|
|
|
@ -7,7 +7,7 @@
|
|
|
|
import { ref } from "vue";
|
|
|
|
import { ref } from "vue";
|
|
|
|
import { $api, $response, $image } from "@/api";
|
|
|
|
import { $api, $response, $image } from "@/api";
|
|
|
|
import { onShow } from "@dcloudio/uni-app";
|
|
|
|
import { onShow } from "@dcloudio/uni-app";
|
|
|
|
import wx from 'weixin-js-sdk'
|
|
|
|
import wx from "weixin-js-sdk";
|
|
|
|
import { useStore } from "@/store";
|
|
|
|
import { useStore } from "@/store";
|
|
|
|
const $store = useStore();
|
|
|
|
const $store = useStore();
|
|
|
|
|
|
|
|
|
|
|
|
@ -28,10 +28,10 @@ const mountedAction = async () => {
|
|
|
|
userInfo.value = buyInfo.value.group_id
|
|
|
|
userInfo.value = buyInfo.value.group_id
|
|
|
|
? $store.getGroupInfo()
|
|
|
|
? $store.getGroupInfo()
|
|
|
|
: $store.getUser();
|
|
|
|
: $store.getUser();
|
|
|
|
let time = setTimeout(() => {
|
|
|
|
let time = setTimeout(() => {
|
|
|
|
getnmrList();
|
|
|
|
getnmrList();
|
|
|
|
clearTimeout(time);
|
|
|
|
clearTimeout(time);
|
|
|
|
}, 500);
|
|
|
|
}, 500);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const getnmrList = async () => {
|
|
|
|
const getnmrList = async () => {
|
|
|
|
@ -46,21 +46,21 @@ const getnmrList = async () => {
|
|
|
|
comboInfo.value = response.data.combo_info;
|
|
|
|
comboInfo.value = response.data.combo_info;
|
|
|
|
itemsInfo.value = response.data.items_info;
|
|
|
|
itemsInfo.value = response.data.items_info;
|
|
|
|
truePrice.value = response.data.true_price;
|
|
|
|
truePrice.value = response.data.true_price;
|
|
|
|
|
|
|
|
|
|
|
|
if(!yytjInfo.value?.nmr_list?.length){
|
|
|
|
if (!yytjInfo.value?.nmr_list?.length) {
|
|
|
|
yytjInfo.value.nmr_list = response.data.nmr_list.map((val) => {
|
|
|
|
yytjInfo.value.nmr_list = response.data.nmr_list.map((val) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
...val,
|
|
|
|
...val,
|
|
|
|
time: "",
|
|
|
|
time: "",
|
|
|
|
id: "",
|
|
|
|
id: "",
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});;
|
|
|
|
});
|
|
|
|
yytjInfo.value.nmr_list.push({
|
|
|
|
yytjInfo.value.nmr_list.push({
|
|
|
|
item_id: -1,
|
|
|
|
item_id: -1,
|
|
|
|
name: "体检时间",
|
|
|
|
name: "体检时间",
|
|
|
|
time: "",
|
|
|
|
time: "",
|
|
|
|
id: "",
|
|
|
|
id: "",
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uni.hideLoading();
|
|
|
|
uni.hideLoading();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -74,72 +74,93 @@ const comfrimyy = async () => {
|
|
|
|
// return;
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// console.log(yytjInfo.value?.nmr_list);
|
|
|
|
// console.log(yytjInfo.value?.nmr_list);
|
|
|
|
for(let i = 0; i < yytjInfo.value?.nmr_list?.length; i++){
|
|
|
|
for (let i = 0; i < yytjInfo.value?.nmr_list?.length; i++) {
|
|
|
|
if(!yytjInfo.value?.nmr_list[i].time){
|
|
|
|
if (!yytjInfo.value?.nmr_list[i].time) {
|
|
|
|
uni.$lu.toast("请选择预约时间");
|
|
|
|
uni.$lu.toast("请选择预约时间");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(yytjInfo.value?.nmr_list?.length > 1){
|
|
|
|
if (yytjInfo.value?.nmr_list?.length > 1) {
|
|
|
|
plan_nmr_id = yytjInfo.value?.nmr_list[0]?.id;
|
|
|
|
plan_nmr_id = yytjInfo.value?.nmr_list[0]?.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(yytjInfo.value?.nmr_list?.length > 1){
|
|
|
|
if (yytjInfo.value?.nmr_list?.length > 1) {
|
|
|
|
plan_id = yytjInfo.value?.nmr_list[yytjInfo.value?.nmr_list.length - 1]?.id;
|
|
|
|
plan_id = yytjInfo.value?.nmr_list[yytjInfo.value?.nmr_list.length - 1]?.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log(groupInfo.value);
|
|
|
|
console.log(groupInfo.value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let obj = {
|
|
|
|
let obj = {
|
|
|
|
person_id: buyInfo.value.person_id,
|
|
|
|
person_id: buyInfo.value.person_id,
|
|
|
|
type: buyInfo.value.group_id ? 2 : 1,
|
|
|
|
type: buyInfo.value.group_id ? 2 : 1,
|
|
|
|
hospital: buyInfo.value.hospital,
|
|
|
|
hospital: buyInfo.value.hospital,
|
|
|
|
group_id: buyInfo.value.group_id,
|
|
|
|
group_id: buyInfo.value.group_id,
|
|
|
|
combo_id: buyInfo.value?.combo_id || (groupInfo.value?.combo_id?"":userInfo.value?.combo_id) || "",
|
|
|
|
combo_id:
|
|
|
|
|
|
|
|
buyInfo.value?.combo_id ||
|
|
|
|
|
|
|
|
(groupInfo.value?.combo_id ? "" : userInfo.value?.combo_id) ||
|
|
|
|
|
|
|
|
"",
|
|
|
|
item_ids: buyInfo.value.item_ids,
|
|
|
|
item_ids: buyInfo.value.item_ids,
|
|
|
|
plan_id: plan_id,
|
|
|
|
plan_id: plan_id,
|
|
|
|
$plan_nmr_id: plan_nmr_id,
|
|
|
|
$plan_nmr_id: plan_nmr_id,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
console.log(obj);
|
|
|
|
console.log(obj);
|
|
|
|
|
|
|
|
|
|
|
|
const response = await $api("OrderCreate", obj);
|
|
|
|
const response = await $api("OrderCreate", obj);
|
|
|
|
// return
|
|
|
|
// return
|
|
|
|
$response(response, () => {
|
|
|
|
$response(response, () => {
|
|
|
|
if(response.status){
|
|
|
|
if (response.status) {
|
|
|
|
if(response.data.action == "pay"){
|
|
|
|
if (response.data.action == "pay") {
|
|
|
|
StartPay(response.data.orderid);
|
|
|
|
StartPay(response.data.orderid);
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
uni.navigateTo({
|
|
|
|
uni.navigateTo({
|
|
|
|
url: "/pages/buy/done/done?id="+response.data.orderid
|
|
|
|
url: "/pages/buy/done/done?id=" + response.data.orderid,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const StartPay = async (id) => { //继续支付
|
|
|
|
const StartPay = async (id) => {
|
|
|
|
uni.showLoading()
|
|
|
|
//继续支付
|
|
|
|
const response = await $api('StartPay', {
|
|
|
|
uni.showLoading();
|
|
|
|
openid: localStorage.getItem('OPENID'),
|
|
|
|
const response = await $api("StartPay", {
|
|
|
|
id: id,
|
|
|
|
openid: localStorage.getItem("OPENID"),
|
|
|
|
})
|
|
|
|
id: id,
|
|
|
|
uni.hideLoading()
|
|
|
|
});
|
|
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
$response(response, () => {
|
|
|
|
$response(response, () => {
|
|
|
|
if (response.status) {
|
|
|
|
if (response.status) {
|
|
|
|
let info = response.data.info
|
|
|
|
let info = response.data.info;
|
|
|
|
let p = '&appid=' + info.appid + '&sub_org_code=' + info.sub_org_code + '&ghzid=' + info
|
|
|
|
let p =
|
|
|
|
.ghzid + '&orderid=' + info.orderid + '&order_desc=' + info.order_desc + '&amount=' +
|
|
|
|
"&appid=" +
|
|
|
|
info.amount + '¬ify_url=' + info.notify_url + '×tamp=' + info.timestamp +
|
|
|
|
info.appid +
|
|
|
|
'&nonce=' + info.nonce + '&signature=' + info.signature;
|
|
|
|
"&sub_org_code=" +
|
|
|
|
console.log(p);
|
|
|
|
info.sub_org_code +
|
|
|
|
wx.miniProgram.navigateTo({
|
|
|
|
"&ghzid=" +
|
|
|
|
url: '/pages/other/entry/index?path=/pages/physical-examination/payment/index' +
|
|
|
|
info.ghzid +
|
|
|
|
p
|
|
|
|
"&orderid=" +
|
|
|
|
})
|
|
|
|
info.orderid +
|
|
|
|
}
|
|
|
|
"&order_desc=" +
|
|
|
|
})
|
|
|
|
info.order_desc +
|
|
|
|
}
|
|
|
|
"&amount=" +
|
|
|
|
|
|
|
|
info.amount +
|
|
|
|
|
|
|
|
"¬ify_url=" +
|
|
|
|
|
|
|
|
info.notify_url +
|
|
|
|
|
|
|
|
"×tamp=" +
|
|
|
|
|
|
|
|
info.timestamp +
|
|
|
|
|
|
|
|
"&nonce=" +
|
|
|
|
|
|
|
|
info.nonce +
|
|
|
|
|
|
|
|
"&signature=" +
|
|
|
|
|
|
|
|
info.signature;
|
|
|
|
|
|
|
|
console.log(p);
|
|
|
|
|
|
|
|
wx.miniProgram.navigateTo({
|
|
|
|
|
|
|
|
url:
|
|
|
|
|
|
|
|
"/pages/other/entry/index?path=/pages/physical-examination/payment/index" +
|
|
|
|
|
|
|
|
p,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const config_ref = ref(null);
|
|
|
|
const config_ref = ref(null);
|
|
|
|
const configRef = (e) => {
|
|
|
|
const configRef = (e) => {
|
|
|
|
@ -156,7 +177,7 @@ onShow(() => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const toRouter = (url, status) => {
|
|
|
|
const toRouter = (url, status) => {
|
|
|
|
if(status){
|
|
|
|
if (status) {
|
|
|
|
uni.setStorageSync("yytjInfoS", yytjInfo.value);
|
|
|
|
uni.setStorageSync("yytjInfoS", yytjInfo.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uni.navigateTo({
|
|
|
|
uni.navigateTo({
|
|
|
|
@ -177,7 +198,7 @@ const toRouter = (url, status) => {
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
class="flex w-full b-0 b-solid b-#E1ECEE mb-7rpx"
|
|
|
|
class="flex w-full b-0 b-solid b-#E1ECEE mb-7rpx"
|
|
|
|
:class="{
|
|
|
|
:class="{
|
|
|
|
'b-b-1 pb-25rpx': itemsInfo?.items?.length
|
|
|
|
'b-b-1 pb-25rpx': itemsInfo?.items?.length,
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
v-if="!buyInfo.group_id && comboInfo?.items?.length"
|
|
|
|
v-if="!buyInfo.group_id && comboInfo?.items?.length"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -236,7 +257,7 @@ const toRouter = (url, status) => {
|
|
|
|
v-if="buyInfo.group_id"
|
|
|
|
v-if="buyInfo.group_id"
|
|
|
|
class="b-0 b-solid b-#E1ECEE pb-25rpx mb-7rpx"
|
|
|
|
class="b-0 b-solid b-#E1ECEE pb-25rpx mb-7rpx"
|
|
|
|
:class="{
|
|
|
|
:class="{
|
|
|
|
'b-b-1': itemsInfo?.items?.length
|
|
|
|
'b-b-1': itemsInfo?.items?.length,
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<!-- 3团检套餐 4团检自选 都要显示头像和名字 -->
|
|
|
|
<!-- 3团检套餐 4团检自选 都要显示头像和名字 -->
|
|
|
|
@ -350,18 +371,93 @@ const toRouter = (url, status) => {
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view
|
|
|
|
|
|
|
|
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
|
|
|
|
|
|
|
|
class="p-38rpx pr-17rpx rounded-15rpx bg-#fff between text-24rpx line-height-[1] mb-15rpx"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
|
|
|
<text class="text-#050505">积分抵扣</text>
|
|
|
|
|
|
|
|
<text class="text-#828383">(共50个)</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="ml-auto mr-20rpx">
|
|
|
|
|
|
|
|
<text class="text-#FB4F1A">-¥50.00</text>
|
|
|
|
|
|
|
|
<text class="text-#070707 ml-50rpx">去选择</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<uni-icons type="right" size="12"></uni-icons>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view
|
|
|
|
|
|
|
|
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
|
|
|
|
|
|
|
|
class="p-38rpx pr-17rpx rounded-15rpx bg-#fff between text-24rpx line-height-[1] mb-15rpx"
|
|
|
|
|
|
|
|
@click="toRouter('/pages/main/coupon/coupon')"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
|
|
|
<text class="text-#050505">优惠券</text>
|
|
|
|
|
|
|
|
<!-- <text class="text-#828383">(共50个)</text> -->
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="ml-auto mr-20rpx">
|
|
|
|
|
|
|
|
<text class="text-#FB4F1A">-¥50.00</text>
|
|
|
|
|
|
|
|
<!-- <text class="text-#070707 ml-50rpx">去选择</text> -->
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<uni-icons type="right" size="12"></uni-icons>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view
|
|
|
|
|
|
|
|
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
|
|
|
|
|
|
|
|
class="p-38rpx pr-17rpx rounded-15rpx bg-#fff between text-24rpx line-height-[1] mb-15rpx"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
|
|
|
<text class="text-#050505">预存款</text>
|
|
|
|
|
|
|
|
<!-- <text class="text-#828383">(共50个)</text> -->
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="ml-auto mr-20rpx">
|
|
|
|
|
|
|
|
<text class="text-#FB4F1A">-¥50.00</text>
|
|
|
|
|
|
|
|
<!-- <text class="text-#070707 ml-50rpx">去选择</text> -->
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<uni-icons type="right" size="12"></uni-icons>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="text-#FB4F1A text-20rpx mb-30rpx">
|
|
|
|
|
|
|
|
<view class="flex items-center mt-20rpx">
|
|
|
|
|
|
|
|
<uni-icons
|
|
|
|
|
|
|
|
type="info-filled"
|
|
|
|
|
|
|
|
class="rotate-180"
|
|
|
|
|
|
|
|
color="#FB4F1A"
|
|
|
|
|
|
|
|
size="22"
|
|
|
|
|
|
|
|
></uni-icons>
|
|
|
|
|
|
|
|
<text>选择“预约人”和“体检时间”后,请点击提交按钮,完成预约。</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="flex items-center mt-30rpx">
|
|
|
|
|
|
|
|
<uni-icons
|
|
|
|
|
|
|
|
type="info-filled"
|
|
|
|
|
|
|
|
class="rotate-180"
|
|
|
|
|
|
|
|
color="#FB4F1A"
|
|
|
|
|
|
|
|
size="22"
|
|
|
|
|
|
|
|
></uni-icons>
|
|
|
|
|
|
|
|
<text
|
|
|
|
|
|
|
|
>购买后如需退款,未到预约体检日期者可在“我的订单”中点击申请退款,体检当日取消或逾期未检者须至体检中心服务台办理
|
|
|
|
|
|
|
|
</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
|
|
|
|
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
|
|
|
|
class="px-16rpx rounded-15rpx bg-#fff"
|
|
|
|
class="px-16rpx rounded-15rpx bg-#fff"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
class="pt-42rpx pb-36rpx b-0 b-solid b-b-1 b-#E1ECEE"
|
|
|
|
class="pt-42rpx pb-36rpx b-0 b-solid b-b-1 b-#E1ECEE"
|
|
|
|
v-if="(comboInfo && comboInfo?.items?.length) || groupInfo?.items?.length"
|
|
|
|
v-if="
|
|
|
|
|
|
|
|
(comboInfo && comboInfo?.items?.length) || groupInfo?.items?.length
|
|
|
|
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<view class="text-#0E0E0E text-30rpx mb-35rpx">套餐名称</view>
|
|
|
|
<view class="text-#0E0E0E text-30rpx mb-35rpx">套餐名称</view>
|
|
|
|
<view class="text-24rpx between">
|
|
|
|
<view class="text-24rpx between">
|
|
|
|
<text class="text-#0E0E0E">{{ comboInfo?.combo_name || groupInfo?.combo_name }}</text>
|
|
|
|
<text class="text-#0E0E0E">{{
|
|
|
|
<text>¥{{ comboInfo?.price || groupInfo?.sixi_zong_ji_jin_e }}</text>
|
|
|
|
comboInfo?.combo_name || groupInfo?.combo_name
|
|
|
|
|
|
|
|
}}</text>
|
|
|
|
|
|
|
|
<text
|
|
|
|
|
|
|
|
>¥{{ comboInfo?.price || groupInfo?.sixi_zong_ji_jin_e }}</text
|
|
|
|
|
|
|
|
>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|