Commit 5e89b49d authored by 周俊涛(东信)'s avatar 周俊涛(东信)
parents 56848faa 9a9fd0d0
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<div class="date-wrap"> <div class="date-wrap">
<div class="date-title">选择日期</div> <div class="date-title">选择日期</div>
<div class="date-list flex-between"> <div class="date-list flex-between">
<div class="list"> <div class="list" style="margin-top: 20rpx">
<div <div
class="item" class="item"
:class="{ active: activePrice === v }" :class="{ active: activePrice === v }"
...@@ -328,7 +328,8 @@ import { ...@@ -328,7 +328,8 @@ import {
getItinerary, getItinerary,
getStoreInformation, getStoreInformation,
} from '@/api/assistingAgriculture/route'; } from '@/api/assistingAgriculture/route';
import { groupBuyConfirm, groupBuyUpdate } from '@/api/confirmOrder'; import { sgyOrderOrderInfo } from '@/api/assistingAgriculture/shop';
import { groupBuyConfirm, groupBuyUpdate, groupBuyCreate } from '@/api/confirmOrder';
import { getCollect } from '@/api/packageDetail'; import { getCollect } from '@/api/packageDetail';
/* 监听滑动改变顶部颜色 */ /* 监听滑动改变顶部颜色 */
const backgroundBox = ref(''); const backgroundBox = ref('');
...@@ -373,6 +374,41 @@ watch(show, (value) => { ...@@ -373,6 +374,41 @@ watch(show, (value) => {
index = Math.min(priceList.value.length - 3, index); index = Math.min(priceList.value.length - 3, index);
viewPriceList.value = priceList.value.slice(index - 1, index + 3); viewPriceList.value = priceList.value.slice(index - 1, index + 3);
}); });
onShow(() => {
if (outTradeNos.value) {
// 查询订单状态决定是否支付
sgyOrderOrderInfo({ orderNumber: outTradeNos.value }).then((res) => {
switch (res.data.baseOrder.subStatus) {
case '1':
xma.showToast({
title: '支付失败',
icon: 'error',
duration: 1000,
success() {
setTimeout(() => {
xma.redirectTo({
url: `/pages/order/order?status=not_pay`,
});
}, 1500);
},
});
break;
case '2':
xma.redirectTo({
url: `/pages/order/detail?orderNumber=${outTradeNos.value}`,
});
break;
case '3':
xma.redirectTo({
url: `/pages/order/detail?orderNumber=${outTradeNos.value}`,
});
break;
default:
break;
}
});
}
});
const getWeek = (date) => { const getWeek = (date) => {
const week = ['日', '一', '二', '三', '四', '五', '六']; const week = ['日', '一', '二', '三', '四', '五', '六'];
return week[new Date(date).getDay()]; return week[new Date(date).getDay()];
...@@ -393,7 +429,7 @@ function jumpPage() { ...@@ -393,7 +429,7 @@ function jumpPage() {
} }
function groupBuyConfirmFn(prodId, skuId) { function groupBuyConfirmFn(prodId, skuId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
groupBuyConfirm({ prodId, skuId }).then((res) => { groupBuyConfirm({ prodId, skuId, orderType: 'store' }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
orderInfo.value = res.data; orderInfo.value = res.data;
resolve(res.data.shopId); resolve(res.data.shopId);
...@@ -428,33 +464,51 @@ function formatDate(inputDate) { ...@@ -428,33 +464,51 @@ function formatDate(inputDate) {
} }
const payNow = async (data) => { const payNow = async (data) => {
groupBuyConfirmFn(activeMeal.value.prodId, activeMeal.value.skuId).then((res) => { groupBuyConfirmFn(activeMeal.value.prodId, activeMeal.value.skuId).then((res) => {
groupBuyUpdateFnQg().then(() => {}); groupBuyUpdateFnQg().then(() => {
const qgParams = {
id: orderInfo.value.key,
placeOrderWay: 'sgy',
payWayCode: 5,
tradeType: data.selectType,
};
groupBuyCreate(qgParams).then((res) => {
if (res.code === 0) {
openUrl(res.data.result);
} else {
groupBuyConfirmFn(activeMeal.value.prodId, activeMeal.value.skuId);
}
});
});
}); });
params.value.id = orderInfo.value.key;
params.value.tradeType = data.selectType;
params.value.basketIds = basketIds.value;
const qgParams = {
id: orderInfo.value.key,
placeOrderWay: 'sgy',
payWayCode: 5,
tradeType: data.selectType,
};
// groupBuyCreate(qgParams).then((res) => {
// if (res.code === 0) {
// openUrl(res.data.result);
// } else {
// groupBuyConfirmFn(prodIds.value, skuIds.value);
// }
// });
}; };
function groupBuyUpdateFnQg(couponUserId = '') { const outTradeNos = ref(null);
const openUrl = (result) => {
const { paymentUrl, outTradeNo } = result;
outTradeNos.value = outTradeNo;
window.location.href = paymentUrl;
// 设置一个延时器
const start = Date.now();
setTimeout(() => {
const end = Date.now();
if (end - start < 1200) {
// 如果 iframe 加载时间小于 1.2 秒,说明应用没有安装
xma.showToast({
title: '未安装App',
icon: 'error',
});
// 这里可以跳转到应用下载页面
}
}, 1600);
};
function groupBuyUpdateFnQg() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
groupBuyUpdate({ groupBuyUpdate({
key: orderInfo.value.key, key: orderInfo.value.key,
receiverTime: formatDate(activePrice.value.priceDay), receiverTime: activePrice.value.priceDay.replace(' ', '-'),
}).then((res) => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
orderInfo.value = res.data; orderInfo.value = res.data;
resolve();
} }
}); });
}); });
......
...@@ -697,7 +697,7 @@ page { ...@@ -697,7 +697,7 @@ page {
} }
.tag { .tag {
margin-top: 10rpx; margin-top: 10rpx;
width: 400rpx; width: 600rpx;
} }
.detail-score { .detail-score {
margin-top: 30rpx; margin-top: 30rpx;
...@@ -746,18 +746,12 @@ uni-video { ...@@ -746,18 +746,12 @@ uni-video {
left: 20rpx; left: 20rpx;
border-radius: 16rpx; border-radius: 16rpx;
} }
::v-deep .uni-video-controls {
margin: 0;
}
.no-more-data { .no-more-data {
text-align: center; text-align: center;
padding: 20rpx; padding: 20rpx;
color: #999; color: #999;
} }
/* 默认隐藏进度条 */
.spe-img1::-webkit-media-controls-progress-panel {
display: none;
}
/* 当全屏时显示进度条 */
.spe-img1.no-progress-bar::-webkit-media-controls-progress-panel {
display: block;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment