0414-2
This commit is contained in:
parent
294ab2ace0
commit
83694623ce
@ -164,8 +164,9 @@
|
||||
background-color: rgba(255, 239, 229, 1);
|
||||
border-radius: 2px;
|
||||
//height: 36rpx;
|
||||
width: 52rpx;
|
||||
// width: 52rpx;
|
||||
//margin: 48rpx 86rpx 0 -138rpx;
|
||||
padding: 0 5rpx;
|
||||
.text_6 {
|
||||
width: 32rpx;
|
||||
height: 24rpx;
|
||||
|
@ -1,12 +1,14 @@
|
||||
.page {
|
||||
background-color: rgba(242, 244, 248, 1);
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
height: 1624rpx;
|
||||
width: 100%;
|
||||
max-width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
.block_1 {
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
width: 750rpx;
|
||||
width: 100%;
|
||||
max-width: 100vw;
|
||||
height: 92rpx;
|
||||
.image_1 {
|
||||
width: 64rpx;
|
||||
@ -32,11 +34,20 @@
|
||||
}
|
||||
}
|
||||
.block_2 {
|
||||
width: 750rpx;
|
||||
height: 1414rpx;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
.scroll-view {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
height: 100% !important;
|
||||
}
|
||||
.box_3 {
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
width: 750rpx;
|
||||
width: 100%;
|
||||
max-width: 100vw;
|
||||
height: 96rpx;
|
||||
justify-content: flex-center;
|
||||
.label_1 {
|
||||
@ -412,7 +423,9 @@
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
height: 120rpx;
|
||||
margin-top: -2rpx;
|
||||
width: 750rpx;
|
||||
width: 100%;
|
||||
max-width: 100vw;
|
||||
flex-shrink: 0;
|
||||
.text-wrapper_8 {
|
||||
background-color: rgba(4, 78, 242, 1);
|
||||
border-radius: 20px;
|
||||
|
@ -6,7 +6,6 @@
|
||||
</headers>
|
||||
</view>
|
||||
<view class="block_2 flex-col">
|
||||
<view>
|
||||
<scroll-view
|
||||
class="scroll-view"
|
||||
scroll-y
|
||||
@ -56,7 +55,6 @@
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block_8 flex-col">
|
||||
<view class="text-wrapper_8 flex-col" @click="onEnterScoreClick()">
|
||||
|
||||
@ -310,7 +308,7 @@ export default {
|
||||
// 获取屏幕高度
|
||||
const screenHeight = uni.getSystemInfoSync().windowHeight;
|
||||
// 获取顶部区域高度
|
||||
const topHeight = 160;
|
||||
const topHeight = 88;
|
||||
// 计算滚动区域高度
|
||||
this.scrollHeight = screenHeight - topHeight;
|
||||
},
|
||||
|
@ -153,7 +153,8 @@
|
||||
method: "GET",
|
||||
params:{
|
||||
pageNo:this.pageNo,
|
||||
pageSize:this.pageSize
|
||||
pageSize:this.pageSize,
|
||||
systemCode: this.systemCode,
|
||||
},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
|
@ -59,9 +59,18 @@
|
||||
import SchoolInfo from './SchoolInfo.vue';
|
||||
import request from "@/utils/request";
|
||||
import {
|
||||
getCoachId,
|
||||
getInviteId,
|
||||
getLocalUserInfo,
|
||||
getToken,
|
||||
setLocalUserInfo
|
||||
removeCoachId,
|
||||
removeInviteId,
|
||||
removeTenantId,
|
||||
setCoachId,
|
||||
setInviteId,
|
||||
setLocalUserInfo,
|
||||
setStaffType,
|
||||
setTenantId
|
||||
} from '@/utils/auth'
|
||||
export default {
|
||||
components: {
|
||||
@ -97,24 +106,84 @@ export default {
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
imageUrl: this.$imagesUrl,
|
||||
textList:[]
|
||||
textList:[],
|
||||
qTenantId: null,
|
||||
qCoachId: null,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
onLoad(query) {
|
||||
// setInviteId('JLPXF1')
|
||||
// this.getTenantIdByInviteId()
|
||||
this.getSwiperList()
|
||||
this.getTextList()
|
||||
|
||||
const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容
|
||||
let theRequest = this.getUrlValue(q)
|
||||
if(theRequest.hasOwnProperty("inviteId")){
|
||||
//扫码邀请过来的,设置邀请者code
|
||||
setInviteId(theRequest['inviteId'])
|
||||
this.getTenantIdByInviteId()
|
||||
//先登录
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else{
|
||||
removeInviteId()
|
||||
removeCoachId()
|
||||
removeTenantId()
|
||||
/* uni.reLaunch({
|
||||
url: '/pages-home/home/home'
|
||||
}) */
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTenantIdByInviteId(){
|
||||
console.log('1122', getInviteId())
|
||||
if(!getInviteId()){
|
||||
console.log(1)
|
||||
this.getList()
|
||||
return
|
||||
}
|
||||
request({
|
||||
url: '/app-api/dl-drive-school-coach-small/getCoachByUniqueCode',
|
||||
method: 'GET',
|
||||
params: {
|
||||
uniqueCode: getInviteId()
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(123)
|
||||
if(res.data != null){
|
||||
this.qTenantId = res.data.tenantId
|
||||
this.qCoachId = res.data.userId
|
||||
setTenantId(res.data.tenantId)
|
||||
this.getList()
|
||||
if(res.data.type == 'jl'){
|
||||
setCoachId(res.data.userId)
|
||||
setStaffType('02')
|
||||
}
|
||||
if(res.data.type == 'yg'){
|
||||
setCoachId(res.data.userId)
|
||||
setStaffType('01')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getList() {
|
||||
const params = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
serviceCodes: 'jiaxiao',
|
||||
};
|
||||
|
||||
if (this.qTenantId) {
|
||||
params.tenantId = this.qTenantId;
|
||||
}
|
||||
console.log('params', params)
|
||||
request({
|
||||
url: '/userClient/base/companySmallProgram/pageNoTenantId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
serviceCodes: 'jiaxiao'
|
||||
},
|
||||
params: params,
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
res.data.records.forEach(item => {
|
||||
@ -123,8 +192,22 @@ export default {
|
||||
})
|
||||
this.schoolList = this.schoolList.concat(res.data.records)
|
||||
this.isTriggered = false
|
||||
this.total = res.data.total
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
getUrlValue(url) {
|
||||
var theRequest = new Object();
|
||||
if (url.indexOf("?") != -1) {
|
||||
//有参数
|
||||
var str = url.split("?")[1];
|
||||
var strs = str.split("&");
|
||||
for (var i = 0; i < strs.length; i++) {
|
||||
theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
|
||||
}
|
||||
}
|
||||
return theRequest
|
||||
},
|
||||
/**
|
||||
* 实时讯息
|
||||
*/
|
||||
@ -139,6 +222,7 @@ export default {
|
||||
})
|
||||
// this.textList = res.data.records
|
||||
// 将textList中的title拼接成数组赋值给textList
|
||||
this.textList = []
|
||||
res.data.records.forEach(item => {
|
||||
this.textList.push(item.title)
|
||||
})
|
||||
|
@ -30,10 +30,11 @@
|
||||
<view class="bm-page-info-title">
|
||||
选择教练
|
||||
</view>
|
||||
<view class="d-s" @click="showjl = true">
|
||||
<view class="d-s" @click="!jlId && (showjl = true)"
|
||||
:style="{color: jlId ? '#999' : '', pointerEvents: jlId ? 'none' : ''}">
|
||||
<view class="" v-if="!jlName">请选择</view>
|
||||
<view class="" v-else>{{ jlName }}</view>
|
||||
<u-icon name="arrow-right" size="16"></u-icon>
|
||||
<u-icon name="arrow-right" size="16" :color="jlId ? '#999' : ''"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -154,7 +155,7 @@ import headers from '../../components/header/headers.vue'
|
||||
import request from '@/utils/request.js'
|
||||
import tabbar from '../../components/tabbar/tabbar.vue'
|
||||
import upload from '@/utils/upload.js'
|
||||
import {getLocalUserInfo,getToken} from '../../utils/auth'
|
||||
import {getCoachId, getLocalUserInfo,getStaffType,getToken} from '../../utils/auth'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -207,6 +208,8 @@ export default {
|
||||
payStatus: null,
|
||||
oldOrderDetails: [],
|
||||
loading: false,
|
||||
localStaffType: null,
|
||||
localCoachId: null,
|
||||
columns: [
|
||||
[{
|
||||
label: '全款',
|
||||
@ -233,6 +236,8 @@ export default {
|
||||
this.userId = option.userId,
|
||||
this.tenantId = option.tenantId
|
||||
this.userinfo = getLocalUserInfo()
|
||||
this.localStaffType = getStaffType()
|
||||
this.localCoachId = getCoachId()
|
||||
},
|
||||
onShow() {
|
||||
this.getListAll()
|
||||
@ -279,6 +284,45 @@ export default {
|
||||
|
||||
// 教练信息
|
||||
async getListAll() {
|
||||
this.columnjl = []
|
||||
let res = await request({
|
||||
url: '/app-api/dl-drive-school-coach-small/queryCoachByCourseId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
courseId: this.courseId,
|
||||
},
|
||||
tenantIdFlag: false
|
||||
})
|
||||
console.log('data',res.data)
|
||||
|
||||
// 过滤数据,只保留subject为2或3的教练
|
||||
const filteredData = res.data.filter(coach =>
|
||||
coach.subject === '2' || coach.subject === '3'
|
||||
);
|
||||
|
||||
this.columnjl = [
|
||||
filteredData.map(coach => ({
|
||||
label: coach.coachName,
|
||||
value: coach
|
||||
}))
|
||||
];
|
||||
|
||||
if (this.localStaffType === '02' && this.localCoachId) {
|
||||
console.log('123123',this.localStaffType)
|
||||
console.log('321321', this.localCoachId)
|
||||
console.log('coach', filteredData)
|
||||
const defaultCoach = filteredData.find(coach =>
|
||||
String(coach.coachId) === String(this.localCoachId)
|
||||
);
|
||||
console.log('111222333', defaultCoach)
|
||||
if (defaultCoach) {
|
||||
this.jlName = defaultCoach.coachName;
|
||||
this.jlId = defaultCoach.coachId;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* async getListAll() {
|
||||
this.columnjl = []
|
||||
let res = await request({
|
||||
url: '/app-api/dl-drive-school-coach-small/list',
|
||||
@ -294,7 +338,7 @@ export default {
|
||||
value: coach
|
||||
}))
|
||||
];
|
||||
},
|
||||
}, */
|
||||
getsexindex(index) {
|
||||
this.sex = index
|
||||
},
|
||||
@ -307,6 +351,7 @@ export default {
|
||||
},
|
||||
// 选择教练
|
||||
jlconfirm(e) {
|
||||
console.log('e', e)
|
||||
this.jlName = e.value[0].label; // 显示名称
|
||||
this.jlId = e.value[0].value.userId; // 获取教练ID
|
||||
this.showjl = false;
|
||||
@ -494,8 +539,8 @@ export default {
|
||||
money: this.rightInfoList.price,
|
||||
indent: this.identity,
|
||||
phone: this.phone,
|
||||
time: this.getCurrentDateTime()
|
||||
|
||||
time: this.getCurrentDateTime(),
|
||||
endTime: this.getEndTime(),
|
||||
};
|
||||
/* uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
|
||||
@ -781,10 +826,10 @@ export default {
|
||||
url: '/app-api/small-upload/common/upload',
|
||||
filePath: e,
|
||||
}).then((res) => {
|
||||
this.sfzimg = this.baseUrl + '/' + res.data.url
|
||||
this.sfzimg = res.data.url
|
||||
|
||||
if (this.sfzimg) {
|
||||
this.idOcr(this.sfzimg)
|
||||
this.idOcr(this.baseUrl + '/' + this.sfzimg)
|
||||
}
|
||||
|
||||
})
|
||||
@ -835,9 +880,14 @@ export default {
|
||||
};
|
||||
|
||||
// 如果选择了教练,添加source和sourceUserId
|
||||
if (this.jlId) {
|
||||
if (this.localCoachId && this.localStaffType == '01') {
|
||||
studentData.source = '01';
|
||||
studentData.sourceUserId = getCoachId(); // 设置来源用户ID为员工ID
|
||||
}else if (this.localCoachId && this.localStaffType == '02') {
|
||||
studentData.source = '02';
|
||||
studentData.sourceUserId = this.jlId; // 设置来源用户ID为教练ID
|
||||
studentData.sourceUserId = getCoachId(); // 设置来源用户ID为教练ID
|
||||
}else{
|
||||
studentData.source = '03'; // 自来客户
|
||||
}
|
||||
|
||||
request({
|
||||
@ -933,13 +983,29 @@ export default {
|
||||
money: this.payPrice,
|
||||
indent: this.identity,
|
||||
phone: this.phone,
|
||||
time: this.getCurrentDateTime()
|
||||
time: this.getCurrentDateTime(),
|
||||
endTime: this.getEndTime(),
|
||||
};
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
|
||||
})
|
||||
},
|
||||
|
||||
// 获取三年后的时间
|
||||
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}`;
|
||||
},
|
||||
|
||||
// 获取订单状态
|
||||
async getPayStatus(orderId) {
|
||||
const res = await request({
|
||||
|
@ -18,6 +18,7 @@
|
||||
import headers from "@/components/header/headers.vue";
|
||||
import SchoolInfo from '../newIndex/SchoolInfo.vue';
|
||||
import request from "@/utils/request";
|
||||
import { getTenantId } from "../../utils/auth";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -43,14 +44,20 @@ export default {
|
||||
uni.navigateBack()
|
||||
},
|
||||
getList() {
|
||||
const params = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
serviceCodes: 'jiaxiao',
|
||||
};
|
||||
if (getTenantId()) {
|
||||
console.log(getTenantId())
|
||||
params.tenantId = getTenantId();
|
||||
}
|
||||
|
||||
request({
|
||||
url: '/userClient/base/companySmallProgram/pageNoTenantId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
serviceCodes: 'jiaxiao'
|
||||
}
|
||||
params: params,
|
||||
}).then(res => {
|
||||
res.data.records.forEach(item => {
|
||||
item.features = ['有接送', '规模大']
|
||||
|
@ -140,7 +140,7 @@ export default {
|
||||
uni.navigateTo({
|
||||
url: '/newPages/newIndex/index'
|
||||
})
|
||||
}, 3000); // 3000毫秒即为3秒
|
||||
}, 2600); // 3000毫秒即为3秒
|
||||
|
||||
// const index = e.lastIndexOf("/")
|
||||
// let fileName = e.substring(index + 1, e.length)
|
||||
|
@ -1,6 +1,9 @@
|
||||
const TokenKey = 'App-Token'
|
||||
const TenantIdKey = 'TENANT_ID'
|
||||
const userInfo = 'userInfo'
|
||||
const InviteIdKey = 'INVITE_ID'
|
||||
const CoachIdKey = 'COACH_ID'
|
||||
const StaffTypeKey = 'STAFF_TYPE'
|
||||
|
||||
export function getToken() {
|
||||
return uni.getStorageSync(TokenKey)
|
||||
@ -22,6 +25,10 @@ export function getTenantId(){
|
||||
return uni.getStorageSync(TenantIdKey)
|
||||
}
|
||||
|
||||
export function removeTenantId(){
|
||||
return uni.removeStorageSync(TenantIdKey)
|
||||
}
|
||||
|
||||
export function setLocalUserInfo(userinfo){
|
||||
return uni.setStorageSync(userInfo,userinfo)
|
||||
}
|
||||
@ -30,6 +37,36 @@ export function getLocalUserInfo() {
|
||||
return uni.getStorageSync(userInfo)
|
||||
}
|
||||
|
||||
export function setInviteId(InviteId) {
|
||||
return uni.setStorageSync(InviteIdKey, InviteId);
|
||||
}
|
||||
export function getInviteId(){
|
||||
return uni.getStorageSync(InviteIdKey)
|
||||
}
|
||||
export function removeInviteId(){
|
||||
return uni.removeStorageSync(InviteIdKey)
|
||||
}
|
||||
|
||||
export function setCoachId(CoachId) {
|
||||
return uni.setStorageSync(CoachIdKey, CoachId);
|
||||
}
|
||||
export function getCoachId(){
|
||||
return uni.getStorageSync(CoachIdKey)
|
||||
}
|
||||
export function removeCoachId(){
|
||||
return uni.removeStorageSync(CoachIdKey)
|
||||
}
|
||||
// 员工为01,教练为02
|
||||
export function setStaffType(StaffType) {
|
||||
return uni.setStorageSync(StaffTypeKey, StaffType);
|
||||
}
|
||||
export function getStaffType(){
|
||||
return uni.getStorageSync(StaffTypeKey)
|
||||
}
|
||||
export function removeStaffType(){
|
||||
return uni.removeStorageSync(StaffTypeKey)
|
||||
}
|
||||
|
||||
// 设置本地存储,并设置一个过期时间(单位为秒)
|
||||
export function setStorageWithExpiry(key, value, ttl) {
|
||||
const now = new Date();
|
||||
|
Loading…
Reference in New Issue
Block a user