Commit 3da31206a67c9e7ab8c221ed588b7e08bade07ea

Authored by 后端研发-苏明海
2 parents 8503ca2a 10a351aa

Merge branch 'dev' into 'test'

Dev

See merge request !247
components/nav_b/nav_b.wxss
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
22 text-align: center; 22 text-align: center;
23 width: 80rpx; 23 width: 80rpx;
24 height: 80rpx; 24 height: 80rpx;
  25 + line-height: 66rpx;
25 color: #ffff; 26 color: #ffff;
26 font-size: 50rpx; 27 font-size: 50rpx;
27 background: none; 28 background: none;
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -47,7 +47,6 @@ Page({ @@ -47,7 +47,6 @@ Page({
47 var my_confirm = th.selectComponent("#my_confirm"); //组件的id 47 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
48 var order_sn = e.currentTarget.dataset.order_sn; //订单号 48 var order_sn = e.currentTarget.dataset.order_sn; //订单号
49 var money = e.currentTarget.dataset.money; //支付金额 49 var money = e.currentTarget.dataset.money; //支付金额
50 -  
51 my_confirm.open( 50 my_confirm.open(
52 "是否确定购买该礼包", 51 "是否确定购买该礼包",
53 "取消", 52 "取消",
@@ -57,9 +56,6 @@ Page({ @@ -57,9 +56,6 @@ Page({
57 }, 56 },
58 function() { 57 function() {
59 my_confirm.open_cancel(0); 58 my_confirm.open_cancel(0);
60 - wx.showLoading({  
61 - title: '加载中',  
62 - })  
63 var json = { 59 var json = {
64 "actId": '', //活动Id 60 "actId": '', //活动Id
65 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 61 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -99,37 +95,7 @@ Page({ @@ -99,37 +95,7 @@ Page({
99 } 95 }
100 96
101 ) 97 )
102 - wx.request({  
103 - url: url,  
104 - data: data,  
105 - method: 'post',  
106 - header: {  
107 - 'content-type': 'application/json'  
108 - }, // 设置请求的 header  
109 - success: function(res) {  
110 - wx.hideLoading();  
111 - if (res.data.code == 0) {  
112 - var order_sn = res.data.data.orderSn;  
113 - res = res.data.data.result;  
114 - var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;  
115 - wx.requestPayment({  
116 - timeStamp: String(res.timeStamp),  
117 - nonceStr: res.nonceStr,  
118 - package: res.packageValue,  
119 - signType: res.signType,  
120 - paySign: res.paySign,  
121 - success: function(res) {  
122 - getApp().goto(url);  
123 - },  
124 - fail: function(res) {  
125 - getApp().my_confirm("取消支付", 0, th);  
126 - }  
127 - });  
128 - } else {  
129 - getApp().my_warnning(res.data.msg, 0, th);  
130 - }  
131 - }  
132 - }) 98 +
133 99
134 } 100 }
135 101
@@ -151,9 +117,6 @@ Page({ @@ -151,9 +117,6 @@ Page({
151 }, 117 },
152 function() { 118 function() {
153 my_confirm.open_cancel(0); 119 my_confirm.open_cancel(0);
154 - wx.showLoading({  
155 - title: '加载中',  
156 - })  
157 var json = { 120 var json = {
158 "actId": '', //活动Id 121 "actId": '', //活动Id
159 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 122 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -191,8 +154,7 @@ Page({ @@ -191,8 +154,7 @@ Page({
191 page: th.data.pages, 154 page: th.data.pages,
192 pageSize: th.data.pageSize 155 pageSize: th.data.pageSize
193 }, 156 },
194 - success: function success(res) {  
195 - wx.hideLoading(); 157 + success: function(res) {
196 if (res.data.code == 0) { 158 if (res.data.code == 0) {
197 th.data.curpage++; 159 th.data.curpage++;
198 var arr1 = th.data.wareCard; 160 var arr1 = th.data.wareCard;
@@ -236,9 +198,7 @@ Page({ @@ -236,9 +198,7 @@ Page({
236 var th = this; 198 var th = this;
237 if (th.data.total <= th.data.pageSize) return; 199 if (th.data.total <= th.data.pageSize) return;
238 if (th.data.ismore) return; 200 if (th.data.ismore) return;
239 - wx.showLoading({  
240 - title: '加载中...',  
241 - }) 201 +
242 th.getList(); 202 th.getList();
243 }, 203 },
244 //图片失败,默认图片 204 //图片失败,默认图片
pages/giftpack/giftpacklist/giftpacklist.js
@@ -61,7 +61,7 @@ Page({ @@ -61,7 +61,7 @@ Page({
61 }, 61 },
62 function() { 62 function() {
63 my_confirm.open_cancel(0); 63 my_confirm.open_cancel(0);
64 - 64 +
65 var json = { 65 var json = {
66 "actId": '', //活动Id 66 "actId": '', //活动Id
67 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 67 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -74,36 +74,36 @@ Page({ @@ -74,36 +74,36 @@ Page({
74 var data = JSON.stringify(json); 74 var data = JSON.stringify(json);
75 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; 75 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
76 76
77 - getApp().request.json_post(url,json,  
78 - function(res){  
79 - if (res.data.code == 0) {  
80 - var res = res.data.data;  
81 - var order_sn = res.orderSn;  
82 - var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;  
83 - wx.requestPayment({  
84 - timeStamp: String(res.result.timeStamp),  
85 - nonceStr: res.result.nonceStr,  
86 - package: res.result.packageValue,  
87 - signType: res.result.signType,  
88 - paySign: res.result.paySign,  
89 - success: function (n) {  
90 - getApp().goto(url);  
91 - },  
92 - fail: function (n) {  
93 - getApp().my_confirm("取消支付", 0, th);  
94 - }  
95 - });  
96 - } else {  
97 - getApp().my_warnning(res.data.msg, 0, th); 77 + getApp().request.json_post(url, json,
  78 + function(res) {
  79 + if (res.data.code == 0) {
  80 + var res = res.data.data;
  81 + var order_sn = res.orderSn;
  82 + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
  83 + wx.requestPayment({
  84 + timeStamp: String(res.result.timeStamp),
  85 + nonceStr: res.result.nonceStr,
  86 + package: res.result.packageValue,
  87 + signType: res.result.signType,
  88 + paySign: res.result.paySign,
  89 + success: function(n) {
  90 + getApp().goto(url);
  91 + },
  92 + fail: function(n) {
  93 + getApp().my_confirm("取消支付", 0, th);
  94 + }
  95 + });
  96 + } else {
  97 + getApp().my_warnning(res.data.msg, 0, th);
  98 + }
  99 + },
  100 + function(res) {
  101 +
98 } 102 }
99 - },  
100 - function(res){  
101 103
102 - } 104 + )
103 105
104 - )  
105 106
106 -  
107 } 107 }
108 108
109 109
@@ -136,18 +136,18 @@ Page({ @@ -136,18 +136,18 @@ Page({
136 var data = JSON.stringify(json); 136 var data = JSON.stringify(json);
137 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; 137 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
138 getApp().request.json_post(url, json, 138 getApp().request.json_post(url, json,
139 - function (res) {  
140 - if (res.data.code == 0) {  
141 - getApp().my_warnning("兑换成功!", 1, th);  
142 - } else {  
143 - getApp().my_warnning(res.data.msg, 0, th);  
144 - } 139 + function(res) {
  140 + if (res.data.code == 0) {
  141 + getApp().my_warnning("兑换成功!", 1, th);
  142 + } else {
  143 + getApp().my_warnning(res.data.msg, 0, th);
  144 + }
145 }, 145 },
146 - function (res) { 146 + function(res) {
147 147
148 } 148 }
149 149
150 - ) 150 + )
151 }) 151 })
152 152
153 153
@@ -156,13 +156,13 @@ Page({ @@ -156,13 +156,13 @@ Page({
156 var _this = this; 156 var _this = this;
157 var th = this; 157 var th = this;
158 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { 158 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
  159 + isShowLoading: true,
159 data: { 160 data: {
160 "storeId": a.stoid, //商家ID 161 "storeId": a.stoid, //商家ID
161 "userId": d.user_id, //用户ID 162 "userId": d.user_id, //用户ID
162 "orderSn": th.data.orderSn 163 "orderSn": th.data.orderSn
163 }, 164 },
164 - success: function success(res) {  
165 - wx.hideLoading(); 165 + success: function(res) {
166 if (res.data.code == 0) { 166 if (res.data.code == 0) {
167 th.setData({ 167 th.setData({
168 giftImage: th.data.iurl + res.data.data.lbUrl, 168 giftImage: th.data.iurl + res.data.data.lbUrl,
@@ -224,6 +224,7 @@ Page({ @@ -224,6 +224,7 @@ Page({
224 var _this2 = this; 224 var _this2 = this;
225 var th = this.data; 225 var th = this.data;
226 getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { 226 getApp().request.get('/api/weshop/marketing/giftbag/detail/get', {
  227 + isShowLoading: true,
227 data: { 228 data: {
228 "storeId": a.stoid, //商家ID 229 "storeId": a.stoid, //商家ID
229 "userId": d.user_id, //用户ID 230 "userId": d.user_id, //用户ID
@@ -278,9 +279,6 @@ Page({ @@ -278,9 +279,6 @@ Page({
278 //获取核销码 279 //获取核销码
279 getcode: function() { 280 getcode: function() {
280 var th = this; 281 var th = this;
281 - wx.showLoading({  
282 - title: '加载中',  
283 - })  
284 var orderSn = th.data.orderSn; //订单号 282 var orderSn = th.data.orderSn; //订单号
285 var json = { 283 var json = {
286 "storeId": a.stoid, 284 "storeId": a.stoid,
@@ -288,15 +286,8 @@ Page({ @@ -288,15 +286,8 @@ Page({
288 }; 286 };
289 var data = JSON.stringify(json); 287 var data = JSON.stringify(json);
290 var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 288 var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址
291 - wx.request({  
292 - url: url,  
293 - data: data,  
294 - method: 'put',  
295 - header: {  
296 - 'content-type': 'application/json'  
297 - }, // 设置请求的 header  
298 - success: function(res) {  
299 - wx.hideLoading(); 289 + getApp().request.json_post(url, json,
  290 + function(res) {
300 if (res.data.code == 0) { 291 if (res.data.code == 0) {
301 th.setData({ 292 th.setData({
302 code: res.data.data 293 code: res.data.data
@@ -305,8 +296,14 @@ Page({ @@ -305,8 +296,14 @@ Page({
305 } else { 296 } else {
306 getApp().my_warnning(res.data.msg, 0, th); 297 getApp().my_warnning(res.data.msg, 0, th);
307 } 298 }
308 - }  
309 - }) 299 + },
  300 + function(res) {
  301 +
  302 + },
  303 + "put"
  304 +
  305 + )
  306 +
310 }, 307 },
311 //界面跳转 308 //界面跳转
312 goto: function(e) { 309 goto: function(e) {
pages/giftpack/giftpacklist/giftpacklist.wxml
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 <text class="data-v-3a5b7e36">礼包内容</text> 37 <text class="data-v-3a5b7e36">礼包内容</text>
38 </view> 38 </view>
39 <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> 39 <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index">
40 - <view class="box_ware_box data-v-3a5b7e36"> 40 + <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36">
41 <view class="box_ware_img data-v-3a5b7e36"> 41 <view class="box_ware_img data-v-3a5b7e36">
42 <block wx:if="{{item.lbType==1}}"> 42 <block wx:if="{{item.lbType==1}}">
43 <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> 43 <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
pages/giftpack/mygiftpack/mygiftpack.js
@@ -52,7 +52,6 @@ Page({ @@ -52,7 +52,6 @@ Page({
52 pageSize: th.data.pageSize 52 pageSize: th.data.pageSize
53 }, 53 },
54 success: function success(res) { 54 success: function success(res) {
55 - wx.hideLoading();  
56 if (res.data.code == 0) { 55 if (res.data.code == 0) {
57 th.data.curpage++; 56 th.data.curpage++;
58 var arr1 = th.data.wareCard; 57 var arr1 = th.data.wareCard;
@@ -97,9 +96,6 @@ Page({ @@ -97,9 +96,6 @@ Page({
97 var th = this; 96 var th = this;
98 if (th.data.total <= th.data.pageSize) return; 97 if (th.data.total <= th.data.pageSize) return;
99 if (th.data.ismore) return; 98 if (th.data.ismore) return;
100 - wx.showLoading({  
101 - title: '加载中...',  
102 - })  
103 th.getList(); 99 th.getList();
104 }, 100 },
105 //图片失败,默认图片 101 //图片失败,默认图片
pages/giftpack/newvipgift/newvipgift.js
@@ -33,10 +33,8 @@ Page({ @@ -33,10 +33,8 @@ Page({
33 GetList: function() { 33 GetList: function() {
34 var th = this; 34 var th = this;
35 var url = "/api/weshop/marketing/giftbag/bound/get"; 35 var url = "/api/weshop/marketing/giftbag/bound/get";
36 - wx.showLoading({  
37 - title: '加载中',  
38 - })  
39 getApp().request.promiseGet(url, { 36 getApp().request.promiseGet(url, {
  37 + isShowLoading: true,
40 data: { 38 data: {
41 "actId": th.data.getActId, //活动id 39 "actId": th.data.getActId, //活动id
42 "actType": 1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 40 "actType": 1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
@@ -45,7 +43,6 @@ Page({ @@ -45,7 +43,6 @@ Page({
45 "userId": d.user_id //用户ID 43 "userId": d.user_id //用户ID
46 } 44 }
47 }).then(res => { 45 }).then(res => {
48 - wx.hideLoading();  
49 if (res.data.code == 0) { 46 if (res.data.code == 0) {
50 if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) { 47 if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) {
51 //礼包内容--礼券 48 //礼包内容--礼券
@@ -137,9 +134,6 @@ Page({ @@ -137,9 +134,6 @@ Page({
137 th.setData({ 134 th.setData({
138 is_sub: 1 135 is_sub: 1
139 }) 136 })
140 - wx.showLoading({  
141 - title: '加载中',  
142 - })  
143 var json = { 137 var json = {
144 "actId": th.data.getActId, //活动Id 138 "actId": th.data.getActId, //活动Id
145 "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 139 "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -149,15 +143,8 @@ Page({ @@ -149,15 +143,8 @@ Page({
149 }; 143 };
150 var data = JSON.stringify(json); 144 var data = JSON.stringify(json);
151 var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; 145 var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
152 - wx.request({  
153 - url: url,  
154 - data: data,  
155 - method: 'post',  
156 - header: {  
157 - 'content-type': 'application/json'  
158 - }, // 设置请求的 header  
159 - success: function(res) {  
160 - wx.hideLoading(); 146 + getApp().request.json_post(url, json,
  147 + function(res) {
161 th.setData({ 148 th.setData({
162 is_sub: 0 149 is_sub: 0
163 }) 150 })
@@ -169,8 +156,13 @@ Page({ @@ -169,8 +156,13 @@ Page({
169 } else { 156 } else {
170 getApp().my_warnning(res.data.msg, 0, th); 157 getApp().my_warnning(res.data.msg, 0, th);
171 } 158 }
172 - }  
173 - }) 159 + },
  160 + function(res) {
  161 +
  162 + }, "post"
  163 +
  164 + )
  165 +
174 } 166 }
175 }, 167 },
176 //界面跳转 168 //界面跳转
pages/user/assistance/assistance.js
@@ -24,8 +24,8 @@ Page({ @@ -24,8 +24,8 @@ Page({
24 is_show_more: 0, //是否加载更多 24 is_show_more: 0, //是否加载更多
25 help_id:"",//助力活动的id 25 help_id:"",//助力活动的id
26 timer:"",//任务列表的定时器 26 timer:"",//任务列表的定时器
27 - s_num:"",//多少人已经领取任务  
28 - 27 + s_num:"",//多少人已经领取任务
  28 + page:1,//我的任务的当前页
29 }, 29 },
30 30
31 /** 31 /**
@@ -34,7 +34,7 @@ Page({ @@ -34,7 +34,7 @@ Page({
34 onLoad: function(options) { 34 onLoad: function(options) {
35 var th = this; 35 var th = this;
36 var nav_b = th.selectComponent("#nav_b"); //组件的id 36 var nav_b = th.selectComponent("#nav_b"); //组件的id
37 - nav_b.set_name("助力", ""); 37 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
38 // 助力活动 38 // 助力活动
39 this.assistance(); 39 this.assistance();
40 }, 40 },
@@ -43,12 +43,7 @@ Page({ @@ -43,12 +43,7 @@ Page({
43 * 生命周期函数--监听页面显示 43 * 生命周期函数--监听页面显示
44 */ 44 */
45 onShow: function() { 45 onShow: function() {
46 - var th=this;  
47 - this.data.timer= setInterval(function () {  
48 - th.get_list();  
49 -  
50 - },2000)  
51 - 46 +
52 }, 47 },
53 // 助力活动 48 // 助力活动
54 assistance() { 49 assistance() {
@@ -63,10 +58,13 @@ Page({ @@ -63,10 +58,13 @@ Page({
63 } 58 }
64 }).then(res => { 59 }).then(res => {
65 if (res.data.code == 0) { 60 if (res.data.code == 0) {
66 -  
67 var help_data=res.data.data; 61 var help_data=res.data.data;
68 - console.log(help_data.id,'数据', res.data.data);  
69 th.setData({ zl_act:help_data, help_id:help_data.id }); 62 th.setData({ zl_act:help_data, help_id:help_data.id });
  63 + if (th.data.help_id != "" && th.data.help_id!=null) {
  64 + //我的任务
  65 + th.get_list();
  66 + }
  67 +
70 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { 68 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
71 data: { 69 data: {
72 helpId: help_data.id, storeId: store_id 70 helpId: help_data.id, storeId: store_id
@@ -85,39 +83,54 @@ Page({ @@ -85,39 +83,54 @@ Page({
85 83
86 //--点击获取用户任务列表--会员的任务列表 84 //--点击获取用户任务列表--会员的任务列表
87 get_list:function() { 85 get_list:function() {
  86 +
88 var th = this; 87 var th = this;
  88 + var page=th.data.page;
89 var help_id=this.data.help_id; 89 var help_id=this.data.help_id;
90 t.request.get("/api/weshop/marketing/help/help/user/page", { 90 t.request.get("/api/weshop/marketing/help/help/user/page", {
91 data: { 91 data: {
92 userId:getApp().globalData.user_id, 92 userId:getApp().globalData.user_id,
93 storeId: os.stoid, 93 storeId: os.stoid,
94 - helpId: help_id 94 + helpId: help_id,
  95 + page: page,
  96 + pageSize:5
95 }, 97 },
96 success: function(res) { 98 success: function(res) {
97 clearTimeout(th.data.timer); 99 clearTimeout(th.data.timer);
98 -  
99 - if (!th.data.is_load) th.setData({ 100 +
  101 + if (!th.data.is_load)
  102 + th.setData({
100 is_load: 1 103 is_load: 1
101 }) 104 })
  105 +
  106 +
102 if (res.data.code == 0) { 107 if (res.data.code == 0) {
103 - 108 +
104 var list = th.data.zl_user_list; 109 var list = th.data.zl_user_list;
105 - list = list.concat(res.data.data.pageData) //连接数组 110 + //连接数组
  111 + list = list.concat(res.data.data.pageData);
106 th.setData({ 112 th.setData({
107 - zl_user_list: list 113 + zl_user_list: list,
  114 + is_load: 1,
108 }); 115 });
109 - var n_all_num = th.data.cur_page * th.data.page_num;  
110 - if (res.data.data.total > n_all_num) th.setData({  
111 - is_show_more: 1  
112 - })  
113 - else th.setData({  
114 - is_show_more: 0  
115 - })  
116 - //页吗要更新一下  
117 - th.data.cur_page++; 116 + if (res.data.data.total <= 5) {
  117 + th.setData({
  118 + is_show_more: 1
  119 + })
  120 + }else{
  121 + var page = th.data.page + 1;
  122 + th.setData({
  123 + is_show_more: 0,
  124 + page: page
  125 + })
  126 + }
  127 +
118 } else { 128 } else {
  129 +
  130 + getApp().showWarning("暂无更多内容",0);
119 th.setData({ 131 th.setData({
120 - is_show_more: 0 132 + is_show_more: 1,
  133 + page: page
121 }) 134 })
122 } 135 }
123 136
@@ -127,8 +140,8 @@ Page({ @@ -127,8 +140,8 @@ Page({
127 140
128 //-----跳转到领取礼包的页面------ 141 //-----跳转到领取礼包的页面------
129 go_task: function() { 142 go_task: function() {
  143 +
130 var help_id=this.data.help_id; 144 var help_id=this.data.help_id;
131 -  
132 getApp().goto("/pages/user/assistance/task_assistance?help_id="+help_id); 145 getApp().goto("/pages/user/assistance/task_assistance?help_id="+help_id);
133 }, 146 },
134 switch_head: function (e) { 147 switch_head: function (e) {
@@ -148,5 +161,17 @@ Page({ @@ -148,5 +161,17 @@ Page({
148 var nav_b = th.selectComponent("#nav_b"); //组件的id 161 var nav_b = th.selectComponent("#nav_b"); //组件的id
149 nav_b.close_box(); 162 nav_b.close_box();
150 }, 163 },
151 - 164 + // 领取礼包
  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);
  170 + },
  171 + //查看礼包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 );
  176 + }
152 }) 177 })
153 \ No newline at end of file 178 \ No newline at end of file
pages/user/assistance/assistance.json
1 { 1 {
2 - "navigationBarTitleText": "好友助力", 2 + "navigationBarTitleText": "好友助力,得好礼",
3 "navigationStyle": "custom", 3 "navigationStyle": "custom",
4 "usingComponents": { 4 "usingComponents": {
5 "warn": "/components/long_warn/long_warn", 5 "warn": "/components/long_warn/long_warn",
pages/user/assistance/assistance.wxml
1 <wxs module="filter" src="c_filter.wxs"></wxs> 1 <wxs module="filter" src="c_filter.wxs"></wxs>
  2 +<wxs module="filter_s" src="../../../utils/filter.wxs"></wxs>
2 <view class="page" bindtap="close"> 3 <view class="page" bindtap="close">
3 <!-- 背景图片 --> 4 <!-- 背景图片 -->
4 <image class="lumi" src="{{iurl+'miniapp/images/friendhelp/lumi.png'}}" lazy-load="true"></image> 5 <image class="lumi" src="{{iurl+'miniapp/images/friendhelp/lumi.png'}}" lazy-load="true"></image>
@@ -7,7 +8,7 @@ @@ -7,7 +8,7 @@
7 <view class="flex-center"> 8 <view class="flex-center">
8 <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>
9 </view> 10 </view>
10 - <view class="flex-center fs32"> 11 + <view class="flex-center fs32">
11 <view class="excitation">机会总是留给最有行动力的人</view> 12 <view class="excitation">机会总是留给最有行动力的人</view>
12 </view> 13 </view>
13 <view class="flex-center"> 14 <view class="flex-center">
@@ -15,7 +16,7 @@ @@ -15,7 +16,7 @@
15 </view> 16 </view>
16 <view class="flex-center fs26 time"> 17 <view class="flex-center fs26 time">
17 <view>活动时间:</view> 18 <view>活动时间:</view>
18 - <view>{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.endDate)}} 19 + <view>{{filter_s.format_time(zl_act.beginDate,0)}} 至 {{filter_s.format_time(zl_act.endDate,0)}}
19 </view> 20 </view>
20 </view> 21 </view>
21 <view class="flex-center" bindtap="go_task"> 22 <view class="flex-center" bindtap="go_task">
@@ -45,24 +46,25 @@ @@ -45,24 +46,25 @@
45 <view class="items"> 46 <view class="items">
46 <view class="item fs26 flex-vertical-between padding" wx:for="{{zl_user_list}}"> 47 <view class="item fs26 flex-vertical-between padding" wx:for="{{zl_user_list}}">
47 <view class="flex-center width"> 48 <view class="flex-center width">
48 - <view class="ellipsis-1">{{item.help_taskname}}</view> 49 + <view class="ellipsis-1">{{item.helpTaskName}}</view>
49 </view> 50 </view>
50 51
51 <!-- 已完成的颜色nostate --> 52 <!-- 已完成的颜色nostate -->
52 - <view class="flex-center width state" wx:if="{{item.is_acting==0}}">  
53 - <view class="ellipsis-1">领取礼包</view> 53 + <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>
54 </view> 56 </view>
55 - <view class="flex-center width state" wx:if="{{item.is_acting==1}}">  
56 - <view class="ellipsis-1">{{item.helped}}/{{item.help_num}}</view> 57 + <view class="flex-center width state" wx:if="{{item.status==0}}">
  58 + <view class="ellipsis-1">{{item.zlHelpNum}}/{{item.helpNum}}</view>
57 </view> 59 </view>
58 - <view class="flex-center width state" wx:if="{{item.is_acting==2}}">  
59 - <view class="ellipsis-1">查看礼包</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>
60 </view> 62 </view>
61 63
62 64
63 </view> 65 </view>
64 <!-- 加载更多 --> 66 <!-- 加载更多 -->
65 - <block wx:if="{{is_load && zl_user_list.length!=0}}"> 67 + <block wx:if="{{is_show_more==0}}">
66 <view class="fs28 flex-center"> 68 <view class="fs28 flex-center">
67 <view class="line"></view> 69 <view class="line"></view>
68 <view class="load" bindtap="get_list">点击加载更多</view> 70 <view class="load" bindtap="get_list">点击加载更多</view>
pages/user/assistance/assistance_success.json
1 { 1 {
  2 + "navigationBarTitleText": "好友助力,得好礼",
  3 + "navigationStyle": "custom",
2 "usingComponents": { 4 "usingComponents": {
3 "warn": "/components/long_warn/long_warn", 5 "warn": "/components/long_warn/long_warn",
4 "my_confirm": "/components/my_confirm/my_confirm", 6 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/friend_assistance.js
@@ -32,54 +32,53 @@ Page({ @@ -32,54 +32,53 @@ Page({
32 if (options.userId) this.data.userId = options.userId; 32 if (options.userId) this.data.userId = options.userId;
33 //任务是不是为空 33 //任务是不是为空
34 if (this.data.tasking == 0 || this.data.tasking == undefined) { 34 if (this.data.tasking == 0 || this.data.tasking == undefined) {
35 - //this.data.task_id = decodeURIComponent(options.scene);  
36 - this.data.tasking =1;  
37 - if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking !=  
38 - 0) {  
39 - getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", {  
40 - data: {  
41 - id: th.data.tasking,  
42 - storeId: os.stoid  
43 - }  
44 - }).then(res => {  
45 - if (res.data.code == 0) {  
46 - th.data.userId = res.data.data.userId;  
47 - th.data.taskId = res.data.data.taskId;  
48 - //获取活动的时间  
49 - return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", {  
50 - data: {  
51 - helpId: res.data.data.helpFormId,  
52 - storeId: os.stoid  
53 - }  
54 - })  
55 - }  
56 - return ut.null_promise();  
57 - }).then(res => {  
58 - if (res.data.code == 0) {  
59 - th.setData({  
60 - zl_act: res.data.data  
61 - })  
62 - //获取活动的参与的人数  
63 - return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {  
64 - data: {  
65 - helpId: res.data.data.id,  
66 - storeId: os.stoid  
67 - }  
68 - })  
69 - }  
70 - return ut.null_promise();  
71 - }).then(res => {  
72 - if (res.data.code == 0) {  
73 - th.setData({  
74 - s_num: res.data.data.countAll  
75 - });  
76 - }  
77 - })  
78 -  
79 - } 35 + this.data.tasking = decodeURIComponent(options.scene);
80 } 36 }
81 - },  
82 37
  38 + if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking !=
  39 + 0) {
  40 + getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", {
  41 + data: {
  42 + id: th.data.tasking,
  43 + storeId: os.stoid
  44 + }
  45 + }).then(res => {
  46 + if (res.data.code == 0) {
  47 + th.data.userId = res.data.data.userId;
  48 + th.data.taskId = res.data.data.taskId;
  49 + //获取活动的时间
  50 + return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", {
  51 + data: {
  52 + helpId: res.data.data.helpFormId,
  53 + storeId: os.stoid
  54 + }
  55 + })
  56 + }
  57 + return ut.null_promise();
  58 + }).then(res => {
  59 + if (res.data.code == 0) {
  60 + th.setData({
  61 + zl_act: res.data.data
  62 + })
  63 + //获取活动的参与的人数
  64 + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
  65 + data: {
  66 + helpId: res.data.data.id,
  67 + storeId: os.stoid
  68 + }
  69 + })
  70 + }
  71 + return ut.null_promise();
  72 + }).then(res => {
  73 + if (res.data.code == 0) {
  74 + th.setData({
  75 + s_num: res.data.data.countAll
  76 + });
  77 + }
  78 + })
  79 +
  80 + }
  81 + },
83 82
84 // 跳转到助力成功页 83 // 跳转到助力成功页
85 participate_activity: function() { 84 participate_activity: function() {
@@ -132,7 +131,7 @@ Page({ @@ -132,7 +131,7 @@ Page({
132 var th = this; 131 var th = this;
133 var nav_b = th.selectComponent("#nav_b"); //组件的id 132 var nav_b = th.selectComponent("#nav_b"); //组件的id
134 nav_b.close_box(); 133 nav_b.close_box();
135 - nav_b.set_name("助力", ""); 134 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
136 }, 135 },
137 136
138 /** 137 /**
pages/user/assistance/friend_assistance.json
1 { 1 {
  2 + "navigationBarTitleText": "好友助力,得好礼",
  3 + "navigationStyle": "custom",
2 "usingComponents": { 4 "usingComponents": {
3 "warn": "/components/long_warn/long_warn", 5 "warn": "/components/long_warn/long_warn",
4 "my_confirm": "/components/my_confirm/my_confirm", 6 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/giftpacklist.js
@@ -28,144 +28,120 @@ Page({ @@ -28,144 +28,120 @@ Page({
28 code: "", //核销码 28 code: "", //核销码
29 c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 29 c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
30 is_lb: 0, //是否有礼包 30 is_lb: 0, //是否有礼包
  31 + receiveState: 0, //0未领取 1已领取
  32 + completeid: "",
  33 + is_sub: 0, //判断是否重复提交
  34 + is_libao: 0, //0轮播查看活动 1领取礼包 2.查看礼包详情
  35 + held_id: "", //活动id
  36 + taskId: "", //任务id
  37 + orderSn: "", //订单号
31 }, 38 },
32 - onLoad: function (options) { 39 + onLoad: function(options) {
33 var th = this; 40 var th = this;
34 - th.setData({  
35 - isBuy: options.isBuy,  
36 - getStorageID: a.stoid,  
37 - getUserID: d.user_id,  
38 - getGiftID: options.lbId,  
39 - orderSn: options.orderSn  
40 - })  
41 - if (options.isBuy == 0) {  
42 - th.GetMyGiftList();  
43 - } else { 41 + if (options.is_libao == 0) {
  42 + th.setData({
  43 + held_id: options.help_id, //options.help_id
  44 + taskId: options.taskId, //options.libao_id
  45 + })
  46 + th.help();
  47 + }
  48 + if (options.is_libao == 1) {
  49 + th.setData({
  50 + taskId: options.libao_id,
  51 + held_id: options.held_id
  52 + })
44 th.GetBuyGiftList(); 53 th.GetBuyGiftList();
45 } 54 }
46 - th.setData({  
47 - giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img")  
48 - }) 55 + if (options.order_sn) {
  56 + th.setData({
  57 + orderSn: options.orderSn
  58 + })
  59 + th.GetMyGiftList();
  60 + }
49 th.close(); 61 th.close();
50 }, 62 },
51 - onShow: function () { 63 + onShow: function() {
52 64
53 }, 65 },
54 - GetBuyPrice: function (e) {  
55 - var that = this.data; 66 + //助力活动查看礼包详情调用
  67 + help: function(e) {
56 var th = this; 68 var th = this;
57 - // var id = e.currentTarget.dataset.id;//活动id  
58 - var my_confirm = th.selectComponent("#my_confirm"); //组件的id  
59 - my_confirm.open(  
60 - "是否确定购买该礼包",  
61 - "取消",  
62 - "确定",  
63 - function () {  
64 - my_confirm.open_cancel(0);  
65 - },  
66 - function () {  
67 - my_confirm.open_cancel(0);  
68 - var json = {  
69 - "actId": '', //活动Id  
70 - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销  
71 - "buyType": '2', //1=积分兑换 2=余额购买  
72 - "lbId": that.getGiftID, //礼包Id  
73 - "storeId": that.getStorageID, //商家Id  
74 - "userId": that.getUserID, //用户ID  
75 - "buyFrom": 2  
76 - };  
77 - var data = JSON.stringify(json);  
78 - var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";  
79 - wx.request({  
80 - url: url,  
81 - data: data,  
82 - method: 'post',  
83 - header: {  
84 - 'content-type': 'application/json'  
85 - }, // 设置请求的 header  
86 - success: function (res) {  
87 - if (res.data.code == 0) {  
88 - res = res.data.data;  
89 - wx.requestPayment({  
90 - timeStamp: String(res.timeStamp),  
91 - nonceStr: res.nonceStr,  
92 - package: res.packageValue,  
93 - signType: res.signType,  
94 - paySign: res.paySign,  
95 - success: function (n) {  
96 -  
97 - },  
98 - fail: function (n) {  
99 -  
100 - }  
101 - });  
102 - } else {  
103 - getApp().my_warnning(res.data.msg, 0, th);  
104 - }  
105 - }  
106 - })  
107 - 69 + var url = "/api/weshop/marketing/giftbag/help/get";
  70 + getApp().request.promiseGet(url, {
  71 + isShowLoading: true,
  72 + data: {
  73 + helpId: th.data.held_id,
  74 + storeId: a.stoid,
  75 + taskId: th.data.taskId
108 } 76 }
  77 + }).then(res => {
  78 + if (res.data.code == 0) {
  79 + th.setData({
  80 + giftImage: th.data.iurl + res.data.data.lbUrl,
  81 + giftTitle: res.data.data.giftTitle
  82 + })
  83 + if (res.data.data.giftRemark == '') {
  84 + th.setData({
  85 + giftRemark: '暂无详情......'
  86 + })
  87 + } else {
  88 + th.setData({
  89 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  90 + })
  91 + }
109 92
  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();
110 98
111 - )  
112 - 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 + // })
113 106
114 - },  
115 - GetBuyIntegral: function (e) {  
116 - var that = this.data;  
117 - var th = this;  
118 - // var id = e.currentTarget.dataset.id;//活动id  
119 - var my_confirm = th.selectComponent("#my_confirm"); //组件的id  
120 - my_confirm.open(  
121 - "是否确定兑换该礼包",  
122 - "取消",  
123 - "确定",  
124 - function () {  
125 - my_confirm.open_cancel(0);  
126 - },  
127 - function () {  
128 - my_confirm.open_cancel(0);  
129 - var json = {  
130 - "actId": '', //活动Id  
131 - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销  
132 - "buyType": '1', //1=积分兑换 2=余额购买  
133 - "lbId": that.getGiftID, //礼包Id  
134 - "storeId": that.getStorageID, //商家Id  
135 - "userId": that.getUserID //用户ID  
136 - };  
137 - var data = JSON.stringify(json);  
138 - var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";  
139 - wx.request({  
140 - url: url,  
141 - data: data,  
142 - method: 'post',  
143 - header: {  
144 - 'content-type': 'application/json'  
145 - }, // 设置请求的 header  
146 - success: function (res) {  
147 - if (res.data.code == 0) {  
148 - getApp().my_warnning("兑换成功!", 1, th);  
149 - } else {  
150 - getApp().my_warnning(res.data.msg, 0, th);  
151 - }  
152 - } 107 + th.setData({
  108 + giftDate: res.data.data.endTime,
  109 + giftPosPrice: res.data.data.giftPosPrice,
  110 + giftQty: res.data.data.giftQty,
  111 + giftIntegral: res.data.data.payIntegral,
  112 + giftPrice: res.data.data.payMoney,
  113 + giftType: res.data.data.actType,
  114 + actTitle: res.data.data.actTitle,
  115 + wareCard: res.data.data.wareCard,
  116 + lbId: res.data.data.lbId
153 }) 117 })
  118 + //判断是否有礼包
  119 + for (var i = 0; i < res.data.data.wareCard.length; i++) {
  120 + if (res.data.data.wareCard[i].lbType == 1) {
  121 + th.setData({
  122 + is_lb: 1
  123 + })
  124 + break;
  125 + }
  126 + }
  127 + } else {
  128 + getApp().my_warnning(res.data.msg, 0, th);
  129 + return false;
  130 + }
154 131
155 - })  
156 -  
157 - 132 + })
158 }, 133 },
159 - GetMyGiftList: function () { 134 + GetMyGiftList: function() {
160 var _this = this; 135 var _this = this;
161 var th = this; 136 var th = this;
162 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { 137 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
  138 + isShowLoading: true,
163 data: { 139 data: {
164 - "storeId": th.data.getStorageID, //商家ID  
165 - "userId": th.data.getUserID, //用户ID 140 + "storeId": a.stoid, //商家ID
  141 + "userId": d.user_id, //用户ID
166 "orderSn": th.data.orderSn 142 "orderSn": th.data.orderSn
167 }, 143 },
168 - success: function success(res) { 144 + success: function(res) {
169 if (res.data.code == 0) { 145 if (res.data.code == 0) {
170 th.setData({ 146 th.setData({
171 giftImage: th.data.iurl + res.data.data.lbUrl, 147 giftImage: th.data.iurl + res.data.data.lbUrl,
@@ -177,7 +153,7 @@ Page({ @@ -177,7 +153,7 @@ Page({
177 }) 153 })
178 } else { 154 } else {
179 th.setData({ 155 th.setData({
180 - giftRemark: res.data.data.giftRemark 156 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
181 }) 157 })
182 } 158 }
183 159
@@ -216,23 +192,65 @@ Page({ @@ -216,23 +192,65 @@ Page({
216 } 192 }
217 } 193 }
218 } else { 194 } else {
219 - getApp().my_warnning("系统繁忙,请稍后再试", 0, th); 195 + getApp().my_warnning(res.data.msg, 0, th);
220 return false; 196 return false;
221 } 197 }
222 } 198 }
223 }); 199 });
224 200
225 }, 201 },
226 - GetBuyGiftList: function () { 202 + GetReceive: function() {
  203 + var th = this;
  204 + if (th.data.receiveState) {
  205 + return false;
  206 + }
  207 + var is_sub = th.data.is_sub; //判断是否重复提交
  208 + if (is_sub == 0) {
  209 + th.setData({
  210 + is_sub: 1
  211 + })
  212 + var json = {
  213 + "actId": th.data.completeid, //活动Id
  214 + "actType": 5, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  215 + "giftBagId": th.data.giftID, //礼包Id
  216 + "storeId": a.stoid, //商家Id
  217 + "userId": d.user_id //用户ID
  218 + };
  219 + var data = JSON.stringify(json);
  220 + var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
  221 + getApp().request.json_post(url, json,
  222 + function(res) {
  223 + th.setData({
  224 + is_sub: 0
  225 + })
  226 + if (res.data.code == 0) {
  227 + th.setData({
  228 + receiveState: 1
  229 + })
  230 + getApp().my_warnning("领取成功", 1, th);
  231 + } else {
  232 + getApp().my_warnning(res.data.msg, 0, th);
  233 + }
  234 + },
  235 + function(res) {
  236 +
  237 + }, "post"
  238 +
  239 + )
  240 +
  241 + }
  242 + },
  243 + GetBuyGiftList: function() {
227 var _this2 = this; 244 var _this2 = this;
228 var th = this.data; 245 var th = this.data;
229 getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { 246 getApp().request.get('/api/weshop/marketing/giftbag/detail/get', {
  247 + isShowLoading: true,
230 data: { 248 data: {
231 - "storeId": th.getStorageID, //商家ID  
232 - "userId": th.getUserID, //用户ID  
233 - "giftBagId": th.getGiftID 249 + "storeId": a.stoid, //商家ID
  250 + "userId": d.user_id, //用户ID
  251 + "giftBagId": th.taskId
234 }, 252 },
235 - success: function success(res) { 253 + success: function(res) {
236 if (res.data.code == 0) { 254 if (res.data.code == 0) {
237 _this2.setData({ 255 _this2.setData({
238 giftImage: th.iurl + res.data.data.lbUrl, 256 giftImage: th.iurl + res.data.data.lbUrl,
@@ -245,10 +263,9 @@ Page({ @@ -245,10 +263,9 @@ Page({
245 }) 263 })
246 } else { 264 } else {
247 _this2.setData({ 265 _this2.setData({
248 - giftRemark: res.data.data.giftRemark 266 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
249 }) 267 })
250 } 268 }
251 -  
252 _this2.setData({ 269 _this2.setData({
253 giftDate: res.data.data.endTime, 270 giftDate: res.data.data.endTime,
254 giftPosPrice: res.data.data.giftPosPrice, 271 giftPosPrice: res.data.data.giftPosPrice,
@@ -260,7 +277,7 @@ Page({ @@ -260,7 +277,7 @@ Page({
260 wareCard: res.data.data.wareCard 277 wareCard: res.data.data.wareCard
261 }) 278 })
262 } else { 279 } else {
263 - getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2); 280 + getApp().my_warnning(res.data.msg, 0, _this2);
264 return false; 281 return false;
265 } 282 }
266 } 283 }
@@ -268,7 +285,7 @@ Page({ @@ -268,7 +285,7 @@ Page({
268 285
269 }, 286 },
270 //显示核销码 287 //显示核销码
271 - code_show: function (e) { 288 + code_show: function(e) {
272 var th = this; 289 var th = this;
273 //--获取成功的时候-- 290 //--获取成功的时候--
274 var no = th.data.code; 291 var no = th.data.code;
@@ -280,7 +297,7 @@ Page({ @@ -280,7 +297,7 @@ Page({
280 qc_com.open(obj) 297 qc_com.open(obj)
281 }, 298 },
282 //获取核销码 299 //获取核销码
283 - getcode: function () { 300 + getcode: function() {
284 var th = this; 301 var th = this;
285 var orderSn = th.data.orderSn; //订单号 302 var orderSn = th.data.orderSn; //订单号
286 var json = { 303 var json = {
@@ -289,14 +306,8 @@ Page({ @@ -289,14 +306,8 @@ Page({
289 }; 306 };
290 var data = JSON.stringify(json); 307 var data = JSON.stringify(json);
291 var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 308 var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址
292 - wx.request({  
293 - url: url,  
294 - data: data,  
295 - method: 'put',  
296 - header: {  
297 - 'content-type': 'application/json'  
298 - }, // 设置请求的 header  
299 - success: function (res) { 309 + getApp().request.json_post(url, json,
  310 + function(res) {
300 if (res.data.code == 0) { 311 if (res.data.code == 0) {
301 th.setData({ 312 th.setData({
302 code: res.data.data 313 code: res.data.data
@@ -305,17 +316,24 @@ Page({ @@ -305,17 +316,24 @@ Page({
305 } else { 316 } else {
306 getApp().my_warnning(res.data.msg, 0, th); 317 getApp().my_warnning(res.data.msg, 0, th);
307 } 318 }
308 - }  
309 - }) 319 + },
  320 + function(res) {
  321 +
  322 + }, "put"
  323 +
  324 + )
  325 +
  326 +
  327 +
310 }, 328 },
311 //界面跳转 329 //界面跳转
312 - goto: function (e) { 330 + goto: function(e) {
313 var th = this; 331 var th = this;
314 var url = e.currentTarget.dataset.url; 332 var url = e.currentTarget.dataset.url;
315 getApp().goto(url); 333 getApp().goto(url);
316 }, 334 },
317 //图片失败,默认图片 335 //图片失败,默认图片
318 - bind_bnerr2: function (e) { 336 + bind_bnerr2: function(e) {
319 var _errImg = e.target.dataset.errorimg; 337 var _errImg = e.target.dataset.errorimg;
320 var _errObj = {}; 338 var _errObj = {};
321 _errObj[_errImg] = "/public/images/empty.jpg"; 339 _errObj[_errImg] = "/public/images/empty.jpg";
@@ -323,7 +341,7 @@ Page({ @@ -323,7 +341,7 @@ Page({
323 341
324 }, 342 },
325 //关闭导航 343 //关闭导航
326 - close: function () { 344 + close: function() {
327 var th = this; 345 var th = this;
328 var nav_b = th.selectComponent("#nav_b"); //组件的id 346 var nav_b = th.selectComponent("#nav_b"); //组件的id
329 nav_b.close_box(); 347 nav_b.close_box();
pages/user/assistance/giftpacklist.json
@@ -6,4 +6,4 @@ @@ -6,4 +6,4 @@
6 "qr_code": "/components/qr_code/qr_code", 6 "qr_code": "/components/qr_code/qr_code",
7 "nav_b": "/components/nav_b/nav_b" 7 "nav_b": "/components/nav_b/nav_b"
8 } 8 }
9 -}  
10 \ No newline at end of file 9 \ No newline at end of file
  10 +}
11 \ No newline at end of file 11 \ No newline at end of file
pages/user/assistance/giftpacklist.wxml
@@ -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 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">
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 </view> 67 </view>
68 <view class="box_ware_code data-v-3a5b7e36"> 68 <view class="box_ware_code data-v-3a5b7e36">
69 <block wx:if="{{c_state==0}}"> 69 <block wx:if="{{c_state==0}}">
70 - <block wx:if="{{isBuy==0&item.lbType==1}}"> 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> 71 <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image>
72 </block> 72 </block>
73 </block> 73 </block>
@@ -76,13 +76,13 @@ @@ -76,13 +76,13 @@
76 <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image> 76 <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image>
77 </block> 77 </block>
78 </block> 78 </block>
79 - <block wx:if="{{isBuy==0&item.lbType==2}}"> 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> 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> 81 </block>
82 - <block wx:if="{{isBuy==0&item.lbType==3}}"> 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> 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> 84 </block>
85 - <block wx:if="{{isBuy==0&item.lbType>3}}"> 85 + <block wx:if="{{item.lbType>3}}">
86 <text class="data-v-3a5b7e36">奖励已发放</text> 86 <text class="data-v-3a5b7e36">奖励已发放</text>
87 </block> 87 </block>
88 </view> 88 </view>
@@ -95,52 +95,41 @@ @@ -95,52 +95,41 @@
95 <text class="data-v-3a5b7e36">活动说明</text> 95 <text class="data-v-3a5b7e36">活动说明</text>
96 </view> 96 </view>
97 <view class="foot_box_remark data-v-3a5b7e36"> 97 <view class="foot_box_remark data-v-3a5b7e36">
98 - <rich-text nodes="{{giftRemark}}"></rich-text> 98 + <rich-text nodes="{{giftRemark}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
99 </view> 99 </view>
100 </view> 100 </view>
101 <view class="foot_empty data-v-3a5b7e36"></view> 101 <view class="foot_empty data-v-3a5b7e36"></view>
102 - <block wx:if="{{isBuy==1}}">  
103 - <view class="foot_button data-v-3a5b7e36">  
104 - <block wx:if="{{giftPrice>0&&giftIntegral>0}}">  
105 - <view class="foot_button_left data-v-3a5b7e36" data-id="{{lbId}}" bindtap="GetBuyPrice">  
106 - <text class="data-v-3a5b7e36">立即购买</text>  
107 - </view>  
108 - </block>  
109 - <block wx:if="{{giftPrice>0 && giftIntegral>0}}">  
110 - <view class="foot_button_right data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}">  
111 - <text class="data-v-3a5b7e36">立即兑换</text>  
112 - </view>  
113 - </block>  
114 - <block wx:if="{{giftPrice>0 && giftIntegral<=0}}">  
115 - <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetBuyPrice" data-id="{{lbId}}">  
116 - <text class="data-v-3a5b7e36">立即购买</text>  
117 - </view>  
118 - </block>  
119 - <block wx:if="{{giftPrice<=0 && giftIntegral>0}}">  
120 - <view class="foot_button_intalge data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}">  
121 - <text class="data-v-3a5b7e36">立即兑换</text>  
122 - </view>  
123 - </block>  
124 - </view>  
125 - </block>  
126 <block wx:if="{{isBuy==0}}"> 102 <block wx:if="{{isBuy==0}}">
127 <view class="foot_button data-v-3a5b7e36"> 103 <view class="foot_button data-v-3a5b7e36">
128 - <block wx:if="{{is_lb!=1}}">  
129 - <view class="foot_button_buy data-v-3a5b7e36 overdue">  
130 - <text class="data-v-3a5b7e36">无核销商品</text>  
131 - </view> 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>
132 </block> 115 </block>
133 <block wx:else> 116 <block wx:else>
134 - <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode">  
135 - <text class="data-v-3a5b7e36">立即使用</text>  
136 - </view>  
137 - <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue">  
138 - <text class="data-v-3a5b7e36">商品已核销</text>  
139 - </view>  
140 - <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue">  
141 - <text class="data-v-3a5b7e36">商品兑换时间已过</text>  
142 - </view>  
143 - 117 + <block wx:if="{{is_lb!=1}}">
  118 + <view class="foot_button_buy data-v-3a5b7e36 overdue">
  119 + <text class="data-v-3a5b7e36">无核销商品</text>
  120 + </view>
  121 + </block>
  122 + <block wx:else>
  123 + <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode">
  124 + <text class="data-v-3a5b7e36">立即使用</text>
  125 + </view>
  126 + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue">
  127 + <text class="data-v-3a5b7e36">商品已核销</text>
  128 + </view>
  129 + <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue">
  130 + <text class="data-v-3a5b7e36">商品兑换时间已过</text>
  131 + </view>
  132 + </block>
144 </block> 133 </block>
145 </view> 134 </view>
146 </block> 135 </block>
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
pages/user/assistance/task_assistance.js
@@ -24,17 +24,18 @@ Page({ @@ -24,17 +24,18 @@ Page({
24 aitem: "", //活动的轮播图数据 24 aitem: "", //活动的轮播图数据
25 switch_head: 0, //0:我的任务,1:记录 25 switch_head: 0, //0:我的任务,1:记录
26 help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成 26 help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成
27 - is_share: 1, //是否显示画布  
28 - shareImgPath: [], //生成的图片  
29 - screenWidth: "", //用户的屏幕宽度  
30 gid: "", 27 gid: "",
31 timer: null, //全局的定时器 28 timer: null, //全局的定时器
32 user_task_list: null, //会员列表 29 user_task_list: null, //会员列表
33 taskid: "", //任务id 30 taskid: "", //任务id
34 usercount: 0, //参与的人数 31 usercount: 0, //参与的人数
35 dismantle: null, //帮拆记录数据集 32 dismantle: null, //帮拆记录数据集
36 - is_shares:111111,//判断是不是要分享的  
37 - 33 + is_user_task: null, //判断是不是领取的任务
  34 + zzjx_id: "", //真正进行的任务id
  35 + is_show:0,//任务的加载更多
  36 + is_bc_show:0,//帮拆的加载更多
  37 + bc_page:1,//帮拆的页码
  38 + rw_page:1,//任务的页码
38 //*********************************************start钱 39 //*********************************************start钱
39 canvasHidden: 0, //分享图片是否已经生成 40 canvasHidden: 0, //分享图片是否已经生成
40 is_share: 0, //是否显示画布 41 is_share: 0, //是否显示画布
@@ -50,6 +51,7 @@ Page({ @@ -50,6 +51,7 @@ Page({
50 already: 0, //已有几人助力 51 already: 0, //已有几人助力
51 lack: 0, //还差几人助力 52 lack: 0, //还差几人助力
52 zltime: "", //助力时间 53 zltime: "", //助力时间
  54 + djs: "", //定时器的显示
53 //*********************************************end 55 //*********************************************end
54 }, 56 },
55 57
@@ -70,7 +72,7 @@ Page({ @@ -70,7 +72,7 @@ Page({
70 } 72 }
71 th.close(); 73 th.close();
72 th.syinfo(); 74 th.syinfo();
73 - // th.imageinfo(); 75 + th.imageinfo();
74 //end 76 //end
75 }, 77 },
76 78
@@ -89,10 +91,12 @@ Page({ @@ -89,10 +91,12 @@ Page({
89 taskId: taskid 91 taskId: taskid
90 }, 92 },
91 function(res) { 93 function(res) {
92 -  
93 if (res.data.code == 0) { 94 if (res.data.code == 0) {
94 - console.log(res.data.data);  
95 getApp().my_warnning(res.data.data, 1, th); 95 getApp().my_warnning(res.data.data, 1, th);
  96 + //判断是不是领取的任务
  97 + th.get_user_task();
  98 + //会员任务列表
  99 + th.user_task_list();
96 } else { 100 } else {
97 getApp().my_warnning(res.data.msg, 0, th); 101 getApp().my_warnning(res.data.msg, 0, th);
98 } 102 }
@@ -128,17 +132,21 @@ Page({ @@ -128,17 +132,21 @@ Page({
128 }, 132 },
129 success: function(res) { 133 success: function(res) {
130 if (res.data.code == 0) { 134 if (res.data.code == 0) {
131 -  
132 var help_data = res.data.data; 135 var help_data = res.data.data;
133 - console.log('助力活动(判断)', res.data.data);  
134 th.setData({ 136 th.setData({
135 endDate: help_data.endDate, 137 endDate: help_data.endDate,
136 }); 138 });
137 139
  140 + //任务时间 设置全局定时器
  141 + th.setData({
  142 + timer:setInterval(function () {
  143 + th.countDown();
  144 + }, 1000)
  145 + })
  146 +
  147 +
138 } 148 }
139 } 149 }
140 -  
141 -  
142 }); 150 });
143 151
144 152
@@ -171,29 +179,28 @@ Page({ @@ -171,29 +179,28 @@ Page({
171 }); 179 });
172 var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; 180 var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty;
173 var taskid = data_aissa[0].id; 181 var taskid = data_aissa[0].id;
174 - 182 + console.log("参考", data_aissa);
175 th.setData({ 183 th.setData({
176 aitem: data_aissa, 184 aitem: data_aissa,
177 task_number: task_number, 185 task_number: task_number,
178 taskid: taskid 186 taskid: taskid
179 }); 187 });
180 - 188 + //判断是不是领取的任务
  189 + th.get_user_task();
181 190
182 } 191 }
183 192
184 } 193 }
185 }) 194 })
  195 +
186 // 分享的 196 // 分享的
187 // setTimeout(function() { 197 // setTimeout(function() {
188 // th.shareFrends(); 198 // th.shareFrends();
189 // }, 1000) 199 // }, 1000)
190 - //任务时间 设置全局定时器  
191 - th.data.timer = setInterval(function() {  
192 - th.countDown();  
193 - }, 1000); 200 +
194 //会员任务列表 201 //会员任务列表
195 this.user_task_list(); 202 this.user_task_list();
196 - // 获取会员的参与的任务列表 我的任务 203 + //获取助力活动参与的人数
197 this.get_user_task_num(); 204 this.get_user_task_num();
198 205
199 }, 206 },
@@ -209,36 +216,65 @@ Page({ @@ -209,36 +216,65 @@ Page({
209 var sw_index = this.data.sw_index; //轮播的下标 216 var sw_index = this.data.sw_index; //轮播的下标
210 //任务id 217 //任务id
211 var taskid = aitem[sw_index].id; 218 var taskid = aitem[sw_index].id;
212 - console.log("任务id", taskid);  
213 var th = this; 219 var th = this;
214 var index = 1; //获取当前选择的是任务还是活动说明 220 var index = 1; //获取当前选择的是任务还是活动说明
215 - var is_task = th.data.is_task; //0任务,1帮拆  
216 - console.log("0任务,1帮拆", is_task, );  
217 - th.setData({ 221 + var is_task = this.data.is_task; //0任务,1帮拆
  222 + if (is_task == undefined || is_task == null) {
  223 + is_task = 1;
  224 + }
  225 + var switch_head = this.data.switch_head;
  226 + if (switch_head == undefined || switch_head == null) {
  227 + switch_head = 1;
  228 + }
  229 + this.setData({
218 is_task: 1, 230 is_task: 1,
219 switch_head: 1 231 switch_head: 1
220 }); 232 });
  233 + var bc_page = th.data.bc_page;
221 rq.get("/api/weshop/marketing/help/help/task/involve/page", { 234 rq.get("/api/weshop/marketing/help/help/task/involve/page", {
222 data: { 235 data: {
  236 + page: bc_page,
  237 + pageSize: 5,
223 taskId: taskid, 238 taskId: taskid,
224 userId: getApp().globalData.user_id, 239 userId: getApp().globalData.user_id,
225 storeId: os.stoid 240 storeId: os.stoid
226 }, 241 },
227 success: function(res) { 242 success: function(res) {
228 -  
229 if (res.data.code == 0) { 243 if (res.data.code == 0) {
230 - var dismantle = res.data.data.pageData; 244 + var dismantle = res.data.data.pageData[0].zlHelpUser;
  245 + if(res.data.data.total>5){
  246 + var bc_page = th.data.bc_page + 1;
  247 + th.data({ bc_page: bc_page,
  248 + is_bc_show:1
  249 + })
  250 + }else{
  251 + getApp().showWarning("暂无更多内容", 0);
  252 + }
  253 +
231 th.setData({ 254 th.setData({
232 dismantle: dismantle 255 dismantle: dismantle
233 }); 256 });
  257 + } else {
  258 + th.setData({
  259 + dismantle: null
  260 + });
234 } 261 }
235 } 262 }
236 263
237 }) 264 })
238 -  
239 -  
240 }, 265 },
241 - 266 + // 领取礼包
  267 + 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 + },
  273 + //查看礼包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);
  277 + },
242 278
243 //划动的时候监听 279 //划动的时候监听
244 onSli: function(e) { 280 onSli: function(e) {
@@ -246,55 +282,105 @@ Page({ @@ -246,55 +282,105 @@ Page({
246 var ind = e.detail.current; 282 var ind = e.detail.current;
247 var aitem = this.data.aitem; 283 var aitem = this.data.aitem;
248 var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty; 284 var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty;
249 - console.log("划动的任务总数", task_number, "任务所有的参数", aitem); 285 + var task_id = aitem[ind].id;
  286 + console.log("划动的任务总数", task_number, "任务所有的参数", aitem,
  287 + "任务id", task_id);
250 th.setData({ 288 th.setData({
251 sw_index: ind, 289 sw_index: ind,
252 - task_number: task_number 290 + task_number: task_number,
  291 + taskid: task_id
253 }); 292 });
254 - console.log("可以领取的的任务数", aitem[ind].giftQty, '已领取的任务数据', aitem[ind].useGiftQty); 293 +
  294 + if (this.data.switch_head == 1) {
  295 + //判断有没有帮拆记录
  296 + this.dismantle_record();
  297 + }
  298 + //判断是不是领取的任务
  299 + th.get_user_task();
  300 +
255 }, 301 },
256 //导航球 302 //导航球
257 close: function() { 303 close: function() {
258 var th = this; 304 var th = this;
259 var nav_b = th.selectComponent("#nav_b"); //组件的id 305 var nav_b = th.selectComponent("#nav_b"); //组件的id
260 nav_b.close_box(); 306 nav_b.close_box();
261 - nav_b.set_name("助力", ""); 307 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
262 }, 308 },
263 // 获取会员的参与的任务列表 我的任务 309 // 获取会员的参与的任务列表 我的任务
264 user_task_list: function(e) { 310 user_task_list: function(e) {
265 var th = this; 311 var th = this;
266 -  
267 var index = 0; 312 var index = 0;
268 - var is_task = th.data.is_task; //0任务,1活动说明 313 + var is_task = this.data.is_task; //0任务,1帮拆
  314 + if (is_task == undefined || is_task == null) {
  315 + is_task = 0;
  316 + }
  317 + var switch_head = this.data.switch_head;
  318 + if (switch_head == undefined || switch_head == null) {
  319 + switch_head = 0;
  320 + }
  321 + this.setData({
  322 + is_task: index,
  323 + switch_head: index
  324 + });
269 var help_id = th.data.help_id; 325 var help_id = th.data.help_id;
270 var user_id = getApp().globalData.user_id; 326 var user_id = getApp().globalData.user_id;
  327 + var rw_page=th.data.rw_page;
271 rq.get("/api/weshop/marketing/help/help/user/page", { 328 rq.get("/api/weshop/marketing/help/help/user/page", {
272 data: { 329 data: {
  330 + page:rw_page,
  331 + pageSize:5,
273 helpId: help_id, 332 helpId: help_id,
274 storeId: os.stoid, 333 storeId: os.stoid,
275 userId: user_id 334 userId: user_id
276 }, 335 },
277 success: function(su) { 336 success: function(su) {
278 - th.setData({  
279 - is_task: index,  
280 - switch_head: index  
281 - });  
282 if (su.data.code == 0) { 337 if (su.data.code == 0) {
  338 + if (su.data.data.total > 5){
  339 + th.setData({
  340 + rw_page: rw_page,
  341 + is_show: 1
  342 + })
  343 + 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 + }
283 var user_list = su.data.data.pageData; 351 var user_list = su.data.data.pageData;
284 - console.log("会员列表", user_list);  
285 th.setData({ 352 th.setData({
286 user_task_list: user_list 353 user_task_list: user_list
287 }); 354 });
288 - } else { 355 + }
  356 + }
  357 + })
  358 + },
  359 + //判断是否有领取任务 获取正在进行中的任务
  360 + get_user_task: function() {
  361 + var user_id = getApp().globalData.user_id;
  362 + var th = this;
  363 + var aitem = th.data.aitem;
  364 + var sw_index = th.data.sw_index;
  365 + var taskid = aitem[sw_index].id
  366 + rq.get("/api/weshop/marketing/help/help/task/get", {
  367 + data: {
  368 + storeId: os.stoid,
  369 + userId: user_id,
  370 + taskId: taskid
  371 + },
  372 + success: function(res) {
  373 + if (res.data.code == 0) {
  374 + var is_usertask = res.data.data;
289 th.setData({ 375 th.setData({
290 - user_task_list: null 376 + is_user_task: is_usertask
291 }); 377 });
292 } 378 }
293 } 379 }
294 }) 380 })
295 }, 381 },
296 //获取助力活动参与的人数 382 //获取助力活动参与的人数
297 - get_user_task_num() { 383 + get_user_task_num: function() {
298 var th = this; 384 var th = this;
299 var help_id = th.data.help_id; 385 var help_id = th.data.help_id;
300 rq.get("/api/weshop/marketing/help/involve/help/act/people/count", { 386 rq.get("/api/weshop/marketing/help/involve/help/act/people/count", {
@@ -310,8 +396,6 @@ Page({ @@ -310,8 +396,6 @@ Page({
310 th.setData({ 396 th.setData({
311 usercount: usercount 397 usercount: usercount
312 }); 398 });
313 - } else {  
314 -  
315 } 399 }
316 } 400 }
317 }) 401 })
@@ -331,7 +415,7 @@ Page({ @@ -331,7 +415,7 @@ Page({
331 if (swiperError >= 3) { //在开关被触发3次以上 415 if (swiperError >= 3) { //在开关被触发3次以上
332 console.error(this.data.swiperError) 416 console.error(this.data.swiperError)
333 this.setData({ 417 this.setData({
334 - goodsIndex: this.data.preIndex 418 + sw_index: this.data.preIndex
335 }); //,重置current为正确索引 419 }); //,重置current为正确索引
336 this.setData({ 420 this.setData({
337 swiperError: 0 421 swiperError: 0
@@ -351,32 +435,41 @@ Page({ @@ -351,32 +435,41 @@ Page({
351 435
352 // 轮播图点击左边 436 // 轮播图点击左边
353 click_pre: function() { 437 click_pre: function() {
354 - console.log("轮播图点击左边");  
355 var index = this.data.sw_index; 438 var index = this.data.sw_index;
356 index--; 439 index--;
357 if (index < 0) return; 440 if (index < 0) return;
358 var aitem = this.data.aitem; 441 var aitem = this.data.aitem;
359 var task_number = aitem[index].giftQty - aitem[index].useGiftQty; 442 var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
  443 + var task_id = aitem[index].id;
360 this.setData({ 444 this.setData({
361 sw_index: index, 445 sw_index: index,
362 - task_number: task_number 446 + task_number: task_number,
  447 + taskid: task_id
363 }) 448 })
364 - 449 + if (this.data.switch_head == 1) {
  450 + //判断有没有帮拆记录
  451 + this.dismantle_record();
  452 + }
  453 + //判断有没有领取任务
  454 + this.get_user_task();
365 }, 455 },
366 //轮播图点击右边 456 //轮播图点击右边
367 click_next: function() { 457 click_next: function() {
368 458
369 var index = this.data.sw_index; 459 var index = this.data.sw_index;
370 index++; 460 index++;
371 - console.log("轮播图点击右边");  
372 if (index >= this.data.aitem.length) return; 461 if (index >= this.data.aitem.length) return;
373 var aitem = this.data.aitem; 462 var aitem = this.data.aitem;
374 var task_number = aitem[index].giftQty - aitem[index].useGiftQty; 463 var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
  464 + var task_id = aitem[index].id;
375 this.setData({ 465 this.setData({
376 sw_index: index, 466 sw_index: index,
377 - task_number: task_number 467 + task_number: task_number,
  468 + taskid: task_id
378 }) 469 })
379 - 470 + if (this.data.switch_head == 1) {
  471 + this.dismantle_record();
  472 + }
380 }, 473 },
381 474
382 /** 475 /**
@@ -384,8 +477,7 @@ Page({ @@ -384,8 +477,7 @@ Page({
384 */ 477 */
385 onHide: function() { 478 onHide: function() {
386 //--清理定时器-- 479 //--清理定时器--
387 - console.log("清理定时器");  
388 - clearInterval(this.timer); 480 + clearInterval(this.data.timer);
389 }, 481 },
390 482
391 /** 483 /**
@@ -407,52 +499,42 @@ Page({ @@ -407,52 +499,42 @@ Page({
407 var th = this; 499 var th = this;
408 // 获取当前时间,同时得到活动结束时间数组 500 // 获取当前时间,同时得到活动结束时间数组
409 var newTime = ut.gettimestamp(); 501 var newTime = ut.gettimestamp();
410 - var List = this.data.aitem;  
411 - for (var j = 0; j < List.length; j++) {  
412 - var o = List[j];  
413 -  
414 - // 对结束时间进行处理渲染到页面  
415 -  
416 - // var o = endTimeList[i];  
417 - var endTime = o.endDate  
418 -  
419 - // if (o.status == 0) endTime = o.start_time  
420 -  
421 - var obj = null;  
422 - // 如果活动未结束,对时间进行处理  
423 - if (endTime - newTime > 0) {  
424 -  
425 - var time = (endTime - newTime);  
426 - // 获取天、时、分、秒  
427 - var day = parseInt(time / (60 * 60 * 24));  
428 - var hou = parseInt(time % (60 * 60 * 24) / 3600);  
429 - var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
430 - var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
431 - obj = {  
432 - day: this.timeFormat(day),  
433 - hou: this.timeFormat(hou),  
434 - min: this.timeFormat(min),  
435 - sec: this.timeFormat(sec)  
436 - }  
437 - } else {  
438 502
439 - //活动已结束,全部设置为'00'  
440 - obj = {  
441 - day: '00',  
442 - hou: '00',  
443 - min: '00',  
444 - sec: '00'  
445 - } 503 + // 对结束时间进行处理渲染到页面
  504 +
  505 + // var o = endTimeList[i];
  506 + var endTime = th.data.endDate;
  507 + console.log("结束时间5555555", endTime);
  508 + // if (o.status == 0) endTime = o.start_time
  509 +
  510 + var obj = null;
  511 + // 如果活动未结束,对时间进行处理
  512 + if (endTime - newTime > 0) {
  513 + var time = (endTime - newTime);
  514 + // 获取天、时、分、秒
  515 + var day = parseInt(time / (60 * 60 * 24));
  516 + var hou = parseInt(time % (60 * 60 * 24) / 3600);
  517 + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  518 + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  519 + obj = {
  520 + day: this.timeFormat(day),
  521 + hou: this.timeFormat(hou),
  522 + min: this.timeFormat(min),
  523 + sec: this.timeFormat(sec)
  524 + }
  525 + } else {
  526 + //活动已结束,全部设置为'00'
  527 + obj = {
  528 + day: '00',
  529 + hou: '00',
  530 + min: '00',
  531 + sec: '00'
446 } 532 }
447 - var txt = "aitem[" + j + "]djs";  
448 - th.setData({  
449 - [txt]: obj  
450 - });  
451 -  
452 -  
453 } 533 }
454 - setTimeout(th.countDown, 1000);  
455 - 534 + var txt = "aitem[" +0+ "].djs";
  535 + th.setData({
  536 + [txt]: obj
  537 + });
456 }, 538 },
457 //---小于10的格式化函数---- 539 //---小于10的格式化函数----
458 timeFormat(param) { 540 timeFormat(param) {
@@ -472,119 +554,7 @@ Page({ @@ -472,119 +554,7 @@ Page({
472 onShareAppMessage: function() { 554 onShareAppMessage: function() {
473 555
474 }, 556 },
475 - shareFrends: function(e) {  
476 - var th = this;  
477 - var scene = th.data.gid;  
478 - ///二微码  
479 - // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +  
480 - // a.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";  
481 - var iurl = th.data.iurl; //图片地址前缀  
482 - const ctx = wx.createCanvasContext('share_id'); //绘图上下文  
483 - var unit = th.data.screenWidth / 750 * 1.35;  
484 - var numsize = 20 * unit; //几人助力字体大小  
485 - var size = 15 * unit;  
486 - var num = 10;  
487 - var q_num = 6;  
488 - var already = num.toString().length + 1; //已有几位好友助力  
489 - var lack = q_num.toString().length + 1; //还差几位好友助力  
490 - var imagesize = 40 * unit; //助力人的图片大小  
491 - var left = 74 * unit; //助力人头像跟左边的距离  
492 - var spacing = 12 * unit; //助力人图片间距  
493 - var images = th.data.images;  
494 - ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片  
495 - ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片  
496 - ctx.drawImage(images[2], 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的背景图片  
497 - ctx.setFillStyle("rgb(221,153,116)");  
498 - ctx.setFontSize(size)  
499 - ctx.fillText("已有", 77 * unit, 430 * unit);  
500 - ctx.setFillStyle("#FF4746");  
501 - ctx.setFontSize(numsize)  
502 - ctx.fillText(num + "位", 108 * unit, 430 * unit);  
503 - ctx.setFillStyle("rgb(221,153,116)");  
504 - ctx.setFontSize(size)  
505 - ctx.fillText("好友助力,还差", 114 * unit + already * numsize * unit, 430 * unit);  
506 - ctx.setFillStyle("#FF4746");  
507 - ctx.setFontSize(numsize);  
508 - ctx.fillText(q_num + "位", 220 * unit + already * numsize * unit, 430 * unit);  
509 - ctx.setFillStyle("rgb(221,153,116)");  
510 - ctx.setFontSize(size);  
511 - ctx.fillText("达成助力", 248 * unit + lack * numsize * unit + already * numsize - numsize * 2, 430 * unit);  
512 - var c = q_num / num;  
513 - ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit, 12 * unit);  
514 - ctx.drawImage(images[4], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit);  
515 - for (var i = 0; i < 6; i++) {  
516 - if (i == 0) {  
517 - ctx.save();  
518 - ctx.beginPath(); //开始绘制  
519 - ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI);  
520 - ctx.setLineWidth(4 * unit);  
521 - ctx.setStrokeStyle('red');  
522 - ctx.setFillStyle("white");  
523 - ctx.fill();  
524 - ctx.clip();  
525 - ctx.drawImage(images[6], left, 505 * unit - imagesize / 2, imagesize, imagesize);  
526 - ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制  
527 - } else {  
528 - // 助力人的头像  
529 - ctx.drawImage(images[6], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片  
530 - }  
531 - left += imagesize + spacing;  
532 - }  
533 - ctx.setFillStyle("rgb(255,255,255)");  
534 - ctx.setFontSize(size);  
535 - ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit);  
536 - ctx.setFillStyle("rgb(255,255,255)");  
537 - ctx.setFontSize(size);  
538 - ctx.fillText("2019.06.26 - 2019.07.02!", 37 * unit, 620 * unit);  
539 - ctx.setFillStyle("rgb(255,255,255)");  
540 - ctx.setFontSize(size);  
541 - ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit);  
542 - ctx.drawImage(images[7], 325 * unit, 595 * unit, 77 * unit, 77 * unit); //分享的背景图片  
543 - ctx.save();  
544 - //读取文件成功则OK--  
545 - // wx.getImageInfo({  
546 - // src: path3,  
547 - // success: function (res) {  
548 - //把画板内容绘制成图片,并回调 画板图片路径  
549 - ctx.draw(false, function() {  
550 - setTimeout(function() {  
551 - wx.canvasToTempFilePath({  
552 - x: 0,  
553 - y: 0,  
554 - width: 300,  
555 - height: 500,  
556 - destWidth: 400 * 2,  
557 - destHeight: 720 * 2,  
558 - canvasId: 'share_id',  
559 - success: function(res) {  
560 - wx.hideLoading();  
561 - var shareImgPath = th.data.shareImgPath;  
562 - shareImgPath[0] = res.tempFilePath;  
563 -  
564 - th.setData({  
565 - shareImgPath: shareImgPath,  
566 - canvasHidden: 1,  
567 - is_share: 1  
568 - })  
569 - if (!res.tempFilePath) {  
570 - wx.showModal({  
571 - title: '提示',  
572 - content: '图片绘制中,请稍后重试',  
573 - showCancel: false  
574 - })  
575 - return false;  
576 - }  
577 557
578 - },  
579 - fail(r) {  
580 -  
581 - }  
582 - }, 500)  
583 - })  
584 - })  
585 - // }  
586 - // })  
587 - },  
588 preview: function() { 558 preview: function() {
589 var th = this; 559 var th = this;
590 var shareImgPath = th.data.shareImgPath; 560 var shareImgPath = th.data.shareImgPath;
@@ -763,8 +733,8 @@ Page({ @@ -763,8 +733,8 @@ Page({
763 var c = q_num / num; 733 var c = q_num / num;
764 ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit); 734 ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit);
765 ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit); 735 ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit);
766 - // var dynamic = th.data.dynamic; //助力的微信头像  
767 - // console.log(dynamic[0].headPic + "动态图片显示"); 736 + // var dynamic = th.data.dynamic; //助力的微信头像
  737 + // console.log(dynamic[0].headPic + "动态图片显示");
768 for (var i = 0; i < 6; i++) { 738 for (var i = 0; i < 6; i++) {
769 if (i < 0) { 739 if (i < 0) {
770 // ctx.beginPath(); 740 // ctx.beginPath();
@@ -948,21 +918,23 @@ Page({ @@ -948,21 +918,23 @@ Page({
948 }) 918 })
949 919
950 }, 920 },
951 -//好友猜一猜  
952 - save_share: function (e) { 921 + //好友猜一猜
  922 + save_share: function(e) {
  923 + var th = this;
953 var aitem = this.data.aitem; //任务的数据集 924 var aitem = this.data.aitem; //任务的数据集
954 var sw_index = this.data.sw_index; //轮播的下标 925 var sw_index = this.data.sw_index; //轮播的下标
955 //任务id 926 //任务id
956 - var taskid = aitem[sw_index].id;  
957 - console.log("好友猜一猜的任务id", taskid);  
958 - var th = this;  
959 - 927 + var taskid = aitem[sw_index].id
  928 + th.setData({
  929 + is_share: 1
  930 + })
960 var url = "/api/weshop/marketing/help/help/task/involve/page"; 931 var url = "/api/weshop/marketing/help/help/task/involve/page";
961 getApp().request.promiseGet(url, { 932 getApp().request.promiseGet(url, {
  933 + isShowLoading: true,
962 data: { 934 data: {
963 - storeId: 1, 935 + storeId: os.stoid,
964 taskId: taskid, 936 taskId: taskid,
965 - userId: 1433390 937 + userId: getApp().globalData.user_id
966 } 938 }
967 }).then(res => { 939 }).then(res => {
968 if (res.data.code == 0) { 940 if (res.data.code == 0) {
@@ -971,11 +943,11 @@ Page({ @@ -971,11 +943,11 @@ Page({
971 // th.setData({ 943 // th.setData({
972 // dynamic: data 944 // dynamic: data
973 // }) 945 // })
974 - // th.info_head();  
975 - th.imageinfo();  
976 - setTimeout(function () { 946 + // th.info_head(function() {
977 th.shareFrends(); 947 th.shareFrends();
978 - }, 500) 948 + // });
  949 + //th.imageinfo();
  950 +
979 } 951 }
980 } else { 952 } else {
981 wx.hideLoading(); 953 wx.hideLoading();
@@ -984,18 +956,18 @@ Page({ @@ -984,18 +956,18 @@ Page({
984 }) 956 })
985 }, 957 },
986 //把已助力好友头像下载到本地 958 //把已助力好友头像下载到本地
987 - info_head: function (e) { 959 + info_head: function(e) {
988 var th = this; 960 var th = this;
989 var images = th.data.dynamic; 961 var images = th.data.dynamic;
990 if (images[0] != null && images[0] != "" && images[0] != undefined) { 962 if (images[0] != null && images[0] != "" && images[0] != undefined) {
991 console.log(images[0].headPic + "就将计就计"); 963 console.log(images[0].headPic + "就将计就计");
992 wx.getImageInfo({ 964 wx.getImageInfo({
993 src: images[0].headPic, 965 src: images[0].headPic,
994 - success: function (res) { 966 + success: function(res) {
995 //res.path是网络图片的本地地址 967 //res.path是网络图片的本地地址
996 images[0].headPic = res.path; 968 images[0].headPic = res.path;
997 }, 969 },
998 - fail: function (res) { 970 + fail: function(res) {
999 971
1000 } 972 }
1001 }); 973 });
@@ -1003,11 +975,11 @@ Page({ @@ -1003,11 +975,11 @@ Page({
1003 if (images[1] != null && images[1] != "" && images[1] != undefined) { 975 if (images[1] != null && images[1] != "" && images[1] != undefined) {
1004 wx.getImageInfo({ 976 wx.getImageInfo({
1005 src: images[1].headPic, 977 src: images[1].headPic,
1006 - success: function (res) { 978 + success: function(res) {
1007 //res.path是网络图片的本地地址 979 //res.path是网络图片的本地地址
1008 images[1].headPic = res.path; 980 images[1].headPic = res.path;
1009 }, 981 },
1010 - fail: function (res) { 982 + fail: function(res) {
1011 983
1012 } 984 }
1013 }); 985 });
@@ -1015,11 +987,11 @@ Page({ @@ -1015,11 +987,11 @@ Page({
1015 if (images[2] != null && images[2] != "" && images[2] != undefined) { 987 if (images[2] != null && images[2] != "" && images[2] != undefined) {
1016 wx.getImageInfo({ 988 wx.getImageInfo({
1017 src: images[2].headPic, 989 src: images[2].headPic,
1018 - success: function (res) { 990 + success: function(res) {
1019 //res.path是网络图片的本地地址 991 //res.path是网络图片的本地地址
1020 images[2].headPic = res.path; 992 images[2].headPic = res.path;
1021 }, 993 },
1022 - fail: function (res) { 994 + fail: function(res) {
1023 995
1024 } 996 }
1025 }); 997 });
@@ -1027,11 +999,11 @@ Page({ @@ -1027,11 +999,11 @@ Page({
1027 if (images[3] != null && images[3] != "" && images[3] != undefined) { 999 if (images[3] != null && images[3] != "" && images[3] != undefined) {
1028 wx.getImageInfo({ 1000 wx.getImageInfo({
1029 src: images[3].headPic, 1001 src: images[3].headPic,
1030 - success: function (res) { 1002 + success: function(res) {
1031 //res.path是网络图片的本地地址 1003 //res.path是网络图片的本地地址
1032 images[3].headPic = res.path; 1004 images[3].headPic = res.path;
1033 }, 1005 },
1034 - fail: function (res) { 1006 + fail: function(res) {
1035 1007
1036 } 1008 }
1037 }); 1009 });
@@ -1063,6 +1035,18 @@ Page({ @@ -1063,6 +1035,18 @@ Page({
1063 th.setData({ 1035 th.setData({
1064 dynamic: images 1036 dynamic: images
1065 }) 1037 })
  1038 +
  1039 + },
  1040 + //礼包的详情 轮播图
  1041 + libao_details: function(e) {
  1042 + var th = this;
  1043 + var help_id = th.data.help_id;//活动id
  1044 + var taskId = th.data.taskid;//任务id
  1045 + getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId);
  1046 + },
  1047 + //正在进行任务
  1048 + test: function(e) {
  1049 + getApp().goto("/pages/user/assistance/friend_assistance?tasking=13");
1066 }, 1050 },
1067 1051
1068 }) 1052 })
1069 \ No newline at end of file 1053 \ No newline at end of file
pages/user/assistance/task_assistance.json
1 { 1 {
2 - "navigationBarTitleText": "好友助力", 2 + "navigationBarTitleText": "好友助力,得好礼",
3 "navigationStyle": "custom", 3 "navigationStyle": "custom",
4 "usingComponents": { 4 "usingComponents": {
5 "warn": "/components/long_warn/long_warn", 5 "warn": "/components/long_warn/long_warn",
pages/user/assistance/task_assistance.wxml
1 -<wxs module="filter" src="../../../utils/filter.wxs"></wxs> 1 + <wxs module="filter" src="../../../utils/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 <!-- 助力活动头部 --> 3 <!-- 助力活动头部 -->
4 <view class="top-frame"> 4 <view class="top-frame">
5 <view class="top-title white fs36 t-c"> 5 <view class="top-title white fs36 t-c">
6 -  
7 {{aitem[sw_index].helpTaskName}} 6 {{aitem[sw_index].helpTaskName}}
8 </view> 7 </view>
9 <view class="activity-data t-c fs28 white"> 8 <view class="activity-data t-c fs28 white">
10 活动剩余时间:<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> 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>
11 - </view> 10 + </view>
12 </view> 11 </view>
13 <!-- 图片的轮播图 --> 12 <!-- 图片的轮播图 -->
14 <view class="xc-specific-more-frame flex-center"> 13 <view class="xc-specific-more-frame flex-center">
@@ -16,8 +15,11 @@ @@ -16,8 +15,11 @@
16 <view class="bg_left xc-left bcolor"></view> 15 <view class="bg_left xc-left bcolor"></view>
17 </view> 16 </view>
18 <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> 17 <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}">
19 - <swiper-item wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx">  
20 - <image class="xc-center-img " src="{{iurl+aitem.giftBagUrl}}"></image> 18 + <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx">
  19 +
  20 + <image class="xc-center-img" bindtap="libao_details" src="{{iurl+aitem.giftBagUrl}}"></image>
  21 + <view class="abs select_details fs26 white">礼包详情</view>
  22 +
21 </swiper-item> 23 </swiper-item>
22 </swiper> 24 </swiper>
23 25
@@ -25,23 +27,28 @@ @@ -25,23 +27,28 @@
25 <view class="bg_right xc-right bcolor mt"></view> 27 <view class="bg_right xc-right bcolor mt"></view>
26 </view> 28 </view>
27 </view> 29 </view>
28 - <view class="plan-frame flex ai-center"> 30 + <view class="plan-frame flex ai-center" wx:if="{{is_user_task}}">
29 <view class="plan_num rel"> 31 <view class="plan_num rel">
30 - <view class="is_plam abs"></view> 32 + <view class="is_plam abs" style="width:{{(is_user_task.zlHelpNum/is_user_task.helpNum)*100}}%"></view>
31 </view> 33 </view>
32 - <text class="white fs24">/</text> 34 +
  35 +
  36 + <text class="white fs24">{{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}}</text>
33 37
34 </view> 38 </view>
35 <view class="task-number fs28 white t-c "> 39 <view class="task-number fs28 white t-c ">
36 今天剩余可领{{task_number}}个任务 40 今天剩余可领{{task_number}}个任务
37 </view> 41 </view>
38 42
39 - <view wx:if="{{is_shares==null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="add_onlicke"> 43 + <view wx:if="{{is_user_task==null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="add_onlicke">
40 就选它了 44 就选它了
41 </view> 45 </view>
42 - <view wx:if="{{is_shares!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="save_share"> 46 + <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center" bindtap="save_share">
43 好友拆一拆 47 好友拆一拆
44 </view> 48 </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">
  50 + 测试专用
  51 + </view> -->
45 52
46 </view> 53 </view>
47 <!-- 底部列表 --> 54 <!-- 底部列表 -->
@@ -63,49 +70,70 @@ @@ -63,49 +70,70 @@
63 70
64 <view class="items" wx:if="{{is_task==0}}"> 71 <view class="items" wx:if="{{is_task==0}}">
65 72
66 - <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}" > 73 + <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}"wx:key="*this">
67 <view class="flex-center width"> 74 <view class="flex-center width">
68 <view class="ellipsis-1">{{item.helpTaskName}} 75 <view class="ellipsis-1">{{item.helpTaskName}}
69 </view> 76 </view>
70 </view> 77 </view>
71 <view class="flex-center width state"> 78 <view class="flex-center width state">
72 <view class="ellipsis-1"> 79 <view class="ellipsis-1">
73 - <text wx:if="{{item.status==0&&item.zlHelpNum<item.helpNum}}">{{item.zlHelpNum}}/{{item.helpNum}}</text>  
74 - <text wx:if="{{item.status==2&&item.zlHelpNum==item.helpNum}}">查看详情</text>  
75 - <text wx:if="{{item.status==1&&time.zlHelpNum==item.helpNum}}">领取礼包 </text> 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>
76 </view> 84 </view>
77 </view> 85 </view>
78 86
79 </view> 87 </view>
  88 +
  89 + <view class="fs30" wx:if="{{user_task_list==null || user_task_list==''}}">
  90 + <view class="flex-center nothing white">
  91 + <view>暂无任务记录</view>
80 </view> 92 </view>
81 </view> 93 </view>
  94 + </view>
82 95
  96 +
  97 + </view>
  98 +
83 99
84 <view class="items" wx:if="{{is_task==1}}"> 100 <view class="items" wx:if="{{is_task==1}}">
85 - <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}"> 101 + <block wx:if="{{ dismantle!=null|| dismantle!=''}}">
  102 +
  103 +
  104 + <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}"wx:for-index="idx">
  105 +
86 <view class="flex white" style="justify-content: space-around; width: 90%;margin:auto"> 106 <view class="flex white" style="justify-content: space-around; width: 90%;margin:auto">
87 - <image class="circle user_img" src="{{iurl+itme.headPic}}"></image>  
88 - <view class="ellipsis-1">{{itme.nickName}} 107 + <image class="circle user_img" src="{{item.headPic}}"></image>
  108 + <view class="ellipsis-1">{{item.nickName}}
89 </view> 109 </view>
90 - <view class="ellipsis-1">{{filter.format_time(itme.beginDate)}} 110 + <view class="ellipsis-1">{{filter.format_time(item.zltime)}}
91 </view> 111 </view>
92 </view> 112 </view>
93 -  
94 </view> 113 </view>
95 114
  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>
96 </view> 119 </view>
97 - <view class="fs30" wx:if="{{user_task_list==null || user_task_list==''}}"> 120 + </block>
  121 +
  122 + <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}">
98 <view class="flex-center nothing white"> 123 <view class="flex-center nothing white">
99 <view>暂无任务记录</view> 124 <view>暂无任务记录</view>
100 </view> 125 </view>
101 </view> 126 </view>
  127 +
  128 + </view>
  129 +
102 130
103 </view> 131 </view>
104 <!-- 加载更多 --> 132 <!-- 加载更多 -->
105 <view class="fs32"> 133 <view class="fs32">
106 - <view class="flex-center" wx:if="{{user_task_list}}"> 134 + <view class="flex-center" wx:if="{{is_show==1}}">
107 <view class="line"></view> 135 <view class="line"></view>
108 - <view class="load white" bindtap="">点击加载更多</view> 136 + <view class="load white" bindtap="user_task_list">点击加载更多</view>
109 <view class="line"></view> 137 <view class="line"></view>
110 </view> 138 </view>
111 <view class="flex-center white" style="margin-top: 20rpx;"> 139 <view class="flex-center white" style="margin-top: 20rpx;">
@@ -114,32 +142,17 @@ @@ -114,32 +142,17 @@
114 <view>人领取了任务</view> 142 <view>人领取了任务</view>
115 </view> 143 </view>
116 </view> 144 </view>
117 -<view wx:if="{{is_share}}">  
118 - <!-- 蒙尘 -->  
119 - <view class="dust">  
120 - </view>  
121 - <!-- 画布 -->  
122 - <view class="canvas" style="width:100%;">  
123 - <view class="flex-center">  
124 - <canvas canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas>  
125 - </view>  
126 - <view class="closes flex-center">  
127 - <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image>  
128 - </view>  
129 - </view>  
130 -</view> 145 +
131 146
132 <!--********** 钱巧玲 --> 147 <!--********** 钱巧玲 -->
133 -<view>  
134 - <!-- 蒙尘 -->  
135 - <view class="dust">  
136 - </view>  
137 - <!-- 画布 --> 148 +<view wx:if="{{is_share}}" >
  149 +
  150 + <view class="dust"></view>
138 <view class="canvas" style="width:100%;"> 151 <view class="canvas" style="width:100%;">
139 <view class="flex-center"> 152 <view class="flex-center">
140 - <canvas wx:if="{{is_share}}" canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas> 153 + <canvas canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas>
141 </view> 154 </view>
142 - <view wx:if="{{is_share}}" class="closes flex-center"> 155 + <view class="closes flex-center">
143 <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image> 156 <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image>
144 </view> 157 </view>
145 </view> 158 </view>
pages/user/assistance/task_assistance.wxss
@@ -165,8 +165,11 @@ border-color: #fff; @@ -165,8 +165,11 @@ border-color: #fff;
165 background: #ffe7ab; 165 background: #ffe7ab;
166 border-radius: 20rpx; 166 border-radius: 20rpx;
167 height: 22rpx; 167 height: 22rpx;
  168 + margin-right: 10rpx;
168 } 169 }
169 .is_plam{ 170 .is_plam{
  171 + border-radius: 20rpx;
  172 + background: #fcc001;
170 height: 100%; 173 height: 100%;
171 top: 0rpx; 174 top: 0rpx;
172 left: 0rpx; 175 left: 0rpx;
@@ -185,7 +188,7 @@ border-color: #fff; @@ -185,7 +188,7 @@ border-color: #fff;
185 188
186 .canvas { 189 .canvas {
187 position: fixed; 190 position: fixed;
188 - z-index: 11; 191 + z-index: 20;
189 width: 100%; 192 width: 100%;
190 top:20rpx; 193 top:20rpx;
191 } 194 }
@@ -193,4 +196,13 @@ border-color: #fff; @@ -193,4 +196,13 @@ border-color: #fff;
193 .close { 196 .close {
194 width: 70rpx; 197 width: 70rpx;
195 height: 70rpx; 198 height: 70rpx;
  199 +}
  200 +.select_details{
  201 + width: 100%;
  202 + height: 50rpx;
  203 + line-height: 50rpx;
  204 + text-align: center;
  205 + background: #000;
  206 + opacity:0.6; filter: alpha(opacity=60);
  207 + bottom: 0rpx;
196 } 208 }
197 \ No newline at end of file 209 \ No newline at end of file
pages/user/integral/filter.wxs
1 var numFr = { 1 var numFr = {
2 getNum: function(x) { 2 getNum: function(x) {
3 - var f = parseFloat(x);  
4 - if (isNaN(f)) {  
5 - return false;  
6 - }  
7 - var f = Math.round(x * 100) / 100;  
8 - var s = f.toString();  
9 - var rs = s.indexOf('.');  
10 - if (rs < 0) {  
11 - rs = s.length;  
12 - s += '.';  
13 - }  
14 - while (s.length <= rs + 2) {  
15 - s += '0';  
16 - }  
17 - return s; 3 + var f = parseInt(x);
  4 + return f;
18 } 5 }
19 } 6 }
20 module.exports = { 7 module.exports = {
pages/user/integral/integral.wxml
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 </view> 40 </view>
41 </view> 41 </view>
42 <view class="val" style='color:{{(details.InIntegral!="0")?"green":""}}'> 42 <view class="val" style='color:{{(details.InIntegral!="0")?"green":""}}'>
43 - {{(details.OutIntegral==0)?"+":""}}{{(details.InIntegral==0)?filter.getNum(details.OutIntegral):filter.getNum(details.InIntegral)}}积分 </view> 43 + {{(details.OutIntegral==0)?"+":"-"}}{{(details.InIntegral==0)?details.OutIntegral:details.InIntegral}}积分 </view>
44 </view> 44 </view>
45 <view style="clear:both"></view> 45 <view style="clear:both"></view>
46 </block> 46 </block>
utils/request.js
@@ -220,15 +220,18 @@ module.exports = { @@ -220,15 +220,18 @@ module.exports = {
220 * @param {Object} succ //成功的回调 220 * @param {Object} succ //成功的回调
221 * @param {Object} fail //失败的回调 221 * @param {Object} fail //失败的回调
222 */ 222 */
223 - json_post:function(url,data,succ,fail){  
224 - var th=this; 223 + json_post:function(url,data,succ,fail,mathod){
  224 + var th=this;
  225 + var Mathod="POST";
  226 +
  227 + if (mathod) Mathod = mathod;
225 this.showLoading(); 228 this.showLoading();
226 if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; 229 if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url;
227 var str = JSON.stringify(data); 230 var str = JSON.stringify(data);
228 wx.request({ 231 wx.request({
229 url: url, 232 url: url,
230 data: str, 233 data: str,
231 - method: 'POST', 234 + method: Mathod,
232 header: { 235 header: {
233 'content-type': 'application/json' 236 'content-type': 'application/json'
234 },// 设置请求的 header 237 },// 设置请求的 header