main
yanzai 10 months ago
parent d0e67bc0a7
commit 8276fe00d1

@ -86,6 +86,8 @@ class ApiMapController extends Controller
'SendMsgCode' => $base_url . '/api/H5/SendMsgCode', // 发送验证码
'CheckMsgCode' => $base_url . '/api/H5/CheckMsgCode', // 验证验证码
'CheckEnableNmrTime' => $base_url . '/api/H5/CheckEnableNmrTime', // 查询是否有可用核磁号源
'BaseInfo' => $base_url . '/api/H5/BaseInfo', // 基础信息
'CreateNewOrder' => $base_url . '/api/H5/CreateNewOrder', // 创建订单(新)
];
}

@ -11,7 +11,16 @@ class CheckUpTypeController extends Controller
//H5获取体检类型名称和logo
public function GetList()
{
$list=DB::table('checkup_type')->where(['status'=>1,'is_del'=>0])->get();
$ids = [7,1,4];
$sortedIds = implode(',', array_map('intval', $ids));
$list=DB::table('checkup_type')->where(['status'=>1,'is_del'=>0])
->orderByRaw("FIELD(id, {$sortedIds})")
->get();
foreach($list as $k=>$v){
if($v->name=='健康体检'){
$v->name='预约体检';
}
}
return \Yz::Return(true,"查询完成",['list'=>$list]);
}
}

@ -18,6 +18,31 @@ class HomeController extends Controller
'version' => $version
]);
}
//获取基础信息
public function BaseInfo(){
$openid = request('openid');
$hospital_id = request('hospital_id');
$user = DB::table('web_users')->where(['openid' => $openid, 'is_del' => 0])->first();
if (!$user) return \Yz::echoError1("openid对应用户不存在");
$person = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0, 'is_default' => 1])->first();
if (!$person) return \Yz::echoError1("请选择就诊人");
$personCount = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->count();
$hospital=DB::table('hospitals')->where(['id' => $hospital_id])->first();
if (!$hospital) {
return \Yz::echoError1("医院不存在");
}
$info =[
'person' => [
'name' => $person->name,
'sex' => $person->sex,
'count' => $personCount
],
'hospital' => [
'name' => $hospital->name,
]
] ;
return \Yz::Return(true, '获取成功', $info);
}
// 获取配置更新时间
public function config()

