From 5b8f667c8b06e09b7e811e1b689c357c9065c9f1 Mon Sep 17 00:00:00 2001 From: devil Date: Sun, 2 Aug 2020 22:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=A1=AE=E8=AE=A4=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Buy.php | 7 +----- sourcecode/weixin/pages/buy/buy.js | 26 +++++++++++++++++++++ sourcecode/weixin/pages/buy/buy.wxml | 31 ++++++++++++++++++++++--- sourcecode/weixin/pages/buy/buy.wxss | 34 ++++++++++++++++++++++++---- 4 files changed, 85 insertions(+), 13 deletions(-) diff --git a/application/api/controller/Buy.php b/application/api/controller/Buy.php index 29cf75dd6..db3b3a43e 100755 --- a/application/api/controller/Buy.php +++ b/application/api/controller/Buy.php @@ -61,27 +61,22 @@ class Buy extends Common // 基础信息 $buy_base = $buy_ret['data']['base']; $buy_goods = $buy_ret['data']['goods']; - $buy_extension_data = $buy_ret['data']['extension_data']; // 支付方式 $payment_list = PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]); - // 当前选中的优惠劵 - $coupon_id = isset($params['coupon_id']) ? intval($params['coupon_id']) : 0; - // 数据返回组装 $result = [ 'goods_list' => $buy_goods, 'payment_list' => $payment_list, 'base' => $buy_base, - 'extension_data' => $buy_extension_data, 'common_order_is_booking' => (int) MyC('common_order_is_booking', 0), 'common_site_type' => (int) $buy_base['common_site_type'], ]; // 优惠劵 $ret = PluginsService::PluginsControlCall( - 'coupon', 'coupon', 'buy', 'api', ['order_goods'=>$buy_goods, 'coupon_id'=>$coupon_id]); + 'coupon', 'coupon', 'buy', 'api', ['order_goods'=>$buy_goods, 'params'=>$params]); if($ret['code'] == 0 && isset($ret['data']['code']) && $ret['data']['code'] == 0) { $result['plugins_coupon_data'] = $ret['data']['data']; diff --git a/sourcecode/weixin/pages/buy/buy.js b/sourcecode/weixin/pages/buy/buy.js index e3dbe5d31..dfc157667 100755 --- a/sourcecode/weixin/pages/buy/buy.js +++ b/sourcecode/weixin/pages/buy/buy.js @@ -307,4 +307,30 @@ Page({ this.init(); } }, + + // 地图查看 + map_event(e) { + var index = e.currentTarget.dataset.index || 0; + var data = this.data.goods_list[index] || null; + if (data == null) + { + app.showToast("地址有误"); + return false; + } + + var lng = parseFloat(data.lng || 0); + var lat = parseFloat(data.lat || 0); + if (lng <= 0 || lat <= 0) { + app.showToast("坐标有误"); + return false; + } + + wx.openLocation({ + latitude: lat, + longitude: lng, + scale: 18, + name: data.name || data.alias || '', + address: (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || ''), + }); + }, }); diff --git a/sourcecode/weixin/pages/buy/buy.wxml b/sourcecode/weixin/pages/buy/buy.wxml index a8d76983b..3d60f97ee 100755 --- a/sourcecode/weixin/pages/buy/buy.wxml +++ b/sourcecode/weixin/pages/buy/buy.wxml @@ -32,9 +32,20 @@ - - - + + + + + + {{group.name}} + {{group.alias}} + + + 查看地图 + + + + {{item.title}} @@ -52,6 +63,20 @@ + + + + {{item.name}} + + {{item.tips}} + + + + + + {{price_symbol}}{{group.order_base.total_price}} + {{price_symbol}}{{group.order_base.actual_price}} + diff --git a/sourcecode/weixin/pages/buy/buy.wxss b/sourcecode/weixin/pages/buy/buy.wxss index 76e55ea29..899c2e4ca 100755 --- a/sourcecode/weixin/pages/buy/buy.wxss +++ b/sourcecode/weixin/pages/buy/buy.wxss @@ -41,14 +41,39 @@ /** * 商品 */ -.goods .goods-item:not(:last-child) { +.goods-group-list .goods-item:not(:last-child) { border-bottom: 1px dashed #efefef; } -.goods-item { - padding: 20rpx 10rpx; +.goods-group-list { + padding: 0 10rpx 10rpx 10rpx; +} +.goods-group-hd { + padding: 20rpx 0; +} +.goods-group-title { + font-weight: bold; + vertical-align: middle; +} +.goods-group-alias { + border: 1px solid #3bb4f2; + color: #3bb4f2; + padding: 2rpx 10rpx; + border-radius: 6rpx; + margin-left: 10rpx; +} +.goods-group-footer .original-price { + margin-right: 10rpx; +} +.goods-group-map-submit { + font-size: 24rpx; + padding: 5rpx 20rpx; + background: #f0f0f0; } .goods-title, .goods-spec { - margin-bottom: 10rpx; + margin-bottom: 5rpx; +} +.goods-item { + padding: 5rpx 0; } .goods-image { width: 160rpx; @@ -119,6 +144,7 @@ */ .extension-list { background-color: #ffffeb; + border: 1px solid #ffe2cf; } .extension-list .item { padding: 20rpx 10rpx; -- GitLab