线下预约线上联动

main
yanzai 4 months ago
parent 1722a9913f
commit fdbb90a39f

@ -252,7 +252,7 @@ class ComboController extends Controller
'sale_count' => $Info['sale_count'],
'is_hot' => isset($Info['is_hot']) ? $Info['is_hot'] : 0,
];
if ($type === 'onlyPaixu') {
if (isset($type) and $type === 'onlyPaixu') {
$data=['order' => $newOrder,];
}

@ -55,6 +55,7 @@ class ApiMapController extends Controller
'StartPay' => $base_url . '/api/H5/StartPay', //开始支付
'CheckPay' => $base_url . '/api/H5/CheckPay', //支付查询
'Refund' => $base_url . '/api/H5/Refund', //退款
'OrderCancel' => $base_url . '/api/H5/OrderCancel', //取消订单
'GetMonthPlanCount' => $base_url . '/api/H5/GetMonthPlanCount', //按月获取每日号源
'GetDayPlanList' => $base_url . '/api/H5/GetDayPlanList', //获取每日号源
'ComboCompare' => $base_url . '/api/H5/ComboCompare', //套餐对比

@ -22,6 +22,12 @@ class OrderController extends Controller
// status 1-待支付 2-已预约 3-交易关闭 4-已完成 5-已退款
$openid = $request->post('openid');
$searchInfo = $request->post('searchInfo');
$page = $request->post('page');
if(isset($page)){
$page = intval($page);
}else{
$page = 1;
}
$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();
@ -43,7 +49,10 @@ class OrderController extends Controller
->orWhere(function ($query) use ($persons_sfz) {
$query->WhereIn('id_number', $persons_sfz)
->where('person_id', 0);
})->orderBy('id', 'desc')->get();
})->orderBy('id', 'desc') ->skip(($page - 1) * 100) // 跳过前9999条记录
->take(100)->get();
$WaitingPaymentTime = config('app.globals.WaitingPaymentTime');//支付等待時間
foreach ($OrderList as $key => $list) {
if ($list->status == 1) {
@ -148,7 +157,7 @@ class OrderController extends Controller
$sanfang_code=request('sanfang_code'); //第三方code
$yuyue_fangshi=request('yuyue_fangshi'); //预约方式 个检、团检、个检先选号源等,非必填
$order_id= request('order_id');//如果是线下预约的这里获取订单id,这种直接进行更新,不新建
$wj_flag = request('wj'); //问卷标记
if (isset($wj_flag) and $wj_flag == 1) {
$wj_zhekou = config('app.globals.Wj_ZheKou');//问卷过来的折扣率
@ -175,6 +184,14 @@ class OrderController extends Controller
if (!$user) return \Yz::echoError1('用户不存在');
$person = DB::table('web_user_person')->where(['id' => $person_id, 'is_del' => 0])->first();
if (!$person) return \Yz::echoError1('体检人不存在');
$do_type='insert';
if(isset($order_id)){
$order_info=DB::table('orders')->where(['id'=>$order_id])->first();
if (strpos($order_info->source, '线下体检预约') !== false){
$do_type='update';
}
}
$title = "自选项目";
$price = 0;
$quanInfo=false;
@ -409,10 +426,17 @@ class OrderController extends Controller
}
//检查号源是否可用
$plan = new PlanController();
$plan_check = $plan->CheckPlan($plan_id, $hospital_id, $type, $person->sex, $price, $checkup_type_id,$user->id);
if ($plan_check['status'] === false) return \Yz::echoError1($plan_check['msg']);
$plan = $plan_check['plan'];
if($do_type=='update'){
//如果是线下预约的订单,则不进行号源检测
$plan = DB::table('plans')->where(['id' => $plan_id, 'hospital_id' => $hospital_id, 'status' => 1, 'is_del' => 0])->first();
}else{
$plan = new PlanController();
$plan_check = $plan->CheckPlan($plan_id, $hospital_id, $type, $person->sex, $price, $checkup_type_id,$user->id);
if ($plan_check['status'] === false) return \Yz::echoError1($plan_check['msg']);
$plan = $plan_check['plan'];
}
@ -584,11 +608,17 @@ class OrderController extends Controller
'paycheck_time'=>$now_datetime
];
if($do_type=='update'){
$insert = DB::table('orders')->where(['id'=>$order_id])->update($data);
$insert=$order_id;
$up_plan=true;
}else{
$insert = DB::table('orders')->insertGetId($data);
$up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([
'status' => 2
]);
}
$insert = DB::table('orders')->insertGetId($data);
$up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([
'status' => 2
]);
//更新问卷log表
DB::table('questionnaires_logs')->where(['person_id' => $person->id, 'order_id' => 0])->update([
'order_id' => $insert,
@ -1047,7 +1077,7 @@ class OrderController extends Controller
public function Finish_test() //删除!!!
{
$f = self::Finish('20241030111035259T2IBC6');
$f = self::Finish('20250729122601478wq5l6d');
dd($f);
}
@ -1057,6 +1087,52 @@ class OrderController extends Controller
$AspNet=new AspNetZhuanController();
$order_info = DB::table('orders')->where(['order_number' => $order_number])->first();
if (!$order_info) return ['status' => false, 'msg' => "未找到有效订单。"];
//如果是线下预约完的订单,直接走思信修改信息接口
if(strpos($order_info->source, '线下体检预约') !== false){
$BuyInfo=json_decode($order_info->buy_info,true);
$items=[];
if(isset($BuyInfo['items']) and count($BuyInfo['items'])>0){
foreach($BuyInfo['items'] as $it){
$items[]=[
'Id'=>$it['id'],
'名称'=>$it['name'],
'原价'=>$it['price'],
'数量'=>1,
'价格'=>$it['price'],
'优惠方式'=>$it['youhui_fangshi'],
'优惠值'=>$it['youhui_zhi'],
'附加项目'=>true,
'收费方式'=>'自费',
'已收费'=>$order_info->status==2,
];
}
}
$peis = new PEISApiController();
$res=$peis::Post('个检预约设置套餐和项目信息', $order_info->hospital_id, [
'预约Id' => $order_info->appointment_number,
'已收费' => $order_info->status==2,
'套餐Id' => $order_info->combo_id==0?null:$order_info->combo_id,
'项目列表' => $items,
]);
if($res['message']=='设置成功'){
//预约完成后查询预约结果
$appointment_info = self::appointment_info($order_info->hospital_id, [
'type' => 1,
"证件号码" => null,
"电话号码" => null,
"预约Id" => $order_info->appointment_number,
]);
$u = DB::table('orders')->where(['id' => $order_info->id])->update([
'appointment_back_info' => json_encode($appointment_info['data'][0], JSON_UNESCAPED_UNICODE),
]);
return ['status' => true, 'msg' => "完成"];
}else{
return ['status' => false, 'msg' => "操作失败"];
}
}
$person=DB::table('web_user_person')->where(['id' => $order_info->person_id])->first();
if(!$person) return ['status' => false, 'msg' => "体检人信息无效。"];
$yyid=6;
@ -1321,7 +1397,12 @@ class OrderController extends Controller
//未支付取消订单
public function Cancel()
{
$order_number=request('order_number');
$orderInfo = DB::table('orders')->where(['order_number' => $order_number,'status'=>1])->first();
if (!$orderInfo) return \Yz::echoErrorJson('未找到有效订单');
$do = new OrderService();
$do->Cancel($orderInfo);
return \Yz::Return(true,"取消完成",['order_id'=>$orderInfo->id]);
}
//批量取消订单

@ -634,6 +634,7 @@ class OrderNewController extends Controller
$yuyue= $Finish->Finish($order->order_number);
return \Yz::Return($yuyue['status'], $yuyue['msg'], ['id' => $order->id]);
}
//转赠
public function ZhuanZeng()
{
@ -751,6 +752,75 @@ class OrderNewController extends Controller
})->get();
return \Yz::Return(true,'查询完成',['list'=>$list]);
}
//检测线下预约推送订单,该通知通知,该取消取消
public function OfflineOrderCheck()
{
$type = request('type');//1通知2取消
$now = new DateTime();
// 时间点1当前时间 +1 个月
$date1 = (clone $now)->modify('+1 month')->format('Y-m-d H:i:00');
// 时间点2当前时间 +7 天
$date2 = (clone $now)->modify('+7 days')->format('Y-m-d H:i:00');
// 时间点3当前时间 +6 天(你定义了 $date3但没用上这里也加上可选
$date3 = (clone $now)->modify('+6 days')->format('Y-m-d H:i:00');
$currentTime = $now->format('Y-m-d H:i:00');
if($type==1){
$AspZhuan = new AspNetZhuanController();
$targetTimes = [$date1, $date2];
$orders = DB::table('orders')
->where('status', 1)
->whereIn(DB::raw('TIMESTAMP(appointment_date, appointment_time)'), $targetTimes)
->where('source', 'like', '%线下体检预约%')
->where('offline_sendmsg_status', '<>', 2)
->get();
$orderids=[];
foreach ($orders as $order) {
$orderids[]=$order->id;
$offline_sendmsg_status=0;
if($order->offline_sendmsg_status==0 or $order->offline_sendmsg_status==null or $order->offline_sendmsg_status==''){
$offline_sendmsg_status=1;
}
if($order->offline_sendmsg_status==1){
$offline_sendmsg_status=2;
}
DB::table('orders')->where(['id'=>$order->id])->update(['offline_sendmsg_status'=>$offline_sendmsg_status]);
$person=DB::table('web_user_person')->where(['id_number'=>$order->id_number,'is_del'=>0])->first();
if(!$person) continue;
$reqst_data = [
'ghzid' => $person->ghzid,
'yyid' => 6,
'type' => 28,
'msg1' => $person['name'],
'msg2' => $order->title,
'msg3' => number_format($order->true_price, 2, '.', ''),
'msg4' => $order->appointment_date . ' ' . $order->appointment_time,
'msg5' => "健康管理中心",
'msg6' => "",
'url' => "pages/other/entry/index?path=/pages/other/jump-h5/index&src=https%3A%2F%2Ftj-h5.hnxdfe.com%2Fh5%2F%23%2Fpages%2Fmain%2Flogin%2Flogin%3Fpath%3Dorder&scene=1014",
];
$AspZhuan::WeiXinSend($reqst_data);
}
return \Yz::Return(true,"线下订单通知完成",['find_orderids'=>$orderids]);
}
if($type==2){
$orderids=[];
$order_cancels = DB::table('orders')
->where('status', 1)
->where('source', 'LIKE', '%线下体检预约%')
->where(function ($query) use ($date3, $currentTime) {
// 条件组:满足任一即可
$query->whereRaw('TIMESTAMP(appointment_date, appointment_time) = ?', [$date3]) // 精确匹配 +6天
->orWhereRaw('TIMESTAMP(appointment_date, appointment_time) < ?', [$currentTime]); // 小于当前时间
})->get();
$do = new OrderService();
foreach ($order_cancels as $order) {
$orderids[]=$order->id;
$do->Cancel($order);
}
return \Yz::Return(true,"线下订单自动取消完成",['find_orderids'=>$orderids]);
}
}
public function item_check($hospital, $data)
{
$peis = new PEISApiController();

@ -409,7 +409,7 @@ class PlanController extends Controller
if($u){
return \Yz::Return(true, "释放成功", ['plan_id' => $plan_id]);
}else{
return \Yz::echoError1("释放失败");
return \Yz::Return(false, "释放失败!!!", ['plan_id' => $plan_id]);
}
}
}

