详情接口和提交预约接口增加多选一字段

main
刘佳宇 1 year ago
parent 0ad5223b9b
commit c7a2ff6f4a

@ -276,6 +276,7 @@ const buyClick = async (item) => {
popupMultiple.value.open("center"); popupMultiple.value.open("center");
multipleIndex.value = 0; multipleIndex.value = 0;
itemIds.value = []; itemIds.value = [];
$store.setDuoXuanYi([]);
itemId.value = ""; itemId.value = "";
multipleList.value = item.duo_xuan_yi; multipleList.value = item.duo_xuan_yi;
return; return;
@ -288,7 +289,10 @@ const nextItemClick = () => {
uni.$lu.toast("请选择项目"); uni.$lu.toast("请选择项目");
return; return;
} }
itemIds.value.push(itemId.value); itemIds.value.push({
item_id: itemId.value,
zu_name: multipleList.value[multipleIndex.value]["0"]["zu_name"],
});
if (multipleIndex.value == multipleList.value.length - 1) { if (multipleIndex.value == multipleList.value.length - 1) {
toDetail(); toDetail();
return; return;
@ -304,9 +308,7 @@ const toDetail = () => {
// ID // ID
query += "&groupId=" + $props.groupId; query += "&groupId=" + $props.groupId;
} }
if (itemIds.value.length) { $store.setDuoXuanYi(itemIds.value);
query += "&itemIds=" + itemIds.value.join(",");
}
// ID // ID
// / // /
popupMultiple.value.close(); popupMultiple.value.close();
@ -495,14 +497,14 @@ const toRouter = () => {
<view <view
v-for="(item, index) in multipleList[multipleIndex]['item_list']" v-for="(item, index) in multipleList[multipleIndex]['item_list']"
:key="index" :key="index"
@click="itemId = item.item_id"
class="px-20rpx box-border b-b-1 b-#EAEAEA b-solid bs between h-100rpx" class="px-20rpx box-border b-b-1 b-#EAEAEA b-solid bs between h-100rpx"
> >
<text class="text-#000000 text-30rpx">{{ item.item_name }}</text> <text class="text-#000000 text-30rpx">{{ item.item_name }}</text>
<view class="center"> <view class="center">
<text class="text-#EC3D15 text-20rpx">¥</text> <text class="text-#EC3D15 text-20rpx mt-10rpx mr-5rpx">¥</text>
<text class="text-#EC3D15 text-32rpx mb-0">{{ item.price }}</text> <text class="text-#EC3D15 text-32rpx mb-0">{{ item.price }}</text>
<uni-icons <uni-icons
@click="itemId = item.item_id"
class="ml-28rpx" class="ml-28rpx"
color="#239EA3" color="#239EA3"
:type="itemId == item.item_id ? 'checkbox-filled' : 'circle'" :type="itemId == item.item_id ? 'checkbox-filled' : 'circle'"

@ -119,6 +119,7 @@ const buy = () => {
group_id: groupId.value, group_id: groupId.value,
item_ids: selectIds.value, item_ids: selectIds.value,
hospital: $store.save_info.hospital, hospital: $store.save_info.hospital,
duo_xuan_yi: $store.getDuoXuanYi(),
}); });
$store.setYytjInfo({}); $store.setYytjInfo({});
uni.navigateTo({ uni.navigateTo({
@ -135,6 +136,7 @@ const getBuyInfo = async () => {
hospital: $store.save_info.hospital, hospital: $store.save_info.hospital,
person_id: personId.value, person_id: personId.value,
group_id: groupId.value, group_id: groupId.value,
duo_xuan_yi: $store.getDuoXuanYi(),
}; };
const response = await $api("BuyInfo", obj); const response = await $api("BuyInfo", obj);
$response(response, () => { $response(response, () => {
@ -383,18 +385,32 @@ onShow(() => {
<view class="grow center">检查指标意义</view> <view class="grow center">检查指标意义</view>
</view> </view>
<view v-for="(val, index) in groupInfo?.items" :key="index"> <view v-for="(val, index) in groupInfo?.items" :key="index">
<view v-if="val.keshi_name != '材料费'"> <view v-if="val.keshi_name != '材料费'">
<view class="flex h-55rpx bg-#9f9f9f text-#fff text-24rpx rounded-10rpx mt-10rpx"> <view
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view> class="flex h-55rpx bg-#9f9f9f text-#fff text-24rpx rounded-10rpx mt-10rpx"
<view class="grow center">{{ val.keshi_name }}{{ val.children.length }}</view> >
</view> <view
<view class="flex bg-#efefef text-#000 text-24rpx rounded-10rpx mt-10rpx" v-for="(v, i) in val.children" :key="i"> class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"
<view class="min-w-155rpx break-all max-w-155rpx center b-0 b-r-4 b-solid b-#fff p-10rpx box-border text-center"> ></view>
{{ v.name }} <view class="grow center"
>{{ val.keshi_name }}{{ val.children.length }}</view
>
</view>
<view
class="flex bg-#efefef text-#000 text-24rpx rounded-10rpx mt-10rpx"
v-for="(v, i) in val.children"
:key="i"
>
<view
class="min-w-155rpx break-all max-w-155rpx center b-0 b-r-4 b-solid b-#fff p-10rpx box-border text-center"
>
{{ v.name }}
</view>
<view class="grow center p-10rpx box-border">{{
v.desc || "-"
}}</view>
</view> </view>
<view class="grow center p-10rpx box-border">{{v.desc || "-" }}</view>
</view> </view>
</view>
</view> </view>
</view> </view>

@ -190,6 +190,7 @@ const comfrimyy = async () => {
plan_id: plan_id, plan_id: plan_id,
plan_nmr_id: plan_nmr_id, plan_nmr_id: plan_nmr_id,
doctor: yytjInfo.value?.doctor_name || "", doctor: yytjInfo.value?.doctor_name || "",
duo_xuan_yi: $store.getDuoXuanYi(),
}; };
console.log(obj); console.log(obj);

@ -10,6 +10,7 @@ export const useStore = defineStore('counter', {
config: false, config: false,
groupInfo: {}, // 团检信息 groupInfo: {}, // 团检信息
combo_compare: [], // 套餐对比 combo_compare: [], // 套餐对比
duo_xuan_yi: [], // 多选一
save: { save: {
hospital: 1, hospital: 1,
doctor: 1, doctor: 1,
@ -27,9 +28,16 @@ export const useStore = defineStore('counter', {
this.combo_compare = comboContrast; this.combo_compare = comboContrast;
uni.setStorageSync('COMBO_CONTRAST', JSON.stringify(this.combo_compare)); uni.setStorageSync('COMBO_CONTRAST', JSON.stringify(this.combo_compare));
}, },
getComboContrast(){ getComboContrast() {
return JSON.parse(uni.getStorageSync('COMBO_CONTRAST') || '[]') || this.combo_compare; return JSON.parse(uni.getStorageSync('COMBO_CONTRAST') || '[]') || this.combo_compare;
}, },
setDuoXuanYi(duoXuanYi) {
this.duo_xuan_yi = duoXuanYi;
uni.setStorageSync('DUO_XUAN_YI', JSON.stringify(duoXuanYi))
},
getDuoXuanYi() {
return JSON.parse(uni.getStorageSync('DUO_XUAN_YI') || '[]') || this.duo_xuan_yi;
},
setTjbgInfo(tjbgInfo) { setTjbgInfo(tjbgInfo) {
this.tjbgInfo = tjbgInfo; this.tjbgInfo = tjbgInfo;
uni.setStorageSync('TJBG_INFO', JSON.stringify(tjbgInfo)); uni.setStorageSync('TJBG_INFO', JSON.stringify(tjbgInfo));

Loading…
Cancel
Save