From c248086a777ee63e16426b084bc83b113fe21f1a Mon Sep 17 00:00:00 2001 From: JerryYan <792602257@qq.com> Date: Sat, 29 Aug 2020 23:21:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=95=86=E6=88=B7=E6=94=B6?= =?UTF-8?q?=E6=AC=BE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/pay.css | 94 ++++++++++++++++++++++++++++++++------ js/common.js | 4 +- js/confirmOrder.js | 43 ++++++++++++++++- js/indentcon.js | 50 +++++++++++++++++++- js/shundaijian.js | 2 +- templete/confirmOrder.html | 81 ++++++++++++++++++++------------ templete/indentcon.html | 59 ++++++++++++++---------- 7 files changed, 261 insertions(+), 72 deletions(-) diff --git a/css/pay.css b/css/pay.css index b863fe3..d5c0728 100644 --- a/css/pay.css +++ b/css/pay.css @@ -19,7 +19,8 @@ background: white; margin-bottom: 52px; min-height: 400px; - /* height: 90%; */ + max-height: 90vh; + flex-direction: column; } .pay{ /*transform: translateY(380px);*/ @@ -49,10 +50,16 @@ } .paynum { - font-size: 18px; - text-align: center; - color: black; - padding: 20px 0; + font-size: 1.4rem; + text-align: center; + color: black; + padding: 15px 0; + font-weight: bold; +} + +.paynum o { + font-size: 2rem; + font-weight: bolder; } .con_1 { @@ -104,7 +111,6 @@ #qlg_pay_pwd .con_2 .prod .info{ padding: 5px; display: flex; - justify-content: space-between; align-items: center; margin: 0px; } @@ -113,12 +119,13 @@ padding: 0px; margin: 0px 0px; text-align: left; + width: 4em; } #qlg_pay_pwd .con_2 .prod .info .p1 span{ /* margin-left: 10px; */ } #qlg_pay_pwd .con_2 .shadown_wai input{ - width: 40%; + width: 36%; min-width: 65px; padding: 0px; margin: 5px 20px; @@ -142,21 +149,23 @@ #pay_pwd,#qlg_pay_pwd .con_1 { width: 70%; margin: 0 auto; - padding:10px 0px; + padding: 0px; text-align: center; position: relative; } #pay_pwd,#qlg_pay_pwd .con_2{ padding:0; margin: 0; + overflow-y: auto; /* position: relative; */ + z-index: 1003; } #pay_pwd,#qlg_pay_pwd .con_2 p{ font-size: 16px; } #pay_pwd,#qlg_pay_pwd .con_1 input{ - margin: 14px 5%; + margin: 8px 5%; width: 70%; height: 30px; } @@ -167,12 +176,12 @@ #pay_pwd,#qlg_pay_pwd .con_1 .p9{ /* margin: 30px 5%; */ /* width: 90%; */ - position: absolute; + /* position: absolute; */ /* padding:10px; */ - left:18%; + /* left:18%; */ /* right: 5%; */ - top:62px; - font-size: 16px + /* top:62px; */ + /* font-size: 16px */ } /* #pay_pwd,#qlg_pay_pwd .con_2 .p1{ @@ -198,4 +207,61 @@ background: white; height: 49px; border-top: 1px solid #e6e6e6; -} \ No newline at end of file +} + +#qlg_pay_pwd .con_2 .prod .p1 span:first-child { + margin-right: 5px; + font-size: 0.9em; +} + +#qlg_pay_pwd .con_2 .prod .productInfo .productInfo_ { + flex-direction: column; + align-items: end; + padding: 0; + width: 7.5rem; +} + +#qlg_pay_pwd .con_2 .prod .productInfo .productInfo_ .p1 { + width: 100%; + align-items: end; + justify-content: space-between; + display: flex; +} + +#qlg_pay_pwd .con_2 .prod .couponsInfo .couponsInfo_ { + flex-direction: column; + align-items: end; + padding: 0; + width: 7.5rem; +} + +#qlg_pay_pwd .con_2 .prod .couponsInfo .couponsInfo_ .p1 { + width: 100%; + align-items: end; + justify-content: space-between; + display: flex; +} + +.receiveInfo { + display: flex; + justify-content: space-between; +} + +.receiveInfo ._right { + width: 60vw; +} + +._alipay, +._wechat { + height: 150px; + width: 50vw; +} + +._alipay > img, +._wechat > img { + max-height: 100%; + max-width: 100%; + margin: 0 auto; + display: block; +} + diff --git a/js/common.js b/js/common.js index 193fefe..b9dd88f 100644 --- a/js/common.js +++ b/js/common.js @@ -1,8 +1,8 @@ var is_app = 1; -// var imgUrl = 'http://img.zgqlg.com.cn/'; +var imgUrl = 'http://img.zgqlg.com.cn/'; // var webUrl = 'http://www.zgqlg.com.cn/'; // var webUrl1 = 'http://www.zgqlg.com.cn/'; -var imgUrl = 'http://qlg.qgmzbxs.com/'; +// var imgUrl = 'http://qlg.qgmzbxs.com/'; var webUrl = 'http://qlg.qgmzbxs.com/'; var webUrl1 = 'http://qlg.qgmzbxs.com/'; var cssUrl = localStorage.getItem("cssUrl"); diff --git a/js/confirmOrder.js b/js/confirmOrder.js index 820b35f..27474e5 100644 --- a/js/confirmOrder.js +++ b/js/confirmOrder.js @@ -3,6 +3,17 @@ var wxChannel = null; // 微信支付 var aliChannel = null; // 支付宝支付 var channel = null; //支付通道 mui.init(); + +function copyToClip (text) { + var Context = plus.android.importClass("android.content.Context"); + var main = plus.android.runtimeMainActivity(); + var clip = main.getSystemService(Context.CLIPBOARD_SERVICE); + plus.android.invoke(clip,"setText",text.toString()); + mui.toast("复制成功"); +} + +let payPics = []; + mui.plusReady(function() { var self = plus.webview.currentWebview(); from_id = self.from?self.from:1 @@ -49,6 +60,9 @@ mui.plusReady(function() { } }); }); + $("#shopRecieveInfo") + .on('click', '.copy_name', function(){copyToClip($("#shopRecieveInfo > ._name").text())}) + .on('click', '.copy_card', function(){copyToClip($("#shopRecieveInfo > ._card").text())}); $('.con').on('tap', '.address', function() { var addressId = $(this).attr('data-addressId'); @@ -158,6 +172,18 @@ mui.plusReady(function() { var couponIds = []; var areaId2 = ''; // //console.log(type) + $("#shopRecieveInfo") + .on('click', '.copy_name', function(){copyToClip($("#shopRecieveInfo > ._name").text())}) + .on('click', '.copy_card', function(){copyToClip($("#shopRecieveInfo > ._card").text())}) + .on('click', 'img', function(){ + var index = $(this).parent().index(); + if (payPics.length < index) return; + plus.nativeUI.previewImage(payPics, { + current: index, + loop: true, + indicator: 'number' + }); + }); mui.ajax(qlgUrl('app/carts/settlement'), { data: { @@ -607,13 +633,28 @@ mui.plusReady(function() { // //console.log(JSON.stringify(data)) if (data.status == 1) { $('.pay').css('display', 'none'); - $('#qlg_pay_pwd').css('display', 'block'); + $('#qlg_pay_pwd').css('display', 'flex'); if (data.data.payPwd == '0') { mui.alert('还未设置支付密码请先设置操作密码!'); var url = 'setting_fogetPayPwd'; JZL.openWindow(url + '.html', url + '.html'); //return; } + if (!$.isEmptyObject(data.data.shopPaymentInfo)) { + payPics = [ + hyhImgUrl(data.data.shopPaymentInfo.alipayRecive), + hyhImgUrl(data.data.shopPaymentInfo.wechatRecive), + ]; + $("#shopRecieveInfo").show() + .find("._shortBankName").text(data.data.shopPaymentInfo.bankName).end() + .find("._card").text(data.data.shopPaymentInfo.bankNo).end() + .find("._name").text(data.data.shopPaymentInfo.realname).end() + .find("._alipay > img").attr("src", hyhImgUrl(data.data.shopPaymentInfo.alipayRecive)).end() + .find("._wechat > img").attr("src", hyhImgUrl(data.data.shopPaymentInfo.wechatRecive)).end(); + } else { + payPics = []; + $("#shopRecieveInfo").hide(); + } $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); $('#productNum').val(data.data.product.useProduct); if (data.data.product.useProduct > 0) { diff --git a/js/indentcon.js b/js/indentcon.js index 5c4ad3b..2e6340b 100644 --- a/js/indentcon.js +++ b/js/indentcon.js @@ -34,12 +34,29 @@ mui.init({ }); var count = 1; +setInterval(function() { + var pr = mui('#pullrefresh').pullRefresh(); + if ($("#qlg_pay_pwd").is(":visible")) { + if (!pr.stopped) mui('#pullrefresh').pullRefresh().setStopped(!pr.stopped); + } else { + if (pr.stopped) mui('#pullrefresh').pullRefresh().setStopped(!pr.stopped); + } +}, 1000) + function pullupRefresh() { count += 1; getData(count); mui('#pullrefresh').pullRefresh().endPullupToRefresh(); } +function copyToClip (text) { + var Context = plus.android.importClass("android.content.Context"); + var main = plus.android.runtimeMainActivity(); + var clip = main.getSystemService(Context.CLIPBOARD_SERVICE); + plus.android.invoke(clip,"setText",text.toString()); + mui.toast("复制成功"); +} + /** * 下拉刷新具体业务实现 */ @@ -131,6 +148,9 @@ function getData(page) { isLoad = false; }) } + +let payPics = []; + mui.plusReady(function() { // window.addEventListener('refresh', function(e) { //执行刷新 @@ -141,7 +161,18 @@ mui.plusReady(function() { order_class = ''; } getData(count); - + $("#shopRecieveInfo") + .on('click', '.copy_name', function(){copyToClip($("#shopRecieveInfo > ._name").text())}) + .on('click', '.copy_card', function(){copyToClip($("#shopRecieveInfo > ._card").text())}) + .on('click', 'img', function(){ + var index = $(this).parent().index(); + if (payPics.length < index) return; + plus.nativeUI.previewImage(payPics, { + current: index, + loop: true, + indicator: 'number' + }); + }); //支付插件 plus.payment.getChannels(function(channels) { for (var i in channels) { @@ -373,13 +404,28 @@ mui.plusReady(function() { // //console.log(JSON.stringify(data)) if (data.status == 1) { $('.pay').css('display', 'none'); - $('#qlg_pay_pwd').css('display', 'block'); + $('#qlg_pay_pwd').css('display', 'flex'); if (data.data.payPwd == '0') { mui.alert('还未设置支付密码请先设置操作密码!'); var url = 'setting_fogetPayPwd'; JZL.openWindow(url + '.html', url + '.html'); //return; } + if (!$.isEmptyObject(data.data.shopPaymentInfo)) { + payPics = [ + hyhImgUrl(data.data.shopPaymentInfo.alipayRecive), + hyhImgUrl(data.data.shopPaymentInfo.wechatRecive), + ]; + $("#shopRecieveInfo").show() + .find("._shortBankName").text(data.data.shopPaymentInfo.bankName).end() + .find("._card").text(data.data.shopPaymentInfo.bankNo).end() + .find("._name").text(data.data.shopPaymentInfo.realname).end() + .find("._alipay > img").attr("src", hyhImgUrl(data.data.shopPaymentInfo.alipayRecive)).end() + .find("._wechat > img").attr("src", hyhImgUrl(data.data.shopPaymentInfo.wechatRecive)).end(); + } else { + payPics = []; + $("#shopRecieveInfo").hide(); + } $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); $('#productNum').val(data.data.product.useProduct); if (data.data.product.useProduct > 0) { diff --git a/js/shundaijian.js b/js/shundaijian.js index 7c6afd1..ceca4ba 100644 --- a/js/shundaijian.js +++ b/js/shundaijian.js @@ -158,7 +158,7 @@ const app = new Vue({ Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2))); s = s *6378.137 ;// EARTH_RADIUS; if (s < 1.5) { - return `${s * 1000}m`; + return `${(s * 1000).toFixed(2)}m`; } if (s > 50) { return `>50km`; diff --git a/templete/confirmOrder.html b/templete/confirmOrder.html index be00d0b..d6c014b 100644 --- a/templete/confirmOrder.html +++ b/templete/confirmOrder.html @@ -180,36 +180,59 @@

收银台

+
-
-
-

产品券

-
-
- -
-
- -
-

优惠券

-
- -
-
-
-

旺旺券

- -
-
-

现金额

- -
-
+
+
+

产品券

+
+ +
+
+
+ +
+
+

优惠券

+ +
+ +
+
+
+
+

旺旺券

+ +
+
+

现金额

+ +
+
-
+
@@ -155,31 +155,54 @@
-