From 4b99efa2943316f70354ab3f343f405e860c6e2b Mon Sep 17 00:00:00 2001 From: initwithout Date: Mon, 24 Apr 2023 09:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=AF=E4=BB=98=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- images/钱包支付.png | Bin 0 -> 2306 bytes pages/cart/cart.wxss | 14 +-- pages/login/login.js | 53 ++++------ pages/logistics/logistics.wxss | 1 - pages/order/order.js | 14 ++- pages/order/pay.js | 28 +++++- pages/order/pay.wxml | 171 +++++++++++++++++---------------- pages/order/pay.wxss | 7 +- pages/set/set.js | 8 +- pages/user/user.js | 29 ++++-- pages/user/user.wxml | 3 +- utils/server.js | 4 +- 12 files changed, 181 insertions(+), 151 deletions(-) create mode 100644 images/钱包支付.png diff --git a/images/钱包支付.png b/images/钱包支付.png new file mode 100644 index 0000000000000000000000000000000000000000..1ad75618369ebd2e68b768c0abbd9e5fa7238547 GIT binary patch literal 2306 zcmV+d3H|noP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91K%fHv1ONa40RR91KmY&$07g+lumAuEY)M2xRCoc^TU~5aMHD`ByZqN= zBN%ERbd3;HVraty52kcCJRmRf^JJui{s4w2>Z?9b6634oRZ?1{C{GB9iC|)O`FZid zw2c8YO1wo0HT+~X1=(`z_XqbWDWA# zOzRF*Up!&TLPI8uHL!CI2F|R@;>i3F9{kIcSYnNUw_wr`Z#n@Wd#a2j#802Y3Tkq_t+o>M$2htfS~yL5QaQb6uh#|RT^(IGgGa7NSJ!>zUWsp$hS z^Gsx+2@knjas&GYk*Nk%6_6e1=vy#m?MAaQ(jG6Wc2-2@dn%>; zDARMc-;YmU1vvXWwz|57w0^AAwJt9UiB`WjA>lWyki~30g-EwMscH*c@a-0Bvkns|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uus zzZ-cW=J}5meeDN_XE;8$9KJrljj*5|NxKnt7EinD=5-!3uOU2S&{6;pGu^|TSWn2$XMo?TW%h3VwH1I)?LEWC z@!FEJTG66=pcjzOv$yYU?>Phhv_Z=Uc&Xvvph7lquq0C6wmB;2WWnmHwAEGPDU<>f z!R){X{H|CWn?prl)~jxFiq}eMBn5ydtiiAs9hE|Ma#1UCM8AlDKTh`B#^i}i*M&&S zF|q=bAkLqpZ6jT0i-=8d#dmB9Py~@)J+;5x7ItUpzl9=&y70jN4i)wVA&m>_7%M!j z**)u`0QWGkj0U-QvlMoVwE53hf>P`=c&SKE-N2W$#P^hv|2}U>lVk(m+E}@F4t_Q6 c#)>=tKdw0nRX!wh>up(f|Me literal 0 HcmV?d00001 diff --git a/pages/cart/cart.wxss b/pages/cart/cart.wxss index b5dc8e4..468b214 100644 --- a/pages/cart/cart.wxss +++ b/pages/cart/cart.wxss @@ -140,8 +140,8 @@ page{ height:160rpx; border: 1px solid #eee; } - .kong{ - width:200rpx; +.kong{ + width:200rpx; height:200rpx; } @@ -290,24 +290,24 @@ page{ padding-bottom: 60rpx; } .reds{ - color: red; + color: red; } .pp{ text-align: center; - margin-top:264rpx; + margin-top:300rpx; } .cla{ - font-family: '微软雅黑'; - color: #ccc; + font-family: '微软雅黑'; + color: #ccc; } .heji{ display:flex; align-items:center; width: 71%; - border-top: 1px solid #eee; + border-top: 1px solid #eee; } diff --git a/pages/login/login.js b/pages/login/login.js index a1b7756..c17c77b 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -73,27 +73,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - this.reloadData() - }, - reloadData() { - var that = this - wx.login({ - success: function (res) { - var code = res.code; - that.setData({ - code: code, - }) - WXAPI.getWXTemplates({ - storeId: 239, - storeType: 1, - }).then(res => { - if (res.code == 200) { - var data = res.data - wx.setStorageSync('logmsgId', [data.delivery]) - } - }) - } - }); + }, // wxlogin(){ // var that = this @@ -136,20 +116,25 @@ Page({ //微信一键登录 tapWeixinLogin : function(e) { var that = this - WXAPI.wxLogin({ - code: that.data.code, - storeId: 239, - storeType: 1, - }).then(res => { - if (res.code == 200) { - var data = res.data - app.globalData.accessId = data.access_id; - wx.setStorageSync('accessId', data.access_id) - wx.setStorageSync('isLogin', true); - wx.setStorageSync('userInfo', data.user); - wx.navigateBack() + wx.login({ + success: function (res) { + var code = res.code; + WXAPI.wxLogin({ + code: code, + storeId: 239, + storeType: 1, + }).then(res => { + if (res.code == 200) { + var data = res.data + app.globalData.accessId = data.access_id; + wx.setStorageSync('accessId', data.access_id) + wx.setStorageSync('isLogin', true); + wx.setStorageSync('userInfo', data.user); + wx.navigateBack() + } + }) } - }) + }); }, /** * 生命周期函数--监听页面显示 diff --git a/pages/logistics/logistics.wxss b/pages/logistics/logistics.wxss index aad3a39..9bd69fb 100644 --- a/pages/logistics/logistics.wxss +++ b/pages/logistics/logistics.wxss @@ -14,7 +14,6 @@ position: relative; } .logistics_centent{ - /* position: absolute; */ margin-top: -25rpx; margin-left: 100rpx; font-size: 30rpx; diff --git a/pages/order/order.js b/pages/order/order.js index d4a8602..478c4eb 100644 --- a/pages/order/order.js +++ b/pages/order/order.js @@ -223,8 +223,20 @@ Page({ currentStatus: options.status }) that.reloadData(); + that.getWXTemplate() + }, + getWXTemplate() { + WXAPI.getWXTemplate({ + storeId: 239, + storeType: 1, + type: 2, + }).then(res => { + if (res.code == 200) { + var data = res.data + wx.setStorageSync('logmsgId', [data.template_id]) + } + }) }, - /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/order/pay.js b/pages/order/pay.js index 1363c70..45c8a88 100644 --- a/pages/order/pay.js +++ b/pages/order/pay.js @@ -7,7 +7,7 @@ Page({ pays: [], itemData: {}, userId: 0, - paytype: 'wxPay', //支付方式 + paytype: 'bank_pay', //支付方式 cartId: 0, addrId: 0, //收货地址//测试-- btnDisabled: false, @@ -71,7 +71,6 @@ Page({ } } }, - onLoad: function (options) { // console.log(options) var that = this; @@ -91,6 +90,19 @@ Page({ wallet: wallet, // 钱包状态 }); this.Settlement(options); + this.getWXTemplate(); + }, + getWXTemplate() { + WXAPI.getWXTemplate({ + storeId: 239, + storeType: 1, + type: 2, + }).then(res => { + if (res.code == 200) { + var data = res.data + wx.setStorageSync('logmsgId', [data.template_id]) + } + }) }, //页面加载完成函数 onReady: function () { @@ -156,6 +168,12 @@ Page({ // } }, + //单选支付方式 + updataRadio:function(e){ + this.setData({ + paytype: e.detail.value + }) + }, // 进入结算页面 Settlement: function (options) { var that = this; @@ -181,10 +199,10 @@ Page({ } var pays = [] if (data.payment.bank_pay == 1) { - pays.push({'name':'公对公支付','icon':'/images/公对公.png'}) + pays.push({'name':'公对公支付','icon':'/images/公对公.png','type':'bank_pay','checked':true}) } // if (data.payment.wallet_pay == 1) { - // pays.push({'name':'余额支付','icon':'/images/weixin.png'}) + // pays.push({'name':'余额支付','icon':'/images/钱包支付.png','type':'wallet_pay','checked':false}) // } that.setData({ productAry: options.product, @@ -542,7 +560,7 @@ Page({ remarks: '', vipSource: 0, product: that.data.productAry, - pay_type: 'bank_pay', + pay_type: that.data.paytype, }).then(res => { if (res.code == 200) { var data = res.data diff --git a/pages/order/pay.wxml b/pages/order/pay.wxml index 29f8c12..d6f21e7 100644 --- a/pages/order/pay.wxml +++ b/pages/order/pay.wxml @@ -25,111 +25,112 @@ - - - - - - - - - {{address.name}} {{address.tel}} - 地址:{{address.address_xq}} - + + + + + + + + + {{address.name}} {{address.tel}} - + 地址:{{address.address_xq}} + + - - - 添加收货地址 - + + + + 添加收货地址 - - - + + + + {{item.shop_name}} - - - - - - - - {{item.product_title}} - [{{item.size}}] - ¥ {{item.price}} - - - x{{item.num}} - - - - + + + - - - - - - 运费 - 包邮 - {{freight}}元 - - - 优惠券 - - 使用优惠券:{{money}} - - - - - - 活动 - {{name}} - - - 钱包余额 - 余额抵扣{{d_yuan}} - {{user_money}}元 - - - - - 选择支付方式 + + + + {{item.product_title}} + [{{item.size}}] + ¥ {{item.price}} - - - - + + x{{item.num}} + + + - - - - - 合计: - ¥ {{total}} + + + + 运费 + 包邮 + {{freight}}元 + + + 优惠券 + + 使用优惠券:{{money}} + + + + + + 活动 + {{name}} + + + 钱包余额 + 余额抵扣{{d_yuan}} + {{user_money}}元 + + + + + 选择支付方式 + + + + + + + {{item.name}} + + - - - + + + + + + + + + + 合计: + ¥ {{total}} + + + + diff --git a/pages/order/pay.wxss b/pages/order/pay.wxss index ee01a9c..ad93656 100644 --- a/pages/order/pay.wxss +++ b/pages/order/pay.wxss @@ -596,8 +596,6 @@ color:#fff; /* color: #FF6347; */ } - - .radio-group { display:block; width:100%; @@ -615,7 +613,10 @@ color:#fff; .payment text{ margin-left: 15rpx; } - +.select{ + position: absolute; + right: 20rpx; +} /*优惠券 */ .orderDetails { border-bottom: 10px solid #f3f3f3; diff --git a/pages/set/set.js b/pages/set/set.js index 3267335..853a9a7 100644 --- a/pages/set/set.js +++ b/pages/set/set.js @@ -72,9 +72,11 @@ Page({ wx.clearStorage({ success: (res) => { wx.clearStorageSync('isLogin'); - wx.reLaunch({ - url: '/pages/login/login', - }) + wx.clearStorageSync('accessId'); + wx.navigateBack() + // wx.reLaunch({ + // url: '/pages/login/login', + // }) }, }) } else { diff --git a/pages/user/user.js b/pages/user/user.js index b9e01b7..493724f 100644 --- a/pages/user/user.js +++ b/pages/user/user.js @@ -41,6 +41,8 @@ Page({ remind: '加载中', tjr: false, user:'', + xxnum: 0, + accessId: app.globalData.accessId, }, //下拉刷新 onPullDownRefresh: function () { @@ -81,14 +83,14 @@ Page({ }, onShow: function () { var that = this; - var cont = that.data.cont; - if (cont > 1) { + // var cont = that.data.cont; + // if (cont > 1) { that.requestMyData(); - } else { - that.setData({ - cont: cont + 1 - }) - } + // } else { + // that.setData({ + // cont: cont + 1 + // }) + // } }, requestMyData: function () { var that = this; @@ -102,8 +104,8 @@ Page({ var data = res.data; if (data.data) { that.setData({ + xxnum: data.data.xxnum, user: data.data.user, - // article: data.data.article, logo: data.data.logo, company: data.data.company, th: data.data.th, @@ -117,6 +119,17 @@ Page({ }); } else { + that.setData({ + xxnum: '', + user: '', + logo: '', + company: '', + th: '', + dfh_num: '', + dfk_num: '', + dpj_num: '', + dsh_num: '', + }); wx.removeStorageSync('accessId') wx.removeStorageSync('isLogin'); wx.removeStorageSync('userInfo'); diff --git a/pages/user/user.wxml b/pages/user/user.wxml index cc157f2..e7a63a0 100644 --- a/pages/user/user.wxml +++ b/pages/user/user.wxml @@ -54,8 +54,7 @@ - {{ user.xxnum > 99 ? '99+' : user.xxnum }} - + {{ xxnum > 99 ? '99+' : xxnum }} diff --git a/utils/server.js b/utils/server.js index 3149730..d6c06ba 100644 --- a/utils/server.js +++ b/utils/server.js @@ -65,8 +65,8 @@ module.exports = { logout: (data) => { //退出登录 return requestServer('app.login.quit', 'post', data) }, - getWXTemplates: (data) => { //获取订阅消息模板 - return requestServer('app.message.getWxTemplates', 'post', data) + getWXTemplate: (data) => { //获取订阅消息模板 + return requestServer('app.message.getWxTemplate', 'post', data) }, /* 首页 */ homeIndex: (data) => { //首页