Commit b4e667b871ae3cc48070a0ab464d568cea374936

Authored by yvan.ni
1 parent aceadc1e

1. 报警

2.  测试返回的bug优化
packageA/pages/goods_share/goods_share.js
... ... @@ -24,7 +24,9 @@ Page({
24 24 dis_switch:0, //-- 分销开关 --
25 25 pattern:0, //-- 分成的方式 --
26 26 share_hidden:1, //-- 分享的按钮隐藏 --
27   - share_good:null //--- 要分享的商品 ---
  27 + share_good:null ,//--- 要分享的商品 ---
  28 +
  29 + is_no_distri:0
28 30 },
29 31 /**
30 32 * 生命周期函数--监听页面加载
... ... @@ -90,17 +92,43 @@ Page({
90 92 }
91 93 });
92 94  
  95 +
  96 + //看有没有开启分销功能
  97 + getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
  98 + var dis=rs.data.data;
  99 + if( dis && dis.switch==0){
  100 + th.setData({is_no_distri:1})
  101 + }
  102 + })
  103 + //看有没有开启分销功能
  104 + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{
  105 + if(res.data.code==0){
  106 + var arr = res.data.data.pageData;
  107 + if (arr.length > 0) {
  108 + var item=arr[0];
  109 + if(item.is_sy==0){
  110 + var now = Date.parse(new Date());now = now / 1000;
  111 + if(item.end_time<now) th.setData({is_no_distri:1})
  112 + }
  113 + }
  114 + }
  115 + })
  116 +
  117 +
93 118 },
94 119  
95 120 /*** 生命周期函数--监听页面显示***/
96 121 onShow: function () {
97 122 var th=this;
98 123  
99   -
100   - this.setData({
101   - //用来判断是否是分销商,是分销商才显示分成佣金
102   - is_distribut: app.globalData.userInfo.is_distribut
103   - });
  124 +
  125 + if(app.globalData.userInfo) {
  126 + this.setData({
  127 + //用来判断是否是分销商,是分销商才显示分成佣金
  128 + is_distribut: app.globalData.userInfo.is_distribut
  129 + });
  130 + }
  131 +
104 132  
105 133 getApp().getConfig2(function(rs){
106 134 //计算等级价相关
... ...
packageA/pages/goods_share/goods_share.wxml
... ... @@ -19,12 +19,14 @@
19 19 <view class="title-item" bindtap="sort1">价格<text class="iconfont icon-shang"></text></view>
20 20 </block>
21 21  
  22 + <block wx:if="{{!is_no_distri}}">
22 23 <block wx:if="{{orderField=='commission'}}">
23 24 <view class="title-item" bindtap="sort2">佣金<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view>
24 25 </block>
25 26 <block wx:else>
26 27 <view class="title-item" bindtap="sort2">佣金<text class="iconfont icon-xia"></text></view>
27 28 </block>
  29 + </block>
28 30  
29 31 <view class="title-item" bindtap='new_sort'>最新</view>
30 32 </view>
... ...
packageA/pages/goods_share/goods_share.wxss
... ... @@ -40,6 +40,7 @@ page {
40 40 display: flex;
41 41 font-size: 30rpx;
42 42 border-bottom: 2rpx solid #f8f8f8;
  43 + justify-content: space-around;
43 44 }
44 45 .title .iconfont {
45 46 color: #ccc;
... ... @@ -47,7 +48,7 @@ page {
47 48 margin-left: 8rpx;
48 49 }
49 50 .title-item {
50   - width: 25%;
  51 + /* width: 25%; */
51 52 box-sizing: border-box;
52 53 text-align: center;
53 54 padding: 20rpx;
... ...
pages/activity/pind_list/pind_list.js
... ... @@ -16,6 +16,7 @@ Page({
16 16 isshow:0,
17 17 iurl: os.imghost,
18 18 ad_data:null,
  19 + max_sw_height:200,
19 20 },
20 21  
21 22 //------初始化加载----------
... ... @@ -47,9 +48,9 @@ Page({
47 48 var narr=[];
48 49 for(var i in a){
49 50 var tt = {
50   - 'ad_code': os.imghost + a[0].ad_code,
  51 + 'ad_code': os.imghost + a[i].ad_code,
51 52 'media_link': '',
52   - 'ad_weapplink':a[0].ad_weapplink
  53 + 'ad_weapplink':a[i].ad_weapplink
53 54 };
54 55 narr.push(tt);
55 56 }
... ... @@ -206,6 +207,20 @@ Page({
206 207 _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
207 208 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
208 209 }
209   - }
  210 + },
  211 +
  212 + imageLoad:function(e){
  213 + var imgwidth = e.detail.width;
  214 + var imgheight = e.detail.height;
  215 + //宽高比
  216 + var ratio = imgwidth / imgheight;
  217 + //计算的高度值
  218 + var viewHeight = 750 / ratio;
  219 + var hei=this.data.max_sw_height;
  220 +
  221 + if (hei< viewHeight) {
  222 + this.setData({ max_sw_height: viewHeight });
  223 + }
  224 + }
210 225  
211 226 });
... ...
pages/activity/seckill_list/seckill_list.js
... ... @@ -12,6 +12,7 @@ Page({
12 12 ismore:1, //是否可以加载更多
13 13 isshow:0,
14 14 ad_data:null,
  15 + max_sw_height:200,
15 16 },
16 17  
17 18 //------初始化加载----------
... ... @@ -44,9 +45,9 @@ Page({
44 45 var narr=[];
45 46 for(var i in a){
46 47 var tt = {
47   - 'ad_code': os.imghost + a[0].ad_code,
  48 + 'ad_code': os.imghost + a[i].ad_code,
48 49 'media_link': '',
49   - 'ad_weapplink':a[0].ad_weapplink
  50 + 'ad_weapplink':a[i].ad_weapplink
50 51 };
51 52 narr.push(tt);
52 53 }
... ... @@ -207,5 +208,19 @@ Page({
207 208 title: '秒杀活动-' + getApp().globalData.config.store_name,
208 209 }
209 210 },
  211 +
  212 + imageLoad:function(e){
  213 + var imgwidth = e.detail.width;
  214 + var imgheight = e.detail.height;
  215 + //宽高比
  216 + var ratio = imgwidth / imgheight;
  217 + //计算的高度值
  218 + var viewHeight = 750 / ratio;
  219 + var hei=this.data.max_sw_height;
  220 +
  221 + if (hei< viewHeight) {
  222 + this.setData({ max_sw_height: viewHeight });
  223 + }
  224 + }
210 225  
211 226 });
... ...
pages/distribution/distribution.js
... ... @@ -171,16 +171,20 @@ Page({
171 171 title: "全部满足成为分销商",
172 172 icon: 'none',
173 173 duration: 2000
174   - });
175   - //-- 会员的分销的内容要进行存储 --
176   - app.globalData.userInfo.is_distribut=1;
177   - wx.setStorageSync("userinfo",app.globalData.userInfo);
178   - setTimeout(function(){
179   - self.getDis_data();
180   - self.setData({
181   - userInfo: app.globalData.userInfo,
182   - });
183   - },2000)
  174 + });
  175 +
  176 + if(app.globalData.userInfo) {
  177 + //-- 会员的分销的内容要进行存储 --
  178 + app.globalData.userInfo.is_distribut=1;
  179 + wx.setStorageSync("userinfo",app.globalData.userInfo);
  180 + setTimeout(function(){
  181 + self.getDis_data();
  182 + self.setData({
  183 + userInfo: app.globalData.userInfo,
  184 + });
  185 + },2000)
  186 + }
  187 +
184 188 }
185 189 }
186 190  
... ... @@ -284,7 +288,7 @@ Page({
284 288 var txt="fenxiao["+index+"].pass";
285 289 var txt2="data.is_distribut";
286 290 var txt3="userInfo.is_distribut";
287   - getApp().globalData.userInfo.is_distribut=1;
  291 + if(getApp().globalData.userInfo) getApp().globalData.userInfo.is_distribut=1;
288 292  
289 293  
290 294 setTimeout(function(){
... ...