Commit b7efd720ac1e79035c9b7d152fd47d0741867bc0
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
13 changed files
with
1236 additions
and
1182 deletions
app.json
components/diy_seckill/diy_seckill.js
| ... | ... | @@ -4,13 +4,13 @@ |
| 4 | 4 | // }; |
| 5 | 5 | // }(require("../../utils/LoadMore3.js")), |
| 6 | 6 | // n = new e.default(), |
| 7 | -var t = getApp(), | |
| 8 | - a = t.request, | |
| 9 | - o = t.globalData.setting, | |
| 10 | - os = o, | |
| 11 | - i = require("../../utils/util.js"), | |
| 12 | - ut = i, | |
| 13 | - s = require("../../utils/common.js"); | |
| 7 | +var t = getApp(), | |
| 8 | + a = t.request, | |
| 9 | + o = t.globalData.setting, | |
| 10 | + os = o, | |
| 11 | + i = require("../../utils/util.js"), | |
| 12 | + ut = i, | |
| 13 | + s = require("../../utils/common.js"); | |
| 14 | 14 | var regeneratorRuntime = require('../../utils/runtime.js'); |
| 15 | 15 | Component({ |
| 16 | 16 | properties: { |
| ... | ... | @@ -36,23 +36,25 @@ Component({ |
| 36 | 36 | imghost: os.imghost, |
| 37 | 37 | timer: null, |
| 38 | 38 | }, |
| 39 | - | |
| 40 | - pageLifetimes:{ | |
| 39 | + | |
| 40 | + pageLifetimes: { | |
| 41 | 41 | //要处理一下,游客登录后的界面的变化,主要还该是改变会员 |
| 42 | 42 | show: function () { |
| 43 | - var th=this; | |
| 44 | - if(this.data.goods_array.length>0){ | |
| 45 | - th.data.timer = setInterval(function() { | |
| 46 | - th.countDown2(th); | |
| 47 | - }, 1000); | |
| 48 | - } | |
| 49 | - } | |
| 50 | - }, | |
| 51 | - | |
| 52 | - ready: function() { | |
| 43 | + | |
| 44 | + var th = this; | |
| 45 | + if (this.data.goods_array.length > 0) { | |
| 46 | + th.data.timer = setInterval(function () { | |
| 47 | + th.countDown2(th); | |
| 48 | + }, 1000); | |
| 49 | + } | |
| 50 | + } | |
| 51 | + }, | |
| 52 | + | |
| 53 | + ready: function () { | |
| 53 | 54 | console.log("ready"); |
| 54 | - var g_id = this.data.object.data; | |
| 55 | - console.log(g_id); | |
| 55 | + // var g_id = this.data.object.data; | |
| 56 | + var g_id = this.data.object; | |
| 57 | + // console.log(g_id); | |
| 56 | 58 | this.init(g_id); |
| 57 | 59 | }, |
| 58 | 60 | detached() { |
| ... | ... | @@ -61,96 +63,100 @@ Component({ |
| 61 | 63 | }, |
| 62 | 64 | methods: { |
| 63 | 65 | // 这里是一个自定义方法 |
| 64 | - customMethod: function() {}, | |
| 65 | - init: function(g_id) { | |
| 66 | - var th = this, app = getApp(), goodsidlist=""; | |
| 67 | - if(g_id && g_id.length>0){ | |
| 68 | - //--先把商品ID串起来-- | |
| 69 | - g_id.forEach(function(val, ind) { | |
| 70 | - var item = {}; | |
| 71 | - goodsidlist+=val.goodsid+","; | |
| 72 | - }) | |
| 73 | - goodsidlist=ut.sub_last(goodsidlist); | |
| 74 | - | |
| 75 | - //--调用接口,读取秒杀-- | |
| 76 | - app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" | |
| 77 | - +os.stoid+"&goodsidlist="+goodsidlist, {}).then(res => { | |
| 78 | - //如果秒杀的数组为空的时候 | |
| 79 | - var goodslist=res.data.data; | |
| 80 | - //就算是添加的活动已经过期,就要用最新的进行中活动 | |
| 81 | - if(goodslist && goodslist.length>0) { | |
| 82 | - th.set_goods_list(g_id,goodslist); | |
| 83 | - } | |
| 84 | - }); | |
| 85 | - }else{ | |
| 86 | - th.no_gid_set(); | |
| 87 | - } | |
| 66 | + customMethod: function () { }, | |
| 67 | + init: function (g_id) { | |
| 68 | + var th = this, app = getApp(), goodsidlist = ""; | |
| 69 | + if (g_id.data_type == 2) { | |
| 70 | + if (g_id.data && g_id.data.length > 0) { | |
| 71 | + //--先把商品ID串起来-- | |
| 72 | + g_id.data.forEach(function (val, ind) { | |
| 73 | + var item = {}; | |
| 74 | + goodsidlist += val.goodsid + ","; | |
| 75 | + }) | |
| 76 | + goodsidlist = ut.sub_last(goodsidlist); | |
| 77 | + | |
| 78 | + //--调用接口,读取秒杀-- | |
| 79 | + app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" | |
| 80 | + + os.stoid + "&goodsidlist=" + goodsidlist, {}).then(res => { | |
| 81 | + console.log(res); | |
| 82 | + //如果秒杀的数组为空的时候 | |
| 83 | + var goodslist = res.data.data; | |
| 84 | + //就算是添加的活动已经过期,就要用最新的进行中活动 | |
| 85 | + if (goodslist && goodslist.length > 0) { | |
| 86 | + th.set_goods_list(g_id.data, goodslist); | |
| 87 | + } | |
| 88 | + }); | |
| 89 | + } | |
| 90 | + } else { | |
| 91 | + th.no_gid_set(); | |
| 92 | + } | |
| 93 | + }, | |
| 94 | + | |
| 95 | + //当是默认的情况 | |
| 96 | + no_gid_set() { | |
| 97 | + console.log(5623); | |
| 98 | + getApp().request.promiseGet("/api/ms/flash_sale/spikepage?page=1&pageSize=9", | |
| 99 | + { isShowLoading: 1, data: { store_id: os.stoid, is_end: 0, is_show: 1, timetype: 2 } } | |
| 100 | + ).then(res => { | |
| 101 | + if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 102 | + var goodsidlist = res.data.data.pageData; | |
| 103 | + this.set_goods_list(null, goodsidlist); | |
| 104 | + } | |
| 105 | + }); | |
| 106 | + }, | |
| 107 | + | |
| 108 | + //就算是添加的活动已经过期,就要用最新的活动 | |
| 109 | + set_goods_list(g_id, goodslist) { | |
| 110 | + // 判断火热,预热 | |
| 111 | + var newTime = ut.gettimestamp(), all_array = [], th = this; | |
| 112 | + th.setData({ newTime: newTime }); | |
| 113 | + if (g_id) { | |
| 114 | + /*--商品队列按照添加的顺序排列--*/ | |
| 115 | + g_id.forEach(function (val, ind) { | |
| 116 | + goodslist.forEach(function (vy, indy) { | |
| 117 | + if (val.goodsid == vy.goods_id) { | |
| 118 | + all_array.push(vy); | |
| 119 | + //th.setData({goods_array:arr}); | |
| 120 | + } | |
| 121 | + }) | |
| 122 | + }) | |
| 123 | + } else { | |
| 124 | + all_array = goodslist; | |
| 125 | + } | |
| 126 | + | |
| 127 | + | |
| 128 | + if (all_array.length == 0) { | |
| 129 | + all_array = goodslist; | |
| 130 | + } | |
| 131 | + | |
| 132 | + var arr = new Array(); | |
| 133 | + //--三个三个一组--- | |
| 134 | + for (var i = 0; i < all_array.length; i += 3) { | |
| 135 | + arr.push(all_array.slice(i, i + 3)); | |
| 136 | + } | |
| 137 | + /*--熏染到前台--*/ | |
| 138 | + | |
| 139 | + th.setData({ goods_array: arr }); | |
| 140 | + | |
| 141 | + th.data.timer = setInterval(function () { | |
| 142 | + th.countDown2(th); | |
| 143 | + }, 1000); | |
| 88 | 144 | }, |
| 89 | - | |
| 90 | - //当是默认的情况 | |
| 91 | - no_gid_set(){ | |
| 92 | - getApp().request.promiseGet("/api/ms/flash_sale/spikepage?page=1&pageSize=9", | |
| 93 | - {isShowLoading:1,data:{store_id:os.stoid,is_end:0,is_show:1,timetype:2 }} | |
| 94 | - ).then(res=>{ | |
| 95 | - if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0) { | |
| 96 | - var goodsidlist=res.data.data.pageData; | |
| 97 | - this.set_goods_list(null,goodsidlist); | |
| 98 | - } | |
| 99 | - }); | |
| 100 | - }, | |
| 101 | - | |
| 102 | - //就算是添加的活动已经过期,就要用最新的活动 | |
| 103 | - set_goods_list(g_id,goodslist){ | |
| 104 | - // 判断火热,预热 | |
| 105 | - var newTime = ut.gettimestamp(),all_array = [],th=this; | |
| 106 | - th.setData({newTime:newTime}); | |
| 107 | - if(g_id){ | |
| 108 | - /*--商品队列按照添加的顺序排列--*/ | |
| 109 | - g_id.forEach(function(val, ind) { | |
| 110 | - goodslist.forEach(function (vy,indy) { | |
| 111 | - if(val.goodsid==vy.goods_id){ | |
| 112 | - all_array.push(vy); | |
| 113 | - //th.setData({goods_array:arr}); | |
| 114 | - } | |
| 115 | - }) | |
| 116 | - }) | |
| 117 | - }else{ | |
| 118 | - all_array=goodslist; | |
| 119 | - } | |
| 120 | - | |
| 121 | - | |
| 122 | - if(all_array.length==0){ | |
| 123 | - all_array=goodslist; | |
| 124 | - } | |
| 125 | - | |
| 126 | - var arr = new Array(); | |
| 127 | - //--三个三个一组--- | |
| 128 | - for(var i=0;i< all_array.length;i+=3){ | |
| 129 | - arr.push(all_array.slice(i,i+3)); | |
| 130 | - } | |
| 131 | - /*--熏染到前台--*/ | |
| 132 | - | |
| 133 | - th.setData({goods_array:arr}); | |
| 134 | - | |
| 135 | - th.data.timer = setInterval(function() { | |
| 136 | - th.countDown2(th); | |
| 137 | - }, 1000); | |
| 138 | - }, | |
| 139 | - | |
| 140 | - | |
| 141 | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 142 | 148 | //---小于10的格式化函数---- |
| 143 | - timeFormat: function(param) { | |
| 149 | + timeFormat: function (param) { | |
| 144 | 150 | return param < 10 ? '0' + param : param; |
| 145 | 151 | }, |
| 146 | 152 | //----秒杀倒计时函数----- |
| 147 | - countDown2: function(ob) { | |
| 153 | + countDown2: function (ob) { | |
| 148 | 154 | if (ob == undefined) return false; |
| 149 | 155 | var ee = ob; |
| 150 | 156 | // 获取当前时间,同时得到活动结束时间数组 |
| 151 | 157 | var newTime = ut.gettimestamp(); |
| 152 | - this.setData({newTime:newTime}); | |
| 153 | - | |
| 158 | + this.setData({ newTime: newTime }); | |
| 159 | + | |
| 154 | 160 | var List = ee.data.goods_array; |
| 155 | 161 | if (List.length == 0) return false; |
| 156 | 162 | for (var j = 0; j < List.length; j++) { |
| ... | ... | @@ -159,7 +165,7 @@ Component({ |
| 159 | 165 | for (var i = 0; i < endTimeList.length; i++) { |
| 160 | 166 | var o = endTimeList[i]; |
| 161 | 167 | var endTime = o.end_time; |
| 162 | - if (newTime< o.start_time) endTime = o.start_time; | |
| 168 | + if (newTime < o.start_time) endTime = o.start_time; | |
| 163 | 169 | let obj = null; |
| 164 | 170 | // 如果活动未结束,对时间进行处理 |
| 165 | 171 | if (endTime - newTime > 0) { |
| ... | ... | @@ -199,9 +205,9 @@ Component({ |
| 199 | 205 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 200 | 206 | }, |
| 201 | 207 | |
| 202 | - go_to_skill:function () { | |
| 208 | + go_to_skill: function () { | |
| 203 | 209 | wx.navigateTo({ |
| 204 | - url:"/pages/activity/seckill_list/seckill_list" | |
| 210 | + url: "/pages/activity/seckill_list/seckill_list" | |
| 205 | 211 | }); |
| 206 | 212 | } |
| 207 | 213 | }, | ... | ... |
packageA/pages/distribution/shop/shop.js
| ... | ... | @@ -23,7 +23,7 @@ Page({ |
| 23 | 23 | isShowRow: false,//控制视图切换状态 |
| 24 | 24 | isHiddenDropdown: true,//控制筛选下拉菜单显隐 |
| 25 | 25 | |
| 26 | - list: null, | |
| 26 | + list: [], | |
| 27 | 27 | isLoading: false, // 检测是否已经发送请求,防止重复发送请求 |
| 28 | 28 | noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 |
| 29 | 29 | pageNum: 1, // 当前页数 |
| ... | ... | @@ -44,7 +44,6 @@ Page({ |
| 44 | 44 | * 生命周期函数--监听页面加载 |
| 45 | 45 | */ |
| 46 | 46 | onLoad: function (options) { |
| 47 | - console.log(options); | |
| 48 | 47 | wx.setNavigationBarTitle({ |
| 49 | 48 | title: "我的小店", |
| 50 | 49 | }); |
| ... | ... | @@ -76,32 +75,20 @@ Page({ |
| 76 | 75 | |
| 77 | 76 | } |
| 78 | 77 | |
| 79 | - | |
| 80 | - // 判断会员是否授权登录, | |
| 81 | - // 没有登录则跳转到登录页, | |
| 82 | - // 已登录则设置已登录状态,请求加载签到数据 | |
| 83 | - // isLogin记录登录状态 | |
| 84 | - // app.isLogin().then(function(data) { | |
| 85 | - // // 1.登录成功 | |
| 86 | - // self.setData({ | |
| 87 | - // isLogin: true, | |
| 88 | - // userInfo: data, | |
| 89 | - // currentQuery: { | |
| 90 | - // store_id: app.globalData.setting.stoid, | |
| 91 | - // user_id: app.globalData.user_id, | |
| 92 | - // }, | |
| 93 | - // }); | |
| 94 | - // // 2.请求全部商品数据 | |
| 95 | - // self.getData(true, '/api/weshop/users/distribut/pagemyshop', self.data.currentQuery); | |
| 96 | - // // 3.请求新品 | |
| 97 | - // app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2', { | |
| 98 | - // data: self.data.currentQuery, | |
| 99 | - // }).then(function(res) { | |
| 100 | - // self.setData({ | |
| 101 | - // newList: res.data.data, | |
| 102 | - // }); | |
| 103 | - // }) | |
| 104 | - // }); | |
| 78 | + if (options?.brand_id) { | |
| 79 | + this.setData({ | |
| 80 | + brand_id: options.brand_id, | |
| 81 | + is_router:true | |
| 82 | + }) | |
| 83 | + // this.getData(true, '/api/weshop/users/distribut/pagemyshop', this.data.currentQuery); | |
| 84 | + } | |
| 85 | + if (options?.nation_id) { | |
| 86 | + this.setData({ | |
| 87 | + nation_id: options.nation_id, | |
| 88 | + is_router:true | |
| 89 | + }) | |
| 90 | + // this.getData(true, '/api/weshop/users/distribut/pagemyshop', this.data.currentQuery); | |
| 91 | + } | |
| 105 | 92 | }, |
| 106 | 93 | |
| 107 | 94 | /** |
| ... | ... | @@ -125,42 +112,16 @@ Page({ |
| 125 | 112 | user_id: app.globalData.user_id, |
| 126 | 113 | }, |
| 127 | 114 | }); |
| 128 | - // 请求数据 | |
| 129 | - app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?orderType=desc', { | |
| 130 | - data: this.data.currentQuery, | |
| 131 | - }).then(res => { | |
| 132 | - self.setData({ | |
| 133 | - list: res.data.data, | |
| 134 | - total: res.data.data.total, | |
| 135 | - }); | |
| 136 | - }); | |
| 137 | - | |
| 138 | - // 新品 | |
| 139 | - app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2&orderType=desc', { | |
| 140 | - data: self.data.currentQuery, | |
| 141 | - }).then(res => { | |
| 142 | - self.setData({ | |
| 143 | - newList: res.data.data, | |
| 144 | - }); | |
| 145 | - }); | |
| 146 | - // 广告banner | |
| 147 | - app.request.promiseGet("/api/weshop/ad/page", { | |
| 148 | - data: { | |
| 149 | - pid: 401, | |
| 150 | - enabled: 1, | |
| 151 | - store_id: app.globalData.setting.stoid, | |
| 152 | - } | |
| 153 | - }).then(res => { | |
| 154 | - if (res.data.code == 0 && res.data.data) { | |
| 155 | - let item = res.data.data.pageData[0]; | |
| 156 | - if (item && item.ad_code) { | |
| 157 | - self.setData({ | |
| 158 | - ad_img: item.ad_code, | |
| 159 | - }); | |
| 160 | - }; | |
| 161 | - }; | |
| 162 | - }); | |
| 163 | - | |
| 115 | + !this.data.is_router&&this.initData(); | |
| 116 | + this.data.is_router&&this.getData(true,"/api/weshop/users/distribut/pagemyshop?orderType=desc",this.data.currentQuery); | |
| 117 | + let total=wx.getStorageSync('total'); | |
| 118 | + let newListTotal=wx.getStorageSync('newListTotal'); | |
| 119 | + if(total>0&&newListTotal>0){ | |
| 120 | + this.setData({ | |
| 121 | + total, | |
| 122 | + newListTotal | |
| 123 | + }) | |
| 124 | + } | |
| 164 | 125 | }; |
| 165 | 126 | } |
| 166 | 127 | //被人分享点击开的 |
| ... | ... | @@ -259,9 +220,50 @@ Page({ |
| 259 | 220 | inputVal: app.globalData.key_word, |
| 260 | 221 | }) |
| 261 | 222 | this.search(); |
| 262 | - } | |
| 223 | + }; | |
| 224 | + }, | |
| 225 | + //初始化数据 | |
| 226 | + initData() { | |
| 227 | + | |
| 228 | + // 全部商品 | |
| 229 | + app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?orderType=desc', { | |
| 230 | + data: this.data.currentQuery, | |
| 231 | + }).then(res => { | |
| 232 | + wx.setStorageSync('total', res.data.data.total); | |
| 233 | + this.setData({ | |
| 234 | + total: res.data.data.total, | |
| 235 | + list:res.data.data.pageData, | |
| 236 | + }); | |
| 237 | + }); | |
| 238 | + // 新品 | |
| 239 | + app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2&orderType=desc', { | |
| 240 | + data: this.data.currentQuery, | |
| 241 | + }).then(res => { | |
| 242 | + wx.setStorageSync('newListTotal', res.data.data.total); | |
| 243 | + this.setData({ | |
| 244 | + newListTotal: res.data.data.total, | |
| 245 | + }); | |
| 246 | + }); | |
| 247 | + | |
| 248 | + // 广告banner | |
| 249 | + app.request.promiseGet("/api/weshop/ad/page", { | |
| 250 | + data: { | |
| 251 | + pid: 401, | |
| 252 | + enabled: 1, | |
| 253 | + store_id: app.globalData.setting.stoid, | |
| 254 | + } | |
| 255 | + }).then(res => { | |
| 256 | + if (res.data.code == 0 && res.data.data) { | |
| 257 | + let item = res.data.data.pageData[0]; | |
| 258 | + if (item && item.ad_code) { | |
| 259 | + this.setData({ | |
| 260 | + ad_img: item.ad_code, | |
| 261 | + }); | |
| 262 | + }; | |
| 263 | + }; | |
| 264 | + }); | |
| 265 | + // } | |
| 263 | 266 | }, |
| 264 | - | |
| 265 | 267 | /** |
| 266 | 268 | * 生命周期函数--监听页面隐藏 |
| 267 | 269 | */ |
| ... | ... | @@ -273,7 +275,11 @@ Page({ |
| 273 | 275 | * 生命周期函数--监听页面卸载 |
| 274 | 276 | */ |
| 275 | 277 | onUnload: function () { |
| 276 | - app.globalData.key_word=null; | |
| 278 | + console.log('onun'); | |
| 279 | + app.globalData.key_word = null; | |
| 280 | + app.globalData.nid = null; | |
| 281 | + app.globalData.bid = null; | |
| 282 | + // wx.removeStorageSync(key); | |
| 277 | 283 | }, |
| 278 | 284 | |
| 279 | 285 | /** |
| ... | ... | @@ -395,20 +401,18 @@ Page({ |
| 395 | 401 | search() { |
| 396 | 402 | let data = this.data.currentQuery; |
| 397 | 403 | data.key = this.data.inputVal; |
| 398 | - if (data.orderField) { | |
| 399 | - delete data.orderField; | |
| 400 | - }; | |
| 401 | - if (data.page) { | |
| 402 | - delete data.page; | |
| 403 | - }; | |
| 404 | + delete data.page; | |
| 405 | + delete data.brand_id; | |
| 406 | + delete data.nation_id; | |
| 404 | 407 | this.setData({ |
| 405 | - currentTabIndex: 4, | |
| 408 | + currentTabIndex: this.data.currentTabIndex, | |
| 406 | 409 | isSort: false, |
| 407 | 410 | isDescending: false, |
| 408 | 411 | currentQuery: data, |
| 409 | 412 | pageNum: 1, |
| 410 | 413 | }); |
| 411 | 414 | this.getData(true, '/api/weshop/users/distribut/pagemyshop', data); |
| 415 | + app.globalData.key_word=null; | |
| 412 | 416 | }, |
| 413 | 417 | |
| 414 | 418 | /** |
| ... | ... | @@ -484,9 +488,6 @@ Page({ |
| 484 | 488 | if (data.page) {// 清除page |
| 485 | 489 | delete data.page; |
| 486 | 490 | }; |
| 487 | - | |
| 488 | - | |
| 489 | - | |
| 490 | 491 | if (currentIndex == 0) { |
| 491 | 492 | if (data.orderField) {// 清除orderField |
| 492 | 493 | delete data.orderField; |
| ... | ... | @@ -508,6 +509,9 @@ Page({ |
| 508 | 509 | }; |
| 509 | 510 | data.orderType = 'desc'; |
| 510 | 511 | this.data.currentQuery = data; |
| 512 | + delete data.brand_id; | |
| 513 | + delete data.nation_id; | |
| 514 | + console.log(data); | |
| 511 | 515 | this.getData(true, '/api/weshop/users/distribut/pagemyshop', data); |
| 512 | 516 | }, |
| 513 | 517 | |
| ... | ... | @@ -535,7 +539,19 @@ Page({ |
| 535 | 539 | * 请求数据 |
| 536 | 540 | */ |
| 537 | 541 | getData: function (isInit, url, data) { |
| 538 | - | |
| 542 | + let { brand_id, nation_id } = this.data; | |
| 543 | + if (brand_id - 0) { | |
| 544 | + delete data.nation_id; | |
| 545 | + // delete data.key; | |
| 546 | + data.brand_id = brand_id; | |
| 547 | + this.data.brand_id=null; | |
| 548 | + }; | |
| 549 | + if (nation_id - 0) { | |
| 550 | + delete data.brand_id; | |
| 551 | + // delete data.key; | |
| 552 | + data.nation_id = nation_id; | |
| 553 | + this.data.nation_id=null; | |
| 554 | + }; | |
| 539 | 555 | app.request.promiseGet(url, { |
| 540 | 556 | data: data, |
| 541 | 557 | isShowLoading: true, |
| ... | ... | @@ -545,16 +561,19 @@ Page({ |
| 545 | 561 | if (res.data.code == 0) { |
| 546 | 562 | |
| 547 | 563 | self.setData({ |
| 548 | - isLoading: false | |
| 564 | + isLoading: false, | |
| 565 | + // is_router:false, | |
| 549 | 566 | }); |
| 550 | 567 | |
| 551 | 568 | if (isInit) {// 第一次加载 |
| 569 | + console.log('first',res); | |
| 552 | 570 | self.setData({ |
| 553 | - list: res.data.data, | |
| 571 | + list: res.data.data.pageData, | |
| 554 | 572 | }); |
| 573 | + console.log(self.data.list); | |
| 555 | 574 | } else { |
| 556 | 575 | self.setData({ |
| 557 | - 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData) | |
| 576 | + list: self.data.list.concat(res.data.data.pageData) | |
| 558 | 577 | }); |
| 559 | 578 | }; |
| 560 | 579 | |
| ... | ... | @@ -566,7 +585,7 @@ Page({ |
| 566 | 585 | |
| 567 | 586 | } else { |
| 568 | 587 | self.setData({ |
| 569 | - 'list.pageData': [] | |
| 588 | + list: [] | |
| 570 | 589 | }); |
| 571 | 590 | }; |
| 572 | 591 | |
| ... | ... | @@ -574,7 +593,7 @@ Page({ |
| 574 | 593 | .catch(function (err) { |
| 575 | 594 | console.log('出错拉!!!!', err); |
| 576 | 595 | self.setData({ |
| 577 | - 'list.pageData': [] | |
| 596 | + list: [] | |
| 578 | 597 | }); |
| 579 | 598 | }); |
| 580 | 599 | }, |
| ... | ... | @@ -668,12 +687,12 @@ Page({ |
| 668 | 687 | */ |
| 669 | 688 | clickAll() { |
| 670 | 689 | let data = this.data.currentQuery; |
| 671 | - | |
| 672 | 690 | if (data.page) delete data.page; |
| 673 | 691 | if (data.orderField) delete data.orderField; |
| 674 | 692 | if (data.orderType) delete data.orderType; |
| 675 | 693 | if (data.key) delete data.key; |
| 676 | - | |
| 694 | + delete data.brand_id; | |
| 695 | + delete data.nation_id; | |
| 677 | 696 | this.setData({ |
| 678 | 697 | pageNum: 1, |
| 679 | 698 | noMore: false, |
| ... | ... | @@ -689,11 +708,12 @@ Page({ |
| 689 | 708 | clickNew() { |
| 690 | 709 | let data = this.data.currentQuery; |
| 691 | 710 | |
| 692 | - if (data.page) delete data.page; | |
| 693 | - if (data.orderField) delete data.orderField; | |
| 694 | - if (data.orderType) delete data.orderType; | |
| 695 | - if (data.key) delete data.key; | |
| 696 | - | |
| 711 | + delete data.page; | |
| 712 | + delete data.orderField; | |
| 713 | + delete data.orderType; | |
| 714 | + delete data.key; | |
| 715 | + delete data.brand_id; | |
| 716 | + delete data.nation_id; | |
| 697 | 717 | this.setData({ |
| 698 | 718 | pageNum: 1, |
| 699 | 719 | noMore: false, | ... | ... |
packageA/pages/distribution/shop/shop.wxml
| 1 | 1 | <wxs src="../../../../utils/filter.wxs" module="filter"></wxs> |
| 2 | 2 | <wxs module="g_filter" src="g_filter.wxs"></wxs> |
| 3 | 3 | <view> |
| 4 | - <view class="head pr"> | |
| 5 | - <view class="bdb"> | |
| 6 | - <!-- <view><image src="../../../images/jfbuy.jpg" mode="widthFix" class="banner"/></view> --> | |
| 7 | - <view><image src="{{imghost + (ad_img ? ad_img:'/miniapp/images/user_index_powder.jpg')}}" mode="widthFix" class="banner"/></view> | |
| 8 | - <view class="flex bg-white pdh20 jc_sb pr"> | |
| 9 | - <!-- 分享人的头像 --> | |
| 10 | - <view class="avatar-container" wx:if="{{userInfo2}}"> | |
| 11 | - <image class="avatar" src="{{userInfo2.head_pic}}"/> | |
| 12 | - <view class="pdt20"><text class="nickname">{{userInfo2.nickname}}</text></view> | |
| 13 | - </view> | |
| 14 | - <!-- 自己的头像 --> | |
| 15 | - <view class="avatar-container" wx:else> | |
| 16 | - <image class="avatar" src="{{userInfo.head_pic}}"/> | |
| 17 | - <view class="pdt20"><text class="nickname">{{userInfo.nickname}}</text></view> | |
| 18 | - </view> | |
| 19 | - | |
| 20 | - | |
| 21 | - <view class="flex t-c fs24 f1 jc_fe"> | |
| 22 | - <view class="pdv20 pdh40 {{isAll ? 'selected':''}}" bindtap="clickAll"> | |
| 23 | - <view class="fs30">{{filter.show_default(total)}}</view> | |
| 24 | - <view>全部商品</view> | |
| 25 | - </view> | |
| 26 | - <view class="pdv20 pdh40 {{!isAll ? 'selected':''}}" bindtap="clickNew"> | |
| 27 | - <view class="fs30">{{filter.show_default(newList.total)}}</view> | |
| 28 | - <view>新品</view> | |
| 29 | - </view> | |
| 30 | - <view class="pdv20 pdh40" bindtap="goto" data-url="/pages/user/index/index"> | |
| 31 | - <view class="fs26"><text class="iconfont icon-ren1 bold"></text></view> | |
| 32 | - <view>会员中心</view> | |
| 33 | - </view> | |
| 34 | - </view> | |
| 35 | - </view> | |
| 36 | - </view> | |
| 37 | - | |
| 38 | - <!-- 搜索 --> | |
| 39 | - <view class="flex ai-center fs26 bg-white pd20"> | |
| 40 | - <text class="pd20 c-9b iconfont icon-fenxiang" catch:tap="goto" data-url="/packageC/pages/goods/distributionCategoryList/index"></text> | |
| 41 | - <view class="input-container f1"> | |
| 42 | - <input class="input" type="text" value="{{inputVal}}" placeholder="请输入商品关键字" confirm-type="search" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input" bindconfirm="search"/> | |
| 43 | - <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text> | |
| 44 | - <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 --> | |
| 45 | - </view> | |
| 46 | - <view class="pd20 c-red" bindtap="search">搜索</view> | |
| 47 | - </view> | |
| 48 | - | |
| 49 | - </view> | |
| 50 | - | |
| 51 | - <view class="flex t-c fs26 bg-white bdb sticky c-a" catchtap="clickTab"> | |
| 52 | - <block wx:for="{{tabArr}}"> | |
| 53 | - <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:if="{{index != 3}}">{{item}}</view> | |
| 54 | - <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:else bindtap="clickSort"> | |
| 55 | - {{item}} | |
| 56 | - <text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}"></text> | |
| 57 | - <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" wx:else></text> | |
| 58 | - </view> | |
| 59 | - </block> | |
| 60 | - <view class="f1 pd20" catchtap="change"> | |
| 61 | - <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text> | |
| 62 | - </view> | |
| 63 | - </view> | |
| 64 | - | |
| 65 | - | |
| 66 | - <view class="content"> | |
| 67 | - | |
| 68 | - <view class="fs26" wx:if="{{isShowRow}}"> | |
| 69 | - <view class="item bg-white flex ai-center pd20" wx:for="{{list.pageData}}"> | |
| 70 | - <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 71 | - <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}"><image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit"/></view> | |
| 72 | - <view class="flex fdc jc_sb"> | |
| 73 | - <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> | |
| 74 | - | |
| 75 | - <!-- 判断是否有活动价 --> | |
| 76 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 77 | - <view class="flex xc-wc pdt20" > | |
| 78 | - <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> | |
| 79 | - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | |
| 80 | - <!-- 活动价 --> | |
| 81 | - <view class="flex xc-wc ai_and" wx:if="{{item.prom_price}}"> | |
| 82 | - <!-- <view class="fs24">¥</view> --> | |
| 83 | - <view class="fs30 money">{{item.prom_price}}</view> | |
| 84 | - </view> | |
| 85 | - </view> | |
| 86 | - <view class="flex" style="line-height: 28rpx;"> | |
| 87 | - <!-- 原价 --> | |
| 88 | - <view class="price flex xc-ash line_th"> | |
| 89 | - <!-- <view class="fs22">¥</view> --> | |
| 90 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 91 | - </view> | |
| 92 | - </view> | |
| 93 | - </block> | |
| 94 | - <block wx:else> | |
| 95 | - <!-- 商品价格,先判断下是后⼜等级价--> | |
| 96 | - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | |
| 97 | - <!-- 当会员是等级卡的时候 --> | |
| 98 | - <block wx:if="{{card_field}}"> | |
| 99 | - <!-- 等级价>0 --> | |
| 100 | - <block wx:if="{{item[card_field]>0}}"> | |
| 101 | - <view class="flex"> | |
| 102 | - <!-- 办卡价 --> | |
| 103 | - <view class="flex xc-wc ai_and"> | |
| 104 | - <!-- <view class="fs24">¥</view> --> | |
| 105 | - <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view> | |
| 106 | - <view class="card_bg"> | |
| 107 | - <image src="{{url + 'miniapp/images/plus/dj_icon.png'}}"></image> | |
| 108 | - <text class="card_name ellipsis-1">{{card_name}}</text> | |
| 109 | - </view> | |
| 110 | - </view> | |
| 111 | - </view> | |
| 112 | - <view class="flex" style="line-height: 28rpx;"> | |
| 113 | - <!-- 原价 --> | |
| 114 | - <view class="price flex xc-ash line_th"> | |
| 115 | - <!-- <view class="fs22">¥</view> --> | |
| 116 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 117 | - </view> | |
| 118 | - </view> | |
| 119 | - </block> | |
| 120 | - <blocK wx:else> | |
| 121 | - <view class="flex"> | |
| 122 | - <!-- 办卡价 --> | |
| 123 | - <view class="flex xc-wc"> | |
| 124 | - <!-- <view class="fs24">¥</view> --> | |
| 125 | - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 126 | - </view> | |
| 127 | - </view> | |
| 128 | - <view class="flex" style="line-height: 28rpx;"> | |
| 129 | - <!-- 原价 --> | |
| 130 | - <view class="price flex xc-ash line_th"> | |
| 131 | - <!-- <view class="fs22">¥</view> --> | |
| 132 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 133 | - </view> | |
| 134 | - </view> | |
| 135 | - </blocK> | |
| 136 | - </block> | |
| 137 | - <block wx:else> | |
| 138 | - <!-- 如果商品有设置等级价⼤于0的 --> | |
| 139 | - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> | |
| 140 | - <view class="flex"> | |
| 141 | - <!-- 办卡价 --> | |
| 142 | - <view class="flex xc-wc"> | |
| 143 | - <!-- <view class="fs24">¥</view> --> | |
| 144 | - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 145 | - </view> | |
| 146 | - <!-- 原价 --> | |
| 147 | - <view class="price flex xc-ash line_th"> | |
| 148 | - <!-- <view class="fs22">¥</view> --> | |
| 149 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 150 | - </view> | |
| 151 | - </view> | |
| 152 | - <view class="flexr" style=""> | |
| 153 | - <!-- 等级价 --> | |
| 154 | - <view class="price flex ai-center"> | |
| 155 | - <!-- <view class="fs22">¥</view> --> | |
| 156 | - <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view> | |
| 157 | - <view class="card_bg"> | |
| 158 | - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image> | |
| 159 | - <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text> | |
| 160 | - </view> | |
| 161 | - </view> | |
| 162 | - </view> | |
| 163 | - </block> | |
| 164 | - <block wx:else> | |
| 165 | - <view class="flex"> | |
| 166 | - <!-- 办卡价 --> | |
| 167 | - <view class="flex xc-wc"> | |
| 168 | - <!-- <view class="fs24">¥</view> --> | |
| 169 | - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 170 | - </view> | |
| 171 | - </view> | |
| 172 | - <view class="flex" style="line-height: 28rpx;"> | |
| 173 | - <!-- 原价 --> | |
| 174 | - <view class="price flex xc-ash line_th"> | |
| 175 | - <!-- <view class="fs22">¥</view> --> | |
| 176 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 177 | - </view> | |
| 178 | - </view> | |
| 179 | - </block> | |
| 180 | - </block> | |
| 181 | - </block> | |
| 182 | - <!-- 商品压根就没有等级价 --> | |
| 183 | - <block wx:else> | |
| 184 | - <view class="flex"> | |
| 185 | - <!-- 办卡价 --> | |
| 186 | - <view class="flex xc-wc"> | |
| 187 | - <!-- <view class="fs24">¥</view> --> | |
| 188 | - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 189 | - </view> | |
| 190 | - </view> | |
| 191 | - <view class="flex" style="line-height: 28rpx;"> | |
| 192 | - <!-- 原价 --> | |
| 193 | - <view class="price flex xc-ash line_th"> | |
| 194 | - <!-- <view class="fs22">¥</view> --> | |
| 195 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 196 | - </view> | |
| 197 | - </view> | |
| 198 | - </block> | |
| 199 | - </block> | |
| 200 | - <!-- 分层金额 --> | |
| 201 | - <view hidden="{{ishidden_comise}}" class="fs24 c-a">分成金额:<text class="money c-red">{{filter.toFix(item.commission,2)}}</text></view> | |
| 202 | - | |
| 203 | - | |
| 204 | - </view> | |
| 205 | - </view> | |
| 206 | - </view> | |
| 207 | - </view> | |
| 208 | - | |
| 209 | - | |
| 210 | - | |
| 211 | - <view class="fs26 flex pd20 wrap" wx:else> | |
| 212 | - <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 213 | - <view class="img-container" data-txt="已售:{{item.sales_sum}}"><image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true"/></view> | |
| 214 | - <view class="pd20 fs26"> | |
| 215 | - <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> | |
| 216 | - <!-- 判断是否有活动价 --> | |
| 217 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 218 | - <view class="flex xc-wc"> | |
| 219 | - <text wx:if="{{item.prom_integral}}"><text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> | |
| 220 | - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | |
| 221 | - <!-- 活动价 --> | |
| 222 | - <view class="flex xc-wc" wx:if="{{item.prom_price}}"> | |
| 223 | - <!-- <view class="fs24">¥</view> --> | |
| 224 | - <view class="fs30 money">{{item.prom_price}}</view> | |
| 225 | - </view> | |
| 226 | - </view> | |
| 227 | - <view class="flex" style="line-height: 28rpx;"> | |
| 228 | - <!-- 原价 --> | |
| 229 | - <view class="price flex xc-ash line_th"> | |
| 230 | - <!-- <view class="fs22">¥</view> --> | |
| 231 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 232 | - </view> | |
| 233 | - </view> | |
| 234 | - </block> | |
| 235 | - <block wx:else> | |
| 236 | - <!-- 商品价格,先判断下是后⼜等级价--> | |
| 237 | - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | |
| 238 | - <!-- 当会员是等级卡的时候 --> | |
| 239 | - <block wx:if="{{card_field}}"> | |
| 240 | - <!-- 等级价>0 --> | |
| 241 | - <block wx:if="{{item[card_field]>0}}"> | |
| 242 | - <view class="flex"> | |
| 243 | - <!-- 办卡价 --> | |
| 244 | - <view class="flex xc-wc ai_and"> | |
| 245 | - <!-- <view class="fs24">¥</view> --> | |
| 246 | - <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view> | |
| 247 | - <view class="card_bg"> | |
| 248 | - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | |
| 249 | - <text class="card_name ellipsis-1">{{card_name}}</text> | |
| 250 | - </view> | |
| 251 | - </view> | |
| 252 | - </view> | |
| 253 | - <view class="flex" style="line-height: 28rpx;"> | |
| 254 | - <!-- 原价 --> | |
| 255 | - <view class="price flex xc-ash line_th"> | |
| 256 | - <!-- <view class="fs22">¥</view> --> | |
| 257 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 258 | - </view> | |
| 259 | - </view> | |
| 260 | - </block> | |
| 261 | - <blocK wx:else> | |
| 262 | - <view class="flex"> | |
| 263 | - <!-- 办卡价 --> | |
| 264 | - <view class="flex xc-wc ai_and"> | |
| 265 | - <!-- <view class="fs24">¥</view> --> | |
| 266 | - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 267 | - </view> | |
| 268 | - </view> | |
| 269 | - <view class="flex" style="line-height: 28rpx;"> | |
| 270 | - <!-- 原价 --> | |
| 271 | - <view class="price flex xc-ash line_th"> | |
| 272 | - <!-- <view class="fs22">¥</view> --> | |
| 273 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 274 | - </view> | |
| 275 | - </view> | |
| 276 | - </blocK> | |
| 277 | - </block> | |
| 278 | - <block wx:else> | |
| 279 | - <!-- 如果商品有设置等级价⼤于0的 --> | |
| 280 | - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> | |
| 281 | - <view class="flex"> | |
| 282 | - <!-- 办卡价 --> | |
| 283 | - <view class="flex xc-wc ai_and"> | |
| 284 | - <!-- <view class="fs24">¥</view> --> | |
| 285 | - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 286 | - </view> | |
| 287 | - <!-- 原价 --> | |
| 288 | - <view class="price flex xc-ash line_th"> | |
| 289 | - <!-- <view class="fs22">¥</view> --> | |
| 290 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 291 | - </view> | |
| 292 | - </view> | |
| 293 | - <view class="flexr" style=""> | |
| 294 | - <!-- 等级价 --> | |
| 295 | - <view class="price flex ai-center"> | |
| 296 | - <!-- <view class="fs22">¥</view> --> | |
| 297 | - <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view> | |
| 298 | - <view class="card_bg"> | |
| 299 | - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image> | |
| 300 | - <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text> | |
| 301 | - </view> | |
| 302 | - </view> | |
| 303 | - </view> | |
| 304 | - </block> | |
| 305 | - <block wx:else> | |
| 306 | - <view class="flex"> | |
| 307 | - <!-- 办卡价 --> | |
| 308 | - <view class="flex xc-wc ai_and"> | |
| 309 | - <!-- <view class="fs24">¥</view> --> | |
| 310 | - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 311 | - </view> | |
| 312 | - </view> | |
| 313 | - <view class="flex" style="line-height: 28rpx;"> | |
| 314 | - <!-- 原价 --> | |
| 315 | - <view class="price flex xc-ash line_th"> | |
| 316 | - <!-- <view class="fs22">¥</view> --> | |
| 317 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 318 | - </view> | |
| 319 | - </view> | |
| 320 | - </block> | |
| 321 | - </block> | |
| 322 | - </block> | |
| 323 | - <!-- 商品压根就没有等级价 --> | |
| 324 | - <block wx:else> | |
| 325 | - <view class="flex"> | |
| 326 | - <!-- 办卡价 --> | |
| 327 | - <view class="flex xc-wc ai_and"> | |
| 328 | - <!-- <view class="fs24">¥</view> --> | |
| 329 | - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 330 | - </view> | |
| 331 | - </view> | |
| 332 | - <view class="flex" style="line-height: 28rpx;"> | |
| 333 | - <!-- 原价 --> | |
| 334 | - <view class="price flex xc-ash line_th"> | |
| 335 | - <!-- <view class="fs22">¥</view> --> | |
| 336 | - <view class="fs22 money">{{item.market_price}}</view> | |
| 337 | - </view> | |
| 338 | - </view> | |
| 339 | - </block> | |
| 340 | - </block> | |
| 341 | - <!-- 分层金额 --> | |
| 342 | - <view class="fs24 c-a">分成金额:<text class="money c-red">{{filter.toFix(item.commission,2)}}</text></view> | |
| 343 | - </view> | |
| 344 | - </view> | |
| 345 | - </view> | |
| 346 | - | |
| 347 | - | |
| 348 | - <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata> | |
| 349 | - <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view> | |
| 350 | - </view> | |
| 351 | - | |
| 352 | - | |
| 353 | - | |
| 354 | -</view> | |
| 355 | - | |
| 356 | - | |
| 357 | - | |
| 358 | - | |
| 359 | - | |
| 4 | + <view class="head pr"> | |
| 5 | + <view class="bdb"> | |
| 6 | + <!-- <view><image src="../../../images/jfbuy.jpg" mode="widthFix" class="banner"/></view> --> | |
| 7 | + <view> | |
| 8 | + <image src="{{imghost + (ad_img ? ad_img:'/miniapp/images/user_index_powder.jpg')}}" mode="widthFix" class="banner" /> | |
| 9 | + </view> | |
| 10 | + <view class="flex bg-white pdh20 jc_sb pr"> | |
| 11 | + <!-- 分享人的头像 --> | |
| 12 | + <view class="avatar-container" wx:if="{{userInfo2}}"> | |
| 13 | + <image class="avatar" src="{{userInfo2.head_pic}}" /> | |
| 14 | + <view class="pdt20"> | |
| 15 | + <text class="nickname">{{userInfo2.nickname}}</text> | |
| 16 | + </view> | |
| 17 | + </view> | |
| 18 | + <!-- 自己的头像 --> | |
| 19 | + <view class="avatar-container" wx:else> | |
| 20 | + <image class="avatar" src="{{userInfo.head_pic}}" /> | |
| 21 | + <view class="pdt20"> | |
| 22 | + <text class="nickname">{{userInfo.nickname}}</text> | |
| 23 | + </view> | |
| 24 | + </view> | |
| 25 | + <view class="flex t-c fs24 f1 jc_fe"> | |
| 26 | + <view class="pdv20 pdh40 {{isAll ? 'selected':''}}" bindtap="clickAll"> | |
| 27 | + <view class="fs30">{{filter.show_default(total)}}</view> | |
| 28 | + <view>全部商品</view> | |
| 29 | + </view> | |
| 30 | + <view class="pdv20 pdh40 {{!isAll ? 'selected':''}}" bindtap="clickNew"> | |
| 31 | + <view class="fs30">{{filter.show_default(newListTotal)}}</view> | |
| 32 | + <view>新品</view> | |
| 33 | + </view> | |
| 34 | + <view class="pdv20 pdh40" bindtap="goto" data-url="/pages/user/index/index"> | |
| 35 | + <view class="fs26"> | |
| 36 | + <text class="iconfont icon-ren1 bold"></text> | |
| 37 | + </view> | |
| 38 | + <view>会员中心</view> | |
| 39 | + </view> | |
| 40 | + </view> | |
| 41 | + </view> | |
| 42 | + </view> | |
| 43 | + <!-- 搜索 --> | |
| 44 | + <view class="flex ai-center fs26 bg-white pd20"> | |
| 45 | + <text class="pd20 c-9b iconfont icon-fenxiang" catch:tap="goto" data-url="/packageC/pages/goods/distributionCategoryList/index"></text> | |
| 46 | + <view class="input-container f1"> | |
| 47 | + <input class="input" type="text" value="{{inputVal}}" placeholder="请输入商品关键字" confirm-type="search" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input" bindconfirm="search" /> | |
| 48 | + <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text> | |
| 49 | + <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 --> | |
| 50 | + </view> | |
| 51 | + <view class="pd20 c-red" bindtap="search">搜索</view> | |
| 52 | + </view> | |
| 53 | + </view> | |
| 54 | + <view class="flex t-c fs26 bg-white bdb sticky c-a" catchtap="clickTab"> | |
| 55 | + <block wx:for="{{tabArr}}"> | |
| 56 | + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:if="{{index != 3}}"> | |
| 57 | + {{item}} | |
| 58 | + </view> | |
| 59 | + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:else bindtap="clickSort"> | |
| 60 | + {{item}} | |
| 61 | + <text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}"></text> | |
| 62 | + <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" wx:else></text> | |
| 63 | + </view> | |
| 64 | + </block> | |
| 65 | + <view class="f1 pd20" catchtap="change"> | |
| 66 | + <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text> | |
| 67 | + </view> | |
| 68 | + </view> | |
| 69 | + <view class="content"> | |
| 70 | + <view class="fs26" wx:if="{{isShowRow}}"> | |
| 71 | + <view class="item bg-white flex ai-center pd20" wx:for="{{list}}"> | |
| 72 | + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 73 | + <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}"> | |
| 74 | + <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit" /> | |
| 75 | + </view> | |
| 76 | + <view class="flex fdc jc_sb"> | |
| 77 | + <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> | |
| 78 | + <!-- 判断是否有活动价 --> | |
| 79 | + <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 80 | + <view class="flex xc-wc pdt20"> | |
| 81 | + <text wx:if="{{item.prom_integral}}"> | |
| 82 | + <text class="fs30">{{item.prom_integral}}</text> | |
| 83 | + 积分 | |
| 84 | + </text> | |
| 85 | + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | |
| 86 | + <!-- 活动价 --> | |
| 87 | + <view class="flex xc-wc ai_and" wx:if="{{item.prom_price}}"> | |
| 88 | + <!-- <view class="fs24">¥</view> --> | |
| 89 | + <view class="fs30 money">{{item.prom_price}}</view> | |
| 90 | + </view> | |
| 91 | + </view> | |
| 92 | + <view class="flex" style="line-height: 28rpx;"> | |
| 93 | + <!-- 原价 --> | |
| 94 | + <view class="price flex xc-ash line_th"> | |
| 95 | + <!-- <view class="fs22">¥</view> --> | |
| 96 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 97 | + </view> | |
| 98 | + </view> | |
| 99 | + </block> | |
| 100 | + <block wx:else> | |
| 101 | + <!-- 商品价格,先判断下是后⼜等级价 --> | |
| 102 | + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | |
| 103 | + <!-- 当会员是等级卡的时候 --> | |
| 104 | + <block wx:if="{{card_field}}"> | |
| 105 | + <!-- 等级价>0 --> | |
| 106 | + <block wx:if="{{item[card_field]>0}}"> | |
| 107 | + <view class="flex"> | |
| 108 | + <!-- 办卡价 --> | |
| 109 | + <view class="flex xc-wc ai_and"> | |
| 110 | + <!-- <view class="fs24">¥</view> --> | |
| 111 | + <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view> | |
| 112 | + <view class="card_bg"> | |
| 113 | + <image src="{{url + 'miniapp/images/plus/dj_icon.png'}}" /> | |
| 114 | + <text class="card_name ellipsis-1">{{card_name}}</text> | |
| 115 | + </view> | |
| 116 | + </view> | |
| 117 | + </view> | |
| 118 | + <view class="flex" style="line-height: 28rpx;"> | |
| 119 | + <!-- 原价 --> | |
| 120 | + <view class="price flex xc-ash line_th"> | |
| 121 | + <!-- <view class="fs22">¥</view> --> | |
| 122 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 123 | + </view> | |
| 124 | + </view> | |
| 125 | + </block> | |
| 126 | + <blocK wx:else> | |
| 127 | + <view class="flex"> | |
| 128 | + <!-- 办卡价 --> | |
| 129 | + <view class="flex xc-wc"> | |
| 130 | + <!-- <view class="fs24">¥</view> --> | |
| 131 | + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 132 | + </view> | |
| 133 | + </view> | |
| 134 | + <view class="flex" style="line-height: 28rpx;"> | |
| 135 | + <!-- 原价 --> | |
| 136 | + <view class="price flex xc-ash line_th"> | |
| 137 | + <!-- <view class="fs22">¥</view> --> | |
| 138 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 139 | + </view> | |
| 140 | + </view> | |
| 141 | + </blocK> | |
| 142 | + </block> | |
| 143 | + <block wx:else> | |
| 144 | + <!-- 如果商品有设置等级价⼤于0的 --> | |
| 145 | + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> | |
| 146 | + <view class="flex"> | |
| 147 | + <!-- 办卡价 --> | |
| 148 | + <view class="flex xc-wc"> | |
| 149 | + <!-- <view class="fs24">¥</view> --> | |
| 150 | + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 151 | + </view> | |
| 152 | + <!-- 原价 --> | |
| 153 | + <view class="price flex xc-ash line_th"> | |
| 154 | + <!-- <view class="fs22">¥</view> --> | |
| 155 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 156 | + </view> | |
| 157 | + </view> | |
| 158 | + <view class="flexr" style=""> | |
| 159 | + <!-- 等级价 --> | |
| 160 | + <view class="price flex ai-center"> | |
| 161 | + <!-- <view class="fs22">¥</view> --> | |
| 162 | + <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view> | |
| 163 | + <view class="card_bg"> | |
| 164 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | |
| 165 | + <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}} </text> | |
| 166 | + </view> | |
| 167 | + </view> | |
| 168 | + </view> | |
| 169 | + </block> | |
| 170 | + <block wx:else> | |
| 171 | + <view class="flex"> | |
| 172 | + <!-- 办卡价 --> | |
| 173 | + <view class="flex xc-wc"> | |
| 174 | + <!-- <view class="fs24">¥</view> --> | |
| 175 | + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 176 | + </view> | |
| 177 | + </view> | |
| 178 | + <view class="flex" style="line-height: 28rpx;"> | |
| 179 | + <!-- 原价 --> | |
| 180 | + <view class="price flex xc-ash line_th"> | |
| 181 | + <!-- <view class="fs22">¥</view> --> | |
| 182 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 183 | + </view> | |
| 184 | + </view> | |
| 185 | + </block> | |
| 186 | + </block> | |
| 187 | + </block> | |
| 188 | + <!-- 商品压根就没有等级价 --> | |
| 189 | + <block wx:else> | |
| 190 | + <view class="flex"> | |
| 191 | + <!-- 办卡价 --> | |
| 192 | + <view class="flex xc-wc"> | |
| 193 | + <!-- <view class="fs24">¥</view> --> | |
| 194 | + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 195 | + </view> | |
| 196 | + </view> | |
| 197 | + <view class="flex" style="line-height: 28rpx;"> | |
| 198 | + <!-- 原价 --> | |
| 199 | + <view class="price flex xc-ash line_th"> | |
| 200 | + <!-- <view class="fs22">¥</view> --> | |
| 201 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 202 | + </view> | |
| 203 | + </view> | |
| 204 | + </block> | |
| 205 | + </block> | |
| 206 | + <!-- 分层金额 --> | |
| 207 | + <view hidden="{{ishidden_comise}}" class="fs24 c-a"> | |
| 208 | + 分成金额: | |
| 209 | + <text class="money c-red">{{filter.toFix(item.commission,2)}}</text> | |
| 210 | + </view> | |
| 211 | + </view> | |
| 212 | + </view> | |
| 213 | + </view> | |
| 214 | + </view> | |
| 215 | + <view class="fs26 flex pd20 wrap" wx:else> | |
| 216 | + <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 217 | + <view class="img-container" data-txt="已售:{{item.sales_sum}}"> | |
| 218 | + <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true" /> | |
| 219 | + </view> | |
| 220 | + <view class="pd20 fs26"> | |
| 221 | + <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> | |
| 222 | + <!-- 判断是否有活动价 --> | |
| 223 | + <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 224 | + <view class="flex xc-wc"> | |
| 225 | + <text wx:if="{{item.prom_integral}}"> | |
| 226 | + <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text> | |
| 227 | + 积分 | |
| 228 | + </text> | |
| 229 | + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | |
| 230 | + <!-- 活动价 --> | |
| 231 | + <view class="flex xc-wc" wx:if="{{item.prom_price}}"> | |
| 232 | + <!-- <view class="fs24">¥</view> --> | |
| 233 | + <view class="fs30 money">{{item.prom_price}}</view> | |
| 234 | + </view> | |
| 235 | + </view> | |
| 236 | + <view class="flex" style="line-height: 28rpx;"> | |
| 237 | + <!-- 原价 --> | |
| 238 | + <view class="price flex xc-ash line_th"> | |
| 239 | + <!-- <view class="fs22">¥</view> --> | |
| 240 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 241 | + </view> | |
| 242 | + </view> | |
| 243 | + </block> | |
| 244 | + <block wx:else> | |
| 245 | + <!-- 商品价格,先判断下是后⼜等级价 --> | |
| 246 | + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | |
| 247 | + <!-- 当会员是等级卡的时候 --> | |
| 248 | + <block wx:if="{{card_field}}"> | |
| 249 | + <!-- 等级价>0 --> | |
| 250 | + <block wx:if="{{item[card_field]>0}}"> | |
| 251 | + <view class="flex"> | |
| 252 | + <!-- 办卡价 --> | |
| 253 | + <view class="flex xc-wc ai_and"> | |
| 254 | + <!-- <view class="fs24">¥</view> --> | |
| 255 | + <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view> | |
| 256 | + <view class="card_bg"> | |
| 257 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png" /> | |
| 258 | + <text class="card_name ellipsis-1">{{card_name}}</text> | |
| 259 | + </view> | |
| 260 | + </view> | |
| 261 | + </view> | |
| 262 | + <view class="flex" style="line-height: 28rpx;"> | |
| 263 | + <!-- 原价 --> | |
| 264 | + <view class="price flex xc-ash line_th"> | |
| 265 | + <!-- <view class="fs22">¥</view> --> | |
| 266 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 267 | + </view> | |
| 268 | + </view> | |
| 269 | + </block> | |
| 270 | + <blocK wx:else> | |
| 271 | + <view class="flex"> | |
| 272 | + <!-- 办卡价 --> | |
| 273 | + <view class="flex xc-wc ai_and"> | |
| 274 | + <!-- <view class="fs24">¥</view> --> | |
| 275 | + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 276 | + </view> | |
| 277 | + </view> | |
| 278 | + <view class="flex" style="line-height: 28rpx;"> | |
| 279 | + <!-- 原价 --> | |
| 280 | + <view class="price flex xc-ash line_th"> | |
| 281 | + <!-- <view class="fs22">¥</view> --> | |
| 282 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 283 | + </view> | |
| 284 | + </view> | |
| 285 | + </blocK> | |
| 286 | + </block> | |
| 287 | + <block wx:else> | |
| 288 | + <!-- 如果商品有设置等级价⼤于0的 --> | |
| 289 | + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> | |
| 290 | + <view class="flex"> | |
| 291 | + <!-- 办卡价 --> | |
| 292 | + <view class="flex xc-wc ai_and"> | |
| 293 | + <!-- <view class="fs24">¥</view> --> | |
| 294 | + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 295 | + </view> | |
| 296 | + <!-- 原价 --> | |
| 297 | + <view class="price flex xc-ash line_th"> | |
| 298 | + <!-- <view class="fs22">¥</view> --> | |
| 299 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 300 | + </view> | |
| 301 | + </view> | |
| 302 | + <view class="flexr" style=""> | |
| 303 | + <!-- 等级价 --> | |
| 304 | + <view class="price flex ai-center"> | |
| 305 | + <!-- <view class="fs22">¥</view> --> | |
| 306 | + <view class="fs28 money"> | |
| 307 | + {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}} | |
| 308 | + </view> | |
| 309 | + <view class="card_bg"> | |
| 310 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png" /> | |
| 311 | + <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text> | |
| 312 | + </view> | |
| 313 | + </view> | |
| 314 | + </view> | |
| 315 | + </block> | |
| 316 | + <block wx:else> | |
| 317 | + <view class="flex"> | |
| 318 | + <!-- 办卡价 --> | |
| 319 | + <view class="flex xc-wc ai_and"> | |
| 320 | + <!-- <view class="fs24">¥</view> --> | |
| 321 | + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 322 | + </view> | |
| 323 | + </view> | |
| 324 | + <view class="flex" style="line-height: 28rpx;"> | |
| 325 | + <!-- 原价 --> | |
| 326 | + <view class="price flex xc-ash line_th"> | |
| 327 | + <!-- <view class="fs22">¥</view> --> | |
| 328 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 329 | + </view> | |
| 330 | + </view> | |
| 331 | + </block> | |
| 332 | + </block> | |
| 333 | + </block> | |
| 334 | + <!-- 商品压根就没有等级价 --> | |
| 335 | + <block wx:else> | |
| 336 | + <view class="flex"> | |
| 337 | + <!-- 办卡价 --> | |
| 338 | + <view class="flex xc-wc ai_and"> | |
| 339 | + <!-- <view class="fs24">¥</view> --> | |
| 340 | + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view> | |
| 341 | + </view> | |
| 342 | + </view> | |
| 343 | + <view class="flex" style="line-height: 28rpx;"> | |
| 344 | + <!-- 原价 --> | |
| 345 | + <view class="price flex xc-ash line_th"> | |
| 346 | + <!-- <view class="fs22">¥</view> --> | |
| 347 | + <view class="fs22 money">{{item.market_price}}</view> | |
| 348 | + </view> | |
| 349 | + </view> | |
| 350 | + </block> | |
| 351 | + </block> | |
| 352 | + <!-- 分层金额 --> | |
| 353 | + <view class="fs24 c-a"> | |
| 354 | + 分成金额: | |
| 355 | + <text class="money c-red">{{filter.toFix(item.commission,2)}}</text> | |
| 356 | + </view> | |
| 357 | + </view> | |
| 358 | + </view> | |
| 359 | + </view> | |
| 360 | + <nodata class="t-c" wx:if="{{list.length == 0 && list}}"></nodata> | |
| 361 | + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.length !== 0}}"> | |
| 362 | + - 已经到底了 - | |
| 363 | + </view> | |
| 364 | + </view> | |
| 365 | +</view> | |
| 360 | 366 | \ No newline at end of file | ... | ... |
packageC/pages/goods/distributionCategoryList/index.js
| ... | ... | @@ -292,16 +292,31 @@ Page({ |
| 292 | 292 | |
| 293 | 293 | //跳转到品牌的商品列表 |
| 294 | 294 | go_brand: function (t) { |
| 295 | - var cid = t.currentTarget.dataset.bid; | |
| 296 | - var lurl = "../../goods/goodsList/goodsList?brand_id=" + cid; | |
| 297 | - wx.navigateTo({ url: lurl }); | |
| 295 | + var bid = t.currentTarget.dataset.bid; | |
| 296 | + // getApp().globalData.bid=bid; | |
| 297 | + // console.log(getApp().globalData.bid); | |
| 298 | + // let page=getCurrentPages(); | |
| 299 | + // let prePage=page[page.length-2]; | |
| 300 | + // console.log(prePage); | |
| 301 | + // prePage.setData({ | |
| 302 | + // brand_id:cid, | |
| 303 | + // }) | |
| 304 | + var lurl = "/packageA/pages/distribution/shop/shop?brand_id=" + bid; | |
| 305 | + // var lurl = "/packageA/pages/distribution/shop/shop"; | |
| 306 | + // wx.redirectTo({ url: lurl }); | |
| 307 | + wx.navigateTo({ url: lurl }) | |
| 308 | + // wx.navigateBack() | |
| 298 | 309 | }, |
| 299 | 310 | |
| 300 | 311 | //跳转到国别的商品列表 |
| 301 | 312 | go_nation: function (t) { |
| 302 | - var cid = t.currentTarget.dataset.nid; | |
| 303 | - var lurl = "../../goods/goodsList/goodsList?nation_id=" + cid; | |
| 313 | + var nid = t.currentTarget.dataset.nid; | |
| 314 | + // getApp().globalData.nid=nid; | |
| 315 | + var lurl = "/packageA/pages/distribution/shop/shop?nation_id=" + nid; | |
| 316 | + // var lurl = "/packageA/pages/distribution/shop/shop"; | |
| 304 | 317 | wx.navigateTo({ url: lurl }); |
| 318 | + | |
| 319 | + // wx.navigateBack() | |
| 305 | 320 | }, |
| 306 | 321 | //获取国别 |
| 307 | 322 | get_nation: function () { | ... | ... |
packageC/pages/goods/distributionCategoryList/index.wxss
packageC/pages/goods/goodsList/goodsList.js
| ... | ... | @@ -72,9 +72,7 @@ Page({ |
| 72 | 72 | if (getApp().globalData.userInfo) { |
| 73 | 73 | url += "&user_id=" + getApp().globalData.userInfo.user_id; |
| 74 | 74 | } |
| 75 | - this.setData({ | |
| 76 | - baseUrl:url, | |
| 77 | - }) | |
| 75 | + this.requestGoodsList(url); | |
| 78 | 76 | //优惠活动的凑单 |
| 79 | 77 | if (t.prom_type == 3) { |
| 80 | 78 | if (0 != t.prom_id && t.prom_id != undefined) { url += "&prom_id=" + t.prom_id; } |
| ... | ... | @@ -89,8 +87,6 @@ Page({ |
| 89 | 87 | } |
| 90 | 88 | }) |
| 91 | 89 | } |
| 92 | - this.getInitData() | |
| 93 | - | |
| 94 | 90 | getApp().getConfig2(function (rs) { |
| 95 | 91 | //计算等级价相关 |
| 96 | 92 | var swithc_list = rs.switch_list; |
| ... | ... | @@ -121,12 +117,7 @@ Page({ |
| 121 | 117 | }) |
| 122 | 118 | }, 500) |
| 123 | 119 | } |
| 124 | - }); | |
| 125 | - | |
| 126 | - }, | |
| 127 | - async getInitData(){ | |
| 128 | - await this.getShopGoods(); | |
| 129 | - await this.requestGoodsList(this.data.baseUrl); | |
| 120 | + }); | |
| 130 | 121 | }, |
| 131 | 122 | //设置优惠券的 |
| 132 | 123 | set_prom_list: async function (arr) { |
| ... | ... | @@ -135,7 +126,6 @@ Page({ |
| 135 | 126 | //优惠的实际内容 |
| 136 | 127 | var content = JSON.parse(arr[i].preferential_type); |
| 137 | 128 | arr[i].content = content; |
| 138 | - | |
| 139 | 129 | //--送礼包-- |
| 140 | 130 | if (content.is_libao) { |
| 141 | 131 | //-- 获取 -- |
| ... | ... | @@ -172,34 +162,6 @@ Page({ |
| 172 | 162 | this.resetData(), this.requestGoodsList(url); |
| 173 | 163 | }, |
| 174 | 164 | |
| 175 | - //分销小店的商品 | |
| 176 | - async getShopGoods() { | |
| 177 | - let data= { | |
| 178 | - store_id: oo.stoid, | |
| 179 | - user_id: getApp().globalData.user_id, | |
| 180 | - page:this.data.page, | |
| 181 | - pageSize:2000, | |
| 182 | - }; | |
| 183 | - // this.setData({ | |
| 184 | - // is_go:0 | |
| 185 | - // }) | |
| 186 | - // a.init(this, "", "shopGoodsData"); | |
| 187 | - // let url=`/api/weshop/users/distribut/pagemyshop?orderType=desc&store_id=${oo.stoid}&user_id=${getApp().globalData.user_id}`; | |
| 188 | - let url=`/api/weshop/users/distribut/pagemyshop?orderType=desc`; | |
| 189 | - const distriGoods = await getApp().request.promiseGet(url, { | |
| 190 | - data: data, | |
| 191 | - isShowLoading: false, | |
| 192 | - }); | |
| 193 | - console.log(distriGoods,1); | |
| 194 | - if (distriGoods.data.code == 0 && distriGoods.data.data.pageData.length > 0) { | |
| 195 | - this.setData({ | |
| 196 | - shopGoodsData: distriGoods.data.data.pageData, | |
| 197 | - }) | |
| 198 | - } | |
| 199 | - // this.requestGoodsList(url) | |
| 200 | - }, | |
| 201 | - | |
| 202 | - | |
| 203 | 165 | requestGoodsList: async function (t) { |
| 204 | 166 | |
| 205 | 167 | if(this.data.is_no_more){ |
| ... | ... | @@ -216,57 +178,18 @@ Page({ |
| 216 | 178 | } |
| 217 | 179 | |
| 218 | 180 | t += "&page=" + e.data.currentPage; |
| 219 | - t += "&pageSize=" + 2000; | |
| 181 | + t += "&pageSize=" + 20; | |
| 220 | 182 | t +="&store_id=" +oo.stoid; |
| 221 | 183 | const { data: res } = await getApp().request.promiseGet(t, { |
| 222 | 184 | isShowLoading: true, |
| 223 | 185 | }) |
| 224 | 186 | console.log(res); |
| 225 | - | |
| 226 | 187 | if (res.code == 0 && res.data.pageData.length > 0) { |
| 227 | - let arr = []; | |
| 228 | - arr = res.data.pageData.filter(obj => this.data.shopGoodsData.some(item => item.goods_id == obj.goods_id)); | |
| 229 | - console.log(arr); | |
| 230 | 188 | this.setData({ |
| 231 | - requestData: arr, | |
| 232 | - is_no_more:1, | |
| 189 | + requestData: res.data.pageData, | |
| 190 | + | |
| 233 | 191 | }); |
| 234 | - // if (res.data.page > 1) { | |
| 235 | - // this.setData({ | |
| 236 | - // requestData: this.data.requestData.concat(arr), | |
| 237 | - // // select_classify_on: index, | |
| 238 | - // }); | |
| 239 | - // } else { | |
| 240 | - // this.setData({ | |
| 241 | - // requestData: arr, | |
| 242 | - // // select_classify_on: index, | |
| 243 | - // }); | |
| 244 | - // }; | |
| 245 | 192 | } |
| 246 | - // a.request(t, | |
| 247 | - // function (t) { | |
| 248 | - // let arr=[]; | |
| 249 | - // e.setData({ is_go: 1 }); | |
| 250 | - // null == e.data.allData && (e.data.allData = Object.assign({}, t.data.result)), | |
| 251 | - // wx.stopPullDownRefresh(); | |
| 252 | - | |
| 253 | - // arr = e.data.requestData.filter(obj => e.data.shopGoodsData.some(item => item.goods_id == obj.goods_id)); | |
| 254 | - // // e.data.requestData.map(item => { | |
| 255 | - // // e.data.shopGoodsData.forEach(i => { | |
| 256 | - // // if (i.nation_id = item.nation_id) { | |
| 257 | - // // return item | |
| 258 | - // // } | |
| 259 | - // // }); | |
| 260 | - // // arr.push(item); | |
| 261 | - // // }); | |
| 262 | - // console.log(arr); | |
| 263 | - // // e.setData({ | |
| 264 | - // // requestData: arr, | |
| 265 | - // // }); | |
| 266 | - // }, | |
| 267 | - // null, { is_mainshow: 1, isonsale: 1, store_id: oo.stoid } | |
| 268 | - // ); | |
| 269 | - | |
| 270 | 193 | }, |
| 271 | 194 | getInput(e) { |
| 272 | 195 | this.setData({ |
| ... | ... | @@ -280,10 +203,6 @@ Page({ |
| 280 | 203 | t.showWarning("请输入搜索关键词"); |
| 281 | 204 | return false |
| 282 | 205 | } |
| 283 | - // this.search(val); | |
| 284 | - // wx.navigateTo({ | |
| 285 | - // url: `/packageA/pages/distribution/shop/shop?key_word=${val}`, | |
| 286 | - // }); | |
| 287 | 206 | wx.navigateBack({ |
| 288 | 207 | delta: 2 |
| 289 | 208 | }); | ... | ... |
pages/distribution/distribution.js
pages/goods/categoryList/categoryList.wxml
| ... | ... | @@ -90,55 +90,60 @@ |
| 90 | 90 | <view class="no-data" wx:if="{{!is_date}}"> |
| 91 | 91 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 92 | 92 | <view class="no-data-title">暂无分类</view> |
| 93 | - <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 93 | + <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator> | |
| 94 | 94 | </view> |
| 95 | 95 | </block> |
| 96 | 96 | <block wx:elif="{{is_do}}"> |
| 97 | 97 | <view class="no-data" > |
| 98 | 98 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 99 | 99 | <view class="no-data-title">商家暂未设置分类</view> |
| 100 | - <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 100 | + <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator> | |
| 101 | 101 | </view> |
| 102 | 102 | </block> |
| 103 | 103 | </block> |
| 104 | 104 | <!-- 风格2 --> |
| 105 | 105 | <block wx:elif="{{is_used_share == 1}}"> |
| 106 | 106 | <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
| 107 | - <!-- 新版分类头部 --> | |
| 108 | - <view class="xc-search-box flex-center white_b" style="position:fixed;top:0;z-index:99"> | |
| 109 | - <view class="share-height t-c" bindtap="getScancode" > | |
| 110 | - <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> | |
| 111 | - <view class="fs24"> | |
| 112 | - 扫一扫 | |
| 113 | - </view> | |
| 114 | - </view> | |
| 115 | - <view class="xc-search-inner "> | |
| 116 | - <view class="search-img left"> | |
| 117 | - <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | |
| 118 | - </view> | |
| 119 | - <input bindfocus="goseach" class="search-cont" placeholder="请输入您所搜索的商品" type="text"></input> | |
| 120 | - </view> | |
| 121 | - </view> | |
| 107 | + <!-- 新版分类头部 --> | |
| 108 | + <view class="xc-search-box flex jc_sb ai-center" style="position:fixed;top:0;z-index:99"> | |
| 109 | + <!-- <view class="xc-search-inner "> | |
| 110 | + <view class="search-img left"> | |
| 111 | + <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | |
| 112 | + </view> | |
| 113 | + <input bindfocus="goseach" class="search-cont" placeholder="搜索店铺商品" type="text"></input> | |
| 114 | + </view> --> | |
| 115 | + <!-- 搜索框 --> | |
| 116 | + <view class="search-container f1"> | |
| 117 | + <view bindtap="goseach"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</view> | |
| 118 | + </view> | |
| 119 | + <view class="pdl30" bindtap="getScancode" > | |
| 120 | + <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> | |
| 121 | + <!-- <view class="fs24">扫一扫</view> --> | |
| 122 | + </view> | |
| 123 | + | |
| 124 | + </view> | |
| 122 | 125 | |
| 123 | 126 | |
| 124 | 127 | <!-- 分类项目内容 22 --> |
| 125 | - <view class="flex project_height" style="height:100%;box-sizing:border-box;padding-bottom:100rpx;padding-top:120rpx;" id="two_type"> | |
| 128 | + <view class="flex project_height" style="height:100%;box-sizing:border-box;padding-bottom:100rpx;padding-top:108rpx;" id="two_type"> | |
| 126 | 129 | <!-- 分类项目的类型 --> |
| 127 | - <view class="project_type" style="background-color:#eee;<!-- height:88%; -->overflow-y:auto;position:fixed;left:0;z-index:99;top:120rpx;"> | |
| 130 | + <view class="project_type" style="background-color:#f4f4f4;overflow-y:auto;position:fixed;left:0;z-index:99;top:108rpx;"> | |
| 128 | 131 | <view class="project_type-frame" style="margin-bottom:120rpx;"> |
| 129 | 132 | <view wx:if="{{is_show_gb}}" class="{{status_show == 1?'':''}}"> |
| 130 | 133 | <!-- <view style="{{status_show == 1?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> --> |
| 131 | - <view bindtap="click_classify" style="{{status_show == 1?'margin-top:0':'margin-top:40rpx'}}" class="fs30 flex-space-between {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> | |
| 134 | + <view bindtap="click_classify" style="{{status_show == 1?'margin-top:0':'margin-top:40rpx'}}" class="fs30 {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> | |
| 132 | 135 | |
| 133 | - <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">国家</view> | |
| 136 | + <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">国家</view> --> | |
| 137 | + <view class="tab-bar-item sort-name ellipsis-1" style="">国家</view> | |
| 134 | 138 | |
| 135 | 139 | </view> |
| 136 | 140 | </view> |
| 137 | 141 | <view wx:if="{{is_show_pp}}" class="{{status_show == 2?'':''}}"> |
| 138 | 142 | <!-- <view style="{{status_show == 2?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> --> |
| 139 | - <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} fs30 flex-space-between " wx:if="{{is_brand}}"data-index="220"data-name="品牌"> | |
| 143 | + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} fs30" wx:if="{{is_brand}}"data-index="220"data-name="品牌"> | |
| 140 | 144 | |
| 141 | - <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">品牌</view> | |
| 145 | + <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">品牌</view> --> | |
| 146 | + <view class="tab-bar-item sort-name ellipsis-1" style="">品牌</view> | |
| 142 | 147 | </view> |
| 143 | 148 | </view> |
| 144 | 149 | <view wx:if="{{is_show_pl}}"> |
| ... | ... | @@ -210,11 +215,11 @@ |
| 210 | 215 | <block wx:if="{{is_show_pl}}"> |
| 211 | 216 | <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> |
| 212 | 217 | <view class="my-container"> |
| 213 | - <view class="classify_name fs28 flex-space-between"data-pid="0"data-cid="{{cat_id}}" bindtap='select_more'> | |
| 218 | + <view class="classify_name fs28 flex-space-between ai-center"data-pid="0"data-cid="{{cat_id}}" bindtap='select_more'> | |
| 214 | 219 | <view class="classify_title ellipsis-1">{{classify_name}}</view> |
| 215 | - <view class="flex select_more" > | |
| 220 | + <view class="flex select_more ai-center" > | |
| 216 | 221 | <view class="red-co fs24" >更多</view> |
| 217 | - <view class="bg_right width_height"></view> | |
| 222 | + <view class="bg_right width_height" style="margin-top: 0;"></view> | |
| 218 | 223 | </view> |
| 219 | 224 | </view> |
| 220 | 225 | <!-- 显示2级列表 --> |
| ... | ... | @@ -223,7 +228,7 @@ |
| 223 | 228 | <block wx:for="{{goodslist}}" wx:for-item="goods" wx:for-index="indx"> |
| 224 | 229 | <view class="type_img_frame t-c ib" data-cid="{{goods.items.id}}" data-pid="{{goods.items.parent_id}}" bindtap="go_cate"> |
| 225 | 230 | <image class=" type_img" src="{{goods.items.icoimg==null||goods.items.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':goods.items.icoimg}}"binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image> |
| 226 | - <view class="brand_img_name fs24 ellipsis-1">{{goods.items.name}}</view> | |
| 231 | + <view class="brand_img_name fs24 ellipsis-1 pdh10">{{goods.items.name}}</view> | |
| 227 | 232 | </view> |
| 228 | 233 | </block> |
| 229 | 234 | </block> |
| ... | ... | @@ -240,12 +245,12 @@ |
| 240 | 245 | <block wx:for="{{goodslist}}"wx:for-item="goods"wx:for-index="inds"> |
| 241 | 246 | <view> |
| 242 | 247 | |
| 243 | - <view class="classify_name fs28 flex-space-between"data-pid="{{goods.items.parent_id}}" data-cid="{{goods.items.id}}" bindtap='select_more'> | |
| 248 | + <view class="classify_name fs28 flex-space-between ai-center"data-pid="{{goods.items.parent_id}}" data-cid="{{goods.items.id}}" bindtap='select_more'> | |
| 244 | 249 | |
| 245 | 250 | <view class="classify_title ellipsis-1">{{goods.items.name}}</view> |
| 246 | - <view class="flex select_more" > | |
| 251 | + <view class="flex select_more ai-center" > | |
| 247 | 252 | <view class="red-co fs24" >更多</view> |
| 248 | - <view class="bg_right width_height"></view> | |
| 253 | + <view class="bg_right width_height" style="margin-top: 0;"></view> | |
| 249 | 254 | </view> |
| 250 | 255 | </view> |
| 251 | 256 | |
| ... | ... | @@ -253,10 +258,10 @@ |
| 253 | 258 | <view class="classify_content-frame flex-wrap"> |
| 254 | 259 | <view class="type_img_frame t-c ib" data-cid="{{item.id}}" data-pid="three" wx:for="{{goods.arrays}}" wx:for-index="index" wx:for-item="item" bindtap="go_cate"> |
| 255 | 260 | <image class=" type_img"src="{{item.icoimg==null||item.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':item.icoimg}}"binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image> |
| 256 | - <view class="brand_img_name fs24 ellipsis-1">{{item.name}}</view> | |
| 261 | + <view class="brand_img_name fs24 ellipsis-1 pdh10">{{item.name}}</view> | |
| 257 | 262 | </view> |
| 258 | 263 | </view> |
| 259 | - <view class="divider_line"></view> | |
| 264 | + <!-- <view class="divider_line"></view> --> | |
| 260 | 265 | </block> |
| 261 | 266 | |
| 262 | 267 | </view> |
| ... | ... | @@ -270,7 +275,7 @@ |
| 270 | 275 | <view class="no-data" > |
| 271 | 276 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 272 | 277 | <view class="no-data-title">商家暂未设置分类</view> |
| 273 | - <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 278 | + <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator> | |
| 274 | 279 | </view> |
| 275 | 280 | </block> |
| 276 | 281 | |
| ... | ... | @@ -280,7 +285,7 @@ |
| 280 | 285 | <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
| 281 | 286 | <!-- 头部 --> |
| 282 | 287 | <view class="xc-search-box flex-center white_b" id="navbar" style="position:fixed;top:0;z-index:99"> |
| 283 | - <view class="share-height t-c" bindtap="getScancode" > | |
| 288 | + <!-- <view class="share-height t-c" bindtap="getScancode" > | |
| 284 | 289 | <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> |
| 285 | 290 | <view class="fs24"> |
| 286 | 291 | 扫一扫 |
| ... | ... | @@ -291,23 +296,32 @@ |
| 291 | 296 | <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> |
| 292 | 297 | </view> |
| 293 | 298 | <input bindfocus="goseach" class="search-cont" placeholder="请输入您所搜索的商品" type="text"></input> |
| 294 | - </view> | |
| 299 | + </view> --> | |
| 300 | + | |
| 301 | + <!-- 搜索框 --> | |
| 302 | + <view class="search-container f1"> | |
| 303 | + <view bindtap="goseach"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</view> | |
| 304 | + </view> | |
| 305 | + <view class="pdl30" bindtap="getScancode" > | |
| 306 | + <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> | |
| 307 | + <!-- <view class="fs24">扫一扫</view> --> | |
| 308 | + </view> | |
| 295 | 309 | </view> |
| 296 | 310 | <!-- /头部 --> |
| 297 | 311 | <!-- 分类项目内容 --> |
| 298 | - <view class="flex project_height" style="margin-left:-10rpx;"> | |
| 312 | + <view class="flex project_height" style=""> | |
| 299 | 313 | <!-- 分类项目的类型 --> |
| 300 | - <view class="project_type" style="background-color:#eee;height:88%;overflow-y:auto;position:fixed;left:0;z-index:99;top:120rpx;" id="thress_type3"> | |
| 314 | + <view class="project_type" style="background-color:#f4f4f4;overflow-y:auto;position:fixed;left:0;z-index:99;top:108rpx;" id="thress_type3"> | |
| 301 | 315 | <view class="project_type-frame" style="margin-bottom:120rpx;"> |
| 302 | 316 | <view wx:if="{{is_show_gb}}"> |
| 303 | 317 | <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==223 ? 'active' : ''}}" data-current="223" data-index="223" data-name="国家" wx:if="{{is_country}}"> |
| 304 | - <text style="letter-spacing:50rpx;">国家</text> | |
| 318 | + <text style="">国家</text> | |
| 305 | 319 | </view> |
| 306 | 320 | </view> |
| 307 | 321 | <view wx:if="{{is_show_pp}}"> |
| 308 | 322 | |
| 309 | 323 | <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==220 ? 'active' : ''}}" wx:if="{{is_brand}}" data-current="220" data-index="220" data-name="品牌"> |
| 310 | - <text style="letter-spacing:50rpx;">品牌</text> | |
| 324 | + <text style="">品牌</text> | |
| 311 | 325 | </view> |
| 312 | 326 | </view> |
| 313 | 327 | <view wx:if="{{is_show_pl}}"> |
| ... | ... | @@ -345,7 +359,7 @@ |
| 345 | 359 | </view> |
| 346 | 360 | </view> |
| 347 | 361 | <!-- 分类项目的内容 --> |
| 348 | - <view class="classify_content" style="margin-left:27%;margin-top:120rpx"> | |
| 362 | + <view class="classify_content" style="padding-left:26%;padding-top:108rpx;box-sizing: border-box;"> | |
| 349 | 363 | <!-- 国家的样式 --> |
| 350 | 364 | <block wx:if="{{select_classify_on==223&&is_show_gb}}"> |
| 351 | 365 | <view class="classify_name fs28 flex-space-between"> |
| ... | ... | @@ -394,19 +408,19 @@ |
| 394 | 408 | <!-- 品类--> |
| 395 | 409 | <block wx:if="{{is_show_pl}}"> |
| 396 | 410 | <block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}"> |
| 397 | - <view style="width:100%;height:100%;"> | |
| 398 | - <view class="classify_name fs28 flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="position:fixed;z-index:999999;top:130rpx;width:70%;background-color:#ffffff;left:27%;padding:0 10rpx;"> | |
| 411 | + <view style="width:100%;height:100%;position: relative;"> | |
| 412 | + <view class="classify_name fs28 flex ai-center flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="box-sizing:border-box;position:fixed;z-index: 999;width:74%;background-color:#ffffff;padding:0 20rpx;"> | |
| 399 | 413 | <view class="classify_title ellipsis-1">{{classify_name}}</view> |
| 400 | - <view class="flex select_more" > | |
| 414 | + <view class="flex select_more ai-center" > | |
| 401 | 415 | <view class="red-co fs24" >更多</view> |
| 402 | - <view class="bg_right width_height"></view> | |
| 416 | + <view class="bg_right width_height" style="margin-top: 0;"></view> | |
| 403 | 417 | </view> |
| 404 | 418 | </view> |
| 405 | 419 | <!-- 显示商品列表开始 --> |
| 406 | 420 | <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> |
| 407 | 421 | |
| 408 | 422 | <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> --> |
| 409 | - <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:140rpx;bottom:0;rigth:0;left:26%;width:73%;"> | |
| 423 | + <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:0;bottom:0;left:0;width:100%;"> | |
| 410 | 424 | <view class="null" style="width:100%;height:1px;"></view> |
| 411 | 425 | <!-- goodslist --> |
| 412 | 426 | <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> |
| ... | ... | @@ -560,7 +574,7 @@ |
| 560 | 574 | <view class="no-data" > |
| 561 | 575 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 562 | 576 | <view class="no-data-title">商家暂未设置分类</view> |
| 563 | - <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 577 | + <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator> | |
| 564 | 578 | </view> |
| 565 | 579 | </block> |
| 566 | 580 | </block> | ... | ... |
pages/goods/categoryList/categoryList.wxss
| ... | ... | @@ -47,6 +47,14 @@ swiper{ |
| 47 | 47 | border-radius: 50%; |
| 48 | 48 | overflow: hidden; |
| 49 | 49 | } |
| 50 | +.search-container { | |
| 51 | + color: #bbb; | |
| 52 | + font-size: 26rpx; | |
| 53 | + border-radius: 40rpx; | |
| 54 | + padding: 16rpx; | |
| 55 | + background-color: #f4f4f4; | |
| 56 | +} | |
| 57 | + | |
| 50 | 58 | |
| 51 | 59 | .search-inner { |
| 52 | 60 | display: flex; |
| ... | ... | @@ -176,25 +184,27 @@ line-height: 50rpx; |
| 176 | 184 | /* 商品分类新的版本 */ |
| 177 | 185 | /* 分享样式*/ |
| 178 | 186 | .xc-search-box { |
| 179 | - width: 100%; | |
| 180 | - height: 120rpx; | |
| 181 | - z-index: 10; | |
| 182 | - background: #fff; | |
| 183 | - /* border-top: 4rpx solid #eee; */ | |
| 184 | - border-bottom: 1rpx solid #eee; | |
| 185 | - | |
| 187 | + box-sizing: border-box; | |
| 188 | + width: 100%; | |
| 189 | + /* height: 120rpx; */ | |
| 190 | + z-index: 10; | |
| 191 | + background: #fff; | |
| 192 | + /* border-top: 4rpx solid #eee; */ | |
| 193 | + border-bottom: 1rpx solid #f4f4f4; | |
| 194 | + padding: 20rpx; | |
| 186 | 195 | } |
| 187 | 196 | |
| 188 | 197 | .share-height{ |
| 189 | - line-height: 20rpx; | |
| 198 | + /* line-height: 20rpx; | |
| 190 | 199 | margin-right: 15rpx; |
| 191 | -margin-top: 8rpx; | |
| 200 | +margin-top: 8rpx; */ | |
| 192 | 201 | |
| 193 | 202 | } |
| 194 | -.scanning_black-img{ | |
| 203 | +.scanning_black-img { | |
| 204 | + display: block; | |
| 195 | 205 | width:50rpx; |
| 196 | - height: 45rpx; | |
| 197 | - margin-bottom: 5rpx; | |
| 206 | + height: 50rpx; | |
| 207 | + /* margin-bottom: 5rpx; */ | |
| 198 | 208 | |
| 199 | 209 | } |
| 200 | 210 | .search-img.left{ |
| ... | ... | @@ -219,7 +229,7 @@ margin-top: 8rpx; |
| 219 | 229 | width: 26%; |
| 220 | 230 | height: 100%; |
| 221 | 231 | padding-bottom: 100rpx; |
| 222 | - border-right: 1rpx solid #eee; | |
| 232 | + /* border-right: 1rpx solid #eee; */ | |
| 223 | 233 | white-space: nowrap; |
| 224 | 234 | overflow: hidden; |
| 225 | 235 | overflow-y: scroll; |
| ... | ... | @@ -298,20 +308,20 @@ width: 60%; |
| 298 | 308 | /* width: 90%; |
| 299 | 309 | margin: auto; */ |
| 300 | 310 | height: 70rpx; |
| 301 | - border-bottom: 1rpx solid #f5f6f6; | |
| 311 | + /* border-bottom: 1rpx solid #f5f6f6; */ | |
| 302 | 312 | line-height: 70rpx; |
| 303 | 313 | font-weight: 600; |
| 304 | 314 | padding-left: 20rpx; |
| 305 | 315 | padding-right: 20rpx; |
| 306 | 316 | } |
| 307 | 317 | .classify_content{ |
| 308 | - width: 100% | |
| 309 | - | |
| 318 | + width: 100%; | |
| 319 | + box-sizing: border-box; | |
| 310 | 320 | } |
| 311 | 321 | .classify_content-frame{ |
| 312 | 322 | box-sizing: border-box; |
| 313 | 323 | width: 100%; |
| 314 | - padding: 0 20rpx; | |
| 324 | + padding: 0 12rpx; | |
| 315 | 325 | flex-wrap:wrap; |
| 316 | 326 | overflow-y:scroll; |
| 317 | 327 | } |
| ... | ... | @@ -376,6 +386,7 @@ line-height: 65rpx; |
| 376 | 386 | |
| 377 | 387 | } |
| 378 | 388 | .type_img_frame { |
| 389 | + box-sizing: border-box; | |
| 379 | 390 | width: calc(100% / 3); |
| 380 | 391 | height: 140rpx; |
| 381 | 392 | margin-top: 20rpx; |
| ... | ... | @@ -386,8 +397,8 @@ line-height: 65rpx; |
| 386 | 397 | |
| 387 | 398 | |
| 388 | 399 | .type_img{ |
| 389 | - width:80rpx; | |
| 390 | - height:80rpx; | |
| 400 | + width: 110rpx; | |
| 401 | + height: 110rpx; | |
| 391 | 402 | margin-bottom: 10rpx; |
| 392 | 403 | margin-top: 10rpx; |
| 393 | 404 | |
| ... | ... | @@ -408,9 +419,9 @@ width: 62%; |
| 408 | 419 | margin-top:12rpx; |
| 409 | 420 | } |
| 410 | 421 | .select_more{ |
| 411 | -line-height: 37rpx; | |
| 422 | +/* line-height: 37rpx; */ | |
| 412 | 423 | height: 35rpx; |
| 413 | -margin-top: 24rpx; | |
| 424 | +/* margin-top: 24rpx; */ | |
| 414 | 425 | } |
| 415 | 426 | .divider_line{ |
| 416 | 427 | width: 100%; |
| ... | ... | @@ -431,7 +442,10 @@ margin: auto; |
| 431 | 442 | /* width: 80%; */ |
| 432 | 443 | } |
| 433 | 444 | |
| 434 | -.brand_img_name {color: #666;} | |
| 445 | +.brand_img_name { | |
| 446 | + /* box-sizing: border-box; */ | |
| 447 | + color: #8a8a8a; | |
| 448 | +} | |
| 435 | 449 | |
| 436 | 450 | |
| 437 | 451 | .tab-view { |
| ... | ... | @@ -449,16 +463,16 @@ margin: auto; |
| 449 | 463 | box-sizing: border-box; |
| 450 | 464 | display: flex; |
| 451 | 465 | align-items: center; |
| 452 | - justify-content: left; | |
| 453 | - font-size: 30rpx; | |
| 454 | - padding-left: 30rpx; | |
| 455 | - color: #444; | |
| 456 | - font-weight: 400; | |
| 466 | + justify-content: center; | |
| 467 | + font-size: 28rpx; | |
| 468 | + padding: 0 20rpx; | |
| 469 | + color: #080808; | |
| 470 | + /* font-weight: 400; */ | |
| 457 | 471 | } |
| 458 | 472 | |
| 459 | 473 | #thress_type3 .active { |
| 460 | 474 | position: relative; |
| 461 | - color: #000; | |
| 475 | + color: #e83028; | |
| 462 | 476 | font-size: 30rpx; |
| 463 | 477 | font-weight: 600; |
| 464 | 478 | background: #fff; |
| ... | ... | @@ -467,9 +481,12 @@ margin: auto; |
| 467 | 481 | #thress_type3 .active::before { |
| 468 | 482 | content: ""; |
| 469 | 483 | position: absolute; |
| 470 | - border-left: 8rpx solid #E41F19; | |
| 471 | - height: 50rpx; | |
| 484 | + border-left: 8rpx solid #e83028; | |
| 485 | + border-radius: 8rpx; | |
| 486 | + height: 40rpx; | |
| 472 | 487 | left: 0; |
| 488 | + top: 50%; | |
| 489 | + transform: translateY(-50%); | |
| 473 | 490 | } |
| 474 | 491 | |
| 475 | 492 | |
| ... | ... | @@ -483,11 +500,11 @@ margin: auto; |
| 483 | 500 | box-sizing: border-box; |
| 484 | 501 | display: flex; |
| 485 | 502 | align-items: center; |
| 486 | - justify-content: left; | |
| 487 | - font-size: 30rpx; | |
| 488 | - padding-left: 30rpx; | |
| 489 | - color: #444; | |
| 490 | - font-weight: 400; | |
| 503 | + justify-content: center; | |
| 504 | + font-size: 28rpx; | |
| 505 | + padding: 0 20rpx; | |
| 506 | + color: #080808; | |
| 507 | + /* font-weight: 600; */ | |
| 491 | 508 | } |
| 492 | 509 | #two_type .select_classify { |
| 493 | 510 | position: relative; |
| ... | ... | @@ -500,13 +517,18 @@ margin: auto; |
| 500 | 517 | #two_type .select_classify::before { |
| 501 | 518 | content: ""; |
| 502 | 519 | position: absolute; |
| 503 | - border-left: 8rpx solid #E41F19; | |
| 504 | - height: 50rpx; | |
| 520 | + border-left: 8rpx solid #e83028; | |
| 521 | + border-radius: 8rpx; | |
| 522 | + height: 40rpx; | |
| 505 | 523 | left: 0; |
| 506 | 524 | top:50%; |
| 507 | 525 | transform: translateY(-50%); |
| 508 | 526 | } |
| 509 | 527 | |
| 528 | +#two_type .select_classify .tab-bar-item { | |
| 529 | + color: #e83028; | |
| 530 | +} | |
| 531 | + | |
| 510 | 532 | |
| 511 | 533 | |
| 512 | 534 | #two_type .is_show_class{ |
| ... | ... | @@ -518,7 +540,7 @@ margin: auto; |
| 518 | 540 | |
| 519 | 541 | } |
| 520 | 542 | |
| 521 | - | |
| 543 | + .classify_content > view:last-of-type, | |
| 522 | 544 | .classify_content > view:last-of-type .classify_content-frame { |
| 523 | 545 | padding-bottom: 100rpx; |
| 524 | 546 | } | ... | ... |
pages/goods/goodsList/goodsList.wxml
| ... | ... | @@ -293,8 +293,8 @@ |
| 293 | 293 | |
| 294 | 294 | <view class="no-data" wx:if="{{(!requestData||requestData.length==0) && is_go}}"> |
| 295 | 295 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 296 | - <view class="no-data-title">没有相关的数据</view> | |
| 297 | - <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 296 | + <view class="no-data-title">暂无相关商品</view> | |
| 297 | + <navigator class="lookat" url="/pages/index/index/index">回到首页</navigator> | |
| 298 | 298 | </view> |
| 299 | 299 | </view> |
| 300 | 300 | <view hidden="{{!openFilterModal}}"> | ... | ... |
pages/goods/goodsList/goodsList.wxss
| ... | ... | @@ -59,11 +59,11 @@ page { |
| 59 | 59 | |
| 60 | 60 | .search-box { |
| 61 | 61 | color: #BEBEBE; |
| 62 | - font-size: 24rpx; | |
| 62 | + font-size: 26rpx; | |
| 63 | 63 | /* border: 2rpx solid #f23030; */ |
| 64 | 64 | border-radius: 40rpx; |
| 65 | 65 | padding: 16rpx; |
| 66 | - background-color: #e0e0e0; | |
| 66 | + background-color: #e8e8e8; | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | .icon-sousuo { |
| ... | ... | @@ -266,7 +266,7 @@ page { |
| 266 | 266 | .choice_list.on { |
| 267 | 267 | display: flex; |
| 268 | 268 | flex-wrap: wrap; |
| 269 | - padding-bottom: 12rpx; | |
| 269 | + padding-bottom: 16rpx; | |
| 270 | 270 | padding-left: 16rpx; |
| 271 | 271 | padding-right: 16rpx; |
| 272 | 272 | background-color: #f0f0f0; |
| ... | ... | @@ -293,7 +293,7 @@ page { |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | .choice_list.on .item-cont { |
| 296 | - padding: 10rpx; | |
| 296 | + padding: 10rpx 14rpx; | |
| 297 | 297 | display: flex; |
| 298 | 298 | flex-direction: column; |
| 299 | 299 | justify-content: space-between; |
| ... | ... | @@ -303,3 +303,23 @@ page { |
| 303 | 303 | .choice_list.on .item-cont .flex.on { |
| 304 | 304 | display: block; |
| 305 | 305 | } |
| 306 | + | |
| 307 | +.no-data .cart-image { | |
| 308 | + width: 208rpx; | |
| 309 | + height: 202rpx; | |
| 310 | +} | |
| 311 | + | |
| 312 | +.no-data .no-data-title { | |
| 313 | + font-size: 28rpx; | |
| 314 | + color: #b8b8b8; | |
| 315 | + margin-bottom: 50rpx; | |
| 316 | +} | |
| 317 | + | |
| 318 | +.no-data .lookat { | |
| 319 | + display: inline-block; | |
| 320 | + font-size: 28rpx; | |
| 321 | + border-radius: 10rpx; | |
| 322 | + background-color: #e83028; | |
| 323 | + color: white; | |
| 324 | + padding: 20rpx 50rpx; | |
| 325 | +} | ... | ... |
pages/index/index/index.js
| 1 | -var e = function(e) { | |
| 2 | - return e && e.__esModule ? e : { | |
| 3 | - default: e | |
| 4 | - }; | |
| 5 | - }(require("../../../utils/LoadMore.js")), | |
| 1 | +var e = function (e) { | |
| 2 | + return e && e.__esModule ? e : { | |
| 3 | + default: e | |
| 4 | + }; | |
| 5 | +}(require("../../../utils/LoadMore.js")), | |
| 6 | 6 | t = getApp(), |
| 7 | 7 | a = t.request, |
| 8 | 8 | o = t.globalData.setting, |
| ... | ... | @@ -72,123 +72,123 @@ Page({ |
| 72 | 72 | is_disgraceful: 0, //是否显示新人广告 |
| 73 | 73 | new_image: "", //新人有礼弹窗图片 |
| 74 | 74 | new_nav: "", //新人页面跳转地址 |
| 75 | - w_holiday_pop:0, | |
| 76 | - | |
| 77 | - showHongbao: false, | |
| 78 | - showHongbaoSmall: false, | |
| 79 | - | |
| 80 | - is_full_screen_show:0, //全屏显示 | |
| 81 | - sec_show:3, //倒计时的秒数 | |
| 82 | - full_ad:null, //全屏广告 | |
| 83 | - full_screen:0, //全屏广告 | |
| 84 | - | |
| 75 | + w_holiday_pop: 0, | |
| 76 | + | |
| 77 | + showHongbao: false, | |
| 78 | + showHongbaoSmall: false, | |
| 79 | + | |
| 80 | + is_full_screen_show: 0, //全屏显示 | |
| 81 | + sec_show: 3, //倒计时的秒数 | |
| 82 | + full_ad: null, //全屏广告 | |
| 83 | + full_screen: 0, //全屏广告 | |
| 84 | + | |
| 85 | 85 | }, |
| 86 | 86 | |
| 87 | - onLoad: async function(tt) { | |
| 88 | - console.log("进入首页-------------"); | |
| 89 | - console.log(tt); | |
| 90 | - var th = this; | |
| 91 | - var first_leader=tt.first_leader; | |
| 92 | - if(!first_leader && tt.scene){ | |
| 93 | - var first_leader_str= decodeURIComponent(tt.scene); | |
| 94 | - var f_arr=first_leader_str.split("_"); | |
| 95 | - first_leader=f_arr[0] && parseFloat(f_arr[0])>0?f_arr[0]:null; | |
| 96 | - //注册门店 | |
| 97 | - if(f_arr[1] && parseFloat(f_arr[1])>0){ | |
| 98 | - getApp().globalData.store_number=f_arr[1]; | |
| 87 | + onLoad: async function (tt) { | |
| 88 | + console.log("进入首页-------------"); | |
| 89 | + console.log(tt); | |
| 90 | + var th = this; | |
| 91 | + var first_leader = tt.first_leader; | |
| 92 | + if (!first_leader && tt.scene) { | |
| 93 | + var first_leader_str = decodeURIComponent(tt.scene); | |
| 94 | + var f_arr = first_leader_str.split("_"); | |
| 95 | + first_leader = f_arr[0] && parseFloat(f_arr[0]) > 0 ? f_arr[0] : null; | |
| 96 | + //注册门店 | |
| 97 | + if (f_arr[1] && parseFloat(f_arr[1]) > 0) { | |
| 98 | + getApp().globalData.store_number = f_arr[1]; | |
| 99 | + } | |
| 100 | + } | |
| 101 | + | |
| 102 | + getApp().getConfig(function (e) { | |
| 103 | + //--首页的问题-- | |
| 104 | + if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) { | |
| 105 | + wx.setNavigationBarTitle({ | |
| 106 | + title: getApp().globalData.config.store_name, | |
| 107 | + }); | |
| 108 | + } else { | |
| 109 | + wx.setNavigationBarTitle({ | |
| 110 | + title: getApp().globalData.setting.appName, | |
| 111 | + }); | |
| 112 | + }; | |
| 113 | + }); | |
| 114 | + | |
| 115 | + | |
| 116 | + var th = this; | |
| 117 | + getApp().getConfig2(function (config2) { | |
| 118 | + if (config2 && config2.is_overdue == 1) { | |
| 119 | + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=5", {}).then(res => { | |
| 120 | + var o = res; | |
| 121 | + if (o.data.code == 0) { | |
| 122 | + var ob = { isout: 0, isbuy: 1 }; | |
| 123 | + var arr = o.data.data.pageData; | |
| 124 | + var isbuy = 0; | |
| 125 | + //----如果数组不为空---- | |
| 126 | + if (arr.length > 0) { | |
| 127 | + arr.forEach(function (val, ind) { | |
| 128 | + if (val.is_sy == 0 && val.type == 5) { | |
| 129 | + isbuy = 1; | |
| 130 | + var now = ut.gettimestamp(); | |
| 131 | + if (now > val.end_time) ob.isout = 1; | |
| 132 | + return false; | |
| 133 | + } | |
| 134 | + }) | |
| 135 | + } | |
| 136 | + ob.isbuy = isbuy; | |
| 137 | + | |
| 138 | + var pages = getCurrentPages(); //获取加载的页面 | |
| 139 | + var currentPage = pages[pages.length - 1]; //获取当前页面的对象 | |
| 140 | + | |
| 141 | + console.log("当前路由"); | |
| 142 | + console.log(currentPage.route); | |
| 143 | + | |
| 144 | + | |
| 145 | + th.setappdata(ob); | |
| 146 | + | |
| 147 | + if (ob.isbuy && !ob.isout) { | |
| 148 | + th.onload_init(); | |
| 149 | + } | |
| 150 | + } else { | |
| 151 | + th.onload_init(); | |
| 152 | + } | |
| 153 | + }) | |
| 154 | + } | |
| 155 | + | |
| 156 | + else { | |
| 157 | + th.onload_init(); | |
| 158 | + } | |
| 159 | + }) | |
| 160 | + | |
| 161 | + if (first_leader) { | |
| 162 | + //-- user_id代过来免登录 -- | |
| 163 | + getApp().globalData.first_leader = first_leader; | |
| 164 | + //调用接口判断是不是会员 | |
| 165 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 166 | + if (res.data.code == 0) { | |
| 167 | + getApp().globalData.guide_id = res.data.data.id; | |
| 99 | 168 | } |
| 100 | - } | |
| 101 | - | |
| 102 | - getApp().getConfig(function(e){ | |
| 103 | - //--首页的问题-- | |
| 104 | - if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) { | |
| 105 | - wx.setNavigationBarTitle({ | |
| 106 | - title: getApp().globalData.config.store_name, | |
| 107 | - }); | |
| 108 | - } else { | |
| 109 | - wx.setNavigationBarTitle({ | |
| 110 | - title: getApp().globalData.setting.appName, | |
| 111 | - }); | |
| 112 | - }; | |
| 113 | - }); | |
| 114 | - | |
| 115 | - | |
| 116 | - var th = this; | |
| 117 | - getApp().getConfig2(function(config2){ | |
| 118 | - if(config2 && config2.is_overdue==1){ | |
| 119 | - getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{ | |
| 120 | - var o=res; | |
| 121 | - if (o.data.code == 0) { | |
| 122 | - var ob = { isout: 0, isbuy: 1 }; | |
| 123 | - var arr = o.data.data.pageData; | |
| 124 | - var isbuy = 0; | |
| 125 | - //----如果数组不为空---- | |
| 126 | - if (arr.length > 0) { | |
| 127 | - arr.forEach(function (val, ind) { | |
| 128 | - if (val.is_sy == 0 && val.type == 5) { | |
| 129 | - isbuy = 1; | |
| 130 | - var now = ut.gettimestamp(); | |
| 131 | - if (now > val.end_time) ob.isout = 1; | |
| 132 | - return false; | |
| 133 | - } | |
| 134 | - }) | |
| 135 | - } | |
| 136 | - ob.isbuy = isbuy; | |
| 137 | - | |
| 138 | - var pages = getCurrentPages(); //获取加载的页面 | |
| 139 | - var currentPage = pages[pages.length - 1]; //获取当前页面的对象 | |
| 140 | - | |
| 141 | - console.log("当前路由"); | |
| 142 | - console.log(currentPage.route); | |
| 143 | - | |
| 144 | - | |
| 145 | - th.setappdata(ob); | |
| 146 | - | |
| 147 | - if(ob.isbuy && !ob.isout){ | |
| 148 | - th.onload_init(); | |
| 149 | - } | |
| 150 | - }else{ | |
| 151 | - th.onload_init(); | |
| 152 | - } | |
| 153 | - }) | |
| 154 | - } | |
| 155 | - | |
| 156 | - else{ | |
| 157 | - th.onload_init(); | |
| 158 | - } | |
| 159 | - }) | |
| 160 | - | |
| 161 | - if(first_leader){ | |
| 162 | - //-- user_id代过来免登录 -- | |
| 163 | - getApp().globalData.first_leader=first_leader; | |
| 164 | - //调用接口判断是不是会员 | |
| 165 | - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ | |
| 166 | - if(res.data.code==0){ | |
| 167 | - getApp().globalData.guide_id=res.data.data.id; | |
| 168 | - } | |
| 169 | - }) | |
| 170 | - } | |
| 171 | - | |
| 172 | - // 判断是否有红包活动 | |
| 173 | - getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/'+getApp().globalData.setting.stoid, { | |
| 174 | - data: {} | |
| 175 | - }).then(function(data) { | |
| 176 | - // console.log('909090909090----->', data.data.code); | |
| 177 | - let code = data.data.code; | |
| 178 | - if(code == 0) { | |
| 179 | - | |
| 180 | - th.setData({ | |
| 181 | - showHongbao: true, | |
| 182 | - }); | |
| 183 | - } else if(code == -1) { | |
| 184 | - th.setData({ | |
| 185 | - showHongbao: false, | |
| 186 | - }); | |
| 187 | - }; | |
| 188 | - }); | |
| 189 | - | |
| 190 | - | |
| 191 | - // console.log(9090909); | |
| 169 | + }) | |
| 170 | + } | |
| 171 | + | |
| 172 | + // 判断是否有红包活动 | |
| 173 | + getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/' + getApp().globalData.setting.stoid, { | |
| 174 | + data: {} | |
| 175 | + }).then(function (data) { | |
| 176 | + // console.log('909090909090----->', data.data.code); | |
| 177 | + let code = data.data.code; | |
| 178 | + if (code == 0) { | |
| 179 | + | |
| 180 | + th.setData({ | |
| 181 | + showHongbao: true, | |
| 182 | + }); | |
| 183 | + } else if (code == -1) { | |
| 184 | + th.setData({ | |
| 185 | + showHongbao: false, | |
| 186 | + }); | |
| 187 | + }; | |
| 188 | + }); | |
| 189 | + | |
| 190 | + | |
| 191 | + // console.log(9090909); | |
| 192 | 192 | //看一下商家是否开通了权益 |
| 193 | 193 | //--初始化是否有打勾-- |
| 194 | 194 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { |
| ... | ... | @@ -201,12 +201,12 @@ Page({ |
| 201 | 201 | th.setData({ |
| 202 | 202 | is_boot: is_init |
| 203 | 203 | }); |
| 204 | - | |
| 205 | - if(!is_init){ | |
| 206 | - th.setData({ | |
| 207 | - swiperimage: [] | |
| 208 | - }); | |
| 209 | - } | |
| 204 | + | |
| 205 | + if (!is_init) { | |
| 206 | + th.setData({ | |
| 207 | + swiperimage: [] | |
| 208 | + }); | |
| 209 | + } | |
| 210 | 210 | } |
| 211 | 211 | }) |
| 212 | 212 | |
| ... | ... | @@ -215,75 +215,75 @@ Page({ |
| 215 | 215 | //t.editTabBar(th,o.stoid,th.data.url); |
| 216 | 216 | |
| 217 | 217 | }, |
| 218 | - | |
| 219 | - async onload_init(){ | |
| 220 | - var th=this; | |
| 221 | - await this.init_load(); | |
| 222 | - //显示的时候要开启计时器 | |
| 223 | - this.data.is_timer = 1; | |
| 224 | - //如果是自定义模板 | |
| 225 | - if (this.data.isTemplate) { | |
| 226 | - //---先获取会员--- | |
| 227 | - t.getUserFir(function() { | |
| 228 | - th.is_festival(); | |
| 229 | - var new_nav = th.data.new_nav; | |
| 230 | - if (new_nav == "") { | |
| 231 | - th.is_new(); | |
| 232 | - } | |
| 233 | - setTimeout(function () { | |
| 234 | - if (getApp().globalData.user_id) getApp().requestCardNum(th); | |
| 235 | - },500) | |
| 236 | - | |
| 237 | - }); | |
| 238 | - } else { | |
| 239 | - await this.init_fir(); | |
| 240 | - wx.setNavigationBarColor({ | |
| 241 | - frontColor: '#ffffff', // 必写项 | |
| 242 | - backgroundColor: '#ff7295', // 必写项 | |
| 243 | - }) | |
| 244 | - } | |
| 245 | - | |
| 246 | - //--正再拼团中的处理-- | |
| 247 | - var url = "/api/weshop/order/pageTuan?pt_status=2&is_pt=1&store_id=" + os.stoid + "&pageSize=6&page=1" | |
| 248 | - await getApp().request.promiseGet(url, {}).then(res => { | |
| 249 | - if (res.data.code == 0 && res.data.data && res.data.data.pageData) { | |
| 250 | - th.data.pt_timer_arr = res.data.data.pageData; | |
| 251 | - } | |
| 252 | - }) | |
| 253 | - if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) { | |
| 254 | - for (var i in th.data.pt_timer_arr) { | |
| 255 | - var p_item = th.data.pt_timer_arr[i]; | |
| 256 | - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, { | |
| 257 | - 1: 1 | |
| 258 | - }).then(res => { | |
| 259 | - th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic; | |
| 260 | - th.data.pt_timer_arr[i].nickname = res.data.data.nickname; | |
| 261 | - }) | |
| 262 | - } | |
| 263 | - th.Interval_pt(); | |
| 264 | - } | |
| 265 | - | |
| 266 | - //---处理正在6个分类---- | |
| 267 | - await getApp().request.promiseGet("/api/weshop/goodscategory/page", { | |
| 268 | - data: { | |
| 269 | - store_id: os.stoid, | |
| 270 | - pageSize: 5, | |
| 271 | - is_show: 1, | |
| 272 | - level:1 | |
| 273 | - } | |
| 274 | - }).then(res => { | |
| 275 | - if (res.data.data) { | |
| 276 | - var gd_category = res.data.data.pageData; | |
| 277 | - th.setData({ | |
| 278 | - gd_category: gd_category | |
| 279 | - }); | |
| 280 | - } | |
| 281 | - }) | |
| 218 | + | |
| 219 | + async onload_init() { | |
| 220 | + var th = this; | |
| 221 | + await this.init_load(); | |
| 222 | + //显示的时候要开启计时器 | |
| 223 | + this.data.is_timer = 1; | |
| 224 | + //如果是自定义模板 | |
| 225 | + if (this.data.isTemplate) { | |
| 226 | + //---先获取会员--- | |
| 227 | + t.getUserFir(function () { | |
| 228 | + th.is_festival(); | |
| 229 | + var new_nav = th.data.new_nav; | |
| 230 | + if (new_nav == "") { | |
| 231 | + th.is_new(); | |
| 232 | + } | |
| 233 | + setTimeout(function () { | |
| 234 | + if (getApp().globalData.user_id) getApp().requestCardNum(th); | |
| 235 | + }, 500) | |
| 236 | + | |
| 237 | + }); | |
| 238 | + } else { | |
| 239 | + await this.init_fir(); | |
| 240 | + wx.setNavigationBarColor({ | |
| 241 | + frontColor: '#ffffff', // 必写项 | |
| 242 | + backgroundColor: '#ff7295', // 必写项 | |
| 243 | + }) | |
| 244 | + } | |
| 245 | + | |
| 246 | + //--正再拼团中的处理-- | |
| 247 | + var url = "/api/weshop/order/pageTuan?pt_status=2&is_pt=1&store_id=" + os.stoid + "&pageSize=6&page=1" | |
| 248 | + await getApp().request.promiseGet(url, {}).then(res => { | |
| 249 | + if (res.data.code == 0 && res.data.data && res.data.data.pageData) { | |
| 250 | + th.data.pt_timer_arr = res.data.data.pageData; | |
| 251 | + } | |
| 252 | + }) | |
| 253 | + if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) { | |
| 254 | + for (var i in th.data.pt_timer_arr) { | |
| 255 | + var p_item = th.data.pt_timer_arr[i]; | |
| 256 | + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, { | |
| 257 | + 1: 1 | |
| 258 | + }).then(res => { | |
| 259 | + th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic; | |
| 260 | + th.data.pt_timer_arr[i].nickname = res.data.data.nickname; | |
| 261 | + }) | |
| 262 | + } | |
| 263 | + th.Interval_pt(); | |
| 264 | + } | |
| 265 | + | |
| 266 | + //---处理正在6个分类---- | |
| 267 | + await getApp().request.promiseGet("/api/weshop/goodscategory/page", { | |
| 268 | + data: { | |
| 269 | + store_id: os.stoid, | |
| 270 | + pageSize: 5, | |
| 271 | + is_show: 1, | |
| 272 | + level: 1 | |
| 273 | + } | |
| 274 | + }).then(res => { | |
| 275 | + if (res.data.data) { | |
| 276 | + var gd_category = res.data.data.pageData; | |
| 277 | + th.setData({ | |
| 278 | + gd_category: gd_category | |
| 279 | + }); | |
| 280 | + } | |
| 281 | + }) | |
| 282 | 282 | }, |
| 283 | - | |
| 284 | - | |
| 283 | + | |
| 284 | + | |
| 285 | 285 | //关闭新用户领取广告 |
| 286 | - close_disgraceful: function() { | |
| 286 | + close_disgraceful: function () { | |
| 287 | 287 | var th = this; |
| 288 | 288 | th.setData({ |
| 289 | 289 | is_disgraceful: 0 |
| ... | ... | @@ -291,10 +291,10 @@ Page({ |
| 291 | 291 | }, |
| 292 | 292 | |
| 293 | 293 | async onShow() { |
| 294 | - var th=this; | |
| 295 | - //-- 登录回来判断弹框 -- | |
| 296 | - var userInfo=getApp().globalData.userInfo; | |
| 297 | - if(userInfo){ | |
| 294 | + var th = this; | |
| 295 | + //-- 登录回来判断弹框 -- | |
| 296 | + var userInfo = getApp().globalData.userInfo; | |
| 297 | + if (userInfo) { | |
| 298 | 298 | th.is_festival(); |
| 299 | 299 | var new_nav = th.data.new_nav; |
| 300 | 300 | if (new_nav == "") { |
| ... | ... | @@ -303,64 +303,64 @@ Page({ |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | //优惠券要实时更新 |
| 306 | - getApp().getConfig2(function(e) { | |
| 306 | + getApp().getConfig2(function (e) { | |
| 307 | 307 | var json_d = JSON.parse(e.switch_list); |
| 308 | - th.setData({is_closecoupon: json_d.is_closecoupon}) | |
| 309 | - th.setData({is_topstore: json_d.is_show_storeselect}) | |
| 310 | - },1) | |
| 311 | - | |
| 312 | - if (typeof this.getTabBar === 'function' && this.getTabBar()) { | |
| 313 | - var index=getApp().getPageIndex(this); | |
| 314 | - this.getTabBar().setData({ | |
| 315 | - active: index //数字是当前页面在tabbar的索引 | |
| 316 | - }) | |
| 317 | - | |
| 318 | - getApp().requestCardNum(this); | |
| 319 | - } | |
| 320 | - | |
| 321 | - var th = this; | |
| 322 | - | |
| 323 | - var show=getApp().globalData.isLoad_ad; | |
| 324 | - setTimeout(function(){ | |
| 325 | - //user没有及时更新 | |
| 326 | - var userInfo=getApp().globalData.userInfo; | |
| 327 | - if(!userInfo || !userInfo.user_id) userInfo=null; | |
| 328 | - //有加载过一次首页,就显示 | |
| 329 | - if(show || userInfo || getApp().globalData.user_id){ | |
| 330 | - setTimeout(function(){ | |
| 331 | - full_screen.get_the_full_screen(th); | |
| 332 | - },800) | |
| 333 | - //动画效果 | |
| 334 | - if(!th.data.f_hidden){ | |
| 335 | - wx.showLoading({ | |
| 336 | - title:'加载中..' | |
| 337 | - }); | |
| 338 | - setTimeout(function(){ | |
| 339 | - th.setData({f_hidden:1}) | |
| 340 | - wx.hideLoading(); | |
| 341 | - },960) | |
| 342 | - } | |
| 343 | - }else{ | |
| 344 | - getApp().globalData.isLoad_ad=1; | |
| 345 | - } | |
| 346 | - },500) | |
| 347 | - | |
| 348 | - | |
| 349 | - | |
| 308 | + th.setData({ is_closecoupon: json_d.is_closecoupon }) | |
| 309 | + th.setData({ is_topstore: json_d.is_show_storeselect }) | |
| 310 | + }, 1) | |
| 311 | + | |
| 312 | + if (typeof this.getTabBar === 'function' && this.getTabBar()) { | |
| 313 | + var index = getApp().getPageIndex(this); | |
| 314 | + this.getTabBar().setData({ | |
| 315 | + active: index //数字是当前页面在tabbar的索引 | |
| 316 | + }) | |
| 317 | + | |
| 318 | + getApp().requestCardNum(this); | |
| 319 | + } | |
| 320 | + | |
| 321 | + var th = this; | |
| 322 | + | |
| 323 | + var show = getApp().globalData.isLoad_ad; | |
| 324 | + setTimeout(function () { | |
| 325 | + //user没有及时更新 | |
| 326 | + var userInfo = getApp().globalData.userInfo; | |
| 327 | + if (!userInfo || !userInfo.user_id) userInfo = null; | |
| 328 | + //有加载过一次首页,就显示 | |
| 329 | + if (show || userInfo || getApp().globalData.user_id) { | |
| 330 | + setTimeout(function () { | |
| 331 | + full_screen.get_the_full_screen(th); | |
| 332 | + }, 800) | |
| 333 | + //动画效果 | |
| 334 | + if (!th.data.f_hidden) { | |
| 335 | + wx.showLoading({ | |
| 336 | + title: '加载中..' | |
| 337 | + }); | |
| 338 | + setTimeout(function () { | |
| 339 | + th.setData({ f_hidden: 1 }) | |
| 340 | + wx.hideLoading(); | |
| 341 | + }, 960) | |
| 342 | + } | |
| 343 | + } else { | |
| 344 | + getApp().globalData.isLoad_ad = 1; | |
| 345 | + } | |
| 346 | + }, 500) | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | 350 | }, |
| 351 | 351 | //当隐藏的时候就关闭计时器 |
| 352 | - onHide: function() { | |
| 352 | + onHide: function () { | |
| 353 | 353 | this.data.is_timer = 0; |
| 354 | - if(this.data.pt_timer) clearInterval(this.data.pt_timer); | |
| 355 | - if(this.data.w_holiday_pop) clearInterval(this.data.w_holiday_pop); | |
| 356 | - if(this.data.full_screen) clearInterval(this.data.full_screen); | |
| 357 | - this.data.w_holiday_pop=0; | |
| 354 | + if (this.data.pt_timer) clearInterval(this.data.pt_timer); | |
| 355 | + if (this.data.w_holiday_pop) clearInterval(this.data.w_holiday_pop); | |
| 356 | + if (this.data.full_screen) clearInterval(this.data.full_screen); | |
| 357 | + this.data.w_holiday_pop = 0; | |
| 358 | 358 | |
| 359 | 359 | }, |
| 360 | 360 | |
| 361 | 361 | //同步初始加载 |
| 362 | 362 | async init_load() { |
| 363 | - var th=this; | |
| 363 | + var th = this; | |
| 364 | 364 | //因为营销版本的功能包含了自定义模板的功能,是同时的 |
| 365 | 365 | //读取全局是否有弄自定义模板 |
| 366 | 366 | await api.get_template_fir(o.stoid).then(res => { |
| ... | ... | @@ -368,6 +368,7 @@ Page({ |
| 368 | 368 | if (data && data.length > 0) { |
| 369 | 369 | var temp_data = data[0]; |
| 370 | 370 | var t_arr = JSON.parse(temp_data.json_str); |
| 371 | + console.log(t_arr); | |
| 371 | 372 | th.setData({ |
| 372 | 373 | template_arr: t_arr, |
| 373 | 374 | isTemplate: 1, |
| ... | ... | @@ -375,11 +376,11 @@ Page({ |
| 375 | 376 | }); |
| 376 | 377 | |
| 377 | 378 | //---如果有设定顶部的颜色的时候-- |
| 378 | - if(temp_data.top_color && temp_data.top_color!='null' ){ | |
| 379 | + if (temp_data.top_color && temp_data.top_color != 'null') { | |
| 379 | 380 | |
| 380 | - var top_w_color="#ffffff"; | |
| 381 | - if(temp_data.top_word_color && temp_data.top_word_color=='black'){ | |
| 382 | - top_w_color="#000000"; | |
| 381 | + var top_w_color = "#ffffff"; | |
| 382 | + if (temp_data.top_word_color && temp_data.top_word_color == 'black') { | |
| 383 | + top_w_color = "#000000"; | |
| 383 | 384 | } |
| 384 | 385 | wx.setNavigationBarColor({ |
| 385 | 386 | frontColor: top_w_color, // 必写项 |
| ... | ... | @@ -390,15 +391,11 @@ Page({ |
| 390 | 391 | } |
| 391 | 392 | }) |
| 392 | 393 | |
| 393 | - | |
| 394 | 394 | |
| 395 | - | |
| 396 | - | |
| 397 | - | |
| 398 | - | |
| 399 | 395 | }, |
| 400 | 396 | //---读取数据内容--- |
| 401 | 397 | async init_fir() { |
| 398 | + console.log('init_fir'); | |
| 402 | 399 | var th = this; |
| 403 | 400 | //----广告---- |
| 404 | 401 | var e = this; |
| ... | ... | @@ -407,24 +404,24 @@ Page({ |
| 407 | 404 | enabled: 1 |
| 408 | 405 | } |
| 409 | 406 | }).then(res => { |
| 410 | - | |
| 411 | - if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | |
| 412 | - var a = res.data.data.pageData; | |
| 413 | - var arr = new Array(); | |
| 414 | - for (var i = 0; i < a.length; i++) { | |
| 415 | - var tt = { | |
| 416 | - 'ad_code': o.imghost + a[i].ad_code, | |
| 417 | - 'media_link': '', | |
| 418 | - 'ad_weapplink':a[i].ad_weapplink | |
| 419 | - }; | |
| 420 | - arr.push(tt); | |
| 421 | - } | |
| 422 | - if (arr.length > 0) e.setData({ | |
| 423 | - banner: arr, | |
| 424 | - }); | |
| 425 | - | |
| 426 | - wx.stopPullDownRefresh(); | |
| 427 | - } | |
| 407 | + | |
| 408 | + if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 409 | + var a = res.data.data.pageData; | |
| 410 | + var arr = new Array(); | |
| 411 | + for (var i = 0; i < a.length; i++) { | |
| 412 | + var tt = { | |
| 413 | + 'ad_code': o.imghost + a[i].ad_code, | |
| 414 | + 'media_link': '', | |
| 415 | + 'ad_weapplink': a[i].ad_weapplink | |
| 416 | + }; | |
| 417 | + arr.push(tt); | |
| 418 | + } | |
| 419 | + if (arr.length > 0) e.setData({ | |
| 420 | + banner: arr, | |
| 421 | + }); | |
| 422 | + | |
| 423 | + wx.stopPullDownRefresh(); | |
| 424 | + } | |
| 428 | 425 | }) |
| 429 | 426 | |
| 430 | 427 | //-----秒杀----- |
| ... | ... | @@ -447,7 +444,7 @@ Page({ |
| 447 | 444 | //当前时间戳 |
| 448 | 445 | var nt = ut.gettimestamp(); |
| 449 | 446 | |
| 450 | - flash_data.forEach(function(val, ind) { | |
| 447 | + flash_data.forEach(function (val, ind) { | |
| 451 | 448 | if (val.start_time > nt) flash_data[ind].status = 0; |
| 452 | 449 | else if (val.end_time > nt) flash_data[ind].status = 1; |
| 453 | 450 | if (val.buy_num >= val.goods_num) flash_data[ind].status = 2; |
| ... | ... | @@ -464,6 +461,34 @@ Page({ |
| 464 | 461 | //th.countDown(); |
| 465 | 462 | } |
| 466 | 463 | }); |
| 464 | + //-----预售---- | |
| 465 | + //调用接口获取数据 | |
| 466 | + await getApp().request.get("/api/weshop/marketing/marketingPresellList/page", { | |
| 467 | + data: { | |
| 468 | + is_end: 0, | |
| 469 | + store_id: os.stoid, | |
| 470 | + pageSize: 10, | |
| 471 | + timetype: 1 | |
| 472 | + }, | |
| 473 | + success: function (res) { | |
| 474 | + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 475 | + var list = th.data.goodlist ? th.data.goodlist : []; | |
| 476 | + var arr = res.data.data.pageData; | |
| 477 | + //数组合起来 | |
| 478 | + for (var i in arr) { | |
| 479 | + list.push(arr[i]); | |
| 480 | + } | |
| 481 | + th.setData({ goodlist: list }); | |
| 482 | + if (arr.length < 10) { | |
| 483 | + th.setData({ no_more: 1 }) | |
| 484 | + } | |
| 485 | + } else { | |
| 486 | + th.setData({ no_more: 1 }) | |
| 487 | + } | |
| 488 | + th.setData({ is_get: 1 }) | |
| 489 | + | |
| 490 | + } | |
| 491 | + }); | |
| 467 | 492 | |
| 468 | 493 | //----拼单----- |
| 469 | 494 | await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2", { |
| ... | ... | @@ -482,7 +507,7 @@ Page({ |
| 482 | 507 | |
| 483 | 508 | //获取当前 |
| 484 | 509 | var nt = ut.gettimestamp(); |
| 485 | - pd_data.forEach(function(val, ind) { | |
| 510 | + pd_data.forEach(function (val, ind) { | |
| 486 | 511 | if (val.start_time > nt) pd_data[ind].status = 0; |
| 487 | 512 | else if (val.end_time > nt) pd_data[ind].status = 1; |
| 488 | 513 | if (val.buy_num >= val.goods_num) pd_data[ind].status = 2; |
| ... | ... | @@ -559,6 +584,7 @@ Page({ |
| 559 | 584 | for (var i = 0; i < new_data.length; i += 3) { |
| 560 | 585 | arr.push(new_data.slice(i, i + 3)); |
| 561 | 586 | } |
| 587 | + console.log(arr); | |
| 562 | 588 | th.setData({ |
| 563 | 589 | hotGoods: arr, |
| 564 | 590 | }); |
| ... | ... | @@ -569,33 +595,33 @@ Page({ |
| 569 | 595 | this.setData({ |
| 570 | 596 | ishow: 1 |
| 571 | 597 | }); |
| 572 | - | |
| 598 | + | |
| 573 | 599 | //---先获取会员--- |
| 574 | - t.getUserFir(function() { | |
| 575 | - th.is_festival(); | |
| 576 | - var new_nav = th.data.new_nav; | |
| 577 | - if (new_nav == "") { | |
| 578 | - th.is_new(); | |
| 579 | - } | |
| 580 | - | |
| 581 | - setTimeout(function () { | |
| 582 | - if (getApp().globalData.user_id) getApp().requestCardNum(th); | |
| 583 | - },500) | |
| 584 | - | |
| 600 | + t.getUserFir(function () { | |
| 601 | + th.is_festival(); | |
| 602 | + var new_nav = th.data.new_nav; | |
| 603 | + if (new_nav == "") { | |
| 604 | + th.is_new(); | |
| 605 | + } | |
| 606 | + | |
| 607 | + setTimeout(function () { | |
| 608 | + if (getApp().globalData.user_id) getApp().requestCardNum(th); | |
| 609 | + }, 500) | |
| 610 | + | |
| 585 | 611 | }); |
| 586 | - | |
| 587 | - setTimeout(function() { | |
| 588 | - var goods_list = th.selectComponent("#goods_list"); //组件的id | |
| 589 | - goods_list.init(); | |
| 590 | - goods_list.get_list(); | |
| 612 | + | |
| 613 | + setTimeout(function () { | |
| 614 | + var goods_list = th.selectComponent("#goods_list"); //组件的id | |
| 615 | + goods_list.init(); | |
| 616 | + goods_list.get_list(); | |
| 591 | 617 | }, 2000) |
| 592 | 618 | }, |
| 593 | 619 | |
| 594 | 620 | //--判断小程序是否过期-- |
| 595 | - setappdata: function(t) { | |
| 621 | + setappdata: function (t) { | |
| 596 | 622 | if (t.isout == 1) |
| 597 | 623 | wx.reLaunch({ |
| 598 | - url: "/pages/error/error?msg=该商城已到期,暂停浏览!\r\n可联系:"+getApp().globalData.config.store_tel, | |
| 624 | + url: "/pages/error/error?msg=该商城已到期,暂停浏览!\r\n可联系:" + getApp().globalData.config.store_tel, | |
| 599 | 625 | }); |
| 600 | 626 | if (t.isbuy == 0) |
| 601 | 627 | wx.reLaunch({ |
| ... | ... | @@ -603,40 +629,39 @@ Page({ |
| 603 | 629 | }); |
| 604 | 630 | }, |
| 605 | 631 | //---加载更多是靠这个函数---- |
| 606 | - onReachBottom: function() { | |
| 632 | + onReachBottom: function () { | |
| 607 | 633 | var goods_list = this.selectComponent("#goods_list"); //组件的id |
| 608 | 634 | if (goods_list) goods_list.get_list(); |
| 609 | 635 | |
| 610 | - if(getApp().globalData.func_list) | |
| 611 | - { | |
| 612 | - for(let i in getApp().globalData.func_list){ | |
| 613 | - let item=getApp().globalData.func_list[i]; | |
| 614 | - item.re_show(); | |
| 615 | - } | |
| 616 | - } | |
| 636 | + if (getApp().globalData.func_list) { | |
| 637 | + for (let i in getApp().globalData.func_list) { | |
| 638 | + let item = getApp().globalData.func_list[i]; | |
| 639 | + item.re_show(); | |
| 640 | + } | |
| 641 | + } | |
| 617 | 642 | }, |
| 618 | 643 | |
| 619 | - onPullDownRefresh: function(e) { | |
| 644 | + onPullDownRefresh: function (e) { | |
| 620 | 645 | this.data.recommend = null, this.data.currentPage = 1, n.resetConfig(), this.requestHomePage(), |
| 621 | 646 | this.requestRecommend(); |
| 622 | 647 | }, |
| 623 | - requestRecommend(){}, | |
| 624 | - requestHomePage(){}, | |
| 648 | + requestRecommend() { }, | |
| 649 | + requestHomePage() { }, | |
| 625 | 650 | |
| 626 | - onUnload: function() { | |
| 651 | + onUnload: function () { | |
| 627 | 652 | this.destroyActivityTimer(); |
| 628 | 653 | }, |
| 629 | - setCountTime: function(e) { | |
| 654 | + setCountTime: function (e) { | |
| 630 | 655 | e.diffTime || (e.diffTime = new Date().getTime() - 1e3 * e.server_time), this.setData({ |
| 631 | 656 | "sale.diffTime": e.diffTime |
| 632 | 657 | }), this.setData({ |
| 633 | 658 | "sale.good": e.flash_sale_goods[0] |
| 634 | 659 | }), this.destroyActivityTimer(), this.createActivityTimer(); |
| 635 | 660 | }, |
| 636 | - createActivityTimer: function() { | |
| 661 | + createActivityTimer: function () { | |
| 637 | 662 | var e = this.data.sale, |
| 638 | 663 | t = this; |
| 639 | - this.data.timer = setInterval(function() { | |
| 664 | + this.data.timer = setInterval(function () { | |
| 640 | 665 | var a = 1e3 * e.good.end_time - new Date().getTime() + e.diffTime, |
| 641 | 666 | o = i.transTime(a); |
| 642 | 667 | a <= 0 ? t.requestHomePage() : t.setData({ |
| ... | ... | @@ -644,11 +669,11 @@ Page({ |
| 644 | 669 | }); |
| 645 | 670 | }, 1e3); |
| 646 | 671 | }, |
| 647 | - destroyActivityTimer: function() { | |
| 672 | + destroyActivityTimer: function () { | |
| 648 | 673 | this.data.timer && (clearInterval(this.data.timer), this.data.timer = null); |
| 649 | 674 | }, |
| 650 | - onPageScroll: function(e) { | |
| 651 | - this.data.scrollTop=e.scrollTop; | |
| 675 | + onPageScroll: function (e) { | |
| 676 | + this.data.scrollTop = e.scrollTop; | |
| 652 | 677 | var t = getCurrentPages(); |
| 653 | 678 | "pages/index/index/index" == t[t.length - 1].route; |
| 654 | 679 | /*--(e.scrollTop > 10 ? wx.setNavigationBarColor({ |
| ... | ... | @@ -659,37 +684,37 @@ Page({ |
| 659 | 684 | backgroundColor: "#eeeeee" |
| 660 | 685 | }));--*/ |
| 661 | 686 | }, |
| 662 | - jumpSearch: function() { | |
| 687 | + jumpSearch: function () { | |
| 663 | 688 | wx.navigateTo({ |
| 664 | 689 | url: "/pages/goods/search/search" |
| 665 | 690 | }); |
| 666 | 691 | }, |
| 667 | - onShareAppMessage: function(e) { | |
| 668 | - var url="/pages/index/index/index"; | |
| 669 | - var userInfo=getApp().globalData.userInfo; | |
| 670 | - //是分销商才带 | |
| 671 | - if(userInfo){ | |
| 672 | - url+="?first_leader="+userInfo.user_id; | |
| 673 | - } | |
| 674 | - console.log("---首页---分享--"); | |
| 675 | - var title="商城首页" | |
| 692 | + onShareAppMessage: function (e) { | |
| 693 | + var url = "/pages/index/index/index"; | |
| 694 | + var userInfo = getApp().globalData.userInfo; | |
| 695 | + //是分销商才带 | |
| 696 | + if (userInfo) { | |
| 697 | + url += "?first_leader=" + userInfo.user_id; | |
| 698 | + } | |
| 699 | + console.log("---首页---分享--"); | |
| 700 | + var title = "商城首页" | |
| 676 | 701 | //分享 |
| 677 | - if(getApp().globalData.config && getApp().globalData.config.store_name){ | |
| 678 | - title=getApp().globalData.config.store_name; | |
| 679 | - }else if(getApp().globalData.setting.appName){ | |
| 680 | - title=getApp().globalData.setting.appName; | |
| 681 | - } | |
| 682 | - | |
| 683 | - var ob={ | |
| 684 | - title: title, | |
| 685 | - path:url, | |
| 686 | - }; | |
| 687 | - console.log(ob); | |
| 702 | + if (getApp().globalData.config && getApp().globalData.config.store_name) { | |
| 703 | + title = getApp().globalData.config.store_name; | |
| 704 | + } else if (getApp().globalData.setting.appName) { | |
| 705 | + title = getApp().globalData.setting.appName; | |
| 706 | + } | |
| 707 | + | |
| 708 | + var ob = { | |
| 709 | + title: title, | |
| 710 | + path: url, | |
| 711 | + }; | |
| 712 | + console.log(ob); | |
| 688 | 713 | return ob; |
| 689 | 714 | }, |
| 690 | 715 | |
| 691 | 716 | //图片失败,默认图片 |
| 692 | - bind_bnerr: function(e) { | |
| 717 | + bind_bnerr: function (e) { | |
| 693 | 718 | var _errImg = e.target.dataset.errorimg; |
| 694 | 719 | var _errObj = {}; |
| 695 | 720 | _errObj[_errImg] = this.data.url + "/miniapp/images/del/logo.jpg"; |
| ... | ... | @@ -697,7 +722,7 @@ Page({ |
| 697 | 722 | }, |
| 698 | 723 | |
| 699 | 724 | //图片失败,默认图片 |
| 700 | - bind_bnerr2: function(e) { | |
| 725 | + bind_bnerr2: function (e) { | |
| 701 | 726 | var _errImg = e.target.dataset.errorimg; |
| 702 | 727 | var _errurl = e.target.dataset.url; |
| 703 | 728 | var _errObj = {}; |
| ... | ... | @@ -706,7 +731,7 @@ Page({ |
| 706 | 731 | |
| 707 | 732 | }, |
| 708 | 733 | //图片失败,默认图片 |
| 709 | - bind_bnerr3: function(e) { | |
| 734 | + bind_bnerr3: function (e) { | |
| 710 | 735 | var _errImg = e.target.dataset.errorimg; |
| 711 | 736 | var _Img = e.target.dataset.img; |
| 712 | 737 | if (_Img != undefined) { |
| ... | ... | @@ -821,19 +846,19 @@ Page({ |
| 821 | 846 | setTimeout(th.countDown2, 1000); |
| 822 | 847 | }, |
| 823 | 848 | |
| 824 | - bannerSwiperChange: function(e) { | |
| 849 | + bannerSwiperChange: function (e) { | |
| 825 | 850 | var index = e.detail.current; |
| 826 | 851 | this.setData({ |
| 827 | 852 | banner_index: index |
| 828 | 853 | }); |
| 829 | 854 | }, |
| 830 | - flashSwiperChange: function(e) { | |
| 855 | + flashSwiperChange: function (e) { | |
| 831 | 856 | var index = e.detail.current; |
| 832 | 857 | this.setData({ |
| 833 | 858 | flash_index: index |
| 834 | 859 | }); |
| 835 | 860 | }, |
| 836 | - ptSwiperChange: function(e) { | |
| 861 | + ptSwiperChange: function (e) { | |
| 837 | 862 | var index = e.detail.current; |
| 838 | 863 | this.setData({ |
| 839 | 864 | pt_index: index |
| ... | ... | @@ -842,13 +867,13 @@ Page({ |
| 842 | 867 | |
| 843 | 868 | Interval_pt() { |
| 844 | 869 | var th = this; |
| 845 | - this.data.pt_timer = setInterval(function() { | |
| 870 | + this.data.pt_timer = setInterval(function () { | |
| 846 | 871 | var item = ut.get_rand_item(th.data.pt_timer_arr); |
| 847 | 872 | th.setData({ |
| 848 | 873 | pt_timer_active: 1, |
| 849 | 874 | pt_timer_item: item |
| 850 | 875 | }); |
| 851 | - setTimeout(function() { | |
| 876 | + setTimeout(function () { | |
| 852 | 877 | th.setData({ |
| 853 | 878 | pt_timer_active: 0 |
| 854 | 879 | }); |
| ... | ... | @@ -858,7 +883,7 @@ Page({ |
| 858 | 883 | |
| 859 | 884 | |
| 860 | 885 | //---扫一扫的函数--- |
| 861 | - getScancode: function() { | |
| 886 | + getScancode: function () { | |
| 862 | 887 | var _this = this; |
| 863 | 888 | // 允许从相机和相册扫码 |
| 864 | 889 | wx.scanCode({ |
| ... | ... | @@ -872,16 +897,16 @@ Page({ |
| 872 | 897 | }, |
| 873 | 898 | |
| 874 | 899 | //跳转到分类 |
| 875 | - go_cate: function() { | |
| 900 | + go_cate: function () { | |
| 876 | 901 | getApp().goto("/pages/goods/categoryList/categoryList"); |
| 877 | 902 | }, |
| 878 | 903 | |
| 879 | - go_url: function(e) { | |
| 904 | + go_url: function (e) { | |
| 880 | 905 | var url = e.currentTarget.dataset.url; |
| 881 | 906 | getApp().goto(url); |
| 882 | 907 | }, |
| 883 | 908 | |
| 884 | - bind_bnerr_icon: function(e) { | |
| 909 | + bind_bnerr_icon: function (e) { | |
| 885 | 910 | var def = "/miniapp/images/no_cate_def.png"; |
| 886 | 911 | var _err = e.currentTarget.dataset.err; |
| 887 | 912 | var ob = {}; |
| ... | ... | @@ -890,7 +915,7 @@ Page({ |
| 890 | 915 | }, |
| 891 | 916 | |
| 892 | 917 | //跳转到分类的商品列表 |
| 893 | - go_cate2: function(t) { | |
| 918 | + go_cate2: function (t) { | |
| 894 | 919 | var cid = t.currentTarget.dataset.cid; |
| 895 | 920 | var pid = t.currentTarget.dataset.pid; |
| 896 | 921 | var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; |
| ... | ... | @@ -898,13 +923,13 @@ Page({ |
| 898 | 923 | url: lurl |
| 899 | 924 | }); |
| 900 | 925 | }, |
| 901 | - new_nav: function(e) { | |
| 926 | + new_nav: function (e) { | |
| 902 | 927 | var th = this; |
| 903 | 928 | var new_nav = th.data.new_nav; |
| 904 | 929 | getApp().goto(new_nav); |
| 905 | 930 | }, |
| 906 | 931 | //跳转到权益 |
| 907 | - go_quanyi: function(t) { | |
| 932 | + go_quanyi: function (t) { | |
| 908 | 933 | var user_info = getApp().globalData.userInfo; |
| 909 | 934 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 910 | 935 | wx.navigateTo({ |
| ... | ... | @@ -916,7 +941,7 @@ Page({ |
| 916 | 941 | getApp().goto("/pages/user/userqy/userqy"); |
| 917 | 942 | }, |
| 918 | 943 | |
| 919 | - imageLoad: function(e) { | |
| 944 | + imageLoad: function (e) { | |
| 920 | 945 | var imgwidth = e.detail.width; |
| 921 | 946 | var imgheight = e.detail.height; |
| 922 | 947 | //宽高比 |
| ... | ... | @@ -928,7 +953,7 @@ Page({ |
| 928 | 953 | }); |
| 929 | 954 | }, |
| 930 | 955 | //判断该用户是否是新会员 |
| 931 | - is_new: function() { | |
| 956 | + is_new: function () { | |
| 932 | 957 | var th = this; |
| 933 | 958 | wx.hideLoading(); |
| 934 | 959 | getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", { |
| ... | ... | @@ -964,20 +989,20 @@ Page({ |
| 964 | 989 | th.setData({ |
| 965 | 990 | is_disgraceful: 1 |
| 966 | 991 | }) |
| 967 | - }else{ | |
| 968 | - th.check_holiday_pop(); //节日的弹窗 | |
| 969 | - } | |
| 970 | - | |
| 992 | + } else { | |
| 993 | + th.check_holiday_pop(); //节日的弹窗 | |
| 994 | + } | |
| 995 | + | |
| 971 | 996 | }) |
| 972 | - }else{ | |
| 973 | - th.check_holiday_pop(); //节日的弹窗 | |
| 974 | - } | |
| 975 | - | |
| 997 | + } else { | |
| 998 | + th.check_holiday_pop(); //节日的弹窗 | |
| 999 | + } | |
| 1000 | + | |
| 976 | 1001 | }) |
| 977 | 1002 | |
| 978 | 1003 | }, |
| 979 | - | |
| 980 | - is_festival: function(e) { | |
| 1004 | + | |
| 1005 | + is_festival: function (e) { | |
| 981 | 1006 | var th = this; |
| 982 | 1007 | var url = "/api/weshop/marketing/holiday/act/judge"; |
| 983 | 1008 | getApp().request.promiseGet(url, { |
| ... | ... | @@ -991,24 +1016,24 @@ Page({ |
| 991 | 1016 | var giftBagId = res.data.data.gifBagId; //礼包id |
| 992 | 1017 | var nav_url = "/pages/giftpack/festival/festival?actId=" + actid + '&' + 'actType=' + 3 + '&' + 'giftBagId=' + giftBagId; |
| 993 | 1018 | var swiperimage = th.data.swiperimage; |
| 994 | - var actBoundImg = res.data.data.actBoundImg?res.data.data.actBoundImg:'/miniapp/images/default_g_img.gif'; | |
| 995 | - | |
| 996 | - th.data.holiday_image= res.data.data.actImg; | |
| 997 | - th.data.holiday_url=nav_url; | |
| 998 | - | |
| 1019 | + var actBoundImg = res.data.data.actBoundImg ? res.data.data.actBoundImg : '/miniapp/images/default_g_img.gif'; | |
| 1020 | + | |
| 1021 | + th.data.holiday_image = res.data.data.actImg; | |
| 1022 | + th.data.holiday_url = nav_url; | |
| 1023 | + | |
| 999 | 1024 | var img = { |
| 1000 | 1025 | image: actBoundImg, |
| 1001 | 1026 | nav_url: nav_url, |
| 1002 | - id:res.data.data.id, | |
| 1003 | - type:'festival' | |
| 1027 | + id: res.data.data.id, | |
| 1028 | + type: 'festival' | |
| 1029 | + } | |
| 1030 | + | |
| 1031 | + for (var i in swiperimage) { | |
| 1032 | + var item = swiperimage[i]; | |
| 1033 | + if (item.id == img.id && item.type == img.type) { | |
| 1034 | + return false; | |
| 1035 | + } | |
| 1004 | 1036 | } |
| 1005 | - | |
| 1006 | - for(var i in swiperimage){ | |
| 1007 | - var item=swiperimage[i]; | |
| 1008 | - if(item.id ==img.id && item.type==img.type){ | |
| 1009 | - return false; | |
| 1010 | - } | |
| 1011 | - } | |
| 1012 | 1037 | |
| 1013 | 1038 | swiperimage.unshift(img); |
| 1014 | 1039 | th.setData({ |
| ... | ... | @@ -1018,82 +1043,82 @@ Page({ |
| 1018 | 1043 | } |
| 1019 | 1044 | }) |
| 1020 | 1045 | }, |
| 1021 | - | |
| 1046 | + | |
| 1022 | 1047 | //弹出节日有礼 |
| 1023 | - check_holiday_pop:function(){ | |
| 1024 | - var th=this; | |
| 1025 | - getApp().waitfor2(th,'w_holiday_pop','holiday_image',function(){ | |
| 1026 | - //等到结果才显示 | |
| 1027 | - if(th.data.holiday_image){ | |
| 1028 | - th.setData({ | |
| 1029 | - new_image: th.data.holiday_image, | |
| 1030 | - new_nav: th.data.holiday_url, | |
| 1031 | - is_disgraceful: 1 | |
| 1032 | - }) | |
| 1033 | - } | |
| 1034 | - }) | |
| 1048 | + check_holiday_pop: function () { | |
| 1049 | + var th = this; | |
| 1050 | + getApp().waitfor2(th, 'w_holiday_pop', 'holiday_image', function () { | |
| 1051 | + //等到结果才显示 | |
| 1052 | + if (th.data.holiday_image) { | |
| 1053 | + th.setData({ | |
| 1054 | + new_image: th.data.holiday_image, | |
| 1055 | + new_nav: th.data.holiday_url, | |
| 1056 | + is_disgraceful: 1 | |
| 1057 | + }) | |
| 1058 | + } | |
| 1059 | + }) | |
| 1035 | 1060 | }, |
| 1036 | - | |
| 1037 | - go_ad:function(e){ | |
| 1038 | - var url=e.currentTarget.dataset.url; | |
| 1039 | - if(!url || url=='') return; | |
| 1040 | - if(url[0]!='/') url='/'+url; | |
| 1041 | - getApp().goto(url); | |
| 1061 | + | |
| 1062 | + go_ad: function (e) { | |
| 1063 | + var url = e.currentTarget.dataset.url; | |
| 1064 | + if (!url || url == '') return; | |
| 1065 | + if (url[0] != '/') url = '/' + url; | |
| 1066 | + getApp().goto(url); | |
| 1042 | 1067 | }, |
| 1043 | - | |
| 1068 | + | |
| 1044 | 1069 | //导航跳转 |
| 1045 | - nav_goto:function(e){ | |
| 1046 | - var url=e.currentTarget.dataset.url; | |
| 1047 | - if(!url || url=='') return; | |
| 1048 | - if(url[0]!='/') url='/'+url; | |
| 1049 | - getApp().goto(url); | |
| 1050 | - if(this.data.showHongbao) { | |
| 1051 | - this.setData({ | |
| 1052 | - showHongbao: false, | |
| 1053 | - showHongbaoSmall: true, //显示抢红包小图标 | |
| 1054 | - }); | |
| 1055 | - } | |
| 1056 | - }, | |
| 1057 | - | |
| 1058 | - //----跳转到搭配购买---- | |
| 1059 | - go_test:function () { | |
| 1060 | - wx.navigateTo({ url: "/packageA/pages/goods_share/goods_share", }) | |
| 1061 | - }, | |
| 1062 | - | |
| 1063 | - | |
| 1070 | + nav_goto: function (e) { | |
| 1071 | + var url = e.currentTarget.dataset.url; | |
| 1072 | + if (!url || url == '') return; | |
| 1073 | + if (url[0] != '/') url = '/' + url; | |
| 1074 | + getApp().goto(url); | |
| 1075 | + if (this.data.showHongbao) { | |
| 1076 | + this.setData({ | |
| 1077 | + showHongbao: false, | |
| 1078 | + showHongbaoSmall: true, //显示抢红包小图标 | |
| 1079 | + }); | |
| 1080 | + } | |
| 1081 | + }, | |
| 1082 | + | |
| 1083 | + //----跳转到搭配购买---- | |
| 1084 | + go_test: function () { | |
| 1085 | + wx.navigateTo({ url: "/packageA/pages/goods_share/goods_share", }) | |
| 1086 | + }, | |
| 1087 | + | |
| 1088 | + | |
| 1064 | 1089 | onShareTimeline() { |
| 1065 | - // getApp().getConfig(function(t) { | |
| 1066 | - // return { | |
| 1067 | - // title: '首页-' + getApp().globalData.config.store_name, | |
| 1068 | - // } | |
| 1069 | - // }); | |
| 1070 | - var store_name=getApp().globalData.config?getApp().globalData.config.store_name:''; | |
| 1071 | - if(!store_name) | |
| 1072 | - store_name=getApp().globalData.setting.appName; | |
| 1073 | - return { | |
| 1074 | - title: '首页-' + store_name, | |
| 1075 | - } | |
| 1076 | - }, | |
| 1077 | - | |
| 1078 | - | |
| 1079 | - // 关闭首页抢红包主弹窗,显示侧边栏抢红包小图标 | |
| 1080 | - closeHongbao() { | |
| 1081 | - this.setData({ | |
| 1082 | - showHongbao: false, //关闭抢红包主弹窗 | |
| 1083 | - showHongbaoSmall: true, //显示抢红包小图标 | |
| 1084 | - }); | |
| 1085 | - }, | |
| 1086 | - | |
| 1087 | - /*-- 全屏广告 --*/ | |
| 1088 | - close_full_screen(){ | |
| 1089 | - this.setData({is_full_screen_show:0,sec_show:0}); | |
| 1090 | - }, | |
| 1091 | - //-- 跳转到满屏广告的链接 -- | |
| 1092 | - go_full_ad(){ | |
| 1093 | - if(!this.data.full_ad) return false; | |
| 1094 | - if(!this.data.full_ad.ad_weapplink) return false; | |
| 1095 | - getApp().goto(this.data.full_ad.ad_weapplink); | |
| 1096 | - this.close_full_screen(); | |
| 1097 | - }, | |
| 1090 | + // getApp().getConfig(function(t) { | |
| 1091 | + // return { | |
| 1092 | + // title: '首页-' + getApp().globalData.config.store_name, | |
| 1093 | + // } | |
| 1094 | + // }); | |
| 1095 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
| 1096 | + if (!store_name) | |
| 1097 | + store_name = getApp().globalData.setting.appName; | |
| 1098 | + return { | |
| 1099 | + title: '首页-' + store_name, | |
| 1100 | + } | |
| 1101 | + }, | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + // 关闭首页抢红包主弹窗,显示侧边栏抢红包小图标 | |
| 1105 | + closeHongbao() { | |
| 1106 | + this.setData({ | |
| 1107 | + showHongbao: false, //关闭抢红包主弹窗 | |
| 1108 | + showHongbaoSmall: true, //显示抢红包小图标 | |
| 1109 | + }); | |
| 1110 | + }, | |
| 1111 | + | |
| 1112 | + /*-- 全屏广告 --*/ | |
| 1113 | + close_full_screen() { | |
| 1114 | + this.setData({ is_full_screen_show: 0, sec_show: 0 }); | |
| 1115 | + }, | |
| 1116 | + //-- 跳转到满屏广告的链接 -- | |
| 1117 | + go_full_ad() { | |
| 1118 | + if (!this.data.full_ad) return false; | |
| 1119 | + if (!this.data.full_ad.ad_weapplink) return false; | |
| 1120 | + getApp().goto(this.data.full_ad.ad_weapplink); | |
| 1121 | + this.close_full_screen(); | |
| 1122 | + }, | |
| 1098 | 1123 | |
| 1099 | 1124 | }); |
| 1100 | 1125 | \ No newline at end of file | ... | ... |