0417-3
This commit is contained in:
parent
457b953046
commit
bca7aef387
@ -239,18 +239,33 @@ export default {
|
||||
}, 1500)
|
||||
}, */
|
||||
async handlePay() {
|
||||
uni.showLoading({ title: '跳转支付中...' });
|
||||
uni.showLoading({
|
||||
title: '跳转支付中...'
|
||||
});
|
||||
try {
|
||||
const res = await this.directWxPay(this.orderData.id, this.orderData.orderNo, this.orderData.payType);
|
||||
const res = await this.directWxPay(this.orderData.id, this.orderData.orderNo, this.orderData
|
||||
.payType);
|
||||
if (res === 'success') {
|
||||
uni.showToast({ title: '支付成功', icon: 'success' });
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
});
|
||||
} else if (res === 'cancelled') {
|
||||
uni.showToast({ title: '已取消支付', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '已取消支付',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({ title: '支付失败,请重试', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '支付失败,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({ title: '支付异常', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '支付异常',
|
||||
icon: 'none'
|
||||
});
|
||||
console.error('支付异常', error);
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
@ -307,7 +322,10 @@ export default {
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error("支付失败:", error);
|
||||
uni.showToast({ title: '支付失败,请重试', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '支付失败,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
return 'fail';
|
||||
}
|
||||
},
|
||||
@ -320,7 +338,8 @@ export default {
|
||||
resolve(res.errMsg === 'requestPayment:ok' ? 'success' : 'fail');
|
||||
},
|
||||
fail: (err) => {
|
||||
resolve(err.errMsg === 'requestPayment:fail cancel' ? 'cancelled' : 'fail');
|
||||
resolve(err.errMsg === 'requestPayment:fail cancel' ? 'cancelled' :
|
||||
'fail');
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -379,7 +398,8 @@ export default {
|
||||
money: this.orderData.reserveMoney,
|
||||
indent: this.orderData.userNo,
|
||||
phone: this.orderData.userPhone,
|
||||
time: this.getCurrentDateTime()
|
||||
time: this.getCurrentDateTime(),
|
||||
endTime: this.getEndTime(),
|
||||
};
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
|
||||
@ -400,6 +420,21 @@ export default {
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
// return now;
|
||||
},
|
||||
// 获取三年后的时间
|
||||
getEndTime() {
|
||||
const now = new Date();
|
||||
now.setFullYear(now.getFullYear() + 3); // 加三年
|
||||
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const hours = String(now.getHours()).padStart(2, '0');
|
||||
const minutes = String(now.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(now.getSeconds()).padStart(2, '0');
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
},
|
||||
|
||||
|
||||
getLicenseTypeDescription(code) {
|
||||
const licenseMap = {
|
||||
@ -483,15 +518,19 @@ export default {
|
||||
.status-0 {
|
||||
background: linear-gradient(to right, #ff976a, #ff6600);
|
||||
}
|
||||
|
||||
.status-1 {
|
||||
background: linear-gradient(to right, #ffcc00, #ff9900);
|
||||
}
|
||||
|
||||
.status-2 {
|
||||
background: linear-gradient(to right, #19be6b, #00b050);
|
||||
}
|
||||
|
||||
.status-3 {
|
||||
background: linear-gradient(to right, #dd6161, #cc0000);
|
||||
}
|
||||
|
||||
.status-4 {
|
||||
background: linear-gradient(to right, #909399, #808080);
|
||||
}
|
||||
@ -502,7 +541,9 @@ export default {
|
||||
}
|
||||
|
||||
/* 卡片通用样式 */
|
||||
.info-card, .course-card, .price-card {
|
||||
.info-card,
|
||||
.course-card,
|
||||
.price-card {
|
||||
margin: 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
@ -555,6 +596,7 @@ export default {
|
||||
.type-C1 {
|
||||
background-color: #19be6b;
|
||||
}
|
||||
|
||||
.type-C2 {
|
||||
background-color: #2979ff;
|
||||
}
|
||||
@ -596,7 +638,8 @@ export default {
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3; /* 限制显示3行 */
|
||||
-webkit-line-clamp: 3;
|
||||
/* 限制显示3行 */
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@ -664,7 +707,8 @@ export default {
|
||||
.cancel-button {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
margin: 0 10rpx; /* 两个按钮之间留点间距 */
|
||||
margin: 0 10rpx;
|
||||
/* 两个按钮之间留点间距 */
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@ -54,6 +54,8 @@
|
||||
if (options.data) {
|
||||
this.contractData = JSON.parse(decodeURIComponent(options.data));
|
||||
this.callback = options.callback;
|
||||
this.tenantId = this.contractData.tenantId
|
||||
console.log('options', this.contractData)
|
||||
}
|
||||
this.callback = options.callback;
|
||||
this.userData = uni.getStorageSync('userInfo');
|
||||
@ -122,11 +124,11 @@
|
||||
async signatureChange(e) {
|
||||
this.imgUrl = e
|
||||
let res = await request({
|
||||
url: '/app-api/small/driveSchool/obtainContract',
|
||||
url: '/app-api/small/driveSchool/obtainContract/add',
|
||||
method: 'post',
|
||||
data: {
|
||||
userName: this.contractData.name,
|
||||
tenantId: this.tenantId,
|
||||
tenantId: this.contractData.tenantId,
|
||||
userId: this.userData.id,
|
||||
content: this.content,
|
||||
userUrl: this.userUrl,
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
<scroll-view :style="{ height: scrollHeight + 'px' }" scroll-y="true" class="scroll-view">
|
||||
<view class="group_3 flex-col">
|
||||
<image style="width: 100%; height: 100%;" :src="imagesUrl + '/' + courseDetails.photo" />
|
||||
v-if="courseDetails.photo" />
|
||||
<u-empty mode="data" text='暂无图片' v-else>
|
||||
</u-empty>
|
||||
</view>
|
||||
<view class="group_4 flex-col">
|
||||
<view class="section_2 flex-row justify-between">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user