xiaohaizhao пре 1 година
родитељ
комит
4654302b2a
5 измењених фајлова са 250 додато и 35 уклоњено
  1. 203 0
      cloud/winningNews/detail.vue
  2. 42 33
      cloud/winningNews/index.vue
  3. 2 0
      pages.json
  4. 1 1
      store/lottery/modules/sudoku.vue
  5. 2 1
      store/lottery/shareable.vue

+ 203 - 0
cloud/winningNews/detail.vue

@@ -0,0 +1,203 @@
+<template>
+    <view>
+        <view class="item">
+            <view class="text">
+                <view class="title u-line-2">{{ detail.awardname || '--' }}</view>
+                <view class="count u-line-1">
+                    <text style="margin-right: 118px">类型:{{ detail.type || '--' }}</text>
+                    <text>金额:{{ CNY(detail.price, '', false) || '--' }}元</text>
+                </view>
+                <view class="count u-line-1">来源:{{ detail.awardheadname || '--' }}</view>
+            </view>
+        </view>
+        <view class="head">
+            收货信息
+        </view>
+
+        <view class="row">
+            <view class="label">
+                姓名
+            </view>
+            <view class="value">
+                {{ detail.name }}
+            </view>
+        </view>
+
+        <view class="row">
+            <view class="label">
+                手机号
+            </view>
+            <view class="value">
+                {{ detail.phonenumber }}
+            </view>
+        </view>
+
+        <view class="row">
+            <view class="label">
+                地址
+            </view>
+            <view class="value">
+                {{ getCity(detail) }}
+            </view>
+        </view>
+
+        <view style="height: 70px;" />
+        <view class="footer">
+            <view class="add" hover-class="navigator-hover" @click="toEdit">
+                编辑收货信息
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            detail: {},
+        }
+    },
+    onLoad(options) {
+        this.detail = JSON.parse(options.data);
+        console.log("options", this.detail)
+    },
+    onUnload() {
+        delete this.$Http.changeItem;
+    },
+    methods: {
+        toEdit() {
+            let that = this;
+            uni.navigateTo({
+                url: '/store/deliveryAddress/index'
+            })
+            that.$Http.selectAddress = (item) => {
+                uni.showModal({
+                    title: '提示',
+                    content: `是否确定选择“${item.address}”作为收货地址?`,
+                    success: (success) => {
+                        if (success.confirm) that.$Http.basic({
+                            id: "2024052910464202",
+                            content: {
+                                sa_awardmxid: that.detail.sa_awardmxid,
+                                name: item.name,
+                                phonenumber: item.phonenumber,
+                                province: item.province,
+                                city: item.city,
+                                county: item.county,
+                                address: item.address,
+                            }
+                        }).then(s => {
+                            if (that.cutoff(s.msg, '设置成功', true, '1000')) return;
+                            that.detail.name = item.name;
+                            that.detail.phonenumber = item.phonenumber;
+                            that.detail.province = item.province;
+                            that.detail.city = item.city;
+                            that.detail.county = item.county;
+                            that.detail.address = item.address;
+                            that.$Http.changeItem && that.$Http.changeItem(that.detail)
+                        })
+                    },
+                })
+            }
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.item {
+    display: flex;
+    width: 355px;
+    border-radius: 5px;
+    overflow: hidden;
+    background: #FFFFFF;
+    padding: 10px;
+    box-sizing: border-box;
+    margin: 10px;
+
+    .text {
+        flex: 1;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+
+        .title {
+            font-weight: bold;
+            font-size: 14px;
+            color: #333333;
+            line-height: 24px;
+        }
+
+        .count {
+            font-size: 12px;
+            color: #999999;
+            line-height: 17px;
+            margin-top: 8px;
+        }
+    }
+
+}
+
+.head {
+    width: 375px;
+    height: 45px;
+    line-height: 45px;
+    padding-left: 10px;
+    box-sizing: border-box;
+    background: #FFFFFF;
+    font-family: PingFang SC, PingFang SC;
+    font-size: 16px;
+    font-weight: bold;
+    color: #333333;
+}
+
+.row {
+    width: 100vw;
+    padding: 10px;
+    background: #fff;
+    box-sizing: border-box;
+
+    .label {
+        line-height: 20px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-size: 14px;
+        color: #666666;
+    }
+
+    .value {
+        width: 355px;
+        line-height: 20px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-size: 14px;
+        color: #000000;
+        margin-top: 10px;
+    }
+}
+
+.footer {
+    position: fixed;
+    bottom: 0;
+    width: 100vw;
+    height: 65px;
+    background: #FFFFFF;
+    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+    box-sizing: border-box;
+    padding: 5px 10px;
+    display: flex;
+
+    .add {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 100%;
+        height: 45px;
+        background: #C30D23;
+        border-radius: 5px;
+        font-family: PingFang SC, PingFang SC;
+        font-size: 14px;
+        color: #FFFFFF;
+    }
+
+    .forbidden {
+        opacity: .6;
+    }
+}
+</style>

+ 42 - 33
cloud/winningNews/index.vue

@@ -1,26 +1,26 @@
 <template>
-    <view>
-      <view class="text-top">
-        <view class="text">奖项</view>
-        <view class="text">共{{total}}个</view>
-      </view>
-        <My_listbox ref="List" @getlist="getList" >
-          <view class="list-box">
-            <navigator class="item" v-for="item in list" :key="item.sa_awardmxid"
-                       url="">
-              <view class="text">
-                <view class="title u-line-2">{{ item.awardname || '--' }}</view>
-                <view class="count u-line-1">
-                  <text style="margin-right: 118px">类型:{{ item.type || '--' }}</text>
-                  <text>金额:{{ CNY(item.price,'',false) || '--' }}元</text>
-                </view>
-                <view class="count u-line-1">来源:{{ item.awardheadname || '--' }}</view>
-              </view>
-            </navigator>
+  <view>
+    <view class="text-top">
+      <view class="text">奖项</view>
+      <view class="text">共{{ total }}个</view>
+    </view>
+    <My_listbox ref="List" @getlist="getList">
+      <view class="list-box">
+        <navigator class="item" v-for="(item, index) in list" :key="item.sa_awardmxid"
+          :url="'/cloud/winningNews/detail?data=' + JSON.stringify(item)" @click="toDetail(index)">
+          <view class="text">
+            <view class="title u-line-2">{{ item.awardname || '--' }}</view>
+            <view class="count u-line-1">
+              <text style="margin-right: 118px">类型:{{ item.type || '--' }}</text>
+              <text>金额:{{ CNY(item.price, '', false) || '--' }}元</text>
+            </view>
+            <view class="count u-line-1">来源:{{ item.awardheadname || '--' }}</view>
           </view>
-        </My_listbox>
+        </navigator>
+      </view>
+    </My_listbox>
 
-    </view>
+  </view>
 </template>
 
 <script>
@@ -28,18 +28,18 @@ export default {
   data() {
     return {
       list: [],
-      total:0,
+      total: 0,
       "content": {
       },
     }
   },
-  onLoad(options){
+  onLoad(options) {
     this.getList(true)
     uni.setNavigationBarTitle({
       title: '我的中奖信息'
     });
   },
-  methods:{
+  methods: {
     getList(init = false) {
       if (this.paging(this.content, init)) return;
       this.$Http.basic({
@@ -54,17 +54,23 @@ export default {
         this.content = this.$refs.List.paging(this.content, res)
       })
     },
+    toDetail(index) {
+      this.$Http.changeItem = function (item) {
+        this.$set(this.list, index, item)
+      }.bind(this)
+    }
   }
 }
 </script>
 
 <style lang="scss">
-.text-top{
+.text-top {
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   padding: 10px;
-  .text{
+
+  .text {
     font-family: Source Han Sans SC, Source Han Sans SC;
     font-weight: 400;
     font-size: 12px;
@@ -76,18 +82,20 @@ export default {
     margin-top: 10px;
   }
 }
+
 .list-box {
   width: 100vw;
   box-sizing: border-box;
 
-    .item {
-      display: flex;
-      width: 100vw;
-      border-radius: 5px;
-      overflow: hidden;
-      margin-top: 10px;
-      background: #FFFFFF;
-      padding: 10px;
+  .item {
+    display: flex;
+    width: 100vw;
+    border-radius: 5px;
+    overflow: hidden;
+    margin-top: 10px;
+    background: #FFFFFF;
+    padding: 10px;
+
     .text {
       flex: 1;
       font-family: Source Han Sans SC, Source Han Sans SC;
@@ -98,6 +106,7 @@ export default {
         color: #333333;
         line-height: 24px;
       }
+
       .count {
         font-size: 12px;
         color: #999999;

+ 2 - 0
pages.json

@@ -104,6 +104,8 @@
 			"path": "subscriptionList/index"
 		}, {
 			"path": "winningNews/index"
+		}, {
+			"path": "winningNews/detail"
 		}, {
 			"path": "contacts/index"
 		}, {

+ 1 - 1
store/lottery/modules/sudoku.vue

@@ -187,7 +187,7 @@ export default {
                                     if (success.confirm) that.$Http.basic({
                                         id: "2024052910464202",
                                         content: {
-                                            sa_awardmxid: item.sa_awardmxid,
+                                            sa_awardmxid: data.sa_awardmxid,
                                             name: item.name,
                                             phonenumber: item.phonenumber,
                                             province: item.province,

+ 2 - 1
store/lottery/shareable.vue

@@ -16,7 +16,8 @@ export default {
         }
     },
     onLoad(options) {
-        this.sa_awardid = options.id || 0;
+        console.log("options", options)
+        this.sa_awardid = options.sa_awardid || 0;
         this.shareuserid = options.userid || 0;
         uni.setNavigationBarTitle({
             title: '活动抽奖'