This commit is contained in:
Lx 2025-04-09 14:36:38 +08:00
parent 1747d849cf
commit 4f9c0d0075
3 changed files with 60 additions and 37 deletions

View File

@ -131,7 +131,8 @@ import tabbar from '../../components/tabbar/tabbar.vue'
import request from '@/utils/request.js' import request from '@/utils/request.js'
import { import {
getLocalUserInfo, getLocalUserInfo,
getToken getToken,
setLocalUserInfo
} from '@/utils/auth' } from '@/utils/auth'
export default { export default {
@ -140,6 +141,7 @@ export default {
return { return {
msg: "3", msg: "3",
selfInfo: {}, selfInfo: {},
selfInfoLocal: {},
coachDetails: {}, coachDetails: {},
userDetails: {}, userDetails: {},
orderList: {}, orderList: {},
@ -175,8 +177,8 @@ export default {
}; };
}, },
onLoad() { onLoad() {
this.selfInfo = getLocalUserInfo() this.selfInfoLocal = getLocalUserInfo()
console.log("用户信息", this.selfInfo) console.log("用户信息", this.selfInfoLocal)
this.getUserInfo() this.getUserInfo()
}, },
onShow() { onShow() {
@ -188,6 +190,7 @@ export default {
onPullDownRefresh() { onPullDownRefresh() {
console.log("刷新"); console.log("刷新");
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
this.getUserInfo()
}, },
onReachBottom() { onReachBottom() {
// this.show = true // this.show = true
@ -228,35 +231,36 @@ export default {
}) })
}, },
getUserInfo() {
request({
url: '/app-api/small/dl-drive-school-student/getByUserId', getUserInfo() {
method: 'GET', request({
params: { url: '/app-api/small/dl-drive-school-student/getUsersInfo',
userId: this.selfInfo.id, method: 'GET',
}, }).then(res => {
}).then(res => { this.selfInfo = res.data
this.userDetails = res.data if(this.userInfo != null){
this.getOrder() setLocalUserInfo(this.selfInfo)
console.log('userDetails', this.userDetails) }
/* if (this.userDetails.sourceUserId !== null) {
this.getCoachDetails(this.userDetails.sourceUserId) this.getOrder()
} */ console.log('userDetails', this.selfInfo)
}) })
}, },
getCoachDetails(coachId) { getCoachDetails(coachId) {
request({ request({
url: '/app-api/dl-drive-school-coach-small/get', url: '/app-api/dl-drive-school-coach-small/getCoachByUserId',
method: 'GET', method: 'GET',
params: { params: {
id: coachId userId: coachId
} }
}).then(res => { }).then(res => {
this.coachDetails = res.data this.coachDetails = res.data
console.log('coachDetails', this.coachDetails); console.log('coachDetails', this.coachDetails);
}) })
}, },
getOrder() { getOrder() {
request({ request({
url: '/app-api/small/drive/school-course-order/getCourseByLoginUser', url: '/app-api/small/drive/school-course-order/getCourseByLoginUser',
@ -270,6 +274,7 @@ export default {
} }
}) })
}, },
getProcess(courseId) { getProcess(courseId) {
request({ request({
url: '/app-api/process/getAllByCourseId', url: '/app-api/process/getAllByCourseId',

View File

@ -214,7 +214,7 @@ export default {
switch (item.text) { switch (item.text) {
case '学车报名': case '学车报名':
uni.navigateTo({ uni.navigateTo({
// url: '/pages/enroll/index' url: '/newPages/schoolList/index'
}); });
break; break;
case '预约训练': case '预约训练':

View File

@ -229,8 +229,8 @@ export default {
} }
this.jlId = uni.getStorageSync('jlId'); this.jlId = uni.getStorageSync('jlId');
this.courseId = option.courseId, this.courseId = option.courseId,
this.userId = option.userId, this.userId = option.userId,
this.tenantId = option.tenantId this.tenantId = option.tenantId
this.userinfo = getLocalUserInfo() this.userinfo = getLocalUserInfo()
console.log("驾校id", this.jxId, "课程id", this.courseId) console.log("驾校id", this.jxId, "课程id", this.courseId)
console.log("userId", this.userId, "tenantId", this.tenantId) console.log("userId", this.userId, "tenantId", this.tenantId)
@ -274,16 +274,19 @@ export default {
}, },
methods: { methods: {
// 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;
}, },
//
async getListAll() { async getListAll() {
this.columnjl = [] this.columnjl = []
let res = await request({ let res = await request({
url: '/app-api/dl-drive-school-coach-small/page', url: '/app-api/dl-drive-school-coach-small/list',
method: 'get', method: 'GET',
params: { params: {
tenantId: this.tenantId, tenantId: this.tenantId,
}, },
@ -291,7 +294,7 @@ export default {
}) })
console.log(res); console.log(res);
this.columnjl = [ this.columnjl = [
res.data.records.map(coach => ({ res.data.map(coach => ({
label: coach.name, label: coach.name,
value: coach value: coach
})) }))
@ -307,10 +310,11 @@ export default {
this.popupShow = false this.popupShow = false
// console.log('close'); // console.log('close');
}, },
//
jlconfirm(e) { jlconfirm(e) {
console.log("选中教练:", e.value[0]); console.log("选中教练:", e.value[0]);
this.jlName = e.value[0].label; // this.jlName = e.value[0].label; //
this.jlId = e.value[0].value.id; // ID this.jlId = e.value[0].value.userId; // ID
this.showjl = false; this.showjl = false;
}, },
jlcancel() { jlcancel() {
@ -333,11 +337,11 @@ export default {
this.startPay = id this.startPay = id
}, },
goBookingJl() { /* goBookingJl() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/bookingJl', url: '/pages/index/bookingJl',
}) })
}, }, */
// //
isValidPhoneNumber(phoneNumber) { isValidPhoneNumber(phoneNumber) {
@ -485,7 +489,16 @@ export default {
}); });
if (res.code === 0) { if (res.code === 0) {
const contractData = { /* ...合同数据... */}; const contractData = {
adress: this.Address,
name: this.name,
tenantId: this.tenantId,
type: this.rightInfoList.price,
money: this.getRightInfoList,
indent: this.identity,
phone: this.phone,
time: this.getCurrentDateTime()
};
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData)) url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
}); });
@ -551,14 +564,13 @@ 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
await this.wxPayClick( await this.wxPayClick(
this.name, this.name,
this.phone, this.phone,
@ -585,7 +597,6 @@ export default {
if (event.name == '2') { if (event.name == '2') {
this.videoUr = null this.videoUr = null
} }
}, },
// //
async afterRead(event) { async afterRead(event) {
@ -660,6 +671,7 @@ export default {
}); });
}, },
//
insertSchoolStudent() { insertSchoolStudent() {
request({ request({
url: '/app-api/small/dl-drive-school-student/create', url: '/app-api/small/dl-drive-school-student/create',
@ -675,23 +687,24 @@ export default {
userId: this.userinfo.id, userId: this.userinfo.id,
tenantId: this.tenantId, tenantId: this.tenantId,
idPhoto: this.sfzimg, idPhoto: this.sfzimg,
} }
}) })
this.updateSysUsersNickName() this.updateSysUsersNickName()
}, },
// users
updateSysUsersNickName(){ updateSysUsersNickName(){
request({ request({
url: '/app-api/system/user/update', url: '/app-api/system/user/update',
method: 'PUT', method: 'PUT',
params: { data: {
nickName: this.name, nickname: this.name,
id: this.userInfo.id id: this.userInfo.id
} }
}) })
}, },
//
checkLogin() { checkLogin() {
const token = uni.getStorageSync('App-Token'); const token = uni.getStorageSync('App-Token');
console.log(token) console.log(token)
@ -701,6 +714,8 @@ export default {
} }
return true; return true;
}, },
//
getCurrentDateTime() { getCurrentDateTime() {
const now = new Date(); const now = new Date();
@ -714,6 +729,8 @@ export default {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
// return now; // return now;
}, },
//
signContract() { signContract() {
const contractData = { const contractData = {
adress: this.Address, adress: this.Address,
@ -729,6 +746,7 @@ export default {
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData)) url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
}) })
}, },
// //
async getPayStatus(orderId) { async getPayStatus(orderId) {
const res = await request({ const res = await request({