|
|
|
|
@ -62,6 +62,49 @@
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 数量选择器 - 新建订单时显示 -->
|
|
|
|
|
<view v-if="!orderId && accompanyProduct.id && form.can_multi_num==1" class="quantity-card">
|
|
|
|
|
<view class="quantity-card__header">
|
|
|
|
|
<view class="quantity-card__title">产品数量</view>
|
|
|
|
|
<view class="quantity-card__content">
|
|
|
|
|
<view class="quantity-control">
|
|
|
|
|
<u-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="default"
|
|
|
|
|
@click="decreaseQuantity"
|
|
|
|
|
:disabled="form.quantity <= 1"
|
|
|
|
|
:custom-style="{ width: '60rpx', height: '60rpx', borderRadius: '50%' }"
|
|
|
|
|
:throttle-time="0"
|
|
|
|
|
>
|
|
|
|
|
<u-icon name="minus" size="20" color="#666"></u-icon>
|
|
|
|
|
</u-button>
|
|
|
|
|
<view class="quantity-display">{{ form.quantity }}</view>
|
|
|
|
|
<u-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="default"
|
|
|
|
|
@click="increaseQuantity"
|
|
|
|
|
:custom-style="{ width: '60rpx', height: '60rpx', borderRadius: '50%' }"
|
|
|
|
|
:throttle-time="0"
|
|
|
|
|
>
|
|
|
|
|
<u-icon name="plus" size="20" color="#666"></u-icon>
|
|
|
|
|
</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 数量显示 - 编辑订单时显示 -->
|
|
|
|
|
<view v-if="orderId && form.quantity" class="quantity-card">
|
|
|
|
|
<view class="quantity-card__header">
|
|
|
|
|
<view class="quantity-card__title">产品数量</view>
|
|
|
|
|
<view class="quantity-card__content">
|
|
|
|
|
<view class="quantity-display-static">
|
|
|
|
|
{{ form.quantity }} 份
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="card" v-if="form.nurse_id && nurse.id">
|
|
|
|
|
<view class="desc-card__title">
|
|
|
|
|
护工信息
|
|
|
|
|
@ -326,6 +369,12 @@
|
|
|
|
|
</view>
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<view class="desc-card__content--title"> 数量 </view>
|
|
|
|
|
<view class="desc-card__content--value">
|
|
|
|
|
{{ form.quantity || 1 }} 份
|
|
|
|
|
</view>
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<!-- <view class="desc-card__content--title"> 服务标价 </view>-->
|
|
|
|
|
<!-- <view class="desc-card__content--value"> ¥ 288 </view>-->
|
|
|
|
|
<!-- <br />-->
|
|
|
|
|
@ -352,7 +401,7 @@
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<view class="price">
|
|
|
|
|
<text>实付:</text>
|
|
|
|
|
<text>¥ {{ orderId?paidPrice:accompanyProduct.price }}</text>
|
|
|
|
|
<text>¥ {{ orderId ? paidPrice : ((accompanyProduct.price || 0) * (form.quantity || 1)) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<u-button
|
|
|
|
|
v-if="form.pay_status === 0"
|
|
|
|
|
@ -673,6 +722,7 @@ export default {
|
|
|
|
|
content: "",
|
|
|
|
|
pay_status: 0,
|
|
|
|
|
no: "",
|
|
|
|
|
quantity: 1,
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
user_archive_id: [
|
|
|
|
|
@ -739,6 +789,7 @@ export default {
|
|
|
|
|
this.$refs.uForm.setRules(this.rules);
|
|
|
|
|
},
|
|
|
|
|
onLoad(option) {
|
|
|
|
|
this.form.can_multi_num = option.can_multi_num ? Number(option.can_multi_num) : 0
|
|
|
|
|
this.form.accompany_product_id = option.id ? Number(option.id) : "";
|
|
|
|
|
this.form.type = Number(option.type);
|
|
|
|
|
uni.setNavigationBarTitle({
|
|
|
|
|
@ -754,6 +805,28 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
// 增加数量
|
|
|
|
|
increaseQuantity() {
|
|
|
|
|
if (this.form.quantity < 99) { // 限制最大数量为99
|
|
|
|
|
this.$set(this.form, 'quantity', this.form.quantity + 1);
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '最大数量为99',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 减少数量
|
|
|
|
|
decreaseQuantity() {
|
|
|
|
|
if (this.form.quantity > 1) {
|
|
|
|
|
this.$set(this.form, 'quantity', this.form.quantity - 1);
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '最小数量为1',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 获取产品列表
|
|
|
|
|
async getList(type) {
|
|
|
|
|
const res = await this.$u.api.accompanyProduct({
|
|
|
|
|
@ -775,6 +848,11 @@ export default {
|
|
|
|
|
this.form[key] = res[key];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 确保数量字段有默认值
|
|
|
|
|
if (!this.form.quantity) {
|
|
|
|
|
this.form.quantity = 1;
|
|
|
|
|
}
|
|
|
|
|
this.form['created_at'] = res['created_at']
|
|
|
|
|
this.form['status'] = res['status']
|
|
|
|
|
this.form['nurse_id'] = res['nurse_id']
|
|
|
|
|
@ -885,6 +963,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// return
|
|
|
|
|
this.form.price = this.orderId ? this.paidPrice : (this.accompanyProduct.price * this.form.quantity)
|
|
|
|
|
this.form.total = this.form.quantity.toString()
|
|
|
|
|
const res = await this.$u.api.accompanyProductOrder(this.form);
|
|
|
|
|
if (res) {
|
|
|
|
|
this.orderId = res.id;
|
|
|
|
|
@ -1160,6 +1240,79 @@ export default {
|
|
|
|
|
background: #f4efee;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 数量选择Card样式
|
|
|
|
|
.quantity-card {
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
margin: 30rpx;
|
|
|
|
|
box-shadow: 0 4rpx 16rpx #e6eaf1;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
|
|
|
|
|
&__header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&__title {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #000000;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
position: relative;
|
|
|
|
|
padding-left: 24rpx;
|
|
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
|
content: "";
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
0deg,
|
|
|
|
|
#c10d12 0%,
|
|
|
|
|
#c10d12 6%,
|
|
|
|
|
#e26165 100%
|
|
|
|
|
);
|
|
|
|
|
border-radius: 4rpx;
|
|
|
|
|
width: 6rpx;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&__content {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.quantity-control {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
.quantity-display {
|
|
|
|
|
width: 120rpx;
|
|
|
|
|
height: 60rpx;
|
|
|
|
|
line-height: 60rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background: #f8f8f8;
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
margin: 0 20rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.quantity-display-static {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
padding: 10rpx 20rpx;
|
|
|
|
|
background: #f8f8f8;
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.pay-popup {
|
|
|
|
|
&-container {
|
|
|
|
|
padding-bottom: 20rpx;
|
|
|
|
|
|