我的预定取消订单
Showing
1 changed file
with
38 additions
and
6 deletions
| ... | @@ -32,7 +32,7 @@ | ... | @@ -32,7 +32,7 @@ |
| 32 | </div> | 32 | </div> |
| 33 | 33 | ||
| 34 | <el-row class="pd20 mt10" justify="space-between" align="middle"> | 34 | <el-row class="pd20 mt10" justify="space-between" align="middle"> |
| 35 | <el-col :lg="10"> | 35 | <el-col :lg="9"> |
| 36 | <div v-if="b.orderType == 0"> | 36 | <div v-if="b.orderType == 0"> |
| 37 | <h3 class="name">{{b.name}}</h3> | 37 | <h3 class="name">{{b.name}}</h3> |
| 38 | <p v-if="language==0">{{b.messageObj?.roomStayDate}}</p> | 38 | <p v-if="language==0">{{b.messageObj?.roomStayDate}}</p> |
| ... | @@ -78,13 +78,13 @@ | ... | @@ -78,13 +78,13 @@ |
| 78 | <p>{{ b.extJsonObj.packageName }}</p> | 78 | <p>{{ b.extJsonObj.packageName }}</p> |
| 79 | </div> | 79 | </div> |
| 80 | </el-col> | 80 | </el-col> |
| 81 | <el-col :lg="4" class="text-center"> | 81 | <el-col :lg="3" class="text-center"> |
| 82 | <span class="text-warning"> {{ language==0?'¥':'€' }} | 82 | <span class="text-warning"> {{ language==0?'¥':'€' }} |
| 83 | <span class="bigMoney">{{language==0?b.total:b.totalEn}}</span> | 83 | <span class="bigMoney">{{language==0?b.total:b.totalEn}}</span> |
| 84 | </span> | 84 | </span> |
| 85 | </el-col> | 85 | </el-col> |
| 86 | 86 | ||
| 87 | <el-col :lg="4" > | 87 | <el-col :lg="6" > |
| 88 | <div class="text-right mb20 text-danger"> | 88 | <div class="text-right mb20 text-danger"> |
| 89 | <el-countdown value-style="color:#E60012;font-size:16px;" v-if="b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')" format="mm:ss" :value="b.countdown" @finish="finish(b)"/> | 89 | <el-countdown value-style="color:#E60012;font-size:16px;" v-if="b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')" format="mm:ss" :value="b.countdown" @finish="finish(b)"/> |
| 90 | </div> | 90 | </div> |
| ... | @@ -95,6 +95,10 @@ | ... | @@ -95,6 +95,10 @@ |
| 95 | <el-button v-if="b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')" @click="goDetail(b)" | 95 | <el-button v-if="b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')" @click="goDetail(b)" |
| 96 | class="mb10" plain round type="primary" > | 96 | class="mb10" plain round type="primary" > |
| 97 | {{ language==0?'支付':'Pay' }}</el-button> | 97 | {{ language==0?'支付':'Pay' }}</el-button> |
| 98 | <el-button v-if="b.viewStatus==0" @click="cancel(b)" class="mb10" plain round type="warning" > | ||
| 99 | {{ language==0?'取消订单':'Cancel Order' }}</el-button> | ||
| 100 | <el-button v-if="b.viewStatus==5" @click="unsubscribe(b)" class="mb10" plain round type="" > | ||
| 101 | {{ language==0?'退订':'Unsubscribe' }}</el-button> | ||
| 98 | </div> | 102 | </div> |
| 99 | </el-col> | 103 | </el-col> |
| 100 | </el-row> | 104 | </el-row> |
| ... | @@ -107,15 +111,18 @@ | ... | @@ -107,15 +111,18 @@ |
| 107 | </template> | 111 | </template> |
| 108 | 112 | ||
| 109 | <script setup> | 113 | <script setup> |
| 110 | import {onMounted} from "@vue/runtime-core"; | 114 | import {onMounted,getCurrentInstance} from "@vue/runtime-core"; |
| 111 | import {useStorage} from "@vueuse/core/index"; | 115 | import {useStorage} from "@vueuse/core/index"; |
| 112 | import {newbilllist} from "@/apiPc/common"; | 116 | import {newbilllist} from "@/apiPc/common"; |
| 113 | import useUserStore from "@/store/modules/user"; | 117 | import useUserStore from "@/store/modules/user"; |
| 114 | import dayjs from 'dayjs' | 118 | import dayjs from 'dayjs' |
| 119 | import {cancelOrder2,cancelOrder} from "/@/apiPc/booking"; | ||
| 120 | |||
| 115 | const router = useRouter() | 121 | const router = useRouter() |
| 116 | const language= useStorage('language',0) | 122 | const language= useStorage('language',0) |
| 117 | const list = ref([]) | 123 | const list = ref([]) |
| 118 | const user = useUserStore().user | 124 | const user = useUserStore().user |
| 125 | const {proxy} = getCurrentInstance() | ||
| 119 | 126 | ||
| 120 | onMounted(()=>{ | 127 | onMounted(()=>{ |
| 121 | getList() | 128 | getList() |
| ... | @@ -132,10 +139,8 @@ function getList() { | ... | @@ -132,10 +139,8 @@ function getList() { |
| 132 | b.extJsonObj = JSON.parse(b.extJson) || {} | 139 | b.extJsonObj = JSON.parse(b.extJson) || {} |
| 133 | if(b.surplus&&b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')){ | 140 | if(b.surplus&&b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')){ |
| 134 | b.countdown = Date.now() + Number((b.surplus.split(',')[0]*60 + b.surplus.split(',')[1])*10) | 141 | b.countdown = Date.now() + Number((b.surplus.split(',')[0]*60 + b.surplus.split(',')[1])*10) |
| 135 | console.log(b.countdown) | ||
| 136 | } | 142 | } |
| 137 | } | 143 | } |
| 138 | console.log(list.value) | ||
| 139 | }) | 144 | }) |
| 140 | } | 145 | } |
| 141 | function goDetail(b) { | 146 | function goDetail(b) { |
| ... | @@ -147,6 +152,33 @@ function goDetail(b) { | ... | @@ -147,6 +152,33 @@ function goDetail(b) { |
| 147 | } | 152 | } |
| 148 | }) | 153 | }) |
| 149 | } | 154 | } |
| 155 | |||
| 156 | const cancel = (row) => { | ||
| 157 | //取消订单 | ||
| 158 | proxy.$modal.confirm(language.value == 0 ? '确定取消订单吗 ?' :`Are you sure to cancel the order?`).then(() => { | ||
| 159 | return cancelOrder2(row.id).then(res=>{ | ||
| 160 | getList() | ||
| 161 | ElMessage({ | ||
| 162 | message: language.value == 0?'操作成功':'Successful operation!', | ||
| 163 | type: 'success' | ||
| 164 | }) | ||
| 165 | }) | ||
| 166 | }) | ||
| 167 | } | ||
| 168 | |||
| 169 | const unsubscribe = (row) => { | ||
| 170 | proxy.$modal.confirm(language.value == 0 ?`确定退款吗 ?`:'Are you sure to refund?').then(() => { | ||
| 171 | return cancelOrder(row.id).then(res=>{ | ||
| 172 | getList() | ||
| 173 | ElMessage({ | ||
| 174 | message: language.value == 0?'操作成功':'Successful operation!', | ||
| 175 | type: 'success' | ||
| 176 | }) | ||
| 177 | }) | ||
| 178 | }) | ||
| 179 | } | ||
| 180 | |||
| 181 | |||
| 150 | function toInvoice(){ | 182 | function toInvoice(){ |
| 151 | router.push({ | 183 | router.push({ |
| 152 | name: 'invoice' | 184 | name: 'invoice' | ... | ... |
-
Please register or sign in to post a comment