Showing
9 changed files
with
108 additions
and
73 deletions
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | "pages/zeroSell/detail", | 4 | "pages/zeroSell/detail", |
5 | "pages/zeroSell/snapshootShare", | 5 | "pages/zeroSell/snapshootShare", |
6 | "pages/zeroSell/h5Page", | 6 | "pages/zeroSell/h5Page", |
7 | + "pages/zeroSell/error", | ||
7 | "pages/bindPhoneNumber/bindPhoneNumber", | 8 | "pages/bindPhoneNumber/bindPhoneNumber", |
8 | "pages/choosecountry/choosecountry", | 9 | "pages/choosecountry/choosecountry", |
9 | "login/login-page/login-page" | 10 | "login/login-page/login-page" |
@@ -133,11 +133,9 @@ function request(method = 'GET') { | @@ -133,11 +133,9 @@ function request(method = 'GET') { | ||
133 | let code = statusCode; | 133 | let code = statusCode; |
134 | let message = res.errMsg ? res.errMsg : ''; | 134 | let message = res.errMsg ? res.errMsg : ''; |
135 | if(statusCode === 503) { | 135 | if(statusCode === 503) { |
136 | - wx.showToast({ | ||
137 | - title: '目前参与人数过多请下拉刷新', | ||
138 | - icon: 'none', | ||
139 | - duration: 2000 | ||
140 | - }); | 136 | + wx.navigateTo({ |
137 | + url: '/pages/zeroSell/error' | ||
138 | + }) | ||
141 | } | 139 | } |
142 | reject({ code, message }); | 140 | reject({ code, message }); |
143 | } | 141 | } |
@@ -145,13 +143,6 @@ function request(method = 'GET') { | @@ -145,13 +143,6 @@ function request(method = 'GET') { | ||
145 | fail: function (err) { | 143 | fail: function (err) { |
146 | let code = err.code ? err.code : 800; | 144 | let code = err.code ? err.code : 800; |
147 | let message = err.message ? err.message : ''; | 145 | let message = err.message ? err.message : ''; |
148 | - if(code === 503) { | ||
149 | - wx.showToast({ | ||
150 | - title: '目前参与人数过多请下拉刷新', | ||
151 | - icon: 'none', | ||
152 | - duration: 2000 | ||
153 | - }); | ||
154 | - } | ||
155 | reject({code, message}); | 146 | reject({code, message}); |
156 | } | 147 | } |
157 | }); | 148 | }); |
@@ -224,11 +215,9 @@ function request(method = 'GET') { | @@ -224,11 +215,9 @@ function request(method = 'GET') { | ||
224 | let code = statusCode; | 215 | let code = statusCode; |
225 | let message = res.errMsg ? res.errMsg : ''; | 216 | let message = res.errMsg ? res.errMsg : ''; |
226 | if(statusCode === 503) { | 217 | if(statusCode === 503) { |
227 | - wx.showToast({ | ||
228 | - title: '目前参与人数过多请下拉刷新', | ||
229 | - icon: 'none', | ||
230 | - duration: 2000 | ||
231 | - }); | 218 | + wx.navigateTo({ |
219 | + url: '/pages/zeroSell/error' | ||
220 | + }) | ||
232 | } | 221 | } |
233 | reject({ code, message }); | 222 | reject({ code, message }); |
234 | } | 223 | } |
@@ -236,13 +225,6 @@ function request(method = 'GET') { | @@ -236,13 +225,6 @@ function request(method = 'GET') { | ||
236 | fail: function (err) { | 225 | fail: function (err) { |
237 | let code = err.code ? err.code : 800; | 226 | let code = err.code ? err.code : 800; |
238 | let message = err.message ? err.message : ''; | 227 | let message = err.message ? err.message : ''; |
239 | - if(code === 503){ | ||
240 | - wx.showToast({ | ||
241 | - title: '目前参与人数过多请下拉刷新', | ||
242 | - icon: 'none', | ||
243 | - duration: 2000 | ||
244 | - }); | ||
245 | - } | ||
246 | reject({ code, message }); | 228 | reject({ code, message }); |
247 | } | 229 | } |
248 | }); | 230 | }); |
@@ -62,7 +62,6 @@ Page(Object.assign({ | @@ -62,7 +62,6 @@ Page(Object.assign({ | ||
62 | */ | 62 | */ |
63 | data: { | 63 | data: { |
64 | tabIdx: '', | 64 | tabIdx: '', |
65 | - show: false, | ||
66 | showAuth: false, | 65 | showAuth: false, |
67 | actPrizeId: '', | 66 | actPrizeId: '', |
68 | shareUid: 0, | 67 | shareUid: 0, |
@@ -358,7 +357,6 @@ Page(Object.assign({ | @@ -358,7 +357,6 @@ Page(Object.assign({ | ||
358 | 357 | ||
359 | myPrizeCount: r1.code === 200 ? r1.data.myCodeNum : 0, | 358 | myPrizeCount: r1.code === 200 ? r1.data.myCodeNum : 0, |
360 | participantCount, | 359 | participantCount, |
361 | - show: true, | ||
362 | snapData, | 360 | snapData, |
363 | notice: JSON.parse(product.notice || '{}'), | 361 | notice: JSON.parse(product.notice || '{}'), |
364 | lottery: JSON.parse(product.lottery_info || '{}') | 362 | lottery: JSON.parse(product.lottery_info || '{}') |
1 | -<block wx:if="{{show}}"> | ||
2 | - | ||
3 | - <view class="header {{shareFlag || 'mt-header'}}" > | 1 | +<view class="header {{shareFlag || 'mt-header'}}"> |
4 | 2 | ||
5 | <product-header product="{{product}}" shareFlag="{{shareFlag}}" avatars="{{avatars}}"></product-header> | 3 | <product-header product="{{product}}" shareFlag="{{shareFlag}}" avatars="{{avatars}}"></product-header> |
6 | - </view> | ||
7 | - <block wx:if="{{false}}"> | 4 | +</view> |
5 | +<block wx:if="{{false}}"> | ||
8 | <counter count="{{participantCount}}" num="{{product.limit}}" status="{{product.status}}"></counter> | 6 | <counter count="{{participantCount}}" num="{{product.limit}}" status="{{product.status}}"></counter> |
9 | <prize-progress step="{{step}}"></prize-progress> | 7 | <prize-progress step="{{step}}"></prize-progress> |
10 | - </block> | ||
11 | - <view class="machine {{shareFlag ? 'machine-t-m' : 'machine-t-l'}}"> | 8 | +</block> |
9 | +<view class="machine {{shareFlag ? 'machine-t-m' : 'machine-t-l'}}"> | ||
12 | <view class="open-shadow"></view> | 10 | <view class="open-shadow"></view> |
13 | <view class="code-list" animation="{{animation}}"> | 11 | <view class="code-list" animation="{{animation}}"> |
14 | <view class="code-list-item-container"> | 12 | <view class="code-list-item-container"> |
15 | - <view class="code-list-item"><view class="content"></view></view> | 13 | + <view class="code-list-item"> |
14 | + <view class="content"></view> | ||
15 | + </view> | ||
16 | <view class="code-list-item" wx:for="{{codeList}}" wx:if="{{index < 3}}" wx:key="{{index}}"> | 16 | <view class="code-list-item" wx:for="{{codeList}}" wx:if="{{index < 3}}" wx:key="{{index}}"> |
17 | <view class="content"> | 17 | <view class="content"> |
18 | <image class="thumb" mode="widthFix" src="{{item.user_thumb}}"></image> | 18 | <image class="thumb" mode="widthFix" src="{{item.user_thumb}}"></image> |
@@ -22,34 +22,37 @@ | @@ -22,34 +22,37 @@ | ||
22 | </view> | 22 | </view> |
23 | <view class="my-code">{{item.prize_code}}</view> | 23 | <view class="my-code">{{item.prize_code}}</view> |
24 | </view> | 24 | </view> |
25 | - <image class="shadow" src="https://img11.static.yhbimg.com/yhb-img01/2018/12/27/19/0140fa3243af949068d2aabeedb0ea0666.png" mode="widthFix" wx:if="{{index == 2 && codeList.length>3 }}"></image> | ||
26 | - </view> | ||
27 | - <image src="./images/down.png" bindtap="goList" data-index="3" mode="widthFix" class="down" wx:if="{{codeList.length>3}}"></image> | 25 | + <image class="shadow" |
26 | + src="https://img11.static.yhbimg.com/yhb-img01/2018/12/27/19/0140fa3243af949068d2aabeedb0ea0666.png" | ||
27 | + mode="widthFix" wx:if="{{index == 2 && codeList.length>3 }}"></image> | ||
28 | </view> | 28 | </view> |
29 | + <image src="./images/down.png" bindtap="goList" data-index="3" mode="widthFix" class="down" | ||
30 | + wx:if="{{codeList.length>3}}"></image> | ||
29 | </view> | 31 | </view> |
30 | </view> | 32 | </view> |
31 | - <view class="help"> | 33 | +</view> |
34 | +<view class="help"> | ||
32 | <help></help> | 35 | <help></help> |
33 | - </view> | ||
34 | - <desc list="{{product.content}}" bind:tapUrl="_jumpBanner" bannerSrc="{{bannerSrc}}" bannerUrl="{{bannerUrl}}"></desc> | 36 | +</view> |
37 | +<desc list="{{product.content}}" bind:tapUrl="_jumpBanner" bannerSrc="{{bannerSrc}}" bannerUrl="{{bannerUrl}}"></desc> | ||
35 | 38 | ||
36 | - <view class="line"></view> | 39 | +<view class="line"></view> |
37 | 40 | ||
38 | - <more wx:if="{{recommends.length > 0}}"> | 41 | +<more wx:if="{{recommends.length > 0}}"> |
39 | <block wx:for="{{recommends}}" wx:key="{{index}}"> | 42 | <block wx:for="{{recommends}}" wx:key="{{index}}"> |
40 | <view class="product-item"> | 43 | <view class="product-item"> |
41 | <product-item product="{{item}}" tab-idx="{{tabIdx - 1}}"></product-item> | 44 | <product-item product="{{item}}" tab-idx="{{tabIdx - 1}}"></product-item> |
42 | </view> | 45 | </view> |
43 | </block> | 46 | </block> |
44 | - </more> | 47 | +</more> |
45 | 48 | ||
46 | - <view class="fellow-bar" wx:if="{{product.status && !shareFlag}}"> | 49 | +<view class="fellow-bar" wx:if="{{product.status && !shareFlag}}"> |
47 | <fellow-bar notice="{{notice}}"></fellow-bar> | 50 | <fellow-bar notice="{{notice}}"></fellow-bar> |
48 | - </view> | ||
49 | - <group-recommend groupRecommendList="{{groupList}}" bindgoToGroupMiniApp="goToGroupMiniApp"> | ||
50 | - </group-recommend> | 51 | +</view> |
52 | +<group-recommend groupRecommendList="{{groupList}}" bindgoToGroupMiniApp="goToGroupMiniApp"> | ||
53 | +</group-recommend> | ||
51 | 54 | ||
52 | - <view class="action-bar"> | 55 | +<view class="action-bar"> |
53 | <action-bar wx:if="{{isLogin}}" status="{{actionStatus}}" num="{{myPrizeCount}}" share-uid="{{shareUid}}" | 56 | <action-bar wx:if="{{isLogin}}" status="{{actionStatus}}" num="{{myPrizeCount}}" share-uid="{{shareUid}}" |
54 | act-prize-id="{{actPrizeId}}" bindgetcode="changeActionStatus" bindshare="share" | 57 | act-prize-id="{{actPrizeId}}" bindgetcode="changeActionStatus" bindshare="share" |
55 | copyText="{{lottery.miniappCopy}}" text="{{lottery.miniappTip}}" | 58 | copyText="{{lottery.miniappCopy}}" text="{{lottery.miniappTip}}" |
@@ -71,10 +74,8 @@ | @@ -71,10 +74,8 @@ | ||
71 | </block> | 74 | </block> |
72 | </view> | 75 | </view> |
73 | </block> | 76 | </block> |
74 | - </view> | ||
75 | - <view class="foot"></view> | ||
76 | - | ||
77 | -</block> | 77 | +</view> |
78 | +<view class="foot"></view> | ||
78 | 79 | ||
79 | <import src="../../vendors/zanui/actionsheet/index.wxml"/> | 80 | <import src="../../vendors/zanui/actionsheet/index.wxml"/> |
80 | <template is="zan-actionsheet" data="{{...actionsheet}}"/> | 81 | <template is="zan-actionsheet" data="{{...actionsheet}}"/> |
pages/zeroSell/error.js
0 → 100644
pages/zeroSell/error.json
0 → 100644
pages/zeroSell/error.wxml
0 → 100644
pages/zeroSell/error.wxss
0 → 100644
1 | +.offline-box { | ||
2 | + font-size: 32rpx; | ||
3 | + width: 100%; | ||
4 | + position: fixed; | ||
5 | + top: 50%; | ||
6 | + text-align: center; | ||
7 | + transform: translateY(-50%); | ||
8 | +} | ||
9 | + | ||
10 | +.offline-bg { | ||
11 | + height: 200px; | ||
12 | + width: 200px; | ||
13 | +} | ||
14 | + | ||
15 | +.slogan { | ||
16 | + margin-top: 80rpx; | ||
17 | +} | ||
18 | + | ||
19 | +.refresh { | ||
20 | + margin-left: 50%; | ||
21 | + transform: translate(-50%); | ||
22 | + width: 240rpx; | ||
23 | + margin-top: 40rpx; | ||
24 | + padding: 20rpx; | ||
25 | + border-radius: 4rpx; | ||
26 | + background-color: #444; | ||
27 | + color: #fff; | ||
28 | +} |
@@ -34,7 +34,7 @@ Page(Object.assign({ | @@ -34,7 +34,7 @@ Page(Object.assign({ | ||
34 | }, { | 34 | }, { |
35 | page: 1, | 35 | page: 1, |
36 | products: [] | 36 | products: [] |
37 | - },{ | 37 | + }, { |
38 | page: 1, | 38 | page: 1, |
39 | products: [] | 39 | products: [] |
40 | }], | 40 | }], |
@@ -101,12 +101,9 @@ Page(Object.assign({ | @@ -101,12 +101,9 @@ Page(Object.assign({ | ||
101 | this.setData({ | 101 | this.setData({ |
102 | tabIndex: Number(options.tabIndex) | 102 | tabIndex: Number(options.tabIndex) |
103 | }) | 103 | }) |
104 | - this._init(options.tabIndex); | ||
105 | - } else { | ||
106 | - this._init(); | ||
107 | } | 104 | } |
108 | new app.WeToast(); | 105 | new app.WeToast(); |
109 | - if(options && (Number(options.reload) !== 0)) { | 106 | + if (options && (Number(options.reload) !== 0)) { |
110 | this._getResouceCode() | 107 | this._getResouceCode() |
111 | } | 108 | } |
112 | this._getBottomBanner(); | 109 | this._getBottomBanner(); |
@@ -115,6 +112,11 @@ Page(Object.assign({ | @@ -115,6 +112,11 @@ Page(Object.assign({ | ||
115 | 112 | ||
116 | onShow() { | 113 | onShow() { |
117 | let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0; | 114 | let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0; |
115 | + if (this.data.tabIndex) { | ||
116 | + this._init(this.data.tabIndex); | ||
117 | + } else { | ||
118 | + this._init(); | ||
119 | + } | ||
118 | 120 | ||
119 | this.setData({ | 121 | this.setData({ |
120 | hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false, | 122 | hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false, |
@@ -309,7 +311,7 @@ Page(Object.assign({ | @@ -309,7 +311,7 @@ Page(Object.assign({ | ||
309 | let oldData = my_zero_list[type].data; | 311 | let oldData = my_zero_list[type].data; |
310 | let key = `my_zero_list[${type}].data`; | 312 | let key = `my_zero_list[${type}].data`; |
311 | let keyPage = `my_zero_list[${type}].page`; | 313 | let keyPage = `my_zero_list[${type}].page`; |
312 | - this.service.getMyList({ type, page }).then(res => { | 314 | + this.service.getMyList({type, page}).then(res => { |
313 | let data = [] | 315 | let data = [] |
314 | if (res && res.code === 200) { | 316 | if (res && res.code === 200) { |
315 | data = res.data; | 317 | data = res.data; |
@@ -347,10 +349,10 @@ Page(Object.assign({ | @@ -347,10 +349,10 @@ Page(Object.assign({ | ||
347 | this._init(); | 349 | this._init(); |
348 | }, | 350 | }, |
349 | 351 | ||
350 | - getUserInfo: function(e) { | 352 | + getUserInfo: function (e) { |
351 | var that = this; | 353 | var that = this; |
352 | if (e.detail.errMsg === 'getUserInfo:ok') { | 354 | if (e.detail.errMsg === 'getUserInfo:ok') { |
353 | - decodeUnionId(app.getWechatThirdSession(), e, function(response) { | 355 | + decodeUnionId(app.getWechatThirdSession(), e, function (response) { |
354 | if (response.isHaveUnionID) { | 356 | if (response.isHaveUnionID) { |
355 | that.setData({ | 357 | that.setData({ |
356 | hasUnionID: true, | 358 | hasUnionID: true, |
@@ -358,27 +360,28 @@ Page(Object.assign({ | @@ -358,27 +360,28 @@ Page(Object.assign({ | ||
358 | } | 360 | } |
359 | }); | 361 | }); |
360 | } else { | 362 | } else { |
361 | - openAuthorizeSettings(function(response) { | 363 | + openAuthorizeSettings(function (response) { |
362 | if (response.isHaveUnionID) { | 364 | if (response.isHaveUnionID) { |
363 | that.setData({ | 365 | that.setData({ |
364 | hasUnionID: true, | 366 | hasUnionID: true, |
365 | }) | 367 | }) |
366 | - }; | 368 | + } |
369 | + ; | ||
367 | }); | 370 | }); |
368 | } | 371 | } |
369 | }, | 372 | }, |
370 | 373 | ||
371 | - getPhoneNumber: function(e) { | 374 | + getPhoneNumber: function (e) { |
372 | var that = this; | 375 | var that = this; |
373 | if (e.detail.errMsg === 'getPhoneNumber:ok') { | 376 | if (e.detail.errMsg === 'getPhoneNumber:ok') { |
374 | - decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function(result) { | 377 | + decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function (result) { |
375 | // console.log('!!!!result',result) | 378 | // console.log('!!!!result',result) |
376 | if (result.code != 200) { | 379 | if (result.code != 200) { |
377 | that.wetoast.toast({ | 380 | that.wetoast.toast({ |
378 | title: result.message, | 381 | title: result.message, |
379 | titleClassName: 'wetoast-title', | 382 | titleClassName: 'wetoast-title', |
380 | duration: 1000, | 383 | duration: 1000, |
381 | - success: function() { | 384 | + success: function () { |
382 | that.loginAndRegisterTapped() | 385 | that.loginAndRegisterTapped() |
383 | }.bind(that) | 386 | }.bind(that) |
384 | }); | 387 | }); |
@@ -386,7 +389,7 @@ Page(Object.assign({ | @@ -386,7 +389,7 @@ Page(Object.assign({ | ||
386 | if (result.is_register) { | 389 | if (result.is_register) { |
387 | that.showZanToast({ | 390 | that.showZanToast({ |
388 | title: '欢迎加入Yoho!Family!新人礼包已发放到个人中心-优惠券,请注意查收', | 391 | title: '欢迎加入Yoho!Family!新人礼包已发放到个人中心-优惠券,请注意查收', |
389 | - success: function() { | 392 | + success: function () { |
390 | let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0; | 393 | let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0; |
391 | that.setData({ | 394 | that.setData({ |
392 | uid, | 395 | uid, |
@@ -427,13 +430,13 @@ Page(Object.assign({ | @@ -427,13 +430,13 @@ Page(Object.assign({ | ||
427 | content: '检测到您未打开微信用户信息授权,开启后即可进行登录', | 430 | content: '检测到您未打开微信用户信息授权,开启后即可进行登录', |
428 | confirmText: "去开启", | 431 | confirmText: "去开启", |
429 | confirmColor: "#000000", | 432 | confirmColor: "#000000", |
430 | - success: function(res) { | 433 | + success: function (res) { |
431 | if (res.confirm) { | 434 | if (res.confirm) { |
432 | wx.openSetting({ | 435 | wx.openSetting({ |
433 | success: (res) => { | 436 | success: (res) => { |
434 | // console.log(res.authSetting["scope.userInfo"]) | 437 | // console.log(res.authSetting["scope.userInfo"]) |
435 | if (res.authSetting["scope.userInfo"] !== null && res.authSetting["scope.userInfo"] !== undefined && res.authSetting["scope.userInfo"] === true) { | 438 | if (res.authSetting["scope.userInfo"] !== null && res.authSetting["scope.userInfo"] !== undefined && res.authSetting["scope.userInfo"] === true) { |
436 | - getUnionID(app.getWechatThirdSession(), function(response) { | 439 | + getUnionID(app.getWechatThirdSession(), function (response) { |
437 | // console.log(response) | 440 | // console.log(response) |
438 | }) | 441 | }) |
439 | } | 442 | } |
@@ -485,7 +488,7 @@ Page(Object.assign({ | @@ -485,7 +488,7 @@ Page(Object.assign({ | ||
485 | }, | 488 | }, |
486 | 489 | ||
487 | loginChangeStatus(params) { | 490 | loginChangeStatus(params) { |
488 | - let { openType } = params; | 491 | + let {openType} = params; |
489 | this.setData({ | 492 | this.setData({ |
490 | openType | 493 | openType |
491 | }) | 494 | }) |
@@ -513,20 +516,20 @@ Page(Object.assign({ | @@ -513,20 +516,20 @@ Page(Object.assign({ | ||
513 | }); | 516 | }); |
514 | }, | 517 | }, |
515 | 518 | ||
516 | - share({ detail }) { | 519 | + share({detail}) { |
517 | this.setData({ | 520 | this.setData({ |
518 | 'actionsheet.show': true, | 521 | 'actionsheet.show': true, |
519 | 'shareProduct': detail | 522 | 'shareProduct': detail |
520 | }) | 523 | }) |
521 | }, | 524 | }, |
522 | 525 | ||
523 | - handleZanActionsheetCancel({ componentId }) { | 526 | + handleZanActionsheetCancel({componentId}) { |
524 | this.setData({ | 527 | this.setData({ |
525 | 'actionsheet.show': false | 528 | 'actionsheet.show': false |
526 | }) | 529 | }) |
527 | }, | 530 | }, |
528 | 531 | ||
529 | - handleZanActionsheetClick({ componentId, index }) { | 532 | + handleZanActionsheetClick({componentId, index}) { |
530 | this.setData({ | 533 | this.setData({ |
531 | 'actionsheet.show': false | 534 | 'actionsheet.show': false |
532 | }); | 535 | }); |
@@ -545,7 +548,8 @@ Page(Object.assign({ | @@ -545,7 +548,8 @@ Page(Object.assign({ | ||
545 | product_qrCode: qrcode | 548 | product_qrCode: qrcode |
546 | }); | 549 | }); |
547 | } | 550 | } |
548 | - }; | 551 | + } |
552 | + ; | ||
549 | }, | 553 | }, |
550 | onShareAppMessage(res) { | 554 | onShareAppMessage(res) { |
551 | let params = { | 555 | let params = { |
-
Please register or login to post a comment