Commit 85fc30d0c46dea82a8a6d5834733a99ec64b3f40

Authored by 后端研发-苏明海
2 parents 60fe337f 72dc693d

Merge branch 'test' into 'qa'

Test

See merge request !254
pages/giftpack/birthdaygift/birthdaygift.js
@@ -19,7 +19,7 @@ Page({ @@ -19,7 +19,7 @@ Page({
19 getActId: '', 19 getActId: '',
20 getActType: '', 20 getActType: '',
21 giftID: '', 21 giftID: '',
22 - receiveState: '一键全部领取', 22 + receiveState: 0,
23 textTitle: '', 23 textTitle: '',
24 getUrl: '', 24 getUrl: '',
25 noShow: false, 25 noShow: false,
@@ -29,13 +29,11 @@ Page({ @@ -29,13 +29,11 @@ Page({
29 growUpTitle: "", 29 growUpTitle: "",
30 is_sub: 0, //是否重复领取 30 is_sub: 0, //是否重复领取
31 }, 31 },
32 - GetList: function () { 32 + GetList: function() {
33 var th = this; 33 var th = this;
34 var url = "/api/weshop/marketing/giftbag/bound/get"; 34 var url = "/api/weshop/marketing/giftbag/bound/get";
35 - wx.showLoading({  
36 - title: '加载中',  
37 - })  
38 getApp().request.promiseGet(url, { 35 getApp().request.promiseGet(url, {
  36 + isShowLoading: true,
39 data: { 37 data: {
40 "actId": th.data.getActId, //活动id 38 "actId": th.data.getActId, //活动id
41 "actType": 4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 39 "actType": 4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
@@ -44,7 +42,6 @@ Page({ @@ -44,7 +42,6 @@ Page({
44 "userId": d.user_id //用户ID 42 "userId": d.user_id //用户ID
45 } 43 }
46 }).then(res => { 44 }).then(res => {
47 - wx.hideLoading();  
48 if (res.data.code == 0) { 45 if (res.data.code == 0) {
49 if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) { 46 if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) {
50 //礼包内容--礼券 47 //礼包内容--礼券
@@ -93,19 +90,18 @@ Page({ @@ -93,19 +90,18 @@ Page({
93 }) 90 })
94 if (res.data.data.receiveState == 0) { 91 if (res.data.data.receiveState == 0) {
95 th.setData({ 92 th.setData({
96 - receiveState: '一键全部领取' 93 + receiveState: 0
97 }) 94 })
98 } else { 95 } else {
99 th.setData({ 96 th.setData({
100 - receiveState: '已领取' 97 + receiveState: 1
101 }) 98 })
102 } 99 }
103 100
104 if (res.data.data.actIntro != '') { 101 if (res.data.data.actIntro != '') {
105 th.setData({ 102 th.setData({
106 textShow: true, 103 textShow: true,
107 - textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"').replace(/<section/g, '<div')  
108 - .replace(/\/section>/g, '\div>') 104 + textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
109 }) 105 })
110 } 106 }
111 } else { 107 } else {
@@ -126,9 +122,9 @@ Page({ @@ -126,9 +122,9 @@ Page({
126 onShow: function onShow() { 122 onShow: function onShow() {
127 123
128 }, 124 },
129 - GetReceive: function () { 125 + GetReceive: function() {
130 var th = this; 126 var th = this;
131 - if (th.data.receiveState == '已领取') { 127 + if (th.data.receiveState) {
132 return false; 128 return false;
133 } 129 }
134 var is_sub = th.data.is_sub; //判断是否重复提交 130 var is_sub = th.data.is_sub; //判断是否重复提交
@@ -136,9 +132,6 @@ Page({ @@ -136,9 +132,6 @@ Page({
136 th.setData({ 132 th.setData({
137 is_sub: 1 133 is_sub: 1
138 }) 134 })
139 - wx.showLoading({  
140 - title: '加载中',  
141 - })  
142 var json = { 135 var json = {
143 "actId": th.data.getActId, //活动Id 136 "actId": th.data.getActId, //活动Id
144 "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 137 "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -148,37 +141,35 @@ Page({ @@ -148,37 +141,35 @@ Page({
148 }; 141 };
149 var data = JSON.stringify(json); 142 var data = JSON.stringify(json);
150 var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; 143 var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
151 - wx.request({  
152 - url: url,  
153 - data: data,  
154 - method: 'post',  
155 - header: {  
156 - 'content-type': 'application/json'  
157 - }, // 设置请求的 header  
158 - success: function (res) {  
159 - wx.hideLoading(); 144 + getApp().request.json_post(url, json,
  145 + function(res) {
160 th.setData({ 146 th.setData({
161 is_sub: 0 147 is_sub: 0
162 }) 148 })
163 if (res.data.code == 0) { 149 if (res.data.code == 0) {
164 th.setData({ 150 th.setData({
165 - receiveState: '已领取' 151 + receiveState: 1
166 }) 152 })
167 getApp().my_warnning("领取成功", 1, th); 153 getApp().my_warnning("领取成功", 1, th);
168 } else { 154 } else {
169 - getApp().my_warnning("系统繁忙,请稍后再试", 0, th); 155 + getApp().my_warnning(res.data.msg, 0, th);
170 } 156 }
  157 + },
  158 + function(res) {
  159 +
171 } 160 }
172 - }) 161 +
  162 + )
  163 +
173 } 164 }
174 }, 165 },
175 //界面跳转 166 //界面跳转
176 - goto: function (e) { 167 + goto: function(e) {
177 var url = e.currentTarget.dataset.url; 168 var url = e.currentTarget.dataset.url;
178 getApp().goto(url); 169 getApp().goto(url);
179 }, 170 },
180 //图片失败,默认图片 171 //图片失败,默认图片
181 - bind_bnerr1: function (e) { 172 + bind_bnerr1: function(e) {
182 var th = this; 173 var th = this;
183 var _errImg = e.target.dataset.errorimg; 174 var _errImg = e.target.dataset.errorimg;
184 var _Img = e.target.dataset.img; 175 var _Img = e.target.dataset.img;
pages/giftpack/birthdaygift/birthdaygift.wxml
@@ -166,9 +166,16 @@ @@ -166,9 +166,16 @@
166 </view> 166 </view>
167 <view class="foot_empty "></view> 167 <view class="foot_empty "></view>
168 <view class="foot_button"> 168 <view class="foot_button">
169 - <view class="{{receiveState=='已领取'?'foot_button_notbuy':'foot_button_buy'}}" bindtap="GetReceive">  
170 - <text>{{receiveState}}</text>  
171 - </view> 169 + <block wx:if="{{receiveState}}">
  170 + <view class="foot_button_notbuy">
  171 + <text>已领取</text>
  172 + </view>
  173 + </block>
  174 + <block wx:else>
  175 + <view class="foot_button_buy'}}" bindtap="GetReceive">
  176 + <text>一键全部领取</text>
  177 + </view>
  178 + </block>
172 </view> 179 </view>
173 </view> 180 </view>
174 <!-- 引入提示组件 --> 181 <!-- 引入提示组件 -->
pages/giftpack/evaluategift/evaluategift.js
@@ -19,7 +19,7 @@ Page({ @@ -19,7 +19,7 @@ Page({
19 getActId: '', 19 getActId: '',
20 getActType: '', 20 getActType: '',
21 giftBagId: '', 21 giftBagId: '',
22 - receiveState: '一键全部领取', 22 + receiveState: 0,
23 textTitle: '', 23 textTitle: '',
24 getUrl: '', 24 getUrl: '',
25 noShow: false, 25 noShow: false,
@@ -39,6 +39,7 @@ Page({ @@ -39,6 +39,7 @@ Page({
39 }) 39 })
40 var url = "/api/weshop/marketing/giftbag/bound/get"; 40 var url = "/api/weshop/marketing/giftbag/bound/get";
41 getApp().request.promiseGet(url, { 41 getApp().request.promiseGet(url, {
  42 + isShowLoading: true,
42 data: { 43 data: {
43 "actId": th.data.getActId, //活动Id 44 "actId": th.data.getActId, //活动Id
44 "actType": 2, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 45 "actType": 2, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -50,7 +51,6 @@ Page({ @@ -50,7 +51,6 @@ Page({
50 "gifbagid": th.data.giftBagId 51 "gifbagid": th.data.giftBagId
51 } 52 }
52 }).then(res => { 53 }).then(res => {
53 - wx.hideLoading();  
54 if (res.data.code == 0) { 54 if (res.data.code == 0) {
55 if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) { 55 if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) {
56 //礼包内容--礼券 56 //礼包内容--礼券
@@ -99,18 +99,18 @@ Page({ @@ -99,18 +99,18 @@ Page({
99 }) 99 })
100 if (res.data.data.receiveState == 0) { 100 if (res.data.data.receiveState == 0) {
101 th.setData({ 101 th.setData({
102 - receiveState: '一键全部领取' 102 + receiveState:0
103 }) 103 })
104 } else { 104 } else {
105 th.setData({ 105 th.setData({
106 - receiveState: '已领取' 106 + receiveState: 1
107 }) 107 })
108 } 108 }
109 109
110 if (res.data.data.actIntro != '') { 110 if (res.data.data.actIntro != '') {
111 th.setData({ 111 th.setData({
112 textShow: true, 112 textShow: true,
113 - textTitle: res.data.data.actIntro 113 + textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
114 }) 114 })
115 } 115 }
116 } else { 116 } else {
@@ -132,20 +132,15 @@ Page({ @@ -132,20 +132,15 @@ Page({
132 if (orderType) { 132 if (orderType) {
133 th.setData({ orderType: orderType}) 133 th.setData({ orderType: orderType})
134 } 134 }
135 -  
136 - 135 +
137 th.GetList(); 136 th.GetList();
138 }, 137 },
139 onShow: function() { 138 onShow: function() {
140 - var th = this;  
141 - var textTitle = th.data.textTitle.replace(/<p><img/gi, "<p class='img'><img");  
142 - th.setData({  
143 - textTitle: textTitle  
144 - }) 139 +
145 }, 140 },
146 GetReceive: function() { 141 GetReceive: function() {
147 var th = this; 142 var th = this;
148 - if (th.data.receiveState == '已领取') { 143 + if (th.data.receiveState) {
149 return false; 144 return false;
150 } 145 }
151 var is_sub = th.data.is_sub; //判断是否重复提交 146 var is_sub = th.data.is_sub; //判断是否重复提交
@@ -166,27 +161,26 @@ Page({ @@ -166,27 +161,26 @@ Page({
166 }; 161 };
167 var data = JSON.stringify(json); 162 var data = JSON.stringify(json);
168 var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; 163 var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
169 - wx.request({  
170 - url: url,  
171 - data: data,  
172 - method: 'post',  
173 - header: {  
174 - 'content-type': 'application/json'  
175 - }, // 设置请求的 header  
176 - success: function(res) { 164 + getApp().request.json_post(url, json,
  165 + function (res) {
177 th.setData({ 166 th.setData({
178 is_sub: 0 167 is_sub: 0
179 }) 168 })
180 if (res.data.code == 0) { 169 if (res.data.code == 0) {
181 th.setData({ 170 th.setData({
182 - receiveState: '已领取' 171 + receiveState: 1
183 }) 172 })
184 getApp().my_warnning("领取成功", 1, th); 173 getApp().my_warnning("领取成功", 1, th);
185 } else { 174 } else {
186 getApp().my_warnning(res.data.msg, 0, th); 175 getApp().my_warnning(res.data.msg, 0, th);
187 } 176 }
  177 + },
  178 + function (res) {
  179 +
188 } 180 }
189 - }) 181 +
  182 + )
  183 +
190 } 184 }
191 }, 185 },
192 //界面跳转 186 //界面跳转
pages/giftpack/evaluategift/evaluategift.wxml
1 <view> 1 <view>
2 - <view class="image_box">  
3 - <image src="{{iurl+'miniapp/images/giftbag/eval00.png'}}" lazy-load="true"></image>  
4 - </view>  
5 - <block wx:if="{{itemShow}}"> 2 + <view class="image_box">
  3 + <image src="{{iurl+'miniapp/images/giftbag/eval00.png'}}" lazy-load="true"></image>
  4 + </view>
  5 + <block wx:if="{{itemShow}}">
6 <view class="top rel"> 6 <view class="top rel">
7 <view class="top_box"> 7 <view class="top_box">
8 <view class="top_box_text"> 8 <view class="top_box_text">
@@ -94,8 +94,13 @@ @@ -94,8 +94,13 @@
94 <view class="top_card_tite_a">分类限定</view> 94 <view class="top_card_tite_a">分类限定</view>
95 </block> 95 </block>
96 </view> 96 </view>
  97 + <block wx:if="{{item.isPack!=null}}">
  98 + <view class="top_card_counte">包邮券</view>
  99 + </block>
  100 + <block>
97 <view class="top_card_counte ">{{item.sum+"元券"}}</view> 101 <view class="top_card_counte ">{{item.sum+"元券"}}</view>
98 <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view> 102 <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view>
  103 + </block>
99 </view> 104 </view>
100 </view> 105 </view>
101 </block> 106 </block>
@@ -147,7 +152,7 @@ @@ -147,7 +152,7 @@
147 <text>活动规则:</text> 152 <text>活动规则:</text>
148 </view> 153 </view>
149 <view class="foot_box_text"> 154 <view class="foot_box_text">
150 - <rich-text nodes="{{textTitle}}"></rich-text> 155 + <rich-text nodes="{{textTitle}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
151 </view> 156 </view>
152 </view> 157 </view>
153 </block> 158 </block>
@@ -161,9 +166,16 @@ @@ -161,9 +166,16 @@
161 </view> 166 </view>
162 <view class="foot_empty "></view> 167 <view class="foot_empty "></view>
163 <view class="foot_button"> 168 <view class="foot_button">
164 - <view class="{{receiveState=='已领取'?'foot_button_notbuy':'foot_button_buy'}}" bindtap="GetReceive">  
165 - <text>{{receiveState}}</text>  
166 - </view> 169 + <block wx:if="{{receiveState}}">
  170 + <view class="foot_button_notbuy">
  171 + <text>已领取</text>
  172 + </view>
  173 + </block>
  174 + <block wx:else>
  175 + <view class="foot_button_buy'}}" bindtap="GetReceive">
  176 + <text>一键全部领取</text>
  177 + </view>
  178 + </block>
167 </view> 179 </view>
168 </view> 180 </view>
169 <!-- 引入提示组件 --> 181 <!-- 引入提示组件 -->
pages/giftpack/festival/festival.js 0 → 100644
  1 +var i = require("../../../utils/util.js")
  2 +var e = getApp(),
  3 + a = e.globalData.setting,
  4 + os = a,
  5 + t = e.request,
  6 + d = e.globalData;
  7 +Page({
  8 + data: {
  9 + url: a.url, //接口网址
  10 + iurl: a.imghost, //图片前缀网址
  11 + itemShow: false, //项目栏目是否显示
  12 + cardShow: false, //代金券栏目是否显示
  13 + packShow: false, //福利栏目是否显示
  14 + textShow: false, //规则是否显示
  15 + integralShow: true, //积分领取是否显示
  16 + growUpShow: true, //成长值领取是否显示
  17 + itemButton: '',
  18 + cardButton: '',
  19 + getActId: '',
  20 + getActType: '',
  21 + giftID: '',
  22 + receiveState: 0,
  23 + textTitle: '',
  24 + getUrl: '',
  25 + noShow: false,
  26 + cards: [], //礼包内容--礼券
  27 + itemWare: [], //礼包内容--服务项目
  28 + integralTitle: "",
  29 + growUpTitle: "",
  30 + is_sub: 0, //是否重复领取
  31 + bimg: "", //评价有礼背景图片
  32 + actFontColor: "", //字体颜色
  33 + actBgColor: "", //背景颜色
  34 + },
  35 + GetList: function() {
  36 + var th = this;
  37 + wx.showLoading({
  38 + title: '加载中',
  39 + })
  40 + var url = "/api/weshop/marketing/giftbag/bound/get";
  41 + getApp().request.promiseGet(url, {
  42 + isShowLoading: true,
  43 + data: {
  44 + "actId": th.data.getActId, //活动id
  45 + "actType": 3, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
  46 + "giftBagId": th.data.giftID, //礼包ID
  47 + "storeId": a.stoid, //商家ID
  48 + "userId": d.user_id //用户ID
  49 + }
  50 + }).then(res => {
  51 + if (res.data.code == 0) {
  52 + if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) {
  53 + //礼包内容--礼券
  54 + th.setData({
  55 + cardShow: true,
  56 + cards: res.data.data.lbCoupons
  57 + })
  58 + }
  59 + if (res.data.data.lbSM != null && res.data.data.lbSM.length > 0) {
  60 + //礼包内容--服务项目
  61 + th.setData({
  62 + itemShow: true,
  63 + itemWare: res.data.data.lbSM
  64 + })
  65 + }
  66 + //礼包积分
  67 + if (res.data.data.lbIntegral <= 0) {
  68 + if (res.data.data.lbGrowthValue <= 0) {
  69 + th.setData({
  70 + packShow: false
  71 + })
  72 + } else {
  73 + th.setData({
  74 + packShow: false,
  75 + integralShow: false,
  76 + growUpShow: true
  77 + })
  78 + }
  79 +
  80 + } else {
  81 + if (res.data.data.lbGrowthValue > 0) {
  82 + th.setData({
  83 + packShow: true
  84 + })
  85 + } else {
  86 + th.setData({
  87 + packShow: true,
  88 + integralShow: true,
  89 + growUpShow: false
  90 + })
  91 + }
  92 + }
  93 + th.setData({
  94 + integralTitle: '价值' + res.data.data.lbIntegral + '积分',
  95 + growUpTitle: '价值' + res.data.data.lbGrowthValue + '成长值'
  96 + })
  97 + if (res.data.data.receiveState == 0) {
  98 + th.setData({
  99 + receiveState: 0
  100 + })
  101 + } else {
  102 + th.setData({
  103 + receiveState: 1
  104 + })
  105 + }
  106 +
  107 + if (res.data.data.actIntro != '') {
  108 + th.setData({
  109 + textShow: true,
  110 + textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  111 + })
  112 + }
  113 + } else {
  114 + getApp().my_warnning(res.data.msg, 0, th);
  115 + return false;
  116 + }
  117 + })
  118 + },
  119 +
  120 + onLoad: function(options) {
  121 + var th = this;
  122 + th.setData({
  123 + getActId: options.actId,
  124 + giftID: options.giftBagId
  125 + })
  126 + th.is_festival();
  127 + th.GetList();
  128 + },
  129 + onShow: function() {
  130 +
  131 + },
  132 + GetReceive: function() {
  133 + var th = this;
  134 + if (th.data.receiveState) {
  135 + return false;
  136 + }
  137 + var is_sub = th.data.is_sub; //判断是否重复提交
  138 + if (is_sub == 0) {
  139 + th.setData({
  140 + is_sub: 1
  141 + })
  142 + var json = {
  143 + "actId": th.data.getActId, //活动Id
  144 + "actType": 3, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  145 + "giftBagId": th.data.giftID, //礼包Id
  146 + "storeId": a.stoid, //商家Id
  147 + "userId": d.user_id //用户ID
  148 + }
  149 + var data = JSON.stringify(json);
  150 + var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
  151 + getApp().request.json_post(url, json,
  152 + function (res) {
  153 + th.setData({
  154 + is_sub: 0
  155 + })
  156 + if (res.data.code == 0) {
  157 + th.setData({
  158 + receiveState: 1
  159 + })
  160 + getApp().my_warnning("领取成功", 1, th);
  161 + } else {
  162 + getApp().my_warnning(res.data.msg, 0, th);
  163 + }
  164 + },
  165 + function (res) {
  166 +
  167 + }
  168 +
  169 + )
  170 +
  171 + }
  172 + },
  173 + //获取节日有礼信息
  174 + is_festival: function(e) {
  175 + var th = this;
  176 + var url = "/api/weshop/marketing/holiday/act/judge";
  177 + getApp().request.promiseGet(url, {
  178 + data: {
  179 + storeId: a.stoid, //商家ID
  180 + userId: d.user_id //用户ID
  181 + }
  182 + }).then(res => {
  183 + if (res.data.code == 0) {
  184 + th.setData({
  185 + bimg: res.data.data.actBoundImg,
  186 + actFontColor: res.data.data.actFontColor, //字体颜色
  187 + actBgColor: res.data.data.actBgColor, //背景颜色
  188 +
  189 + })
  190 + }
  191 + })
  192 + },
  193 + //界面跳转
  194 + goto: function(e) {
  195 + var url = e.currentTarget.dataset.url;
  196 + getApp().goto(url);
  197 + },
  198 + //图片失败,默认图片
  199 + bind_bnerr1: function(e) {
  200 + var th = this;
  201 + var _errImg = e.target.dataset.errorimg;
  202 + var _Img = e.target.dataset.img;
  203 + if (_Img != undefined) {
  204 + var _errObj = {};
  205 + _errObj[_errImg] = "/miniapp/images/giftbag/gift02.png";
  206 + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  207 + }
  208 + },
  209 +});
0 \ No newline at end of file 210 \ No newline at end of file
pages/giftpack/festival/festival.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "节日有礼",
  3 + "usingComponents": {
  4 + "warn": "/components/long_warn/long_warn",
  5 + "my_confirm": "/components/my_confirm/my_confirm"
  6 + }
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
pages/giftpack/festival/festival.wxml 0 → 100644
  1 +<view style="background-color:{{actBgColor==undefined?'#FFB72D':actBgColor}}">
  2 + <view class="image_box">
  3 + <image src="{{iurl+bimg}}" lazy-load="true"></image>
  4 + </view>
  5 + <block wx:if="{{itemShow}}">
  6 + <view class="top rel">
  7 + <view class="top_box">
  8 + <view class="top_box_text">
  9 + <text style="color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">______</text>
  10 + </view>
  11 + <view class="top_box_text">
  12 + <text style="color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">新人专享\n你的美丽我来缔造</text>
  13 + </view>
  14 + <view class="top_box_text">
  15 + <text style="color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">______</text>
  16 + </view>
  17 + </view>
  18 + <block wx:for="{{itemWare}}" wx:for-item="item" wx:for-index="index" wx:key="index">
  19 + <view class="top_item ">
  20 + <block wx:if="{{item.lbType==3}}">
  21 + <view class="top_item_img">
  22 + <image src="{{item.fromImage=='' || item.fromImage==null?iurl+'/miniapp/images/giftbag/gift02.png':iurl+item.fromImage}}" lazy-load="true" data-errorimg="itemWare[{{index}}].fromImage" binderror="bind_bnerr1" data-img="{{item.fromImage}}"></image>
  23 + </view>
  24 + </block>
  25 + <block wx:if="{{item.lbType==1}}">
  26 + <view class="top_item_img ">
  27 + <image src="{{item.fromImage==''?iurl+'/miniapp/images/giftbag/empty.jpg':iurl+item.fromImage}}" lazy-load="true"></image>
  28 + </view>
  29 + </block>
  30 + <view class="top_item_center ">
  31 + <view class="top_item_center_title" style="color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">
  32 + <block wx:if="{{item.lbType==1}}">
  33 + <text>免费领取</text>
  34 + </block>
  35 + <block wx:if="{{item.lbType==3}}">
  36 + <text>{{item.fromName}}</text>
  37 + </block>
  38 + </view>
  39 + <view class="top_item_center_ramke ">
  40 + <block wx:if="{{item.lbType==1}}">
  41 + <text>{{item.fromName}}</text>
  42 + </block>
  43 + <block wx:if="{{item.lbType==3}}">
  44 + <text>{{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}}</text>
  45 + </block>
  46 + <view class="num flex-level-right fs26" style="color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">
  47 + <view>数量:</view>
  48 + <view>{{item.num}}</view>
  49 + </view>
  50 + </view>
  51 + </view>
  52 + </view>
  53 + </block>
  54 + <block wx:if="{{itemShow}}">
  55 + <view class="vips">
  56 + <image class="lvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>
  57 + <image class="rvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>
  58 + </view>
  59 + </block>
  60 + </view>
  61 + </block>
  62 + <block wx:if="{{cardShow}}">
  63 + <view>
  64 + <view class="top rel">
  65 + <view class="top_box ">
  66 + <view class="top_box_text">
  67 + <text style="color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">———</text>
  68 + </view>
  69 + <view class="top_box_text ">
  70 + <text style="color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">新人专享优惠券</text>
  71 + </view>
  72 + <view class="top_box_text ">
  73 + <text style="color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">———</text>
  74 + </view>
  75 + </view>
  76 + <block wx:for="{{cards}}" wx:for-item="item" wx:for-index="index" wx:key="index">
  77 + <view class="top_card ">
  78 + <view class="{{item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3'}}">
  79 + <!-- class="{{['',item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3']}}" -->
  80 + <view class="top_card_tite_box ">
  81 + <block wx:if="{{item.useObjectType==0}}">
  82 + <view class="top_card_tite_a">全场通用</view>
  83 + </block>
  84 + <block wx:if="{{item.useObjectType==1}}">
  85 + <view class="top_card_tite_b">品牌限定</view>
  86 + </block>
  87 + <block wx:if="{{item.useObjectType==2}}">
  88 + <view class="top_card_tite_c">品类限定</view>
  89 + </block>
  90 + <block wx:if="{{item.useObjectType==11}}">
  91 + <view class="top_card_tite_a">用途限定</view>
  92 + </block>
  93 + <block wx:if="{{item.useObjectType==12}}">
  94 + <view class="top_card_tite_a">分类限定</view>
  95 + </block>
  96 + </view>
  97 + <view class="top_card_counte ">{{item.sum+"元券"}}</view>
  98 + <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view>
  99 + </view>
  100 + </view>
  101 + </block>
  102 + <block wx:if="{{packShow}}">
  103 + <view class="vips">
  104 + <image class="lvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>
  105 + <image class="rvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>
  106 + </view>
  107 + </block>
  108 + </view>
  109 + </view>
  110 + </block>
  111 + <block wx:if="{{packShow}}">
  112 + <view>
  113 + <view class="top ">
  114 + <view class="top_box ">
  115 + <view class="top_box_text ">
  116 + <text>———</text>
  117 + </view>
  118 + <view class="top_box_text ">
  119 + <text>新人专享福利</text>
  120 + </view>
  121 + <view class="top_box_text ">
  122 + <text>———</text>
  123 + </view>
  124 + </view>
  125 + <block wx:if="{{integralShow}}">
  126 + <view>
  127 + <view class="top_box_image ">
  128 + <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image>
  129 + <button style="background-color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">{{integralTitle}}</button>
  130 + </view>
  131 + </view>
  132 + </block>
  133 + <block wx:if="{{growUpShow}}">
  134 + <view>
  135 + <view class="top_box_image fs36">
  136 + <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image>
  137 + <button style="background-color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">{{growUpTitle}}</button>
  138 + </view>
  139 + </view>
  140 + </block>
  141 + </view>
  142 + </view>
  143 + </block>
  144 + <block wx:if="{{textShow}}">
  145 + <view class="foot_box">
  146 + <view class="foot_box_title fs36">
  147 + <text>活动规则:</text>
  148 + </view>
  149 + <view class="foot_box_text">
  150 + <rich-text nodes="{{textTitle}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
  151 + </view>
  152 + </view>
  153 + </block>
  154 + <view class="button_box">
  155 + <view>
  156 + <button class="button" bindtap="goto" data-url="/pages/index/index/index" style="background-color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">进入商城购物</button>
  157 + </view>
  158 + <view class="button_text ">
  159 + <text>本活动最终解释权归公司所有,如果有问题请联系客服</text>
  160 + </view>
  161 + </view>
  162 + <view class="foot_empty "></view>
  163 + <view class="foot_button">
  164 + <block wx:if="{{receiveState}}">
  165 + <view class="foot_button_notbuy">
  166 + <text>已领取</text>
  167 + </view>
  168 + </block>
  169 + <block wx:else>
  170 + <view class="foot_button_buy'}}" bindtap="GetReceive">
  171 + <text>一键全部领取</text>
  172 + </view>
  173 + </block>
  174 + </view>
  175 +</view>
  176 +<!-- 引入提示组件 -->
  177 +<warn id="warn"></warn>
  178 +<my_confirm id="my_confirm"></my_confirm>
0 \ No newline at end of file 179 \ No newline at end of file
pages/giftpack/festival/festival.wxss 0 → 100644
  1 +@charset "UTF-8";
  2 +
  3 +/* Author XGQ
  4 + * 2019-10-27
  5 + */
  6 +
  7 +.image_box {
  8 + -webkit-box-pack: center;
  9 + -webkit-justify-content: center;
  10 + justify-content: center;
  11 +}
  12 +
  13 +.image_box image {
  14 + width: 100%;
  15 + height: 690rpx;
  16 +}
  17 +
  18 +.top {
  19 + margin: -20rpx 28rpx 45rpx 28rpx;
  20 + padding: 10rpx 10rpx 70rpx 10rpx;
  21 + background-color: #fff;
  22 + border-radius: 0rpx 0rpx 15rpx 15rpx;
  23 +}
  24 +
  25 +.top_box {
  26 + display: -webkit-box;
  27 + display: -webkit-flex;
  28 + display: flex;
  29 + text-align: center;
  30 + -webkit-box-pack: center;
  31 + -webkit-justify-content: center;
  32 + justify-content: center;
  33 +}
  34 +
  35 +.top_box_text {
  36 + -webkit-box-pack: center;
  37 + -webkit-justify-content: center;
  38 + justify-content: center;
  39 + margin: 50rpx 15rpx 20rpx 15rpx;
  40 +}
  41 +
  42 +.top_box_text text {
  43 + color: #FFB72D;
  44 + font-size: 40rpx;
  45 +}
  46 +
  47 +.top_item {
  48 + display: -webkit-box;
  49 + display: -webkit-flex;
  50 + display: flex;
  51 + width: 100%;
  52 + margin: 60rpx 0 0 0;
  53 +}
  54 +
  55 +.top_item_img {
  56 + float: left;
  57 + width: 28%;
  58 + margin: 0rpx 10rpx 0rpx 20rpx;
  59 +}
  60 +
  61 +.top_item_img image {
  62 + width: 150rpx;
  63 + height: 150rpx;
  64 + border-radius: 50%;
  65 + border: #f96865 solid 3rpx;
  66 +}
  67 +
  68 +.top_item_center {
  69 + float: left;
  70 + width: 50%;
  71 +}
  72 +
  73 +.top_item_center_title {
  74 + font-size: 35rpx;
  75 + color: #FFB72D;
  76 + -webkit-box-pack: start;
  77 + -webkit-justify-content: flex-start;
  78 + justify-content: flex-start;
  79 + padding: 0 10rpx 15rpx 0rpx;
  80 + word-break: break-all;
  81 + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/
  82 + text-overflow: ellipsis;
  83 + display: -webkit-box;
  84 + /** 对象作为伸缩盒子模型显示 **/
  85 + -webkit-box-orient: vertical;
  86 + /** 设置或检索伸缩盒对象的子元素的排列方式 **/
  87 + -webkit-line-clamp: 2;
  88 + /** 显示的行数 **/
  89 + overflow: hidden;
  90 + /** 隐藏超出的内容 **/
  91 +}
  92 +
  93 +.top_item_center_ramke {
  94 + font-size: 25rpx;
  95 + -webkit-box-pack: start;
  96 + -webkit-justify-content: flex-start;
  97 + justify-content: flex-start;
  98 + line-height: 35rpx;
  99 + letter-spacing: 0.5rpx;
  100 + word-break: break-all;
  101 + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/
  102 + text-overflow: ellipsis;
  103 + display: -webkit-box;
  104 + /** 对象作为伸缩盒子模型显示 **/
  105 + -webkit-box-orient: vertical;
  106 + /** 设置或检索伸缩盒对象的子元素的排列方式 **/
  107 + -webkit-line-clamp: 2;
  108 + /** 显示的行数 **/
  109 + overflow: hidden;
  110 + /** 隐藏超出的内容 **/
  111 +}
  112 +
  113 +.top_item_button {
  114 + float: right;
  115 + width: 22%;
  116 + padding: 65rpx 20rpx 0 1rpx;
  117 +}
  118 +
  119 +.top_item_button button {
  120 + font-size: 25rpx;
  121 + background: #fd6969;
  122 + color: #fff;
  123 + border-radius: 50rpx;
  124 + height: 45rpx;
  125 + line-height: 45rpx;
  126 +}
  127 +
  128 +.top_card {
  129 + width: calc(50% - 30rpx);
  130 + display: inline-block;
  131 + margin: 15rpx;
  132 +}
  133 +
  134 +.top_card_box {
  135 + background-size: cover;
  136 + background-position: center;
  137 + background-repeat: no-repeat;
  138 + border-radius: 20rpx;
  139 + height: 250rpx;
  140 + margin: 5rpx;
  141 +}
  142 +
  143 +.img1 {
  144 + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip01.png);
  145 +}
  146 +
  147 +.img2 {
  148 + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip02.png);
  149 +}
  150 +
  151 +.img3 {
  152 + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip03.png);
  153 +}
  154 +
  155 +.top_card_tite_box {
  156 + width: 100%;
  157 + display: -webkit-box;
  158 + display: -webkit-flex;
  159 + display: flex;
  160 + -webkit-box-pack: end;
  161 + -webkit-justify-content: flex-end;
  162 + justify-content: flex-end;
  163 +}
  164 +
  165 +.top_card_tite_a {
  166 + padding: 5rpx 25rpx 5rpx 25rpx;
  167 + line-height: 29rpx;
  168 + font-size: 25rpx;
  169 + color: #fff;
  170 + background: #ffa7c0;
  171 + border-radius: 0rpx 20rpx 0rpx 6rpx;
  172 +}
  173 +
  174 +.top_card_tite_b {
  175 + padding: 5rpx 25rpx 5rpx 25rpx;
  176 + line-height: 29rpx;
  177 + font-size: 25rpx;
  178 + color: #fff;
  179 + background: #50dfdb;
  180 + border-radius: 0rpx 20rpx 0rpx 6rpx;
  181 +}
  182 +
  183 +.top_card_tite_c {
  184 + padding: 5rpx 25rpx 5rpx 25rpx;
  185 + line-height: 29rpx;
  186 + font-size: 25rpx;
  187 + color: #fff;
  188 + background: #92cbff;
  189 + border-radius: 0rpx 20rpx 0rpx 6rpx;
  190 +}
  191 +
  192 +.top_card_tite_d {
  193 + padding: 5rpx 25rpx 5rpx 25rpx;
  194 + line-height: 29rpx;
  195 + font-size: 25rpx;
  196 + color: #fff;
  197 + border-radius: 0rpx 20rpx 0rpx 6rpx;
  198 +}
  199 +
  200 +.top_card_counte {
  201 + padding: 40rpx 20rpx 0 0;
  202 + text-align: center;
  203 + display: -webkit-box;
  204 + display: -webkit-flex;
  205 + display: flex;
  206 + -webkit-box-pack: center;
  207 + -webkit-justify-content: center;
  208 + justify-content: center;
  209 + -webkit-box-align: center;
  210 + -webkit-align-items: center;
  211 + align-items: center;
  212 + color: #fff;
  213 + font-size: 40rpx;
  214 +}
  215 +
  216 +.top_card_remak {
  217 + padding: 20rpx 0 40rpx 0;
  218 + text-align: center;
  219 + display: -webkit-box;
  220 + display: -webkit-flex;
  221 + display: flex;
  222 + -webkit-box-pack: center;
  223 + -webkit-justify-content: center;
  224 + justify-content: center;
  225 + -webkit-box-align: center;
  226 + -webkit-align-items: center;
  227 + align-items: center;
  228 + font-size: 20rpx;
  229 + color: #fff;
  230 +}
  231 +
  232 +.top_card_button_a button {
  233 + margin: 0 85rpx;
  234 + background: #ffa6bc;
  235 + border-radius: 50rpx;
  236 + line-height: 40rpx;
  237 + height: 40rpx;
  238 + color: white;
  239 + font-size: 25rpx;
  240 +}
  241 +
  242 +.top_card_button_b button {
  243 + margin: 0 85rpx;
  244 + background: #50dfdb;
  245 + border-radius: 50rpx;
  246 + line-height: 40rpx;
  247 + height: 40rpx;
  248 + color: white;
  249 + font-size: 25rpx;
  250 +}
  251 +
  252 +.top_card_button_c button {
  253 + margin: 0 85rpx;
  254 + background: #75bcfc;
  255 + border-radius: 50rpx;
  256 + line-height: 40rpx;
  257 + height: 40rpx;
  258 + color: white;
  259 + font-size: 25rpx;
  260 +}
  261 +
  262 +.top_card_button_d button {
  263 + margin: 0 85rpx;
  264 + border-radius: 50rpx;
  265 + line-height: 40rpx;
  266 + height: 40rpx;
  267 + color: white;
  268 + font-size: 25rpx;
  269 +}
  270 +
  271 +.top_box_image {
  272 + padding: 20rpx 20rpx 20rpx 20rpx;
  273 +}
  274 +
  275 +.top_box_image image {
  276 + height: 216rpx;
  277 + width: 100%;
  278 +}
  279 +
  280 +.top_box_image button {
  281 + margin: 15rpx 95rpx 0rpx 95rpx;
  282 + background: rgb(254,182,44);
  283 + border-radius: 50rpx;
  284 + line-height: 60rpx;
  285 + height: 60rpx;
  286 + color: white;
  287 + font-size: 30rpx;
  288 +}
  289 +
  290 +.foot_box {
  291 + margin: 0 30rpx 40rpx 30rpx;
  292 + background: #fff;
  293 + border-radius: 20rpx;
  294 +}
  295 +
  296 +.foot_box_title {
  297 + color: #000;
  298 + padding: 20rpx 30rpx 20rpx 30rpx;
  299 +}
  300 +
  301 +.foot_box_text {
  302 + font-size: 30rpx;
  303 + color: #000;
  304 + line-height: 48rpx;
  305 + padding: 20rpx 35rpx 50rpx 30rpx;
  306 +}
  307 +
  308 +.button_box {
  309 + margin: 50rpx 50rpx 50rpx 50rpx;
  310 + text-align: center;
  311 +}
  312 +
  313 +.button {
  314 + margin: 0 30rpx;
  315 + background: #FFDB97;
  316 + border-radius: 50rpx;
  317 + line-height: 80rpx;
  318 + height: 80rpx;
  319 + color: white;
  320 + font-size: 35rpx;
  321 +}
  322 +
  323 +.button_text {
  324 + padding-top: 20rpx;
  325 + font-size: 20rpx;
  326 + color: white;
  327 + height: 100rpx;
  328 +}
  329 +
  330 +.foot_empty {
  331 + height: 90rpx;
  332 +}
  333 +
  334 +.foot_button {
  335 + display: -webkit-box;
  336 + display: -webkit-flex;
  337 + display: flex;
  338 + margin: 20rpx 0rpx 0rpx 0rpx;
  339 + padding: 25rpx 0rpx;
  340 + background: #fff;
  341 + text-align: center;
  342 + -webkit-box-pack: center;
  343 + -webkit-justify-content: center;
  344 + justify-content: center;
  345 + position: fixed;
  346 + bottom: 0;
  347 + left: 0;
  348 + width: 100%;
  349 + z-index: 10;
  350 +}
  351 +
  352 +.foot_button_buy {
  353 + background: #FFB72D;
  354 + color: #fff;
  355 + width: 400rpx;
  356 + height: 70rpx;
  357 + font-size: 28rpx;
  358 + line-height: 70rpx;
  359 + border-radius: 40rpx;
  360 +}
  361 +
  362 +.foot_button_notbuy {
  363 + background: #999;
  364 + color: #fff;
  365 + width: 400rpx;
  366 + height: 70rpx;
  367 + font-size: 28rpx;
  368 + line-height: 70rpx;
  369 + border-radius: 40rpx;
  370 +}
  371 +
  372 +/* page {
  373 + background-color: #FFB72D;
  374 +} */
  375 +
  376 +button::after {
  377 + border: none;
  378 +}
  379 +
  380 +.foot_box_text ._img {
  381 + width: 100%;
  382 +}
  383 +
  384 +.foot_box_text .img {
  385 + line-height: 0;
  386 +}
  387 +
  388 +.image {
  389 + width: 400rpx;
  390 + height: 200rpx;
  391 +}
  392 +
  393 +.num {
  394 + color: #FFB72D;
  395 +}
  396 +
  397 +.lvip {
  398 + left: 30rpx;
  399 + bottom: -58rpx;
  400 + width: 20rpx;
  401 + height: 90rpx;
  402 + z-index: 5;
  403 +}
  404 +
  405 +.rvip {
  406 + right: 30rpx;
  407 + bottom: -58rpx;
  408 + width: 20rpx;
  409 + height: 90rpx;
  410 + z-index: 5;
  411 +}
pages/user/assistance/assistance.js
@@ -6,7 +6,9 @@ var t = getApp(), @@ -6,7 +6,9 @@ var t = getApp(),
6 ut = i, 6 ut = i,
7 s = require("../../../utils/common.js"); 7 s = require("../../../utils/common.js");
8 var regeneratorRuntime = require('../../../utils/runtime.js'); 8 var regeneratorRuntime = require('../../../utils/runtime.js');
9 -var oo = t.globalData.setting,os=oo, ut= require("../../../utils/util.js"); 9 +var oo = t.globalData.setting,
  10 + os = oo,
  11 + ut = require("../../../utils/util.js");
10 Page({ 12 Page({
11 13
12 /** 14 /**
@@ -22,10 +24,10 @@ Page({ @@ -22,10 +24,10 @@ Page({
22 cur_page: 1, //页码 24 cur_page: 1, //页码
23 page_num: 5, //每页多少个 25 page_num: 5, //每页多少个
24 is_show_more: 0, //是否加载更多 26 is_show_more: 0, //是否加载更多
25 - help_id:"",//助力活动的id  
26 - timer:"",//任务列表的定时器  
27 - s_num:"",//多少人已经领取任务  
28 - page:1,//我的任务的当前页 27 + help_id: "", //助力活动的id
  28 + timer: "", //任务列表的定时器
  29 + s_num: "", //多少人已经领取任务
  30 + page: 1, //我的任务的当前页
29 }, 31 },
30 32
31 /** 33 /**
@@ -36,79 +38,85 @@ Page({ @@ -36,79 +38,85 @@ Page({
36 var nav_b = th.selectComponent("#nav_b"); //组件的id 38 var nav_b = th.selectComponent("#nav_b"); //组件的id
37 nav_b.set_name("助力", "/pages/user/assistance/assistance"); 39 nav_b.set_name("助力", "/pages/user/assistance/assistance");
38 // 助力活动 40 // 助力活动
39 - this.assistance(); 41 + th.assistance();
40 }, 42 },
41 43
42 /** 44 /**
43 * 生命周期函数--监听页面显示 45 * 生命周期函数--监听页面显示
44 */ 46 */
45 onShow: function() { 47 onShow: function() {
46 - 48 +
47 }, 49 },
48 // 助力活动 50 // 助力活动
49 - assistance() {  
50 - var th=this; 51 + assistance() {
  52 + var th = this;
51 var user_id = getApp().globalData.user_id; 53 var user_id = getApp().globalData.user_id;
52 var store_id = os.stoid; 54 var store_id = os.stoid;
53 -  
54 getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", { 55 getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", {
  56 + isShowLoading: true,
55 data: { 57 data: {
56 storeId: store_id, 58 storeId: store_id,
57 userId: user_id 59 userId: user_id
58 } 60 }
59 }).then(res => { 61 }).then(res => {
60 if (res.data.code == 0) { 62 if (res.data.code == 0) {
61 - var help_data=res.data.data;  
62 - th.setData({ zl_act:help_data, help_id:help_data.id });  
63 - if (th.data.help_id != "" && th.data.help_id!=null) {  
64 - //我的任务 63 + var help_data = res.data.data;
  64 + help_data.remark = help_data.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"');
  65 + th.setData({
  66 + zl_act: help_data,
  67 + help_id: help_data.id
  68 + });
  69 + if (th.data.help_id != "" && th.data.help_id != null) {
  70 + //我的任务
65 th.get_list(); 71 th.get_list();
66 - }  
67 -  
68 - return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {  
69 - data: {  
70 - helpId: help_data.id, storeId: store_id  
71 - }  
72 - })  
73 - 72 + }
  73 + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
  74 + isShowLoading: true,
  75 + data: {
  76 + helpId: help_data.id,
  77 + storeId: store_id
  78 + }
  79 + })
74 } 80 }
75 - return ut.null_promise();  
76 - }).then(res=>{  
77 - if(res.data.code==0)  
78 - th.setData({s_num:res.data.data.countAll})  
79 - })  
80 -  
81 - 81 + return ut.null_promise();
  82 + }).then(res => {
  83 + if (res.data.code == 0)
  84 + th.setData({
  85 + s_num: res.data.data.countAll
  86 + })
  87 + })
  88 +
  89 +
82 }, 90 },
83 91
84 //--点击获取用户任务列表--会员的任务列表 92 //--点击获取用户任务列表--会员的任务列表
85 - get_list:function() {  
86 - 93 + get_list: function() {
  94 +
87 var th = this; 95 var th = this;
88 - var page=th.data.page;  
89 - var help_id=this.data.help_id; 96 + var page = th.data.page;
  97 + var help_id = this.data.help_id;
90 t.request.get("/api/weshop/marketing/help/help/user/page", { 98 t.request.get("/api/weshop/marketing/help/help/user/page", {
  99 + isShowLoading: true,
91 data: { 100 data: {
92 - userId:getApp().globalData.user_id, 101 + userId: getApp().globalData.user_id,
93 storeId: os.stoid, 102 storeId: os.stoid,
94 helpId: help_id, 103 helpId: help_id,
95 page: page, 104 page: page,
96 - pageSize:5 105 + pageSize: 5
97 }, 106 },
98 success: function(res) { 107 success: function(res) {
99 clearTimeout(th.data.timer); 108 clearTimeout(th.data.timer);
100 -  
101 - if (!th.data.is_load)  
102 - th.setData({  
103 - is_load: 1  
104 - })  
105 -  
106 - 109 +
  110 + if (!th.data.is_load)
  111 + th.setData({
  112 + is_load: 1
  113 + })
  114 +
107 if (res.data.code == 0) { 115 if (res.data.code == 0) {
108 - 116 +
109 var list = th.data.zl_user_list; 117 var list = th.data.zl_user_list;
110 //连接数组 118 //连接数组
111 - list = list.concat(res.data.data.pageData); 119 + list = list.concat(res.data.data.pageData);
112 th.setData({ 120 th.setData({
113 zl_user_list: list, 121 zl_user_list: list,
114 is_load: 1, 122 is_load: 1,
@@ -117,20 +125,18 @@ Page({ @@ -117,20 +125,18 @@ Page({
117 th.setData({ 125 th.setData({
118 is_show_more: 1 126 is_show_more: 1
119 }) 127 })
120 - }else{ 128 + } else {
121 var page = th.data.page + 1; 129 var page = th.data.page + 1;
122 th.setData({ 130 th.setData({
123 is_show_more: 0, 131 is_show_more: 0,
124 page: page 132 page: page
125 }) 133 })
126 } 134 }
127 -  
128 } else { 135 } else {
129 -  
130 - getApp().showWarning("暂无更多内容",0); 136 + getApp().my_confirm(res.data.msg, 0, th);
131 th.setData({ 137 th.setData({
132 is_show_more: 1, 138 is_show_more: 1,
133 - page: page 139 + page: page
134 }) 140 })
135 } 141 }
136 142
@@ -140,11 +146,11 @@ Page({ @@ -140,11 +146,11 @@ Page({
140 146
141 //-----跳转到领取礼包的页面------ 147 //-----跳转到领取礼包的页面------
142 go_task: function() { 148 go_task: function() {
143 -  
144 - var help_id=this.data.help_id;  
145 - getApp().goto("/pages/user/assistance/task_assistance?help_id="+help_id); 149 + var th = this;
  150 + var help_id = th.data.help_id;
  151 + getApp().goto("/pages/user/assistance/task_assistance?help_id=" + help_id);
146 }, 152 },
147 - switch_head: function (e) { 153 + switch_head: function(e) {
148 var th = this; 154 var th = this;
149 var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明 155 var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明
150 var switch_head = th.data.switch_head; //0任务,1活动说明 156 var switch_head = th.data.switch_head; //0任务,1活动说明
@@ -156,22 +162,22 @@ Page({ @@ -156,22 +162,22 @@ Page({
156 }, 162 },
157 163
158 //关闭导航 164 //关闭导航
159 - close: function () { 165 + close: function() {
160 var th = this; 166 var th = this;
161 var nav_b = th.selectComponent("#nav_b"); //组件的id 167 var nav_b = th.selectComponent("#nav_b"); //组件的id
162 nav_b.close_box(); 168 nav_b.close_box();
163 }, 169 },
  170 +
164 // 领取礼包 171 // 领取礼包
165 - get_libao:function(e){  
166 - var libao_id=e.currentTarget.dataset.libaoid;  
167 - var completeid= e.currentTarget.dataset.completeid;  
168 -  
169 - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1 + "&completeid=" + completeid); 172 + get_libao: function(e) {
  173 + var libao_id = e.currentTarget.dataset.libaoid;
  174 + getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1);
170 }, 175 },
  176 +
171 //查看礼包id 177 //查看礼包id
172 - select_libao:function(){  
173 - var libao_id = e.currentTarget.dataset.libaoid;  
174 - var ordersn = e.currentTarget.dataset.orderid;  
175 - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 0 + "&ordersn=" + ordersn ); 178 + select_libao: function() {
  179 + var orderSn = e.currentTarget.dataset.orderSn;//订单号
  180 + getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn);
176 } 181 }
  182 +
177 }) 183 })
178 \ No newline at end of file 184 \ No newline at end of file
pages/user/assistance/assistance.json
1 { 1 {
2 "navigationBarTitleText": "好友助力,得好礼", 2 "navigationBarTitleText": "好友助力,得好礼",
3 - "navigationStyle": "custom",  
4 "usingComponents": { 3 "usingComponents": {
5 "warn": "/components/long_warn/long_warn", 4 "warn": "/components/long_warn/long_warn",
6 "my_confirm": "/components/my_confirm/my_confirm", 5 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/assistance.wxml
@@ -8,16 +8,15 @@ @@ -8,16 +8,15 @@
8 <view class="flex-center"> 8 <view class="flex-center">
9 <image class="getgift" src="{{iurl+'miniapp/images/friendhelp/getgift.png'}}" lazy-load="true"></image> 9 <image class="getgift" src="{{iurl+'miniapp/images/friendhelp/getgift.png'}}" lazy-load="true"></image>
10 </view> 10 </view>
11 - <view class="flex-center fs32"> 11 + <view class="flex-center fs32">
12 <view class="excitation">机会总是留给最有行动力的人</view> 12 <view class="excitation">机会总是留给最有行动力的人</view>
13 </view> 13 </view>
14 <view class="flex-center"> 14 <view class="flex-center">
15 <image class="gift" src="{{zl_act.imageUrl==''?iurl+'miniapp/images/friendhelp/gift.png':iurl+zl_act.imageUrl}}" lazy-load="true"></image> 15 <image class="gift" src="{{zl_act.imageUrl==''?iurl+'miniapp/images/friendhelp/gift.png':iurl+zl_act.imageUrl}}" lazy-load="true"></image>
16 </view> 16 </view>
17 <view class="flex-center fs26 time"> 17 <view class="flex-center fs26 time">
18 - <view>活动时间:</view>  
19 - <view>{{filter_s.format_time(zl_act.beginDate,0)}} 至 {{filter_s.format_time(zl_act.endDate,0)}}  
20 - </view> 18 + <view>活动时间:{{filter_s.format_time(zl_act.beginDate,0)}} 至 {{filter_s.format_time(zl_act.endDate,0)}}</view>
  19 +
21 </view> 20 </view>
22 <view class="flex-center" bindtap="go_task"> 21 <view class="flex-center" bindtap="go_task">
23 <view class="flex-center take"> 22 <view class="flex-center take">
@@ -48,31 +47,30 @@ @@ -48,31 +47,30 @@
48 <view class="flex-center width"> 47 <view class="flex-center width">
49 <view class="ellipsis-1">{{item.helpTaskName}}</view> 48 <view class="ellipsis-1">{{item.helpTaskName}}</view>
50 </view> 49 </view>
51 - 50 +
52 <!-- 已完成的颜色nostate --> 51 <!-- 已完成的颜色nostate -->
53 <view class="flex-center width state" wx:if="{{item.status==1}}"> 52 <view class="flex-center width state" wx:if="{{item.status==1}}">
54 - <view class="ellipsis-1"bindtap="get_libao"data-libaoid="{{item.helpListGiftBagId}}"  
55 - data-completeid="{{item.id}}" >领取礼包</view> 53 + <view class="ellipsis-1" bindtap="get_libao" data-libaoid="{{item.helpListGiftBagId}}">领取礼包</view>
56 </view> 54 </view>
57 - <view class="flex-center width state" wx:if="{{item.status==0}}">  
58 - <view class="ellipsis-1">{{item.zlHelpNum}}/{{item.helpNum}}</view>  
59 - </view>  
60 - <view class="flex-center width state" wx:if="{{item.status==2}}">  
61 - <view class="ellipsis-1" bindtap="select_libao" data-orderid="{{item.ordersn}}" data-libaoid="{{item.helpListGiftBagId}}">查看礼包</view>  
62 - </view>  
63 -  
64 - 55 + <view class="flex-center width state" wx:if="{{item.status==0}}">
  56 + <view class="ellipsis-1">{{item.zlHelpNum}}/{{item.helpNum}}</view>
  57 + </view>
  58 + <view class="flex-center width state" wx:if="{{item.status==2}}">
  59 + <view class="ellipsis-1" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</view>
  60 + </view>
  61 +
  62 +
65 </view> 63 </view>
66 <!-- 加载更多 --> 64 <!-- 加载更多 -->
67 - <block wx:if="{{is_show_more==0}}">  
68 - <view class="fs28 flex-center">  
69 - <view class="line"></view>  
70 - <view class="load" bindtap="get_list">点击加载更多</view>  
71 - <view class="line"></view>  
72 - </view>  
73 - </block> 65 + <block wx:if="{{is_show_more==0}}">
  66 + <view class="fs28 flex-center">
  67 + <view class="line"></view>
  68 + <view class="load" bindtap="get_list">点击加载更多</view>
  69 + <view class="line"></view>
  70 + </view>
  71 + </block>
74 </view> 72 </view>
75 - 73 +
76 74
77 <view class="fs30" style="margin-top: 30rpx;"> 75 <view class="fs30" style="margin-top: 30rpx;">
78 <view class="flex-center nothing" wx:if="{{is_load && zl_user_list.length==0}}"> 76 <view class="flex-center nothing" wx:if="{{is_load && zl_user_list.length==0}}">
@@ -93,11 +91,14 @@ @@ -93,11 +91,14 @@
93 <view wx:if="{{switch_head}}" class="white"> 91 <view wx:if="{{switch_head}}" class="white">
94 <view class="items"> 92 <view class="items">
95 <view class="content fs28 padding"> 93 <view class="content fs28 padding">
96 - <!-- <view>{{zl_act.remark}}</view> -->  
97 - <rich-text nodes="{{zl_act.remark}}"></rich-text> 94 + <block wx:if="{{zl_act.remark!=''}}">
  95 + <rich-text nodes="{{zl_act.remark}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
  96 + </block>
  97 + <block wx:else>
  98 + <view>暂无活动说明</view>
  99 + </block>
98 </view> 100 </view>
99 </view> 101 </view>
100 -  
101 </view> 102 </view>
102 103
103 </view> 104 </view>
pages/user/assistance/assistance.wxss
@@ -2,6 +2,7 @@ page { @@ -2,6 +2,7 @@ page {
2 background-color: rgb(208, 17, 25); 2 background-color: rgb(208, 17, 25);
3 width: 100%; 3 width: 100%;
4 height: 100%; 4 height: 100%;
  5 +
5 } 6 }
6 7
7 .lumi { 8 .lumi {
pages/user/assistance/assistance_success.json
1 { 1 {
2 "navigationBarTitleText": "好友助力,得好礼", 2 "navigationBarTitleText": "好友助力,得好礼",
3 - "navigationStyle": "custom",  
4 "usingComponents": { 3 "usingComponents": {
5 "warn": "/components/long_warn/long_warn", 4 "warn": "/components/long_warn/long_warn",
6 "my_confirm": "/components/my_confirm/my_confirm", 5 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/friend_assistance.json
1 { 1 {
2 "navigationBarTitleText": "好友助力,得好礼", 2 "navigationBarTitleText": "好友助力,得好礼",
3 - "navigationStyle": "custom",  
4 "usingComponents": { 3 "usingComponents": {
5 "warn": "/components/long_warn/long_warn", 4 "warn": "/components/long_warn/long_warn",
6 "my_confirm": "/components/my_confirm/my_confirm", 5 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/friend_assistance.wxml
1 <wxs module="filter" src="c_filter.wxs"></wxs> 1 <wxs module="filter" src="c_filter.wxs"></wxs>
2 <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> 2 <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)">
3 <view class="flex-vertical user_assis"> 3 <view class="flex-vertical user_assis">
4 - <image class="circle user_img" src="{{user.head_pic}}"></image> 4 + <image class="circle user_img" src="{{user.head_pic}}" lazy-load="true"></image>
5 <view class="user_name white fs28 ellipsis-1">{{user.nickname}}</view> 5 <view class="user_name white fs28 ellipsis-1">{{user.nickname}}</view>
6 </view> 6 </view>
7 <view class="caption_title white fs32 t-c"> 7 <view class="caption_title white fs32 t-c">
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 </view> 9 </view>
10 <!-- 礼包图片 --> 10 <!-- 礼包图片 -->
11 <view class="t-c"> 11 <view class="t-c">
12 -<image class="assis_liba" src="{{iurl}}/miniapp/images/friendhelp/libao_asiss.png"> 12 +<image class="assis_liba" src="{{iurl}}/miniapp/images/friendhelp/libao_asiss.png" lazy-load="true">
13 </image> 13 </image>
14 </view> 14 </view>
15 <view class="flex jc-center"> 15 <view class="flex jc-center">
pages/user/assistance/giftpacklist.js
@@ -10,7 +10,6 @@ Page({ @@ -10,7 +10,6 @@ Page({
10 url: a.url, //接口网址 10 url: a.url, //接口网址
11 iurl: a.imghost, //图片前缀网址 11 iurl: a.imghost, //图片前缀网址
12 isBuy: 0, 12 isBuy: 0,
13 - getGiftID: '', //礼包id  
14 giftImage: '', 13 giftImage: '',
15 giftTitle: '', 14 giftTitle: '',
16 giftDate: '', 15 giftDate: '',
@@ -29,39 +28,47 @@ Page({ @@ -29,39 +28,47 @@ Page({
29 c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 28 c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
30 is_lb: 0, //是否有礼包 29 is_lb: 0, //是否有礼包
31 receiveState: 0, //0未领取 1已领取 30 receiveState: 0, //0未领取 1已领取
32 - completeid: "",  
33 is_sub: 0, //判断是否重复提交 31 is_sub: 0, //判断是否重复提交
34 is_libao: 0, //0轮播查看活动 1领取礼包 2.查看礼包详情 32 is_libao: 0, //0轮播查看活动 1领取礼包 2.查看礼包详情
35 held_id: "", //活动id 33 held_id: "", //活动id
36 taskId: "", //任务id 34 taskId: "", //任务id
37 orderSn: "", //订单号 35 orderSn: "", //订单号
  36 + is_type:"",//类型 0.轮播过来的 1.领取礼包过来的 2.查看礼包过来的
  37 + is_head:0,//数据是否加载完成
  38 + giftBagId:"",//礼包id
38 }, 39 },
39 onLoad: function(options) { 40 onLoad: function(options) {
40 var th = this; 41 var th = this;
41 if (options.is_libao == 0) { 42 if (options.is_libao == 0) {
42 th.setData({ 43 th.setData({
43 - held_id: options.help_id, //options.help_id  
44 - taskId: options.taskId, //options.libao_id 44 + held_id: options.help_id,
  45 + taskId: options.taskId,
  46 + is_type:0
45 }) 47 })
46 th.help(); 48 th.help();
47 } 49 }
48 if (options.is_libao == 1) { 50 if (options.is_libao == 1) {
49 th.setData({ 51 th.setData({
50 - taskId: options.libao_id,  
51 - held_id: options.held_id 52 + giftBagId: options.libao_id,
  53 + is_type: 1
52 }) 54 })
53 th.GetBuyGiftList(); 55 th.GetBuyGiftList();
54 } 56 }
55 if (options.order_sn) { 57 if (options.order_sn) {
56 th.setData({ 58 th.setData({
57 - orderSn: options.orderSn 59 + orderSn: options.orderSn,
  60 + is_type: 2
58 }) 61 })
59 th.GetMyGiftList(); 62 th.GetMyGiftList();
60 } 63 }
61 - th.close();  
62 }, 64 },
63 onShow: function() { 65 onShow: function() {
64 - 66 + var th = this;
  67 + var is_read = th.data.is_read;
  68 + if (is_read){
  69 + var nav_b = th.selectComponent("#nav_b"); //组件的id
  70 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
  71 + }
65 }, 72 },
66 //助力活动查看礼包详情调用 73 //助力活动查看礼包详情调用
67 help: function(e) { 74 help: function(e) {
@@ -78,7 +85,8 @@ Page({ @@ -78,7 +85,8 @@ Page({
78 if (res.data.code == 0) { 85 if (res.data.code == 0) {
79 th.setData({ 86 th.setData({
80 giftImage: th.data.iurl + res.data.data.lbUrl, 87 giftImage: th.data.iurl + res.data.data.lbUrl,
81 - giftTitle: res.data.data.giftTitle 88 + giftTitle: res.data.data.giftTitle,
  89 + is_head:1
82 }) 90 })
83 if (res.data.data.giftRemark == '') { 91 if (res.data.data.giftRemark == '') {
84 th.setData({ 92 th.setData({
@@ -90,22 +98,7 @@ Page({ @@ -90,22 +98,7 @@ Page({
90 }) 98 })
91 } 99 }
92 100
93 - // //---获取日期的时间戳---  
94 - // var t_endtime = res.data.data.endTime;  
95 - // t_endtime = t_endtime.replace(/-/g, '/');  
96 - // var t_date = new Date(t_endtime) / 1000;  
97 - // var t_now = ut.gettimestamp();  
98 -  
99 - // if (res.data.data.goodsUseState) th.setData({  
100 - // c_state: 1  
101 - // })  
102 - // else if (t_date <= t_now)  
103 - // th.setData({  
104 - // c_state: 2  
105 - // })  
106 -  
107 th.setData({ 101 th.setData({
108 - giftDate: res.data.data.endTime,  
109 giftPosPrice: res.data.data.giftPosPrice, 102 giftPosPrice: res.data.data.giftPosPrice,
110 giftQty: res.data.data.giftQty, 103 giftQty: res.data.data.giftQty,
111 giftIntegral: res.data.data.payIntegral, 104 giftIntegral: res.data.data.payIntegral,
@@ -145,7 +138,8 @@ Page({ @@ -145,7 +138,8 @@ Page({
145 if (res.data.code == 0) { 138 if (res.data.code == 0) {
146 th.setData({ 139 th.setData({
147 giftImage: th.data.iurl + res.data.data.lbUrl, 140 giftImage: th.data.iurl + res.data.data.lbUrl,
148 - giftTitle: res.data.data.giftTitle 141 + giftTitle: res.data.data.giftTitle,
  142 + is_head:1
149 }) 143 })
150 if (res.data.data.giftRemark == '') { 144 if (res.data.data.giftRemark == '') {
151 th.setData({ 145 th.setData({
@@ -210,9 +204,9 @@ Page({ @@ -210,9 +204,9 @@ Page({
210 is_sub: 1 204 is_sub: 1
211 }) 205 })
212 var json = { 206 var json = {
213 - "actId": th.data.completeid, //活动Id 207 + "actId": th.data.held_id, //活动Id
214 "actType": 5, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 208 "actType": 5, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
215 - "giftBagId": th.data.giftID, //礼包Id 209 + "giftBagId": th.data.giftBagId, //礼包Id
216 "storeId": a.stoid, //商家Id 210 "storeId": a.stoid, //商家Id
217 "userId": d.user_id //用户ID 211 "userId": d.user_id //用户ID
218 }; 212 };
@@ -234,7 +228,7 @@ Page({ @@ -234,7 +228,7 @@ Page({
234 }, 228 },
235 function(res) { 229 function(res) {
236 230
237 - }, "post" 231 + }
238 232
239 ) 233 )
240 234
@@ -248,13 +242,14 @@ Page({ @@ -248,13 +242,14 @@ Page({
248 data: { 242 data: {
249 "storeId": a.stoid, //商家ID 243 "storeId": a.stoid, //商家ID
250 "userId": d.user_id, //用户ID 244 "userId": d.user_id, //用户ID
251 - "giftBagId": th.taskId 245 + "giftBagId": th.giftBagId
252 }, 246 },
253 success: function(res) { 247 success: function(res) {
254 if (res.data.code == 0) { 248 if (res.data.code == 0) {
255 _this2.setData({ 249 _this2.setData({
256 giftImage: th.iurl + res.data.data.lbUrl, 250 giftImage: th.iurl + res.data.data.lbUrl,
257 - giftTitle: res.data.data.giftTitle 251 + giftTitle: res.data.data.giftTitle,
  252 + is_head:1
258 }) 253 })
259 if (res.data.data.giftRemark == '') { 254 if (res.data.data.giftRemark == '') {
260 255
@@ -267,7 +262,6 @@ Page({ @@ -267,7 +262,6 @@ Page({
267 }) 262 })
268 } 263 }
269 _this2.setData({ 264 _this2.setData({
270 - giftDate: res.data.data.endTime,  
271 giftPosPrice: res.data.data.giftPosPrice, 265 giftPosPrice: res.data.data.giftPosPrice,
272 giftQty: res.data.data.giftQty, 266 giftQty: res.data.data.giftQty,
273 giftIntegral: res.data.data.payIntegral, 267 giftIntegral: res.data.data.payIntegral,
@@ -345,6 +339,5 @@ Page({ @@ -345,6 +339,5 @@ Page({
345 var th = this; 339 var th = this;
346 var nav_b = th.selectComponent("#nav_b"); //组件的id 340 var nav_b = th.selectComponent("#nav_b"); //组件的id
347 nav_b.close_box(); 341 nav_b.close_box();
348 - nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy");  
349 } 342 }
350 }); 343 });
351 \ No newline at end of file 344 \ No newline at end of file
pages/user/assistance/giftpacklist.json
1 { 1 {
2 - "navigationBarTitleText": "助力详情", 2 + "navigationBarTitleText": "礼包详情",
3 "usingComponents": { 3 "usingComponents": {
4 "warn": "/components/long_warn/long_warn", 4 "warn": "/components/long_warn/long_warn",
5 "my_confirm": "/components/my_confirm/my_confirm", 5 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/giftpacklist.wxml
1 -<view class="box data-v-3a5b7e36"> 1 +<view wx:if="{{is_head}}" class="box data-v-3a5b7e36" bindtap="close">
2 <view class="box_top data-v-3a5b7e36"> 2 <view class="box_top data-v-3a5b7e36">
3 <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="giftImage"></image> 3 <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="giftImage"></image>
4 </view> 4 </view>
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <view class="top_title data-v-3a5b7e36"> 6 <view class="top_title data-v-3a5b7e36">
7 <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> 7 <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text>
8 </view> 8 </view>
9 - <view wx:if="{{giftDate}}" class="top_time data-v-3a5b7e36"> 9 + <view wx:if="{{giftDate!=''}}" class="top_time data-v-3a5b7e36">
10 <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> 10 <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text>
11 </view> 11 </view>
12 <view class="top_price data-v-3a5b7e36"> 12 <view class="top_price data-v-3a5b7e36">
@@ -65,27 +65,30 @@ @@ -65,27 +65,30 @@
65 <view class="box_ware_item_qty data-v-3a5b7e36"> 65 <view class="box_ware_item_qty data-v-3a5b7e36">
66 <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text> 66 <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text>
67 </view> 67 </view>
68 - <view class="box_ware_code data-v-3a5b7e36">  
69 - <block wx:if="{{c_state==0}}">  
70 - <block wx:if="{{item.lbType==1}}">  
71 - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image> 68 + <!-- 已完成方可显示 -->
  69 + <block wx:if="{{is_type==2}}">
  70 + <view class="box_ware_code data-v-3a5b7e36">
  71 + <block wx:if="{{c_state==0}}">
  72 + <block wx:if="{{item.lbType==1}}">
  73 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image>
  74 + </block>
72 </block> 75 </block>
73 - </block>  
74 - <block wx:else>  
75 - <block wx:if="{{isBuy==0&item.lbType==1}}">  
76 - <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image> 76 + <block wx:else>
  77 + <block wx:if="{{isBuy==0&item.lbType==1}}">
  78 + <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image>
  79 + </block>
77 </block> 80 </block>
78 - </block>  
79 - <block wx:if="{{item.lbType==2}}">  
80 - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/coupons/coupons" bindtap="goto"></image>  
81 - </block>  
82 - <block wx:if="{{item.lbType==3}}">  
83 - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image>  
84 - </block>  
85 - <block wx:if="{{item.lbType>3}}">  
86 - <text class="data-v-3a5b7e36">奖励已发放</text>  
87 - </block>  
88 - </view> 81 + <block wx:if="{{item.lbType==2}}">
  82 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/coupons/coupons" bindtap="goto"></image>
  83 + </block>
  84 + <block wx:if="{{item.lbType==3}}">
  85 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image>
  86 + </block>
  87 + <block wx:if="{{item.lbType>3}}">
  88 + <text class="data-v-3a5b7e36">奖励已发放</text>
  89 + </block>
  90 + </view>
  91 + </block>
89 </view> 92 </view>
90 </view> 93 </view>
91 </block> 94 </block>
@@ -99,21 +102,14 @@ @@ -99,21 +102,14 @@
99 </view> 102 </view>
100 </view> 103 </view>
101 <view class="foot_empty data-v-3a5b7e36"></view> 104 <view class="foot_empty data-v-3a5b7e36"></view>
102 - <block wx:if="{{isBuy==0}}">  
103 - <view class="foot_button data-v-3a5b7e36">  
104 - <block wx:if="{{true}}">  
105 - <block wx:if="{{receiveState}}">  
106 - <view class="foot_button_buy data-v-3a5b7e36 overdue">  
107 - <text class="data-v-3a5b7e36">已领取</text>  
108 - </view>  
109 - </block>  
110 - <block wx:else>  
111 - <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetReceive">  
112 - <text class="data-v-3a5b7e36">一键全部领取</text>  
113 - </view>  
114 - </block> 105 + <view class="foot_button data-v-3a5b7e36">
  106 + <block wx:if="{{is_type!=0}}">
  107 + <block wx:if="{{is_type==1}}">
  108 + <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetReceive">
  109 + <text class="data-v-3a5b7e36">一键全部领取</text>
  110 + </view>
115 </block> 111 </block>
116 - <block wx:else> 112 + <block wx:if="{{is_type==2}}">
117 <block wx:if="{{is_lb!=1}}"> 113 <block wx:if="{{is_lb!=1}}">
118 <view class="foot_button_buy data-v-3a5b7e36 overdue"> 114 <view class="foot_button_buy data-v-3a5b7e36 overdue">
119 <text class="data-v-3a5b7e36">无核销商品</text> 115 <text class="data-v-3a5b7e36">无核销商品</text>
@@ -123,7 +119,7 @@ @@ -123,7 +119,7 @@
123 <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode"> 119 <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode">
124 <text class="data-v-3a5b7e36">立即使用</text> 120 <text class="data-v-3a5b7e36">立即使用</text>
125 </view> 121 </view>
126 - <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue"> 122 + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue" bindtap="getcode">
127 <text class="data-v-3a5b7e36">商品已核销</text> 123 <text class="data-v-3a5b7e36">商品已核销</text>
128 </view> 124 </view>
129 <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue"> 125 <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue">
@@ -131,8 +127,13 @@ @@ -131,8 +127,13 @@
131 </view> 127 </view>
132 </block> 128 </block>
133 </block> 129 </block>
134 - </view>  
135 - </block> 130 + </block>
  131 + <block wx:else>
  132 + <view class="foot_button_buy data-v-3a5b7e36" bindtap="goto" data-url="/pages/index/index/index">
  133 + <text class="data-v-3a5b7e36">回到首页</text>
  134 + </view>
  135 + </block>
  136 + </view>
136 </view> 137 </view>
137 <!-- 引入提示组件 --> 138 <!-- 引入提示组件 -->
138 <warn id="warn"></warn> 139 <warn id="warn"></warn>
@@ -140,4 +141,4 @@ @@ -140,4 +141,4 @@
140 <!-- 弹出框扫描 --> 141 <!-- 弹出框扫描 -->
141 <qr_code id="qc_com"></qr_code> 142 <qr_code id="qc_com"></qr_code>
142 <!-- 制作一个圆球导航 --> 143 <!-- 制作一个圆球导航 -->
143 -<nav_b id="nav_b"></nav_b>  
144 \ No newline at end of file 144 \ No newline at end of file
  145 +<nav_b wx:if="{{is_head}}" id="nav_b"></nav_b>
145 \ No newline at end of file 146 \ No newline at end of file
pages/user/assistance/giftpacklist.wxss
1 - @charset "UTF-8"; 1 +@charset "UTF-8";
2 2
3 /* Author XGQ 3 /* Author XGQ
4 * 2019-12-12 4 * 2019-12-12
@@ -96,6 +96,7 @@ @@ -96,6 +96,7 @@
96 border: 2rpx solid #999; 96 border: 2rpx solid #999;
97 width: 120rpx; 97 width: 120rpx;
98 height: 120rpx; 98 height: 120rpx;
  99 + /* background-color: rgba(153, 153, 153, 0.664); */
99 } 100 }
100 101
101 .box_ware_item.data-v-3a5b7e36 { 102 .box_ware_item.data-v-3a5b7e36 {
@@ -239,6 +240,7 @@ page.data-v-3a5b7e36 { @@ -239,6 +240,7 @@ page.data-v-3a5b7e36 {
239 .foot_box_remark.data-v-3a5b7e36 .img { 240 .foot_box_remark.data-v-3a5b7e36 .img {
240 line-height: 0; 241 line-height: 0;
241 } 242 }
242 -.overdue.data-v-3a5b7e36{  
243 - background-color: rgb(153,153,153);  
244 -}  
245 \ No newline at end of file 243 \ No newline at end of file
  244 +
  245 +.overdue.data-v-3a5b7e36 {
  246 + background-color: rgb(153, 153, 153);
  247 +}
pages/user/assistance/task_assistance.js
@@ -32,10 +32,11 @@ Page({ @@ -32,10 +32,11 @@ Page({
32 dismantle: null, //帮拆记录数据集 32 dismantle: null, //帮拆记录数据集
33 is_user_task: null, //判断是不是领取的任务 33 is_user_task: null, //判断是不是领取的任务
34 zzjx_id: "", //真正进行的任务id 34 zzjx_id: "", //真正进行的任务id
35 - is_show:0,//任务的加载更多  
36 - is_bc_show:0,//帮拆的加载更多  
37 - bc_page:1,//帮拆的页码  
38 - rw_page:1,//任务的页码 35 + is_show: 0, //任务的加载更多
  36 + is_bc_show: 0, //帮拆的加载更多
  37 + bc_page: 1, //帮拆的页码
  38 + rw_page: 1, //任务的页码
  39 + block: 0, //阻断助力的用户图片多次添加
39 //*********************************************start钱 40 //*********************************************start钱
40 canvasHidden: 0, //分享图片是否已经生成 41 canvasHidden: 0, //分享图片是否已经生成
41 is_share: 0, //是否显示画布 42 is_share: 0, //是否显示画布
@@ -46,7 +47,12 @@ Page({ @@ -46,7 +47,12 @@ Page({
46 "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png", 47 "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png",
47 "/public/upload/libao/temp/2019/12-20/51f251f44ea0f67b8efdc5bfa3a434b0.jpg" 48 "/public/upload/libao/temp/2019/12-20/51f251f44ea0f67b8efdc5bfa3a434b0.jpg"
48 ], //固的分享图片 49 ], //固的分享图片
49 - dynamic: [], //已助力的微信头像数组 50 +
  51 + dynamic: null, //已助力的微信头像数组
  52 + head_pic_arr: [], //助力的头像
  53 + share_lb_img: "", //分享的礼包图片
  54 +
  55 +
50 is_generate: 0, //是否重复点击拆一拆 56 is_generate: 0, //是否重复点击拆一拆
51 already: 0, //已有几人助力 57 already: 0, //已有几人助力
52 lack: 0, //还差几人助力 58 lack: 0, //还差几人助力
@@ -59,8 +65,10 @@ Page({ @@ -59,8 +65,10 @@ Page({
59 * 生命周期函数--监听页面加载 65 * 生命周期函数--监听页面加载
60 */ 66 */
61 onLoad: function(options) { 67 onLoad: function(options) {
62 - var help_id = options.help_id;  
63 var th = this; 68 var th = this;
  69 + var help_id = options.help_id;
  70 + var nav_b = th.selectComponent("#nav_b"); //组件的id
  71 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
64 th.setData({ 72 th.setData({
65 help_id: help_id 73 help_id: help_id
66 }); 74 });
@@ -73,7 +81,7 @@ Page({ @@ -73,7 +81,7 @@ Page({
73 th.close(); 81 th.close();
74 th.syinfo(); 82 th.syinfo();
75 th.imageinfo(); 83 th.imageinfo();
76 - //end 84 +
77 }, 85 },
78 86
79 87
@@ -93,7 +101,7 @@ Page({ @@ -93,7 +101,7 @@ Page({
93 function(res) { 101 function(res) {
94 if (res.data.code == 0) { 102 if (res.data.code == 0) {
95 getApp().my_warnning(res.data.data, 1, th); 103 getApp().my_warnning(res.data.data, 1, th);
96 - //判断是不是领取的任务 104 + //判断是不是领取的任务
97 th.get_user_task(); 105 th.get_user_task();
98 //会员任务列表 106 //会员任务列表
99 th.user_task_list(); 107 th.user_task_list();
@@ -139,11 +147,11 @@ Page({ @@ -139,11 +147,11 @@ Page({
139 147
140 //任务时间 设置全局定时器 148 //任务时间 设置全局定时器
141 th.setData({ 149 th.setData({
142 - timer:setInterval(function () { 150 + timer: setInterval(function() {
143 th.countDown(); 151 th.countDown();
144 }, 1000) 152 }, 1000)
145 }) 153 })
146 - 154 +
147 155
148 } 156 }
149 } 157 }
@@ -179,7 +187,6 @@ Page({ @@ -179,7 +187,6 @@ Page({
179 }); 187 });
180 var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; 188 var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty;
181 var taskid = data_aissa[0].id; 189 var taskid = data_aissa[0].id;
182 - console.log("参考", data_aissa);  
183 th.setData({ 190 th.setData({
184 aitem: data_aissa, 191 aitem: data_aissa,
185 task_number: task_number, 192 task_number: task_number,
@@ -200,16 +207,12 @@ Page({ @@ -200,16 +207,12 @@ Page({
200 207
201 //会员任务列表 208 //会员任务列表
202 this.user_task_list(); 209 this.user_task_list();
203 - //获取助力活动参与的人数 210 + //获取助力活动参与的人数
204 this.get_user_task_num(); 211 this.get_user_task_num();
205 212
206 }, 213 },
207 214
208 215
209 -  
210 -  
211 -  
212 -  
213 //帮拆记录的 216 //帮拆记录的
214 dismantle_record: function(e) { 217 dismantle_record: function(e) {
215 var aitem = this.data.aitem; //任务的数据集 218 var aitem = this.data.aitem; //任务的数据集
@@ -242,15 +245,16 @@ Page({ @@ -242,15 +245,16 @@ Page({
242 success: function(res) { 245 success: function(res) {
243 if (res.data.code == 0) { 246 if (res.data.code == 0) {
244 var dismantle = res.data.data.pageData[0].zlHelpUser; 247 var dismantle = res.data.data.pageData[0].zlHelpUser;
245 - if(res.data.data.total>5){ 248 + if (res.data.data.total > 5) {
246 var bc_page = th.data.bc_page + 1; 249 var bc_page = th.data.bc_page + 1;
247 - th.data({ bc_page: bc_page,  
248 - is_bc_show:1 250 + th.data({
  251 + bc_page: bc_page,
  252 + is_bc_show: 1
249 }) 253 })
250 - }else{  
251 - getApp().showWarning("暂无更多内容", 0); 254 + } else {
  255 + getApp().showWarning("暂无更多内容", 0, th);
252 } 256 }
253 - 257 +
254 th.setData({ 258 th.setData({
255 dismantle: dismantle 259 dismantle: dismantle
256 }); 260 });
@@ -265,15 +269,13 @@ Page({ @@ -265,15 +269,13 @@ Page({
265 }, 269 },
266 // 领取礼包 270 // 领取礼包
267 get_libao: function(e) { 271 get_libao: function(e) {
268 - var libao_id = e.currentTarget.dataset.libaoid;  
269 - var completeid = e.currentTarget.dataset.completeid;  
270 - console.log("礼包id", libao_id);  
271 - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1 + "&completeid=" + completeid); 272 + var libao_id = e.currentTarget.dataset.libaoid; //礼包id
  273 + getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1);
272 }, 274 },
273 //查看礼包id 275 //查看礼包id
274 - select_libao: function() {  
275 - var libao_id = e.currentTarget.dataset.libaoid;  
276 - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 0); 276 + select_libao: function(e) {
  277 + var orderSn = e.currentTarget.dataset.orderSn;
  278 + getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn);
277 }, 279 },
278 280
279 //划动的时候监听 281 //划动的时候监听
@@ -283,8 +285,6 @@ Page({ @@ -283,8 +285,6 @@ Page({
283 var aitem = this.data.aitem; 285 var aitem = this.data.aitem;
284 var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty; 286 var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty;
285 var task_id = aitem[ind].id; 287 var task_id = aitem[ind].id;
286 - console.log("划动的任务总数", task_number, "任务所有的参数", aitem,  
287 - "任务id", task_id);  
288 th.setData({ 288 th.setData({
289 sw_index: ind, 289 sw_index: ind,
290 task_number: task_number, 290 task_number: task_number,
@@ -304,7 +304,6 @@ Page({ @@ -304,7 +304,6 @@ Page({
304 var th = this; 304 var th = this;
305 var nav_b = th.selectComponent("#nav_b"); //组件的id 305 var nav_b = th.selectComponent("#nav_b"); //组件的id
306 nav_b.close_box(); 306 nav_b.close_box();
307 - nav_b.set_name("助力", "/pages/user/assistance/assistance");  
308 }, 307 },
309 // 获取会员的参与的任务列表 我的任务 308 // 获取会员的参与的任务列表 我的任务
310 user_task_list: function(e) { 309 user_task_list: function(e) {
@@ -324,30 +323,27 @@ Page({ @@ -324,30 +323,27 @@ Page({
324 }); 323 });
325 var help_id = th.data.help_id; 324 var help_id = th.data.help_id;
326 var user_id = getApp().globalData.user_id; 325 var user_id = getApp().globalData.user_id;
327 - var rw_page=th.data.rw_page; 326 + var rw_page = th.data.rw_page;
328 rq.get("/api/weshop/marketing/help/help/user/page", { 327 rq.get("/api/weshop/marketing/help/help/user/page", {
329 data: { 328 data: {
330 - page:rw_page,  
331 - pageSize:5, 329 + page: rw_page,
  330 + pageSize: 5,
332 helpId: help_id, 331 helpId: help_id,
333 storeId: os.stoid, 332 storeId: os.stoid,
334 userId: user_id 333 userId: user_id
335 }, 334 },
336 success: function(su) { 335 success: function(su) {
337 if (su.data.code == 0) { 336 if (su.data.code == 0) {
338 - if (su.data.data.total > 5){ 337 + if (su.data.data.total > 5) {
  338 + var rw_page = th.data.rw_page + 1;
339 th.setData({ 339 th.setData({
340 rw_page: rw_page, 340 rw_page: rw_page,
341 is_show: 1 341 is_show: 1
342 }) 342 })
  343 + getApp().my_warnning();
343 getApp().showWarning("暂无更多内容", 0); 344 getApp().showWarning("暂无更多内容", 0);
344 - }else{  
345 - var rw_page = th.data.rw_page + 1;  
346 - th.setData({  
347 - rw_page: rw_page,  
348 -  
349 - })  
350 } 345 }
  346 +
351 var user_list = su.data.data.pageData; 347 var user_list = su.data.data.pageData;
352 th.setData({ 348 th.setData({
353 user_task_list: user_list 349 user_task_list: user_list
@@ -389,7 +385,6 @@ Page({ @@ -389,7 +385,6 @@ Page({
389 storeId: os.stoid, 385 storeId: os.stoid,
390 }, 386 },
391 success: function(su) { 387 success: function(su) {
392 - console.log(su.data.code, "获取助力活动参与的人数", su.data)  
393 if (su.data.code == 0) { 388 if (su.data.code == 0) {
394 var usercount = su.data.data.countAll; 389 var usercount = su.data.data.countAll;
395 390
@@ -413,7 +408,6 @@ Page({ @@ -413,7 +408,6 @@ Page({
413 swiperError: swiperError 408 swiperError: swiperError
414 }) 409 })
415 if (swiperError >= 3) { //在开关被触发3次以上 410 if (swiperError >= 3) { //在开关被触发3次以上
416 - console.error(this.data.swiperError)  
417 this.setData({ 411 this.setData({
418 sw_index: this.data.preIndex 412 sw_index: this.data.preIndex
419 }); //,重置current为正确索引 413 }); //,重置current为正确索引
@@ -504,7 +498,6 @@ Page({ @@ -504,7 +498,6 @@ Page({
504 498
505 // var o = endTimeList[i]; 499 // var o = endTimeList[i];
506 var endTime = th.data.endDate; 500 var endTime = th.data.endDate;
507 - console.log("结束时间5555555", endTime);  
508 // if (o.status == 0) endTime = o.start_time 501 // if (o.status == 0) endTime = o.start_time
509 502
510 var obj = null; 503 var obj = null;
@@ -531,7 +524,7 @@ Page({ @@ -531,7 +524,7 @@ Page({
531 sec: '00' 524 sec: '00'
532 } 525 }
533 } 526 }
534 - var txt = "aitem[" +0+ "].djs"; 527 + var txt = "aitem[" + 0 + "].djs";
535 th.setData({ 528 th.setData({
536 [txt]: obj 529 [txt]: obj
537 }); 530 });
@@ -582,238 +575,165 @@ Page({ @@ -582,238 +575,165 @@ Page({
582 } 575 }
583 }) 576 })
584 }, 577 },
585 - //钱 分享图  
586 - imageinfo: function() {  
587 - var th = this;  
588 - var images = th.data.images;  
589 - var iurl = th.data.iurl;  
590 - wx.getImageInfo({  
591 - src: iurl + images[0],  
592 - success: function(res) {  
593 - console.log(res + i);  
594 - //res.path是网络图片的本地地址  
595 - images[0] = res.path;  
596 - },  
597 - fail: function(res) {  
598 - console.log(res.toString() + "" + i);  
599 - }  
600 - });  
601 - wx.getImageInfo({  
602 - src: iurl + images[1],  
603 - success: function(res) {  
604 - console.log(res + i);  
605 - //res.path是网络图片的本地地址  
606 - images[1] = res.path;  
607 - },  
608 - fail: function(res) {  
609 - console.log(res.toString() + "" + i);  
610 - }  
611 - });  
612 - wx.getImageInfo({  
613 - src: iurl + images[2],  
614 - success: function(res) {  
615 - console.log(res + i);  
616 - //res.path是网络图片的本地地址  
617 - images[2] = res.path;  
618 - },  
619 - fail: function(res) {  
620 - console.log(res.toString() + "" + i);  
621 - }  
622 - });  
623 - wx.getImageInfo({  
624 - src: iurl + images[3],  
625 - success: function(res) {  
626 - console.log(res + i);  
627 - //res.path是网络图片的本地地址  
628 - images[3] = res.path;  
629 - },  
630 - fail: function(res) {  
631 - console.log(res.toString() + "" + i);  
632 - }  
633 - });  
634 - wx.getImageInfo({  
635 - src: iurl + images[4],  
636 - success: function(res) {  
637 - console.log(res + i);  
638 - //res.path是网络图片的本地地址  
639 - images[4] = res.path;  
640 - },  
641 - fail: function(res) {  
642 - console.log(res.toString() + "" + i);  
643 - }  
644 - });  
645 - wx.getImageInfo({  
646 - src: iurl + images[5],  
647 - success: function(res) {  
648 - console.log(res + i);  
649 - //res.path是网络图片的本地地址  
650 - images[5] = res.path;  
651 - },  
652 - fail: function(res) {  
653 - console.log(res.toString() + "" + i);  
654 - }  
655 - });  
656 - wx.getImageInfo({  
657 - src: iurl + images[6],  
658 - success: function(res) {  
659 - console.log(res + i);  
660 - //res.path是网络图片的本地地址  
661 - images[6] = res.path;  
662 - },  
663 - fail: function(res) {  
664 - console.log(res.toString() + "" + i);  
665 - }  
666 - });  
667 578
668 - wx.getImageInfo({  
669 - src: iurl + images[7],  
670 - success: function(res) {  
671 - console.log(res + i);  
672 - //res.path是网络图片的本地地址  
673 - images[7] = res.path;  
674 - },  
675 - fail: function(res) {  
676 - console.log(res.toString() + "" + i);  
677 - }  
678 - })  
679 - th.setData({  
680 - images: images  
681 - })  
682 -  
683 - },  
684 - //生成分享图,用于分享给好友帮拆  
685 - demolition: function() {  
686 - var th = this;  
687 579
688 580
689 - },  
690 //************************ */ 581 //************************ */
691 shareFrends: function(e) { 582 shareFrends: function(e) {
692 var th = this; 583 var th = this;
693 - var is_generate = th.data.is_generate; //是否重复提交拆一拆  
694 - if (is_generate == 0) {  
695 - th.setData({  
696 - is_generate: 1  
697 - })  
698 - var scene = th.data.gid;  
699 - ///二微码  
700 - // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +  
701 - // a.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";  
702 - var iurl = th.data.iurl; //图片地址前缀  
703 - const ctx = wx.createCanvasContext('share_id'); //绘图上下文  
704 - var unit = th.data.screenWidth / 750 * 1.35;  
705 - var numsize = 20 * unit; //几人助力字体大小  
706 - var size = 15 * unit;  
707 - var num = th.data.already; //已有几位好友助力  
708 - var q_num = th.data.lack; //还差几位好友助力  
709 - var already = num.toString().length + 1; //已有几位好友助力  
710 - var lack = q_num.toString().length + 1; //还差几位好友助力  
711 - var imagesize = 40 * unit; //助力人的图片大小  
712 - var left = 74 * unit; //助力人头像跟左边的距离  
713 - var spacing = 12 * unit; //助力人图片间距  
714 - var images = th.data.images;  
715 - ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片  
716 - ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片  
717 - ctx.drawImage(images[5], 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的背景图片  
718 - ctx.setFillStyle("rgb(221,153,116)");  
719 - ctx.setFontSize(size)  
720 - ctx.fillText("已有", 77 * unit, 430 * unit);  
721 - ctx.setFillStyle("#FF4746");  
722 - ctx.setFontSize(numsize)  
723 - ctx.fillText(num + "位", 108 * unit, 430 * unit);  
724 - ctx.setFillStyle("rgb(221,153,116)");  
725 - ctx.setFontSize(size)  
726 - ctx.fillText("好友助力,还差", 116 * unit + already * numsize * unit, 430 * unit);  
727 - ctx.setFillStyle("#FF4746");  
728 - ctx.setFontSize(numsize);  
729 - ctx.fillText(q_num + "位", 223 * unit + already * numsize * unit, 430 * unit);  
730 - ctx.setFillStyle("rgb(221,153,116)");  
731 - ctx.setFontSize(size);  
732 - ctx.fillText("达成助力", 230 * unit + lack * numsize * unit + already * numsize * unit, 430 * unit);  
733 - var c = q_num / num;  
734 - ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit);  
735 - ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit);  
736 - // var dynamic = th.data.dynamic; //助力的微信头像  
737 - // console.log(dynamic[0].headPic + "动态图片显示");  
738 - for (var i = 0; i < 6; i++) {  
739 - if (i < 0) {  
740 - // ctx.beginPath();  
741 - // ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI);  
742 - // ctx.setLineWidth(1);  
743 - // ctx.setStrokeStyle('red');  
744 - ctx.save();  
745 - ctx.beginPath(); //开始绘制  
746 - ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI);  
747 - ctx.setLineWidth(4 * unit);  
748 - ctx.setStrokeStyle('red');  
749 - ctx.setFillStyle("white");  
750 - ctx.fill();  
751 - ctx.clip();  
752 - ctx.drawImage(dynamic[i].headPic, left, 505 * unit - imagesize / 2, imagesize, imagesize);  
753 - ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制  
754 - } else {  
755 - // 助力人的头像  
756 - ctx.drawImage(images[4], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片 584 + if (th.data.is_generate) return;
  585 + th.data.is_generate = 1;
  586 +
  587 + var scene = 1;
  588 + ///二微码
  589 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  590 + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/index/index/index";
  591 + //读取文件成功则OK--
  592 + wx.getImageInfo({
  593 + src: path3,
  594 + success: function(res) {
757 595
  596 + var ewm_path = res.path; //
  597 + //var act_time="2019.06.26 - 2019.07.02"; //活动的时间
  598 + var bg_time = ut.formar_no_full(th.data.dynamic.beginDate);
  599 + var end_time = ut.formar_no_full(th.data.dynamic.endDate);
  600 + var act_time = bg_time + "-" + end_time;
  601 +
  602 +
  603 + var iurl = th.data.iurl; //图片地址前缀
  604 + const ctx = wx.createCanvasContext('share_id'); //绘图上下文
  605 + var unit = th.data.screenWidth / 750 * 1.35;
  606 + var numsize = 20 * unit; //几人助力字体大小
  607 + var head_list_img = th.data.head_pic_arr;
  608 + var num = th.data.head_pic_arr.length; //已有几位好友助力
  609 +
  610 + var aitem = th.data.aitem; //任务的数据集
  611 + var sw_index = th.data.sw_index; //轮播的下标
  612 + //任务id
  613 + var help_num = aitem[sw_index].helpNum;
  614 + var q_num = help_num - num; //还差几位好友助力
  615 + var already = num.toString().length + 1; //已有几位好友助力
  616 + var lack = q_num.toString().length + 1; //还差几位好友助力
  617 +
  618 + var size = 15 * unit;
  619 + var imagesize = 40 * unit; //助力人的图片大小
  620 + var left = 74 * unit; //助力人头像跟左边的距离
  621 + var spacing = 12 * unit; //助力人图片间距
  622 + var images = th.data.images;
  623 + ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片
  624 + ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片
  625 +
  626 +
  627 + ctx.drawImage(th.data.share_lb_img, 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的礼包的背景图片
  628 +
  629 + ctx.setFillStyle("rgb(221,153,116)");
  630 + ctx.setFontSize(size)
  631 + ctx.fillText("已有", 77 * unit, 430 * unit);
  632 + ctx.setFillStyle("#FF4746");
  633 + ctx.setFontSize(numsize)
  634 + ctx.fillText(num + "位", 108 * unit, 430 * unit);
  635 + ctx.setFillStyle("rgb(221,153,116)");
  636 + ctx.setFontSize(size)
  637 + ctx.fillText("好友助力,还差", 116 * unit + already * numsize * unit, 430 * unit);
  638 + ctx.setFillStyle("#FF4746");
  639 + ctx.setFontSize(numsize);
  640 + ctx.fillText(q_num + "位", 223 * unit + already * numsize * unit, 430 * unit);
  641 + ctx.setFillStyle("rgb(221,153,116)");
  642 + ctx.setFontSize(size);
  643 + ctx.fillText("达成助力", 230 * unit + lack * numsize * unit + already * numsize * unit, 430 * unit);
  644 + var c = num / help_num;
  645 + ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit);
  646 + ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit);
  647 + var head_list_num = 30;
  648 + var is_head_list = 0;
  649 + if (help_num < 8) {
  650 + // 判断已助力的人数
  651 +
  652 + for (var a = 0; a < head_list_img.length; a++) {
  653 + ctx.save();
  654 + ctx.beginPath(); //开始绘制
  655 + ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI);
  656 + ctx.setLineWidth(4 * unit);
  657 + ctx.setStrokeStyle('red');
  658 + ctx.setFillStyle("white");
  659 + ctx.fill();
  660 + ctx.clip();
  661 + ctx.drawImage(head_list_img[a], left , 505 * unit - imagesize / 2, imagesize, imagesize);
  662 + ctx.restore();
  663 + left += imagesize + spacing;
  664 + }
  665 + //这个是还未助力的位置
  666 + for (var i = 0; i < q_num; i++) {
  667 + // 助力人的头像
  668 + ctx.drawImage(images[4], left , 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片
  669 + left += imagesize + spacing;
  670 + }
758 } 671 }
759 - left += imagesize + spacing;  
760 - }  
761 - ctx.setFillStyle("rgb(255,255,255)");  
762 - ctx.setFontSize(size);  
763 - ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit);  
764 - ctx.setFillStyle("rgb(255,255,255)");  
765 - ctx.setFontSize(size);  
766 - ctx.fillText("2019.06.26 - 2019.07.02!", 37 * unit, 620 * unit);  
767 - ctx.setFillStyle("rgb(255,255,255)");  
768 - ctx.setFontSize(size);  
769 - ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit);  
770 - ctx.drawImage(images[5], 325 * unit, 585 * unit, 77 * unit, 77 * unit); //分享的背景图片  
771 - ctx.save();  
772 - //读取文件成功则OK--  
773 - // wx.getImageInfo({  
774 - // src: path3,  
775 - // success: function (res) {  
776 - //把画板内容绘制成图片,并回调 画板图片路径  
777 - ctx.draw(false, function() {  
778 - setTimeout(function() {  
779 - wx.canvasToTempFilePath({  
780 - x: 0,  
781 - y: 0,  
782 - width: 300,  
783 - height: 500,  
784 - destWidth: 400 * 2,  
785 - destHeight: 720 * 2,  
786 - canvasId: 'share_id',  
787 - success: function(res) {  
788 - wx.hideLoading();  
789 - var shareImgPath = th.data.shareImgPath;  
790 - shareImgPath[0] = res.tempFilePath;  
791 -  
792 - th.setData({  
793 - shareImgPath: shareImgPath,  
794 - canvasHidden: 1,  
795 - is_share: 1,  
796 - is_generate: 0,  
797 - canvasHidden: 1  
798 - })  
799 - if (!res.tempFilePath) {  
800 - wx.showModal({  
801 - title: '提示',  
802 - content: '图片绘制中,请稍后重试',  
803 - showCancel: false 672 +
  673 +
  674 +
  675 + ctx.setFillStyle("rgb(255,255,255)");
  676 + ctx.setFontSize(size);
  677 + ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit);
  678 + ctx.setFillStyle("rgb(255,255,255)");
  679 + ctx.setFontSize(size);
  680 +
  681 + ctx.fillText(act_time, 37 * unit, 620 * unit); //绘制活动是时间
  682 + ctx.setFillStyle("rgb(255,255,255)");
  683 + ctx.setFontSize(size);
  684 + ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit);
  685 + ctx.drawImage(ewm_path, 325 * unit, 585 * unit, 77 * unit, 77 * unit); //分享的背景图片
  686 + ctx.save();
  687 + //读取文件成功则OK--
  688 + // wx.getImageInfo({
  689 + // src: path3,
  690 + // success: function (res) {
  691 + //把画板内容绘制成图片,并回调 画板图片路径
  692 + ctx.draw(false, function() {
  693 + setTimeout(function() {
  694 + wx.canvasToTempFilePath({
  695 + x: 0,
  696 + y: 0,
  697 + width: 300,
  698 + height: 500,
  699 + destWidth: 400 * 2,
  700 + destHeight: 720 * 2,
  701 + canvasId: 'share_id',
  702 + success: function(res) {
  703 + wx.hideLoading();
  704 + var shareImgPath = th.data.shareImgPath;
  705 + shareImgPath[0] = res.tempFilePath;
  706 +
  707 + th.setData({
  708 + shareImgPath: shareImgPath,
  709 + canvasHidden: 1,
  710 + is_share: 1,
  711 + is_generate: 0,
  712 + canvasHidden: 1
804 }) 713 })
805 - return false; 714 + if (!res.tempFilePath) {
  715 + wx.showModal({
  716 + title: '提示',
  717 + content: '图片绘制中,请稍后重试',
  718 + showCancel: false
  719 + })
  720 + return false;
  721 + }
  722 +
  723 + },
  724 + fail(r) {
  725 +
806 } 726 }
  727 + }, 500)
  728 + })
  729 + })
  730 + }
  731 + })
807 732
808 - },  
809 - fail(r) {  
810 733
811 - }  
812 - }, 500)  
813 - })  
814 - })  
815 - }  
816 }, 734 },
  735 +
  736 +
817 preview: function() { 737 preview: function() {
818 var th = this; 738 var th = this;
819 var shareImgPath = th.data.shareImgPath; 739 var shareImgPath = th.data.shareImgPath;
@@ -845,86 +765,31 @@ Page({ @@ -845,86 +765,31 @@ Page({
845 } 765 }
846 }) 766 })
847 }, 767 },
  768 +
848 //把固定的图片加载到本地 769 //把固定的图片加载到本地
849 - imageinfo: function() { 770 + imageinfo: async function() {
850 var th = this; 771 var th = this;
851 var images = th.data.images; 772 var images = th.data.images;
852 var iurl = th.data.iurl; 773 var iurl = th.data.iurl;
853 - wx.getImageInfo({  
854 - src: iurl + images[0],  
855 - success: function(res) {  
856 - //res.path是网络图片的本地地址  
857 - images[0] = res.path;  
858 - },  
859 - fail: function(res) {  
860 -  
861 - }  
862 - });  
863 - wx.getImageInfo({  
864 - src: iurl + images[1],  
865 - success: function(res) {  
866 - //res.path是网络图片的本地地址  
867 - images[1] = res.path;  
868 - },  
869 - fail: function(res) {  
870 -  
871 - }  
872 - });  
873 - wx.getImageInfo({  
874 - src: iurl + images[2],  
875 - success: function(res) {  
876 - //res.path是网络图片的本地地址  
877 - images[2] = res.path;  
878 - },  
879 - fail: function(res) {  
880 -  
881 - }  
882 - });  
883 - wx.getImageInfo({  
884 - src: iurl + images[3],  
885 - success: function(res) {  
886 -  
887 - //res.path是网络图片的本地地址  
888 - images[3] = res.path;  
889 - },  
890 - fail: function(res) {  
891 -  
892 - }  
893 - });  
894 - wx.getImageInfo({  
895 - src: iurl + images[4],  
896 - success: function(res) {  
897 -  
898 - //res.path是网络图片的本地地址  
899 - images[4] = res.path;  
900 - },  
901 - fail: function(res) {  
902 -  
903 - }  
904 - });  
905 - wx.getImageInfo({  
906 - src: iurl + images[5],  
907 - success: function(res) { 774 + for (var i in images) {
  775 + var img_path = iurl + images[i];
  776 + await getApp().request.promise_downimg(img_path).then(res => {
  777 + images[i] = res;
  778 + })
  779 + }
908 780
909 - //res.path是网络图片的本地地址  
910 - images[5] = res.path;  
911 - },  
912 - fail: function(res) { 781 + th.data.images = images;
  782 + },
913 783
914 - }  
915 - });  
916 - th.setData({  
917 - images: images  
918 - })  
919 784
920 - },  
921 //好友猜一猜 785 //好友猜一猜
922 save_share: function(e) { 786 save_share: function(e) {
923 var th = this; 787 var th = this;
924 var aitem = this.data.aitem; //任务的数据集 788 var aitem = this.data.aitem; //任务的数据集
925 var sw_index = this.data.sw_index; //轮播的下标 789 var sw_index = this.data.sw_index; //轮播的下标
  790 + var sw_item = aitem[sw_index];
926 //任务id 791 //任务id
927 - var taskid = aitem[sw_index].id 792 + var taskid = sw_item.id;
928 th.setData({ 793 th.setData({
929 is_share: 1 794 is_share: 1
930 }) 795 })
@@ -940,14 +805,14 @@ Page({ @@ -940,14 +805,14 @@ Page({
940 if (res.data.code == 0) { 805 if (res.data.code == 0) {
941 var data = res.data.data.pageData; //帮拆数组 806 var data = res.data.data.pageData; //帮拆数组
942 if (data.length > 0) { 807 if (data.length > 0) {
943 - // th.setData({  
944 - // dynamic: data  
945 - // })  
946 - // th.info_head(function() {  
947 - th.shareFrends();  
948 - // });  
949 - //th.imageinfo();  
950 - 808 + th.data.dynamic = data[0];
  809 + var path = th.data.iurl + sw_item.giftBagUrl;
  810 + //先获取礼包分享时的本地路径
  811 + getApp().request.promise_downimg(path).then(res => {
  812 + th.data.share_lb_img = res;
  813 + //先获取会员的头像
  814 + th.info_head(th.shareFrends);
  815 + });
951 } 816 }
952 } else { 817 } else {
953 wx.hideLoading(); 818 wx.hideLoading();
@@ -955,93 +820,33 @@ Page({ @@ -955,93 +820,33 @@ Page({
955 } 820 }
956 }) 821 })
957 }, 822 },
  823 +
958 //把已助力好友头像下载到本地 824 //把已助力好友头像下载到本地
959 - info_head: function(e) { 825 + info_head: async function(func) {
960 var th = this; 826 var th = this;
961 - var images = th.data.dynamic;  
962 - if (images[0] != null && images[0] != "" && images[0] != undefined) {  
963 - console.log(images[0].headPic + "就将计就计");  
964 - wx.getImageInfo({  
965 - src: images[0].headPic,  
966 - success: function(res) {  
967 - //res.path是网络图片的本地地址  
968 - images[0].headPic = res.path;  
969 - },  
970 - fail: function(res) {  
971 -  
972 - }  
973 - });  
974 - }  
975 - if (images[1] != null && images[1] != "" && images[1] != undefined) {  
976 - wx.getImageInfo({  
977 - src: images[1].headPic,  
978 - success: function(res) {  
979 - //res.path是网络图片的本地地址  
980 - images[1].headPic = res.path;  
981 - },  
982 - fail: function(res) {  
983 -  
984 - }  
985 - }); 827 + var images = th.data.dynamic.zlHelpUser;
  828 + console.log(images,"图片长度", images.length);
  829 + var arr = new Array();
  830 + var block = th.data.block;
  831 + if (images) {
  832 + th.data.head_pic_arr.length = 0;
  833 + for (var i in images) {
  834 + var img_path = images[i].headPic;
  835 + await getApp().request.promise_downimg(img_path).then(res => {
  836 + th.data.head_pic_arr.push(res);
  837 + })
  838 + }
986 } 839 }
987 - if (images[2] != null && images[2] != "" && images[2] != undefined) {  
988 - wx.getImageInfo({  
989 - src: images[2].headPic,  
990 - success: function(res) {  
991 - //res.path是网络图片的本地地址  
992 - images[2].headPic = res.path;  
993 - },  
994 - fail: function(res) { 840 + func();
  841 + },
995 842
996 - }  
997 - });  
998 - }  
999 - if (images[3] != null && images[3] != "" && images[3] != undefined) {  
1000 - wx.getImageInfo({  
1001 - src: images[3].headPic,  
1002 - success: function(res) {  
1003 - //res.path是网络图片的本地地址  
1004 - images[3].headPic = res.path;  
1005 - },  
1006 - fail: function(res) {  
1007 843
1008 - }  
1009 - });  
1010 - }  
1011 - // if (images[4] != null && images[4] != "" && images[4] != undefined) {  
1012 - // wx.getImageInfo({  
1013 - // src: images[4].headPic,  
1014 - // success: function(res) {  
1015 - // //res.path是网络图片的本地地址  
1016 - // images[4].headPic = res.path;  
1017 - // },  
1018 - // fail: function(res) {  
1019 -  
1020 - // }  
1021 - // });  
1022 - // }  
1023 - // if (images[5] != null && images[5] != "" && images[5] != undefined) {  
1024 - // wx.getImageInfo({  
1025 - // src: images[5].headPic,  
1026 - // success: function (res) {  
1027 - // //res.path是网络图片的本地地址  
1028 - // images[5].headPic = res.path;  
1029 - // },  
1030 - // fail: function (res) {  
1031 -  
1032 - // }  
1033 - // });  
1034 - //}  
1035 - th.setData({  
1036 - dynamic: images  
1037 - })  
1038 844
1039 - },  
1040 //礼包的详情 轮播图 845 //礼包的详情 轮播图
1041 libao_details: function(e) { 846 libao_details: function(e) {
1042 var th = this; 847 var th = this;
1043 - var help_id = th.data.help_id;//活动id  
1044 - var taskId = th.data.taskid;//任务id 848 + var help_id = th.data.help_id; //活动id
  849 + var taskId = th.data.taskid; //任务id
1045 getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId); 850 getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId);
1046 }, 851 },
1047 //正在进行任务 852 //正在进行任务
pages/user/assistance/task_assistance.json
1 { 1 {
2 "navigationBarTitleText": "好友助力,得好礼", 2 "navigationBarTitleText": "好友助力,得好礼",
3 - "navigationStyle": "custom",  
4 "usingComponents": { 3 "usingComponents": {
5 "warn": "/components/long_warn/long_warn", 4 "warn": "/components/long_warn/long_warn",
6 "my_confirm": "/components/my_confirm/my_confirm", 5 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/task_assistance.wxml
1 - <wxs module="filter" src="../../../utils/filter.wxs"></wxs>  
2 -<view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> 1 +<wxs module="filter" src="../../../utils/filter.wxs"></wxs>
  2 +<view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)" bindtap="close">
3 <!-- 助力活动头部 --> 3 <!-- 助力活动头部 -->
4 <view class="top-frame"> 4 <view class="top-frame">
5 - <view class="top-title white fs36 t-c">  
6 - {{aitem[sw_index].helpTaskName}} 5 + <view class="flex-center">
  6 + <view class="top-title white fs36 t-c ellipsis-1">
  7 + {{aitem[sw_index].helpTaskName}}
  8 + </view>
7 </view> 9 </view>
8 <view class="activity-data t-c fs28 white"> 10 <view class="activity-data t-c fs28 white">
9 - 活动剩余时间:<text class='tui-conutdown-box'> {{aitem[0].djs.day}}</text>:<text class='tui-conutdown-box'>{{aitem[0].djs.hou}}</text>:<text class='tui-conutdown-box'>{{aitem[0].djs.min}}</text>:<text class='tui-conutdown-box tui-countdown-bg'>{{aitem[0].djs.sec}}</text>  
10 - </view> 11 + 活动剩余时间:
  12 + <text class='tui-conutdown-box'> {{aitem[0].djs.day}}</text>:
  13 + <text class='tui-conutdown-box'>{{aitem[0].djs.hou}}</text>:
  14 + <text class='tui-conutdown-box'>{{aitem[0].djs.min}}</text>:
  15 + <text class='tui-conutdown-box tui-countdown-bg'>{{aitem[0].djs.sec}}</text>
  16 + </view>
11 </view> 17 </view>
12 <!-- 图片的轮播图 --> 18 <!-- 图片的轮播图 -->
13 <view class="xc-specific-more-frame flex-center"> 19 <view class="xc-specific-more-frame flex-center">
@@ -16,10 +22,10 @@ @@ -16,10 +22,10 @@
16 </view> 22 </view>
17 <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> 23 <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}">
18 <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> 24 <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx">
19 - 25 +
20 <image class="xc-center-img" bindtap="libao_details" src="{{iurl+aitem.giftBagUrl}}"></image> 26 <image class="xc-center-img" bindtap="libao_details" src="{{iurl+aitem.giftBagUrl}}"></image>
21 - <view class="abs select_details fs26 white">礼包详情</view>  
22 - 27 + <view class="abs select_details fs26 white">礼包详情</view>
  28 +
23 </swiper-item> 29 </swiper-item>
24 </swiper> 30 </swiper>
25 31
@@ -28,31 +34,31 @@ @@ -28,31 +34,31 @@
28 </view> 34 </view>
29 </view> 35 </view>
30 <view class="plan-frame flex ai-center" wx:if="{{is_user_task}}"> 36 <view class="plan-frame flex ai-center" wx:if="{{is_user_task}}">
31 - <view class="plan_num rel">  
32 - <view class="is_plam abs" style="width:{{(is_user_task.zlHelpNum/is_user_task.helpNum)*100}}%"></view>  
33 - </view>  
34 - 37 + <view class="plan_num rel">
  38 + <view class="is_plam abs" style="width:{{(is_user_task.zlHelpNum/is_user_task.helpNum)*100}}%"></view>
  39 + </view>
  40 +
  41 +
  42 + <text class="white fs24">{{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}}</text>
35 43
36 - <text class="white fs24">{{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}}</text>  
37 -  
38 </view> 44 </view>
39 <view class="task-number fs28 white t-c "> 45 <view class="task-number fs28 white t-c ">
40 今天剩余可领{{task_number}}个任务 46 今天剩余可领{{task_number}}个任务
41 </view> 47 </view>
42 48
43 - <view wx:if="{{is_user_task==null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="add_onlicke"> 49 + <view wx:if="{{is_user_task==null}}" class="task_clike fs40 t-c flex-center" data-taskid="{{taskid}}" bindtap="add_onlicke">
44 就选它了 50 就选它了
45 </view> 51 </view>
46 - <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center" bindtap="save_share">  
47 - 好友拆一拆 52 + <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center" bindtap="save_share">
  53 + 好友拆一拆
48 </view> 54 </view>
49 - <!-- <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test"> 55 + <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test" >
50 测试专用 56 测试专用
51 - </view> --> 57 + </view>
52 58
53 </view> 59 </view>
54 <!-- 底部列表 --> 60 <!-- 底部列表 -->
55 -<view style="margin-top:50rpx"> 61 +<view style="margin-top:{{is_user_task!=null?100:50}}rpx">
56 <!-- 标题 --> 62 <!-- 标题 -->
57 63
58 <view class="flex-vertical-between fs28 padding head"> 64 <view class="flex-vertical-between fs28 padding head">
@@ -67,66 +73,65 @@ @@ -67,66 +73,65 @@
67 </view> 73 </view>
68 74
69 <view class="white"> 75 <view class="white">
70 - 76 +
71 <view class="items" wx:if="{{is_task==0}}"> 77 <view class="items" wx:if="{{is_task==0}}">
72 -  
73 - <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}"wx:key="*this"> 78 +
  79 + <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}" wx:key="*this">
74 <view class="flex-center width"> 80 <view class="flex-center width">
75 <view class="ellipsis-1">{{item.helpTaskName}} 81 <view class="ellipsis-1">{{item.helpTaskName}}
76 </view> 82 </view>
77 </view> 83 </view>
78 <view class="flex-center width state"> 84 <view class="flex-center width state">
79 <view class="ellipsis-1"> 85 <view class="ellipsis-1">
80 - <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text>  
81 - <text wx:if="{{item.status==2}}"bindtap="select_libao" data-libaoid="{{item.order_sn}}">查看礼包</text>  
82 - <text wx:if="{{item.status==1}}"bindtap="get_libao"data-orderid="{{item.ordersn}}" data-libaoid="{{item.helpListGiftBagId}}"  
83 - data-completeid="{{item.id}}">领取礼包 </text> 86 + <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text>
  87 + <text wx:if="{{item.status==2}}" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</text>
  88 + <text wx:if="{{item.status==1}}" bindtap="get_libao" data-libaoid="{{item.helpListGiftBagId}}">领取礼包 </text>
84 </view> 89 </view>
85 </view> 90 </view>
86 91
87 </view> 92 </view>
88 93
89 <view class="fs30" wx:if="{{user_task_list==null || user_task_list==''}}"> 94 <view class="fs30" wx:if="{{user_task_list==null || user_task_list==''}}">
90 - <view class="flex-center nothing white">  
91 - <view>暂无任务记录</view>  
92 - </view>  
93 - </view> 95 + <view class="flex-center nothing white">
  96 + <view>暂无任务记录</view>
  97 + </view>
  98 + </view>
94 </view> 99 </view>
95 100
96 - 101 +
97 </view> 102 </view>
98 - 103 +
99 104
100 <view class="items" wx:if="{{is_task==1}}"> 105 <view class="items" wx:if="{{is_task==1}}">
101 - <block wx:if="{{ dismantle!=null|| dismantle!=''}}"> 106 + <block wx:if="{{ dismantle!=null|| dismantle!=''}}">
102 107
103 108
104 - <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}"wx:for-index="idx">  
105 -  
106 - <view class="flex white" style="justify-content: space-around; width: 90%;margin:auto">  
107 - <image class="circle user_img" src="{{item.headPic}}"></image>  
108 - <view class="ellipsis-1">{{item.nickName}}  
109 - </view>  
110 - <view class="ellipsis-1">{{filter.format_time(item.zltime)}} 109 + <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}" wx:for-index="idx">
  110 +
  111 + <view class="flex white" style="justify-content: space-around; width: 90%;margin:auto">
  112 + <image class="circle user_img" src="{{item.headPic}}"></image>
  113 + <view class="ellipsis-1 width">{{item.nickName}}
  114 + </view>
  115 + <view class="ellipsis-1">{{filter.format_time(item.zltime)}}
  116 + </view>
111 </view> 117 </view>
112 </view> 118 </view>
113 - </view>  
114 119
115 - <view class="flex-center fs32" wx:if="{{is_bc_show==1}}">  
116 - <view class="line"></view>  
117 - <view class="load white" bindtap="dismantle_record">点击加载更多</view>  
118 - <view class="line"></view>  
119 - </view>  
120 - </block>  
121 -  
122 - <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}">  
123 - <view class="flex-center nothing white">  
124 - <view>暂无任务记录</view> 120 + <view class="flex-center fs32" wx:if="{{is_bc_show==1}}">
  121 + <view class="line"></view>
  122 + <view class="load white" bindtap="dismantle_record">点击加载更多</view>
  123 + <view class="line"></view>
  124 + </view>
  125 + </block>
  126 +
  127 + <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}">
  128 + <view class="flex-center nothing white">
  129 + <view>暂无任务记录</view>
  130 + </view>
125 </view> 131 </view>
  132 +
126 </view> 133 </view>
127 -  
128 - </view>  
129 - 134 +
130 135
131 </view> 136 </view>
132 <!-- 加载更多 --> 137 <!-- 加载更多 -->
@@ -136,7 +141,7 @@ @@ -136,7 +141,7 @@
136 <view class="load white" bindtap="user_task_list">点击加载更多</view> 141 <view class="load white" bindtap="user_task_list">点击加载更多</view>
137 <view class="line"></view> 142 <view class="line"></view>
138 </view> 143 </view>
139 - <view class="flex-center white" style="margin-top: 20rpx;"> 144 + <view class="flex-center white" style="margin-top: 20rpx;" wx:if="{{usercount>0}}">
140 <view>已有</view> 145 <view>已有</view>
141 <view>{{usercount}}</view> 146 <view>{{usercount}}</view>
142 <view>人领取了任务</view> 147 <view>人领取了任务</view>
@@ -145,14 +150,14 @@ @@ -145,14 +150,14 @@
145 150
146 151
147 <!--********** 钱巧玲 --> 152 <!--********** 钱巧玲 -->
148 -<view wx:if="{{is_share}}" > 153 +<view wx:if="{{is_share}}">
149 154
150 <view class="dust"></view> 155 <view class="dust"></view>
151 <view class="canvas" style="width:100%;"> 156 <view class="canvas" style="width:100%;">
152 <view class="flex-center"> 157 <view class="flex-center">
153 <canvas canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas> 158 <canvas canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas>
154 </view> 159 </view>
155 - <view class="closes flex-center"> 160 + <view class="closes flex-center">
156 <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image> 161 <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image>
157 </view> 162 </view>
158 </view> 163 </view>
pages/user/assistance/task_assistance.wxss
1 -page{ 1 +page {
2 background: #d01119; 2 background: #d01119;
3 width: 100%; 3 width: 100%;
4 - height: 100% 4 + height: 100%;
5 5
6 } 6 }
7 -.top-back{ 7 +
  8 +
  9 +.top-back {
8 width: 100%; 10 width: 100%;
9 height: 60%; 11 height: 60%;
10 - background-repead:no-repead;  
11 - background-size:100% 100%;  
12 - 12 + background-repead: no-repead;
  13 + background-size: 100% 100%;
13 } 14 }
14 -.top-frame{ 15 +
  16 +.top-frame {
15 width: 100%; 17 width: 100%;
16 height: auto; 18 height: auto;
17 - padding-top: 50rpx  
18 -}  
19 -.top-title{  
20 - letter-spacing:10rpx 19 + padding-top: 50rpx;
21 } 20 }
22 -.activity-data{  
23 - padding-top: 10rpx; 21 +
  22 +.top-title {
24 letter-spacing: 10rpx; 23 letter-spacing: 10rpx;
  24 + width: 300rpx;
  25 +}
25 26
  27 +.activity-data {
  28 + padding-top: 10rpx;
  29 + letter-spacing: 2rpx;
26 } 30 }
27 -.xc-specific-more-frame{ 31 +
  32 +.xc-specific-more-frame {
28 width: 100%; 33 width: 100%;
29 height: 40%; 34 height: 40%;
30 -  
31 margin-top: 20rpx; 35 margin-top: 20rpx;
32 } 36 }
33 -.task-number{  
34 - margin-top: 50rpx 37 +
  38 +.task-number {
  39 + margin-top: 50rpx;
35 } 40 }
36 -.task_clike{ 41 +
  42 +.task_clike {
37 margin: auto; 43 margin: auto;
38 width: 60%; 44 width: 60%;
39 height: 65rpx; 45 height: 65rpx;
40 border-radius: 50rpx; 46 border-radius: 50rpx;
41 margin-top: 20rpx; 47 margin-top: 20rpx;
42 background: #fbda0e; 48 background: #fbda0e;
43 - color:#d01119; 49 + color: #d01119;
44 line-height: 65rpx; 50 line-height: 65rpx;
45 letter-spacing: 5rpx; 51 letter-spacing: 5rpx;
46 - box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6); 52 + box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6);
47 } 53 }
48 -/* 底部列表样式 */  
49 54
  55 +/* 底部列表样式 */
50 56
51 .head { 57 .head {
52 border-bottom: 4rpx solid rgb(253, 193, 7); 58 border-bottom: 4rpx solid rgb(253, 193, 7);
@@ -73,7 +79,7 @@ page{ @@ -73,7 +79,7 @@ page{
73 } 79 }
74 80
75 .unfinished { 81 .unfinished {
76 - width:35rpx; 82 + width: 35rpx;
77 height: 35rpx; 83 height: 35rpx;
78 margin-right: 10rpx; 84 margin-right: 10rpx;
79 } 85 }
@@ -110,27 +116,31 @@ page{ @@ -110,27 +116,31 @@ page{
110 .receive { 116 .receive {
111 padding-bottom: 50rpx; 117 padding-bottom: 50rpx;
112 } 118 }
113 -.xc-center-img{ 119 +
  120 +.xc-center-img {
114 width: 100%; 121 width: 100%;
115 - height: 100% 122 + height: 100%;
116 } 123 }
117 124
118 -.xc-left{ 125 +.xc-left {
119 width: 40rpx; 126 width: 40rpx;
120 height: 40rpx; 127 height: 40rpx;
121 } 128 }
122 -.bcolor {  
123 -border-color: #fff;  
124 129
  130 +.bcolor {
  131 + border-color: #fff;
125 } 132 }
126 -.xc-right{ 133 +
  134 +.xc-right {
127 width: 40rpx; 135 width: 40rpx;
128 height: 40rpx; 136 height: 40rpx;
129 } 137 }
130 -.user_img{ 138 +
  139 +.user_img {
131 width: 50rpx; 140 width: 50rpx;
132 - height: 50rpx; 141 + height: 50rpx;
133 } 142 }
  143 +
134 .dust { 144 .dust {
135 position: fixed; 145 position: fixed;
136 width: 100%; 146 width: 100%;
@@ -140,69 +150,74 @@ border-color: #fff; @@ -140,69 +150,74 @@ border-color: #fff;
140 } 150 }
141 151
142 .closes { 152 .closes {
143 - margin-top: 20rpx; 153 + margin-top: 20rpx;
144 } 154 }
145 155
146 .canvas { 156 .canvas {
147 position: fixed; 157 position: fixed;
148 z-index: 11; 158 z-index: 11;
149 width: 100%; 159 width: 100%;
150 - top:20rpx; 160 + top: 20rpx;
151 } 161 }
152 162
153 .close { 163 .close {
154 width: 70rpx; 164 width: 70rpx;
155 height: 70rpx; 165 height: 70rpx;
156 } 166 }
157 -.plan-frame{  
158 - width: 86%;  
159 - margin: auto; 167 +
  168 +.plan-frame {
  169 + width: 86%;
  170 + margin: auto;
160 margin-top: 50rpx; 171 margin-top: 50rpx;
161 -  
162 } 172 }
163 -.plan-frame .plan_num{  
164 - width: 90%;  
165 - background: #ffe7ab;  
166 - border-radius: 20rpx;  
167 - height: 22rpx; 173 +
  174 +.plan-frame .plan_num {
  175 + width: 90%;
  176 + background: #ffe7ab;
  177 + border-radius: 20rpx;
  178 + height: 22rpx;
168 margin-right: 10rpx; 179 margin-right: 10rpx;
169 } 180 }
170 -.is_plam{  
171 - border-radius: 20rpx; 181 +
  182 +.is_plam {
  183 + border-radius: 20rpx;
172 background: #fcc001; 184 background: #fcc001;
173 - height: 100%;  
174 - top: 0rpx;  
175 - left: 0rpx; 185 + height: 100%;
  186 + top: 0rpx;
  187 + left: 0rpx;
176 } 188 }
  189 +
177 .dust { 190 .dust {
178 position: fixed; 191 position: fixed;
179 width: 100%; 192 width: 100%;
180 height: 100%; 193 height: 100%;
181 - background-color: red; 194 + background-color: #d01119;
182 z-index: 10; 195 z-index: 10;
183 } 196 }
184 197
185 .closes { 198 .closes {
186 - margin-top: 20rpx; 199 + margin-top: 20rpx;
187 } 200 }
188 201
189 .canvas { 202 .canvas {
190 position: fixed; 203 position: fixed;
191 z-index: 20; 204 z-index: 20;
192 width: 100%; 205 width: 100%;
193 - top:20rpx; 206 + top: 20rpx;
194 } 207 }
195 208
196 .close { 209 .close {
197 width: 70rpx; 210 width: 70rpx;
198 height: 70rpx; 211 height: 70rpx;
199 } 212 }
200 -.select_details{ 213 +
  214 +.select_details {
201 width: 100%; 215 width: 100%;
202 height: 50rpx; 216 height: 50rpx;
203 line-height: 50rpx; 217 line-height: 50rpx;
204 text-align: center; 218 text-align: center;
205 - background: #000;  
206 - opacity:0.6; filter: alpha(opacity=60); 219 + background: #000;
  220 + opacity: 0.6;
  221 + filter: alpha(opacity=60);
207 bottom: 0rpx; 222 bottom: 0rpx;
208 -}  
209 \ No newline at end of file 223 \ No newline at end of file
  224 +}
pages/user/coupons/coupons.js
@@ -26,7 +26,9 @@ Page({ @@ -26,7 +26,9 @@ Page({
26 * 页面的初始数据 26 * 页面的初始数据
27 */ 27 */
28 data: { 28 data: {
29 - sheng:3, 29 + sheng:1, //是否有更多
  30 + overdue_sheng:1, //是否有更多
  31 +
30 details: [], //可使用的数据 32 details: [], //可使用的数据
31 sum: 0, //全部票 33 sum: 0, //全部票
32 val: 0, //可使用票 34 val: 0, //可使用票
@@ -49,14 +51,20 @@ Page({ @@ -49,14 +51,20 @@ Page({
49 udata: null, 51 udata: null,
50 iurl:os.imghost, 52 iurl:os.imghost,
51 is_show_dhwz:0, 53 is_show_dhwz:0,
  54 +
  55 + b_can_arr:null, //包邮券的未使用内容
  56 + b_out_arr:null, //包邮券的已过期的内容
  57 + b_isuse_arr:null,//包邮券的已使用的内容
  58 +
  59 + isloading:0, //正在加载中的代码
52 }, 60 },
53 // 点击选中二维码 61 // 点击选中二维码
54 click: function(e) { 62 click: function(e) {
55 var val = e.currentTarget.dataset.cashrepno; 63 var val = e.currentTarget.dataset.cashrepno;
56 getApp().globalData.val =val; 64 getApp().globalData.val =val;
57 - wx.navigateTo({  
58 - url: 'qr_code/qr_code',  
59 - }) 65 + wx.navigateTo({
  66 + url: 'qr_code/qr_code',
  67 + })
60 68
61 }, 69 },
62 // 点击返回主页 70 // 点击返回主页
@@ -136,134 +144,158 @@ Page({ @@ -136,134 +144,158 @@ Page({
136 var json_d = JSON.parse(ee.switch_list); 144 var json_d = JSON.parse(ee.switch_list);
137 th.setData({ is_show_dhwz: json_d.dhwz_switch }); 145 th.setData({ is_show_dhwz: json_d.dhwz_switch });
138 }) 146 })
  147 +
139 }, 148 },
140 149
141 150
142 onShow: function() { 151 onShow: function() {
143 - // this.setData({  
144 - // details: [],  
145 -  
146 - // });  
147 - this.myyhj();  
148 - 152 + var th=this;
  153 + wx.setNavigationBarTitle({ title: "我的优惠券", })
  154 +
149 //--先判断会员状态-- 155 //--先判断会员状态--
150 var user_info = getApp().globalData.userInfo; 156 var user_info = getApp().globalData.userInfo;
151 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { 157 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
152 wx.navigateTo({ url: '/pages/getphone/getphone', }) 158 wx.navigateTo({ url: '/pages/getphone/getphone', })
153 return false; 159 return false;
154 } 160 }
155 - wx.setNavigationBarTitle({  
156 - title: "我的优惠券",  
157 - }) 161 + this.init(th.myyhj);
  162 +
158 }, 163 },
  164 +
  165 + //----------券的界面初始化-----------
  166 + init:function(func){
  167 + var user_id = getApp().globalData.user_id;
  168 + var store_id = os.stoid;
  169 + var th=this;
  170 + rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + user_id, {
  171 + isShowLoading: 0,
  172 + success: function (su) {
  173 +
  174 + var data = su.data.data;
  175 + data.cashcount = parseInt(data.CashCount);
  176 + getApp().globalData.Integral = data.Integral;
  177 +
  178 + getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea",{data:{user_id: user_id, store_id: os.stoid, pageSize:200}}).then(res=>{
  179 + if(res.data.code==0 && res.data.data && res.data.data.total>0 ){
  180 + var b_arr=res.data.data.pageData;
  181 + var b_can_arr=[]; //未使用
  182 + var b_out_arr=[]; //已过期
  183 + var b_isuse_arr=[]; //已过期
  184 + for(var i in b_arr){
  185 + b_arr[i].isby=1;
  186 + if(b_arr[i].isuse==0){
  187 + if(b_arr[i].use_end_time<ut.gettimestamp()){
  188 + b_can_arr.push(b_arr[i]);
  189 + }else{
  190 + b_can_arr.push(b_arr[i]);
  191 + }
  192 +
  193 + }else{
  194 + b_isuse_arr.push(b_arr[i]);
  195 + }
  196 + }
  197 + data.cashcount= data.cashcount+b_arr.length; //加上包邮券的数量
  198 + th.data.b_can_arr=b_can_arr; //可使用
  199 + th.data.b_out_arr=b_out_arr; //过期
  200 + th.data.b_isuse_arr=b_isuse_arr; //已使用
  201 + th.setData({ udata: data});
  202 + func();
  203 +
  204 + }else{
  205 + th.setData({ udata: data});
  206 + func();
  207 + }
  208 + })
  209 +
  210 + }
  211 + })
  212 + },
  213 +
159 214
160 //获取劵的数量 215 //获取劵的数量
161 - async myyhj() {  
162 - //if (this.data.is_no_more) return;  
163 - var len = this.data.details.length;  
164 - this.data.current_page++;  
165 - var e = this,  
166 - sum, val, number;  
167 - var user_id = getApp().globalData.user_id;  
168 - var store_id = os.stoid;  
169 -  
170 -  
171 - console.log("参数", user_id, store_id);  
172 - rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + user_id, {  
173 - isShowLoading: 0,  
174 - success: function (su) { 216 + myyhj:function() {
  217 + if(this.data.isloading) return;
  218 +
  219 + var len = this.data.details.length;
  220 + this.data.current_page++;
  221 + var e = this, sum, val, number;
  222 + var user_id = getApp().globalData.user_id;
  223 + var store_id = os.stoid;
  224 + var th=this; var init_num=0;
175 225
176 - var data = su.data.data;  
177 -  
178 - data.cashcount = parseInt(data.CashCount);  
179 - getApp().globalData.Integral = data.Integral;  
180 - e.setData({ udata: data});  
181 -  
182 - }  
183 - })  
184 - var currentTab = this.data.currentTab;  
185 -  
186 - if (currentTab==0){  
187 - var get_data = {  
188 - user_id: user_id,  
189 - store_id: store_id,  
190 - IsUse: 0,  
191 - pageSize: 10,  
192 - page: e.data.current_page  
193 - };  
194 - var big_arr = this.data.details;  
195 - wx.showLoading();  
196 - await getApp().request.promiseGet("/api/weshop/users/listQuan", {  
197 - data: get_data,  
198 - }).then(res => {  
199 - var a = res.data;  
200 - val = a.data.total;  
201 -  
202 - var details = a.data.pageData;  
203 -  
204 - if (details.length == 0) {  
205 -  
206 - this.setData({sheng:0});  
207 - getApp().showWarning("未找更多数据");  
208 - return false;  
209 - }  
210 -  
211 - details.forEach(function (val, ind) {  
212 -  
213 - big_arr.push(val);  
214 - })  
215 -  
216 - this.setData({  
217 - details: big_arr,  
218 - });  
219 - setTimeout(function () {  
220 -  
221 - for (var i = 0; i < details.length; i++) {  
222 - var no = i + len;  
223 - qrcode('qrcode' + no, details[i].CashRepNo, 460, 460);  
224 - }  
225 - wx.hideLoading();  
226 - }, 1000)  
227 -  
228 - })  
229 - this.setData({  
230 - val: val  
231 - });  
232 - }  
233 - var get_data = {  
234 - user_id: user_id,  
235 - store_id: store_id,  
236 - IsUse:2,  
237 - pageSize: 1,  
238 - page: e.data.current_page  
239 - }; 226 + var get_data = {
  227 + user_id: user_id,
  228 + store_id: store_id,
  229 + IsUse: 0,
  230 + pageSize: 10,
  231 + page: e.data.current_page
  232 + };
  233 + var big_arr = this.data.details;
  234 + //可用券加入包邮券
  235 + if(big_arr.length==0 && this.data.b_can_arr){
  236 + big_arr=this.data.b_can_arr;
  237 + }
  238 + init_num=this.data.b_can_arr.length;
  239 +
  240 + wx.showLoading(); th.data.isloading=1;
  241 + getApp().request.promiseGet("/api/weshop/users/listQuan", {
  242 + data: get_data,
  243 + }).then(res => {
  244 + th.data.isloading=0;
  245 +
  246 + var a = res.data;
  247 + val = a.data.total;
  248 + var details = a.data.pageData;
  249 +
  250 + //没有找到优惠券的时候
  251 + if (details.length == 0 && th.data.current_page==1) {
  252 + this.setData({sheng:0});
  253 + getApp().showWarning("未找更多数据");
  254 + if(big_arr.length>0) {
  255 + th.setData({ details: big_arr, });
  256 + th.setData({ val: init_num});
  257 + setTimeout(function(){
  258 + details=big_arr;
  259 + for (var i = 0; i < details.length; i++) {
  260 + var no = i + len;
  261 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
  262 + }
  263 + },1000)
  264 + }
  265 + return false;
  266 + }
  267 +
  268 + th.setData({ val: val+init_num });
  269 +
  270 + //数组合并
  271 + big_arr=big_arr.concat(details);
  272 + //设置数组
  273 + th.setData({ details: big_arr, });
  274 +
  275 + //延迟显示二维码的内容
  276 + setTimeout(function () {
  277 + if(th.data.current_page==1) details=big_arr;
  278 + for (var i = 0; i < details.length; i++) {
  279 + var no = i + len;
  280 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
  281 + }
  282 + wx.hideLoading();
  283 + }, 1200)
  284 +
  285 + })
  286 +
240 287
241 - var big_arrs = this.data.details;  
242 - await getApp().request.promiseGet("/api/weshop/users/listQuan"  
243 - , {  
244 - data: get_data,  
245 - }).then(res => {  
246 - var a = res.data;  
247 - number= a.data.total;  
248 -  
249 - var details = a.data.pageData;  
250 -  
251 -  
252 - })  
253 - this.setData({  
254 - number: number  
255 - });  
256 -  
257 - 288 +
258 }, 289 },
259 - async overdue(){ 290 +
  291 + overdue:function(){
  292 + if(this.data.isloading) return;
260 293
261 var len = this.data.details.length; 294 var len = this.data.details.length;
262 this.data.current_page++; 295 this.data.current_page++;
263 - var e = this,  
264 - sum, val, number; 296 + var e = this,sum, val, number;
265 var user_id = getApp().globalData.user_id; 297 var user_id = getApp().globalData.user_id;
266 - var store_id = os.stoid; 298 + var store_id = os.stoid,init_num=0,th=this;
267 299
268 var get_data = { 300 var get_data = {
269 user_id: user_id, 301 user_id: user_id,
@@ -273,57 +305,74 @@ Page({ @@ -273,57 +305,74 @@ Page({
273 page: e.data.current_page 305 page: e.data.current_page
274 }; 306 };
275 var big_arr= this.data.details; 307 var big_arr= this.data.details;
276 - wx.showLoading();  
277 - await getApp().request.promiseGet("/api/weshop/users/listQuan" 308 + //可用券加入包邮券
  309 + if(big_arr.length==0 && this.data.b_out_arr){
  310 + big_arr=this.data.b_can_arr;
  311 + }
  312 + init_num=this.data.b_out_arr.length;
  313 +
  314 +
  315 + wx.showLoading();th.data.isloading=1;
  316 + getApp().request.promiseGet("/api/weshop/users/listQuan"
278 , { 317 , {
279 data: get_data, 318 data: get_data,
280 }).then(res => { 319 }).then(res => {
  320 +
  321 + th.data.isloading=0;
281 var a = res.data; 322 var a = res.data;
282 - number = a.data.total;  
283 - 323 + number = a.data.total;
284 var details = a.data.pageData; 324 var details = a.data.pageData;
285 325
286 -  
287 if (details.length == 0) { 326 if (details.length == 0) {
288 - //this.data.is_no_more = 1; 327 + this.setData({overdue_sheng:0});
289 getApp().showWarning("未找更多数据"); 328 getApp().showWarning("未找更多数据");
  329 + if( big_arr.length>0 && th.data.current_page==1) {
  330 + th.setData({ details: big_arr, });
  331 + th.setData({ number: init_num});
  332 + setTimeout(function(){
  333 + details=big_arr;
  334 + for (var i = 0; i < details.length; i++) {
  335 + var no = i + len;
  336 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
  337 + }
  338 + },1000)
  339 +
  340 + }
290 return false; 341 return false;
291 } 342 }
292 343
293 - details.forEach(function (val, ind) {  
294 -  
295 - big_arr.push(val);  
296 - })  
297 -  
298 - 344 + big_arr=big_arr.concat(details);
  345 +
299 this.setData({ 346 this.setData({
300 - details: big_arr, 347 + details: big_arr, number:number+init_num,
301 }); 348 });
  349 +
  350 +
  351 +
302 setTimeout(function () { 352 setTimeout(function () {
  353 + if(th.data.current_page==1) details=big_arr;
303 for (var i = 0; i < details.length; i++) { 354 for (var i = 0; i < details.length; i++) {
304 var no = i + len; 355 var no = i + len;
305 - qrcode('qrcode' + no, details[i].CashRepNo, 460, 460); 356 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
306 357
307 } 358 }
308 wx.hideLoading(); 359 wx.hideLoading();
309 -  
310 }, 800) 360 }, 800)
311 }) 361 })
312 }, 362 },
  363 +
313 //---加载更多是靠这个函数---- 364 //---加载更多是靠这个函数----
314 onReachBottom: function() { 365 onReachBottom: function() {
315 - var sheng=this.data.sheng;  
316 -  
317 - if (sheng==3){  
318 - this.myyhj();  
319 - }else{  
320 - getApp().showWarning("未找更多数据");  
321 - }  
322 - 366 + if(this.data.isloading) return false; //正在加载中,则不处理
323 var currentTab=this.data.currentTab; 367 var currentTab=this.data.currentTab;
324 if (currentTab==2){ 368 if (currentTab==2){
325 - this.overdue(); 369 + if(this.data.overdue_sheng==0) return false;
  370 + this.overdue();
326 } 371 }
  372 + if (currentTab==0){
  373 + if(this.data.sheng==0) return false;
  374 + this.myyhj();
  375 + }
327 }, 376 },
328 /** 377 /**
329 * 生命周期函数--监听页面隐藏 378 * 生命周期函数--监听页面隐藏
@@ -333,21 +382,6 @@ Page({ @@ -333,21 +382,6 @@ Page({
333 }, 382 },
334 383
335 /** 384 /**
336 - * 生命周期函数--监听页面卸载  
337 - */  
338 - onUnload: function() {  
339 -  
340 - },  
341 -  
342 - /**  
343 - * 页面相关事件处理函数--监听用户下拉动作  
344 - */  
345 - onPullDownRefresh: function() {  
346 -  
347 - },  
348 -  
349 -  
350 - /**  
351 * 用户点击右上角分享 385 * 用户点击右上角分享
352 */ 386 */
353 onShareAppMessage: function() { 387 onShareAppMessage: function() {
pages/user/coupons/coupons.wxml
@@ -28,6 +28,27 @@ @@ -28,6 +28,27 @@
28 </view> 28 </view>
29 <view wx:else> 29 <view wx:else>
30 <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> 30 <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail">
  31 + <block wx:if="{{detail.isby}}">
  32 + <view class="data" data-cashrepno='{{detail.no}}' bindtap='click'>
  33 + <canvas class="code" canvas-id="qrcode{{idx}}" /><view class="code_val">{{detail.no}}</view>
  34 + </view>
  35 + <view class="moneys">包邮券</view>
  36 + <view class="car-rim">
  37 + <view class="coupon_from">微券来源: 微信商城</view>
  38 + <view wx:if="{{detail.use_end_time!='' && detail.use_end_time!=null}}">
  39 +
  40 + <view class="text">有效期: {{time.format_time(detail.use_start_time)}}至{{time.format_time(detail.use_end_time)}}</view>
  41 + </view>
  42 + <view wx:else>
  43 + <view class="text" wx:if="{{detail.use_start_time!='' && detail.use_start_time!=null}}">有效期: time.format_time(detail.use_start_time)至不限</view>
  44 + <view class="text" wx:else>有效期:不限</view>
  45 + </view>
  46 + <view class="textss">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用 {{detail.title==null?"":",不包邮地区:"+detail.title}}</view>
  47 + </view>
  48 + </block>
  49 + <block wx:else>
  50 +
  51 +
31 <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'> 52 <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'>
32 <canvas class="code" canvas-id="qrcode{{idx}}" /> 53 <canvas class="code" canvas-id="qrcode{{idx}}" />
33 <view class="code_val">{{detail.CashRepNo}}</view> 54 <view class="code_val">{{detail.CashRepNo}}</view>
@@ -42,10 +63,11 @@ @@ -42,10 +63,11 @@
42 <view wx:else> 63 <view wx:else>
43 <view class="text">有效期:不限</view> 64 <view class="text">有效期:不限</view>
44 </view> 65 </view>
45 - <view class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用{{detail.region_list_name==null?"":",不包邮地区:"+region_list_name}} 66 + <view class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null?"":",不包邮地区:"+region_list_name}}
46 </view> 67 </view>
47 68
48 </view> 69 </view>
  70 + </block>
49 71
50 </block> 72 </block>
51 </view> 73 </view>
52 \ No newline at end of file 74 \ No newline at end of file
pages/user/coupons/query/index.js
@@ -30,7 +30,9 @@ Page({ @@ -30,7 +30,9 @@ Page({
30 ], 30 ],
31 display:false, 31 display:false,
32 is_no_more: 0, 32 is_no_more: 0,
33 - current_page:0, 33 + current_page:1,
  34 + by_list:[],
  35 + islading:0,
34 }, 36 },
35 /** 37 /**
36 * 生命周期函数--监听页面加载 38 * 生命周期函数--监听页面加载
@@ -65,9 +67,7 @@ Page({ @@ -65,9 +67,7 @@ Page({
65 // }, 67 // },
66 //监听输入框显示清空按钮 68 //监听输入框显示清空按钮
67 watchPassWord: function (event) { 69 watchPassWord: function (event) {
68 - console.log("监听输入框显示清空按钮");  
69 var val = event.detail.value; 70 var val = event.detail.value;
70 - console.log("是什么", val);  
71 if (val != "" && val != null) { 71 if (val != "" && val != null) {
72 var isBind = false; 72 var isBind = false;
73 this.setData({ isBind: isBind }); 73 this.setData({ isBind: isBind });
@@ -78,7 +78,6 @@ Page({ @@ -78,7 +78,6 @@ Page({
78 * 点击下拉框 78 * 点击下拉框
79 */ 79 */
80 bindShowMsg() { 80 bindShowMsg() {
81 - console.log(!this.data.select);  
82 this.setData({ 81 this.setData({
83 select: !this.data.select 82 select: !this.data.select
84 }) 83 })
@@ -87,7 +86,6 @@ Page({ @@ -87,7 +86,6 @@ Page({
87 * 已选下拉框 86 * 已选下拉框
88 */ 87 */
89 mySelect(e) { 88 mySelect(e) {
90 - console.log(e)  
91 var name = e.currentTarget.dataset.name; 89 var name = e.currentTarget.dataset.name;
92 this.setData({ 90 this.setData({
93 grade_name: name, 91 grade_name: name,
@@ -103,41 +101,38 @@ Page({ @@ -103,41 +101,38 @@ Page({
103 var stime = th.data.datet; 101 var stime = th.data.datet;
104 var etime = th.data.dates; 102 var etime = th.data.dates;
105 var tpye = th.data.grade_name; 103 var tpye = th.data.grade_name;
106 - console.log(tpye,"选中类型",stime, "数据绑定", etime) 104 +
107 //开始获取时间结束 105 //开始获取时间结束
108 - console.log(stime, "结束开始", etime);  
109 //删除字符中的—— 106 //删除字符中的——
110 var datatk = stime.replace(/[-]/g, ""); 107 var datatk = stime.replace(/[-]/g, "");
111 - console.log("aaa", datak);  
112 - var dataj = etime.replace(/[-]/g, "");  
113 - console.log("开始", datatk, "结束", dataj); 108 + var dataj = etime.replace(/[-]/g, "");
114 //转换类型 109 //转换类型
115 var datak = parseInt(datatk); 110 var datak = parseInt(datatk);
116 var dataj = parseInt(dataj); 111 var dataj = parseInt(dataj);
117 - console.log("sk", datak, "js", dataj); 112 +
118 //判断初始时间小于结束时间 113 //判断初始时间小于结束时间
119 if (datak > dataj) { 114 if (datak > dataj) {
120 - console.log("开始时间", datak, '结束时间', dataj, "时间判断");  
121 - getApp().showWarning("结束时间错误");  
122 - 115 + getApp().showWarning("结束时间错误");
123 } else { 116 } else {
124 this.setData({ details: [] }); 117 this.setData({ details: [] });
125 - console.log(datak, dataj, "时间判断2");  
126 - console.log("有进来吗", stime, etime);  
127 - this.setData({ current_page: 0 }); 118 + this.data.current_page=1;
  119 + this.data.is_no_more=0;
  120 + this.data.by_list=[];
  121 + this.data.details=[];
128 this.wjquery(); 122 this.wjquery();
129 } 123 }
130 124
131 }, 125 },
132 //微卷查询流水明细 126 //微卷查询流水明细
133 - async wjquery() {  
134 - console.log("进来wjquery", this.data.is_no_more);  
135 -  
136 - //if (this.data.is_no_more) return; 127 + async wjquery() {
  128 + if (this.data.islading) return;
  129 + if(this.data.is_no_more) return;
  130 + this.data.islading=1;
  131 + var th=this;
  132 +
137 var len = this.data.details.length; 133 var len = this.data.details.length;
138 - this.data.current_page++;  
139 - var e = this,  
140 - sum, val, number; 134 +
  135 + var e = this,sum, val, number;
141 var user_id = getApp().globalData.user_id; 136 var user_id = getApp().globalData.user_id;
142 var store_id = os.stoid; 137 var store_id = os.stoid;
143 var stime = this.data.datet; 138 var stime = this.data.datet;
@@ -152,69 +147,108 @@ Page({ @@ -152,69 +147,108 @@ Page({
152 pageSize: 10, 147 pageSize: 10,
153 page: e.data.current_page 148 page: e.data.current_page
154 }; 149 };
  150 +
  151 + var dd={ user_id: user_id, store_id: store_id,pageSize: 100};
  152 + dd.isuse=0;
155 // 判断下拉框,添加类型 153 // 判断下拉框,添加类型
156 - if (tpye == "已使用"){  
157 - console.log("已使用"); 154 + if (tpye == "已使用"){
158 get_data.IsUse = 1; 155 get_data.IsUse = 1;
159 - } else if (tpye == "已过期"){  
160 - console.log("已过期"); 156 + dd.isuse=1;
  157 + } else if (tpye == "已过期"){
161 get_data.IsUse = 2; 158 get_data.IsUse = 2;
162 } else if (tpye == "未使用"){ 159 } else if (tpye == "未使用"){
163 - get_data.IsUse = 0; 160 + get_data.IsUse = 0;
164 } 161 }
165 if (etime != "" && etime != null) { 162 if (etime != "" && etime != null) {
166 get_data.EndDate = etime; 163 get_data.EndDate = etime;
  164 +
  165 + //时间要转成时间戳
  166 + var new_t=new Date(etime)/1000;
  167 + dd.etime=new_t;
167 } 168 }
168 169
169 if (stime != "" && stime != null) { 170 if (stime != "" && stime != null) {
170 - get_data.BeginDate= stime; 171 + get_data.BeginDate= stime;
  172 + //时间要转成时间戳
  173 + var new_t=new Date(stime)/1000;
  174 + dd.stime=new_t;
171 } 175 }
  176 +
  177 + var by_list=[];
  178 + if(th.data.current_page==1){
  179 + //先拿包邮券
  180 + await getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", {
  181 + data: dd,
  182 + }).then(res => {
  183 + if(res.data.code==0 && res.data.data && res.data.data.total>0){
  184 + by_list=res.data.data.pageData;
  185 + for(var i in by_list){
  186 + by_list[i].isby=1;
  187 + //过滤是时间的范围
  188 + if(get_data.IsUse == 2 && by_list[i].use_end_time>=ut.gettimestamp()){
  189 + th.data.by_list.push(by_list[i]);
  190 + }else if(get_data.IsUse == 0 && by_list[i].use_end_time<ut.gettimestamp()){
  191 + th.data.by_list.push(by_list[i]);
  192 + }else if(get_data.IsUse==1){
  193 + th.data.by_list.push(by_list[i]);
  194 + }else if(get_data.IsUse==undefined){
  195 + th.data.by_list.push(by_list[i]);
  196 + }
  197 + }
  198 + }
  199 + })
  200 + }
172 201
173 var big_arr = this.data.details; ///api/weshop / users / listQuan 202 var big_arr = this.data.details; ///api/weshop / users / listQuan
174 - await getApp().request.promiseGet("/api/weshop/users/listQuan", {  
175 - 203 + if(th.data.current_page==1 && th.data.by_list.length>0)
  204 + big_arr=th.data.by_list;
  205 +
  206 + await getApp().request.promiseGet("/api/weshop/users/listQuan", {
176 data: get_data, 207 data: get_data,
177 isShowLoading: 1 208 isShowLoading: 1
178 209
179 }).then(res => { 210 }).then(res => {
180 - console.log("1" + res); 211 +
  212 + th.data.islading=0;
181 var a = res.data; 213 var a = res.data;
182 var len = e.data.details.length; 214 var len = e.data.details.length;
183 var details = a.data.pageData; 215 var details = a.data.pageData;
184 - console.log("无限大乱斗" + details);  
185 -  
186 - if (details.length == 0) { 216 +
  217 + if (details.length == 0 ) {
187 this.data.is_no_more = 1; 218 this.data.is_no_more = 1;
188 getApp().showWarning("未找更多数据"); 219 getApp().showWarning("未找更多数据");
189 - 220 + if(th.data.by_list && th.data.current_page==1){
  221 + th.setData({ val: val,details:th.data.by_list});
  222 + details=th.data.by_list;
  223 + setTimeout(function () {
  224 + for (var i = 0; i < details.length; i++) {
  225 + var no = i + len;
  226 + qrcode('qrcode' + no, details[i].no,460, 460);
  227 + }
  228 + }, 100)
  229 + }
190 return false; 230 return false;
191 } 231 }
192 - console.log("无限大乱斗" + details);  
193 -  
194 - val = a.data.total;  
195 -  
196 -  
197 - console.log("长度", details.length);  
198 - details.forEach(function (val, ind) {  
199 - big_arr.push(val);  
200 - })  
201 - 232 +
  233 + th.data.current_page++;
  234 + val = a.data.total+th.data.by_list.length;
202 235
  236 + big_arr=big_arr.concat(details);
203 this.setData({ 237 this.setData({
204 - details: big_arr, 238 + details: big_arr,val: val
205 }); 239 });
206 240
207 setTimeout(function () { 241 setTimeout(function () {
  242 + if(by_list) details=big_arr;
208 for (var i = 0; i < details.length; i++) { 243 for (var i = 0; i < details.length; i++) {
209 var no = i + len; 244 var no = i + len;
210 - qrcode('qrcode' + no, details[i].CashRepNo,460, 460);  
211 - console.log("是三生三世" + no); 245 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no,460, 460);
212 } 246 }
213 }, 100) 247 }, 100)
214 }) 248 })
215 - this.setData({  
216 - val: val  
217 - }); 249 +
  250 +
  251 +
218 }, 252 },
219 //---加载更多是靠这个函数---- 253 //---加载更多是靠这个函数----
220 onReachBottom: function () { 254 onReachBottom: function () {
pages/user/coupons/query/index.wxml
@@ -52,10 +52,39 @@ @@ -52,10 +52,39 @@
52 </form> 52 </form>
53 </view> 53 </view>
54 <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> 54 <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail">
55 - <view wx:if="{{details!=[]}}">  
56 - <!-- 判断有没有数据有显示没有不显示 -->  
57 - <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'>  
58 - <view class="code_rim"> 55 +
  56 + <block wx:if="{{detail.isby}}">
  57 + <!-- 判断有没有数据有显示没有不显示 -->
  58 + <view class="data" data-cashrepno='{{detail.no}}' bindtap='click'>
  59 + <view class="code_rim">
  60 + <canvas class="code" canvas-id="qrcode{{idx}}" />
  61 + <view class="code_val">{{detail.no}}</view>
  62 + </view>
  63 +
  64 + <view class="moneys">包邮券</view>
  65 + <view class="car-rim">
  66 + <view class="text">微券来源: 微信商城</view>
  67 + <view wx:if="{{detail.use_end_time!=null}}">
  68 + <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 -->
  69 + <view class="text">有效期:
  70 + {{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}}
  71 + 至 {{ time.format_time(detail.use_end_time)}}</view>
  72 + </view>
  73 + <view wx:else>
  74 + <view class="text">有效期: 不限</view>
  75 + </view>
  76 + <view class="textss">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?",不包邮地区:"+detail.title:""}}
  77 + </view>
  78 + </view>
  79 + </view>
  80 +
  81 +
  82 +
  83 + </block>
  84 + <block wx:else>
  85 + <!-- 判断有没有数据有显示没有不显示 -->
  86 + <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'>
  87 + <view class="code_rim">
59 <canvas class="code" canvas-id="qrcode{{idx}}" /> 88 <canvas class="code" canvas-id="qrcode{{idx}}" />
60 <view class="code_val">{{detail.CashRepNo}}</view> 89 <view class="code_val">{{detail.CashRepNo}}</view>
61 </view> 90 </view>
@@ -77,6 +106,6 @@ @@ -77,6 +106,6 @@
77 </view> 106 </view>
78 </view> 107 </view>
79 </view> 108 </view>
80 -  
81 - </view> 109 + </block>
82 </block> 110 </block>
  111 +
pages/user/integral/integral.wxml
@@ -8,7 +8,6 @@ @@ -8,7 +8,6 @@
8 </view> 8 </view>
9 </view> 9 </view>
10 10
11 -  
12 <!--选择款--> 11 <!--选择款-->
13 <view class='top'> 12 <view class='top'>
14 <view class="jfmx-rim" bindtap="swichNav"> 13 <view class="jfmx-rim" bindtap="swichNav">
pages/user/my_service/i_service.wxml
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <image class="equity_money" src="{{iurl}}/miniapp/images//yyservice/equity.png" lazy-load="true"></image> 15 <image class="equity_money" src="{{iurl}}/miniapp/images//yyservice/equity.png" lazy-load="true"></image>
16 </block> 16 </block>
17 <!-- 金钱log --> 17 <!-- 金钱log -->
18 - <block wx:if="{{item.BuyType==1}}"> 18 + <block wx:if="{{item.BuyType==1 || item.BuyType==2 }}">
19 <image class="equity_money" src="{{iurl}}/miniapp/images/yyservice/money.png" lazy-load="true"></image> 19 <image class="equity_money" src="{{iurl}}/miniapp/images/yyservice/money.png" lazy-load="true"></image>
20 </block> 20 </block>
21 <!-- 礼包log --> 21 <!-- 礼包log -->
utils/filter.wxs
@@ -8,11 +8,13 @@ var filters = { @@ -8,11 +8,13 @@ var filters = {
8 }, 8 },
9 9
10 replace_time2: function (val) { 10 replace_time2: function (val) {
  11 + if(val==null || val==undefined || val=='') return "";
11 var a = val.split(" "); 12 var a = val.split(" ");
12 return a[0]; 13 return a[0];
13 }, 14 },
14 15
15 format_time:function(ts,isFull) { 16 format_time:function(ts,isFull) {
  17 + if(ts==null || ts==undefined || ts=='') return "";
16 var d = getDate(ts*1000) 18 var d = getDate(ts*1000)
17 var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-'); 19 var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-');
18 if(isFull==1) 20 if(isFull==1)
utils/request.js
@@ -238,6 +238,21 @@ module.exports = { @@ -238,6 +238,21 @@ module.exports = {
238 success: function (res) { succ(res);th.hideLoading(); }, 238 success: function (res) { succ(res);th.hideLoading(); },
239 fail:function(res){fail(res);} 239 fail:function(res){fail(res);}
240 }) 240 })
  241 + },
  242 +
  243 + promise_downimg(url){
  244 + return new Promise((resolve, reject) => {
  245 + wx.getImageInfo({
  246 + src: url,
  247 + success: function(res) {
  248 + //res.path是网络图片的本地地址
  249 + resolve(res.path);
  250 + },
  251 + fail: function(err) {
  252 + reject(err);
  253 + }
  254 + });
  255 + })
241 } 256 }
242 257
243 }; 258 };
244 \ No newline at end of file 259 \ No newline at end of file
utils/util.js
@@ -304,10 +304,23 @@ function draw_randon_rect(ctx,x,y,r,w,h){ @@ -304,10 +304,23 @@ function draw_randon_rect(ctx,x,y,r,w,h){
304 ctx.lineTo(x, y + r) 304 ctx.lineTo(x, y + r)
305 ctx.lineTo(x + r, y) 305 ctx.lineTo(x + r, y)
306 // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应 306 // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应
307 - ctx.fill();  
308 - 307 + ctx.fill();
309 } 308 }
310 309
  310 +/**
  311 + * @param {Object} num 数量,最大5
  312 + * @param {Object} x 中心坐标
  313 + * @param {Object} y y中心坐标
  314 + * @param {Object} sp 圆的间隔
  315 + * @param {Object} r 圆的半径
  316 + */
  317 +function get_box_arr(num,x,y,sp,r){
  318 + if(num==1) return [{x:x,y:y}];
  319 + if(num==2) return [{x:x-sp/2-r,y:y},{x:x+sp/2+r,y:y}];
  320 + if(num==3) return [{x:x-sp-2*r,y:y},{x:x,y:y},{x:x+sp+2*r,y:y}];
  321 + if(num==4) return [{x:x-sp/2-r-sp-2*r,y:y},{x:x-sp/2-r,y:y},{x:x+sp/2+r,y:y},{x:x+sp/2+r+sp+2*r,y:y}];
  322 + if(num==5) return [{x:x-2*sp-4*r,y:y},{x:x-sp-2*r,y:y},{x:x,y:y},{x:x+sp+2*r,y:y},{x:x+2*sp+4*r,y:y}];
  323 +}
311 324
312 function null_promise(){ 325 function null_promise(){
313 var promise=new Promise(function(resolve, reject){ var ob={code:-1,data:null}; resolve(ob); }); return promise; 326 var promise=new Promise(function(resolve, reject){ var ob={code:-1,data:null}; resolve(ob); }); return promise;
@@ -336,6 +349,11 @@ module.exports = { @@ -336,6 +349,11 @@ module.exports = {
336 for (var o in n) new RegExp("(" + o + ")").test(r) && (r = r.replace(RegExp.$1, 1 == RegExp.$1.length ? n[o] : ("00" + n[o]).substr(("" + n[o]).length))); 349 for (var o in n) new RegExp("(" + o + ")").test(r) && (r = r.replace(RegExp.$1, 1 == RegExp.$1.length ? n[o] : ("00" + n[o]).substr(("" + n[o]).length)));
337 return r; 350 return r;
338 }, 351 },
  352 + formar_no_full(e){
  353 + var t= new Date(1e3 * e);
  354 + return t.getFullYear() +"-"+(t.getMonth() + 1)+"-"+t.getDate();
  355 + },
  356 +
339 json2Form: function(e) { 357 json2Form: function(e) {
340 var r = []; 358 var r = [];
341 for (var t in e) r.push(encodeURIComponent(t) + "=" + encodeURIComponent(e[t])); 359 for (var t in e) r.push(encodeURIComponent(t) + "=" + encodeURIComponent(e[t]));
@@ -406,4 +424,5 @@ module.exports = { @@ -406,4 +424,5 @@ module.exports = {
406 getDistance:getDistance, //获取俩个经纬网度之间的距离 424 getDistance:getDistance, //获取俩个经纬网度之间的距离
407 draw_randon_rect:draw_randon_rect ,//画图画圆角矩形 425 draw_randon_rect:draw_randon_rect ,//画图画圆角矩形
408 null_promise:null_promise,//返回空的promise 426 null_promise:null_promise,//返回空的promise
  427 + get_box_arr:get_box_arr,//返回圆的数组
409 }; 428 };