前端-胡立永 1 week ago
parent
commit
b2d6c20db3
5 changed files with 74 additions and 24 deletions
  1. +1
    -1
      pages/index/cart.vue
  2. +3
    -8
      pages_order/mine/individualTeam.vue
  3. +1
    -1
      pages_order/order/createOrder.vue
  4. +67
    -12
      pages_order/order/firmOrder.vue
  5. +2
    -2
      pages_order/order/voiceOrder.vue

+ 1
- 1
pages/index/cart.vue View File

@ -147,7 +147,7 @@
price += n.price * n.selectNum
}
})
return Number(price).toFixed(3)
return Number(price).toFixed(2)
},
},
onLoad(){


+ 3
- 8
pages_order/mine/individualTeam.vue View File

@ -100,14 +100,9 @@
},
methods: {
//tab
clickTabs(index) {
if (index == 0) {
this.state = -1;
} else {
this.state = index - 1;
}
// this.queryParams.pageSize = 10
// this.orderPage()
clickTabs({index}) {
this.queryParams.state = index;
this.getData()
},
//
toPurse() {


+ 1
- 1
pages_order/order/createOrder.vue View File

@ -255,7 +255,7 @@
price -= this.coupon.money
}
return Number(price).toFixed(3)
return Number(price).toFixed(2)
},
...mapState(['userInfo', 'payOrderProduct']),
},


+ 67
- 12
pages_order/order/firmOrder.vue View File

@ -43,6 +43,11 @@
<text>商品信息</text>
</view>
<!-- 空状态提示 -->
<view v-if="!productInfo.commonShop || productInfo.commonShop.length === 0" class="empty-state">
<view class="empty-text">暂无商品信息</view>
</view>
<view class="product-card" v-for="(info, index) in productInfo.commonShop"
:key="index">
@ -74,6 +79,11 @@
</view>
</view>
</view>
<!-- 未选择商品提示 -->
<view v-if="productInfo.commonShop && productInfo.commonShop.length > 0 && checkboxValue.length === 0" class="empty-state">
<view class="empty-text">请选择至少一件商品</view>
</view>
</view>
</uv-checkbox-group>
@ -119,7 +129,7 @@
<!-- 底部按钮 -->
<view class="order-submit" v-if="productInfo.isPay != 'Y'">
<button class="submit-btn-close" @click="cancelOrderFast">取消</button>
<button class="submit-btn" @click="submitOrder">快捷下单{{ totalPrice }}</button>
<button class="submit-btn" :disabled="!hasSelectedProducts" :class="{'submit-btn-disabled': !hasSelectedProducts}" @click="submitOrder">快捷下单{{ totalPrice }}</button>
</view>
<view class="order-submit" v-else>
@ -182,8 +192,14 @@
price += n.price * (n.selectNum || 1)
}
})
return Number(price).toFixed(3)
return Number(price).toFixed(2)
},
//
hasSelectedProducts() {
return this.productInfo.commonShop &&
this.productInfo.commonShop.length > 0 &&
this.checkboxValue.length > 0;
}
},
onLoad(options) {
// ID
@ -321,6 +337,24 @@
//
submitOrder(skipAddressCheck = false) {
//
if (!this.hasSelectedProducts) {
uni.showToast({
title: '请选择至少一件商品',
icon: 'none'
});
return;
}
//
if (!this.productInfo.commonShop || this.productInfo.commonShop.length === 0) {
uni.showToast({
title: '暂无商品信息',
icon: 'none'
});
return;
}
if (!this.address.id) {
const addressForm = this.$refs.addressForm;
//
@ -357,22 +391,22 @@
}
})
//
if (list.length === 0) {
uni.hideLoading();
uni.showToast({
title: '请选择至少一件商品',
icon: 'none'
});
return;
}
let data = {
addressId: this.address.id,
payType: 1, //
orderId: this.orderId,
list: JSON.stringify(list),
}
/*
{
addressId: this.address.id,
productId: this.productInfo.id,
num : 1,
payType: 1, //
orderId: this.orderId
}
*/
//
this.$api('createSumOrder', data, res => {
@ -701,5 +735,26 @@
}
}
}
//
.empty-state {
padding: 60rpx 30rpx;
text-align: center;
.empty-icon {
margin-bottom: 20rpx;
}
.empty-text {
font-size: 28rpx;
color: #999;
}
}
//
.submit-btn-disabled {
background-color: #cccccc !important;
color: #ffffff !important;
}
}
</style>

+ 2
- 2
pages_order/order/voiceOrder.vue View File

@ -462,9 +462,9 @@
if (size < 1024) {
this.audioSize = size + 'B';
} else if (size < 1024 * 1024) {
this.audioSize = (size / 1024).toFixed(3) + 'KB';
this.audioSize = (size / 1024).toFixed(2) + 'KB';
} else {
this.audioSize = (size / (1024 * 1024)).toFixed(3) + 'MB';
this.audioSize = (size / (1024 * 1024)).toFixed(2) + 'MB';
}
},


Loading…
Cancel
Save