|
| 1 | +<template> |
| 2 | + <view> |
| 3 | + <view class="cu-bar bg-white search "> |
| 4 | + <view class="search-form round"> |
| 5 | + <text class="cuIcon-search"></text> |
| 6 | + <input type="text" placeholder="输入核销码" v-model="reserveQrcode" confirm-type="search"></input> |
| 7 | + </view> |
| 8 | + <view class="action"> |
| 9 | + <button class="cu-btn bg-gradual-green shadow-blur round" @click="navigateToScan()">扫码</button> |
| 10 | + <button style="margin-left: 10px;" class="cu-btn bg-gradual-red shadow-blur round" |
| 11 | + @click="comfirmTimeId(reserveQrcode)">核销</button> |
| 12 | + </view> |
| 13 | + </view> |
| 14 | + <view v-if="reserveOrders && reserveOrders.length>0"> |
| 15 | + <view v-for="(item,index) in reserveOrders" :key="index" |
| 16 | + class="bg-white margin-top margin-right-xs radius margin-left-xs padding"> |
| 17 | + <view class="flex padding-bottom-xs solid-bottom justify-between"> |
| 18 | + <view style="font-size: 14px;">单号<span style="margin-left: 10px;" |
| 19 | + class="text-gray">{{item.orderId}}</span></view> |
| 20 | + </view> |
| 21 | + <view class="flex margin-top justify-between"> |
| 22 | + <view class="text-gray">商品/服务</view> |
| 23 | + <view class="text-gray">{{item.goodsName}}</view> |
| 24 | + </view> |
| 25 | + <view class="flex margin-top-xs justify-between"> |
| 26 | + <view class="text-gray">核销数量</view> |
| 27 | + <view class="text-gray">{{item.quantity}}</view> |
| 28 | + </view> |
| 29 | + <view class="flex margin-top-xs justify-between"> |
| 30 | + <view class="text-gray">预约日期</view> |
| 31 | + <view class="text-gray">{{item.appointmentTime}}</view> |
| 32 | + </view> |
| 33 | + <view class="flex margin-top-xs justify-between"> |
| 34 | + <view class="text-gray">预约小时</view> |
| 35 | + <view class="text-gray">{{item.hours}}</view> |
| 36 | + </view> |
| 37 | + <view class="flex margin-top-xs justify-between"> |
| 38 | + <view class="text-gray">预约人</view> |
| 39 | + <view class="text-gray">{{item.personName}}({{item.personTel}})</view> |
| 40 | + </view> |
| 41 | + <view class="flex margin-top-xs justify-between"> |
| 42 | + <view class="text-gray">核销时间</view> |
| 43 | + <view class="text-gray">{{item.createTime}}</view> |
| 44 | + </view> |
| 45 | + </view> |
| 46 | + </view> |
| 47 | + <view v-else> |
| 48 | + <no-data-page></no-data-page> |
| 49 | + </view> |
| 50 | + </view> |
| 51 | +</template> |
| 52 | + |
| 53 | +<script> |
| 54 | + import noDataPage from '@/components/no-data-page/no-data-page.vue' |
| 55 | + import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue'; |
| 56 | + import url from '../../constant/url.js' |
| 57 | + import { |
| 58 | + getCurrentCommunity |
| 59 | + } from '../../api/community/community.js' |
| 60 | + import { |
| 61 | + getReserveGoodsConfirmOrder, |
| 62 | + saveReserveGoodsConfirmOrder |
| 63 | + } from '@/api/coupon/coupon.js' |
| 64 | + // 防止多次点击 |
| 65 | + import { |
| 66 | + preventClick |
| 67 | + } from '@/lib/java110/utils/common.js'; |
| 68 | + import Vue from 'vue' |
| 69 | + Vue.prototype.$preventClick = preventClick; |
| 70 | + export default { |
| 71 | + data() { |
| 72 | + return { |
| 73 | + onoff: true, |
| 74 | + orderImg: url.baseUrl + 'img/order.png', |
| 75 | + reserveOrders: [], |
| 76 | + page: 1, |
| 77 | + loadingStatus: 'loading', |
| 78 | + loadingContentText: { |
| 79 | + contentdown: '上拉加载更多', |
| 80 | + contentrefresh: '加载中', |
| 81 | + contentnomore: '没有更多' |
| 82 | + }, |
| 83 | + reserveQrcode: '', |
| 84 | + modal: { |
| 85 | + showModal: false, |
| 86 | + title: '暂停原因', |
| 87 | + text: '请填写暂停原因' |
| 88 | + } |
| 89 | + } |
| 90 | + }, |
| 91 | + components: { |
| 92 | + noDataPage, |
| 93 | + uniLoadMore |
| 94 | + }, |
| 95 | + onLoad() { |
| 96 | + this.java110Context.onLoad(); |
| 97 | + this._loadReserveUserDetail(); |
| 98 | + }, |
| 99 | + onShow() { |
| 100 | + let _userInfo = this.java110Context.getUserInfo(); |
| 101 | + let _storeId = _userInfo.storeId; |
| 102 | + this.storeId = _storeId; |
| 103 | + }, |
| 104 | + methods: { |
| 105 | +
|
| 106 | + // 获取核销订单 |
| 107 | + _loadReserveUserDetail: function() { |
| 108 | + let _that = this; |
| 109 | + getReserveGoodsConfirmOrder(this, { |
| 110 | + page: 1, |
| 111 | + row: 100, |
| 112 | + communityId: getCurrentCommunity().communityId |
| 113 | + }).then(_data => { |
| 114 | + _that.reserveOrders = _data.data; |
| 115 | + }) |
| 116 | + }, |
| 117 | + navigateToScan() { |
| 118 | + setTimeout(() => { |
| 119 | + uni.navigateTo({ |
| 120 | + url: `/pages/appointment/hou_one` |
| 121 | + }) |
| 122 | + }, 300) |
| 123 | + }, |
| 124 | + comfirmTimeId(timeId) { |
| 125 | + // debugger |
| 126 | + let _that = this; |
| 127 | + if (!timeId) { |
| 128 | + return; |
| 129 | + } |
| 130 | + _that.reserveQrcode = timeId; |
| 131 | + setTimeout(function() { |
| 132 | + uni.showModal({ |
| 133 | + cancelText: "取消", // 取消按钮的文字 |
| 134 | + confirmText: "核销", |
| 135 | + content: "核销码:" + timeId, |
| 136 | + success: (res) => { |
| 137 | + if (res.confirm) { |
| 138 | + wx.showToast({ |
| 139 | + title: "请稍后", |
| 140 | + icon: 'none' |
| 141 | + }); |
| 142 | + saveReserveGoodsConfirmOrder(_that, { |
| 143 | + timeId: timeId, |
| 144 | + communityId: getCurrentCommunity().communityId |
| 145 | + }).then(function(_res) { |
| 146 | + uni.showToast({ |
| 147 | + title: '操作成功' |
| 148 | + }); |
| 149 | + _that.reserveQrcode = ""; |
| 150 | + wx.hideLoading(); |
| 151 | + _that._loadReserveUserDetail(); |
| 152 | + }); |
| 153 | + } |
| 154 | + } |
| 155 | + }); |
| 156 | + }, 1000); |
| 157 | +
|
| 158 | + }, |
| 159 | + } |
| 160 | + } |
| 161 | +</script> |
| 162 | + |
| 163 | +<style> |
| 164 | +
|
| 165 | +</style> |
0 commit comments