1.修改就诊人清空所有预选信息

2.完成预存款和积分功能
main
刘佳宇 1 year ago
parent ba00a25f5a
commit 86156076f7

@ -5,56 +5,46 @@ import DraggableButton from "@/pages/components/goHome.vue";
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from 'vue'
import {
$api,
$image,
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store'
const $store = useStore()
import { ref } from "vue";
import { $api, $image, $response } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
const $store = useStore();
const $props = defineProps({
url: {
type: String,
default: ''
}
default: "",
},
});
const button_list = ref([])
const button_list = ref([]);
const getButtonList = async (api) => {
const response = await $api(api)
const response = await $api(api);
$response(response, () => {
button_list.value = response.data.list
})
}
button_list.value = response.data.list;
});
};
const checkType = () => {
if ($props.url.includes('api://')) {
let api = $props.url.split('api://')[1]
if ($props.url?.includes("api://")) {
let api = $props.url.split("api://")[1];
if (!!api) {
getButtonList(api)
}
getButtonList(api);
}
}
};
const mountedAction = () => {
checkType()
}
checkType();
};
const config_ref = ref(null)
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e
mountedAction()
}
config_ref.value = e;
mountedAction();
}
};
const buttonClick = (info) => {
if (!!info.url) {
@ -62,18 +52,18 @@ import DraggableButton from "@/pages/components/goHome.vue";
$store.setCheckupTypeId({ id: info.id });
}
uni.navigateTo({
url: info.url
})
url: info.url,
});
} else {
uni.$lu.toast('暂未开放')
}
uni.$lu.toast("暂未开放");
}
};
onShow(() => {
if (!!config_ref.value) {
mountedAction()
mountedAction();
}
})
});
</script>
<template>
<DraggableButton />
@ -83,7 +73,12 @@ import DraggableButton from "@/pages/components/goHome.vue";
</view>
<view class="button_list_wrapper">
<view @click="buttonClick(i)" class="button_item_wrapper" v-for="(i,k) in button_list" :key="k">
<view
@click="buttonClick(i)"
class="button_item_wrapper"
v-for="(i, k) in button_list"
:key="k"
>
<view class="button_icon_wrapper">
<image :src="$image(i.logo)"></image>
</view>
@ -105,7 +100,7 @@ import DraggableButton from "@/pages/components/goHome.vue";
.button_item_wrapper {
width: 552rpx;
height: 140rpx;
background: #FFFFFF;
background: #ffffff;
box-shadow: 0rpx 1rpx 4rpx 0rpx rgba(0, 164, 172, 0.16);
border-radius: 15rpx;
margin: 50rpx auto 0;

@ -25,6 +25,10 @@ let integral = ref(0);
let couponList = ref([]);
let selectStatus = ref(null);
let selectIndex = ref(0);
let netReceiptsPrice = ref(0);
let yucunkuan = ref(0); //
let jifen = ref(0); //
let keyong_jifen = ref(0); //
const mountedAction = async () => {
uni.showLoading({
@ -54,6 +58,30 @@ const GetPersonIntegralSaveMoneyCouponInfo = async () => {
});
};
const UsableIntegralSaveMoney = async () => {
//
const response = await $api("UsableIntegralSaveMoney", {
person_id: $store.getUser()?.person_id,
ysje: netReceiptsPrice.value,
ssje: truePrice.value,
type: 1,
});
$response(response, () => {
keyong_jifen.value = response.data.keyong_jifen;
if (keyong_jifen.value) {
selectStatus.value = 1;
popup.value.open("bottom");
if (yytjInfo.value.pointsPrice) {
selectIndex.value = 1;
} else {
selectIndex.value = 0;
}
} else {
uni.$lu.toast("暂无积分");
}
});
};
const selectDiscount = (status) => {
//
if (status == 2) {
@ -67,21 +95,19 @@ const selectDiscount = (status) => {
if (status == 1) {
//
if (integral.value) {
selectStatus.value = status;
popup.value.open("bottom");
if (yytjInfo.value.pointsPrice) {
selectIndex.value = 1;
} else {
selectIndex.value = 0;
}
} else {
uni.$lu.toast("暂无积分");
if (!jifen.value && !netReceiptsPrice.value) {
uni.$lu.toast("实际金额已为0元无需使用积分");
return;
}
UsableIntegralSaveMoney();
}
if (status == 3) {
//
if (!yucunkuan.value && !netReceiptsPrice.value) {
uni.$lu.toast("实际金额已为0元无需使用预付款");
return;
}
if (save_money.value) {
selectStatus.value = status;
if (yytjInfo.value.prepaidPrice) {
@ -101,18 +127,43 @@ const comfrimSelect = () => {
if (selectStatus.value == 1) {
//
if (selectIndex.value) {
yytjInfo.value.pointsPrice = integral.value;
yytjInfo.value.pointsPrice = keyong_jifen.value;
// 使 使
if (keyong_jifen.value > netReceiptsPrice.value) {
jifen.value = netReceiptsPrice.value;
} else {
jifen.value = keyong_jifen.value;
}
netReceiptsPrice.value = netReceiptsPrice.value - jifen.value;
$store.setYytjInfo(yytjInfo.value);
} else {
if (yytjInfo.value.pointsPrice) {
netReceiptsPrice.value = netReceiptsPrice.value + Number(jifen.value);
}
yytjInfo.value.pointsPrice = 0;
jifen.value = 0;
$store.setYytjInfo(yytjInfo.value);
}
} else {
console.log(selectIndex.value);
//
if (selectIndex.value) {
yytjInfo.value.prepaidPrice = save_money.value;
// 使 使
if (save_money.value > netReceiptsPrice.value) {
yucunkuan.value = netReceiptsPrice.value;
} else {
yucunkuan.value = save_money.value;
}
netReceiptsPrice.value = netReceiptsPrice.value - yucunkuan.value;
$store.setYytjInfo(yytjInfo.value);
} else {
if (yytjInfo.value.prepaidPrice) {
// 使
netReceiptsPrice.value =
netReceiptsPrice.value + Number(yucunkuan.value);
}
yucunkuan.value = 0;
yytjInfo.value.prepaidPrice = 0;
$store.setYytjInfo(yytjInfo.value);
}
@ -133,6 +184,34 @@ const getnmrList = async () => {
comboInfo.value = response.data.combo_info;
itemsInfo.value = response.data.items_info;
truePrice.value = response.data.true_price;
netReceiptsPrice.value = response.data.true_price;
if (yytjInfo.value.couponPrice) {
//
netReceiptsPrice.value =
netReceiptsPrice.value - yytjInfo.value.couponPrice;
}
if (yytjInfo.value.prepaidPrice) {
//
yucunkuan.value =
yytjInfo.value.prepaidPrice > netReceiptsPrice.value
? netReceiptsPrice.value
: yytjInfo.value.prepaidPrice;
netReceiptsPrice.value = netReceiptsPrice.value - yucunkuan.value;
} else {
yucunkuan.value = 0;
}
if (yytjInfo.value.pointsPrice) {
//
jifen.value =
yytjInfo.value.pointsPrice > netReceiptsPrice.value
? netReceiptsPrice.value
: yytjInfo.value.pointsPrice;
netReceiptsPrice.value = netReceiptsPrice.value - jifen.value;
} else {
jifen.value = 0;
}
if (!yytjInfo.value?.nmr_list?.length) {
yytjInfo.value.nmr_list = response.data.nmr_list.map((val) => {
@ -191,6 +270,8 @@ const comfrimyy = async () => {
plan_nmr_id: plan_nmr_id,
doctor: yytjInfo.value?.doctor_name || "",
duo_xuan_yi: $store.getDuoXuanYi(),
jifen: jifen.value,
yucunkuan: yucunkuan.value,
};
console.log(obj);
@ -288,7 +369,7 @@ const toRouter = (url, status) => {
}}</text>
<view class="mr-auto text-#888787">
剩余<text class="text-#FB670E">{{
selectStatus == 1 ? integral : save_money
selectStatus == 1 ? keyong_jifen : save_money
}}</text
>)
</view>
@ -318,9 +399,29 @@ const toRouter = (url, status) => {
@click="selectIndex = 1"
>
<text v-if="selectStatus == 1"
>抵扣{{ integral }}使用{{ integral }}积分</text
>抵扣{{
jifen
? jifen
: keyong_jifen > netReceiptsPrice
? netReceiptsPrice
: keyong_jifen
}}使用{{
jifen
? jifen
: keyong_jifen > netReceiptsPrice
? netReceiptsPrice
: keyong_jifen
}}积分</text
>
<text v-else
>使用剩余预存款中的{{
yucunkuan
? yucunkuan
: save_money > netReceiptsPrice
? netReceiptsPrice
: save_money
}}</text
>
<text v-else>{{ save_money }}使{{ save_money }}</text>
<uni-icons
:type="selectIndex ? 'checkbox-filled' : 'circle'"
:color="selectIndex ? '#239EA3' : '#A6A6A6'"
@ -542,9 +643,7 @@ const toRouter = (url, status) => {
>
</view>
<view class="ml-auto mr-20rpx">
<text class="text-#FB4F1A" v-if="yytjInfo.pointsPrice"
>-¥{{ yytjInfo.pointsPrice }}</text
>
<text class="text-#FB4F1A" v-if="jifen">-¥{{ jifen }}</text>
<text class="text-#070707" v-else></text>
</view>
<uni-icons type="right" size="12"></uni-icons>
@ -578,13 +677,11 @@ const toRouter = (url, status) => {
<view>
<text class="text-#050505">预存款</text>
<text v-if="save_money" class="text-#828383"
>{{ save_money }}</text
>剩余{{ save_money }}</text
>
</view>
<view class="ml-auto mr-20rpx">
<text class="text-#FB4F1A" v-if="yytjInfo.prepaidPrice"
>-¥{{ yytjInfo.prepaidPrice }}</text
>
<text class="text-#FB4F1A" v-if="yucunkuan">-¥{{ yucunkuan }}</text>
<text class="text-#070707" v-else></text>
</view>
<uni-icons type="right" size="12"></uni-icons>
@ -666,7 +763,7 @@ const toRouter = (url, status) => {
>
<view class="text-#ED6907 text-48rpx center items-end line-height-[1]">
<text class="text-24rpx">¥</text>
<text>{{ truePrice }}</text>
<text>{{ netReceiptsPrice }}</text>
</view>
<button
@click="comfrimyy"

@ -5,61 +5,52 @@ import DraggableButton from "@/pages/components/goHome.vue";
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from 'vue'
import {
$api,
$image,
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store'
const $store = useStore()
const person_list = ref([])
import { ref } from "vue";
import { $api, $image, $response } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
const $store = useStore();
const person_list = ref([]);
const getPersonList = async () => {
const response = await $api('GetPersonList')
const response = await $api("GetPersonList");
$response(response, () => {
person_list.value = response.data.list
})
}
person_list.value = response.data.list;
});
};
const config_ref = ref(null)
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e
getPersonList()
}
config_ref.value = e;
getPersonList();
}
};
const getUserInfo = async () => {
const response = await $api('UserInfo')
const response = await $api("UserInfo");
$response(response, () => {
// $store.user = response.data.info
$store.setUser(response.data.info);
uni.$lu.toast('切换成功')
$store.setYytjInfo({}); //
uni.$lu.toast("切换成功");
uni.navigateBack({
delta: 1
})
})
}
delta: 1,
});
});
};
const choosePersonClick = async (info) => {
const response = await $api('SetDefaultPerson', {
person_id: info.id
})
const response = await $api("SetDefaultPerson", {
person_id: info.id,
});
$response(response, () => {
getUserInfo();
})
}
});
};
onShow(() => {
if (!!config_ref.value) {
getPersonList()
getPersonList();
}
})
});
</script>
<template>
<DraggableButton />
@ -76,13 +67,22 @@ import DraggableButton from "@/pages/components/goHome.vue";
<view class="person_info_wrapper">
<view class="person_text_wrapper">
<view class="person_name_wrapper">{{ i.name }}</view>
<view class="person_sex_wrapper">{{ i.sex === 1 ? '男' : '女' }}</view>
<view class="person_sex_wrapper"
>{{ i.sex === 1 ? "男" : "女" }}</view
>
</view>
<view class="person_idnumber_wrapper">{{ i.id_number }}</view>
</view>
<view v-if="!!i.relation" class="person_type_wrapper">{{ i.relation }}</view>
<view v-if="!!i.relation" class="person_type_wrapper">{{
i.relation
}}</view>
<view class="person_type_wrapper">本人</view>
<view v-if="i.is_default === 2" @click="choosePersonClick(i)" class="person_choose_wrapper"></view>
<view
v-if="i.is_default === 2"
@click="choosePersonClick(i)"
class="person_choose_wrapper"
>切换</view
>
</view>
</view>
</view>
@ -97,7 +97,7 @@ import DraggableButton from "@/pages/components/goHome.vue";
.person_item_wrapper {
width: 690rpx;
height: 166rpx;
background: #FFFFFF;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 15rpx;
position: relative;
@ -131,20 +131,20 @@ import DraggableButton from "@/pages/components/goHome.vue";
.person_name_wrapper {
font-weight: 500;
font-size: 32rpx;
color: #0E0E0E;
color: #0e0e0e;
line-height: 1;
}
.person_sex_wrapper {
font-size: 24rpx;
color: #9E9E9E;
color: #9e9e9e;
line-height: 1;
margin-left: 10rpx;
}
.person_idnumber_wrapper {
font-size: 26rpx;
color: #0E0E0E;
color: #0e0e0e;
line-height: 1;
margin-top: 20rpx;
}
@ -153,13 +153,13 @@ import DraggableButton from "@/pages/components/goHome.vue";
position: absolute;
width: 100rpx;
height: 46rpx;
background: #C0C0C0;
background: #c0c0c0;
border-radius: 0rpx 15rpx 0rpx 15rpx;
right: 0;
top: 0;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
color: #ffffff;
line-height: 46rpx;
text-align: center;
}
@ -170,11 +170,11 @@ import DraggableButton from "@/pages/components/goHome.vue";
bottom: 10rpx;
width: 130rpx;
height: 50rpx;
background: #239EA3;
background: #239ea3;
border-radius: 25rpx;
font-weight: 400;
font-size: 22rpx;
color: #FFFFFF;
color: #ffffff;
line-height: 50rpx;
text-align: center;
}

Loading…
Cancel
Save