Commit 19a48f7a33281381a1360ba5f00c51692c33a93b
1 parent
6ba16ffa
助力活动代码调整
Showing
10 changed files
with
168 additions
and
166 deletions
pages/user/assistance/assistance.js
@@ -6,7 +6,9 @@ var t = getApp(), | @@ -6,7 +6,9 @@ var t = getApp(), | ||
6 | ut = i, | 6 | ut = i, |
7 | s = require("../../../utils/common.js"); | 7 | s = require("../../../utils/common.js"); |
8 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 8 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
9 | -var oo = t.globalData.setting,os=oo, ut= require("../../../utils/util.js"); | 9 | +var oo = t.globalData.setting, |
10 | + os = oo, | ||
11 | + ut = require("../../../utils/util.js"); | ||
10 | Page({ | 12 | Page({ |
11 | 13 | ||
12 | /** | 14 | /** |
@@ -22,10 +24,10 @@ Page({ | @@ -22,10 +24,10 @@ Page({ | ||
22 | cur_page: 1, //页码 | 24 | cur_page: 1, //页码 |
23 | page_num: 5, //每页多少个 | 25 | page_num: 5, //每页多少个 |
24 | is_show_more: 0, //是否加载更多 | 26 | is_show_more: 0, //是否加载更多 |
25 | - help_id:"",//助力活动的id | ||
26 | - timer:"",//任务列表的定时器 | ||
27 | - s_num:"",//多少人已经领取任务 | ||
28 | - page:1,//我的任务的当前页 | 27 | + help_id: "", //助力活动的id |
28 | + timer: "", //任务列表的定时器 | ||
29 | + s_num: "", //多少人已经领取任务 | ||
30 | + page: 1, //我的任务的当前页 | ||
29 | }, | 31 | }, |
30 | 32 | ||
31 | /** | 33 | /** |
@@ -36,79 +38,85 @@ Page({ | @@ -36,79 +38,85 @@ Page({ | ||
36 | var nav_b = th.selectComponent("#nav_b"); //组件的id | 38 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
37 | nav_b.set_name("助力", "/pages/user/assistance/assistance"); | 39 | nav_b.set_name("助力", "/pages/user/assistance/assistance"); |
38 | // 助力活动 | 40 | // 助力活动 |
39 | - this.assistance(); | 41 | + th.assistance(); |
40 | }, | 42 | }, |
41 | 43 | ||
42 | /** | 44 | /** |
43 | * 生命周期函数--监听页面显示 | 45 | * 生命周期函数--监听页面显示 |
44 | */ | 46 | */ |
45 | onShow: function() { | 47 | onShow: function() { |
46 | - | 48 | + |
47 | }, | 49 | }, |
48 | // 助力活动 | 50 | // 助力活动 |
49 | - assistance() { | ||
50 | - var th=this; | 51 | + assistance() { |
52 | + var th = this; | ||
51 | var user_id = getApp().globalData.user_id; | 53 | var user_id = getApp().globalData.user_id; |
52 | var store_id = os.stoid; | 54 | var store_id = os.stoid; |
53 | - | ||
54 | getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", { | 55 | getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", { |
56 | + isShowLoading: true, | ||
55 | data: { | 57 | data: { |
56 | storeId: store_id, | 58 | storeId: store_id, |
57 | userId: user_id | 59 | userId: user_id |
58 | } | 60 | } |
59 | }).then(res => { | 61 | }).then(res => { |
60 | if (res.data.code == 0) { | 62 | if (res.data.code == 0) { |
61 | - var help_data=res.data.data; | ||
62 | - th.setData({ zl_act:help_data, help_id:help_data.id }); | ||
63 | - if (th.data.help_id != "" && th.data.help_id!=null) { | ||
64 | - //我的任务 | 63 | + var help_data = res.data.data; |
64 | + help_data.remark = help_data.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"'); | ||
65 | + th.setData({ | ||
66 | + zl_act: help_data, | ||
67 | + help_id: help_data.id | ||
68 | + }); | ||
69 | + if (th.data.help_id != "" && th.data.help_id != null) { | ||
70 | + //我的任务 | ||
65 | th.get_list(); | 71 | th.get_list(); |
66 | - } | ||
67 | - | ||
68 | - return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
69 | - data: { | ||
70 | - helpId: help_data.id, storeId: store_id | ||
71 | - } | ||
72 | - }) | ||
73 | - | 72 | + } |
73 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
74 | + isShowLoading: true, | ||
75 | + data: { | ||
76 | + helpId: help_data.id, | ||
77 | + storeId: store_id | ||
78 | + } | ||
79 | + }) | ||
74 | } | 80 | } |
75 | - return ut.null_promise(); | ||
76 | - }).then(res=>{ | ||
77 | - if(res.data.code==0) | ||
78 | - th.setData({s_num:res.data.data.countAll}) | ||
79 | - }) | ||
80 | - | ||
81 | - | 81 | + return ut.null_promise(); |
82 | + }).then(res => { | ||
83 | + if (res.data.code == 0) | ||
84 | + th.setData({ | ||
85 | + s_num: res.data.data.countAll | ||
86 | + }) | ||
87 | + }) | ||
88 | + | ||
89 | + | ||
82 | }, | 90 | }, |
83 | 91 | ||
84 | //--点击获取用户任务列表--会员的任务列表 | 92 | //--点击获取用户任务列表--会员的任务列表 |
85 | - get_list:function() { | ||
86 | - | 93 | + get_list: function() { |
94 | + | ||
87 | var th = this; | 95 | var th = this; |
88 | - var page=th.data.page; | ||
89 | - var help_id=this.data.help_id; | 96 | + var page = th.data.page; |
97 | + var help_id = this.data.help_id; | ||
90 | t.request.get("/api/weshop/marketing/help/help/user/page", { | 98 | t.request.get("/api/weshop/marketing/help/help/user/page", { |
99 | + isShowLoading: true, | ||
91 | data: { | 100 | data: { |
92 | - userId:getApp().globalData.user_id, | 101 | + userId: getApp().globalData.user_id, |
93 | storeId: os.stoid, | 102 | storeId: os.stoid, |
94 | helpId: help_id, | 103 | helpId: help_id, |
95 | page: page, | 104 | page: page, |
96 | - pageSize:5 | 105 | + pageSize: 5 |
97 | }, | 106 | }, |
98 | success: function(res) { | 107 | success: function(res) { |
99 | clearTimeout(th.data.timer); | 108 | clearTimeout(th.data.timer); |
100 | - | ||
101 | - if (!th.data.is_load) | ||
102 | - th.setData({ | ||
103 | - is_load: 1 | ||
104 | - }) | ||
105 | - | ||
106 | - | 109 | + |
110 | + if (!th.data.is_load) | ||
111 | + th.setData({ | ||
112 | + is_load: 1 | ||
113 | + }) | ||
114 | + | ||
107 | if (res.data.code == 0) { | 115 | if (res.data.code == 0) { |
108 | - | 116 | + |
109 | var list = th.data.zl_user_list; | 117 | var list = th.data.zl_user_list; |
110 | //连接数组 | 118 | //连接数组 |
111 | - list = list.concat(res.data.data.pageData); | 119 | + list = list.concat(res.data.data.pageData); |
112 | th.setData({ | 120 | th.setData({ |
113 | zl_user_list: list, | 121 | zl_user_list: list, |
114 | is_load: 1, | 122 | is_load: 1, |
@@ -117,20 +125,19 @@ Page({ | @@ -117,20 +125,19 @@ Page({ | ||
117 | th.setData({ | 125 | th.setData({ |
118 | is_show_more: 1 | 126 | is_show_more: 1 |
119 | }) | 127 | }) |
120 | - }else{ | 128 | + } else { |
121 | var page = th.data.page + 1; | 129 | var page = th.data.page + 1; |
122 | th.setData({ | 130 | th.setData({ |
123 | is_show_more: 0, | 131 | is_show_more: 0, |
124 | page: page | 132 | page: page |
125 | }) | 133 | }) |
126 | } | 134 | } |
127 | - | ||
128 | } else { | 135 | } else { |
129 | - | ||
130 | - getApp().showWarning("暂无更多内容",0); | 136 | + |
137 | + getApp().showWarning("暂无更多内容", 0); | ||
131 | th.setData({ | 138 | th.setData({ |
132 | is_show_more: 1, | 139 | is_show_more: 1, |
133 | - page: page | 140 | + page: page |
134 | }) | 141 | }) |
135 | } | 142 | } |
136 | 143 | ||
@@ -140,11 +147,11 @@ Page({ | @@ -140,11 +147,11 @@ Page({ | ||
140 | 147 | ||
141 | //-----跳转到领取礼包的页面------ | 148 | //-----跳转到领取礼包的页面------ |
142 | go_task: function() { | 149 | go_task: function() { |
143 | - | ||
144 | - var help_id=this.data.help_id; | ||
145 | - getApp().goto("/pages/user/assistance/task_assistance?help_id="+help_id); | 150 | + var th = this; |
151 | + var help_id = th.data.help_id; | ||
152 | + getApp().goto("/pages/user/assistance/task_assistance?help_id=" + help_id); | ||
146 | }, | 153 | }, |
147 | - switch_head: function (e) { | 154 | + switch_head: function(e) { |
148 | var th = this; | 155 | var th = this; |
149 | var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明 | 156 | var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明 |
150 | var switch_head = th.data.switch_head; //0任务,1活动说明 | 157 | var switch_head = th.data.switch_head; //0任务,1活动说明 |
@@ -156,22 +163,22 @@ Page({ | @@ -156,22 +163,22 @@ Page({ | ||
156 | }, | 163 | }, |
157 | 164 | ||
158 | //关闭导航 | 165 | //关闭导航 |
159 | - close: function () { | 166 | + close: function() { |
160 | var th = this; | 167 | var th = this; |
161 | var nav_b = th.selectComponent("#nav_b"); //组件的id | 168 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
162 | nav_b.close_box(); | 169 | nav_b.close_box(); |
163 | }, | 170 | }, |
171 | + | ||
164 | // 领取礼包 | 172 | // 领取礼包 |
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); | 173 | + get_libao: function(e) { |
174 | + var libao_id = e.currentTarget.dataset.libaoid; | ||
175 | + getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1); | ||
170 | }, | 176 | }, |
177 | + | ||
171 | //查看礼包id | 178 | //查看礼包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 ); | 179 | + select_libao: function() { |
180 | + var orderSn = e.currentTarget.dataset.orderSn;//订单号 | ||
181 | + getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn); | ||
176 | } | 182 | } |
183 | + | ||
177 | }) | 184 | }) |
178 | \ No newline at end of file | 185 | \ No newline at end of file |
pages/user/assistance/assistance.json
1 | { | 1 | { |
2 | "navigationBarTitleText": "好友助力,得好礼", | 2 | "navigationBarTitleText": "好友助力,得好礼", |
3 | - "navigationStyle": "custom", | ||
4 | "usingComponents": { | 3 | "usingComponents": { |
5 | "warn": "/components/long_warn/long_warn", | 4 | "warn": "/components/long_warn/long_warn", |
6 | "my_confirm": "/components/my_confirm/my_confirm", | 5 | "my_confirm": "/components/my_confirm/my_confirm", |
pages/user/assistance/assistance.wxml
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | <view class="flex-center"> | 8 | <view class="flex-center"> |
9 | <image class="getgift" src="{{iurl+'miniapp/images/friendhelp/getgift.png'}}" lazy-load="true"></image> | 9 | <image class="getgift" src="{{iurl+'miniapp/images/friendhelp/getgift.png'}}" lazy-load="true"></image> |
10 | </view> | 10 | </view> |
11 | - <view class="flex-center fs32"> | 11 | + <view class="flex-center fs32"> |
12 | <view class="excitation">机会总是留给最有行动力的人</view> | 12 | <view class="excitation">机会总是留给最有行动力的人</view> |
13 | </view> | 13 | </view> |
14 | <view class="flex-center"> | 14 | <view class="flex-center"> |
@@ -48,31 +48,30 @@ | @@ -48,31 +48,30 @@ | ||
48 | <view class="flex-center width"> | 48 | <view class="flex-center width"> |
49 | <view class="ellipsis-1">{{item.helpTaskName}}</view> | 49 | <view class="ellipsis-1">{{item.helpTaskName}}</view> |
50 | </view> | 50 | </view> |
51 | - | 51 | + |
52 | <!-- 已完成的颜色nostate --> | 52 | <!-- 已完成的颜色nostate --> |
53 | <view class="flex-center width state" wx:if="{{item.status==1}}"> | 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 class="ellipsis-1" bindtap="get_libao" data-libaoid="{{item.helpListGiftBagId}}">领取礼包</view> |
55 | + </view> | ||
56 | + <view class="flex-center width state" wx:if="{{item.status==0}}"> | ||
57 | + <view class="ellipsis-1">{{item.zlHelpNum}}/{{item.helpNum}}</view> | ||
58 | + </view> | ||
59 | + <view class="flex-center width state" wx:if="{{item.status==2}}"> | ||
60 | + <view class="ellipsis-1" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</view> | ||
56 | </view> | 61 | </view> |
57 | - <view class="flex-center width state" wx:if="{{item.status==0}}"> | ||
58 | - <view class="ellipsis-1">{{item.zlHelpNum}}/{{item.helpNum}}</view> | ||
59 | - </view> | ||
60 | - <view class="flex-center width state" wx:if="{{item.status==2}}"> | ||
61 | - <view class="ellipsis-1" bindtap="select_libao" data-orderid="{{item.ordersn}}" data-libaoid="{{item.helpListGiftBagId}}">查看礼包</view> | ||
62 | - </view> | ||
63 | - | ||
64 | - | 62 | + |
63 | + | ||
65 | </view> | 64 | </view> |
66 | <!-- 加载更多 --> | 65 | <!-- 加载更多 --> |
67 | - <block wx:if="{{is_show_more==0}}"> | ||
68 | - <view class="fs28 flex-center"> | ||
69 | - <view class="line"></view> | ||
70 | - <view class="load" bindtap="get_list">点击加载更多</view> | ||
71 | - <view class="line"></view> | ||
72 | - </view> | ||
73 | - </block> | 66 | + <block wx:if="{{is_show_more==0}}"> |
67 | + <view class="fs28 flex-center"> | ||
68 | + <view class="line"></view> | ||
69 | + <view class="load" bindtap="get_list">点击加载更多</view> | ||
70 | + <view class="line"></view> | ||
71 | + </view> | ||
72 | + </block> | ||
74 | </view> | 73 | </view> |
75 | - | 74 | + |
76 | 75 | ||
77 | <view class="fs30" style="margin-top: 30rpx;"> | 76 | <view class="fs30" style="margin-top: 30rpx;"> |
78 | <view class="flex-center nothing" wx:if="{{is_load && zl_user_list.length==0}}"> | 77 | <view class="flex-center nothing" wx:if="{{is_load && zl_user_list.length==0}}"> |
@@ -93,11 +92,14 @@ | @@ -93,11 +92,14 @@ | ||
93 | <view wx:if="{{switch_head}}" class="white"> | 92 | <view wx:if="{{switch_head}}" class="white"> |
94 | <view class="items"> | 93 | <view class="items"> |
95 | <view class="content fs28 padding"> | 94 | <view class="content fs28 padding"> |
96 | - <!-- <view>{{zl_act.remark}}</view> --> | ||
97 | - <rich-text nodes="{{zl_act.remark}}"></rich-text> | 95 | + <block wx:if="{{zl_act.remark!=''}}"> |
96 | + <rich-text nodes="{{zl_act.remark}}" style="word-break:break-all;word-wrap:break-word"></rich-text> | ||
97 | + </block> | ||
98 | + <block wx:else> | ||
99 | + <view>暂无活动说明</view> | ||
100 | + </block> | ||
98 | </view> | 101 | </view> |
99 | </view> | 102 | </view> |
100 | - | ||
101 | </view> | 103 | </view> |
102 | 104 | ||
103 | </view> | 105 | </view> |
pages/user/assistance/assistance_success.json
1 | { | 1 | { |
2 | "navigationBarTitleText": "好友助力,得好礼", | 2 | "navigationBarTitleText": "好友助力,得好礼", |
3 | - "navigationStyle": "custom", | ||
4 | "usingComponents": { | 3 | "usingComponents": { |
5 | "warn": "/components/long_warn/long_warn", | 4 | "warn": "/components/long_warn/long_warn", |
6 | "my_confirm": "/components/my_confirm/my_confirm", | 5 | "my_confirm": "/components/my_confirm/my_confirm", |
pages/user/assistance/friend_assistance.json
1 | { | 1 | { |
2 | "navigationBarTitleText": "好友助力,得好礼", | 2 | "navigationBarTitleText": "好友助力,得好礼", |
3 | - "navigationStyle": "custom", | ||
4 | "usingComponents": { | 3 | "usingComponents": { |
5 | "warn": "/components/long_warn/long_warn", | 4 | "warn": "/components/long_warn/long_warn", |
6 | "my_confirm": "/components/my_confirm/my_confirm", | 5 | "my_confirm": "/components/my_confirm/my_confirm", |
pages/user/assistance/friend_assistance.wxml
1 | <wxs module="filter" src="c_filter.wxs"></wxs> | 1 | <wxs module="filter" src="c_filter.wxs"></wxs> |
2 | <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> | 2 | <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> |
3 | <view class="flex-vertical user_assis"> | 3 | <view class="flex-vertical user_assis"> |
4 | - <image class="circle user_img" src="{{user.head_pic}}"></image> | 4 | + <image class="circle user_img" src="{{user.head_pic}}" lazy-load="true"></image> |
5 | <view class="user_name white fs28 ellipsis-1">{{user.nickname}}</view> | 5 | <view class="user_name white fs28 ellipsis-1">{{user.nickname}}</view> |
6 | </view> | 6 | </view> |
7 | <view class="caption_title white fs32 t-c"> | 7 | <view class="caption_title white fs32 t-c"> |
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | </view> | 9 | </view> |
10 | <!-- 礼包图片 --> | 10 | <!-- 礼包图片 --> |
11 | <view class="t-c"> | 11 | <view class="t-c"> |
12 | -<image class="assis_liba" src="{{iurl}}/miniapp/images/friendhelp/libao_asiss.png"> | 12 | +<image class="assis_liba" src="{{iurl}}/miniapp/images/friendhelp/libao_asiss.png" lazy-load="true"> |
13 | </image> | 13 | </image> |
14 | </view> | 14 | </view> |
15 | <view class="flex jc-center"> | 15 | <view class="flex jc-center"> |
pages/user/assistance/giftpacklist.js
@@ -10,7 +10,6 @@ Page({ | @@ -10,7 +10,6 @@ Page({ | ||
10 | url: a.url, //接口网址 | 10 | url: a.url, //接口网址 |
11 | iurl: a.imghost, //图片前缀网址 | 11 | iurl: a.imghost, //图片前缀网址 |
12 | isBuy: 0, | 12 | isBuy: 0, |
13 | - getGiftID: '', //礼包id | ||
14 | giftImage: '', | 13 | giftImage: '', |
15 | giftTitle: '', | 14 | giftTitle: '', |
16 | giftDate: '', | 15 | giftDate: '', |
@@ -29,39 +28,47 @@ Page({ | @@ -29,39 +28,47 @@ Page({ | ||
29 | c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 | 28 | c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 |
30 | is_lb: 0, //是否有礼包 | 29 | is_lb: 0, //是否有礼包 |
31 | receiveState: 0, //0未领取 1已领取 | 30 | receiveState: 0, //0未领取 1已领取 |
32 | - completeid: "", | ||
33 | is_sub: 0, //判断是否重复提交 | 31 | is_sub: 0, //判断是否重复提交 |
34 | is_libao: 0, //0轮播查看活动 1领取礼包 2.查看礼包详情 | 32 | is_libao: 0, //0轮播查看活动 1领取礼包 2.查看礼包详情 |
35 | held_id: "", //活动id | 33 | held_id: "", //活动id |
36 | taskId: "", //任务id | 34 | taskId: "", //任务id |
37 | orderSn: "", //订单号 | 35 | orderSn: "", //订单号 |
36 | + is_type:"",//类型 0.轮播过来的 1.领取礼包过来的 2.查看礼包过来的 | ||
37 | + is_head:0,//数据是否加载完成 | ||
38 | + giftBagId:"",//礼包id | ||
38 | }, | 39 | }, |
39 | onLoad: function(options) { | 40 | onLoad: function(options) { |
40 | var th = this; | 41 | var th = this; |
41 | if (options.is_libao == 0) { | 42 | if (options.is_libao == 0) { |
42 | th.setData({ | 43 | th.setData({ |
43 | - held_id: options.help_id, //options.help_id | ||
44 | - taskId: options.taskId, //options.libao_id | 44 | + held_id: options.help_id, |
45 | + taskId: options.taskId, | ||
46 | + is_type:0 | ||
45 | }) | 47 | }) |
46 | th.help(); | 48 | th.help(); |
47 | } | 49 | } |
48 | if (options.is_libao == 1) { | 50 | if (options.is_libao == 1) { |
49 | th.setData({ | 51 | th.setData({ |
50 | - taskId: options.libao_id, | ||
51 | - held_id: options.held_id | 52 | + giftBagId: options.libao_id, |
53 | + is_type: 1 | ||
52 | }) | 54 | }) |
53 | th.GetBuyGiftList(); | 55 | th.GetBuyGiftList(); |
54 | } | 56 | } |
55 | if (options.order_sn) { | 57 | if (options.order_sn) { |
56 | th.setData({ | 58 | th.setData({ |
57 | - orderSn: options.orderSn | 59 | + orderSn: options.orderSn, |
60 | + is_type: 2 | ||
58 | }) | 61 | }) |
59 | th.GetMyGiftList(); | 62 | th.GetMyGiftList(); |
60 | } | 63 | } |
61 | - th.close(); | ||
62 | }, | 64 | }, |
63 | onShow: function() { | 65 | onShow: function() { |
64 | - | 66 | + var th = this; |
67 | + var is_read = th.data.is_read; | ||
68 | + if (is_read){ | ||
69 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
70 | + nav_b.set_name("助力", "/pages/user/assistance/assistance"); | ||
71 | + } | ||
65 | }, | 72 | }, |
66 | //助力活动查看礼包详情调用 | 73 | //助力活动查看礼包详情调用 |
67 | help: function(e) { | 74 | help: function(e) { |
@@ -78,7 +85,8 @@ Page({ | @@ -78,7 +85,8 @@ Page({ | ||
78 | if (res.data.code == 0) { | 85 | if (res.data.code == 0) { |
79 | th.setData({ | 86 | th.setData({ |
80 | giftImage: th.data.iurl + res.data.data.lbUrl, | 87 | giftImage: th.data.iurl + res.data.data.lbUrl, |
81 | - giftTitle: res.data.data.giftTitle | 88 | + giftTitle: res.data.data.giftTitle, |
89 | + is_head:1 | ||
82 | }) | 90 | }) |
83 | if (res.data.data.giftRemark == '') { | 91 | if (res.data.data.giftRemark == '') { |
84 | th.setData({ | 92 | th.setData({ |
@@ -90,22 +98,7 @@ Page({ | @@ -90,22 +98,7 @@ Page({ | ||
90 | }) | 98 | }) |
91 | } | 99 | } |
92 | 100 | ||
93 | - // //---获取日期的时间戳--- | ||
94 | - // var t_endtime = res.data.data.endTime; | ||
95 | - // t_endtime = t_endtime.replace(/-/g, '/'); | ||
96 | - // var t_date = new Date(t_endtime) / 1000; | ||
97 | - // var t_now = ut.gettimestamp(); | ||
98 | - | ||
99 | - // if (res.data.data.goodsUseState) th.setData({ | ||
100 | - // c_state: 1 | ||
101 | - // }) | ||
102 | - // else if (t_date <= t_now) | ||
103 | - // th.setData({ | ||
104 | - // c_state: 2 | ||
105 | - // }) | ||
106 | - | ||
107 | th.setData({ | 101 | th.setData({ |
108 | - giftDate: res.data.data.endTime, | ||
109 | giftPosPrice: res.data.data.giftPosPrice, | 102 | giftPosPrice: res.data.data.giftPosPrice, |
110 | giftQty: res.data.data.giftQty, | 103 | giftQty: res.data.data.giftQty, |
111 | giftIntegral: res.data.data.payIntegral, | 104 | giftIntegral: res.data.data.payIntegral, |
@@ -145,7 +138,8 @@ Page({ | @@ -145,7 +138,8 @@ Page({ | ||
145 | if (res.data.code == 0) { | 138 | if (res.data.code == 0) { |
146 | th.setData({ | 139 | th.setData({ |
147 | giftImage: th.data.iurl + res.data.data.lbUrl, | 140 | giftImage: th.data.iurl + res.data.data.lbUrl, |
148 | - giftTitle: res.data.data.giftTitle | 141 | + giftTitle: res.data.data.giftTitle, |
142 | + is_head:1 | ||
149 | }) | 143 | }) |
150 | if (res.data.data.giftRemark == '') { | 144 | if (res.data.data.giftRemark == '') { |
151 | th.setData({ | 145 | th.setData({ |
@@ -210,9 +204,9 @@ Page({ | @@ -210,9 +204,9 @@ Page({ | ||
210 | is_sub: 1 | 204 | is_sub: 1 |
211 | }) | 205 | }) |
212 | var json = { | 206 | var json = { |
213 | - "actId": th.data.completeid, //活动Id | 207 | + "actId": th.data.held_id, //活动Id |
214 | "actType": 5, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 208 | "actType": 5, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
215 | - "giftBagId": th.data.giftID, //礼包Id | 209 | + "giftBagId": th.data.giftBagId, //礼包Id |
216 | "storeId": a.stoid, //商家Id | 210 | "storeId": a.stoid, //商家Id |
217 | "userId": d.user_id //用户ID | 211 | "userId": d.user_id //用户ID |
218 | }; | 212 | }; |
@@ -248,13 +242,14 @@ Page({ | @@ -248,13 +242,14 @@ Page({ | ||
248 | data: { | 242 | data: { |
249 | "storeId": a.stoid, //商家ID | 243 | "storeId": a.stoid, //商家ID |
250 | "userId": d.user_id, //用户ID | 244 | "userId": d.user_id, //用户ID |
251 | - "giftBagId": th.taskId | 245 | + "giftBagId": th.giftBagId |
252 | }, | 246 | }, |
253 | success: function(res) { | 247 | success: function(res) { |
254 | if (res.data.code == 0) { | 248 | if (res.data.code == 0) { |
255 | _this2.setData({ | 249 | _this2.setData({ |
256 | giftImage: th.iurl + res.data.data.lbUrl, | 250 | giftImage: th.iurl + res.data.data.lbUrl, |
257 | - giftTitle: res.data.data.giftTitle | 251 | + giftTitle: res.data.data.giftTitle, |
252 | + is_head:1 | ||
258 | }) | 253 | }) |
259 | if (res.data.data.giftRemark == '') { | 254 | if (res.data.data.giftRemark == '') { |
260 | 255 | ||
@@ -267,7 +262,6 @@ Page({ | @@ -267,7 +262,6 @@ Page({ | ||
267 | }) | 262 | }) |
268 | } | 263 | } |
269 | _this2.setData({ | 264 | _this2.setData({ |
270 | - giftDate: res.data.data.endTime, | ||
271 | giftPosPrice: res.data.data.giftPosPrice, | 265 | giftPosPrice: res.data.data.giftPosPrice, |
272 | giftQty: res.data.data.giftQty, | 266 | giftQty: res.data.data.giftQty, |
273 | giftIntegral: res.data.data.payIntegral, | 267 | giftIntegral: res.data.data.payIntegral, |
@@ -345,6 +339,5 @@ Page({ | @@ -345,6 +339,5 @@ Page({ | ||
345 | var th = this; | 339 | var th = this; |
346 | var nav_b = th.selectComponent("#nav_b"); //组件的id | 340 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
347 | nav_b.close_box(); | 341 | nav_b.close_box(); |
348 | - nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy"); | ||
349 | } | 342 | } |
350 | }); | 343 | }); |
351 | \ No newline at end of file | 344 | \ No newline at end of file |
pages/user/assistance/giftpacklist.json
1 | { | 1 | { |
2 | - "navigationBarTitleText": "助力详情", | 2 | + "navigationBarTitleText": "礼包详情", |
3 | "usingComponents": { | 3 | "usingComponents": { |
4 | "warn": "/components/long_warn/long_warn", | 4 | "warn": "/components/long_warn/long_warn", |
5 | "my_confirm": "/components/my_confirm/my_confirm", | 5 | "my_confirm": "/components/my_confirm/my_confirm", |
pages/user/assistance/giftpacklist.wxml
1 | -<view class="box data-v-3a5b7e36"> | 1 | +<view wx:if="{{is_head}}" class="box data-v-3a5b7e36" bindtap="close"> |
2 | <view class="box_top data-v-3a5b7e36"> | 2 | <view class="box_top data-v-3a5b7e36"> |
3 | <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="giftImage"></image> | 3 | <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="giftImage"></image> |
4 | </view> | 4 | </view> |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <view class="top_title data-v-3a5b7e36"> | 6 | <view class="top_title data-v-3a5b7e36"> |
7 | <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> | 7 | <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> |
8 | </view> | 8 | </view> |
9 | - <view wx:if="{{giftDate}}" class="top_time data-v-3a5b7e36"> | 9 | + <view wx:if="{{giftDate!=''}}" class="top_time data-v-3a5b7e36"> |
10 | <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> | 10 | <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> |
11 | </view> | 11 | </view> |
12 | <view class="top_price data-v-3a5b7e36"> | 12 | <view class="top_price data-v-3a5b7e36"> |
@@ -65,27 +65,30 @@ | @@ -65,27 +65,30 @@ | ||
65 | <view class="box_ware_item_qty data-v-3a5b7e36"> | 65 | <view class="box_ware_item_qty data-v-3a5b7e36"> |
66 | <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text> | 66 | <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text> |
67 | </view> | 67 | </view> |
68 | - <view class="box_ware_code data-v-3a5b7e36"> | ||
69 | - <block wx:if="{{c_state==0}}"> | ||
70 | - <block wx:if="{{item.lbType==1}}"> | ||
71 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image> | 68 | + <!-- 已完成方可显示 --> |
69 | + <block wx:if="{{is_type==2}}"> | ||
70 | + <view class="box_ware_code data-v-3a5b7e36"> | ||
71 | + <block wx:if="{{c_state==0}}"> | ||
72 | + <block wx:if="{{item.lbType==1}}"> | ||
73 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image> | ||
74 | + </block> | ||
72 | </block> | 75 | </block> |
73 | - </block> | ||
74 | - <block wx:else> | ||
75 | - <block wx:if="{{isBuy==0&item.lbType==1}}"> | ||
76 | - <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image> | 76 | + <block wx:else> |
77 | + <block wx:if="{{isBuy==0&item.lbType==1}}"> | ||
78 | + <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image> | ||
79 | + </block> | ||
77 | </block> | 80 | </block> |
78 | - </block> | ||
79 | - <block wx:if="{{item.lbType==2}}"> | ||
80 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/coupons/coupons" bindtap="goto"></image> | ||
81 | - </block> | ||
82 | - <block wx:if="{{item.lbType==3}}"> | ||
83 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image> | ||
84 | - </block> | ||
85 | - <block wx:if="{{item.lbType>3}}"> | ||
86 | - <text class="data-v-3a5b7e36">奖励已发放</text> | ||
87 | - </block> | ||
88 | - </view> | 81 | + <block wx:if="{{item.lbType==2}}"> |
82 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/coupons/coupons" bindtap="goto"></image> | ||
83 | + </block> | ||
84 | + <block wx:if="{{item.lbType==3}}"> | ||
85 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image> | ||
86 | + </block> | ||
87 | + <block wx:if="{{item.lbType>3}}"> | ||
88 | + <text class="data-v-3a5b7e36">奖励已发放</text> | ||
89 | + </block> | ||
90 | + </view> | ||
91 | + </block> | ||
89 | </view> | 92 | </view> |
90 | </view> | 93 | </view> |
91 | </block> | 94 | </block> |
@@ -99,21 +102,14 @@ | @@ -99,21 +102,14 @@ | ||
99 | </view> | 102 | </view> |
100 | </view> | 103 | </view> |
101 | <view class="foot_empty data-v-3a5b7e36"></view> | 104 | <view class="foot_empty data-v-3a5b7e36"></view> |
102 | - <block wx:if="{{isBuy==0}}"> | ||
103 | - <view class="foot_button data-v-3a5b7e36"> | ||
104 | - <block wx:if="{{true}}"> | ||
105 | - <block wx:if="{{receiveState}}"> | ||
106 | - <view class="foot_button_buy data-v-3a5b7e36 overdue"> | ||
107 | - <text class="data-v-3a5b7e36">已领取</text> | ||
108 | - </view> | ||
109 | - </block> | ||
110 | - <block wx:else> | ||
111 | - <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetReceive"> | ||
112 | - <text class="data-v-3a5b7e36">一键全部领取</text> | ||
113 | - </view> | ||
114 | - </block> | 105 | + <view class="foot_button data-v-3a5b7e36"> |
106 | + <block wx:if="{{is_type!=0}}"> | ||
107 | + <block wx:if="{{is_type==1}}"> | ||
108 | + <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetReceive"> | ||
109 | + <text class="data-v-3a5b7e36">一键全部领取</text> | ||
110 | + </view> | ||
115 | </block> | 111 | </block> |
116 | - <block wx:else> | 112 | + <block wx:if="{{is_type==2}}"> |
117 | <block wx:if="{{is_lb!=1}}"> | 113 | <block wx:if="{{is_lb!=1}}"> |
118 | <view class="foot_button_buy data-v-3a5b7e36 overdue"> | 114 | <view class="foot_button_buy data-v-3a5b7e36 overdue"> |
119 | <text class="data-v-3a5b7e36">无核销商品</text> | 115 | <text class="data-v-3a5b7e36">无核销商品</text> |
@@ -131,8 +127,13 @@ | @@ -131,8 +127,13 @@ | ||
131 | </view> | 127 | </view> |
132 | </block> | 128 | </block> |
133 | </block> | 129 | </block> |
134 | - </view> | ||
135 | - </block> | 130 | + </block> |
131 | + <block wx:else> | ||
132 | + <view class="foot_button_buy data-v-3a5b7e36" bindtap="goto" data-url="/pages/index/index/index"> | ||
133 | + <text class="data-v-3a5b7e36">回到首页</text> | ||
134 | + </view> | ||
135 | + </block> | ||
136 | + </view> | ||
136 | </view> | 137 | </view> |
137 | <!-- 引入提示组件 --> | 138 | <!-- 引入提示组件 --> |
138 | <warn id="warn"></warn> | 139 | <warn id="warn"></warn> |
@@ -140,4 +141,4 @@ | @@ -140,4 +141,4 @@ | ||
140 | <!-- 弹出框扫描 --> | 141 | <!-- 弹出框扫描 --> |
141 | <qr_code id="qc_com"></qr_code> | 142 | <qr_code id="qc_com"></qr_code> |
142 | <!-- 制作一个圆球导航 --> | 143 | <!-- 制作一个圆球导航 --> |
143 | -<nav_b id="nav_b"></nav_b> | ||
144 | \ No newline at end of file | 144 | \ No newline at end of file |
145 | +<nav_b wx:if="{{is_head}}" id="nav_b"></nav_b> | ||
145 | \ No newline at end of file | 146 | \ No newline at end of file |
pages/user/assistance/giftpacklist.wxss
1 | - @charset "UTF-8"; | 1 | +@charset "UTF-8"; |
2 | 2 | ||
3 | /* Author XGQ | 3 | /* Author XGQ |
4 | * 2019-12-12 | 4 | * 2019-12-12 |
@@ -96,6 +96,7 @@ | @@ -96,6 +96,7 @@ | ||
96 | border: 2rpx solid #999; | 96 | border: 2rpx solid #999; |
97 | width: 120rpx; | 97 | width: 120rpx; |
98 | height: 120rpx; | 98 | height: 120rpx; |
99 | + /* background-color: rgba(153, 153, 153, 0.664); */ | ||
99 | } | 100 | } |
100 | 101 | ||
101 | .box_ware_item.data-v-3a5b7e36 { | 102 | .box_ware_item.data-v-3a5b7e36 { |
@@ -239,6 +240,7 @@ page.data-v-3a5b7e36 { | @@ -239,6 +240,7 @@ page.data-v-3a5b7e36 { | ||
239 | .foot_box_remark.data-v-3a5b7e36 .img { | 240 | .foot_box_remark.data-v-3a5b7e36 .img { |
240 | line-height: 0; | 241 | line-height: 0; |
241 | } | 242 | } |
242 | -.overdue.data-v-3a5b7e36{ | ||
243 | - background-color: rgb(153,153,153); | ||
244 | -} | ||
245 | \ No newline at end of file | 243 | \ No newline at end of file |
244 | + | ||
245 | +.overdue.data-v-3a5b7e36 { | ||
246 | + background-color: rgb(153, 153, 153); | ||
247 | +} |