@@ -77,14 +77,14 @@ class Order extends Base | |||||
} | } | ||||
/** 默认地址 **/ | /** 默认地址 **/ | ||||
$address = (new AddressModel)->where(['user_id' => $user_id, 'is_default' => AddressModel::IS_DEFAULT_YES])->find(); | |||||
if ($address) { | |||||
$area = (new Area)->whereIn('id', [$address->province_id, $address->city_id, $address->area_id])->column('name', 'id'); | |||||
$address = $address->toArray(); | |||||
$address['province']['name'] = $area[$address['province_id']]; | |||||
$address['city']['name'] = $area[$address['city_id']]; | |||||
$address['area']['name'] = $area[$address['area_id']]; | |||||
} | |||||
// $address = (new AddressModel)->where(['user_id' => $user_id, 'is_default' => AddressModel::IS_DEFAULT_YES])->find(); | |||||
// if ($address) { | |||||
// $area = (new Area)->whereIn('id', [$address->province_id, $address->city_id, $address->area_id])->column('name', 'id'); | |||||
// $address = $address->toArray(); | |||||
// $address['province']['name'] = $area[$address['province_id']]; | |||||
// $address['city']['name'] = $area[$address['city_id']]; | |||||
// $address['area']['name'] = $area[$address['area_id']]; | |||||
// } | |||||
/** 可用优惠券 **/ | /** 可用优惠券 **/ | ||||
@@ -101,8 +101,8 @@ class Order extends Base | |||||
/** 运费数据 **/ | /** 运费数据 **/ | ||||
$cityId = $address['city_id'] ? $address['city_id'] : 0; | |||||
$delivery = (new DeliveryRuleModel())->getDelivetyByArea($cityId); | |||||
// $cityId = $address['city_id'] ? $address['city_id'] : 0; | |||||
// $delivery = (new DeliveryRuleModel())->getDelivetyByArea($cityId); | |||||
foreach ($productData as &$product) { | foreach ($productData as &$product) { | ||||
$product['image'] = Config::getImagesFullUrl($product['image']); | $product['image'] = Config::getImagesFullUrl($product['image']); | ||||
@@ -112,9 +112,9 @@ class Order extends Base | |||||
$this->success('', [ | $this->success('', [ | ||||
'product' => $productData, | 'product' => $productData, | ||||
'address' => $address, | |||||
// 'address' => $address, | |||||
'coupon' => $coupon, | 'coupon' => $coupon, | ||||
'delivery' => $delivery['list'] | |||||
// 'delivery' => $delivery['list'] | |||||
]); | ]); | ||||
} catch (Exception $e) { | } catch (Exception $e) { | ||||
@@ -238,9 +238,9 @@ class Order extends Model | |||||
// 订单费用 | // 订单费用 | ||||
//$orderPrice; | //$orderPrice; | ||||
// 运费 | // 运费 | ||||
$deliveryPrice = Delivery::algorithm($delivery, $data['number']); | |||||
// $deliveryPrice = Delivery::algorithm($delivery, $data['number']); | |||||
// 总费用 | // 总费用 | ||||
$totalPrice = bcadd(bcsub($orderPrice, $discountPrice, 2), $deliveryPrice, 2); | |||||
$totalPrice = bcadd(bcsub($orderPrice, $discountPrice, 2), 0, 2); | |||||
$out_trade_no = date('Ymd',time()).uniqid().$userId; | $out_trade_no = date('Ymd',time()).uniqid().$userId; | ||||
(new self)->save([ | (new self)->save([ | ||||
@@ -249,7 +249,7 @@ class Order extends Model | |||||
'out_trade_no' => $out_trade_no, | 'out_trade_no' => $out_trade_no, | ||||
'order_price' => $orderPrice, | 'order_price' => $orderPrice, | ||||
'discount_price' => $discountPrice, | 'discount_price' => $discountPrice, | ||||
'delivery_price' => $deliveryPrice, | |||||
// 'delivery_price' => $deliveryPrice, | |||||
'total_price' => $totalPrice, | 'total_price' => $totalPrice, | ||||
'ip' => $_SERVER['REMOTE_ADDR'] ?? '', | 'ip' => $_SERVER['REMOTE_ADDR'] ?? '', | ||||
'remark' => $data['remark'] ?? '', | 'remark' => $data['remark'] ?? '', | ||||
@@ -84,7 +84,7 @@ | |||||
<view class="cell-tit clamp">优惠金额</view> | <view class="cell-tit clamp">优惠金额</view> | ||||
<view class="cell-tip red">-¥{{coupon_price}}</view> | <view class="cell-tip red">-¥{{coupon_price}}</view> | ||||
</view> | </view> | ||||
<view class="yt-list-cell b-b"> | |||||
<!-- <view class="yt-list-cell b-b"> | |||||
<view class="cell-tit clamp">配送方式 | <view class="cell-tit clamp">配送方式 | ||||
<!-- <text style="color:red" @click="deliveryTemplate">(查看详情)</text> --> | <!-- <text style="color:red" @click="deliveryTemplate">(查看详情)</text> --> | ||||
</view> | </view> | ||||
@@ -93,7 +93,7 @@ | |||||
<view class="uni-input">{{deliveryList[deliveryIndex].name}}</view> | <view class="uni-input">{{deliveryList[deliveryIndex].name}}</view> | ||||
</picker> | </picker> | ||||
</view> | </view> | ||||
</view> | |||||
</view> --> | |||||
<view class="yt-list-cell b-b"> | <view class="yt-list-cell b-b"> | ||||
<view class="cell-tit clamp">运费</view> | <view class="cell-tit clamp">运费</view> | ||||
<view class="cell-tip">¥{{deliveryPrice}}</view> | <view class="cell-tip">¥{{deliveryPrice}}</view> | ||||
@@ -18,7 +18,7 @@ | |||||
</view> --> | </view> --> | ||||
<view class="tit"> | <view class="tit"> | ||||
<text class="yticon icon-iLinkapp-"></text> | <text class="yticon icon-iLinkapp-"></text> | ||||
喂喂会员 | |||||
会员 | |||||
</view> | </view> | ||||
<text class="e-m">uniShop</text> | <text class="e-m">uniShop</text> | ||||
<!-- <text class="e-b">开通会员开发无bug 一测就上线</text> --> | <!-- <text class="e-b">开通会员开发无bug 一测就上线</text> --> | ||||
@@ -1,3 +1,3 @@ | |||||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>宜家自购商城</title><script>document.addEventListener('DOMContentLoaded', function() { | <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>宜家自购商城</title><script>document.addEventListener('DOMContentLoaded', function() { | ||||
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px' | document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px' | ||||
})</script><link rel=stylesheet href=/h5/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/*BAIDU_STAT*/</script><script src=/h5/static/js/chunk-vendors.82917b4b.js></script><script src=/h5/static/js/index.30a08c4e.js></script></body></html> | |||||
})</script><link rel=stylesheet href=/h5/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/*BAIDU_STAT*/</script><script src=/h5/static/js/chunk-vendors.82917b4b.js></script><script src=/h5/static/js/index.68f31d17.js></script></body></html> |