Browse Source

移除运费

undefined
娄梦宁 4 years ago
parent
commit
a7cf5b331f
10 changed files with 22 additions and 22 deletions
  1. +12
    -12
      addons/unishop/controller/Order.php
  2. +3
    -3
      addons/unishop/model/Order.php
  3. +2
    -2
      addons/unishop/uniapp/uni-shop/pages/order/createOrder.vue
  4. +1
    -1
      addons/unishop/uniapp/uni-shop/pages/user/user.vue
  5. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html
  6. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.68f31d17.js
  7. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.400aae3e.js
  8. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.811cbb21.js
  9. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-user-user.4fd95423.js
  10. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-user-user.d21958d5.js

+ 12
- 12
addons/unishop/controller/Order.php View File

@@ -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) {
$product['image'] = Config::getImagesFullUrl($product['image']);
@@ -112,9 +112,9 @@ class Order extends Base

$this->success('', [
'product' => $productData,
'address' => $address,
// 'address' => $address,
'coupon' => $coupon,
'delivery' => $delivery['list']
// 'delivery' => $delivery['list']
]);

} catch (Exception $e) {


+ 3
- 3
addons/unishop/model/Order.php View File

@@ -238,9 +238,9 @@ class Order extends Model
// 订单费用
//$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;
(new self)->save([
@@ -249,7 +249,7 @@ class Order extends Model
'out_trade_no' => $out_trade_no,
'order_price' => $orderPrice,
'discount_price' => $discountPrice,
'delivery_price' => $deliveryPrice,
// 'delivery_price' => $deliveryPrice,
'total_price' => $totalPrice,
'ip' => $_SERVER['REMOTE_ADDR'] ?? '',
'remark' => $data['remark'] ?? '',


+ 2
- 2
addons/unishop/uniapp/uni-shop/pages/order/createOrder.vue View File

@@ -84,7 +84,7 @@
<view class="cell-tit clamp">优惠金额</view>
<view class="cell-tip red">-¥{{coupon_price}}</view>
</view>
<view class="yt-list-cell b-b">
<!-- <view class="yt-list-cell b-b">
<view class="cell-tit clamp">配送方式
<!-- <text style="color:red" @click="deliveryTemplate">(查看详情)</text> -->
</view>
@@ -93,7 +93,7 @@
<view class="uni-input">{{deliveryList[deliveryIndex].name}}</view>
</picker>
</view>
</view>
</view> -->
<view class="yt-list-cell b-b">
<view class="cell-tit clamp">运费</view>
<view class="cell-tip">¥{{deliveryPrice}}</view>


+ 1
- 1
addons/unishop/uniapp/uni-shop/pages/user/user.vue View File

@@ -18,7 +18,7 @@
</view> -->
<view class="tit">
<text class="yticon icon-iLinkapp-"></text>
喂喂会员
会员
</view>
<text class="e-m">uniShop</text>
<!-- <text class="e-b">开通会员开发无bug 一测就上线</text> -->


+ 1
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html View File

@@ -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() {
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>

addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.68f31d17.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.400aae3e.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.811cbb21.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-user-user.4fd95423.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-user-user.d21958d5.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save