Commit 9d83b819af4ab65c0e078c94e1996a815880c733
1 parent
2b241324
服务卡项详情页详情信息修改;指定类别商品搜索修改
Showing
4 changed files
with
83 additions
and
19 deletions
packageA/pages/goodsInfo/goodsInfo.js
| ... | ... | @@ -113,7 +113,7 @@ Page({ |
| 113 | 113 | is_sec_mend: 0, |
| 114 | 114 | sto_sele_name: "", //选中的门店名称 |
| 115 | 115 | sto_sele_id: "", //选中的门店id |
| 116 | - sto_sele_keyid:'', //选中的门店线下 | |
| 116 | + sto_sele_keyid:'', //选中的门店线下 | |
| 117 | 117 | sto_sele_distr: "", //选择的门店的配送方式 |
| 118 | 118 | is_show_sto_cat: 1, //是否显示门店分类 |
| 119 | 119 | only_pk: null, |
| ... | ... | @@ -269,11 +269,11 @@ Page({ |
| 269 | 269 | |
| 270 | 270 | ee.setData({ gid: gid}); |
| 271 | 271 | |
| 272 | - if(first_leader){ | |
| 272 | + if(first_leader) { | |
| 273 | 273 | getApp().globalData.first_leader=first_leader; |
| 274 | 274 | //调用接口判断是不是会员 |
| 275 | 275 | getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ |
| 276 | - if(res.data.code==0){ | |
| 276 | + if(res.data.code==0) { | |
| 277 | 277 | getApp().globalData.guide_id=res.data.data.id; |
| 278 | 278 | } |
| 279 | 279 | }) |
| ... | ... | @@ -545,7 +545,8 @@ Page({ |
| 545 | 545 | }); |
| 546 | 546 | }; |
| 547 | 547 | |
| 548 | - console.log('!!!!!!~~~~~~~~~prom~~~~~~~~~~!!!!!!'); | |
| 548 | + // console.log('!!!!!!~~~~~~~~~prom~~~~~~~~~~!!!!!!'); | |
| 549 | + | |
| 549 | 550 | // this.setData({ |
| 550 | 551 | // prom, |
| 551 | 552 | // }); |
| ... | ... | @@ -667,6 +668,10 @@ Page({ |
| 667 | 668 | this.wait_for_store_config(); |
| 668 | 669 | |
| 669 | 670 | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 670 | 675 | i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, { |
| 671 | 676 | failRollback: !0, |
| 672 | 677 | success: function(t) { |
| ... | ... | @@ -772,11 +777,11 @@ Page({ |
| 772 | 777 | }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment(); |
| 773 | 778 | }, |
| 774 | 779 | |
| 775 | - tabClick2: function(t) { | |
| 776 | - this.setData({ | |
| 777 | - activeCategoryId2: t.currentTarget.id | |
| 778 | - }); | |
| 779 | - }, | |
| 780 | + // tabClick2: function(t) { | |
| 781 | + // this.setData({ | |
| 782 | + // activeCategoryId2: t.currentTarget.id | |
| 783 | + // }); | |
| 784 | + // }, | |
| 780 | 785 | |
| 781 | 786 | tabClick3: function(t) { |
| 782 | 787 | var e = this; |
| ... | ... | @@ -790,11 +795,11 @@ Page({ |
| 790 | 795 | } |
| 791 | 796 | }, |
| 792 | 797 | |
| 793 | - doScrollTop: function() { | |
| 794 | - wx.pageScrollTo({ | |
| 795 | - scrollTop: 0 | |
| 796 | - }); | |
| 797 | - }, | |
| 798 | + // doScrollTop: function() { | |
| 799 | + // wx.pageScrollTo({ | |
| 800 | + // scrollTop: 0 | |
| 801 | + // }); | |
| 802 | + // }, | |
| 798 | 803 | |
| 799 | 804 | tabComment: function() { |
| 800 | 805 | this.setData({ |
| ... | ... | @@ -3091,6 +3096,46 @@ Page({ |
| 3091 | 3096 | |
| 3092 | 3097 | |
| 3093 | 3098 | |
| 3099 | + //-- 检验商品的活动情况 -- | |
| 3100 | + check_gd_prom_new: function (func) { | |
| 3101 | + var th = this; | |
| 3102 | + var user_id = getApp().globalData.user_id; | |
| 3103 | + if (!user_id) user_id = 0; | |
| 3104 | + | |
| 3105 | + var url = '/api/weshop/activitylist/listGoodActInfo2'; | |
| 3106 | + var req_d = { | |
| 3107 | + "store_id": os.stoid, | |
| 3108 | + "goods_id": this.data.gid, | |
| 3109 | + "user_id": user_id, | |
| 3110 | + } | |
| 3111 | + getApp().request.get(url, { | |
| 3112 | + data: req_d, | |
| 3113 | + success: function (e) { | |
| 3114 | + if (e.data.code == 0 && e.data.data && e.data.data.length > 0) { | |
| 3115 | + var arr = e.data.data; | |
| 3116 | + var arr2 = arr.filter(function (e) { | |
| 3117 | + return e.s_time < ut.gettimestamp(); | |
| 3118 | + }) | |
| 3119 | + //-- 如果只有一个活动的话 -- | |
| 3120 | + if (arr.length == 1) { | |
| 3121 | + th.data.prom_type = arr[0].prom_type; | |
| 3122 | + th.data.prom_id = arr[0].act_id; | |
| 3123 | + } | |
| 3124 | + //-- 如果只有一个进行中的活动的话 -- | |
| 3125 | + else if (arr2.length == 1) { | |
| 3126 | + th.data.prom_type = arr2[0].prom_type; | |
| 3127 | + th.data.prom_id = arr2[0].act_id; | |
| 3128 | + } | |
| 3129 | + } | |
| 3130 | + //-- 调用回调 -- | |
| 3131 | + func(); | |
| 3132 | + } | |
| 3133 | + }); | |
| 3134 | + }, | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3094 | 3139 | |
| 3095 | 3140 | |
| 3096 | 3141 | ... | ... |
pages/goods/goodsList/goodsList.js
| ... | ... | @@ -442,7 +442,10 @@ Page({ |
| 442 | 442 | |
| 443 | 443 | |
| 444 | 444 | go_url:function (e) { |
| 445 | - var url=e.currentTarget.dataset.url; | |
| 445 | + var url = e.currentTarget.dataset.url; | |
| 446 | + var rq_data = JSON.stringify(this.data.rq_data); | |
| 447 | + url += `&o=${rq_data}`; | |
| 448 | + // console.log('url!!!=======<<<<', url); | |
| 446 | 449 | getApp().goto(url); |
| 447 | 450 | } |
| 448 | 451 | ... | ... |
pages/goods/goodsList/goodsList.wxml
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | <view class="pd20 flex ai-center jc_sb search_fixed"> |
| 20 | 20 | <!-- 搜索框 --> |
| 21 | 21 | <view class="search-box f1"> |
| 22 | - <navigator hover-class="none" url="/pages/goods/search/search?ladder_id={{ladder_id}}"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</navigator> | |
| 22 | + <view hover-class="none" data-url="/pages/goods/search/search?ladder_id={{ladder_id}}" bindtap="go_url"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</view> | |
| 23 | 23 | </view> |
| 24 | 24 | <!-- 单列/双列 显示切换 --> |
| 25 | 25 | <text class="iconfont {{isToggle ? 'icon-fenlie':'icon-fenxiang'}} pdl30 fs36" bindtap="bindToggleDisplay"></text> | ... | ... |
pages/goods/search/search.js
| ... | ... | @@ -30,6 +30,8 @@ Page({ |
| 30 | 30 | |
| 31 | 31 | onLoad: function(t) { |
| 32 | 32 | this.data.rq_data=t; |
| 33 | + this.data.rq_data.o = JSON.parse(t.o); | |
| 34 | + | |
| 33 | 35 | //接受有没有导购的参数 |
| 34 | 36 | var first_leader=t.first_leader; |
| 35 | 37 | if(first_leader){ |
| ... | ... | @@ -154,7 +156,7 @@ Page({ |
| 154 | 156 | |
| 155 | 157 | //-----------真的调用地址进行搜索------------ |
| 156 | 158 | requestSearch: function(t) { |
| 157 | - console.log('t===>', t); | |
| 159 | + // console.log('t===>', t); | |
| 158 | 160 | if(this.data.loading) return false; |
| 159 | 161 | this.data.loading=1; |
| 160 | 162 | var e = this,th=e; |
| ... | ... | @@ -165,8 +167,22 @@ Page({ |
| 165 | 167 | |
| 166 | 168 | var user_id=getApp().globalData.user_id; |
| 167 | 169 | if(!user_id) user_id=0; |
| 168 | - | |
| 169 | - getApp().request.promiseGet(t, {data:{is_mainshow: 1, isonsale: 1, store_id: oo.stoid,orderField: e.data.tabname, orderType: e.data.adname, page: e.data.currentPage}}).then(async res=>{ | |
| 170 | + let data = { | |
| 171 | + is_mainshow: 1, | |
| 172 | + isonsale: 1, | |
| 173 | + store_id: oo.stoid, | |
| 174 | + orderField: e.data.tabname, | |
| 175 | + orderType: e.data.adname, | |
| 176 | + page: e.data.currentPage, | |
| 177 | + }; | |
| 178 | + | |
| 179 | + let o = this.data.rq_data.o; | |
| 180 | + if(o.cat_id) data.cat_id = o.cat_id; | |
| 181 | + if(o.pid && o.pid != 'three') data.parent_id = o.pid; | |
| 182 | + if(o.nation_id) data.nation_id = o.nation_id; | |
| 183 | + if(o.brand_id) data.brand_id = o.brand_id; | |
| 184 | + | |
| 185 | + getApp().request.promiseGet(t, {data:data}).then(async res=>{ | |
| 170 | 186 | th.data.loading=0; |
| 171 | 187 | if(ut.ajax_ok(res)){ |
| 172 | 188 | if(!e.data.requestData) e.data.requestData=[]; | ... | ... |