fbda758c by simon

默认提交

1 parent 8fa3e323
...@@ -36,9 +36,6 @@ Page({ ...@@ -36,9 +36,6 @@ Page({
36 isInit: false 36 isInit: false
37 }) 37 })
38 return new Promise((resolve, reject) => { 38 return new Promise((resolve, reject) => {
39 this.setData({
40 rankInfo: {}
41 })
42 let status = this.data.status; 39 let status = this.data.status;
43 app.post({ 40 app.post({
44 url: app.api.activity, 41 url: app.api.activity,
...@@ -46,17 +43,11 @@ Page({ ...@@ -46,17 +43,11 @@ Page({
46 key: status 43 key: status
47 } 44 }
48 }).then((result) => { 45 }).then((result) => {
49 // console.log("result:", result)
50 let rankInfo = this.formatRankInfo(result, status); 46 let rankInfo = this.formatRankInfo(result, status);
51 // console.log("rankInfo:", rankInfo)
52 this.setData({
53 isInit: true
54 })
55 if (rankInfo) {
56 this.setData({ 47 this.setData({
48 isInit: true,
57 rankInfo: rankInfo 49 rankInfo: rankInfo
58 }) 50 });
59 }
60 console.log("rankInfo 1:", rankInfo); 51 console.log("rankInfo 1:", rankInfo);
61 resolve(); 52 resolve();
62 }) 53 })
...@@ -64,16 +55,13 @@ Page({ ...@@ -64,16 +55,13 @@ Page({
64 }, 55 },
65 56
66 /** 57 /**
67 * 推广积分排行 58 * 历史积分排行
68 */ 59 */
69 queryActivityHistory() { 60 queryActivityHistory() {
70 this.setData({ 61 this.setData({
71 isInit: false 62 isInit: false
72 }) 63 })
73 return new Promise((resolve, reject) => { 64 return new Promise((resolve, reject) => {
74 this.setData({
75 rankInfo: {}
76 })
77 let status = this.data.status; 65 let status = this.data.status;
78 app.post({ 66 app.post({
79 url: app.api.activityHistory, 67 url: app.api.activityHistory,
...@@ -88,7 +76,7 @@ Page({ ...@@ -88,7 +76,7 @@ Page({
88 isInit: true, 76 isInit: true,
89 historyRankInfoList: historyRankInfoList 77 historyRankInfoList: historyRankInfoList
90 }) 78 })
91 console.log("rankInfo 2:", historyRankInfoList); 79 console.log("rankInfo 2 history:", historyRankInfoList);
92 this.setHistory(); 80 this.setHistory();
93 resolve(); 81 resolve();
94 }) 82 })
......
...@@ -112,6 +112,7 @@ $contentWidth:690px; ...@@ -112,6 +112,7 @@ $contentWidth:690px;
112 color: #666666; 112 color: #666666;
113 font-size: 24px; 113 font-size: 24px;
114 padding: 5px 0; 114 padding: 5px 0;
115 width: 100%;
115 } 116 }
116 117
117 .t2 {} 118 .t2 {}
......
...@@ -17,18 +17,19 @@ ...@@ -17,18 +17,19 @@
17 </view> 17 </view>
18 <!-- 排行 --> 18 <!-- 排行 -->
19 <view class="border rank"> 19 <view class="border rank">
20 <block wx:if="{{rankInfo && rankInfo.memberList.length > 0}}"> 20 <!-- <block wx:if="{{rankInfo && rankInfo.memberList.length > 0}}"> -->
21 <!-- 功能区 --> 21 <!-- 功能区 -->
22 <view class="rank-func"> 22 <view class="rank-func">
23 <view class="rank-func-item"> 23 <view class="rank-func-item">
24 <!-- 本轮 -->
24 <view wx:if="{{turnsIndex == 0}}" class="pubish"> 25 <view wx:if="{{turnsIndex == 0}}" class="pubish">
25 <view class="t1"> 26 <view class="t1">
26 本轮周期: 27 本轮周期:
27 <span>{{rankInfo.activityName}}</span> 28 <span>{{rankInfo.activityName || '-' }}</span>
28 </view> 29 </view>
29 <view wx:if="{{status == 'promotion'}}" class="t1 t2"> 30 <view wx:if="{{status == 'promotion'}}" class="t1 t2">
30 本轮奖品: 31 本轮奖品:
31 <span class="c1">{{rankInfo.prizeName}}</span> 32 <span class="c1">{{rankInfo.prizeName || '-'}}</span>
32 </view> 33 </view>
33 <view wx:if="{{status == 'rank'}}" class="t1 t2"> 34 <view wx:if="{{status == 'rank'}}" class="t1 t2">
34 我的名次: 35 我的名次:
...@@ -36,11 +37,12 @@ ...@@ -36,11 +37,12 @@
36 37
37 </view> 38 </view>
38 </view> 39 </view>
40 <!-- 历史 -->
39 <view wx:else class="pubish"> 41 <view wx:else class="pubish">
40 <picker value="{{historyIndex}}" range="{{historyRankInfoList}}" range-key="activityName" bindchange="bindHistoryChange"> 42 <picker value="{{historyIndex}}" range="{{historyRankInfoList}}" range-key="activityName" bindchange="bindHistoryChange">
41 <view class="func"> 43 <view class="func">
42 <image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" /> 44 <image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" />
43 {{rankInfo.activityName}} 45 {{rankInfo.activityName || '-'}}
44 <image class="arrow" mode="aspectFit" src="../../image/icon/icon-filter-down-on.png" /> 46 <image class="arrow" mode="aspectFit" src="../../image/icon/icon-filter-down-on.png" />
45 {{dateStart}} 47 {{dateStart}}
46 </view> 48 </view>
...@@ -56,6 +58,7 @@ ...@@ -56,6 +58,7 @@
56 </view> 58 </view>
57 </view> 59 </view>
58 </view> 60 </view>
61 <block wx:if="{{rankInfo}}">
59 <!-- 标题 --> 62 <!-- 标题 -->
60 <view class="tit"> 63 <view class="tit">
61 <view class="tt t1">名次</view> 64 <view class="tt t1">名次</view>
...@@ -95,7 +98,6 @@ ...@@ -95,7 +98,6 @@
95 </block> 98 </block>
96 <block wx:else> 99 <block wx:else>
97 <view class="empty-tips" wx:if="{{isInit}}"> 100 <view class="empty-tips" wx:if="{{isInit}}">
98 <!-- <span class="iconfont iconempty"></span> -->
99 <view class="tips">暂未开启积分排行,敬请期待</view> 101 <view class="tips">暂未开启积分排行,敬请期待</view>
100 </view> 102 </view>
101 </block> 103 </block>
......