diff --git a/components.d.ts b/components.d.ts
index a6272c1..8934366 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -33,6 +33,7 @@ declare module '@vue/runtime-core' {
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
+ NutPopover: typeof import('@nutui/nutui-taro')['Popover']
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
NutPrice: typeof import('@nutui/nutui-taro')['Price']
NutRadio: typeof import('@nutui/nutui-taro')['Radio']
diff --git a/src/components/Cart.vue b/src/components/Cart.vue
index eb54117..466c05d 100644
--- a/src/components/Cart.vue
+++ b/src/components/Cart.vue
@@ -159,7 +159,7 @@ const create_order = async () => {
};
// isShowPay.value = true;
Taro.navigateTo({
- url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${mer_info.bid}`,
+ url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${mer_info.bid}&OrderType=1`,
});
}
}
diff --git a/src/pages/admin/add_order/pending_order/components/Footer.vue b/src/pages/admin/add_order/pending_order/components/Footer.vue
index f2ed3af..3e5ea71 100644
--- a/src/pages/admin/add_order/pending_order/components/Footer.vue
+++ b/src/pages/admin/add_order/pending_order/components/Footer.vue
@@ -1,30 +1,48 @@
diff --git a/src/pages/admin/add_order/pending_order/pending_order_detail/index.scss b/src/pages/admin/add_order/pending_order/pending_order_detail/index.scss
index 2c5a505..d7847a6 100644
--- a/src/pages/admin/add_order/pending_order/pending_order_detail/index.scss
+++ b/src/pages/admin/add_order/pending_order/pending_order_detail/index.scss
@@ -33,11 +33,13 @@
height: 195px;
border-radius: 12px;
min-width: 195px;
+ margin-right: 20px;
}
.center {
- margin-left: 20px;
-
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
.title {
font-weight: bold;
text-align: left;
@@ -54,7 +56,7 @@
}
.desc {
- padding: 10px 20px;
+ // padding: 10px 0px;
color: #666666;
}
}
@@ -75,4 +77,4 @@
color: #333333;
font-size: 32px;
}
-}
\ No newline at end of file
+}
diff --git a/src/pages/admin/add_order/pending_order/pending_order_detail/index.vue b/src/pages/admin/add_order/pending_order/pending_order_detail/index.vue
index 8870504..cb9e2c4 100644
--- a/src/pages/admin/add_order/pending_order/pending_order_detail/index.vue
+++ b/src/pages/admin/add_order/pending_order/pending_order_detail/index.vue
@@ -4,8 +4,8 @@
- x{{ itm.pay_price }}
+ ¥{{ itm.pay_price }}
x{{ itm.number }}
-
+
diff --git a/src/pages/cart/index.vue b/src/pages/cart/index.vue
index cd85441..c8f795f 100644
--- a/src/pages/cart/index.vue
+++ b/src/pages/cart/index.vue
@@ -207,7 +207,7 @@ const sub = async () => {
// isShowPay.value = true;
// console.log(arr)
Taro.navigateTo({
- url: `/pages/goods/pay/index?oid=${res.oid}&bid=${arr[0].StoreBid}`,
+ url: `/pages/goods/pay/index?oid=${res.oid}&bid=${arr[0].StoreBid}&OrderType=1`,
});
}
} catch (e) {
diff --git a/src/pages/goods/pay/index.vue b/src/pages/goods/pay/index.vue
index 7445214..b02141e 100644
--- a/src/pages/goods/pay/index.vue
+++ b/src/pages/goods/pay/index.vue
@@ -4,13 +4,9 @@
>交易剩余时间:{{ tStr }}
-
+
-
+
@@ -132,12 +128,15 @@ const visible2 = ref(false);
const opt = ref({});
Taro.useLoad(e => {
- const {oid, bid} = e;
+ const {oid, bid, OrderType} = e;
opt.value = e;
- getData(oid, bid);
+ getData(oid, bid, OrderType);
});
-const getData = async (oid: string, bid: string) => {
+const a = ref(0);
+const b = ref(0);
+
+const getData = async (oid: string, bid: string, OrderType: number) => {
const user_info = Taro.getStorageSync('userInfo');
const data = await getUserPoint({
phone: user_info.data.phone,
@@ -145,12 +144,26 @@ const getData = async (oid: string, bid: string) => {
});
const res = await getActiveOrderDetail({
oid,
+ OrderType: Number(OrderType),
});
+ // let a = 0;
+ // let b = 0;
+
orderData.value = {
- ...res.data.data,
+ ...res.data.data[0],
...data.data,
};
+
+ a.value = 0;
+ b.value = 0;
+
+ res.data.data.forEach(item => {
+ a.value += item.price;
+ b.value += item.exchange;
+ });
+
+ console.log(orderData.value);
if (!orderData.value.oid)
return Taro.showToast({
title: '未获取到订单信息~',
@@ -201,8 +214,9 @@ const shortComplete = async value => {
const confirmPay = async () => {
try {
const res = await payOrder({
+ // oid: opt.value.oid.map(item => item.oid),
oid: opt.value.oid,
- OrderType: orderData.value.pay_type,
+ OrderType: payVal.value,
PayType: payVal.value,
});
switch (payVal.value) {
@@ -227,8 +241,11 @@ const confirmPay = async () => {
});
},
complete: function () {
+ // Taro.redirectTo({
+ // url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}&OrderType=1`,
+ // });
Taro.redirectTo({
- url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}`,
+ url: `/pages/users/order_list/index?type=0`,
});
},
});
@@ -245,8 +262,11 @@ const confirmPay = async () => {
icon: 'none',
});
setTimeout(() => {
+ // Taro.redirectTo({
+ // url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}&OrderType=1`,
+ // });
Taro.redirectTo({
- url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}`,
+ url: `/pages/users/order_list/index?type=0`,
});
}, 2000);
break;
diff --git a/src/pages/users/order_list/index.vue b/src/pages/users/order_list/index.vue
index 515e001..427a953 100644
--- a/src/pages/users/order_list/index.vue
+++ b/src/pages/users/order_list/index.vue
@@ -9,6 +9,8 @@ import {getUserPoint} from '@/api/admin';
const tabValue = ref(0);
const isShowPay = ref(false);
+const isShowCode = ref(false);
+const url = ref('');
const tabsList = ref([
{
@@ -150,7 +152,7 @@ const successPay = () => {
const toDetail = (item: any) => {
Taro.navigateTo({
- url: `/pages/users/order_list_detail/index?orderId=${item.joint_oid}`,
+ url: `/pages/users/order_list_detail/index?orderId=${item.oid}&OrderType=2`,
});
};
@@ -194,6 +196,41 @@ const getTj = async () => {
});
}
};
+
+const t_id = ref();
+
+const openCode = item => {
+ if (item.status === 2) return;
+ url.value = `https://api.pwmqr.com/qrcode/create?url=${item.oid}`;
+ isShowCode.value = true;
+ t_id.value = setInterval(() => {
+ checkStatus(item);
+ }, 1000);
+};
+
+const checkStatus = async itm => {
+ await getList();
+ orderList.value.forEach(item => {
+ if (item.oid === itm.oid) {
+ console.log(item);
+ if (item.status === 2) {
+ clearInterval(t_id.value);
+ isShowCode.value = false;
+ url.value = '';
+ Taro.showToast({
+ title: '核销成功',
+ icon: 'none',
+ });
+ }
+ }
+ });
+};
+
+const closed = () => {
+ isShowCode.value = false;
+ url.value = '';
+ clearInterval(t_id.value);
+};
@@ -311,10 +348,32 @@ const getTj = async () => {
@click.stop="openPay(item)"
>立即付款
+ 出示核销码
+
+
+
+
+ 核销码
+
+
+
diff --git a/src/pages/users/order_list_detail/index.vue b/src/pages/users/order_list_detail/index.vue
index 4fb21bd..f9ccad5 100644
--- a/src/pages/users/order_list_detail/index.vue
+++ b/src/pages/users/order_list_detail/index.vue
@@ -248,9 +248,12 @@ const url = ref('');
const oid = ref('');
+const tId = ref();
+
Taro.useLoad(options => {
type.value = options.type;
oid.value = options.orderId;
+ tId.value = Number(options.OrderType);
Taro.getLocation({
type: 'wgs84',
success: res => {
@@ -265,8 +268,9 @@ Taro.useLoad(options => {
const getOrderDetail = async () => {
const res = await getActiveOrderDetail({
oid: oid.value,
+ OrderType: tId.value,
});
- goodInfo.value = res.data.data;
+ goodInfo.value = res.data.data[0];
if (goodInfo.value.status === 1) {
startTime();
}