Commit 6805b7ef163f4930fcac8b7340e44c068c971384
1 parent
7aad9a9a
1. 首页点击商品,返回的时候要到原来固定位置的bug修复
2. 默认情况下,顶部搜索框的优化 3. 推荐列表,商品分组的组件在游客登陆后,要能够正确的显示商品的价格
Showing
6 changed files
with
43 additions
and
67 deletions
components/diy_goodsGroup/diy_goodsGroup.js
| ... | ... | @@ -83,39 +83,10 @@ Component({ |
| 83 | 83 | }, |
| 84 | 84 | |
| 85 | 85 | pageLifetimes: { |
| 86 | + //游客登陆后,只要更新卡的情况 | |
| 86 | 87 | show: function () { |
| 87 | - this.data.firist_type_curr=0, | |
| 88 | - this.data.currentPage=1, | |
| 89 | - this.setData({ goods_array: null}) | |
| 90 | - | |
| 91 | - // 页面被展示 | |
| 92 | - // 在组件实例进入页面节点树时执行 | |
| 93 | - this.data.classstyle_id = this.data.object.classstyle; | |
| 94 | - this.data.goodscount = this.data.object.goodscount; | |
| 95 | - this.data.wgroup = this.data.object.wgroup; | |
| 96 | - | |
| 97 | - this.setData({ | |
| 98 | - classstyle_id: this.data.object.classstyle | |
| 99 | - }) | |
| 100 | - if (this.data.object.goodsclass == 1) { | |
| 101 | - this.data.is_recommend = 1 | |
| 102 | - } | |
| 103 | - if (this.data.object.goodsclass == 2) { | |
| 104 | - this.data.is_hot = 1 | |
| 105 | - } | |
| 106 | - if (this.data.object.goodsclass == 3) { | |
| 107 | - this.data.is_new = 1 | |
| 108 | - } | |
| 109 | - this.data.requestData = new Array(); | |
| 110 | - //---将数组--- | |
| 111 | - this.data.g_id = this.data.object.data; | |
| 112 | - var arr = []; | |
| 113 | - for (var i = 0; i < this.data.g_id .length; i += this.data.goodscount) { | |
| 114 | - arr.push(this.data.g_id .slice(i, i + this.data.goodscount)); | |
| 115 | - } | |
| 116 | - | |
| 117 | - this.data.firist_type_data = arr; | |
| 118 | - this.init(this.data.classstyle_id, this.data.wgroup); | |
| 88 | + //--初始化卡类-- | |
| 89 | + this.card_init(); | |
| 119 | 90 | }, |
| 120 | 91 | }, |
| 121 | 92 | ... | ... |
components/diy_searchbox/diy_searchbox.wxml
components/goods_list/goods_list.js
pages/index/index/index.js
| ... | ... | @@ -76,7 +76,7 @@ Page({ |
| 76 | 76 | |
| 77 | 77 | }, |
| 78 | 78 | |
| 79 | - onLoad: function() { | |
| 79 | + onLoad: async function() { | |
| 80 | 80 | var th = this; |
| 81 | 81 | //看一下商家是否开通了权益 |
| 82 | 82 | //--初始化是否有打勾-- |
| ... | ... | @@ -92,26 +92,11 @@ Page({ |
| 92 | 92 | }); |
| 93 | 93 | } |
| 94 | 94 | }) |
| 95 | - | |
| 96 | - | |
| 97 | - }, | |
| 98 | - //关闭新用户领取广告 | |
| 99 | - close_disgraceful: function() { | |
| 100 | - var th = this; | |
| 101 | - th.setData({ | |
| 102 | - is_disgraceful: 0 | |
| 103 | - }) | |
| 104 | - }, | |
| 105 | 95 | |
| 106 | - async onShow() { | |
| 107 | - | |
| 108 | - var th = this | |
| 109 | - | |
| 110 | 96 | //调用底部导航 |
| 111 | 97 | getApp().globalData.url=th.data.url |
| 112 | 98 | t.editTabBar(th,o.stoid,th.data.url); |
| 113 | 99 | |
| 114 | - | |
| 115 | 100 | await this.init_load(); |
| 116 | 101 | //显示的时候要开启计时器 |
| 117 | 102 | this.data.is_timer = 1; |
| ... | ... | @@ -119,16 +104,16 @@ Page({ |
| 119 | 104 | if (this.data.isTemplate) { |
| 120 | 105 | //---先获取会员--- |
| 121 | 106 | t.getUserFir(function() { |
| 122 | - th.is_festival(); | |
| 123 | - var new_nav = th.data.new_nav; | |
| 124 | - if (new_nav == "") { | |
| 125 | - th.is_new(); | |
| 126 | - } | |
| 127 | - setTimeout(function () { | |
| 128 | - if (getApp().globalData.user_id) getApp().requestCardNum(th); | |
| 129 | - },500) | |
| 130 | - | |
| 131 | - }); | |
| 107 | + th.is_festival(); | |
| 108 | + var new_nav = th.data.new_nav; | |
| 109 | + if (new_nav == "") { | |
| 110 | + th.is_new(); | |
| 111 | + } | |
| 112 | + setTimeout(function () { | |
| 113 | + if (getApp().globalData.user_id) getApp().requestCardNum(th); | |
| 114 | + },500) | |
| 115 | + | |
| 116 | + }); | |
| 132 | 117 | } else { |
| 133 | 118 | await this.init_fir(); |
| 134 | 119 | wx.setNavigationBarColor({ |
| ... | ... | @@ -168,12 +153,25 @@ Page({ |
| 168 | 153 | }).then(res => { |
| 169 | 154 | if (res.data.data) { |
| 170 | 155 | var gd_category = res.data.data.pageData; |
| 171 | - | |
| 172 | 156 | th.setData({ |
| 173 | 157 | gd_category: gd_category |
| 174 | 158 | }); |
| 175 | 159 | } |
| 176 | 160 | }) |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + }, | |
| 165 | + //关闭新用户领取广告 | |
| 166 | + close_disgraceful: function() { | |
| 167 | + var th = this; | |
| 168 | + th.setData({ | |
| 169 | + is_disgraceful: 0 | |
| 170 | + }) | |
| 171 | + }, | |
| 172 | + | |
| 173 | + async onShow() { | |
| 174 | + var th = this | |
| 177 | 175 | }, |
| 178 | 176 | //当隐藏的时候就关闭计时器 |
| 179 | 177 | onHide: function() { |
| ... | ... | @@ -185,6 +183,7 @@ Page({ |
| 185 | 183 | clearInterval(i); |
| 186 | 184 | } |
| 187 | 185 | |
| 186 | + | |
| 188 | 187 | }, |
| 189 | 188 | |
| 190 | 189 | //同步初始加载 |
| ... | ... | @@ -469,13 +468,12 @@ Page({ |
| 469 | 468 | this.data.timer && (clearInterval(this.data.timer), this.data.timer = null); |
| 470 | 469 | }, |
| 471 | 470 | onPageScroll: function(e) { |
| 472 | - this.setData({ | |
| 473 | - scrollTop: e.scrollTop | |
| 474 | - }); | |
| 471 | + this.data.scrollTop=e.scrollTop; | |
| 472 | + | |
| 473 | + | |
| 475 | 474 | var t = getCurrentPages(); |
| 476 | 475 | "pages/index/index/index" == t[t.length - 1].route; |
| 477 | - /*-- | |
| 478 | - && (e.scrollTop > 10 ? wx.setNavigationBarColor({ | |
| 476 | + /*--(e.scrollTop > 10 ? wx.setNavigationBarColor({ | |
| 479 | 477 | frontColor: "#ffffff", |
| 480 | 478 | backgroundColor: "#f95959" |
| 481 | 479 | }) : wx.setNavigationBarColor({ |
| ... | ... | @@ -829,5 +827,4 @@ Page({ |
| 829 | 827 | }) |
| 830 | 828 | } |
| 831 | 829 | |
| 832 | - | |
| 833 | 830 | }); |
| 834 | 831 | \ No newline at end of file | ... | ... |
pages/index/index/index.wxml