Commit e18503135ddbfbb65db742c89c43ff91ee9244b4
Merge branch 'test' into 'qa'
Test See merge request !439
Showing
49 changed files
with
535 additions
and
391 deletions
app.js
| @@ -5,66 +5,111 @@ var api = require("./api/api.js") | @@ -5,66 +5,111 @@ var api = require("./api/api.js") | ||
| 5 | 5 | ||
| 6 | //公共方法和变量 | 6 | //公共方法和变量 |
| 7 | App({ | 7 | App({ |
| 8 | - editTabBar: function () { | 8 | + editTabBar: function (taht,stoid,url) { |
| 9 | + var that=this; | ||
| 10 | + var th = taht | ||
| 9 | //使用getCurrentPages可以获取当前加载中所有的页面对象的一个数组,数组最后一个就是当前页面。 | 11 | //使用getCurrentPages可以获取当前加载中所有的页面对象的一个数组,数组最后一个就是当前页面。 |
| 10 | - | ||
| 11 | - var curPageArr = getCurrentPages(); //获取加载的页面 | ||
| 12 | - var curPage = curPageArr[curPageArr.length - 1]; //获取当前页面的对象 | 12 | + var custum_data=this.globalData.custum_data; |
| 13 | + var isIpx=this.globalData.isIpx; | ||
| 14 | + //var curPageArr = getCurrentPages(); //获取加载的页面 | ||
| 15 | + //var curPage = curPageArr[curPageArr.length - 1]; //获取当前页面的对象 | ||
| 16 | + var curPage=th; | ||
| 13 | var pagePath = curPage.route; //当前页面url | 17 | var pagePath = curPage.route; //当前页面url |
| 14 | if (pagePath.indexOf('/') != 0) { | 18 | if (pagePath.indexOf('/') != 0) { |
| 15 | - pagePath = '/' + pagePath; | 19 | + pagePath = '/' + pagePath; |
| 16 | } | 20 | } |
| 17 | - console.log("获取加载的页面:="+curPageArr) | ||
| 18 | - console.log("获取当前页面的对象:="+curPage) | ||
| 19 | - console.log("当前页面url:="+pagePath) | ||
| 20 | - var tabBar = this.globalData.tabBar; | ||
| 21 | - for (var i = 0; i < tabBar.list.length; i++) { | ||
| 22 | - tabBar.list[i].active = false; | ||
| 23 | - if (tabBar.list[i].weappurl == pagePath) { | ||
| 24 | - tabBar.list[i].active = true; //根据页面地址设置当前页面状态 | ||
| 25 | - } | 21 | + if(isIpx){ |
| 22 | + if(custum_data){ | ||
| 23 | + that.set_custom_nav(custum_data,isIpx,pagePath,url,curPage); | ||
| 24 | + }else{ | ||
| 25 | + var tabBar = { | ||
| 26 | + 'iscustom':2, | ||
| 27 | + 'url':url, | ||
| 28 | + 'active':pagePath, | ||
| 29 | + 'isIpx':isIpx, | ||
| 30 | + cartGoodsNum:this.globalData.cartGoodsNum | ||
| 31 | + } | ||
| 32 | + curPage.setData({ | ||
| 33 | + tabBar:tabBar, | ||
| 34 | + isIpx:isIpx, | ||
| 35 | + cartGoodsNum:this.globalData.cartGoodsNum | ||
| 36 | + }) | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + }else{ | ||
| 40 | + var isIpx = false; | ||
| 41 | + wx.getSystemInfo({ | ||
| 42 | + success: (res) => { | ||
| 43 | + // console.log(res) | ||
| 44 | + let modelmes = res.model; //手机品牌 | ||
| 45 | + if (modelmes.indexOf('iPhone X') != -1) { //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来 | ||
| 46 | + isIpx = true | ||
| 47 | + } | ||
| 48 | + //缓存住,下次就不调用接口了 | ||
| 49 | + that.globalData.isIpx=isIpx; | ||
| 50 | + getApp().request.promiseGet("/api/weshop/storeFooter/get/"+stoid, { | ||
| 51 | + }).then(res => { | ||
| 52 | + var e = res; | ||
| 53 | + if(e.data.code != -1){ | ||
| 54 | + that.globalData.custum_data=e.data.data; | ||
| 55 | + that.set_custom_nav(e.data.data,isIpx,pagePath,url,curPage); | ||
| 56 | + }else{ | ||
| 57 | + var tabBar = { | ||
| 58 | + 'iscustom':2, | ||
| 59 | + 'url':url, | ||
| 60 | + 'active':pagePath, | ||
| 61 | + 'isIpx':isIpx, | ||
| 62 | + cartGoodsNum:this.globalData.cartGoodsNum | ||
| 63 | + } | ||
| 64 | + curPage.setData({ | ||
| 65 | + tabBar:tabBar, | ||
| 66 | + isIpx:isIpx, | ||
| 67 | + cartGoodsNum:this.globalData.cartGoodsNum | ||
| 68 | + }) | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + }) | ||
| 72 | + }, | ||
| 73 | + }) | ||
| 26 | } | 74 | } |
| 27 | - curPage.setData({ | ||
| 28 | - tabBar: tabBar | ||
| 29 | - }); | ||
| 30 | }, | 75 | }, |
| 76 | + set_custom_nav(data,isIpx,pagePath,url,curPage){ | ||
| 77 | + //缓存住,下次就不调用接口了 | ||
| 78 | + var itemList = data.data; | ||
| 79 | + itemList = JSON.parse(itemList) | ||
| 80 | + //使用getCurrentPages可以获取当前加载中所有的页面对象的一个数组,数组最后一个就是当前页面。 | ||
| 81 | + for (var i = 0; i < itemList.length; i++) { | ||
| 82 | + itemList[i].active = false; | ||
| 83 | + if (itemList[i].weappurl == pagePath) { | ||
| 84 | + itemList[i].active = true; //根据页面地址设置当前页面状态 | ||
| 85 | + } | ||
| 86 | + } | ||
| 31 | 87 | ||
| 88 | + //如果当服务端返回的值有数据就渲染数据到页面 | ||
| 89 | + var tabBar = { | ||
| 90 | + 'iscustom':1, | ||
| 91 | + 'url':url, | ||
| 92 | + 'active':pagePath, | ||
| 93 | + 'list':itemList, | ||
| 94 | + 'backgroundColor': data.bkcolor, | ||
| 95 | + 'selectedColor' : data.fontcolor_sele, | ||
| 96 | + 'color':data.fontcolor, | ||
| 97 | + 'length':itemList.length, | ||
| 98 | + 'isIpx':isIpx, | ||
| 99 | + cartGoodsNum:this.globalData.cartGoodsNum | ||
| 100 | + } | ||
| 101 | + curPage.setData({ | ||
| 102 | + tabBar:tabBar, | ||
| 103 | + isIpx:isIpx, | ||
| 104 | + cartGoodsNum:this.globalData.cartGoodsNum | ||
| 105 | + }) | ||
| 106 | + }, | ||
| 107 | + | ||
| 32 | globalData: { | 108 | globalData: { |
| 33 | - tabBar: { | ||
| 34 | - "color": "#6e6d6b",//文字未选择color | ||
| 35 | - "selectedColor": "#f23030",//文字被选择后color | ||
| 36 | - "borderStyle": "white",// | ||
| 37 | - "backgroundColor": "#ffffff",//背景color | ||
| 38 | - "iscustom":'', | ||
| 39 | - "url":"", | ||
| 40 | - "list": [ | ||
| 41 | - { | ||
| 42 | - "weappurl": "/pages/index/index/index", | ||
| 43 | - "nav_name": "首页", | ||
| 44 | - "src": "/miniapp/images/bar/index.png", | ||
| 45 | - "src_sele": "/miniapp/images/bar/index_on.png" | ||
| 46 | - }, | ||
| 47 | - { | ||
| 48 | - "weappurl": "/pages/goods/categoryList/categoryList", | ||
| 49 | - "nav_name": "分类", | ||
| 50 | - "src": "/miniapp/images/bar/fl.png", | ||
| 51 | - "src_sele": "/miniapp/images/bar/fl_on.png" | ||
| 52 | - }, | ||
| 53 | - { | ||
| 54 | - "weappurl": "/pages/cart/cart/cart", | ||
| 55 | - "nav_name": "购物车", | ||
| 56 | - "src": "/miniapp/images/bar/car.png", | ||
| 57 | - "src_sele": "/miniapp/images/bar/car_on.png" | ||
| 58 | - }, | ||
| 59 | - { | ||
| 60 | - "weappurl": "/pages/user/index/index", | ||
| 61 | - "nav_name": "我的", | ||
| 62 | - "src": "/miniapp/images/bar/user.png", | ||
| 63 | - "src_sele": "/miniapp/images/bar/user_on.png" | ||
| 64 | - } | ||
| 65 | - ] | ||
| 66 | - }, | ||
| 67 | - isTabBar:false, | 109 | + cartGoodsNum:0, //购物车总数量 |
| 110 | + isTabBar :false, | ||
| 111 | + isIpx: false, //适配IPhoneX | ||
| 112 | + url:"", | ||
| 68 | setting: t, | 113 | setting: t, |
| 69 | wechatUser: null, | 114 | wechatUser: null, |
| 70 | userInfo: null, | 115 | userInfo: null, |
| @@ -86,17 +131,23 @@ App({ | @@ -86,17 +131,23 @@ App({ | ||
| 86 | to_group:null, //参团传递的数据 | 131 | to_group:null, //参团传递的数据 |
| 87 | wxapp_buy_obj:null, //微信小程序购买的Object | 132 | wxapp_buy_obj:null, //微信小程序购买的Object |
| 88 | pk_store:null, //选择的门店 | 133 | pk_store:null, //选择的门店 |
| 134 | + first_leader:null, //分享会员ID | ||
| 135 | + guide_id:null, //分享导购ID | ||
| 136 | + | ||
| 137 | + windowWidth:0, //整个窗体的宽度 | ||
| 89 | }, | 138 | }, |
| 90 | auth: o, | 139 | auth: o, |
| 91 | request: a, | 140 | request: a, |
| 92 | onLaunch: function() { | 141 | onLaunch: function() { |
| 93 | this.initExt(); | 142 | this.initExt(); |
| 94 | var t = this.globalData.setting; | 143 | var t = this.globalData.setting; |
| 144 | + //console.log(t) | ||
| 95 | t.resourceUrl = t.url + "/template/mobile/rainbow"; | 145 | t.resourceUrl = t.url + "/template/mobile/rainbow"; |
| 96 | var clientWidth = wx.getSystemInfoSync().windowWidth; | 146 | var clientWidth = wx.getSystemInfoSync().windowWidth; |
| 97 | var rpxR = 750 / clientWidth; | 147 | var rpxR = 750 / clientWidth; |
| 98 | var calc = wx.getSystemInfoSync().windowHeight * rpxR; | 148 | var calc = wx.getSystemInfoSync().windowHeight * rpxR; |
| 99 | this.globalData.heigth=calc; | 149 | this.globalData.heigth=calc; |
| 150 | + this.globalData.windowWidth=clientWidth; | ||
| 100 | 151 | ||
| 101 | var app=this; | 152 | var app=this; |
| 102 | if(!app.globalData.userInfo){ | 153 | if(!app.globalData.userInfo){ |
| @@ -106,6 +157,44 @@ App({ | @@ -106,6 +157,44 @@ App({ | ||
| 106 | app.globalData.user_id= app.globalData.userInfo.user_id; | 157 | app.globalData.user_id= app.globalData.userInfo.user_id; |
| 107 | } | 158 | } |
| 108 | } | 159 | } |
| 160 | + | ||
| 161 | + wx.getSystemInfo({ | ||
| 162 | + success: (res) => { | ||
| 163 | + // console.log(res) | ||
| 164 | + let modelmes = res.model; //手机品牌 | ||
| 165 | + console.log('手机品牌', modelmes) | ||
| 166 | + if (modelmes.indexOf('iPhone X') != -1) { //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来 | ||
| 167 | + this.globalData.isIpx = true | ||
| 168 | + } | ||
| 169 | + }, | ||
| 170 | + }) | ||
| 171 | + console.log(t.stoid,this.globalData.user_id) | ||
| 172 | + var tha = this | ||
| 173 | + wx.request({ | ||
| 174 | + url: t.url+'/api/weshop/cart/page', | ||
| 175 | + data: { | ||
| 176 | + store_id:t.stoid, | ||
| 177 | + user_id:tha.globalData.user_id, | ||
| 178 | + state:0, | ||
| 179 | + is_gift:0 | ||
| 180 | + }, | ||
| 181 | + methods:'GET', | ||
| 182 | + header: { | ||
| 183 | + 'content-type': 'json' | ||
| 184 | + }, | ||
| 185 | + success: function(e){ | ||
| 186 | + | ||
| 187 | + var num = 0; | ||
| 188 | + for (var i = 0; i < e.data.data.pageData.length; i++) { | ||
| 189 | + num += e.data.data.pageData[i].goods_num; | ||
| 190 | + } | ||
| 191 | + console.log("购物车数量:=",num) | ||
| 192 | + tha.globalData.cartGoodsNum=num | ||
| 193 | + }, | ||
| 194 | + fail: function(){} | ||
| 195 | + }) | ||
| 196 | + | ||
| 197 | + | ||
| 109 | }, | 198 | }, |
| 110 | 199 | ||
| 111 | //---初始化第三方---- | 200 | //---初始化第三方---- |
| @@ -294,7 +383,6 @@ App({ | @@ -294,7 +383,6 @@ App({ | ||
| 294 | 383 | ||
| 295 | //同步化,在调用的时候要await | 384 | //同步化,在调用的时候要await |
| 296 | async get_isbuy() { | 385 | async get_isbuy() { |
| 297 | - | ||
| 298 | var th=this; | 386 | var th=this; |
| 299 | await api.check_isbuy({ store_id: t.stoid, type: 5 }).then(res=>{ | 387 | await api.check_isbuy({ store_id: t.stoid, type: 5 }).then(res=>{ |
| 300 | var o=res; | 388 | var o=res; |
| @@ -333,6 +421,7 @@ App({ | @@ -333,6 +421,7 @@ App({ | ||
| 333 | 421 | ||
| 334 | //----智能跳转,判断 非tabBar,tabBar页面的跳转---- | 422 | //----智能跳转,判断 非tabBar,tabBar页面的跳转---- |
| 335 | goto:function (url) { | 423 | goto:function (url) { |
| 424 | + | ||
| 336 | var arr_tabbar=["/pages/index/index/index","/pages/goods/categoryList/categoryList", | 425 | var arr_tabbar=["/pages/index/index/index","/pages/goods/categoryList/categoryList", |
| 337 | "/pages/goods/categoryList/categoryList?type=2", | 426 | "/pages/goods/categoryList/categoryList?type=2", |
| 338 | "/pages/goods/categoryList/categoryList?type=1", | 427 | "/pages/goods/categoryList/categoryList?type=1", |
| @@ -340,10 +429,12 @@ App({ | @@ -340,10 +429,12 @@ App({ | ||
| 340 | if(arr_tabbar.indexOf(url)!=-1){ | 429 | if(arr_tabbar.indexOf(url)!=-1){ |
| 341 | if(url.indexOf("categoryList?type=1")!=-1) this.globalData.cat_type=1; | 430 | if(url.indexOf("categoryList?type=1")!=-1) this.globalData.cat_type=1; |
| 342 | if(url.indexOf("categoryList?type=2")!=-1) this.globalData.cat_type=2; | 431 | if(url.indexOf("categoryList?type=2")!=-1) this.globalData.cat_type=2; |
| 343 | - wx.switchTab({ url: url, }) //跳到tabbar页 | 432 | + wx.navigateTo({ url: url, }) //跳到tabbar页 |
| 433 | + | ||
| 344 | }else{ | 434 | }else{ |
| 345 | wx.navigateTo({ url: url, }) //跳到非tabbar页 | 435 | wx.navigateTo({ url: url, }) //跳到非tabbar页 |
| 346 | } | 436 | } |
| 437 | + //wx.navigateTo({ url: url, }) //跳到非tabbar页 | ||
| 347 | }, | 438 | }, |
| 348 | 439 | ||
| 349 | //显示提示,word提示内容,type 0失败,提示 1成功 | 440 | //显示提示,word提示内容,type 0失败,提示 1成功 |
| @@ -473,7 +564,14 @@ App({ | @@ -473,7 +564,14 @@ App({ | ||
| 473 | } | 564 | } |
| 474 | },1000); | 565 | },1000); |
| 475 | } | 566 | } |
| 476 | - } | 567 | + }, |
| 568 | + | ||
| 569 | + //清空登录时候缓存的值 | ||
| 570 | + onHide:function () { | ||
| 571 | + this.globalData.is_test=0; | ||
| 572 | + this.globalData.guide_id=null; //导购清空 | ||
| 573 | + this.globalData.first_leader=null; //分享的会员清空 | ||
| 574 | + } | ||
| 477 | 575 | ||
| 478 | 576 | ||
| 479 | }); | 577 | }); |
app.json
| @@ -117,38 +117,6 @@ | @@ -117,38 +117,6 @@ | ||
| 117 | "backgroundColor": "#ffffff", | 117 | "backgroundColor": "#ffffff", |
| 118 | "enablePullDownRefresh": true | 118 | "enablePullDownRefresh": true |
| 119 | }, | 119 | }, |
| 120 | - "tabBar": { | ||
| 121 | - "color": "#6e6d6b", | ||
| 122 | - "selectedColor": "#f23030", | ||
| 123 | - "borderStyle": "white", | ||
| 124 | - "backgroundColor": "#ffffff", | ||
| 125 | - "list": [ | ||
| 126 | - { | ||
| 127 | - "pagePath": "pages/index/index/index", | ||
| 128 | - "text": "首页", | ||
| 129 | - "iconPath": "packageA/images/bar/index.png", | ||
| 130 | - "selectedIconPath": "packageA/images/bar/index_on.png" | ||
| 131 | - }, | ||
| 132 | - { | ||
| 133 | - "pagePath": "pages/goods/categoryList/categoryList", | ||
| 134 | - "text": "分类", | ||
| 135 | - "iconPath": "packageA/images/bar/fl.png", | ||
| 136 | - "selectedIconPath": "packageA/images/bar/fl_on.png" | ||
| 137 | - }, | ||
| 138 | - { | ||
| 139 | - "pagePath": "pages/cart/cart/cart", | ||
| 140 | - "text": "购物车", | ||
| 141 | - "iconPath": "packageA/images/bar/car.png", | ||
| 142 | - "selectedIconPath": "packageA/images/bar/car_on.png" | ||
| 143 | - }, | ||
| 144 | - { | ||
| 145 | - "pagePath": "pages/user/index/index", | ||
| 146 | - "text": "我的", | ||
| 147 | - "iconPath": "packageA/images/bar/user.png", | ||
| 148 | - "selectedIconPath": "packageA/images/bar/user_on.png" | ||
| 149 | - } | ||
| 150 | - ] | ||
| 151 | - }, | ||
| 152 | "debug": false, | 120 | "debug": false, |
| 153 | "sitemapLocation": "sitemap.json" | 121 | "sitemapLocation": "sitemap.json" |
| 154 | } | 122 | } |
| 155 | \ No newline at end of file | 123 | \ No newline at end of file |
components/diy_advertising/diy_advertising.js
| @@ -16,9 +16,10 @@ Component({ | @@ -16,9 +16,10 @@ Component({ | ||
| 16 | interval:3000, | 16 | interval:3000, |
| 17 | duration:1000, | 17 | duration:1000, |
| 18 | someData: {}, | 18 | someData: {}, |
| 19 | - max_sw_height:null, | 19 | + max_sw_height:getApp().globalData.windowWidth, |
| 20 | }, | 20 | }, |
| 21 | methods: { | 21 | methods: { |
| 22 | + | ||
| 22 | customMethod: function () { }, | 23 | customMethod: function () { }, |
| 23 | //---智能跳转--- | 24 | //---智能跳转--- |
| 24 | go_url:function(e){ | 25 | go_url:function(e){ |
components/diy_advertising/diy_advertising.wxml
| 1 | <wxs module="g_filter" src="../diy_notice/g_filter.wxs"></wxs> | 1 | <wxs module="g_filter" src="../diy_notice/g_filter.wxs"></wxs> |
| 2 | <!--上下两块--> | 2 | <!--上下两块--> |
| 3 | <block wx:if='{{object.style==0}}'> | 3 | <block wx:if='{{object.style==0}}'> |
| 4 | -<view class="zwp_s1"> | 4 | +<view class="zwp_s1" style="background-color: {{object.bg_color?object.bg_color:'none'}}"> |
| 5 | <block wx:for="{{object.data}}" wx:key="{{index}}"> | 5 | <block wx:for="{{object.data}}" wx:key="{{index}}"> |
| 6 | - <view class='s1'> | 6 | + <view class='s1' style="padding: 0 {{object.two_side}}px"> |
| 7 | <view class='s1_gk'> | 7 | <view class='s1_gk'> |
| 8 | <block wx:if="{{item.src==''}}"> | 8 | <block wx:if="{{item.src==''}}"> |
| 9 | <text>建议宽度640</text> | 9 | <text>建议宽度640</text> |
| @@ -80,19 +80,31 @@ | @@ -80,19 +80,31 @@ | ||
| 80 | </view> | 80 | </view> |
| 81 | <view class="clear"></view> | 81 | <view class="clear"></view> |
| 82 | <!--2行三列--> | 82 | <!--2行三列--> |
| 83 | -<view class='s4' wx:if='{{object.style==3}}'> | 83 | +<view class='s4' wx:if='{{object.style==3}}' |
| 84 | + style="padding:0 {{object.two_side}}px;display: flex; background-color:{{object.bg_color?object.bg_color:'none'}}"> | ||
| 84 | 85 | ||
| 85 | <block wx:for="{{object.data}}" wx:key="{{index}}"> | 86 | <block wx:for="{{object.data}}" wx:key="{{index}}"> |
| 86 | 87 | ||
| 87 | - <view class='s4_gk'> | 88 | + <view class='s4_gk' wx:if="{{index==0}}" style="width:{{(max_sw_height-2*object.two_side-2*object.jian_ge)/3}}px"> |
| 88 | <block wx:if="{{item.src==''}}"> | 89 | <block wx:if="{{item.src==''}}"> |
| 89 | <text>200*200</text> | 90 | <text>200*200</text> |
| 90 | </block> | 91 | </block> |
| 91 | <block wx:if="{{item.src!=''}}"> | 92 | <block wx:if="{{item.src!=''}}"> |
| 92 | - <navigator url="{{item.wxapp_imgurl}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.wxapp_imgurl,'plugin')>=0}}"><image src="{{item.src}}" ></image></navigator> | ||
| 93 | - <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url" wx:else><image src="{{item.src}}" ></image></view> | 93 | + <navigator url="{{item.wxapp_imgurl}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.wxapp_imgurl,'plugin')>=0}}"><image src="{{item.src}}" mode="widthFix" ></image></navigator> |
| 94 | + <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url" wx:else><image src="{{item.src}}" mode="widthFix"></image></view> | ||
| 94 | </block> | 95 | </block> |
| 95 | </view> | 96 | </view> |
| 97 | + | ||
| 98 | + <view class='s4_gk' wx:else style="margin-left:{{object.jian_ge}}px; width:{{(max_sw_height-2*object.two_side-2*object.jian_ge)/3}}px"> | ||
| 99 | + <block wx:if="{{item.src==''}}"> | ||
| 100 | + <text>200*200</text> | ||
| 101 | + </block> | ||
| 102 | + <block wx:if="{{item.src!=''}}"> | ||
| 103 | + <navigator url="{{item.wxapp_imgurl}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.wxapp_imgurl,'plugin')>=0}}"><image src="{{item.src}}" mode="widthFix"></image></navigator> | ||
| 104 | + <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url" wx:else><image src="{{item.src}}" mode="widthFix"></image></view> | ||
| 105 | + </block> | ||
| 106 | + </view> | ||
| 107 | + | ||
| 96 | </block> | 108 | </block> |
| 97 | </view> | 109 | </view> |
| 98 | <view class="clear"></view> | 110 | <view class="clear"></view> |
| @@ -137,10 +149,10 @@ | @@ -137,10 +149,10 @@ | ||
| 137 | <text>300*150</text> | 149 | <text>300*150</text> |
| 138 | </block> | 150 | </block> |
| 139 | <block wx:if="{{object.data[2].src!=''}}"> | 151 | <block wx:if="{{object.data[2].src!=''}}"> |
| 140 | - <navigator url="{{object.data[2].wxapp_imgurl}}" open-type="switchTab" class="s1_gk_a1" wx:if="{{g_filter.has_char(object.data[2].wxapp_imgurl,'plugin')>=0}}"> | 152 | + <navigator url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(object.data[2].wxapp_imgurl,'plugin')>=0}}"> |
| 141 | <image src="{{object.data[2].src}}"></image> | 153 | <image src="{{object.data[2].src}}"></image> |
| 142 | </navigator> | 154 | </navigator> |
| 143 | - <view data-url="{{object.data[2].wxapp_imgurl}}" open-type="switchTab" class="s1_gk_a1" bindtap="go_url" wx:else> | 155 | + <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url" wx:else> |
| 144 | <image src="{{object.data[2].src}}"></image> | 156 | <image src="{{object.data[2].src}}"></image> |
| 145 | </view> | 157 | </view> |
| 146 | 158 | ||
| @@ -388,9 +400,14 @@ | @@ -388,9 +400,14 @@ | ||
| 388 | <!--幻灯片--> | 400 | <!--幻灯片--> |
| 389 | <block wx:if='{{object.style==4}}'> | 401 | <block wx:if='{{object.style==4}}'> |
| 390 | 402 | ||
| 391 | - <swiper class="swiper" indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" style="height:{{max_sw_height}}rpx" > | 403 | + |
| 404 | + <swiper class="swiper" autoplay="{{autoplay}}" current="{{object.sw_index}}" | ||
| 405 | + indicator-dots="true" | ||
| 406 | + indicator-color="{{object.dot_color}}" | ||
| 407 | + indicator-active-color="{{object.dot_color_act}}" | ||
| 408 | + interval="{{object.swiper_time?object.swiper_time*1000:interval}}" duration="{{duration}}" | ||
| 409 | + style="height:{{max_sw_height}}rpx" > | ||
| 392 | <block wx:for="{{object.data}}" wx:for-index="index" > | 410 | <block wx:for="{{object.data}}" wx:for-index="index" > |
| 393 | - | ||
| 394 | 411 | ||
| 395 | <navigator url="{{item.wxapp_imgurl}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.wxapp_imgurl,'plugin')>=0}}"> | 412 | <navigator url="{{item.wxapp_imgurl}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.wxapp_imgurl,'plugin')>=0}}"> |
| 396 | <swiper-item><image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /></swiper-item> | 413 | <swiper-item><image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /></swiper-item> |
| @@ -400,10 +417,10 @@ | @@ -400,10 +417,10 @@ | ||
| 400 | <swiper-item><image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /></swiper-item> | 417 | <swiper-item><image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /></swiper-item> |
| 401 | </view> | 418 | </view> |
| 402 | 419 | ||
| 403 | - | ||
| 404 | - | ||
| 405 | - | ||
| 406 | </block> | 420 | </block> |
| 407 | </swiper> | 421 | </swiper> |
| 408 | 422 | ||
| 423 | + | ||
| 424 | + | ||
| 425 | + | ||
| 409 | </block> | 426 | </block> |
components/diy_advertising/diy_advertising.wxss
| @@ -17,7 +17,6 @@ | @@ -17,7 +17,6 @@ | ||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | .s1 { | 19 | .s1 { |
| 20 | - width: 100%; | ||
| 21 | display: flex; | 20 | display: flex; |
| 22 | } | 21 | } |
| 23 | 22 | ||
| @@ -152,14 +151,10 @@ | @@ -152,14 +151,10 @@ | ||
| 152 | 151 | ||
| 153 | .s4_gk { | 152 | .s4_gk { |
| 154 | /* background-color: rgb(129, 213, 249); */ | 153 | /* background-color: rgb(129, 213, 249); */ |
| 155 | - width: 32%; | ||
| 156 | color: #fff; | 154 | color: #fff; |
| 157 | font-size: 32rpx; | 155 | font-size: 32rpx; |
| 158 | - height: 240rpx; | ||
| 159 | text-align: center; | 156 | text-align: center; |
| 160 | - margin-left: 1%; | ||
| 161 | float: left; | 157 | float: left; |
| 162 | - margin-bottom: 8rpx; | ||
| 163 | } | 158 | } |
| 164 | 159 | ||
| 165 | .s4_gk1 { | 160 | .s4_gk1 { |
| @@ -331,8 +326,8 @@ | @@ -331,8 +326,8 @@ | ||
| 331 | width: 100%; | 326 | width: 100%; |
| 332 | margin: 0; | 327 | margin: 0; |
| 333 | } | 328 | } |
| 334 | - | ||
| 335 | - | ||
| 336 | -.zwp_s1{ | ||
| 337 | - margin-bottom: 8rpx; | ||
| 338 | -} | ||
| 339 | \ No newline at end of file | 329 | \ No newline at end of file |
| 330 | +.sw_con{ | ||
| 331 | + position: relative; | ||
| 332 | +} | ||
| 333 | +.clicle{ width: 20rpx; height: 20rpx} | ||
| 334 | +.dots{ position: absolute; bottom: 10rpx; width: 100%; display: flex; justify-content: center} |
packageA/images/share/ct_num.png renamed to images/share/ct_num.png
3.63 KB
packageA/images/share/default_g_img.gif renamed to images/share/default_g_img.gif
7.54 KB
packageA/images/share/hui_hear_pic.png renamed to images/share/hui_hear_pic.png
27.6 KB
packageA/images/share/mackground.png renamed to images/share/mackground.png
10.4 KB
packageA/images/share/miao_share.png renamed to images/share/miao_share.png
14 KB
packageA/images/share/q_tj.png renamed to images/share/q_tj.png
1.81 KB
packageA/images/share/s_gou.png renamed to images/share/s_gou.png
23.8 KB
packageA/images/share/share_bg.png renamed to images/share/share_bg.png
7.03 KB
pages/cart/cart/cart.js
| @@ -55,11 +55,9 @@ Page({ | @@ -55,11 +55,9 @@ Page({ | ||
| 55 | }, | 55 | }, |
| 56 | onShow: function() { | 56 | onShow: function() { |
| 57 | var th = this; | 57 | var th = this; |
| 58 | - //th.setData({ | ||
| 59 | - // isTabBar: getApp().globalData.isTabBar, | ||
| 60 | - //}); | ||
| 61 | - | ||
| 62 | - t.editTabBar(); //显示自定义的底部导航 | 58 | + //调用底部导航 |
| 59 | + t.editTabBar(th,getApp().globalData.setting.stoid,getApp().globalData.url); | ||
| 60 | + | ||
| 63 | this.getCardList(); | 61 | this.getCardList(); |
| 64 | if(getApp().globalData.user_id) getApp().requestCardNum(); | 62 | if(getApp().globalData.user_id) getApp().requestCardNum(); |
| 65 | //--获取是否又秒杀活动-- | 63 | //--获取是否又秒杀活动-- |
| @@ -81,6 +79,12 @@ Page({ | @@ -81,6 +79,12 @@ Page({ | ||
| 81 | 79 | ||
| 82 | }, | 80 | }, |
| 83 | 81 | ||
| 82 | + onHide(){ | ||
| 83 | + for(var i = 1; i < 100; i++) { | ||
| 84 | + clearInterval(i); | ||
| 85 | + } | ||
| 86 | + }, | ||
| 87 | + | ||
| 84 | //-------------获取购物车列表,要安装门店进行分类订单----------- | 88 | //-------------获取购物车列表,要安装门店进行分类订单----------- |
| 85 | getCardList: function() { | 89 | getCardList: function() { |
| 86 | var th = this; | 90 | var th = this; |
| @@ -1102,7 +1106,7 @@ Page({ | @@ -1102,7 +1106,7 @@ Page({ | ||
| 1102 | }, | 1106 | }, |
| 1103 | //跳到首页 | 1107 | //跳到首页 |
| 1104 | goto: function(e) { | 1108 | goto: function(e) { |
| 1105 | - wx.switchTab({ | 1109 | + navigateTo({ |
| 1106 | url: '/pages/index/index/index', | 1110 | url: '/pages/index/index/index', |
| 1107 | }) | 1111 | }) |
| 1108 | }, | 1112 | }, |
pages/cart/cart/cart.wxml
| @@ -180,10 +180,6 @@ | @@ -180,10 +180,6 @@ | ||
| 180 | </view> | 180 | </view> |
| 181 | 181 | ||
| 182 | 182 | ||
| 183 | - | ||
| 184 | - | ||
| 185 | <warn id="warn"></warn> | 183 | <warn id="warn"></warn> |
| 186 | -<!-- <view wx:if="{{isTabBar == true}}"> | ||
| 187 | - <import src="../../tabbar/tabbar.wxml" /> | ||
| 188 | - <template is="tabBar" data="{{tabBar}}" /> | ||
| 189 | -</view> --> | ||
| 190 | \ No newline at end of file | 184 | \ No newline at end of file |
| 185 | +<import src="../../tabbar/tabbar.wxml" /> | ||
| 186 | +<template is="tabBar" data="{{tabBar}}" /> | ||
| 191 | \ No newline at end of file | 187 | \ No newline at end of file |
pages/cart/cart/cart.wxss
| @@ -31,7 +31,7 @@ page { | @@ -31,7 +31,7 @@ page { | ||
| 31 | align-items: center; | 31 | align-items: center; |
| 32 | justify-content: center; | 32 | justify-content: center; |
| 33 | background-color: rgb(255, 255, 255); | 33 | background-color: rgb(255, 255, 255); |
| 34 | - margin-bottom: 99rpx; | 34 | + margin-bottom: 160rpx; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | radio { | 37 | radio { |
| @@ -143,7 +143,7 @@ radio { | @@ -143,7 +143,7 @@ radio { | ||
| 143 | height: 100rpx; | 143 | height: 100rpx; |
| 144 | position: fixed; | 144 | position: fixed; |
| 145 | left: 0; | 145 | left: 0; |
| 146 | - bottom: 0; | 146 | + bottom: 45px; |
| 147 | font-size: 28rpx; | 147 | font-size: 28rpx; |
| 148 | color: #666; | 148 | color: #666; |
| 149 | background-color: rgb(255, 255, 255); | 149 | background-color: rgb(255, 255, 255); |
pages/cart/cart2/cart2.js
pages/cart/cart2_pt/cart2_pt.js
| @@ -217,7 +217,7 @@ Page({ | @@ -217,7 +217,7 @@ Page({ | ||
| 217 | onShow: function() { | 217 | onShow: function() { |
| 218 | var th=this; | 218 | var th=this; |
| 219 | if (th.data.isclose==0){ | 219 | if (th.data.isclose==0){ |
| 220 | - wx.switchTab({ | 220 | + wx.navigateTo({ |
| 221 | url: "/pages/index/index/index" | 221 | url: "/pages/index/index/index" |
| 222 | }) | 222 | }) |
| 223 | }else{ | 223 | }else{ |
pages/cart/cart_wk/cart_wk.js
| @@ -62,7 +62,7 @@ Page({ | @@ -62,7 +62,7 @@ Page({ | ||
| 62 | onShow: function() { | 62 | onShow: function() { |
| 63 | var th = this; | 63 | var th = this; |
| 64 | if (th.data.isclose == 0) { | 64 | if (th.data.isclose == 0) { |
| 65 | - wx.switchTab({ | 65 | + wx.navigateTo({ |
| 66 | url: "/pages/index/index/index" | 66 | url: "/pages/index/index/index" |
| 67 | }) | 67 | }) |
| 68 | } | 68 | } |
pages/goods/categoryList/categoryList.js
| @@ -47,13 +47,14 @@ Page({ | @@ -47,13 +47,14 @@ Page({ | ||
| 47 | is_pl_time:0, | 47 | is_pl_time:0, |
| 48 | requestData:null, //风格三的商品数据列表 分页 | 48 | requestData:null, //风格三的商品数据列表 分页 |
| 49 | stylePage:1, //商品列表分页标识 | 49 | stylePage:1, //商品列表分页标识 |
| 50 | + | ||
| 50 | //风格三使用 | 51 | //风格三使用 |
| 51 | url: t.globalData.setting.imghost, | 52 | url: t.globalData.setting.imghost, |
| 52 | currentPage: 1, | 53 | currentPage: 1, |
| 53 | requestData: null, | 54 | requestData: null, |
| 54 | allData: null, | 55 | allData: null, |
| 55 | openFilterModal: !1, | 56 | openFilterModal: !1, |
| 56 | - baseUrl: "api/weshop/goods/page?1=1&orderField=goods_id&orderType=desc&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", | 57 | + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", |
| 57 | requestUrl: "", | 58 | requestUrl: "", |
| 58 | tabname: "goods_id", //排序的字段 | 59 | tabname: "goods_id", //排序的字段 |
| 59 | adname: "desc", //升降的字段 | 60 | adname: "desc", //升降的字段 |
| @@ -152,10 +153,8 @@ Page({ | @@ -152,10 +153,8 @@ Page({ | ||
| 152 | 153 | ||
| 153 | onShow:function(){ | 154 | onShow:function(){ |
| 154 | var that=this; | 155 | var that=this; |
| 155 | - that.setData({ | ||
| 156 | - isTabBar: getApp().globalData.isTabBar, | ||
| 157 | - }); | ||
| 158 | - t.editTabBar(); //显示自定义的底部导航 | 156 | + //调用底部导航 |
| 157 | + t.editTabBar(that,getApp().globalData.setting.stoid,getApp().globalData.url); | ||
| 159 | //this.requestFirstCategoris(); | 158 | //this.requestFirstCategoris(); |
| 160 | if(getApp().globalData.user_id) getApp().requestCardNum(); | 159 | if(getApp().globalData.user_id) getApp().requestCardNum(); |
| 161 | getApp().getConfig2(function (e) { | 160 | getApp().getConfig2(function (e) { |
| @@ -463,9 +462,12 @@ Page({ | @@ -463,9 +462,12 @@ Page({ | ||
| 463 | success: function (e) { | 462 | success: function (e) { |
| 464 | var arr=new Array(); | 463 | var arr=new Array(); |
| 465 | var dda = e.data.data.pageData; | 464 | var dda = e.data.data.pageData; |
| 466 | - s.setData({brand_list:dda}); | 465 | + s.setData({brand_list:dda}); |
| 467 | for (var i = 0; i < dda.length; i++) { | 466 | for (var i = 0; i < dda.length; i++) { |
| 468 | - if(dda[i].logo && dda[i].logo.indexOf("http")<0) dda[i].logo = oo.imghost+dda[i].logo; | 467 | + //console.log(dda[i].logo) |
| 468 | + if(dda[i].logo && dda[i].logo.indexOf("http")<0){ | ||
| 469 | + dda[i].logo = oo.imghost+dda[i].logo; | ||
| 470 | + } | ||
| 469 | if (arr.length>0){ | 471 | if (arr.length>0){ |
| 470 | var find = 0; | 472 | var find = 0; |
| 471 | //寻找字母在arr数组中是否存在,不存在就要添加,存在就在要这个数组添加元素 | 473 | //寻找字母在arr数组中是否存在,不存在就要添加,存在就在要这个数组添加元素 |
| @@ -487,8 +489,15 @@ Page({ | @@ -487,8 +489,15 @@ Page({ | ||
| 487 | } | 489 | } |
| 488 | //进行排序 | 490 | //进行排序 |
| 489 | arr.sort(compare("zm")); | 491 | arr.sort(compare("zm")); |
| 492 | + for(var i=0;i< arr.length;i++){ | ||
| 493 | + for(var j=0;j<arr[i].array.length;j++){ | ||
| 494 | + if(arr[i].array[j].logo == ""){ | ||
| 495 | + arr[i].array[j].logo= s.data.iurl+"/miniapp/images/no_brand_def.jpg"; | ||
| 496 | + } | ||
| 497 | + } | ||
| 498 | + } | ||
| 490 | s.setData({ groups: arr }); | 499 | s.setData({ groups: arr }); |
| 491 | - | 500 | + //console.log(s.data.groups) |
| 492 | } | 501 | } |
| 493 | }); | 502 | }); |
| 494 | }, | 503 | }, |
| @@ -507,10 +516,22 @@ Page({ | @@ -507,10 +516,22 @@ Page({ | ||
| 507 | }, | 516 | }, |
| 508 | //图片失败,默认图片 | 517 | //图片失败,默认图片 |
| 509 | bind_bnerr_pp: function (e) { | 518 | bind_bnerr_pp: function (e) { |
| 519 | + var list = this.data.groups | ||
| 510 | var _errImg = e.target.dataset.errorimg; | 520 | var _errImg = e.target.dataset.errorimg; |
| 511 | - var _errObj = {}; | ||
| 512 | - _errObj[_errImg] = this.data.iurl+"/miniapp/images/no_brand_def.jpg\n"; | ||
| 513 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 521 | + var idx = e.target.dataset.idx; |
| 522 | + var pix = e.target.dataset.pix; | ||
| 523 | + // for(var i=0;i< list.length;i++){ | ||
| 524 | + // for(var j=0;j<list[i].array.length;j++){ | ||
| 525 | + // if(list[i].array[j].logo == ""){ | ||
| 526 | + // list[i].array[j].logo= this.data.iurl+"/miniapp/images/no_brand_def.jpg"; | ||
| 527 | + // } | ||
| 528 | + // } | ||
| 529 | + // } | ||
| 530 | + // this.setData({groups:list}) | ||
| 531 | + // var _errObj = {}; | ||
| 532 | + // _errObj[_errImg] = this.data.iurl+"/miniapp/images/no_brand_def.jpg\n"; | ||
| 533 | + //console.log(this.data.groups) | ||
| 534 | + //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
| 514 | }, | 535 | }, |
| 515 | //商品图片失败,默认图片 | 536 | //商品图片失败,默认图片 |
| 516 | goods_bnerr: function (e) { | 537 | goods_bnerr: function (e) { |
| @@ -534,15 +555,6 @@ Page({ | @@ -534,15 +555,6 @@ Page({ | ||
| 534 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 555 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 535 | 556 | ||
| 536 | }, | 557 | }, |
| 537 | - | ||
| 538 | - | ||
| 539 | - //---图片失败,默认图片--- | ||
| 540 | - bind_Goodsbnerr: function (e) { | ||
| 541 | - var _errImg = e.target.dataset.errorimg; | ||
| 542 | - var _errObj = {}; | ||
| 543 | - _errObj[_errImg] ="/miniapp/images/default_g_img.gif"; | ||
| 544 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
| 545 | - }, | ||
| 546 | // 新的版本分类点击一级分类 | 558 | // 新的版本分类点击一级分类 |
| 547 | click_classify:function(e){ | 559 | click_classify:function(e){ |
| 548 | clearInterval(this.data.timer); | 560 | clearInterval(this.data.timer); |
| @@ -619,7 +631,7 @@ Page({ | @@ -619,7 +631,7 @@ Page({ | ||
| 619 | }) | 631 | }) |
| 620 | }, | 632 | }, |
| 621 | onUnload: function () { | 633 | onUnload: function () { |
| 622 | - this.destroyActivityTimer(); | 634 | + //this.destroyActivityTimer(); |
| 623 | }, | 635 | }, |
| 624 | 636 | ||
| 625 | 637 | ||
| @@ -688,7 +700,7 @@ Page({ | @@ -688,7 +700,7 @@ Page({ | ||
| 688 | // }, | 700 | // }, |
| 689 | // 左侧更新 | 701 | // 左侧更新 |
| 690 | scrollLower: function (data) { | 702 | scrollLower: function (data) { |
| 691 | - console.log("上拉加载更多", JSON.stringify(data)) | 703 | + //console.log("上拉加载更多", JSON.stringify(data)) |
| 692 | var that = this; | 704 | var that = this; |
| 693 | clearInterval(that.data.timer); | 705 | clearInterval(that.data.timer); |
| 694 | that.setData({ | 706 | that.setData({ |
| @@ -714,7 +726,7 @@ Page({ | @@ -714,7 +726,7 @@ Page({ | ||
| 714 | s.setData({ | 726 | s.setData({ |
| 715 | msgStatus: false, | 727 | msgStatus: false, |
| 716 | }); | 728 | }); |
| 717 | - //如果有数据 怕断分页为第一页的时候直接渲染数据 | 729 | + //如果有数据 判断分页为第一页的时候直接渲染数据 |
| 718 | if (page > 1) { | 730 | if (page > 1) { |
| 719 | //如果分页不是在第一页 那么就把返回的数据追加到原有数据后面 | 731 | //如果分页不是在第一页 那么就把返回的数据追加到原有数据后面 |
| 720 | var arr = s.data.requestData | 732 | var arr = s.data.requestData |
| @@ -765,46 +777,43 @@ Page({ | @@ -765,46 +777,43 @@ Page({ | ||
| 765 | countDownNum: countDownNum, | 777 | countDownNum: countDownNum, |
| 766 | requestData: [] | 778 | requestData: [] |
| 767 | }); | 779 | }); |
| 768 | - s.setData({ | ||
| 769 | - timer:setInterval(function () { | ||
| 770 | - if (countDownNum == 0) { | ||
| 771 | - clearInterval(s.data.timer); | ||
| 772 | - //关闭定时器之后,可作其他处理 | ||
| 773 | - s.setData({ | ||
| 774 | - msgStatus: false, | ||
| 775 | - }) | ||
| 776 | - | ||
| 777 | - //如果没有数据就把分页初始化成第一页 | ||
| 778 | - //没有数据根据当前分类id去找到下一个分类id再次传递给服务端请求数据 | ||
| 779 | - var dataArray = s.data.one_level_classify | ||
| 780 | - var index = s.data.index | ||
| 781 | - console.log(dataArray[index + 1]) | ||
| 782 | - if (dataArray[index + 1] == undefined || dataArray[index + 1] == "undefined"){ | ||
| 783 | - console.log("dataArray[index + 1] = undefined") | ||
| 784 | - s.setData({ | ||
| 785 | - stylePage: 1, | ||
| 786 | - msgStatus: true, | ||
| 787 | - lastMsg: true | ||
| 788 | - }); | ||
| 789 | - }else{ | ||
| 790 | - s.setData({ | ||
| 791 | - stylePage: 1, | ||
| 792 | - index: index + 1, | ||
| 793 | - select_classify_on: index + 1, | ||
| 794 | - cat_id: dataArray[index + 1]['items']['id'], | ||
| 795 | - classify_name: dataArray[index + 1]['items']['name'] | ||
| 796 | - }); | ||
| 797 | - s.style(s.data.stylePage, dataArray[index + 1]['items']['id']); | ||
| 798 | - } | ||
| 799 | - | ||
| 800 | - } | ||
| 801 | - countDownNum--; | 780 | + s.data.timer=setInterval(function () { |
| 781 | + if (countDownNum == 0) { | ||
| 782 | + clearInterval(s.data.timer); | ||
| 783 | + //关闭定时器之后,可作其他处理 | ||
| 802 | s.setData({ | 784 | s.setData({ |
| 803 | - countDownNum: countDownNum | 785 | + msgStatus: false, |
| 804 | }) | 786 | }) |
| 805 | - }, 1000) | ||
| 806 | 787 | ||
| 807 | - }) | 788 | + //如果没有数据就把分页初始化成第一页 |
| 789 | + //没有数据根据当前分类id去找到下一个分类id再次传递给服务端请求数据 | ||
| 790 | + var dataArray = s.data.one_level_classify | ||
| 791 | + var index = s.data.index | ||
| 792 | + console.log(dataArray[index + 1]) | ||
| 793 | + if (dataArray[index + 1] == undefined || dataArray[index + 1] == "undefined"){ | ||
| 794 | + console.log("dataArray[index + 1] = undefined") | ||
| 795 | + s.setData({ | ||
| 796 | + stylePage: 1, | ||
| 797 | + msgStatus: true, | ||
| 798 | + lastMsg: true | ||
| 799 | + }); | ||
| 800 | + }else{ | ||
| 801 | + s.setData({ | ||
| 802 | + stylePage: 1, | ||
| 803 | + index: index + 1, | ||
| 804 | + select_classify_on: index + 1, | ||
| 805 | + cat_id: dataArray[index + 1]['items']['id'], | ||
| 806 | + classify_name: dataArray[index + 1]['items']['name'] | ||
| 807 | + }); | ||
| 808 | + s.style(s.data.stylePage, dataArray[index + 1]['items']['id']); | ||
| 809 | + } | ||
| 810 | + | ||
| 811 | + } | ||
| 812 | + countDownNum--; | ||
| 813 | + s.setData({ | ||
| 814 | + countDownNum: countDownNum | ||
| 815 | + }) | ||
| 816 | + }, 1000) | ||
| 808 | } | 817 | } |
| 809 | 818 | ||
| 810 | 819 |
pages/goods/categoryList/categoryList.wxml
| @@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
| 19 | </view> | 19 | </view> |
| 20 | </view> | 20 | </view> |
| 21 | <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | 21 | <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
| 22 | - <swiper current="{{currentTab}}" duration="300" bindanimationfinish="swiperTab" style="height:{{abc}}rpx;"> | 22 | + <swiper current="{{currentTab}}" duration="300" bindanimationfinish="swiperTab" style="height:{{abc}}rpx;margin-bottom:120rpx"> |
| 23 | <!--------分类----------> | 23 | <!--------分类----------> |
| 24 | <swiper-item > | 24 | <swiper-item > |
| 25 | <scroll-view scroll-y="true" class="fenlei-list" | 25 | <scroll-view scroll-y="true" class="fenlei-list" |
| @@ -83,14 +83,14 @@ | @@ -83,14 +83,14 @@ | ||
| 83 | <view class="no-data" wx:if="{{!is_date}}"> | 83 | <view class="no-data" wx:if="{{!is_date}}"> |
| 84 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | 84 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 85 | <view class="no-data-title">暂无分类</view> | 85 | <view class="no-data-title">暂无分类</view> |
| 86 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 86 | + <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 87 | </view> | 87 | </view> |
| 88 | </block> | 88 | </block> |
| 89 | <block wx:elif="{{is_do}}"> | 89 | <block wx:elif="{{is_do}}"> |
| 90 | <view class="no-data" > | 90 | <view class="no-data" > |
| 91 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | 91 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 92 | <view class="no-data-title">商家暂未设置分类</view> | 92 | <view class="no-data-title">商家暂未设置分类</view> |
| 93 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 93 | + <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 94 | </view> | 94 | </view> |
| 95 | </block> | 95 | </block> |
| 96 | </block> | 96 | </block> |
| @@ -112,11 +112,12 @@ | @@ -112,11 +112,12 @@ | ||
| 112 | <input bindfocus="goseach" class="search-cont" placeholder="搜索你想要的生活" type="text"></input> | 112 | <input bindfocus="goseach" class="search-cont" placeholder="搜索你想要的生活" type="text"></input> |
| 113 | </view> | 113 | </view> |
| 114 | </view> | 114 | </view> |
| 115 | + | ||
| 115 | <!-- 分类项目内容 --> | 116 | <!-- 分类项目内容 --> |
| 116 | - <view class="flex project_height" style="margin-left:-10rpx"> | 117 | + <view class="flex project_height" style="margin-left:-10rpx;margin-bottom:120rpx"> |
| 117 | <!-- 分类项目的类型 --> | 118 | <!-- 分类项目的类型 --> |
| 118 | - <view class="project_type"> | ||
| 119 | - <view class="project_type-frame"> | 119 | + <view class="project_type" style="background-color:#eee"> |
| 120 | + <view class="project_type-frame" style="margin-bottom:120rpx"> | ||
| 120 | <view wx:if="{{is_show_gb}}"> | 121 | <view wx:if="{{is_show_gb}}"> |
| 121 | <view bindtap="click_classify" class="share_type fs30 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> | 122 | <view bindtap="click_classify" class="share_type fs30 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> |
| 122 | <text>国</text><text>家</text> | 123 | <text>国</text><text>家</text> |
| @@ -184,11 +185,11 @@ | @@ -184,11 +185,11 @@ | ||
| 184 | <view class="classify_content-frame flex flex-wrap"> | 185 | <view class="classify_content-frame flex flex-wrap"> |
| 185 | 186 | ||
| 186 | <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> | 187 | <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> |
| 187 | - <view class="brand_img_frame "wx:for="{{brand_list.array}}"wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > | 188 | + <view class="brand_img_frame" wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > |
| 188 | 189 | ||
| 189 | <view class="brand_img t-c"> | 190 | <view class="brand_img t-c"> |
| 190 | - <image class=" brand_img" src="{{user.logo}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image> | ||
| 191 | - <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view> | 191 | + <image class="brand_img" src="{{user.logo}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image> |
| 192 | + <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view> | ||
| 192 | </view> | 193 | </view> |
| 193 | </view> | 194 | </view> |
| 194 | 195 | ||
| @@ -260,7 +261,7 @@ | @@ -260,7 +261,7 @@ | ||
| 260 | <view class="no-data" > | 261 | <view class="no-data" > |
| 261 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | 262 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 262 | <view class="no-data-title">商家暂未设置分类</view> | 263 | <view class="no-data-title">商家暂未设置分类</view> |
| 263 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 264 | + <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 264 | </view> | 265 | </view> |
| 265 | </block> | 266 | </block> |
| 266 | 267 | ||
| @@ -287,8 +288,8 @@ | @@ -287,8 +288,8 @@ | ||
| 287 | <!-- 分类项目内容 --> | 288 | <!-- 分类项目内容 --> |
| 288 | <view class="flex project_height" style="margin-left:-10rpx;"> | 289 | <view class="flex project_height" style="margin-left:-10rpx;"> |
| 289 | <!-- 分类项目的类型 --> | 290 | <!-- 分类项目的类型 --> |
| 290 | - <view class="project_type" style="height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:120rpx;"> | ||
| 291 | - <view class="project_type-frame" style="margin-bottom:50px;"> | 291 | + <view class="project_type" style="background-color:#eee;height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:120rpx;"> |
| 292 | + <view class="project_type-frame" style="margin-bottom:120rpx;"> | ||
| 292 | <view wx:if="{{is_show_gb}}"> | 293 | <view wx:if="{{is_show_gb}}"> |
| 293 | <view bindtap="click_classify" class="share_type fs30 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> | 294 | <view bindtap="click_classify" class="share_type fs30 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> |
| 294 | <text>国</text><text>家</text> | 295 | <text>国</text><text>家</text> |
| @@ -316,7 +317,7 @@ | @@ -316,7 +317,7 @@ | ||
| 316 | </view> | 317 | </view> |
| 317 | </view> | 318 | </view> |
| 318 | <!-- 分类项目的内容 --> | 319 | <!-- 分类项目的内容 --> |
| 319 | - <view class="classify_content" style="margin-left:26%;margin-top:60px"> | 320 | + <view class="classify_content" style="margin-left:27%;margin-top:130rpx"> |
| 320 | <!-- 国家的样式 --> | 321 | <!-- 国家的样式 --> |
| 321 | <block wx:if="{{select_classify_on==223&&is_show_gb}}"> | 322 | <block wx:if="{{select_classify_on==223&&is_show_gb}}"> |
| 322 | <view class="classify_name fs28 flex-space-between"> | 323 | <view class="classify_name fs28 flex-space-between"> |
| @@ -349,10 +350,10 @@ | @@ -349,10 +350,10 @@ | ||
| 349 | <view class="classify_content-frame flex flex-wrap"> | 350 | <view class="classify_content-frame flex flex-wrap"> |
| 350 | 351 | ||
| 351 | <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> | 352 | <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> |
| 352 | - <view class="brand_img_frame "wx:for="{{brand_list.array}}"wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > | 353 | + <view class="brand_img_frame "wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > |
| 353 | 354 | ||
| 354 | <view class="brand_img t-c"> | 355 | <view class="brand_img t-c"> |
| 355 | - <image class=" brand_img" src="{{user.logo}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image> | 356 | + <image class=" brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image> |
| 356 | <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view> | 357 | <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view> |
| 357 | </view> | 358 | </view> |
| 358 | </view> | 359 | </view> |
| @@ -365,7 +366,7 @@ | @@ -365,7 +366,7 @@ | ||
| 365 | <block wx:if="{{is_show_pl}}"> | 366 | <block wx:if="{{is_show_pl}}"> |
| 366 | <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> | 367 | <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> |
| 367 | <view style="width:100%;height:100%;"> | 368 | <view style="width:100%;height:100%;"> |
| 368 | - <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:65px;width:70%;background-color:#ffffff;left:26%;padding:0 10rpx;"> | 369 | + <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;"> |
| 369 | <view class="classify_title ellipsis-1">{{classify_name}}</view> | 370 | <view class="classify_title ellipsis-1">{{classify_name}}</view> |
| 370 | <view class="flex select_more" > | 371 | <view class="flex select_more" > |
| 371 | <view class="red-co fs24" >更多</view> | 372 | <view class="red-co fs24" >更多</view> |
| @@ -382,7 +383,7 @@ | @@ -382,7 +383,7 @@ | ||
| 382 | <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> | 383 | <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> |
| 383 | <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}"> | 384 | <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}"> |
| 384 | <view class="img-wrap"> | 385 | <view class="img-wrap"> |
| 385 | - <image src="{{url+item.original_img}}" binderror="bind_Goodsbnerr" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image> | 386 | + <image src="{{url+item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image> |
| 386 | </view> | 387 | </view> |
| 387 | <view class="item-cont"> | 388 | <view class="item-cont"> |
| 388 | <view class="title">{{item.goods_name}}</view> | 389 | <view class="title">{{item.goods_name}}</view> |
| @@ -465,7 +466,7 @@ | @@ -465,7 +466,7 @@ | ||
| 465 | <view wx:if="{{msgStatus == true && lastMsg == false}}" class="no-data-title" style="text-align:center;margin-top:100px"> | 466 | <view wx:if="{{msgStatus == true && lastMsg == false}}" class="no-data-title" style="text-align:center;margin-top:100px"> |
| 466 | <view style="color:#444;line-height:30px;">该类别暂无推荐商品</view><view style="color:#444;line-height:30px;"> {{countDownNum}} 秒后自动跳到下一个类别</view> </view> | 467 | <view style="color:#444;line-height:30px;">该类别暂无推荐商品</view><view style="color:#444;line-height:30px;"> {{countDownNum}} 秒后自动跳到下一个类别</view> </view> |
| 467 | <view wx:elif="{{lastMsg == true && msgStatus == true}}" class="no-data-title" style="text-align:center;margin-top:100px">该类别暂无推荐商品</view> | 468 | <view wx:elif="{{lastMsg == true && msgStatus == true}}" class="no-data-title" style="text-align:center;margin-top:100px">该类别暂无推荐商品</view> |
| 468 | - <!-- <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> --> | 469 | + <!-- <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> --> |
| 469 | </view> | 470 | </view> |
| 470 | 471 | ||
| 471 | </scroll-view> | 472 | </scroll-view> |
| @@ -482,12 +483,10 @@ | @@ -482,12 +483,10 @@ | ||
| 482 | <view class="no-data" > | 483 | <view class="no-data" > |
| 483 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | 484 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 484 | <view class="no-data-title">商家暂未设置分类</view> | 485 | <view class="no-data-title">商家暂未设置分类</view> |
| 485 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 486 | + <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 486 | </view> | 487 | </view> |
| 487 | </block> | 488 | </block> |
| 488 | 489 | ||
| 489 | </block> | 490 | </block> |
| 490 | -<!-- <view wx:if="{{isTabBar == true}}"> | ||
| 491 | <import src="../../tabbar/tabbar.wxml" /> | 491 | <import src="../../tabbar/tabbar.wxml" /> |
| 492 | - <template is="tabBar" data="{{tabBar}}" /> | ||
| 493 | -</view> --> | ||
| 494 | \ No newline at end of file | 492 | \ No newline at end of file |
| 493 | + <template is="tabBar" data="{{tabBar}}" /> | ||
| 495 | \ No newline at end of file | 494 | \ No newline at end of file |
pages/goods/categoryList/categoryList.wxss
| @@ -244,15 +244,23 @@ margin: auto; | @@ -244,15 +244,23 @@ margin: auto; | ||
| 244 | margin-top: 35rpx; | 244 | margin-top: 35rpx; |
| 245 | } | 245 | } |
| 246 | .select_classify{ | 246 | .select_classify{ |
| 247 | - background: #d60021; | ||
| 248 | -border-radius: 30rpx; | ||
| 249 | -color: #fff; | 247 | + /* 20200530 update */ |
| 248 | +/* background: #d60021; */ | ||
| 249 | +background:white; | ||
| 250 | +/* border-radius: 30rpx; */ | ||
| 251 | +/* color: #fff; */ | ||
| 252 | +color:black; | ||
| 250 | height: 48rpx; | 253 | height: 48rpx; |
| 251 | line-height: 45rpx; | 254 | line-height: 45rpx; |
| 255 | +font-weight:700; | ||
| 252 | 256 | ||
| 253 | } | 257 | } |
| 254 | .select_classify.width80{ | 258 | .select_classify.width80{ |
| 255 | - width: 74.5%; | 259 | + /* 20200530updata */ |
| 260 | + /* width: 74.5%; */ | ||
| 261 | + width: 100%; | ||
| 262 | + height: 100rpx; | ||
| 263 | + line-height: 100rpx; | ||
| 256 | } | 264 | } |
| 257 | .select_classify.width80.text-indent{ | 265 | .select_classify.width80.text-indent{ |
| 258 | text-indent: 38rpx; | 266 | text-indent: 38rpx; |
pages/goods/goodsInfo/goodsInfo.js
| @@ -752,6 +752,9 @@ Page({ | @@ -752,6 +752,9 @@ Page({ | ||
| 752 | onUnload: function() {}, | 752 | onUnload: function() {}, |
| 753 | onHide: function() { | 753 | onHide: function() { |
| 754 | this.data.is_timer = 0; | 754 | this.data.is_timer = 0; |
| 755 | + for(var i = 1; i < 100; i++) { | ||
| 756 | + clearInterval(i); | ||
| 757 | + } | ||
| 755 | }, | 758 | }, |
| 756 | //----------三个选项按钮----------- | 759 | //----------三个选项按钮----------- |
| 757 | tabClick: function(t) { | 760 | tabClick: function(t) { |
| @@ -3137,7 +3140,7 @@ Page({ | @@ -3137,7 +3140,7 @@ Page({ | ||
| 3137 | var vpath = res.path; | 3140 | var vpath = res.path; |
| 3138 | var context = wx.createCanvasContext('share'); | 3141 | var context = wx.createCanvasContext('share'); |
| 3139 | //先画背景 | 3142 | //先画背景 |
| 3140 | - var pg_path = "../../../images/share/share_bg.png"; | 3143 | + var pg_path = "/pacj/images/share/share_bg.png"; |
| 3141 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | 3144 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); |
| 3142 | //--昵称--- | 3145 | //--昵称--- |
| 3143 | context.setFontSize(24 * unit) | 3146 | context.setFontSize(24 * unit) |
pages/goods/goodsInfo/goodsInfo.wxml
| @@ -824,7 +824,7 @@ | @@ -824,7 +824,7 @@ | ||
| 824 | <view>收藏</view> | 824 | <view>收藏</view> |
| 825 | </view> | 825 | </view> |
| 826 | <view class="shopping-cart cart-ico new_split"> | 826 | <view class="shopping-cart cart-ico new_split"> |
| 827 | - <navigator openType="switchTab" url="/pages/cart/cart/cart"> | 827 | + <navigator url="/pages/cart/cart/cart"> |
| 828 | <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> | 828 | <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> |
| 829 | <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view> | 829 | <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view> |
| 830 | <view>购物车</view> | 830 | <view>购物车</view> |
pages/goods/goodsList/goodsList.wxml
| @@ -127,7 +127,7 @@ | @@ -127,7 +127,7 @@ | ||
| 127 | <view class="no-data" wx:if="{{(!requestData||requestData.length==0) && is_go}}"> | 127 | <view class="no-data" wx:if="{{(!requestData||requestData.length==0) && is_go}}"> |
| 128 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | 128 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 129 | <view class="no-data-title">没有相关的数据</view> | 129 | <view class="no-data-title">没有相关的数据</view> |
| 130 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 130 | + <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 131 | </view> | 131 | </view> |
| 132 | </view> | 132 | </view> |
| 133 | <view hidden="{{!openFilterModal}}"> | 133 | <view hidden="{{!openFilterModal}}"> |
pages/goods/search/search.wxml
| @@ -110,7 +110,7 @@ | @@ -110,7 +110,7 @@ | ||
| 110 | <view class="no-data" wx:if="{{!requestData||requestData.length==0}}"> | 110 | <view class="no-data" wx:if="{{!requestData||requestData.length==0}}"> |
| 111 | <image class="cart-image" src="{{url}}/miniapp/images/cart-null.png"></image> | 111 | <image class="cart-image" src="{{url}}/miniapp/images/cart-null.png"></image> |
| 112 | <view class="no-data-title">没有相关的数据</view> | 112 | <view class="no-data-title">没有相关的数据</view> |
| 113 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 113 | + <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 114 | </view> | 114 | </view> |
| 115 | </view> | 115 | </view> |
| 116 | <view hidden="{{!openFilterModal}}"> | 116 | <view hidden="{{!openFilterModal}}"> |
pages/index/index/index.js
| @@ -15,6 +15,7 @@ var regeneratorRuntime = require('../../../utils/runtime.js'); | @@ -15,6 +15,7 @@ var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
| 15 | var api = require('../../../api/api.js'); | 15 | var api = require('../../../api/api.js'); |
| 16 | var d = getApp().globalData; | 16 | var d = getApp().globalData; |
| 17 | 17 | ||
| 18 | + | ||
| 18 | Page({ | 19 | Page({ |
| 19 | data: { | 20 | data: { |
| 20 | url: o.imghost, | 21 | url: o.imghost, |
| @@ -71,13 +72,12 @@ Page({ | @@ -71,13 +72,12 @@ Page({ | ||
| 71 | new_image: "", //新人有礼弹窗图片 | 72 | new_image: "", //新人有礼弹窗图片 |
| 72 | new_nav: "", //新人页面跳转地址 | 73 | new_nav: "", //新人页面跳转地址 |
| 73 | 74 | ||
| 74 | - w_holiday_pop:0 | 75 | + w_holiday_pop:0, |
| 75 | 76 | ||
| 76 | }, | 77 | }, |
| 77 | 78 | ||
| 78 | onLoad: function() { | 79 | onLoad: function() { |
| 79 | var th = this; | 80 | var th = this; |
| 80 | - | ||
| 81 | //看一下商家是否开通了权益 | 81 | //看一下商家是否开通了权益 |
| 82 | //--初始化是否有打勾-- | 82 | //--初始化是否有打勾-- |
| 83 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { | 83 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { |
| @@ -92,7 +92,7 @@ Page({ | @@ -92,7 +92,7 @@ Page({ | ||
| 92 | }); | 92 | }); |
| 93 | } | 93 | } |
| 94 | }) | 94 | }) |
| 95 | - | 95 | + |
| 96 | 96 | ||
| 97 | }, | 97 | }, |
| 98 | //关闭新用户领取广告 | 98 | //关闭新用户领取广告 |
| @@ -104,42 +104,14 @@ Page({ | @@ -104,42 +104,14 @@ Page({ | ||
| 104 | }, | 104 | }, |
| 105 | 105 | ||
| 106 | async onShow() { | 106 | async onShow() { |
| 107 | - var th = this; | ||
| 108 | - //获取底部导航 | ||
| 109 | - // await getApp().request.promiseGet("/api/weshop/storeFooter/get/"+o.stoid, { | ||
| 110 | - | ||
| 111 | - // }).then(res => { | ||
| 112 | - // var e = res; | ||
| 113 | - // console.log(e) | ||
| 114 | - // if(e.data.code != -1){ | ||
| 115 | - // getApp().globalData.isTabBar = true | ||
| 116 | - // //console.log(JSON.parse(e)) | ||
| 117 | - // var itemList = e.data.data.data; | ||
| 118 | - | ||
| 119 | - // itemList = JSON.parse(itemList) | ||
| 120 | - // for(var i=0; i<itemList.length; i++){ | ||
| 121 | - // itemList[i]['active'] = false | ||
| 122 | - // } | ||
| 123 | - // console.log(itemList) | ||
| 124 | - // getApp().globalData.tabBar.backgroundColor = e.data.data.bkcolor | ||
| 125 | - // getApp().globalData.tabBar.selectedColor = e.data.data.fontcolor_sele | ||
| 126 | - // getApp().globalData.tabBar.color = e.data.data.fontcolor | ||
| 127 | - // getApp().globalData.tabBar.list = itemList | ||
| 128 | - // getApp().globalData.tabBar.iscustom = '1' | ||
| 129 | - // getApp().globalData.tabBar.url = ""; | ||
| 130 | - // wx.hideTabBar({}) | ||
| 131 | - // }else{ | ||
| 132 | - // getApp().globalData.isTabBar = true | ||
| 133 | - // getApp().globalData.tabBar.iscustom = '2' | ||
| 134 | - // getApp().globalData.tabBar.url = th.data.url; | ||
| 135 | - // } | ||
| 136 | - // th.setData({ | ||
| 137 | - // isTabBar: getApp().globalData.isTabBar, | ||
| 138 | - // }); | ||
| 139 | - // }) | ||
| 140 | - // console.log("isTabBar:="+getApp().globalData.isTabBar) | ||
| 141 | - // t.editTabBar(); //显示自定义的底部导航 | ||
| 142 | - | 107 | + |
| 108 | + var th = this | ||
| 109 | + | ||
| 110 | + //调用底部导航 | ||
| 111 | + getApp().globalData.url=th.data.url | ||
| 112 | + t.editTabBar(th,o.stoid,th.data.url); | ||
| 113 | + | ||
| 114 | + | ||
| 143 | if (getApp().globalData.user_id) getApp().requestCardNum(); | 115 | if (getApp().globalData.user_id) getApp().requestCardNum(); |
| 144 | await this.init_load(); | 116 | await this.init_load(); |
| 145 | //显示的时候要开启计时器 | 117 | //显示的时候要开启计时器 |
| @@ -201,13 +173,16 @@ Page({ | @@ -201,13 +173,16 @@ Page({ | ||
| 201 | } | 173 | } |
| 202 | }) | 174 | }) |
| 203 | }, | 175 | }, |
| 204 | - | ||
| 205 | //当隐藏的时候就关闭计时器 | 176 | //当隐藏的时候就关闭计时器 |
| 206 | onHide: function() { | 177 | onHide: function() { |
| 207 | this.data.is_timer = 0; | 178 | this.data.is_timer = 0; |
| 208 | clearInterval(this.data.pt_timer); | 179 | clearInterval(this.data.pt_timer); |
| 209 | clearInterval(this.data.w_holiday_pop); | 180 | clearInterval(this.data.w_holiday_pop); |
| 210 | this.data.w_holiday_pop=0; | 181 | this.data.w_holiday_pop=0; |
| 182 | + for(var i = 1; i < 100; i++) { | ||
| 183 | + clearInterval(i); | ||
| 184 | + } | ||
| 185 | + | ||
| 211 | }, | 186 | }, |
| 212 | 187 | ||
| 213 | //同步初始加载 | 188 | //同步初始加载 |
| @@ -229,6 +204,15 @@ Page({ | @@ -229,6 +204,15 @@ Page({ | ||
| 229 | isTemplate: 1, | 204 | isTemplate: 1, |
| 230 | bgcolor_t: temp_data.bkcolor | 205 | bgcolor_t: temp_data.bkcolor |
| 231 | }); | 206 | }); |
| 207 | + | ||
| 208 | + //---如果有设定顶部的颜色的时候-- | ||
| 209 | + if(temp_data.top_color && temp_data.top_color!='null' ){ | ||
| 210 | + wx.setNavigationBarColor({ | ||
| 211 | + frontColor: '#ffffff', // 必写项 | ||
| 212 | + backgroundColor: temp_data.top_color, // 必写项 | ||
| 213 | + }) | ||
| 214 | + } | ||
| 215 | + | ||
| 232 | } | 216 | } |
| 233 | }) | 217 | }) |
| 234 | 218 |
pages/index/index/index.wxml
| @@ -69,7 +69,7 @@ | @@ -69,7 +69,7 @@ | ||
| 69 | </navigator> | 69 | </navigator> |
| 70 | </view> | 70 | </view> |
| 71 | <view class="venues_item"> | 71 | <view class="venues_item"> |
| 72 | - <navigator openType="switchTab" url="/pages/goods/categoryList/categoryList"> | 72 | + <navigator url="/pages/goods/categoryList/categoryList"> |
| 73 | <image src="{{url}}/miniapp/images/index/fenlei.png"></image> | 73 | <image src="{{url}}/miniapp/images/index/fenlei.png"></image> |
| 74 | <view>全部分类</view> | 74 | <view>全部分类</view> |
| 75 | </navigator> | 75 | </navigator> |
| @@ -246,7 +246,7 @@ | @@ -246,7 +246,7 @@ | ||
| 246 | </view> | 246 | </view> |
| 247 | 247 | ||
| 248 | <!-- 好物推荐 --> | 248 | <!-- 好物推荐 --> |
| 249 | - <view class="title" style="margin-bottom:{{isTabBar == true ? '50px' : '0'}}"> | 249 | + <view class="title" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}};"> |
| 250 | <!-- 标题 --> | 250 | <!-- 标题 --> |
| 251 | <view> | 251 | <view> |
| 252 | <!-- 中文名标题 --> | 252 | <!-- 中文名标题 --> |
| @@ -359,9 +359,9 @@ | @@ -359,9 +359,9 @@ | ||
| 359 | </view> | 359 | </view> |
| 360 | </view> | 360 | </view> |
| 361 | </block> | 361 | </block> |
| 362 | -<!-- <view wx:if="{{isTabBar == true}}"> --> | ||
| 363 | - <!-- <import src="../../tabbar/tabbar.wxml" /> | ||
| 364 | - <template is="tabBar" data="{{tabBar}}" /> --> | ||
| 365 | -<!-- </view> --> | 362 | + |
| 363 | + <import src="../../tabbar/tabbar.wxml" /> | ||
| 364 | + <template is="tabBar" data="{{tabBar}}"/> | ||
| 365 | + | ||
| 366 | 366 | ||
| 367 | 367 |
pages/tabbar/tabbar.js
| 1 | -// pages/tabbar.js | ||
| 2 | -var d = getApp().globalData; | ||
| 3 | -Page({ | ||
| 4 | - | ||
| 5 | - /** | ||
| 6 | - * 页面的初始数据 | ||
| 7 | - */ | ||
| 8 | - data: { | ||
| 9 | - isTabBar:d.isTabBar | ||
| 10 | - }, | ||
| 11 | - | ||
| 12 | - /** | ||
| 13 | - * 生命周期函数--监听页面加载 | ||
| 14 | - */ | ||
| 15 | - onLoad: function (options) { | ||
| 16 | - | ||
| 17 | - }, | ||
| 18 | - | ||
| 19 | - /** | ||
| 20 | - * 生命周期函数--监听页面初次渲染完成 | ||
| 21 | - */ | ||
| 22 | - onReady: function () { | ||
| 23 | - | ||
| 24 | - }, | ||
| 25 | - | ||
| 26 | - /** | ||
| 27 | - * 生命周期函数--监听页面显示 | ||
| 28 | - */ | ||
| 29 | - onShow: function () { | ||
| 30 | - | ||
| 31 | - }, | ||
| 32 | - | ||
| 33 | - /** | ||
| 34 | - * 生命周期函数--监听页面隐藏 | ||
| 35 | - */ | ||
| 36 | - onHide: function () { | ||
| 37 | - | ||
| 38 | - }, | ||
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * 生命周期函数--监听页面卸载 | ||
| 42 | - */ | ||
| 43 | - onUnload: function () { | ||
| 44 | - | ||
| 45 | - }, | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
| 49 | - */ | ||
| 50 | - onPullDownRefresh: function () { | ||
| 51 | - | ||
| 52 | - }, | ||
| 53 | - | ||
| 54 | - /** | ||
| 55 | - * 页面上拉触底事件的处理函数 | ||
| 56 | - */ | ||
| 57 | - onReachBottom: function () { | ||
| 58 | - | ||
| 59 | - }, | ||
| 60 | - | ||
| 61 | - /** | ||
| 62 | - * 用户点击右上角分享 | ||
| 63 | - */ | ||
| 64 | - onShareAppMessage: function () { | ||
| 65 | - | ||
| 66 | - } | ||
| 67 | -}) | ||
| 68 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/tabbar/tabbar.wxml
| 1 | <!--pages/tabbar.wxml--> | 1 | <!--pages/tabbar.wxml--> |
| 2 | - | ||
| 3 | <template name="tabBar"> | 2 | <template name="tabBar"> |
| 4 | - <view class="tab-bar" style="position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}};width:100%;height:50px;z-index:9999999"> | 3 | + <!-- 如果是自定义的话 --> |
| 4 | + <view hidden="{{tabBar.iscustom=='2'}}" class="tab-bar" style="width:100%;height:{{tabBar.isIpx ? '168rpx' : '100rpx'}};position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; bottom: 0;z-index:9999999;padding:2px 0;"> | ||
| 5 | <block wx:for="{{tabBar.list}}" wx:key="weappurl"> | 5 | <block wx:for="{{tabBar.list}}" wx:key="weappurl"> |
| 6 | - <navigator url="{{item.weappurl}}" bindtap="goto({{item.weappurl}})" class="tabbar_item {{item.clas}}" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}};position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 7 | - <view style="width:50%;height:50%;margin-left:25%;"><image src="{{tabBar.url}}{{item.src_sele}}" wx:if="{{item.active&&item.src_sele}}" class="img" style="width:100%;height:100%"></image> | ||
| 8 | - <image src="{{tabBar.url}}{{item.src}}" wx:if="{{!item.active&&item.src}}" class="img" style="width:100%;height:100%"></image></view> | ||
| 9 | - <view style="width:100%;height:100%;"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.8rem">{{item.nav_name}}</text></view> | ||
| 10 | - </navigator> | 6 | + |
| 7 | + <block wx:if="{{!item.active}}"> | ||
| 8 | + <navigator url="{{item.weappurl}}" open-type="redirect" class="tabbar_item {{item.clas}}" style="position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 9 | + <view wx:if="{{item.nav_name=='购物车'}}" style="background-color: red;color: #fff;font-size: 20rpx;border-radius: 40rpx;width: 50rpx;height: 30rpx;padding: 5rpx;position: absolute;z-index: 100;right: 0"> | ||
| 10 | + {{tabBar.cartGoodsNum}} | ||
| 11 | + </view> | ||
| 12 | + <view style="width:35%;height:30px;margin-left:33%;"> | ||
| 13 | + <image src="{{item.src}}" wx:if="{{!item.active}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image> | ||
| 14 | + </view> | ||
| 15 | + <view style="height:20px;line-height:15px; position: relative; top: -15rpx"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.6rem">{{item.nav_name}}</text></view> | ||
| 16 | + </navigator> | ||
| 17 | + </block> | ||
| 18 | + <block wx:else> | ||
| 19 | + <view class="tabbar_item {{item.clas}}" style="color: {{item.selectedColor? item.selectedColor :tabBar.selectedColor}};position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 20 | + <view wx:if="{{item.nav_name=='购物车'}}" style="background-color: red;color: #fff;font-size: 20rpx;border-radius: 40rpx;width: 50rpx;height: 30rpx;padding: 5rpx;position: absolute;z-index: 100;right:0"> | ||
| 21 | + {{tabBar.cartGoodsNum}} | ||
| 22 | + </view> | ||
| 23 | + <view style="width:35%;height:30px;margin-left:33%;"> | ||
| 24 | + <block wx:if="{{item.active}}"> | ||
| 25 | + <image src="{{item.src_sele}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image> | ||
| 26 | + </block> | ||
| 27 | + <block wx:else> | ||
| 28 | + <navigator url="{{item.weappurl}}"> | ||
| 29 | + <image src="{{item.src}}" wx:if="{{!item.active}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image> | ||
| 30 | + </navigator> | ||
| 31 | + </block> | ||
| 32 | + </view> | ||
| 33 | + <view style="height:20px;line-height:15px; position: relative; top: -15rpx"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.6rem">{{item.nav_name}}</text></view> | ||
| 34 | + </view> | ||
| 35 | + </block> | ||
| 36 | + | ||
| 11 | </block> | 37 | </block> |
| 12 | </view> | 38 | </view> |
| 39 | + | ||
| 40 | + | ||
| 41 | + <!-- 如果是默认的话 --> | ||
| 42 | + <view hidden="{{tabBar.iscustom=='1'}}" class="tab-bar" style="width:100%;height:{{tabBar.isIpx ? '168rpx' : '100rpx'}};position:fixed;color:#6e6d6b; background:#ffffff; bottom: 0;z-index:9999999;padding:2px 0;"> | ||
| 43 | + <!-- 1 --> | ||
| 44 | + <block wx:if="{{tabBar.active!='/pages/index/index/index'}}"> | ||
| 45 | + <navigator url="/pages/index/index/index" class="tabbar_item {{item.clas}}" open-type="redirect" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 46 | + <view style="width:30%;height:57rpx;margin-left:35%;"> | ||
| 47 | + <image src="{{tabBar.url}}/miniapp/images/bar/index.png" class="img" style="width:100%;height:100%"></image> | ||
| 48 | + </view> | ||
| 49 | + <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view> | ||
| 50 | + </navigator> | ||
| 51 | + </block> | ||
| 52 | + <block wx:else> | ||
| 53 | + <view class="tabbar_item {{item.clas}}" style="color:#f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 54 | + <view style="width:30%;height:57rpx;margin-left:35%;"> | ||
| 55 | + <image src="{{tabBar.url}}/miniapp/images/bar/index_on.png" class="img" style="width:100%;height:100%"></image> | ||
| 56 | + </view> | ||
| 57 | + <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view> | ||
| 58 | + </view> | ||
| 59 | + </block> | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + <!-- 2 --> | ||
| 63 | + <block wx:if="{{tabBar.active!='/pages/goods/categoryList/categoryList'}}"> | ||
| 64 | + <navigator url="/pages/goods/categoryList/categoryList" class="tabbar_item {{tabBar.clas}}" open-type="redirect" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 65 | + <view style="width:30%;height:57rpx;margin-left:35%;"> | ||
| 66 | + <image src="{{tabBar.url}}/miniapp/images/bar/fl.png" class="img" style="width:100%;height:100%"></image> | ||
| 67 | + </view> | ||
| 68 | + <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" wx:if="分类" style="font-size:0.6rem">分类</text></view> | ||
| 69 | + </navigator> | ||
| 70 | + </block> | ||
| 71 | + <block wx:else> | ||
| 72 | + <view class="tabbar_item {{tabBar.clas}}" style="color:#f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 73 | + <view style="width:30%;height:57rpx;margin-left:35%;"> | ||
| 74 | + <image src="{{tabBar.url}}/miniapp/images/bar/fl_on.png" class="img" style="width:100%;height:100%"></image> | ||
| 75 | + </view> | ||
| 76 | + <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" wx:if="分类" style="font-size:0.6rem">分类</text></view> | ||
| 77 | + </view> | ||
| 78 | + </block> | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + <!-- 3 --> | ||
| 82 | + <block wx:if="{{tabBar.active!='/pages/cart/cart/cart'}}"> | ||
| 83 | + <navigator url="/pages/cart/cart/cart" open-type="redirect" class="tabbar_item {{tabBar.clas}}" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 84 | + <view style="background-color: red;color: #fff;font-size: 20rpx;border-radius: 40rpx;width: 50rpx;height: 30rpx;padding: 5rpx;position: fixed;z-index: 100;left:63%"> | ||
| 85 | + {{tabBar.cartGoodsNum}} | ||
| 86 | + </view><view style="width:30%;height:57rpx;margin-left:35%;"> | ||
| 87 | + <image src="{{tabBar.url}}/miniapp/images/bar/car.png" class="img" style="width:100%;height:100%"></image> | ||
| 88 | + </view> | ||
| 89 | + <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view> | ||
| 90 | + </navigator> | ||
| 91 | + </block> | ||
| 92 | + <block wx:else> | ||
| 93 | + <view class="tabbar_item {{tabBar.clas}}" style="color: #f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 94 | + <view style="background-color: red;color: #fff;font-size: 20rpx;border-radius: 40rpx;width: 50rpx;height: 30rpx;padding: 5rpx;position: fixed;z-index: 100;left:63%"> | ||
| 95 | + {{tabBar.cartGoodsNum}} | ||
| 96 | + </view><view style="width:30%;height:57rpx;margin-left:35%;"> | ||
| 97 | + <image src="{{tabBar.url}}/miniapp/images/bar/car_on.png" class="img" style="width:100%;height:100%"></image> | ||
| 98 | + </view> | ||
| 99 | + <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view> | ||
| 100 | + </view> | ||
| 101 | + </block> | ||
| 102 | + | ||
| 103 | + <!-- 4 --> | ||
| 104 | + <block wx:if="{{tabBar.active!='/pages/user/index/index'}}"> | ||
| 105 | + <navigator url="/pages/user/index/index" open-type="redirect" class="tabbar_item {{tabBar.clas}}" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 106 | + <view style="width:30%;height:57rpx;margin-left:35%;"> | ||
| 107 | + <image src="{{tabBar.url}}/miniapp/images/bar/user.png" class="img" style="width:100%;height:100%"></image> | ||
| 108 | + </view> | ||
| 109 | + <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view> | ||
| 110 | + </navigator> | ||
| 111 | + </block> | ||
| 112 | + <block wx:else> | ||
| 113 | + <view class="tabbar_item {{tabBar.clas}}" style="color: #f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | ||
| 114 | + <view style="width:30%;height:57rpx;margin-left:35%;"> | ||
| 115 | + <image src="{{tabBar.url}}/miniapp/images/bar/user_on.png" class="img" style="width:100%;height:100%"></image> | ||
| 116 | + </view> | ||
| 117 | + <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view> | ||
| 118 | + </view> | ||
| 119 | + </block> | ||
| 120 | + | ||
| 121 | + </view> | ||
| 13 | </template> | 122 | </template> |
pages/tabbar/tabbar.wxss
pages/team/team_show/team_show.js
| @@ -523,7 +523,7 @@ Page({ | @@ -523,7 +523,7 @@ Page({ | ||
| 523 | if(getCurrentPages()>1) | 523 | if(getCurrentPages()>1) |
| 524 | wx.navigateBack({delta: 1}) | 524 | wx.navigateBack({delta: 1}) |
| 525 | else | 525 | else |
| 526 | - wx.switchTab({ | 526 | + wx.navigateTo({ |
| 527 | url: "/pages/index/index/index" | 527 | url: "/pages/index/index/index" |
| 528 | }); | 528 | }); |
| 529 | }, | 529 | }, |
pages/template/index.js
| @@ -51,6 +51,15 @@ Page({ | @@ -51,6 +51,15 @@ Page({ | ||
| 51 | isTemplate: 1, | 51 | isTemplate: 1, |
| 52 | bgcolor_t: temp_data.bkcolor | 52 | bgcolor_t: temp_data.bkcolor |
| 53 | }); | 53 | }); |
| 54 | + | ||
| 55 | + //---如果有设定顶部的颜色的时候-- | ||
| 56 | + if(temp_data.top_color && temp_data.top_color!='null' ){ | ||
| 57 | + wx.setNavigationBarColor({ | ||
| 58 | + frontColor: '#ffffff', // 必写项 | ||
| 59 | + backgroundColor: temp_data.top_color, // 必写项 | ||
| 60 | + }) | ||
| 61 | + } | ||
| 62 | + | ||
| 54 | } | 63 | } |
| 55 | }) | 64 | }) |
| 56 | 65 |
pages/user/binding_info/binding_info.js
| @@ -139,7 +139,7 @@ Page({ | @@ -139,7 +139,7 @@ Page({ | ||
| 139 | "function" == typeof cb && cb(e.globalData.userInfo, e.globalData.wechatUser); | 139 | "function" == typeof cb && cb(e.globalData.userInfo, e.globalData.wechatUser); |
| 140 | e.showWarning("绑定成功"); | 140 | e.showWarning("绑定成功"); |
| 141 | setTimeout(function(){ | 141 | setTimeout(function(){ |
| 142 | - wx.switchTab({ | 142 | + wx.navigateTo({ |
| 143 | url: '/pages/user/index/index', | 143 | url: '/pages/user/index/index', |
| 144 | }) | 144 | }) |
| 145 | },1000); | 145 | },1000); |
pages/user/collect_list/collect_list.js
pages/user/comment/comment.js
pages/user/coupon/coupon.wxml
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | </view> | 16 | </view> |
| 17 | <view class="coupon-body"> | 17 | <view class="coupon-body"> |
| 18 | <view class="line">{{storeName}}</view> | 18 | <view class="line">{{storeName}}</view> |
| 19 | - <navigator class="use-btn {{typeId!=0?'btn-disable':''}}" openType="switchTab" url="{{typeId==0?'/pages/index/index/index':''}}">{{typeId==1?'已使用':typeId==2?'已过期':'立即使用'}}</navigator> | 19 | + <navigator class="use-btn {{typeId!=0?'btn-disable':''}}" url="{{typeId==0?'/pages/index/index/index':''}}">{{typeId==1?'已使用':typeId==2?'已过期':'立即使用'}}</navigator> |
| 20 | </view> | 20 | </view> |
| 21 | <view class="use-end">限{{item.deadTimeFommat}}前使用</view> | 21 | <view class="use-end">限{{item.deadTimeFommat}}前使用</view> |
| 22 | </view> | 22 | </view> |
| @@ -24,6 +24,6 @@ | @@ -24,6 +24,6 @@ | ||
| 24 | <view class="no-data" wx:if="{{!coupons||coupons.length==0}}"> | 24 | <view class="no-data" wx:if="{{!coupons||coupons.length==0}}"> |
| 25 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | 25 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 26 | <view class="no-data-title">没有找到相关的数据</view> | 26 | <view class="no-data-title">没有找到相关的数据</view> |
| 27 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 27 | + <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 28 | </view> | 28 | </view> |
| 29 | </view> | 29 | </view> |
pages/user/deposit/prepaid/msg/msg.js
pages/user/get_user_info/get_user_info.wxml
| @@ -2,5 +2,5 @@ | @@ -2,5 +2,5 @@ | ||
| 2 | <image class="cart-image"></image> | 2 | <image class="cart-image"></image> |
| 3 | <view class="no-data-title">请先登录, 以便操作更多功能</view> | 3 | <view class="no-data-title">请先登录, 以便操作更多功能</view> |
| 4 | <button bindgetuserinfo="bindGetUserinfo" class="getuse_info" openType="getUserInfo">获取用户信息</button> | 4 | <button bindgetuserinfo="bindGetUserinfo" class="getuse_info" openType="getUserInfo">获取用户信息</button> |
| 5 | - <navigator class="similer" openType="switchTab" url="/pages/index/index/index">返回首页</navigator> | 5 | + <navigator class="similer" url="/pages/index/index/index">返回首页</navigator> |
| 6 | </view> | 6 | </view> |
pages/user/index/index.js
| @@ -41,7 +41,6 @@ Page({ | @@ -41,7 +41,6 @@ Page({ | ||
| 41 | actImg: "", | 41 | actImg: "", |
| 42 | is_assistance: 0, //助力活动 | 42 | is_assistance: 0, //助力活动 |
| 43 | ad_img:"", | 43 | ad_img:"", |
| 44 | - isshow_vip:0, | ||
| 45 | }, | 44 | }, |
| 46 | goto_nav: function(e) { | 45 | goto_nav: function(e) { |
| 47 | var th = this; | 46 | var th = this; |
| @@ -79,19 +78,14 @@ Page({ | @@ -79,19 +78,14 @@ Page({ | ||
| 79 | onShow: function() { | 78 | onShow: function() { |
| 80 | 79 | ||
| 81 | this.is_assistance(); | 80 | this.is_assistance(); |
| 82 | - this.getPlusCardType(); | ||
| 83 | - | ||
| 84 | - | ||
| 85 | var stoid = app_d.setting.stoid; | 81 | var stoid = app_d.setting.stoid; |
| 86 | var s = this, | 82 | var s = this, |
| 87 | th = s, | 83 | th = s, |
| 88 | need_money = 0, | 84 | need_money = 0, |
| 89 | cur_g_num = 0; | 85 | cur_g_num = 0; |
| 90 | - th.setData({ | ||
| 91 | - isTabBar: getApp().globalData.isTabBar, | ||
| 92 | - }); | ||
| 93 | 86 | ||
| 94 | - app.editTabBar(); //显示自定义的底部导航 | 87 | + //调用底部导航 |
| 88 | + getApp().editTabBar(th,getApp().globalData.setting.stoid,getApp().globalData.url); | ||
| 95 | getApp().get_isbuy(th.setappdata); | 89 | getApp().get_isbuy(th.setappdata); |
| 96 | if (getApp().globalData.user_id) getApp().requestCardNum(); | 90 | if (getApp().globalData.user_id) getApp().requestCardNum(); |
| 97 | /*------会员登录------*/ | 91 | /*------会员登录------*/ |
| @@ -329,7 +323,11 @@ Page({ | @@ -329,7 +323,11 @@ Page({ | ||
| 329 | /** | 323 | /** |
| 330 | * 生命周期函数--监听页面隐藏 | 324 | * 生命周期函数--监听页面隐藏 |
| 331 | */ | 325 | */ |
| 332 | - onHide: function() {}, | 326 | + onHide: function() { |
| 327 | + for(var i = 1; i < 100; i++) { | ||
| 328 | + clearInterval(i); | ||
| 329 | + } | ||
| 330 | + }, | ||
| 333 | setappdata: function(t) { | 331 | setappdata: function(t) { |
| 334 | if (t.isout == 1) | 332 | if (t.isout == 1) |
| 335 | wx.navigateTo({ | 333 | wx.navigateTo({ |
| @@ -361,7 +359,11 @@ Page({ | @@ -361,7 +359,11 @@ Page({ | ||
| 361 | //------卡片的显示和关闭-------- | 359 | //------卡片的显示和关闭-------- |
| 362 | show_tc: function() { | 360 | show_tc: function() { |
| 363 | if (!this.data.userInfo) return false; | 361 | if (!this.data.userInfo) return false; |
| 364 | - qrcode('qrcode', this.data.userInfo.mobile, 480, 480, this); | 362 | + //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') |
| 363 | + var val= this.data.userInfo.mobile+"|"+ut.formatTime(); | ||
| 364 | + val=ut.base64_encode(val); | ||
| 365 | + | ||
| 366 | + qrcode('qrcode', val, 480, 480, this); | ||
| 365 | this.setData({ | 367 | this.setData({ |
| 366 | tc_hide: false, | 368 | tc_hide: false, |
| 367 | }); | 369 | }); |
| @@ -634,23 +636,9 @@ Page({ | @@ -634,23 +636,9 @@ Page({ | ||
| 634 | 636 | ||
| 635 | } | 637 | } |
| 636 | }) | 638 | }) |
| 637 | - }, | ||
| 638 | - | ||
| 639 | - //--- 获取卡类列表 --- | ||
| 640 | - getPlusCardType: function () { | ||
| 641 | - var storid = os.stoid; | ||
| 642 | - var th = this; | ||
| 643 | - var isshow_vip=0; | ||
| 644 | - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | ||
| 645 | - if(res.data.code==0){ | ||
| 646 | - for(var i in res.data.data){ | ||
| 647 | - var item=res.data.data[i]; | ||
| 648 | - //IsStopBuy 如果是真的话,代表这个卡没有停用 | ||
| 649 | - if(item.IsStopBuy!=true){ isshow_vip=1;break; } | ||
| 650 | - } | ||
| 651 | - th.setData({isshow_vip:isshow_vip}) | ||
| 652 | - } | ||
| 653 | - }) | ||
| 654 | } | 639 | } |
| 655 | 640 | ||
| 641 | + | ||
| 642 | + | ||
| 643 | + | ||
| 656 | }) | 644 | }) |
pages/user/index/index.wxml
| 1 | -<view class="xc-page" style="margin-bottom:{{isTabBar == true ? '50px' : '0'}}"> | 1 | +<view class="xc-page" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}}"> |
| 2 | <view class="xc-user"> | 2 | <view class="xc-user"> |
| 3 | <view class="xc-head rel"> | 3 | <view class="xc-head rel"> |
| 4 | <image class="xc-background" src="{{iurl}}{{ad_img?ad_img:'/miniapp/images/user_index_powder.jpg'}}"> | 4 | <image class="xc-background" src="{{iurl}}{{ad_img?ad_img:'/miniapp/images/user_index_powder.jpg'}}"> |
| @@ -63,9 +63,6 @@ | @@ -63,9 +63,6 @@ | ||
| 63 | </image> | 63 | </image> |
| 64 | 64 | ||
| 65 | </view> | 65 | </view> |
| 66 | - | ||
| 67 | - <block wx:if="{{isshow_vip}}"> | ||
| 68 | - | ||
| 69 | <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==2}}"> | 66 | <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==2}}"> |
| 70 | <view class="xc-add-member flex-center-around "> | 67 | <view class="xc-add-member flex-center-around "> |
| 71 | <view class="flex jc-center ai-center"> | 68 | <view class="flex jc-center ai-center"> |
| @@ -89,7 +86,6 @@ | @@ -89,7 +86,6 @@ | ||
| 89 | </view> | 86 | </view> |
| 90 | </view> | 87 | </view> |
| 91 | </view> | 88 | </view> |
| 92 | - </block> | ||
| 93 | 89 | ||
| 94 | </view> | 90 | </view> |
| 95 | <view class="xc-after-sale rel"> | 91 | <view class="xc-after-sale rel"> |
| @@ -301,7 +297,5 @@ | @@ -301,7 +297,5 @@ | ||
| 301 | </view> | 297 | </view> |
| 302 | 298 | ||
| 303 | <pop_txt id="pop_txt"></pop_txt> | 299 | <pop_txt id="pop_txt"></pop_txt> |
| 304 | -<!-- <view wx:if="{{isTabBar == true}}"> | ||
| 305 | <import src="../../tabbar/tabbar.wxml" /> | 300 | <import src="../../tabbar/tabbar.wxml" /> |
| 306 | - <template is="tabBar" data="{{tabBar}}" /> | ||
| 307 | -</view> --> | ||
| 308 | \ No newline at end of file | 301 | \ No newline at end of file |
| 302 | + <template is="tabBar" data="{{tabBar}}" /> | ||
| 309 | \ No newline at end of file | 303 | \ No newline at end of file |
pages/user/integral/msg/msg.js
pages/user/member/bring/msg/msg.js
pages/user/my_service/tment_details.js
| @@ -117,7 +117,7 @@ Page({ | @@ -117,7 +117,7 @@ Page({ | ||
| 117 | //跳到首页 | 117 | //跳到首页 |
| 118 | goto: function(e) { | 118 | goto: function(e) { |
| 119 | var th = this; | 119 | var th = this; |
| 120 | - wx.switchTab({ | 120 | + wx.navigateTo({ |
| 121 | url: '/pages/index/index/index', | 121 | url: '/pages/index/index/index', |
| 122 | }) | 122 | }) |
| 123 | }, | 123 | }, |
pages/user/order_list/order_list.js
| @@ -501,6 +501,7 @@ Page({ | @@ -501,6 +501,7 @@ Page({ | ||
| 501 | if (good.goods_price != gg.shop_price) isok = 0; | 501 | if (good.goods_price != gg.shop_price) isok = 0; |
| 502 | 502 | ||
| 503 | } | 503 | } |
| 504 | + var is_h=0; | ||
| 504 | if (!isok) { | 505 | if (!isok) { |
| 505 | wx.showModal({ | 506 | wx.showModal({ |
| 506 | title: '提示', | 507 | title: '提示', |
| @@ -728,7 +729,7 @@ Page({ | @@ -728,7 +729,7 @@ Page({ | ||
| 728 | }, | 729 | }, |
| 729 | //跳到首页 | 730 | //跳到首页 |
| 730 | goto: function(e) { | 731 | goto: function(e) { |
| 731 | - wx.switchTab({ | 732 | + wx.navigateTo({ |
| 732 | url: '/pages/index/index/index', | 733 | url: '/pages/index/index/index', |
| 733 | }) | 734 | }) |
| 734 | }, | 735 | }, |
pages/user/return_goods_list/return_goods_list.wxml
| @@ -24,6 +24,6 @@ | @@ -24,6 +24,6 @@ | ||
| 24 | <view class="no-data" wx:if="{{!list||list.length==0}}"> | 24 | <view class="no-data" wx:if="{{!list||list.length==0}}"> |
| 25 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | 25 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 26 | <view class="no-data-title">没有找到相关的记录</view> | 26 | <view class="no-data-title">没有找到相关的记录</view> |
| 27 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 27 | + <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 28 | </view> | 28 | </view> |
| 29 | </view> | 29 | </view> |
utils/auth.js
| @@ -282,7 +282,7 @@ module.exports = { | @@ -282,7 +282,7 @@ module.exports = { | ||
| 282 | }, null, !0); | 282 | }, null, !0); |
| 283 | }, | 283 | }, |
| 284 | goHome: function() { | 284 | goHome: function() { |
| 285 | - wx.switchTab({ | 285 | + wx.navigateTo({ |
| 286 | url: "/pages/index/index/index" | 286 | url: "/pages/index/index/index" |
| 287 | }); | 287 | }); |
| 288 | }, | 288 | }, |
utils/request.js
| @@ -69,9 +69,9 @@ module.exports = { | @@ -69,9 +69,9 @@ module.exports = { | ||
| 69 | var i = getApp(); | 69 | var i = getApp(); |
| 70 | return i.auth.clearAuth(), i.showWarning("正在重新登录", function() { | 70 | return i.auth.clearAuth(), i.showWarning("正在重新登录", function() { |
| 71 | var t = getCurrentPages(); | 71 | var t = getCurrentPages(); |
| 72 | - "pages/user/index/index" != t[t.length - 1].route ? wx.switchTab({ | 72 | + "pages/user/index/index" != t[t.length - 1].route ? wx.navigateTo({ |
| 73 | url: "/pages/user/index/index" | 73 | url: "/pages/user/index/index" |
| 74 | - }) : wx.switchTab({ | 74 | + }) : wx.navigateTo({ |
| 75 | url: "/pages/index/index/index" | 75 | url: "/pages/index/index/index" |
| 76 | }); | 76 | }); |
| 77 | }, null, !0), !1; | 77 | }, null, !0), !1; |
utils/util.js
| @@ -371,7 +371,35 @@ function isContained(aa, bb) { | @@ -371,7 +371,35 @@ function isContained(aa, bb) { | ||
| 371 | return true; | 371 | return true; |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | - | 374 | +//---base64位编码--- |
| 375 | +function base64_encode (str) { // 编码,配合encodeURIComponent使用 | ||
| 376 | + var c1, c2, c3; | ||
| 377 | + var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | ||
| 378 | + var i = 0, len = str.length, strin = ''; | ||
| 379 | + while (i < len) { | ||
| 380 | + c1 = str.charCodeAt(i++) & 0xff; | ||
| 381 | + if (i == len) { | ||
| 382 | + strin += base64EncodeChars.charAt(c1 >> 2); | ||
| 383 | + strin += base64EncodeChars.charAt((c1 & 0x3) << 4); | ||
| 384 | + strin += "=="; | ||
| 385 | + break; | ||
| 386 | + } | ||
| 387 | + c2 = str.charCodeAt(i++); | ||
| 388 | + if (i == len) { | ||
| 389 | + strin += base64EncodeChars.charAt(c1 >> 2); | ||
| 390 | + strin += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4)); | ||
| 391 | + strin += base64EncodeChars.charAt((c2 & 0xF) << 2); | ||
| 392 | + strin += "="; | ||
| 393 | + break; | ||
| 394 | + } | ||
| 395 | + c3 = str.charCodeAt(i++); | ||
| 396 | + strin += base64EncodeChars.charAt(c1 >> 2); | ||
| 397 | + strin += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4)); | ||
| 398 | + strin += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6)); | ||
| 399 | + strin += base64EncodeChars.charAt(c3 & 0x3F) | ||
| 400 | + } | ||
| 401 | + return strin | ||
| 402 | +} | ||
| 375 | 403 | ||
| 376 | module.exports = { | 404 | module.exports = { |
| 377 | formatTime: function(e, r) { | 405 | formatTime: function(e, r) { |
| @@ -477,4 +505,5 @@ module.exports = { | @@ -477,4 +505,5 @@ module.exports = { | ||
| 477 | draw_circle:draw_circle,//绘制圆, | 505 | draw_circle:draw_circle,//绘制圆, |
| 478 | mergeArray:mergeArray, //数组合并 | 506 | mergeArray:mergeArray, //数组合并 |
| 479 | isContained:isContained, //是否包含 | 507 | isContained:isContained, //是否包含 |
| 508 | + base64_encode:base64_encode //64位加密 | ||
| 480 | }; | 509 | }; |