钱新宇 2 mēneši atpakaļ
vecāks
revīzija
b94997b177

+ 67 - 65
pages/activity/lottery.vue

@@ -63,7 +63,7 @@
           <view class="radio_label">
             <image
               class="radio_icon"
-              :src="item.id == checkedAddr.id ? 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radioed.png' : 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radio.png'"
+              :src="item.id == checkedAddr?.id ? 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radioed.png' : 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radio.png'"
             ></image>
           </view>
           <view class="contact_user">
@@ -92,14 +92,14 @@
 </template>
 
 <script>
-import FollowPopup from "@/components/FollowPopup/FollowPopup.vue";
+import FollowPopup from '@/components/FollowPopup/FollowPopup.vue';
 export default {
   components: {
     FollowPopup,
   },
   data() {
     return {
-      height: "",
+      height: '',
       // 奖项列表,
       prizeList: [],
       // 中奖记录
@@ -109,14 +109,14 @@ export default {
       // 抽奖信息
       lotteryInfo: {
         id: 0,
-        name: "",
-        logo: "",
-        number: "0",
-        start_date: "",
-        end_date: "",
-        start_time: "",
-        end_time: "",
-        rule: "",
+        name: '',
+        logo: '',
+        number: '0',
+        start_date: '',
+        end_date: '',
+        start_time: '',
+        end_time: '',
+        rule: '',
       },
       recordId: 0,
       // 请求参数
@@ -124,6 +124,7 @@ export default {
         id: 0,
         activity_id: 0,
       },
+      checkedAddr: {},
     };
   },
   onLoad(param) {
@@ -140,9 +141,9 @@ export default {
     // 窗口信息
     var sysinfo = uni.getWindowInfo();
     // 获取屏幕可用高度
-    this.height = "height:" + sysinfo.windowHeight + "px;";
+    this.height = 'height:' + sysinfo.windowHeight + 'px;';
     // 监听地址变动
-    uni.$on("addr_list_change", (data) => {
+    uni.$on('addr_list_change', (data) => {
       // 地址列表
       this.addrList = data.list;
     });
@@ -150,7 +151,7 @@ export default {
     //分享按钮
     uni.showShareMenu({
       withShareTicket: true,
-      menus: ["shareAppMessage", "shareTimeline"],
+      menus: ['shareAppMessage', 'shareTimeline'],
     });
     // #endif
   },
@@ -159,16 +160,16 @@ export default {
       this.shareRequest();
     }
     return {
-      title: "999智控终端平台\n正月十五猜灯谜",
-      path: "/pages/activity/index?id=" + this.requestParam.activity_id,
-      imageUrl: "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/20250210-143021.jpg",
+      title: '999智控终端平台\n正月十五猜灯谜',
+      path: '/pages/activity/index?id=' + this.requestParam.activity_id,
+      imageUrl: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/20250210-143021.jpg',
       promise: new Promise((resolve, reject) => {
-        this.$http.request("api/share_message/get_item", { item_id: this.requestParam.activity_id, pages: "/pages/activity/index" }).then((callback) => {
-          console.log(callback, "api/share_message/get_item");
+        this.$http.request('api/share_message/get_item', { item_id: this.requestParam.activity_id, pages: '/pages/activity/index' }).then((callback) => {
+          console.log(callback, 'api/share_message/get_item');
           let obj = {
-            title: callback.data?.title == "" ? this.lotteryInfo.name : callback.data.title,
-            path: "/pages/activity/index?id=" + this.requestParam.activity_id,
-            imageUrl: callback.data?.image_url == "" ? this.lotteryInfo.logo : callback.data.image_url,
+            title: callback.data?.title == '' ? this.lotteryInfo.name : callback.data.title,
+            path: '/pages/activity/index?id=' + this.requestParam.activity_id,
+            imageUrl: callback.data?.image_url == '' ? this.lotteryInfo.logo : callback.data.image_url,
           };
           resolve(obj);
         });
@@ -185,15 +186,15 @@ export default {
       // 设置请求中
       this.isReqing = true;
       // 请求
-      this.$http.request("api/lottery_riddle/get_detail", this.requestParam).then((re) => {
+      this.$http.request('api/lottery_riddle/get_detail', this.requestParam).then((re) => {
         // 设置非请求中
         this.isReqing = false;
         // 成功结果
-        if (re.code == "success") {
+        if (re.code == 'success') {
           this.lotteryInfo = re.data;
           this.prizeList = re.data.reward_list;
         } else {
-          if (re.code != "no_login") {
+          if (re.code != 'no_login') {
             uni.showModal({
               content: re.msg,
               showCancel: false,
@@ -203,22 +204,22 @@ export default {
       });
     } else {
       uni.showModal({
-        content: "未知的活动ID",
+        content: '未知的活动ID',
         showCancel: false,
       });
     }
   },
   methods: {
     shareRequest() {
-      this.$http.request("api/riddle_active_share/add", { active_id: this.requestParam.activity_id }).then((response) => {
+      this.$http.request('api/riddle_active_share/add', { active_id: this.requestParam.activity_id }).then((response) => {
         uni.showModal({
-          title: "分享成功",
-          confirmText: "立即答题",
-          cancelText: "留在此页",
+          title: '分享成功',
+          confirmText: '立即答题',
+          cancelText: '留在此页',
           success: (res) => {
             if (res.confirm) {
               uni.redirectTo({
-                url: "/pages/activity/index?id=" + this.requestParam.activity_id,
+                url: '/pages/activity/index?id=' + this.requestParam.activity_id,
               });
             }
           },
@@ -231,8 +232,8 @@ export default {
       let prize = this.prizeList[index];
       // 结果
       uni.showModal({
-        title: prize.id == 0 ? "很遗憾" : "恭喜您",
-        content: (prize.id != 0 ? `获得` : "") + prize.name + (prize.reward_type == 5 ? ",请在中奖记录中填写收货地址" : ""),
+        title: prize.id == 0 ? '很遗憾' : '恭喜您',
+        content: (prize.id != 0 ? `获得` : '') + prize.name + (prize.reward_type == 5 ? ',请在中奖记录中填写收货地址' : ''),
         showCancel: false,
         success: (re) => {
           if (re.confirm && prize.reward_type == 5) {
@@ -246,47 +247,47 @@ export default {
       // 活动是否开始
       if (!this.lotteryInfo.id) {
         uni.showToast({
-          title: "暂无可参与活动",
-          icon: "none",
+          title: '暂无可参与活动',
+          icon: 'none',
         });
         return;
       }
       // 活动是否开始
       if (this.lotteryInfo.start_time * 1000 > new Date().getTime()) {
         uni.showToast({
-          title: "活动还没开始哦",
-          icon: "none",
+          title: '活动还没开始哦',
+          icon: 'none',
         });
         return;
       }
       // 活动是否结束
       if (this.lotteryInfo.end_time * 1000 <= new Date().getTime()) {
         uni.showToast({
-          title: "活动已结束了哦",
-          icon: "none",
+          title: '活动已结束了哦',
+          icon: 'none',
         });
         return;
       }
       // 次数已用完了
       if (this.lotteryInfo.number <= 0) {
         uni.showToast({
-          title: "次数已用完了",
-          icon: "none",
+          title: '次数已用完了',
+          icon: 'none',
         });
         return;
       }
       if (!this.$checkAccess.getHasFollow()) {
-        this.$refs.addFollow.open("center");
+        this.$refs.addFollow.open('center');
         return;
       }
       // 次数操作
       this.lotteryInfo.number = this.lotteryInfo.number - 1;
       // 请求列表
-      this.$http.request("/api/lottery_riddle/get_reward", { lottery_id: this.lotteryInfo.id }).then((re) => {
+      this.$http.request('/api/lottery_riddle/get_reward', { lottery_id: this.lotteryInfo.id }).then((re) => {
         // 设置非请求中
         this.isReqing = false;
         // 成功结果
-        if (re.code == "success") {
+        if (re.code == 'success') {
           // 奖品列表更新
           this.prizeList = re.data.reward_list;
           // 奖品的索引
@@ -294,7 +295,7 @@ export default {
         } else {
           uni.showToast({
             title: re.msg,
-            icon: "none",
+            icon: 'none',
           });
           return;
         }
@@ -304,7 +305,7 @@ export default {
       this.$refs.addFollow.close();
     },
     showRule() {
-      this.$refs.lotteryRule.open("center");
+      this.$refs.lotteryRule.open('center');
     },
     closeRule() {
       this.$refs.lotteryRule.close();
@@ -313,21 +314,22 @@ export default {
       // 活动是否开始
       if (this.lotteryInfo.id) {
         // 请求列表
-        this.$http.request("/api/lottery_riddle_record/get_list", { lottery_id: this.lotteryInfo.id }).then((re) => {
+        this.$http.request('/api/lottery_riddle_record/get_list', { lottery_id: this.lotteryInfo.id }).then((re) => {
           // 设置非请求中
           this.isReqing = false;
           // 成功结果
-          if (re.code == "success") {
+          if (re.code == 'success') {
             this.recordList = re.data;
           }
         });
       }
-      this.$refs.lotteryRecord.open("bottom");
+      this.$refs.lotteryRecord.open('bottom');
     },
     closeRecord() {
       this.$refs.lotteryRecord.close();
     },
     openAddr(index) {
+      console.log(index, 'test');
       // 选择的下标
       this.recordIndex = index;
       // 地址列表
@@ -336,20 +338,20 @@ export default {
     // 选择地址
     checkedAddrItem(item) {
       // 判断数据
-      this.$http.request("api/lottery_riddle_record/set_addr", { id: this.recordList[this.recordIndex].id, addr_id: item.id }, "post").then((callback) => {
+      this.$http.request('api/lottery_riddle_record/set_addr', { id: this.recordList[this.recordIndex].id, addr_id: item.id }, 'post').then((callback) => {
         // 获取成功
-        if (callback.code == "success") {
+        if (callback.code == 'success') {
           this.recordList[this.recordIndex].status = 1;
-          this.recordList[this.recordIndex].state = "进行中";
+          this.recordList[this.recordIndex].state = '进行中';
         }
         this.$refs.addrPopup.close();
       });
     },
     getAddrList(showPopup = false) {
       // 判断数据
-      this.$http.request("api/custom_addr/get_list").then((callback) => {
+      this.$http.request('api/custom_addr/get_list').then((callback) => {
         // 获取成功
-        if (callback.code == "success") {
+        if (callback.code == 'success') {
           this.addrList = callback.data;
           // 如果有的话
           if (this.addrList.length) {
@@ -359,12 +361,12 @@ export default {
               if (this.addrList[i].is_default) this.checkedAddr = this.addrList[i];
             }
             // 如果没有默认的话
-            if (!this.checkedAddr.id) {
+            if (!this.checkedAddr?.id) {
               this.checkedAddr = this.addrList[this.addrList.length - 1];
             }
           }
           // 弹出地址层
-          if (showPopup) this.$refs.addrPopup.open("bottom");
+          if (showPopup) this.$refs.addrPopup.open('bottom');
         }
       });
     },
@@ -591,16 +593,16 @@ export default {
       }
       .reward_state {
         float: right;
-		color: #deb887;
-		display: block;
-		font-size: 26rpx;
-		overflow: hidden;
-		background: transparent;
+        color: #deb887;
+        display: block;
+        font-size: 26rpx;
+        overflow: hidden;
+        background: transparent;
+      }
+      .reward_state::after {
+        border: none;
+        background: transparent;
       }
-	  .reward_state::after{
-		  border: none;
-		  background: transparent;
-	  }
     }
   }
 }

+ 49 - 48
pages/orders/lottery.vue

@@ -85,7 +85,7 @@
 export default {
   data() {
     return {
-      height: "",
+      height: '',
       // 奖项列表,
       prizeList: [],
       // 中奖记录
@@ -95,20 +95,21 @@ export default {
       // 抽奖信息
       lotteryInfo: {
         id: 0,
-        name: "",
-        logo: "",
-        join_num: "0",
-        start_date: "",
-        end_date: "",
-        start_time: "",
-        end_time: "",
-        rule: "",
+        name: '',
+        logo: '',
+        join_num: '0',
+        start_date: '',
+        end_date: '',
+        start_time: '',
+        end_time: '',
+        rule: '',
       },
       recordId: 0,
       // 请求参数
       requestParam: {
         id: 0,
       },
+      checkedAddr: {},
     };
   },
   onLoad(param) {
@@ -124,9 +125,9 @@ export default {
     // 窗口信息
     var sysinfo = uni.getWindowInfo();
     // 获取屏幕可用高度
-    this.height = "height:" + sysinfo.windowHeight + "px;";
+    this.height = 'height:' + sysinfo.windowHeight + 'px;';
     // 监听地址变动
-    uni.$on("addr_list_change", (data) => {
+    uni.$on('addr_list_change', (data) => {
       // 地址列表
       this.addrList = data.list;
     });
@@ -134,14 +135,14 @@ export default {
     //分享按钮
     uni.showShareMenu({
       withShareTicket: true,
-      menus: ["shareAppMessage", "shareTimeline"],
+      menus: ['shareAppMessage', 'shareTimeline'],
     });
     // #endif
   },
   onShareAppMessage(obj) {
     return {
       title: `999智控终端平台\n${this.activeInfo.name}`,
-      path: "/pages/orders/lottery?id=" + this.requestParam.id,
+      path: '/pages/orders/lottery?id=' + this.requestParam.id,
     };
   },
   onShow() {
@@ -154,15 +155,15 @@ export default {
       // 设置请求中
       this.isReqing = true;
       // 请求
-      this.$http.request("api/lottery_order/get_detail", this.requestParam).then((re) => {
+      this.$http.request('api/lottery_order/get_detail', this.requestParam).then((re) => {
         // 设置非请求中
         this.isReqing = false;
         // 成功结果
-        if (re.code == "success") {
+        if (re.code == 'success') {
           this.lotteryInfo = re.data;
           this.prizeList = re.data.reward_list;
         } else {
-          if (re.code != "no_login") {
+          if (re.code != 'no_login') {
             uni.showModal({
               content: re.msg,
               showCancel: false,
@@ -172,7 +173,7 @@ export default {
       });
     } else {
       uni.showModal({
-        content: "未知的活动ID",
+        content: '未知的活动ID',
         showCancel: false,
       });
     }
@@ -183,8 +184,8 @@ export default {
       let prize = this.prizeList[index];
       // 结果
       uni.showModal({
-        title: prize.id == 0 ? "很遗憾" : "恭喜您",
-        content: (prize.id != 0 ? `获得` : "") + prize.name + (prize.reward_type == 5 ? ",请在中奖记录中填写收货地址" : ""),
+        title: prize.id == 0 ? '很遗憾' : '恭喜您',
+        content: (prize.id != 0 ? `获得` : '') + prize.name + (prize.reward_type == 5 ? ',请在中奖记录中填写收货地址' : ''),
         showCancel: false,
         success: (re) => {
           if (re.confirm && prize.reward_type == 5) {
@@ -198,43 +199,43 @@ export default {
       // 活动是否开始
       if (!this.lotteryInfo.id) {
         uni.showToast({
-          title: "暂无可参与活动",
-          icon: "none",
+          title: '暂无可参与活动',
+          icon: 'none',
         });
         return;
       }
       // 活动是否开始
       if (this.lotteryInfo.start_time * 1000 > new Date().getTime()) {
         uni.showToast({
-          title: "活动还没开始哦",
-          icon: "none",
+          title: '活动还没开始哦',
+          icon: 'none',
         });
         return;
       }
       // 活动是否结束
       if (this.lotteryInfo.end_time * 1000 <= new Date().getTime()) {
         uni.showToast({
-          title: "活动已结束了哦",
-          icon: "none",
+          title: '活动已结束了哦',
+          icon: 'none',
         });
         return;
       }
       // 次数已用完了
       if (this.lotteryInfo.join_num <= 0) {
         uni.showToast({
-          title: "次数已用完了",
-          icon: "none",
+          title: '次数已用完了',
+          icon: 'none',
         });
         return;
       }
       // 次数操作
       this.lotteryInfo.join_num = this.lotteryInfo.join_num - 1;
       // 请求列表
-      this.$http.request("/api/lottery_order/get_reward", { lottery_id: this.lotteryInfo.id }).then((re) => {
+      this.$http.request('/api/lottery_order/get_reward', { lottery_id: this.lotteryInfo.id }).then((re) => {
         // 设置非请求中
         this.isReqing = false;
         // 成功结果
-        if (re.code == "success") {
+        if (re.code == 'success') {
           // 奖品列表更新
           this.prizeList = re.data.reward_list;
           // 奖品的索引
@@ -242,14 +243,14 @@ export default {
         } else {
           uni.showToast({
             title: re.msg,
-            icon: "none",
+            icon: 'none',
           });
           return;
         }
       });
     },
     showRule() {
-      this.$refs.lotteryRule.open("center");
+      this.$refs.lotteryRule.open('center');
     },
     closeRule() {
       this.$refs.lotteryRule.close();
@@ -258,16 +259,16 @@ export default {
       // 活动是否开始
       if (this.lotteryInfo.id) {
         // 请求列表
-        this.$http.request("/api/lottery_order_record/get_list", { lottery_id: this.lotteryInfo.id }).then((re) => {
+        this.$http.request('/api/lottery_order_record/get_list', { lottery_id: this.lotteryInfo.id }).then((re) => {
           // 设置非请求中
           this.isReqing = false;
           // 成功结果
-          if (re.code == "success") {
+          if (re.code == 'success') {
             this.recordList = re.data;
           }
         });
       }
-      this.$refs.lotteryRecord.open("bottom");
+      this.$refs.lotteryRecord.open('bottom');
     },
     closeRecord() {
       this.$refs.lotteryRecord.close();
@@ -281,20 +282,20 @@ export default {
     // 选择地址
     checkedAddrItem(item) {
       // 判断数据
-      this.$http.request("api/lottery_order_record/set_addr", { id: this.recordList[this.recordIndex].id, addr_id: item.id }, "post").then((callback) => {
+      this.$http.request('api/lottery_order_record/set_addr', { id: this.recordList[this.recordIndex].id, addr_id: item.id }, 'post').then((callback) => {
         // 获取成功
-        if (callback.code == "success") {
+        if (callback.code == 'success') {
           this.recordList[this.recordIndex].status = 1;
-          this.recordList[this.recordIndex].state = "进行中";
+          this.recordList[this.recordIndex].state = '进行中';
         }
         this.$refs.addrPopup.close();
       });
     },
     getAddrList(showPopup = false) {
       // 判断数据
-      this.$http.request("api/custom_addr/get_list").then((callback) => {
+      this.$http.request('api/custom_addr/get_list').then((callback) => {
         // 获取成功
-        if (callback.code == "success") {
+        if (callback.code == 'success') {
           this.addrList = callback.data;
           // 如果有的话
           if (this.addrList.length) {
@@ -309,7 +310,7 @@ export default {
             }
           }
           // 弹出地址层
-          if (showPopup) this.$refs.addrPopup.open("bottom");
+          if (showPopup) this.$refs.addrPopup.open('bottom');
         }
       });
     },
@@ -524,15 +525,15 @@ export default {
       }
       .reward_state {
         float: right;
-		color: #deb887;
-		display: block;
-		font-size: 26rpx;
-		overflow: hidden;
-		background: transparent;
+        color: #deb887;
+        display: block;
+        font-size: 26rpx;
+        overflow: hidden;
+        background: transparent;
       }
-      .reward_state::after{
-		border: none;
-		background: transparent;
+      .reward_state::after {
+        border: none;
+        background: transparent;
       }
     }
   }

+ 63 - 62
pages/recruitment/lottery.vue

@@ -92,14 +92,14 @@
 </template>
 
 <script>
-import FollowPopup from "@/components/FollowPopup/FollowPopup.vue";
+import FollowPopup from '@/components/FollowPopup/FollowPopup.vue';
 export default {
   components: {
     FollowPopup,
   },
   data() {
     return {
-      height: "",
+      height: '',
       // 奖项列表,
       prizeList: [],
       // 中奖记录
@@ -109,14 +109,14 @@ export default {
       // 抽奖信息
       lotteryInfo: {
         id: 0,
-        name: "",
-        logo: "",
-        number: "0",
-        start_date: "",
-        end_date: "",
-        start_time: "",
-        end_time: "",
-        rule: "",
+        name: '',
+        logo: '',
+        number: '0',
+        start_date: '',
+        end_date: '',
+        start_time: '',
+        end_time: '',
+        rule: '',
       },
       recordId: 0,
       // 请求参数
@@ -124,13 +124,14 @@ export default {
         id: 0,
         activity_id: 0,
       },
+      checkedAddr: {},
     };
   },
   onLoad(param) {
     //未登陆提醒用户登陆
     try {
       // 接收参数
-      console.log(param, "onload  param");
+      console.log(param, 'onload  param');
 
       this.requestParam.id = param.id;
       this.requestParam.activity_id = param.activity_id;
@@ -144,9 +145,9 @@ export default {
       // 窗口信息
       var sysinfo = uni.getWindowInfo();
       // 获取屏幕可用高度
-      this.height = "height:" + sysinfo.windowHeight + "px;";
+      this.height = 'height:' + sysinfo.windowHeight + 'px;';
       // 监听地址变动
-      uni.$on("addr_list_change", (data) => {
+      uni.$on('addr_list_change', (data) => {
         // 地址列表
         this.addrList = data.list;
       });
@@ -154,7 +155,7 @@ export default {
       //分享按钮
       uni.showShareMenu({
         withShareTicket: true,
-        menus: ["shareAppMessage", "shareTimeline"],
+        menus: ['shareAppMessage', 'shareTimeline'],
       });
       // #endif
     } catch (e) {
@@ -166,16 +167,16 @@ export default {
     //   this.shareRequest();
     // }
     return {
-      title: "999智控终端平台\n新人抽奖",
+      title: '999智控终端平台\n新人抽奖',
       path: `/pages/recruitment/lottery?id=${this.requestParam.id}&activity_id=${this.requestParam.activity_id}`,
-      imageUrl: "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/20250210-143021.jpg",
+      imageUrl: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/20250210-143021.jpg',
       promise: new Promise((resolve, reject) => {
-        this.$http.request("api/share_message/get_item", { item_id: this.requestParam.activity_id, pages: "/pages/recruitment/lottery" }).then((callback) => {
-          console.log(callback, "api/share_message/get_item");
+        this.$http.request('api/share_message/get_item', { item_id: this.requestParam.activity_id, pages: '/pages/recruitment/lottery' }).then((callback) => {
+          console.log(callback, 'api/share_message/get_item');
           let obj = {
-            title: callback.data?.title == "" ? this.lotteryInfo.name : callback.data.title,
-            path: "/pages/activity/index?id=" + this.requestParam.activity_id,
-            imageUrl: callback.data?.image_url == "" ? this.lotteryInfo.logo : callback.data.image_url,
+            title: callback.data?.title == '' ? this.lotteryInfo.name : callback.data.title,
+            path: '/pages/activity/index?id=' + this.requestParam.activity_id,
+            imageUrl: callback.data?.image_url == '' ? this.lotteryInfo.logo : callback.data.image_url,
           };
           resolve(obj);
         });
@@ -183,14 +184,14 @@ export default {
     };
   },
   onShow() {
-    console.log(this.requestParam, "onshow  requestParam");
+    console.log(this.requestParam, 'onshow  requestParam');
 
     if (!this.$checkAccess.checkLogin()) {
       uni.showModal({
-        title: "温馨提示",
-        content: "请先登录",
-        confirmText: "去登录",
-        cancelText: "取消",
+        title: '温馨提示',
+        content: '请先登录',
+        confirmText: '去登录',
+        cancelText: '取消',
         success: (res) => {
           if (res.confirm) {
             uni.redirectTo({
@@ -210,15 +211,15 @@ export default {
       // 设置请求中
       this.isReqing = true;
       // 请求
-      this.$http.request("api/lottery_recruitment/get_detail", this.requestParam).then((re) => {
+      this.$http.request('api/lottery_recruitment/get_detail', this.requestParam).then((re) => {
         // 设置非请求中
         this.isReqing = false;
         // 成功结果
-        if (re.code == "success") {
+        if (re.code == 'success') {
           this.lotteryInfo = re.data;
           this.prizeList = re.data.reward_list;
         } else {
-          if (re.code != "no_login") {
+          if (re.code != 'no_login') {
             uni.showModal({
               content: re.msg,
               showCancel: false,
@@ -228,7 +229,7 @@ export default {
       });
     } else {
       uni.showModal({
-        content: "未知的活动ID",
+        content: '未知的活动ID',
         showCancel: false,
       });
     }
@@ -256,8 +257,8 @@ export default {
       let prize = this.prizeList[index];
       // 结果
       uni.showModal({
-        title: prize.id == 0 ? "很遗憾" : "恭喜您",
-        content: (prize.id != 0 ? `获得` : "") + prize.name + (prize.reward_type == 5 ? ",请在中奖记录中填写收货地址" : ""),
+        title: prize.id == 0 ? '很遗憾' : '恭喜您',
+        content: (prize.id != 0 ? `获得` : '') + prize.name + (prize.reward_type == 5 ? ',请在中奖记录中填写收货地址' : ''),
         showCancel: false,
         success: (re) => {
           if (re.confirm && prize.reward_type == 5) {
@@ -271,47 +272,47 @@ export default {
       // 活动是否开始
       if (!this.lotteryInfo.id) {
         uni.showToast({
-          title: "暂无可参与活动",
-          icon: "none",
+          title: '暂无可参与活动',
+          icon: 'none',
         });
         return;
       }
       // 活动是否开始
       if (this.lotteryInfo.start_time * 1000 > new Date().getTime()) {
         uni.showToast({
-          title: "活动还没开始哦",
-          icon: "none",
+          title: '活动还没开始哦',
+          icon: 'none',
         });
         return;
       }
       // 活动是否结束
       if (this.lotteryInfo.end_time * 1000 <= new Date().getTime()) {
         uni.showToast({
-          title: "活动已结束了哦",
-          icon: "none",
+          title: '活动已结束了哦',
+          icon: 'none',
         });
         return;
       }
       // 次数已用完了
       if (this.lotteryInfo.number <= 0) {
         uni.showToast({
-          title: "次数已用完了",
-          icon: "none",
+          title: '次数已用完了',
+          icon: 'none',
         });
         return;
       }
       if (!this.$checkAccess.getHasFollow()) {
-        this.$refs.addFollow.open("center");
+        this.$refs.addFollow.open('center');
         return;
       }
       // 次数操作
       this.lotteryInfo.number = this.lotteryInfo.number - 1;
       // 请求列表
-      this.$http.request("/api/lottery_recruitment/get_reward", { lottery_id: this.lotteryInfo.id }).then((re) => {
+      this.$http.request('/api/lottery_recruitment/get_reward', { lottery_id: this.lotteryInfo.id }).then((re) => {
         // 设置非请求中
         this.isReqing = false;
         // 成功结果
-        if (re.code == "success") {
+        if (re.code == 'success') {
           // 奖品列表更新
           this.prizeList = re.data.reward_list;
           // 奖品的索引
@@ -319,7 +320,7 @@ export default {
         } else {
           uni.showToast({
             title: re.msg,
-            icon: "none",
+            icon: 'none',
           });
           return;
         }
@@ -329,7 +330,7 @@ export default {
       this.$refs.addFollow.close();
     },
     showRule() {
-      this.$refs.lotteryRule.open("center");
+      this.$refs.lotteryRule.open('center');
     },
     closeRule() {
       this.$refs.lotteryRule.close();
@@ -338,16 +339,16 @@ export default {
       // 活动是否开始
       if (this.lotteryInfo.id) {
         // 请求列表
-        this.$http.request("/api/lottery_recruitment_record/get_list", { lottery_id: this.lotteryInfo.id }).then((re) => {
+        this.$http.request('/api/lottery_recruitment_record/get_list', { lottery_id: this.lotteryInfo.id }).then((re) => {
           // 设置非请求中
           this.isReqing = false;
           // 成功结果
-          if (re.code == "success") {
+          if (re.code == 'success') {
             this.recordList = re.data;
           }
         });
       }
-      this.$refs.lotteryRecord.open("bottom");
+      this.$refs.lotteryRecord.open('bottom');
     },
     closeRecord() {
       this.$refs.lotteryRecord.close();
@@ -361,20 +362,20 @@ export default {
     // 选择地址
     checkedAddrItem(item) {
       // 判断数据
-      this.$http.request("api/lottery_recruitment_record/set_addr", { id: this.recordList[this.recordIndex].id, addr_id: item.id }, "post").then((callback) => {
+      this.$http.request('api/lottery_recruitment_record/set_addr', { id: this.recordList[this.recordIndex].id, addr_id: item.id }, 'post').then((callback) => {
         // 获取成功
-        if (callback.code == "success") {
+        if (callback.code == 'success') {
           this.recordList[this.recordIndex].status = 1;
-          this.recordList[this.recordIndex].state = "进行中";
+          this.recordList[this.recordIndex].state = '进行中';
         }
         this.$refs.addrPopup.close();
       });
     },
     getAddrList(showPopup = false) {
       // 判断数据
-      this.$http.request("api/custom_addr/get_list").then((callback) => {
+      this.$http.request('api/custom_addr/get_list').then((callback) => {
         // 获取成功
-        if (callback.code == "success") {
+        if (callback.code == 'success') {
           this.addrList = callback.data;
           // 如果有的话
           if (this.addrList.length) {
@@ -389,7 +390,7 @@ export default {
             }
           }
           // 弹出地址层
-          if (showPopup) this.$refs.addrPopup.open("bottom");
+          if (showPopup) this.$refs.addrPopup.open('bottom');
         }
       });
     },
@@ -616,15 +617,15 @@ export default {
       }
       .reward_state {
         float: right;
-		color: #deb887;
-		display: block;
-		font-size: 26rpx;
-		overflow: hidden;
-		background: transparent;
+        color: #deb887;
+        display: block;
+        font-size: 26rpx;
+        overflow: hidden;
+        background: transparent;
       }
-      .reward_state::after{
-      	border: none;
-      	background: transparent;
+      .reward_state::after {
+        border: none;
+        background: transparent;
       }
     }
   }

+ 1 - 0
pages/recruitment/lottery_new.vue

@@ -117,6 +117,7 @@ export default {
         5: 'goods',
         6: 'others',
       },
+      checkedAddr: {},
     };
   },
   onLoad(param) {

+ 56 - 55
pages/score/lottery.vue

@@ -86,7 +86,7 @@
 export default {
   data() {
     return {
-      height: "",
+      height: '',
       // 奖项列表,
       prizeList: [],
       // 中奖记录
@@ -96,14 +96,14 @@ export default {
       // 抽奖信息
       lotteryInfo: {
         id: 0,
-        name: "",
-        logo: "",
-        need_score: "",
-        start_date: "",
-        end_date: "",
-        start_time: "",
-        end_time: "",
-        rule: "",
+        name: '',
+        logo: '',
+        need_score: '',
+        start_date: '',
+        end_date: '',
+        start_time: '',
+        end_time: '',
+        rule: '',
       },
       // 积分信息
       scoreInfo: {
@@ -118,15 +118,16 @@ export default {
         wait_score: 0,
       },
       recordId: 0,
+      checkedAddr: {},
     };
   },
   onLoad() {
     // 窗口信息
     var sysinfo = uni.getWindowInfo();
     // 获取屏幕可用高度
-    this.height = "height:" + sysinfo.windowHeight + "px;";
+    this.height = 'height:' + sysinfo.windowHeight + 'px;';
     // 监听地址变动
-    uni.$on("addr_list_change", (data) => {
+    uni.$on('addr_list_change', (data) => {
       // 地址列表
       this.addrList = data.list;
     });
@@ -134,24 +135,24 @@ export default {
     //分享按钮
     uni.showShareMenu({
       withShareTicket: true,
-      menus: ["shareAppMessage", "shareTimeline"],
+      menus: ['shareAppMessage', 'shareTimeline'],
     });
     // #endif
   },
   onShareAppMessage(obj) {
     // 返回分享信息
     return {
-      title: "999智控终端平台\n药优惠 得积分 兑豪礼",
-      path: "/pages/score/lottery",
-      imageUrl: "",
+      title: '999智控终端平台\n药优惠 得积分 兑豪礼',
+      path: '/pages/score/lottery',
+      imageUrl: '',
       promise: new Promise((resolve, reject) => {
-        this.$http.request("api/share_message/get_item", { item_id: this.lotteryInfo.id, pages: "/pages/score/lottery" }).then((callback) => {
-          console.log(callback, "api/share_message/get_item");
+        this.$http.request('api/share_message/get_item', { item_id: this.lotteryInfo.id, pages: '/pages/score/lottery' }).then((callback) => {
+          console.log(callback, 'api/share_message/get_item');
           let obj = {
-            title: callback.data?.title == "" ? "999智控终端平台\n药优惠 得积分 兑豪礼" : callback.data.title,
-            path: "/pages/score/lottery",
+            title: callback.data?.title == '' ? '999智控终端平台\n药优惠 得积分 兑豪礼' : callback.data.title,
+            path: '/pages/score/lottery',
           };
-          if (callback.data?.image_url !== "") {
+          if (callback.data?.image_url !== '') {
             obj.imageUrl = callback.data.image_url;
           }
           resolve(obj);
@@ -167,21 +168,21 @@ export default {
     // 设置请求中
     this.isReqing = true;
     // 请求
-    this.$http.request("api/lottery_score/get_detail").then((re) => {
+    this.$http.request('api/lottery_score/get_detail').then((re) => {
       // 设置非请求中
       this.isReqing = false;
       // 成功结果
-      if (re.code == "success") {
+      if (re.code == 'success') {
         this.lotteryInfo = re.data;
         this.prizeList = re.data.reward_list;
       }
     });
     // 请求列表
-    this.$http.request("/api/custom_score/get_info", {}).then((re) => {
+    this.$http.request('/api/custom_score/get_info', {}).then((re) => {
       // 设置非请求中
       this.isReqing = false;
       // 成功结果
-      if (re.code == "success") {
+      if (re.code == 'success') {
         this.scoreInfo = re.data;
         this.newScore = re.data;
       }
@@ -194,8 +195,8 @@ export default {
       // 如果是实物
       this.scoreInfo = this.newScore;
       uni.showModal({
-        title: prize.id == 0 ? "很遗憾" : "恭喜您",
-        content: (prize.id != 0 ? `获得` : "") + prize.name + (prize.reward_type == 5 ? ",请在中奖记录中填写收货地址" : ""),
+        title: prize.id == 0 ? '很遗憾' : '恭喜您',
+        content: (prize.id != 0 ? `获得` : '') + prize.name + (prize.reward_type == 5 ? ',请在中奖记录中填写收货地址' : ''),
         showCancel: false,
         success: (re) => {
           if (re.confirm && prize.reward_type == 5) {
@@ -209,43 +210,43 @@ export default {
       // 活动是否开始
       if (!this.lotteryInfo.id) {
         uni.showToast({
-          title: "暂无可参与活动",
-          icon: "none",
+          title: '暂无可参与活动',
+          icon: 'none',
         });
         return;
       }
       // 活动是否开始
       if (this.lotteryInfo.start_time * 1000 > new Date().getTime()) {
         uni.showToast({
-          title: "活动还没开始哦",
-          icon: "none",
+          title: '活动还没开始哦',
+          icon: 'none',
         });
         return;
       }
       // 活动是否结束
       if (this.lotteryInfo.end_time * 1000 <= new Date().getTime()) {
         uni.showToast({
-          title: "活动已结束了哦",
-          icon: "none",
+          title: '活动已结束了哦',
+          icon: 'none',
         });
         return;
       }
       // 积分不足
       if (this.scoreInfo.score < this.lotteryInfo.need_score) {
         uni.showToast({
-          title: "积分不足",
-          icon: "none",
+          title: '积分不足',
+          icon: 'none',
         });
         return;
       }
       // 积分操作
       this.scoreInfo.score = this.scoreInfo.score - this.lotteryInfo.need_score;
       // 请求列表
-      this.$http.request("/api/lottery_score/get_reward", { lottery_id: this.lotteryInfo.id }).then((re) => {
+      this.$http.request('/api/lottery_score/get_reward', { lottery_id: this.lotteryInfo.id }).then((re) => {
         // 设置非请求中
         this.isReqing = false;
         // 成功结果
-        if (re.code == "success") {
+        if (re.code == 'success') {
           // 奖品列表更新
           this.prizeList = re.data.reward_list;
           this.newScore = re.data.custom_score;
@@ -254,7 +255,7 @@ export default {
         } else {
           uni.showToast({
             title: re.msg,
-            icon: "none",
+            icon: 'none',
           });
           // 积分操作
           this.scoreInfo.score = this.scoreInfo.score + this.lotteryInfo.need_score;
@@ -263,7 +264,7 @@ export default {
       });
     },
     showRule() {
-      this.$refs.lotteryRule.open("center");
+      this.$refs.lotteryRule.open('center');
     },
     closeRule() {
       this.$refs.lotteryRule.close();
@@ -272,16 +273,16 @@ export default {
       // 活动是否开始
       if (this.lotteryInfo.id) {
         // 请求列表
-        this.$http.request("/api/lottery_score_record/get_list", { lottery_id: this.lotteryInfo.id }).then((re) => {
+        this.$http.request('/api/lottery_score_record/get_list', { lottery_id: this.lotteryInfo.id }).then((re) => {
           // 设置非请求中
           this.isReqing = false;
           // 成功结果
-          if (re.code == "success") {
+          if (re.code == 'success') {
             this.recordList = re.data;
           }
         });
       }
-      this.$refs.lotteryRecord.open("bottom");
+      this.$refs.lotteryRecord.open('bottom');
     },
     closeRecord() {
       this.$refs.lotteryRecord.close();
@@ -295,20 +296,20 @@ export default {
     // 选择地址
     checkedAddrItem(item) {
       // 判断数据
-      this.$http.request("api/lottery_score_record/set_addr", { id: this.recordList[this.recordIndex].id, addr_id: item.id }, "post").then((callback) => {
+      this.$http.request('api/lottery_score_record/set_addr', { id: this.recordList[this.recordIndex].id, addr_id: item.id }, 'post').then((callback) => {
         // 获取成功
-        if (callback.code == "success") {
+        if (callback.code == 'success') {
           this.recordList[this.recordIndex].status = 1;
-          this.recordList[this.recordIndex].state = "进行中";
+          this.recordList[this.recordIndex].state = '进行中';
         }
         this.$refs.addrPopup.close();
       });
     },
     getAddrList(showPopup = false) {
       // 判断数据
-      this.$http.request("api/custom_addr/get_list").then((callback) => {
+      this.$http.request('api/custom_addr/get_list').then((callback) => {
         // 获取成功
-        if (callback.code == "success") {
+        if (callback.code == 'success') {
           this.addrList = callback.data;
           // 如果有的话
           if (this.addrList.length) {
@@ -323,7 +324,7 @@ export default {
             }
           }
           // 弹出地址层
-          if (showPopup) this.$refs.addrPopup.open("bottom");
+          if (showPopup) this.$refs.addrPopup.open('bottom');
         }
       });
     },
@@ -536,15 +537,15 @@ export default {
       }
       .reward_state {
         float: right;
-		color: #deb887;
-		display: block;
-		font-size: 26rpx;
-		overflow: hidden;
-		background: transparent;
+        color: #deb887;
+        display: block;
+        font-size: 26rpx;
+        overflow: hidden;
+        background: transparent;
       }
-      .reward_state::after{
-		  border: none;
-		  background: transparent;
+      .reward_state::after {
+        border: none;
+        background: transparent;
       }
     }
   }