Commit 0ea0d5edf38ab9399debe6d8cea5c6021a72e2f5
1 parent
0637eb27
服务卡购买自定义的优化
Showing
5 changed files
with
18 additions
and
18 deletions
packageA/pages/cardDetails/cardDetails.wxml
packageA/pages/cardList/cardList.js
| @@ -61,6 +61,7 @@ Page({ | @@ -61,6 +61,7 @@ Page({ | ||
| 61 | isLogin: true, | 61 | isLogin: true, |
| 62 | }); | 62 | }); |
| 63 | 63 | ||
| 64 | + currentQuery.page=1; | ||
| 64 | this.getData(true, url, currentQuery); | 65 | this.getData(true, url, currentQuery); |
| 65 | // app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, { | 66 | // app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, { |
| 66 | // data: { | 67 | // data: { |
| @@ -137,9 +138,7 @@ Page({ | @@ -137,9 +138,7 @@ Page({ | ||
| 137 | /** | 138 | /** |
| 138 | * promiseGet请求数据 | 139 | * promiseGet请求数据 |
| 139 | */ | 140 | */ |
| 140 | - getData: function(isInit, url, data) { | ||
| 141 | - return new Promise(function(resolve, reject) { | ||
| 142 | - | 141 | + getData: function(isInit, url, data,callback) { |
| 143 | app.request.promiseGet(url, { | 142 | app.request.promiseGet(url, { |
| 144 | data: data, | 143 | data: data, |
| 145 | isShowLoading: true, | 144 | isShowLoading: true, |
| @@ -172,18 +171,18 @@ Page({ | @@ -172,18 +171,18 @@ Page({ | ||
| 172 | self.setData({ | 171 | self.setData({ |
| 173 | 'list.pageData': [] | 172 | 'list.pageData': [] |
| 174 | }); | 173 | }); |
| 175 | - }; | ||
| 176 | - resolve(); | 174 | + }; |
| 175 | + if(callback) callback(); | ||
| 176 | + | ||
| 177 | }) | 177 | }) |
| 178 | .catch(function(err) { | 178 | .catch(function(err) { |
| 179 | console.log('出错拉!!!!',err); | 179 | console.log('出错拉!!!!',err); |
| 180 | self.setData({ | 180 | self.setData({ |
| 181 | 'list.pageData': [] | 181 | 'list.pageData': [] |
| 182 | }); | 182 | }); |
| 183 | + | ||
| 184 | + if(callback) callback(); | ||
| 183 | }); | 185 | }); |
| 184 | - | ||
| 185 | - }); | ||
| 186 | - | ||
| 187 | }, | 186 | }, |
| 188 | 187 | ||
| 189 | 188 | ||
| @@ -207,12 +206,9 @@ Page({ | @@ -207,12 +206,9 @@ Page({ | ||
| 207 | isLoading: true, | 206 | isLoading: true, |
| 208 | pageNum: this.data.pageNum + 1 | 207 | pageNum: this.data.pageNum + 1 |
| 209 | }); | 208 | }); |
| 210 | - requestData.page = this.data.pageNum; | 209 | + requestData.page = this.data.pageNum; |
| 210 | + this.getData(false, url, requestData,callback) | ||
| 211 | 211 | ||
| 212 | - this.getData(false, url, requestData) | ||
| 213 | - .then(function() { | ||
| 214 | - callback(); | ||
| 215 | - }); | ||
| 216 | }; | 212 | }; |
| 217 | }, | 213 | }, |
| 218 | 214 |
packageA/pages/cardList/cardList.json
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | "enablePullDownRefresh": false, | 3 | "enablePullDownRefresh": false, |
| 4 | "usingComponents": { | 4 | "usingComponents": { |
| 5 | "nodata": "/components/nodata/nodata", | 5 | "nodata": "/components/nodata/nodata", |
| 6 | - "advertising":"/components/diy_advertising/diy_advertising" | 6 | + "advertising":"/components/diy_advertising/diy_advertising", |
| 7 | + "nav_box":"/components/nav_box/nav_box" | ||
| 7 | } | 8 | } |
| 8 | } | 9 | } |
| 9 | \ No newline at end of file | 10 | \ No newline at end of file |
packageA/pages/cardList/cardList.wxml
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | <view wx:for="{{list.pageData}}" class="{{object.column=='1'?'w100':'w50'}} {{index%2==1?'ml':''}} bg-white" | 33 | <view wx:for="{{list.pageData}}" class="{{object.column=='1'?'w100':'w50'}} {{index%2==1?'ml':''}} bg-white" |
| 34 | bindtap="go_goods" data-gid="{{item.id}}" | 34 | bindtap="go_goods" data-gid="{{item.id}}" |
| 35 | style="margin-bottom: 20rpx;"> | 35 | style="margin-bottom: 20rpx;"> |
| 36 | - <view style="width: 100%;"><image src="{{imghost + item.imgUrl}}" mode="aspectFill"/></view> | 36 | + <view style="width: 100%;"><image style="width: 100%;" src="{{imghost + item.imgUrl}}" mode="aspectFill"/></view> |
| 37 | <view class="flex fdc space-bt f1 pdl20"> | 37 | <view class="flex fdc space-bt f1 pdl20"> |
| 38 | <view> | 38 | <view> |
| 39 | <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view> | 39 | <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view> |
| @@ -81,4 +81,5 @@ | @@ -81,4 +81,5 @@ | ||
| 81 | <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view> | 81 | <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view> |
| 82 | </scroll-view> | 82 | </scroll-view> |
| 83 | </view> | 83 | </view> |
| 84 | -</block> | ||
| 85 | \ No newline at end of file | 84 | \ No newline at end of file |
| 85 | +</block> | ||
| 86 | +<nav_box id="nav_box"></nav_box> | ||
| 86 | \ No newline at end of file | 87 | \ No newline at end of file |
packageA/pages/cardList/cardList.wxss
| @@ -69,9 +69,9 @@ page { | @@ -69,9 +69,9 @@ page { | ||
| 69 | .list_item{ display: inline-block;} | 69 | .list_item{ display: inline-block;} |
| 70 | .w100{ width: 100%;} | 70 | .w100{ width: 100%;} |
| 71 | .w50{ width: 49%; } | 71 | .w50{ width: 49%; } |
| 72 | - | 72 | +.w50.ml{margin-left: 15rpx;} |
| 73 | 73 | ||
| 74 | .w50 image{ width: 100%; height: 340rpx; } | 74 | .w50 image{ width: 100%; height: 340rpx; } |
| 75 | .flex-set{display: flex;flex-wrap: wrap;} | 75 | .flex-set{display: flex;flex-wrap: wrap;} |
| 76 | -.ml{margin-left: 15rpx;} | 76 | + |
| 77 | .b-bottom{ border-bottom:1rpx solid #fff} | 77 | .b-bottom{ border-bottom:1rpx solid #fff} |
| 78 | \ No newline at end of file | 78 | \ No newline at end of file |