From 9d83b819af4ab65c0e078c94e1996a815880c733 Mon Sep 17 00:00:00 2001 From: taiwan Date: Fri, 4 Mar 2022 14:03:56 +0800 Subject: [PATCH] 服务卡项详情页详情信息修改;指定类别商品搜索修改 --- packageA/pages/goodsInfo/goodsInfo.js | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- pages/goods/goodsList/goodsList.js | 5 ++++- pages/goods/goodsList/goodsList.wxml | 2 +- pages/goods/search/search.js | 22 +++++++++++++++++++--- 4 files changed, 83 insertions(+), 19 deletions(-) diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index 6c2e2e2..34fb2fe 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -113,7 +113,7 @@ Page({ is_sec_mend: 0, sto_sele_name: "", //选中的门店名称 sto_sele_id: "", //选中的门店id - sto_sele_keyid:'', //选中的门店线下 + sto_sele_keyid:'', //选中的门店线下 sto_sele_distr: "", //选择的门店的配送方式 is_show_sto_cat: 1, //是否显示门店分类 only_pk: null, @@ -269,11 +269,11 @@ Page({ ee.setData({ gid: gid}); - if(first_leader){ + if(first_leader) { getApp().globalData.first_leader=first_leader; //调用接口判断是不是会员 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ - if(res.data.code==0){ + if(res.data.code==0) { getApp().globalData.guide_id=res.data.data.id; } }) @@ -545,7 +545,8 @@ Page({ }); }; - console.log('!!!!!!~~~~~~~~~prom~~~~~~~~~~!!!!!!'); + // console.log('!!!!!!~~~~~~~~~prom~~~~~~~~~~!!!!!!'); + // this.setData({ // prom, // }); @@ -667,6 +668,10 @@ Page({ this.wait_for_store_config(); + + + + i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, { failRollback: !0, success: function(t) { @@ -772,11 +777,11 @@ Page({ }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment(); }, - tabClick2: function(t) { - this.setData({ - activeCategoryId2: t.currentTarget.id - }); - }, + // tabClick2: function(t) { + // this.setData({ + // activeCategoryId2: t.currentTarget.id + // }); + // }, tabClick3: function(t) { var e = this; @@ -790,11 +795,11 @@ Page({ } }, - doScrollTop: function() { - wx.pageScrollTo({ - scrollTop: 0 - }); - }, + // doScrollTop: function() { + // wx.pageScrollTo({ + // scrollTop: 0 + // }); + // }, tabComment: function() { this.setData({ @@ -3091,6 +3096,46 @@ Page({ + //-- 检验商品的活动情况 -- + check_gd_prom_new: function (func) { + var th = this; + var user_id = getApp().globalData.user_id; + if (!user_id) user_id = 0; + + var url = '/api/weshop/activitylist/listGoodActInfo2'; + var req_d = { + "store_id": os.stoid, + "goods_id": this.data.gid, + "user_id": user_id, + } + getApp().request.get(url, { + data: req_d, + success: function (e) { + if (e.data.code == 0 && e.data.data && e.data.data.length > 0) { + var arr = e.data.data; + var arr2 = arr.filter(function (e) { + return e.s_time < ut.gettimestamp(); + }) + //-- 如果只有一个活动的话 -- + if (arr.length == 1) { + th.data.prom_type = arr[0].prom_type; + th.data.prom_id = arr[0].act_id; + } + //-- 如果只有一个进行中的活动的话 -- + else if (arr2.length == 1) { + th.data.prom_type = arr2[0].prom_type; + th.data.prom_id = arr2[0].act_id; + } + } + //-- 调用回调 -- + func(); + } + }); + }, + + + + diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index 287403a..caee622 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -442,7 +442,10 @@ Page({ go_url:function (e) { - var url=e.currentTarget.dataset.url; + var url = e.currentTarget.dataset.url; + var rq_data = JSON.stringify(this.data.rq_data); + url += `&o=${rq_data}`; + // console.log('url!!!=======<<<<', url); getApp().goto(url); } diff --git a/pages/goods/goodsList/goodsList.wxml b/pages/goods/goodsList/goodsList.wxml index 4f2f585..96377db 100644 --- a/pages/goods/goodsList/goodsList.wxml +++ b/pages/goods/goodsList/goodsList.wxml @@ -19,7 +19,7 @@ - 搜索店铺商品 + 搜索店铺商品 diff --git a/pages/goods/search/search.js b/pages/goods/search/search.js index 043d585..1a61796 100644 --- a/pages/goods/search/search.js +++ b/pages/goods/search/search.js @@ -30,6 +30,8 @@ Page({ onLoad: function(t) { this.data.rq_data=t; + this.data.rq_data.o = JSON.parse(t.o); + //接受有没有导购的参数 var first_leader=t.first_leader; if(first_leader){ @@ -154,7 +156,7 @@ Page({ //-----------真的调用地址进行搜索------------ requestSearch: function(t) { - console.log('t===>', t); + // console.log('t===>', t); if(this.data.loading) return false; this.data.loading=1; var e = this,th=e; @@ -165,8 +167,22 @@ Page({ var user_id=getApp().globalData.user_id; if(!user_id) user_id=0; - - 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=>{ + let data = { + is_mainshow: 1, + isonsale: 1, + store_id: oo.stoid, + orderField: e.data.tabname, + orderType: e.data.adname, + page: e.data.currentPage, + }; + + let o = this.data.rq_data.o; + if(o.cat_id) data.cat_id = o.cat_id; + if(o.pid && o.pid != 'three') data.parent_id = o.pid; + if(o.nation_id) data.nation_id = o.nation_id; + if(o.brand_id) data.brand_id = o.brand_id; + + getApp().request.promiseGet(t, {data:data}).then(async res=>{ th.data.loading=0; if(ut.ajax_ok(res)){ if(!e.data.requestData) e.data.requestData=[]; -- libgit2 0.21.4