Commit 6da2f40e6adbf4bb3220354e944ce71503586be4
1 parent
80b6a543
app的图片修改
Showing
1 changed file
with
33 additions
and
38 deletions
app.js
| @@ -72,6 +72,8 @@ App({ | @@ -72,6 +72,8 @@ App({ | ||
| 72 | }, | 72 | }, |
| 73 | }) | 73 | }) |
| 74 | } | 74 | } |
| 75 | + | ||
| 76 | + | ||
| 75 | }, | 77 | }, |
| 76 | set_custom_nav(data,isIpx,pagePath,url,curPage){ | 78 | set_custom_nav(data,isIpx,pagePath,url,curPage){ |
| 77 | //缓存住,下次就不调用接口了 | 79 | //缓存住,下次就不调用接口了 |
| @@ -135,6 +137,7 @@ App({ | @@ -135,6 +137,7 @@ App({ | ||
| 135 | guide_id:null, //分享导购ID | 137 | guide_id:null, //分享导购ID |
| 136 | 138 | ||
| 137 | windowWidth:0, //整个窗体的宽度 | 139 | windowWidth:0, //整个窗体的宽度 |
| 140 | + | ||
| 138 | }, | 141 | }, |
| 139 | auth: o, | 142 | auth: o, |
| 140 | request: a, | 143 | request: a, |
| @@ -168,32 +171,6 @@ App({ | @@ -168,32 +171,6 @@ App({ | ||
| 168 | } | 171 | } |
| 169 | }, | 172 | }, |
| 170 | }) | 173 | }) |
| 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 | 174 | ||
| 198 | }, | 175 | }, |
| 199 | 176 | ||
| @@ -346,7 +323,7 @@ App({ | @@ -346,7 +323,7 @@ App({ | ||
| 346 | title: t, | 323 | title: t, |
| 347 | mask: e, | 324 | mask: e, |
| 348 | duration: a, | 325 | duration: a, |
| 349 | - image:"/images/gt.png", | 326 | + image:"/packageA/images/gt.png", |
| 350 | complete: function() { | 327 | complete: function() { |
| 351 | "function" == typeof o && setTimeout(o, a); | 328 | "function" == typeof o && setTimeout(o, a); |
| 352 | } | 329 | } |
| @@ -421,7 +398,10 @@ App({ | @@ -421,7 +398,10 @@ App({ | ||
| 421 | 398 | ||
| 422 | //----智能跳转,判断 非tabBar,tabBar页面的跳转---- | 399 | //----智能跳转,判断 非tabBar,tabBar页面的跳转---- |
| 423 | goto:function (url) { | 400 | goto:function (url) { |
| 424 | - | 401 | + var arr=getCurrentPages(); |
| 402 | + if(arr.length>8){ | ||
| 403 | + arr.splice(0, 2); | ||
| 404 | + } | ||
| 425 | var arr_tabbar=["/pages/index/index/index","/pages/goods/categoryList/categoryList", | 405 | var arr_tabbar=["/pages/index/index/index","/pages/goods/categoryList/categoryList", |
| 426 | "/pages/goods/categoryList/categoryList?type=2", | 406 | "/pages/goods/categoryList/categoryList?type=2", |
| 427 | "/pages/goods/categoryList/categoryList?type=1", | 407 | "/pages/goods/categoryList/categoryList?type=1", |
| @@ -429,10 +409,18 @@ App({ | @@ -429,10 +409,18 @@ App({ | ||
| 429 | if(arr_tabbar.indexOf(url)!=-1){ | 409 | if(arr_tabbar.indexOf(url)!=-1){ |
| 430 | if(url.indexOf("categoryList?type=1")!=-1) this.globalData.cat_type=1; | 410 | if(url.indexOf("categoryList?type=1")!=-1) this.globalData.cat_type=1; |
| 431 | if(url.indexOf("categoryList?type=2")!=-1) this.globalData.cat_type=2; | 411 | if(url.indexOf("categoryList?type=2")!=-1) this.globalData.cat_type=2; |
| 432 | - wx.navigateTo({ url: url, }) //跳到tabbar页 | 412 | + if (getCurrentPages().length > 9) { |
| 413 | + wx.redirectTo({url: url,}) //跳到tabbar页 | ||
| 414 | + }else{ | ||
| 415 | + wx.navigateTo({url: url,}) //跳到tabbar页 | ||
| 416 | + } | ||
| 433 | 417 | ||
| 434 | }else{ | 418 | }else{ |
| 435 | - wx.navigateTo({ url: url, }) //跳到非tabbar页 | 419 | + if (getCurrentPages().length > 9) { |
| 420 | + wx.redirectTo({url: url,}) //跳到非tabbar页 | ||
| 421 | + }else{ | ||
| 422 | + wx.navigateTo({url: url,}) //跳到tabbar页 | ||
| 423 | + } | ||
| 436 | } | 424 | } |
| 437 | //wx.navigateTo({ url: url, }) //跳到非tabbar页 | 425 | //wx.navigateTo({ url: url, }) //跳到非tabbar页 |
| 438 | }, | 426 | }, |
| @@ -511,24 +499,30 @@ App({ | @@ -511,24 +499,30 @@ App({ | ||
| 511 | }, | 499 | }, |
| 512 | 500 | ||
| 513 | //-------获取购物车数量---------- | 501 | //-------获取购物车数量---------- |
| 514 | - requestCardNum: function() { | ||
| 515 | - var th = this; | ||
| 516 | - th.request.get("/api/weshop/cart/page", { | 502 | + requestCardNum: function(th) { |
| 503 | + if(!this.globalData.user_id) return false; | ||
| 504 | + this.request.get("/api/weshop/cart/page", { | ||
| 517 | data: { | 505 | data: { |
| 518 | - store_id: th.globalData.setting.stoid, | ||
| 519 | - user_id: th.globalData.user_id, | 506 | + store_id: this.globalData.setting.stoid, |
| 507 | + user_id: this.globalData.user_id, | ||
| 520 | state:0, | 508 | state:0, |
| 521 | is_gift:0 | 509 | is_gift:0 |
| 522 | }, | 510 | }, |
| 523 | success: function(e) { | 511 | success: function(e) { |
| 524 | var num = 0; | 512 | var num = 0; |
| 525 | - for (var i = 0; i < e.data.data.pageData.length; i++) { | ||
| 526 | - num += e.data.data.pageData[i].goods_num; | 513 | + if(e.data.data && e.data.data.pageData) { |
| 514 | + for (var i = 0; i < e.data.data.pageData.length; i++) { | ||
| 515 | + num += e.data.data.pageData[i].goods_num; | ||
| 516 | + } | ||
| 527 | } | 517 | } |
| 518 | + | ||
| 519 | + | ||
| 520 | + /*--- | ||
| 528 | wx.setTabBarBadge({ //tabbar右上角添加文本 | 521 | wx.setTabBarBadge({ //tabbar右上角添加文本 |
| 529 | index: 2, ////tabbar下标 | 522 | index: 2, ////tabbar下标 |
| 530 | text: '' + num //显示的内容 | 523 | text: '' + num //显示的内容 |
| 531 | - }); | 524 | + });--*/ |
| 525 | + th.setData({['tabBar.cartGoodsNum']:num}); | ||
| 532 | } | 526 | } |
| 533 | }); | 527 | }); |
| 534 | }, | 528 | }, |
| @@ -571,6 +565,7 @@ App({ | @@ -571,6 +565,7 @@ App({ | ||
| 571 | this.globalData.is_test=0; | 565 | this.globalData.is_test=0; |
| 572 | this.globalData.guide_id=null; //导购清空 | 566 | this.globalData.guide_id=null; //导购清空 |
| 573 | this.globalData.first_leader=null; //分享的会员清空 | 567 | this.globalData.first_leader=null; //分享的会员清空 |
| 568 | + th.globalData.wuliu=null; //关闭要把物流清空 | ||
| 574 | } | 569 | } |
| 575 | 570 | ||
| 576 | 571 |