Commit 2cf88516e1b9a3bc08d68d83d540c4807044e7ef

Authored by 后端研发-苏明海
2 parents 1d3d9208 b7ec4747

Merge branch 'dev' into 'test'

Dev

See merge request !654
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -2166,8 +2166,12 @@ Page({
2166 2166 },
2167 2167  
2168 2168 onShareTimeline() {
  2169 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  2170 + if(!store_name)
  2171 + store_name=getApp().globalData.setting.appName;
  2172 +
2169 2173 return {
2170   - title:this.data.data.goods_name + '-' + getApp().globalData.config.store_name,
  2174 + title:this.data.data.goods_name + '-' + store_name,
2171 2175 imageUrl:this.data.gallery[0].image_url,
2172 2176 }
2173 2177 },
... ...
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,47 @@ 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 + if(!app.globalData.userInfo) {
  118 + getApp().goto("/pages/togoin/togoin");
  119 + }
  120 +
  121 +
93 122 },
94 123  
95 124 /*** 生命周期函数--监听页面显示***/
96 125 onShow: function () {
97 126 var th=this;
98 127  
99   -
100   - this.setData({
101   - //用来判断是否是分销商,是分销商才显示分成佣金
102   - is_distribut: app.globalData.userInfo.is_distribut
103   - });
  128 +
  129 + if(app.globalData.userInfo) {
  130 + this.setData({
  131 + //用来判断是否是分销商,是分销商才显示分成佣金
  132 + is_distribut: app.globalData.userInfo.is_distribut
  133 + });
  134 + }
  135 +
104 136  
105 137 getApp().getConfig2(function(rs){
106 138 //计算等级价相关
... ...
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>
... ... @@ -77,7 +79,7 @@
77 79  
78 80 <view class="flex jc_sb fs24 pdt14">
79 81 <view class="gray">已售:<text class="red">{{item.sales_sum}}</text></view>
80   - <view class="gray" wx:if="{{is_distribut}}">分成金额:
  82 + <view class="gray" wx:if="{{is_distribut && !is_no_distri}}">分成金额:
81 83 <text wx:if="{{!pattern}}" class="red">¥{{item.commission}}</text>
82 84 <text wx:else class="red">¥{{item.fir_rate+item.sec_rate+item.thi_rate}}</text>
83 85 </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 //------初始化加载----------
... ... @@ -26,6 +27,7 @@ Page({
26 27  
27 28 console.log("------------");
28 29 console.log(first_leader);
  30 + getApp().getConfig();
29 31  
30 32 if (first_leader) {
31 33 getApp().globalData.first_leader = first_leader;
... ... @@ -47,9 +49,9 @@ Page({
47 49 var narr=[];
48 50 for(var i in a){
49 51 var tt = {
50   - 'ad_code': os.imghost + a[0].ad_code,
  52 + 'ad_code': os.imghost + a[i].ad_code,
51 53 'media_link': '',
52   - 'ad_weapplink':a[0].ad_weapplink
  54 + 'ad_weapplink':a[i].ad_weapplink
53 55 };
54 56 narr.push(tt);
55 57 }
... ... @@ -206,6 +208,29 @@ Page({
206 208 _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
207 209 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
208 210 }
209   - }
  211 + },
  212 +
  213 + imageLoad:function(e){
  214 + var imgwidth = e.detail.width;
  215 + var imgheight = e.detail.height;
  216 + //宽高比
  217 + var ratio = imgwidth / imgheight;
  218 + //计算的高度值
  219 + var viewHeight = 750 / ratio;
  220 + var hei=this.data.max_sw_height;
  221 +
  222 + if (hei< viewHeight) {
  223 + this.setData({ max_sw_height: viewHeight });
  224 + }
  225 + },
  226 +
  227 + onShareTimeline() {
  228 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  229 + if(!store_name)
  230 + store_name=getApp().globalData.setting.appName;
  231 + return {
  232 + title: '秒杀活动-' + store_name,
  233 + }
  234 + },
210 235  
211 236 });
... ...
pages/activity/pind_list/pind_list.wxml
... ... @@ -9,13 +9,13 @@
9 9  
10 10 <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">
11 11 <swiper-item>
12   - <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  12 + <image src="{{item.ad_code}}" style="width: 100%;" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
13 13 </swiper-item>
14 14 </navigator>
15 15  
16 16 <view data-url="{{item.ad_weapplink}}" class="s1_gk_a1" bindtap="go_url" wx:else>
17 17 <swiper-item>
18   - <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  18 + <image src="{{item.ad_code}}" style="width: 100%;" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
19 19 </swiper-item>
20 20 </view>
21 21  
... ...
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 //------初始化加载----------
... ... @@ -22,7 +23,8 @@ Page({
22 23 var th=this;
23 24  
24 25 console.log("------------");
25   - console.log(first_leader);
  26 + console.log(first_leader);
  27 + getApp().getConfig();
26 28  
27 29 if (first_leader) {
28 30 getApp().globalData.first_leader = first_leader;
... ... @@ -44,9 +46,9 @@ Page({
44 46 var narr=[];
45 47 for(var i in a){
46 48 var tt = {
47   - 'ad_code': os.imghost + a[0].ad_code,
  49 + 'ad_code': os.imghost + a[i].ad_code,
48 50 'media_link': '',
49   - 'ad_weapplink':a[0].ad_weapplink
  51 + 'ad_weapplink':a[i].ad_weapplink
50 52 };
51 53 narr.push(tt);
52 54 }
... ... @@ -203,9 +205,26 @@ Page({
203 205 },
204 206  
205 207 onShareTimeline() {
  208 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  209 + if(!store_name)
  210 + store_name=getApp().globalData.setting.appName;
206 211 return {
207   - title: '秒杀活动-' + getApp().globalData.config.store_name,
  212 + title: '秒杀活动-' + store_name,
208 213 }
209 214 },
  215 +
  216 + imageLoad:function(e){
  217 + var imgwidth = e.detail.width;
  218 + var imgheight = e.detail.height;
  219 + //宽高比
  220 + var ratio = imgwidth / imgheight;
  221 + //计算的高度值
  222 + var viewHeight = 750 / ratio;
  223 + var hei=this.data.max_sw_height;
  224 +
  225 + if (hei< viewHeight) {
  226 + this.setData({ max_sw_height: viewHeight });
  227 + }
  228 + }
210 229  
211 230 });
... ...
pages/activity/seckill_list/seckill_list.wxml
... ... @@ -11,13 +11,13 @@
11 11  
12 12 <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">
13 13 <swiper-item>
14   - <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  14 + <image src="{{item.ad_code}}" style="width: 100%;" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
15 15 </swiper-item>
16 16 </navigator>
17 17  
18 18 <view data-url="{{item.ad_weapplink}}" class="s1_gk_a1" bindtap="go_url" wx:else>
19 19 <swiper-item>
20   - <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  20 + <image src="{{item.ad_code}}" style="width: 100%;" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
21 21 </swiper-item>
22 22 </view>
23 23  
... ...
pages/distribution/distribution.js
... ... @@ -171,20 +171,33 @@ 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   - }
186   -
187   -
  189 + }
  190 + else{
  191 + wx.showToast({
  192 + title: res.data.msg,
  193 + icon: 'none',
  194 + duration: 2000
  195 + });
  196 + setTimeout(function(){
  197 + getApp().goto("/pages/user/index/index");
  198 + },1500)
  199 +
  200 + }
188 201  
189 202 }else{
190 203 self.getDis_data()
... ... @@ -284,7 +297,7 @@ Page({
284 297 var txt="fenxiao["+index+"].pass";
285 298 var txt2="data.is_distribut";
286 299 var txt3="userInfo.is_distribut";
287   - getApp().globalData.userInfo.is_distribut=1;
  300 + if(getApp().globalData.userInfo) getApp().globalData.userInfo.is_distribut=1;
288 301  
289 302  
290 303 setTimeout(function(){
... ...
pages/goods/categoryList/categoryList.js
... ... @@ -578,7 +578,7 @@ Page({
578 578 //---------分享配置--------
579 579 onShareAppMessage: function (e) {
580 580  
581   - url="pages/goods/categoryList/categoryList";
  581 + var url="pages/goods/categoryList/categoryList";
582 582 var userInfo=getApp().globalData.userInfo;
583 583 //是分销商才带
584 584 if(userInfo){
... ... @@ -1042,8 +1042,11 @@ Page({
1042 1042 },
1043 1043  
1044 1044 onShareTimeline(){
  1045 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  1046 + if(!store_name)
  1047 + store_name=getApp().globalData.setting.appName;
1045 1048 return {
1046   - title:'商品分类-'+getApp().globalData.config.store_name,
  1049 + title:'商品分类-'+store_name,
1047 1050 }
1048 1051 }
1049 1052  
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -4452,7 +4452,7 @@ Page({
4452 4452 }
4453 4453  
4454 4454 var img_url=ee.data.data.original_img;
4455   - if((this.data.prom_type==1 && this.data.prom_type==6) || this.data.prom_act.share_imgurl){
  4455 + if((this.data.prom_type==1 || this.data.prom_type==6) && this.data.prom_act.share_imgurl){
4456 4456 img_url=this.data.iurl+this.data.prom_act.share_imgurl;
4457 4457 }
4458 4458  
... ... @@ -5233,8 +5233,11 @@ Page({
5233 5233  
5234 5234  
5235 5235 onShareTimeline() {
  5236 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  5237 + if(!store_name)
  5238 + store_name=getApp().globalData.setting.appName;
5236 5239 return {
5237   - title:this.data.data.goods_name + '-' + getApp().globalData.config.store_name,
  5240 + title:this.data.data.goods_name + '-' + store_name,
5238 5241 imageUrl:this.data.gallery[0].image_url,
5239 5242 }
5240 5243 },
... ...
pages/index/index/index.js
... ... @@ -668,7 +668,7 @@ Page({
668 668 }
669 669  
670 670 var ob={
671   - title: getApp().globalData.config.store_name,
  671 + title: title,
672 672 path:url,
673 673 };
674 674 console.log(ob);
... ... @@ -1042,9 +1042,11 @@ Page({
1042 1042 // title: '首页-' + getApp().globalData.config.store_name,
1043 1043 // }
1044 1044 // });
1045   -
  1045 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  1046 + if(!store_name)
  1047 + store_name=getApp().globalData.setting.appName;
1046 1048 return {
1047   - title: '首页-' + getApp().globalData.config.store_name,
  1049 + title: '首页-' + store_name,
1048 1050 }
1049 1051 },
1050 1052  
... ...
pages/user/assistance/assistance.js
... ... @@ -241,8 +241,11 @@ Page({
241 241 },
242 242  
243 243 onShareTimeline() {
  244 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  245 + if(!store_name)
  246 + store_name=getApp().globalData.setting.appName;
244 247 return {
245   - title: '好友助力-' + getApp().globalData.config.store_name,
  248 + title: '好友助力-' + store_name,
246 249 }
247 250 },
248 251  
... ...
pages/user/coupons/coupons.js
... ... @@ -178,37 +178,40 @@ Page({
178 178 data.cashcount = parseInt(data.CashCount);
179 179 getApp().globalData.Integral = data.Integral;
180 180  
181   - getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea",{data:{user_id: user_id, store_id: os.stoid, pageSize:200}}).then(res=>{
182   - if(res.data.code==0 && res.data.data && res.data.data.total>0 ){
183   - var b_arr=res.data.data.pageData;
184   - var b_can_arr=[]; //未使用
185   - var b_out_arr=[]; //已过期
186   - var b_isuse_arr=[]; //已过期
187   - for(var i in b_arr){
188   - b_arr[i].isby=1;
189   - if(b_arr[i].isuse==0){
190   - if(b_arr[i].use_end_time<=ut.gettimestamp()){
191   - b_out_arr.push(b_arr[i]);
192   - }else{
193   - b_can_arr.push(b_arr[i]);
194   - }
195   -
196   - }else{
197   - b_isuse_arr.push(b_arr[i]);
198   - }
199   - }
200   - data.cashcount= data.cashcount+b_can_arr.length; //加上包邮券的数量
201   - th.data.b_can_arr=b_can_arr; //可使用
202   - th.data.b_out_arr=b_out_arr; //过期
203   - th.data.b_isuse_arr=b_isuse_arr; //已使用
204   - th.setData({ udata: data});
205   - func();s_guoqi();
206   -
207   - }else{
208   - th.setData({ udata: data});
209   - func();s_guoqi();
210   - }
211   - })
  181 + getApp().request.get("/api/weshop/userfeemail/pageAndArea",{
  182 + data:{user_id: user_id, store_id: os.stoid, pageSize:200},
  183 + success:function(res){
  184 + if(res.data.code==0 && res.data.data && res.data.data.total>0 ){
  185 + var b_arr=res.data.data.pageData;
  186 + var b_can_arr=[]; //未使用
  187 + var b_out_arr=[]; //已过期
  188 + var b_isuse_arr=[]; //已过期
  189 + for(var i in b_arr){
  190 + b_arr[i].isby=1;
  191 + if(b_arr[i].isuse==0){
  192 + if(b_arr[i].use_end_time<=ut.gettimestamp()){
  193 + b_out_arr.push(b_arr[i]);
  194 + }else{
  195 + b_can_arr.push(b_arr[i]);
  196 + }
  197 +
  198 + }else{
  199 + b_isuse_arr.push(b_arr[i]);
  200 + }
  201 + }
  202 + data.cashcount= data.cashcount+b_can_arr.length; //加上包邮券的数量
  203 + th.data.b_can_arr=b_can_arr; //可使用
  204 + th.data.b_out_arr=b_out_arr; //过期
  205 + th.data.b_isuse_arr=b_isuse_arr; //已使用
  206 + th.setData({ udata: data});
  207 + func();s_guoqi();
  208 +
  209 + }else{
  210 + th.setData({ udata: data});
  211 + func();s_guoqi();
  212 + }
  213 + }
  214 + })
212 215  
213 216 }
214 217 })
... ... @@ -227,23 +230,21 @@ Page({
227 230 page: 1
228 231 };
229 232  
230   - getApp().request.promiseGet("/api/weshop/users/listQuan", {
231   - data:get_data
232   - }).then(res=>{
233   -
234   - if(res.data.code==0 && res.data){
235   - var a = res.data,val = a.data.total;
236   - var details = a.data.pageData;
237   - if (details.length == 0){
238   - if(th.data.b_out_arr) th.setData({ number: th.data.b_out_arr.length});
239   - return false;
240   - }
241   - var all_length=val;
242   - if(th.data.b_out_arr) all_length+=th.data.b_out_arr.length;
243   - th.setData({ number: all_length});
244   - }
245   -
246   -
  233 + getApp().request.get("/api/weshop/users/listQuan", {
  234 + data:get_data,
  235 + success:function(res){
  236 + if(res.data.code==0 && res.data){
  237 + var a = res.data,val = a.data.total;
  238 + var details = a.data.pageData;
  239 + if (details.length == 0){
  240 + if(th.data.b_out_arr) th.setData({ number: th.data.b_out_arr.length});
  241 + return false;
  242 + }
  243 + var all_length=val;
  244 + if(th.data.b_out_arr) all_length+=th.data.b_out_arr.length;
  245 + th.setData({ number: all_length});
  246 + }
  247 + }
247 248 })
248 249 },
249 250  
... ... @@ -272,47 +273,48 @@ Page({
272 273 if(this.data.b_can_arr) init_num=this.data.b_can_arr.length;
273 274  
274 275 wx.showLoading(); th.data.isloading=1;
275   - getApp().request.promiseGet("/api/weshop/users/listQuan", {
  276 + getApp().request.get("/api/weshop/users/listQuan", {
276 277 data: get_data,
277   - }).then(res => {
278   - th.data.isloading=0;
279   - var a = res.data;
280   - val = a.data.total;
281   - var details = a.data.pageData;
282   - th.setData({isset:1});
283   -
284   - //没有找到优惠券的时候
285   - if (details.length == 0 && th.data.current_page==1) {
286   - this.setData({sheng:0});
287   - getApp().showWarning("未找更多数据");
288   - if(big_arr.length>0) {
289   - th.setData({ details: big_arr, });
290   - th.setData({ val: init_num});
291   - setTimeout(function(){
292   - details=big_arr;
293   - for (var i = 0; i < details.length; i++) {
294   - var no = i + len;
295   - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
296   - }
297   - },1000)
298   - }
299   - return false;
300   - }
301   -
302   - th.setData({ val: val+init_num });
303   - //数组合并
304   - big_arr=big_arr.concat(details);
305   - //设置数组
306   - th.setData({ details: big_arr, });
307   - //延迟显示二维码的内容
308   - setTimeout(function () {
309   - if(th.data.current_page==1) details=big_arr;
310   - for (var i = 0; i < details.length; i++) {
311   - var no = i + len;
312   - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
313   - }
314   - wx.hideLoading();
315   - }, 1200)
  278 + success:function(res){
  279 + th.data.isloading=0;
  280 + var a = res.data;
  281 + val = a.data.total;
  282 + var details = a.data.pageData;
  283 + th.setData({isset:1});
  284 +
  285 + //没有找到优惠券的时候
  286 + if (details.length == 0 && th.data.current_page==1) {
  287 + th.setData({sheng:0});
  288 + getApp().showWarning("未找更多数据");
  289 + if(big_arr.length>0) {
  290 + th.setData({ details: big_arr, });
  291 + th.setData({ val: init_num});
  292 + setTimeout(function(){
  293 + details=big_arr;
  294 + for (var i = 0; i < details.length; i++) {
  295 + var no = i + len;
  296 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
  297 + }
  298 + },1000)
  299 + }
  300 + return false;
  301 + }
  302 +
  303 + th.setData({ val: val+init_num });
  304 + //数组合并
  305 + big_arr=big_arr.concat(details);
  306 + //设置数组
  307 + th.setData({ details: big_arr, });
  308 + //延迟显示二维码的内容
  309 + setTimeout(function () {
  310 + if(th.data.current_page==1) details=big_arr;
  311 + for (var i = 0; i < details.length; i++) {
  312 + var no = i + len;
  313 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
  314 + }
  315 + wx.hideLoading();
  316 + }, 1200)
  317 + }
316 318 })
317 319  
318 320  
... ... @@ -341,54 +343,55 @@ Page({
341 343 if(big_arr.length==0 && this.data.b_out_arr){
342 344 big_arr=this.data.b_out_arr;
343 345 }
344   - init_num=this.data.b_out_arr.length;
  346 + if(this.data.b_out_arr)
  347 + init_num=this.data.b_out_arr.length;
345 348  
346 349  
347 350 wx.showLoading();th.data.isloading=1;
348   - getApp().request.promiseGet("/api/weshop/users/listQuan"
  351 + getApp().request.get("/api/weshop/users/listQuan"
349 352 , {
350 353 data: get_data,
351   - }).then(res => {
352   -
353   - th.data.isloading=0;
354   - var a = res.data;
355   - number = a.data.total;
356   - var details = a.data.pageData;
357   -
358   - if (details.length == 0) {
359   - this.setData({overdue_sheng:0});
360   - getApp().showWarning("未找更多数据");
361   - if( big_arr.length>0 && th.data.current_page==1) {
362   - th.setData({ details: big_arr, });
363   - th.setData({ number: init_num});
364   - setTimeout(function(){
365   - details=big_arr;
366   - for (var i = 0; i < details.length; i++) {
367   - var no = i + len;
368   - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
369   - }
370   - },1000)
371   -
372   - }
373   - return false;
374   - }
375   -
376   - big_arr=big_arr.concat(details);
377   -
378   - this.setData({
379   - details: big_arr, number:number+init_num,
380   - });
381   -
382   -
383   - setTimeout(function () {
384   - if(th.data.current_page==1) details=big_arr;
385   - for (var i = 0; i < details.length; i++) {
386   - var no = i + len;
387   - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
388   -
389   - }
390   - wx.hideLoading();
391   - }, 800)
  354 + success:function(res){
  355 + th.data.isloading=0;
  356 + var a = res.data;
  357 + number = a.data.total;
  358 + var details = a.data.pageData;
  359 +
  360 + if (details.length == 0) {
  361 + this.setData({overdue_sheng:0});
  362 + getApp().showWarning("未找更多数据");
  363 + if( big_arr.length>0 && th.data.current_page==1) {
  364 + th.setData({ details: big_arr, });
  365 + th.setData({ number: init_num});
  366 + setTimeout(function(){
  367 + details=big_arr;
  368 + for (var i = 0; i < details.length; i++) {
  369 + var no = i + len;
  370 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
  371 + }
  372 + },1000)
  373 +
  374 + }
  375 + return false;
  376 + }
  377 +
  378 + big_arr=big_arr.concat(details);
  379 +
  380 + this.setData({
  381 + details: big_arr, number:number+init_num,
  382 + });
  383 +
  384 +
  385 + setTimeout(function () {
  386 + if(th.data.current_page==1) details=big_arr;
  387 + for (var i = 0; i < details.length; i++) {
  388 + var no = i + len;
  389 + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460);
  390 +
  391 + }
  392 + wx.hideLoading();
  393 + }, 800)
  394 + }
392 395 })
393 396 },
394 397  
... ...
pages/user/index/index.js
... ... @@ -60,33 +60,36 @@ Page({
60 60 onLoad: function(options) {
61 61 var th=this;
62 62 //-- 读取会员中心按钮列表 --
63   - getApp().request.promiseGet("/api/weshop/userTool/page?pageSize=100", {
64   - }).then(res => {
65   - if(res.data.code==0 ){
66   - var d_list=res.data.data.pageData;
67   - getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
68   - var dis=rs.data.data;
69   - for(var i in d_list){
70   - if(d_list[i].name=='我的分销' && dis && dis.switch==0){
71   - d_list.splice(i,1);
72   - }
73   - }
74   - th.setData({user_tool:d_list});
75   - })
76   - }
77   - })
  63 + getApp().request.get("/api/weshop/userTool/page?pageSize=100", {
  64 + success:function(res){
  65 + if(res.data.code==0 ){
  66 + var d_list=res.data.data.pageData;
  67 + getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
  68 + var dis=rs.data.data;
  69 + for(var i in d_list){
  70 + if(d_list[i].name=='我的分销' && dis && dis.switch==0){
  71 + d_list.splice(i,1);
  72 + }
  73 + }
  74 + th.setData({user_tool:d_list});
  75 + })
  76 + }
  77 + }
  78 + })
78 79 this.birthday();
79   - getApp().request.promiseGet("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, {
  80 + getApp().request.get("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, {
80 81 data: {
81 82 enabled: 1
82   - }
83   - }).then(res => {
84   - if(res.data.code==0 && res.data.data){
85   - var item=res.data.data.pageData[0];
86   - if (item && item.ad_code)
87   - th.setData({ad_img:item.ad_code})
88   - }
89   - })
  83 + },
  84 + success:function(res){
  85 + if(res.data.code==0 && res.data.data){
  86 + var item=res.data.data.pageData[0];
  87 + if (item && item.ad_code) th.setData({ad_img:item.ad_code})
  88 + }
  89 + }
  90 + })
  91 +
  92 +
90 93 app.getUserFir();
91 94  
92 95 },
... ...
pages/user/my_service/hist_service.wxml
... ... @@ -39,7 +39,12 @@
39 39 </view>
40 40 <!-- right -->
41 41 <view class="serState fs32">
42   - <view wx:if="{{item.State==0}}">未服务</view>
  42 + <view wx:if="{{item.State==0}}" >
  43 + <navigator url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}&number={{item.Number}}&itemId={{item.ServiceID}}&modify=1&projectId={{item.ProjectID}}">
  44 + <view>未服务</view>
  45 + <view>更改时间</view>
  46 + </navigator>
  47 + </view>
43 48 <view wx:if="{{item.State==1}}">已服务</view>
44 49 <view wx:if="{{item.State==2}}">已过期</view>
45 50 <view wx:if="{{item.State==3}}">已取消</view>
... ...
pages/user/my_service/hist_service.wxss
... ... @@ -64,6 +64,7 @@ page {
64 64  
65 65 .serState {
66 66 color: rgb(255, 82, 125);
  67 + text-align: right;
67 68 }
68 69  
69 70 .container {
... ...