diff --git a/app.js b/app.js index 9d5f501..7ee7ddc 100644 --- a/app.js +++ b/app.js @@ -251,7 +251,7 @@ App({ title: t, mask: e, duration: a, - image:"/packageA/images/gt.png", + image:"/images/gt.png", complete: function() { "function" == typeof o && setTimeout(o, a); } diff --git a/app.json b/app.json index f1edde1..a17acea 100644 --- a/app.json +++ b/app.json @@ -103,11 +103,11 @@ "pages/quan_pro/quan_pro", "pages/liveStream/liveStream", "pages/liveStreamDetails/liveStreamDetails", - "pages/shop_details/shop_details", + "pages/goods_share/goods_share", "pages/activity_share/activity_share", - "pages/live_share/live_share", - "pages/addCustomer/addCustomer" + "pages/live_share/live_share", + "pages/quan/quan" ] }], diff --git a/packageA/images/gt.png b/images/gt.png index 354851e..354851e 100644 --- a/packageA/images/gt.png +++ b/images/gt.png diff --git a/packageA/pages/activity_share/activity_share.js b/packageA/pages/activity_share/activity_share.js index ccae667..b3859ea 100644 --- a/packageA/pages/activity_share/activity_share.js +++ b/packageA/pages/activity_share/activity_share.js @@ -142,7 +142,7 @@ Page({ //礼包的转发 if(th.data.currentIndex==3){ var lbid=th.data.hui_active.lbId; - var url="pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; + var url="/pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; if(getApp().globalData.user_id){ url+="&first_leader="+getApp().globalData.user_id; } @@ -161,10 +161,13 @@ Page({ //---秒杀,拼团,促销--- var item=this.data.share_good; if(item){ - var price = item.shop_price; + var price = item.price; + if(!price) price=item.shop_price; + + var title= item.goods_name; var img=this.data.url+item.original_img; - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; if(getApp().globalData.user_id){ url+="&first_leader="+getApp().globalData.user_id; } @@ -494,7 +497,7 @@ Page({ var app = getApp(); var unit = that.data.screenWidth / 750 * 1.35; //基础单位, - var scene = th.data.gid+""; + var scene = th.data.share_good.goods_id+""; var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; if(user_id>0){ scene+="_"+user_id; @@ -1057,6 +1060,28 @@ Page({ this.data.is_load=0; this.data.currentPage=1; this.requestGoodsList(); + }, + + + go_goods:function(e){ + var index=e.currentTarget.dataset.index; + var item=this.data.list[index]; + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; + getApp().goto(url); + }, + + go_coll_good:function(e){ + var gid=e.currentTarget.dataset.gid; + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; + getApp().goto(url); + }, + + go_libao:function(e){ + var index=e.currentTarget.dataset.index; + var item=this.data.list[index]; + var lbid=item.lbId; + var url="/pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; + getApp().goto(url); } diff --git a/packageA/pages/activity_share/activity_share.wxml b/packageA/pages/activity_share/activity_share.wxml index 7fe123b..3d3183c 100644 --- a/packageA/pages/activity_share/activity_share.wxml +++ b/packageA/pages/activity_share/activity_share.wxml @@ -26,13 +26,13 @@ scroll-y="true" bindscrolltolower="refresh" scroll-anchoring - refresher-enabled> + > - + ¥{{item.price}} 零售价:¥{{item.market_price}} - 分享 + 分享 @@ -107,7 +107,7 @@ - + 零售价:¥{{item.giftPosPrice}} - 分享 + 分享 @@ -151,7 +151,7 @@ 活动详情 - + 必买商品 商品编号:{{hui_active.goods_sn}} {{hui_active.main_goods_name}} @@ -168,7 +168,7 @@ - + {{index+1}} {{item.goods_name}} ¥{{g_filter.toFix(item.shop_price,2)}} @@ -206,11 +206,11 @@ - + {{index+1}} {{item.goods_name}} ¥{{item.shop_price}} - 分享 + 分享 diff --git a/packageA/pages/addCustomer/addCustomer.js b/packageA/pages/addCustomer/addCustomer.js deleted file mode 100644 index 9a4786c..0000000 --- a/packageA/pages/addCustomer/addCustomer.js +++ /dev/null @@ -1,66 +0,0 @@ -// packageA//pages/quan/quan.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } -}) \ No newline at end of file diff --git a/packageA/pages/addCustomer/addCustomer.json b/packageA/pages/addCustomer/addCustomer.json deleted file mode 100644 index ce68506..0000000 --- a/packageA/pages/addCustomer/addCustomer.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "usingComponents": {}, - "enablePullDownRefresh": false -} \ No newline at end of file diff --git a/packageA/pages/addCustomer/addCustomer.wxml b/packageA/pages/addCustomer/addCustomer.wxml deleted file mode 100644 index c5fa600..0000000 --- a/packageA/pages/addCustomer/addCustomer.wxml +++ /dev/null @@ -1,19 +0,0 @@ - - - - 微信昵称 - hello,我是您的专属顾问 - 扫描下方二维码,加我微信吧~ - - - - - - 发给客户 - - - - 保存图片 - - - \ No newline at end of file diff --git a/packageA/pages/addCustomer/addCustomer.wxss b/packageA/pages/addCustomer/addCustomer.wxss deleted file mode 100644 index d67d9eb..0000000 --- a/packageA/pages/addCustomer/addCustomer.wxss +++ /dev/null @@ -1,488 +0,0 @@ -/* packageA//pages/goods_share/goods_share.wxss */ -.red { - color: #FE6867; -} -.gray { - color: #7b7b7b; -} -.w25 { - width: 25%; -} -.w50 { - width: 50%; -} -.w164 { - width: 164rpx; -} -.bold { - font-weight: bold; -} -.mgt12 { - margin-top: 12rpx; -} -page, -.container { - /* background-color: #f2f2f2; */ - height: 100%; - background-color: pink; -} -.container { - /* background-color: white; */ - /* position: fixed; - width: 100%; - bottom: 0; */ - box-sizing: border-box; - padding: 160rpx 40rpx 0; - background-image: linear-gradient(to top, #4481eb 0%, #04befe 100%); - /* padding-bottom: 128rpx; */ -} -.search-container { - display: flex; - padding: 26rpx 20rpx; - border-bottom: 2rpx solid #f8f8f8; -} -.input-container { - flex: 1; - border-radius: 6rpx 0 0 6rpx; - overflow: hidden; -} -.search { - background-color: #f0f0f0; - padding: 10rpx 20rpx; - font-size: 28rpx; -} -.btn-search { - background-color: #FE6867; - color: white; - padding: 0 30rpx; - display: flex; - align-items: center; - border-radius: 0 6rpx 6rpx 0; -} -.title { - display: flex; - font-size: 30rpx; - border-bottom: 2rpx solid #f8f8f8; -} -.title .iconfont { - color: #ccc; - font-size: 16rpx; - margin-left: 8rpx; -} -.title-item { - width: 25%; - box-sizing: border-box; - text-align: center; - padding: 20rpx; - position: relative; -} -.title-item.active { - color: #FE6867; - font-weight: bold; -} -.title-item.active:after { - content:''; - position: absolute; - width: 50%; - height: 4rpx; - background-color: #FE6867; - left: 0; - right: 0; - bottom: 0; - margin: 0 auto; -} -.list-container { - height: calc(100% - 118rpx); -} -.list { - box-sizing: border-box; - height: calc(100% - 82rpx); - background-color: #f2f2f2; - /* padding-bottom: 102rpx; */ -} -.list.active1 { - height: calc(100% - 82rpx - 78rpx); - padding-bottom: 0; -} -.list.active2 { - padding-bottom: 0; -} -.list-item { - display: flex; - padding: 20rpx; - border-bottom: 2rpx solid #f8f8f8; - background-color: white; -} -.img-container { - background-color: #f0f0f0; - width: 280rpx; - height: 248rpx; - display: flex; - align-items: center; - justify-content: center; - position: relative; -} -.img-container:after { - font-family: iconfont; - content: '\e8c1'; - color: #bbb; - font-size: 80rpx; -} - - -.img-container.live:before { - content: '\e664'; -} -.img-container.coming:before { - content: '\e608'; -} -.img-container.playback:before { - content: '\e603'; -} -.img-container.live:before, -.img-container.coming:before, -.img-container.playback:before { - font-family: iconfont; - background-color: #FE6867; - color: white; - width: 50rpx; - height: 50rpx; - line-height: 50rpx; - text-align: center; - border-radius: 50%; - position: absolute; - left: 10rpx; - top: 10rpx; -} -.details { - flex: 1; - padding-left: 20rpx; -} -.btn-share { - box-sizing: border-box; - display: inline-block; - background-color: #FE6867; - color: white; - padding: 8rpx 30rpx; - border-radius: 6rpx; - text-align: center; -} -.pdt10 { - padding-top: 10rpx; -} -.pdt14 { - padding-top: 14rpx; -} -.pdtb6 { - padding-top: 6rpx; - padding-bottom: 6rpx; -} -.pdtb8 { - padding-top: 8rpx; - padding-bottom: 8rpx; -} -.pdl20 { - padding-left: 104rpx; -} - - -.no-more { - line-height: 3; - color: #ccc; - /* background-color: #f2f2f2; */ -} -.nodata { - text-align: center; - background-color: #f2f2f2; -} -.progress-container { - width: 55%; - padding-right: 10rpx; - position: relative; - text-align: center; -} -.retail { - color: #7b7b7b; - text-decoration: line-through; - font-size: 22rpx; - padding-left: 20rpx; -} -.name { - height: 76rpx; - overflow: hidden; -} - -.percent { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - margin: auto; - color: white; -} -.tabbar { - position: fixed; - width: 100%; - bottom: 0; - background-color: white; -} -.tabbar:after { - position: absolute; - content: ''; - width: 2rpx; - height: 50%; - top: 0; - bottom: 0; - left: 0; - right: 0; - margin: auto; - background-color: #f0f0f0; -} -.tabbar-item { - width: 50%; - text-align: center; - padding-top: 30rpx; - padding-bottom: 30rpx; -} -.tabbar-item .iconfont { - margin-right: 10rpx; -} -.tabbar-item.active { - color: #FE6867; -} - - -.group-type, -.group-num { - position: relative; - font-size: 22rpx; -} -.group-type:before, -.group-num:before { - font-family: iconfont; -} -.group-type:before { - content: '\e66a'; - color: white; - background-color: #FE6867; - position: absolute; - left: 0; - top: 0; - bottom: 0; - padding-left: 6rpx; - padding-right: 10rpx; - line-height: 30rpx; -} -.group-num:before { - padding-right: 6rpx; -} -.group-num:before { - content: '\e694'; - position: relative; -} -.group-num { - color: white; - background-color: #FE6867; - border-radius: 34rpx; - padding-left: 10rpx; - padding-right: 10rpx; - margin-right: 14rpx; -} -.group-type { - color: #FE6867; - border: 2rpx solid #FE6867; - padding-left: 42rpx; - padding-right: 4rpx; - border-radius: 6rpx; -} - -.badge { - color: white; - padding: 0 20rpx; - border-radius: 6rpx; - background-color: #FE6867; - margin-right: 10rpx; -} - -.subTab-title { - text-align: center; - justify-content: center; - align-items: center; - font-size: 28rpx; -} -.subTab-list { - padding: 20rpx; -} -.subTab-titleItem { - box-sizing: border-box; - width: calc(100% / 3); - padding: 20rpx 40rpx; - background-color: white; - border-right: 2rpx solid #f8f8f8; -} -.subTab-titleItem:last-child { - border-right: none; -} -.subTab-titleItem.active { - background-color: #FE6867; - color: white; -} -.subTab-item { - padding: 20rpx; - border-bottom: 2rpx solid #f8f8f8; - background-color: white; - border-radius: 8rpx; - box-shadow: 0 8px 12px #e7e9eb; -} -.subTab-item ~ .subTab-item { - margin-top: 20rpx; -} -.pdv10 { - padding-top: 10rpx; - padding-bottom: 10rpx; -} -.pdv20 { - padding-top: 20rpx; - padding-bottom: 20rpx; -} -.pdb10 { - padding-bottom: 10rpx; -} -.pdb20 { - padding-bottom: 20rpx; -} -.bdr-b { - border-bottom: 2rpx solid #f8f8f8; -} -.dash-b { - border-bottom: 2rpx dashed #ddd; -} -.btn-container { - display: flex; - align-items: flex-end; - font-size: 26rpx; -} - - -/* .popup-container { - content:''; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 3; - background-color: rgba(0,0,0,.6); - display: flex; - align-items: center; - justify-content: center; -} -.popup { - width: 90%; -} -.popup-content { - box-sizing: border-box; - width: 100%; - background-color: white; - padding: 0 20rpx; - border-radius: 10rpx; - max-height: 1038rpx; -} -.icon-close { - font-size: 60rpx; - color: white; -} -.popup-btn { - padding-top: 30rpx; -} - -.popup-title { - /* font-size: 28rpx; */ - /* font-weight: bold; - padding: 20rpx 0; -} -.popup-title2 { */ - /* padding: 10rpx 0; */ - /* padding-bottom: 8rpx; -} -.popup-title3 { - padding-left: 34rpx; - font-size: 30rpx; -} -.popup-list { - max-height: 602rpx; - overflow-y: auto; -} - - -radio .wx-radio-input { - width: 28rpx; - height: 28rpx; -} - - -radio .wx-radio-input.wx-radio-input-checked { - background-color: #FE6867; - border-color: #FE6867; -} -radio .wx-radio-input.wx-radio-input-checked::before{ - color: white; -} - -.popup-content.active { - max-height: 982rpx; - overflow: auto; -} */ - -.panel { - box-sizing: border-box; - background-color: white; - height: 100%; - border-radius: 16rpx; - position: relative; - padding-top: 140rpx; - box-shadow: 0 8px 12px #ccc; -} -.avatar { - width: 220rpx; - height: 220rpx; - border-radius: 50%; - background-color: skyblue; - position: absolute; - top: -100rpx; - left: 0; - right: 0; - margin: 0 auto; -} -.nickname { - padding-bottom: 60rpx; -} -.bottom { - background-color: white; - border-top: 2rpx solid #f0f0f0; - /* box-shadow: 0 -6px 8px #e7e9eb; */ - width: 100%; - position: fixed; - left: 0; - bottom: 0; -} -.wx { - width: 60rpx; - height: 60rpx; -} -.save { - box-sizing: border-box; - padding-top: 6rpx; -} -.icon-save { - font-size: 50rpx; -} -.qrcode { - width: 480rpx; - height: 480rpx; - background-color: red; - margin: 60rpx auto 0; -} - - diff --git a/packageA/pages/goods_share/goods_share.js b/packageA/pages/goods_share/goods_share.js index 117dbe5..35948dc 100644 --- a/packageA/pages/goods_share/goods_share.js +++ b/packageA/pages/goods_share/goods_share.js @@ -136,7 +136,7 @@ Page({ var title= item.goods_name; var img=this.data.url+item.original_img; - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; if(getApp().globalData.user_id){ url+="&first_leader="+getApp().globalData.user_id; } @@ -325,7 +325,7 @@ Page({ var app = getApp(); var unit = that.data.screenWidth / 750 * 1.35; //基础单位, - var scene = th.data.gid+""; + var scene = th.data.share_good.goods_id+""; var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; if(user_id>0){ scene+="_"+user_id; @@ -792,6 +792,13 @@ Page({ this.data.is_load=0; this.data.currentPage=1; this.requestGoodsList(); + }, + + go_goods:function(e){ + var index=e.currentTarget.dataset.index; + var item=this.data.list[index]; + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; + getApp().goto(url); } diff --git a/packageA/pages/goods_share/goods_share.wxml b/packageA/pages/goods_share/goods_share.wxml index d922e98..ec817b0 100644 --- a/packageA/pages/goods_share/goods_share.wxml +++ b/packageA/pages/goods_share/goods_share.wxml @@ -10,8 +10,21 @@ 销量 - 价格 - 佣金 + + + 价格 + + + 价格 + + + + 佣金 + + + 佣金 + + 最新 @@ -20,9 +33,9 @@ scroll-y="true" bindscrolltolower="refresh" scroll-anchoring - refresher-enabled> + > - + ¥{{item.fir_rate+item.sec_rate+item.thi_rate}} - + 分享 diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.js b/packageA/pages/liveStreamDetails/liveStreamDetails.js index ae5f577..563ed96 100644 --- a/packageA/pages/liveStreamDetails/liveStreamDetails.js +++ b/packageA/pages/liveStreamDetails/liveStreamDetails.js @@ -401,8 +401,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un var first_leader=options.first_leader; if(first_leader){ //-- user_id代过来免登陆 -- - getApp().globalData.user_id=first_leader; - getApp().getUserFir(); + getApp().globalData.first_leader=first_leader; //调用接口判断是不是会员 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+o.stoid+"/"+first_leader,{}).then(res=>{ if(res.data.code==0){ diff --git a/packageA/pages/live_share/live_share.js b/packageA/pages/live_share/live_share.js index e340ea0..2631ba1 100644 --- a/packageA/pages/live_share/live_share.js +++ b/packageA/pages/live_share/live_share.js @@ -179,6 +179,16 @@ Page({ this.requestGoodsList(); }, + cancel:function(){ + this.setData({share_hidden:1}); + }, + go_live:function(e){ + var index=e.currentTarget.dataset.index; + var item=this.data.list[index]; + var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + item.id + '&live=ing'; + getApp().goto(url); + } + }) \ No newline at end of file diff --git a/packageA/pages/live_share/live_share.wxml b/packageA/pages/live_share/live_share.wxml index 14b4030..353d0c1 100644 --- a/packageA/pages/live_share/live_share.wxml +++ b/packageA/pages/live_share/live_share.wxml @@ -14,10 +14,10 @@ scroll-y="true" bindscrolltolower="refresh" scroll-anchoring - refresher-enabled> + > - + {{item.name}} 直播时间:{{filter.format_time(item.start_time, 2)}} 主播:{{item['anchor_name']}} - 分享 + 分享 diff --git a/packageA/pages/quan/quan.js b/packageA/pages/quan/quan.js index 154edc6..3e541d1 100644 --- a/packageA/pages/quan/quan.js +++ b/packageA/pages/quan/quan.js @@ -156,6 +156,20 @@ Page({ com.set_type(1); }, + cancel:function(){ + this.setData({share_hidden:1}); + }, + + go_quan:function(e){ + var index=e.currentTarget.dataset.index; + var item=this.data.list[index]; + var url="/packageA/pages/quan_pro/quan_pro?id="+item.id; + getApp().goto(url); + } + + + + diff --git a/packageA/pages/quan/quan.wxml b/packageA/pages/quan/quan.wxml index 86fbeda..b2cd17c 100644 --- a/packageA/pages/quan/quan.wxml +++ b/packageA/pages/quan/quan.wxml @@ -17,10 +17,10 @@ refresher-enabled> - + - {{item.name}} + {{item.name}} 限时使用: {{filters.format_time(getcurday+3600*24*item.startdays)}} {{filters.format_time(item.use_start_time)}}至 @@ -30,7 +30,7 @@ {{filters.format_time(getcurday+3600*24*item.startdays)}}至 {{filters.format_time(getcurday+3600*24*item.days)}}不限 - {{filters.toFix(item.money,2)}} + {{filters.toFix(item.money,2)}} 全场任意产品通用 @@ -40,7 +40,7 @@ 分类一({{item.useobjectname}}) 单品({{item.useobjectname}}) - 分享 + 分享 diff --git a/packageA/pages/quan_pro/quan_pro.js b/packageA/pages/quan_pro/quan_pro.js index 15a91bf..c44ecfe 100644 --- a/packageA/pages/quan_pro/quan_pro.js +++ b/packageA/pages/quan_pro/quan_pro.js @@ -19,6 +19,20 @@ Page({ }, //------初始化加载---------- onLoad: function(t) { + + var th = this; + var first_leader=t.first_leader; + if(first_leader){ + //-- user_id代过来免登陆 -- + getApp().globalData.first_leader=first_leader; + //调用接口判断是不是会员 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ + if(res.data.code==0){ + getApp().globalData.guide_id=res.data.data.id; + } + }) + } + var id=t.id; this.data.id=id; var goods_list = this.selectComponent("#goods_list"); //组件的id diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 01f2e95..af4a9a9 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -112,6 +112,8 @@ Page({ show_card:null, //显示的等级卡 card_name:'', //显示的卡的名称 card_cut_price:null,//减价多少钱 + + show_submit:0, //提交按钮变正常显示 }, onLoad: function(t) { @@ -140,8 +142,9 @@ Page({ //----------子页返回父页触发---------- onShow: function() { var th=this; + th.setData({show_submit:0}); + if (th.data.isclose==0){ - wx.navigateTo({ url: "/pages/index/index/index" }) @@ -153,7 +156,7 @@ Page({ console.log(ie) //地址切换要把包邮券清空 - if( !th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ + if( !th.data.user_addr || !ie || th.data.user_addr.address_id!=ie.address_id){ var using_quan=th.data.using_quan; for(var i in using_quan){ var item=using_quan[i]; @@ -164,19 +167,22 @@ Page({ } th.data.isget_by_quan={}; } - + + + th.data.prom_goods_map={}; + th.data.is_summit_ing=0; //更换地址回来要重新调用计算价钱的接口 if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ th.setData({user_addr: ie }); if (th.data.is_b_now == 1) { if(th.data.bn_goods) { th.setData({add_back:1}); - th.calculatePrice2(); + //th.calculatePrice2(); } }else{ if (th.data.cartlist){ th.setData({add_back:1}); - th.calculatePrice(); + //th.calculatePrice(); } } }else{ @@ -277,26 +283,31 @@ Page({ //------获取会员收货地址----- getuser_addr:function(func){ + var th=this; a.get("/api/weshop/useraddress/page", { - data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600 }, + data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600,t:Math.random()}, success: function (su) { /*--- var user_addr=[ { 'address_id': 882, 'user_id': 2661, 'consignee': '测试测试测', 'province': 3102, 'city': 3431, 'district': 3466, 'address': 'ed', 'more_address': '山西-长治市-襄垣县-虎(音si)亭镇', 'mobile': 13012345678,'is_default':1}, - ];---*/ - var user_addr = su.data.data.pageData; - var item = null; - var def_item=null; - for (var i = 0; i < user_addr.length; i++) { - if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];} - if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } - } - - if (item == null) item = def_item; - if (item == null) item = user_addr[0]; + ];---*/ + var item = null; + if(su.data.code==0 && su.data.data && su.data.data.pageData){ + var user_addr = su.data.data.pageData; + var def_item=null; + for (var i = 0; i < user_addr.length; i++) { + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];} + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } + } + + if (item == null) item = def_item; + if (item == null) item = user_addr[0]; + } if(item==undefined) item=null; + if(!item) th.setData({user_addr:null}); //地址为空的时候,要清空,因为返回的时候,有缓存 + func(item); } }); @@ -341,7 +352,8 @@ Page({ } }); }, - + + //-----真的获取购物车,入口-------- get_cart: function () { var th = this,app=getApp(); @@ -360,11 +372,7 @@ Page({ for (var i = 0; i < carr.length; i++) { var item = carr[i]; - //要把优惠活动加入,prom_goods_map中,赠品不要运算 - if(item.prom_type==3 && item.is_gift!=1){ - await th.add_prom_goods_map(item); - } - + //-- 如果是等级会员注册返回 -- if(is_card_back){ th.data.card_name=th.data.userinfo.card_field; @@ -383,12 +391,17 @@ Page({ // 拼团,搭配购不计算,赠品也不计算,同时会员还未购买等级会员 if(item[th.data.card_name]>0 && item['prom_type']!=5 && item['prom_type']!=6 && !th.data.userinfo.card_field && !item.is_gift && !item['is_collocation'] && item.goods_price>item[th.data.card_name] ){ - item.cut_price= item.goods_price-item[th.data.card_name]; - carr[i].cut_price=(item.goods_price-item[th.data.card_name])*item.goods_num; + item.cut_price1= item.goods_price-item[th.data.card_name]; + carr[i].cut_price1=(item.goods_price-item[th.data.card_name])*item.goods_num; } } + //要把优惠活动加入,prom_goods_map中,赠品不要运算 + if(item.prom_type==3 && item.is_gift!=1){ + await th.add_prom_goods_map(item); + } + item.original_img = oo.imghost + item.original_img; /*----接口要弄出来的,先顶着-----*/ @@ -399,7 +412,22 @@ Page({ if (arr.length > 0) { for (var j = 0; j < arr.length; j++) { if (arr[j].pickup_id == pcid) { - arr[j].goods.push(item); + arr[j].goods.push(item); + if(item.is_gift!=1){ + //确定配送方式 + if(arr[j].distr_t==0){ + arr[j].distr_t=item.distr_type; + } + var e_t=0 + switch (arr[j].distr_t) { + case 0: e_t = 1; break; + case 1: e_t = 1; break; + case 2: e_t = 0; break; + } + arr[j].exp_type=e_t; + if (e_t == 0) th.setData({ is_all_zt:0}); + } + //-- 把等级卡会优惠多少钱装进去 -- if(item.cut_price) arr[j].card_cut_price+=item.cut_price; find = 1;break; @@ -426,7 +454,6 @@ Page({ case 1: e_t = 1; break; case 2: e_t = 0; break; } - //如果是物流的话,全部自提的控制要弄成0 if (e_t == 0) th.setData({ is_all_zt:0}); @@ -441,14 +468,21 @@ Page({ } var ie = { - pickup_id: pcid, pname: pikname, goods: narr, wind: m_wind, distr_t: dis_t,card_cut_price:0, + pickup_id: pcid, pname: pikname, goods: narr, wind: m_wind, distr_t: dis_t,card_cut_price:0,exp_type:e_t, goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0}; - - if(!th.data.add_back){ - ie.exp_type= e_t - } + + //-- 如果是回退回来的情况 -- + if(th.data.cartlist && th.data.cartlist.length>0) { + for(var kj in th.data.cartlist){ + if(ie.pickup_id==th.data.cartlist[kj].pickup_id){ + ie.exp_type=th.data.cartlist[kj].exp_type; + break; + } + } + } + //-- 把等级卡会优惠多少钱装进去 -- - if(item.cut_price) ie.card_cut_price+=item.cut_price; + if(item.cut_price1) ie.card_cut_price+=item.cut_price1; arr.push(ie); } @@ -496,7 +530,9 @@ Page({ case 1: et = 1; break; case 2: et = 0; break; } - + + if(th.data.bn_goods) et=th.data.bn_exp_type + var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; if(et==0 && def_exp_code){ for(var k=0;k=0 && item_map.price-item_map.prom_price){ + //if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){ + if(item_map.price-item_map.prom_price && item_map.prom_price!==null){ if(cart_item.prom_pt_json){ cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}) }else{ @@ -892,6 +919,7 @@ Page({ cart_item.g_coupon_num.push({'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}) } } + //-- 如果有送优包邮券的情况 -- if(item_map.s_libao){ if(!cart_item.s_libao) { @@ -1004,15 +1032,18 @@ Page({ if(no_ex_good){ is_good_no_by=th.check_by_goods(no_ex_good,item[j].goods_id); } + //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 if(o_price>=freight_free && freight_free>0 && !is_good_no_by && th.data.is_no_by[pickid]!=1){ continue; } + //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算-- if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby==1 && !is_good_no_by){ continue; } + //----------------如果是选择了物流--------------------- if(cart_item.exp_type == 0 && item[j].is_free_shipping==0){ //如果地址不为空 @@ -1197,7 +1228,7 @@ Page({ th.setData({ [atxt]: all_total_m, [atxt1]: all_order_m, [atxt2]: all_price, [atxt3]: all_user_m, [atxt4]: all_shipping_m, [atxt5]: all_coupon_price_m,[atxt6]: all_cutprice, - [atxt7]: all_order_prom, + [atxt7]: all_order_prom, show_submit:1 }) th.data.order_prom_list_cart=c_arr; th.set_can_num(); @@ -1247,7 +1278,7 @@ Page({ //-----------计算商品总价-------------- var allpice = good.shop_price * good.buynum; var cut_price=0; - if(good.prom_type==3 && good.prom_price){ + if(good.prom_type==3 && good.prom_price!==null){ cut_price=allpice-good.prom_price; } allpice=parseFloat(allpice).toFixed(2); @@ -1429,14 +1460,14 @@ Page({ if (th.data.bn_use_money == 1) { if (amoney> order_m) { order_m = order_m.toFixed(2); - th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price }) + th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 }) }else{ order_m =parseFloat(order_m - amoney); order_m = order_m.toFixed(2); - th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price }) + th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 }) } }else{ - th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price }) + th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price,show_submit:1}) } //优惠活动送积分 if(good.s_intValue){ @@ -1476,14 +1507,14 @@ Page({ if (th.data.bn_use_money == 1) { if (amoney> order_m) { order_m = order_m.toFixed(2); - th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price }) + th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 }) }else{ order_m =parseFloat(order_m - amoney); order_m = order_m.toFixed(2); - th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price }) + th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 }) } }else{ - th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price }) + th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price, show_submit:1 }) } //优惠活动送积分 if(good.s_intValue){ @@ -1527,7 +1558,7 @@ Page({ if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ ff = false; getApp().my_warnning("请选择收货地址",0,th); - this.data.is_summit_ing = 0; + th.data.is_summit_ing = 0; } if (!ff) return false; var addr = th.data.user_addr; @@ -1536,6 +1567,7 @@ Page({ if(th.data.bn_exp_type==0) if(th.data.wu_arr==null || th.data.wu_arr.length<=0){ getApp().my_warnning("读取物流失败",0,th); + th.data.is_summit_ing = 0; return false; } @@ -1716,7 +1748,9 @@ Page({ console.log(pdata); }else{ //---------购物车的结算--------- - if (th.data.is_all_zt == 0 && th.data.user_addr == null) { ff = false; getApp().confirmBox("请新建收货地址");} + if (th.data.is_all_zt == 0 && th.data.user_addr == null) { + th.data.is_summit_ing = 0; + ff = false; getApp().confirmBox("请新建收货地址");} if (!ff) return false; var addr = th.data.user_addr; @@ -1726,6 +1760,7 @@ Page({ if(th.data.is_all_zt !=1) if(th.data.wu_arr==null || th.data.wu_arr.length<=0 ){ + th.data.is_summit_ing = 0; getApp().confirmBox("读取物流失败"); return false; } @@ -1939,7 +1974,7 @@ Page({ util_pay.pay(data.data, function() { //app.my_warnning("支付成功",1,th); //setTimeout(function () { - wx.navigateTo({ + wx.redirectTo({ url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data }) //},1000) @@ -1965,7 +2000,7 @@ Page({ //app.my_warnning("支付成功",1,th); //setTimeout(function () { th.setData({ isclose: 0 }); - wx.navigateTo({ + wx.redirectTo({ url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data, }) //}, 1000) @@ -2084,6 +2119,7 @@ Page({ //--------购物车购买时,选择自提和物流----------- setexptype_w:function(t){ + var def_exp_code= getApp().globalData.userInfo.def_exp_code,th=this; var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, wl_txt = t.currentTarget.dataset.wl_txt, diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml index 43f4e80..eaa234c 100644 --- a/pages/cart/cart2/cart2.wxml +++ b/pages/cart/cart2/cart2.wxml @@ -4,7 +4,7 @@
- + - + 应付金额:¥{{formData.order_amount}} - + diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index b62bef0..018e713 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -42,10 +42,9 @@ Page({ var first_leader=options.first_leader; if(first_leader){ //-- user_id代过来免登陆 -- - getApp().globalData.user_id=first_leader; - getApp().getUserFir(); + getApp().globalData.first_leader=first_leader; //调用接口判断是不是会员 - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{ + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ if(res.data.code==0){ getApp().globalData.guide_id=res.data.data.id; } diff --git a/pages/index/index/index.js b/pages/index/index/index.js index cebe2ea..f458aef 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -82,10 +82,9 @@ Page({ var first_leader=tt.first_leader; if(first_leader){ //-- user_id代过来免登陆 -- - getApp().globalData.user_id=first_leader; - getApp().getUserFir(); + getApp().globalData.first_leader=first_leader; //调用接口判断是不是会员 - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{ + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ if(res.data.code==0){ getApp().globalData.guide_id=res.data.data.id; } diff --git a/pages/user/assistance/assistance.wxml b/pages/user/assistance/assistance.wxml index b7a7501..69e5394 100644 --- a/pages/user/assistance/assistance.wxml +++ b/pages/user/assistance/assistance.wxml @@ -7,7 +7,9 @@ - + + + @@ -97,6 +99,7 @@ + @@ -113,6 +116,7 @@
+
diff --git a/pages/user/assistance/assistance.wxss b/pages/user/assistance/assistance.wxss index 5054598..ac87d8e 100644 --- a/pages/user/assistance/assistance.wxss +++ b/pages/user/assistance/assistance.wxss @@ -6,13 +6,14 @@ page { } .page { - height: 100vh; + /* height: 100vh; */ } .bg-img { - background: url("https://mshopimg.yolipai.net/public/upload/newpeoplegift/temp/2020/09-26/75640123e5ae953e416527134a6fc477.jpg") no-repeat center center; - background-size: 100% 100%; + display: block; + width: 100%; + height: 100%; } .lumi { diff --git a/pages/user/assistance/task_assistance.wxml b/pages/user/assistance/task_assistance.wxml index 8e86552..8bc19e5 100644 --- a/pages/user/assistance/task_assistance.wxml +++ b/pages/user/assistance/task_assistance.wxml @@ -1,182 +1,185 @@ - - - - - - - {{aitem[sw_index].helpTaskName}} - - - - 活动剩余时间: - {{aitem[0].djs.day}}天 - {{aitem[0].djs.hou}}: - {{aitem[0].djs.min}}: - {{aitem[0].djs.sec}} - - - - - - - - - - - - - 礼包详情 - - - - - - - - - - - - - - - - {{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}} - - - - 今天剩余可领{{task_number}}个任务 - 不限任务数量 - - - - 就选它了 - - - 好友拆一拆 - - - 立即兑换 - - - - + + + + + + + + {{aitem[sw_index].helpTaskName}} + + + + 活动剩余时间: + {{aitem[0].djs.day}}天 + {{aitem[0].djs.hou}}: + {{aitem[0].djs.min}}: + {{aitem[0].djs.sec}} + + + + + + + + + + + + + 礼包详情 + + + + + + + + + + + + + + + + {{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}} + + + + 今天剩余可领{{task_number}}个任务 + 不限任务数量 + + + + 就选它了 + + + 好友拆一拆 + + + 立即兑换 + + + + + + + + + + + + + + 我的任务 + + + + 帮拆记录 + + + + + + + + + + {{item.helpTaskName}} + + + + + {{item.zlHelpNum}}/{{item.helpNum}} + 查看礼包 + 领取礼包 + + + + + + + + 暂无任务记录 + + + + + + + + + + + + + + + + {{item.nickName}} + + {{filter.format_time(item.zltime)}} + + + + + + + 点击加载更多 + + + + + + + 暂无任务记录 + + + + + + + + + + + + 点击加载更多 + + + + 该任务已被领取了{{usercount}}次 + + + 暂无领取记录 + + + + + + + + + + + + + + + + + + + + - - - - - - - - - 我的任务 - - - - 帮拆记录 - - - - - - - - - - {{item.helpTaskName}} - - - - - {{item.zlHelpNum}}/{{item.helpNum}} - 查看礼包 - 领取礼包 - - - - - - - - 暂无任务记录 - - - - - - - - - - - - - - - {{item.nickName}} - - {{filter.format_time(item.zltime)}} - - - - - - - 点击加载更多 - - - - - - - 暂无任务记录 - - - - - - - - - - - - 点击加载更多 - - - - 该任务已被领取了{{usercount}}次 - - - 暂无领取记录 - - - - - - - - - - - - - - - - - - - - diff --git a/pages/user/assistance/task_assistance.wxss b/pages/user/assistance/task_assistance.wxss index ed29596..d7f0e53 100644 --- a/pages/user/assistance/task_assistance.wxss +++ b/pages/user/assistance/task_assistance.wxss @@ -1,8 +1,11 @@ page { /* background: #d01119; */ width: 100%; - height: 100%; + height: 100%; +} +.container { + height: 100vh; } .tesk_list{ diff --git a/pages/user/index/filter.wxs b/pages/user/index/filter.wxs index 5d5835e..3997e16 100644 --- a/pages/user/index/filter.wxs +++ b/pages/user/index/filter.wxs @@ -4,22 +4,31 @@ var is_close = function (name,c_list) { map['我的分销']="1"; map['我的拼单']="2"; map['秒杀活动']="3"; - map['PLUS会员']="4"; - map['专享礼包']="5"; - map['我的权益']="6"; - map['联系客服']="7"; - map['收藏夹']="8"; - map['我的地址']="9"; - map['收入卡包']="10"; - map['我的服务']="11"; - map['我的评价']="12"; - map['我的礼包']="13"; + map['PLUS会员']="4"; + map['我的权益']="5"; + map['联系客服']="6"; + map['收藏夹']="7"; + map['我的地址']="8"; + map['收入卡包']="9"; + map['专享礼包']="10"; + map['我的服务']="12"; + map['我的评价']="13"; + map['我的礼包']="14"; + map['助力活动']="15"; var index=map[name]; - //不包含,不关闭 - if(c_list.indexOf(index)==-1) return 0; - //包含,就是关闭的 - return 1 - + + //我的权益要判断5,和11 + if(name=="我的权益"){ + if(c_list.indexOf("11")!=-1) return 1; + else if(c_list.indexOf("5")!=-1) return 1; + return 0; + }else{ + //不包含,不关闭 + if(c_list.indexOf(index)==-1) return 0; + //包含,就是关闭的 + return 1 + } + } module.exports = { diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml index 374537d..4a3e699 100644 --- a/pages/user/index/index.wxml +++ b/pages/user/index/index.wxml @@ -216,7 +216,13 @@ 助力活动 -
+
+ + + + 我的权益 + + @@ -225,14 +231,8 @@ - - - - - 我的权益 - - - + +