This commit is contained in:
Lx 2025-04-17 11:17:38 +08:00
parent 457b953046
commit bca7aef387
3 changed files with 647 additions and 604 deletions

View File

@ -22,8 +22,8 @@
<view class="course-detail">
<text class="course-title">{{ orderData.courseName }}</text>
<view class='course-twoType'>
<text class="course-type" >{{ getLicenseTypeDescription(orderData.courseType) }}</text>
<text class="course-type" >{{ orderData.courseType }}</text>
<text class="course-type">{{ getLicenseTypeDescription(orderData.courseType) }}</text>
<text class="course-type">{{ orderData.courseType }}</text>
</view>
<text class="course-desc">{{ courseDetails.tittle }}</text>
</view>
@ -139,9 +139,9 @@
</template>
<script>
import headers from "@/components/header/headers.vue";
import request from '@/utils/request.js'
export default {
import headers from "@/components/header/headers.vue";
import request from '@/utils/request.js'
export default {
components: {
headers
},
@ -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');
}
});
});
@ -345,7 +364,7 @@ export default {
},
// users
updateSysUsersNickName(){
updateSysUsersNickName() {
request({
url: '/app-api/system/user/update',
method: 'PUT',
@ -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 = {
@ -439,211 +474,219 @@ export default {
});
},
}
}
}
}
</script>
<style scoped>
.order-detail-container {
.order-detail-container {
padding-bottom: 200rpx;
background-color: #f7f7f7;
min-height: 100vh;
}
}
/* 头部样式 */
.header {
/* 头部样式 */
.header {
position: relative;
}
}
.navbar {
.navbar {
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #ffffff;
position: relative;
}
}
.navbar-title {
.navbar-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
}
.status-card {
.status-card {
height: 40rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
}
}
.status-0 {
.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);
}
}
.status-text {
.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);
}
.status-text {
font-size: 28rpx;
margin-top: 2rpx;
}
}
/* 卡片通用样式 */
.info-card, .course-card, .price-card {
/* 卡片通用样式 */
.info-card,
.course-card,
.price-card {
margin: 30rpx;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.05);
}
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
}
/* 信息项样式 */
.info-item {
/* 信息项样式 */
.info-item {
padding: 24rpx 30rpx;
display: flex;
justify-content: space-between;
border-bottom: 2rpx solid #f5f5f5;
}
}
.info-title {
.info-title {
color: #666;
font-size: 28rpx;
}
}
.info-value {
.info-value {
color: #333;
font-size: 28rpx;
font-weight: 500;
}
}
/* 课程卡片样式 */
.course-header {
/* 课程卡片样式 */
.course-header {
padding: 30rpx 30rpx 0;
display: flex;
justify-content: space-between;
margin-bottom: 24rpx;
}
}
.course-twoType {
.course-twoType {
width: 90%;
display: flex;
justify-content: flex-start;
}
}
.course-type {
.course-type {
font-size: 22rpx;
padding: 4rpx 16rpx;
border-radius: 8rpx;
color: #fff;
background-color: #2979ff;
margin-right: 10rpx;
}
}
.type-C1 {
.type-C1 {
background-color: #19be6b;
}
.type-C2 {
background-color: #2979ff;
}
}
.order-time {
.type-C2 {
background-color: #2979ff;
}
.order-time {
font-size: 24rpx;
color: #909399;
}
}
.course-info {
.course-info {
padding: 0 30rpx 30rpx;
display: flex;
}
}
.course-image {
.course-image {
width: 240rpx;
height: 180rpx;
border-radius: 8rpx;
}
}
.course-detail {
.course-detail {
flex: 1;
margin-left: 24rpx;
display: flex;
flex-direction: column;
}
}
.course-title {
.course-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 12rpx;
color: #333;
}
}
.course-desc {
.course-desc {
font-size: 24rpx;
color: #909399;
line-height: 1.5;
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;
}
}
/* 价格卡片样式 */
.price-card {
/* 价格卡片样式 */
.price-card {
padding: 30rpx;
}
}
.price-row {
.price-row {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
font-size: 28rpx;
}
}
.price-row.total {
.price-row.total {
margin-top: 20rpx;
padding-top: 20rpx;
border-top: 2rpx dashed #eee;
font-weight: bold;
font-size: 32rpx;
}
}
.price-label {
.price-label {
color: #666;
}
}
.price-value {
.price-value {
color: #ff6600;
}
}
/* 底部按钮样式 */
.footer {
/* 底部按钮样式 */
.footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx 30rpx;
background: #fff;
box-shadow: 0 -4rpx 16rpx rgba(0,0,0,0.05);
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.05);
display: flex;
justify-content: space-around;
}
}
/* .pay-button {
/* .pay-button {
height: 80rpx;
background-color: #ff9900;
border-radius: 40rpx;
@ -660,28 +703,29 @@ export default {
align-items: center;
justify-content: center;
} */
.pay-button,
.cancel-button {
.pay-button,
.cancel-button {
flex: 1;
height: 80rpx;
margin: 0 10rpx; /* 两个按钮之间留点间距 */
margin: 0 10rpx;
/* 两个按钮之间留点间距 */
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
.pay-button {
.pay-button {
background-color: #ff9900;
}
}
.cancel-button {
.cancel-button {
background-color: #ff0105;
}
}
.pay-button-text {
.pay-button-text {
color: #fff;
font-size: 32rpx;
font-weight: bold;
}
}
</style>

View File

@ -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,

View File

@ -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">