Browse Source

Merge remote-tracking branch 'origin/yuenan' into yuenan

yuenan
娄梦宁 3 years ago
parent
commit
08bde158f8
8 changed files with 32 additions and 14 deletions
  1. +14
    -7
      addons/unishop/uniapp/uni-shop/pages/order/createOrder.vue
  2. +14
    -3
      addons/unishop/uniapp/uni-shop/pages/product/product.vue
  3. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html
  4. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.22d23508.js
  5. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.48b9fc85.js
  6. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.95123f09.js
  7. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-product-product.368138ff.js
  8. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-product-product.eef8f8ba.js

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

@@ -47,7 +47,7 @@
{{progress.number ? "(秒:"+progress.number+"件,剩:"+(progress.number - progress.sold)+"件)": ""}}
</view>
<view class="price-box">
<view class="price">¥{{item.sales_price}} <del class="market_price">¥{{item.market_price}}</del>
<view class="price">¥{{item.sales_price|million}}
</view>
<!-- <text class="number">x 1</text> -->
<uni-number-box v-if="progress.number" class="step" :min="1"
@@ -55,7 +55,7 @@
:disabled="item.number>=(progress.number - progress.sold)" :value="item.number"
:isMax="(progress.number - progress.sold) <= item.number?true:false"
:isMin="item.number===1" :index="index" @eventChange="numberChange"></uni-number-box>
<uni-number-box v-else class="step" :min="1" :max="item.stock"
<uni-number-box v-else class="step" :min="1" :max="Number(item.stock)"
:disabled="item.number>=item.stock" :value="item.number"
:isMax="item.stock <= item.number?true:false" :isMin="item.number===1" :index="index"
@eventChange="numberChange"></uni-number-box>
@@ -89,7 +89,7 @@
<view class="yt-list">
<view class="yt-list-cell b-b">
<view class="cell-tit clamp">总共合计</view>
<view class="cell-tip">¥{{price}}</view>
<view class="cell-tip">¥{{price|million}}</view>
</view>
<view class="yt-list-cell b-b" v-if="couponList && couponList.length">
<view class="cell-tit clamp">优惠金额</view>
@@ -119,7 +119,7 @@
<view class="price-content">
<text>实付款</text>
<text class="price-tip">¥</text>
<text class="price">{{total}}</text>
<text class="price">{{total|million}}</text>
</view>
<text class="submit" @click="submit">提交订单</text>
</view>
@@ -205,6 +205,12 @@
}
},
onShow() {},
filters: {
million: function (value) {
if (!value) return 0;
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 将整数部分逢三一断
}
},
methods: {
// 计算百分比
percentage(number, sold) {
@@ -266,7 +272,7 @@
this.$api.msg('请填写收货人姓名');
return;
}
if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(adres.mobile)) {
if (!/(^0[0-9]{9}$)/.test(adres.mobile)) {
this.$api.msg('请输入正确的手机号码');
return;
}
@@ -354,13 +360,14 @@
let price = 0;
let number = 0; // 产品数量
let product = this.product;
console.log(this.product)
product.forEach(item => {
price = price + parseFloat(item.sales_price) * item.number;
price = price + parseFloat(item.sales_price.replace(/,/g, "")) * item.number;
number = number + item.number;
});

this.price = price.toFixed(2);
console.log(this.price)
let total = price;

// 检查当前优惠券是否满足使用条件


+ 14
- 3
addons/unishop/uniapp/uni-shop/pages/product/product.vue View File

@@ -51,12 +51,12 @@
<view style="display: flex;justify-content: space-between;align-items: center;">
<view class="price-box" v-if="flash == false">
<text class="price-tip">¥</text>
<text class="price">{{specProduct.sales_price}}</text>
<text class="m-price" v-if="specProduct.market_price">¥{{specProduct.market_price}}</text>
<text class="price">{{specProduct.sales_price|million}}</text>
<text class="m-price" v-if="specProduct.market_price">¥{{specProduct.market_price|million}}</text>
<text class="coupon-tip" v-if="specProduct.market_price > 0 && specProduct.market_price > specProduct.sales_price">{{(specProduct.sales_price/specProduct.market_price*10).toFixed(1)}}折</text>
</view>
<view class="bot-row">
<text>已售: {{product.sales}}</text>
<text>已售: {{product.sales|round|million}}+</text>
</view>
</view>
<view style="display: flex;justify-content: space-between;align-items: center;">
@@ -240,6 +240,16 @@
ProgressBar,
uniCountdown
},
filters: {
million: function (value) {
if (!value) return 0;
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 将整数部分逢三一断
},
round: function (value) {
if (!value) return 0;
return (value/1000).toFixed(1)*1000
}
},
computed: {
...mapGetters(['userInfo', 'hasLogin']),
@@ -545,6 +555,7 @@

.title {
font-size: 32upx;
font-weight: 800;
color: $font-color-dark;
height: 50upx;
line-height: 50upx;


+ 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.83ec382e.js></script><script src=/h5/static/js/index.12d25690.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.83ec382e.js></script><script src=/h5/static/js/index.22d23508.js></script></body></html>

addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.22d23508.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.48b9fc85.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.95123f09.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-product-product.368138ff.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-product-product.eef8f8ba.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save