Commit 0ea0d5edf38ab9399debe6d8cea5c6021a72e2f5

Authored by yvan.ni
1 parent 0637eb27

服务卡购买自定义的优化

packageA/pages/cardDetails/cardDetails.wxml
... ... @@ -17,3 +17,5 @@
17 17 <view class="pd20">{{details.serviceContent}}</view>
18 18 </view>
19 19 </view>
  20 +
  21 +<nav_box object="{{item.content}}"></nav_box>
... ...
packageA/pages/cardList/cardList.js
... ... @@ -61,6 +61,7 @@ Page({
61 61 isLogin: true,
62 62 });
63 63  
  64 + currentQuery.page=1;
64 65 this.getData(true, url, currentQuery);
65 66 // app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, {
66 67 // data: {
... ... @@ -137,9 +138,7 @@ Page({
137 138 /**
138 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 142 app.request.promiseGet(url, {
144 143 data: data,
145 144 isShowLoading: true,
... ... @@ -172,18 +171,18 @@ Page({
172 171 self.setData({
173 172 'list.pageData': []
174 173 });
175   - };
176   - resolve();
  174 + };
  175 + if(callback) callback();
  176 +
177 177 })
178 178 .catch(function(err) {
179 179 console.log('出错拉!!!!',err);
180 180 self.setData({
181 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 206 isLoading: true,
208 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 3 "enablePullDownRefresh": false,
4 4 "usingComponents": {
5 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 10 \ No newline at end of file
... ...
packageA/pages/cardList/cardList.wxml
... ... @@ -33,7 +33,7 @@
33 33 <view wx:for="{{list.pageData}}" class="{{object.column=='1'?'w100':'w50'}} {{index%2==1?'ml':''}} bg-white"
34 34 bindtap="go_goods" data-gid="{{item.id}}"
35 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 37 <view class="flex fdc space-bt f1 pdl20">
38 38 <view>
39 39 <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view>
... ... @@ -81,4 +81,5 @@
81 81 <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view>
82 82 </scroll-view>
83 83 </view>
84   -</block>
85 84 \ No newline at end of file
  85 +</block>
  86 +<nav_box id="nav_box"></nav_box>
86 87 \ No newline at end of file
... ...
packageA/pages/cardList/cardList.wxss
... ... @@ -69,9 +69,9 @@ page {
69 69 .list_item{ display: inline-block;}
70 70 .w100{ width: 100%;}
71 71 .w50{ width: 49%; }
72   -
  72 +.w50.ml{margin-left: 15rpx;}
73 73  
74 74 .w50 image{ width: 100%; height: 340rpx; }
75 75 .flex-set{display: flex;flex-wrap: wrap;}
76   -.ml{margin-left: 15rpx;}
  76 +
77 77 .b-bottom{ border-bottom:1rpx solid #fff}
78 78 \ No newline at end of file
... ...