-
Status changed to merged
-
mentioned in commit 0670cbc2c7dad539d49f02413e52b14772f1a10d
Showing
22 changed files
components/qr_code/qr_code.wxml
1 | 1 | ||
2 | -<view class="xc-pop-up" wx:if="{{q_show}}"> | 2 | +<view class="xc-pop-up" wx:if="{{q_show}}" catchtouchmove='true'> |
3 | <!-- <scroll-view scroll-y="false" style=" height: 100%;"> --> | 3 | <!-- <scroll-view scroll-y="false" style=" height: 100%;"> --> |
4 | <view class="xc-obscuration" bindtap='close' catchtouchmove="ture"></view> | 4 | <view class="xc-obscuration" bindtap='close' catchtouchmove="ture"></view> |
5 | <view> | 5 | <view> |
pages/giftpack/birthdaygift/birthdaygift.js
@@ -37,12 +37,15 @@ Page({ | @@ -37,12 +37,15 @@ Page({ | ||
37 | data: { | 37 | data: { |
38 | "actId": th.data.getActId, //活动id | 38 | "actId": th.data.getActId, //活动id |
39 | "actType": 4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | 39 | "actType": 4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 |
40 | - "giftBagId": th.data.giftID, //礼包ID | ||
41 | "storeId": a.stoid, //商家ID | 40 | "storeId": a.stoid, //商家ID |
42 | "userId": d.user_id //用户ID | 41 | "userId": d.user_id //用户ID |
43 | } | 42 | } |
44 | }).then(res => { | 43 | }).then(res => { |
45 | if (res.data.code == 0) { | 44 | if (res.data.code == 0) { |
45 | + th.setData({ | ||
46 | + | ||
47 | + giftID: res.data.data.id, | ||
48 | + }) | ||
46 | if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) { | 49 | if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) { |
47 | //礼包内容--礼券 | 50 | //礼包内容--礼券 |
48 | th.setData({ | 51 | th.setData({ |
@@ -50,7 +53,7 @@ Page({ | @@ -50,7 +53,7 @@ Page({ | ||
50 | cards: res.data.data.lbCoupons | 53 | cards: res.data.data.lbCoupons |
51 | }) | 54 | }) |
52 | } | 55 | } |
53 | - if (res.data.data.lbSM.length > 0 && res.data.data.lbSM != nll) { | 56 | + if (res.data.data.lbSM.length > 0 && res.data.data.lbSM != null) { |
54 | //礼包内容--服务项目 | 57 | //礼包内容--服务项目 |
55 | th.setData({ | 58 | th.setData({ |
56 | itemShow: true, | 59 | itemShow: true, |
pages/giftpack/birthdaygift/birthdaygift.wxml
@@ -130,7 +130,7 @@ | @@ -130,7 +130,7 @@ | ||
130 | <block wx:if="{{integralShow}}"> | 130 | <block wx:if="{{integralShow}}"> |
131 | <view> | 131 | <view> |
132 | <view class="top_box_image "> | 132 | <view class="top_box_image "> |
133 | - <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image> | 133 | + <image src="{{iurl+'/miniapp/images/giftbag/integral.png'}}" lazy-load="true"></image> |
134 | <button>{{integralTitle}}</button> | 134 | <button>{{integralTitle}}</button> |
135 | </view> | 135 | </view> |
136 | </view> | 136 | </view> |
@@ -138,7 +138,7 @@ | @@ -138,7 +138,7 @@ | ||
138 | <block wx:if="{{growUpShow}}"> | 138 | <block wx:if="{{growUpShow}}"> |
139 | <view> | 139 | <view> |
140 | <view class="top_box_image fs36"> | 140 | <view class="top_box_image fs36"> |
141 | - <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image> | 141 | + <image src="{{iurl+'/miniapp/images/giftbag/vgrowup.png'}}" lazy-load="true"></image> |
142 | <button>{{growUpTitle}}</button> | 142 | <button>{{growUpTitle}}</button> |
143 | </view> | 143 | </view> |
144 | </view> | 144 | </view> |
pages/giftpack/birthdaygift/birthdaygift.wxss
@@ -110,9 +110,10 @@ | @@ -110,9 +110,10 @@ | ||
110 | line-height: 45rpx; | 110 | line-height: 45rpx; |
111 | } | 111 | } |
112 | .top_card { | 112 | .top_card { |
113 | - width: calc(50% - 30rpx); | 113 | + width: 309rpx; |
114 | display: inline-block; | 114 | display: inline-block; |
115 | margin: 15rpx; | 115 | margin: 15rpx; |
116 | + vertical-align:top; | ||
116 | } | 117 | } |
117 | .top_card_box { | 118 | .top_card_box { |
118 | background-size: cover; | 119 | background-size: cover; |
@@ -337,3 +338,17 @@ button::after { | @@ -337,3 +338,17 @@ button::after { | ||
337 | line-height: 0; | 338 | line-height: 0; |
338 | } | 339 | } |
339 | 340 | ||
341 | +.lvip { | ||
342 | + left: 30rpx; | ||
343 | + bottom: -58rpx; | ||
344 | + width: 20rpx; | ||
345 | + height: 90rpx; | ||
346 | + z-index: 5; | ||
347 | +} | ||
348 | +.rvip { | ||
349 | + right: 30rpx; | ||
350 | + bottom: -58rpx; | ||
351 | + width: 20rpx; | ||
352 | + height: 90rpx; | ||
353 | + z-index: 5; | ||
354 | +} | ||
340 | \ No newline at end of file | 355 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -151,7 +151,7 @@ Page({ | @@ -151,7 +151,7 @@ Page({ | ||
151 | data: { | 151 | data: { |
152 | storeId: th.data.getStorageID, //商家ID | 152 | storeId: th.data.getStorageID, //商家ID |
153 | userId: th.data.getUserID, //用户ID | 153 | userId: th.data.getUserID, //用户ID |
154 | - page: th.data.pages, | 154 | + page: th.data.curpage, |
155 | pageSize: th.data.pageSize | 155 | pageSize: th.data.pageSize |
156 | }, | 156 | }, |
157 | success: function(res) { | 157 | success: function(res) { |
@@ -170,7 +170,8 @@ Page({ | @@ -170,7 +170,8 @@ Page({ | ||
170 | }), wx.stopPullDownRefresh(); //停止下拉刷新 | 170 | }), wx.stopPullDownRefresh(); //停止下拉刷新 |
171 | } else { | 171 | } else { |
172 | th.setData({ | 172 | th.setData({ |
173 | - is_read: 1 | 173 | + is_read: 1, |
174 | + ismore:1 | ||
174 | }) | 175 | }) |
175 | } | 176 | } |
176 | } | 177 | } |
pages/giftpack/evaluategift/evaluategift.wxml
@@ -130,7 +130,7 @@ | @@ -130,7 +130,7 @@ | ||
130 | <block wx:if="{{integralShow}}"> | 130 | <block wx:if="{{integralShow}}"> |
131 | <view> | 131 | <view> |
132 | <view class="top_box_image "> | 132 | <view class="top_box_image "> |
133 | - <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image> | 133 | + <image src="{{iurl+'/miniapp/images/giftbag/integral.png'}}" lazy-load="true"></image> |
134 | <button>{{integralTitle}}</button> | 134 | <button>{{integralTitle}}</button> |
135 | </view> | 135 | </view> |
136 | </view> | 136 | </view> |
@@ -138,7 +138,7 @@ | @@ -138,7 +138,7 @@ | ||
138 | <block wx:if="{{growUpShow}}"> | 138 | <block wx:if="{{growUpShow}}"> |
139 | <view> | 139 | <view> |
140 | <view class="top_box_image fs36"> | 140 | <view class="top_box_image fs36"> |
141 | - <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image> | 141 | + <image src="{{iurl+'/miniapp/images/giftbag/growup.png'}}" lazy-load="true"></image> |
142 | <button>{{growUpTitle}}</button> | 142 | <button>{{growUpTitle}}</button> |
143 | </view> | 143 | </view> |
144 | </view> | 144 | </view> |
pages/giftpack/evaluategift/evaluategift.wxss
@@ -121,9 +121,10 @@ | @@ -121,9 +121,10 @@ | ||
121 | } | 121 | } |
122 | 122 | ||
123 | .top_card { | 123 | .top_card { |
124 | - width: calc(50% - 30rpx); | 124 | + width: 309rpx; |
125 | display: inline-block; | 125 | display: inline-block; |
126 | margin: 15rpx; | 126 | margin: 15rpx; |
127 | + vertical-align:top; | ||
127 | } | 128 | } |
128 | 129 | ||
129 | .top_card_box { | 130 | .top_card_box { |
pages/giftpack/festival/festival.js
@@ -125,6 +125,9 @@ Page({ | @@ -125,6 +125,9 @@ Page({ | ||
125 | }) | 125 | }) |
126 | th.is_festival(); | 126 | th.is_festival(); |
127 | th.GetList(); | 127 | th.GetList(); |
128 | + wx.setNavigationBarTitle({ | ||
129 | + title: "节日有礼", | ||
130 | + }); | ||
128 | }, | 131 | }, |
129 | onShow: function() { | 132 | onShow: function() { |
130 | 133 | ||
@@ -182,7 +185,7 @@ Page({ | @@ -182,7 +185,7 @@ Page({ | ||
182 | }).then(res => { | 185 | }).then(res => { |
183 | if (res.data.code == 0) { | 186 | if (res.data.code == 0) { |
184 | th.setData({ | 187 | th.setData({ |
185 | - bimg: res.data.data.actBoundImg, | 188 | + bimg: res.data.data.actImg, |
186 | actFontColor: res.data.data.actFontColor, //字体颜色 | 189 | actFontColor: res.data.data.actFontColor, //字体颜色 |
187 | actBgColor: res.data.data.actBgColor, //背景颜色 | 190 | actBgColor: res.data.data.actBgColor, //背景颜色 |
188 | 191 |
pages/giftpack/festival/festival.wxml
@@ -130,7 +130,7 @@ | @@ -130,7 +130,7 @@ | ||
130 | <block wx:if="{{integralShow}}"> | 130 | <block wx:if="{{integralShow}}"> |
131 | <view> | 131 | <view> |
132 | <view class="top_box_image "> | 132 | <view class="top_box_image "> |
133 | - <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image> | 133 | + <image src="{{iurl+'/miniapp/images/giftbag/integral.png'}}" lazy-load="true"></image> |
134 | <button style="background-color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">{{integralTitle}}</button> | 134 | <button style="background-color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">{{integralTitle}}</button> |
135 | </view> | 135 | </view> |
136 | </view> | 136 | </view> |
@@ -138,7 +138,7 @@ | @@ -138,7 +138,7 @@ | ||
138 | <block wx:if="{{growUpShow}}"> | 138 | <block wx:if="{{growUpShow}}"> |
139 | <view> | 139 | <view> |
140 | <view class="top_box_image fs36"> | 140 | <view class="top_box_image fs36"> |
141 | - <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image> | 141 | + <image src="{{iurl+'/miniapp/images/giftbag/growup.png'}}" lazy-load="true"></image> |
142 | <button style="background-color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">{{growUpTitle}}</button> | 142 | <button style="background-color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}">{{growUpTitle}}</button> |
143 | </view> | 143 | </view> |
144 | </view> | 144 | </view> |
pages/giftpack/festival/festival.wxss
@@ -126,9 +126,10 @@ | @@ -126,9 +126,10 @@ | ||
126 | } | 126 | } |
127 | 127 | ||
128 | .top_card { | 128 | .top_card { |
129 | - width: calc(50% - 30rpx); | 129 | + width: 309rpx; |
130 | display: inline-block; | 130 | display: inline-block; |
131 | margin: 15rpx; | 131 | margin: 15rpx; |
132 | + vertical-align:top; | ||
132 | } | 133 | } |
133 | 134 | ||
134 | .top_card_box { | 135 | .top_card_box { |
@@ -137,7 +138,6 @@ | @@ -137,7 +138,6 @@ | ||
137 | background-repeat: no-repeat; | 138 | background-repeat: no-repeat; |
138 | border-radius: 20rpx; | 139 | border-radius: 20rpx; |
139 | height: 250rpx; | 140 | height: 250rpx; |
140 | - margin: 5rpx; | ||
141 | } | 141 | } |
142 | 142 | ||
143 | .img1 { | 143 | .img1 { |
pages/giftpack/mygiftpack/mygiftpack.js
@@ -20,8 +20,8 @@ Page({ | @@ -20,8 +20,8 @@ Page({ | ||
20 | contentrefresh: '加载中...', | 20 | contentrefresh: '加载中...', |
21 | contentnomore: '已加载全部' | 21 | contentnomore: '已加载全部' |
22 | }, | 22 | }, |
23 | - ismore:0,//数据是否全部加载完成 | ||
24 | - is_read:0,//是否查询过我的礼包接口 | 23 | + ismore: 0, //数据是否全部加载完成 |
24 | + is_read: 0, //是否查询过我的礼包接口 | ||
25 | curpage: 1, //当前分页数 | 25 | curpage: 1, //当前分页数 |
26 | pageSize: 10, //页大小 | 26 | pageSize: 10, //页大小 |
27 | total: 0, //总数量 | 27 | total: 0, //总数量 |
@@ -42,16 +42,16 @@ Page({ | @@ -42,16 +42,16 @@ Page({ | ||
42 | }, | 42 | }, |
43 | getList: function() { | 43 | getList: function() { |
44 | var th = this; | 44 | var th = this; |
45 | - | 45 | + |
46 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { | 46 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { |
47 | - isShowLoading:true, | 47 | + isShowLoading: true, |
48 | data: { | 48 | data: { |
49 | storeId: th.data.getStorageID, //商家ID | 49 | storeId: th.data.getStorageID, //商家ID |
50 | userId: th.data.getUserID, //用户ID | 50 | userId: th.data.getUserID, //用户ID |
51 | page: th.data.curpage, | 51 | page: th.data.curpage, |
52 | pageSize: th.data.pageSize | 52 | pageSize: th.data.pageSize |
53 | }, | 53 | }, |
54 | - success: function success(res) { | 54 | + success: function(res) { |
55 | if (res.data.code == 0) { | 55 | if (res.data.code == 0) { |
56 | th.data.curpage++; | 56 | th.data.curpage++; |
57 | var arr1 = th.data.wareCard; | 57 | var arr1 = th.data.wareCard; |
@@ -63,21 +63,22 @@ Page({ | @@ -63,21 +63,22 @@ Page({ | ||
63 | wareCard: arr3, | 63 | wareCard: arr3, |
64 | total: res.data.data.total, | 64 | total: res.data.data.total, |
65 | ismore: ismore, | 65 | ismore: ismore, |
66 | - is_read:1 | 66 | + is_read: 1 |
67 | }), wx.stopPullDownRefresh(); //停止下拉刷新 | 67 | }), wx.stopPullDownRefresh(); //停止下拉刷新 |
68 | } else { | 68 | } else { |
69 | th.setData({ | 69 | th.setData({ |
70 | - is_read: 1 | 70 | + is_read: 1, |
71 | + ismore:1 | ||
71 | }) | 72 | }) |
72 | } | 73 | } |
73 | - | 74 | + |
74 | } | 75 | } |
75 | - | 76 | + |
76 | }); | 77 | }); |
77 | 78 | ||
78 | }, | 79 | }, |
79 | //销毁界面跳转 | 80 | //销毁界面跳转 |
80 | - redirectTo: function (e) { | 81 | + redirectTo: function(e) { |
81 | var th = this; | 82 | var th = this; |
82 | var url = e.currentTarget.dataset.url; | 83 | var url = e.currentTarget.dataset.url; |
83 | //销毁跳转 | 84 | //销毁跳转 |
@@ -86,20 +87,20 @@ Page({ | @@ -86,20 +87,20 @@ Page({ | ||
86 | }); | 87 | }); |
87 | }, | 88 | }, |
88 | //不销毁界面跳转 | 89 | //不销毁界面跳转 |
89 | - navigateTo: function (e) { | 90 | + navigateTo: function(e) { |
90 | var th = this; | 91 | var th = this; |
91 | var url = e.currentTarget.dataset.url; | 92 | var url = e.currentTarget.dataset.url; |
92 | getApp().goto(url); | 93 | getApp().goto(url); |
93 | }, | 94 | }, |
94 | //下拉事件 | 95 | //下拉事件 |
95 | - onReachBottom: function () { | 96 | + onReachBottom: function() { |
96 | var th = this; | 97 | var th = this; |
97 | if (th.data.total <= th.data.pageSize) return; | 98 | if (th.data.total <= th.data.pageSize) return; |
98 | if (th.data.ismore) return; | 99 | if (th.data.ismore) return; |
99 | th.getList(); | 100 | th.getList(); |
100 | }, | 101 | }, |
101 | //图片失败,默认图片 | 102 | //图片失败,默认图片 |
102 | - bind_bnerr2: function (e) { | 103 | + bind_bnerr2: function(e) { |
103 | var _errImg = e.target.dataset.errorimg; | 104 | var _errImg = e.target.dataset.errorimg; |
104 | var _errObj = {}; | 105 | var _errObj = {}; |
105 | _errObj[_errImg] = "/public/images/empty.jpg"; | 106 | _errObj[_errImg] = "/public/images/empty.jpg"; |
pages/giftpack/newvipgift/newvipgift.wxml
@@ -130,7 +130,7 @@ | @@ -130,7 +130,7 @@ | ||
130 | <block wx:if="{{integralShow}}"> | 130 | <block wx:if="{{integralShow}}"> |
131 | <view> | 131 | <view> |
132 | <view class="top_box_image "> | 132 | <view class="top_box_image "> |
133 | - <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image> | 133 | + <image src="{{iurl+'/miniapp/images/giftbag/integral.png'}}" lazy-load="true"></image> |
134 | <button>{{integralTitle}}</button> | 134 | <button>{{integralTitle}}</button> |
135 | </view> | 135 | </view> |
136 | </view> | 136 | </view> |
@@ -138,7 +138,7 @@ | @@ -138,7 +138,7 @@ | ||
138 | <block wx:if="{{growUpShow}}"> | 138 | <block wx:if="{{growUpShow}}"> |
139 | <view> | 139 | <view> |
140 | <view class="top_box_image fs36"> | 140 | <view class="top_box_image fs36"> |
141 | - <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image> | 141 | + <image src="{{iurl+'/miniapp/images/giftbag/growup.png'}}" lazy-load="true"></image> |
142 | <button>{{growUpTitle}}</button> | 142 | <button>{{growUpTitle}}</button> |
143 | </view> | 143 | </view> |
144 | </view> | 144 | </view> |
pages/giftpack/newvipgift/newvipgift.wxss
@@ -126,9 +126,10 @@ | @@ -126,9 +126,10 @@ | ||
126 | } | 126 | } |
127 | 127 | ||
128 | .top_card { | 128 | .top_card { |
129 | - width: calc(50% - 30rpx); | 129 | + width: 309rpx; |
130 | display: inline-block; | 130 | display: inline-block; |
131 | margin: 15rpx; | 131 | margin: 15rpx; |
132 | + vertical-align:top; | ||
132 | } | 133 | } |
133 | 134 | ||
134 | .top_card_box { | 135 | .top_card_box { |
pages/index/index/index.js
@@ -90,7 +90,7 @@ Page({ | @@ -90,7 +90,7 @@ Page({ | ||
90 | }); | 90 | }); |
91 | } | 91 | } |
92 | }) | 92 | }) |
93 | - // th.is_festival(); | 93 | + th.is_festival(); |
94 | 94 | ||
95 | }, | 95 | }, |
96 | //关闭新用户领取广告 | 96 | //关闭新用户领取广告 |
@@ -747,9 +747,9 @@ Page({ | @@ -747,9 +747,9 @@ Page({ | ||
747 | var giftBagId = res.data.data.gifBagId; //礼包id | 747 | var giftBagId = res.data.data.gifBagId; //礼包id |
748 | var nav_url = "/pages/giftpack/festival/festival?actId=" + actid + '&' + 'actType=' + 3 + '&' + 'giftBagId=' + giftBagId; | 748 | var nav_url = "/pages/giftpack/festival/festival?actId=" + actid + '&' + 'actType=' + 3 + '&' + 'giftBagId=' + giftBagId; |
749 | var swiperimage = th.data.swiperimage; | 749 | var swiperimage = th.data.swiperimage; |
750 | - var actImg = res.data.data.actImg; | 750 | + var actBoundImg = res.data.data.actBoundImg; actBoundImg |
751 | var img = { | 751 | var img = { |
752 | - image: actImg, | 752 | + image: actBoundImg, |
753 | nav_url: nav_url | 753 | nav_url: nav_url |
754 | } | 754 | } |
755 | swiperimage.unshift(img); | 755 | swiperimage.unshift(img); |
pages/user/assistance/friend_assistance.js
@@ -99,7 +99,6 @@ Page({ | @@ -99,7 +99,6 @@ Page({ | ||
99 | cklie_button: function() { | 99 | cklie_button: function() { |
100 | var th = this; | 100 | var th = this; |
101 | var t_user_id = app_d.user_id; | 101 | var t_user_id = app_d.user_id; |
102 | - t_user_id = 1433320; | ||
103 | var data = { | 102 | var data = { |
104 | id: this.data.tasking, | 103 | id: this.data.tasking, |
105 | storeId: os.stoid, | 104 | storeId: os.stoid, |
pages/user/assistance/task_assistance.js
1 | -var auth = require("../../../utils/auth.js"), | ||
2 | - rq = require("../../../utils/request.js"); | ||
3 | -var e = getApp(), | ||
4 | - app = e, | ||
5 | - i = require("../../../utils/util.js"), | ||
6 | - ut = i, | ||
7 | - s = e.globalData.setting, | ||
8 | - os = s, | ||
9 | - app_d = e.globalData; | ||
10 | -var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
11 | -Page({ | ||
12 | - /** | ||
13 | - * 页面的初始数据 | ||
14 | - */ | ||
15 | - data: { | ||
16 | - sw_index: 0, //轮播的下标控制 | ||
17 | - url: s.url, //接口网址 | ||
18 | - iurl: s.imghost, | ||
19 | - endDate: "", //活动结束时间 | ||
20 | - activity_data: "25:20:59", //活动剩余时间 | ||
21 | - task_number: 0, //任务数 | ||
22 | - is_task: 0, //历史记录与任务 | ||
23 | - aitem: "", //活动的轮播图数据 | ||
24 | - switch_head: 0, //0:我的任务,1:记录 | ||
25 | - help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成 | ||
26 | - gid: "", | ||
27 | - timer: null, //全局的定时器 | ||
28 | - user_task_list: null, //会员列表 | ||
29 | - taskid: "", //任务id | ||
30 | - usercount: 0, //参与的人数 | ||
31 | - dismantle: null, //帮拆记录数据集 | ||
32 | - is_user_task: null, //判断是不是领取的任务 | ||
33 | - zzjx_id: "", //真正进行的任务id | ||
34 | - is_show: 0, //任务的加载更多 | ||
35 | - is_bc_show: 0, //帮拆的加载更多 | ||
36 | - bc_page: 1, //帮拆的页码 | ||
37 | - rw_page: 1, //任务的页码 | ||
38 | - block: 0, //阻断助力的用户图片多次添加 | ||
39 | - //*********************************************start钱 | ||
40 | - canvasHidden: 0, //分享图片是否已经生成 | ||
41 | - is_share: 0, //是否显示画布 | ||
42 | - shareImgPath: [], //生成的图片 | ||
43 | - screenWidth: "", //用户的屏幕宽度 | ||
44 | - gid: "", | ||
45 | - images: ["miniapp/images/friendhelp/help.png", "miniapp/images/friendhelp/background.png", "miniapp/images/friendhelp/no_check.png", | ||
46 | - "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png","miniapp/images/xc_ellipsis.png" | ||
47 | - ], //固的分享图片 | ||
48 | - | ||
49 | - dynamic: null, //已助力的微信头像数组 | ||
50 | - head_pic_arr: [], //助力的头像 | ||
51 | - share_lb_img: "", //分享的礼包图片 | ||
52 | - | ||
53 | - is_generate: 0, //是否重复点击拆一拆 | ||
54 | - already: 0, //已有几人助力 | ||
55 | - lack: 0, //还差几人助力 | ||
56 | - zltime: "", //助力时间 | ||
57 | - djs: "", //定时器的显示 | ||
58 | - //*********************************************end | ||
59 | - }, | ||
60 | - | ||
61 | - /** | ||
62 | - * 生命周期函数--监听页面加载 | ||
63 | - */ | ||
64 | - onLoad: function(options) { | ||
65 | - var th = this; | ||
66 | - var help_id = options.help_id; | ||
67 | - var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
68 | - nav_b.set_name("助力", "/pages/user/assistance/assistance"); | ||
69 | - th.setData({ | ||
70 | - help_id: help_id | ||
71 | - }); | ||
72 | - //start 钱 | ||
73 | - if (options.gid != undefined) { | ||
74 | - th.setData({ | ||
75 | - gid: options.gid | ||
76 | - }) | ||
77 | - } | ||
78 | - th.close(); | ||
79 | - th.syinfo(); | ||
80 | - th.imageinfo(); | ||
81 | - | ||
82 | - }, | ||
83 | - | ||
84 | - | ||
85 | - //选中任务保存 | ||
86 | - add_onlicke: function(e) { | ||
87 | - var th = this; | ||
88 | - var taskid = e.target.dataset.taskid; | ||
89 | - var help_id = th.data.help_id; | ||
90 | - var user_id = getApp().globalData.user_id; | ||
91 | - var stoid = os.stoid | ||
92 | - getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", { | ||
93 | - helpId: help_id, | ||
94 | - userId: user_id, | ||
95 | - storeId: stoid, | ||
96 | - taskId: taskid | ||
97 | - }, | ||
98 | - function(res) { | ||
99 | - if (res.data.code == 0) { | ||
100 | - getApp().my_warnning(res.data.data, 1, th); | ||
101 | - //判断是不是领取的任务 | ||
102 | - th.get_user_task(); | ||
103 | - //会员任务列表 | ||
104 | - th.user_task_list(); | ||
105 | - } else { | ||
106 | - getApp().my_warnning(res.data.msg, 0, th); | ||
107 | - } | ||
108 | - } | ||
109 | - | ||
110 | - ) | ||
111 | - | ||
112 | - }, | ||
113 | - | ||
114 | - | ||
115 | - | ||
116 | - /** | ||
117 | - * 生命周期函数--监听页面初次渲染完成 | ||
118 | - */ | ||
119 | - onReady: function() { | ||
120 | - | ||
121 | - }, | ||
122 | - | ||
123 | - /** | ||
124 | - * 生命周期函数--监听页面显示 | ||
125 | - */ | ||
126 | - onShow: function() { | ||
127 | - this.data.is_timer = 1; | ||
128 | - var th = this; | ||
129 | - var help_id = th.data.help_id; | ||
130 | - var user_id = getApp().globalData.user_id; | ||
131 | - | ||
132 | - /*-----助力活动(判断)-----*/ | ||
133 | - rq.get("/api/weshop/marketing/help/act/judge", { | ||
134 | - data: { | ||
135 | - userId: user_id, | ||
136 | - storeId: os.stoid | ||
137 | - }, | ||
138 | - success: function(res) { | ||
139 | - if (res.data.code == 0) { | ||
140 | - var help_data = res.data.data; | ||
141 | - th.setData({ | ||
142 | - endDate: help_data.endDate, | ||
143 | - }); | ||
144 | - | ||
145 | - //任务时间 设置全局定时器 | ||
146 | - th.setData({ | ||
147 | - timer: setInterval(function() { | ||
148 | - th.countDown(); | ||
149 | - }, 1000) | ||
150 | - }) | ||
151 | - | ||
152 | - | ||
153 | - } | ||
154 | - } | ||
155 | - }); | ||
156 | - | ||
157 | - | ||
158 | - /*-----获取助力活动的任务-----*/ | ||
159 | - rq.get("/api/weshop/marketing/help/help/task/page", { | ||
160 | - data: { | ||
161 | - helpId: help_id, | ||
162 | - storeId: os.stoid | ||
163 | - }, | ||
164 | - success: function(su) { | ||
165 | - var data = su.data; | ||
166 | - if (data.code != 0) { | ||
167 | - getApp().my_warnning(data.msg, 0, th); | ||
168 | - return false; | ||
169 | - } | ||
170 | - if (data.code == 0) { | ||
171 | - //轮播图的数据 | ||
172 | - var data_aissa = data.data.pageData; | ||
173 | - //当前时间戳 | ||
174 | - var nt = ut.gettimestamp(); | ||
175 | - | ||
176 | - data_aissa.forEach(function(val, ind) { | ||
177 | - | ||
178 | - //已开始 | ||
179 | - if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0; | ||
180 | - //未开始 | ||
181 | - else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1; | ||
182 | - //已结束 | ||
183 | - else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2; | ||
184 | - }); | ||
185 | - var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; | ||
186 | - var taskid = data_aissa[0].id; | ||
187 | - th.setData({ | ||
188 | - aitem: data_aissa, | ||
189 | - task_number: task_number, | ||
190 | - taskid: taskid | ||
191 | - }); | ||
192 | - //判断是不是领取的任务 | ||
193 | - th.get_user_task(); | ||
194 | - | ||
195 | - } | ||
196 | - | ||
197 | - } | ||
198 | - }) | ||
199 | - | ||
200 | - // 分享的 | ||
201 | - // setTimeout(function() { | ||
202 | - // th.shareFrends(); | ||
203 | - // }, 1000) | ||
204 | - | ||
205 | - //会员任务列表 | ||
206 | - this.user_task_list(); | ||
207 | - //获取助力活动参与的人数 | ||
208 | - this.get_user_task_num(); | ||
209 | - | ||
210 | - }, | ||
211 | - | ||
212 | - | ||
213 | - //帮拆记录的 | ||
214 | - dismantle_record: function(e) { | ||
215 | - //优化444444444444444444 | ||
216 | - if (this.data.switch_head == 1) { | ||
217 | - return false; | ||
218 | - } | ||
219 | - var aitem = this.data.aitem; //任务的数据集 | ||
220 | - var sw_index = this.data.sw_index; //轮播的下标 | ||
221 | - //任务id | ||
222 | - var taskid = aitem[sw_index].id; | ||
223 | - var th = this; | ||
224 | - var index = 1; //获取当前选择的是任务还是活动说明 | ||
225 | - var is_task = this.data.is_task; //0任务,1帮拆 | ||
226 | - if (is_task == undefined || is_task == null) { | ||
227 | - is_task = 1; | ||
228 | - } | ||
229 | - var switch_head = this.data.switch_head; | ||
230 | - if (switch_head == undefined || switch_head == null) { | ||
231 | - switch_head = 1; | ||
232 | - } | ||
233 | - this.setData({ | ||
234 | - is_task: 1, | ||
235 | - switch_head: 1, | ||
236 | - block: 0, | ||
237 | - }); | ||
238 | - var bc_page = th.data.bc_page; | ||
239 | - rq.get("/api/weshop/marketing/help/help/task/involve/page", { | ||
240 | - data: { | ||
241 | - page: bc_page, | ||
242 | - pageSize: 5, | ||
243 | - taskId: taskid, | ||
244 | - userId: getApp().globalData.user_id, | ||
245 | - storeId: os.stoid | ||
246 | - }, | ||
247 | - success: function(res) { | ||
248 | - if (res.data.code == 0) { | ||
249 | - var dismantle = res.data.data.pageData[0].zlHelpUser; | ||
250 | - if (res.data.data.total > 5) { | ||
251 | - var bc_page = th.data.bc_page + 1; | ||
252 | - th.data({ | ||
253 | - bc_page: bc_page, | ||
254 | - is_bc_show: 1 | ||
255 | - }) | ||
256 | - } else { | ||
257 | - getApp().my_warnning("暂无更多内容", 0, th); | ||
258 | - } | ||
259 | - | ||
260 | - th.setData({ | ||
261 | - dismantle: dismantle | ||
262 | - }); | ||
263 | - } else { | ||
264 | - th.setData({ | ||
265 | - dismantle: null | ||
266 | - }); | ||
267 | - } | ||
268 | - } | ||
269 | - | ||
270 | - }) | ||
271 | - }, | ||
272 | - // 领取礼包 | ||
273 | - get_libao: function(e) { | ||
274 | - var libao_id = e.currentTarget.dataset.libaoid; //礼包id | ||
275 | - var taskid= e.currentTarget.dataset.taskid; | ||
276 | - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1 +"&taskId="+taskid); | ||
277 | - }, | ||
278 | - //查看礼包id | ||
279 | - select_libao: function(e) { | ||
280 | - var orderSn = e.currentTarget.dataset.orderSn; | ||
281 | - getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn); | ||
282 | - }, | ||
283 | - | ||
284 | - //划动的时候监听 | ||
285 | - onSli: function(e) { | ||
286 | - var th = this; | ||
287 | - var ind = e.detail.current; | ||
288 | - var aitem = this.data.aitem; | ||
289 | - var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty; | ||
290 | - var task_id = aitem[ind].id; | ||
291 | - th.setData({ | ||
292 | - sw_index: ind, | ||
293 | - task_number: task_number, | ||
294 | - taskid: task_id | ||
295 | - }); | ||
296 | - | ||
297 | - if (this.data.switch_head == 1) { | ||
298 | - //判断有没有帮拆记录 | ||
299 | - this.dismantle_record(); | ||
300 | - } | ||
301 | - //判断是不是领取的任务 | ||
302 | - th.get_user_task(); | ||
303 | - | ||
304 | - }, | ||
305 | - //导航球 | ||
306 | - close: function() { | ||
307 | - var th = this; | ||
308 | - var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
309 | - nav_b.close_box(); | ||
310 | - }, | ||
311 | - // 获取会员的参与的任务列表 我的任务 | ||
312 | - user_task_list: function(e) { | ||
313 | - var th = this; | ||
314 | - //防止已经当前位置的时候多次点击 | ||
315 | - if (th.data.block == 1) { return false; } | ||
316 | - var index = 0; | ||
317 | - var is_task = this.data.is_task; //0任务,1帮拆 | ||
318 | - if (is_task == undefined || is_task == null) { | ||
319 | - is_task = 0; | ||
320 | - } | ||
321 | - var switch_head = this.data.switch_head; | ||
322 | - if (switch_head == undefined || switch_head == null) { | ||
323 | - switch_head = 0; | ||
324 | - } | ||
325 | - this.setData({ | ||
326 | - is_task: index, | ||
327 | - switch_head: index | ||
328 | - }); | ||
329 | - var help_id = th.data.help_id; | ||
330 | - var user_id = getApp().globalData.user_id; | ||
331 | - var rw_page = th.data.rw_page; | ||
332 | - rq.get("/api/weshop/marketing/help/help/user/page", { | ||
333 | - data: { | ||
334 | - page: rw_page, | ||
335 | - pageSize: 5, | ||
336 | - helpId: help_id, | ||
337 | - storeId: os.stoid, | ||
338 | - userId: user_id | ||
339 | - }, | ||
340 | - success: function(su) { | ||
341 | - th.setData({block:1}); | ||
342 | - if (su.data.code == 0) { | ||
343 | - if (su.data.data.total > 5) { | ||
344 | - var rw_page = th.data.rw_page + 1; | ||
345 | - th.setData({ | ||
346 | - rw_page: rw_page, | ||
347 | - is_show: 1 | ||
348 | - }) | ||
349 | - getApp().my_warnning(su.data.msg, 1, th); | ||
350 | - } | ||
351 | - | ||
352 | - var user_list = su.data.data.pageData; | ||
353 | - th.setData({ | ||
354 | - user_task_list: user_list | ||
355 | - }); | ||
356 | - } else { | ||
357 | - getApp().my_warnning(su.data.msg, 0, th); | ||
358 | - } | ||
359 | - } | ||
360 | - }) | ||
361 | - }, | ||
362 | - //判断是否有领取任务 获取正在进行中的任务 | ||
363 | - get_user_task: function() { | ||
364 | - var user_id = getApp().globalData.user_id; | ||
365 | - var th = this; | ||
366 | - var aitem = th.data.aitem; | ||
367 | - var sw_index = th.data.sw_index; | ||
368 | - var taskid = aitem[sw_index].id | ||
369 | - rq.get("/api/weshop/marketing/help/help/task/get", { | ||
370 | - data: { | ||
371 | - storeId: os.stoid, | ||
372 | - userId: user_id, | ||
373 | - taskId: taskid | ||
374 | - }, | ||
375 | - success: function(res) { | ||
376 | - if (res.data.code == 0) { | ||
377 | - var is_usertask = res.data.data; | ||
378 | - th.setData({ | ||
379 | - is_user_task: is_usertask | ||
380 | - }); | ||
381 | - } | ||
382 | - } | ||
383 | - }) | ||
384 | - }, | ||
385 | - //获取助力活动参与的人数 | ||
386 | - get_user_task_num: function() { | ||
387 | - var th = this; | ||
388 | - var help_id = th.data.help_id; | ||
389 | - rq.get("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
390 | - data: { | ||
391 | - helpId: help_id, | ||
392 | - storeId: os.stoid, | ||
393 | - }, | ||
394 | - success: function(su) { | ||
395 | - if (su.data.code == 0) { | ||
396 | - var usercount = su.data.data.countAll; | ||
397 | - | ||
398 | - th.setData({ | ||
399 | - usercount: usercount | ||
400 | - }); | ||
401 | - } | ||
402 | - } | ||
403 | - }) | ||
404 | - | ||
405 | - }, | ||
406 | - //轮播卡死的重置 | ||
407 | - changeGoodsSwip: function(detail) { | ||
408 | - if (detail.detail.source == "touch") { | ||
409 | - //当页面卡死的时候,current的值会变成0 | ||
410 | - if (detail.detail.current == 0) { | ||
411 | - //有时候这算是正常情况,所以暂定连续出现3次就是卡了 | ||
412 | - let swiperError = this.data.swiperError | ||
413 | - swiperError += 1 | ||
414 | - this.setData({ | ||
415 | - swiperError: swiperError | ||
416 | - }) | ||
417 | - if (swiperError >= 3) { //在开关被触发3次以上 | ||
418 | - this.setData({ | ||
419 | - sw_index: this.data.preIndex | ||
420 | - }); //,重置current为正确索引 | ||
421 | - this.setData({ | ||
422 | - swiperError: 0 | ||
423 | - }) | ||
424 | - } | ||
425 | - } else { //正常轮播时,记录正确页码索引 | ||
426 | - this.setData({ | ||
427 | - preIndex: detail.detail.current | ||
428 | - }); | ||
429 | - //将开关重置为0 | ||
430 | - this.setData({ | ||
431 | - swiperError: 0 | ||
432 | - }) | ||
433 | - } | ||
434 | - } | ||
435 | - }, | ||
436 | - | ||
437 | - // 轮播图点击左边 | ||
438 | - click_pre: function() { | ||
439 | - var index = this.data.sw_index; | ||
440 | - index--; | ||
441 | - if (index < 0) return; | ||
442 | - var aitem = this.data.aitem; | ||
443 | - var task_number = aitem[index].giftQty - aitem[index].useGiftQty; | ||
444 | - var task_id = aitem[index].id; | ||
445 | - this.setData({ | ||
446 | - sw_index: index, | ||
447 | - task_number: task_number, | ||
448 | - taskid: task_id | ||
449 | - }) | ||
450 | - if (this.data.switch_head == 1) { | ||
451 | - //判断有没有帮拆记录 | ||
452 | - this.dismantle_record(); | ||
453 | - } | ||
454 | - //判断有没有领取任务 | ||
455 | - this.get_user_task(); | ||
456 | - }, | ||
457 | - //轮播图点击右边 | ||
458 | - click_next: function() { | ||
459 | - | ||
460 | - var index = this.data.sw_index; | ||
461 | - index++; | ||
462 | - if (index >= this.data.aitem.length) return; | ||
463 | - var aitem = this.data.aitem; | ||
464 | - var task_number = aitem[index].giftQty - aitem[index].useGiftQty; | ||
465 | - var task_id = aitem[index].id; | ||
466 | - this.setData({ | ||
467 | - sw_index: index, | ||
468 | - task_number: task_number, | ||
469 | - taskid: task_id | ||
470 | - }) | ||
471 | - if (this.data.switch_head == 1) { | ||
472 | - this.dismantle_record(); | ||
473 | - } | ||
474 | - }, | ||
475 | - | ||
476 | - /** | ||
477 | - * 生命周期函数--监听页面隐藏 | ||
478 | - */ | ||
479 | - onHide: function() { | ||
480 | - //--清理定时器-- | ||
481 | - clearInterval(this.data.timer); | ||
482 | - }, | ||
483 | - | ||
484 | - /** | ||
485 | - * 生命周期函数--监听页面卸载 | ||
486 | - */ | ||
487 | - onUnload: function() { | ||
488 | - | ||
489 | - }, | ||
490 | - | ||
491 | - /** | ||
492 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
493 | - */ | ||
494 | - onPullDownRefresh: function() { | ||
495 | - | ||
496 | - }, | ||
497 | - //----助力任务的时间----- | ||
498 | - countDown() { | ||
499 | - if (!this.data.is_timer) return false; | ||
500 | - var th = this; | ||
501 | - // 获取当前时间,同时得到活动结束时间数组 | ||
502 | - var newTime = ut.gettimestamp(); | ||
503 | - | ||
504 | - // 对结束时间进行处理渲染到页面 | ||
505 | - | ||
506 | - // var o = endTimeList[i]; | ||
507 | - var endTime = th.data.endDate; | ||
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' | ||
532 | - } | ||
533 | - } | ||
534 | - var txt = "aitem[" + 0 + "].djs"; | ||
535 | - th.setData({ | ||
536 | - [txt]: obj | ||
537 | - }); | ||
538 | - }, | ||
539 | - //---小于10的格式化函数---- | ||
540 | - timeFormat(param) { | ||
541 | - return param < 10 ? '0' + param : param; | ||
542 | - }, | ||
543 | - | ||
544 | - /** | ||
545 | - * 页面上拉触底事件的处理函数 | ||
546 | - */ | ||
547 | - onReachBottom: function() { | ||
548 | - | ||
549 | - }, | ||
550 | - | ||
551 | - /** | ||
552 | - * 用户点击右上角分享 | ||
553 | - */ | ||
554 | - onShareAppMessage: function() { | ||
555 | - | ||
556 | - }, | ||
557 | - | ||
558 | - preview: function() { | ||
559 | - var th = this; | ||
560 | - var shareImgPath = th.data.shareImgPath; | ||
561 | - wx.previewImage({ | ||
562 | - url: shareImgPath[0], | ||
563 | - urls: shareImgPath | ||
564 | - }) | ||
565 | - }, | ||
566 | - | ||
567 | - //关闭分享显示 | ||
568 | - close_share: function() { | ||
569 | - var th = this; | ||
570 | - th.setData({ | ||
571 | - is_share: 0 | ||
572 | - }) | ||
573 | - }, | ||
574 | - syinfo: function() { | ||
575 | - var th = this; | ||
576 | - //获取用户设备信息,屏幕宽度 | ||
577 | - wx.getSystemInfo({ | ||
578 | - success: res => { | ||
579 | - th.setData({ | ||
580 | - screenWidth: res.screenWidth | ||
581 | - }) | ||
582 | - } | ||
583 | - }) | ||
584 | - }, | ||
585 | - | ||
586 | - | ||
587 | - | ||
588 | - //************************ */ | ||
589 | - shareFrends: function(e) { | ||
590 | - var th = this; | ||
591 | - if (th.data.is_generate) return; | ||
592 | - th.data.is_generate = 1; | ||
593 | - | ||
594 | - var scene = 1; | ||
595 | - ///二微码 | ||
596 | - var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | ||
597 | - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/index/index/index"; | ||
598 | - //读取文件成功则OK-- | ||
599 | - wx.getImageInfo({ | ||
600 | - src: path3, | ||
601 | - success: function(res) { | ||
602 | - | ||
603 | - var ewm_path = res.path; // | ||
604 | - //var act_time="2019.06.26 - 2019.07.02"; //活动的时间 | ||
605 | - var bg_time = ut.formar_no_full(th.data.dynamic.beginDate); | ||
606 | - var end_time = ut.formar_no_full(th.data.dynamic.endDate); | ||
607 | - var act_time = bg_time + "-" + end_time; | ||
608 | - | ||
609 | - | ||
610 | - var iurl = th.data.iurl; //图片地址前缀 | ||
611 | - const ctx = wx.createCanvasContext('share_id'); //绘图上下文 | ||
612 | - var unit = th.data.screenWidth / 750 * 1.35; | ||
613 | - var numsize = 20 * unit; //几人助力字体大小 | ||
614 | - var head_list_img = th.data.head_pic_arr; | ||
615 | - var num = th.data.head_pic_arr.length; //已有几位好友助力 | ||
616 | - | ||
617 | - var aitem = th.data.aitem; //任务的数据集 | ||
618 | - var sw_index = th.data.sw_index; //轮播的下标 | ||
619 | - //任务id | ||
620 | - var help_num = aitem[sw_index].helpNum; | ||
621 | - var q_num = help_num - num; //还差几位好友助力 | ||
622 | - var already = num.toString().length + 1; //已有几位好友助力 | ||
623 | - var lack = q_num.toString().length + 1; //还差几位好友助力 | ||
624 | - | ||
625 | - var size = 15 * unit; | ||
626 | - var imagesize = 40 * unit; //助力人的图片大小 | ||
627 | - var left = 74 * unit; //助力人头像跟左边的距离 | ||
628 | - var spacing = 12 * unit; //助力人图片间距 | ||
629 | - var images = th.data.images; | ||
630 | - ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片 | ||
631 | - ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片 | ||
632 | - | ||
633 | - | ||
634 | - ctx.drawImage(th.data.share_lb_img, 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的礼包的背景图片 | ||
635 | - | ||
636 | - ctx.setFillStyle("rgb(221,153,116)"); | ||
637 | - ctx.setFontSize(size) | ||
638 | - ctx.fillText("已有", 77 * unit, 430 * unit); | ||
639 | - ctx.setFillStyle("#FF4746"); | ||
640 | - ctx.setFontSize(numsize) | ||
641 | - ctx.fillText(num + "位", 108 * unit, 430 * unit); | ||
642 | - ctx.setFillStyle("rgb(221,153,116)"); | ||
643 | - ctx.setFontSize(size) | ||
644 | - ctx.fillText("好友助力,还差", 116 * unit + already * numsize * unit, 430 * unit); | ||
645 | - ctx.setFillStyle("#FF4746"); | ||
646 | - ctx.setFontSize(numsize); | ||
647 | - ctx.fillText(q_num + "位", 223 * unit + already * numsize * unit, 430 * unit); | ||
648 | - ctx.setFillStyle("rgb(221,153,116)"); | ||
649 | - ctx.setFontSize(size); | ||
650 | - ctx.fillText("达成助力", 230 * unit + lack * numsize * unit + already * numsize * unit, 430 * unit); | ||
651 | - var c = num / help_num; | ||
652 | - ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit); | ||
653 | - ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit); | ||
654 | - var head_list_num = 30; | ||
655 | - var is_head_list = 0; | ||
656 | - | ||
657 | - //当需要助力人数小与6个 | ||
658 | - if (help_num < 6) { | ||
659 | - var pos_arr=ut.get_box_arr(help_num,225.25*unit,505 * unit,spacing,imagesize / 2); | ||
660 | - var now_ind=0; | ||
661 | - //--判断已助力的人数-- | ||
662 | - for (var a = 0; a < head_list_img.length; a++) { | ||
663 | - var pos= pos_arr[now_ind]; | ||
664 | - ut.draw_circle(ctx,pos.x, pos.y, imagesize / 2,head_list_img[a],'red',unit); | ||
665 | - now_ind++; | ||
666 | - } | ||
667 | - //--显示还差的人数-- | ||
668 | - if(help_num-head_list_img.length>0){ | ||
669 | - var neednum=help_num-head_list_img.length; | ||
670 | - //这个是还未助力的位置 | ||
671 | - for (var i = 0; i < neednum; i++) { | ||
672 | - var pos= pos_arr[now_ind]; | ||
673 | - now_ind++; | ||
674 | - // 助力人的头像 | ||
675 | - ctx.drawImage(images[4], pos.x-imagesize/2, pos.y-imagesize/2,imagesize, imagesize); //分享的背景图片 | ||
676 | - | ||
677 | - } | ||
678 | - } | ||
679 | - | ||
680 | - }else if(help_num>7){ | ||
681 | - //助力头像数量, 是不是要显示省略图 | ||
682 | - var zl_head=0,is_sheng=0; | ||
683 | - if(head_list_img.length>=6) { | ||
684 | - zl_head=5;is_sheng=1; | ||
685 | - }else{ | ||
686 | - zl_head=head_list_img.length; | ||
687 | - } | ||
688 | - | ||
689 | - | ||
690 | - //判断已助力的人数 | ||
691 | - for (var a = 0; a < zl_head; a++) { | ||
692 | - //绘制头像 | ||
693 | - ut.draw_circle(ctx,left + imagesize / 2, 505 * unit, imagesize / 2,head_list_img[a],'red',unit); | ||
694 | - left += imagesize + spacing; | ||
695 | - } | ||
696 | - | ||
697 | - //如果是省略号的话 | ||
698 | - if(is_sheng){ | ||
699 | - ctx.drawImage(images[5], left , 505 * unit - imagesize / 2, imagesize, imagesize); //头像的省略图片 | ||
700 | - }else{ | ||
701 | - //这个是还未助力的位置 | ||
702 | - for (var i = 0; i < 6-head_list_img.length; i++) { | ||
703 | - // 助力人的头像 | ||
704 | - ctx.drawImage(images[4], left , 505 * unit - imagesize / 2, imagesize, imagesize); //分享的?号图片 | ||
705 | - left += imagesize + spacing; | ||
706 | - } | ||
707 | - } | ||
708 | - }else{ | ||
709 | - // 判断已助力的人数 | ||
710 | - for (var a = 0; a < head_list_img.length; a++) { | ||
711 | - ctx.save(); | ||
712 | - ctx.beginPath(); //开始绘制 | ||
713 | - ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI); | ||
714 | - ctx.setLineWidth(4 * unit); | ||
715 | - ctx.setStrokeStyle('red'); | ||
716 | - ctx.setFillStyle("white"); | ||
717 | - ctx.fill(); | ||
718 | - ctx.clip(); | ||
719 | - ctx.drawImage(head_list_img[a], left , 505 * unit - imagesize / 2, imagesize, imagesize); | ||
720 | - ctx.restore(); | ||
721 | - left += imagesize + spacing; | ||
722 | - } | ||
723 | - | ||
724 | - if(help_num-head_list_img.lengt>0){ | ||
725 | - var neednum=help_num-head_list_img.length; | ||
726 | - //这个是还未助力的位置 | ||
727 | - for (var i = 0; i < neednum; i++) { | ||
728 | - // 助力人的头像 | ||
729 | - ctx.drawImage(images[4], left , 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片 | ||
730 | - left += imagesize + spacing; | ||
731 | - } | ||
732 | - } | ||
733 | - | ||
734 | - } | ||
735 | - | ||
736 | - ctx.setFillStyle("rgb(255,255,255)"); | ||
737 | - ctx.setFontSize(size); | ||
738 | - ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit); | ||
739 | - ctx.setFillStyle("rgb(255,255,255)"); | ||
740 | - ctx.setFontSize(size); | ||
741 | - ctx.fillText(act_time, 37 * unit, 620 * unit); //绘制活动是时间 | ||
742 | - ctx.setFillStyle("rgb(255,255,255)"); | ||
743 | - ctx.setFontSize(size); | ||
744 | - ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit); | ||
745 | - ctx.drawImage(ewm_path, 325 * unit, 585 * unit, 77 * unit, 77 * unit); //分享的背景图片 | ||
746 | - ctx.save(); | ||
747 | - //读取文件成功则OK-- | ||
748 | - // wx.getImageInfo({ | ||
749 | - // src: path3, | ||
750 | - // success: function (res) { | ||
751 | - //把画板内容绘制成图片,并回调 画板图片路径 | ||
752 | - ctx.draw(false, function() { | ||
753 | - setTimeout(function() { | ||
754 | - wx.canvasToTempFilePath({ | ||
755 | - x: 0, | ||
756 | - y: 0, | ||
757 | - width: 300, | ||
758 | - height: 500, | ||
759 | - destWidth: 400 * 2, | ||
760 | - destHeight: 720 * 2, | ||
761 | - canvasId: 'share_id', | ||
762 | - success: function(res) { | ||
763 | - wx.hideLoading(); | ||
764 | - var shareImgPath = th.data.shareImgPath; | ||
765 | - shareImgPath[0] = res.tempFilePath; | ||
766 | - | ||
767 | - th.setData({ | ||
768 | - shareImgPath: shareImgPath, | ||
769 | - canvasHidden: 1, | ||
770 | - is_share: 1, | ||
771 | - is_generate: 0, | ||
772 | - canvasHidden: 1 | ||
773 | - }) | ||
774 | - if (!res.tempFilePath) { | ||
775 | - wx.showModal({ | ||
776 | - title: '提示', | ||
777 | - content: '图片绘制中,请稍后重试', | ||
778 | - showCancel: false | ||
779 | - }) | ||
780 | - return false; | ||
781 | - } | ||
782 | - | ||
783 | - }, | ||
784 | - fail(r) { | ||
785 | - | ||
786 | - } | ||
787 | - }, 500) | ||
788 | - }) | ||
789 | - }) | ||
790 | - } | ||
791 | - }) | ||
792 | - | ||
793 | - | ||
794 | - }, | ||
795 | - | ||
796 | - | ||
797 | - preview: function() { | ||
798 | - var th = this; | ||
799 | - var shareImgPath = th.data.shareImgPath; | ||
800 | - wx.previewImage({ | ||
801 | - url: shareImgPath[0], | ||
802 | - urls: shareImgPath | ||
803 | - }) | ||
804 | - th.setData({ | ||
805 | - is_share: 0 | ||
806 | - }) | ||
807 | - }, | ||
808 | - | ||
809 | - //关闭分享显示 | ||
810 | - close_share: function() { | ||
811 | - var th = this; | ||
812 | - wx.hideLoading(); | ||
813 | - th.setData({ | ||
814 | - is_share: 0 | ||
815 | - }) | ||
816 | - }, | ||
817 | - syinfo: function() { | ||
818 | - var th = this; | ||
819 | - //获取用户设备信息,屏幕宽度 | ||
820 | - wx.getSystemInfo({ | ||
821 | - success: res => { | ||
822 | - th.setData({ | ||
823 | - screenWidth: res.screenWidth | ||
824 | - }) | ||
825 | - } | ||
826 | - }) | ||
827 | - }, | ||
828 | - | ||
829 | - //把固定的图片加载到本地 | ||
830 | - imageinfo: async function() { | ||
831 | - var th = this; | ||
832 | - var images = th.data.images; | ||
833 | - var iurl = th.data.iurl; | ||
834 | - for (var i in images) { | ||
835 | - var img_path = iurl + images[i]; | ||
836 | - await getApp().request.promise_downimg(img_path).then(res => { | ||
837 | - images[i] = res; | ||
838 | - }) | ||
839 | - } | ||
840 | - | ||
841 | - th.data.images = images; | ||
842 | - }, | ||
843 | - | ||
844 | - | ||
845 | - //好友猜一猜 | ||
846 | - save_share: function(e) { | ||
847 | - var th = this; | ||
848 | - var aitem = this.data.aitem; //任务的数据集 | ||
849 | - var sw_index = this.data.sw_index; //轮播的下标 | ||
850 | - var sw_item = aitem[sw_index]; | ||
851 | - //任务id | ||
852 | - var taskid = sw_item.id; | ||
853 | - th.setData({ | ||
854 | - is_share: 1 | ||
855 | - }) | ||
856 | - var url = "/api/weshop/marketing/help/help/task/involve/page"; | ||
857 | - getApp().request.promiseGet(url, { | ||
858 | - isShowLoading: true, | ||
859 | - data: { | ||
860 | - storeId: os.stoid, | ||
861 | - taskId: taskid, | ||
862 | - userId: getApp().globalData.user_id | ||
863 | - } | ||
864 | - }).then(res => { | ||
865 | - if (res.data.code == 0) { | ||
866 | - var data = res.data.data.pageData; //帮拆数组 | ||
867 | - if (data.length > 0) { | ||
868 | - th.data.dynamic = data[0]; | ||
869 | - var path = th.data.iurl + sw_item.giftBagUrl; | ||
870 | - //先获取礼包分享时的本地路径 | ||
871 | - getApp().request.promise_downimg(path).then(res => { | ||
872 | - th.data.share_lb_img = res; | ||
873 | - //先获取会员的头像 | ||
874 | - th.info_head(th.shareFrends); | ||
875 | - }); | ||
876 | - } | ||
877 | - } else { | ||
878 | - wx.hideLoading(); | ||
879 | - getApp().my_warnning(res.data.msg, 0, th); | ||
880 | - } | ||
881 | - }) | ||
882 | - }, | ||
883 | - | ||
884 | - //把已助力好友头像下载到本地 | ||
885 | - info_head: async function(func) { | ||
886 | - var th = this; | ||
887 | - var images = th.data.dynamic.zlHelpUser; | ||
888 | - var arr = new Array(); | ||
889 | - var block = th.data.block; | ||
890 | - if (images) { | ||
891 | - th.data.head_pic_arr.length = 0; | ||
892 | - for (var i in images) { | ||
893 | - var img_path = images[i].headPic; | ||
894 | - await getApp().request.promise_downimg(img_path).then(res => { | ||
895 | - th.data.head_pic_arr.push(res); | ||
896 | - }) | ||
897 | - } | ||
898 | - } | ||
899 | - func(); | ||
900 | - }, | ||
901 | -//立即兑换 | ||
902 | - redeem_now: function (e) { | ||
903 | - var libao_id = e.currentTarget.dataset.libaoid; | ||
904 | - var taskid = e.currentTarget.dataset.taskid; | ||
905 | - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1 + "&taskId=" + taskid); | ||
906 | - }, | ||
907 | - | ||
908 | - | ||
909 | - //礼包的详情 轮播图 | ||
910 | - libao_details: function(e) { | ||
911 | - var th = this; | ||
912 | - var help_id = th.data.help_id; //活动id | ||
913 | - var taskId = e.currentTarget.dataset.taskid; //任务id | ||
914 | - getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId); | ||
915 | - }, | ||
916 | - //测试正在进行任务 | ||
917 | - test: function (e) { | ||
918 | - var taskid = e.currentTarget.dataset.taskid; | ||
919 | - var uset_id = this.data.zlisuers_id; | ||
920 | - getApp().goto("/pages/user/assistance/friend_assistance?tasking=" + taskid + "&userId=" + uset_id); | ||
921 | - }, | ||
922 | - | ||
923 | -}) | ||
924 | \ No newline at end of file | 0 | \ No newline at end of file |
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)" bindtap="close"> | 2 | +<view class="top-back" style="padding-bottom:{{is_user_task!=null&&is_user_task.status==0?50:0}}rpx;background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)" bindtap="close"> |
3 | <!-- 助力活动头部 --> | 3 | <!-- 助力活动头部 --> |
4 | <view class="top-frame"> | 4 | <view class="top-frame"> |
5 | <view class="flex-center"> | 5 | <view class="flex-center"> |
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> | 23 | <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> |
24 | <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> | 24 | <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> |
25 | 25 | ||
26 | - <image class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{iurl+aitem.giftBagUrl}}"></image> | 26 | + <image class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}"></image> |
27 | <view class="abs select_details fs26 white">礼包详情</view> | 27 | <view class="abs select_details fs26 white">礼包详情</view> |
28 | 28 | ||
29 | </swiper-item> | 29 | </swiper-item> |
@@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
52 | <view wx:if="{{is_user_task!=null&&is_user_task.status==0}}" class="task_clike fs40 t-c flex-center" bindtap="save_share"> | 52 | <view wx:if="{{is_user_task!=null&&is_user_task.status==0}}" class="task_clike fs40 t-c flex-center" bindtap="save_share"> |
53 | 好友拆一拆 | 53 | 好友拆一拆 |
54 | </view> | 54 | </view> |
55 | - <view wx:if="{{is_user_task!=null&&is_user_task.status==1}}" class="task_clike fs40 t-c flex-center" data-libaoid="{{is_user_task.helpListGiftBagId}}"data-taskid="{{is_user_task.id}}" bindtap="redeem_now"> | 55 | + <view wx:if="{{is_user_task!=null&&is_user_task.status==1}}" class="task_clike fs40 t-c flex-center" data-libaoid="{{is_user_task.helpListGiftBagId}}"data-taskingid="{{is_user_task.id}}" bindtap="redeem_now"> |
56 | 立即兑换 | 56 | 立即兑换 |
57 | </view> | 57 | </view> |
58 | <view wx:if="{{is_user_task!=null&&is_user_task.status==0}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test"> | 58 | <view wx:if="{{is_user_task!=null&&is_user_task.status==0}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test"> |
@@ -90,7 +90,7 @@ | @@ -90,7 +90,7 @@ | ||
90 | <view class="ellipsis-1"> | 90 | <view class="ellipsis-1"> |
91 | <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> | 91 | <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> |
92 | <text wx:if="{{item.status==2}}" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</text> | 92 | <text wx:if="{{item.status==2}}" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</text> |
93 | - <text wx:if="{{item.status==1}}" bindtap="get_libao" data-libaoid="{{item.helpListGiftBagId}}"data-taskid="{{item.id}}">领取礼包 </text> | 93 | + <text wx:if="{{item.status==1}}" bindtap="get_libao" data-libaoid="{{item.helpListGiftBagId}}"data-taskingid="{{item.id}}" data-taskid="{{item.helpTaskId}}">领取礼包 </text> |
94 | </view> | 94 | </view> |
95 | </view> | 95 | </view> |
96 | </view> | 96 | </view> |
@@ -110,21 +110,20 @@ | @@ -110,21 +110,20 @@ | ||
110 | <view class="items" wx:if="{{is_task==1}}"> | 110 | <view class="items" wx:if="{{is_task==1}}"> |
111 | <block wx:if="{{ dismantle!=null|| dismantle!=''}}"> | 111 | <block wx:if="{{ dismantle!=null|| dismantle!=''}}"> |
112 | 112 | ||
113 | - | 113 | + <view class="tesk_list"> |
114 | <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}" wx:for-index="idx"> | 114 | <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}" wx:for-index="idx"> |
115 | - | ||
116 | - <view class="flex white" style="justify-content: space-around; width: 90%;margin:auto"> | ||
117 | - <image class="circle user_img" src="{{item.headPic}}"></image> | 115 | + <view class="flex white is_dismantle_frame" style="justify-content: space-around; width: 90%;margin:auto"> |
116 | + <image class="circle user_img" src="{{item.headPic==null?defaultAvatar:item.headPic}}"></image> | ||
118 | <view class="ellipsis-1 width">{{item.nickName}} | 117 | <view class="ellipsis-1 width">{{item.nickName}} |
119 | </view> | 118 | </view> |
120 | <view class="ellipsis-1">{{filter.format_time(item.zltime)}} | 119 | <view class="ellipsis-1">{{filter.format_time(item.zltime)}} |
121 | </view> | 120 | </view> |
122 | </view> | 121 | </view> |
123 | </view> | 122 | </view> |
124 | - | ||
125 | - <view class="flex-center fs32" wx:if="{{is_bc_show==1}}"> | 123 | + </view> |
124 | + <view class="flex-center fs32" wx:if="{{is_bc_show==1&&dismantle!=null&&is_dis_list==1}}"> | ||
126 | <view class="line"></view> | 125 | <view class="line"></view> |
127 | - <view class="load white" bindtap="dismantle_record">点击加载更多</view> | 126 | + <view class="load white" bindtap="dismantle_record_list">点击加载更多</view> |
128 | <view class="line"></view> | 127 | <view class="line"></view> |
129 | </view> | 128 | </view> |
130 | </block> | 129 | </block> |
@@ -141,12 +140,12 @@ | @@ -141,12 +140,12 @@ | ||
141 | </view> | 140 | </view> |
142 | <!-- 加载更多 --> | 141 | <!-- 加载更多 --> |
143 | <view class="fs32"> | 142 | <view class="fs32"> |
144 | - <view class="flex-center" wx:if="{{is_show==1}}"> | 143 | + <view class="flex-center" wx:if="{{is_show==1&&is_user_list==0}}"> |
145 | <view class="line"></view> | 144 | <view class="line"></view> |
146 | - <view class="load white" bindtap="user_task_list">点击加载更多</view> | 145 | + <view class="load white" bindtap="task_list">点击加载更多</view> |
147 | <view class="line"></view> | 146 | <view class="line"></view> |
148 | </view> | 147 | </view> |
149 | - <view class="flex-center white" style="margin-top: 20rpx;" wx:if="{{usercount>0}}"> | 148 | + <view class="flex-center white bottom" wx:if="{{usercount>0}}"> |
150 | <view>已有{{usercount}}人领取了任务</view> | 149 | <view>已有{{usercount}}人领取了任务</view> |
151 | </view> | 150 | </view> |
152 | </view> | 151 | </view> |
pages/user/assistance/task_assistance.wxss
@@ -226,3 +226,13 @@ page { | @@ -226,3 +226,13 @@ page { | ||
226 | filter: alpha(opacity=60); | 226 | filter: alpha(opacity=60); |
227 | bottom: 0rpx; | 227 | bottom: 0rpx; |
228 | } | 228 | } |
229 | +.is_dismantle_frame{ | ||
230 | + align-content: center; | ||
231 | +height: 56rpx; | ||
232 | +line-height: 48rpx; | ||
233 | + | ||
234 | +} | ||
235 | +.bottom{ | ||
236 | + margin-bottom: 50rpx; | ||
237 | + margin-top: 20rpx; | ||
238 | +} | ||
229 | \ No newline at end of file | 239 | \ No newline at end of file |
pages/user/index/index.js
1 | -var auth = require("../../../utils/auth.js"),rq = require("../../../utils/request.js"); | ||
2 | -var e = getApp(),app=e, s = e.globalData.setting,os=s,app_d = e.globalData; | 1 | +var auth = require("../../../utils/auth.js"), |
2 | + rq = require("../../../utils/request.js"); | ||
3 | +var e = getApp(), | ||
4 | + app = e, | ||
5 | + s = e.globalData.setting, | ||
6 | + os = s, | ||
7 | + app_d = e.globalData; | ||
3 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 8 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
4 | const { | 9 | const { |
5 | barcode, | 10 | barcode, |
@@ -12,69 +17,74 @@ Page({ | @@ -12,69 +17,74 @@ Page({ | ||
12 | * 页面的初始数据 | 17 | * 页面的初始数据 |
13 | */ | 18 | */ |
14 | data: { | 19 | data: { |
15 | - length:150, | ||
16 | - iurl: s.imghost, | ||
17 | - defaultAvatar:s.imghost+"/miniapp/images/no-head.jpg", | ||
18 | - userInfo:null, | ||
19 | - toji:null, //统计相关 | ||
20 | - txmon:0, | ||
21 | - byquan: 0, | ||
22 | - yuer: 0, | ||
23 | - currentPage:1, | ||
24 | - recommend_list:[], | ||
25 | - tc_hide: true, | ||
26 | - sw_index:0, | ||
27 | - qy_list:null, | ||
28 | - gradeId:null, | ||
29 | - is_init:0, | ||
30 | - cz_val:0, | ||
31 | - full_cz_val:0, | ||
32 | - is_dengji:0, //是不是等级 | ||
33 | - is_banner:0,//是不是有生日活动 | ||
34 | - giftbagid:"",//生日活动的类型 | ||
35 | - actId:"",//生日活动的id | ||
36 | - actImg:"", | ||
37 | - is_assistance:0,//助力活动 | 20 | + length: 150, |
21 | + iurl: s.imghost, | ||
22 | + defaultAvatar: s.imghost + "/miniapp/images/no-head.jpg", | ||
23 | + userInfo: null, | ||
24 | + toji: null, //统计相关 | ||
25 | + txmon: 0, | ||
26 | + byquan: 0, | ||
27 | + yuer: 0, | ||
28 | + currentPage: 1, | ||
29 | + recommend_list: [], | ||
30 | + tc_hide: true, | ||
31 | + sw_index: 0, | ||
32 | + qy_list: null, | ||
33 | + gradeId: null, | ||
34 | + is_init: 0, | ||
35 | + cz_val: 0, | ||
36 | + full_cz_val: 0, | ||
37 | + is_dengji: 0, //是不是等级 | ||
38 | + is_banner: 0, //是不是有生日活动 | ||
39 | + giftbagid: "", //生日活动的类型 | ||
40 | + actId: "", //生日活动的id | ||
41 | + actImg: "", | ||
42 | + is_assistance: 0, //助力活动 | ||
38 | }, | 43 | }, |
39 | - goto_nav: function (e) { | 44 | + goto_nav: function(e) { |
40 | var th = this; | 45 | var th = this; |
41 | var url = e.currentTarget.dataset.url; | 46 | var url = e.currentTarget.dataset.url; |
42 | if (th.data.userInfo != null) { | 47 | if (th.data.userInfo != null) { |
43 | getApp().goto(url); | 48 | getApp().goto(url); |
44 | } else { | 49 | } else { |
45 | - wx.navigateTo({ | ||
46 | - url: '/pages/getphone/getphone', | ||
47 | - }) | 50 | + wx.navigateTo({ |
51 | + url: '/pages/getphone/getphone', | ||
52 | + }) | ||
48 | } | 53 | } |
49 | }, | 54 | }, |
50 | /** | 55 | /** |
51 | * 生命周期函数--监听页面加载 | 56 | * 生命周期函数--监听页面加载 |
52 | */ | 57 | */ |
53 | - onLoad: function (options) { | ||
54 | - this.birthday(); | 58 | + onLoad: function(options) { |
59 | + this.birthday(); | ||
55 | }, | 60 | }, |
56 | 61 | ||
57 | /** | 62 | /** |
58 | * 生命周期函数--监听页面显示 | 63 | * 生命周期函数--监听页面显示 |
59 | */ | 64 | */ |
60 | - onShow: function () { | ||
61 | - | ||
62 | - this.is_assistance(); | ||
63 | - | 65 | + onShow: function() { |
66 | + | ||
67 | + this.is_assistance(); | ||
68 | + | ||
64 | var stoid = app_d.setting.stoid; | 69 | var stoid = app_d.setting.stoid; |
65 | - var s = this,th=s,need_money=0,cur_g_num=0; | 70 | + var s = this, |
71 | + th = s, | ||
72 | + need_money = 0, | ||
73 | + cur_g_num = 0; | ||
66 | getApp().get_isbuy(th.setappdata); | 74 | getApp().get_isbuy(th.setappdata); |
67 | - if(getApp().globalData.user_id) getApp().requestCardNum(); | 75 | + if (getApp().globalData.user_id) getApp().requestCardNum(); |
68 | /*------会员登录------*/ | 76 | /*------会员登录------*/ |
69 | - app.getUserFir(async function(e){ | ||
70 | - if(e!=undefined && e!=null && e.mobile){ | 77 | + app.getUserFir(async function(e) { |
78 | + if (e != undefined && e != null && e.mobile) { | ||
71 | s.setData({ | 79 | s.setData({ |
72 | userInfo: e | 80 | userInfo: e |
73 | }); | 81 | }); |
74 | /*-----统计-----*/ | 82 | /*-----统计-----*/ |
75 | - rq.get("/api/weshop/order/waitlist",{ | ||
76 | - data: { user_id: app_d.user_id}, | ||
77 | - success: function (su) { | 83 | + rq.get("/api/weshop/order/waitlist", { |
84 | + data: { | ||
85 | + user_id: app_d.user_id | ||
86 | + }, | ||
87 | + success: function(su) { | ||
78 | s.setData({ | 88 | s.setData({ |
79 | toji: su.data.data, | 89 | toji: su.data.data, |
80 | }); | 90 | }); |
@@ -82,114 +92,155 @@ Page({ | @@ -82,114 +92,155 @@ Page({ | ||
82 | }) | 92 | }) |
83 | /*-----获取线下会员的预存款和优惠券的数量-----*/ | 93 | /*-----获取线下会员的预存款和优惠券的数量-----*/ |
84 | rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + e.user_id, { | 94 | rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + e.user_id, { |
85 | - success: function (su) { | ||
86 | - var data=su.data.data; | 95 | + success: function(su) { |
96 | + var data = su.data.data; | ||
87 | data.cashcount = parseInt(data.cashcount); | 97 | data.cashcount = parseInt(data.cashcount); |
88 | - s.setData({ udata: data, }); | 98 | + s.setData({ |
99 | + udata: data, | ||
100 | + }); | ||
89 | } | 101 | } |
90 | }) | 102 | }) |
91 | /*-----获取会员提现金额-----*/ | 103 | /*-----获取会员提现金额-----*/ |
92 | rq.get("/api/weshop/withdrawals/summoney", { | 104 | rq.get("/api/weshop/withdrawals/summoney", { |
93 | - data: { user_id: e.user_id, store_id: os.stoid, status: 0 }, | ||
94 | - success: function (su) { | 105 | + data: { |
106 | + user_id: e.user_id, | ||
107 | + store_id: os.stoid, | ||
108 | + status: 0 | ||
109 | + }, | ||
110 | + success: function(su) { | ||
95 | if (su.data.code == 0) { | 111 | if (su.data.code == 0) { |
96 | var yuer = parseFloat(th.data.userInfo.user_money - | 112 | var yuer = parseFloat(th.data.userInfo.user_money - |
97 | - th.data.userInfo.frozen_money - su.data.data.summoney).toFixed(2); | ||
98 | - th.setData({ txmon: su.data.data.summoney, yuer: yuer }); | 113 | + th.data.userInfo.frozen_money - su.data.data.summoney).toFixed(2); |
114 | + th.setData({ | ||
115 | + txmon: su.data.data.summoney, | ||
116 | + yuer: yuer | ||
117 | + }); | ||
99 | } | 118 | } |
100 | } | 119 | } |
101 | }) | 120 | }) |
102 | 121 | ||
103 | /*-----获取会员包邮券的数量-----*/ | 122 | /*-----获取会员包邮券的数量-----*/ |
104 | rq.get("/api/weshop/userfeemail/page", { | 123 | rq.get("/api/weshop/userfeemail/page", { |
105 | - data: { user_id: e.user_id, store_id: os.stoid, pageSize:1,isuse:0}, | ||
106 | - success: function (su) { | 124 | + data: { |
125 | + user_id: e.user_id, | ||
126 | + store_id: os.stoid, | ||
127 | + pageSize: 1, | ||
128 | + isuse: 0 | ||
129 | + }, | ||
130 | + success: function(su) { | ||
107 | if (su.data.code == 0) { | 131 | if (su.data.code == 0) { |
108 | - th.setData({ byquan: parseInt(su.data.data.total)}); | 132 | + th.setData({ |
133 | + byquan: parseInt(su.data.data.total) | ||
134 | + }); | ||
109 | } | 135 | } |
110 | } | 136 | } |
111 | }) | 137 | }) |
112 | 138 | ||
113 | /*-----获取会员权益列表-----*/ | 139 | /*-----获取会员权益列表-----*/ |
114 | rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", { | 140 | rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", { |
115 | - data: { storeId: os.stoid,pageSize:100}, | ||
116 | - success: async function (res) { | ||
117 | - var arr_data=res.data.data.pageData; | ||
118 | - var gid=null,g_qy_list=null,cz_vals=0,need_money=0, | ||
119 | - backClass = null, is_init = 0, GradeName=''; | 141 | + data: { |
142 | + storeId: os.stoid, | ||
143 | + pageSize: 100 | ||
144 | + }, | ||
145 | + success: async function(res) { | ||
146 | + var arr_data = res.data.data.pageData; | ||
147 | + var gid = null, | ||
148 | + g_qy_list = null, | ||
149 | + cz_vals = 0, | ||
150 | + need_money = 0, | ||
151 | + backClass = null, | ||
152 | + is_init = 0, | ||
153 | + GradeName = ''; | ||
120 | 154 | ||
121 | //--初始化是否有打勾-- | 155 | //--初始化是否有打勾-- |
122 | await getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { | 156 | await getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { |
123 | - data: { storeId: os.stoid} | 157 | + data: { |
158 | + storeId: os.stoid | ||
159 | + } | ||
124 | }).then(res => { | 160 | }).then(res => { |
125 | - is_init=res.data.data.isBool; | 161 | + is_init = res.data.data.isBool; |
126 | }) | 162 | }) |
127 | 163 | ||
128 | //获取成长值 | 164 | //获取成长值 |
129 | - await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get",{ | ||
130 | - data:{ storeId:os.stoid,userId:app_d.user_id } | ||
131 | - }).then(res=>{ | ||
132 | - if (res.data.code == 0 && res.data.data){ | ||
133 | - gid=res.data.data.GradeId; | ||
134 | - var cz_val = res.data.data.GradeSum; | ||
135 | - cz_vals=parseInt(cz_val); | ||
136 | - GradeName=res.data.data.GradeName; | ||
137 | - } | ||
138 | - //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid}); | ||
139 | - }) | ||
140 | - var obj = { cz_val: cz_vals, GradeName:GradeName, is_init: is_init, gradeId: gid }; | ||
141 | - | ||
142 | - // 获取最大值 | ||
143 | - await getApp().request.promiseGet("/api/weshop/users/grade/vipgradeinfo/page", { | ||
144 | - data: { storeId: os.stoid } | ||
145 | - }).then(res => { | ||
146 | - if (res.data.data) | ||
147 | - backClass = res.data.data.pageData; | ||
148 | - if (backClass){ | ||
149 | - var full_cz_val = backClass[backClass.length - 1].BuyGradeSum; | ||
150 | - //th.setData({ full_cz_val: full_cz_val}); | ||
151 | - obj.full_cz_val = full_cz_val | ||
152 | - } | ||
153 | - }) | ||
154 | - | ||
155 | - //--会员权益中心页的修改-- | ||
156 | - for(var i in backClass){ | ||
157 | - var im=backClass[i]; | ||
158 | - if(cz_vals<im.BuyGradeSum && need_money==0){ | ||
159 | - need_money=im.BuyGradeSum; | ||
160 | - obj.need_money = need_money; | ||
161 | - } | 165 | + await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get", { |
166 | + data: { | ||
167 | + storeId: os.stoid, | ||
168 | + userId: app_d.user_id | ||
169 | + } | ||
170 | + }).then(res => { | ||
171 | + if (res.data.code == 0 && res.data.data) { | ||
172 | + gid = res.data.data.GradeId; | ||
173 | + var cz_val = res.data.data.GradeSum; | ||
174 | + cz_vals = parseInt(cz_val); | ||
175 | + GradeName = res.data.data.GradeName; | ||
162 | } | 176 | } |
177 | + //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid}); | ||
178 | + }) | ||
179 | + var obj = { | ||
180 | + cz_val: cz_vals, | ||
181 | + GradeName: GradeName, | ||
182 | + is_init: is_init, | ||
183 | + gradeId: gid | ||
184 | + }; | ||
185 | + | ||
186 | + // 获取最大值 | ||
187 | + await getApp().request.promiseGet("/api/weshop/users/grade/vipgradeinfo/page", { | ||
188 | + data: { | ||
189 | + storeId: os.stoid | ||
190 | + } | ||
191 | + }).then(res => { | ||
192 | + if (res.data.data) | ||
193 | + backClass = res.data.data.pageData; | ||
194 | + if (backClass) { | ||
195 | + var full_cz_val = backClass[backClass.length - 1].BuyGradeSum; | ||
196 | + //th.setData({ full_cz_val: full_cz_val}); | ||
197 | + obj.full_cz_val = full_cz_val | ||
198 | + } | ||
199 | + }) | ||
163 | 200 | ||
164 | - //获取当前等级的特权 | ||
165 | - await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page",{ | ||
166 | - data: { storeId: os.stoid, GradeId: gid, userId: app_d.user_id, pageSize: 100} | ||
167 | - }).then(res=>{ | ||
168 | - if (res.data.data) | ||
169 | - g_qy_list=res.data.data.pageData; | ||
170 | - }); | 201 | + //--会员权益中心页的修改-- |
202 | + for (var i in backClass) { | ||
203 | + var im = backClass[i]; | ||
204 | + if (cz_vals < im.BuyGradeSum && need_money == 0) { | ||
205 | + need_money = im.BuyGradeSum; | ||
206 | + obj.need_money = need_money; | ||
207 | + } | ||
208 | + } | ||
171 | 209 | ||
172 | - for(var i in arr_data){ | ||
173 | - var item=arr_data[i]; | ||
174 | - var FromId=th.check_is_has_qy(item,g_qy_list); | ||
175 | - arr_data[i].ishas=0; | ||
176 | - if(FromId){ | ||
177 | - arr_data[i].ishas=1; | ||
178 | - arr_data[i].FromId=FromId; | ||
179 | - } | 210 | + //获取当前等级的特权 |
211 | + await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page", { | ||
212 | + data: { | ||
213 | + storeId: os.stoid, | ||
214 | + GradeId: gid, | ||
215 | + userId: app_d.user_id, | ||
216 | + pageSize: 100 | ||
180 | } | 217 | } |
181 | - arr_data.sort(function(a,b){ | ||
182 | - return b.ishas-a.ishas | ||
183 | - }) | 218 | + }).then(res => { |
219 | + if (res.data.data) | ||
220 | + g_qy_list = res.data.data.pageData; | ||
221 | + }); | ||
184 | 222 | ||
185 | - //4个4个一组 | ||
186 | - var arr = new Array(); | ||
187 | - for(var i=0;i< arr_data.length;i+=4){ | ||
188 | - arr.push(arr_data.slice(i,i+4)); | 223 | + for (var i in arr_data) { |
224 | + var item = arr_data[i]; | ||
225 | + var FromId = th.check_is_has_qy(item, g_qy_list); | ||
226 | + arr_data[i].ishas = 0; | ||
227 | + if (FromId) { | ||
228 | + arr_data[i].ishas = 1; | ||
229 | + arr_data[i].FromId = FromId; | ||
189 | } | 230 | } |
190 | - //th.setData({ qy_list: arr, need_money: need_money}); | ||
191 | - obj.qy_list=arr; | ||
192 | - th.setData(obj); | 231 | + } |
232 | + arr_data.sort(function(a, b) { | ||
233 | + return b.ishas - a.ishas | ||
234 | + }) | ||
235 | + | ||
236 | + //4个4个一组 | ||
237 | + var arr = new Array(); | ||
238 | + for (var i = 0; i < arr_data.length; i += 4) { | ||
239 | + arr.push(arr_data.slice(i, i + 4)); | ||
240 | + } | ||
241 | + //th.setData({ qy_list: arr, need_money: need_money}); | ||
242 | + obj.qy_list = arr; | ||
243 | + th.setData(obj); | ||
193 | } | 244 | } |
194 | }) | 245 | }) |
195 | 246 | ||
@@ -197,21 +248,31 @@ Page({ | @@ -197,21 +248,31 @@ Page({ | ||
197 | th.requestRecommend(); | 248 | th.requestRecommend(); |
198 | 249 | ||
199 | /*-------系统是否开通等级卡,会员是等级卡-----*/ | 250 | /*-------系统是否开通等级卡,会员是等级卡-----*/ |
200 | - getApp().getConfig2(function (e) { | ||
201 | - var t_swi=e.switch_list; | ||
202 | - if(t_swi) t_swi=JSON.parse(t_swi) | ||
203 | - if(parseInt(t_swi.rank_switch)==2){ | ||
204 | - var userInfo=th.data.userInfo; | ||
205 | - if(userInfo.card_field!=null && userInfo.card_field!=undefined && userInfo.card_field!="" ){ | ||
206 | - var now=ut.gettimestamp(); | ||
207 | - var str= userInfo.card_expiredate; | ||
208 | - var end = new Date(str); | ||
209 | - end = Date.parse(end) / 1000; | ||
210 | - //---判断是不是有过期--- | ||
211 | - if(now<end){ th.setData({is_dengji:1}) }else{ th.setData({is_dengji:3}) } | ||
212 | - }else{ | ||
213 | - th.setData({is_dengji:2}) | 251 | + getApp().getConfig2(function(e) { |
252 | + var t_swi = e.switch_list; | ||
253 | + if (t_swi) t_swi = JSON.parse(t_swi) | ||
254 | + if (parseInt(t_swi.rank_switch) == 2) { | ||
255 | + var userInfo = th.data.userInfo; | ||
256 | + if (userInfo.card_field != null && userInfo.card_field != undefined && userInfo.card_field != "") { | ||
257 | + var now = ut.gettimestamp(); | ||
258 | + var str = userInfo.card_expiredate; | ||
259 | + var end = new Date(str); | ||
260 | + end = Date.parse(end) / 1000; | ||
261 | + //---判断是不是有过期--- | ||
262 | + if (now < end) { | ||
263 | + th.setData({ | ||
264 | + is_dengji: 1 | ||
265 | + }) | ||
266 | + } else { | ||
267 | + th.setData({ | ||
268 | + is_dengji: 3 | ||
269 | + }) | ||
214 | } | 270 | } |
271 | + } else { | ||
272 | + th.setData({ | ||
273 | + is_dengji: 2 | ||
274 | + }) | ||
275 | + } | ||
215 | } | 276 | } |
216 | }) | 277 | }) |
217 | 278 | ||
@@ -228,12 +289,12 @@ Page({ | @@ -228,12 +289,12 @@ Page({ | ||
228 | }, | 289 | }, |
229 | 290 | ||
230 | //判断会员是后有改服务项目 | 291 | //判断会员是后有改服务项目 |
231 | - check_is_has_qy:function(item,g_qy_list){ | ||
232 | - if(!g_qy_list) return false; | 292 | + check_is_has_qy: function(item, g_qy_list) { |
293 | + if (!g_qy_list) return false; | ||
233 | 294 | ||
234 | - for(var i in g_qy_list){ | ||
235 | - var iter=g_qy_list[i]; | ||
236 | - if(iter.FormId==item.Id) return g_qy_list[i].FormId; | 295 | + for (var i in g_qy_list) { |
296 | + var iter = g_qy_list[i]; | ||
297 | + if (iter.FormId == item.Id) return g_qy_list[i].FormId; | ||
237 | } | 298 | } |
238 | return false; | 299 | return false; |
239 | }, | 300 | }, |
@@ -241,8 +302,8 @@ Page({ | @@ -241,8 +302,8 @@ Page({ | ||
241 | /** | 302 | /** |
242 | * 生命周期函数--监听页面隐藏 | 303 | * 生命周期函数--监听页面隐藏 |
243 | */ | 304 | */ |
244 | - onHide: function () {}, | ||
245 | - setappdata: function (t) { | 305 | + onHide: function() {}, |
306 | + setappdata: function(t) { | ||
246 | if (t.isout == 1) | 307 | if (t.isout == 1) |
247 | wx.navigateTo({ | 308 | wx.navigateTo({ |
248 | url: "/pages/error/error?msg=小程序已经过期", | 309 | url: "/pages/error/error?msg=小程序已经过期", |
@@ -256,70 +317,72 @@ Page({ | @@ -256,70 +317,72 @@ Page({ | ||
256 | /** | 317 | /** |
257 | * 页面上拉触底事件的处理函数 | 318 | * 页面上拉触底事件的处理函数 |
258 | */ | 319 | */ |
259 | - onReachBottom: function () { | 320 | + onReachBottom: function() { |
260 | //!this.nomore && this.requestRecommend(); | 321 | //!this.nomore && this.requestRecommend(); |
261 | - var goods_list = this.selectComponent("#goods_recommend"); //组件的id | 322 | + var goods_list = this.selectComponent("#goods_recommend"); //组件的id |
262 | goods_list.init(); | 323 | goods_list.init(); |
263 | - setTimeout(function () { goods_list.get_list(); }, 300) | 324 | + setTimeout(function() { |
325 | + goods_list.get_list(); | ||
326 | + }, 300) | ||
264 | }, | 327 | }, |
265 | 328 | ||
266 | /** | 329 | /** |
267 | * 用户点击右上角分享 | 330 | * 用户点击右上角分享 |
268 | */ | 331 | */ |
269 | - onShareAppMessage: function () {}, | 332 | + onShareAppMessage: function() {}, |
270 | 333 | ||
271 | //------卡片的显示和关闭-------- | 334 | //------卡片的显示和关闭-------- |
272 | - show_tc:function(){ | ||
273 | - if(!this.data.userInfo) return false; | ||
274 | - qrcode('qrcode',this.data.userInfo.mobile, 480, 480,this); | 335 | + show_tc: function() { |
336 | + if (!this.data.userInfo) return false; | ||
337 | + qrcode('qrcode', this.data.userInfo.mobile, 480, 480, this); | ||
275 | this.setData({ | 338 | this.setData({ |
276 | - tc_hide:false, | 339 | + tc_hide: false, |
277 | }); | 340 | }); |
278 | }, | 341 | }, |
279 | - hide_tc:function(){ | 342 | + hide_tc: function() { |
280 | this.setData({ | 343 | this.setData({ |
281 | tc_hide: true, | 344 | tc_hide: true, |
282 | }); | 345 | }); |
283 | }, | 346 | }, |
284 | 347 | ||
285 | //--跳转到预存款页面-- | 348 | //--跳转到预存款页面-- |
286 | - deposit: function () { | ||
287 | - if(!this.data.userInfo) return false; | ||
288 | - wx.navigateTo({ | ||
289 | - url: '../deposit/deposit', | ||
290 | - }) | 349 | + deposit: function() { |
350 | + if (!this.data.userInfo) return false; | ||
351 | + wx.navigateTo({ | ||
352 | + url: '../deposit/deposit', | ||
353 | + }) | ||
291 | }, | 354 | }, |
292 | //--跳转到余额页面-- | 355 | //--跳转到余额页面-- |
293 | - balance: function () { | ||
294 | - if(!this.data.userInfo) return false; | 356 | + balance: function() { |
357 | + if (!this.data.userInfo) return false; | ||
295 | wx.navigateTo({ | 358 | wx.navigateTo({ |
296 | url: '../member/menber', | 359 | url: '../member/menber', |
297 | }) | 360 | }) |
298 | }, | 361 | }, |
299 | //--跳转到优惠券-- | 362 | //--跳转到优惠券-- |
300 | - coupon: function () { | ||
301 | - if(!this.data.userInfo) return false; | 363 | + coupon: function() { |
364 | + if (!this.data.userInfo) return false; | ||
302 | wx.navigateTo({ | 365 | wx.navigateTo({ |
303 | url: '../coupons/coupons', | 366 | url: '../coupons/coupons', |
304 | }) | 367 | }) |
305 | }, | 368 | }, |
306 | //--跳转到积分-- | 369 | //--跳转到积分-- |
307 | - integral: function () { | ||
308 | - if(!this.data.userInfo) return false; | 370 | + integral: function() { |
371 | + if (!this.data.userInfo) return false; | ||
309 | wx.navigateTo({ | 372 | wx.navigateTo({ |
310 | url: '../integral/integral', | 373 | url: '../integral/integral', |
311 | }) | 374 | }) |
312 | }, | 375 | }, |
313 | //--跳到绑定页面-- | 376 | //--跳到绑定页面-- |
314 | - gobindtel:function(){ | 377 | + gobindtel: function() { |
315 | wx.navigateTo({ | 378 | wx.navigateTo({ |
316 | url: '/pages/getphone/getphone', | 379 | url: '/pages/getphone/getphone', |
317 | }) | 380 | }) |
318 | }, | 381 | }, |
319 | 382 | ||
320 | - go_order:function (e) { | ||
321 | - if(!this.data.userInfo) return false; | ||
322 | - var url=e.currentTarget.dataset.url; | 383 | + go_order: function(e) { |
384 | + if (!this.data.userInfo) return false; | ||
385 | + var url = e.currentTarget.dataset.url; | ||
323 | wx.navigateTo({ | 386 | wx.navigateTo({ |
324 | url: url, | 387 | url: url, |
325 | }) | 388 | }) |
@@ -327,53 +390,70 @@ Page({ | @@ -327,53 +390,70 @@ Page({ | ||
327 | }, | 390 | }, |
328 | 391 | ||
329 | //--加载更多商品-- | 392 | //--加载更多商品-- |
330 | - requestRecommend: function () { | ||
331 | - var e = this, t = '/api/weshop/goods/page?page=' + e.data.currentPage; | ||
332 | - var th_recommend_list=e.data.recommend_list; | ||
333 | - getApp().request.get(t,{ | ||
334 | - data: { is_mainshow: 1, isonsale: 1, is_recommend:1, is_on_sale: 1, store_id: os.stoid, pageSize: 10 }, | ||
335 | - success:function (ee) { | ||
336 | - var recommend_list=ee.data.data.pageData; | ||
337 | - if(recommend_list && recommend_list.length>0){ | ||
338 | - var dd=[...th_recommend_list,...recommend_list]; | ||
339 | - e.setData({recommend_list,dd}); | ||
340 | - e.data.currentPage++; | ||
341 | - }else{ | ||
342 | - e.setData({nomore:1}); | ||
343 | - } | ||
344 | - } | 393 | + requestRecommend: function() { |
394 | + var e = this, | ||
395 | + t = '/api/weshop/goods/page?page=' + e.data.currentPage; | ||
396 | + var th_recommend_list = e.data.recommend_list; | ||
397 | + getApp().request.get(t, { | ||
398 | + data: { | ||
399 | + is_mainshow: 1, | ||
400 | + isonsale: 1, | ||
401 | + is_recommend: 1, | ||
402 | + is_on_sale: 1, | ||
403 | + store_id: os.stoid, | ||
404 | + pageSize: 10 | ||
405 | + }, | ||
406 | + success: function(ee) { | ||
407 | + var recommend_list = ee.data.data.pageData; | ||
408 | + if (recommend_list && recommend_list.length > 0) { | ||
409 | + var dd = [...th_recommend_list, ...recommend_list]; | ||
410 | + e.setData({ | ||
411 | + recommend_list, | ||
412 | + dd | ||
413 | + }); | ||
414 | + e.data.currentPage++; | ||
415 | + } else { | ||
416 | + e.setData({ | ||
417 | + nomore: 1 | ||
418 | + }); | ||
419 | + } | ||
420 | + } | ||
345 | }) | 421 | }) |
346 | }, | 422 | }, |
347 | 423 | ||
348 | //--跳转到权益页面-- | 424 | //--跳转到权益页面-- |
349 | - go_qy:function () { | ||
350 | - if(!this.data.userInfo) return false; | ||
351 | - var url="/pages/user/userqy/userqy"; | 425 | + go_qy: function() { |
426 | + if (!this.data.userInfo) return false; | ||
427 | + var url = "/pages/user/userqy/userqy"; | ||
352 | getApp().goto(url); | 428 | getApp().goto(url); |
353 | }, | 429 | }, |
354 | 430 | ||
355 | //--跳转到商品详情页面-- | 431 | //--跳转到商品详情页面-- |
356 | - go_goods:function (e) { | ||
357 | - var gid=e.currentTarget.dataset.gid; | ||
358 | - var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+gid; | 432 | + go_goods: function(e) { |
433 | + var gid = e.currentTarget.dataset.gid; | ||
434 | + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; | ||
359 | getApp().goto(url); | 435 | getApp().goto(url); |
360 | }, | 436 | }, |
361 | 437 | ||
362 | - click_next:function(){ | ||
363 | - var index=this.data.sw_index; | 438 | + click_next: function() { |
439 | + var index = this.data.sw_index; | ||
364 | index++; | 440 | index++; |
365 | - if(index>=this.data.qy_list.length) return; | ||
366 | - this.setData({ sw_index:index}) | 441 | + if (index >= this.data.qy_list.length) return; |
442 | + this.setData({ | ||
443 | + sw_index: index | ||
444 | + }) | ||
367 | }, | 445 | }, |
368 | 446 | ||
369 | - click_pre:function(){ | ||
370 | - var index=this.data.sw_index; | 447 | + click_pre: function() { |
448 | + var index = this.data.sw_index; | ||
371 | index--; | 449 | index--; |
372 | - if(index<0) return; | ||
373 | - this.setData({ sw_index:index}) | 450 | + if (index < 0) return; |
451 | + this.setData({ | ||
452 | + sw_index: index | ||
453 | + }) | ||
374 | }, | 454 | }, |
375 | 455 | ||
376 | - onSli:function(e){ | 456 | + onSli: function(e) { |
377 | var that = this; | 457 | var that = this; |
378 | that.setData({ | 458 | that.setData({ |
379 | sw_index: e.detail.current | 459 | sw_index: e.detail.current |
@@ -381,40 +461,51 @@ Page({ | @@ -381,40 +461,51 @@ Page({ | ||
381 | }, | 461 | }, |
382 | 462 | ||
383 | //--权益使用-- | 463 | //--权益使用-- |
384 | - go_qy_url:function (e) { | ||
385 | - var th=this; | ||
386 | - var no=e.currentTarget.dataset.no; | ||
387 | - var ind=e.currentTarget.dataset.ind; | ||
388 | - var find=e.currentTarget.dataset.find; | ||
389 | - var item=th.data.qy_list[find][ind]; | ||
390 | - if(item.ishas==undefined || !item.ishas){ | 464 | + go_qy_url: function(e) { |
465 | + var th = this; | ||
466 | + var no = e.currentTarget.dataset.no; | ||
467 | + var ind = e.currentTarget.dataset.ind; | ||
468 | + var find = e.currentTarget.dataset.find; | ||
469 | + var item = th.data.qy_list[find][ind]; | ||
470 | + if (item.ishas == undefined || !item.ishas) { | ||
391 | var qt_txt = th.selectComponent("#pop_txt"); //组件的id | 471 | var qt_txt = th.selectComponent("#pop_txt"); //组件的id |
392 | - var ob={title:"温馨提示",content:"当前会员暂无此权益"}; | 472 | + var ob = { |
473 | + title: "温馨提示", | ||
474 | + content: "当前会员暂无此权益" | ||
475 | + }; | ||
393 | qt_txt.open(ob); | 476 | qt_txt.open(ob); |
394 | return false; | 477 | return false; |
395 | } | 478 | } |
396 | 479 | ||
397 | - var url=e.currentTarget.dataset.img; | 480 | + var url = e.currentTarget.dataset.img; |
398 | 481 | ||
399 | switch (no) { | 482 | switch (no) { |
400 | case "01": | 483 | case "01": |
401 | - getApp().goto("/pages/user/user_coupon/user_coupon?img=" | ||
402 | - +url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); | 484 | + getApp().goto("/pages/user/user_coupon/user_coupon?img=" + |
485 | + url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); | ||
403 | break; | 486 | break; |
404 | case "02": | 487 | case "02": |
405 | - getApp().goto("/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id); | 488 | + getApp().goto("/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); |
406 | break; | 489 | break; |
407 | case "03": | 490 | case "03": |
408 | getApp().goto("/pages/user/user_spsy/user_spsy"); | 491 | getApp().goto("/pages/user/user_spsy/user_spsy"); |
409 | break; | 492 | break; |
410 | case "10": | 493 | case "10": |
411 | - getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get",{ | ||
412 | - data:{storeId:os.stoid, formId:item.Id,userId:getApp().globalData.user_id,gradeId:th.data.gradeId}, | ||
413 | - success:function (res) { | ||
414 | - var val=res.data.data.Remark; | ||
415 | - var title=res.data.data.PrivilegeName; | 494 | + getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get", { |
495 | + data: { | ||
496 | + storeId: os.stoid, | ||
497 | + formId: item.Id, | ||
498 | + userId: getApp().globalData.user_id, | ||
499 | + gradeId: th.data.gradeId | ||
500 | + }, | ||
501 | + success: function(res) { | ||
502 | + var val = res.data.data.Remark; | ||
503 | + var title = res.data.data.PrivilegeName; | ||
416 | var qt_txt = th.selectComponent("#pop_txt"); //组件的id | 504 | var qt_txt = th.selectComponent("#pop_txt"); //组件的id |
417 | - var ob={title:title,content:val}; | 505 | + var ob = { |
506 | + title: title, | ||
507 | + content: val | ||
508 | + }; | ||
418 | qt_txt.open(ob); | 509 | qt_txt.open(ob); |
419 | } | 510 | } |
420 | }) | 511 | }) |
@@ -423,88 +514,94 @@ Page({ | @@ -423,88 +514,94 @@ Page({ | ||
423 | }, | 514 | }, |
424 | 515 | ||
425 | //跳转到链接 | 516 | //跳转到链接 |
426 | - goto:function (e) { | ||
427 | - var url=e.currentTarget.dataset.url; | ||
428 | - getApp().goto(url); | 517 | + goto: function(e) { |
518 | + var url = e.currentTarget.dataset.url; | ||
519 | + getApp().goto(url); | ||
429 | }, | 520 | }, |
430 | 521 | ||
431 | //---------联系客服------------ | 522 | //---------联系客服------------ |
432 | contactService: function() { | 523 | contactService: function() { |
433 | - var s=getApp(); | 524 | + var s = getApp(); |
434 | s.getConfig(function(t) { | 525 | s.getConfig(function(t) { |
435 | - if(t.store_tel==undefined){ | ||
436 | - getApp().request.get("/api/weshop/store/get/" + os.stoid,{ | ||
437 | - isShowLoading:1, | ||
438 | - data:{}, | ||
439 | - success:function (rs) { | 526 | + if (t.store_tel == undefined) { |
527 | + getApp().request.get("/api/weshop/store/get/" + os.stoid, { | ||
528 | + isShowLoading: 1, | ||
529 | + data: {}, | ||
530 | + success: function(rs) { | ||
440 | getApp().globalData.config = rs.data.data; | 531 | getApp().globalData.config = rs.data.data; |
441 | - if(rs.data.data.store_tel==null && rs.data.data.store_tel==undefined ){ | 532 | + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { |
442 | getApp().showWarning("商家未设置电话"); | 533 | getApp().showWarning("商家未设置电话"); |
443 | return false; | 534 | return false; |
444 | } | 535 | } |
445 | s.confirmBox("请联系客服:" + rs.data.data.store_tel); | 536 | s.confirmBox("请联系客服:" + rs.data.data.store_tel); |
446 | } | 537 | } |
447 | }) | 538 | }) |
448 | - }else{ | 539 | + } else { |
449 | s.confirmBox("请联系客服:" + t.store_tel); | 540 | s.confirmBox("请联系客服:" + t.store_tel); |
450 | } | 541 | } |
451 | }); | 542 | }); |
452 | }, | 543 | }, |
453 | 544 | ||
454 | - go_info:function () { | ||
455 | - getApp().goto("/pages/user/userinfo/userinfo"); | 545 | + go_info: function() { |
546 | + getApp().goto("/pages/user/userinfo/userinfo"); | ||
456 | }, | 547 | }, |
457 | 548 | ||
458 | - jump: function () { | 549 | + jump: function() { |
459 | getApp().goto("/pages/user/grow_value/grow_value") | 550 | getApp().goto("/pages/user/grow_value/grow_value") |
460 | }, | 551 | }, |
461 | // 判断生日营销的页面是不是存在 | 552 | // 判断生日营销的页面是不是存在 |
462 | - birthday:function(){ | 553 | + birthday: function() { |
554 | + | ||
463 | var th = this; | 555 | var th = this; |
464 | - // rq.get("/api/weshop/marketing/birthday/act/judge", { | ||
465 | - // data: { storeId: os.stoid, userId: app_d.user_id }, | ||
466 | - // success: function (res) { | ||
467 | - // var code = res.data.code; | ||
468 | - // if (code == 0) { | ||
469 | - // var giftbagid = res.data.data.giftBagId; | ||
470 | - // var actId = res.data.data.id; | ||
471 | - // var actImg = res.data.data.actImg; | ||
472 | - // t.setData({ giftbagid: giftbagid, actId: actId, actImg: actImg }); | ||
473 | - // t.setData({ is_banner: 1 }); | ||
474 | - // } | ||
475 | - | ||
476 | - // } | ||
477 | - // }) | 556 | + rq.get("/api/weshop/marketing/birthday/act/judge", { |
557 | + data: { storeId: os.stoid, userId: app_d.user_id }, | ||
558 | + success: function (res) { | ||
559 | + | ||
560 | + var code = res.data.code; | ||
561 | + if (code == 0) { | ||
562 | + var giftbagid = res.data.data.giftBagId; | ||
563 | + var actId = res.data.data.id; | ||
564 | + var actImg = res.data.data.actImg; | ||
565 | + th.setData({ giftbagid: giftbagid, actId: actId, actImg: actImg }); | ||
566 | + th.setData({is_banner:1}); | ||
567 | + } | ||
568 | + | ||
569 | + } | ||
570 | + }) | ||
478 | 571 | ||
479 | 572 | ||
480 | }, | 573 | }, |
481 | - clike_banne:function(){ | 574 | + clike_banne: function() { |
482 | var th = this; | 575 | var th = this; |
483 | - var actId=th.data.actId; | ||
484 | - var giftbagid=th.data.giftbagid; | ||
485 | - if (actId != "" && giftbagid!=""){ | ||
486 | - | ||
487 | - wx.redirectTo({ | ||
488 | - url: "/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3 | ||
489 | - }); | ||
490 | - }else{ | 576 | + var actId = th.data.actId; |
577 | + var giftbagid = th.data.giftbagid; | ||
491 | 578 | ||
492 | - getApp().showWarning("请稍后重试"); | 579 | + if (actId != "" && giftbagid != "") { |
580 | + | ||
581 | + getApp().goto("/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3); | ||
582 | + } else { | ||
583 | + | ||
584 | + getApp().showWarning("请稍后重试"); | ||
493 | } | 585 | } |
494 | }, | 586 | }, |
495 | // 判断助力活动是不是存在 | 587 | // 判断助力活动是不是存在 |
496 | - is_assistance:function(){ | ||
497 | - // var th = this; | ||
498 | - // rq.get("/api/weshop/marketing/help/act/judge", { | ||
499 | - // data: { storeId: os.stoid, userId: app_d.user_id }, | ||
500 | - // success: function (res) { | ||
501 | - // var code = res.data.code; | ||
502 | - // if (code == 0) { | ||
503 | - // th.setData({ is_assistance:1}); | ||
504 | - // } | ||
505 | - | ||
506 | - // } | ||
507 | - // }) | 588 | + is_assistance: function() { |
589 | + var th = this; | ||
590 | + rq.get("/api/weshop/marketing/help/act/judge", { | ||
591 | + data: { | ||
592 | + storeId: os.stoid, | ||
593 | + userId: app_d.user_id | ||
594 | + }, | ||
595 | + success: function(res) { | ||
596 | + var code = res.data.code; | ||
597 | + if (code == 0) { | ||
598 | + th.setData({ | ||
599 | + is_assistance: 1 | ||
600 | + }); | ||
601 | + } | ||
602 | + | ||
603 | + } | ||
604 | + }) | ||
508 | } | 605 | } |
509 | 606 | ||
510 | 607 |
pages/user/index/index.wxml
1 | <view class="xc-page"> | 1 | <view class="xc-page"> |
2 | <view class="xc-user"> | 2 | <view class="xc-user"> |
3 | - <view class="xc-head rel"> | 3 | + <view class="xc-head rel"> |
4 | <image class="xc-background" src="{{iurl}}/miniapp/images/user_index_powder.jpg"> | 4 | <image class="xc-background" src="{{iurl}}/miniapp/images/user_index_powder.jpg"> |
5 | <view class="flex-space-between abs xc-user-frame"> | 5 | <view class="flex-space-between abs xc-user-frame"> |
6 | <view class="xc-user-left flex" wx:if="{{userInfo}}"> | 6 | <view class="xc-user-left flex" wx:if="{{userInfo}}"> |
@@ -168,7 +168,7 @@ | @@ -168,7 +168,7 @@ | ||
168 | </view> | 168 | </view> |
169 | <!-- 生日营销 is_banner--> | 169 | <!-- 生日营销 is_banner--> |
170 | <block wx:if="{{is_banner}}"> | 170 | <block wx:if="{{is_banner}}"> |
171 | - <view class="t-c banner-frame" bindtap="clike_banne"> | 171 | + <view class="t-c banner-frame"bindtap="clike_banne"> |
172 | <image class="banner-img" src="{{actImg==''?iurl+'/miniapp/images/user/banner-img.jpg':iurl+actImg}}"> | 172 | <image class="banner-img" src="{{actImg==''?iurl+'/miniapp/images/user/banner-img.jpg':iurl+actImg}}"> |
173 | </image> | 173 | </image> |
174 | </view> | 174 | </view> |
pages/user/my_service/tment_eval.js
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | os = a, | 3 | os = a, |
4 | t = e.request, | 4 | t = e.request, |
5 | d = e.globalData; | 5 | d = e.globalData; |
6 | -Page({ | 6 | +Page({ |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * 页面的初始数据 | 9 | * 页面的初始数据 |
@@ -23,7 +23,7 @@ Page({ | @@ -23,7 +23,7 @@ Page({ | ||
23 | arrangeTime: "", //服务日期 | 23 | arrangeTime: "", //服务日期 |
24 | is_evaluate: 0, //是否评价 | 24 | is_evaluate: 0, //是否评价 |
25 | EvaluateDatetime: "", //评价时间 | 25 | EvaluateDatetime: "", //评价时间 |
26 | - is_act:0, //是否能购获取图片 | 26 | + is_act:0, //是否能购获取图片 |
27 | actId:0, //活动ID | 27 | actId:0, //活动ID |
28 | giftBagId:0, //礼包ID | 28 | giftBagId:0, //礼包ID |
29 | 29 | ||
@@ -189,9 +189,10 @@ Page({ | @@ -189,9 +189,10 @@ Page({ | ||
189 | wx.hideLoading(); | 189 | wx.hideLoading(); |
190 | if (res.data.code == 0) { | 190 | if (res.data.code == 0) { |
191 | getApp().my_warnning("评价成功", 1, th); | 191 | getApp().my_warnning("评价成功", 1, th); |
192 | + var namber=th.data.number; | ||
192 | setTimeout(function() { | 193 | setTimeout(function() { |
193 | wx.redirectTo({ | 194 | wx.redirectTo({ |
194 | - url: "/pages/user/my_service/tment_order_list" | 195 | + url: "/pages/user/my_service/tment_eval?Number="+namber+"&evaluate="+1 |
195 | }); | 196 | }); |
196 | }, 2000); | 197 | }, 2000); |
197 | } else { | 198 | } else { |
@@ -248,8 +249,9 @@ Page({ | @@ -248,8 +249,9 @@ Page({ | ||
248 | 249 | ||
249 | var id=this.data.actId; | 250 | var id=this.data.actId; |
250 | var gifbagid = this.data.gifbagid; | 251 | var gifbagid = this.data.gifbagid; |
252 | + console.log(id,"订单", this.data.number), | ||
251 | wx.redirectTo({ | 253 | wx.redirectTo({ |
252 | - url: "/pages/giftpack/evaluategift/evaluategift?actId=" + id + "&gifbagid=&orderType=2&orderNumber="+this.data.number | 254 | + url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType=2&orderNumber="+this.data.number |
253 | }); | 255 | }); |
254 | 256 | ||
255 | }, | 257 | }, |
@@ -274,7 +276,11 @@ Page({ | @@ -274,7 +276,11 @@ Page({ | ||
274 | actId: id, | 276 | actId: id, |
275 | giftBagId: giftbagid | 277 | giftBagId: giftbagid |
276 | }) | 278 | }) |
277 | - } | 279 | + } else{ |
280 | + th.setData({ | ||
281 | + is_act:0 | ||
282 | + }) | ||
283 | + } | ||
278 | }) | 284 | }) |
279 | }, | 285 | }, |
280 | 286 |
pages/user/my_service/tment_eval.wxml
@@ -98,7 +98,7 @@ | @@ -98,7 +98,7 @@ | ||
98 | <view>评价其他</view> | 98 | <view>评价其他</view> |
99 | </view> | 99 | </view> |
100 | 100 | ||
101 | - <view wx:if="{{is_act}}" style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb"> | 101 | + <view wx:if="{{is_act==1}}" style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb"> |
102 | <view>点击领取礼品</view> | 102 | <view>点击领取礼品</view> |
103 | </view> | 103 | </view> |
104 | </view> | 104 | </view> |