Commit 1d9f590a1b01242f5dca5efcdbbc3af8da363fd9

Authored by yvan.ni
2 parents 2b2c83fe 164f1c27

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

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/giftpacklist/giftpacklist.wxml
@@ -134,7 +134,7 @@ @@ -134,7 +134,7 @@
134 <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode"> 134 <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode">
135 <text class="data-v-3a5b7e36">立即使用</text> 135 <text class="data-v-3a5b7e36">立即使用</text>
136 </view> 136 </view>
137 - <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue"> 137 + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue" bindtap="getcode">
138 <text class="data-v-3a5b7e36">商品已核销</text> 138 <text class="data-v-3a5b7e36">商品已核销</text>
139 </view> 139 </view>
140 <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue"> 140 <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue">
pages/user/assistance/assistance.js
@@ -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 },
@@ -83,11 +83,9 @@ Page({ @@ -83,11 +83,9 @@ Page({
83 83
84 //--点击获取用户任务列表--会员的任务列表 84 //--点击获取用户任务列表--会员的任务列表
85 get_list:function() { 85 get_list:function() {
86 -  
87 - 86 +
88 var th = this; 87 var th = this;
89 var page=th.data.page; 88 var page=th.data.page;
90 - console.log("page是什么", page);  
91 var help_id=this.data.help_id; 89 var help_id=this.data.help_id;
92 t.request.get("/api/weshop/marketing/help/help/user/page", { 90 t.request.get("/api/weshop/marketing/help/help/user/page", {
93 data: { 91 data: {
@@ -107,33 +105,32 @@ Page({ @@ -107,33 +105,32 @@ Page({
107 105
108 106
109 if (res.data.code == 0) { 107 if (res.data.code == 0) {
110 - var page=th.data.page+1; 108 +
111 var list = th.data.zl_user_list; 109 var list = th.data.zl_user_list;
112 //连接数组 110 //连接数组
113 list = list.concat(res.data.data.pageData); 111 list = list.concat(res.data.data.pageData);
114 th.setData({ 112 th.setData({
115 zl_user_list: list, 113 zl_user_list: list,
116 is_load: 1, 114 is_load: 1,
117 - page: page  
118 }); 115 });
119 if (res.data.data.total <= 5) { 116 if (res.data.data.total <= 5) {
120 th.setData({ 117 th.setData({
121 is_show_more: 1 118 is_show_more: 1
122 }) 119 })
  120 + }else{
  121 + var page = th.data.page + 1;
  122 + th.setData({
  123 + is_show_more: 0,
  124 + page: page
  125 + })
123 } 126 }
124 - // var n_all_num = th.data.cur_page * th.data.page_num;  
125 - // if (res.data.data.total > n_all_num) th.setData({  
126 - // is_show_more: 1  
127 - // })  
128 - // else th.setData({  
129 - // is_show_more: 0  
130 - // })  
131 - //页吗要更新一下  
132 - // th.data.cur_page++; 127 +
133 } else { 128 } else {
134 - getApp().showWarning("暂无更多内容"); 129 +
  130 + getApp().showWarning("暂无更多内容",0);
135 th.setData({ 131 th.setData({
136 - is_show_more: 1 132 + is_show_more: 1,
  133 + page: page
137 }) 134 })
138 } 135 }
139 136
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
@@ -131,7 +131,7 @@ Page({ @@ -131,7 +131,7 @@ Page({
131 var th = this; 131 var th = this;
132 var nav_b = th.selectComponent("#nav_b"); //组件的id 132 var nav_b = th.selectComponent("#nav_b"); //组件的id
133 nav_b.close_box(); 133 nav_b.close_box();
134 - nav_b.set_name("助力", ""); 134 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
135 }, 135 },
136 136
137 /** 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
@@ -31,38 +31,117 @@ Page({ @@ -31,38 +31,117 @@ Page({
31 receiveState: 0, //0未领取 1已领取 31 receiveState: 0, //0未领取 1已领取
32 completeid: "", 32 completeid: "",
33 is_sub: 0, //判断是否重复提交 33 is_sub: 0, //判断是否重复提交
  34 + is_libao: 0, //0轮播查看活动 1领取礼包 2.查看礼包详情
  35 + held_id: "", //活动id
  36 + taskId: "", //任务id
  37 + orderSn: "", //订单号
34 }, 38 },
35 onLoad: function(options) { 39 onLoad: function(options) {
36 var th = this; 40 var th = this;
37 - th.setData({  
38 - getGiftID: 100, // options.libao_id,  
39 - completeid: options.completeid,  
40 - orderSn: options.orderSn  
41 - })  
42 if (options.is_libao == 0) { 41 if (options.is_libao == 0) {
43 - th.GetMyGiftList();  
44 - } else { 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 + })
45 th.GetBuyGiftList(); 53 th.GetBuyGiftList();
46 } 54 }
47 - // th.setData({  
48 - // giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img")  
49 - // }) 55 + if (options.order_sn) {
  56 + th.setData({
  57 + orderSn: options.orderSn
  58 + })
  59 + th.GetMyGiftList();
  60 + }
50 th.close(); 61 th.close();
51 }, 62 },
52 onShow: function() { 63 onShow: function() {
53 64
54 }, 65 },
  66 + //助力活动查看礼包详情调用
  67 + help: function(e) {
  68 + var th = this;
  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
  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 + }
  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();
55 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({
  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
  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 + }
  131 +
  132 + })
  133 + },
56 GetMyGiftList: function() { 134 GetMyGiftList: function() {
57 var _this = this; 135 var _this = this;
58 var th = this; 136 var th = this;
59 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { 137 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
  138 + isShowLoading: true,
60 data: { 139 data: {
61 "storeId": a.stoid, //商家ID 140 "storeId": a.stoid, //商家ID
62 "userId": d.user_id, //用户ID 141 "userId": d.user_id, //用户ID
63 "orderSn": th.data.orderSn 142 "orderSn": th.data.orderSn
64 }, 143 },
65 - success: function success(res) { 144 + success: function(res) {
66 if (res.data.code == 0) { 145 if (res.data.code == 0) {
67 th.setData({ 146 th.setData({
68 giftImage: th.data.iurl + res.data.data.lbUrl, 147 giftImage: th.data.iurl + res.data.data.lbUrl,
@@ -74,7 +153,7 @@ Page({ @@ -74,7 +153,7 @@ Page({
74 }) 153 })
75 } else { 154 } else {
76 th.setData({ 155 th.setData({
77 - giftRemark: res.data.data.giftRemark 156 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
78 }) 157 })
79 } 158 }
80 159
@@ -132,7 +211,7 @@ Page({ @@ -132,7 +211,7 @@ Page({
132 }) 211 })
133 var json = { 212 var json = {
134 "actId": th.data.completeid, //活动Id 213 "actId": th.data.completeid, //活动Id
135 - "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 214 + "actType": 5, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
136 "giftBagId": th.data.giftID, //礼包Id 215 "giftBagId": th.data.giftID, //礼包Id
137 "storeId": a.stoid, //商家Id 216 "storeId": a.stoid, //商家Id
138 "userId": d.user_id //用户ID 217 "userId": d.user_id //用户ID
@@ -164,17 +243,14 @@ Page({ @@ -164,17 +243,14 @@ Page({
164 GetBuyGiftList: function() { 243 GetBuyGiftList: function() {
165 var _this2 = this; 244 var _this2 = this;
166 var th = this.data; 245 var th = this.data;
167 - wx.showLoading({  
168 - title: '加载中'  
169 - })  
170 getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { 246 getApp().request.get('/api/weshop/marketing/giftbag/detail/get', {
  247 + isShowLoading: true,
171 data: { 248 data: {
172 "storeId": a.stoid, //商家ID 249 "storeId": a.stoid, //商家ID
173 "userId": d.user_id, //用户ID 250 "userId": d.user_id, //用户ID
174 - "giftBagId": th.getGiftID 251 + "giftBagId": th.taskId
175 }, 252 },
176 success: function(res) { 253 success: function(res) {
177 - wx.hideLoading();  
178 if (res.data.code == 0) { 254 if (res.data.code == 0) {
179 _this2.setData({ 255 _this2.setData({
180 giftImage: th.iurl + res.data.data.lbUrl, 256 giftImage: th.iurl + res.data.data.lbUrl,
@@ -187,10 +263,9 @@ Page({ @@ -187,10 +263,9 @@ Page({
187 }) 263 })
188 } else { 264 } else {
189 _this2.setData({ 265 _this2.setData({
190 - giftRemark: res.data.data.giftRemark 266 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
191 }) 267 })
192 } 268 }
193 -  
194 _this2.setData({ 269 _this2.setData({
195 giftDate: res.data.data.endTime, 270 giftDate: res.data.data.endTime,
196 giftPosPrice: res.data.data.giftPosPrice, 271 giftPosPrice: res.data.data.giftPosPrice,
@@ -231,14 +306,8 @@ Page({ @@ -231,14 +306,8 @@ Page({
231 }; 306 };
232 var data = JSON.stringify(json); 307 var data = JSON.stringify(json);
233 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"; //预约接口地址
234 - wx.request({  
235 - url: url,  
236 - data: data,  
237 - method: 'put',  
238 - header: {  
239 - 'content-type': 'application/json'  
240 - }, // 设置请求的 header  
241 - success: function(res) { 309 + getApp().request.json_post(url, json,
  310 + function(res) {
242 if (res.data.code == 0) { 311 if (res.data.code == 0) {
243 th.setData({ 312 th.setData({
244 code: res.data.data 313 code: res.data.data
@@ -247,8 +316,15 @@ Page({ @@ -247,8 +316,15 @@ Page({
247 } else { 316 } else {
248 getApp().my_warnning(res.data.msg, 0, th); 317 getApp().my_warnning(res.data.msg, 0, th);
249 } 318 }
250 - }  
251 - }) 319 + },
  320 + function(res) {
  321 +
  322 + }, "put"
  323 +
  324 + )
  325 +
  326 +
  327 +
252 }, 328 },
253 //界面跳转 329 //界面跳转
254 goto: function(e) { 330 goto: function(e) {
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,7 +95,7 @@ @@ -95,7 +95,7 @@
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>
pages/user/assistance/task_assistance.js
@@ -32,6 +32,10 @@ Page({ @@ -32,6 +32,10 @@ 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 //*********************************************start钱 39 //*********************************************start钱
36 canvasHidden: 0, //分享图片是否已经生成 40 canvasHidden: 0, //分享图片是否已经生成
37 is_share: 0, //是否显示画布 41 is_share: 0, //是否显示画布
@@ -77,7 +81,6 @@ Page({ @@ -77,7 +81,6 @@ Page({
77 add_onlicke: function(e) { 81 add_onlicke: function(e) {
78 var th = this; 82 var th = this;
79 var taskid = e.target.dataset.taskid; 83 var taskid = e.target.dataset.taskid;
80 - console.log("任务id5555555", taskid);  
81 var help_id = th.data.help_id; 84 var help_id = th.data.help_id;
82 var user_id = getApp().globalData.user_id; 85 var user_id = getApp().globalData.user_id;
83 var stoid = os.stoid 86 var stoid = os.stoid
@@ -88,10 +91,12 @@ Page({ @@ -88,10 +91,12 @@ Page({
88 taskId: taskid 91 taskId: taskid
89 }, 92 },
90 function(res) { 93 function(res) {
91 -  
92 if (res.data.code == 0) { 94 if (res.data.code == 0) {
93 - console.log(res.data.data);  
94 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();
95 } else { 100 } else {
96 getApp().my_warnning(res.data.msg, 0, th); 101 getApp().my_warnning(res.data.msg, 0, th);
97 } 102 }
@@ -127,17 +132,18 @@ Page({ @@ -127,17 +132,18 @@ Page({
127 }, 132 },
128 success: function(res) { 133 success: function(res) {
129 if (res.data.code == 0) { 134 if (res.data.code == 0) {
130 -  
131 var help_data = res.data.data; 135 var help_data = res.data.data;
132 - console.log('助力活动(判断)', res.data.data);  
133 th.setData({ 136 th.setData({
134 endDate: help_data.endDate, 137 endDate: help_data.endDate,
135 }); 138 });
136 139
137 //任务时间 设置全局定时器 140 //任务时间 设置全局定时器
138 - th.data.timer = setInterval(function() {  
139 - th.countDown();  
140 - }, 1000); 141 + th.setData({
  142 + timer:setInterval(function () {
  143 + th.countDown();
  144 + }, 1000)
  145 + })
  146 +
141 147
142 } 148 }
143 } 149 }
@@ -194,7 +200,7 @@ Page({ @@ -194,7 +200,7 @@ Page({
194 200
195 //会员任务列表 201 //会员任务列表
196 this.user_task_list(); 202 this.user_task_list();
197 - // 获取会员的参与的任务列表 我的任务 203 + //获取助力活动参与的人数
198 this.get_user_task_num(); 204 this.get_user_task_num();
199 205
200 }, 206 },
@@ -210,7 +216,6 @@ Page({ @@ -210,7 +216,6 @@ Page({
210 var sw_index = this.data.sw_index; //轮播的下标 216 var sw_index = this.data.sw_index; //轮播的下标
211 //任务id 217 //任务id
212 var taskid = aitem[sw_index].id; 218 var taskid = aitem[sw_index].id;
213 - console.log("任务id", taskid);  
214 var th = this; 219 var th = this;
215 var index = 1; //获取当前选择的是任务还是活动说明 220 var index = 1; //获取当前选择的是任务还是活动说明
216 var is_task = this.data.is_task; //0任务,1帮拆 221 var is_task = this.data.is_task; //0任务,1帮拆
@@ -221,24 +226,31 @@ Page({ @@ -221,24 +226,31 @@ Page({
221 if (switch_head == undefined || switch_head == null) { 226 if (switch_head == undefined || switch_head == null) {
222 switch_head = 1; 227 switch_head = 1;
223 } 228 }
224 -  
225 - console.log("0任务,1帮拆", is_task, );  
226 this.setData({ 229 this.setData({
227 is_task: 1, 230 is_task: 1,
228 switch_head: 1 231 switch_head: 1
229 }); 232 });
  233 + var bc_page = th.data.bc_page;
230 rq.get("/api/weshop/marketing/help/help/task/involve/page", { 234 rq.get("/api/weshop/marketing/help/help/task/involve/page", {
231 data: { 235 data: {
  236 + page: bc_page,
  237 + pageSize: 5,
232 taskId: taskid, 238 taskId: taskid,
233 userId: getApp().globalData.user_id, 239 userId: getApp().globalData.user_id,
234 storeId: os.stoid 240 storeId: os.stoid
235 }, 241 },
236 success: function(res) { 242 success: function(res) {
237 -  
238 if (res.data.code == 0) { 243 if (res.data.code == 0) {
239 var dismantle = res.data.data.pageData[0].zlHelpUser; 244 var dismantle = res.data.data.pageData[0].zlHelpUser;
240 - console.log(dismantle.toString, "帮拆记录", dismantle[0].nickName);  
241 - 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 +
242 th.setData({ 254 th.setData({
243 dismantle: dismantle 255 dismantle: dismantle
244 }); 256 });
@@ -292,13 +304,11 @@ Page({ @@ -292,13 +304,11 @@ Page({
292 var th = this; 304 var th = this;
293 var nav_b = th.selectComponent("#nav_b"); //组件的id 305 var nav_b = th.selectComponent("#nav_b"); //组件的id
294 nav_b.close_box(); 306 nav_b.close_box();
295 - nav_b.set_name("助力", ""); 307 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
296 }, 308 },
297 // 获取会员的参与的任务列表 我的任务 309 // 获取会员的参与的任务列表 我的任务
298 user_task_list: function(e) { 310 user_task_list: function(e) {
299 -  
300 var th = this; 311 var th = this;
301 -  
302 var index = 0; 312 var index = 0;
303 var is_task = this.data.is_task; //0任务,1帮拆 313 var is_task = this.data.is_task; //0任务,1帮拆
304 if (is_task == undefined || is_task == null) { 314 if (is_task == undefined || is_task == null) {
@@ -314,24 +324,34 @@ Page({ @@ -314,24 +324,34 @@ Page({
314 }); 324 });
315 var help_id = th.data.help_id; 325 var help_id = th.data.help_id;
316 var user_id = getApp().globalData.user_id; 326 var user_id = getApp().globalData.user_id;
  327 + var rw_page=th.data.rw_page;
317 rq.get("/api/weshop/marketing/help/help/user/page", { 328 rq.get("/api/weshop/marketing/help/help/user/page", {
318 data: { 329 data: {
  330 + page:rw_page,
  331 + pageSize:5,
319 helpId: help_id, 332 helpId: help_id,
320 storeId: os.stoid, 333 storeId: os.stoid,
321 userId: user_id 334 userId: user_id
322 }, 335 },
323 success: function(su) { 336 success: function(su) {
324 -  
325 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 + }
326 var user_list = su.data.data.pageData; 351 var user_list = su.data.data.pageData;
327 - console.log("会员列表", user_list);  
328 th.setData({ 352 th.setData({
329 user_task_list: user_list 353 user_task_list: user_list
330 }); 354 });
331 - } else {  
332 - th.setData({  
333 - user_task_list: null  
334 - });  
335 } 355 }
336 } 356 }
337 }) 357 })
@@ -342,9 +362,7 @@ Page({ @@ -342,9 +362,7 @@ Page({
342 var th = this; 362 var th = this;
343 var aitem = th.data.aitem; 363 var aitem = th.data.aitem;
344 var sw_index = th.data.sw_index; 364 var sw_index = th.data.sw_index;
345 - console.log(sw_index, "判断是否有领取任务", aitem);  
346 var taskid = aitem[sw_index].id 365 var taskid = aitem[sw_index].id
347 - console.log("判断是否有领取任务 任务的id", taskid);  
348 rq.get("/api/weshop/marketing/help/help/task/get", { 366 rq.get("/api/weshop/marketing/help/help/task/get", {
349 data: { 367 data: {
350 storeId: os.stoid, 368 storeId: os.stoid,
@@ -354,7 +372,6 @@ Page({ @@ -354,7 +372,6 @@ Page({
354 success: function(res) { 372 success: function(res) {
355 if (res.data.code == 0) { 373 if (res.data.code == 0) {
356 var is_usertask = res.data.data; 374 var is_usertask = res.data.data;
357 - console.log('判断是不是领取的任务', is_usertask);  
358 th.setData({ 375 th.setData({
359 is_user_task: is_usertask 376 is_user_task: is_usertask
360 }); 377 });
@@ -424,7 +441,6 @@ Page({ @@ -424,7 +441,6 @@ Page({
424 var aitem = this.data.aitem; 441 var aitem = this.data.aitem;
425 var task_number = aitem[index].giftQty - aitem[index].useGiftQty; 442 var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
426 var task_id = aitem[index].id; 443 var task_id = aitem[index].id;
427 - console.log("轮播图点击左边");  
428 this.setData({ 444 this.setData({
429 sw_index: index, 445 sw_index: index,
430 task_number: task_number, 446 task_number: task_number,
@@ -446,7 +462,6 @@ Page({ @@ -446,7 +462,6 @@ Page({
446 var aitem = this.data.aitem; 462 var aitem = this.data.aitem;
447 var task_number = aitem[index].giftQty - aitem[index].useGiftQty; 463 var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
448 var task_id = aitem[index].id; 464 var task_id = aitem[index].id;
449 - console.log("轮播图点击右边");  
450 this.setData({ 465 this.setData({
451 sw_index: index, 466 sw_index: index,
452 task_number: task_number, 467 task_number: task_number,
@@ -462,8 +477,7 @@ Page({ @@ -462,8 +477,7 @@ Page({
462 */ 477 */
463 onHide: function() { 478 onHide: function() {
464 //--清理定时器-- 479 //--清理定时器--
465 - console.log("清理定时器");  
466 - clearInterval(this.timer); 480 + clearInterval(this.data.timer);
467 }, 481 },
468 482
469 /** 483 /**
@@ -489,14 +503,13 @@ Page({ @@ -489,14 +503,13 @@ Page({
489 // 对结束时间进行处理渲染到页面 503 // 对结束时间进行处理渲染到页面
490 504
491 // var o = endTimeList[i]; 505 // var o = endTimeList[i];
492 - var endTime = th.data.endDate  
493 - 506 + var endTime = th.data.endDate;
  507 + console.log("结束时间5555555", endTime);
494 // if (o.status == 0) endTime = o.start_time 508 // if (o.status == 0) endTime = o.start_time
495 509
496 var obj = null; 510 var obj = null;
497 // 如果活动未结束,对时间进行处理 511 // 如果活动未结束,对时间进行处理
498 if (endTime - newTime > 0) { 512 if (endTime - newTime > 0) {
499 -  
500 var time = (endTime - newTime); 513 var time = (endTime - newTime);
501 // 获取天、时、分、秒 514 // 获取天、时、分、秒
502 var day = parseInt(time / (60 * 60 * 24)); 515 var day = parseInt(time / (60 * 60 * 24));
@@ -518,15 +531,10 @@ Page({ @@ -518,15 +531,10 @@ Page({
518 sec: '00' 531 sec: '00'
519 } 532 }
520 } 533 }
521 - 534 + var txt = "aitem[" +0+ "].djs";
522 th.setData({ 535 th.setData({
523 - djs: obj 536 + [txt]: obj
524 }); 537 });
525 -  
526 -  
527 -  
528 -  
529 -  
530 }, 538 },
531 //---小于10的格式化函数---- 539 //---小于10的格式化函数----
532 timeFormat(param) { 540 timeFormat(param) {
@@ -1031,8 +1039,10 @@ Page({ @@ -1031,8 +1039,10 @@ Page({
1031 }, 1039 },
1032 //礼包的详情 轮播图 1040 //礼包的详情 轮播图
1033 libao_details: function(e) { 1041 libao_details: function(e) {
1034 - var giftbagid = e.currentTarget.dataset.giftbagid;  
1035 - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + giftbagid + "&is_libao=" + 0); 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);
1036 }, 1046 },
1037 //正在进行任务 1047 //正在进行任务
1038 test: function(e) { 1048 test: function(e) {
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">
@@ -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"bindtap="libao_details" data-giftbagid="{{aitem.id}}" 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
@@ -44,9 +46,9 @@ @@ -44,9 +46,9 @@
44 <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center" bindtap="save_share"> 46 <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center" bindtap="save_share">
45 好友拆一拆 47 好友拆一拆
46 </view> 48 </view>
47 - <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test"> 49 + <!-- <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test">
48 测试专用 50 测试专用
49 - </view> 51 + </view> -->
50 52
51 </view> 53 </view>
52 <!-- 底部列表 --> 54 <!-- 底部列表 -->
@@ -76,7 +78,7 @@ @@ -76,7 +78,7 @@
76 <view class="flex-center width state"> 78 <view class="flex-center width state">
77 <view class="ellipsis-1"> 79 <view class="ellipsis-1">
78 <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> 80 <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text>
79 - <text wx:if="{{item.status==2}}"bindtap="select_libao" data-libaoid="{{item.helpListGiftBagId}}">查看礼包</text> 81 + <text wx:if="{{item.status==2}}"bindtap="select_libao" data-libaoid="{{item.order_sn}}">查看礼包</text>
80 <text wx:if="{{item.status==1}}"bindtap="get_libao"data-orderid="{{item.ordersn}}" data-libaoid="{{item.helpListGiftBagId}}" 82 <text wx:if="{{item.status==1}}"bindtap="get_libao"data-orderid="{{item.ordersn}}" data-libaoid="{{item.helpListGiftBagId}}"
81 data-completeid="{{item.id}}">领取礼包 </text> 83 data-completeid="{{item.id}}">领取礼包 </text>
82 </view> 84 </view>
@@ -108,8 +110,13 @@ @@ -108,8 +110,13 @@
108 <view class="ellipsis-1">{{filter.format_time(item.zltime)}} 110 <view class="ellipsis-1">{{filter.format_time(item.zltime)}}
109 </view> 111 </view>
110 </view> 112 </view>
111 -  
112 </view> 113 </view>
  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>
  119 + </view>
113 </block> 120 </block>
114 121
115 <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}"> 122 <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}">
@@ -124,9 +131,9 @@ @@ -124,9 +131,9 @@
124 </view> 131 </view>
125 <!-- 加载更多 --> 132 <!-- 加载更多 -->
126 <view class="fs32"> 133 <view class="fs32">
127 - <view class="flex-center" wx:if="{{user_task_list}}"> 134 + <view class="flex-center" wx:if="{{is_show==1}}">
128 <view class="line"></view> 135 <view class="line"></view>
129 - <view class="load white" bindtap="">点击加载更多</view> 136 + <view class="load white" bindtap="user_task_list">点击加载更多</view>
130 <view class="line"></view> 137 <view class="line"></view>
131 </view> 138 </view>
132 <view class="flex-center white" style="margin-top: 20rpx;"> 139 <view class="flex-center white" style="margin-top: 20rpx;">
pages/user/assistance/task_assistance.wxss
@@ -196,4 +196,13 @@ border-color: #fff; @@ -196,4 +196,13 @@ border-color: #fff;
196 .close { 196 .close {
197 width: 70rpx; 197 width: 70rpx;
198 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;
199 } 208 }
200 \ No newline at end of file 209 \ No newline at end of file