|
@@ -5,11 +5,15 @@ import {
|
|
|
CellGroup,
|
|
|
DatePicker,
|
|
|
Dialog,
|
|
|
+ Field,
|
|
|
Icon,
|
|
|
Image,
|
|
|
List,
|
|
|
Picker,
|
|
|
Popup,
|
|
|
+ Radio,
|
|
|
+ RadioGroup,
|
|
|
+ showToast,
|
|
|
Sticky
|
|
|
} from 'vant'
|
|
|
import { defineComponent, onMounted, reactive } from 'vue'
|
|
@@ -21,6 +25,7 @@ import { orderStatus, orderType } from '@/constant'
|
|
|
import { moneyFormat } from '@/helpers/utils'
|
|
|
import ODialog from '@/components/o-dialog'
|
|
|
import { forms } from '@/school/train-planning/create'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'wait_pay',
|
|
@@ -31,6 +36,7 @@ export default defineComponent({
|
|
|
}
|
|
|
},
|
|
|
setup(props) {
|
|
|
+ const router = useRouter()
|
|
|
const form = reactive({
|
|
|
isClick: false,
|
|
|
timeShow: false,
|
|
@@ -50,7 +56,10 @@ export default defineComponent({
|
|
|
page: 1,
|
|
|
rows: 20
|
|
|
},
|
|
|
- refundStatus: false
|
|
|
+ refundStatus: false,
|
|
|
+ resion: null,
|
|
|
+ refundSelect: {} as any,
|
|
|
+ checked: null as any
|
|
|
})
|
|
|
|
|
|
// WAIT_PAY: '待支付',
|
|
@@ -119,19 +128,53 @@ export default defineComponent({
|
|
|
})
|
|
|
|
|
|
form.resionList = data.paramValue.split('\n')
|
|
|
- form.resionList.push('其它')
|
|
|
- console.log(form.resionList, 'resionList')
|
|
|
+ form.resionList.push('其它原因')
|
|
|
+ // console.log(form.resionList, 'resionList')
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 确认退费
|
|
|
+ const onConfirmRefund = async () => {
|
|
|
+ try {
|
|
|
+ const status = form.checked === form.resionList.length - 1 && form.resion
|
|
|
+ if (form.checked) {
|
|
|
+ showToast('请选择原因')
|
|
|
+ return
|
|
|
+ } else if (status) {
|
|
|
+ showToast('请输入原因')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log({
|
|
|
+ merOrderNo: form.refundSelect.orderNo,
|
|
|
+ refundReason: status ? form.resion : form.resionList[form.checked]
|
|
|
+ })
|
|
|
+ await request.post('/api-student/userPaymentOrder/refundPayment', {
|
|
|
+ data: {
|
|
|
+ merOrderNo: form.refundSelect.orderNo,
|
|
|
+ refundReason: status ? form.resion : form.resionList[form.checked]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const onDetails = (item: any) => {
|
|
|
+ router.push({
|
|
|
+ path: 'payment-result',
|
|
|
+ query: {
|
|
|
+ orderNo: item.orderNo
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getList()
|
|
|
getDefaultParams()
|
|
|
|
|
|
Object.keys(orderType).forEach((key) => {
|
|
|
- console.log(key)
|
|
|
form.typeArray.push({
|
|
|
text: orderType[key],
|
|
|
value: key
|
|
@@ -166,7 +209,7 @@ export default defineComponent({
|
|
|
immediateCheck={false}
|
|
|
>
|
|
|
{form.list.map((item: any) => (
|
|
|
- <CellGroup inset class={styles.cellGroup}>
|
|
|
+ <CellGroup inset class={styles.cellGroup} onClick={() => onDetails(item)}>
|
|
|
<Cell center titleClass={styles.times}>
|
|
|
{{
|
|
|
title: () => <span class={styles.times}>{item.createTime}</span>,
|
|
@@ -192,7 +235,11 @@ export default defineComponent({
|
|
|
<Button
|
|
|
block
|
|
|
class={styles.refundBtn}
|
|
|
- onClick={() => (form.refundStatus = true)}
|
|
|
+ onClick={(e: any) => {
|
|
|
+ e.stopPropagation()
|
|
|
+ form.refundSelect = item
|
|
|
+ form.refundStatus = true
|
|
|
+ }}
|
|
|
>
|
|
|
申请退费
|
|
|
</Button>
|
|
@@ -231,27 +278,63 @@ export default defineComponent({
|
|
|
/>
|
|
|
</Popup>
|
|
|
|
|
|
- <Dialog
|
|
|
- v-model:show={form.refundStatus}
|
|
|
- message={
|
|
|
- '您将要发起退款,退款需承担千分之六的手续费,确认退款后款项将原路返还到您的付款账户中。'
|
|
|
- }
|
|
|
- messageAlign="left"
|
|
|
- confirmButtonText="取消"
|
|
|
- cancelButtonText="确认退款"
|
|
|
- showCancelButton
|
|
|
- onConfirm={() => (form.refundStatus = false)}
|
|
|
- onCancel={() => {}}
|
|
|
- >
|
|
|
- {{
|
|
|
- title: () => (
|
|
|
- <div class={styles.dialogTitle}>
|
|
|
- <i></i>
|
|
|
- 申请退款
|
|
|
+ <Popup v-model:show={form.refundStatus} round style={{ width: '90%' }}>
|
|
|
+ <div class={styles.container}>
|
|
|
+ <div class={styles.dialogTitle}>
|
|
|
+ <i></i>
|
|
|
+ 申请退款
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={styles.refundContent}>
|
|
|
+ <div class={styles.tips}>
|
|
|
+ 您将要发起退款,退款需承担千分之六的手续费,确认退款后款项将原路返还到您的付款账户中。
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={styles.refundTitle}>
|
|
|
+ <span>*</span>请选择您的退款原因
|
|
|
</div>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Dialog>
|
|
|
+
|
|
|
+ <RadioGroup v-model={form.checked}>
|
|
|
+ {form.resionList &&
|
|
|
+ form.resionList.map((item: any, index: number) => (
|
|
|
+ <Cell style="padding: 16px 0;" onClick={() => (form.checked = index)}>
|
|
|
+ {{
|
|
|
+ icon: () => <Radio name={index} />,
|
|
|
+ title: () => <span style={'padding-left: 6px'}>{item}</span>
|
|
|
+ }}
|
|
|
+ </Cell>
|
|
|
+ ))}
|
|
|
+ </RadioGroup>
|
|
|
+ {form.checked === form.resionList.length - 1 && (
|
|
|
+ <Field
|
|
|
+ class={styles.phoneName}
|
|
|
+ v-model={form.resion}
|
|
|
+ placeholder="请输入原因"
|
|
|
+ maxlength={15}
|
|
|
+ type="textarea"
|
|
|
+ rows={2}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={['van-hairline--top van-dialog__footer']}>
|
|
|
+ <Button
|
|
|
+ onClick={onConfirmRefund}
|
|
|
+ class={['van-button van-button--default van-button--large van-dialog__cancel']}
|
|
|
+ >
|
|
|
+ 确认退款
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ onClick={() => (form.refundStatus = false)}
|
|
|
+ class={[
|
|
|
+ 'van-button van-button--default van-button--large van-dialog__confirm van-hairline--left'
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ 取消
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Popup>
|
|
|
</>
|
|
|
)
|
|
|
}
|