From 684a7cd8d00ae234c42d0b136d94a298d99d28db Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Fri, 11 Oct 2019 19:31:35 +0800 Subject: [PATCH] 订单提交的结果~ --- pages/cart/cart2/cart2.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++--------- pages/cart/cart2_pt/cart2_pt.js | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++------- pages/cart/cart2_pt/cart2_pt.wxml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- pages/cart/cart2_pt/cart2_pt.wxss | 237 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 387 insertions(+), 20 deletions(-) diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 4053663..496e010 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -97,12 +97,6 @@ Page({ } }); - }, - onUnload: function () { this.setData({ isclose: 1 })}, - - //----------子页返回父页触发---------- - onShow: function() { - var th=this; //先获取是否有关闭使用优惠券 getApp().getConfig2(function (ee) { var json_d = JSON.parse(ee.switch_list); @@ -111,8 +105,12 @@ Page({ th.get_wuliu(th.get_info(th.show_page)); }) + }, + onUnload: function () { this.setData({ isclose: 1 })}, - console.log(th.data.isclose); + //----------子页返回父页触发---------- + onShow: function() { + var th=this; if (th.data.isclose==0){ /*--- wx.navigateTo({ @@ -124,7 +122,7 @@ Page({ }) }else{ - this.getuser_addr(function(ie){ + this.getuser_addr(function(ie){ console.log("getuser_addr") console.log(ie) @@ -146,6 +144,12 @@ Page({ },500) }); + //--更新默认地址--,看一下是不是跳到地址页面 + if(!getApp().globalData.is_cart2_old){ + this.update_code(); + }else{ + getApp().globalData.is_cart2_old=0; + } } }, @@ -1090,6 +1094,7 @@ Page({ }); }, enterAddressPage: function() { + getApp().globalData.is_cart_old=1; this.data.enterAddressPage = !0, wx.navigateTo({ url: "/pages/user/address_list/address_list?is_back=1" }); @@ -1463,6 +1468,38 @@ Page({ } } }) - }, + + //更新下默认,在onshow里面 + update_code(){ + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; + //--定时器,判断wu_arr不未空-- + var uii=setInterval(function () { + if(th.data.wu_arr) clearInterval(uii); + else { + for (var k = 0; k < th.data.wu_arr.length; k++) { + var item = th.data.wu_arr[k]; + if (def_exp_code == item.code) { m_wind = k; } + } + //--如果是立即购买-- + if (this.data.is_b_now == 1) { + th.setData({index: m_wind}); + } else { + var ui = setInterval(function () { + if (th.data.cartlist) { + var c_arr = th.data.cartlist; + for (var i in c_arr) { + c_arr[i].wind = m_wind; + } + th.setData({cartlist: c_arr}) + + clearInterval(ui); + } + }, 500) + } + } + },500); + } + + }); diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 6f6b258..2f4ae74 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -213,18 +213,21 @@ Page({ //----------子页返回父页触发---------- onShow: function() { - console.log('onshow'); var th=this; - console.log(th.data.isclose); if (th.data.isclose==0){ wx.switchTab({ url: "/pages/index/index/index" }) - }else{ - this.getuser_addr(function(ie){ - th.setData({user_addr: ie }); - }) + this.getuser_addr(function(ie){ + th.setData({user_addr: ie }); + }) + //--更新默认地址--,看一下是不是跳到地址页面 + if(!getApp().globalData.is_cart2_old){ + this.update_code(); + }else{ + getApp().globalData.is_cart2_old=0; + } } }, //---------------检查是否有收货地址------------------- @@ -536,6 +539,7 @@ Page({ }); }, enterAddressPage: function() { + getApp().globalData.is_cart2_old=1; this.data.enterAddressPage = !0, wx.navigateTo({ url: "/pages/user/address_list/address_list?operate=select" }); @@ -661,6 +665,48 @@ Page({ var ob = {}; ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; this.setData(ob); - } + }, + + //// 开启物流的弹窗 + show_wu_arr:function(e){ + this.setData({ open_express: 1}); + }, + + //更新下默认,在onshow里面 + update_code(){ + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; + + var uii=setInterval(function () { + if(th.data.wu_arr) clearInterval(uii); + else { + for (var k = 0; k < th.data.wu_arr.length; k++) { + var item = th.data.wu_arr[k]; + if (def_exp_code == item.code) { + m_wind = k; + } + } + //--如果是立即购买-- + th.setData({index: m_wind}); + } + },500) + }, + + // 关闭物流的弹窗 + close_express:function(){ + this.setData({ open_express:0 }); + }, + // 选择物流 + click_express_name:function(e){ + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; + var index=e.currentTarget.dataset.idxe; + var ob={ is_express: index, is_shipping_code: shippingcode,index:index}; + this.setData(ob); + }, + + //点击确定物流 + determine_expres:function(e){ + this.setData({ open_express: 0}); + this.calculatePrice2(); + }, }); diff --git a/pages/cart/cart2_pt/cart2_pt.wxml b/pages/cart/cart2_pt/cart2_pt.wxml index ed4506d..69e9bd5 100644 --- a/pages/cart/cart2_pt/cart2_pt.wxml +++ b/pages/cart/cart2_pt/cart2_pt.wxml @@ -51,17 +51,22 @@ + 自提 - + 物流 + + {{wu_arr[index].name}} + + - + @@ -122,5 +127,49 @@ + + + + + + + + + + 选择物流名字 + + + + × + + + + + + + + Γ + + + + + {{express_list.name}} + + + + + + + 确定 + + + 设为默认 + + + + + diff --git a/pages/cart/cart2_pt/cart2_pt.wxss b/pages/cart/cart2_pt/cart2_pt.wxss index ef34fd0..d49345f 100644 --- a/pages/cart/cart2_pt/cart2_pt.wxss +++ b/pages/cart/cart2_pt/cart2_pt.wxss @@ -98,6 +98,8 @@ border-bottom: 1px solid #ddd; font-size: 30rpx; padding-left: 20rpx; + justify-content: space-between; + } .use-item>view{ @@ -269,5 +271,238 @@ .add_new{height: 60rpx; line-height: 60rpx;} .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} -.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} +.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} + + +/* 自定义弹出窗口 */ +.cx-popup{ + width:100%; + height:920rpx; + background: #fff; + z-index: 35; + border-top-left-radius: 20rpx; + border-top-right-radius: 20rpx; + position:fixed; + bottom:0; + padding-bottom: 25rpx; + +} + +.cx-popup .top{ + width:95%; + height:100rpx; + border-bottom:3rpx solid #ddd; + margin: auto; + margin-top: 30rpx; + +} +.xc-top-content{ + width: 93%; + height:85rpx; + padding-top: 30rpx; + font-size: 34rpx; + font-weight: 600; + +} + + +.xc-valid-coupon{ + width: 90%; + height:40rpx; + padding-top: 24rpx; + overflow: hidden; +} +.xc-frame{ + width: 100%; + height:68.9%; +} + +.xc-frame .list-frame{ + width: 95%; + height: 100%; + overflow-y:scroll; + +} +.xc-close-frame{ + margin-top:-10rpx; + +} + +.xc-close{ + width: 37rpx; + height: 37rpx; + border-radius: 50%; + border: 3rpx solid #333; + text-align: center; + line-height: 34rpx; + font-size: 29rpx; + color: #333; + +} +.xc-money{ + color: #af2346; + font-size: 35rpx; +} + +.xc-money-frame{ + margin-left:35rpx; + +} +.xc-coupon-effect{ + width: 99%; + min-height: 100rpx; + border-bottom:3rpx solid #ddd; + + +} +.xc-goods-coupon{ + width: 85%; + height:100%; + +} +.xc-title{ + width:50%; + margin-left:222rpx; + +} +.xc-coupon-money0{ + color: #c91e31; + font-size: 35rpx; + line-height: 40rpx; + +} +.xc-coupon-money{ + color: #c91e31; + font-size: 35rpx; + line-height: 40rpx; + padding-top: 10px; + +} +.xc-coupon-money1{ + color: #444; + font-size: 28rpx; + line-height: 60rpx; + + +} +.xc-coupon-time{ + height: 50rpx; + font-size: 27rpx; + color: #a4a4a4; +} +.xc-coupon-time .time{ + margin-left: 15rpx; + font-size: 27rpx; +} +.xc-coupon-selection{ + height:100%; +} + +.xc-confirm { + width: 48%; + border-radius: 50rpx; + height: 50rpx; + margin:0 auto; + background:#d60021; + color:#fff; + font-size:28rpx; + margin-top: 28rpx; +} + +.up{ animation: up .7s; } +.down{ animation: down 1s; } +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } + +.xc-not-Selection{ + width: 40rpx; + height: 40rpx; + background: #eeeeee; +} + + +.xc-close-express{ + width: 40rpx; + height: 40rpx; + border-radius: 50%; + border: 3rpx solid #333; + text-align: center; + font-size:32rpx; + line-height: 38rpx; + color: #333; + margin-top: 5rpx; +} +.cx-popup .tops{ + width: 100%; + height: 145rpx; + border-bottom: 3rpx solid #eee; + +} +.top-content { + width: 82%; + padding-top: 33px; + height: 100%; + padding-left: 40rpx; +} +.close-frame{ + margin-top: 30rpx; + +} +.cx-popup.radius{ + + height: 650rpx; + +} +.xc-hook { + width: 33rpx; + height: 33rpx; + transform: rotate(-135deg); + line-height: 35rpx; + text-align: center; + margin-right: 20rpx + + +} +.xc-hooks { + width: 30rpx; + height: 30rpx; + border: 1rpx solid #999; + margin-right: 20rpx; +} +.express_list_frame{ + display: flex; + height: 80rpx; + align-items: center; + padding-left: 40rpx; + border-bottom: 1rpx solid #eee; + +} +.express_list{ + width: 100%; + height: 65%; + overflow-y: scroll; + overflow: hidden; +} +.xc-confirms { + width: 40%; + border-radius: 50rpx; + height: 55rpx; + margin:0 auto; + font-size:28rpx; + background: #fff; + color: #333; + border: 2rpx solid #333; + +} + +.xc-right{ + width:20rpx; + height:20rpx; + border-top:2rpx solid #000; + border-right:2rpx solid #000; + transform:rotate(45deg); + display:inline-block; + +} + -- libgit2 0.21.4