@ -146,7 +146,10 @@ class OrderController extends Controller
$hospital_id = request('hospital_id'); //秀英院区1府城院区4
$appointment_number = request('appointment_number');
$plan_id = request('plan_id');
$combo_id = request('combo_id');
if (!isset($plan_id) or empty($plan_id)) return \Yz::echoErrorJson("占用的号源id不能为空");
$check=DB::table('orders')->where(['appointment_number' => $appointment_number])->first();
if (!!$check) return \Yz::echoErrorJson("预约已存在,无需重复推送");
$plan_info=DB::table('plans')->where('id', $plan_id)->first();
$data = [
"证件号码" => null,
@ -166,15 +169,20 @@ class OrderController extends Controller
// }
$items = [];
foreach ($res['项目列表'] as $it) {
$items[] = [
'id' => $it['Id'],
'name' => $it['名称'],
'price' => $it['价格'],
];
if($it['自选项目']){
$items[] = [
'id' => $it['Id'],
'name' => $it['名称'],
'price' => $it['价格'],
'youhui_fangshi' => $it['优惠方式'],
'youhui_zhi' => $it['优惠值'],
];
}
}
$buyInfo = [
'combo' => [
'id' => 0,
'id' => empty($combo_id)?0:$combo_id,
'name' => '',
'price' => ''
],
@ -184,6 +192,9 @@ class OrderController extends Controller
]
];
$orderController= new \App\Http\Controllers\API\H5\OrderController();
if((empty($res['套餐名称']) or $res['套餐名称']=='无') and count($items)>0){
$res['套餐名称']='自选项目';
}
$save_data = [
'title' => $res['套餐名称'],
'type' => 1,
@ -203,6 +214,7 @@ class OrderController extends Controller
'appointment_back_info' => json_encode($res, JSON_UNESCAPED_UNICODE),
'plan_id' =>$plan_info->id,
'plan_number' =>$plan_info->plan_number,
'combo_id' =>empty($combo_id)?0:$combo_id,
'hospital_id' =>$hospital_id,
'phone' =>$res['电话号码'],
'sex' =>null,

@ -41,6 +41,7 @@ class PEISApiController extends Controller
$api['报告时间计算'] = "{$url}/Home/CalcReportDays?eventNos={$code}";
$api['弃检接口'] = "{$url}/Home/AbandonCheck";
$api['检后签到'] = "{$url}/Home/PostExamSignIn?eventNo={$code}";
$api['个检预约设置套餐和项目信息'] = "{$url}/PEISCommon/PersonAppSetComboInfo?key=YmMxOGI2MDUxZmFh";
}
if($env=='dev') { //如果是测试环境

@ -97,9 +97,9 @@ class ComboItemGroupService
// 判断是否是当天的开始时间00:00:00
if ($EndTime->isStartOfDay()) { // Carbon 提供的方法
$EndTime = $EndTime->endOfDay()->format('Y-m-d H:i:s');
$youxiaoEndTime = $EndTime->endOfDay()->format('Y-m-d H:i:s');
} else {
$EndTime = $EndTime->format('Y-m-d H:i:s');
$youxiaoEndTime = $EndTime->format('Y-m-d H:i:s');
}
} catch (\Exception $e) {
$youxiaoEndTime = $EndTime; // 解析失败则保持原样

@ -169,6 +169,16 @@ class OrderService
$now_datetime=date('Y-m-d H:i:s');
//调用接口恢复积分和预存款
$env=config('app.globals.Env');
if($orderInfo->appointment_number<>null and $orderInfo->appointment_number<>'' and strpos($orderInfo->source, '线下体检预约') !== false){
$ap = new OrderController();
$cancel = $ap->cancel_appointment($orderInfo->hospital_id, [
'type' => $orderInfo->type,
'预约Id' => $orderInfo->appointment_number
]);
if ($cancel['code'] != 0) return ['status'=>false,'msg'=>"取消预约失败," . $cancel['message']];
}
$AspNet=new AspNetZhuanController();
$jifen_huifu_status=true;
$yucunkuan_huifu_status=true;
@ -187,7 +197,7 @@ class OrderService
foreach ($erxian_info as $key => $plan_nmr) {
if(isset($plan_nmr['gid'])){
//调用接口校验号源是否可用
$erxian_status = $AspNet::ErXian(['id' =>$plan_nmr['gid'], 'yyid' => $yyid, 'action' => 3], uniqid());
$erxian_status = $AspNet::ErXian(['id' =>$plan_nmr['gid'], 'yyid' => $yyid, 'action' => 3,'leixing'=>$plan_nmr['leixing']], uniqid());
$erxian_info[$key]['gid']='';
$ex_u= DB::table('orders')->where(['id' => $orderInfo->id])->update([
'erxian_appointment_info'=>json_encode($erxian_info, JSON_UNESCAPED_UNICODE),

@ -67,6 +67,7 @@ Route::group(['middleware' => ['log'],'prefix' => 'api/H5'], function () {
Route::post('/StartPay', 'App\Http\Controllers\API\H5\PayController@StartPay');//开始支付接口
Route::post('/CheckPay', 'App\Http\Controllers\API\H5\PayController@CheckPay');//支付结果查询接口
Route::post('/Refund', 'App\Http\Controllers\API\H5\PayController@Refund');//退款
Route::post('/OrderCancel', 'App\Http\Controllers\API\H5\OrderController@Cancel');//取消订单
Route::post('/GetOrderDetail', 'App\Http\Controllers\API\H5\OrderController@GetDetail');//获取订单详情
Route::post('/ChangeAppointment', 'App\Http\Controllers\API\H5\OrderController@ChangeAppointment');//改约
Route::post('/ReportContrast', 'App\Http\Controllers\API\H5\ReportController@contrast');//报告对比
@ -131,6 +132,7 @@ Route::any('GetZhuanZhenInfo', 'App\Http\Controllers\API\Web\OrderController@exp
Route::post('/RoundPayCheck', 'App\Http\Controllers\API\H5\OrderController@RoundPayCheck');//轮询支付检查
Route::post('/Day1WXSend', 'App\Http\Controllers\API\H5\OrderController@Day1WXSend')->middleware('log');//提前1天微信通知
Route::post('/AutoRefund', 'App\Http\Controllers\API\H5\PayController@AutoRefund')->middleware('log');//对外退款接口
Route::post('/OfflineOrderCheck', 'App\Http\Controllers\API\H5\OrderNewController@OfflineOrderCheck')->middleware('log');//检测线下预约推送订单,该通知通知,该取消取消
Route::any('api/FenzhenInfoExport', 'App\Http\Controllers\H5\FenzhenController@export')->middleware('log');//导出报表
Route::any('api/FenzhenInfoExport2', 'App\Http\Controllers\H5\FenzhenController@export2')->middleware('log');//导出报表

@ -0,0 +1,77 @@
<?php
namespace Workerman\Lib;
use DateTime;
use Workerman\Worker;
$bot_loop = new Worker();
$bot_loop->count = 1;
$bot_loop->name = 'OfflineOrderCheck';
function OfflineOrderCheck($type)
{
Tool::log('开始执行线下预约订单任务type:'.$type, 2);
$url = Tool::ini('OFFLINEORDER_CHECK');
$res = Tool::post($url ,[
'type' => $type
]);
Tool::log(json_encode($res, JSON_UNESCAPED_UNICODE), 2);
}
function OfflineOrderCheckFunc()
{
$db = Db::get();
$now = new DateTime();
// 时间点1当前时间 +1 个月
$date1 = (clone $now)->modify('+1 month')->format('Y-m-d H:i:00');
// 时间点2当前时间 +7 天
$date2 = (clone $now)->modify('+7 days')->format('Y-m-d H:i:00');
$date3 = (clone $now)->modify('+6 days')->format('Y-m-d H:i:00');
$currentTime = $now->format('Y-m-d H:i:00');
$order_tongzhi = $db->getRow(
"SELECT COUNT(1) AS c
FROM orders
WHERE status = ?
AND TIMESTAMP(appointment_date, appointment_time) IN (?, ?)
AND source LIKE ?
AND offline_sendmsg_status <> 2",
[
1,
$date1, // +1个月 的这一分钟
$date2, // +7天 的这一分钟
'%线下体检预约%'
]
);
$order_cancel = $db->getRow(
"SELECT COUNT(1) AS c
FROM orders
WHERE status = ?
AND (
TIMESTAMP(appointment_date, appointment_time) = ?
OR
TIMESTAMP(appointment_date, appointment_time) < ?
)
AND source LIKE ?",
[
1,
$date3, // 条件1+6天
$currentTime, // 条件2小于当前时间
'%线下体检预约%'
]
);
if ($order_tongzhi['c'] > 0) {
OfflineOrderCheck(1);
} else if ($order_cancel['c'] > 0){
OfflineOrderCheck(2);
}else {
Tool::log('未检测到任务');
}
}
$bot_loop->onWorkerStart = function () {
OfflineOrderCheckFunc();
Timer::add(10, function () {
OfflineOrderCheckFunc();
});
};

@ -18,9 +18,9 @@ function OrderCancel()
function OrderCancelFunc()
{
$db = Db::get();
$order_cancel_count = $db->getRow("select count(1) as c from orders where status = ? and created_at < ?", [
$order_cancel_count = $db->getRow("select count(1) as c from orders where status = ? and created_at < ? and source not like ?", [
1,
date('Y-m-d H:i:s', time() - 60 * 20)
date('Y-m-d H:i:s', time() - 60 * 20),'%线下体检预约%'
]);
if ($order_cancel_count['c'] > 0) {
OrderCancel();

@ -23,7 +23,7 @@ function PayCheckFunc()
$pay_check = $db->getRow("select * from orders where status = ? and order_number is not null order by paycheck_time asc", [
1,
]);
if (!!$pay_check and strtotime($pay_check['paycheck_time'])>strtotime($pay_check['created_at']) + 60) {
if (!!$pay_check and strtotime($pay_check['paycheck_time'])<strtotime($pay_check['created_at']) + 60) {
Db2::u($db, 'orders', [
'paycheck_time' => date('Y-m-d H:i:s'),
], 'where id = ?', [

@ -111,7 +111,7 @@
<view class="order_icon_image_wrapper">
<image src="@/static/assets/buy/yuan_duihao.png"></image>
</view>
<view class="order_icon_tip_wrapper"><span v-if="($store.getTempPlan()?.plan_id || order_info.combo_id=='2814')"></span><span v-else></span></view>
<view class="order_icon_tip_wrapper"><span v-if="($store.getTempPlan()?.plan_id || order_info.combo_id=='2814' || order_info.source?.includes('线下体检预约'))"></span><span v-else></span></view>
<view v-if="order_info.checkup_type_id==4 && (order_info.title=='' || order_info.title=='')"
style="font-size: 24rpx;padding:20rpx 40rpx; 0rpx 40rpx;color:#FF0000;">
请您的配偶在15分钟内完成预约否则本次预约将会失效如有支付金额会原路退回

@ -214,6 +214,7 @@
tj_plan_id.value = timeinfo.id
let temp = $store.getYytjInfo()
temp.nmr_list[0].time = selectedDate.value+ ' '+ timeinfo.time
temp.nmr_list[0].id = timeinfo.id
$store.setYytjInfo(temp)
}
}

@ -34,9 +34,19 @@ import DraggableButton from "@/pages/components/goHome.vue";
}
if (!!$props.path) {
path = decodeURIComponent($props.path)
const index = path.indexOf('#');
if (index !== -1) {
path= path.substring(0, index); // # #
}
param=param+"?path="+path
}
if (!!openid) {
const index = openid.indexOf('#');
if (index !== -1) {
openid= openid.substring(0, index); // # #
}
uni.setStorageSync('OPENID', openid)
uni.redirectTo({
url: "/pages/main/index/index"+param

@ -45,7 +45,12 @@
}
onLoad((option) => {
if(!!option.orderid){
orderid.value=option.orderid
let orderid1=option.orderid
const index = orderid1.indexOf('#');
if (index !== -1) {
orderid1= orderid1.substring(0, index); // # #
}
orderid.value=orderid1
CheckPay()
}else{
uni.showToast({

@ -18,6 +18,11 @@
onShow
} from "@dcloudio/uni-app";
import wx from "weixin-js-sdk";
import {
useStore
} from "@/store";
const $store = useStore();
const $props = defineProps({
info: {
type: Object,
@ -39,6 +44,9 @@
const countdown = ref(null);
const checkStatus = () => {
if(order_info.value.source?.includes('线下体检预约')){
return
}
if (order_info.value.status === 1 || (order_info.value.status===2 && order_info.value.checkup_type_id==4 && order_info.value.end_time)) {
countdown.value = setInterval(() => {
countdownRun();
@ -54,11 +62,33 @@
(order_info.value.end_time - new Date() / 1000) / 60
);
count_down_text.value =minutes>=0? `${minutes}${seconds}`:"限制时间";
if (order_info.value.end_time <= new Date() / 1000 && order_info.value.status === 1) {
if (order_info.value.end_time <= new Date() / 1000 && order_info.value.status === 1 ) {
clearInterval(countdown.value);
order_info.value.status = 3;
}
};
//
const OrderCancelFunc= async (order)=>{
uni.showModal({
title: '提示',
content:'确定取消此订单吗?',
success: async function (res) {
if (res.confirm) {
uni.showLoading();
const response = await $api("OrderCancel", {
order_number: order.order
});
uni.hideLoading();
$response(response, () => {
emit("updateValue", "orderUpdate");
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
const StartPay = async (id) => {
//
uni.showLoading();
@ -341,6 +371,16 @@
}
});
}
const Buy=(orderInfo)=>{
if(orderInfo.source?.includes('线下体检预约')){
let data= {plan_id:orderInfo.plan_id,plan_time:orderInfo.time,order_id:orderInfo.id}
$store.setTempPlan(data)
uni.redirectTo({
url:'/pages/main/combo/combo'
})
}
}
onMounted(() => {
@ -418,7 +458,7 @@
</view>
</uni-popup>
<uni-popup ref="detail_popup" type="center" :animation="false">
<view style="background-color: #fff;padding: 20rpx;border-radius: 10rpx; width: 600rpx;" v-if="OrderInfoDetail.buy_info">
<view style="background-color: #fff;padding: 20rpx;border-radius: 10rpx; width: 600rpx;max-height:90vh;overflow-y:auto;" v-if="OrderInfoDetail.buy_info">
<view>{{OrderInfoDetail.title}}</view>
<view class="OrderInfoRow">
<view class="row_label">体检人员:</view>
@ -450,7 +490,7 @@
<view style="margin-top: 10rpx;">预约时间{{item.date}} {{item.time}}</view>
</view>
</view>
<view class="OrderInfoRow" v-if="OrderInfoDetail.source==null && OrderInfoDetail.buy_info.items && OrderInfoDetail.buy_info.items.length>0">
<view class="OrderInfoRow" v-if=" OrderInfoDetail.buy_info.items && OrderInfoDetail.buy_info.items.length>0">
<view class="row_label">自选项目:</view>
<view class="row_value">
<view v-for="(item,index) in OrderInfoDetail.buy_info.items" :key="index"> {{item.name}} </view>
@ -583,7 +623,7 @@
<view class="order_line_wrapper"></view>
<view v-if="![3].includes(order_info.status)" class="order_pay_wrapper">
<view class="order_pay_time_wrapper">
<view v-if="[1].includes(order_info.status)">
<view v-if="[1].includes(order_info.status) && !order_info.source?.includes('线下体检预约')">
<text>请在</text>
<text class="time_red">{{ count_down_text }}</text>
<text>内完成支付</text>
@ -603,7 +643,7 @@
</view>
</view>
<view class="order_pay_button_wrapper">
<view v-if="[1].includes(order_info.status)" @click="StartPay(order_info.id)"
<view v-if="[1].includes(order_info.status) && order_info.true_price>0" @click="StartPay(order_info.id)"
class="button_item_wrapper pay_button_wrapper">继续付款</view>
<view
v-if="[2].includes(order_info.status) && order_info.appointment_number!=null && order_info.appointment_number!=''"
@ -628,6 +668,10 @@
</view> -->
<view v-if="[2].includes(order_info.status) && order_info.type=='' && !order_info.source?.includes('')" @click="Refound(order_info)"
class="button_item_wrapper refund_button_wrapper"><span v-if="order_info.true_price>0">退</span><span v-else></span></view>
<view v-if="[1].includes(order_info.status) && order_info.type=='' && order_info.source?.includes('线') &&order_info.true_price==0 && (order_info.combo_id==0 || order_info.combo_id==null)" @click="Buy(order_info)"
class="button_item_wrapper refund_button_wrapper"><span >购买套餐</span></view>
<view v-if="[1].includes(order_info.status) && order_info.type=='' && order_info.source?.includes('线')" @click="OrderCancelFunc(order_info)"
class="button_item_wrapper refund_button_wrapper"><span >取消</span></view>
</view>
</view>
<view v-else class="order_pay_blank_wrapper"></view>

@ -478,11 +478,12 @@
let apiName="CreateNewOrder"
let doneUrl="/pages/buy/done/done?id="
if($store.tempPlan?.plan_id){
if($store.getTempPlan()?.plan_id){
apiName="OrderCreate"
doneUrl="/pages/buy/done/yuyue_done?id="
obj.plan_id=$store.tempPlan?.plan_id
obj.plan_id=$store.getTempPlan()?.plan_id
obj.yuyue_fangshi='GeJianPlanFront'
obj.order_id=$store.getTempPlan()?.order_id
}
const response = await $api(apiName, obj);

Loading…
Cancel
Save