diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js index e6cd4728..48a4a1f3 100644 --- a/jiuyi2/common/js/config.js +++ b/jiuyi2/common/js/config.js @@ -5,18 +5,17 @@ const config = { host: 'http://localhost:5173', // #endif // #ifndef H5 - host: 'https://539c1514.r24.cpolar.top', - // host: 'http://gfjds5.natappfree.cc', + host: 'http://2h34ni.natappfree.cc', // #endif // 支付方式配置 payType: { score: { name: '积分', - img: '/static/images/pay/wechat.png', + img: '/static/score.png', }, balance: { name: '余额', - img: '/static/images/pay/wechat.png', + img: '/static/balance.png', }, }, // 腾讯im聊天 diff --git a/jiuyi2/common/js/order.js b/jiuyi2/common/js/order.js index 9c18c29d..adca2aa6 100644 --- a/jiuyi2/common/js/order.js +++ b/jiuyi2/common/js/order.js @@ -5,19 +5,22 @@ import api from '@/api/index.js' const order = { /** - * 订单支付 + * 订单取消 * @param {Object} event 事件对象 */ - orderPay: (event) => { + orderCancel: (event) => { return new Promise((resolve, reject) => { - api.shop.orderPay({ - query: { - ...event.query, - }, - data: [ - event.orderId, - ], - }).then(rs => { + util.alert({ + content: '取消订单后不可恢复,确认取消订单?', + }).then(res => { + if (!res.confirm) return + // + return api.shop.orderCancel({ + query: { + id: event.orderId, + }, + }) + }).then(res => { if (res.code == 200) { resolve(res.data) return @@ -28,6 +31,18 @@ const order = { }) }) }) + }, + + /** + * 订单支付 + * @param {Object} event 事件对象 + */ + orderPay(event) { + uni.navigateTo({ + url: util.setUrl('/pages/shop/commodity/payment', { + orderId: event.id, + }) + }) } } diff --git a/jiuyi2/common/js/util.js b/jiuyi2/common/js/util.js index 34c19d82..70828da2 100644 --- a/jiuyi2/common/js/util.js +++ b/jiuyi2/common/js/util.js @@ -1804,11 +1804,6 @@ const util = { }) }) }, - - // 分页 - paging: { - // - }, } export default util \ No newline at end of file diff --git a/jiuyi2/components/shop/order/logistics.vue b/jiuyi2/components/shop/order/logistics.vue index 58ce3e59..d9e02992 100644 --- a/jiuyi2/components/shop/order/logistics.vue +++ b/jiuyi2/components/shop/order/logistics.vue @@ -3,23 +3,55 @@ * 物流入口 */ + import { + ref, + reactive, + defineProps, + computed + } from 'vue' + import { + onLoad, + } from '@dcloudio/uni-app'; + // 工具库 + import util from '@/common/js/util.js' + // api + import api from '@/api/index.js' + // + // 详情 + const props = defineProps({ + detail: { + type: Object, + default: () => ({}) + }, + logistics: { + type: Object, + default: () => ({}) + } + }) + // 商品图片 + const productImg = computed(() => props.detail.orderDetailList[0]?.productInfo?.sliderImage.split(',')[0]) + + onLoad(() => { + // + }) + // 跳转 function link(url) { uni.navigateTo({ - url: '/pages/shop/order/logistics' + url: util.setUrl('/pages/shop/order/logistics', { + // + }) }) }