Commit ea45d556333bd1c113b9e324d0e5804283b5365e

Authored by WXD-SEASON\season
2 parents 4105ae2e 56b201be

Merge branch 'dev_oa_luo35' into dev

components/diy_floatingWindow/diy_floatingWindow.wxss
1 .custom-service { 1 .custom-service {
2 - width: 100rpx;  
3 - height: 100rpx; 2 + width: 80rpx;
  3 + height: 80rpx;
4 /* background-color: red; */ 4 /* background-color: red; */
5 border-radius: 50%; 5 border-radius: 50%;
6 z-index: 100; 6 z-index: 100;
7 line-height: 28rpx; 7 line-height: 28rpx;
8 - position: fixed; 8 + /* position: fixed; */
9 top: 50%; 9 top: 50%;
10 10
11 /* background-position: 50%; */ 11 /* background-position: 50%; */
components/diy_goodsGroup/diy_goodsGroup.js
@@ -573,7 +573,7 @@ Component({ @@ -573,7 +573,7 @@ Component({
573 } 573 }
574 574
575 }) 575 })
576 - console.error(th.data.requestData); 576 + // console.error(th.data.requestData);
577 //----------------------- 577 //-----------------------
578 if (th.data.object.column_action_name) { 578 if (th.data.object.column_action_name) {
579 if (th.data.object.style == 6 || th.data.object.style == 5) { 579 if (th.data.object.style == 6 || th.data.object.style == 5) {
@@ -643,7 +643,7 @@ Component({ @@ -643,7 +643,7 @@ Component({
643 }, 643 },
644 // 加购方法 hide 644 // 加购方法 hide
645 hide_add_purchase(){ 645 hide_add_purchase(){
646 - console.error('隐藏加购方法。。。。'); 646 + // console.error('隐藏加购方法。。。。');
647 setTimeout(()=>{ 647 setTimeout(()=>{
648 this.setData({ 648 this.setData({
649 add_purchase:false 649 add_purchase:false
components/diy_scan/diy_scan.wxml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 style="top:{{top}}px;left:{{left}}px; background-color:{{object.bg_color}}; opacity: 0.5 " bindtouchmove="setTouchMove"> 3 style="top:{{top}}px;left:{{left}}px; background-color:{{object.bg_color}}; opacity: 0.5 " bindtouchmove="setTouchMove">
4 <view style="text-align: center;"> 4 <view style="text-align: center;">
5 <image class="cs-img" src="{{object.img}}"></image> 5 <image class="cs-img" src="{{object.img}}"></image>
6 - <view class="s_title" wx:if="{{object.title!=''}}"> 6 + <view class="s_title" style="line-height: 14rpx;" wx:if="{{object.title!=''}}">
7 <text wx:if="{{object.word_color}}" style="color:{{object.word_color}}">{{object.title}}</text> 7 <text wx:if="{{object.word_color}}" style="color:{{object.word_color}}">{{object.title}}</text>
8 <text wx:else >{{object.title}}</text> 8 <text wx:else >{{object.title}}</text>
9 </view> 9 </view>
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <view class="scan_view" disable-scroll="true" bindtap='getScancode' style="top:{{top}}px;left:{{left}}px;" bindtouchmove="setTouchMove"> 15 <view class="scan_view" disable-scroll="true" bindtap='getScancode' style="top:{{top}}px;left:{{left}}px;" bindtouchmove="setTouchMove">
16 <view style="text-align: center;"> 16 <view style="text-align: center;">
17 <image class="cs-img" src="{{object.img}}"></image> 17 <image class="cs-img" src="{{object.img}}"></image>
18 - <view class="s_title" wx:if="{{object.title!=''}}"> 18 + <view class="s_title" style="line-height: 14rpx;" wx:if="{{object.title!=''}}">
19 <text wx:if="{{object.word_color}}" style="color:{{object.word_color}}">{{object.title}}</text> 19 <text wx:if="{{object.word_color}}" style="color:{{object.word_color}}">{{object.title}}</text>
20 <text wx:else>{{object.title}}</text> 20 <text wx:else>{{object.title}}</text>
21 </view> 21 </view>
components/diy_scan/diy_scan.wxss
1 .scan_view{ 1 .scan_view{
2 - position: fixed;z-index: 100; left: 0; top: 0; width: 100rpx; height: 100rpx; 2 + z-index: 100; left: 0; top: 0; width: 80rpx; height: 80rpx;
3 border-radius: 50%; background-color: rgba(125,125,2,0.5);box-shadow: #ccc 0px 0px 70px 1px; 3 border-radius: 50%; background-color: rgba(125,125,2,0.5);box-shadow: #ccc 0px 0px 70px 1px;
4 display: flex;align-items: center;justify-content: center; color: #f8f8f8; 4 display: flex;align-items: center;justify-content: center; color: #f8f8f8;
5 } 5 }
components/diy_service/diy_service.wxml
@@ -4,14 +4,14 @@ @@ -4,14 +4,14 @@
4 <view wx:if="{{userInfo}}" class="custom-service" bindtap="go_user" > 4 <view wx:if="{{userInfo}}" class="custom-service" bindtap="go_user" >
5 <view style="text-align: center;"> 5 <view style="text-align: center;">
6 <image class="cs-img" src="{{object.img}}"></image> 6 <image class="cs-img" src="{{object.img}}"></image>
7 - <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> 7 + <view class="s_title" style="line-height: 14rpx;" wx:if="{{object.title!=''}}">{{object.title}}</view>
8 </view> 8 </view>
9 </view> 9 </view>
10 10
11 <button wx:else class="custom-service" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> 11 <button wx:else class="custom-service" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
12 <view style="text-align: center;"> 12 <view style="text-align: center;">
13 <image class="cs-img" src="{{object.img}}"></image> 13 <image class="cs-img" src="{{object.img}}"></image>
14 - <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> 14 + <view class="s_title" style="line-height: 14rpx;" wx:if="{{object.title!=''}}">{{object.title}}</view>
15 </view> 15 </view>
16 </button> 16 </button>
17 </block> 17 </block>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <view class="custom-service cart-ico new_split" bindtap="con_weixin"> 20 <view class="custom-service cart-ico new_split" bindtap="con_weixin">
21 <view style="text-align: center;"> 21 <view style="text-align: center;">
22 <image class="cs-img" src="{{object.img}}"></image> 22 <image class="cs-img" src="{{object.img}}"></image>
23 - <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> 23 + <view class="s_title" style="line-height: 14rpx;" wx:if="{{object.title!=''}}">{{object.title}}</view>
24 </view> 24 </view>
25 </view> 25 </view>
26 </block> 26 </block>
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 <view class="custom-service cart-ico new_split" bindtap="contactService"> 29 <view class="custom-service cart-ico new_split" bindtap="contactService">
30 <view style="text-align: center;"> 30 <view style="text-align: center;">
31 <image class="cs-img" src="{{object.img}}"></image> 31 <image class="cs-img" src="{{object.img}}"></image>
32 - <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> 32 + <view class="s_title" style="line-height: 14rpx;" wx:if="{{object.title!=''}}">{{object.title}}</view>
33 </view> 33 </view>
34 </view> 34 </view>
35 </block> 35 </block>
36 \ No newline at end of file 36 \ No newline at end of file
components/diy_service/diy_service.wxss
1 -.custom-service{ width: 100rpx; height: 100rpx; border-radius: 50%; background-color: #fff;z-index: 100; 1 +.custom-service{ width: 80rpx; height: 80rpx; border-radius: 50%; background-color: #fff;z-index: 100;
2 border: 1px solid #adadad; box-shadow: 0 0 10px 2px #adadad; line-height: 28rpx; 2 border: 1px solid #adadad; box-shadow: 0 0 10px 2px #adadad; line-height: 28rpx;
3 - position: fixed; top: 40%; right: 2rpx; display: flex;align-items: center;justify-content: center;} 3 + right: 2rpx; display: flex;align-items: center;justify-content: center;}
4 4
5 .cs-img{ width: 36rpx; height: 36rpx;} 5 .cs-img{ width: 36rpx; height: 36rpx;}
6 .s_title{ font-size: 14rpx;} 6 .s_title{ font-size: 14rpx;}
7 \ No newline at end of file 7 \ No newline at end of file
components/diy_top_nav/diy_top_nav.js
@@ -20,11 +20,11 @@ Component({ @@ -20,11 +20,11 @@ Component({
20 }, 20 },
21 nav_frontColor:{ 21 nav_frontColor:{
22 type:String, 22 type:String,
23 - value:'#ffffff', 23 + value:'#000',
24 }, 24 },
25 nav_backgroundColor:{ 25 nav_backgroundColor:{
26 type:String, 26 type:String,
27 - value:'#ff7295', 27 + value:'#ffffff',
28 }, 28 },
29 is_share:{ 29 is_share:{
30 type:Boolean, 30 type:Boolean,
packageB/pages/zuhegou/index/index.js
@@ -20,6 +20,7 @@ Page({ @@ -20,6 +20,7 @@ Page({
20 showNum: false, 20 showNum: false,
21 haveAdded: false, 21 haveAdded: false,
22 imgDraw: {}, 22 imgDraw: {},
  23 + new_imgDraw:{},
23 id: 0, //获得活动id 24 id: 0, //获得活动id
24 page: 1, //第一页 25 page: 1, //第一页
25 no_more: 0, //没有更多 26 no_more: 0, //没有更多
@@ -38,6 +39,7 @@ Page({ @@ -38,6 +39,7 @@ Page({
38 sec_pick_index: 0, //门店选择的下标,地区选择之后的内页 39 sec_pick_index: 0, //门店选择的下标,地区选择之后的内页
39 userbuynum: false,//是否有超出购买次数,还是否可以购买。false 为可购买,true为不可购买 40 userbuynum: false,//是否有超出购买次数,还是否可以购买。false 为可购买,true为不可购买
40 sales_map: {}, //线下销售的map 41 sales_map: {}, //线下销售的map
  42 + fxShow:false,//分享是否显示
41 }, 43 },
42 44
43 /** 45 /**
@@ -614,6 +616,8 @@ Page({ @@ -614,6 +616,8 @@ Page({
614 th.get_head_temp(function () { 616 th.get_head_temp(function () {
615 var txt = th.data.act.zhprice + "元" + th.data.act.zhbuyqty + "件"; 617 var txt = th.data.act.zhprice + "元" + th.data.act.zhbuyqty + "件";
616 var imgDraw = th.data.imgDraw; 618 var imgDraw = th.data.imgDraw;
  619 + // console.error('头像地址1');
  620 + // console.error(th.data.share_head);
617 imgDraw.views[0].url = th.data.share_head; 621 imgDraw.views[0].url = th.data.share_head;
618 imgDraw.views[1].text = userInfo.nickname; 622 imgDraw.views[1].text = userInfo.nickname;
619 imgDraw.views[3].text = txt; 623 imgDraw.views[3].text = txt;
@@ -634,7 +638,14 @@ Page({ @@ -634,7 +638,14 @@ Page({
634 imgDraw.views[2].url = path22; 638 imgDraw.views[2].url = path22;
635 imgDraw.views[5].url = vpath; 639 imgDraw.views[5].url = vpath;
636 th.setData({ 640 th.setData({
637 - imgDraw: imgDraw 641 + // ['imgDraw.views[0].url']:imgDraw.views[0].url,
  642 + // ['imgDraw.views[1].text']:imgDraw.views[1].text,
  643 + // ['imgDraw.views[2].text']:imgDraw.views[2].text,
  644 + // ['imgDraw.views[3].text']:imgDraw.views[3].text,
  645 + // ['imgDraw.views[4].text']:imgDraw.views[4].url,
  646 + imgDraw: imgDraw,
  647 + new_imgDraw:imgDraw,
  648 + fxShow:true
638 }) 649 })
639 } 650 }
640 }) 651 })
@@ -649,6 +660,8 @@ Page({ @@ -649,6 +660,8 @@ Page({
649 th.get_head_temp(function () { 660 th.get_head_temp(function () {
650 var imgDraw = th.data.imgDraw; 661 var imgDraw = th.data.imgDraw;
651 var txt = th.data.act.zhprice + "元" + th.data.act.zhbuyqty + "件"; 662 var txt = th.data.act.zhprice + "元" + th.data.act.zhbuyqty + "件";
  663 + // console.error('头像地址2');
  664 + // console.error(th.data.share_head);
652 imgDraw.views[0].url = th.data.share_head; 665 imgDraw.views[0].url = th.data.share_head;
653 imgDraw.views[1].text = userInfo.nickname; 666 imgDraw.views[1].text = userInfo.nickname;
654 imgDraw.views[2].text = txt; 667 imgDraw.views[2].text = txt;
@@ -670,7 +683,14 @@ Page({ @@ -670,7 +683,14 @@ Page({
670 var vpath = res.path; 683 var vpath = res.path;
671 imgDraw.views[4].url = vpath; 684 imgDraw.views[4].url = vpath;
672 th.setData({ 685 th.setData({
673 - imgDraw: imgDraw 686 + // ['imgDraw.views[0].url']:imgDraw.views[0].url,
  687 + // ['imgDraw.views[1].text']:imgDraw.views[1].text,
  688 + // ['imgDraw.views[2].text']:imgDraw.views[2].text,
  689 + // ['imgDraw.views[3].text']:imgDraw.views[3].text,
  690 + // ['imgDraw.views[4].url']:imgDraw.views[4].url,
  691 + imgDraw: imgDraw,
  692 + new_imgDraw:imgDraw,
  693 + fxShow:true
674 }) 694 })
675 } 695 }
676 }) 696 })
@@ -1442,7 +1462,9 @@ Page({ @@ -1442,7 +1462,9 @@ Page({
1442 }, 1462 },
1443 1463
1444 onImgOK(e) { 1464 onImgOK(e) {
1445 - console.log(e.detail.path); 1465 + // console.error('绘制返回------------');
  1466 + // console.error(e);
  1467 + // console.log(e.detail.path);
1446 this.setData({ 1468 this.setData({
1447 myimg: e.detail.path, 1469 myimg: e.detail.path,
1448 }); 1470 });
@@ -1541,7 +1563,8 @@ Page({ @@ -1541,7 +1563,8 @@ Page({
1541 //---获取分享图片的本地地址,头像和商品图片---- 1563 //---获取分享图片的本地地址,头像和商品图片----
1542 var path2 = getApp().globalData.userInfo.head_pic; 1564 var path2 = getApp().globalData.userInfo.head_pic;
1543 if (path2 == "") { 1565 if (path2 == "") {
1544 - ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; 1566 + // ee.data.share_head = "../../../../images/share/hui_hear_pic.png";
  1567 + ee.data.share_head = "https://mshopimg.yolipai.net//miniapp/images/no-head.jpg";
1545 tt(); 1568 tt();
1546 } else { 1569 } else {
1547 path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); 1570 path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
@@ -1555,7 +1578,8 @@ Page({ @@ -1555,7 +1578,8 @@ Page({
1555 tt(); 1578 tt();
1556 }, 1579 },
1557 fail: function () { 1580 fail: function () {
1558 - ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 1581 + ee.data.share_head = "https://mshopimg.yolipai.net//miniapp/images/no-head.jpg";
  1582 + // ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
1559 tt(); 1583 tt();
1560 } 1584 }
1561 }); 1585 });
packageB/pages/zuhegou/index/index.wxml
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
98 </view> 98 </view>
99 </view> 99 </view>
100 <!-- 分享 --> 100 <!-- 分享 -->
101 - <view wx:if="{{imgDraw}}" class="share-container" bindtap="share"> 101 + <view wx:if="{{imgDraw && fxShow}}" class="share-container" bindtap="share">
102 <text class="iconfont icon-zhuanfa fs40"></text> 102 <text class="iconfont icon-zhuanfa fs40"></text>
103 <view class="fs22 c-8">分享</view> 103 <view class="fs22 c-8">分享</view>
104 </view> 104 </view>
@@ -155,7 +155,9 @@ @@ -155,7 +155,9 @@
155 155
156 </view> 156 </view>
157 157
158 -<painter style="position: absolute; top: -9999rpx;" palette="{{imgDraw}}" bind:imgOK="onImgOK"/> 158 +
  159 + <painter style="position: absolute; top: -9999rpx;" palette="{{imgDraw}}" bind:imgOK="onImgOK"/>
  160 +
159 <!-- 活动异常提醒 --> 161 <!-- 活动异常提醒 -->
160 <catch wx:if="{{error}}">{{error}}</catch> 162 <catch wx:if="{{error}}">{{error}}</catch>
161 <warn id="warn"></warn> 163 <warn id="warn"></warn>
pages/index/index/index.js
1 var e = function (e) { 1 var e = function (e) {
2 - return e && e.__esModule ? e : {  
3 - default: e  
4 - }; 2 + return e && e.__esModule ? e : {
  3 + default: e
  4 + };
5 }(require("../../../utils/LoadMore.js")), 5 }(require("../../../utils/LoadMore.js")),
6 - t = getApp(),  
7 - a = t.request,  
8 - o = t.globalData.setting,  
9 - os = o,  
10 - i = require("../../../utils/util.js"),  
11 - ut = i,  
12 - s = require("../../../utils/common.js"),  
13 - n = new e.default(); 6 + t = getApp(),
  7 + a = t.request,
  8 + o = t.globalData.setting,
  9 + os = o,
  10 + i = require("../../../utils/util.js"),
  11 + ut = i,
  12 + s = require("../../../utils/common.js"),
  13 + n = new e.default();
14 var regeneratorRuntime = require('../../../utils/runtime.js'); 14 var regeneratorRuntime = require('../../../utils/runtime.js');
15 var api = require('../../../api/api.js'); 15 var api = require('../../../api/api.js');
16 var d = getApp().globalData; 16 var d = getApp().globalData;
17 - 17 +
18 var full_screen = require('full_screen.js'); 18 var full_screen = require('full_screen.js');
19 19
20 20
21 Page({ 21 Page({
22 - data: {  
23 - url: o.imghost,  
24 - swiperimage: [{  
25 - image: "/miniapp/images/title.png",  
26 - nav_url: 0  
27 - }],  
28 - resourceUrl: o.resourceUrl,  
29 - logo: o.appLogo,  
30 - homeData: null,  
31 - saleGoods: null,  
32 - sale: {  
33 - countTime: {  
34 - hour: 0,  
35 - minute: 0,  
36 - second: 0  
37 - },  
38 - diffTime: 0,  
39 - good: null,  
40 - },  
41 - timer: null,  
42 - recommend: null,  
43 - scrollTop: 0,  
44 - currentPage: 1,  
45 - banner: null,  
46 -  
47 - appdata: null,  
48 - saleGoods: null, //秒杀数据  
49 - pindGoods: null, //拼单数据  
50 - newGoods: null, //新商品  
51 - hotGoods: null, //hot商品  
52 - preGoods: null, //预售商品  
53 - //----控制是是否显示计时器---  
54 - is_timer: 1,  
55 - ishow: 0,  
56 - //是不是显示自定义模板  
57 - isTemplate: 0,  
58 - template_arr: null,  
59 - bgcolor_t: '',  
60 -  
61 - banner_index: 0,  
62 - flash_index: 0,  
63 - pt_index: 0,  
64 -  
65 - pt_timer_item: null,  
66 - pt_timer_arr: null,  
67 - pt_timer: null,  
68 - pt_timer_active: 0,  
69 - //看下商家是否开通会员权益  
70 - is_boot: 0,  
71 - gd_category: null,  
72 - is_no_more: 0,  
73 - max_sw_height: 0, //banner的最大高度  
74 - is_disgraceful: 0, //是否显示新人广告  
75 - new_image: "", //新人有礼弹窗图片  
76 - new_nav: "", //新人页面跳转地址  
77 - w_holiday_pop: 0,  
78 -  
79 - showHongbao: false,  
80 - showHongbaoSmall: false,  
81 - goodsGroupArr:[], //商品模块列表  
82 - is_full_screen_show: 0, //全屏显示  
83 - sec_show: 3, //倒计时的秒数  
84 - full_ad: null, //全屏广告  
85 - full_screen: 0, //全屏广告  
86 - is_ok_h5: 0, //判断要不要显示关注二维码  
87 - mb_banner:{},//首页广告  
88 - container: null,  
89 - is_retail_price:0,  
90 - },  
91 -  
92 -  
93 - onLoad: async function (tt) { 22 + data: {
  23 + url: o.imghost,
  24 + swiperimage: [{
  25 + image: "/miniapp/images/title.png",
  26 + nav_url: 0
  27 + }],
  28 + resourceUrl: o.resourceUrl,
  29 + logo: o.appLogo,
  30 + homeData: null,
  31 + saleGoods: null,
  32 + sale: {
  33 + countTime: {
  34 + hour: 0,
  35 + minute: 0,
  36 + second: 0
  37 + },
  38 + diffTime: 0,
  39 + good: null,
  40 + },
  41 + timer: null,
  42 + recommend: null,
  43 + scrollTop: 0,
  44 + currentPage: 1,
  45 + banner: null,
  46 +
  47 + appdata: null,
  48 + saleGoods: null, //秒杀数据
  49 + pindGoods: null, //拼单数据
  50 + newGoods: null, //新商品
  51 + hotGoods: null, //hot商品
  52 + preGoods: null, //预售商品
  53 + //----控制是是否显示计时器---
  54 + is_timer: 1,
  55 + ishow: 0,
  56 + //是不是显示自定义模板
  57 + isTemplate: 0,
  58 + template_arr: null,
  59 + bgcolor_t: '',
  60 +
  61 + banner_index: 0,
  62 + flash_index: 0,
  63 + pt_index: 0,
  64 +
  65 + pt_timer_item: null,
  66 + pt_timer_arr: null,
  67 + pt_timer: null,
  68 + pt_timer_active: 0,
  69 + //看下商家是否开通会员权益
  70 + is_boot: 0,
  71 + gd_category: null,
  72 + is_no_more: 0,
  73 + max_sw_height: 0, //banner的最大高度
  74 + is_disgraceful: 0, //是否显示新人广告
  75 + new_image: "", //新人有礼弹窗图片
  76 + new_nav: "", //新人页面跳转地址
  77 + w_holiday_pop: 0,
  78 +
  79 + showHongbao: false,
  80 + showHongbaoSmall: false,
  81 + goodsGroupArr: [], //商品模块列表
  82 + is_full_screen_show: 0, //全屏显示
  83 + sec_show: 3, //倒计时的秒数
  84 + full_ad: null, //全屏广告
  85 + full_screen: 0, //全屏广告
  86 + is_ok_h5: 0, //判断要不要显示关注二维码
  87 + mb_banner: {},//首页广告
  88 + container: null,
  89 + is_retail_price: 0,
  90 + //满屏顶部导航参数------------
  91 + is_full_screen_navigation: false, //是否满屏
  92 + is_full_screen_navigation_index: -1, //广告轮播满屏下标
  93 + nav_title: '首页',
  94 + nav_frontColor: "#000",
  95 + nav_backgroundColor: "#fff",
  96 + nav_type: 1, //导航类型
  97 + searchbox_transparent: 1, //搜索框背景是否透明
  98 + is_show_top:0, //是否置顶显示
  99 + // nav_but_color: '#32ACF9', //导航按钮颜色
  100 + // sele_pickup: null, //默认门店
  101 + // nav_bg_color:'#e823e8', //导航按钮颜色
  102 + //----------------
  103 + },
  104 +
  105 +
  106 + onLoad: async function (tt) {
94 wx.offCopyUrl() 107 wx.offCopyUrl()
95 - wx.showShareMenu({  
96 - withShareTicket:true,  
97 - menus:['shareAppMessage','shareTimeline']  
98 - })  
99 - var th = this; 108 + wx.showShareMenu({
  109 + withShareTicket: true,
  110 + menus: ['shareAppMessage', 'shareTimeline']
  111 + })
  112 + var th = this;
100 var first_leader = tt.first_leader; 113 var first_leader = tt.first_leader;
101 - //群id  
102 - if(tt && tt.groupchat_id && tt.groupchat_id!='undefined' && tt.groupchat_id!='null'){  
103 - getApp().globalData.groupchat_id=tt.groupchat_id 114 + //群id
  115 + if (tt && tt.groupchat_id && tt.groupchat_id != 'undefined' && tt.groupchat_id != 'null') {
  116 + getApp().globalData.groupchat_id = tt.groupchat_id
104 } 117 }
105 - if (!first_leader && tt.scene) {  
106 - var first_leader_str = decodeURIComponent(tt.scene);  
107 - var f_arr = first_leader_str.split("_");  
108 - first_leader = f_arr[0] && parseFloat(f_arr[0]) > 0 ? f_arr[0] : null;  
109 - //注册门店  
110 - if (f_arr[1] && parseFloat(f_arr[1]) > 0) {  
111 - getApp().globalData.store_number = f_arr[1]; 118 + if (!first_leader && tt.scene) {
  119 + var first_leader_str = decodeURIComponent(tt.scene);
  120 + var f_arr = first_leader_str.split("_");
  121 + first_leader = f_arr[0] && parseFloat(f_arr[0]) > 0 ? f_arr[0] : null;
  122 + //注册门店
  123 + if (f_arr[1] && parseFloat(f_arr[1]) > 0) {
  124 + getApp().globalData.store_number = f_arr[1];
112 } 125 }
113 //企业微信群id 126 //企业微信群id
114 - if (f_arr[2] && parseFloat(f_arr[2]) > 0) {  
115 - getApp().globalData.groupchat_id = f_arr[2]; 127 + if (f_arr[2] && parseFloat(f_arr[2]) > 0) {
  128 + getApp().globalData.groupchat_id = f_arr[2];
116 } 129 }
117 - 130 +
118 } 131 }
119 // console.error('群id------------------------------------------'); 132 // console.error('群id------------------------------------------');
120 // console.error(getApp().globalData.groupchat_id); 133 // console.error(getApp().globalData.groupchat_id);
121 // console.error('群id------------------------------------------2222222222222222222222'); 134 // console.error('群id------------------------------------------2222222222222222222222');
122 // getApp().globalData.groupchat_id=1 135 // getApp().globalData.groupchat_id=1
123 - console.log("first_leader:"+first_leader,"onload");  
124 -  
125 -  
126 - getApp().getConfig(function (e) {  
127 - //--首页的问题--  
128 - if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) {  
129 - wx.setNavigationBarTitle({  
130 - title: getApp().globalData.config.store_name,  
131 - });  
132 - } else {  
133 - wx.setNavigationBarTitle({  
134 - title: getApp().globalData.setting.appName,  
135 - });  
136 - };  
137 - });  
138 -  
139 -  
140 - var th = this;  
141 - getApp().getConfig2(function (config2) {  
142 - var swithc_list = config2.switch_list;  
143 - var sw_arr = JSON.parse(swithc_list);  
144 - if(sw_arr.is_retail_price){  
145 - th.setData({is_retail_price:1});  
146 - }  
147 -  
148 - if (config2 && config2.is_overdue == 1) {  
149 - getApp().promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=5", {}).then(res => {  
150 - var o = res;  
151 - if (o.data.code == 0) {  
152 - var ob = { isout: 0, isbuy: 1 };  
153 - var arr = o.data.data.pageData;  
154 - var isbuy = 0;  
155 - //----如果数组不为空----  
156 - if (arr.length > 0) {  
157 - arr.forEach(function (val, ind) {  
158 - if (val.is_sy == 0 && val.type == 5) {  
159 - isbuy = 1;  
160 - var now = ut.gettimestamp();  
161 - if (now > val.end_time) ob.isout = 1;  
162 - return false;  
163 - }  
164 - })  
165 - }  
166 - ob.isbuy = isbuy;  
167 -  
168 - var pages = getCurrentPages(); //获取加载的页面  
169 - var currentPage = pages[pages.length - 1]; //获取当前页面的对象  
170 -  
171 - // console.log("当前路由");  
172 - // console.log(currentPage.route);  
173 -  
174 -  
175 - th.setappdata(ob);  
176 -  
177 - if (ob.isbuy && !ob.isout) {  
178 - th.onload_init();  
179 - }  
180 - } else {  
181 - th.onload_init();  
182 - }  
183 - })  
184 - }  
185 - else {  
186 - th.onload_init();  
187 - }  
188 - })  
189 -  
190 - if (first_leader) {  
191 - //-- user_id代过来免登录 --  
192 - getApp().globalData.first_leader = first_leader;  
193 - //调用接口判断是不是会员  
194 - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {  
195 - if (res.data.code == 0) {  
196 - getApp().globalData.guide_id = res.data.data.id;  
197 - getApp().globalData.guide_pick_id= res.data.data.pickup_id  
198 - }  
199 - })  
200 -  
201 - if(!getApp().globalData.user_id){  
202 - ut.new_user_go(os.stoid,first_leader);  
203 - }  
204 -  
205 - }  
206 -  
207 - // 判断是否有红包活动  
208 - getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/' + getApp().globalData.setting.stoid, {  
209 - data: {}  
210 - }).then(function (data) { 136 + console.log("first_leader:" + first_leader, "onload");
  137 +
  138 +
  139 + getApp().getConfig(function (e) {
  140 + //--首页的问题--
  141 + if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) {
  142 + wx.setNavigationBarTitle({
  143 + title: getApp().globalData.config.store_name,
  144 + });
  145 + } else {
  146 + wx.setNavigationBarTitle({
  147 + title: getApp().globalData.setting.appName,
  148 + });
  149 + };
  150 + th.setData({
  151 + nav_title:getApp().globalData.config.store_name
  152 + })
  153 + });
  154 +
  155 +
  156 + var th = this;
  157 + getApp().getConfig2(function (config2) {
  158 + var swithc_list = config2.switch_list;
  159 + var sw_arr = JSON.parse(swithc_list);
  160 + if (sw_arr.is_retail_price) {
  161 + th.setData({ is_retail_price: 1 });
  162 + }
  163 +
  164 + if (config2 && config2.is_overdue == 1) {
  165 + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=5", {}).then(res => {
  166 + var o = res;
  167 + if (o.data.code == 0) {
  168 + var ob = { isout: 0, isbuy: 1 };
  169 + var arr = o.data.data.pageData;
  170 + var isbuy = 0;
  171 + //----如果数组不为空----
  172 + if (arr.length > 0) {
  173 + arr.forEach(function (val, ind) {
  174 + if (val.is_sy == 0 && val.type == 5) {
  175 + isbuy = 1;
  176 + var now = ut.gettimestamp();
  177 + if (now > val.end_time) ob.isout = 1;
  178 + return false;
  179 + }
  180 + })
  181 + }
  182 + ob.isbuy = isbuy;
  183 +
  184 + var pages = getCurrentPages(); //获取加载的页面
  185 + var currentPage = pages[pages.length - 1]; //获取当前页面的对象
  186 +
  187 + // console.log("当前路由");
  188 + // console.log(currentPage.route);
  189 +
  190 +
  191 + th.setappdata(ob);
  192 +
  193 + if (ob.isbuy && !ob.isout) {
  194 + th.onload_init();
  195 + }
  196 + } else {
  197 + th.onload_init();
  198 + }
  199 + })
  200 + }
  201 + else {
  202 + th.onload_init();
  203 + }
  204 + })
  205 +
  206 + if (first_leader) {
  207 + //-- user_id代过来免登录 --
  208 + getApp().globalData.first_leader = first_leader;
  209 + //调用接口判断是不是会员
  210 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  211 + if (res.data.code == 0) {
  212 + getApp().globalData.guide_id = res.data.data.id;
  213 + getApp().globalData.guide_pick_id = res.data.data.pickup_id
  214 + }
  215 + })
  216 +
  217 + if (!getApp().globalData.user_id) {
  218 + ut.new_user_go(os.stoid, first_leader);
  219 + }
  220 +
  221 + }
  222 +
  223 + // 判断是否有红包活动
  224 + getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/' + getApp().globalData.setting.stoid, {
  225 + data: {}
  226 + }).then(function (data) {
211 let code = data.data.code; 227 let code = data.data.code;
212 let resdata = data.data.data; 228 let resdata = data.data.data;
213 - if (code == 0 && resdata.is_index) {  
214 -  
215 - th.setData({  
216 - showHongbao: true,  
217 - });  
218 - } else if (code == -1) {  
219 - th.setData({  
220 - showHongbao: false,  
221 - });  
222 - };  
223 - });  
224 -  
225 -  
226 - // console.log(9090909);  
227 - //看一下商家是否开通了权益  
228 - //--初始化是否有打勾--  
229 - getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", {  
230 - data: {  
231 - storeId: os.stoid  
232 - }  
233 - }).then(res => {  
234 - if (res.data.data) {  
235 - var is_init = res.data.data.isBool;  
236 - th.setData({  
237 - is_boot: is_init  
238 - });  
239 -  
240 - if (!is_init) {  
241 - th.setData({  
242 - swiperimage: []  
243 - });  
244 - }  
245 - }  
246 - })  
247 -  
248 -  
249 - var share_openid= tt.share_openid;  
250 - if(share_openid){  
251 - this.get_room_share_guide(share_openid);  
252 - }  
253 -  
254 - //调用底部导航  
255 - //getApp().globalData.url=th.data.url  
256 - //t.editTabBar(th,o.stoid,th.data.url);  
257 -  
258 - },  
259 -  
260 -  
261 - async get_room_share_guide(share_openid){  
262 -  
263 - var url="/api/weshop/users/page";  
264 - var first_leader=0;  
265 -  
266 - //调用接口判断是不是会员  
267 - await getApp().request.promiseGet(url, {  
268 - data:{stoid:os.stoid,weapp_openid:share_openid}  
269 - }).then(res => {  
270 - if (ut.ajax_ok(res)) {  
271 - first_leader=res.data.data.pageData[0].user_id;  
272 - // getApp().globalData.guide_id = res.data.data.id;  
273 - }  
274 - })  
275 - if(!first_leader) return false;  
276 -  
277 - getApp().globalData.first_leader = first_leader;  
278 - //调用接口判断是不是会员  
279 - await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {  
280 - if (res.data.code == 0) {  
281 - getApp().globalData.guide_id = res.data.data.id;  
282 - getApp().globalData.guide_pick_id= res.data.data.pickup_id  
283 - }  
284 - })  
285 -  
286 - },  
287 -  
288 -  
289 - async onload_init() {  
290 - var th = this;  
291 - await this.init_load();  
292 - //显示的时候要开启计时器  
293 - this.data.is_timer = 1;  
294 - //如果是自定义模板  
295 - if (this.data.isTemplate) {  
296 - //---先获取会员---  
297 - //t.getUserFir(function () {  
298 - if (getApp().globalData.user_id) {  
299 - th.is_festival();  
300 - var new_nav = th.data.new_nav;  
301 - if (new_nav == "") {  
302 - th.is_new();  
303 - }  
304 - // sty  
305 - setTimeout(function () {  
306 - if (getApp().globalData.user_id) getApp().requestCardNum(th);  
307 - }, 500)  
308 - }  
309 -  
310 - //});  
311 - } else {  
312 - await this.init_fir();  
313 - wx.setNavigationBarColor({  
314 - frontColor: '#ffffff', // 必写项  
315 - backgroundColor: '#ff7295', // 必写项  
316 - })  
317 - }  
318 -  
319 - //--正再拼团中的处理--  
320 - var url = "/api/weshop/order/pageTuanNew?pt_status=2&is_pt=1&store_id=" + os.stoid + "&pageSize=6&page=1"  
321 - await getApp().request.promiseGet(url, {}).then(res => {  
322 - if (res.data.code == 0 && res.data.data && res.data.data.pageData) {  
323 - th.data.pt_timer_arr = res.data.data.pageData;  
324 - }  
325 - })  
326 - if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) {  
327 - for (var i in th.data.pt_timer_arr) {  
328 - var p_item = th.data.pt_timer_arr[i];  
329 - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, {  
330 - 1: 1  
331 - }).then(res => {  
332 - th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic;  
333 - th.data.pt_timer_arr[i].nickname = res.data.data.nickname;  
334 - })  
335 - }  
336 - th.Interval_pt();  
337 - }  
338 -  
339 - //---处理正在6个分类----  
340 - await getApp().request.promiseGet("/api/weshop/goodscategory/page", {  
341 - data: {  
342 - store_id: os.stoid,  
343 - pageSize: 5,  
344 - is_show: 1,  
345 - level: 1  
346 - }  
347 - }).then(res => {  
348 - if (res.data.data) {  
349 - var gd_category = res.data.data.pageData;  
350 - th.setData({  
351 - gd_category: gd_category  
352 - });  
353 - }  
354 - }) 229 + if (code == 0 && resdata.is_index) {
  230 +
  231 + th.setData({
  232 + showHongbao: true,
  233 + });
  234 + } else if (code == -1) {
  235 + th.setData({
  236 + showHongbao: false,
  237 + });
  238 + };
  239 + });
  240 +
  241 +
  242 + // console.log(9090909);
  243 + //看一下商家是否开通了权益
  244 + //--初始化是否有打勾--
  245 + getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", {
  246 + data: {
  247 + storeId: os.stoid
  248 + }
  249 + }).then(res => {
  250 + if (res.data.data) {
  251 + var is_init = res.data.data.isBool;
  252 + th.setData({
  253 + is_boot: is_init
  254 + });
  255 +
  256 + if (!is_init) {
  257 + th.setData({
  258 + swiperimage: []
  259 + });
  260 + }
  261 + }
  262 + })
  263 +
  264 +
  265 + var share_openid = tt.share_openid;
  266 + if (share_openid) {
  267 + this.get_room_share_guide(share_openid);
  268 + }
  269 +
  270 + //调用底部导航
  271 + //getApp().globalData.url=th.data.url
  272 + //t.editTabBar(th,o.stoid,th.data.url);
  273 +
  274 + },
  275 +
  276 +
  277 + async get_room_share_guide(share_openid) {
  278 +
  279 + var url = "/api/weshop/users/page";
  280 + var first_leader = 0;
  281 +
  282 + //调用接口判断是不是会员
  283 + await getApp().request.promiseGet(url, {
  284 + data: { stoid: os.stoid, weapp_openid: share_openid }
  285 + }).then(res => {
  286 + if (ut.ajax_ok(res)) {
  287 + first_leader = res.data.data.pageData[0].user_id;
  288 + // getApp().globalData.guide_id = res.data.data.id;
  289 + }
  290 + })
  291 + if (!first_leader) return false;
  292 +
  293 + getApp().globalData.first_leader = first_leader;
  294 + //调用接口判断是不是会员
  295 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  296 + if (res.data.code == 0) {
  297 + getApp().globalData.guide_id = res.data.data.id;
  298 + getApp().globalData.guide_pick_id = res.data.data.pickup_id
  299 + }
  300 + })
  301 +
  302 + },
  303 +
  304 +
  305 + async onload_init() {
  306 + var th = this;
  307 + await this.init_load();
  308 + //显示的时候要开启计时器
  309 + this.data.is_timer = 1;
  310 + //如果是自定义模板
  311 + if (this.data.isTemplate) {
  312 + //---先获取会员---
  313 + //t.getUserFir(function () {
  314 + if (getApp().globalData.user_id) {
  315 + th.is_festival();
  316 + var new_nav = th.data.new_nav;
  317 + if (new_nav == "") {
  318 + th.is_new();
  319 + }
  320 + // sty
  321 + setTimeout(function () {
  322 + if (getApp().globalData.user_id) getApp().requestCardNum(th);
  323 + }, 500)
  324 + }
  325 +
  326 + //});
  327 + } else {
  328 + await this.init_fir();
  329 + wx.setNavigationBarColor({
  330 + frontColor: '#ffffff', // 必写项
  331 + backgroundColor: '#ff7295', // 必写项
  332 + })
  333 + this.setData({
  334 + nav_frontColor: '#000', // 必写项
  335 + nav_backgroundColor: '#fff', // 必写项
  336 + })
  337 + }
  338 +
  339 + //--正再拼团中的处理--
  340 + var url = "/api/weshop/order/pageTuanNew?pt_status=2&is_pt=1&store_id=" + os.stoid + "&pageSize=6&page=1"
  341 + await getApp().request.promiseGet(url, {}).then(res => {
  342 + if (res.data.code == 0 && res.data.data && res.data.data.pageData) {
  343 + th.data.pt_timer_arr = res.data.data.pageData;
  344 + }
  345 + })
  346 + if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) {
  347 + for (var i in th.data.pt_timer_arr) {
  348 + var p_item = th.data.pt_timer_arr[i];
  349 + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, {
  350 + 1: 1
  351 + }).then(res => {
  352 + th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic;
  353 + th.data.pt_timer_arr[i].nickname = res.data.data.nickname;
  354 + })
  355 + }
  356 + th.Interval_pt();
  357 + }
  358 +
  359 + //---处理正在6个分类----
  360 + await getApp().request.promiseGet("/api/weshop/goodscategory/page", {
  361 + data: {
  362 + store_id: os.stoid,
  363 + pageSize: 5,
  364 + is_show: 1,
  365 + level: 1
  366 + }
  367 + }).then(res => {
  368 + if (res.data.data) {
  369 + var gd_category = res.data.data.pageData;
  370 + th.setData({
  371 + gd_category: gd_category
  372 + });
  373 + }
  374 + })
355 }, 375 },
356 - onReady(){ 376 + onReady() {
357 console.log('渲染完成----') 377 console.log('渲染完成----')
358 console.log(this.data.template_arr); 378 console.log(this.data.template_arr);
359 console.log('....................'); 379 console.log('....................');
360 }, 380 },
361 381
362 //获取商品模块实例 382 //获取商品模块实例
363 - newGoodsGroup(){  
364 - let arr=[] 383 + newGoodsGroup() {
  384 + let arr = []
365 if (this.data.template_arr.length == 0) { 385 if (this.data.template_arr.length == 0) {
366 return 386 return
367 } 387 }
368 - this.data.template_arr.map((item,index)=>{ 388 + this.data.template_arr.map((item, index) => {
369 if (item.ename == 'goodsGroup') { 389 if (item.ename == 'goodsGroup') {
370 arr.push(`goodsGroup${index}`) 390 arr.push(`goodsGroup${index}`)
371 } 391 }
372 }) 392 })
373 if (arr.length > 0) { 393 if (arr.length > 0) {
374 this.setData({ 394 this.setData({
375 - goodsGroupArr : arr 395 + goodsGroupArr: arr
376 }) 396 })
377 - arr.map(item=>{  
378 - let a = '.'+item 397 + arr.map(item => {
  398 + let a = '.' + item
379 this[item] = this.selectComponent(a); 399 this[item] = this.selectComponent(a);
380 }) 400 })
381 } 401 }
382 }, 402 },
383 403
384 - //关闭新用户领取广告  
385 - close_disgraceful: function () {  
386 - var th = this;  
387 - th.setData({  
388 - is_disgraceful: 0  
389 - })  
390 - },  
391 -  
392 - async onShow() {  
393 -  
394 - //-- 看一下隐私政策要不要显示 --  
395 - var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id  
396 - if (privacy_pop) {  
397 - privacy_pop.check_pri_show();  
398 - }  
399 -  
400 - getApp().check_can_share();  
401 - if (typeof this.getTabBar === 'function' && this.getTabBar()) {  
402 - this.getTabBar().setData({  
403 - cartGoodsNum: getApp().globalData.cartGoodsNum  
404 - })  
405 - }  
406 - var th = this;  
407 - //-- 登录回来判断弹框 --  
408 - var user_id = getApp().globalData.user_id;  
409 -  
410 - if (!user_id) {  
411 - var userinfo = wx.getStorageSync('userinfo');  
412 - if (userinfo) user_id = userinfo.user_id  
413 - }  
414 -  
415 - if (user_id) {  
416 - th.is_festival();  
417 - var new_nav = th.data.new_nav;  
418 - if (new_nav == "") {  
419 - th.is_new();  
420 - }  
421 - }  
422 -  
423 - console.log(this.data.isTemplate, '首页');  
424 -  
425 - if (!this.data.isTemplate) {  
426 - //timetype: 1 仅查询已预售 置空查询全部,  
427 - var pre_data = { store_id: os.stoid, is_end: 0, isuse: 1,timetype:3 };  
428 - if (user_id) {  
429 - pre_data.user_id = user_id;  
430 - }  
431 -  
432 - getApp().request.get("/api/weshop/marketing/marketingPresellList/page", {  
433 - data: pre_data,  
434 - success: function (e) {  
435 - if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { 404 + //关闭新用户领取广告
  405 + close_disgraceful: function () {
  406 + var th = this;
  407 + th.setData({
  408 + is_disgraceful: 0
  409 + })
  410 + },
  411 +
  412 + async onShow() {
  413 +
  414 + //-- 看一下隐私政策要不要显示 --
  415 + var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
  416 + if (privacy_pop) {
  417 + privacy_pop.check_pri_show();
  418 + }
  419 +
  420 + getApp().check_can_share();
  421 + if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  422 + this.getTabBar().setData({
  423 + cartGoodsNum: getApp().globalData.cartGoodsNum
  424 + })
  425 + }
  426 + var th = this;
  427 + //-- 登录回来判断弹框 --
  428 + var user_id = getApp().globalData.user_id;
  429 +
  430 + if (!user_id) {
  431 + var userinfo = wx.getStorageSync('userinfo');
  432 + if (userinfo) user_id = userinfo.user_id
  433 + }
  434 +
  435 + if (user_id) {
  436 + th.is_festival();
  437 + var new_nav = th.data.new_nav;
  438 + if (new_nav == "") {
  439 + th.is_new();
  440 + }
  441 + }
  442 +
  443 + console.log(this.data.isTemplate, '首页');
  444 +
  445 + if (!this.data.isTemplate) {
  446 + //timetype: 1 仅查询已预售 置空查询全部,
  447 + var pre_data = { store_id: os.stoid, is_end: 0, isuse: 1, timetype: 3 };
  448 + if (user_id) {
  449 + pre_data.user_id = user_id;
  450 + }
  451 +
  452 + getApp().request.get("/api/weshop/marketing/marketingPresellList/page", {
  453 + data: pre_data,
  454 + success: function (e) {
  455 + if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) {
436 var pre_data = e.data.data.pageData; 456 var pre_data = e.data.data.pageData;
437 //当前时间戳 457 //当前时间戳
438 var st = ut.gettimestamp(); 458 var st = ut.gettimestamp();
@@ -452,968 +472,1071 @@ Page({ @@ -452,968 +472,1071 @@ Page({
452 // pre_data[ind].status = 2; 472 // pre_data[ind].status = 2;
453 // } 473 // }
454 }); 474 });
455 - var arr = new Array();  
456 - //--三个三个一组---  
457 - for (var i = 0; i < pre_data.length; i += 3) {  
458 - arr.push(pre_data.slice(i, i + 3));  
459 - }  
460 - th.setData({  
461 - preGoods: arr  
462 - });  
463 - } else {  
464 - th.setData({  
465 - preGoods: null  
466 - });  
467 - }  
468 - }  
469 - })  
470 -  
471 - // 获取幸运购活动列表  
472 - getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', {  
473 - data: {  
474 - store_id: getApp().globalData.setting.stoid,  
475 - is_end: 0,  
476 - timetype: 1,  
477 - }  
478 - }).then(res => {  
479 - if (res.data.code == 0) {  
480 - th.setData({  
481 - luckGo_list: res.data.data.pageData.slice(0, 3),  
482 - });  
483 - }  
484 - });  
485 -  
486 - //-----秒杀-----  
487 - var flash_data = null;  
488 - var f_req = {  
489 - store_id: os.stoid,  
490 - timetype: 2,  
491 - is_end: 0,  
492 - is_show: 1,  
493 - pageSize: 9,  
494 - user_id: 0  
495 - };  
496 - if (user_id) f_req.user_id = user_id;  
497 - //--获取活动--  
498 - await getApp().request.promiseGet("/api/ms/flash_sale/spikepage", {  
499 - data: f_req,  
500 - }).then(res => {  
501 - var e = res;  
502 - if (e.data.code == 0) {  
503 - flash_data = e.data.data.pageData;  
504 - if (flash_data == null || flash_data.length <= 0) return false;  
505 -  
506 - //当前时间戳  
507 - var nt = ut.gettimestamp();  
508 -  
509 - flash_data.forEach(function (val, ind) {  
510 -  
511 - if (val.user_price) val.price = val.user_price;  
512 - if (val.start_time > nt) {  
513 - flash_data[ind].status = 0;  
514 - } else if (val.end_time > nt) {  
515 - flash_data[ind].status = 1;  
516 - }  
517 -  
518 - if (val.buy_num >= val.goods_num) {  
519 - flash_data[ind].status = 2;  
520 - }  
521 - });  
522 -  
523 - var promisies = [];  
524 - for (const key in flash_data) {  
525 - if (Object.hasOwnProperty.call(flash_data, key)) {  
526 - const val = flash_data[key];  
527 - promisies[key] = getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +  
528 - os.stoid + "/1/" + val.id,  
529 - {}  
530 - ).then(res => {  
531 - if (res.data.code == 0) {  
532 - if (res.data.data <= 0) flash_data[key].status = 2;  
533 - };  
534 - });  
535 - }  
536 - }  
537 -  
538 - Promise.all(promisies).then(() => {  
539 - var arr = new Array();  
540 - //--三个三个一组---  
541 - for (var i = 0; i < flash_data.length; i += 3) {  
542 - arr.push(flash_data.slice(i, i + 3));  
543 - }  
544 -  
545 - th.setData({  
546 - saleGoods: arr  
547 - });  
548 - });  
549 -  
550 -  
551 -  
552 - }  
553 - });  
554 -  
555 - }  
556 -  
557 -  
558 -  
559 -  
560 -  
561 -  
562 -  
563 -  
564 -  
565 - //优惠券要实时更新  
566 - getApp().getConfig2(function (e) {  
567 - var json_d = JSON.parse(e.switch_list);  
568 - th.setData({ is_closecoupon: json_d.is_closecoupon })  
569 - th.setData({ is_topstore: json_d.is_show_storeselect })  
570 - if (json_d.is_gz_h5) th.setData({ is_gz_h5: json_d.is_gz_h5 })  
571 - }, 1)  
572 -  
573 - if (typeof this.getTabBar === 'function' && this.getTabBar()) {  
574 - var index = getApp().getPageIndex(this);  
575 - this.getTabBar().setData({  
576 - active: index //数字是当前页面在tabbar的索引  
577 - })  
578 -  
579 -  
580 - getApp().requestCardNum(this);  
581 - }  
582 -  
583 - var th = this;  
584 -  
585 - var show = getApp().globalData.isLoad_ad;  
586 -  
587 - if (!show) {  
588 - setTimeout(function () {  
589 - full_screen.get_the_full_screen(th);  
590 - }, 800);  
591 - getApp().globalData.isLoad_ad = 1;  
592 - if (!th.data.f_hidden) {  
593 - setTimeout(function () {  
594 - th.setData({ f_hidden: 1 })  
595 - wx.hideLoading();  
596 - }, 960)  
597 - }  
598 - } else {  
599 - th.setData({ f_hidden: 1 })  
600 - }  
601 -  
602 - setTimeout(function () {  
603 - const query = wx.createSelectorQuery();  
604 - query.select('#off_top').boundingClientRect();  
605 - query.exec((res) => {  
606 - if (res && res[0] && res[0].height > 0) {  
607 - th.setData({ is_ok_h5: 1 });  
608 - }  
609 - })  
610 - }, 3600);  
611 -  
612 - },  
613 - //当隐藏的时候就关闭计时器  
614 - onHide: function () {  
615 - this.data.is_timer = 0;  
616 - if (this.data.pt_timer) clearInterval(this.data.pt_timer);  
617 - if (this.data.w_holiday_pop) clearInterval(this.data.w_holiday_pop);  
618 - if (this.data.full_screen) clearInterval(this.data.full_screen);  
619 - this.data.w_holiday_pop = 0;  
620 -  
621 - },  
622 -  
623 - //同步初始加载  
624 - async init_load() {  
625 - var th = this;  
626 - //因为营销版本的功能包含了自定义模板的功能,是同时的  
627 - //读取全局是否有弄自定义模板  
628 - await api.get_template_fir(o.stoid).then(res => {  
629 - var data = res.data.data;  
630 - if (data && data.length > 0) {  
631 - var temp_data = data[0];  
632 - var t_arr = JSON.parse(temp_data.json_str);  
633 - console.log('商品列表------------1')  
634 - console.log(t_arr)  
635 - console.log('商品列表------------2')  
636 - th.setData({  
637 - template_arr: t_arr,  
638 - isTemplate: 1,  
639 - bgcolor_t: temp_data.bkcolor 475 + var arr = new Array();
  476 + //--三个三个一组---
  477 + for (var i = 0; i < pre_data.length; i += 3) {
  478 + arr.push(pre_data.slice(i, i + 3));
  479 + }
  480 + th.setData({
  481 + preGoods: arr
  482 + });
  483 + } else {
  484 + th.setData({
  485 + preGoods: null
  486 + });
  487 + }
  488 + }
  489 + })
  490 +
  491 + // 获取幸运购活动列表
  492 + getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', {
  493 + data: {
  494 + store_id: getApp().globalData.setting.stoid,
  495 + is_end: 0,
  496 + timetype: 1,
  497 + }
  498 + }).then(res => {
  499 + if (res.data.code == 0) {
  500 + th.setData({
  501 + luckGo_list: res.data.data.pageData.slice(0, 3),
  502 + });
  503 + }
  504 + });
  505 +
  506 + //-----秒杀-----
  507 + var flash_data = null;
  508 + var f_req = {
  509 + store_id: os.stoid,
  510 + timetype: 2,
  511 + is_end: 0,
  512 + is_show: 1,
  513 + pageSize: 9,
  514 + user_id: 0
  515 + };
  516 + if (user_id) f_req.user_id = user_id;
  517 + //--获取活动--
  518 + await getApp().request.promiseGet("/api/ms/flash_sale/spikepage", {
  519 + data: f_req,
  520 + }).then(res => {
  521 + var e = res;
  522 + if (e.data.code == 0) {
  523 + flash_data = e.data.data.pageData;
  524 + if (flash_data == null || flash_data.length <= 0) return false;
  525 +
  526 + //当前时间戳
  527 + var nt = ut.gettimestamp();
  528 +
  529 + flash_data.forEach(function (val, ind) {
  530 +
  531 + if (val.user_price) val.price = val.user_price;
  532 + if (val.start_time > nt) {
  533 + flash_data[ind].status = 0;
  534 + } else if (val.end_time > nt) {
  535 + flash_data[ind].status = 1;
  536 + }
  537 +
  538 + if (val.buy_num >= val.goods_num) {
  539 + flash_data[ind].status = 2;
  540 + }
  541 + });
  542 +
  543 + var promisies = [];
  544 + for (const key in flash_data) {
  545 + if (Object.hasOwnProperty.call(flash_data, key)) {
  546 + const val = flash_data[key];
  547 + promisies[key] = getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  548 + os.stoid + "/1/" + val.id,
  549 + {}
  550 + ).then(res => {
  551 + if (res.data.code == 0) {
  552 + if (res.data.data <= 0) flash_data[key].status = 2;
  553 + };
  554 + });
  555 + }
  556 + }
  557 +
  558 + Promise.all(promisies).then(() => {
  559 + var arr = new Array();
  560 + //--三个三个一组---
  561 + for (var i = 0; i < flash_data.length; i += 3) {
  562 + arr.push(flash_data.slice(i, i + 3));
  563 + }
  564 +
  565 + th.setData({
  566 + saleGoods: arr
  567 + });
  568 + });
  569 +
  570 +
  571 +
  572 + }
  573 + });
  574 +
  575 + }
  576 +
  577 +
  578 +
  579 +
  580 +
  581 +
  582 +
  583 +
  584 +
  585 + //优惠券要实时更新
  586 + getApp().getConfig2(function (e) {
  587 + var json_d = JSON.parse(e.switch_list);
  588 + th.setData({ is_closecoupon: json_d.is_closecoupon })
  589 + th.setData({ is_topstore: json_d.is_show_storeselect })
  590 + if (json_d.is_gz_h5) th.setData({ is_gz_h5: json_d.is_gz_h5 })
  591 + }, 1)
  592 +
  593 + if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  594 + var index = getApp().getPageIndex(this);
  595 + this.getTabBar().setData({
  596 + active: index //数字是当前页面在tabbar的索引
  597 + })
  598 +
  599 +
  600 + getApp().requestCardNum(this);
  601 + }
  602 +
  603 + var th = this;
  604 +
  605 + var show = getApp().globalData.isLoad_ad;
  606 +
  607 + if (!show) {
  608 + setTimeout(function () {
  609 + full_screen.get_the_full_screen(th);
  610 + }, 800);
  611 + getApp().globalData.isLoad_ad = 1;
  612 + if (!th.data.f_hidden) {
  613 + setTimeout(function () {
  614 + th.setData({ f_hidden: 1 })
  615 + wx.hideLoading();
  616 + }, 960)
  617 + }
  618 + } else {
  619 + th.setData({ f_hidden: 1 })
  620 + }
  621 +
  622 + setTimeout(function () {
  623 + const query = wx.createSelectorQuery();
  624 + query.select('#off_top').boundingClientRect();
  625 + query.exec((res) => {
  626 + if (res && res[0] && res[0].height > 0) {
  627 + th.setData({ is_ok_h5: 1 });
  628 + }
  629 + })
  630 + }, 3600);
  631 +
  632 + },
  633 + //当隐藏的时候就关闭计时器
  634 + onHide: function () {
  635 + this.data.is_timer = 0;
  636 + if (this.data.pt_timer) clearInterval(this.data.pt_timer);
  637 + if (this.data.w_holiday_pop) clearInterval(this.data.w_holiday_pop);
  638 + if (this.data.full_screen) clearInterval(this.data.full_screen);
  639 + this.data.w_holiday_pop = 0;
  640 +
  641 + },
  642 +
  643 + //同步初始加载
  644 + async init_load() {
  645 + var th = this;
  646 + //因为营销版本的功能包含了自定义模板的功能,是同时的
  647 + //读取全局是否有弄自定义模板
  648 + await api.get_template_fir(o.stoid).then(res => {
  649 + var data = res.data.data;
  650 + if (data && data.length > 0) {
  651 + var temp_data = data[0];
  652 + var t_arr = JSON.parse(temp_data.json_str);
  653 +
  654 + //增加判断是否是满屏
  655 + let is_full_screen_navigation = false
  656 + let is_full_screen_navigation_index = -1
  657 + let nav_but_color = "#32ACF9"
  658 + let left_arr = [] //左边悬浮
  659 + let right_arr=[] //右边悬浮
  660 + let floatw=null //悬浮窗口
  661 + if (t_arr) {
  662 + t_arr.map((item, index) => {
  663 + if (item && item.content && item.content.full_screen == 1 && !is_full_screen_navigation) {
  664 + is_full_screen_navigation = true
  665 + is_full_screen_navigation_index = index
  666 + try {
  667 + nav_but_color = item.content.data[0].but_color
  668 + } catch (error) { }
  669 + }
  670 + if (item.ename=='floatingWindow') {
  671 + floatw = item
  672 + }
  673 + if (item.ename=='backTop' || item.ename=='onlineService' || item.ename=='scan' || item.ename=='floatingWindow') {
  674 + right_arr.push(item)
  675 + }
  676 + })
  677 + }
  678 + if (floatw && floatw.content) {
  679 + let fi = right_arr.findIndex(ite=>ite.ename=='floatingWindow')
  680 + let datas={}
  681 + if (!floatw.content.data) { //兼容旧的悬浮窗口
  682 + datas.AppId= floatw.content.AppId
  683 + datas.feedId= floatw.content.feedId
  684 + datas.finderUserName= floatw.content.finderUserName
  685 + datas.img=floatw.content.img
  686 + datas.video_type= floatw.content.video_type
  687 + datas.wxapp_url= floatw.content.wxapp_url
  688 + datas.wxapp_url_title=floatw.content.wxapp_url_title
  689 + floatw.content.data=[datas]
  690 + }
  691 + if (floatw.content.loaction_index==1) {
  692 + right_arr.splice(fi,1,floatw)
  693 + // right_arr.unshift(floatw)
  694 + }else{
  695 + left_arr.unshift(floatw)
  696 + right_arr.splice(fi,1)
  697 + }
  698 + }
  699 + if (left_arr.length>0) {
  700 + let obj={
  701 + ename:'floatingBox',
  702 + content:left_arr,
  703 + loaction_index:0
  704 + }
  705 + t_arr.push(obj)
  706 + }
  707 + if (right_arr.length>0) {
  708 + let obj={
  709 + ename:'floatingBox',
  710 + content:right_arr,
  711 + loaction_index:1
  712 + }
  713 + t_arr.push(obj)
  714 + }
  715 +
  716 +
  717 + th.setData({
  718 + nav_but_color,
  719 + is_full_screen_navigation,
  720 + is_full_screen_navigation_index,
  721 + template_arr: t_arr,
  722 + isTemplate: 1,
  723 + bgcolor_t: temp_data.bkcolor
640 }); 724 });
641 - setTimeout(()=>{ 725 + setTimeout(() => {
642 th.newGoodsGroup() 726 th.newGoodsGroup()
643 - },1000)  
644 - //---如果有设定顶部的颜色的时候--  
645 - if (temp_data.top_color && temp_data.top_color != 'null') {  
646 -  
647 - var top_w_color = "#ffffff";  
648 - if (temp_data.top_word_color && temp_data.top_word_color == 'black') {  
649 - top_w_color = "#000000";  
650 - }  
651 - wx.setNavigationBarColor({  
652 - frontColor: top_w_color, // 必写项  
653 - backgroundColor: temp_data.top_color, // 必写项  
654 - })  
655 - }  
656 - }  
657 - })  
658 -  
659 -  
660 - },  
661 - //---读取数据内容---  
662 - async init_fir() {  
663 - console.log('init_fir');  
664 - var th = this;  
665 - //----广告----  
666 - var e = this;  
667 - await getApp().request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + o.stoid, {  
668 - data: {  
669 - enabled: 1  
670 - }  
671 - }).then(res => {  
672 -  
673 - if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) {  
674 - var a = res.data.data.pageData;  
675 - var arr = new Array();  
676 - for (var i = 0; i < a.length; i++) {  
677 - var tt = {  
678 - 'ad_code': o.imghost + a[i].ad_code,  
679 - 'media_link': '',  
680 - 'ad_weapplink': a[i].ad_weapplink  
681 - };  
682 - arr.push(tt);  
683 - }  
684 - if (arr.length > 0) e.setData({  
685 - banner: arr,  
686 - });  
687 -  
688 - wx.stopPullDownRefresh();  
689 - }  
690 - })  
691 - let user_id = getApp().globalData.user_id; 727 + }, 1000)
  728 + //---如果有设定顶部的颜色的时候--
  729 + if (temp_data.top_color && temp_data.top_color != 'null') {
  730 +
  731 + var top_w_color = "#ffffff";
  732 + if (temp_data.top_word_color && temp_data.top_word_color == 'black') {
  733 + top_w_color = "#000000";
  734 + }
  735 + wx.setNavigationBarColor({
  736 + frontColor: top_w_color, // 必写项
  737 + backgroundColor: temp_data.top_color, // 必写项
  738 + })
  739 + th.setData({
  740 + // nav_frontColor: top_w_color, // 必写项
  741 + nav_backgroundColor: temp_data.top_color, // 必写项
  742 + })
  743 + }
  744 + }
  745 + })
  746 +
  747 +
  748 + },
  749 + //---读取数据内容---
  750 + async init_fir() {
  751 + console.log('init_fir');
  752 + var th = this;
  753 + //----广告----
  754 + var e = this;
  755 + await getApp().request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + o.stoid, {
  756 + data: {
  757 + enabled: 1
  758 + }
  759 + }).then(res => {
  760 +
  761 + if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) {
  762 + var a = res.data.data.pageData;
  763 + var arr = new Array();
  764 + for (var i = 0; i < a.length; i++) {
  765 + var tt = {
  766 + 'ad_code': o.imghost + a[i].ad_code,
  767 + 'media_link': '',
  768 + 'ad_weapplink': a[i].ad_weapplink
  769 + };
  770 + arr.push(tt);
  771 + }
  772 + if (arr.length > 0) e.setData({
  773 + banner: arr,
  774 + });
  775 +
  776 + wx.stopPullDownRefresh();
  777 + }
  778 + })
  779 + let user_id = getApp().globalData.user_id;
692 780
693 //---首页广告------- 781 //---首页广告-------
694 await getApp().request.promiseGet("/api/weshop/ad/page?pids=300,301,302,303,304&store_id=" + o.stoid, { 782 await getApp().request.promiseGet("/api/weshop/ad/page?pids=300,301,302,303,304&store_id=" + o.stoid, {
695 - data: {  
696 - enabled: 1  
697 - }  
698 - }).then(res => { 783 + data: {
  784 + enabled: 1
  785 + }
  786 + }).then(res => {
699 console.log('首页广告--------------------------'); 787 console.log('首页广告--------------------------');
700 console.log(res); 788 console.log(res);
701 - if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) {  
702 - var a = res.data.data.pageData;  
703 - var obj = {};  
704 - for (var i = 0; i < a.length; i++) {  
705 - var tt = {  
706 - 'ad_code': o.imghost + a[i].ad_code,  
707 - 'media_link': '', 789 + if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) {
  790 + var a = res.data.data.pageData;
  791 + var obj = {};
  792 + for (var i = 0; i < a.length; i++) {
  793 + var tt = {
  794 + 'ad_code': o.imghost + a[i].ad_code,
  795 + 'media_link': '',
708 'ad_weapplink': a[i].ad_weapplink, 796 'ad_weapplink': a[i].ad_weapplink,
709 - 'pid':a[i].pid  
710 - }; 797 + 'pid': a[i].pid
  798 + };
711 // arr.push(tt); 799 // arr.push(tt);
712 - obj[a[i].pid]=tt  
713 - }  
714 - if (a.length > 0) e.setData({  
715 - mb_banner: obj,  
716 - });  
717 -  
718 - wx.stopPullDownRefresh();  
719 - }  
720 - })  
721 -  
722 -  
723 - //----拼单-----  
724 - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2", {  
725 - data: {  
726 - store_id: os.stoid,  
727 - is_end: 0,  
728 - is_show: 1,  
729 - pageSize: 6,  
730 - user_id,  
731 - }  
732 - }).then(res => {  
733 - var e = res;  
734 - if (e.data.code == 0) {  
735 - var pd_data = e.data.data.pageData;  
736 -  
737 - if (pd_data.length == 0) return;  
738 -  
739 - //获取当前  
740 - var nt = ut.gettimestamp();  
741 - pd_data.forEach(function (val, ind) {  
742 - if (val.start_time > nt) pd_data[ind].status = 0;  
743 - else if (val.end_time > nt) pd_data[ind].status = 1;  
744 - if (val.buy_num >= val.goods_num) pd_data[ind].status = 2;  
745 - });  
746 -  
747 - //获取当前时间,比较拼团中还在未开始  
748 - var timestamp = new Date().getTime();  
749 - var is_team_tepy;  
750 - for (var j = 0; j < pd_data.length; j++) {  
751 - pd_data[j].is_team_tepy = 1;  
752 - if (timestamp < pd_data[j].start_time * 1000) {  
753 - var is_team_tepy;  
754 - pd_data[j].is_team_tepy = 0;  
755 - }  
756 - }  
757 -  
758 - var arr = new Array();  
759 - //--2个2个一组---  
760 - for (var i = 0; i < pd_data.length; i += 2) {  
761 -  
762 - arr.push(pd_data.slice(i, i + 2));  
763 - }  
764 -  
765 - th.setData({  
766 - pindGoods: arr  
767 - });  
768 - th.countDown2();  
769 - }  
770 - })  
771 -  
772 - //------新品-------  
773 - await getApp().request.promiseGet("/api/weshop/goods/page?page=1", {  
774 - data: {  
775 - is_mainshow: 1,  
776 - isonsale: 1,  
777 - is_on_sale: 1,  
778 - store_id: o.stoid,  
779 - pageSize: 9,  
780 - is_new: 1,  
781 - orderField: "sort"  
782 - }  
783 - }).then(res => {  
784 - var e = res;  
785 - if (e.data.code == 0) {  
786 - var new_data = e.data.data.pageData;  
787 - var arr = new Array();  
788 - //--三个三个一组---  
789 - for (var i = 0; i < new_data.length; i += 3) {  
790 - arr.push(new_data.slice(i, i + 3));  
791 - }  
792 - th.setData({  
793 - newGoods: arr,  
794 - });  
795 - }  
796 - })  
797 -  
798 - //------热卖-------  
799 - await getApp().request.promiseGet("/api/weshop/goods/page?page=1", {  
800 - data: {  
801 - is_mainshow: 1,  
802 - isonsale: 1,  
803 - is_on_sale: 1,  
804 - store_id: o.stoid,  
805 - pageSize: 9,  
806 - is_hot: 1,  
807 - orderField: "sort"  
808 - }  
809 - }).then(res => {  
810 - var e = res;  
811 - if (e.data.code == 0) {  
812 - var new_data = e.data.data.pageData;  
813 - var arr = new Array();  
814 - //--三个三个一组---  
815 - for (var i = 0; i < new_data.length; i += 3) {  
816 - arr.push(new_data.slice(i, i + 3));  
817 - }  
818 - console.log(arr);  
819 - th.setData({  
820 - hotGoods: arr,  
821 - });  
822 - }  
823 - })  
824 -  
825 - //---调用信息---  
826 - // this.requestRecommend();  
827 - this.setData({  
828 - ishow: 1  
829 - });  
830 -  
831 - //---先获取会员---  
832 - //t.getUserFir(function () {  
833 - if (getApp().globalData.user_id) {  
834 - th.is_festival();  
835 - var new_nav = th.data.new_nav;  
836 - if (new_nav == "") {  
837 - th.is_new();  
838 - }  
839 -  
840 - // sty  
841 - setTimeout(function () {  
842 - if (getApp().globalData.user_id) getApp().requestCardNum(th);  
843 - }, 500)  
844 - }  
845 - //});  
846 -  
847 - setTimeout(function () {  
848 - var goods_list = th.selectComponent("#goods_list"); //组件的id  
849 - goods_list.init();  
850 - goods_list.get_list();  
851 - }, 2000)  
852 - },  
853 -  
854 - //--判断小程序是否过期--  
855 - setappdata: function (t) {  
856 - if (t && t.isout == 1)  
857 - wx.reLaunch({  
858 - url: "/packageD/pages/error/error?msg=该商城已到期,暂停浏览!\r\n可联系:" + getApp().globalData.config.store_tel,  
859 - });  
860 - if (t && t.isbuy == 0)  
861 - wx.reLaunch({  
862 - url: "/packageD/pages/error/error?msg=还未购买小程序",  
863 - });  
864 - },  
865 - //---加载更多是靠这个函数----  
866 - onReachBottom: function () { 800 + obj[a[i].pid] = tt
  801 + }
  802 + if (a.length > 0) e.setData({
  803 + mb_banner: obj,
  804 + });
  805 +
  806 + wx.stopPullDownRefresh();
  807 + }
  808 + })
  809 +
  810 +
  811 + //----拼单-----
  812 + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2", {
  813 + data: {
  814 + store_id: os.stoid,
  815 + is_end: 0,
  816 + is_show: 1,
  817 + pageSize: 6,
  818 + user_id,
  819 + }
  820 + }).then(res => {
  821 + var e = res;
  822 + if (e.data.code == 0) {
  823 + var pd_data = e.data.data.pageData;
  824 +
  825 + if (pd_data.length == 0) return;
  826 +
  827 + //获取当前
  828 + var nt = ut.gettimestamp();
  829 + pd_data.forEach(function (val, ind) {
  830 + if (val.start_time > nt) pd_data[ind].status = 0;
  831 + else if (val.end_time > nt) pd_data[ind].status = 1;
  832 + if (val.buy_num >= val.goods_num) pd_data[ind].status = 2;
  833 + });
  834 +
  835 + //获取当前时间,比较拼团中还在未开始
  836 + var timestamp = new Date().getTime();
  837 + var is_team_tepy;
  838 + for (var j = 0; j < pd_data.length; j++) {
  839 + pd_data[j].is_team_tepy = 1;
  840 + if (timestamp < pd_data[j].start_time * 1000) {
  841 + var is_team_tepy;
  842 + pd_data[j].is_team_tepy = 0;
  843 + }
  844 + }
  845 +
  846 + var arr = new Array();
  847 + //--2个2个一组---
  848 + for (var i = 0; i < pd_data.length; i += 2) {
  849 +
  850 + arr.push(pd_data.slice(i, i + 2));
  851 + }
  852 +
  853 + th.setData({
  854 + pindGoods: arr
  855 + });
  856 + th.countDown2();
  857 + }
  858 + })
  859 +
  860 + //------新品-------
  861 + await getApp().request.promiseGet("/api/weshop/goods/page?page=1", {
  862 + data: {
  863 + is_mainshow: 1,
  864 + isonsale: 1,
  865 + is_on_sale: 1,
  866 + store_id: o.stoid,
  867 + pageSize: 9,
  868 + is_new: 1,
  869 + orderField: "sort"
  870 + }
  871 + }).then(res => {
  872 + var e = res;
  873 + if (e.data.code == 0) {
  874 + var new_data = e.data.data.pageData;
  875 + var arr = new Array();
  876 + //--三个三个一组---
  877 + for (var i = 0; i < new_data.length; i += 3) {
  878 + arr.push(new_data.slice(i, i + 3));
  879 + }
  880 + th.setData({
  881 + newGoods: arr,
  882 + });
  883 + }
  884 + })
  885 +
  886 + //------热卖-------
  887 + await getApp().request.promiseGet("/api/weshop/goods/page?page=1", {
  888 + data: {
  889 + is_mainshow: 1,
  890 + isonsale: 1,
  891 + is_on_sale: 1,
  892 + store_id: o.stoid,
  893 + pageSize: 9,
  894 + is_hot: 1,
  895 + orderField: "sort"
  896 + }
  897 + }).then(res => {
  898 + var e = res;
  899 + if (e.data.code == 0) {
  900 + var new_data = e.data.data.pageData;
  901 + var arr = new Array();
  902 + //--三个三个一组---
  903 + for (var i = 0; i < new_data.length; i += 3) {
  904 + arr.push(new_data.slice(i, i + 3));
  905 + }
  906 + console.log(arr);
  907 + th.setData({
  908 + hotGoods: arr,
  909 + });
  910 + }
  911 + })
  912 +
  913 + //---调用信息---
  914 + // this.requestRecommend();
  915 + this.setData({
  916 + ishow: 1
  917 + });
  918 +
  919 + //---先获取会员---
  920 + //t.getUserFir(function () {
  921 + if (getApp().globalData.user_id) {
  922 + th.is_festival();
  923 + var new_nav = th.data.new_nav;
  924 + if (new_nav == "") {
  925 + th.is_new();
  926 + }
  927 +
  928 + // sty
  929 + setTimeout(function () {
  930 + if (getApp().globalData.user_id) getApp().requestCardNum(th);
  931 + }, 500)
  932 + }
  933 + //});
  934 +
  935 + setTimeout(function () {
  936 + var goods_list = th.selectComponent("#goods_list"); //组件的id
  937 + goods_list.init();
  938 + goods_list.get_list();
  939 + }, 2000)
  940 + },
  941 +
  942 + //--判断小程序是否过期--
  943 + setappdata: function (t) {
  944 + if (t && t.isout == 1)
  945 + wx.reLaunch({
  946 + url: "/packageD/pages/error/error?msg=该商城已到期,暂停浏览!\r\n可联系:" + getApp().globalData.config.store_tel,
  947 + });
  948 + if (t && t.isbuy == 0)
  949 + wx.reLaunch({
  950 + url: "/packageD/pages/error/error?msg=还未购买小程序",
  951 + });
  952 + },
  953 + //---加载更多是靠这个函数----
  954 + onReachBottom: function () {
867 console.log('下拉加载2'); 955 console.log('下拉加载2');
868 956
869 - var goods_list = this.selectComponent("#goods_list"); //组件的id  
870 - if (goods_list) goods_list.get_list(); 957 + var goods_list = this.selectComponent("#goods_list"); //组件的id
  958 + if (goods_list) goods_list.get_list();
871 959
872 - if (getApp().globalData.func_list) {  
873 - for (let i in getApp().globalData.func_list) {  
874 - let item = getApp().globalData.func_list[i];  
875 - item.re_show();  
876 - } 960 + if (getApp().globalData.func_list) {
  961 + for (let i in getApp().globalData.func_list) {
  962 + let item = getApp().globalData.func_list[i];
  963 + item.re_show();
  964 + }
877 } 965 }
878 - 966 +
879 967
880 //自定义时商品自动加载更多 968 //自定义时商品自动加载更多
881 let goodsGroupArr = this.data.goodsGroupArr 969 let goodsGroupArr = this.data.goodsGroupArr
882 - if (this.data.isTemplate && goodsGroupArr.length >0) {  
883 - goodsGroupArr.map(item=>{  
884 - if(this[item]) this[item].automore()  
885 - }) 970 + if (this.data.isTemplate && goodsGroupArr.length > 0) {
  971 + goodsGroupArr.map(item => {
  972 + if (this[item]) this[item].automore()
  973 + })
886 } 974 }
887 975
888 - },  
889 -  
890 - onPullDownRefresh: function (e) {  
891 - this.data.recommend = null, this.data.currentPage = 1, n.resetConfig(), this.requestHomePage(),  
892 - this.requestRecommend();  
893 - },  
894 - requestRecommend() { },  
895 - requestHomePage() { },  
896 -  
897 - onUnload: function () {  
898 - this.destroyActivityTimer();  
899 - },  
900 - setCountTime: function (e) {  
901 - e.diffTime || (e.diffTime = new Date().getTime() - 1e3 * e.server_time), this.setData({  
902 - "sale.diffTime": e.diffTime  
903 - }), this.setData({  
904 - "sale.good": e.flash_sale_goods[0]  
905 - }), this.destroyActivityTimer(), this.createActivityTimer();  
906 - },  
907 - createActivityTimer: function () {  
908 - var e = this.data.sale,  
909 - t = this;  
910 - this.data.timer = setInterval(function () {  
911 - var a = 1e3 * e.good.end_time - new Date().getTime() + e.diffTime,  
912 - o = i.transTime(a);  
913 - a <= 0 ? t.requestHomePage() : t.setData({  
914 - "sale.countTime": o  
915 - });  
916 - }, 1e3);  
917 - },  
918 - destroyActivityTimer: function () {  
919 - this.data.timer && (clearInterval(this.data.timer), this.data.timer = null);  
920 - },  
921 - onPageScroll: function (e) {  
922 - this.data.scrollTop = e.scrollTop;  
923 - var t = getCurrentPages();  
924 - "pages/index/index/index" == t[t.length - 1].route;  
925 - /*--(e.scrollTop > 10 ? wx.setNavigationBarColor({  
926 - frontColor: "#ffffff",  
927 - backgroundColor: "#f95959"  
928 - }) : wx.setNavigationBarColor({  
929 - frontColor: "#000000",  
930 - backgroundColor: "#eeeeee"  
931 - }));--*/  
932 - },  
933 - jumpSearch: function () {  
934 - wx.navigateTo({  
935 - url: "/packageG/pages/goods/search/search"  
936 - });  
937 - },  
938 - onShareAppMessage: function (e) {  
939 - getApp().globalData.no_clear = 1;  
940 - var url = "/pages/index/index/index";  
941 - var userInfo = getApp().globalData.userInfo;  
942 - //是分销商才带  
943 - if (userInfo) { 976 + },
  977 +
  978 + onPullDownRefresh: function (e) {
  979 + this.data.recommend = null, this.data.currentPage = 1, n.resetConfig(), this.requestHomePage(),
  980 + this.requestRecommend();
  981 + },
  982 + requestRecommend() { },
  983 + requestHomePage() { },
  984 +
  985 + onUnload: function () {
  986 + this.destroyActivityTimer();
  987 + },
  988 + setCountTime: function (e) {
  989 + e.diffTime || (e.diffTime = new Date().getTime() - 1e3 * e.server_time), this.setData({
  990 + "sale.diffTime": e.diffTime
  991 + }), this.setData({
  992 + "sale.good": e.flash_sale_goods[0]
  993 + }), this.destroyActivityTimer(), this.createActivityTimer();
  994 + },
  995 + createActivityTimer: function () {
  996 + var e = this.data.sale,
  997 + t = this;
  998 + this.data.timer = setInterval(function () {
  999 + var a = 1e3 * e.good.end_time - new Date().getTime() + e.diffTime,
  1000 + o = i.transTime(a);
  1001 + a <= 0 ? t.requestHomePage() : t.setData({
  1002 + "sale.countTime": o
  1003 + });
  1004 + }, 1e3);
  1005 + },
  1006 + destroyActivityTimer: function () {
  1007 + this.data.timer && (clearInterval(this.data.timer), this.data.timer = null);
  1008 + },
  1009 + onPageScroll: function (e) {
  1010 + //满屏模式监听
  1011 + let num = e.scrollTop
  1012 + if (this.data.is_full_screen_navigation) {
  1013 + let nav_type = this.data.nav_type
  1014 + if (num >= 100 && nav_type) {
  1015 + this.setData({
  1016 + nav_type: 0,
  1017 + searchbox_transparent: 0,
  1018 + nav_frontColor: '#000'
  1019 + })
  1020 + // this.data.nav_type = 0
  1021 + }
  1022 + if (num < 100 && !nav_type) {
  1023 + this.setData({
  1024 + nav_type: 1,
  1025 + searchbox_transparent: 1,
  1026 + nav_frontColor: '#000'
  1027 + })
  1028 + // this.data.nav_type = 1
  1029 + }
  1030 + }
  1031 +
  1032 + //-----------end-------
  1033 + //是否显示置顶
  1034 + if (num > 400) {
  1035 + this.setData({
  1036 + is_show_top:1
  1037 + })
  1038 + }else{
  1039 + this.setData({
  1040 + is_show_top:0
  1041 + })
  1042 + }
  1043 + //----end------
  1044 +
  1045 + this.data.scrollTop = e.scrollTop;
  1046 + var t = getCurrentPages();
  1047 + "pages/index/index/index" == t[t.length - 1].route;
  1048 + /*--(e.scrollTop > 10 ? wx.setNavigationBarColor({
  1049 + frontColor: "#ffffff",
  1050 + backgroundColor: "#f95959"
  1051 + }) : wx.setNavigationBarColor({
  1052 + frontColor: "#000000",
  1053 + backgroundColor: "#eeeeee"
  1054 + }));--*/
  1055 + },
  1056 + jumpSearch: function () {
  1057 + wx.navigateTo({
  1058 + url: "/packageG/pages/goods/search/search"
  1059 + });
  1060 + },
  1061 + onShareAppMessage: function (e) {
  1062 + getApp().globalData.no_clear = 1;
  1063 + var url = "/pages/index/index/index";
  1064 + var userInfo = getApp().globalData.userInfo;
  1065 + //是分销商才带
  1066 + if (userInfo) {
944 url += "?first_leader=" + userInfo.user_id; 1067 url += "?first_leader=" + userInfo.user_id;
945 //群id分享 1068 //群id分享
946 if (getApp().globalData.groupchat_id) { 1069 if (getApp().globalData.groupchat_id) {
947 - url+="&groupchat_id="+getApp().globalData.groupchat_id 1070 + url += "&groupchat_id=" + getApp().globalData.groupchat_id
948 } 1071 }
949 - }else{ 1072 + } else {
950 //群id分享 1073 //群id分享
951 if (getApp().globalData.groupchat_id) { 1074 if (getApp().globalData.groupchat_id) {
952 - url+="?groupchat_id="+getApp().globalData.groupchat_id 1075 + url += "?groupchat_id=" + getApp().globalData.groupchat_id
953 } 1076 }
954 } 1077 }
955 - console.log("---首页---分享--");  
956 - var title = "商城首页"  
957 - //分享  
958 - if (getApp().globalData.config && getApp().globalData.config.store_name) {  
959 - title = getApp().globalData.config.store_name;  
960 - } else if (getApp().globalData.setting.appName) {  
961 - title = getApp().globalData.setting.appName; 1078 + console.log("---首页---分享--");
  1079 + var title = "商城首页"
  1080 + //分享
  1081 + if (getApp().globalData.config && getApp().globalData.config.store_name) {
  1082 + title = getApp().globalData.config.store_name;
  1083 + } else if (getApp().globalData.setting.appName) {
  1084 + title = getApp().globalData.setting.appName;
962 } 1085 }
963 -  
964 -  
965 -  
966 - var ob = {  
967 - title: title,  
968 - path: url,  
969 - };  
970 - console.log(ob);  
971 - return ob;  
972 - },  
973 -  
974 - //图片失败,默认图片  
975 - bind_bnerr: function (e) {  
976 - var _errImg = e.target.dataset.errorimg;  
977 - var _errObj = {};  
978 - _errObj[_errImg] = this.data.url + "/miniapp/images/del/logo.jpg";  
979 - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;  
980 - },  
981 -  
982 - //图片失败,默认图片  
983 - bind_bnerr2: function (e) {  
984 - var _errImg = e.target.dataset.errorimg;  
985 - var _errurl = e.target.dataset.url;  
986 - var _errObj = {};  
987 - _errObj[_errImg] = "/miniapp/images/default_g_img.gif";  
988 - this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;  
989 -  
990 - },  
991 - //图片失败,默认图片  
992 - bind_bnerr3: function (e) {  
993 - var _errImg = e.target.dataset.errorimg;  
994 - var _Img = e.target.dataset.img;  
995 - if (_Img != undefined) {  
996 - var _errObj = {};  
997 - _errObj[_errImg] = "/public/images/default_goods_image_240.gif";  
998 - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;  
999 - }  
1000 - },  
1001 -  
1002 -  
1003 - //秒杀倒计时  
1004 - //---小于10的格式化函数----  
1005 - timeFormat(param) {  
1006 - return param < 10 ? '0' + param : param;  
1007 - },  
1008 -  
1009 - //----秒杀倒计时函数-----  
1010 - countDown() {  
1011 - if (!this.data.is_timer) return false;  
1012 - var th = this;  
1013 - // 获取当前时间,同时得到活动结束时间数组  
1014 - var newTime = ut.gettimestamp();  
1015 - var List = this.data.saleGoods;  
1016 - for (var j = 0; j < List.length; j++) {  
1017 - var endTimeList = List[j];  
1018 - // 对结束时间进行处理渲染到页面  
1019 - for (var i = 0; i < endTimeList.length; i++) {  
1020 - var o = endTimeList[i];  
1021 - var endTime = o.end_time  
1022 - if (o.status == 0) endTime = o.start_time  
1023 -  
1024 - var obj = null;  
1025 - // 如果活动未结束,对时间进行处理  
1026 - if (endTime - newTime > 0) {  
1027 - var time = (endTime - newTime);  
1028 - // 获取天、时、分、秒  
1029 - var day = parseInt(time / (60 * 60 * 24));  
1030 - var hou = parseInt(time % (60 * 60 * 24) / 3600);  
1031 - var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
1032 - var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
1033 - obj = {  
1034 - day: this.timeFormat(day),  
1035 - hou: this.timeFormat(hou),  
1036 - min: this.timeFormat(min),  
1037 - sec: this.timeFormat(sec)  
1038 - }  
1039 - } else {  
1040 - //活动已结束,全部设置为'00'  
1041 - obj = {  
1042 - day: '00',  
1043 - hou: '00',  
1044 - min: '00',  
1045 - sec: '00'  
1046 - }  
1047 - }  
1048 - var txt = "saleGoods[" + j + "][" + i + "].djs";  
1049 - th.setData({  
1050 - [txt]: obj  
1051 - });  
1052 - }  
1053 -  
1054 - }  
1055 - setTimeout(th.countDown, 1000);  
1056 - },  
1057 -  
1058 - //----拼单倒计时函数-----  
1059 - countDown2() {  
1060 - if (!this.data.is_timer) return false;  
1061 -  
1062 - var th = this;  
1063 - // 获取当前时间,同时得到活动结束时间数组  
1064 - var newTime = ut.gettimestamp();  
1065 - var List = this.data.pindGoods;  
1066 - for (var j = 0; j < List.length; j++) {  
1067 - var endTimeList = List[j];  
1068 - // 对结束时间进行处理渲染到页面  
1069 - for (var i = 0; i < endTimeList.length; i++) {  
1070 - var o = endTimeList[i];  
1071 - var endTime = o.end_time;  
1072 - if (o.status == 0) endTime = o.start_time;  
1073 -  
1074 - let obj = null;  
1075 - // 如果活动未结束,对时间进行处理  
1076 - if (endTime - newTime > 0) {  
1077 - let time = (endTime - newTime);  
1078 - // 获取天、时、分、秒  
1079 - let day = parseInt(time / (60 * 60 * 24));  
1080 - let hou = parseInt(time % (60 * 60 * 24) / 3600);  
1081 - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
1082 - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
1083 - obj = {  
1084 - day: this.timeFormat(day),  
1085 - hou: this.timeFormat(hou),  
1086 - min: this.timeFormat(min),  
1087 - sec: this.timeFormat(sec)  
1088 - }  
1089 - } else {  
1090 - //活动已结束,全部设置为'00'  
1091 - obj = {  
1092 - day: '00',  
1093 - hou: '00',  
1094 - min: '00',  
1095 - sec: '00'  
1096 - }  
1097 - }  
1098 - var txt = "pindGoods[" + j + "][" + i + "].djs";  
1099 - th.setData({  
1100 - [txt]: obj  
1101 - });  
1102 - }  
1103 - }  
1104 - setTimeout(th.countDown2, 1000);  
1105 - },  
1106 -  
1107 - bannerSwiperChange: function (e) {  
1108 - var index = e.detail.current;  
1109 - this.setData({  
1110 - banner_index: index  
1111 - });  
1112 - },  
1113 - flashSwiperChange: function (e) {  
1114 - var index = e.detail.current;  
1115 - this.setData({  
1116 - flash_index: index  
1117 - });  
1118 - },  
1119 - ptSwiperChange: function (e) {  
1120 - var index = e.detail.current;  
1121 - this.setData({  
1122 - pt_index: index  
1123 - });  
1124 - },  
1125 -  
1126 - Interval_pt() {  
1127 - var th = this;  
1128 - this.data.pt_timer = setInterval(function () {  
1129 - var item = ut.get_rand_item(th.data.pt_timer_arr);  
1130 - th.setData({  
1131 - pt_timer_active: 1,  
1132 - pt_timer_item: item  
1133 - });  
1134 - setTimeout(function () {  
1135 - th.setData({  
1136 - pt_timer_active: 0  
1137 - });  
1138 - }, 1500)  
1139 - }, 4000);  
1140 - },  
1141 -  
1142 -  
1143 - //---扫一扫的函数---  
1144 - getScancode: function () {  
1145 - var _this = this;  
1146 - getApp().globalData.no_clear = 1;  
1147 - // 允许从相机和相册扫码  
1148 - wx.scanCode({  
1149 - success: (res) => {  
1150 - var result = res.result;  
1151 - wx.navigateTo({  
1152 - url: "/packageG/pages/goods/search/search?s_key=" + result,  
1153 - });  
1154 - }  
1155 - })  
1156 - },  
1157 - //广告跳转  
1158 - go_mb(e){  
1159 - let url=e.currentTarget.dataset.url 1086 +
  1087 +
  1088 +
  1089 + var ob = {
  1090 + title: title,
  1091 + path: url,
  1092 + };
  1093 + console.log(ob);
  1094 + return ob;
  1095 + },
  1096 +
  1097 + //图片失败,默认图片
  1098 + bind_bnerr: function (e) {
  1099 + var _errImg = e.target.dataset.errorimg;
  1100 + var _errObj = {};
  1101 + _errObj[_errImg] = this.data.url + "/miniapp/images/del/logo.jpg";
  1102 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  1103 + },
  1104 +
  1105 + //图片失败,默认图片
  1106 + bind_bnerr2: function (e) {
  1107 + var _errImg = e.target.dataset.errorimg;
  1108 + var _errurl = e.target.dataset.url;
  1109 + var _errObj = {};
  1110 + _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
  1111 + this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  1112 +
  1113 + },
  1114 + //图片失败,默认图片
  1115 + bind_bnerr3: function (e) {
  1116 + var _errImg = e.target.dataset.errorimg;
  1117 + var _Img = e.target.dataset.img;
  1118 + if (_Img != undefined) {
  1119 + var _errObj = {};
  1120 + _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
  1121 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  1122 + }
  1123 + },
  1124 +
  1125 +
  1126 + //秒杀倒计时
  1127 + //---小于10的格式化函数----
  1128 + timeFormat(param) {
  1129 + return param < 10 ? '0' + param : param;
  1130 + },
  1131 +
  1132 + //----秒杀倒计时函数-----
  1133 + countDown() {
  1134 + if (!this.data.is_timer) return false;
  1135 + var th = this;
  1136 + // 获取当前时间,同时得到活动结束时间数组
  1137 + var newTime = ut.gettimestamp();
  1138 + var List = this.data.saleGoods;
  1139 + for (var j = 0; j < List.length; j++) {
  1140 + var endTimeList = List[j];
  1141 + // 对结束时间进行处理渲染到页面
  1142 + for (var i = 0; i < endTimeList.length; i++) {
  1143 + var o = endTimeList[i];
  1144 + var endTime = o.end_time
  1145 + if (o.status == 0) endTime = o.start_time
  1146 +
  1147 + var obj = null;
  1148 + // 如果活动未结束,对时间进行处理
  1149 + if (endTime - newTime > 0) {
  1150 + var time = (endTime - newTime);
  1151 + // 获取天、时、分、秒
  1152 + var day = parseInt(time / (60 * 60 * 24));
  1153 + var hou = parseInt(time % (60 * 60 * 24) / 3600);
  1154 + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  1155 + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  1156 + obj = {
  1157 + day: this.timeFormat(day),
  1158 + hou: this.timeFormat(hou),
  1159 + min: this.timeFormat(min),
  1160 + sec: this.timeFormat(sec)
  1161 + }
  1162 + } else {
  1163 + //活动已结束,全部设置为'00'
  1164 + obj = {
  1165 + day: '00',
  1166 + hou: '00',
  1167 + min: '00',
  1168 + sec: '00'
  1169 + }
  1170 + }
  1171 + var txt = "saleGoods[" + j + "][" + i + "].djs";
  1172 + th.setData({
  1173 + [txt]: obj
  1174 + });
  1175 + }
  1176 +
  1177 + }
  1178 + setTimeout(th.countDown, 1000);
  1179 + },
  1180 +
  1181 + //----拼单倒计时函数-----
  1182 + countDown2() {
  1183 + if (!this.data.is_timer) return false;
  1184 +
  1185 + var th = this;
  1186 + // 获取当前时间,同时得到活动结束时间数组
  1187 + var newTime = ut.gettimestamp();
  1188 + var List = this.data.pindGoods;
  1189 + for (var j = 0; j < List.length; j++) {
  1190 + var endTimeList = List[j];
  1191 + // 对结束时间进行处理渲染到页面
  1192 + for (var i = 0; i < endTimeList.length; i++) {
  1193 + var o = endTimeList[i];
  1194 + var endTime = o.end_time;
  1195 + if (o.status == 0) endTime = o.start_time;
  1196 +
  1197 + let obj = null;
  1198 + // 如果活动未结束,对时间进行处理
  1199 + if (endTime - newTime > 0) {
  1200 + let time = (endTime - newTime);
  1201 + // 获取天、时、分、秒
  1202 + let day = parseInt(time / (60 * 60 * 24));
  1203 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  1204 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  1205 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  1206 + obj = {
  1207 + day: this.timeFormat(day),
  1208 + hou: this.timeFormat(hou),
  1209 + min: this.timeFormat(min),
  1210 + sec: this.timeFormat(sec)
  1211 + }
  1212 + } else {
  1213 + //活动已结束,全部设置为'00'
  1214 + obj = {
  1215 + day: '00',
  1216 + hou: '00',
  1217 + min: '00',
  1218 + sec: '00'
  1219 + }
  1220 + }
  1221 + var txt = "pindGoods[" + j + "][" + i + "].djs";
  1222 + th.setData({
  1223 + [txt]: obj
  1224 + });
  1225 + }
  1226 + }
  1227 + setTimeout(th.countDown2, 1000);
  1228 + },
  1229 +
  1230 + bannerSwiperChange: function (e) {
  1231 + var index = e.detail.current;
  1232 + this.setData({
  1233 + banner_index: index
  1234 + });
  1235 + },
  1236 + flashSwiperChange: function (e) {
  1237 + var index = e.detail.current;
  1238 + this.setData({
  1239 + flash_index: index
  1240 + });
  1241 + },
  1242 + ptSwiperChange: function (e) {
  1243 + var index = e.detail.current;
  1244 + this.setData({
  1245 + pt_index: index
  1246 + });
  1247 + },
  1248 +
  1249 + Interval_pt() {
  1250 + var th = this;
  1251 + this.data.pt_timer = setInterval(function () {
  1252 + var item = ut.get_rand_item(th.data.pt_timer_arr);
  1253 + th.setData({
  1254 + pt_timer_active: 1,
  1255 + pt_timer_item: item
  1256 + });
  1257 + setTimeout(function () {
  1258 + th.setData({
  1259 + pt_timer_active: 0
  1260 + });
  1261 + }, 1500)
  1262 + }, 4000);
  1263 + },
  1264 +
  1265 +
  1266 + //---扫一扫的函数---
  1267 + getScancode: function () {
  1268 + var _this = this;
  1269 + getApp().globalData.no_clear = 1;
  1270 + // 允许从相机和相册扫码
  1271 + wx.scanCode({
  1272 + success: (res) => {
  1273 + var result = res.result;
  1274 + wx.navigateTo({
  1275 + url: "/packageG/pages/goods/search/search?s_key=" + result,
  1276 + });
  1277 + }
  1278 + })
  1279 + },
  1280 + //广告跳转
  1281 + go_mb(e) {
  1282 + let url = e.currentTarget.dataset.url
  1283 + getApp().goto(url);
  1284 + },
  1285 +
  1286 + //跳转到分类
  1287 + go_cate: function () {
  1288 + getApp().goto("/pages/goods/categoryList/categoryList");
  1289 + },
  1290 +
  1291 + // 幸运购跳转
  1292 + go_url: function (e) {
  1293 +
  1294 + var url = e.currentTarget.dataset.url;
1160 getApp().goto(url); 1295 getApp().goto(url);
  1296 +
  1297 + }, //
  1298 +
  1299 + bind_bnerr_icon: function (e) {
  1300 + var def = "/miniapp/images/no_cate_def.png";
  1301 + var _err = e.currentTarget.dataset.err;
  1302 + var ob = {};
  1303 + ob[_err] = def;
  1304 + this.setData(ob);
  1305 + },
  1306 +
  1307 + //跳转到分类的商品列表
  1308 + go_cate2: function (t) {
  1309 + var cid = t.currentTarget.dataset.cid;
  1310 + var pid = t.currentTarget.dataset.pid;
  1311 + var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid;
  1312 + wx.navigateTo({
  1313 + url: lurl
  1314 + });
  1315 + },
  1316 + new_nav: function (e) {
  1317 + var th = this;
  1318 + var new_nav = th.data.new_nav;
  1319 + getApp().goto(new_nav);
  1320 + },
  1321 + //跳转到权益
  1322 + go_quanyi: function (t) {
  1323 + var user_info = getApp().globalData.userInfo;
  1324 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1325 + wx.navigateTo({
  1326 + url: '/packageE/pages/togoin/togoin',
  1327 + //url: '/pages/getphone/getphone',
  1328 + })
  1329 + return false;
  1330 + }
  1331 + getApp().goto("/pages/user/userqy/userqy");
  1332 + },
  1333 +
  1334 + imageLoad: function (e) {
  1335 + var imgwidth = e.detail.width;
  1336 + var imgheight = e.detail.height;
  1337 + //宽高比
  1338 + var ratio = imgwidth / imgheight;
  1339 + //计算的高度值
  1340 + var viewHeight = 715 / ratio;
  1341 + if (this.data.max_sw_height < viewHeight) this.setData({
  1342 + max_sw_height: viewHeight
  1343 + });
  1344 + },
  1345 + //判断该用户是否是新会员
  1346 + is_new: function () {
  1347 + var th = this;
  1348 + wx.hideLoading();
  1349 + getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", {
  1350 + data: {
  1351 + storeId: os.stoid,
  1352 + userId: d.user_id
  1353 + }
  1354 + }).then(res => {
  1355 + if (res.data.code == 0) {
  1356 + var actid = res.data.data.id; //活动id
  1357 + var giftBagId = res.data.data.giftBagId; //礼包id
  1358 + var new_nav = "/pages/giftpack/newvipgift/newvipgift?actId=" + actid + '&' + 'actType=' + 1 + '&' + 'giftBagId=' + giftBagId;
  1359 + var new_image = res.data.data.imageurl;
  1360 + var swiperimage = th.data.swiperimage;
  1361 + var img = {
  1362 + image: "/miniapp/images/newpeople/newpeople.png",
  1363 + nav_url: new_nav
  1364 + }
  1365 + swiperimage.unshift(img);
  1366 + th.setData({
  1367 + swiperimage: swiperimage,
  1368 + new_image: new_image,
  1369 + new_nav: new_nav
  1370 + })
  1371 +
  1372 + getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/bound/judge", {
  1373 + data: {
  1374 + storeId: o.stoid,
  1375 + userId: d.user_id
  1376 + }
  1377 + }).then(res => {
  1378 + if (res.data.code == 0) {
  1379 + th.setData({
  1380 + is_disgraceful: 1
  1381 + })
  1382 + } else {
  1383 + th.check_holiday_pop(); //节日的弹窗
  1384 + }
  1385 +
  1386 + })
  1387 + } else {
  1388 + th.check_holiday_pop(); //节日的弹窗
  1389 + }
  1390 +
  1391 + })
  1392 +
1161 }, 1393 },
1162 1394
1163 - //跳转到分类  
1164 - go_cate: function () {  
1165 - getApp().goto("/pages/goods/categoryList/categoryList");  
1166 - },  
1167 -  
1168 - // 幸运购跳转  
1169 - go_url: function (e) {  
1170 -  
1171 - var url = e.currentTarget.dataset.url;  
1172 - getApp().goto(url);  
1173 -  
1174 - }, //  
1175 -  
1176 - bind_bnerr_icon: function (e) {  
1177 - var def = "/miniapp/images/no_cate_def.png";  
1178 - var _err = e.currentTarget.dataset.err;  
1179 - var ob = {};  
1180 - ob[_err] = def;  
1181 - this.setData(ob);  
1182 - },  
1183 -  
1184 - //跳转到分类的商品列表  
1185 - go_cate2: function (t) {  
1186 - var cid = t.currentTarget.dataset.cid;  
1187 - var pid = t.currentTarget.dataset.pid;  
1188 - var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid;  
1189 - wx.navigateTo({  
1190 - url: lurl  
1191 - });  
1192 - },  
1193 - new_nav: function (e) {  
1194 - var th = this;  
1195 - var new_nav = th.data.new_nav;  
1196 - getApp().goto(new_nav);  
1197 - },  
1198 - //跳转到权益  
1199 - go_quanyi: function (t) {  
1200 - var user_info = getApp().globalData.userInfo;  
1201 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
1202 - wx.navigateTo({  
1203 - url: '/packageE/pages/togoin/togoin',  
1204 - //url: '/pages/getphone/getphone',  
1205 - })  
1206 - return false;  
1207 - }  
1208 - getApp().goto("/pages/user/userqy/userqy");  
1209 - },  
1210 -  
1211 - imageLoad: function (e) {  
1212 - var imgwidth = e.detail.width;  
1213 - var imgheight = e.detail.height;  
1214 - //宽高比  
1215 - var ratio = imgwidth / imgheight;  
1216 - //计算的高度值  
1217 - var viewHeight = 715 / ratio;  
1218 - if (this.data.max_sw_height < viewHeight) this.setData({  
1219 - max_sw_height: viewHeight  
1220 - });  
1221 - },  
1222 - //判断该用户是否是新会员  
1223 - is_new: function () {  
1224 - var th = this;  
1225 - wx.hideLoading();  
1226 - getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", {  
1227 - data: {  
1228 - storeId: os.stoid,  
1229 - userId: d.user_id  
1230 - }  
1231 - }).then(res => {  
1232 - if (res.data.code == 0) {  
1233 - var actid = res.data.data.id; //活动id  
1234 - var giftBagId = res.data.data.giftBagId; //礼包id  
1235 - var new_nav = "/pages/giftpack/newvipgift/newvipgift?actId=" + actid + '&' + 'actType=' + 1 + '&' + 'giftBagId=' + giftBagId;  
1236 - var new_image = res.data.data.imageurl;  
1237 - var swiperimage = th.data.swiperimage;  
1238 - var img = {  
1239 - image: "/miniapp/images/newpeople/newpeople.png",  
1240 - nav_url: new_nav  
1241 - }  
1242 - swiperimage.unshift(img);  
1243 - th.setData({  
1244 - swiperimage: swiperimage,  
1245 - new_image: new_image,  
1246 - new_nav: new_nav  
1247 - })  
1248 -  
1249 - getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/bound/judge", {  
1250 - data: {  
1251 - storeId: o.stoid,  
1252 - userId: d.user_id  
1253 - }  
1254 - }).then(res => {  
1255 - if (res.data.code == 0) {  
1256 - th.setData({  
1257 - is_disgraceful: 1  
1258 - })  
1259 - } else {  
1260 - th.check_holiday_pop(); //节日的弹窗  
1261 - }  
1262 -  
1263 - })  
1264 - } else {  
1265 - th.check_holiday_pop(); //节日的弹窗  
1266 - }  
1267 -  
1268 - })  
1269 -  
1270 - },  
1271 -  
1272 - is_festival: function (e) {  
1273 - var th = this;  
1274 - var url = "/api/weshop/marketing/holiday/act/judge";  
1275 - getApp().request.promiseGet(url, {  
1276 - data: {  
1277 - storeId: os.stoid,  
1278 - userId: d.user_id  
1279 - }  
1280 - }).then(res => {  
1281 - if (res.data.code == 0) {  
1282 - var actid = res.data.data.id; //活动id  
1283 - var giftBagId = res.data.data.gifBagId; //礼包id  
1284 - var nav_url = "/pages/giftpack/festival/festival?actId=" + actid + '&' + 'actType=' + 3 + '&' + 'giftBagId=' + giftBagId;  
1285 - var swiperimage = th.data.swiperimage;  
1286 - var actBoundImg = res.data.data.actBoundImg ? res.data.data.actBoundImg : '/miniapp/images/default_g_img.gif';  
1287 -  
1288 - th.data.holiday_image = res.data.data.actImg;  
1289 - th.data.holiday_url = nav_url;  
1290 -  
1291 - var img = {  
1292 - image: actBoundImg,  
1293 - nav_url: nav_url,  
1294 - id: res.data.data.id,  
1295 - type: 'festival'  
1296 - }  
1297 -  
1298 - for (var i in swiperimage) {  
1299 - var item = swiperimage[i];  
1300 - if (item.id == img.id && item.type == img.type) {  
1301 - return false;  
1302 - }  
1303 - }  
1304 -  
1305 - swiperimage.unshift(img);  
1306 - th.setData({  
1307 - swiperimage: swiperimage,  
1308 - new_nav: nav_url  
1309 - })  
1310 - }  
1311 - })  
1312 - },  
1313 -  
1314 - //弹出节日有礼  
1315 - check_holiday_pop: function () {  
1316 - var th = this;  
1317 - getApp().waitfor2(th, 'w_holiday_pop', 'holiday_image', function () {  
1318 - //等到结果才显示  
1319 - if (th.data.holiday_image) {  
1320 - th.setData({  
1321 - new_image: th.data.holiday_image,  
1322 - new_nav: th.data.holiday_url,  
1323 - is_disgraceful: 1  
1324 - })  
1325 - }  
1326 - })  
1327 - },  
1328 -  
1329 - go_ad: function (e) {  
1330 - var url = e.currentTarget.dataset.url;  
1331 - if (!url || url == '') return;  
1332 - if (url[0] != '/') url = '/' + url;  
1333 - getApp().goto(url);  
1334 - },  
1335 -  
1336 - //导航跳转  
1337 - nav_goto: function (e) {  
1338 - var url = e.currentTarget.dataset.url;  
1339 - if (!url || url == '') return;  
1340 - if (url[0] != '/') url = '/' + url;  
1341 - getApp().goto(url);  
1342 - if (this.data.showHongbao) {  
1343 - this.setData({  
1344 - showHongbao: false,  
1345 - showHongbaoSmall: true, //显示抢红包小图标  
1346 - });  
1347 - }  
1348 - },  
1349 -  
1350 - //----跳转到搭配购买----  
1351 - go_test: function () {  
1352 - wx.navigateTo({ url: "/packageA/pages/goods_share/goods_share", })  
1353 - },  
1354 - onShareTimeline() {  
1355 - getApp().globalData.no_clear=1;  
1356 - var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';  
1357 - if (!store_name){  
1358 - store_name = getApp().globalData.setting.appName;  
1359 - }  
1360 - var user_id=getApp().globalData.user_id;  
1361 - if(!user_id) user_id=0;  
1362 - var url=''  
1363 - //群id分享  
1364 - if (getApp().globalData.groupchat_id) {  
1365 - url+="&groupchat_id="+getApp().globalData.groupchat_id 1395 + is_festival: function (e) {
  1396 + var th = this;
  1397 + var url = "/api/weshop/marketing/holiday/act/judge";
  1398 + getApp().request.promiseGet(url, {
  1399 + data: {
  1400 + storeId: os.stoid,
  1401 + userId: d.user_id
  1402 + }
  1403 + }).then(res => {
  1404 + if (res.data.code == 0) {
  1405 + var actid = res.data.data.id; //活动id
  1406 + var giftBagId = res.data.data.gifBagId; //礼包id
  1407 + var nav_url = "/pages/giftpack/festival/festival?actId=" + actid + '&' + 'actType=' + 3 + '&' + 'giftBagId=' + giftBagId;
  1408 + var swiperimage = th.data.swiperimage;
  1409 + var actBoundImg = res.data.data.actBoundImg ? res.data.data.actBoundImg : '/miniapp/images/default_g_img.gif';
  1410 +
  1411 + th.data.holiday_image = res.data.data.actImg;
  1412 + th.data.holiday_url = nav_url;
  1413 +
  1414 + var img = {
  1415 + image: actBoundImg,
  1416 + nav_url: nav_url,
  1417 + id: res.data.data.id,
  1418 + type: 'festival'
1366 } 1419 }
1367 - return {  
1368 - title: '首页-' + '-' + store_name,  
1369 - query: 'first_leader='+user_id+url 1420 +
  1421 + for (var i in swiperimage) {
  1422 + var item = swiperimage[i];
  1423 + if (item.id == img.id && item.type == img.type) {
  1424 + return false;
  1425 + }
1370 } 1426 }
1371 - },  
1372 1427
1373 - // 关闭首页抢红包主弹窗,显示侧边栏抢红包小图标  
1374 - closeHongbao() {  
1375 - this.setData({  
1376 - showHongbao: false, //关闭抢红包主弹窗  
1377 - showHongbaoSmall: true, //显示抢红包小图标  
1378 - });  
1379 - },  
1380 -  
1381 - /*-- 全屏广告 --*/  
1382 - close_full_screen() {  
1383 - this.setData({ is_full_screen_show: 0, sec_show: 0 });  
1384 - },  
1385 - //-- 跳转到满屏广告的链接 --  
1386 - go_full_ad() {  
1387 - if (!this.data.full_ad) return false;  
1388 - if (!this.data.full_ad.ad_weapplink) return false;  
1389 - getApp().goto(this.data.full_ad.ad_weapplink);  
1390 - this.close_full_screen();  
1391 - },  
1392 -  
1393 - go_pre: function (e) {  
1394 - var userInfo = getApp().globalData.userInfo;  
1395 - if (!userInfo) {  
1396 - getApp().goto("/packageE/pages/togoin/togoin");  
1397 - return false;  
1398 - }  
1399 - var url = e.currentTarget.dataset.url;  
1400 - getApp().goto(url);  
1401 - }, 1428 + swiperimage.unshift(img);
  1429 + th.setData({
  1430 + swiperimage: swiperimage,
  1431 + new_nav: nav_url
  1432 + })
  1433 + }
  1434 + })
  1435 + },
  1436 +
  1437 + //弹出节日有礼
  1438 + check_holiday_pop: function () {
  1439 + var th = this;
  1440 + getApp().waitfor2(th, 'w_holiday_pop', 'holiday_image', function () {
  1441 + //等到结果才显示
  1442 + if (th.data.holiday_image) {
  1443 + th.setData({
  1444 + new_image: th.data.holiday_image,
  1445 + new_nav: th.data.holiday_url,
  1446 + is_disgraceful: 1
  1447 + })
  1448 + }
  1449 + })
  1450 + },
  1451 +
  1452 + go_ad: function (e) {
  1453 + var url = e.currentTarget.dataset.url;
  1454 + if (!url || url == '') return;
  1455 + if (url[0] != '/') url = '/' + url;
  1456 + getApp().goto(url);
  1457 + },
  1458 +
  1459 + //导航跳转
  1460 + nav_goto: function (e) {
  1461 + var url = e.currentTarget.dataset.url;
  1462 + if (!url || url == '') return;
  1463 + if (url[0] != '/') url = '/' + url;
  1464 + getApp().goto(url);
  1465 + if (this.data.showHongbao) {
  1466 + this.setData({
  1467 + showHongbao: false,
  1468 + showHongbaoSmall: true, //显示抢红包小图标
  1469 + });
  1470 + }
  1471 + },
  1472 +
  1473 + //----跳转到搭配购买----
  1474 + go_test: function () {
  1475 + wx.navigateTo({ url: "/packageA/pages/goods_share/goods_share", })
  1476 + },
  1477 + onShareTimeline() {
  1478 + getApp().globalData.no_clear = 1;
  1479 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
  1480 + if (!store_name) {
  1481 + store_name = getApp().globalData.setting.appName;
  1482 + }
  1483 + var user_id = getApp().globalData.user_id;
  1484 + if (!user_id) user_id = 0;
  1485 + var url = ''
  1486 + //群id分享
  1487 + if (getApp().globalData.groupchat_id) {
  1488 + url += "&groupchat_id=" + getApp().globalData.groupchat_id
  1489 + }
  1490 + return {
  1491 + title: '首页-' + '-' + store_name,
  1492 + query: 'first_leader=' + user_id + url
  1493 + }
  1494 + },
  1495 +
  1496 + // 关闭首页抢红包主弹窗,显示侧边栏抢红包小图标
  1497 + closeHongbao() {
  1498 + this.setData({
  1499 + showHongbao: false, //关闭抢红包主弹窗
  1500 + showHongbaoSmall: true, //显示抢红包小图标
  1501 + });
  1502 + },
  1503 +
  1504 + /*-- 全屏广告 --*/
  1505 + close_full_screen() {
  1506 + this.setData({ is_full_screen_show: 0, sec_show: 0 });
  1507 + },
  1508 + //-- 跳转到满屏广告的链接 --
  1509 + go_full_ad() {
  1510 + if (!this.data.full_ad) return false;
  1511 + if (!this.data.full_ad.ad_weapplink) return false;
  1512 + getApp().goto(this.data.full_ad.ad_weapplink);
  1513 + this.close_full_screen();
  1514 + },
  1515 +
  1516 + go_pre: function (e) {
  1517 + var userInfo = getApp().globalData.userInfo;
  1518 + if (!userInfo) {
  1519 + getApp().goto("/packageE/pages/togoin/togoin");
  1520 + return false;
  1521 + }
  1522 + var url = e.currentTarget.dataset.url;
  1523 + getApp().goto(url);
  1524 + },
1402 1525
1403 //视频号跳转 1526 //视频号跳转
1404 - nv_void(){ 1527 + nv_void() {
1405 // getApp().openChannelsActivity() 1528 // getApp().openChannelsActivity()
1406 wx.getChannelsLiveInfo({ 1529 wx.getChannelsLiveInfo({
1407 - finderUserName:'sphYA5FuPCZxHaw',  
1408 - success:(res)=>{ 1530 + finderUserName: 'sphYA5FuPCZxHaw',
  1531 + success: (res) => {
1409 console.log(res) 1532 console.log(res)
1410 }, 1533 },
1411 - fail:(error)=>{ 1534 + fail: (error) => {
1412 console.log(error) 1535 console.log(error)
1413 } 1536 }
1414 }) 1537 })
1415 }, 1538 },
1416 - getchir(){ 1539 + getchir() {
1417 const child = this.selectComponent('.goodsg'); 1540 const child = this.selectComponent('.goodsg');
1418 console.log('子组件--------111111------') 1541 console.log('子组件--------111111------')
1419 console.log(child) 1542 console.log(child)
pages/index/index/index.json
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 "usingComponents": { 2 "usingComponents": {
3 "goods_recommend":"/components/goods_list/goods_list", 3 "goods_recommend":"/components/goods_list/goods_list",
4 "nav": "/components/diy_nav/diy_nav", 4 "nav": "/components/diy_nav/diy_nav",
  5 + "top_nav": "/components/diy_top_nav/diy_top_nav",
5 "advertising":"/components/diy_advertising/diy_advertising", 6 "advertising":"/components/diy_advertising/diy_advertising",
6 "groupbuy": "/components/diy_groupbuy/diy_groupbuy", 7 "groupbuy": "/components/diy_groupbuy/diy_groupbuy",
7 "goodsGroup": "/components/diy_goodsGroup/diy_goodsGroup", 8 "goodsGroup": "/components/diy_goodsGroup/diy_goodsGroup",
@@ -28,8 +29,10 @@ @@ -28,8 +29,10 @@
28 "mp-dialog": "weui-miniprogram/dialog/dialog", 29 "mp-dialog": "weui-miniprogram/dialog/dialog",
29 "mp-sticky": "/components/mp-sticky/mp-sticky", 30 "mp-sticky": "/components/mp-sticky/mp-sticky",
30 "floatingWindow": "/components/diy_floatingWindow/diy_floatingWindow", 31 "floatingWindow": "/components/diy_floatingWindow/diy_floatingWindow",
  32 + "floatingBox": "/components/diy_floatingBox/diy_floatingBox",
31 "privacy_pop": "/components/privacy_pop/privacy_pop" 33 "privacy_pop": "/components/privacy_pop/privacy_pop"
32 }, 34 },
33 "enablePullDownRefresh": false, 35 "enablePullDownRefresh": false,
34 - "onReachBottomDistance":300 36 + "onReachBottomDistance":300,
  37 + "navigationStyle":"custom"
35 } 38 }
36 \ No newline at end of file 39 \ No newline at end of file
pages/index/index/index.wxml
@@ -23,6 +23,8 @@ @@ -23,6 +23,8 @@
23 </block> 23 </block>
24 24
25 <view class="top-bar"> 25 <view class="top-bar">
  26 + <top_nav nav_type="{{0}}" nav_frontColor="{{'#fff'}}" nav_backgroundColor="{{'#ff7295'}}" nav_title="{{nav_title}}"></top_nav>
  27 +
26 <!-- 顶部关注公众号 --> 28 <!-- 顶部关注公众号 -->
27 <view id="off_top" wx:if="{{is_gz_h5}}"> 29 <view id="off_top" wx:if="{{is_gz_h5}}">
28 <official-account></official-account> 30 <official-account></official-account>
@@ -48,6 +50,7 @@ @@ -48,6 +50,7 @@
48 </view> 50 </view>
49 </view> 51 </view>
50 </view> 52 </view>
  53 + <top_nav nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{nav_title}}"></top_nav>
51 54
52 <!-- 如果有关注,要顶开位置,不能注释 --> 55 <!-- 如果有关注,要顶开位置,不能注释 -->
53 <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px;;flex-shrink:0"></view> 56 <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px;;flex-shrink:0"></view>
@@ -137,23 +140,23 @@ @@ -137,23 +140,23 @@
137 <view class="mb_box"> 140 <view class="mb_box">
138 <view class="mb_top"> 141 <view class="mb_top">
139 <view class="mb_top_item" data-url="{{mb_banner['300'].ad_weapplink}}" wx:if="{{mb_banner['300']}}" catchtap="go_mb"> 142 <view class="mb_top_item" data-url="{{mb_banner['300'].ad_weapplink}}" wx:if="{{mb_banner['300']}}" catchtap="go_mb">
140 - <image src="{{mb_banner['300'].ad_code}}" style="max-width: 100%;max-height: 360rpx;"></image> 143 + <image src="{{mb_banner['300'].ad_code}}" style="max-width: 100%;max-height: 360rpx;"></image>
141 </view> 144 </view>
142 <view class="mb_top_item"> 145 <view class="mb_top_item">
143 <view wx:if="{{mb_banner['301']}}" data-url="{{mb_banner['301'].ad_weapplink}}" catchtap="go_mb"> 146 <view wx:if="{{mb_banner['301']}}" data-url="{{mb_banner['301'].ad_weapplink}}" catchtap="go_mb">
144 - <image src="{{mb_banner['301'].ad_code}}" style="max-width: 100%;max-height: 180rpx;"></image> 147 + <image src="{{mb_banner['301'].ad_code}}" style="max-width: 100%;max-height: 180rpx;"></image>
145 </view> 148 </view>
146 <view wx:if="{{mb_banner['302']}}" data-url="{{mb_banner['302'].ad_weapplink}}" catchtap="go_mb"> 149 <view wx:if="{{mb_banner['302']}}" data-url="{{mb_banner['302'].ad_weapplink}}" catchtap="go_mb">
147 - <image src="{{mb_banner['302'].ad_code}}" style="max-width: 100%;max-height: 180rpx;"></image> 150 + <image src="{{mb_banner['302'].ad_code}}" style="max-width: 100%;max-height: 180rpx;"></image>
148 </view> 151 </view>
149 </view> 152 </view>
150 </view> 153 </view>
151 <view class="mb_bottom"> 154 <view class="mb_bottom">
152 <view wx:if="{{mb_banner['303']}}" data-url="{{mb_banner['303'].ad_weapplink}}" catchtap="go_mb"> 155 <view wx:if="{{mb_banner['303']}}" data-url="{{mb_banner['303'].ad_weapplink}}" catchtap="go_mb">
153 - <image src="{{mb_banner['303'].ad_code}}" style="max-width: 100%;max-height:200rpx;"></image> 156 + <image src="{{mb_banner['303'].ad_code}}" style="max-width: 100%;max-height:200rpx;"></image>
154 </view> 157 </view>
155 <view wx:if="{{mb_banner['304']}}" data-url="{{mb_banner['304'].ad_weapplink}}" catchtap="go_mb"> 158 <view wx:if="{{mb_banner['304']}}" data-url="{{mb_banner['304'].ad_weapplink}}" catchtap="go_mb">
156 - <image src="{{mb_banner['304'].ad_code}}" style="max-width: 100%;max-height: 200rpx;"></image> 159 + <image src="{{mb_banner['304'].ad_code}}" style="max-width: 100%;max-height: 200rpx;"></image>
157 </view> 160 </view>
158 </view> 161 </view>
159 </view> 162 </view>
@@ -412,14 +415,13 @@ @@ -412,14 +415,13 @@
412 <!--是否是自定义--> 415 <!--是否是自定义-->
413 <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}; padding-bottom: 10rpx"> 416 <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}; padding-bottom: 10rpx">
414 <!-- 置顶层 --> 417 <!-- 置顶层 -->
415 - <view class="dis_top" style="position:fixed">  
416 - <!-- 关注公众号的显示 -->  
417 - <view id="off_top" wx:if="{{is_gz_h5}}"> 418 + <!-- <view class="dis_top" style="position:fixed"> -->
  419 + <!-- 关注公众号的显示 -->
  420 + <!-- <view id="off_top" wx:if="{{is_gz_h5}}">
418 <official-account></official-account> 421 <official-account></official-account>
419 </view> 422 </view>
420 <block wx:for="{{template_arr}}"> 423 <block wx:for="{{template_arr}}">
421 <block wx:if="{{item.content.is_top==1}}"> 424 <block wx:if="{{item.content.is_top==1}}">
422 - <!--如果是搜索框的时候 -->  
423 <block wx:if="{{item.ename=='searchbox'}}"> 425 <block wx:if="{{item.ename=='searchbox'}}">
424 <searchbox object="{{item.content}}"></searchbox> 426 <searchbox object="{{item.content}}"></searchbox>
425 </block> 427 </block>
@@ -428,19 +430,87 @@ @@ -428,19 +430,87 @@
428 </block> 430 </block>
429 </block> 431 </block>
430 </block> 432 </block>
431 - </view> 433 + </view> -->
432 434
433 <!-- 撑开层 --> 435 <!-- 撑开层 -->
434 - <view> 436 + <!-- <view>
435 <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px;flex-shrink:0"></view> 437 <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px;flex-shrink:0"></view>
436 <block wx:for="{{template_arr}}"> 438 <block wx:for="{{template_arr}}">
437 <block wx:if="{{item.content.is_top==1}}"> 439 <block wx:if="{{item.content.is_top==1}}">
438 - <!-- <view style="height:88rpx"></view> -->  
439 <view style="height:{{item.content.style==1 ? 110 : 88}}rpx"></view> 440 <view style="height:{{item.content.style==1 ? 110 : 88}}rpx"></view>
440 </block> 441 </block>
  442 + </block>
  443 +
  444 + </view> -->
  445 +
  446 + <block wx:if="{{is_full_screen_navigation}}">
  447 + <view class="dis_top" style="position: fixed;">
  448 + <top_nav nav_type="{{nav_type}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor ? '#fff' :'#fff'}}" nav_title="{{nav_title}}"></top_nav>
  449 +
  450 + <!-- <js_store_select bindup_storid="get_new_storid" id="js_store_select" transparent="{{searchbox_transparent}}" bgcoler="{{nav_backgroundColor ? '#fff' :'#fff'}}" anclor="{{nav_but_color}}" ></js_store_select> -->
  451 +
  452 + <block wx:for="{{template_arr}}">
  453 + <block wx:if="{{item.content.is_top==1}}">
  454 + <!--如果是搜索框的时候 -->
  455 + <block wx:if="{{item.ename=='searchbox'}}">
  456 + <searchbox object="{{item.content}}" transparent="{{searchbox_transparent}}" nav_backgroundColor="{{nav_backgroundColor ? '#fff' :'#fff'}}"></searchbox>
  457 + </block>
  458 + <!-- <block wx:if="{{item.ename=='store_select'}}">
  459 + <store_select object="{{item.content}}"></store_select>
  460 + </block> -->
  461 + </block>
  462 + </block>
  463 + </view>
  464 + <block wx:for="{{template_arr}}">
  465 + <!--广告组合-->
  466 + <block wx:if="{{item.ename=='advertising' && item.content.full_screen==1 && is_full_screen_navigation_index==index}}">
  467 + <advertising object="{{item.content}}" bindbutColorEvent="bindbut_color_event_fn" is_full_screen_navigation_index="{{is_full_screen_navigation_index}}"></advertising>
  468 + </block>
441 </block> 469 </block>
  470 + </block>
  471 +
  472 + <block wx:else>
  473 + <!-- 置顶层 -->
  474 + <view class="dis_top" style="position:fixed">
  475 + <top_nav nav_type="{{0}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{nav_title}}"></top_nav>
  476 + <!-- 关注公众号的显示 -->
  477 + <view id="off_top" wx:if="{{is_gz_h5}}">
  478 + <official-account></official-account>
  479 + </view>
  480 +
  481 + <!-- <js_store_select id="js_store_select" bindup_storid="get_new_storid" transparent="{{0}}" bgcoler="{{nav_backgroundColor}}" anclor="{{nav_but_color}}" ></js_store_select> -->
  482 +
  483 + <block wx:for="{{template_arr}}">
  484 + <block wx:if="{{item.content.is_top==1}}">
  485 + <!--如果是搜索框的时候 -->
  486 + <block wx:if="{{item.ename=='searchbox'}}">
  487 + <searchbox object="{{item.content}}"></searchbox>
  488 + </block>
  489 + <!-- <block wx:if="{{item.ename=='store_select'}}">-->
  490 + <!-- <store_select object="{{item.content}}"></store_select>-->
  491 + <!-- </block>-->
  492 +
  493 + </block>
  494 + </block>
  495 + </view>
  496 +
  497 + <!-- 撑开层 -->
  498 + <view>
  499 + <!-- 顶部导航撑开层 -->
  500 + <top_nav nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{nav_title}}"></top_nav>
  501 + <!-- 即时零售,门店选择撑开层 -->
  502 + <!-- <view style="width: 100%;height: 88rpx;"></view> -->
  503 + <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px;flex-shrink:0"></view>
  504 + <block wx:for="{{template_arr}}">
  505 + <block wx:if="{{item.content.is_top==1}}">
  506 + <view style="height:{{item.content.style==1 ? 110 : 88 }}rpx"></view>
  507 + </block>
  508 + </block>
  509 +
  510 + </view>
  511 + </block>
  512 +
442 513
443 - </view>  
444 514
445 <block wx:for="{{template_arr}}" wx:key="index"> 515 <block wx:for="{{template_arr}}" wx:key="index">
446 <view> 516 <view>
@@ -453,13 +523,12 @@ @@ -453,13 +523,12 @@
453 <shopname object="{{item.content}}"></shopname> 523 <shopname object="{{item.content}}"></shopname>
454 </block> 524 </block>
455 <!--广告组合--> 525 <!--广告组合-->
456 - <block wx:if="{{item.ename=='advertising'}}"> 526 + <block wx:if="{{item.ename=='advertising' && item.content.full_screen!=1}}">
457 <advertising object="{{item.content}}"></advertising> 527 <advertising object="{{item.content}}"></advertising>
458 </block> 528 </block>
459 <!--商品分组--> 529 <!--商品分组-->
460 <block wx:if="{{item.ename=='goodsGroup' || item.ename=='goodsGroupNew'}}"> 530 <block wx:if="{{item.ename=='goodsGroup' || item.ename=='goodsGroupNew'}}">
461 <goodsGroup class="{{'goodsGroup' + index}}" object="{{item.content}}" sticky="{{template_arr[0].content.is_top}}"></goodsGroup> 531 <goodsGroup class="{{'goodsGroup' + index}}" object="{{item.content}}" sticky="{{template_arr[0].content.is_top}}"></goodsGroup>
462 -  
463 </block> 532 </block>
464 <!--通知--> 533 <!--通知-->
465 <block wx:if="{{item.ename=='notice'}}"> 534 <block wx:if="{{item.ename=='notice'}}">
@@ -490,16 +559,28 @@ @@ -490,16 +559,28 @@
490 </block> 559 </block>
491 <!-- 热区切图 --> 560 <!-- 热区切图 -->
492 <block wx:if="{{item.ename=='heatCutDiagram'}}"> 561 <block wx:if="{{item.ename=='heatCutDiagram'}}">
493 - <heat_img object="{{item.content}}" ></heat_img> 562 + <heat_img object="{{item.content}}"></heat_img>
494 </block> 563 </block>
495 <!--标题--> 564 <!--标题-->
496 <block wx:if="{{item.ename=='title'}}"> 565 <block wx:if="{{item.ename=='title'}}">
497 <title object="{{item.content}}"></title> 566 <title object="{{item.content}}"></title>
498 </block> 567 </block>
  568 + <!--悬浮集-->
  569 + <block wx:if="{{item.ename=='floatingBox'}}">
  570 + <floatingBox farr="{{item.content}}" is_show_top="{{is_show_top}}" loaction_index="{{item.loaction_index}}"></floatingBox>
  571 + </block>
499 <!--悬浮窗口--> 572 <!--悬浮窗口-->
500 - <block wx:if="{{item.ename=='floatingWindow'}}"> 573 + <!-- <block wx:if="{{item.ename=='floatingWindow'}}">
501 <floatingWindow object="{{item.content}}"></floatingWindow> 574 <floatingWindow object="{{item.content}}"></floatingWindow>
502 - </block> 575 + </block> -->
  576 + <!--在线上客服-->
  577 + <!-- <block wx:if="{{item.ename=='onlineService'}}">
  578 + <service object="{{item.content}}"></service>
  579 + </block> -->
  580 + <!--扫一扫-->
  581 + <!-- <block wx:if="{{item.ename=='scan'}}">
  582 + <scan object="{{item.content}}"></scan>
  583 + </block> -->
503 <!--辅助空白--> 584 <!--辅助空白-->
504 <block wx:if="{{item.ename=='white'}}"> 585 <block wx:if="{{item.ename=='white'}}">
505 <assist object="{{item.content}}"></assist> 586 <assist object="{{item.content}}"></assist>
@@ -508,14 +589,7 @@ @@ -508,14 +589,7 @@
508 <block wx:if="{{item.ename=='picMix'}}"> 589 <block wx:if="{{item.ename=='picMix'}}">
509 <picMax object="{{item.content}}"></picMax> 590 <picMax object="{{item.content}}"></picMax>
510 </block> 591 </block>
511 - <!--在线上客服-->  
512 - <block wx:if="{{item.ename=='onlineService'}}">  
513 - <service object="{{item.content}}"></service>  
514 - </block>  
515 - <!--扫一扫-->  
516 - <block wx:if="{{item.ename=='scan'}}">  
517 - <scan object="{{item.content}}"></scan>  
518 - </block> 592 +
519 <!-- 门店选择 --> 593 <!-- 门店选择 -->
520 <block wx:if="{{item.ename=='store_select' && item.content.is_top!=1}}"> 594 <block wx:if="{{item.ename=='store_select' && item.content.is_top!=1}}">
521 <store_select object="{{item.content}}"></store_select> 595 <store_select object="{{item.content}}"></store_select>
@@ -526,8 +600,8 @@ @@ -526,8 +600,8 @@
526 <presell object="{{item.content}}"></presell> 600 <presell object="{{item.content}}"></presell>
527 </block> 601 </block>
528 <block wx:if="{{item.ename=='presaleNew'}}"> 602 <block wx:if="{{item.ename=='presaleNew'}}">
529 - <diy_public object="{{item.content}}" prom_type="8"></diy_public>  
530 - </block> 603 + <diy_public object="{{item.content}}" prom_type="8"></diy_public>
  604 + </block>
531 <!-- 团购 --> 605 <!-- 团购 -->
532 <block wx:if="{{item.ename=='groupbuy'}}"> 606 <block wx:if="{{item.ename=='groupbuy'}}">
533 <groupbuy object="{{item.content}}"></groupbuy> 607 <groupbuy object="{{item.content}}"></groupbuy>
pages/template/index.js
@@ -4,81 +4,115 @@ var t = getApp(), @@ -4,81 +4,115 @@ var t = getApp(),
4 os = t.globalData.setting, 4 os = t.globalData.setting,
5 ut = require("../../utils/util.js"), 5 ut = require("../../utils/util.js"),
6 com = require("../../utils/common.js"); 6 com = require("../../utils/common.js");
7 - var regeneratorRuntime = require('../../utils/runtime.js');  
8 - var api = require('../../api/api.js');  
9 - var appd = getApp().globalData; 7 +var regeneratorRuntime = require('../../utils/runtime.js');
  8 +var api = require('../../api/api.js');
  9 +var appd = getApp().globalData;
10 10
11 Page({ 11 Page({
12 data: { 12 data: {
13 url: os.imghost, 13 url: os.imghost,
14 - temp_id:0,  
15 - goodsGroupArr:[] 14 + temp_id: 0,
  15 + goodsGroupArr: [],
  16 + //满屏顶部导航参数------------
  17 + is_full_screen_navigation: false, //是否满屏
  18 + is_full_screen_navigation_index: -1, //广告轮播满屏下标
  19 + nav_title: '首页',
  20 + nav_frontColor: "#000",
  21 + nav_backgroundColor: "#fff",
  22 + nav_type: 1, //导航类型
  23 + searchbox_transparent: 1, //搜索框背景是否透明
  24 +
  25 + nav_but_color: '#32ACF9', //导航按钮颜色
  26 + sele_pickup: null, //默认门店
  27 + // nav_bg_color:'#e823e8', //导航按钮颜色
  28 + //----------------
  29 + is_show_top: 0, //是否置顶显示
16 }, 30 },
17 31
18 - onLoad: function(e) { 32 + onLoad: function (e) {
19 var th = this; 33 var th = this;
20 - this.data.temp_id=e.scene;  
21 - if(!this.data.temp_id)  
22 - this.data.temp_id=e.sence;  
23 - if(!this.data.temp_id) wx.showModal({ title:"未读取到模板ID" ,})  
24 -  
25 - var first_leader = e.first_leader;  
26 - if (first_leader) {  
27 - //-- user_id代过来免登录 --  
28 - getApp().globalData.first_leader = first_leader;  
29 - //调用接口判断是不是会员  
30 - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {  
31 - if (res.data.code == 0) {  
32 - getApp().globalData.guide_id = res.data.data.id;  
33 - getApp().globalData.guide_pick_id= res.data.data.pickup_id  
34 - }  
35 - })  
36 - } 34 + this.data.temp_id = e.scene;
  35 + if (!this.data.temp_id)
  36 + this.data.temp_id = e.sence;
  37 + if (!this.data.temp_id) wx.showModal({ title: "未读取到模板ID", })
  38 +
  39 + var first_leader = e.first_leader;
  40 + if (first_leader) {
  41 + //-- user_id代过来免登录 --
  42 + getApp().globalData.first_leader = first_leader;
  43 + //调用接口判断是不是会员
  44 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  45 + if (res.data.code == 0) {
  46 + getApp().globalData.guide_id = res.data.data.id;
  47 + getApp().globalData.guide_pick_id = res.data.data.pickup_id
  48 + }
  49 + })
  50 +
  51 + }
  52 +
  53 + getApp().getConfig(function (e) {
  54 + //--首页的问题--
  55 + if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) {
  56 + wx.setNavigationBarTitle({
  57 + title: getApp().globalData.config.store_name,
  58 + });
  59 + th.setData({
  60 + nav_title: getApp().globalData.config.store_name
  61 + })
  62 + } else {
  63 + wx.setNavigationBarTitle({
  64 + title: getApp().globalData.setting.appName,
  65 + });
  66 + th.setData({
  67 + nav_title: getApp().globalData.setting.appName,
  68 + })
  69 + };
  70 + });
  71 +
37 72
38 73
39 -  
40 }, 74 },
41 75
42 async onShow() { 76 async onShow() {
43 - getApp().check_can_share(); 77 + getApp().check_can_share();
44 var th = this; 78 var th = this;
45 await this.init_load(); 79 await this.init_load();
46 //如果是自定义模板 80 //如果是自定义模板
47 if (this.data.isTemplate) { 81 if (this.data.isTemplate) {
48 -  
49 - } 82 +
  83 + }
50 }, 84 },
51 //获取商品模块实例 85 //获取商品模块实例
52 - newGoodsGroup(){  
53 - let arr=[] 86 + newGoodsGroup() {
  87 + let arr = []
54 if (this.data.template_arr.length == 0) { 88 if (this.data.template_arr.length == 0) {
55 return 89 return
56 } 90 }
57 - this.data.template_arr.map((item,index)=>{ 91 + this.data.template_arr.map((item, index) => {
58 if (item.ename == 'goodsGroup') { 92 if (item.ename == 'goodsGroup') {
59 arr.push(`goodsGroup${index}`) 93 arr.push(`goodsGroup${index}`)
60 } 94 }
61 }) 95 })
62 if (arr.length > 0) { 96 if (arr.length > 0) {
63 this.setData({ 97 this.setData({
64 - goodsGroupArr : arr 98 + goodsGroupArr: arr
65 }) 99 })
66 - arr.map(item=>{  
67 - let a = '.'+item 100 + arr.map(item => {
  101 + let a = '.' + item
68 this[item] = this.selectComponent(a); 102 this[item] = this.selectComponent(a);
69 }) 103 })
70 } 104 }
71 }, 105 },
72 //当隐藏的时候就关闭计时器 106 //当隐藏的时候就关闭计时器
73 - onHide: function() {  
74 - 107 + onHide: function () {
  108 +
75 }, 109 },
76 //同步初始加载 110 //同步初始加载
77 async init_load() { 111 async init_load() {
78 var th = this; 112 var th = this;
79 //因为营销版本的功能包含了自定义模板的功能,是同时的 113 //因为营销版本的功能包含了自定义模板的功能,是同时的
80 //读取全局是否有弄自定义模板 114 //读取全局是否有弄自定义模板
81 - await getApp().request.promiseGet("/api/weshop/store_module/get/"+th.data.temp_id+"/4",{1:1} ).then(res => { 115 + await getApp().request.promiseGet("/api/weshop/store_module/get/" + th.data.temp_id + "/4", { 1: 1 }).then(res => {
82 var data = res.data.data; 116 var data = res.data.data;
83 if (data) { 117 if (data) {
84 var temp_data = data; 118 var temp_data = data;
@@ -86,114 +120,228 @@ Page({ @@ -86,114 +120,228 @@ Page({
86 title: temp_data.page_title, 120 title: temp_data.page_title,
87 }); 121 });
88 var t_arr = JSON.parse(temp_data.json_str); 122 var t_arr = JSON.parse(temp_data.json_str);
  123 + //增加判断是否是满屏
  124 + let is_full_screen_navigation = false
  125 + let is_full_screen_navigation_index = -1
  126 + let nav_but_color = "#32ACF9"
  127 + let left_arr = [] //左边悬浮
  128 + let right_arr=[] //右边悬浮
  129 + let floatw=null //悬浮窗口
  130 + if (t_arr) {
  131 + t_arr.map((item, index) => {
  132 + if (item && item.content && item.content.full_screen == 1 && !is_full_screen_navigation) {
  133 + is_full_screen_navigation = true
  134 + is_full_screen_navigation_index = index
  135 + try {
  136 + nav_but_color = item.content.data[0].but_color
  137 + } catch (error) { }
  138 + }
  139 + if (item.ename=='floatingWindow') {
  140 + floatw = item
  141 + }
  142 + if (item.ename=='backTop' || item.ename=='onlineService' || item.ename=='scan' || item.ename=='floatingWindow') {
  143 + right_arr.push(item)
  144 + }
  145 + })
  146 + }
  147 + if (floatw && floatw.content) {
  148 + let fi = right_arr.findIndex(ite=>ite.ename=='floatingWindow')
  149 + let datas={}
  150 + if (!floatw.content.data) { //兼容旧的悬浮窗口
  151 + datas.AppId= floatw.content.AppId
  152 + datas.feedId= floatw.content.feedId
  153 + datas.finderUserName= floatw.content.finderUserName
  154 + datas.img=floatw.content.img
  155 + datas.video_type= floatw.content.video_type
  156 + datas.wxapp_url= floatw.content.wxapp_url
  157 + datas.wxapp_url_title=floatw.content.wxapp_url_title
  158 + floatw.content.data=[datas]
  159 + }
  160 + if (floatw.content.loaction_index==1) {
  161 + right_arr.splice(fi,1,floatw)
  162 + // right_arr.unshift(floatw)
  163 + }else{
  164 + left_arr.unshift(floatw)
  165 + right_arr.splice(fi,1)
  166 + }
  167 + }
  168 + if (left_arr.length>0) {
  169 + let obj={
  170 + ename:'floatingBox',
  171 + content:left_arr,
  172 + loaction_index:0
  173 + }
  174 + t_arr.push(obj)
  175 + }
  176 + if (right_arr.length>0) {
  177 + let obj={
  178 + ename:'floatingBox',
  179 + content:right_arr,
  180 + loaction_index:1
  181 + }
  182 + t_arr.push(obj)
  183 + }
  184 +
89 th.setData({ 185 th.setData({
90 - share_title:temp_data.page_title, 186 + nav_but_color,
  187 + is_full_screen_navigation,
  188 + is_full_screen_navigation_index,
  189 + share_title: temp_data.page_title,
91 template_arr: t_arr, 190 template_arr: t_arr,
92 isTemplate: 1, 191 isTemplate: 1,
93 bgcolor_t: temp_data.bkcolor 192 bgcolor_t: temp_data.bkcolor
94 }); 193 });
95 - setTimeout(()=>{ 194 + setTimeout(() => {
96 th.newGoodsGroup() 195 th.newGoodsGroup()
97 - },1000) 196 + }, 1000)
98 197
99 //---如果有设定顶部的颜色的时候-- 198 //---如果有设定顶部的颜色的时候--
100 - if(temp_data.top_color && temp_data.top_color!='null' ){ 199 + if (temp_data.top_color && temp_data.top_color != 'null') {
101 200
102 - var top_w_color="#ffffff";  
103 - if(temp_data.top_word_color && temp_data.top_word_color=='black'){  
104 - top_w_color="#000000";  
105 - } 201 + var top_w_color = "#ffffff";
  202 + if (temp_data.top_word_color && temp_data.top_word_color == 'black') {
  203 + top_w_color = "#000000";
  204 + }
106 205
107 wx.setNavigationBarColor({ 206 wx.setNavigationBarColor({
108 frontColor: top_w_color, // 必写项 207 frontColor: top_w_color, // 必写项
109 backgroundColor: temp_data.top_color, // 必写项 208 backgroundColor: temp_data.top_color, // 必写项
110 }) 209 })
  210 + th.setData({
  211 + // nav_frontColor: top_w_color, // 必写项
  212 + nav_backgroundColor: temp_data.top_color, // 必写项
  213 + })
111 } 214 }
112 - 215 +
113 } 216 }
114 }) 217 })
115 -  
116 218
117 - 219 +
  220 +
  221 + },
  222 + //广告轮播满屏按钮颜色传递方法
  223 + bindbut_color_event_fn(even) {
  224 + let nav_but_color = even.detail.but_color
  225 + this.setData({
  226 + nav_but_color
  227 + })
118 }, 228 },
  229 + onPageScroll: function (e) {
  230 + //满屏模式监听
  231 + let num = e.scrollTop
  232 + if (this.data.is_full_screen_navigation) {
  233 + let nav_type = this.data.nav_type
  234 + if (num >= 100 && nav_type) {
  235 + this.setData({
  236 + nav_type: 0,
  237 + searchbox_transparent: 0,
  238 + nav_frontColor: '#000'
  239 + })
  240 + // this.data.nav_type = 0
  241 + }
  242 + if (num < 100 && !nav_type) {
  243 + this.setData({
  244 + nav_type: 1,
  245 + searchbox_transparent: 1,
  246 + nav_frontColor: '#000'
  247 + })
  248 + // this.data.nav_type = 1
  249 + }
  250 + }
  251 + //-----------end-------
  252 + //是否显示置顶
  253 + if (num > 400) {
  254 + this.setData({
  255 + is_show_top: 1
  256 + })
  257 + } else {
  258 + this.setData({
  259 + is_show_top: 0
  260 + })
  261 + }
  262 + //----end------
  263 +
  264 + // this.data.scrollTop = e.scrollTop;
  265 + // var t = getCurrentPages();
  266 + // "pages/index/index/index" == t[t.length - 1].route;
119 267
120 - onPullDownRefresh: function(e) {  
121 -  
122 }, 268 },
  269 + onPullDownRefresh: function (e) {
123 270
124 -  
125 - onShareAppMessage:async function(e) {  
126 - var th=this;  
127 - getApp().globalData.no_clear=1;  
128 - getApp().getConfig(await function(e){  
129 - th.setData({  
130 - store_config:e  
131 - })  
132 - }.bind(this)) 271 + },
133 272
134 - var url= `pages/template/index?sence=`+this.data.temp_id;  
135 - var userInfo = getApp().globalData.userInfo;  
136 - //是分销商才带  
137 - if (userInfo) {  
138 - url += "&first_leader=" + userInfo.user_id;  
139 - }  
140 273
141 - var ob = {  
142 - title: this.data.share_title,  
143 - path: url,  
144 - //imageUrl:this.data.url+this.data.store_config.store_logo,  
145 - };  
146 - return ob; 274 + onShareAppMessage: async function (e) {
  275 + var th = this;
  276 + getApp().globalData.no_clear = 1;
  277 + getApp().getConfig(await function (e) {
  278 + th.setData({
  279 + store_config: e
  280 + })
  281 + }.bind(this))
  282 +
  283 + var url = `pages/template/index?sence=` + this.data.temp_id;
  284 + var userInfo = getApp().globalData.userInfo;
  285 + //是分销商才带
  286 + if (userInfo) {
  287 + url += "&first_leader=" + userInfo.user_id;
  288 + }
  289 +
  290 + var ob = {
  291 + title: this.data.share_title,
  292 + path: url,
  293 + //imageUrl:this.data.url+this.data.store_config.store_logo,
  294 + };
  295 + return ob;
147 }, 296 },
148 297
149 /** 298 /**
150 * 用户分享朋友圈 299 * 用户分享朋友圈
151 */ 300 */
152 - async onShareTimeline(){ 301 + async onShareTimeline() {
153 302
154 - var th=this;  
155 - getApp().globalData.no_clear=1;  
156 - getApp().getConfig(await function(e){ 303 + var th = this;
  304 + getApp().globalData.no_clear = 1;
  305 + getApp().getConfig(await function (e) {
157 th.setData({ 306 th.setData({
158 - store_config:e 307 + store_config: e
159 }) 308 })
160 }.bind(this)) 309 }.bind(this))
161 - var {share_title,temp_id,store_config} = this.data;  
162 - var url= `sence=${temp_id}`; 310 + var { share_title, temp_id, store_config } = this.data;
  311 + var url = `sence=${temp_id}`;
163 312
164 - var userInfo = getApp().globalData.userInfo;  
165 - //是分销商才带  
166 - if (userInfo) {  
167 - url += "&first_leader=" + userInfo.user_id;  
168 - } 313 + var userInfo = getApp().globalData.userInfo;
  314 + //是分销商才带
  315 + if (userInfo) {
  316 + url += "&first_leader=" + userInfo.user_id;
  317 + }
169 318
170 var ob = { 319 var ob = {
171 - title:share_title,  
172 - query:url,  
173 - //imageUrl:this.data.url+store_config.store_logo, 320 + title: share_title,
  321 + query: url,
  322 + //imageUrl:this.data.url+store_config.store_logo,
174 }; 323 };
175 console.log(ob); 324 console.log(ob);
176 return ob; 325 return ob;
177 -},  
178 - //---加载更多是靠这个函数----  
179 - onReachBottom: function() {  
180 - if(getApp().globalData.func_list)  
181 - {  
182 - for(let i in getApp().globalData.func_list){  
183 - let item=getApp().globalData.func_list[i];  
184 - item.re_show();  
185 - }  
186 - }  
187 -  
188 - //自定义时商品自动加载更多  
189 - let goodsGroupArr = this.data.goodsGroupArr  
190 - if (this.data.isTemplate && goodsGroupArr.length >0) {  
191 - goodsGroupArr.map(item=>{  
192 - this[item].automore()  
193 - }) 326 + },
  327 + //---加载更多是靠这个函数----
  328 + onReachBottom: function () {
  329 + if (getApp().globalData.func_list) {
  330 + for (let i in getApp().globalData.func_list) {
  331 + let item = getApp().globalData.func_list[i];
  332 + item.re_show();
194 } 333 }
195 - }, 334 + }
  335 +
  336 + //自定义时商品自动加载更多
  337 + let goodsGroupArr = this.data.goodsGroupArr
  338 + if (this.data.isTemplate && goodsGroupArr.length > 0) {
  339 + goodsGroupArr.map(item => {
  340 + this[item].automore()
  341 + })
  342 + }
  343 + },
  344 +
  345 +
196 346
197 -  
198 -  
199 }); 347 });
200 \ No newline at end of file 348 \ No newline at end of file
pages/template/index.json
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 "usingComponents": { 4 "usingComponents": {
5 "goods_recommend":"/components/goods_list/goods_list", 5 "goods_recommend":"/components/goods_list/goods_list",
6 "nav": "/components/diy_nav/diy_nav", 6 "nav": "/components/diy_nav/diy_nav",
  7 + "top_nav": "/components/diy_top_nav/diy_top_nav",
7 "advertising":"/components/diy_advertising/diy_advertising", 8 "advertising":"/components/diy_advertising/diy_advertising",
8 "groupbuy": "/components/diy_groupbuy/diy_groupbuy", 9 "groupbuy": "/components/diy_groupbuy/diy_groupbuy",
9 "goodsGroup": "/components/diy_goodsGroup/diy_goodsGroup", 10 "goodsGroup": "/components/diy_goodsGroup/diy_goodsGroup",
@@ -24,8 +25,10 @@ @@ -24,8 +25,10 @@
24 "service": "/components/diy_service/diy_service", 25 "service": "/components/diy_service/diy_service",
25 "scan": "/components/diy_scan/diy_scan", 26 "scan": "/components/diy_scan/diy_scan",
26 "floatingWindow": "/components/diy_floatingWindow/diy_floatingWindow", 27 "floatingWindow": "/components/diy_floatingWindow/diy_floatingWindow",
  28 + "floatingBox": "/components/diy_floatingBox/diy_floatingBox",
27 "presell": "/components/diy_pregoods/diy_pregoods" 29 "presell": "/components/diy_pregoods/diy_pregoods"
28 - }, 30 + },
29 "enablePullDownRefresh": false, 31 "enablePullDownRefresh": false,
30 - "onReachBottomDistance":300 32 + "onReachBottomDistance":300,
  33 + "navigationStyle":"custom"
31 } 34 }
32 \ No newline at end of file 35 \ No newline at end of file
pages/template/index.wxml
1 <view class="container" style="background-color:{{bgcolor_t}}"> 1 <view class="container" style="background-color:{{bgcolor_t}}">
  2 +
  3 +
  4 + <block wx:if="{{is_full_screen_navigation}}">
  5 + <view class="dis_top" style="position: fixed;">
  6 + <top_nav nav_type="{{nav_type}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor ? '#fff' :'#fff'}}" nav_title="{{nav_title}}"></top_nav>
  7 +
  8 + <!-- <js_store_select bindup_storid="get_new_storid" id="js_store_select" transparent="{{searchbox_transparent}}" bgcoler="{{nav_backgroundColor ? '#fff' :'#fff'}}" anclor="{{nav_but_color}}" ></js_store_select> -->
  9 +
  10 + <block wx:for="{{template_arr}}">
  11 + <block wx:if="{{item.content.is_top==1}}">
  12 + <!--如果是搜索框的时候 -->
  13 + <block wx:if="{{item.ename=='searchbox'}}">
  14 + <searchbox object="{{item.content}}" transparent="{{searchbox_transparent}}" nav_backgroundColor="{{nav_backgroundColor ? '#fff' :'#fff'}}"></searchbox>
  15 + </block>
  16 + <!-- <block wx:if="{{item.ename=='store_select'}}">
  17 + <store_select object="{{item.content}}"></store_select>
  18 + </block> -->
  19 + </block>
  20 + </block>
  21 + </view>
  22 + <block wx:for="{{template_arr}}">
  23 + <!--广告组合-->
  24 + <block wx:if="{{item.ename=='advertising' && item.content.full_screen==1 && is_full_screen_navigation_index==index}}">
  25 + <advertising object="{{item.content}}" bindbutColorEvent="bindbut_color_event_fn" is_full_screen_navigation_index="{{is_full_screen_navigation_index}}"></advertising>
  26 + </block>
  27 + </block>
  28 + </block>
  29 +
  30 + <block wx:else>
  31 + <!-- 置顶层 -->
  32 + <view class="dis_top" style="position:fixed">
  33 + <top_nav nav_type="{{0}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{nav_title}}"></top_nav>
  34 + <!-- 关注公众号的显示 -->
  35 + <view id="off_top" wx:if="{{is_gz_h5}}">
  36 + <official-account></official-account>
  37 + </view>
  38 +
  39 + <!-- <js_store_select id="js_store_select" bindup_storid="get_new_storid" transparent="{{0}}" bgcoler="{{nav_backgroundColor}}" anclor="{{nav_but_color}}" ></js_store_select> -->
  40 +
  41 + <block wx:for="{{template_arr}}">
  42 + <block wx:if="{{item.content.is_top==1}}">
  43 + <!--如果是搜索框的时候 -->
  44 + <block wx:if="{{item.ename=='searchbox'}}">
  45 + <searchbox object="{{item.content}}"></searchbox>
  46 + </block>
  47 + <!-- <block wx:if="{{item.ename=='store_select'}}">-->
  48 + <!-- <store_select object="{{item.content}}"></store_select>-->
  49 + <!-- </block>-->
  50 +
  51 + </block>
  52 + </block>
  53 + </view>
  54 +
  55 + <!-- 撑开层 -->
  56 + <view>
  57 + <!-- 顶部导航撑开层 -->
  58 + <top_nav nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{nav_title}}"></top_nav>
  59 + <!-- 即时零售,门店选择撑开层 -->
  60 + <!-- <view style="width: 100%;height: 88rpx;"></view> -->
  61 + <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px;flex-shrink:0"></view>
  62 + <block wx:for="{{template_arr}}">
  63 + <block wx:if="{{item.content.is_top==1}}">
  64 + <view style="height:{{item.content.style==1 ? 110 : 88 }}rpx"></view>
  65 + </block>
  66 + </block>
  67 +
  68 + </view>
  69 + </block>
  70 +
  71 +
2 <block wx:for="{{template_arr}}" wx:key="{{index}}"> 72 <block wx:for="{{template_arr}}" wx:key="{{index}}">
3 <view> 73 <view>
4 <!--导航--> 74 <!--导航-->
@@ -10,10 +80,10 @@ @@ -10,10 +80,10 @@
10 <shopname object="{{item.content}}"></shopname> 80 <shopname object="{{item.content}}"></shopname>
11 </block> 81 </block>
12 <!--广告组合--> 82 <!--广告组合-->
13 - <block wx:if="{{item.ename=='advertising'}}"> 83 + <block wx:if="{{item.ename=='advertising' && item.content.full_screen!=1}}">
14 <advertising object="{{item.content}}"></advertising> 84 <advertising object="{{item.content}}"></advertising>
15 </block> 85 </block>
16 - <!--商品分组--> 86 + <!--商品分组-->
17 <block wx:if="{{item.ename=='goodsGroup' || item.ename=='goodsGroupNew'}}"> 87 <block wx:if="{{item.ename=='goodsGroup' || item.ename=='goodsGroupNew'}}">
18 <goodsGroup class="{{'goodsGroup' + index}}" object="{{item.content}}"></goodsGroup> 88 <goodsGroup class="{{'goodsGroup' + index}}" object="{{item.content}}"></goodsGroup>
19 </block> 89 </block>
@@ -33,7 +103,7 @@ @@ -33,7 +103,7 @@
33 <mvideo object="{{item.content}}"></mvideo> 103 <mvideo object="{{item.content}}"></mvideo>
34 </block> 104 </block>
35 <!--搜索--> 105 <!--搜索-->
36 - <block wx:if="{{item.ename=='searchbox'}}"> 106 + <block wx:if="{{item.ename=='searchbox' && item.content.is_top!=1}}">
37 <searchbox object="{{item.content}}"></searchbox> 107 <searchbox object="{{item.content}}"></searchbox>
38 </block> 108 </block>
39 <!--天天拼单--> 109 <!--天天拼单-->
@@ -49,7 +119,7 @@ @@ -49,7 +119,7 @@
49 </block> 119 </block>
50 <!-- 热区切图 --> 120 <!-- 热区切图 -->
51 <block wx:if="{{item.ename=='heatCutDiagram'}}"> 121 <block wx:if="{{item.ename=='heatCutDiagram'}}">
52 - <heat_img object="{{item.content}}" ></heat_img> 122 + <heat_img object="{{item.content}}"></heat_img>
53 </block> 123 </block>
54 <!-- <block wx:if="{{item.ename=='seckillNew'}}"> 124 <!-- <block wx:if="{{item.ename=='seckillNew'}}">
55 <diy_public object="{{item.content}}" prom_type="1"></diy_public> 125 <diy_public object="{{item.content}}" prom_type="1"></diy_public>
@@ -62,22 +132,27 @@ @@ -62,22 +132,27 @@
62 <block wx:if="{{item.ename=='white'}}"> 132 <block wx:if="{{item.ename=='white'}}">
63 <assist object="{{item.content}}"></assist> 133 <assist object="{{item.content}}"></assist>
64 </block> 134 </block>
65 - <!--悬浮窗口-->  
66 - <block wx:if="{{item.ename=='floatingWindow'}}">  
67 - <floatingWindow object="{{item.content}}"></floatingWindow>  
68 - </block>  
69 - <!--图片组合--> 135 +
  136 + <!--图片组合-->
70 <block wx:if="{{item.ename=='picMix'}}"> 137 <block wx:if="{{item.ename=='picMix'}}">
71 <picMax object="{{item.content}}"></picMax> 138 <picMax object="{{item.content}}"></picMax>
72 </block> 139 </block>
73 - <!--在线上客服-->  
74 - <block wx:if="{{item.ename=='onlineService'}}">  
75 - <service object="{{item.content}}"></service>  
76 - </block>  
77 - <!--扫一扫-->  
78 - <block wx:if="{{item.ename=='scan'}}">  
79 - <scan object="{{item.content}}"></scan>  
80 - </block> 140 + <!--悬浮集-->
  141 + <block wx:if="{{item.ename=='floatingBox'}}">
  142 + <floatingBox farr="{{item.content}}" is_show_top="{{is_show_top}}" loaction_index="{{item.loaction_index}}"></floatingBox>
  143 + </block>
  144 + <!--悬浮窗口-->
  145 + <!-- <block wx:if="{{item.ename=='floatingWindow'}}">
  146 + <floatingWindow object="{{item.content}}"></floatingWindow>
  147 + </block> -->
  148 + <!--在线上客服-->
  149 + <!-- <block wx:if="{{item.ename=='onlineService'}}">
  150 + <service object="{{item.content}}"></service>
  151 + </block> -->
  152 + <!--扫一扫-->
  153 + <!-- <block wx:if="{{item.ename=='scan'}}">
  154 + <scan object="{{item.content}}"></scan>
  155 + </block> -->
81 156
82 <!-- 预售 --> 157 <!-- 预售 -->
83 <block wx:if="{{item.ename=='presale'}}"> 158 <block wx:if="{{item.ename=='presale'}}">
@@ -86,22 +161,22 @@ @@ -86,22 +161,22 @@
86 <block wx:if="{{item.ename=='presaleNew'}}"> 161 <block wx:if="{{item.ename=='presaleNew'}}">
87 <diy_public object="{{item.content}}" prom_type="8"></diy_public> 162 <diy_public object="{{item.content}}" prom_type="8"></diy_public>
88 </block> 163 </block>
89 - <!-- 团购 -->  
90 - <block wx:if="{{item.ename=='groupbuy'}}">  
91 - <groupbuy object="{{item.content}}"></groupbuy>  
92 - </block>  
93 - <block wx:if="{{item.ename=='groupbuyNew'}}"> 164 + <!-- 团购 -->
  165 + <block wx:if="{{item.ename=='groupbuy'}}">
  166 + <groupbuy object="{{item.content}}"></groupbuy>
  167 + </block>
  168 + <block wx:if="{{item.ename=='groupbuyNew'}}">
94 <diy_public object="{{item.content}}" prom_type="2"></diy_public> 169 <diy_public object="{{item.content}}" prom_type="2"></diy_public>
95 </block> 170 </block>
96 171
97 <!-- 幸运购 --> 172 <!-- 幸运购 -->
98 - <block wx:if="{{item.ename=='luckyactivity'}}">  
99 - <luckyGo object="{{item.content}}"></luckyGo>  
100 - </block>  
101 - <block wx:if="{{item.ename=='luckyactivityNew'}}">  
102 - <!-- <luckyGo object="{{item.content}}"></luckyGo> -->  
103 - <diy_public object="{{item.content}}" prom_type="9"></diy_public>  
104 - </block> 173 + <block wx:if="{{item.ename=='luckyactivity'}}">
  174 + <luckyGo object="{{item.content}}"></luckyGo>
  175 + </block>
  176 + <block wx:if="{{item.ename=='luckyactivityNew'}}">
  177 + <!-- <luckyGo object="{{item.content}}"></luckyGo> -->
  178 + <diy_public object="{{item.content}}" prom_type="9"></diy_public>
  179 + </block>
105 </view> 180 </view>
106 </block> 181 </block>
107 </view> 182 </view>
pages/template/index.wxss
@@ -15,6 +15,13 @@ @@ -15,6 +15,13 @@
15 width: 50rpx; 15 width: 50rpx;
16 height: 45rpx; 16 height: 45rpx;
17 } 17 }
  18 +.dis_top {
  19 + position: sticky;
  20 + top: 0;
  21 + left: 0;
  22 + width: 100%;
  23 + z-index: 100000;
  24 +}
18 25
19 .logo { 26 .logo {
20 width: 48rpx; 27 width: 48rpx;