@ -20,15 +20,25 @@ class OrderController extends Controller
{
// status 1-待支付 2-已预约 3-交易关闭 4-已完成 5-已退款
$openid = $request->post('openid');
$searchInfo = $request->post('searchInfo');
$user = DB::table('web_users')->where(['openid' => $openid, 'is_del' => 0])->first();
if (!$user) return \Yz::echoError1("openid对应用户不存在");
$persons_sfz = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->pluck('id_number')->toArray();
$where=['web_user_id' => $user->id];
if(isset($searchInfo['status'])){
$where['status'] = $searchInfo['status'];
}
$OrderList = DB::table('orders')
$OrderList = DB::table('orders');
$OrderList=$OrderList
->select('id', 'title','buy_info', 'checkup_type_id','hunjian_status','status', 'name','appointment_date as date', 'appointment_time as time', 'order_number as order','appointment_number',
DB::raw("CASE WHEN type = 1 THEN '个检' WHEN type = 2 THEN '团检' ELSE 'unknown' END as type"),
'price', 'true_price', 'pay_time', 'refund_time', 'created_at')
->where(['web_user_id' => $user->id])
'price', 'true_price', 'pay_time', 'refund_time', 'created_at');
if(isset($searchInfo['dateRange'])){
$OrderList=$OrderList->whereBetween('appointment_date', [$searchInfo['dateRange'][0], $searchInfo['dateRange'][1]]);
}
$OrderList=$OrderList
->where($where)
->orWhere(function ($query) use ($persons_sfz) {
$query->WhereIn('id_number', $persons_sfz)
->where('person_id', 0);

@ -0,0 +1,408 @@
<?php
namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\API\AspNetZhuanController;
use App\Http\Controllers\API\PEISApiController;
use App\Http\Controllers\Controller;
use App\Lib\Tools;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class OrderNewController extends Controller
{
public function CreateNewOrder()
{
$hospital_id = request('hospital');
$openid = request('openid');
$person_id = request('person_id');
$combo_id = request('combo_id');
$type = request('type');//1个检2团检
$group_id = request('group_id');//团检id
$item_ids = request('item_ids');//自选item的ids
$peiou_info = request('peiou_info');//配偶信息
if (count($item_ids) != 0 and $item_ids[0] == "") {
$item_ids = [];
}
$duo_xuan_yi = request('duo_xuan_yi'); //多选1
$plan_nmr_info = request('plan_nmr_info');//核磁号源信息
$doctor = request('doctor');//预约的医生名字
$coupon_id = request('coupon_id');//优惠券
$jifen = request('jifen', 0); //使用的积分数量
$yucunkuan = request('yucunkuan', 0);//使用的预存款数量
$erxian_info = request('erxian_info');//使用的预存款数量
$wj_flag = request('wj'); //问卷标记
if (isset($wj_flag) and $wj_flag == 1) {
$wj_zhekou = config('app.globals.Wj_ZheKou');//问卷过来的折扣率
}
if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空');
if ($hospital_id == 1) {
$yyid = 6;
}
if ($hospital_id == 4) {
$yyid = 2;
}
if (!isset($openid)) return \Yz::echoError1('openid不能为空');
if (!isset($person_id)) return \Yz::echoError1('person_id不能为空');
if (!isset($type)) return \Yz::echoError1('type体检类型不能为空');
if ($type != 1 && $type != 2) {
return \Yz::echoError1('type参数体检类型错误');
}
if ($type == 2 and !isset($group_id)) return \Yz::echoError1('团检group_id不能为空');
if ($type == 1 and isset($group_id)) return \Yz::echoError1('体检类型:个检 与group_id冲突');
$user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
if (!$user) return \Yz::echoError1('用户不存在');
$person = DB::table('web_user_person')->where(['id' => $person_id, 'is_del' => 0])->first();
if (!$person) return \Yz::echoError1('体检人不存在');
$title = "自选项目";
$price = 0;
$quanInfo = false;
$true_price = 0;//订单真实支付金额
$buy_info = [
'combo' => [
'id' => 0,
'name' => $title,
'price' => 0,
],
'items' => [],
'group' => [
'id' => '',
],
'nmr_list' => [],
'peiou_info' => [],
];
if (!empty($peiou_info)) {
$buy_info['peiou_info'] = $peiou_info;
}
//如果是套餐
$Nx1_arrInfo = [];
$TJ_Leixing_id = 1;//存储用体检类型
$checkup_type_id = false; //体检类型id
if (isset($combo_id) and $combo_id <> 0) {
$combo_info = DB::table('combos')->where(['combo_id' => $combo_id, 'status' => 1])->first();
if (!$combo_info) return \Yz::echoError1("套餐不存在");
if (!isset($combo_info->checkup_type_id)) return \Yz::echoError1("套餐未关联体检类型");
$checkup_type_id = $combo_info->checkup_type_id;
//构建多选一数据
if (isset($duo_xuan_yi) and !empty($duo_xuan_yi)) {
$combo_Nx1 = json_decode($combo_info->duo_xuan_yi, true);
foreach ($duo_xuan_yi as $r_k => $r_v) {
foreach ($combo_Nx1 as $k => $n1v) {
if ($r_v['zu_name'] == $n1v['组名称']) {
foreach ($n1v['包含项目'] as $k2 => $v2) {
if ($v2['Id'] == $r_v['item_id']) {
if ($v2['科室名称'] == '影像科') {
$buy_info['nmr_list'][] = [
'item_id' => $v2['Id'],
'name' => $v2['名称'],
];
}
$Nx1_arrInfo[] = [
'id' => $v2['Id'],
'name' => $v2['名称'],
'price' => 0
];
}
}
}
}
}
}
$TJ_Leixing_id = $checkup_type_id;
$price += $combo_info->price;
$title = $combo_info->name;
$buy_info['combo'] = [
'id' => $combo_info->combo_id,
'name' => $combo_info->name,
'price' => $combo_info->price,
];
//如果有影像科则存储在nmr_list字段
$comboItem = DB::table('combo_items')->where(['combo_id' => $combo_id, 'status' => 1, 'keshi_name' => '影像科'])->get();
if (count($comboItem) > 0) {
foreach ($comboItem as $item) {
$buy_info['nmr_list'][] = [
'item_id' => $item->item_id,
'name' => $item->name,
];
}
}
}
//如果有自选项目
$items_list = [];
if (count($item_ids) != 0) {
$items_list = DB::table('items')->whereIn('item_id', $item_ids)->where(['status' => 1])->get();
$existingIds = [];
$item_price = 0;
foreach ($items_list as $item) {
$item_price += $item->price;
$existingIds[] = $item->item_id;
$buy_info['items'][] = [
'id' => $item->item_id,
'name' => $item->name,
'price' => $item->price
];
//如果有影像科则存储在nmr_list字段
if ($item->keshi_name == '影像科') {
$buy_info['nmr_list'][] = [
'item_id' => $item->item_id,
'name' => $item->name,
];
}
}
if (isset($wj_flag) and $wj_flag == 1) {
$item_price = $item_price * $wj_zhekou;
}
$price += $item_price;
$missingIds = array_diff($item_ids, $existingIds);
if (count($missingIds) > 0) return \Yz::echoError1("部分自选项目不可用Id:" . implode(', ', $missingIds));
}
//如果有 多选一项目
if (!empty($Nx1_arrInfo)) {
$buy_info['items'] = array_merge($buy_info['items'], $Nx1_arrInfo);
}
$true_price = $price;
//如果是团检
$group_info = false;
if ($type == 2) {
$P = new PersonController();
$data = [
'电话号码' => null,
'证件号码' => null,
'预约Id' => $group_id
];
$group_info = $P->group_info($hospital_id, $data);
$group_info = $group_info[0];
//如果有多选一项目
//构建多选一数据
$Nx1_arrInfo = [];
if (isset($duo_xuan_yi) and !empty($duo_xuan_yi)) {
foreach ($duo_xuan_yi as $r_k => $r_v) {
$Nx1_arrInfo[] = [
'id' => $r_v['item_id'],
'name' => $r_v['item_name'],
];
}
}
$group_info['items'] = array_merge($group_info['items'], $Nx1_arrInfo); //合并多选一
$buy_info['group'] = [
'id' => $group_id,
'combo_name' => $group_info['combo_name'],
'combo_id' => $group_info['combo_id'],
'group_name' => $group_info['group_name'],
'items' => $group_info['items'],
'group_id' => $group_info['group_id'],
'have_Nx1' => !empty($Nx1_arrInfo)
];
$TJ_Leixing_id = $group_info['checkup_type_id'];
$title = "单位团检" . $group_info['combo_name'];
$price = $price + $group_info['sixi_zong_ji_jin_e'];
$need_pay = ($price - $group_info['tongshou_xiane']) > 0 ? $price - $group_info['tongshou_xiane'] : 0;
//团检订单金额为减去统收后的金的
$price = $need_pay;
$true_price = $need_pay;
//如果有影像科则存储在nmr_list字段
$all_items = DB::table('items')->where(['status' => 1, 'keshi_name' => '影像科'])->get();
foreach ($group_info['items'] as $item) {
foreach ($all_items as $it) {
if ($it->item_id == $item['id']) {
$buy_info['nmr_list'][] = [
'item_id' => $it->item_id,
'name' => $it->name,
];
}
}
}
}
//调用思信接口判断各个项目是否可用
$check_items = [];
foreach ($item_ids as $item_id) {
$check_items[] = ['Id' => $item_id];
}
if ((isset($combo_id) and $combo_id <> 0) || count($check_items) != 0) {
$item_check = self::item_check($hospital_id, [
'人员信息列表' => [[
"序号" => 0,
"性别" => $person->sex == 1 ? '男' : '女',
"年龄" => floor((time() - strtotime($person->birthday)) / 86400 / 360),
"婚姻状态" => $person->married == 1 ? '已婚' : '未婚',
]],
'套餐Id' => $combo_id == 0 ? null : $combo_id,
'可选项目信息' => $check_items,
]);
if (count($item_check['data']) != 1) {
return \Yz::echoError1("体检系统提示:" . $item_check['message']);
}
}
$plan_nmr_appointment_info = [];
//校验积分和预存款
$env = config('app.globals.Env');
$AspNet = new AspNetZhuanController();
if ($env == 'pro') { //如果是正式环境, 测试环境不抵扣
if ($jifen > 0) {
$all_jifen = $AspNet::GetJiFen_YuCunKuan(1, $person->ghzid);
if ($jifen > $all_jifen) return \Yz::echoError1("用户剩余积分不足");
}
if ($yucunkuan > 0) {
// return \Yz::echoError1("暂不支持预存款");
$all_yucunkuan = $AspNet::GetJiFen_YuCunKuan(2, $person->ghzid);
if ($yucunkuan > $all_yucunkuan) return \Yz::echoError1("用户剩余预存款不足");
}
$true_price = $true_price - ($jifen + $yucunkuan);
if ($true_price < -1) return \Yz::echoError1("");
if ($true_price < 0) $true_price = 0;
//如果有二线号源,根据体检时间查询二线可用号源区分上下午二线需预约体检时间1小时后
$plan_nmr_info = [];
if (isset($erxian_info) and !empty($erxian_info)) {
foreach ($erxian_info as $erxian_item) {
$temp_date = [
"item_id" => $erxian_item['item_id'],
"name" => $erxian_item['name'],
"price" => $erxian_item['price'],
];
$plan_nmr_info[] = $temp_date;
}
}
//使用优惠券
if (isset($coupon_id) and !empty($coupon_id)) {
if ($true_price == 0) return \Yz::echoError1("金额为0无需使用优惠券");
$use_quan = $this->useYouHuiQuan($true_price, $person, $coupon_id);
$quanInfo = $use_quan['quanInfo'];
$true_price = $use_quan['price'];
}
$now_datetime = date('Y-m-d H:i:s');
//构建订单号
$order_num = $this->generateOrderNumber();
$data = [
'title' => $title,
'type' => $type,
'web_user_id' => $user->id,
'checkup_type_id' => $TJ_Leixing_id,
'person_id' => $person->id,
'name' => $person->name,
'id_number' => $person->id_number,
'buy_info' => json_encode($buy_info, JSON_UNESCAPED_UNICODE),
'price' => $price,
'true_price' => number_format($true_price, 2, '.', ''),
'jifen' => $jifen,
'yucunkuan' => $yucunkuan,
'order_number' => $order_num,
'status' => 99, //先标记为异常,方法最底部更新为正常状态
'erxian_appointment_info' => json_encode($plan_nmr_info, JSON_UNESCAPED_UNICODE),
'combo_id' => $combo_id,
'hospital_id' => $hospital_id,
'doctor' => $doctor,
'phone' => $person->phone,
'sex' => $person->sex,
'birthday' => $person->birthday,
'married' => $person->married,
'wj_flag' => $wj_flag,
'youhuiquan' => $quanInfo === false ? '' : json_encode(['id' => $quanInfo['DZJID'], 'name' => $quanInfo['DZJLBMC']], JSON_UNESCAPED_UNICODE),
'created_at' => $now_datetime,
'paycheck_time' => $now_datetime
];
$insert = DB::table('orders')->insertGetId($data);
//调用接口扣除积分和预存款、优惠券
$jifen_dikou_status = true;
$yucunkuan_dikou_status = true;
$youhuiquan_dikou_status = true;
if ($env == 'pro') { //如果是正式环境
$nowDateTime = date('Y-m-d H:i:s');
if ($jifen > 0) {
$jifen_dikou_status = false;
$jifen_dikou_status = $AspNet::UseJiFen($person->ghzid, -$jifen, $yyid, $insert, 'tj_h5', '抵扣体检H5订单', $now_datetime);
}
if ($yucunkuan > 0) {
$yucunkuan_dikou_status = false;
$yucunkuan_dikou_status = $AspNet::UseYuCunKuan($person->ghzid, -$yucunkuan, $yyid, 0, $insert, 'tj_h5', '抵扣体检H5订单', $now_datetime);
}
//核销优惠券
if (isset($coupon_id) and !empty($coupon_id)) {
$youhuiquan_dikou_status = false;
$data = [
'action' => 3,
'ghzid' => $person->ghzid,
'dzjid' => $coupon_id,
'hxbz' => "抵扣体检H5订单",
'yyid' => $yyid
];
$youhuiquan_dikou_status = $AspNet::YouHuiQuan($data);
}
}
if ($insert and $jifen_dikou_status and $yucunkuan_dikou_status and $youhuiquan_dikou_status) {
//中途未报错,更新订单为待支付
DB::table('orders')->where('id', $insert)->update([
'status' => 1 //标记为待支付
]);
$action = false;
if ($true_price == 0) {
DB::table('orders')->where('id', $insert)->update([
'status' => 2 //标记为已支付
]);
}
if ($true_price > 0) {
//如果大于0则提示前端去支付
$action = "pay";
}
return \Yz::return(true, "操作成功", ['action' => $action, 'orderid' => $insert]);
} else {
return \Yz::echoError1('操作失败');
}
}
}
public function item_check($hospital, $data)
{
$peis = new PEISApiController();
$check = $peis::Post('套餐项目检查', $hospital, $data);
return $check;
}
public function generateOrderNumber()
{
// 获取当前时间的时间戳(精确到毫秒)
$timestamp = round(microtime(true) * 1000);
// 生成一个随机数(可以根据需要调整长度)
$randomPart = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 6);
// 拼接时间戳和随机部分
$orderNumber = date("YmdHis", $timestamp / 1000) . substr($timestamp % 1000, -3) . $randomPart;
return $orderNumber;
}
}

@ -77,6 +77,8 @@ Route::group(['middleware' => ['log'],'prefix' => 'api/H5'], function () {
Route::post('/SendMsgCode', 'App\Http\Controllers\API\SendMsgCodeController@SendMsgCode');//发送验证码
Route::post('/CheckMsgCode', 'App\Http\Controllers\API\SendMsgCodeController@CheckMsgCode');//验证验证码
Route::post('/CheckEnableNmrTime', 'App\Http\Controllers\API\H5\NMRController@CheckEnableNmrTime');//查询是否有可用核磁号源
Route::post('/BaseInfo', 'App\Http\Controllers\API\H5\HomeController@BaseInfo');//基础信息
Route::post('/CreateNewOrder', 'App\Http\Controllers\API\H5\OrderNewController@CreateNewOrder');//创建新订单

@ -0,0 +1,158 @@
<template>
<view>
<view class="header_wrapper" v-if="info">
<view v-if="1" class="hospital_wrapper">
<view class="hospital_icon_wrapper">
<image src="@/static/assets/dingwei@2x.png"></image>
</view>
<view class="hospital_name_wrapper">{{info.hospital.name}}</view>
<!-- <view class="hospital_select_wrapper">
<image src="@/static/assets/gengduo@2x.png"></image>
</view> -->
</view>
<view v-if="1" class="user_wrapper" @click="tabPatients()">
<view class="user_title_wrapper">体检人</view>
<view class="user_name_wrapper">{{info.person.name}}</view>
<view v-if="info.person.count>1" class="user_choose_wrapper">
<image src="@/static/assets/qiehuan@2x.png"></image>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
computed,
nextTick
} from "vue";
import {
$image,
$api,
$response
} from "@/api";
import {
onShow,
onLoad
} from "@dcloudio/uni-app";
let info=ref(null);
const getBaseInfo = async () => {
uni.showLoading()
const response = await $api('BaseInfo',{
hospital_id:1
})
uni.hideLoading()
$response(response, () => {
info.value=response.data
})
}
const tabPatients = () => {
uni.navigateTo({
url: "/pages/user/choose/choose",
});
};
onShow(() => {
getBaseInfo()
});
</script>
<style scoped>
.user_choose_wrapper {
width: 50rpx;
height: 50rpx;
margin-left: 30rpx;
}
.user_choose_wrapper image {
width: 50rpx;
height: 50rpx;
display: block;
object-fit: contain;
}
.user_title_wrapper {
font-weight: 400;
font-size: 26rpx;
color: #fff;
line-height: 1;
}
.user_name_wrapper {
font-weight: 400;
font-size: 26rpx;
color: #fff;
line-height: 1;
}
.user_wrapper {
height: 60rpx;
padding-left: 40rpx;
padding-right: 20rpx;
margin-right: 20rpx;
background: #009ea7;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.header_wrapper {
display: flex;
align-items: center;
justify-content: space-between;
width: 710rpx;
height: 90rpx;
background: #d8edf2;
margin: 0 auto;
position: relative;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 20rpx;
}
.hospital_wrapper {
display: flex;
align-items: center;
width: 40%;
}
.hospital_icon_wrapper {
width: 48rpx;
height: 48rpx;
margin-left: 20rpx;
}
.hospital_icon_wrapper image {
width: 48rpx;
height: 48rpx;
display: block;
object-fit: contain;
}
.hospital_name_wrapper {
font-weight: 400;
font-size: 28rpx;
color: #484747;
margin-left: 9rpx;
line-height: 1;
}
.hospital_select_wrapper {
width: 24rpx;
height: 14rpx;
margin-left: 19rpx;
}
.hospital_select_wrapper image {
width: 24rpx;
height: 14rpx;
display: block;
object-fit: contain;
}
</style>

@ -1,6 +1,7 @@
const app_type = 'gzh'
//const base_url = "https://api.hainan2024.sa0.online" //开发环境
const base_url="https://tj-h5.hnxdfe.com" //正式环境
//const base_url="https://tj-h5.hnxdfe.com" //正式环境
const base_url="http://124.225.137.54:39081" //测试环境
const config = {
api_map_url: base_url + '/api/ApiMap/h5',
base_assets_url: base_url,

@ -57,6 +57,17 @@
},
"vueVersion" : "3",
"h5" : {
"devServer": {
"proxy": {
"/api": {
"target": "http://124.225.137.54:39081",
"changeOrigin": true,
"pathRewrite": {
"^/api": ""
}
}
}
},
"router" : {
"base" : "/h5/"
},

@ -14,14 +14,6 @@
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/main/combo/combo_new",
"style": {
"navigationBarTitleText": "套餐",
"navigationBarBackgroundColor": "#239EA3",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/main/combo/tcdb",
"style": {
@ -75,16 +67,8 @@
"style": {
"navigationBarTitleText": "套餐详情"
}
},
{
"path": "pages/main/tj/tjzx",
"style": {
"navigationBarTitleText": "体检套餐加项",
"navigationBarBackgroundColor": "#D8EDF2",
"navigationBarTextStyle": "black"
}
},{
"path": "pages/main/tj/tjzx_new",
"path": "pages/main/tj/tjzx",
"style": {
"navigationBarTitleText": "体检套餐加项",
"navigationBarBackgroundColor": "#D8EDF2",
@ -115,13 +99,6 @@
"navigationBarBackgroundColor": "#239EA3",
"navigationBarTextStyle": "white"
}
},{
"path": "pages/main/tj/tjxq_new",
"style": {
"navigationBarTitleText": "套餐详情",
"navigationBarBackgroundColor": "#239EA3",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/main/questionnaire/index",
@ -211,11 +188,6 @@
"style": {
"navigationBarTitleText": "体检预约"
}
},{
"path": "pages/main/tjyy/tjyy_new",
"style": {
"navigationBarTitleText": "体检预约"
}
},
{
"path": "pages/user/pick/pick",
@ -322,6 +294,14 @@
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/main/order/order_new",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}
],

@ -103,7 +103,7 @@
</script>
<template>
<DraggableButton />
<view>
<view class="choose_main">
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
@ -113,7 +113,7 @@
<view class="button_icon_wrapper">
<image :src="$image(i.logo)"></image>
</view>
<view class="button_name_wrapper">{{ i.name }}</view>
<view :class="['button_name_wrapper',{'active':i.id==1}]">{{ i.name }}</view>
<view class="button_right_wrapper">
<uni-icons type="right" size="20"></uni-icons>
</view>
@ -122,6 +122,10 @@
</view>
</template>
<style scoped>
.choose_main{
background-color: #E0F1F5;
min-height: calc(100vh - 80rpx);
}
.button_list_wrapper {
width: 750rpx;
margin: 0 auto;
@ -139,7 +143,9 @@
align-items: center;
justify-content: space-between;
}
.active{
color:#008F96 !important;
}
.button_icon_wrapper {
width: 82rpx;
height: 82rpx;

File diff suppressed because it is too large Load Diff

@ -1,14 +1,28 @@
<script setup>
import DraggableButton from "@/pages/components/goHome.vue";
import PriceRange from "@/common/PriceRange.vue";
/**
* name
* usersa0ChunLuyu
* date2024年8月7日 20:05:05
*/
import { ref, computed, nextTick } from "vue";
import { $image, $api, $response } from "@/api";
import { onShow,onLoad } from "@dcloudio/uni-app";
import { useStore } from "@/store";
import {
ref,
computed,
nextTick
} from "vue";
import {
$image,
$api,
$response
} from "@/api";
import {
onShow,
onLoad
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
const $store = useStore();
const $props = defineProps({
@ -20,10 +34,14 @@ const $props = defineProps({
const combo_active = ref("");
const person_active = ref("");
let tabs_active_id=ref(false); //tabsid
let popup = ref(null);
let popup_new = ref(null);
let selectKey = ref(""); // key
let sortIndex = ref(0); //
let comboIndex = ref(null); //
let sort_price_index=ref(null)
let sort_salecount_index=ref(null)
let crowdIndex = ref(null); //
let priceIndex = ref(null); //
let projectIds = ref([]); // id
@ -36,6 +54,10 @@ let multipleIndex = ref(0); // 多选索引
let itemIds = ref([]); // id
let itemId = ref(""); // id
let comboId = ref(""); // id
let price_max_min=ref([]);
let zhuangjianType=ref(18);
let TiShiPopupRef=ref(null);//
let SelectedComboInfo=ref(null);//
const selectItemClick = async (index, key) => {
//
@ -48,21 +70,29 @@ const selectItemClick = async (index, key) => {
sortIndex.value = index;
}
screenObj.value.combo_sort = data[selectKey.value][index]?.id;
} else if (selectKey.value == "combo_type") {
if (comboIndex.value == index) {
comboIndex.value = null;
delete screenObj.value.combo_type;
} else if (selectKey.value == "sort_sale_count") {
//
sortIndex.value = 0;
delete screenObj.value.combo_sort;
if (sort_salecount_index.value == index) {
sort_salecount_index.value = null;
delete screenObj.value.sort_sale_count;
} else {
comboIndex.value = index;
screenObj.value.combo_type = data[selectKey.value][index]?.id;
sort_salecount_index.value = index;
screenObj.value.sort_sale_count = data[selectKey.value][index]?.id;
}
} else if (selectKey.value == "combo_crowd") {
if (crowdIndex.value == index) {
crowdIndex.value = null;
delete screenObj.value.combo_crowd;
} else if (selectKey.value == "sort_price") {
//
sortIndex.value = 0;
delete screenObj.value.combo_sort;
if (sort_price_index.value == index) {
sort_price_index.value = null;
delete screenObj.value.sort_price;
} else {
crowdIndex.value = index;
screenObj.value.combo_crowd = data[selectKey.value][index]?.id;
sort_price_index.value = index;
screenObj.value.sort_price = data[selectKey.value][index]?.id;
}
} else {
if (key == "combo_price") {
@ -96,15 +126,21 @@ const selectDone = async () => {
delete screenObj.value.combo_item;
}
await getComboList();
select_drawer_ref.value.close();
popup_new.value.close();
};
const remake = () => {
//
delete screenObj.value.combo_price;
delete screenObj.value.combo_item;
delete screenObj.value.price_range
delete screenObj.value.combo_crowd
delete screenObj.value.combo_type
price_max_min.value=[0,combo_list.value.price_max];
priceIndex.value = null;
projectIds.value = [];
comboIndex.value=null
crowdIndex.value=null
};
const getComboSelect = async () => {
uni.showLoading();
@ -112,6 +148,8 @@ const getComboSelect = async () => {
uni.hideLoading();
$response(response, async () => {
combo_select.value = response.data;
combo_select.value.sort_sale_count=[{id:1,name:"销量从低到高"},{id:2,name:"销量从高到低"}]
combo_select.value.sort_price=[{id:1,name:"价格从低到高"},{id:2,name:"价格从高到低"}]
if ("sort_list" in combo_select.value) {
selectKey.value = "sort_list";
sortIndex.value = 0;
@ -184,10 +222,8 @@ const getComboList = async (e) => {
const response = await $api("ComboList", obj);
uni.hideLoading();
$response(response, () => {
combo_list.value = response.data;
price_max_min.value=combo_list.value.price_max_min
});
};
@ -232,6 +268,7 @@ const open = (key) => {
//
selectKey.value = key;
popup.value.close();
popup_new.value.close();
let time = setTimeout(() => {
popup.value.open("top");
clearTimeout(time);
@ -239,22 +276,28 @@ const open = (key) => {
} else {
//
popup.value.close();
popup_new.value.close();
selectKey.value = "screen";
select_drawer_ref.value.open();
if (screenObj.value.combo_price) {
priceIndex.value = combo_select.value["combo_price"].findIndex(
(item) => item.id == screenObj.value.combo_price
);
} else {
priceIndex.value = null;
}
let time = setTimeout(() => {
if (screenObj.value.combo_item?.length) {
projectIds.value = [...screenObj.value.combo_item];
} else {
projectIds.value = [];
}
popup_new.value.open("top");
clearTimeout(time);
}, 400);
// if (screenObj.value.combo_price) {
// priceIndex.value = combo_select.value["combo_price"].findIndex(
// (item) => item.id == screenObj.value.combo_price
// );
// } else {
// priceIndex.value = null;
// }
// if (screenObj.value.combo_item?.length) {
// projectIds.value = [...screenObj.value.combo_item];
// } else {
// projectIds.value = [];
// }
}
};
@ -268,10 +311,7 @@ const configRef = (e) => {
}
};
const select_drawer_ref = ref(null);
const selectDrawerRef = (e) => {
select_drawer_ref.value = e;
};
onShow(() => {
$store.setDuoXuanYi({});
@ -286,6 +326,7 @@ onLoad((e)=>{
})
const buyClick = async (item) => {
SelectedComboInfo.value=item
let checkup_type_id = $store.getCheckupTypeId();
console.log("----", checkup_type_id.id);
if (checkup_type_id.id == "" || checkup_type_id.id == undefined) {
@ -303,6 +344,10 @@ const buyClick = async (item) => {
multipleList.value = item.duo_xuan_yi;
return;
}
if(item.type_id==zhuangjianType.value){
TiShiPopupRef.value.open();
return
}
toDetail();
};
@ -351,25 +396,62 @@ const toRouter = () => {
url: "/pages/main/combo/tcdb",
});
};
const ComboTypeClickFunc=(id)=>{
if(comboIndex.value==id){
comboIndex.value=null
delete screenObj.value.combo_type
}else{
comboIndex.value=id
screenObj.value.combo_type=comboIndex.value
}
}
const ComboCrowdClickFunc=(id)=>{
if(crowdIndex.value==id){
crowdIndex.value=null
delete screenObj.value.combo_crowd
}else{
crowdIndex.value=id
screenObj.value.combo_crowd=crowdIndex.value
}
}
const CheckItemClickFunc=(id)=>{
if (projectIds.value?.includes(id)) {
projectIds.value.splice(projectIds.value.indexOf(id), 1);
} else {
projectIds.value.push(id);
}
}
const getHuaKuaiValue=(value)=>{
screenObj.value.price_range=value
price_max_min.value=value
console.log(price_max_min.value);
}
const tabsClickFunc=(value)=>{
tabs_active_id.value=value
if(value==1){
comboIndex.value=zhuangjianType.value //
screenObj.value.combo_type=comboIndex.value
}else{
comboIndex.value=''
delete screenObj.value.combo_type
}
getComboList();
}
</script>
<template>
<DraggableButton />
<view>
<view style="background-color: #d8eef3; padding-top: 20rpx;">
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view class="header_wrapper">
<view
@click="toRouter"
class="center fixed pt-10rpx box-border left-40rpx bottom-5% rounded-full w-110rpx h-110rpx bg-#239EA3 flex-col"
>
<view @click="toRouter"
class="center fixed pt-10rpx box-border left-40rpx bottom-5% rounded-full w-110rpx h-110rpx bg-#239EA3 flex-col">
<uni-badge :text="comboIds.length" absolute="rightTop" size="small">
<image
src="@/static/assets/slices/duibi.png"
mode="widthFix"
class="w-42rpx"
/>
<image src="@/static/assets/slices/duibi.png" mode="widthFix" class="w-42rpx" />
</uni-badge>
<text class="text-22rpx text-#fff -mt-5rpx">对比</text>
</view>
@ -378,18 +460,12 @@ const toRouter = () => {
<view class="hospital_icon_wrapper">
<image src="@/static/assets/dingwei@2x.png"></image>
</view>
<view class="hospital_name_wrapper">{{
combo_list.hospital.name
}}</view>
<view class="hospital_select_wrapper">
<view class="hospital_name_wrapper">{{combo_list.hospital.name}}</view>
<!-- <view class="hospital_select_wrapper">
<image src="@/static/assets/gengduo@2x.png"></image>
</view> -->
</view>
</view>
<view
v-if="!!combo_list.info.name"
class="user_wrapper"
@click="tabPatients()"
>
<view v-if="!!combo_list.info.name" class="user_wrapper" @click="tabPatients()">
<view class="user_title_wrapper">体检人</view>
<view class="user_name_wrapper">{{ combo_list.info.name }}</view>
<view v-if="combo_list.info.count > 1" class="user_choose_wrapper">
@ -397,59 +473,39 @@ const toRouter = () => {
</view>
</view>
</view>
<!-- <view class="relative z-999 pt-10rpx center">
<view class="doctor_wrapper">
<view class="doctor_tip_wrapper">
<text v-if="!!combo_list.doctor.id"></text>
<text v-else></text>
</view>
<view class="doctor_name_wrapper">
{{ !!combo_list.doctor.id ? combo_list.doctor.name : "前往选择" }}
</view>
<view class="doctor_tip_wrapper">自动筛选匹配套餐</view>
<view class="bg-#d8edf2" style="margin-top: -10rpx;">
<uni-search-bar class="search" radius="100" placeholder="请输入关键字搜索" @clear="getComboList()"
@cancel="getComboList()" @confirm="getComboList" />
</view>
</view> -->
<view class="bg-#d8edf2">
<uni-search-bar
class="search"
radius="100"
placeholder="请输入关键字搜索"
@clear="getComboList()"
@cancel="getComboList()"
@confirm="getComboList"
/>
<view class="top_button_row">
<view @click="tabsClickFunc(0)" :class="['top_button',{'top_button_active':tabs_active_id==false}]">选择套餐</view>
<view @click="tabsClickFunc(1)" :class="['top_button',{'top_button_active':tabs_active_id==true}]">专家定制</view>
<view class="top_button">项目自选</view>
</view>
<view class="select_wrapper flex" v-if="selectKey">
<template v-for="(value, key, index) in combo_select" :key="index">
<view
@click="open(key)"
class="flex-1 center text-#2f2f2f text-26rpx line-height-[1]"
v-if="key != 'combo_price' && key != 'combo_item'"
:class="{
<view @click="open(key)" class="flex-1 center text-#2f2f2f text-26rpx line-height-[1]"
v-if="key != 'combo_price' && key != 'combo_item' && key != 'combo_type' && key != 'combo_crowd'" :class="{
'!text-#239EA3': selectKey == key,
}"
>
}">
<view v-if="key == 'sort_list'">
{{ value[sortIndex]?.name || "综合排序" }}
</view>
<view v-if="key == 'combo_type'">
{{ value[comboIndex]?.name || "套餐类型" }}
<view v-if="key == 'sort_sale_count'">
{{ value[sort_salecount_index]?.name || "按销量" }}
</view>
<view v-if="key == 'combo_crowd'">
{{ value[crowdIndex]?.name || "适用人群" }}
<view v-if="key == 'sort_price'">
{{ value[sort_price_index]?.name || "按价格" }}
</view>
<view class="select_item_icon_wrapper">
<image src="@/static/assets/xuanzegengduo@2x.png"></image>
</view>
</view>
</template>
<view
@click="open()"
:class="{
<view @click="open()" :class="{
'!text-#239EA3': selectKey == 'screen',
}"
class="mx-20rpx center text-#2f2f2f text-26rpx"
>
}" class="mx-20rpx center text-#2f2f2f text-26rpx">
<view>筛选</view>
<view class="select_item_icon2_wrapper">
<image src="@/static/assets/shaixuan@2x.png"></image>
@ -457,27 +513,20 @@ const toRouter = () => {
</view>
</view>
<view class="list_wrapper" ref="combo_list_k">
<view
class="combo_wrapper"
v-for="(i, k) in combo_list_computed"
:key="k"
>
<view class="combo_wrapper" v-for="(i, k) in combo_list_computed" :key="k">
<view style="display: flex;">
<view class="combo_info_wrapper">
<view class="combo_cover_wrapper">
<image v-if="i.cover" :src="$image(i.cover)"></image>
</view>
<view class="combo_content_wrapper">
<view class="combo_name_wrapper">{{ i.name }}</view>
<view style="display: flex;">
<view class="combo_name_wrapper">{{ i.name }}
</view>
<view v-if="i.is_hot">
<image style="height: 32rpx;width: 24rpx;" src="@/static/assets/buy/huomiao.jpg"></image>
</view>
</view>
<view class="combo_tags_wrapper">
<view
class="combo_tag_wrapper"
v-for="(ii, kk) in i.tag"
:key="kk"
:style="{
color: ii.text_color,
background: ii.color,
}"
>
<view class="combo_tag_wrapper" v-for="(ii, kk) in i.tag" :key="kk"
:style="{ color: ii.text_color, background: '#fff',}">
{{ ii.text }}
</view>
</view>
@ -488,192 +537,175 @@ const toRouter = () => {
<view class="combo_price_box_wrapper">
<view class="combo_true_price_wrapper">
<text class="combo_true_price_icon_wrapper">¥</text>
<text class="combo_true_price_number_wrapper">{{
i.price
}}</text>
<text class="combo_true_price_number_wrapper">{{ i.price }}</text>
</view>
<view class="combo_original_price_wrapper"
>¥{{ i.original_price }}</view
>
<view v-if="i.type_id!=zhuangjianType" class="combo_original_price_wrapper">¥{{ i.original_price }}</view>
<view v-if="i.type_id==zhuangjianType" class="combo_original_price_wrapper2"></view>
</view>
<!-- <view class="combo_count_wrapper">已售{{ i.count }}</view> -->
</view>
</view>
</view>
<view class="combo_button_wrapper">
<view @click="contrastClick(i)" class="combo_pick_button_wrapper">{{
comboIds.includes(i.combo_id) ? "已加入" : "对比"
}}</view>
<view class="combo_buy_button_wrapper" @click="buyClick(i)"
>预约</view
>
<view v-if="i.type_id!=zhuangjianType" @click="contrastClick(i)" class="combo_pick_button_wrapper">
{{comboIds.includes(i.combo_id) ? "已加入" : "对比"}}
</view>
<view class="combo_buy_button_wrapper" @click="buyClick(i)"></view>
</view>
</view>
<view class="combo_line_wrapper"></view>
</view>
</view>
<uni-popup ref="popupMultiple" class="w-full">
<view class="rounded-10rpx px-20rpx pb-55rpx box-border bg-#fff w-95vw">
<view
class="center relative pt-40rpx pb-30rpx text-36rpx rounded-t-15rpx box-border"
>
<view class="center relative pt-40rpx pb-30rpx text-36rpx rounded-t-15rpx box-border">
<text class="line-height-[1] text-32rpx">请选择</text>
<uni-icons
@click="popupMultiple.close()"
type="closeempty"
color="#A6A6A6"
size="26"
class="absolute right-40rpx"
></uni-icons>
<uni-icons @click="popupMultiple.close()" type="closeempty" color="#A6A6A6" size="26"
class="absolute right-40rpx"></uni-icons>
</view>
<view class="bg-#F8F8F8 px-20rpx box-border rounded-10rpx">
<view
v-for="(item, index) in multipleList[multipleIndex]['item_list']"
:key="index"
<view v-for="(item, index) in multipleList[multipleIndex]['item_list']" :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>
<view class="center">
<text class="text-#EC3D15 text-20rpx mt-10rpx mr-5rpx">¥</text>
<text class="text-#EC3D15 text-32rpx mb-0">{{ item.price }}</text>
<uni-icons
class="ml-28rpx"
color="#239EA3"
:type="itemId == item.item_id ? 'checkbox-filled' : 'circle'"
size="30"
></uni-icons>
<uni-icons class="ml-28rpx" color="#239EA3"
:type="itemId == item.item_id ? 'checkbox-filled' : 'circle'" size="30"></uni-icons>
</view>
</view>
</view>
<view class="text-#239EA3 text-28rpx my-45rpx text-center"
>当前套餐包含一个可自由{{
<view class="text-#239EA3 text-28rpx my-45rpx text-center">当前套餐包含一个可自由{{
multipleList[multipleIndex]["item_list"].length
}}选1的体检项目<br />根据您的实际情况自行选择</view
>
<view
class="w-270rpx h-80rpx bg-#239EA3 center text-#F8F8F8 text-30rpx rounded-10rpx mx-auto"
@click="nextItemClick()"
>{{
}}选1的体检项目<br />根据您的实际情况自行选择</view>
<view class="w-270rpx h-80rpx bg-#239EA3 center text-#F8F8F8 text-30rpx rounded-10rpx mx-auto"
@click="nextItemClick()">{{
multipleIndex == multipleList.length - 1 ? "确定" : "下一项"
}}</view
>
}}</view>
</view>
</uni-popup>
<uni-popup ref="popup" mask-background-color="transparent" :animation="false">
<view class="pt-292rpx w-full h-100vh" @click="popup.close()">
<view class="pt-330rpx w-full h-100vh" @click="popup.close()">
<view class="bg-[rgba(0,0,0,0.3)] h-100%">
<view
class="bg-#fff"
:class="
<view class="bg-#fff" :class="
selectKey != 'sort_list'
? 'flex pt20rpx px10rpx pb0 box-border flex-wrap'
: ''
"
>
<view
v-for="(val, index) in combo_select[selectKey]"
:key="index"
@click.stop="selectItemClick(index)"
:class="{
">
<view v-for="(val, index) in combo_select[selectKey]" :key="index"
@click.stop="selectItemClick(index)" :class="{
'min-w-23% mx-1% mb-20rpx': selectKey != 'sort_list',
}"
>
}">
<uni-list-item v-if="selectKey == 'sort_list'">
<template v-slot:body>
<text
class="text-26rpx"
:class="{
<text class="text-26rpx" :class="{
'!text-#239EA3': sortIndex == index,
}"
>{{ val.name }}</text
>
}">{{ val.name }}</text>
</template>
</uni-list-item>
<view
v-else
<view v-else
class="box-border px-28rpx py-20rpx text-26rpx center line-height-[1] rounded-5rpx"
:class="{
'!bg-#239EA3 !text-#fff':
(selectKey == 'combo_type' && comboIndex == index) ||
(selectKey == 'combo_crowd' && crowdIndex == index),
(selectKey == 'sort_sale_count' && sort_salecount_index == index) ||
(selectKey == 'sort_price' && sort_price_index == index),
'!text-#747474 !bg-#e0e0e0':
(selectKey == 'combo_type' && comboIndex != index) ||
(selectKey == 'combo_crowd' && crowdIndex != index),
}"
>{{ val.name }}</view
>
(selectKey == 'sort_sale_count' && sort_salecount_index != index) ||
(selectKey == 'sort_price' && sort_price_index != index),
}">{{ val.name }}</view>
</view>
</view>
</view>
</view>
</uni-popup>
<uni-drawer :ref="selectDrawerRef" mode="right">
<view>
<scroll-view scroll-y="true">
<view>
<view class="select_group_wrapper">
<view class="text-30rpx bold">套餐价格</view>
<view class="select_group_line_wrapper mt-20rpx">
<view
v-for="(val, index) in combo_select['combo_price']"
:key="index"
@click.stop="selectItemClick(index, 'combo_price')"
class="min-w-31% mx-1% mb-20rpx"
>
<view
class="box-border px-20rpx py-20rpx text-22rpx center line-height-[1] rounded-5rpx"
:class="{
'!bg-#239EA3 !text-#fff':
selectKey == 'screen' && priceIndex == index,
'!text-#747474 !bg-#e0e0e0':
selectKey == 'screen' && priceIndex != index,
}"
>{{ val.name }}</view
>
<uni-popup ref="popup_new" mask-background-color="transparent" :animation="false" :is-mask-click="true" >
<view class="pt-292rpx w-full h-100vh" >
<view class="bg-[rgba(0,0,0,0.3)] h-100%">
<view class="popup_new_main">
<view class="shaixuan_title">套餐类型</view>
<view style="display: flex;flex-wrap: wrap; ">
<view v-for="(item,index) in combo_select.combo_type" @click="ComboTypeClickFunc(item.id)" :class="['shaixuan_button',{'shaixuan_button_active': comboIndex==item.id}]">
{{item.name}}
</view>
</view>
<view class="shaixuan_title">价格区间</view>
<PriceRange @huakuaiValue="getHuaKuaiValue" :step="combo_list.step" :rangDate="price_max_min" :rangMax="combo_list.price_max" :dataInfo="combo_list.price_range"></PriceRange>
<view style="margin-top: -70rpx;">
<view class="shaixuan_title">适用人群</view>
<view style="display: flex;flex-wrap: wrap; ">
<view v-for="(item,index) in combo_select.combo_crowd" @click="ComboCrowdClickFunc(item.id)" :class="['shaixuan_button',{'shaixuan_button_active': crowdIndex==item.id}]">
{{item.name}}
</view>
<view class="select_group_wrapper">
<view class="text-30rpx bold">体检项目(多选)</view>
<view class="select_group_line_wrapper mt-20rpx">
<view
v-for="(val, index) in combo_select['combo_item']"
:key="index"
@click.stop="selectItemClick(val.id, 'combo_item')"
class="min-w-31% mx-1% mb-20rpx"
>
<view
class="box-border px-20rpx py-20rpx text-22rpx center line-height-[1] rounded-5rpx"
:class="{
'!bg-#239EA3 !text-#fff':
selectKey == 'screen' && projectIds.includes(val.id),
'!text-#747474 !bg-#e0e0e0':
selectKey == 'screen' && !projectIds.includes(val.id),
}"
>{{ val.name }}</view
>
</view>
</view>
<view >
<view class="shaixuan_title">体检项目</view>
<view style="display: flex;flex-wrap: wrap; ">
<view v-for="(item,index) in combo_select.combo_item" @click="CheckItemClickFunc(item.id)" :class="['shaixuan_button',{'shaixuan_button_active': projectIds.includes(item.id)}]">
{{item.name}}
</view>
</view>
</view>
<view class="around">
<view
class="w-40% text-26rpx h-60rpx center rounded-full bg-#239EA3 text-#fff"
@click="remake()"
>重置</view
>
<view
class="w-40% text-26rpx h-60rpx center rounded-full bg-#239EA3 text-#fff"
@click="selectDone()"
>确定</view
>
<view class="around" style="margin-top: 40rpx;">
<view class="w-40% text-26rpx h-60rpx center rounded-full bg-#239EA3 text-#fff"
@click="remake()">重置</view>
<view class="w-40% text-26rpx h-60rpx center rounded-full bg-#239EA3 text-#fff"
@click="selectDone()">确定</view>
</view>
</view>
</scroll-view>
<view style=";height: 100%;" @click="popup_new.close()"></view>
</view>
</view>
</uni-popup>
<uni-popup ref="TiShiPopupRef" style="z-index: 999;">
<view class="tishi_main">
<view class="tishi_title">套餐须知</view>
<view class="tishi_title2">专家定制套餐</view>
<view class="tishi_content">此套餐收费{{SelectedComboInfo.price}}元为预存款可根据现场定制套餐后实际价格多退少补</view>
<view class="tishi_button" @click="toDetail()"></view>
</view>
</uni-drawer>
</uni-popup>
</view>
</template>
<style scoped>
.tishi_main{
background-color: #fff;
padding: 40rpx 50rpx;
width:600rpx;
border-radius: 40rpx;
}
.tishi_button{
width: 365rpx;
background-color: #009da5;
color:#fff;
text-align: center;
padding-top: 10rpx;
padding-bottom: 10rpx;
border-radius: 40rpx;
margin: 40rpx auto 10rpx auto;
}
.tishi_title{
text-align: center;
font-size: 30rpx;
font-weight: 600;
color:#2b2827;
}
.tishi_title2{
font-size: 28rpx;
margin-top: 30rpx;
font-weight: 600;
color:#3a3635;
border-left: 3px solid #009da5;
padding-left: 5rpx;
}
.tishi_content{
font-size: 28rpx;
margin-top: 30rpx;
color:#474241;
}
.select_done_wrapper {
color: #ffffff;
background: #239ea3;
@ -721,6 +753,7 @@ const toRouter = () => {
scrollbar-width: none;
overflow: -moz-scrollbars-none;
overflow-y: scroll;
background-color: #fff;
}
.list_wrapper::-webkit-scrollbar {
@ -731,7 +764,7 @@ const toRouter = () => {
width: 710rpx;
height: 1rpx;
background: #e1ecee;
margin: 15rpx auto 0;
margin: 26rpx 0rpx 0rpx 0;
}
.combo_pick_button_wrapper {
@ -756,15 +789,14 @@ const toRouter = () => {
color: #ffffff;
text-align: center;
line-height: 60rpx;
margin-left: 32rpx;
margin-right: 20rpx;
}
.combo_button_wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: end;
margin-top: 27rpx;
justify-content: space-around;
}
.combo_count_wrapper {
@ -782,6 +814,13 @@ const toRouter = () => {
text-decoration-line: line-through;
margin-left: 10rpx;
}
.combo_original_price_wrapper2 {
font-weight: 500;
font-size: 18rpx;
color: #8b8b8b;
line-height: 1;
margin-left: 10rpx;
}
.combo_true_price_wrapper {
font-weight: 500;
@ -807,9 +846,11 @@ const toRouter = () => {
}
.combo_wrapper {
height: 307rpx;
width: 750rpx;
/* height: 196rpx; */
width: calc(750rpx - 80rpx);
margin: 0 auto;
background-color: #fff;
padding: 0rpx 40rpx 30rpx 40rpx;
}
.combo_tags_wrapper {
@ -835,14 +876,16 @@ const toRouter = () => {
font-weight: 400;
font-size: 18rpx;
color: #47abd8;
margin-right: 8rpx;
margin: 10rpx 8rpx 10rpx 0rpx;
border: 1rpx solid #009da5;
}
.combo_name_wrapper {
font-weight: 400;
font-size: 32rpx;
color: #0e0e0e;
line-height: 1;
line-height: 32rpx;
}
.combo_content_wrapper {
@ -888,11 +931,11 @@ const toRouter = () => {
justify-content: space-between;
width: 750rpx;
height: 80rpx;
background: #f1f7f7;
background: #eef7f7;
box-shadow: 0rpx -1rpx 1rpx 0rpx rgba(0, 0, 0, 0.1);
margin: 0 auto;
position: relative;
z-index: 999;
z-index: 998;
}
.select_item_icon_wrapper {
@ -991,24 +1034,25 @@ const toRouter = () => {
.user_title_wrapper {
font-weight: 400;
font-size: 28rpx;
color: #239ea3;
font-size: 26rpx;
color: #fff;
line-height: 1;
}
.user_name_wrapper {
font-weight: 400;
font-size: 28rpx;
color: #0d0d0d;
font-size: 26rpx;
color: #fff;
line-height: 1;
}
.user_wrapper {
height: 80rpx;
height: 60rpx;
padding-left: 40rpx;
padding-right: 20rpx;
background: #ffffff;
border-radius: 40rpx 0 0 40rpx;
margin-right: 20rpx;
background: #009ea7;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
@ -1018,18 +1062,22 @@ const toRouter = () => {
display: flex;
align-items: center;
justify-content: space-between;
width: 750rpx;
height: 100rpx;
width: 710rpx;
height: 90rpx;
background: #d8edf2;
margin: 0 auto;
position: relative;
z-index: 999;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 20rpx;
}
.hospital_wrapper {
display: flex;
align-items: center;
width: 50%;
width: 40%;
}
.hospital_icon_wrapper {
@ -1065,4 +1113,58 @@ const toRouter = () => {
display: block;
object-fit: contain;
}
.popup_new_main {
background-color: #fff;
border-radius: 0rpx 0rpx 20rpx 20rpx;
padding: 40rpx 20rpx 20rpx 20rpx;
}
.top_button_row {
display: flex;
justify-content: space-between;
padding-left: 20rpx;
padding-right: 20rpx;
}
.top_button {
color: #666;
background-color: #fff;
padding: 6rpx 40rpx;
border-radius: 15rpx;
margin-top: -6rpx;
margin-bottom: 8rpx;
font-size: 28rpx;
width: 140rpx;
text-align: center;
}
.top_button_active {
background-color: #009ea7;
color: #fff;
}
.search {}
.shaixuan_title {
font-size: 26rpx;
margin-top: 20rpx;
margin-bottom: 10rpx;
}
.shaixuan_button {
font-size: 24rpx;
padding-left: 10rpx;
background-color: #ccc;
margin: 10rpx;
padding: 5rpx 10rpx;
border-radius: 5rpx;
background-color: #f3f3f3;
color: #1e1a19;
}
.shaixuan_button_active{
background-color: #009da5;
color: #fff;
}
</style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,193 @@
<template>
<view class="order_new_main">
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<Top></Top>
<view>
<view class="haoyuan_row">
<view class="haoyuan_row_item">挂号预约</view>
<view class="haoyuan_row_item">医技预约</view>
</view>
<view class="order_select_k">
<view class="order_status_row">
<view @click="getOrderList()" :class="['order_status_button',{'active':active_status==1}]">未就诊</view>
<view @click="getOrderList()" :class="['order_status_button',{'active':active_status==2}]">已就诊</view>
<view @click="getOrderList()" :class="['order_status_button',{'active':active_status==3}]">已退号</view>
</view>
<view class="rili_row">
<uni-icons type="calendar" color="#009FA8" size="24"></uni-icons>
<view class="riqi_title">预约日期</view>
<uni-datetime-picker v-model="searchInfo.dateRange" @change="getOrderList" :border="false" type="datetimerange" rangeSeparator="至" />
</view>
</view>
<view class="order_k" v-for="(item,index) in order_list" :key="index">
<view style="display: flex;justify-content: space-between; border-bottom: 1px solid #DBDCDC;padding-bottom: 10rpx;">
<view style="display: flex;">
<uni-icons type="person" color="#009FA8" size="26"></uni-icons>
<view>预约日期</view>
</view>
<view>
<uni-icons type="right" color="#009FA8" size="24"></uni-icons>
</view>
</view>
<view class="order_info_line_wrapper">
<view class="order_info_label_wrapper">预约人</view>
<view class="order_info_value_wrapper">{{ item.name }}</view>
</view>
<view class="order_info_line_wrapper">
<view class="order_info_label_wrapper">预约诊区</view>
<view class="order_info_value_wrapper">
<span style="color:#008F96;font-weight: bold;">秀英院区 </span>
<span v-if="item.sex==1">(1)</span>
<span v-if="item.sex==2">(2)</span>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
computed,
nextTick
} from "vue";
import {
$image,
$api,
$response
} from "@/api";
import {
onShow,
onLoad
} from "@dcloudio/uni-app";
import Top from "../../../common/Top.vue";
import {
useStore
} from "@/store";
const $store = useStore();
let active_status=ref(1);
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
checkHospital();
}
};
const hospital_active = ref(0);
const checkHospital = () => {
let hospital_id = $store.save.hospital;
if (!hospital_id) {
hospital_id = $store.config.hospital[0].id;
}
hospital_active.value = hospital_id;
$store.saveInfo({
hospital: hospital_id,
});
};
let searchInfo=ref({})
let order_list = ref([])
const getOrderList = async () => {
uni.showLoading()
const response = await $api('OrderList',{searchInfo:searchInfo.value})
uni.hideLoading()
$response(response, () => {
order_list.value = response.data.list
})
}
onShow(() => {
getOrderList()
if (!!config_ref.value) {
checkHospital();
}
});
</script>
<style scoped>
.order_new_main{
background-color: #D8EEF3;
min-height: calc(100vh - 80rpx);
padding-top: 20rpx;
}
.haoyuan_row{
display: flex;
width: 100%;
justify-content: space-around;
background-color: #EEF7F7;
margin-top: 30rpx;
padding: 10rpx;
}
.haoyuan_row_item{
padding: 8rpx;
border-bottom: 2px solid #009ea7;
color: #009ea7;
font-size: 26rpx;
}
.order_status_row{
display: flex;
justify-content: space-between;
padding: 20rpx 0rpx 20rpx 0rpx;
border-bottom: 1px solid #DBDCDC;
}
.order_status_button{
font-size: 26rpx;
padding: 6rpx 40rpx;
background-color: #EBEBEB;
border-radius: 20rpx;
color:#3E3A39;
}
.order_select_k{
background-color: #fff;
padding: 0rpx 40rpx;
}
.active{
background-color: #009ea7;
color: #fff;
}
.rili_row{
display: flex;
align-items: center;
}
.riqi_title{
padding-left: 6rpx;
font-size: 24rpx;
color:#727171;
margin-right: -70rpx;
z-index: 20;
background-color: #fff;
padding-right: 40rpx;
}
.order_k{
background-color: #fff;
margin: 20rpx;
border-radius: 10rpx;
padding: 30rpx;
color:#3E3A39;
}
.order_info_line_wrapper {
display: flex;
align-items: center;
font-weight: normal;
font-size: 26rpx;
color: #666666;
line-height: 50rpx;
margin-top: 10rpx;
}
.order_info_label_wrapper {
color: #9E9E9F;
}
.order_info_value_wrapper {
color: #3E3A39;
}
</style>

@ -0,0 +1,559 @@
<script setup>
import DraggableButton from "@/pages/components/goHome.vue";
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from "vue";
import {
$api,
$response,
$image
} from "@/api";
import {
onShow
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
const $store = useStore();
// groupId
let comboInfo = ref({}); //
let selectIds = ref([]); // ID
let wj = ref(""); //
let itemsInfo = ref({}); //
let comboId = ref(""); // id
let personId = ref(""); // id
let groupId = ref(""); // id
let tabIndex = ref(-1); //
let totalPrice = ref(0); //
let groupInfo = ref({}); //
let status = ref(0); // 1 2 3 4
let buyText = ref("立即购买"); //
let notice = ref({}); //
let losePrice = ref(0); //
let popupTip = ref(null); //
const GetReadmeDetails = async () => {
const response = await $api("GetReadme");
$response(response, () => {
notice.value = response.data || false;
if (tabIndex.value == 0) {
let num = 5;
buyText.value = "0" + num;
tabIndex.value = 1;
let timer = setInterval(() => {
num--;
buyText.value = "0" + num;
if (num == 0) {
buyText.value = "立即购买";
clearInterval(timer);
}
}, 1000);
return;
}
uni.hideLoading();
});
};
const $props = defineProps({
comboId: {
type: String,
default: "",
},
personId: {
type: String,
default: "",
},
groupId: {
type: String,
default: "",
},
itemIds: {
type: String,
default: "",
},
wj: {
type: String,
default: "",
},
});
const mountedAction = async () => {
selectIds.value = $props.itemIds ? $props.itemIds.split(",") : [];
wj.value = $props.wj || "";
comboId.value = $props.comboId || "";
personId.value = $store.getUser().person_id || "";
groupId.value = $props.groupId || "";
// - - - - -
//
// - / -
// - - -
// comboId && person_id
// - - - -
//
// - -
if (groupId.value) {
if (comboId.value) {
//
status.value = 3;
} else {
//
status.value = 4;
}
} else {
if (comboId.value) {
//
status.value = 1;
} else {
//
status.value = 2;
}
}
console.log(status.value, "1个检套餐 2个检自选 3团检套餐 4团检自选");
uni.showLoading({
title: "加载中",
});
getBuyInfo(); //
};
const buy = () => {
if (tabIndex.value == 0) {
if (losePrice.value > 0 && groupId.value.length>0) {
popupTip.value.open("center"); //
return;
}
GetReadmeDetails();
}
if (tabIndex.value == 1 && buyText.value == "立即购买") {
$store.setBuyInfo({
combo_id: comboId.value,
person_id: personId.value,
group_id: groupId.value,
item_ids: selectIds.value,
hospital: $store.save_info.hospital,
duo_xuan_yi: $store.getDuoXuanYi(),
wj: wj.value,
});
if (!!$store.yytjInfo.doctor_name) {
$store.setYytjInfo({
doctor_name: $store.yytjInfo.doctor_name,
doctor_date: $store.yytjInfo.doctor_date,
doctor_id:$store.yytjInfo.doctor_id
});
} else {
$store.setYytjInfo({});
}
uni.setStorageSync("yytjInfoS", {});
uni.navigateTo({
url: "/pages/main/tjyy/tjyy",
});
}
};
const getBuyInfo = async () => {
//
console.log("看看有没有hospital",$store.save_info);
let obj = {
item_ids: selectIds.value,
combo_id: comboId.value,
hospital: $store.save_info?.hospital?$store.save_info?.hospital:1,
person_id: personId.value,
group_id: groupId.value,
duo_xuan_yi: $store.getDuoXuanYi(),
wj: wj.value,
};
const response = await $api("BuyInfo", obj);
$response(response, () => {
uni.hideLoading();
if (groupId.value && response.data.group_info.length) {
//
groupInfo.value = response.data.group_info[0];
if (response.data.group_info[0].items?.length) {
status.value = 3;
}
if(groupInfo.value.items?.length){
groupInfo.value.itemscount=0;
let itemscount=0
groupInfo.value.items.forEach((v,i)=>{
if(v.keshi_name!="材料费")
itemscount=itemscount+v.children.length
})
groupInfo.value.itemscount=itemscount
}
}
losePrice.value = response.data.lose_price;
comboInfo.value = response.data.combo_info;
itemsInfo.value = response.data.items_info;
if(itemsInfo.value.items?.length){
itemsInfo.value.itemscount=0;
let itemscount=0
itemsInfo.value.items.forEach((v,i)=>{
if(v.keshi_name!="材料费")
itemscount=itemscount+v.children.length
})
itemsInfo.value.itemscount=itemscount
}
totalPrice.value = response.data.true_price;
tabIndex.value = 0;
});
};
const addCombo = () => {
//
let itemIds = $props.itemIds ? $props.itemIds : "";
let query = "?comboId=" + comboId.value + "&itemIds=" + itemIds;
if (groupId.value) {
query += "&groupId=" + groupId.value;
}
if($props.wj){
query +="&wj="+$props.wj
}
uni.navigateTo({
url: "/pages/main/tj/tjzx?" + query,
});
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
}
};
const toreadme=()=>{
GetReadmeDetails();
popupTip.value.close()
}
onShow(() => {
if (!!config_ref.value) {
mountedAction();
}
});
</script>
<template>
<uni-popup ref="popupTip">
<view
class="mb-70rpx bg-#fff text-center box-border pt-80rpx pb-50rpx px-65rpx w-90vw rounded-15rpx"
>
<view
class="w-full text-center text-##090909 text-26rpx line-height-[50rpx]"
>您还剩余
{{ losePrice }}
元体检额度尚未使用确认提交后剩余体检额度将无法使用!</view
>
<view class="mt-50rpx between">
<button
type="primary"
@click="toreadme()"
class="w-196rpx h-68rpx center text-#fff text-24rpx !bg-#239EA3 rounded-8rpx"
>
我想好了
</button>
<button
@click="popupTip.close()"
class="w-196rpx h-68rpx center text-#239EA3 text-24rpx !bg-#D9F3F2 rounded-8rpx"
>
我再想想
</button>
</view>
</view>
</uni-popup>
<DraggableButton />
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
</view>
<view class="px-30rpx box-border comboInfo">
<view class="pt-35rpx rounded-15rpx px-10rpx bg-#fff pb-30rpx box-border b-0 b-t-1 b-solid b-#E1ECEE">
<view class="flex w-full" v-if="status == 1">
<!-- 1个检套餐 显示套餐信息 -->
<image v-if="comboInfo.img" :src="$image(comboInfo.img)" class="w-190rpx h-190rpx mr-37rpx" mode="widthFix" />
<view class="flex flex-col grow">
<text>{{ comboInfo.combo_name }}</text>
<view class="mt-13rpx mb-18rpx">
<uni-tag v-for="(val, i) in comboInfo.tags" :key="i" size="small" :inverted="true" :text="val.text"
class="mr-8rpx" :custom-style="
'background-color:' +
val.color +
';border-color:' +
val.color +
'; color:' +
val.text_color +
';'
" />
</view>
<view v-if="comboInfo.tags2?.length">
<text v-for="(val, i) in comboInfo.tags2" :key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-solid b-#8B8B8B"
:class="i == comboInfo.tags2?.length - 1 ? 'b-r-0' : 'b-r-2'">{{ val }}</text>
</view>
<view class="mt-20rpx w-full flex items-end">
<text class="text-18rpx text-#EC3D15">¥</text>
<text class="text-38rpx text-#EC3D15 mx-10rpx -mb-8rpx">{{
comboInfo.price
}}</text>
<text class="text-18rpx text-#878787 line-through">{{
comboInfo.original_price
}}</text>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx">已售{{ comboInfo.sale_count }}</text>
</view>
</view>
</view>
<view v-if="status == 1" class="mt-25rpx pt-25rpx b-0 b-t-1 b-solid b-#E1ECEE bettween flex-col text-24rpx">
<!-- 1个检套餐显示 -->
<view>
<text class="text-#8B8B8B">适用人群</text>
<text class="text-#0E0E0E">{{ comboInfo.crowd_name }}</text>
</view>
<view>
<text class="text-#8B8B8B">适用院区</text>
<text class="text-#0E0E0E">{{ comboInfo.hospital_name }}</text>
</view>
</view>
<view v-if="status != 1" class="px-15rpx pt-10rpx">
<!-- 2个检自选 3团检套餐 4团检自选 都要显示头像和名字 -->
<view class="flex items-center">
<image src="@/static/assets/userm.png" class="w-70rpx h-70rpx mr-35rpx" />
<view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{
groupId ? groupInfo.name : $store.getUser().name
}}</text>
</view>
</view>
<view v-if="status != 2" class="text-24rpx mt-40rpx">
<!-- 3团检套餐 4团检自选 都要显示单位部门等信息 -->
<view class="pb-30rpx">
<text class="text-#8B8B8B">单位名称</text>
<text>{{ groupInfo.group_name }}</text>
</view>
<view class="pb-30rpx">
<text class="text-#8B8B8B">部门名称</text>
<text>{{ groupInfo.bumen_name }}</text>
</view>
<view class="pb-30rpx" v-if="groupInfo.combo_name || comboInfo?.combo_name">
<text class="text-#8B8B8B">套餐名称</text>
<text>{{ groupInfo.combo_name || comboInfo?.combo_name }}</text>
</view>
<view>
<text class="text-#8B8B8B">体检额度</text>
<text>{{ groupInfo.tongshou_xiane }}</text>
</view>
</view>
</view>
</view>
<view class="pb-300rpx">
<view class="flex items-center justify-around px-30rpx mt-30rpx">
<text v-if="status == 1 || status == 3" @click="tabIndex = 0" :class="tabIndex == 0 ? 'active' : ''"
class="text-30rpx text-#2E2E2E">套餐内容</text>
<text v-else @click="tabIndex = 0" :class="tabIndex == 0 ? 'active' : ''"
class="text-30rpx text-#2E2E2E">自选内容</text>
<text @click="GetReadmeDetails" :class="tabIndex == 1 ? 'active' : ''"
class="text-30rpx text-#2E2E2E">体检须知</text>
</view>
<view v-if="tabIndex == 0" class="mt-20rpx bg-#fff py-40rpx px-14rpx box-border flex-col flex">
<!-- 套餐内容 -->
<view v-if="comboInfo?.items?.length" class="mb-20rpx">
<!-- 套餐项目 -->
<view class="text-#2E2E2E text-30rpx center mb-20rpx">套餐项目{{ comboInfo?.tags[0]?.text }}</view>
<view class="flex h-67rpx bg-#239ea3 text-#fff text-26rpx rounded-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff">检查项目</view>
<view class="grow center">检查指标意义</view>
</view>
<view v-for="(val, index) in comboInfo?.items" :key="index">
<view v-if="val.keshi_name != '材料费'">
<view class="flex h-55rpx bg-#9f9f9f text-#fff text-24rpx rounded-10rpx mt-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<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>
</view>
<!-- 团检内自带的项目 -->
<view v-if="groupInfo?.items?.length" class="mb-20rpx">
<!-- 套餐 -->
<view class="text-#2E2E2E text-30rpx center mb-20rpx">套餐项目{{ groupInfo.itemscount }}</view>
<view class="flex h-67rpx bg-#239ea3 text-#fff text-26rpx rounded-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff">检查项目</view>
<view class="grow center">检查指标意义</view>
</view>
<view v-for="(val, index) in groupInfo?.items" :key="index">
<view v-if="val.keshi_name != '材料费'">
<view class="flex h-55rpx bg-#9f9f9f text-#fff text-24rpx rounded-10rpx mt-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<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>
</view>
<view v-if="itemsInfo.items?.length">
<!-- 自选 -->
<view class="text-#2E2E2E text-30rpx center mb-20rpx">自选项目{{ itemsInfo.itemscount }}</view>
<view class="flex h-67rpx bg-#239ea3 text-#fff text-26rpx rounded-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff">检查项目</view>
<view class="grow center">检查指标意义</view>
</view>
<view v-for="(val, index) in itemsInfo.items" :key="index">
<view v-if="val.keshi_name != '材料费'">
<view class="flex h-55rpx bg-#9f9f9f text-#fff text-24rpx rounded-10rpx mt-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<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>
</view>
</view>
<view v-if="tabIndex == 1">
<!-- 体检须知 -->
<view style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="rounded-15rpx mt-20rpx bg-#fff py-40rpx px-30rpx box-border flex-col flex">
<view class="text-#2E2E2E text-30rpx font-500 text-center">
体检须知
</view>
<view class="text-30rpx text-#2E2E2E">
<image class="w-5rpx h-26rpx" src="@/static/assets/slices/tjcol2x.png"></image>
体检须知
</view>
<view class="flex flex-justify-around text-#111111 text-28rpx pt-24rpx pb-50rpx">
<view class="flex flex-col flex-items-center">
<image class="w-80rpx h-80rpx" src="@/static/assets/slices/xgtc.png"></image>
选购套餐
</view>
<view class="pt-25rpx">
<image class="w-30rpx h-30rpx" src="@/static/assets/slices/lt.png"></image>
</view>
<view class="flex flex-col flex-items-center">
<image class="w-80rpx h-80rpx" src="@/static/assets/slices/yytj.png"></image>
预约体检
</view>
<view class="pt-25rpx">
<image class="w-30rpx h-30rpx" src="@/static/assets/slices/lt.png"></image>
</view>
<view class="flex flex-col flex-items-center">
<image class="w-80rpx h-80rpx" src="@/static/assets/slices/qwty.png"></image>
前往体检
</view>
<view class="pt-25rpx">
<image class="w-30rpx h-30rpx" src="@/static/assets/slices/lt.png"></image>
</view>
<view class="flex flex-col flex-items-center">
<image class="w-80rpx h-80rpx" src="@/static/assets/slices/lqbg.png"></image>
领取报告
</view>
</view>
<view class="pb-40rpx text-30rpx text-#2E2E2E">
<image class="w-5rpx h-26rpx" src="@/static/assets/slices/tjcol2x.png"></image>
体检注意事项
</view>
<view v-html="notice.content" class="text-28rpx" style="line-height: 50rpx;"></view>
</view>
</view>
</view>
<view class="fixed bottom-0 left-0 w-full bg-#fff p-30rpx box-border between">
<view class="grow">
<view class="flex items-end" v-if="comboId != 0">
<text class="text-18rpx text-#878787">套餐价格</text>
<text class="text-21rpx text-#ED6907 mx-20rpx ml-56rpx">¥ {{ comboInfo.price }}</text>
</view>
<view class="flex items-end">
<text class="text-18rpx text-#878787">自选项目价格</text>
<text class="text-21rpx text-#ED6907 mx-20rpx">¥ {{ itemsInfo.price || 0 }}</text>
</view>
<view class="flex items-end">
<text class="text-18rpx text-#ED6907">合计费用</text>
<text class="text-24rpx text-#ED6907 ml-20rpx mr-5rpx">¥</text>
<text class="text-36rpx text-#ED6907 mr-20rpx font-bold">{{
totalPrice
}}</text>
</view>
</view>
<view class="flex">
<button @click="addCombo()" class="bg-#ED6907 text-30rpx text-#fff rounded-l-full px-34rpx w-200rpx h-full">
增加项目
</button>
<button @click="buy()" class="bg-#239EA3 text-30rpx text-#fff rounded-r-full px-34rpx w-200rpx h-full">
{{ buyText }}
</button>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.comboInfo {
position: relative;
z-index: 1;
&::after {
content: "";
width: 100%;
height: 50rpx;
background-color: #239ea3;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.active {
color: #239ea3;
font-weight: bold;
position: relative;
&::after {
content: "";
width: 26rpx;
height: 3rpx;
background-color: #239ea3;
position: absolute;
left: 50%;
bottom: -10rpx;
transform: translateX(-50%);
}
}
}
</style>

@ -31,6 +31,7 @@
let personId = ref(""); // id
let groupId = ref(""); // id
let tabIndex = ref(-1); //
let total_original_price=ref(0);
let totalPrice = ref(0); //
let groupInfo = ref({}); //
let status = ref(0); // 1 2 3 4
@ -38,6 +39,9 @@
let notice = ref({}); //
let losePrice = ref(0); //
let popupTip = ref(null); //
let contentInfo=ref([])//
let active_keshi=ref([]);
let popupXuZhi=ref(null);
const GetReadmeDetails = async () => {
const response = await $api("GetReadme");
@ -83,7 +87,13 @@
default: "",
},
});
const opendDetail=(index)=>{
if(active_keshi.value.indexOf(index)!== -1){
active_keshi.value.splice(active_keshi.value.indexOf(index), 1);
}else{
active_keshi.value.push(index)
}
}
const mountedAction = async () => {
selectIds.value = $props.itemIds ? $props.itemIds.split(",") : [];
wj.value = $props.wj || "";
@ -125,16 +135,17 @@
getBuyInfo(); //
};
const buy = () => {
const buy = async (step=0) => {
if (tabIndex.value == 0) {
if (step == 1) {
if (losePrice.value > 0 && groupId.value.length>0) {
popupTip.value.open("center"); //
return;
}
GetReadmeDetails();
await GetReadmeDetails();
popupXuZhi.value.open();
}
if (tabIndex.value == 1 && buyText.value == "立即购买") {
if (step == 2) {
$store.setBuyInfo({
combo_id: comboId.value,
person_id: personId.value,
@ -162,7 +173,6 @@
const getBuyInfo = async () => {
//
console.log("看看有没有hospital",$store.save_info);
let obj = {
item_ids: selectIds.value,
combo_id: comboId.value,
@ -182,6 +192,7 @@
status.value = 3;
}
if(groupInfo.value.items?.length){
contentInfo.value.push(groupInfo.value.items)
groupInfo.value.itemscount=0;
let itemscount=0
groupInfo.value.items.forEach((v,i)=>{
@ -193,8 +204,12 @@
}
losePrice.value = response.data.lose_price;
comboInfo.value = response.data.combo_info;
if(comboInfo.value.items?.length){
contentInfo.value.push(comboInfo.value.items)
}
itemsInfo.value = response.data.items_info;
if(itemsInfo.value.items?.length){
contentInfo.value.push(itemsInfo.value.items)
itemsInfo.value.itemscount=0;
let itemscount=0
itemsInfo.value.items.forEach((v,i)=>{
@ -204,7 +219,9 @@
itemsInfo.value.itemscount=itemscount
}
totalPrice.value = response.data.true_price;
total_original_price.value=response.data.original_price
tabIndex.value = 0;
contentInfo.value=contentInfo.value.flat()
});
};
@ -275,55 +292,17 @@
<view :ref="configRef"></view>
</view>
</view>
<view class="px-30rpx box-border comboInfo">
<view class="pt-35rpx rounded-15rpx px-10rpx bg-#fff pb-30rpx box-border b-0 b-t-1 b-solid b-#E1ECEE">
<view class="flex w-full" v-if="status == 1">
<view v-if="[1,2].indexOf(status) !== -1">
<!-- 1个检套餐 显示套餐信息 -->
<image v-if="comboInfo.img" :src="$image(comboInfo.img)" class="w-190rpx h-190rpx mr-37rpx" mode="widthFix" />
<view class="flex flex-col grow">
<text>{{ comboInfo.combo_name }}</text>
<view class="mt-13rpx mb-18rpx">
<uni-tag v-for="(val, i) in comboInfo.tags" :key="i" size="small" :inverted="true" :text="val.text"
class="mr-8rpx" :custom-style="
'background-color:' +
val.color +
';border-color:' +
val.color +
'; color:' +
val.text_color +
';'
" />
</view>
<view v-if="comboInfo.tags2?.length">
<text v-for="(val, i) in comboInfo.tags2" :key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-solid b-#8B8B8B"
:class="i == comboInfo.tags2?.length - 1 ? 'b-r-0' : 'b-r-2'">{{ val }}</text>
</view>
<view class="mt-20rpx w-full flex items-end">
<text class="text-18rpx text-#EC3D15">¥</text>
<text class="text-38rpx text-#EC3D15 mx-10rpx -mb-8rpx">{{
comboInfo.price
}}</text>
<text class="text-18rpx text-#878787 line-through">{{
comboInfo.original_price
}}</text>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx">已售{{ comboInfo.sale_count }}</text>
</view>
<view class="combo_name_row" >
<text v-if="status==2"> </text>
<text v-if="status==1">{{ comboInfo.combo_name }}</text>
</view>
</view>
<view v-if="status == 1" class="mt-25rpx pt-25rpx b-0 b-t-1 b-solid b-#E1ECEE bettween flex-col text-24rpx">
<!-- 1个检套餐显示 -->
<view>
<text class="text-#8B8B8B">适用人群</text>
<text class="text-#0E0E0E">{{ comboInfo.crowd_name }}</text>
</view>
<view>
<text class="text-#8B8B8B">适用院区</text>
<text class="text-#0E0E0E">{{ comboInfo.hospital_name }}</text>
</view>
</view>
<view v-if="status != 1" class="px-15rpx pt-10rpx">
<view class="px-30rpx box-border comboInfo">
<view v-if="status != 1 && status!=2" class="pt-35rpx rounded-15rpx px-10rpx bg-#fff pb-30rpx box-border b-0 b-t-1 b-solid b-#E1ECEE">
<view class="px-15rpx pt-10rpx">
<!-- 2个检自选 3团检套餐 4团检自选 都要显示头像和名字 -->
<view class="flex items-center">
<image src="@/static/assets/userm.png" class="w-70rpx h-70rpx mr-35rpx" />
@ -355,106 +334,60 @@
</view>
</view>
</view>
<view class="pb-300rpx">
<view class="flex items-center justify-around px-30rpx mt-30rpx">
<text v-if="status == 1 || status == 3" @click="tabIndex = 0" :class="tabIndex == 0 ? 'active' : ''"
class="text-30rpx text-#2E2E2E">套餐内容</text>
<text v-else @click="tabIndex = 0" :class="tabIndex == 0 ? 'active' : ''"
class="text-30rpx text-#2E2E2E">自选内容</text>
<text @click="GetReadmeDetails" :class="tabIndex == 1 ? 'active' : ''"
class="text-30rpx text-#2E2E2E">体检须知</text>
<view class="pb-150rpx">
<view class="flex items-center justify-around px-30rpx pl-150rpx pt-30rpx">
<view>
<text class="text-30rpx text-#2E2E2E">套餐项目</text>
<span v-if="status==1 && JSON.stringify(comboInfo) !== '{}'" class="combo_tag_wrapper" >{{ comboInfo?.tags[0]?.text }}</span>
<span v-if="status==2" class="combo_tag_wrapper">{{ itemsInfo?.itemscount }}</span>
</view>
<view v-if="tabIndex == 0" class="mt-20rpx bg-#fff py-40rpx px-14rpx box-border flex-col flex">
</view>
<view class="mt--10rpx bg-#fff py-40rpx px-14rpx box-border flex-col flex">
<!-- 套餐内容 -->
<view v-if="comboInfo?.items?.length" class="mb-20rpx">
<view v-if="contentInfo.length>0" class="mb-20rpx">
<!-- 套餐项目 -->
<view class="text-#2E2E2E text-30rpx center mb-20rpx">套餐项目{{ comboInfo?.tags[0]?.text }}</view>
<view class="flex h-67rpx bg-#239ea3 text-#fff text-26rpx rounded-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff">检查项目</view>
<view class="grow center">检查指标意义</view>
<view class="flex h-58rpx bg-#239ea3 mb-26rpx text-#fff text-26rpx rounded-10rpx">
<view class="min-w-220rpx max-w-220rpx keshi_name_k">体检流程</view>
<view class="grow center">检查项目</view>
</view>
<view v-for="(val, index) in comboInfo?.items" :key="index">
<view v-for="(val, index) in contentInfo" :key="index">
<view v-if="val.keshi_name != '材料费'">
<view class="flex h-55rpx bg-#9f9f9f text-#fff text-24rpx rounded-10rpx mt-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<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"
<view class="flex h-58rpx bg-#E6F5F6 text-#333 text-27rpx rounded-10rpx mt-10rpx">
<view class="min-w-250rpx max-w-250rpx keshi_name_k ">{{index+1}}.{{ val.keshi_name }}</view>
<view class="grow center">{{ val.children.length }}个项目</view>
<view class="grow center xiangqingbutton" @click="opendDetail(index)"><span style="font-size: 12rpx;">>></span></view>
</view>
<view v-if="active_keshi.indexOf(index)!== -1">
<view class="xian mt-10rpx "></view>
<view class=" bg-#FBFBFB text-#000 text-24rpx rounded-10rpx p-20rpx little_item_k " 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">
<view style="display: flex; align-items: center;">
<view class="break-all box-border ">
{{ v.name }}
</view>
<view class="grow center p-10rpx box-border">{{
v.desc || "-"
}}</view>
</view>
</view>
</view>
<view class="wenhao">?</view>
</view>
<!-- 团检内自带的项目 -->
<view v-if="groupInfo?.items?.length" class="mb-20rpx">
<!-- 套餐 -->
<view class="text-#2E2E2E text-30rpx center mb-20rpx">套餐项目{{ groupInfo.itemscount }}</view>
<view class="flex h-67rpx bg-#239ea3 text-#fff text-26rpx rounded-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff">检查项目</view>
<view class="grow center">检查指标意义</view>
</view>
<view v-for="(val, index) in groupInfo?.items" :key="index">
<view v-if="val.keshi_name != '材料费'">
<view class="flex h-55rpx bg-#9f9f9f text-#fff text-24rpx rounded-10rpx mt-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<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 text-20rpx text-#E95513 mt-10rpx box-border">{{ v.desc || "-" }}</view>
</view>
</view>
<view v-if="itemsInfo.items?.length">
<!-- 自选 -->
<view class="text-#2E2E2E text-30rpx center mb-20rpx">自选项目{{ itemsInfo.itemscount }}</view>
<view class="flex h-67rpx bg-#239ea3 text-#fff text-26rpx rounded-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff">检查项目</view>
<view class="grow center">检查指标意义</view>
</view>
<view v-for="(val, index) in itemsInfo.items" :key="index">
<view v-if="val.keshi_name != '材料费'">
<view class="flex h-55rpx bg-#9f9f9f text-#fff text-24rpx rounded-10rpx mt-10rpx">
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<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>
</view>
</view>
<view v-if="tabIndex == 1">
<uni-popup ref="popupXuZhi">
<view class="tishi_main">
<!-- 体检须知 -->
<view style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="rounded-15rpx mt-20rpx bg-#fff py-40rpx px-30rpx box-border flex-col flex">
<view class="text-#2E2E2E text-30rpx font-500 text-center">
<view class="text-#2E2E2E text-30rpx font-900 text-center">
体检须知
</view>
<view class="text-30rpx text-#2E2E2E">
<view class="text-28rpx text-#2E2E2E">
<image class="w-5rpx h-26rpx" src="@/static/assets/slices/tjcol2x.png"></image>
体检须知
</view>
@ -486,38 +419,34 @@
领取报告
</view>
</view>
<view class="pb-40rpx text-30rpx text-#2E2E2E">
<view class="pb-20rpx text-28rpx text-#2E2E2E">
<image class="w-5rpx h-26rpx" src="@/static/assets/slices/tjcol2x.png"></image>
体检注意事项
</view>
<view v-html="notice.content" class="text-28rpx" style="line-height: 50rpx;"></view>
</view>
<view v-html="notice.content" class="text-20rpx" style="line-height: 40rpx;"></view>
<view class="tishi_button" @click="buy(2)" >我已知晓</view>
</view>
</uni-popup>
</view>
<view class="fixed bottom-0 left-0 w-full bg-#fff p-30rpx box-border between">
<view class="fixed bottom-0 h-150rpx left-0 w-full bg-gradient-to-r from-#02b4bd to-#ABD7D7 p-30rpx box-border between">
<view class="grow">
<view class="flex items-end" v-if="comboId != 0">
<text class="text-18rpx text-#878787">套餐价格</text>
<text class="text-21rpx text-#ED6907 mx-20rpx ml-56rpx">¥ {{ comboInfo.price }}</text>
</view>
<view class="flex items-end">
<text class="text-18rpx text-#878787">自选项目价格</text>
<text class="text-21rpx text-#ED6907 mx-20rpx">¥ {{ itemsInfo.price || 0 }}</text>
<text class="original_price_wrapper">¥ {{ total_original_price }}</text>
</view>
<view class="flex items-end">
<text class="text-18rpx text-#ED6907">合计费用</text>
<text class="text-24rpx text-#ED6907 ml-20rpx mr-5rpx">¥</text>
<text class="text-36rpx text-#ED6907 mr-20rpx font-bold">{{
<text class="text-42rpx text-#ED6907 mr-20rpx font-bold">¥{{
totalPrice
}}</text>
</view>
</view>
<view class="flex">
<button @click="addCombo()" class="bg-#ED6907 text-30rpx text-#fff rounded-l-full px-34rpx w-200rpx h-full">
<button @click="addCombo()" class="button bgcolor_huang">
增加项目
</button>
<button @click="buy()" class="bg-#239EA3 text-30rpx text-#fff rounded-r-full px-34rpx w-200rpx h-full">
{{ buyText }}
<button @click="buy(1)" class="button">
立即支付
</button>
</view>
</view>
@ -527,17 +456,9 @@
.comboInfo {
position: relative;
z-index: 1;
background-color: #fff;
min-height: calc(100vh - 200rpx);
&::after {
content: "";
width: 100%;
height: 50rpx;
background-color: #239ea3;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.active {
color: #239ea3;
@ -557,3 +478,90 @@
}
}
</style>
<style scoped>
.combo_name_row{
text-align: center;
background-color: #EEF7F7;
color: #009FA8;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
}
.keshi_name_k{
line-height: 58rpx;
padding-left: 30rpx;
}
.xian{
height: 6rpx;
border-radius: 6rpx;
background-color: #B0E0E2;
}
.combo_tag_wrapper {
padding-left: 13rpx;
padding-right: 13rpx;
height: 28rpx;
line-height: 28rpx;
border-radius: 5rpx;
font-weight: 900;
font-size: 18rpx;
color: #47abd8;
margin: 10rpx 8rpx 10rpx 10rpx;
border: 3rpx solid #009FA8;
}
.little_item_k{
border-bottom: 1px solid #ccc;
}
.wenhao{
height: 18rpx;
width: 18rpx;
background-color: #009FA8;
line-height: 18rpx;
border-radius: 18rpx;
color: #fff;
text-align: center;
font-size: 14rpx;
margin-left: 10rpx;
}
.xiangqingbutton{
color:#009FA8;
font-size: 17rpx;
}
.button {
color: #00828e;
background-color: #fff;
height: 58rpx;
line-height: 58rpx;
text-align: center;
width: 174rpx;
border-radius: 58rpx;
margin-right: 20rpx;
font-size: 29rpx;
}
.bgcolor_huang{
background-color: #FF6D00;
color: #fff;
}
.original_price_wrapper {
font-weight: bolder;
font-size: 18rpx;
color: #333;
line-height: 1;
text-decoration-line: line-through;
}
.tishi_main{
background-color: #fff;
padding: 40rpx 50rpx;
width:600rpx;
border-radius: 40rpx;
}
.tishi_button{
width: 365rpx;
background-color: #009da5;
color:#fff;
text-align: center;
padding-top: 10rpx;
padding-bottom: 10rpx;
border-radius: 40rpx;
margin: 20rpx auto 10rpx auto;
}
</style>

@ -1,567 +0,0 @@
<script setup>
import DraggableButton from "@/pages/components/goHome.vue";
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from "vue";
import {
$api,
$response,
$image
} from "@/api";
import {
onShow
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
const $store = useStore();
// groupId
let comboInfo = ref({}); //
let selectIds = ref([]); // ID
let wj = ref(""); //
let itemsInfo = ref({}); //
let comboId = ref(""); // id
let personId = ref(""); // id
let groupId = ref(""); // id
let tabIndex = ref(-1); //
let total_original_price=ref(0);
let totalPrice = ref(0); //
let groupInfo = ref({}); //
let status = ref(0); // 1 2 3 4
let buyText = ref("立即购买"); //
let notice = ref({}); //
let losePrice = ref(0); //
let popupTip = ref(null); //
let contentInfo=ref([])//
let active_keshi=ref([]);
let popupXuZhi=ref(null);
const GetReadmeDetails = async () => {
const response = await $api("GetReadme");
$response(response, () => {
notice.value = response.data || false;
if (tabIndex.value == 0) {
let num = 5;
buyText.value = "0" + num;
tabIndex.value = 1;
let timer = setInterval(() => {
num--;
buyText.value = "0" + num;
if (num == 0) {
buyText.value = "立即购买";
clearInterval(timer);
}
}, 1000);
return;
}
uni.hideLoading();
});
};
const $props = defineProps({
comboId: {
type: String,
default: "",
},
personId: {
type: String,
default: "",
},
groupId: {
type: String,
default: "",
},
itemIds: {
type: String,
default: "",
},
wj: {
type: String,
default: "",
},
});
const opendDetail=(index)=>{
if(active_keshi.value.indexOf(index)!== -1){
active_keshi.value.splice(active_keshi.value.indexOf(index), 1);
}else{
active_keshi.value.push(index)
}
}
const mountedAction = async () => {
selectIds.value = $props.itemIds ? $props.itemIds.split(",") : [];
wj.value = $props.wj || "";
comboId.value = $props.comboId || "";
personId.value = $store.getUser().person_id || "";
groupId.value = $props.groupId || "";
// - - - - -
//
// - / -
// - - -
// comboId && person_id
// - - - -
//
// - -
if (groupId.value) {
if (comboId.value) {
//
status.value = 3;
} else {
//
status.value = 4;
}
} else {
if (comboId.value) {
//
status.value = 1;
} else {
//
status.value = 2;
}
}
console.log(status.value, "1个检套餐 2个检自选 3团检套餐 4团检自选");
uni.showLoading({
title: "加载中",
});
getBuyInfo(); //
};
const buy = async (step=0) => {
if (step == 1) {
if (losePrice.value > 0 && groupId.value.length>0) {
popupTip.value.open("center"); //
return;
}
await GetReadmeDetails();
popupXuZhi.value.open();
}
if (step == 2) {
$store.setBuyInfo({
combo_id: comboId.value,
person_id: personId.value,
group_id: groupId.value,
item_ids: selectIds.value,
hospital: $store.save_info.hospital,
duo_xuan_yi: $store.getDuoXuanYi(),
wj: wj.value,
});
if (!!$store.yytjInfo.doctor_name) {
$store.setYytjInfo({
doctor_name: $store.yytjInfo.doctor_name,
doctor_date: $store.yytjInfo.doctor_date,
doctor_id:$store.yytjInfo.doctor_id
});
} else {
$store.setYytjInfo({});
}
uni.setStorageSync("yytjInfoS", {});
uni.navigateTo({
url: "/pages/main/tjyy/tjyy",
});
}
};
const getBuyInfo = async () => {
//
let obj = {
item_ids: selectIds.value,
combo_id: comboId.value,
hospital: $store.save_info?.hospital?$store.save_info?.hospital:1,
person_id: personId.value,
group_id: groupId.value,
duo_xuan_yi: $store.getDuoXuanYi(),
wj: wj.value,
};
const response = await $api("BuyInfo", obj);
$response(response, () => {
uni.hideLoading();
if (groupId.value && response.data.group_info.length) {
//
groupInfo.value = response.data.group_info[0];
if (response.data.group_info[0].items?.length) {
status.value = 3;
}
if(groupInfo.value.items?.length){
contentInfo.value.push(groupInfo.value.items)
groupInfo.value.itemscount=0;
let itemscount=0
groupInfo.value.items.forEach((v,i)=>{
if(v.keshi_name!="材料费")
itemscount=itemscount+v.children.length
})
groupInfo.value.itemscount=itemscount
}
}
losePrice.value = response.data.lose_price;
comboInfo.value = response.data.combo_info;
if(comboInfo.value.items?.length){
contentInfo.value.push(comboInfo.value.items)
}
itemsInfo.value = response.data.items_info;
if(itemsInfo.value.items?.length){
contentInfo.value.push(itemsInfo.value.items)
itemsInfo.value.itemscount=0;
let itemscount=0
itemsInfo.value.items.forEach((v,i)=>{
if(v.keshi_name!="材料费")
itemscount=itemscount+v.children.length
})
itemsInfo.value.itemscount=itemscount
}
totalPrice.value = response.data.true_price;
total_original_price.value=response.data.original_price
tabIndex.value = 0;
contentInfo.value=contentInfo.value.flat()
});
};
const addCombo = () => {
//
let itemIds = $props.itemIds ? $props.itemIds : "";
let query = "?comboId=" + comboId.value + "&itemIds=" + itemIds;
if (groupId.value) {
query += "&groupId=" + groupId.value;
}
if($props.wj){
query +="&wj="+$props.wj
}
uni.navigateTo({
url: "/pages/main/tj/tjzx?" + query,
});
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
}
};
const toreadme=()=>{
GetReadmeDetails();
popupTip.value.close()
}
onShow(() => {
if (!!config_ref.value) {
mountedAction();
}
});
</script>
<template>
<uni-popup ref="popupTip">
<view
class="mb-70rpx bg-#fff text-center box-border pt-80rpx pb-50rpx px-65rpx w-90vw rounded-15rpx"
>
<view
class="w-full text-center text-##090909 text-26rpx line-height-[50rpx]"
>您还剩余
{{ losePrice }}
元体检额度尚未使用确认提交后剩余体检额度将无法使用!</view
>
<view class="mt-50rpx between">
<button
type="primary"
@click="toreadme()"
class="w-196rpx h-68rpx center text-#fff text-24rpx !bg-#239EA3 rounded-8rpx"
>
我想好了
</button>
<button
@click="popupTip.close()"
class="w-196rpx h-68rpx center text-#239EA3 text-24rpx !bg-#D9F3F2 rounded-8rpx"
>
我再想想
</button>
</view>
</view>
</uni-popup>
<DraggableButton />
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
</view>
<view v-if="[1,2].indexOf(status) !== -1">
<!-- 1个检套餐 显示套餐信息 -->
<view class="combo_name_row" >
<text v-if="status==2"> </text>
<text v-if="status==1">{{ comboInfo.combo_name }}</text>
</view>
</view>
<view class="px-30rpx box-border comboInfo">
<view v-if="status != 1 && status!=2" class="pt-35rpx rounded-15rpx px-10rpx bg-#fff pb-30rpx box-border b-0 b-t-1 b-solid b-#E1ECEE">
<view class="px-15rpx pt-10rpx">
<!-- 2个检自选 3团检套餐 4团检自选 都要显示头像和名字 -->
<view class="flex items-center">
<image src="@/static/assets/userm.png" class="w-70rpx h-70rpx mr-35rpx" />
<view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{
groupId ? groupInfo.name : $store.getUser().name
}}</text>
</view>
</view>
<view v-if="status != 2" class="text-24rpx mt-40rpx">
<!-- 3团检套餐 4团检自选 都要显示单位部门等信息 -->
<view class="pb-30rpx">
<text class="text-#8B8B8B">单位名称</text>
<text>{{ groupInfo.group_name }}</text>
</view>
<view class="pb-30rpx">
<text class="text-#8B8B8B">部门名称</text>
<text>{{ groupInfo.bumen_name }}</text>
</view>
<view class="pb-30rpx" v-if="groupInfo.combo_name || comboInfo?.combo_name">
<text class="text-#8B8B8B">套餐名称</text>
<text>{{ groupInfo.combo_name || comboInfo?.combo_name }}</text>
</view>
<view>
<text class="text-#8B8B8B">体检额度</text>
<text>{{ groupInfo.tongshou_xiane }}</text>
</view>
</view>
</view>
</view>
<view class="pb-150rpx">
<view class="flex items-center justify-around px-30rpx pl-150rpx pt-30rpx">
<view>
<text class="text-30rpx text-#2E2E2E">套餐项目</text>
<span v-if="status==1 && JSON.stringify(comboInfo) !== '{}'" class="combo_tag_wrapper" >{{ comboInfo?.tags[0]?.text }}</span>
<span v-if="status==2" class="combo_tag_wrapper">{{ itemsInfo?.itemscount }}</span>
</view>
</view>
<view class="mt--10rpx bg-#fff py-40rpx px-14rpx box-border flex-col flex">
<!-- 套餐内容 -->
<view v-if="contentInfo.length>0" class="mb-20rpx">
<!-- 套餐项目 -->
<view class="flex h-58rpx bg-#239ea3 mb-26rpx text-#fff text-26rpx rounded-10rpx">
<view class="min-w-220rpx max-w-220rpx keshi_name_k">体检流程</view>
<view class="grow center">检查项目</view>
</view>
<view v-for="(val, index) in contentInfo" :key="index">
<view v-if="val.keshi_name != '材料费'">
<view class="flex h-58rpx bg-#E6F5F6 text-#333 text-27rpx rounded-10rpx mt-10rpx">
<view class="min-w-250rpx max-w-250rpx keshi_name_k ">{{index+1}}.{{ val.keshi_name }}</view>
<view class="grow center">{{ val.children.length }}个项目</view>
<view class="grow center xiangqingbutton" @click="opendDetail(index)"><span style="font-size: 12rpx;">>></span></view>
</view>
<view v-if="active_keshi.indexOf(index)!== -1">
<view class="xian mt-10rpx "></view>
<view class=" bg-#FBFBFB text-#000 text-24rpx rounded-10rpx p-20rpx little_item_k " v-for="(v, i) in val.children"
:key="i">
<view style="display: flex; align-items: center;">
<view class="break-all box-border ">
{{ v.name }}
</view>
<view class="wenhao">?</view>
</view>
<view class="grow text-20rpx text-#E95513 mt-10rpx box-border">{{ v.desc || "-" }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<uni-popup ref="popupXuZhi">
<view class="tishi_main">
<!-- 体检须知 -->
<view class="text-#2E2E2E text-30rpx font-900 text-center">
体检须知
</view>
<view class="text-28rpx text-#2E2E2E">
<image class="w-5rpx h-26rpx" src="@/static/assets/slices/tjcol2x.png"></image>
体检须知
</view>
<view class="flex flex-justify-around text-#111111 text-28rpx pt-24rpx pb-50rpx">
<view class="flex flex-col flex-items-center">
<image class="w-80rpx h-80rpx" src="@/static/assets/slices/xgtc.png"></image>
选购套餐
</view>
<view class="pt-25rpx">
<image class="w-30rpx h-30rpx" src="@/static/assets/slices/lt.png"></image>
</view>
<view class="flex flex-col flex-items-center">
<image class="w-80rpx h-80rpx" src="@/static/assets/slices/yytj.png"></image>
预约体检
</view>
<view class="pt-25rpx">
<image class="w-30rpx h-30rpx" src="@/static/assets/slices/lt.png"></image>
</view>
<view class="flex flex-col flex-items-center">
<image class="w-80rpx h-80rpx" src="@/static/assets/slices/qwty.png"></image>
前往体检
</view>
<view class="pt-25rpx">
<image class="w-30rpx h-30rpx" src="@/static/assets/slices/lt.png"></image>
</view>
<view class="flex flex-col flex-items-center">
<image class="w-80rpx h-80rpx" src="@/static/assets/slices/lqbg.png"></image>
领取报告
</view>
</view>
<view class="pb-20rpx text-28rpx text-#2E2E2E">
<image class="w-5rpx h-26rpx" src="@/static/assets/slices/tjcol2x.png"></image>
体检注意事项
</view>
<view v-html="notice.content" class="text-20rpx" style="line-height: 40rpx;"></view>
<view class="tishi_button" @click="buy(2)" >我已知晓</view>
</view>
</uni-popup>
</view>
<view class="fixed bottom-0 h-150rpx left-0 w-full bg-gradient-to-r from-#02b4bd to-#ABD7D7 p-30rpx box-border between">
<view class="grow">
<view class="flex items-end" v-if="comboId != 0">
<text class="original_price_wrapper">¥ {{ total_original_price }}</text>
</view>
<view class="flex items-end">
<text class="text-42rpx text-#ED6907 mr-20rpx font-bold">¥{{
totalPrice
}}</text>
</view>
</view>
<view class="flex">
<button @click="addCombo()" class="button bgcolor_huang">
增加项目
</button>
<button @click="buy(1)" class="button">
立即支付
</button>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.comboInfo {
position: relative;
z-index: 1;
background-color: #fff;
min-height: calc(100vh - 200rpx);
.active {
color: #239ea3;
font-weight: bold;
position: relative;
&::after {
content: "";
width: 26rpx;
height: 3rpx;
background-color: #239ea3;
position: absolute;
left: 50%;
bottom: -10rpx;
transform: translateX(-50%);
}
}
}
</style>
<style scoped>
.combo_name_row{
text-align: center;
background-color: #EEF7F7;
color: #009FA8;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
}
.keshi_name_k{
line-height: 58rpx;
padding-left: 30rpx;
}
.xian{
height: 6rpx;
border-radius: 6rpx;
background-color: #B0E0E2;
}
.combo_tag_wrapper {
padding-left: 13rpx;
padding-right: 13rpx;
height: 28rpx;
line-height: 28rpx;
border-radius: 5rpx;
font-weight: 900;
font-size: 18rpx;
color: #47abd8;
margin: 10rpx 8rpx 10rpx 10rpx;
border: 3rpx solid #009FA8;
}
.little_item_k{
border-bottom: 1px solid #ccc;
}
.wenhao{
height: 18rpx;
width: 18rpx;
background-color: #009FA8;
line-height: 18rpx;
border-radius: 18rpx;
color: #fff;
text-align: center;
font-size: 14rpx;
margin-left: 10rpx;
}
.xiangqingbutton{
color:#009FA8;
font-size: 17rpx;
}
.button {
color: #00828e;
background-color: #fff;
height: 58rpx;
line-height: 58rpx;
text-align: center;
width: 174rpx;
border-radius: 58rpx;
margin-right: 20rpx;
font-size: 29rpx;
}
.bgcolor_huang{
background-color: #FF6D00;
color: #fff;
}
.original_price_wrapper {
font-weight: bolder;
font-size: 18rpx;
color: #333;
line-height: 1;
text-decoration-line: line-through;
}
.tishi_main{
background-color: #fff;
padding: 40rpx 50rpx;
width:600rpx;
border-radius: 40rpx;
}
.tishi_button{
width: 365rpx;
background-color: #009da5;
color:#fff;
text-align: center;
padding-top: 10rpx;
padding-bottom: 10rpx;
border-radius: 40rpx;
margin: 20rpx auto 10rpx auto;
}
</style>

@ -0,0 +1,595 @@
<script setup>
import DraggableButton from "@/pages/components/goHome.vue";
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import { ref } from "vue";
import { $api, $response, $image } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
// comboId ID ID
// itemIds ID
const $props = defineProps({
comboId: {
type: String,
default: "",
},
itemIds: {
type: String,
default: "",
},
personId: {
type: String,
default: "",
},
groupId: {
type: String,
default: "",
},
wj: {
type: String,
default: "",
},
});
const $store = useStore();
let wj = ref(""); //
let leftList = ref({}); //
let tabIndex = ref(""); //
let rightLeft = ref([]); //
let selectIds = ref([]); // id
let headImg = ref(""); //
let packagePrice = ref(0); //
let packageOriginalPrice = ref(0); //
let optionalPrice = ref(0); //
let optionalOriginalPrice = ref(0); //
let totalPrice = ref(0); //
let totalOriginalPrice = ref(0); //
let total = ref(0); //
let comboId = ref(""); // id
let recommendPackageList = ref([]); //
let popup = ref(null); //
let popupTip = ref(null); //
let groupLength = ref(0); //
let status = ref(0); // 1 2 3 4
let personId = ref(""); // ID
let groupId = ref(""); // id
let losePrice = ref(0); //
// let query = ref(""); //
const getComboRecommend = async () => {
//
const response = await $api("ComboRecommend", {
person_id: personId.value,
item_ids: selectIds.value,
});
$response(response, () => {
recommendPackageList.value = response.data.combos;
if (recommendPackageList.value.length > 0) {
popup.value.open("center");
} else {
toDetails();
}
uni.hideLoading();
});
};
const getAllItems = async (e) => {
//
const response = await $api("GetAllItems", {
search: e?.value,
});
$response(response, () => {
leftList.value = response.data.list;
if (Object.keys(leftList.value).length) {
let keys = Object.keys(leftList.value);
tabIndex.value = keys[0];
rightLeft.value = leftList.value[keys[0]].children;
headImg.value = leftList.value[keys[0]].head_img;
}
});
};
const getBuyInfo = async () => {
//
uni.showLoading({
title: "加载中",
});
let obj = {
item_ids: selectIds.value,
hospital: $store.save_info.hospital,
person_id: personId.value,
group_id: groupId.value,
combo_id: comboId.value,
wj: wj.value,
};
if (comboId.value) {
obj.combo_id = comboId.value;
}
const response = await $api("BuyInfo", obj);
console.log(response)
if(response.status===false){
uni.hideLoading();
uni.$lu.toast(response.msg);
return false;
}
$response(response, () => {
groupLength.value = response.data.group_info
? response.data.group_info[0]?.items?.length
: 0;
packagePrice.value = response.data.combo_info.price;
packageOriginalPrice.value = response.data.combo_info.original_price;
optionalPrice.value = response.data.items_info.price;
optionalOriginalPrice.value = response.data.items_info.original_price;
totalPrice.value = response.data.true_price;
totalOriginalPrice.value = response.data.original_price;
total.value = response.data.pay_item_count;
losePrice.value = response.data.lose_price;
if (status.value == 4 && groupLength.value) {
// ID
status.value = 3;
}
uni.hideLoading();
});
};
const confirm = async () => {
//
// status 1 2 3 4
if (status.value == 3) {
//
// query.value = "?groupId=" +
// groupId.value +
// "&itemIds=" +
// itemIds +
// "&comboId=" +
// comboId.value;
}
if (status.value == 4) {
//
if (!selectIds.value.length) {
uni.$lu.toast("请选择项目");
return;
}
if (!groupLength.value) {
//
getComboRecommend();
return;
}
}
if (status.value == 1) {
//
// query.value = "?itemIds=" + itemIds + "&comboId=" + comboId.value;
}
if (status.value == 2) {
//
// query.value = "?itemIds=" + itemIds + "&personId=" + personId.value;
if (!selectIds.value.length) {
uni.$lu.toast("请选择项目");
return;
}
//
getComboRecommend();
return;
}
toDetails();
};
const toDetails = (state) => {
//
if (losePrice.value > 0 && !state) {
// popupTip.value.open("center"); //
//return;
}
const itemIds = selectIds.value.length > 0 ? selectIds.value.join(",") : "";
let query = "?comboId=" + comboId.value + "&itemIds=" + itemIds;
if (groupId.value) {
query += "&groupId=" + groupId.value;
}
if($props.wj){
query +="&wj="+$props.wj
}
console.log($props.comboId || $props.itemIds ? 2 : 1);
let delta = 0;
if (groupId.value) {
if (groupLength.value) {
delta = 2;
} else {
if ($props.comboId || $props.itemIds) {
delta = 2;
} else {
delta = 1;
}
}
} else {
if ($props.comboId || $props.itemIds) {
delta = 2;
} else {
delta = 1;
}
}
uni.navigateBack({
delta: delta,
success: () => {
let time = setTimeout(
() => {
clearTimeout(time);
uni.navigateTo({
url: "/pages/main/tj/tjxq" + query,
});
},
delta == 2 ? 800 : 500
);
},
});
};
const buy = async (item) => {
if (item) {
comboId.value = item.combo_id;
selectIds.value=[];
await getBuyInfo();
}
//
popup.value.close(); //
toDetails();
};
const mountedAction = async () => {
selectIds.value = $props.itemIds ? $props.itemIds.split(",") : [];
comboId.value = $props.comboId || "";
personId.value = $store.getUser().person_id || "";
groupId.value = $props.groupId || "";
wj.value = $props.wj || "";
if (groupId.value) {
if (comboId.value) {
//
status.value = 3;
} else {
//
status.value = 4;
}
} else {
if (comboId.value) {
//
status.value = 1;
} else {
//
status.value = 2;
}
}
console.log(status.value, "1个检套餐 2个检自选 3团检套餐 4团检自选");
await getAllItems(); //
// await getComboRecommend();
await getBuyInfo(); //
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
}
};
const XuanZeItem= async (item)=>{
let doi=""
if(selectIds.value.includes(item.id)){
selectIds.value.splice(selectIds.value.indexOf(item.id),1);
doi="del"
}else{
selectIds.value.push(item.id);
doi="add"
}
let a= await getBuyInfo()
if(a===false){
if(doi=="add"){
selectIds.value.splice(selectIds.value.indexOf(item.id),1);
}
if(doi=="del"){
selectIds.value.push(item.id);
}
}
}
onShow(() => {
if (!!config_ref.value) {
mountedAction();
}
});
</script>
<template>
<DraggableButton />
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
</view>
<uni-popup ref="popupTip">
<view
class="mb-70rpx bg-#fff text-center box-border pt-80rpx pb-50rpx px-65rpx w-90vw rounded-15rpx"
>
<view
class="w-full text-center text-##090909 text-26rpx line-height-[50rpx]"
>您还剩余
{{ losePrice }}
元体检额度尚未使用确认提交后剩余体检额度将无法使用!</view
>
<view class="mt-50rpx between">
<button
type="primary"
@click="toDetails(1)"
class="w-196rpx h-68rpx center text-#fff text-24rpx !bg-#239EA3 rounded-8rpx"
>
我想好了
</button>
<button
@click="popupTip.close()"
class="w-196rpx h-68rpx center text-#239EA3 text-24rpx !bg-#D9F3F2 rounded-8rpx"
>
我再想想
</button>
</view>
</view>
</uni-popup>
<uni-popup ref="popup">
<view class="bg-#fff rounded-15rpx w-95vw px-20rpx box-border">
<view class="center relative pt-47rpx pb-32rpx text-36rpx">
<text class="line-height-[1]">推荐套餐</text>
<uni-icons
@click="popup.close()"
type="closeempty"
color="#A6A6A6"
size="26"
class="absolute right-40rpx top-30rpx"
></uni-icons>
</view>
<view
v-for="(item, index) in recommendPackageList"
:key="index"
class="pt-40rpx pb-15rpx box-border b-0 b-t-1 b-solid b-#E1ECEE"
>
<view class="flex w-full">
<image
v-if="item.cover"
:src="$image(item.cover)"
class="w-190rpx h-190rpx mr-37rpx"
mode="widthFix"
/>
<view class="flex flex-col grow">
<text
>{{ item.name }}</text
>
<view class="mt-13rpx mb-18rpx">
<uni-tag
v-for="(val, i) in item.tags"
:key="i"
size="small"
:inverted="true"
:text="val.text"
class="mr-8rpx"
:custom-style="
'background-color:' +
val.color +
';border-color:' +
val.color +
'; color:' +
val.text_color +
';'
"
/>
</view>
<view>
<text
v-for="(val, i) in item.tags2"
:key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-r-2 b-solid b-#8B8B8B"
>{{ val }}</text
>
</view>
<view class="mt-20rpx w-full flex items-end">
<text class="text-18rpx text-#EC3D15">¥</text>
<text class="text-38rpx text-#EC3D15 mx-10rpx -mb-8rpx">{{
item.price
}}</text>
<text class="text-18rpx text-#878787 line-through">{{
item.original_price
}}</text>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx"
>已售{{ item.count }}</text
>
</view>
</view>
</view>
<view class="between mt-30rpx">
<view class="text-#8B8B8B text-22rpx">
相似度
<text class="text-#239EA3">{{ item.recommend?.xiangsidu }}</text>
{{ item.recommend?.count > 0 ? "增加" : "减少" }}
<text class="text-#239EA3">{{
Math.abs(item.recommend?.count)
}}</text>
个项目{{
Number(item.recommend?.money.replace(/,/, "")) > 0
? "增加"
: "减少"
}}
<text class="text-#239EA3"
>{{ item.recommend?.money.replace(/-/, "") }}</text
>
</view>
<button
type="primary"
@click="buy(item)"
class="w-160rpx h-60rpx center text-#fff text-28rpx !bg-#239EA3 rounded-full"
>
预约
</button>
</view>
</view>
<view class="b-0 b-t-1 b-solid b-#E1ECEE pt-80rpx pb-70rpx">
<button
type="primary"
@click="buy()"
class="w-300rpx h-78rpx center text-#fff text-30rpx !bg-#239EA3 rounded-10rpx"
>
跳过
</button>
</view>
</view>
</uni-popup>
<view class="bg-#d8edf2">
<uni-search-bar
class="search"
radius="100"
placeholder="请输入关键字搜索"
@clear="getAllItems()"
@cancel="getAllItems()"
@confirm="getAllItems"
/>
</view>
<view class="mt-20rpx flex min-h-100%">
<view class="min-w-214rpx max-w-214rpx mr-20rpx min-h-100% text-center">
<view
class="w-100% rounded-r-full text-#0E0E0E text-25rpx px-20rpx w-100% center h-84rpx box-border"
v-for="(item, index) in leftList"
:key="index"
:class="{
'bg-gradient-to-r from-#edf6f5 to-#bbdfe2': tabIndex == index,
}"
@click="
() => {
tabIndex = index;
rightLeft = item.children;
headImg = item.head_img;
}
"
>
{{ item.title }}
</view>
<view style="height: 150rpx;"></view>
</view>
<view class="grow min-h-100% bg-#fff pb-200rpx">
<image
v-if="headImg"
class="w-full"
mode="widthFix"
:src="$image(headImg)"
></image>
<view
v-for="(item, index) in rightLeft"
:key="index"
:class="{
'!b-0': index == rightLeft.length - 1,
}"
class="flex justify-between center py-30rpx px-20rpx b-b-1px b-b-solid b-b-#e5e5e5"
>
<view class="w-40% text-#0E0E0E text-25rpx flex items-center">
<text>{{ item.title }}</text>
<uni-tooltip>
<!-- 定义插槽插槽名为 content -->
<template v-slot:content>
<!-- 在这里编写自定义的 HTML 或组件 -->
<view class="w-30vw">
<text>{{ item.desc }}</text>
</view>
</template>
<!-- 触发提示的按钮 -->
<uni-icons color="#239ea4" type="help-filled" size="14"></uni-icons>
</uni-tooltip>
</view>
<view
class="w-58% items-end flex justify-between"
@click="XuanZeItem(item)"
>
<text class="text-#EC3D15 text-26rpx">¥ {{ item.price }}</text>
<text class="text-#9e9d9d text-20rpx line-through"
>¥ {{ item.original_price }}</text
>
<view
:class="{
'!bg-#EEA61E !b-#EEA61E': selectIds.includes(item.id),
}"
class="w-24rpx h-24rpx b-1 b-solid b-#DCDCDC bg-#F8F8F8 rounded-3rpx center"
>
<image
v-if="selectIds.includes(item.id)"
class="w-20rpx"
src="@/static/assets/select.png"
mode="widthFix"
/>
</view>
</view>
</view>
</view>
</view>
<view
class="fixed bottom-0 left-0 w-100% h-135rpx bg-#fff px-20rpx py-30rpx box-border items-center flex justify-between"
>
<text
class="text-26rpx text-#121212 b-r-1 b-r-solid b-#8D9698 pr-12rpx mr-12rpx min-w-120rpx max-w-120rpx"
>
您需付费 \n{{ total }}个项目
</text>
<view class="grow">
<view class="flex items-end" v-if="comboId != 0">
<text class="text-18rpx text-#878787">套餐价格</text>
<text class="text-21rpx text-#ED6907 mx-20rpx"
>¥ {{ packagePrice }}</text
>
<text class="text-18rpx text-#878787 line-through"
>¥ {{ packageOriginalPrice }}</text
>
</view>
<view class="flex items-end">
<text class="text-18rpx text-#878787">自选项目价格</text>
<text class="text-21rpx text-#ED6907 mx-20rpx"
>¥ {{ optionalPrice || 0 }}</text
>
<text
v-if="optionalOriginalPrice"
class="text-18rpx text-#878787 line-through"
>¥ {{ optionalOriginalPrice }}</text
>
</view>
<view class="flex items-end">
<text class="text-18rpx text-#ED6907">合计费用</text>
<text class="text-24rpx text-#ED6907 ml-20rpx mr-5rpx">¥</text>
<text class="text-36rpx text-#ED6907 mr-20rpx font-bold">{{
totalPrice || 0
}}</text>
<text
v-if="totalOriginalPrice"
class="text-18rpx text-#878787 line-through"
>¥ {{ totalOriginalPrice }}</text
>
</view>
</view>
<button
type="primary"
@click="confirm()"
class="text-#F8F8F8 w-240rpx h-hull rounded-full !bg-#239EA3 !mx-0 text-30rpx"
>
确定
</button>
</view>
</template>
<style>
.uni-tooltip-popup {
background-color: #fff;
}
</style>

@ -5,10 +5,20 @@ import DraggableButton from "@/pages/components/goHome.vue";
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import { ref } from "vue";
import { $api, $response, $image } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
import {
ref
} from "vue";
import {
$api,
$response,
$image
} from "@/api";
import {
onShow
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
// comboId ID ID
// itemIds ID
@ -42,6 +52,8 @@ let leftList = ref({}); // 左侧列表
let tabIndex = ref(""); //
let rightLeft = ref([]); //
let selectIds = ref([]); // id
let selectItems = ref([]); //
let BuyInfo = ref(""); //BuyInfo
let headImg = ref(""); //
let packagePrice = ref(0); //
let packageOriginalPrice = ref(0); //
@ -60,6 +72,7 @@ let personId = ref(""); // 就诊人ID
let groupId = ref(""); // id
let losePrice = ref(0); //
// let query = ref(""); //
let popupItemList = ref(null); //
const getComboRecommend = async () => {
//
@ -119,16 +132,17 @@ const getBuyInfo = async () => {
}
$response(response, () => {
groupLength.value = response.data.group_info
? response.data.group_info[0]?.items?.length
: 0;
groupLength.value = response.data.group_info ?
response.data.group_info[0]?.items?.length :
0;
packagePrice.value = response.data.combo_info.price;
packageOriginalPrice.value = response.data.combo_info.original_price;
optionalPrice.value = response.data.items_info.price;
optionalOriginalPrice.value = response.data.items_info.original_price;
BuyInfo.value = response.data;
totalPrice.value = response.data.true_price;
totalOriginalPrice.value = response.data.original_price;
total.value = response.data.pay_item_count;
//total.value = response.data.pay_item_count;
losePrice.value = response.data.lose_price;
if (status.value == 4 && groupLength.value) {
// ID
@ -302,6 +316,25 @@ const XuanZeItem= async (item)=>{
}
}
const openPopupItemList = () => {
selectItems.value = [];
if (BuyInfo.value.items_info) {
BuyInfo.value.items_info.items.forEach((v, i) => {
v.children.forEach((v2, i2) => {
selectItems.value.push(v2)
})
})
}
if (selectItems.value.length > 0) {
popupItemList.value.open()
}
}
const ClearItems=async()=>{
selectIds.value=[];
await getBuyInfo()
popupItemList.value.close()
}
onShow(() => {
if (!!config_ref.value) {
mountedAction();
@ -315,28 +348,50 @@ onShow(() => {
<view :ref="configRef"></view>
</view>
</view>
<uni-popup ref="popupItemList" type="bottom">
<view class="popupItemList-content">
<view style="display: flex;justify-content: space-between;margin-bottom: 34rpx;">
<view style="font-size: 30rpx;">已加购项目</view>
<view style="color: #9E9E9F;display: flex;align-items: center;" @click="ClearItems()">
<uni-icons type="trash" color="#9E9E9F" size="20"></uni-icons>
<view style="font-size: 20rpx;">清空</view>
</view>
</view>
<view v-for="(item,index) in selectItems">
<view class="itemlist_list" @click="XuanZeItem(item)">
<view>
<view style="display: flex; align-items: center;margin-bottom: 20rpx;">
<view class="itemlist_bianhao">{{index+1}}</view>
<view class="itemlist_itemname">{{item.name}}</view>
</view>
<view style="display: flex;align-items: end;">
<view class="itemlist_price"><span style="font-size: 20rpx;"></span>{{item.price}}</view>
<view class="itemlist_org_price line-through">{{item.original_price}}</view>
</view>
</view>
<view :class="{
'!bg-#009fa8 !b-#008e99': selectIds.includes(item.id),
}" class="w-24rpx h-24rpx b-1 b-solid b-#009fa8 bg-#fff rounded-24rpx center">
<image v-if="selectIds.includes(item.id)" class="w-20rpx" src="@/static/assets/select.png"
mode="widthFix" />
</view>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="popupTip">
<view
class="mb-70rpx bg-#fff text-center box-border pt-80rpx pb-50rpx px-65rpx w-90vw rounded-15rpx"
>
<view
class="w-full text-center text-##090909 text-26rpx line-height-[50rpx]"
>您还剩余
<view class="mb-70rpx bg-#fff text-center box-border pt-80rpx pb-50rpx px-65rpx w-90vw rounded-15rpx">
<view class="w-full text-center text-##090909 text-26rpx line-height-[50rpx]">您还剩余
{{ losePrice }}
元体检额度尚未使用确认提交后剩余体检额度将无法使用!</view
>
元体检额度尚未使用确认提交后剩余体检额度将无法使用!
</view>
<view class="mt-50rpx between">
<button
type="primary"
@click="toDetails(1)"
class="w-196rpx h-68rpx center text-#fff text-24rpx !bg-#239EA3 rounded-8rpx"
>
<button type="primary" @click="toDetails(1)"
class="w-196rpx h-68rpx center text-#fff text-24rpx !bg-#239EA3 rounded-8rpx">
我想好了
</button>
<button
@click="popupTip.close()"
class="w-196rpx h-68rpx center text-#239EA3 text-24rpx !bg-#D9F3F2 rounded-8rpx"
>
<button @click="popupTip.close()"
class="w-196rpx h-68rpx center text-#239EA3 text-24rpx !bg-#D9F3F2 rounded-8rpx">
我再想想
</button>
</view>
@ -346,39 +401,19 @@ onShow(() => {
<view class="bg-#fff rounded-15rpx w-95vw px-20rpx box-border">
<view class="center relative pt-47rpx pb-32rpx text-36rpx">
<text class="line-height-[1]">推荐套餐</text>
<uni-icons
@click="popup.close()"
type="closeempty"
color="#A6A6A6"
size="26"
class="absolute right-40rpx top-30rpx"
></uni-icons>
</view>
<view
v-for="(item, index) in recommendPackageList"
:key="index"
class="pt-40rpx pb-15rpx box-border b-0 b-t-1 b-solid b-#E1ECEE"
>
<uni-icons @click="popup.close()" type="closeempty" color="#A6A6A6" size="26"
class="absolute right-40rpx top-30rpx"></uni-icons>
</view>
<view v-for="(item, index) in recommendPackageList" :key="index"
class="pt-40rpx pb-15rpx box-border b-0 b-t-1 b-solid b-#E1ECEE">
<view class="flex w-full">
<image
v-if="item.cover"
:src="$image(item.cover)"
class="w-190rpx h-190rpx mr-37rpx"
mode="widthFix"
/>
<image v-if="item.cover" :src="$image(item.cover)" class="w-190rpx h-190rpx mr-37rpx"
mode="widthFix" />
<view class="flex flex-col grow">
<text
>{{ item.name }}</text
>
<text>{{ item.name }}</text>
<view class="mt-13rpx mb-18rpx">
<uni-tag
v-for="(val, i) in item.tags"
:key="i"
size="small"
:inverted="true"
:text="val.text"
class="mr-8rpx"
:custom-style="
<uni-tag v-for="(val, i) in item.tags" :key="i" size="small" :inverted="true"
:text="val.text" class="mr-8rpx" :custom-style="
'background-color:' +
val.color +
';border-color:' +
@ -386,16 +421,11 @@ onShow(() => {
'; color:' +
val.text_color +
';'
"
/>
" />
</view>
<view>
<text
v-for="(val, i) in item.tags2"
:key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-r-2 b-solid b-#8B8B8B"
>{{ val }}</text
>
<text v-for="(val, i) in item.tags2" :key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-r-2 b-solid b-#8B8B8B">{{ val }}</text>
</view>
<view class="mt-20rpx w-full flex items-end">
<text class="text-18rpx text-#EC3D15">¥</text>
@ -405,9 +435,7 @@ onShow(() => {
<text class="text-18rpx text-#878787 line-through">{{
item.original_price
}}</text>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx"
>已售{{ item.count }}</text
>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx">已售{{ item.count }}</text>
</view>
</view>
</view>
@ -424,77 +452,48 @@ onShow(() => {
? "增加"
: "减少"
}}
<text class="text-#239EA3"
>{{ item.recommend?.money.replace(/-/, "") }}</text
>
</view>
<button
type="primary"
@click="buy(item)"
class="w-160rpx h-60rpx center text-#fff text-28rpx !bg-#239EA3 rounded-full"
>
<text class="text-#239EA3">{{ item.recommend?.money.replace(/-/, "") }}</text>
</view>
<button type="primary" @click="buy(item)"
class="w-160rpx h-60rpx center text-#fff text-28rpx !bg-#239EA3 rounded-full">
预约
</button>
</view>
</view>
<view class="b-0 b-t-1 b-solid b-#E1ECEE pt-80rpx pb-70rpx">
<button
type="primary"
@click="buy()"
class="w-300rpx h-78rpx center text-#fff text-30rpx !bg-#239EA3 rounded-10rpx"
>
<button type="primary" @click="buy()"
class="w-300rpx h-78rpx center text-#fff text-30rpx !bg-#239EA3 rounded-10rpx">
跳过
</button>
</view>
</view>
</uni-popup>
<view class="bg-#d8edf2">
<uni-search-bar
class="search"
radius="100"
placeholder="请输入关键字搜索"
@clear="getAllItems()"
@cancel="getAllItems()"
@confirm="getAllItems"
/>
</view>
<view class="mt-20rpx flex min-h-100%">
<uni-search-bar class="search" radius="100" placeholder="请输入关键字搜索" @clear="getAllItems()"
@cancel="getAllItems()" @confirm="getAllItems" />
</view>
<view class="mt-20rpx flex min-h-100%" style="background-color: #eef7f7;">
<view class="min-w-214rpx max-w-214rpx mr-20rpx min-h-100% text-center">
<view
class="w-100% rounded-r-full text-#0E0E0E text-25rpx px-20rpx w-100% center h-84rpx box-border"
v-for="(item, index) in leftList"
:key="index"
:class="{
<view class="w-100% rounded-r-full text-#0E0E0E text-25rpx px-20rpx w-100% center h-84rpx box-border"
v-for="(item, index) in leftList" :key="index" :class="{
'bg-gradient-to-r from-#edf6f5 to-#bbdfe2': tabIndex == index,
}"
@click="
}" @click="
() => {
tabIndex = index;
rightLeft = item.children;
headImg = item.head_img;
}
"
>
">
{{ item.title }}
</view>
<view style="height: 150rpx;"></view>
</view>
<view class="grow min-h-100% bg-#fff pb-200rpx">
<image
v-if="headImg"
class="w-full"
mode="widthFix"
:src="$image(headImg)"
></image>
<view
v-for="(item, index) in rightLeft"
:key="index"
:class="{
<view v-for="(item, index) in rightLeft" :key="index" :class="{
'!b-0': index == rightLeft.length - 1,
}"
class="flex justify-between center py-30rpx px-20rpx b-b-1px b-b-solid b-b-#e5e5e5"
>
<view class="w-40% text-#0E0E0E text-25rpx flex items-center">
}" class="flex justify-between center py-30rpx px-20rpx b-b-1px b-b-solid b-b-#e5e5e5">
<view class="w-40% text-#0E0E0E text-24rpx flex items-center">
<text>{{ item.title }}</text>
<uni-tooltip>
<!-- 定义插槽插槽名为 content -->
@ -506,86 +505,44 @@ onShow(() => {
</template>
<!-- 触发提示的按钮 -->
<uni-icons color="#239ea4" type="help-filled" size="14"></uni-icons>
<uni-icons color="#009fa8" type="help-filled" size="14"></uni-icons>
</uni-tooltip>
</view>
<view
class="w-58% items-end flex justify-between"
@click="XuanZeItem(item)"
>
<view class="w-58% items-end flex justify-between" @click="XuanZeItem(item)">
<text class="text-#EC3D15 text-26rpx">¥ {{ item.price }}</text>
<text class="text-#9e9d9d text-20rpx line-through"
>¥ {{ item.original_price }}</text
>
<view
:class="{
'!bg-#EEA61E !b-#EEA61E': selectIds.includes(item.id),
}"
class="w-24rpx h-24rpx b-1 b-solid b-#DCDCDC bg-#F8F8F8 rounded-3rpx center"
>
<image
v-if="selectIds.includes(item.id)"
class="w-20rpx"
src="@/static/assets/select.png"
mode="widthFix"
/>
<text class="text-#9e9d9d text-20rpx line-through">¥ {{ item.original_price }}</text>
<view :class="{
'!bg-#009fa8 !b-#008e99': selectIds.includes(item.id),
}" class="w-24rpx h-24rpx b-1 b-solid b-#c3e9eb bg-#ccecee rounded-8rpx center">
<image v-if="selectIds.includes(item.id)" class="w-20rpx" src="@/static/assets/select.png"
mode="widthFix" />
</view>
</view>
</view>
</view>
</view>
<view
class="fixed bottom-0 left-0 w-100% h-135rpx bg-#fff px-20rpx py-30rpx box-border items-center flex justify-between"
>
<text
class="text-26rpx text-#121212 b-r-1 b-r-solid b-#8D9698 pr-12rpx mr-12rpx min-w-120rpx max-w-120rpx"
>
您需付费 \n{{ total }}个项目
</text>
<view class="grow">
<view class="flex items-end" v-if="comboId != 0">
<text class="text-18rpx text-#878787">套餐价格</text>
<text class="text-21rpx text-#ED6907 mx-20rpx"
>¥ {{ packagePrice }}</text
>
<text class="text-18rpx text-#878787 line-through"
>¥ {{ packageOriginalPrice }}</text
>
<view style="z-index: 999;"
class="fixed bottom-0 left-0 w-100% h-150rpx bg-gradient-to-r from-#02b4bd to-#ABD7D7 px-20rpx py-30rpx box-border items-center flex justify-between">
<view style="position: relative;" class="w-110rpx h-129rpx ml-60rpx mt-5rpx" @click="openPopupItemList()">
<image class="w-110rpx h-129rpx" src="@/static/assets/buy/xiong.png" mode="widthFix" />
<view class="yuandian">
{{ selectIds.length }}
</view>
<view class="flex items-end">
<text class="text-18rpx text-#878787">自选项目价格</text>
<text class="text-21rpx text-#ED6907 mx-20rpx"
>¥ {{ optionalPrice || 0 }}</text
>
<text
v-if="optionalOriginalPrice"
class="text-18rpx text-#878787 line-through"
>¥ {{ optionalOriginalPrice }}</text
>
</view>
<view class="grow" style="margin-left: 10rpx;">
<view class="flex items-end">
<text class="text-18rpx text-#ED6907">合计费用</text>
<text class="text-24rpx text-#ED6907 ml-20rpx mr-5rpx">¥</text>
<text class="text-36rpx text-#ED6907 mr-20rpx font-bold">{{
totalPrice || 0
<text class="text-46rpx text-#e95513 ml-20rpx mr-5rpx">¥</text>
<text class="text-46rpx text-#e95513 mr-10rpx font-bold">{{
optionalPrice || 0
}}</text>
<text
v-if="totalOriginalPrice"
class="text-18rpx text-#878787 line-through"
>¥ {{ totalOriginalPrice }}</text
>
</view>
</view>
<button
type="primary"
@click="confirm()"
class="text-#F8F8F8 w-240rpx h-hull rounded-full !bg-#239EA3 !mx-0 text-30rpx"
>
确定
</button>
<text v-if="optionalOriginalPrice" class="text-26rpx text-#3e3a39 line-through">¥
{{ optionalOriginalPrice }}</text>
</view>
</view>
<view @click="confirm()" class="button">
确认项目
</view>
</view>
</template>
<style>
@ -593,3 +550,77 @@ onShow(() => {
background-color: #fff;
}
</style>
<style>
.button {
color: #00828e;
background-color: #fff;
height: 58rpx;
line-height: 58rpx;
text-align: center;
width: 174rpx;
border-radius: 58rpx;
margin-right: 20rpx;
font-size: 29rpx;
}
.popupItemList-content {
padding: 40rpx 40rpx 180rpx 40rpx;
border-radius: 40rpx;
background-color: #fff;
}
.yuandian {
position: absolute;
top: 55rpx;
right: -10rpx;
background-color: #E95513;
height: 26rpx;
width: 26rpx;
border-radius: 13rpx;
color: #fff;
font-size: 20rpx;
text-align: center;
font-weight: 900;
}
.itemlist_org_price {
color: #9E9E9F;
font-weight: bolder;
font-size: 18rpx;
margin-left: 10rpx;
padding-bottom: 5rpx;
}
.itemlist_price {
color: #E95513;
font-weight: bolder;
font-size: 32rpx;
}
.itemlist_itemname {
font-size: 30rpx;
font-weight: bolder;
}
.itemlist_list {
display: flex;
width: 100%;
justify-content: space-between;
border-bottom: 1px solid #00828e;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
align-items: center;
}
.itemlist_bianhao{
height: 26rpx;
width: 26rpx;
margin-right: 10rpx;
border-radius: 26rpx;
line-height: 26rpx;
color: #fff;
font-size: 20rpx;
font-weight: bolder;
text-align: center;
background: linear-gradient(to right, #67a8aa, #8ce7e7);
}
</style>

@ -1,626 +0,0 @@
<script setup>
import DraggableButton from "@/pages/components/goHome.vue";
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from "vue";
import {
$api,
$response,
$image
} from "@/api";
import {
onShow
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
// comboId ID ID
// itemIds ID
const $props = defineProps({
comboId: {
type: String,
default: "",
},
itemIds: {
type: String,
default: "",
},
personId: {
type: String,
default: "",
},
groupId: {
type: String,
default: "",
},
wj: {
type: String,
default: "",
},
});
const $store = useStore();
let wj = ref(""); //
let leftList = ref({}); //
let tabIndex = ref(""); //
let rightLeft = ref([]); //
let selectIds = ref([]); // id
let selectItems = ref([]); //
let BuyInfo = ref(""); //BuyInfo
let headImg = ref(""); //
let packagePrice = ref(0); //
let packageOriginalPrice = ref(0); //
let optionalPrice = ref(0); //
let optionalOriginalPrice = ref(0); //
let totalPrice = ref(0); //
let totalOriginalPrice = ref(0); //
let total = ref(0); //
let comboId = ref(""); // id
let recommendPackageList = ref([]); //
let popup = ref(null); //
let popupTip = ref(null); //
let groupLength = ref(0); //
let status = ref(0); // 1 2 3 4
let personId = ref(""); // ID
let groupId = ref(""); // id
let losePrice = ref(0); //
// let query = ref(""); //
let popupItemList = ref(null); //
const getComboRecommend = async () => {
//
const response = await $api("ComboRecommend", {
person_id: personId.value,
item_ids: selectIds.value,
});
$response(response, () => {
recommendPackageList.value = response.data.combos;
if (recommendPackageList.value.length > 0) {
popup.value.open("center");
} else {
toDetails();
}
uni.hideLoading();
});
};
const getAllItems = async (e) => {
//
const response = await $api("GetAllItems", {
search: e?.value,
});
$response(response, () => {
leftList.value = response.data.list;
if (Object.keys(leftList.value).length) {
let keys = Object.keys(leftList.value);
tabIndex.value = keys[0];
rightLeft.value = leftList.value[keys[0]].children;
headImg.value = leftList.value[keys[0]].head_img;
}
});
};
const getBuyInfo = async () => {
//
uni.showLoading({
title: "加载中",
});
let obj = {
item_ids: selectIds.value,
hospital: $store.save_info.hospital,
person_id: personId.value,
group_id: groupId.value,
combo_id: comboId.value,
wj: wj.value,
};
if (comboId.value) {
obj.combo_id = comboId.value;
}
const response = await $api("BuyInfo", obj);
console.log(response)
if (response.status === false) {
uni.hideLoading();
uni.$lu.toast(response.msg);
return false;
}
$response(response, () => {
groupLength.value = response.data.group_info ?
response.data.group_info[0]?.items?.length :
0;
packagePrice.value = response.data.combo_info.price;
packageOriginalPrice.value = response.data.combo_info.original_price;
optionalPrice.value = response.data.items_info.price;
optionalOriginalPrice.value = response.data.items_info.original_price;
BuyInfo.value = response.data;
totalPrice.value = response.data.true_price;
totalOriginalPrice.value = response.data.original_price;
//total.value = response.data.pay_item_count;
losePrice.value = response.data.lose_price;
if (status.value == 4 && groupLength.value) {
// ID
status.value = 3;
}
uni.hideLoading();
});
};
const confirm = async () => {
//
// status 1 2 3 4
if (status.value == 3) {
//
// query.value = "?groupId=" +
// groupId.value +
// "&itemIds=" +
// itemIds +
// "&comboId=" +
// comboId.value;
}
if (status.value == 4) {
//
if (!selectIds.value.length) {
uni.$lu.toast("请选择项目");
return;
}
if (!groupLength.value) {
//
getComboRecommend();
return;
}
}
if (status.value == 1) {
//
// query.value = "?itemIds=" + itemIds + "&comboId=" + comboId.value;
}
if (status.value == 2) {
//
// query.value = "?itemIds=" + itemIds + "&personId=" + personId.value;
if (!selectIds.value.length) {
uni.$lu.toast("请选择项目");
return;
}
//
getComboRecommend();
return;
}
toDetails();
};
const toDetails = (state) => {
//
if (losePrice.value > 0 && !state) {
// popupTip.value.open("center"); //
//return;
}
const itemIds = selectIds.value.length > 0 ? selectIds.value.join(",") : "";
let query = "?comboId=" + comboId.value + "&itemIds=" + itemIds;
if (groupId.value) {
query += "&groupId=" + groupId.value;
}
if ($props.wj) {
query += "&wj=" + $props.wj
}
console.log($props.comboId || $props.itemIds ? 2 : 1);
let delta = 0;
if (groupId.value) {
if (groupLength.value) {
delta = 2;
} else {
if ($props.comboId || $props.itemIds) {
delta = 2;
} else {
delta = 1;
}
}
} else {
if ($props.comboId || $props.itemIds) {
delta = 2;
} else {
delta = 1;
}
}
uni.navigateBack({
delta: delta,
success: () => {
let time = setTimeout(
() => {
clearTimeout(time);
uni.navigateTo({
url: "/pages/main/tj/tjxq" + query,
});
},
delta == 2 ? 800 : 500
);
},
});
};
const buy = async (item) => {
if (item) {
comboId.value = item.combo_id;
selectIds.value = [];
await getBuyInfo();
}
//
popup.value.close(); //
toDetails();
};
const mountedAction = async () => {
selectIds.value = $props.itemIds ? $props.itemIds.split(",") : [];
comboId.value = $props.comboId || "";
personId.value = $store.getUser().person_id || "";
groupId.value = $props.groupId || "";
wj.value = $props.wj || "";
if (groupId.value) {
if (comboId.value) {
//
status.value = 3;
} else {
//
status.value = 4;
}
} else {
if (comboId.value) {
//
status.value = 1;
} else {
//
status.value = 2;
}
}
console.log(status.value, "1个检套餐 2个检自选 3团检套餐 4团检自选");
await getAllItems(); //
// await getComboRecommend();
await getBuyInfo(); //
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
}
};
const XuanZeItem = async (item) => {
let doi = ""
if (selectIds.value.includes(item.id)) {
selectIds.value.splice(selectIds.value.indexOf(item.id), 1);
doi = "del"
} else {
selectIds.value.push(item.id);
doi = "add"
}
let a = await getBuyInfo()
if (a === false) {
if (doi == "add") {
selectIds.value.splice(selectIds.value.indexOf(item.id), 1);
}
if (doi == "del") {
selectIds.value.push(item.id);
}
}
}
const openPopupItemList = () => {
selectItems.value = [];
if (BuyInfo.value.items_info) {
BuyInfo.value.items_info.items.forEach((v, i) => {
v.children.forEach((v2, i2) => {
selectItems.value.push(v2)
})
})
}
if (selectItems.value.length > 0) {
popupItemList.value.open()
}
}
const ClearItems=async()=>{
selectIds.value=[];
await getBuyInfo()
popupItemList.value.close()
}
onShow(() => {
if (!!config_ref.value) {
mountedAction();
}
});
</script>
<template>
<DraggableButton />
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
</view>
<uni-popup ref="popupItemList" type="bottom">
<view class="popupItemList-content">
<view style="display: flex;justify-content: space-between;margin-bottom: 34rpx;">
<view style="font-size: 30rpx;">已加购项目</view>
<view style="color: #9E9E9F;display: flex;align-items: center;" @click="ClearItems()">
<uni-icons type="trash" color="#9E9E9F" size="20"></uni-icons>
<view style="font-size: 20rpx;">清空</view>
</view>
</view>
<view v-for="(item,index) in selectItems">
<view class="itemlist_list" @click="XuanZeItem(item)">
<view>
<view style="display: flex; align-items: center;margin-bottom: 20rpx;">
<view class="itemlist_bianhao">{{index+1}}</view>
<view class="itemlist_itemname">{{item.name}}</view>
</view>
<view style="display: flex;align-items: end;">
<view class="itemlist_price"><span style="font-size: 20rpx;"></span>{{item.price}}</view>
<view class="itemlist_org_price line-through">{{item.original_price}}</view>
</view>
</view>
<view :class="{
'!bg-#009fa8 !b-#008e99': selectIds.includes(item.id),
}" class="w-24rpx h-24rpx b-1 b-solid b-#009fa8 bg-#fff rounded-24rpx center">
<image v-if="selectIds.includes(item.id)" class="w-20rpx" src="@/static/assets/select.png"
mode="widthFix" />
</view>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="popupTip">
<view class="mb-70rpx bg-#fff text-center box-border pt-80rpx pb-50rpx px-65rpx w-90vw rounded-15rpx">
<view class="w-full text-center text-##090909 text-26rpx line-height-[50rpx]">您还剩余
{{ losePrice }}
元体检额度尚未使用确认提交后剩余体检额度将无法使用!
</view>
<view class="mt-50rpx between">
<button type="primary" @click="toDetails(1)"
class="w-196rpx h-68rpx center text-#fff text-24rpx !bg-#239EA3 rounded-8rpx">
我想好了
</button>
<button @click="popupTip.close()"
class="w-196rpx h-68rpx center text-#239EA3 text-24rpx !bg-#D9F3F2 rounded-8rpx">
我再想想
</button>
</view>
</view>
</uni-popup>
<uni-popup ref="popup">
<view class="bg-#fff rounded-15rpx w-95vw px-20rpx box-border">
<view class="center relative pt-47rpx pb-32rpx text-36rpx">
<text class="line-height-[1]">推荐套餐</text>
<uni-icons @click="popup.close()" type="closeempty" color="#A6A6A6" size="26"
class="absolute right-40rpx top-30rpx"></uni-icons>
</view>
<view v-for="(item, index) in recommendPackageList" :key="index"
class="pt-40rpx pb-15rpx box-border b-0 b-t-1 b-solid b-#E1ECEE">
<view class="flex w-full">
<image v-if="item.cover" :src="$image(item.cover)" class="w-190rpx h-190rpx mr-37rpx"
mode="widthFix" />
<view class="flex flex-col grow">
<text>{{ item.name }}</text>
<view class="mt-13rpx mb-18rpx">
<uni-tag v-for="(val, i) in item.tags" :key="i" size="small" :inverted="true"
:text="val.text" class="mr-8rpx" :custom-style="
'background-color:' +
val.color +
';border-color:' +
val.color +
'; color:' +
val.text_color +
';'
" />
</view>
<view>
<text v-for="(val, i) in item.tags2" :key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-r-2 b-solid b-#8B8B8B">{{ val }}</text>
</view>
<view class="mt-20rpx w-full flex items-end">
<text class="text-18rpx text-#EC3D15">¥</text>
<text class="text-38rpx text-#EC3D15 mx-10rpx -mb-8rpx">{{
item.price
}}</text>
<text class="text-18rpx text-#878787 line-through">{{
item.original_price
}}</text>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx">已售{{ item.count }}</text>
</view>
</view>
</view>
<view class="between mt-30rpx">
<view class="text-#8B8B8B text-22rpx">
相似度
<text class="text-#239EA3">{{ item.recommend?.xiangsidu }}</text>
{{ item.recommend?.count > 0 ? "增加" : "减少" }}
<text class="text-#239EA3">{{
Math.abs(item.recommend?.count)
}}</text>
个项目{{
Number(item.recommend?.money.replace(/,/, "")) > 0
? "增加"
: "减少"
}}
<text class="text-#239EA3">{{ item.recommend?.money.replace(/-/, "") }}</text>
</view>
<button type="primary" @click="buy(item)"
class="w-160rpx h-60rpx center text-#fff text-28rpx !bg-#239EA3 rounded-full">
预约
</button>
</view>
</view>
<view class="b-0 b-t-1 b-solid b-#E1ECEE pt-80rpx pb-70rpx">
<button type="primary" @click="buy()"
class="w-300rpx h-78rpx center text-#fff text-30rpx !bg-#239EA3 rounded-10rpx">
跳过
</button>
</view>
</view>
</uni-popup>
<view class="bg-#d8edf2">
<uni-search-bar class="search" radius="100" placeholder="请输入关键字搜索" @clear="getAllItems()"
@cancel="getAllItems()" @confirm="getAllItems" />
</view>
<view class="mt-20rpx flex min-h-100%" style="background-color: #eef7f7;">
<view class="min-w-214rpx max-w-214rpx mr-20rpx min-h-100% text-center">
<view class="w-100% rounded-r-full text-#0E0E0E text-25rpx px-20rpx w-100% center h-84rpx box-border"
v-for="(item, index) in leftList" :key="index" :class="{
'bg-gradient-to-r from-#edf6f5 to-#bbdfe2': tabIndex == index,
}" @click="
() => {
tabIndex = index;
rightLeft = item.children;
headImg = item.head_img;
}
">
{{ item.title }}
</view>
<view style="height: 150rpx;"></view>
</view>
<view class="grow min-h-100% bg-#fff pb-200rpx">
<view v-for="(item, index) in rightLeft" :key="index" :class="{
'!b-0': index == rightLeft.length - 1,
}" class="flex justify-between center py-30rpx px-20rpx b-b-1px b-b-solid b-b-#e5e5e5">
<view class="w-40% text-#0E0E0E text-24rpx flex items-center">
<text>{{ item.title }}</text>
<uni-tooltip>
<!-- 定义插槽插槽名为 content -->
<template v-slot:content>
<!-- 在这里编写自定义的 HTML 或组件 -->
<view class="w-30vw">
<text>{{ item.desc }}</text>
</view>
</template>
<!-- 触发提示的按钮 -->
<uni-icons color="#009fa8" type="help-filled" size="14"></uni-icons>
</uni-tooltip>
</view>
<view class="w-58% items-end flex justify-between" @click="XuanZeItem(item)">
<text class="text-#EC3D15 text-26rpx">¥ {{ item.price }}</text>
<text class="text-#9e9d9d text-20rpx line-through">¥ {{ item.original_price }}</text>
<view :class="{
'!bg-#009fa8 !b-#008e99': selectIds.includes(item.id),
}" class="w-24rpx h-24rpx b-1 b-solid b-#c3e9eb bg-#ccecee rounded-8rpx center">
<image v-if="selectIds.includes(item.id)" class="w-20rpx" src="@/static/assets/select.png"
mode="widthFix" />
</view>
</view>
</view>
</view>
</view>
<view style="z-index: 999;"
class="fixed bottom-0 left-0 w-100% h-150rpx bg-gradient-to-r from-#02b4bd to-#ABD7D7 px-20rpx py-30rpx box-border items-center flex justify-between">
<view style="position: relative;" class="w-110rpx h-129rpx ml-60rpx mt-5rpx" @click="openPopupItemList()">
<image class="w-110rpx h-129rpx" src="@/static/assets/buy/xiong.png" mode="widthFix" />
<view class="yuandian">
{{ selectIds.length }}
</view>
</view>
<view class="grow" style="margin-left: 10rpx;">
<view class="flex items-end">
<text class="text-46rpx text-#e95513 ml-20rpx mr-5rpx">¥</text>
<text class="text-46rpx text-#e95513 mr-10rpx font-bold">{{
optionalPrice || 0
}}</text>
<text v-if="optionalOriginalPrice" class="text-26rpx text-#3e3a39 line-through">¥
{{ optionalOriginalPrice }}</text>
</view>
</view>
<view @click="confirm()" class="button">
确认项目
</view>
</view>
</template>
<style>
.uni-tooltip-popup {
background-color: #fff;
}
</style>
<style>
.button {
color: #00828e;
background-color: #fff;
height: 58rpx;
line-height: 58rpx;
text-align: center;
width: 174rpx;
border-radius: 58rpx;
margin-right: 20rpx;
font-size: 29rpx;
}
.popupItemList-content {
padding: 40rpx 40rpx 180rpx 40rpx;
border-radius: 40rpx;
background-color: #fff;
}
.yuandian {
position: absolute;
top: 55rpx;
right: -10rpx;
background-color: #E95513;
height: 26rpx;
width: 26rpx;
border-radius: 13rpx;
color: #fff;
font-size: 20rpx;
text-align: center;
font-weight: 900;
}
.itemlist_org_price {
color: #9E9E9F;
font-weight: bolder;
font-size: 18rpx;
margin-left: 10rpx;
padding-bottom: 5rpx;
}
.itemlist_price {
color: #E95513;
font-weight: bolder;
font-size: 32rpx;
}
.itemlist_itemname {
font-size: 30rpx;
font-weight: bolder;
}
.itemlist_list {
display: flex;
width: 100%;
justify-content: space-between;
border-bottom: 1px solid #00828e;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
align-items: center;
}
.itemlist_bianhao{
height: 26rpx;
width: 26rpx;
margin-right: 10rpx;
border-radius: 26rpx;
line-height: 26rpx;
color: #fff;
font-size: 20rpx;
font-weight: bolder;
text-align: center;
background: linear-gradient(to right, #67a8aa, #8ce7e7);
}
</style>

@ -30,7 +30,7 @@ let yucunkuan = ref(0); // 计算后的预存款
let jifen = ref(0); //
let keyong_jifen = ref(0); //
let erxianInfo=ref(null);
let TiShiPopupRef=ref(null);
const mountedAction = async () => {
uni.showLoading({
title: "加载中",
@ -266,6 +266,19 @@ const getnmrList = async () => {
});
};
let checkup_type_id=$store.getCheckupTypeId()?.id
let NextStatus=ref(true)
const toNext=()=>{
NextStatus.value=true
if(checkup_type_id==4){
NextStatus.value=false;
TiShiPopupRef.value.open();
return false;
}
comfrimyy()
}
const comfrimyy = async () => {
let plan_id = "";
let plan_nmr_id = "";
@ -279,6 +292,7 @@ const comfrimyy = async () => {
}
}
if (yytjInfo.value?.nmr_list?.length > 1) {
plan_nmr_id = yytjInfo.value?.nmr_list[0]?.id;
}
@ -426,6 +440,14 @@ const toRouter = (url, status, index) => {
</script>
<template>
<DraggableButton />
<uni-popup ref="TiShiPopupRef" style="z-index: 999;">
<view class="tishi_main">
<view class="tishi_title">提示</view>
<!-- <view class="tishi_title2">专家定制套餐</view> -->
<view class="tishi_content">请您的配偶在15分钟内完成预约否则本次预约将会失效如有支付金额会原路退回</view>
<view class="tishi_button" @click="comfrimyy()"></view>
</view>
</uni-popup>
<uni-popup ref="popup">
<view
class="center relative px-10rpx pb-30rpx text-36rpx bg-#fff rounded-t-15rpx box-border col"
@ -513,21 +535,145 @@ const toRouter = (url, status, index) => {
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view class="px-30rpx box-border pb-200rpx comboInfo">
<view class="px-20rpx box-border pb-200rpx comboInfo">
<view
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="p-20rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff my-16rpx"
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff"
>
<view
class="flex w-full b-0 b-solid b-#E1ECEE mb-7rpx"
:class="{
'b-b-1 pb-25rpx': itemsInfo?.items?.length,
}"
v-if="!buyInfo.group_id && comboInfo?.items?.length"
>
<!-- 1 个检套餐 显示套餐信息 -->
<image
v-if="comboInfo.img"
:src="$image(comboInfo.img)"
class="w-190rpx h-190rpx mr-37rpx"
mode="widthFix"
/>
<view class="flex flex-col grow">
<text>{{ comboInfo.combo_name }}</text>
<view class="mt-13rpx mb-18rpx">
<uni-tag
v-for="(val, i) in comboInfo.tags"
:key="i"
size="small"
:inverted="true"
:text="val.text"
class="mr-8rpx"
:custom-style="
'background-color:' +
val.color +
';border-color:' +
val.color +
'; color:' +
val.text_color +
';'
"
/>
</view>
<view v-if="comboInfo.tags2?.length">
<text
v-for="(val, i) in comboInfo.tags2"
:key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-solid b-#8B8B8B"
:class="i == comboInfo.tags2?.length - 1 ? 'b-r-0' : 'b-r-2'"
>{{ val }}</text
>
</view>
<view class="mt-20rpx w-full flex items-end">
<text class="text-18rpx text-#EC3D15">¥</text>
<text class="text-38rpx text-#EC3D15 mx-10rpx -mb-8rpx">{{
comboInfo.price
}}</text>
<text class="text-18rpx text-#878787 line-through">{{
comboInfo.original_price
}}</text>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx"
>已售{{ comboInfo.sale_count }}</text
>
</view>
</view>
</view>
<view
v-if="buyInfo.group_id"
class="b-0 b-solid b-#E1ECEE pb-25rpx mb-7rpx"
:class="{
'b-b-1': itemsInfo?.items?.length,
}"
>
<!-- 3团检套餐 4团检自选 都要显示头像和名字 -->
<view class="flex items-center">
<image
src="@/static/assets/userm.png"
class="w-70rpx h-70rpx mr-35rpx"
/>
<view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{ groupInfo.name }}</text>
</view>
</view>
<view class="text-24rpx mt-40rpx">
<!-- 3团检套餐 4团检自选 都要显示单位部门等信息 -->
<view class="pb-30rpx">
<text class="text-#8B8B8B">单位名称</text>
<text>{{ groupInfo.group_name }}</text>
</view>
<view class="pb-30rpx">
<text class="text-#8B8B8B">部门名称</text>
<text>{{ groupInfo.bumen_name }}</text>
</view>
<view
class="pb-30rpx"
v-if="groupInfo.combo_name || comboInfo?.combo_name"
>
<text class="text-#8B8B8B">套餐名称</text>
<text>{{ groupInfo?.combo_name || comboInfo?.combo_name }}</text>
</view>
<view>
<text class="text-#8B8B8B">体检额度</text>
<text>{{ groupInfo.tongshou_xiane }}</text>
</view>
</view>
</view>
<view class="pt-15rpx" v-if="itemsInfo?.items?.length">
<view class="text-30rpx text-#0E0E0E pb-30rpx"> 自选项目 </view>
<view class="text-#8B8B8B text-24rpx">
<view
class="flex mb-20rpx"
v-for="(val, index) in itemsInfo?.items.length > 3
? 3
: itemsInfo?.items"
:key="index"
>
<text class="whitespace-nowrap"
>{{ itemsInfo?.items[index]?.keshi_name }} -
</text>
<view class="line-clamp-2">
<text
class="ml-10rpx text-#0E0E0E"
v-for="(v, i) in itemsInfo?.items[index]?.children"
:key="i"
>{{ v.name }}</text
>
</view>
</view>
</view>
</view>
</view>
<view
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff my-16rpx"
>
<view
class="text-#0E0E0E text-30rpx b-0 b-solid b-b-1 b-#E1ECEE pb-20rpx mb-35rpx"
>预约人信息</view
>
<view>
<view style="display: flex;justify-content: space-between;padding-right: 10rpx;">
<view>
<view class="text-28rpx text-#000 mb-20rpx" style="font-weight: bolder;">{{
<view class="text-28rpx text-#000 bold mb-20rpx">{{
userInfo.name
}}</view>
<view class="text-24rpx text-#8B8B8B mb-30rpx between">
@ -540,22 +686,46 @@ const toRouter = (url, status, index) => {
: "未知"
}}</text>
<text class="ml-20rpx mr-auto">{{ userInfo.phone }}</text>
<!-- <button
<button
v-if="!buyInfo.group_id"
@click="toRouter('/pages/user/choose/choose')"
class="text-24rpx text-#fff bg-#31AEB6 rounded-full px-26rpx h55rpx !m-0 center !ml-auto"
>
更改预约人
</button> -->
</button>
</view>
<view class="text-24rpx text-#040404 mb-30rpx">
<view
class="mb-20rpx between"
v-for="(val, index) in yytjInfo?.nmr_list"
@click="toRouter('/pages/main/yytjsj/yytjsj', 1, index)"
:key="index"
v-if="yytjInfo?.nmr_list?.length"
>
<view class="flex-col flex">
<text v-for="(v, i) in val.name?.split('/')" :key="i">{{
v
}}</text>
</view>
<text class="ml-20rpx mr-auto text-#239EA3">{{ val.time }}</text>
<text class="text-30rpx">{{
val.time ? "重新预约" : "预约时间"
}}</text>
</view>
<view
class="mb-20rpx between"
@click="toRouter('/pages/main/yytjsj/yytjsj', 1, -1)"
>
<text>体检医生</text>
<text class="text-30rpx">{{
yytjInfo?.doctor_name || "选择医生"
}}</text>
</view>
<uni-icons @click="toRouter('/pages/user/choose/choose')" type="trash" color="#31AEB6" size="25"></uni-icons>
</view>
</view>
</view>
<view v-if="integral"
<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="selectDiscount(1)"
@ -575,14 +745,14 @@ const toRouter = (url, status, index) => {
<uni-icons type="right" size="12"></uni-icons>
</view>
<view v-if="couponList.length"
<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="selectDiscount(2)"
>
<view>
<text class="text-#050505">优惠券</text>
<text class="text-#828383"
<text v-if="couponList.length" class="text-#828383"
>{{ couponList.length }}</text
>
</view>
@ -595,14 +765,14 @@ const toRouter = (url, status, index) => {
<uni-icons type="right" size="12"></uni-icons>
</view>
<view v-if="save_money"
<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="selectDiscount(3)"
>
<view>
<text class="text-#050505">预存款</text>
<text class="text-#828383"
<text v-if="save_money" class="text-#828383"
>剩余{{ save_money }}</text
>
</view>
@ -613,13 +783,13 @@ const toRouter = (url, status, index) => {
<uni-icons type="right" size="12"></uni-icons>
</view>
<view class="text-#E95513 text-20rpx mb-40rpx mt-40rpx pl-20rpx pr-20rpx">
<view class="flex items-center mt-20rpx mb-40rpx">
<view class="text-#FB4F1A text-20rpx mb-30rpx">
<view class="flex items-center mt-20rpx">
<uni-icons
type="info-filled"
class="rotate-180"
color="#E95513"
size="18"
color="#FB4F1A"
size="22"
></uni-icons>
<text>选择预约人体检时间请点击提交按钮,完成预约</text>
</view>
@ -627,8 +797,8 @@ const toRouter = (url, status, index) => {
<uni-icons
type="info-filled"
class="rotate-180"
color="#E95513"
size="18"
color="#FB4F1A"
size="22"
></uni-icons>
<text
>购买后如需退款未到预约体检日期者可在我的订单中点击申请退款体检当日取消或逾期未检者须至健康管理中心服务台办理
@ -684,17 +854,59 @@ const toRouter = (url, status, index) => {
</view>
</view>
</view>
<view
class="shadow-[0px_1px_1px_0px_rgba(0,0,0,0.08)] fixed bottom-0 left-0 w-full bg-#fff py-30rpx pl-55rpx pr-45rpx box-border between"
>
<view class="text-#ED6907 text-48rpx center items-end line-height-[1]">
<text class="text-24rpx">¥</text>
<text>{{ netReceiptsPrice }}</text>
</view>
<button
@click="comfrimyy"
class="w-210rpx h-42rpx center text-#fff text-30rpx rounded-full bg-#239EA3 !m-0 button"
@click="toNext()"
class="w-276rpx h-76rpx center text-#fff text-30rpx rounded-full bg-#239EA3 !m-0"
>
确认支付
提交预约
</button>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.tishi_main{
background-color: #fff;
padding: 40rpx 50rpx;
width:600rpx;
border-radius: 40rpx;
}
.tishi_button{
width: 365rpx;
background-color: #009da5;
color:#fff;
text-align: center;
padding-top: 10rpx;
padding-bottom: 10rpx;
border-radius: 40rpx;
margin: 40rpx auto 10rpx auto;
}
.tishi_title{
text-align: center;
font-size: 30rpx;
font-weight: 600;
color:#2b2827;
}
.tishi_title2{
font-size: 28rpx;
margin-top: 30rpx;
font-weight: 600;
color:#3a3635;
border-left: 3px solid #009da5;
padding-left: 5rpx;
}
.tishi_content{
font-size: 28rpx;
margin-top: 30rpx;
color:#474241;
}
.activeTime {
background-color: #239ea3;
color: #fff;
@ -707,9 +919,17 @@ const toRouter = (url, status, index) => {
.comboInfo {
position: relative;
z-index: 1;
background-color: #D8EEF3;
padding-top: 20rpx;
min-height: calc(100vh - 80rpx);
&::after {
content: "";
width: 100%;
height: 50rpx;
background-color: #239ea3;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.active {
color: #239ea3;
font-weight: bold;
@ -727,9 +947,4 @@ const toRouter = (url, status, index) => {
}
}
}
.button{
position: fixed;
bottom: 80rpx;
right: 40rpx;
}
</style>

@ -30,7 +30,7 @@ let yucunkuan = ref(0); // 计算后的预存款
let jifen = ref(0); //
let keyong_jifen = ref(0); //
let erxianInfo=ref(null);
let TiShiPopupRef=ref(null);
const mountedAction = async () => {
uni.showLoading({
title: "加载中",
@ -266,31 +266,11 @@ const getnmrList = async () => {
});
};
let checkup_type_id=$store.getCheckupTypeId()?.id
let NextStatus=ref(true)
const toNext=()=>{
NextStatus.value=true
if(checkup_type_id==4){
NextStatus.value=false;
TiShiPopupRef.value.open();
return false;
}
comfrimyy()
}
const comfrimyy = async () => {
let plan_id = "";
let plan_nmr_id = "";
uni.showLoading();
console.log(yytjInfo.value?.nmr_list);
for (let i = 0; i < yytjInfo.value?.nmr_list?.length; i++) {
if (!yytjInfo.value?.nmr_list[i].id) {
uni.$lu.toast("请完善预约时间");
uni.hideLoading();
return;
}
}
if (yytjInfo.value?.nmr_list?.length > 1) {
@ -324,7 +304,7 @@ const comfrimyy = async () => {
peiou_info:$store.getPeiOuUser()//
};
console.log(obj);
const response = await $api("OrderCreate", obj);
const response = await $api("CreateNewOrder", obj);
$response(response, () => {
if (response.status) {
if (response.data.action == "pay") {
@ -440,14 +420,6 @@ const toRouter = (url, status, index) => {
</script>
<template>
<DraggableButton />
<uni-popup ref="TiShiPopupRef" style="z-index: 999;">
<view class="tishi_main">
<view class="tishi_title">提示</view>
<!-- <view class="tishi_title2">专家定制套餐</view> -->
<view class="tishi_content">请您的配偶在15分钟内完成预约否则本次预约将会失效如有支付金额会原路退回</view>
<view class="tishi_button" @click="comfrimyy()"></view>
</view>
</uni-popup>
<uni-popup ref="popup">
<view
class="center relative px-10rpx pb-30rpx text-36rpx bg-#fff rounded-t-15rpx box-border col"
@ -535,145 +507,21 @@ const toRouter = (url, status, index) => {
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view class="px-20rpx box-border pb-200rpx comboInfo">
<view
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff"
>
<view
class="flex w-full b-0 b-solid b-#E1ECEE mb-7rpx"
:class="{
'b-b-1 pb-25rpx': itemsInfo?.items?.length,
}"
v-if="!buyInfo.group_id && comboInfo?.items?.length"
>
<!-- 1 个检套餐 显示套餐信息 -->
<image
v-if="comboInfo.img"
:src="$image(comboInfo.img)"
class="w-190rpx h-190rpx mr-37rpx"
mode="widthFix"
/>
<view class="flex flex-col grow">
<text>{{ comboInfo.combo_name }}</text>
<view class="mt-13rpx mb-18rpx">
<uni-tag
v-for="(val, i) in comboInfo.tags"
:key="i"
size="small"
:inverted="true"
:text="val.text"
class="mr-8rpx"
:custom-style="
'background-color:' +
val.color +
';border-color:' +
val.color +
'; color:' +
val.text_color +
';'
"
/>
</view>
<view v-if="comboInfo.tags2?.length">
<text
v-for="(val, i) in comboInfo.tags2"
:key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-solid b-#8B8B8B"
:class="i == comboInfo.tags2?.length - 1 ? 'b-r-0' : 'b-r-2'"
>{{ val }}</text
>
</view>
<view class="mt-20rpx w-full flex items-end">
<text class="text-18rpx text-#EC3D15">¥</text>
<text class="text-38rpx text-#EC3D15 mx-10rpx -mb-8rpx">{{
comboInfo.price
}}</text>
<text class="text-18rpx text-#878787 line-through">{{
comboInfo.original_price
}}</text>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx"
>已售{{ comboInfo.sale_count }}</text
>
</view>
</view>
</view>
<view
v-if="buyInfo.group_id"
class="b-0 b-solid b-#E1ECEE pb-25rpx mb-7rpx"
:class="{
'b-b-1': itemsInfo?.items?.length,
}"
>
<!-- 3团检套餐 4团检自选 都要显示头像和名字 -->
<view class="flex items-center">
<image
src="@/static/assets/userm.png"
class="w-70rpx h-70rpx mr-35rpx"
/>
<view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{ groupInfo.name }}</text>
</view>
</view>
<view class="text-24rpx mt-40rpx">
<!-- 3团检套餐 4团检自选 都要显示单位部门等信息 -->
<view class="pb-30rpx">
<text class="text-#8B8B8B">单位名称</text>
<text>{{ groupInfo.group_name }}</text>
</view>
<view class="pb-30rpx">
<text class="text-#8B8B8B">部门名称</text>
<text>{{ groupInfo.bumen_name }}</text>
</view>
<view
class="pb-30rpx"
v-if="groupInfo.combo_name || comboInfo?.combo_name"
>
<text class="text-#8B8B8B">套餐名称</text>
<text>{{ groupInfo?.combo_name || comboInfo?.combo_name }}</text>
</view>
<view>
<text class="text-#8B8B8B">体检额度</text>
<text>{{ groupInfo.tongshou_xiane }}</text>
</view>
</view>
</view>
<view class="pt-15rpx" v-if="itemsInfo?.items?.length">
<view class="text-30rpx text-#0E0E0E pb-30rpx"> 自选项目 </view>
<view class="text-#8B8B8B text-24rpx">
<view
class="flex mb-20rpx"
v-for="(val, index) in itemsInfo?.items.length > 3
? 3
: itemsInfo?.items"
:key="index"
>
<text class="whitespace-nowrap"
>{{ itemsInfo?.items[index]?.keshi_name }} -
</text>
<view class="line-clamp-2">
<text
class="ml-10rpx text-#0E0E0E"
v-for="(v, i) in itemsInfo?.items[index]?.children"
:key="i"
>{{ v.name }}</text
>
</view>
</view>
</view>
</view>
</view>
<view class="px-30rpx box-border pb-200rpx comboInfo">
<view
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff my-16rpx"
class="p-20rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff my-16rpx"
>
<view
class="text-#0E0E0E text-30rpx b-0 b-solid b-b-1 b-#E1ECEE pb-20rpx mb-35rpx"
>预约人信息</view
>
<view>
<view style="display: flex;justify-content: space-between;padding-right: 10rpx;">
<view>
<view class="text-28rpx text-#000 bold mb-20rpx">{{
<view class="text-28rpx text-#000 mb-20rpx" style="font-weight: bolder;">{{
userInfo.name
}}</view>
<view class="text-24rpx text-#8B8B8B mb-30rpx between">
@ -686,46 +534,22 @@ const toRouter = (url, status, index) => {
: "未知"
}}</text>
<text class="ml-20rpx mr-auto">{{ userInfo.phone }}</text>
<button
<!-- <button
v-if="!buyInfo.group_id"
@click="toRouter('/pages/user/choose/choose')"
class="text-24rpx text-#fff bg-#31AEB6 rounded-full px-26rpx h55rpx !m-0 center !ml-auto"
>
更改预约人
</button>
</view>
<view class="text-24rpx text-#040404 mb-30rpx">
<view
class="mb-20rpx between"
v-for="(val, index) in yytjInfo?.nmr_list"
@click="toRouter('/pages/main/yytjsj/yytjsj', 1, index)"
:key="index"
v-if="yytjInfo?.nmr_list?.length"
>
<view class="flex-col flex">
<text v-for="(v, i) in val.name?.split('/')" :key="i">{{
v
}}</text>
</view>
<text class="ml-20rpx mr-auto text-#239EA3">{{ val.time }}</text>
<text class="text-30rpx">{{
val.time ? "重新预约" : "预约时间"
}}</text>
</button> -->
</view>
<view
class="mb-20rpx between"
@click="toRouter('/pages/main/yytjsj/yytjsj', 1, -1)"
>
<text>体检医生</text>
<text class="text-30rpx">{{
yytjInfo?.doctor_name || "选择医生"
}}</text>
</view>
<uni-icons @click="toRouter('/pages/user/choose/choose')" type="trash" color="#31AEB6" size="25"></uni-icons>
</view>
</view>
</view>
<view
<view v-if="integral"
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="selectDiscount(1)"
@ -745,14 +569,14 @@ const toRouter = (url, status, index) => {
<uni-icons type="right" size="12"></uni-icons>
</view>
<view
<view v-if="couponList.length"
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="selectDiscount(2)"
>
<view>
<text class="text-#050505">优惠券</text>
<text v-if="couponList.length" class="text-#828383"
<text class="text-#828383"
>{{ couponList.length }}</text
>
</view>
@ -765,14 +589,14 @@ const toRouter = (url, status, index) => {
<uni-icons type="right" size="12"></uni-icons>
</view>
<view
<view v-if="save_money"
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="selectDiscount(3)"
>
<view>
<text class="text-#050505">预存款</text>
<text v-if="save_money" class="text-#828383"
<text class="text-#828383"
>剩余{{ save_money }}</text
>
</view>
@ -783,13 +607,13 @@ const toRouter = (url, status, index) => {
<uni-icons type="right" size="12"></uni-icons>
</view>
<view class="text-#FB4F1A text-20rpx mb-30rpx">
<view class="flex items-center mt-20rpx">
<view class="text-#E95513 text-20rpx mb-40rpx mt-40rpx pl-20rpx pr-20rpx">
<view class="flex items-center mt-20rpx mb-40rpx">
<uni-icons
type="info-filled"
class="rotate-180"
color="#FB4F1A"
size="22"
color="#E95513"
size="18"
></uni-icons>
<text>选择预约人体检时间请点击提交按钮,完成预约</text>
</view>
@ -797,8 +621,8 @@ const toRouter = (url, status, index) => {
<uni-icons
type="info-filled"
class="rotate-180"
color="#FB4F1A"
size="22"
color="#E95513"
size="18"
></uni-icons>
<text
>购买后如需退款未到预约体检日期者可在我的订单中点击申请退款体检当日取消或逾期未检者须至健康管理中心服务台办理
@ -854,59 +678,17 @@ const toRouter = (url, status, index) => {
</view>
</view>
</view>
<view
class="shadow-[0px_1px_1px_0px_rgba(0,0,0,0.08)] fixed bottom-0 left-0 w-full bg-#fff py-30rpx pl-55rpx pr-45rpx box-border between"
>
<view class="text-#ED6907 text-48rpx center items-end line-height-[1]">
<text class="text-24rpx">¥</text>
<text>{{ netReceiptsPrice }}</text>
</view>
<button
@click="toNext()"
class="w-276rpx h-76rpx center text-#fff text-30rpx rounded-full bg-#239EA3 !m-0"
<button v-if="!buyInfo.group_id"
@click="comfrimyy"
class="w-210rpx h-42rpx center text-#fff text-30rpx rounded-full bg-#239EA3 !m-0 button"
>
提交预约
确认支付
</button>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.tishi_main{
background-color: #fff;
padding: 40rpx 50rpx;
width:600rpx;
border-radius: 40rpx;
}
.tishi_button{
width: 365rpx;
background-color: #009da5;
color:#fff;
text-align: center;
padding-top: 10rpx;
padding-bottom: 10rpx;
border-radius: 40rpx;
margin: 40rpx auto 10rpx auto;
}
.tishi_title{
text-align: center;
font-size: 30rpx;
font-weight: 600;
color:#2b2827;
}
.tishi_title2{
font-size: 28rpx;
margin-top: 30rpx;
font-weight: 600;
color:#3a3635;
border-left: 3px solid #009da5;
padding-left: 5rpx;
}
.tishi_content{
font-size: 28rpx;
margin-top: 30rpx;
color:#474241;
}
.activeTime {
background-color: #239ea3;
color: #fff;
@ -919,17 +701,9 @@ const toRouter = (url, status, index) => {
.comboInfo {
position: relative;
z-index: 1;
&::after {
content: "";
width: 100%;
height: 50rpx;
background-color: #239ea3;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
background-color: #D8EEF3;
padding-top: 20rpx;
min-height: calc(100vh - 80rpx);
.active {
color: #239ea3;
font-weight: bold;
@ -947,4 +721,9 @@ const toRouter = (url, status, index) => {
}
}
}
.button{
position: fixed;
bottom: 80rpx;
right: 40rpx;
}
</style>

Loading…
Cancel
Save