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,7 +24,9 @@ Page({
24 dis_switch:0, //-- 分销开关 -- 24 dis_switch:0, //-- 分销开关 --
25 pattern:0, //-- 分成的方式 -- 25 pattern:0, //-- 分成的方式 --
26 share_hidden:1, //-- 分享的按钮隐藏 -- 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,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 onShow: function () { 121 onShow: function () {
97 var th=this; 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 getApp().getConfig2(function(rs){ 133 getApp().getConfig2(function(rs){
106 //计算等级价相关 134 //计算等级价相关
packageA/pages/goods_share/goods_share.wxml
@@ -19,12 +19,14 @@ @@ -19,12 +19,14 @@
19 <view class="title-item" bindtap="sort1">价格<text class="iconfont icon-shang"></text></view> 19 <view class="title-item" bindtap="sort1">价格<text class="iconfont icon-shang"></text></view>
20 </block> 20 </block>
21 21
  22 + <block wx:if="{{!is_no_distri}}">
22 <block wx:if="{{orderField=='commission'}}"> 23 <block wx:if="{{orderField=='commission'}}">
23 <view class="title-item" bindtap="sort2">佣金<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view> 24 <view class="title-item" bindtap="sort2">佣金<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view>
24 </block> 25 </block>
25 <block wx:else> 26 <block wx:else>
26 <view class="title-item" bindtap="sort2">佣金<text class="iconfont icon-xia"></text></view> 27 <view class="title-item" bindtap="sort2">佣金<text class="iconfont icon-xia"></text></view>
27 </block> 28 </block>
  29 + </block>
28 30
29 <view class="title-item" bindtap='new_sort'>最新</view> 31 <view class="title-item" bindtap='new_sort'>最新</view>
30 </view> 32 </view>
packageA/pages/goods_share/goods_share.wxss
@@ -40,6 +40,7 @@ page { @@ -40,6 +40,7 @@ page {
40 display: flex; 40 display: flex;
41 font-size: 30rpx; 41 font-size: 30rpx;
42 border-bottom: 2rpx solid #f8f8f8; 42 border-bottom: 2rpx solid #f8f8f8;
  43 + justify-content: space-around;
43 } 44 }
44 .title .iconfont { 45 .title .iconfont {
45 color: #ccc; 46 color: #ccc;
@@ -47,7 +48,7 @@ page { @@ -47,7 +48,7 @@ page {
47 margin-left: 8rpx; 48 margin-left: 8rpx;
48 } 49 }
49 .title-item { 50 .title-item {
50 - width: 25%; 51 + /* width: 25%; */
51 box-sizing: border-box; 52 box-sizing: border-box;
52 text-align: center; 53 text-align: center;
53 padding: 20rpx; 54 padding: 20rpx;
pages/activity/pind_list/pind_list.js
@@ -16,6 +16,7 @@ Page({ @@ -16,6 +16,7 @@ Page({
16 isshow:0, 16 isshow:0,
17 iurl: os.imghost, 17 iurl: os.imghost,
18 ad_data:null, 18 ad_data:null,
  19 + max_sw_height:200,
19 }, 20 },
20 21
21 //------初始化加载---------- 22 //------初始化加载----------
@@ -47,9 +48,9 @@ Page({ @@ -47,9 +48,9 @@ Page({
47 var narr=[]; 48 var narr=[];
48 for(var i in a){ 49 for(var i in a){
49 var tt = { 50 var tt = {
50 - 'ad_code': os.imghost + a[0].ad_code, 51 + 'ad_code': os.imghost + a[i].ad_code,
51 'media_link': '', 52 'media_link': '',
52 - 'ad_weapplink':a[0].ad_weapplink 53 + 'ad_weapplink':a[i].ad_weapplink
53 }; 54 };
54 narr.push(tt); 55 narr.push(tt);
55 } 56 }
@@ -206,6 +207,20 @@ Page({ @@ -206,6 +207,20 @@ Page({
206 _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; 207 _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
207 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 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,6 +12,7 @@ Page({
12 ismore:1, //是否可以加载更多 12 ismore:1, //是否可以加载更多
13 isshow:0, 13 isshow:0,
14 ad_data:null, 14 ad_data:null,
  15 + max_sw_height:200,
15 }, 16 },
16 17
17 //------初始化加载---------- 18 //------初始化加载----------
@@ -44,9 +45,9 @@ Page({ @@ -44,9 +45,9 @@ Page({
44 var narr=[]; 45 var narr=[];
45 for(var i in a){ 46 for(var i in a){
46 var tt = { 47 var tt = {
47 - 'ad_code': os.imghost + a[0].ad_code, 48 + 'ad_code': os.imghost + a[i].ad_code,
48 'media_link': '', 49 'media_link': '',
49 - 'ad_weapplink':a[0].ad_weapplink 50 + 'ad_weapplink':a[i].ad_weapplink
50 }; 51 };
51 narr.push(tt); 52 narr.push(tt);
52 } 53 }
@@ -207,5 +208,19 @@ Page({ @@ -207,5 +208,19 @@ Page({
207 title: '秒杀活动-' + getApp().globalData.config.store_name, 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,16 +171,20 @@ Page({
171 title: "全部满足成为分销商", 171 title: "全部满足成为分销商",
172 icon: 'none', 172 icon: 'none',
173 duration: 2000 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,7 +288,7 @@ Page({
284 var txt="fenxiao["+index+"].pass"; 288 var txt="fenxiao["+index+"].pass";
285 var txt2="data.is_distribut"; 289 var txt2="data.is_distribut";
286 var txt3="userInfo.is_distribut"; 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 setTimeout(function(){ 294 setTimeout(function(){