diff --git a/api/ticket.ts b/api/ticket.ts index 81688eb..272f886 100644 --- a/api/ticket.ts +++ b/api/ticket.ts @@ -19,4 +19,8 @@ export const orderStorageAct = (data : any) => post('v1/order/storage/act', data // 核销接口 export const orderStorageVerify = (data : any) => post('v1/order/storage/verify', data); // 入库&核销记录 -export const orderRecord = (data : any = {}) => get('v1/order/record', data); \ No newline at end of file +export const orderRecord = (data : any = {}) => get('v1/order/record', data); + + +// 退单 +export const ticketRevert = (data : any = {}) => post('v1/ticket.revert', data); \ No newline at end of file diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 12287c9..7cbd049 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -85,7 +85,7 @@ import { onShow, onReachBottom, Uni } from "@dcloudio/uni-app" import { ref } from "vue" import { useToast } from '@/uni_modules/wot-design-uni' - import { userInfo } from '@/api/login' + import { } from '@/api/login' const Toast = useToast() declare const uni : Uni @@ -201,11 +201,11 @@ }); break; case 'call': - // 入库 - // uni.navigateTo({ - // url: '/pagesB/call/index' - // }); - Toast.info('暂无缴费记录') + // 物业催缴 + uni.navigateTo({ + url: '/pagesB/call/index' + }); + // Toast.info('暂无缴费记录') break; case 'protocol': // 用户协议 @@ -220,13 +220,13 @@ }); break; case 'setting': - // 隐私政策 + // 设置 uni.navigateTo({ url: '/pagesB/setting/index' }); break; case 'userInfo': - // 隐私政策 + // 修改用户信息 uni.navigateTo({ url: '/pagesB/setting/editInfo' }); diff --git a/pagesA/my_order/detail.vue b/pagesA/my_order/detail.vue index 6ddaef9..e5406d6 100644 --- a/pagesA/my_order/detail.vue +++ b/pagesA/my_order/detail.vue @@ -80,7 +80,7 @@ 联系电话 - + {{ticketInfo?.order?.mobile}} @@ -145,22 +145,22 @@ - + 工单记录 - + - {{ticketInfo.create_time}} - 创建工单 + {{item.create_time}} + {{item.remark}} - + - 退单 - 结单 + 退单 + + 结单 + + + @@ -192,10 +196,12 @@ import { ref, computed } from 'vue' import { onLoad, onShow } from '@dcloudio/uni-app' import { useNavigation } from '@/hooks/useNavigation' - import { myTicketInfo } from '@/api/ticket' - import { useToast } from '@/uni_modules/wot-design-uni' + import { myTicketInfo, ticketRevert } from '@/api/ticket' + import { useToast, useMessage } from '@/uni_modules/wot-design-uni' const Toast = useToast() + const Message = useMessage() + const loading = ref(false) const bntloading = ref(false) @@ -221,34 +227,6 @@ } }) - // 商品列表数据 - const productList = computed(() => { - // 如果接口返回了商品数据,则使用接口数据 - if (ticketInfo.value?.order?.products && ticketInfo.value.order.products.length > 0) { - return ticketInfo.value.order.products - } - - // 示例数据 - return [ - { - id: 1, - name: '燕京 8度U8 500ML*12瓶/箱', - spec: '500ML*12瓶/箱', - quantity: 2, - price: 99, - image: '../../static/swiper/1.png' - }, - { - id: 2, - name: '燕京9度菊花听500ML*12听', - spec: '500ML*12听', - quantity: 1, - price: 89, - image: '../../static/swiper/1.png' - } - ] - }) - // 计算商品总价 const getTotalPrice = () => { let total = 0 @@ -309,9 +287,39 @@ const handleAction = (action) => { console.log(action); } + + const revert = () => { + Message.confirm({ + msg: '提示', + title: '确定退单吗?' + }) + .then(() => { + getTicketRevert() + }) + + } + const getTicketRevert = async () => { + uni.showLoading({ + title: '退单中...' + }) + const res = await ticketRevert({ + ticket_id: ticketInfo.value.ticket_id + }) + uni.hideLoading() + Toast.success('退单成功') + setTimeout(() => { + uni.navigateBack() + }, 400) + } + + const btnPhone = (value : any) => { + uni.makePhoneCall({ + phoneNumber: value + }) + } - \ No newline at end of file diff --git a/pagesA/my_order/list.vue b/pagesA/my_order/list.vue index d6e12c5..ff119a4 100644 --- a/pagesA/my_order/list.vue +++ b/pagesA/my_order/list.vue @@ -113,38 +113,20 @@ isTabBarPage, // 当前页面是否为 tabBar 页面 checkRouteStack // 检查当前路由栈状态的方法 } = useNavigation() - - - onLoad((options) => { - checkRouteStack() - if (options.type) { - activeTab.value = Number(options.type) - handleStatusChange(Number(options.status)) - }else{ - activeTab.value = 0 - handleStatusChange('ALL') - } - }) - - onShow(() => { - // query.value.page = 1 - // taskList.value = [] - // poolList() - }) - - onPullDownRefresh(() => { - query.value.page = 1 - taskList.value = [] - poolList() - setTimeout(() => { - uni.stopPullDownRefresh() - }, 300) - }) - - onReachBottom(() => { - if (finish.value) return - query.value.page++ - poolList() + interface QueryParams { + page : number; + limit : number; + type : string; + status : string | number; + ticket_no : string; + } + + const query = ref({ + page: 1, + limit: 10, + type: 'ALL', + status: 'ALL', + ticket_no: '' }) const poolList = async () => { @@ -157,13 +139,7 @@ taskList.value.push(...res.data) } - const query = ref({ - page: 1, - limit: 10, - type: 'ALL', - status: 'ALL', - ticket_no: '' - }) + const finish = ref(false) const loading = ref(false) @@ -310,6 +286,40 @@ query.value.status = id tabChange() } + + + + onLoad((options) => { + checkRouteStack() + if (options.type) { + activeTab.value = Number(options.type) + // handleStatusChange(Number(options.status)) + query.value.status = Number(options.status) + } else { + activeTab.value = 0 + query.value.status = 'ALL' + // handleStatusChange('ALL') + } + }) + + onShow(() => { + tabChange() + }) + + onPullDownRefresh(() => { + query.value.page = 1 + taskList.value = [] + poolList() + setTimeout(() => { + uni.stopPullDownRefresh() + }, 300) + }) + + onReachBottom(() => { + if (finish.value) return + query.value.page++ + poolList() + }) diff --git a/uni_modules/mp-html/components/mp-html/node/node.vue b/uni_modules/mp-html/components/mp-html/node/node.vue new file mode 100644 index 0000000..d3457c5 --- /dev/null +++ b/uni_modules/mp-html/components/mp-html/node/node.vue @@ -0,0 +1,597 @@ +