Commit 89ffb03d09363fc76185701775eadce9861536f8
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
2 changed files
with
19 additions
and
10 deletions
packageA/pages/distribution/goods/goods.js
@@ -107,6 +107,7 @@ Page({ | @@ -107,6 +107,7 @@ Page({ | ||
107 | // url = '/api/weshop/goods/page?dis_type=1'; | 107 | // url = '/api/weshop/goods/page?dis_type=1'; |
108 | // this.getData(true, '/api/weshop/goods/page?dis_type=1', this.data.currentQuery); | 108 | // this.getData(true, '/api/weshop/goods/page?dis_type=1', this.data.currentQuery); |
109 | }; | 109 | }; |
110 | + currentQuery.orderType = 'desc'; | ||
110 | currentQuery.dis_type = 1; | 111 | currentQuery.dis_type = 1; |
111 | this.getData(true, url, currentQuery); | 112 | this.getData(true, url, currentQuery); |
112 | 113 | ||
@@ -330,7 +331,7 @@ Page({ | @@ -330,7 +331,7 @@ Page({ | ||
330 | if(data.orderField) delete data.orderField; | 331 | if(data.orderField) delete data.orderField; |
331 | if(data.orderType) delete data.orderType; | 332 | if(data.orderType) delete data.orderType; |
332 | if(this.data.inputVal) { | 333 | if(this.data.inputVal) { |
333 | - data.key = this.data.inputVal; | 334 | + data.key_str = this.data.inputVal; |
334 | }; | 335 | }; |
335 | if(this.data.isHiddenDropdown) { | 336 | if(this.data.isHiddenDropdown) { |
336 | if(data.nation_id) delete data.nation_id; | 337 | if(data.nation_id) delete data.nation_id; |
@@ -352,8 +353,8 @@ Page({ | @@ -352,8 +353,8 @@ Page({ | ||
352 | url = '/api/weshop/goods/page?searchtype=1'; | 353 | url = '/api/weshop/goods/page?searchtype=1'; |
353 | }; | 354 | }; |
354 | this.getData(true, url, data) | 355 | this.getData(true, url, data) |
355 | - .then(function() { | ||
356 | - callback(); | 356 | + .then(function(callback) { |
357 | + if(callback) callback(); | ||
357 | }); | 358 | }); |
358 | }, | 359 | }, |
359 | 360 | ||
@@ -362,6 +363,7 @@ Page({ | @@ -362,6 +363,7 @@ Page({ | ||
362 | */ | 363 | */ |
363 | clickSort() { | 364 | clickSort() { |
364 | let data = this.data.currentQuery; | 365 | let data = this.data.currentQuery; |
366 | + // if(data.orderType == 'desc') delete data.orderType; | ||
365 | if(!this.data.isSort) { | 367 | if(!this.data.isSort) { |
366 | this.setData({ | 368 | this.setData({ |
367 | isSort: true, | 369 | isSort: true, |
@@ -406,8 +408,11 @@ Page({ | @@ -406,8 +408,11 @@ Page({ | ||
406 | isDescending = false; | 408 | isDescending = false; |
407 | }; | 409 | }; |
408 | }; | 410 | }; |
411 | + | ||
409 | if(data.page) delete data.page; | 412 | if(data.page) delete data.page; |
410 | if(data.key) delete data.key; | 413 | if(data.key) delete data.key; |
414 | + | ||
415 | + // data.orderType = 'desc'; | ||
411 | // if(data.nation_id) delete data.nation_id; | 416 | // if(data.nation_id) delete data.nation_id; |
412 | // if(data.brand_id) delete data.brand_id; | 417 | // if(data.brand_id) delete data.brand_id; |
413 | // if(data.startprice) delete data.startprice; | 418 | // if(data.startprice) delete data.startprice; |
@@ -426,7 +431,8 @@ Page({ | @@ -426,7 +431,8 @@ Page({ | ||
426 | switch(currentIndex) { | 431 | switch(currentIndex) { |
427 | case 0: { | 432 | case 0: { |
428 | if(data.orderField) delete data.orderField; | 433 | if(data.orderField) delete data.orderField; |
429 | - if(data.orderType) delete data.orderType; | 434 | + // if(data.orderType) delete data.orderType; |
435 | + data.orderType = 'desc'; | ||
430 | if(options.index == 1) {//下架:已选 | 436 | if(options.index == 1) {//下架:已选 |
431 | data.searchtype = 1; | 437 | data.searchtype = 1; |
432 | data.dis_type = 1; | 438 | data.dis_type = 1; |
@@ -435,29 +441,32 @@ Page({ | @@ -435,29 +441,32 @@ Page({ | ||
435 | }; | 441 | }; |
436 | case 1: { | 442 | case 1: { |
437 | if(options.index == 0) {//上架:销量排序 | 443 | if(options.index == 0) {//上架:销量排序 |
438 | - if(data.orderType) delete data.orderType; | 444 | + // if(data.orderType) delete data.orderType; |
439 | data.orderField = 'sales_sum'; | 445 | data.orderField = 'sales_sum'; |
440 | } else {//下架:必营 | 446 | } else {//下架:必营 |
441 | if(data.searchtype) delete data.searchtype; | 447 | if(data.searchtype) delete data.searchtype; |
442 | if(data.orderField) delete data.orderField; | 448 | if(data.orderField) delete data.orderField; |
443 | - if(data.orderType) delete data.orderType; | 449 | + // if(data.orderType) delete data.orderType; |
444 | data.dis_type = 0; | 450 | data.dis_type = 0; |
445 | }; | 451 | }; |
452 | + data.orderType = 'desc'; | ||
446 | break; | 453 | break; |
447 | }; | 454 | }; |
448 | case 2: { | 455 | case 2: { |
449 | if(options.index == 0) {//上架:评论排序 | 456 | if(options.index == 0) {//上架:评论排序 |
450 | - if(data.orderType) delete data.orderType; | 457 | + // if(data.orderType) delete data.orderType; |
451 | data.orderField = 'comment_count'; | 458 | data.orderField = 'comment_count'; |
452 | } else {//下架:销量排序 | 459 | } else {//下架:销量排序 |
453 | - if(data.orderType) delete data.orderType; | 460 | + // if(data.orderType) delete data.orderType; |
454 | data.orderField = 'sales_sum'; | 461 | data.orderField = 'sales_sum'; |
455 | data.dis_type = 1; | 462 | data.dis_type = 1; |
456 | data.searchtype = 1; | 463 | data.searchtype = 1; |
457 | }; | 464 | }; |
465 | + data.orderType = 'desc'; | ||
458 | break; | 466 | break; |
459 | }; | 467 | }; |
460 | case 3: { | 468 | case 3: { |
469 | + // if(data.orderType) delete data.orderType; | ||
461 | data.orderField = 'shop_price'; | 470 | data.orderField = 'shop_price'; |
462 | data.dis_type = 1; | 471 | data.dis_type = 1; |
463 | break; | 472 | break; |
packageA/pages/distribution/goods/goods.wxml
@@ -13,13 +13,13 @@ | @@ -13,13 +13,13 @@ | ||
13 | 13 | ||
14 | <view class="dropdown {{isHiddenDropdown ? '':'show'}}" hidden="{{isHiddenDropdown}}"> | 14 | <view class="dropdown {{isHiddenDropdown ? '':'show'}}" hidden="{{isHiddenDropdown}}"> |
15 | <view class="dropdown-wrapper"> | 15 | <view class="dropdown-wrapper"> |
16 | - <view class="pd20 bsbb"> | 16 | + <view class="pd20 bsbb" wx:if="{{nationList.length != 0}}"> |
17 | <view class="pdb20">国家</view> | 17 | <view class="pdb20">国家</view> |
18 | <view class="flex wrap t-c" bindtap="select"> | 18 | <view class="flex wrap t-c" bindtap="select"> |
19 | <view class="w25 pdt20" wx:for="{{nationList}}"><text class="label {{nationIndex == index ? 'selected':''}}" data-id="{{item.nation_id}}" data-name="nation" data-index="{{index}}">{{item.name}}</text></view> | 19 | <view class="w25 pdt20" wx:for="{{nationList}}"><text class="label {{nationIndex == index ? 'selected':''}}" data-id="{{item.nation_id}}" data-name="nation" data-index="{{index}}">{{item.name}}</text></view> |
20 | </view> | 20 | </view> |
21 | </view> | 21 | </view> |
22 | - <view class="pd20 bsbb" > | 22 | + <view class="pd20 bsbb" wx:if="{{brandList.length != 0}}"> |
23 | <view class="pdb20">品牌</view> | 23 | <view class="pdb20">品牌</view> |
24 | <view class="flex wrap t-c" bindtap="select"> | 24 | <view class="flex wrap t-c" bindtap="select"> |
25 | <view class="w25 pdt20" wx:for="{{brandList}}"><text class="label {{brandIndex == index ? 'selected':''}}" data-id="{{item.brand_id}}" data-name="brand" data-index="{{index}}">{{item.name}}</text></view> | 25 | <view class="w25 pdt20" wx:for="{{brandList}}"><text class="label {{brandIndex == index ? 'selected':''}}" data-id="{{item.brand_id}}" data-name="brand" data-index="{{index}}">{{item.name}}</text></view> |