From 63e67aa0ef864cc9d425394c43fb3e6624059bc6 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 21 Mar 2019 17:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=B4=B9=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/view/default/order/index.html | 25 ++ application/api/controller/Goods.php | 8 + application/api/controller/User.php | 15 +- application/index/controller/Cart.php | 2 +- application/index/view/default/buy/index.html | 26 ++- .../index/view/default/order/detail.html | 17 ++ application/plugins/freightfee/Hook.php | 213 ++++++++++++++++-- application/plugins/freightfee/config.json | 4 +- application/plugins/touristbuy/Hook.php | 9 +- .../plugins/view/freightfee/admin/index.html | 11 + .../view/freightfee/admin/saveinfo.html | 13 +- .../plugins/view/touristbuy/index/detail.html | 17 ++ application/service/BuyService.php | 114 ++++++---- application/service/OrderService.php | 3 + application/tags.php | 4 + extend/base/AlipayAuth.php | 26 ++- public/appmini/old/alipay/app.js | 2 +- public/appmini/old/alipay/pages/buy/buy.js | 2 +- .../alipay/pages/user-order/user-order.axml | 22 +- public/appmini/old/weixin/pages/buy/buy.js | 2 +- .../weixin/pages/user-order/user-order.wxml | 23 +- public/static/index/default/css/buy.css | 16 +- .../static/index/default/css/order.detail.css | 1 - .../plugins/css/touristbuy/index.detail.css | 1 - 24 files changed, 450 insertions(+), 126 deletions(-) diff --git a/application/admin/view/default/order/index.html b/application/admin/view/default/order/index.html index 89e606d60..ce6e2c401 100755 --- a/application/admin/view/default/order/index.html +++ b/application/admin/view/default/order/index.html @@ -66,6 +66,7 @@ 快递信息 订单状态 订单金额(元) + 扩展数据 更多 操作 @@ -127,10 +128,21 @@ 金额:{{$v.price}}
+ 增加:{{$v.increase_price}}
优惠:{{$v.preferential_price}}
总价:{{$v.total_price}}
支付:{{$v.pay_price}} + + {{if empty($v['extension_data'])}} + + {{else /}} + {{foreach $v.extension_data as $extk=>$ext}} + {{if $extk gt 0}}
{{/if}} + {{$ext.name}} [{{$ext.tips}}] + {{/foreach}} + {{/if}} + 查看更多
@@ -209,12 +221,25 @@ 未填写 {{else /}} 金额:{{$v.price}}
+ 增加:{{$v.increase_price}}
优惠:{{$v.preferential_price}}
总价:{{$v.total_price}}
支付:{{$v.pay_price}} {{/if}} +
扩展数据
+
+ {{if empty($v['extension_data'])}} + + {{else /}} + {{foreach $v.extension_data as $extk=>$ext}} + {{if $extk gt 0}}
{{/if}} + {{$ext.name}} [{{$ext.tips}}] + {{/foreach}} + {{/if}} +
+
确认时间
{{if empty($v['confirm_time'])}}未填写{{else /}}{{$v.confirm_time}}{{/if}}
diff --git a/application/api/controller/Goods.php b/application/api/controller/Goods.php index 6c327428a..457de1990 100755 --- a/application/api/controller/Goods.php +++ b/application/api/controller/Goods.php @@ -117,6 +117,10 @@ class Goods extends Common { // 开始处理 $params = $this->data_post; + if(isset($_POST['spec'])) + { + $params['spec'] = $_POST['spec']; + } return GoodsService::GoodsSpecType($params); } @@ -132,6 +136,10 @@ class Goods extends Common { // 开始处理 $params = $this->data_post; + if(isset($_POST['spec'])) + { + $params['spec'] = $_POST['spec']; + } return GoodsService::GoodsSpecDetail($params); } diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 06e162322..b6527da98 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -91,15 +91,16 @@ class User extends Common } // 授权 - $result = (new \base\AlipayAuth())->GetAlipayUserInfo($this->data_post['authcode'], MyC('common_app_mini_alipay_appid')); - if($result === false) + $ret = (new \base\AlipayAuth())->GetAlipayUserInfo($this->data_post['authcode'], MyC('common_app_mini_alipay_appid')); + if($ret['status'] != 0) { - return DataReturn('获取授权信息失败', -10); + return DataReturn($ret['msg'], -10); } else { - $result['gender'] = empty($result['gender']) ? 0 : ($result['gender'] == 'm') ? 2 : 1; - $result['openid'] = $result['user_id']; - $result['referrer']= isset($this->data_post['referrer']) ? intval($this->data_post['referrer']) : 0; - return UserService::AuthUserProgram($result, 'alipay_openid'); + $data = $ret['data']; + $data['gender'] = empty($data['gender']) ? 0 : ($data['gender'] == 'm') ? 2 : 1; + $data['openid'] = $data['user_id']; + $data['referrer']= isset($this->data_post['referrer']) ? intval($this->data_post['referrer']) : 0; + return UserService::AuthUserProgram($data, 'alipay_openid'); } } diff --git a/application/index/controller/Cart.php b/application/index/controller/Cart.php index 3c5facbec..e68ba9cef 100755 --- a/application/index/controller/Cart.php +++ b/application/index/controller/Cart.php @@ -51,7 +51,7 @@ class Cart extends Common $base = [ 'total_price' => empty($cart_list['data']) ? 0 : array_sum(array_column($cart_list['data'], 'total_price')), - 'total_stock' => empty($cart_list['data']) ? 0 : array_sum(array_column($cart_list['data'], 'stock')), + 'buy_count' => empty($cart_list['data']) ? 0 : array_sum(array_column($cart_list['data'], 'stock')), 'ids' => empty($cart_list['data']) ? '' : implode(',', array_column($cart_list['data'], 'id')), ]; $this->assign('base', $base); diff --git a/application/index/view/default/buy/index.html b/application/index/view/default/buy/index.html index 625a73125..f5d8f2048 100755 --- a/application/index/view/default/buy/index.html +++ b/application/index/view/default/buy/index.html @@ -153,6 +153,13 @@
没有商品
{{/if}} + +
+

+ 合计 ¥{{$base.total_price}} +

+
+
@@ -165,12 +172,17 @@
- -
-

- 合计(含运费) ¥{{$base.total_price}} -

-
+ + {{if !empty($extension_data)}} + + {{/if}}
@@ -180,7 +192,7 @@ 实付款: ¥ - {{$base.total_price}} + {{$base.actual_price}}
diff --git a/application/index/view/default/order/detail.html b/application/index/view/default/order/detail.html index 36eb7ea1a..8434742b2 100755 --- a/application/index/view/default/order/detail.html +++ b/application/index/view/default/order/detail.html @@ -296,6 +296,17 @@
+ {{if !empty($data['extension_data'])}} +
+ {{foreach $data.extension_data as $ertk=>$ext}} +
+
{{$ext.name}}:
+
{{$ext.tips}}
+
+ {{/foreach}} +
+ {{/if}} +
{{if !empty($data.price)}}
@@ -303,6 +314,12 @@
¥{{$data.price}}
{{/if}} + {{if !empty($data.increase_price)}} +
+
增加金额:
+
+¥{{$data.increase_price}}
+
+ {{/if}} {{if !empty($data.preferential_price)}}
优惠金额:
diff --git a/application/plugins/freightfee/Hook.php b/application/plugins/freightfee/Hook.php index 178b9e7be..4c0b3cb76 100644 --- a/application/plugins/freightfee/Hook.php +++ b/application/plugins/freightfee/Hook.php @@ -1,7 +1,16 @@ FreightFeeCalculate($params); + break; - // 默认返回视图 + default : + $ret = ''; + } + return $ret; + } + } + + /** + * 运费计算 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $params [输入参数] + */ + public function FreightFeeCalculate($params = []) + { + $ret = PluginsService::PluginsData('freightfee'); + if($ret['code'] == 0) + { + // 是否设置运费数据 + if(!empty($ret['data']['data'][0])) + { + // 规则 + $rules = $this->RulesHandle($ret['data']['data'], $params['data']['base']['address']); + + // 计费方式 + if(!empty($rules)) + { + $price = 0; + switch($ret['data']['valuation']) + { + // 按件 + case 0 : + $price = $this->PieceCalculate($rules, $params['data']); + break; + + // 按量 + case 1 : + $price = $this->QuantityCalculate($rules, $params['data']); + break; + } + + // 扩展展示数据 + $show_name = empty($ret['data']['show_name']) ? '运费' : $ret['data']['show_name']; + $params['data']['extension_data'][] = [ + 'name' => $show_name, + 'price' => $price, + 'type' => 0, + 'tips' => '+¥'.$price.'元', + ]; + + // 金额 + $params['data']['base']['increase_price'] += $price; + $params['data']['base']['actual_price'] += $price; + } + return DataReturn('处理成功', 0); + } + return DataReturn('无需处理', 0); } else { - return 'hello world!'; + return $ret['msg']; + } + } + + /** + * 按重计费 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $rules [规则] + * @param [array] $buy [生成订单数据] + */ + public function QuantityCalculate($rules, $buy) + { + $price = 0; + if($rules['first_price'] > 0 && $buy['base']['spec_weight_total'] >= $rules['first']) + { + $price = $rules['first_price']; + } + if($rules['continue_price'] > 0 && $buy['base']['spec_weight_total'] >= $rules['continue']+$rules['first']) + { + $number = ($buy['base']['spec_weight_total']-$rules['first'])/$rules['continue']; + if($number > 0) + { + $price += round($rules['continue_price']*$number); + } + } + + return $price; + } + + /** + * 按件计费 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $rules [规则] + * @param [array] $buy [生成订单数据] + */ + public function PieceCalculate($rules, $buy) + { + $price = 0; + if($rules['first_price'] > 0 && $buy['base']['buy_count'] >= $rules['first']) + { + $price = $rules['first_price']; + } + if($rules['continue_price'] > 0 && $buy['base']['buy_count'] >= $rules['continue']+$rules['first']) + { + $number = round(($buy['base']['buy_count']-$rules['first'])/$rules['continue']); + if($number > 0) + { + $price += round($rules['continue_price']*$number); + } + } + + return $price; + } + + /** + * 运费规则匹配 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $rules [运费规则列表] + * @param [array] $address [用户地址] + */ + public function RulesHandle($rules, $address) + { + if(count($rules) > 1 && !empty($address)) + { + $data = [ + 'province' => ['rules' => [], 'number' => 0], + 'city' => ['rules' => [], 'number' => 0], + ]; + foreach($rules as $k=>$v) + { + if($k != 0) + { + $region = explode('-', $v['region']); + if(!empty($region)) + { + if(in_array($address['province'], $region)) + { + $data['province']['rules'] = $v; + $data['province']['number']++; + } + if(in_array($address['city'], $region)) + { + $data['city']['rules'] = $v; + $data['city']['number']++; + } + } + } + } + if($data['city']['number'] > 0) + { + if($data['province']['number'] > $data['city']['number']) + { + return $data['province']['rules']; + } + return $data['city']['rules']; + } else { + if($data['province']['number'] > 0) + { + return $data['province']['rules']; + } + } } + return $rules[0]; } } ?> \ No newline at end of file diff --git a/application/plugins/freightfee/config.json b/application/plugins/freightfee/config.json index 02b60c8f2..45b0bfd3e 100644 --- a/application/plugins/freightfee/config.json +++ b/application/plugins/freightfee/config.json @@ -21,6 +21,8 @@ "is_home":false }, "hook":{ - + "plugins_service_buy_handle":[ + "app\\plugins\\freightfee\\Hook" + ] } } \ No newline at end of file diff --git a/application/plugins/touristbuy/Hook.php b/application/plugins/touristbuy/Hook.php index 15a46cb21..b6a05f344 100644 --- a/application/plugins/touristbuy/Hook.php +++ b/application/plugins/touristbuy/Hook.php @@ -25,11 +25,12 @@ use app\service\UserService; class Hook extends Controller { /** - * 钩子入口 - * @author Guoguo - * @blog http://gadmin.cojz8.com + * 应用响应入口 + * @author Devil + * @blog http://gong.gg/ * @version 1.0.0 - * @datetime 2019年3月14日 + * @datetime 2019-02-09T14:25:44+0800 + * @param [array] $params [输入参数] */ public function run($params = []) { diff --git a/application/plugins/view/freightfee/admin/index.html b/application/plugins/view/freightfee/admin/index.html index 78672b219..1097200c3 100644 --- a/application/plugins/view/freightfee/admin/index.html +++ b/application/plugins/view/freightfee/admin/index.html @@ -9,6 +9,17 @@
+
+ +
+ {{if empty($data['show_name'])}} + 运费 + {{else /}} + {{$data.show_name}} + {{/if}} +
+
+
diff --git a/application/plugins/view/freightfee/admin/saveinfo.html b/application/plugins/view/freightfee/admin/saveinfo.html index ab4d3cdeb..877240907 100644 --- a/application/plugins/view/freightfee/admin/saveinfo.html +++ b/application/plugins/view/freightfee/admin/saveinfo.html @@ -10,6 +10,11 @@ 返回 +
+ + +
+
@@ -75,12 +80,12 @@ {{if $v['region'] eq 'default'}}
默认运费 - + {{else /}}
{{$v.region_names}}
添加地区 - + {{/if}} @@ -123,12 +128,12 @@ {{if $v['region'] eq 'default'}}
默认运费 - + {{else /}}
{{$v.region_names}}
添加地区 - + {{/if}} diff --git a/application/plugins/view/touristbuy/index/detail.html b/application/plugins/view/touristbuy/index/detail.html index 84d27d9eb..9bf7278ba 100644 --- a/application/plugins/view/touristbuy/index/detail.html +++ b/application/plugins/view/touristbuy/index/detail.html @@ -273,6 +273,17 @@
+ {{if !empty($data['extension_data'])}} +
+ {{foreach $data.extension_data as $ertk=>$ext}} +
+
{{$ext.name}}:
+
{{$ext.tips}}
+
+ {{/foreach}} +
+ {{/if}} +
{{if !empty($data.price)}}
@@ -280,6 +291,12 @@
¥{{$data.price}}
{{/if}} + {{if !empty($data.increase_price)}} +
+
增加金额:
+
+¥{{$data.increase_price}}
+
+ {{/if}} {{if !empty($data.preferential_price)}}
优惠金额:
diff --git a/application/service/BuyService.php b/application/service/BuyService.php index 1a00289dc..35f21c427 100755 --- a/application/service/BuyService.php +++ b/application/service/BuyService.php @@ -11,6 +11,7 @@ namespace app\service; use think\Db; +use think\facade\Hook; use app\service\GoodsService; use app\service\UserService; use app\service\ResourcesService; @@ -529,10 +530,29 @@ class BuyService // 商品/基础信息 $total_price = empty($goods) ? 0 : array_sum(array_column($goods, 'total_price')); $base = [ - 'total_price' => $total_price, - 'actual_price' => $total_price, - 'total_stock' => empty($goods) ? 0 : array_sum(array_column($goods, 'stock')), - 'address' => empty($address['data']) ? null : $address['data'], + // 总价 + 'total_price' => $total_price, + + // 订单实际支付金额(已减去优惠金额, 已加上增加金额) + 'actual_price' => $total_price, + + // 优惠金额 + 'preferential_price' => 0.00, + + // 增加金额 + 'increase_price' => 0.00, + + // 商品数量 + 'goods_count' => count($goods), + + // 规格重量总计 + 'spec_weight_total' => empty($goods) ? 0 : array_sum(array_map(function($v) {return $v['spec_weight']*$v['stock'];}, $goods)), + + // 购买总数 + 'buy_count' => empty($goods) ? 0 : array_sum(array_column($goods, 'stock')), + + // 默认地址 + 'address' => empty($address['data']) ? null : $address['data'], ]; // 扩展展示数据 @@ -541,18 +561,12 @@ class BuyService // type 类型(0减少, 1增加) // tips 提示信息 $extension_data = [ - [ - 'name' => '感恩节9折', - 'price' => 23, - 'type' => 0, - 'tips' => '-¥23元' - ], - [ - 'name' => '运费', - 'price' => 10, - 'type' => 1, - 'tips' => '+¥10元' - ], + // [ + // 'name' => '感恩节9折', + // 'price' => 23, + // 'type' => 0, + // 'tips' => '-¥23元' + // ], ]; // 返回数据 @@ -561,6 +575,20 @@ class BuyService 'base' => $base, 'extension_data' => $extension_data, ]; + + // 生成订单数据处理钩子 + $hook_name = 'plugins_service_buy_handle'; + $ret = Hook::listen($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'params' => &$params, + 'data' => &$result, + ]); + if(isset($ret['code']) && $ret['code'] != 0) + { + return $ret; + } + return DataReturn('操作成功', 0, $result); } @@ -593,7 +621,6 @@ class BuyService } // 数据校验 - $total_price = 0; foreach($params['goods'] as $v) { // 获取商品信息 @@ -630,16 +657,9 @@ class BuyService { return DataReturn('['.$v['goods_id'].']超过商品限购数量['.$v['stock'].'>'.$goods['buy_max_number'].']', -1); } - - // 总价 - $total_price += $goods['price']*$v['stock']; - $result[] = $goods; } - $data = [ - 'total_price' => $total_price, - ]; - return DataReturn('操作成功', 0, $data); + return DataReturn('操作成功', 0); } /** @@ -688,27 +708,25 @@ class BuyService } // 清单商品 - $goods = self::BuyTypeGoodsList($params); - if(!isset($goods['code']) || $goods['code'] != 0) + $buy = self::BuyTypeGoodsList($params); + if(!isset($buy['code']) || $buy['code'] != 0) { - return $goods; + return $buy; } - $check = self::BuyGoodsCheck(['goods'=>$goods['data']['goods']]); + $check = self::BuyGoodsCheck(['goods'=>$buy['data']['goods']]); if(!isset($check['code']) || $check['code'] != 0) { return $check; } - // 用户地址 - $address = UserService::UserAddressRow(array_merge($params, ['id'=>$params['address_id']])); - if(empty($address)) + // 收货地址 + if(empty($buy['data']['base']['address'])) { - return $address; + return DataReturn('收货地址有误', -1); + } else { + $address = $buy['data']['base']['address']; } - // 优惠金额 - $preferential_price = 0.00; - // 店铺 $shop_id = 0; @@ -717,18 +735,20 @@ class BuyService 'order_no' => date('YmdHis').GetNumberCode(6), 'user_id' => $params['user']['id'], 'shop_id' => $shop_id, - 'receive_address_id' => $address['data']['id'], - 'receive_name' => $address['data']['name'], - 'receive_tel' => $address['data']['tel'], - 'receive_province' => $address['data']['province'], - 'receive_city' => $address['data']['city'], - 'receive_county' => $address['data']['county'], - 'receive_address' => $address['data']['address'], + 'receive_address_id' => $address['id'], + 'receive_name' => $address['name'], + 'receive_tel' => $address['tel'], + 'receive_province' => $address['province'], + 'receive_city' => $address['city'], + 'receive_county' => $address['county'], + 'receive_address' => $address['address'], 'user_note' => isset($params['user_note']) ? htmlentities($params['user_note']) : '', 'status' => (intval(MyC('common_order_is_booking', 0)) == 1) ? 0 : 1, - 'preferential_price' => $preferential_price, - 'price' => $check['data']['total_price'], - 'total_price' => $check['data']['total_price']-$preferential_price, + 'preferential_price' => $buy['data']['base']['preferential_price'], + 'increase_price' => $buy['data']['base']['increase_price'], + 'price' => $buy['data']['base']['total_price'], + 'total_price' => $buy['data']['base']['actual_price'], + 'extension_data' => empty($buy['data']['extension_data']) ? '' : json_encode($buy['data']['extension_data']), 'payment_id' => isset($params['payment_id']) ? intval($params['payment_id']) : 0, 'add_time' => time(), ]; @@ -744,7 +764,7 @@ class BuyService $order_id = Db::name('Order')->insertGetId($order); if($order_id > 0) { - foreach($goods['data']['goods'] as $v) + foreach($buy['data']['goods'] as $v) { $detail = [ 'order_id' => $order_id, diff --git a/application/service/OrderService.php b/application/service/OrderService.php index a061089d0..c023cf0b3 100755 --- a/application/service/OrderService.php +++ b/application/service/OrderService.php @@ -648,6 +648,9 @@ class OrderService { $v['user_note'] = null; } + + // 扩展数据 + $v['extension_data'] = empty($v['extension_data']) ? null : json_decode($v['extension_data'], true); // 订单详情 $buy_number_count = 0; diff --git a/application/tags.php b/application/tags.php index cad187d4c..5454c299d 100755 --- a/application/tags.php +++ b/application/tags.php @@ -120,5 +120,9 @@ return array ( array ( 0 => 'app\\plugins\\touristbuy\\Hook', ), + 'plugins_service_buy_handle' => + array ( + 0 => 'app\\plugins\\freightfee\\Hook', + ), ); ?> \ No newline at end of file diff --git a/extend/base/AlipayAuth.php b/extend/base/AlipayAuth.php index b8af0eb19..359283c75 100755 --- a/extend/base/AlipayAuth.php +++ b/extend/base/AlipayAuth.php @@ -68,12 +68,12 @@ class AlipayAuth $result = GS($key); if($result !== false) { - return $result; + return ['status'=>0, 'msg'=>'success', 'data'=>$result]; } // 获取授权信息并且获取用户信息 $auth = $this->GetAuthAccessToken($authcode, $app_id); - if($auth != false) + if($auth['status'] == 0) { // 请求参数 $param = [ @@ -84,7 +84,7 @@ class AlipayAuth 'sign_type' => 'RSA2', 'timestamp' => date('Y-m-d H:i:s'), 'version' => '1.0', - 'auth_token' => $auth['access_token'], + 'auth_token' => $auth['data']['access_token'], ]; // 生成签名参数+签名 @@ -99,17 +99,21 @@ class AlipayAuth // 验证签名正确则存储缓存返回数据 if(!$this->SyncRsaVerify($result, 'alipay_user_info_share_response')) { - return false; + return ['status'=>-1, 'msg'=>'签名验证失败']; } // 存储缓存 SS($key, $result['alipay_user_info_share_response']); // 返回用户数据 - return $result['alipay_user_info_share_response']; + return ['status'=>0, 'msg'=>'success', 'data'=>$result['alipay_user_info_share_response']]; } + + $msg = empty($result['error_response']['sub_msg']) ? '授权失败' : $result['error_response']['sub_msg']; + return ['status'=>-1, 'msg'=>$msg]; + } else { + return $auth; } - return false; } /** @@ -157,7 +161,7 @@ class AlipayAuth { if(empty($app_id) || empty($key) || (empty($authcode) && empty($refresh_token))) { - return false; + return ['status'=>-1, 'msg'=>'参数有误']; } // 请求参数 @@ -188,20 +192,22 @@ class AlipayAuth // 执行请求 $result = $this->HttpRequest('https://openapi.alipay.com/gateway.do', $param); + // 结果正确则验证签名 并且 存储缓存返回access_token if(!empty($result['alipay_system_oauth_token_response']['user_id'])) { // 验证签名正确则存储缓存返回数据 if(!$this->SyncRsaVerify($result, 'alipay_system_oauth_token_response')) { - return false; + return ['status'=>-1, 'msg'=>'签名验证失败']; } // 存储缓存 SS($key, $result['alipay_system_oauth_token_response']); - return $result['alipay_system_oauth_token_response']; + return ['status'=>0, 'msg'=>'success', 'data'=>$result['alipay_system_oauth_token_response']]; } - return false; + $msg = empty($result['error_response']['sub_msg']) ? '授权失败' : $result['error_response']['sub_msg']; + return ['status'=>-1, 'msg'=>$msg]; } /** diff --git a/public/appmini/old/alipay/app.js b/public/appmini/old/alipay/app.js index 86d9662ec..c54b2821a 100755 --- a/public/appmini/old/alipay/app.js +++ b/public/appmini/old/alipay/app.js @@ -58,7 +58,7 @@ App({ // 请求地址 request_url: "{{request_url}}", //request_url: "https://test.shopxo.net/", - //request_url: 'http://tp5-dev.com/', + request_url: 'http://tp5-dev.com/', // 基础信息 application_title: "{{application_title}}", diff --git a/public/appmini/old/alipay/pages/buy/buy.js b/public/appmini/old/alipay/pages/buy/buy.js index 5e2c9416a..d8901a3ec 100755 --- a/public/appmini/old/alipay/pages/buy/buy.js +++ b/public/appmini/old/alipay/pages/buy/buy.js @@ -86,7 +86,7 @@ Page({ } else { this.setData({ goods_list: data.goods_list, - total_price: data.base.total_price, + total_price: data.base.actual_price, extension_data: data.extension_data || [], data_list_loding_status: 3, common_order_is_booking: data.common_order_is_booking || 0, diff --git a/public/appmini/old/alipay/pages/user-order/user-order.axml b/public/appmini/old/alipay/pages/user-order/user-order.axml index 9f75ef98c..e99caf61e 100755 --- a/public/appmini/old/alipay/pages/user-order/user-order.axml +++ b/public/appmini/old/alipay/pages/user-order/user-order.axml @@ -31,17 +31,17 @@ x{{detail.buy_number}} - {{item.describe}} - - - - - - + + {{item.describe}} + + + + + diff --git a/public/appmini/old/weixin/pages/buy/buy.js b/public/appmini/old/weixin/pages/buy/buy.js index 2c5e49a10..aa4e58b48 100755 --- a/public/appmini/old/weixin/pages/buy/buy.js +++ b/public/appmini/old/weixin/pages/buy/buy.js @@ -84,7 +84,7 @@ Page({ } else { this.setData({ goods_list: data.goods_list, - total_price: data.base.total_price, + total_price: data.base.actual_price, extension_data: data.extension_data || [], data_list_loding_status: 3, common_order_is_booking: data.common_order_is_booking || 0, diff --git a/public/appmini/old/weixin/pages/user-order/user-order.wxml b/public/appmini/old/weixin/pages/user-order/user-order.wxml index 9928aa6a4..017c2a2a1 100755 --- a/public/appmini/old/weixin/pages/user-order/user-order.wxml +++ b/public/appmini/old/weixin/pages/user-order/user-order.wxml @@ -31,18 +31,17 @@ x{{detail.buy_number}} - {{item.describe}} - - - - - - - + + {{item.describe}} + + + + + diff --git a/public/static/index/default/css/buy.css b/public/static/index/default/css/buy.css index 7666d1bed..9ba6f3b79 100755 --- a/public/static/index/default/css/buy.css +++ b/public/static/index/default/css/buy.css @@ -28,8 +28,8 @@ ul.logistics-list li.selected i.icon-active, ul.payment-list li.selected i.icon- .business-item ul { padding: 10px 3px 5px 5px;} ul.logistics-list li img, ul.payment-list li img { width: 36px; height: 36px; } -/*运费、留言*/ -.buy-message{padding:0px 5px} +/*运费、留言、扩展数据*/ +.buy-message {padding:0px 5px} .td.td-oplist .pay-logis,.td.td-bonus select{position:absolute;top:6px;right:0;} .memo-input{width:calc(100% - 64px);border: 1px solid #ccc;padding: 5px;outline:none;border-radius: 2px;} @@ -46,6 +46,13 @@ ul.logistics-list li img, ul.payment-list li img { width: 36px; height: 36px; } ul.address-list, .business-item ul { overflow: hidden; } .nav-buy .btn-go.am-disabled { background-color: #efa4af; } +/* 扩展数据 */ +.buy-extension-data { background: #ffffeb; border: 1px solid #ffe2cf; margin-top: 10px; padding: 5px 10px; margin: 10px 5px 0 5px; } +.buy-extension-data li { padding: 5px 0; } +.buy-extension-data li:not(:last-child) { border-bottom: 1px dashed #ffe2cf; } +.buy-extension-data .extension-items-name { } +.buy-extension-data .extension-items-tips { color: #ff8f44; } + /** * 手机下选择地址 */ @@ -91,8 +98,6 @@ ul.address-list, .business-item ul { overflow: hidden; } .base-real-pay .g_price span {font-size: 26px;} .price .nav-total-price {color: #d2364c;font: 700 26px tahoma;} .order-nav .buy-footer-address .buy-line-title {color: #404040;font-weight: 700;} - - .link-list{margin:0px auto;} /*地址管理*/ .address ul{margin-top:10px ;} @@ -121,6 +126,9 @@ ul.address-list, .business-item ul { overflow: hidden; } .link-list h3 { padding: 0 0 5px 0; } .buy-message { margin: 0; } .buy-point-discharge { padding: 10px 0px; } + + /*扩展数据*/ + .buy-extension-data { margin: 10px 0 0 0; } } @media only screen and (max-width:640px) { diff --git a/public/static/index/default/css/order.detail.css b/public/static/index/default/css/order.detail.css index 21b74169f..2c27eb1fb 100755 --- a/public/static/index/default/css/order.detail.css +++ b/public/static/index/default/css/order.detail.css @@ -110,7 +110,6 @@ ul.progress li.current .title { overflow: hidden; } .items-detail { - width: calc(100% - 62px); color: #666; } diff --git a/public/static/plugins/css/touristbuy/index.detail.css b/public/static/plugins/css/touristbuy/index.detail.css index 21b74169f..2c27eb1fb 100644 --- a/public/static/plugins/css/touristbuy/index.detail.css +++ b/public/static/plugins/css/touristbuy/index.detail.css @@ -110,7 +110,6 @@ ul.progress li.current .title { overflow: hidden; } .items-detail { - width: calc(100% - 62px); color: #666; } -- GitLab