Compare commits

...

3 Commits

Author SHA1 Message Date
xyc
f4e040e0a8 更新 2025-04-16 18:03:21 +08:00
xyc
7f13e6cbcb Merge remote-tracking branch 'origin/master'
# Conflicts:
#	pagesA/register/index.vue
2025-04-16 17:44:32 +08:00
xyc
ca98b5c60e 更新 2025-04-16 17:25:48 +08:00

View File

@ -8,7 +8,7 @@
</headers> </headers>
<!-- #endif --> <!-- #endif -->
<!-- #endif --> <!-- #endif -->
<u-loadmore :status="status" v-if="show == true"/> <u-loadmore :status="status" v-if="show == true" />
</view> </view>
<view class="bm-page"> <view class="bm-page">
<view class="bm-page-top"> <view class="bm-page-top">
@ -30,8 +30,14 @@
<view class="bm-page-info-title"> <view class="bm-page-info-title">
选择教练 选择教练
</view> </view>
<view class="d-s" @click="!jlId && (showjl = true)" <view class="d-s" v-if="localCoachId"
:style="{color: jlId ? '#999' : '', pointerEvents: jlId ? 'none' : ''}"> :style="{color: localCoachId ? '#999' : '', pointerEvents: localCoachId ? 'none' : ''}">
<view class="" v-if="!jlName">请选择</view>
<view class="" v-else>{{ jlName }}</view>
<u-icon name="arrow-right" size="16" :color="jlId ? '#999' : ''"></u-icon>
</view>
<view class="d-s" @click="showjl = true" v-else
:style="{color: localCoachId ? '#999' : '', pointerEvents: localCoachId ? 'none' : ''}">
<view class="" v-if="!jlName">请选择</view> <view class="" v-if="!jlName">请选择</view>
<view class="" v-else>{{ jlName }}</view> <view class="" v-else>{{ jlName }}</view>
<u-icon name="arrow-right" size="16" :color="jlId ? '#999' : ''"></u-icon> <u-icon name="arrow-right" size="16" :color="jlId ? '#999' : ''"></u-icon>
@ -151,13 +157,18 @@
</template> </template>
<script> <script>
import headers from '../../components/header/headers.vue' import headers from '../../components/header/headers.vue'
import request from '@/utils/request.js' import request from '@/utils/request.js'
import tabbar from '../../components/tabbar/tabbar.vue' import tabbar from '../../components/tabbar/tabbar.vue'
import upload from '@/utils/upload.js' import upload from '@/utils/upload.js'
import {getCoachId, getLocalUserInfo,getStaffType,getToken} from '../../utils/auth' import {
getCoachId,
getLocalUserInfo,
getStaffType,
getToken
} from '../../utils/auth'
export default { export default {
data() { data() {
return { return {
titles: "报名", titles: "报名",
@ -238,6 +249,7 @@ export default {
this.userinfo = getLocalUserInfo() this.userinfo = getLocalUserInfo()
this.localStaffType = getStaffType() this.localStaffType = getStaffType()
this.localCoachId = getCoachId() this.localCoachId = getCoachId()
console.log('localCoachId', this.localCoachId);
}, },
onShow() { onShow() {
this.getListAll() this.getListAll()
@ -277,9 +289,9 @@ export default {
methods: { methods: {
// or // or
updateDisplayPrice() { updateDisplayPrice() {
this.currentPrice = this.selectedPayType === 1 this.currentPrice = this.selectedPayType === 1 ?
? this.rightInfoList.reserveMoney this.rightInfoList.reserveMoney :
: this.rightInfoList.price; this.rightInfoList.price;
}, },
// //
@ -293,7 +305,7 @@ export default {
}, },
tenantIdFlag: false tenantIdFlag: false
}) })
console.log('data',res.data) console.log('data', res.data)
// 1. subject23 // 1. subject23
const filteredData = res.data.filter(coach => const filteredData = res.data.filter(coach =>
@ -319,7 +331,7 @@ export default {
]; ];
if (this.localStaffType === '02' && this.localCoachId) { if (this.localStaffType === '02' && this.localCoachId) {
console.log('123123',this.localStaffType) console.log('123123', this.localStaffType)
console.log('321321', this.localCoachId) console.log('321321', this.localCoachId)
console.log('coach', uniqueCoaches) // 使 console.log('coach', uniqueCoaches) // 使
const defaultCoach = uniqueCoaches.find(coach => const defaultCoach = uniqueCoaches.find(coach =>
@ -329,6 +341,8 @@ export default {
if (defaultCoach) { if (defaultCoach) {
this.jlName = defaultCoach.coachName; this.jlName = defaultCoach.coachName;
this.jlId = defaultCoach.coachId; this.jlId = defaultCoach.coachId;
} else {
this.localCoachId = null
} }
} }
}, },
@ -397,7 +411,7 @@ export default {
this.jlName = e.value[0].label; // this.jlName = e.value[0].label; //
this.jlId = e.value[0].value.coachId; // ID this.jlId = e.value[0].value.coachId; // ID
this.showjl = false; this.showjl = false;
console.log('jlId',this.jlId) console.log('jlId', this.jlId)
}, },
jlcancel() { jlcancel() {
this.showjl = false this.showjl = false
@ -452,19 +466,31 @@ export default {
// //
async validateForm() { async validateForm() {
if (!this.sfzimg) { if (!this.sfzimg) {
uni.showToast({title: '请上传身份证照片', icon: 'error'}); uni.showToast({
title: '请上传身份证照片',
icon: 'error'
});
return false; return false;
} }
if (!this.phone || !this.name || !this.identity) { if (!this.phone || !this.name || !this.identity) {
uni.showToast({title: '请输入完整信息', icon: 'error'}); uni.showToast({
title: '请输入完整信息',
icon: 'error'
});
return false; return false;
} }
if (!this.isValidPhoneNumber(this.phone)) { if (!this.isValidPhoneNumber(this.phone)) {
uni.showToast({title: '手机号不规范', icon: 'error'}); uni.showToast({
title: '手机号不规范',
icon: 'error'
});
return false; return false;
} }
if (!this.isValidIDNumber(this.identity)) { if (!this.isValidIDNumber(this.identity)) {
uni.showToast({title: '身份证不规范', icon: 'error'}); uni.showToast({
title: '身份证不规范',
icon: 'error'
});
return false; return false;
} }
return true; return true;
@ -478,7 +504,9 @@ export default {
try { try {
// 1. // 1.
if (!this.checkLogin()) { if (!this.checkLogin()) {
uni.navigateTo({url: '/pages/login/login'}); uni.navigateTo({
url: '/pages/login/login'
});
return; return;
} }
if (!await this.validateForm()) return; if (!await this.validateForm()) return;
@ -500,7 +528,10 @@ export default {
await this.createNewOrder(); await this.createNewOrder();
} catch (error) { } catch (error) {
if (!error.message.includes('cancel')) { if (!error.message.includes('cancel')) {
uni.showToast({title: error.message || '操作失败', icon: 'none'}); uni.showToast({
title: error.message || '操作失败',
icon: 'none'
});
} }
} finally { } finally {
this.loading = false; this.loading = false;
@ -647,17 +678,20 @@ export default {
}, */ }, */
async processExistingOrder() { async processExistingOrder() {
uni.showLoading({title: '准备支付...', mask: true}); uni.showLoading({
title: '准备支付...',
mask: true
});
try { try {
// 1. // 1.
const payType = this.selectedPayType; const payType = this.selectedPayType;
const reserveMoney = payType === 1 const reserveMoney = payType === 1 ?
? this.rightInfoList.reserveMoney this.rightInfoList.reserveMoney :
: this.rightInfoList.price; this.rightInfoList.price;
const restMoney = payType === 1 const restMoney = payType === 1 ?
? this.rightInfoList.price - reserveMoney this.rightInfoList.price - reserveMoney :
: 0; 0;
// 2. // 2.
const orderDetail = await this.getOrderDetail(this.orderId); const orderDetail = await this.getOrderDetail(this.orderId);
@ -789,7 +823,8 @@ export default {
resolve(res.errMsg === 'requestPayment:ok' ? 'success' : 'fail'); resolve(res.errMsg === 'requestPayment:ok' ? 'success' : 'fail');
}, },
fail: (err) => { fail: (err) => {
resolve(err.errMsg === 'requestPayment:fail cancel' ? 'cancelled' : 'fail'); resolve(err.errMsg === 'requestPayment:fail cancel' ? 'cancelled' :
'fail');
} }
}); });
}); });
@ -797,13 +832,16 @@ export default {
// //
async createNewOrder() { async createNewOrder() {
uni.showLoading({title: '创建订单中...', mask: true}); uni.showLoading({
title: '创建订单中...',
mask: true
});
try { try {
if (this.startPay === 1) { if (this.startPay === 1) {
const payType = this.selectedPayType; const payType = this.selectedPayType;
const reserveMoney = payType === 1 const reserveMoney = payType === 1 ?
? this.rightInfoList.reserveMoney this.rightInfoList.reserveMoney :
: this.rightInfoList.price; this.rightInfoList.price;
this.payPrice = reserveMoney this.payPrice = reserveMoney
await this.wxPayClick( await this.wxPayClick(
this.name, this.name,
@ -823,7 +861,7 @@ export default {
}, },
// //
async generateOrderNo(){ async generateOrderNo() {
const res = await request({ const res = await request({
url: '/small/jxInfo/generateOrderNo', url: '/small/jxInfo/generateOrderNo',
method: 'GET', method: 'GET',
@ -926,10 +964,10 @@ export default {
if (this.localCoachId && this.localStaffType == '01') { if (this.localCoachId && this.localStaffType == '01') {
studentData.source = '01'; studentData.source = '01';
studentData.sourceUserId = getCoachId(); // IDID studentData.sourceUserId = getCoachId(); // IDID
}else if (this.localCoachId && this.localStaffType == '02') { } else if (this.localCoachId && this.localStaffType == '02') {
studentData.source = '02'; studentData.source = '02';
studentData.sourceUserId = getCoachId(); // IDID studentData.sourceUserId = getCoachId(); // IDID
}else{ } else {
studentData.source = '03'; // studentData.source = '03'; //
} }
@ -962,7 +1000,7 @@ export default {
}, */ }, */
// users // users
updateSysUsersNickName(){ updateSysUsersNickName() {
request({ request({
url: '/app-api/system/user/update', url: '/app-api/system/user/update',
method: 'PUT', method: 'PUT',
@ -977,7 +1015,10 @@ export default {
checkLogin() { checkLogin() {
const token = uni.getStorageSync('App-Token'); const token = uni.getStorageSync('App-Token');
if (!token) { if (!token) {
uni.showToast({title: '请先登录', icon: 'none'}); uni.showToast({
title: '请先登录',
icon: 'none'
});
return false; return false;
} }
return true; return true;
@ -1062,11 +1103,11 @@ export default {
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.bm-page { .bm-page {
padding: 30rpx; padding: 30rpx;
.bm-page-button { .bm-page-button {
@ -1214,30 +1255,30 @@ export default {
border-radius: 12rpx; border-radius: 12rpx;
} }
} }
} }
.content { .content {
background: #f4f5f6; background: #f4f5f6;
// background: linear-gradient(180deg, #9ffcc5 0%, #84fcbc 14%, rgba(255, 255, 255, 0.84) 24%, rgba(255, 255, 255, 0.84) 100%); // background: linear-gradient(180deg, #9ffcc5 0%, #84fcbc 14%, rgba(255, 255, 255, 0.84) 24%, rgba(255, 255, 255, 0.84) 100%);
height: 100vh; height: 100vh;
} }
.container { .container {
width: 100%; width: 100%;
background: #f4f5f6; background: #f4f5f6;
box-sizing: border-box; box-sizing: border-box;
padding-top: 88px; padding-top: 88px;
} }
.onel { .onel {
width: 18px; width: 18px;
height: 18px; height: 18px;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
border: 1px solid #8c8c8d; border: 1px solid #8c8c8d;
} }
.twol { .twol {
width: 18px; width: 18px;
height: 18px; height: 18px;
border-radius: 50%; border-radius: 50%;
@ -1248,14 +1289,14 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: #fff; color: #fff;
} }
.d-s { .d-s {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.anniu { .anniu {
width: 120px; width: 120px;
height: 35px; height: 35px;
border-radius: 4px; border-radius: 4px;
@ -1265,22 +1306,22 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 14px; font-size: 14px;
} }
.popup-box { .popup-box {
width: 300px; width: 300px;
border-radius: 10px; border-radius: 10px;
background: #fff; background: #fff;
box-sizing: border-box; box-sizing: border-box;
padding: 10px; padding: 10px;
} }
.title_s { .title_s {
font-weight: bold; font-weight: bold;
margin-bottom: 10px; margin-bottom: 10px;
} }
.clv { .clv {
color: #fff; color: #fff;
background: #2C78F5; background: #2C78F5;
width: 26px; width: 26px;
@ -1291,9 +1332,9 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-weight: bold; font-weight: bold;
} }
.size-lv { .size-lv {
margin-right: 35px; margin-right: 35px;
} }
</style> </style>