Showing
13 changed files
with
272 additions
and
117 deletions
images/code_bg.png
0 → 100644
5.96 KB
images/machine.png
0 → 100644
62.2 KB
1 | -export const API_HOST = 'https://api.yoho.cn'; | ||
2 | -export const SERVICE_HOST = 'https://api.yoho.cn'; | 1 | +//export const API_HOST = 'https://api.yoho.cn'; |
2 | +//export const SERVICE_HOST = 'https://api.yoho.cn'; | ||
3 | export const APP_REPORT_HOST = 'https://app.yoho.cn/collect/v3'; | 3 | export const APP_REPORT_HOST = 'https://app.yoho.cn/collect/v3'; |
4 | export const LOG_EVENT_HOST = 'https://analysis.yohobuy.com/yas_mobile'; | 4 | export const LOG_EVENT_HOST = 'https://analysis.yohobuy.com/yas_mobile'; |
5 | 5 | ||
6 | // export const ACTIVITY_HOST = 'http://192.168.102.49:6006'; | 6 | // export const ACTIVITY_HOST = 'http://192.168.102.49:6006'; |
7 | // export const ACTIVITY_HOST = 'http://172.16.10.53:6006' | 7 | // export const ACTIVITY_HOST = 'http://172.16.10.53:6006' |
8 | -// export const ACTIVITY_HOST = 'http://yoho-activity-platform.test3.ingress.dev.yohocorp.com'; | 8 | +//export const ACTIVITY_HOST = 'http://yoho-activity-platform.test3.ingress.dev.yohocorp.com'; |
9 | export const ACTIVITY_HOST = 'https://action.yoho.cn'; | 9 | export const ACTIVITY_HOST = 'https://action.yoho.cn'; |
10 | 10 | ||
11 | // export const API_HOST = 'http://dev-api.yohops.com:9999'; | 11 | // export const API_HOST = 'http://dev-api.yohops.com:9999'; |
@@ -14,8 +14,8 @@ export const ACTIVITY_HOST = 'https://action.yoho.cn'; | @@ -14,8 +14,8 @@ export const ACTIVITY_HOST = 'https://action.yoho.cn'; | ||
14 | // export const API_HOST = 'http://api-test1.yohops.com:9999'; | 14 | // export const API_HOST = 'http://api-test1.yohops.com:9999'; |
15 | // export const SERVICE_HOST = 'http://api-test1.yohops.com:9999/'; | 15 | // export const SERVICE_HOST = 'http://api-test1.yohops.com:9999/'; |
16 | 16 | ||
17 | -// export const API_HOST = 'http://api-test3.dev.yohocorp.com'; | ||
18 | -// export const SERVICE_HOST = 'http://api-test3.dev.yohocorp.com'; | 17 | + export const API_HOST = 'http://api-test3.dev.yohocorp.com'; |
18 | + export const SERVICE_HOST = 'http://api-test3.dev.yohocorp.com'; | ||
19 | 19 | ||
20 | // export const API_HOST = 'http://api-test2.dev.yohocorp.com'; | 20 | // export const API_HOST = 'http://api-test2.dev.yohocorp.com'; |
21 | // export const SERVICE_HOST = 'http://api-test2.dev.yohocorp.com'; | 21 | // export const SERVICE_HOST = 'http://api-test2.dev.yohocorp.com'; |
@@ -7,9 +7,19 @@ Component({ | @@ -7,9 +7,19 @@ Component({ | ||
7 | }, | 7 | }, |
8 | avatars: { | 8 | avatars: { |
9 | type: Array | 9 | type: Array |
10 | + }, | ||
11 | + shareFlag: { | ||
12 | + type: Boolean, | ||
13 | + value: false, | ||
14 | + observer(value) { | ||
15 | + this.setData({show: value}) | ||
16 | + } | ||
10 | } | 17 | } |
11 | }, | 18 | }, |
12 | - ready:function() { | 19 | + data: { |
20 | + show: false | ||
21 | + }, | ||
22 | + ready: function () { | ||
13 | // console.log(`productdetail: ${this.properties.avatars}`) | 23 | // console.log(`productdetail: ${this.properties.avatars}`) |
14 | } | 24 | } |
15 | }); | 25 | }); |
1 | - | ||
2 | - <wxs src="./helper.wxs" module="helper" /> | ||
3 | - <view wx:if="{{product.status === 2}}"> | 1 | +<wxs src="./helper.wxs" module="helper"/> |
2 | +<view wx:if="{{product.status === 2}}" hidden="{{ show }}"> | ||
4 | <view class="countdown_label"> | 3 | <view class="countdown_label"> |
5 | - <text class="countdown_labeltext">抽奖</text> | ||
6 | - <text class="countdown_labeltext">倒计时</text> | ||
7 | - </view> | ||
8 | - | ||
9 | - <time-countdown class="product_countdown" wx:if="{{product.status === 2}}" endTime="{{product.end_time}}"></time-countdown> | 4 | + <text class="countdown_labeltext">抽奖</text> |
5 | + <text class="countdown_labeltext">倒计时</text> | ||
10 | </view> | 6 | </view> |
11 | 7 | ||
8 | + <time-countdown class="product_countdown" wx:if="{{product.status === 2}}" | ||
9 | + endTime="{{product.end_time}}"></time-countdown> | ||
10 | +</view> | ||
11 | + | ||
12 | 12 | ||
13 | - <view class="avatarcontainer"> | ||
14 | - <view class="avatars" wx:if="{{product.status === 2 && avatars.length > 0}}"> | 13 | +<view class="avatarcontainer"> |
14 | + <view class="avatars" wx:if="{{product.status === 2 && avatars.length > 0 && !show}}"> | ||
15 | <avatars list="{{avatars}}"></avatars> | 15 | <avatars list="{{avatars}}"></avatars> |
16 | </view> | 16 | </view> |
17 | <image class="product_image" src="{{product.cover_img}}"></image> | 17 | <image class="product_image" src="{{product.cover_img}}"></image> |
18 | 18 | ||
19 | +</view> | ||
20 | +<view class="product_name">{{product.name}}</view> | ||
21 | +<view class="product_lucky_bg"> | ||
22 | + <view class="product_lucky"> | ||
23 | + <text>抽奖价 ¥ | ||
24 | + <text class="lucky">0</text> | ||
25 | + </text> | ||
19 | </view> | 26 | </view> |
20 | - <view class="product_name" >{{product.name}}</view> | ||
21 | - <view class="product_lucky_bg"> | ||
22 | - <view class="product_lucky"><text>抽奖价 ¥ <text class="lucky">0</text></text></view> | ||
23 | - <view class="product_price" >{{product.price}}</view> | ||
24 | - </view> | ||
25 | - <view wx:if="{{product.status !== 2}}" class="product_time">{{helper.formatTime(product.start_time, product.end_time)}}</view> | ||
26 | - <view class="product_margin"></view> | ||
27 | + <view class="product_price">{{product.price}}</view> | ||
28 | +</view> | ||
29 | +<view wx:if="{{product.status !== 2}}" class="product_time">{{helper.formatTime(product.start_time, | ||
30 | + product.end_time)}} | ||
31 | +</view> |
1 | 1 | ||
2 | 2 | ||
3 | .product_image { | 3 | .product_image { |
4 | - width: 750rpx; | ||
5 | - height: 470rpx; | 4 | + width: 690rpx; |
5 | + height: 434rpx; | ||
6 | } | 6 | } |
7 | 7 | ||
8 | .product_name { | 8 | .product_name { |
9 | display: inline-block; | 9 | display: inline-block; |
10 | - margin-top: 30rpx; | 10 | + margin-top: 10rpx; |
11 | letter-spacing: -0.34px; | 11 | letter-spacing: -0.34px; |
12 | width: 686rpx; | 12 | width: 686rpx; |
13 | font-size: 28rpx; | 13 | font-size: 28rpx; |
@@ -17,8 +17,8 @@ import { | @@ -17,8 +17,8 @@ import { | ||
17 | } from '../../vendors/zanui/index'; | 17 | } from '../../vendors/zanui/index'; |
18 | import router from './router/router' | 18 | import router from './router/router' |
19 | import {wrapperName} from './helper' | 19 | import {wrapperName} from './helper' |
20 | -import { formatImageUrl } from '../../utils/util' | ||
21 | -import { jumpByUrl } from '../../libs/urlRoute'; | 20 | +import {formatImageUrl} from '../../utils/util' |
21 | +import {jumpByUrl} from '../../libs/urlRoute'; | ||
22 | 22 | ||
23 | const ACTIVITY = { | 23 | const ACTIVITY = { |
24 | UNKNOWN: 0, | 24 | UNKNOWN: 0, |
@@ -71,11 +71,11 @@ Page(Object.assign({ | @@ -71,11 +71,11 @@ Page(Object.assign({ | ||
71 | hasUnionID: false, | 71 | hasUnionID: false, |
72 | uid: 0, | 72 | uid: 0, |
73 | isLogin: false, | 73 | isLogin: false, |
74 | - bannerSrc:null, | 74 | + bannerSrc: null, |
75 | bannerUrl: null, | 75 | bannerUrl: null, |
76 | loading: false, | 76 | loading: false, |
77 | page: 1, | 77 | page: 1, |
78 | - | 78 | + codeList: [], |
79 | actionsheet: { | 79 | actionsheet: { |
80 | componentId: 'shareActionSheet', | 80 | componentId: 'shareActionSheet', |
81 | show: false, | 81 | show: false, |
@@ -84,12 +84,12 @@ Page(Object.assign({ | @@ -84,12 +84,12 @@ Page(Object.assign({ | ||
84 | isNewShareStyle: true, | 84 | isNewShareStyle: true, |
85 | unionUserImageUrl: 'http://img12.static.yhbimg.com/sns/2018/08/02/15/029b6acc4f8bc0620ecd7ec2133fcf900c.png', | 85 | unionUserImageUrl: 'http://img12.static.yhbimg.com/sns/2018/08/02/15/029b6acc4f8bc0620ecd7ec2133fcf900c.png', |
86 | actions: [{ | 86 | actions: [{ |
87 | - name: '分享给好友', | ||
88 | - className: 'action-class', | ||
89 | - loading: false, | ||
90 | - openType: 'share', | ||
91 | - image_src: '../../images/share_wechat@2x.png', | ||
92 | - }, | 87 | + name: '分享给好友', |
88 | + className: 'action-class', | ||
89 | + loading: false, | ||
90 | + openType: 'share', | ||
91 | + image_src: '../../images/share_wechat@2x.png', | ||
92 | + }, | ||
93 | { | 93 | { |
94 | name: '生成海报分享', | 94 | name: '生成海报分享', |
95 | className: 'action-class', | 95 | className: 'action-class', |
@@ -98,12 +98,14 @@ Page(Object.assign({ | @@ -98,12 +98,14 @@ Page(Object.assign({ | ||
98 | } | 98 | } |
99 | ] | 99 | ] |
100 | }, | 100 | }, |
101 | + animation: null, | ||
102 | + shareFlag:false | ||
101 | }, | 103 | }, |
102 | 104 | ||
103 | /** | 105 | /** |
104 | * 生命周期函数--监听页面加载 | 106 | * 生命周期函数--监听页面加载 |
105 | */ | 107 | */ |
106 | - onLoad: function(options) { | 108 | + onLoad: function (options) { |
107 | app = getApp(); | 109 | app = getApp(); |
108 | 110 | ||
109 | this.service = new ZeroSellService(); | 111 | this.service = new ZeroSellService(); |
@@ -135,12 +137,13 @@ Page(Object.assign({ | @@ -135,12 +137,13 @@ Page(Object.assign({ | ||
135 | /** | 137 | /** |
136 | * 生命周期函数--监听页面初次渲染完成 | 138 | * 生命周期函数--监听页面初次渲染完成 |
137 | */ | 139 | */ |
138 | - onReady: function() {}, | 140 | + onReady: function () { |
141 | + }, | ||
139 | 142 | ||
140 | /** | 143 | /** |
141 | * 生命周期函数--监听页面显示 | 144 | * 生命周期函数--监听页面显示 |
142 | */ | 145 | */ |
143 | - onShow: function() { | 146 | + onShow: function () { |
144 | wx.showLoading({ | 147 | wx.showLoading({ |
145 | mask: true | 148 | mask: true |
146 | }); | 149 | }); |
@@ -153,7 +156,7 @@ Page(Object.assign({ | @@ -153,7 +156,7 @@ Page(Object.assign({ | ||
153 | isLogin: app.isLogin(), | 156 | isLogin: app.isLogin(), |
154 | uid | 157 | uid |
155 | }) | 158 | }) |
156 | - | 159 | + this._getMineCode(); |
157 | this._getUser(); | 160 | this._getUser(); |
158 | this._getGroupList(); | 161 | this._getGroupList(); |
159 | 162 | ||
@@ -172,21 +175,21 @@ Page(Object.assign({ | @@ -172,21 +175,21 @@ Page(Object.assign({ | ||
172 | /** | 175 | /** |
173 | * 生命周期函数--监听页面隐藏 | 176 | * 生命周期函数--监听页面隐藏 |
174 | */ | 177 | */ |
175 | - onHide: function() { | 178 | + onHide: function () { |
176 | 179 | ||
177 | }, | 180 | }, |
178 | 181 | ||
179 | /** | 182 | /** |
180 | * 生命周期函数--监听页面卸载 | 183 | * 生命周期函数--监听页面卸载 |
181 | */ | 184 | */ |
182 | - onUnload: function() { | 185 | + onUnload: function () { |
183 | 186 | ||
184 | }, | 187 | }, |
185 | 188 | ||
186 | /** | 189 | /** |
187 | * 页面相关事件处理函数--监听用户下拉动作 | 190 | * 页面相关事件处理函数--监听用户下拉动作 |
188 | */ | 191 | */ |
189 | - onPullDownRefresh: function() { | 192 | + onPullDownRefresh: function () { |
190 | wx.showLoading({ | 193 | wx.showLoading({ |
191 | mask: true | 194 | mask: true |
192 | }); | 195 | }); |
@@ -198,7 +201,7 @@ Page(Object.assign({ | @@ -198,7 +201,7 @@ Page(Object.assign({ | ||
198 | /** | 201 | /** |
199 | * 页面上拉触底事件的处理函数 | 202 | * 页面上拉触底事件的处理函数 |
200 | */ | 203 | */ |
201 | - onReachBottom: function() { | 204 | + onReachBottom: function () { |
202 | if (this.data.loading) return; | 205 | if (this.data.loading) return; |
203 | let page = this.data.page || 1; | 206 | let page = this.data.page || 1; |
204 | page = page + 1; | 207 | page = page + 1; |
@@ -227,13 +230,13 @@ Page(Object.assign({ | @@ -227,13 +230,13 @@ Page(Object.assign({ | ||
227 | /** | 230 | /** |
228 | * 用户点击右上角分享 | 231 | * 用户点击右上角分享 |
229 | */ | 232 | */ |
230 | - onShareAppMessage: function() { | 233 | + onShareAppMessage: function () { |
231 | 234 | ||
232 | }, | 235 | }, |
233 | 236 | ||
234 | goLogin() { | 237 | goLogin() { |
235 | const event = global.event; | 238 | const event = global.event; |
236 | - event.emit('user-is-login', { logged: this.logged, loginSuccess: this.loginSuccess }); | 239 | + event.emit('user-is-login', {logged: this.logged, loginSuccess: this.loginSuccess}); |
237 | }, | 240 | }, |
238 | 241 | ||
239 | logged() { | 242 | logged() { |
@@ -243,7 +246,32 @@ Page(Object.assign({ | @@ -243,7 +246,32 @@ Page(Object.assign({ | ||
243 | loginSuccess() { | 246 | loginSuccess() { |
244 | 247 | ||
245 | }, | 248 | }, |
249 | + _getMineCode() { | ||
250 | + if (this.data.uid) { | ||
251 | + this.service.fetchMyPrizeList({uid: this.data.uid, actPrizeId: this.data.actPrizeId}).then(res => { | ||
252 | + let len = res.data.length; | ||
253 | + let animation = wx.createAnimation({ | ||
254 | + duration: 400 * len, | ||
255 | + }) | ||
256 | + this.setData({ | ||
257 | + codeList: res.data, | ||
258 | + }) | ||
259 | + this.animation = animation | ||
260 | + setTimeout(function () { | ||
261 | + let query = wx.createSelectorQuery(); | ||
262 | + query.select('.code-list-item-container').boundingClientRect(); | ||
263 | + query.exec((res) => { | ||
264 | + animation.height(res[0].height - 63).step(); | ||
265 | + this.setData({ | ||
266 | + animation: animation.export() | ||
267 | + }) | ||
268 | + }) | ||
246 | 269 | ||
270 | + }.bind(this), 400); | ||
271 | + | ||
272 | + }) | ||
273 | + } | ||
274 | + }, | ||
247 | _getGroupList() { | 275 | _getGroupList() { |
248 | this.commonService.getGroupList({ | 276 | this.commonService.getGroupList({ |
249 | limit: 20, | 277 | limit: 20, |
@@ -389,7 +417,6 @@ Page(Object.assign({ | @@ -389,7 +417,6 @@ Page(Object.assign({ | ||
389 | step: step | 417 | step: step |
390 | }); | 418 | }); |
391 | }, | 419 | }, |
392 | - | ||
393 | _setActionStatus() { | 420 | _setActionStatus() { |
394 | let status = ACTION_BAR_STATUS.START; | 421 | let status = ACTION_BAR_STATUS.START; |
395 | let activityStatus = this.data.product.status; | 422 | let activityStatus = this.data.product.status; |
@@ -398,7 +425,7 @@ Page(Object.assign({ | @@ -398,7 +425,7 @@ Page(Object.assign({ | ||
398 | status = ACTION_BAR_STATUS.END; | 425 | status = ACTION_BAR_STATUS.END; |
399 | } else if (activityStatus === ACTIVITY.READY) { | 426 | } else if (activityStatus === ACTIVITY.READY) { |
400 | status = ACTION_BAR_STATUS.READY; | 427 | status = ACTION_BAR_STATUS.READY; |
401 | - }else if (activityStatus >= ACTIVITY.END) { | 428 | + } else if (activityStatus >= ACTIVITY.END) { |
402 | if (this._isInActivity()) { | 429 | if (this._isInActivity()) { |
403 | if (activityStatus === ACTIVITY.LUCK) { | 430 | if (activityStatus === ACTIVITY.LUCK) { |
404 | status = ACTION_BAR_STATUS.LUCK; | 431 | status = ACTION_BAR_STATUS.LUCK; |
@@ -466,7 +493,7 @@ Page(Object.assign({ | @@ -466,7 +493,7 @@ Page(Object.assign({ | ||
466 | 493 | ||
467 | _getUser() { | 494 | _getUser() { |
468 | const userInfo = app.getUserInfo(); | 495 | const userInfo = app.getUserInfo(); |
469 | - | 496 | + |
470 | if (app.isLogin() && (!userInfo || !userInfo.nickName)) { | 497 | if (app.isLogin() && (!userInfo || !userInfo.nickName)) { |
471 | return this.service.getUserProfile({uid: app.getUid()}).then(json => { | 498 | return this.service.getUserProfile({uid: app.getUid()}).then(json => { |
472 | if (json && json.code && json.code === 200) { | 499 | if (json && json.code && json.code === 200) { |
@@ -481,17 +508,17 @@ Page(Object.assign({ | @@ -481,17 +508,17 @@ Page(Object.assign({ | ||
481 | }, | 508 | }, |
482 | 509 | ||
483 | handleZanActionsheetCancel({ | 510 | handleZanActionsheetCancel({ |
484 | - componentId | ||
485 | - }) { | 511 | + componentId |
512 | + }) { | ||
486 | this.setData({ | 513 | this.setData({ |
487 | 'actionsheet.show': false | 514 | 'actionsheet.show': false |
488 | }) | 515 | }) |
489 | }, | 516 | }, |
490 | 517 | ||
491 | handleZanActionsheetClick({ | 518 | handleZanActionsheetClick({ |
492 | - componentId, | ||
493 | - index | ||
494 | - }) { | 519 | + componentId, |
520 | + index | ||
521 | + }) { | ||
495 | this.setData({ | 522 | this.setData({ |
496 | 'actionsheet.show': false | 523 | 'actionsheet.show': false |
497 | }) | 524 | }) |
@@ -505,16 +532,25 @@ Page(Object.assign({ | @@ -505,16 +532,25 @@ Page(Object.assign({ | ||
505 | TITLE: `【0元抽奖】点一下,免费拿走${this.data.product.name}`, | 532 | TITLE: `【0元抽奖】点一下,免费拿走${this.data.product.name}`, |
506 | DESC: '我在YO!LUCK发现一个不错的商品赶快来看看吧!' | 533 | DESC: '我在YO!LUCK发现一个不错的商品赶快来看看吧!' |
507 | }; | 534 | }; |
508 | - | 535 | + this.setData({ |
536 | + shareFlag: true | ||
537 | + }) | ||
509 | if (res.from === 'menu') { | 538 | if (res.from === 'menu') { |
510 | // 用户点击右上角分享 | 539 | // 用户点击右上角分享 |
511 | return { | 540 | return { |
512 | title: params.TITLE, // 分享标题 | 541 | title: params.TITLE, // 分享标题 |
513 | desc: params.DESC, // 分享描述 | 542 | desc: params.DESC, // 分享描述 |
514 | path: `/pages/zeroSell/detail?actPrizeId=${this.data.product.id}`, | 543 | path: `/pages/zeroSell/detail?actPrizeId=${this.data.product.id}`, |
515 | - imageUrl: this.data.product.cover_img, | ||
516 | - success: function() {}, | ||
517 | - fail: function() {} | 544 | + success: ()=> { |
545 | + this.setData({ | ||
546 | + shareFlag: false | ||
547 | + }) | ||
548 | + }, | ||
549 | + fail: ()=> { | ||
550 | + this.setData({ | ||
551 | + shareFlag: false | ||
552 | + }) | ||
553 | + } | ||
518 | }; | 554 | }; |
519 | } else if (res.from === 'button') { | 555 | } else if (res.from === 'button') { |
520 | // 用户点击分享按钮 | 556 | // 用户点击分享按钮 |
@@ -523,9 +559,16 @@ Page(Object.assign({ | @@ -523,9 +559,16 @@ Page(Object.assign({ | ||
523 | title: params.TITLE, // 分享标题 | 559 | title: params.TITLE, // 分享标题 |
524 | desc: params.DESC, // 分享描述 | 560 | desc: params.DESC, // 分享描述 |
525 | path: `/pages/zeroSell/detail?actPrizeId=${this.data.product.id}&shareUid=${app.getUid()}`, | 561 | path: `/pages/zeroSell/detail?actPrizeId=${this.data.product.id}&shareUid=${app.getUid()}`, |
526 | - imageUrl: this.data.product.cover_img, | ||
527 | - success: function() {}, | ||
528 | - fail: function() {} | 562 | + success: ()=> { |
563 | + this.setData({ | ||
564 | + shareFlag: false | ||
565 | + }) | ||
566 | + }, | ||
567 | + fail: ()=> { | ||
568 | + this.setData({ | ||
569 | + shareFlag: false | ||
570 | + }) | ||
571 | + } | ||
529 | }; | 572 | }; |
530 | } | 573 | } |
531 | }, | 574 | }, |
@@ -533,10 +576,10 @@ Page(Object.assign({ | @@ -533,10 +576,10 @@ Page(Object.assign({ | ||
533 | router.go('index'); | 576 | router.go('index'); |
534 | }, | 577 | }, |
535 | 578 | ||
536 | - getUserInfo: function(e) { | 579 | + getUserInfo: function (e) { |
537 | var that = this; | 580 | var that = this; |
538 | if (e.detail.errMsg === 'getUserInfo:ok') { | 581 | if (e.detail.errMsg === 'getUserInfo:ok') { |
539 | - decodeUnionId(app.getWechatThirdSession(), e, function(response) { | 582 | + decodeUnionId(app.getWechatThirdSession(), e, function (response) { |
540 | if (response.isHaveUnionID) { | 583 | if (response.isHaveUnionID) { |
541 | that.setData({ | 584 | that.setData({ |
542 | hasUnionID: true, | 585 | hasUnionID: true, |
@@ -544,31 +587,32 @@ Page(Object.assign({ | @@ -544,31 +587,32 @@ Page(Object.assign({ | ||
544 | } | 587 | } |
545 | }); | 588 | }); |
546 | } else { | 589 | } else { |
547 | - openAuthorizeSettings(function(response) { | 590 | + openAuthorizeSettings(function (response) { |
548 | if (response.isHaveUnionID) { | 591 | if (response.isHaveUnionID) { |
549 | that.setData({ | 592 | that.setData({ |
550 | hasUnionID: true, | 593 | hasUnionID: true, |
551 | }) | 594 | }) |
552 | - }; | 595 | + } |
596 | + ; | ||
553 | }); | 597 | }); |
554 | } | 598 | } |
555 | }, | 599 | }, |
556 | 600 | ||
557 | - getPhoneNumber: function(e) { | 601 | + getPhoneNumber: function (e) { |
558 | this.setData({ | 602 | this.setData({ |
559 | showAuth: false | 603 | showAuth: false |
560 | }); | 604 | }); |
561 | 605 | ||
562 | var that = this; | 606 | var that = this; |
563 | if (e.detail.errMsg === 'getPhoneNumber:ok') { | 607 | if (e.detail.errMsg === 'getPhoneNumber:ok') { |
564 | - decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function(result) { | 608 | + decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function (result) { |
565 | // console.log('!!!!result',result) | 609 | // console.log('!!!!result',result) |
566 | if (result.code != 200) { | 610 | if (result.code != 200) { |
567 | that.wetoast.toast({ | 611 | that.wetoast.toast({ |
568 | title: result.message, | 612 | title: result.message, |
569 | titleClassName: 'wetoast-title', | 613 | titleClassName: 'wetoast-title', |
570 | duration: 1000, | 614 | duration: 1000, |
571 | - success: function() { | 615 | + success: function () { |
572 | that.loginAndRegisterTapped() | 616 | that.loginAndRegisterTapped() |
573 | }.bind(that) | 617 | }.bind(that) |
574 | }); | 618 | }); |
@@ -576,7 +620,7 @@ Page(Object.assign({ | @@ -576,7 +620,7 @@ Page(Object.assign({ | ||
576 | if (result.is_register) { | 620 | if (result.is_register) { |
577 | that.showZanToast({ | 621 | that.showZanToast({ |
578 | title: '欢迎加入Yoho!Family!新人礼包已发放到个人中心-优惠券,请注意查收', | 622 | title: '欢迎加入Yoho!Family!新人礼包已发放到个人中心-优惠券,请注意查收', |
579 | - success: function() { | 623 | + success: function () { |
580 | let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0; | 624 | let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0; |
581 | that.setData({ | 625 | that.setData({ |
582 | uid, | 626 | uid, |
@@ -617,13 +661,13 @@ Page(Object.assign({ | @@ -617,13 +661,13 @@ Page(Object.assign({ | ||
617 | content: '检测到您未打开微信用户信息授权,开启后即可进行登录', | 661 | content: '检测到您未打开微信用户信息授权,开启后即可进行登录', |
618 | confirmText: "去开启", | 662 | confirmText: "去开启", |
619 | confirmColor: "#000000", | 663 | confirmColor: "#000000", |
620 | - success: function(res) { | 664 | + success: function (res) { |
621 | if (res.confirm) { | 665 | if (res.confirm) { |
622 | wx.openSetting({ | 666 | wx.openSetting({ |
623 | success: (res) => { | 667 | success: (res) => { |
624 | // console.log(res.authSetting["scope.userInfo"]) | 668 | // console.log(res.authSetting["scope.userInfo"]) |
625 | if (res.authSetting["scope.userInfo"] !== null && res.authSetting["scope.userInfo"] !== undefined && res.authSetting["scope.userInfo"] === true) { | 669 | if (res.authSetting["scope.userInfo"] !== null && res.authSetting["scope.userInfo"] !== undefined && res.authSetting["scope.userInfo"] === true) { |
626 | - getUnionID(app.getWechatThirdSession(), function(response) { | 670 | + getUnionID(app.getWechatThirdSession(), function (response) { |
627 | // console.log(response) | 671 | // console.log(response) |
628 | }) | 672 | }) |
629 | } | 673 | } |
@@ -640,7 +684,7 @@ Page(Object.assign({ | @@ -640,7 +684,7 @@ Page(Object.assign({ | ||
640 | wx.navigateTo({ | 684 | wx.navigateTo({ |
641 | url: '/pages/bindPhoneNumber/bindPhoneNumber' | 685 | url: '/pages/bindPhoneNumber/bindPhoneNumber' |
642 | }); | 686 | }); |
643 | - } | 687 | + } |
644 | } | 688 | } |
645 | }) | 689 | }) |
646 | } else { | 690 | } else { |
1 | <!--page/subPackage/pages/zeroSell/detail.wxml--> | 1 | <!--page/subPackage/pages/zeroSell/detail.wxml--> |
2 | <block wx:if="{{show}}"> | 2 | <block wx:if="{{show}}"> |
3 | 3 | ||
4 | -<view class="header"> | 4 | + <view class="header"> |
5 | 5 | ||
6 | - <product-header product="{{product}}" avatars="{{avatars}}"></product-header> | ||
7 | - <view style="height: 20rpx;"></view> | ||
8 | -</view> | ||
9 | -<block wx:if="{{false}}"> | ||
10 | -<counter count="{{participantCount}}" num="{{product.limit}}" status="{{product.status}}"></counter> | ||
11 | -<prize-progress step="{{step}}"></prize-progress> | ||
12 | -</block> | 6 | + <product-header product="{{product}}" shareFlag="{{shareFlag}}" avatars="{{avatars}}"></product-header> |
7 | + <view style="height: 20rpx;"></view> | ||
8 | + </view> | ||
9 | + <block wx:if="{{false}}"> | ||
10 | + <counter count="{{participantCount}}" num="{{product.limit}}" status="{{product.status}}"></counter> | ||
11 | + <prize-progress step="{{step}}"></prize-progress> | ||
12 | + </block> | ||
13 | + <view class="machine"> | ||
14 | + <view class="code-list" animation="{{animation}}"> | ||
15 | + <view class="code-list-item-container"> | ||
16 | + <view class="code-list-item"><view class="content"></view></view> | ||
17 | + <view class="code-list-item" wx:for="{{codeList}}"> | ||
18 | + <view class="content"> | ||
19 | + <image class="thumb" mode="widthFix" src="{{item.user_thumb}}"></image> | ||
20 | + <view class="text"> | ||
21 | + <view>我的</view> | ||
22 | + <view>抽奖码</view> | ||
23 | + </view> | ||
24 | + <view class="my-code">{{item.prize_code}}</view> | ||
25 | + </view> | ||
26 | + </view> | ||
27 | + </view> | ||
28 | + </view> | ||
29 | + </view> | ||
13 | <view class="help"> | 30 | <view class="help"> |
14 | <help></help> | 31 | <help></help> |
15 | </view> | 32 | </view> |
16 | -<desc list="{{product.content}}" bind:tapUrl="_jumpBanner" bannerSrc="{{bannerSrc}}" bannerUrl="{{bannerUrl}}"></desc> | 33 | + <desc list="{{product.content}}" bind:tapUrl="_jumpBanner" bannerSrc="{{bannerSrc}}" bannerUrl="{{bannerUrl}}"></desc> |
17 | 34 | ||
18 | -<view class="line"></view> | 35 | + <view class="line"></view> |
19 | 36 | ||
20 | -<more wx:if="{{recommends.length > 0}}"> | ||
21 | - <block wx:for="{{recommends}}"> | ||
22 | - <view class="product-item" > | ||
23 | - <product-item product="{{item}}"></product-item> | ||
24 | - </view> | ||
25 | - </block> | ||
26 | -</more> | 37 | + <more wx:if="{{recommends.length > 0}}"> |
38 | + <block wx:for="{{recommends}}"> | ||
39 | + <view class="product-item"> | ||
40 | + <product-item product="{{item}}"></product-item> | ||
41 | + </view> | ||
42 | + </block> | ||
43 | + </more> | ||
27 | 44 | ||
28 | -<view class="fellow-bar" wx:if="{{product.status}}"> | ||
29 | - <fellow-bar></fellow-bar> | ||
30 | -</view> | ||
31 | -<group-recommend groupRecommendList="{{groupList}}" bindgoToGroupMiniApp="goToGroupMiniApp"> | ||
32 | -</group-recommend> | 45 | + <view class="fellow-bar" wx:if="{{product.status}}"> |
46 | + <fellow-bar></fellow-bar> | ||
47 | + </view> | ||
48 | + <group-recommend groupRecommendList="{{groupList}}" bindgoToGroupMiniApp="goToGroupMiniApp"> | ||
49 | + </group-recommend> | ||
33 | 50 | ||
34 | -<view class="action-bar"> | ||
35 | - <action-bar wx:if="{{isLogin}}" status="{{actionStatus}}" num="{{myPrizeCount}}" share-uid="{{shareUid}}" act-prize-id="{{actPrizeId}}" bindgetcode="changeActionStatus" bindshare="share" | ||
36 | - ></action-bar> | 51 | + <view class="action-bar"> |
52 | + <action-bar wx:if="{{isLogin}}" status="{{actionStatus}}" num="{{myPrizeCount}}" share-uid="{{shareUid}}" | ||
53 | + act-prize-id="{{actPrizeId}}" bindgetcode="changeActionStatus" bindshare="share" | ||
54 | + ></action-bar> | ||
37 | 55 | ||
38 | - <block wx:else> | ||
39 | - <view class="action-bar2"> | 56 | + <block wx:else> |
57 | + <view class="action-bar2"> | ||
40 | <view class="action-item action-list" bindtap="goList"> | 58 | <view class="action-item action-list" bindtap="goList"> |
41 | <image class="action-image" src="./images/list_icon@2x.png"></image> | 59 | <image class="action-image" src="./images/list_icon@2x.png"></image> |
42 | </view> | 60 | </view> |
@@ -48,15 +66,15 @@ | @@ -48,15 +66,15 @@ | ||
48 | <block wx:else> | 66 | <block wx:else> |
49 | <view class="action-item over">活动已结束</view> | 67 | <view class="action-item over">活动已结束</view> |
50 | </block> | 68 | </block> |
51 | - </view> | ||
52 | - </block> | ||
53 | -</view> | ||
54 | -<view class="foot"></view> | 69 | + </view> |
70 | + </block> | ||
71 | + </view> | ||
72 | + <view class="foot"></view> | ||
55 | 73 | ||
56 | </block> | 74 | </block> |
57 | 75 | ||
58 | -<import src="../../vendors/zanui/actionsheet/index.wxml" /> | ||
59 | -<template is="zan-actionsheet" data="{{...actionsheet}}" /> | 76 | +<import src="../../vendors/zanui/actionsheet/index.wxml"/> |
77 | +<template is="zan-actionsheet" data="{{...actionsheet}}"/> | ||
60 | 78 | ||
61 | <import src="../../vendors/zanui/toast/index.wxml"/> | 79 | <import src="../../vendors/zanui/toast/index.wxml"/> |
62 | <template is="zan-toast" data="{{zanToast}}"/> | 80 | <template is="zan-toast" data="{{zanToast}}"/> |
@@ -66,7 +84,9 @@ | @@ -66,7 +84,9 @@ | ||
66 | 84 | ||
67 | <!-- <quickNavigation id="quickNavigation" isShowIndicator="{{false}}" isShowShopCart="{{false}}" marginBottom="{{190}}"></quickNavigation> --> | 85 | <!-- <quickNavigation id="quickNavigation" isShowIndicator="{{false}}" isShowShopCart="{{false}}" marginBottom="{{190}}"></quickNavigation> --> |
68 | 86 | ||
69 | -<zero-alert wx:if="{{showAuth}}" > | 87 | +<zero-alert wx:if="{{showAuth}}"> |
70 | <view class="auth-content">OOPS 用户尚未授权登录</view> | 88 | <view class="auth-content">OOPS 用户尚未授权登录</view> |
71 | - <button class="auth-foot action-item confirm" open-type="{{!hasUnionID ? 'getUserInfo':'getPhoneNumber'}}" bindgetphonenumber="getPhoneNumber" bindgetuserinfo='getUserInfo'>授权登录</button> | 89 | + <button class="auth-foot action-item confirm" open-type="{{!hasUnionID ? 'getUserInfo':'getPhoneNumber'}}" |
90 | + bindgetphonenumber="getPhoneNumber" bindgetuserinfo='getUserInfo'>授权登录 | ||
91 | + </button> | ||
72 | </zero-alert> | 92 | </zero-alert> |
@@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
75 | left: 50%; | 75 | left: 50%; |
76 | /* transform: translateY(-50%); */ | 76 | /* transform: translateY(-50%); */ |
77 | transform: translate(-50%, -50%); | 77 | transform: translate(-50%, -50%); |
78 | - | 78 | + |
79 | } | 79 | } |
80 | 80 | ||
81 | .action-bar2 { | 81 | .action-bar2 { |
@@ -104,4 +104,76 @@ | @@ -104,4 +104,76 @@ | ||
104 | font-weight: bolder; | 104 | font-weight: bolder; |
105 | text-align: center; | 105 | text-align: center; |
106 | border-top: 1rpx solid #E0E0E0; | 106 | border-top: 1rpx solid #E0E0E0; |
107 | -} | ||
107 | +} | ||
108 | + | ||
109 | +.machine { | ||
110 | + background-image: url('https://img10.static.yhbimg.com/yhb-img01/2018/12/27/19/011f45717237b3cbf7301833e8dc28f994.png'); | ||
111 | + background-size: contain; | ||
112 | + background-repeat: no-repeat; | ||
113 | + min-height: 258rpx; | ||
114 | + position: relative; | ||
115 | + margin-left: 83.6rpx; | ||
116 | + width: 598rpx; | ||
117 | + overflow: hidden; | ||
118 | +} | ||
119 | + | ||
120 | +.machine .code-list { | ||
121 | + position: relative; | ||
122 | + width: 410rpx; | ||
123 | + height:22rpx; | ||
124 | + margin: 120rpx auto 0 74rpx; | ||
125 | + overflow: hidden; | ||
126 | +} | ||
127 | + | ||
128 | +.code-list .code-list-item { | ||
129 | + margin-top:-9rpx; | ||
130 | + width: 410rpx; | ||
131 | + height: 164rpx; | ||
132 | + overflow: hidden; | ||
133 | +} | ||
134 | + | ||
135 | +.code-list .code-list-item-container { | ||
136 | + position: absolute; | ||
137 | + bottom: 0; | ||
138 | + width: 410rpx; | ||
139 | +} | ||
140 | + | ||
141 | +.code-list .code-list-item .code { | ||
142 | + float: left; | ||
143 | +} | ||
144 | + | ||
145 | +.machine .code { | ||
146 | + width: 410rpx; | ||
147 | + position:relative; | ||
148 | +} | ||
149 | + | ||
150 | +.code-list .code-list-item .content{ | ||
151 | + width: 410rpx; | ||
152 | + height: 164rpx; | ||
153 | + position:relative; | ||
154 | + background-image: url('https://img11.static.yhbimg.com/yhb-img01/2018/12/27/19/0140fa3243af949068d2aabeedb0ea0666.png'); | ||
155 | + background-size: contain; | ||
156 | + background-repeat: no-repeat; | ||
157 | + overflow: hidden; | ||
158 | +} | ||
159 | + | ||
160 | +.code-list .code-list-item .content .thumb{ | ||
161 | + width: 60rpx; | ||
162 | + height: 60rpx; | ||
163 | + margin: 46rpx 10rpx 46rpx 32rpx; | ||
164 | + border-radius: 30rpx; | ||
165 | +} | ||
166 | +.code-list .code-list-item .content .my-code{ | ||
167 | + height:44rpx; | ||
168 | + float:right; | ||
169 | + vertical-align:middle; | ||
170 | + line-height:156rpx; | ||
171 | + font-size: 32rpx; | ||
172 | + margin-right: 46rpx; | ||
173 | +} | ||
174 | +.code-list .code-list-item .content .text{ | ||
175 | + font-size: 16rpx; | ||
176 | + display: inline-block; | ||
177 | + height:172rpx; | ||
178 | + vertical-align:middle; | ||
179 | +} |
@@ -151,7 +151,6 @@ Page(Object.assign({ | @@ -151,7 +151,6 @@ Page(Object.assign({ | ||
151 | this.setData({ | 151 | this.setData({ |
152 | footText: '内容加载中...' | 152 | footText: '内容加载中...' |
153 | }); | 153 | }); |
154 | - | ||
155 | return this.service.getMyList({type, page}).then(result => { | 154 | return this.service.getMyList({type, page}).then(result => { |
156 | 155 | ||
157 | if(result.code !== 200 || result.data.length === 0) { | 156 | if(result.code !== 200 || result.data.length === 0) { |
@@ -58,15 +58,13 @@ class ZeroSellService extends Service { | @@ -58,15 +58,13 @@ class ZeroSellService extends Service { | ||
58 | return result | 58 | return result |
59 | }); | 59 | }); |
60 | } | 60 | } |
61 | - | ||
62 | - getRecentAvatars(data) { | ||
63 | - return this._get('/code/recent', data); | ||
64 | - } | ||
65 | - | ||
66 | getMyList(data) { | 61 | getMyList(data) { |
67 | data.channel = 0 | 62 | data.channel = 0 |
68 | return this._get('/list/mine', data); | 63 | return this._get('/list/mine', data); |
69 | } | 64 | } |
65 | + getRecentAvatars(data) { | ||
66 | + return this._get('/code/recent', data); | ||
67 | + } | ||
70 | 68 | ||
71 | fetchCode(data) { | 69 | fetchCode(data) { |
72 | data.miniAppType = MINI_APP_TYPE | 70 | data.miniAppType = MINI_APP_TYPE |
@@ -85,6 +83,7 @@ class ZeroSellService extends Service { | @@ -85,6 +83,7 @@ class ZeroSellService extends Service { | ||
85 | return API_HOST + '/wechat/miniapp/img-check.jpg?param=' + JSON.stringify(page_param) + `&miniQrType=${MINI_QR_TYPE}` + `&miniapp_type=${MINI_APP_TYPE}`; | 83 | return API_HOST + '/wechat/miniapp/img-check.jpg?param=' + JSON.stringify(page_param) + `&miniQrType=${MINI_QR_TYPE}` + `&miniapp_type=${MINI_APP_TYPE}`; |
86 | } | 84 | } |
87 | 85 | ||
86 | + | ||
88 | getUserProfile(data) { | 87 | getUserProfile(data) { |
89 | return this._get('', { | 88 | return this._get('', { |
90 | method: 'app.passport.profile', | 89 | method: 'app.passport.profile', |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | "list": [] | 29 | "list": [] |
30 | }, | 30 | }, |
31 | "miniprogram": { | 31 | "miniprogram": { |
32 | - "current": 4, | 32 | + "current": 5, |
33 | "list": [ | 33 | "list": [ |
34 | { | 34 | { |
35 | "id": 0, | 35 | "id": 0, |
@@ -65,6 +65,12 @@ | @@ -65,6 +65,12 @@ | ||
65 | "pathName": "pages/bindPhoneNumber/bindPhoneNumber", | 65 | "pathName": "pages/bindPhoneNumber/bindPhoneNumber", |
66 | "query": "", | 66 | "query": "", |
67 | "scene": "1011" | 67 | "scene": "1011" |
68 | + }, | ||
69 | + { | ||
70 | + "id": -1, | ||
71 | + "name": "YOLUCK DETAIL", | ||
72 | + "pathName": "pages/zeroSell/detail", | ||
73 | + "query": "actPrizeId=41" | ||
68 | } | 74 | } |
69 | ] | 75 | ] |
70 | } | 76 | } |
-
Please register or login to post a comment