From 3363af77fa23bdc599c3f746ba9802b799c780eb Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 28 三月 2025 09:28:40 +0800
Subject: [PATCH] 解决h5访客申请bug

---
 h5/pages/appointmentDetails/appointmentDetails.vue |   65 +++++++++++++++++++++++++++++++-
 1 files changed, 63 insertions(+), 2 deletions(-)

diff --git a/h5/pages/appointmentDetails/appointmentDetails.vue b/h5/pages/appointmentDetails/appointmentDetails.vue
index 6b40e5e..181a827 100644
--- a/h5/pages/appointmentDetails/appointmentDetails.vue
+++ b/h5/pages/appointmentDetails/appointmentDetails.vue
@@ -22,6 +22,18 @@
       <view class="h1">璁垮棰勭害瀹℃牳涓嶉�氳繃</view>
       <view class="h2">鎮ㄧ殑鏉ヨ鐢宠宸茶椹冲洖锛屽鏈夌枒闂紝鍙仈绯昏璁夸汉</view>
     </view>
+		<view class="head_wrap head_error" v-if="info.status == 4">
+		  <view class="h1">璁垮棰勭害瀹℃牳宸插彇娑�</view>
+		  <view class="h2">鎮ㄧ殑鏉ヨ鐢宠宸插彇娑堬紝璇烽噸鏂扮敵璇�</view>
+		</view>
+		<view class="head_wrap head_success" v-if="info.status == 7">
+		  <view class="h1">璁垮棰勭害鎷滆涓�</view>
+		  <view class="h2">浣犵殑璁跨敵璇锋鍦ㄨ繘琛�,濡傛湁鐤戦棶锛屽彲鑱旂郴琚浜�</view>
+		</view>
+		<view class="head_wrap head_success" v-if="info.status == 8">
+		  <view class="h1">璁垮棰勭害宸茬绂�</view>
+		  <view class="h2">鎮ㄧ殑鏉ヨ鐢宠宸插け鏁堬紝璇烽噸鏂扮敵璇�</view>
+		</view>
 		<view class="head_wrap head_error" v-if="info.status == 9">
 		  <view class="h1">璁垮棰勭害宸插け鏁�</view>
 		  <view class="h2">鎮ㄧ殑鏉ヨ鐢宠宸插け鏁堬紝璇烽噸鏂扮敵璇�</view>
@@ -73,24 +85,37 @@
         <view class="box_list_item_val">{{ info.carNos }}</view>
       </view>
     </view>
+	<view class="padding_wrap">
+		<view class="btn" v-if="[0,1,2,5].includes(info.status)" @click="cancelShow = true">鍙栨秷棰勭害</view>
+	</view>
     <u-popup :show="show" mode="center" @close="close">
       <view class="qrocde">
         <canvas class="qrcode_img" canvas-id="img1"></canvas>
       </view>
     </u-popup>
+	<!-- 鍙栨秷棰勭害寮圭獥 -->
+	<u-modal
+		:show="cancelShow"
+		:showCancelButton="true"
+		title="绯荤粺鎻愮ず"
+		content='纭畾鍙栨秷褰撳墠棰勭害鍚楋紵'
+		@cancel="cancelShow = false"
+		@confirm="cancel" />
   </view>
 </template>
 
 <script>
 import wxcode from 'uniapp-qrcode'
-import { getVisitedDetail } from '@/api'
+import { getVisitedDetail, visitsSelfCancel } from '@/api'
 
 export default {
   data() {
     return {
+		id: null,
       info: {},
       show: false,
-      detail: ''
+      detail: '',
+	  cancelShow: false
     }
   },
   onBackPress(options) {
@@ -107,7 +132,9 @@
     return true
   },
   onLoad(option) {
+		uni.setStorageSync('ywinfo',{})
     this.detail = option.detail || ''
+	this.id = option.id
     this.getDetail(option.id)
     // visitorSubDetail({ id: option.id })
     // 	.then(res => {
@@ -123,6 +150,14 @@
 
   },
   methods: {
+	// 鍙栨秷棰勭害
+	cancel() {
+		const member = uni.getStorageSync('member');
+		visitsSelfCancel(this.id, member.id).then(res => {
+			this.cancelShow = false
+			this.getDetail(this.id)
+		})
+	},
     close() {
       this.show = false
     },
@@ -157,6 +192,28 @@
 <style lang="scss" scoped>
 .box {
   width: 100%;
+  .padding_wrap {
+  	position: fixed;
+  	z-index: 999;
+  	padding: 0 30rpx 64rpx;
+  	bottom: 0;
+  	left: 0;
+  	width: 100%;
+  	display: flex;
+  	justify-content: space-between;
+  
+  	.btn {
+  		height: 96rpx;
+  		line-height: 96rpx;
+  		text-align: center;
+  		width: 100%;
+  		font-size: 36rpx;
+  		color: #333333;
+  		background: #ffffff;
+  		border-radius: 48rpx;
+  		border: 1rpx solid #999999;
+  	}
+  }
   .qrocde {
     width: 300rpx;
     height: 300rpx;
@@ -204,6 +261,10 @@
       color: #ffffff;
     }
   }
+	.head_gray{
+		background-color: #666666;
+		color: #fff;
+	}
   .head_error {
     background: #fdeded;
     .h1 {

--
Gitblit v1.9.3