MrShi
2025-05-21 6ed771467abc47b2d5e1174480a3302f6ab5ed96
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, this.$store.state.openId).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 {