前端-胡立永 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 price += n.price * n.selectNum
} }
}) })
return Number(price).toFixed(3)
return Number(price).toFixed(2)
}, },
}, },
onLoad(){ onLoad(){


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

@ -100,14 +100,9 @@
}, },
methods: { methods: {
//tab //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() { toPurse() {


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

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


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

@ -43,6 +43,11 @@
<text>商品信息</text> <text>商品信息</text>
</view> </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" <view class="product-card" v-for="(info, index) in productInfo.commonShop"
:key="index"> :key="index">
@ -74,6 +79,11 @@
</view> </view>
</view> </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> </view>
</uv-checkbox-group> </uv-checkbox-group>
@ -119,7 +129,7 @@
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="order-submit" v-if="productInfo.isPay != 'Y'"> <view class="order-submit" v-if="productInfo.isPay != 'Y'">
<button class="submit-btn-close" @click="cancelOrderFast">取消</button> <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>
<view class="order-submit" v-else> <view class="order-submit" v-else>
@ -182,8 +192,14 @@
price += n.price * (n.selectNum || 1) 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) { onLoad(options) {
// ID // ID
@ -321,6 +337,24 @@
// //
submitOrder(skipAddressCheck = false) { 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) { if (!this.address.id) {
const addressForm = this.$refs.addressForm; const addressForm = this.$refs.addressForm;
// //
@ -357,22 +391,22 @@
} }
}) })
//
if (list.length === 0) {
uni.hideLoading();
uni.showToast({
title: '请选择至少一件商品',
icon: 'none'
});
return;
}
let data = { let data = {
addressId: this.address.id, addressId: this.address.id,
payType: 1, // payType: 1, //
orderId: this.orderId, orderId: this.orderId,
list: JSON.stringify(list), list: JSON.stringify(list),
} }
/*
{
addressId: this.address.id,
productId: this.productInfo.id,
num : 1,
payType: 1, //
orderId: this.orderId
}
*/
// //
this.$api('createSumOrder', data, res => { 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> </style>

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

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


Loading…
Cancel
Save