Compare commits
3 Commits
b0e2af62e3
...
457b953046
Author | SHA1 | Date | |
---|---|---|---|
457b953046 | |||
d8970bab48 | |||
6fb394ef18 |
@ -1,272 +1,289 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心" :showClear="showClear" @clearNoRead="clearNoReadFun"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="messageList">
|
||||
<scroll-view scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view v-for="(item, index) in messageList" :key="index" class="messageItem" @click="readNotice(item)">
|
||||
<image class="messageIcon" src="@/static/imgs/message-icon1.png" mode="aspectFit"></image>
|
||||
<view class="messageContent">
|
||||
<view :class="{'messageTitle':item.readStatus,'noReadTitle':!item.readStatus}" >系统通知</view>
|
||||
<view class="messageContent_content">{{item.templateContent}}</view>
|
||||
<view class="messageContent_content" style="text-align: right">{{formatTime(item.createTime)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="text-align: center" v-if="messageList.length==0">
|
||||
<image class="" src="@/static/imgs/nothing.png"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 普通弹窗 -->
|
||||
<uni-popup ref="popup" background-color="#fff" >
|
||||
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
|
||||
<text class="text popup-content-text">{{ nowReadItem.templateContent }}</text>
|
||||
<button class="button popup-info" @click="dialogToggle"><text
|
||||
class="button-text info-text">知道了</text></button>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心" :showClear="showClear"
|
||||
@clearNoRead="clearNoReadFun"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="messageList">
|
||||
<scroll-view scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus" refresher-enabled
|
||||
@refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view v-for="(item, index) in messageList" :key="index" class="messageItem"
|
||||
@click="readNotice(item)">
|
||||
<image class="messageIcon" src="@/static/imgs/message-icon1.png" mode="aspectFit"></image>
|
||||
<view class="messageContent">
|
||||
<view :class="{'messageTitle':item.readStatus,'noReadTitle':!item.readStatus}">系统通知</view>
|
||||
<view class="messageContent_content">{{item.templateContent}}</view>
|
||||
<view class="messageContent_content" style="text-align: right">
|
||||
{{formatTime(item.createTime)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="text-align: center" v-if="messageList.length==0">
|
||||
<image class="" src="@/static/imgs/nothing.png"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 普通弹窗 -->
|
||||
<uni-popup ref="popup" background-color="#fff">
|
||||
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
|
||||
<text class="text popup-content-text">{{ nowReadItem.templateContent }}</text>
|
||||
<button class="button popup-info" @click="dialogToggle"><text
|
||||
class="button-text info-text">知道了</text></button>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/tabbar/VNavigationBar.vue'
|
||||
import request from '@/utils/request.js'
|
||||
// import {formatTimestamp} from "@/utils/utils";
|
||||
import VNavigationBar from '@/components/tabbar/VNavigationBar.vue'
|
||||
import request from '@/utils/request.js'
|
||||
// import {formatTimestamp} from "@/utils/utils";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type:"center",
|
||||
messageList: [],
|
||||
pageNo: 1,
|
||||
pageSize: 15,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered:false,
|
||||
//是否显示一键清空
|
||||
showClear:true,
|
||||
nowReadItem:{},
|
||||
systemCode: 'jiaxiao',
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
data() {
|
||||
return {
|
||||
type: "center",
|
||||
messageList: [],
|
||||
pageNo: 1,
|
||||
pageSize: 15,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered: false,
|
||||
//是否显示一键清空
|
||||
showClear: true,
|
||||
nowReadItem: {},
|
||||
systemCode: 'jiaxiao',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
onShow(){
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
/**
|
||||
* 点击阅读消息
|
||||
*/
|
||||
async readNotice(item) {
|
||||
this.nowReadItem = item
|
||||
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
||||
this.$refs.popup.open(this.type)
|
||||
//直接请求后台已读
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/update-read",
|
||||
method: "PUT",
|
||||
params:{ids:this.nowReadItem.id},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if(res.code==200){
|
||||
this.onRefresherrefresh()
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 消息设置为已读
|
||||
*/
|
||||
dialogToggle(){
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
/**
|
||||
* 一键清空未读消息
|
||||
*/
|
||||
async clearNoReadFun(){
|
||||
console.log("清空了")
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/update-all-read",
|
||||
method: "PUT",
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.onRefresherrefresh()
|
||||
},500)
|
||||
}
|
||||
})
|
||||
},
|
||||
formatTime(value){
|
||||
// 将时间戳转换为Date对象
|
||||
const date = new Date(value);
|
||||
// 获取年月日时分秒
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const hours = date.getHours().toString().padStart(2, '0');
|
||||
const minutes = date.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = date.getSeconds().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottomCus() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.pageNo * this.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh(){
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.messageList = []
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
async getList(){
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/my-page",
|
||||
method: "GET",
|
||||
params:{
|
||||
pageNo:this.pageNo,
|
||||
pageSize:this.pageSize,
|
||||
systemCode: this.systemCode,
|
||||
},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
//判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据
|
||||
if (this.pageNo != 1) {
|
||||
this.messageList = this.messageList.concat(res.data.list)
|
||||
} else {
|
||||
this.messageList = res.data.list
|
||||
}
|
||||
//将获取的总条数赋值
|
||||
this.total = res.data.total
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 点击阅读消息
|
||||
*/
|
||||
async readNotice(item) {
|
||||
this.nowReadItem = item
|
||||
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
||||
this.$refs.popup.open(this.type)
|
||||
//直接请求后台已读
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/update-read",
|
||||
method: "PUT",
|
||||
params: {
|
||||
ids: this.nowReadItem.id
|
||||
},
|
||||
tenantIdFlag: false
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.onRefresherrefresh()
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 消息设置为已读
|
||||
*/
|
||||
dialogToggle() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
/**
|
||||
* 一键清空未读消息
|
||||
*/
|
||||
async clearNoReadFun() {
|
||||
console.log("清空了")
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/update-all-read",
|
||||
method: "PUT",
|
||||
tenantIdFlag: false
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.onRefresherrefresh()
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
},
|
||||
formatTime(value) {
|
||||
// 将时间戳转换为Date对象
|
||||
const date = new Date(value);
|
||||
// 获取年月日时分秒
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const hours = date.getHours().toString().padStart(2, '0');
|
||||
const minutes = date.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = date.getSeconds().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottomCus() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.pageNo * this.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh() {
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.messageList = []
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
async getList() {
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/my-page",
|
||||
method: "GET",
|
||||
params: {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
systemCode: this.systemCode,
|
||||
},
|
||||
tenantIdFlag: false
|
||||
}).then((res) => {
|
||||
//判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据
|
||||
if (this.pageNo != 1) {
|
||||
this.messageList = this.messageList.concat(res.data.list)
|
||||
} else {
|
||||
this.messageList = res.data.list
|
||||
}
|
||||
//将获取的总条数赋值
|
||||
this.total = res.data.total
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.container {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.body {
|
||||
flex: 1;
|
||||
.container {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
.messageList {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.itemContent {
|
||||
flex: 1; // 核心:scroll-view 占满剩余空间
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
}
|
||||
.messageItem {
|
||||
padding: 30rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
column-gap: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
|
||||
.messageIcon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.noReadTitle {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.noReadTitle:after{
|
||||
content: "*";
|
||||
color: red;
|
||||
display: block; /* 或者其他的块级显示类型,比如 inline-block, table 等 */
|
||||
position: absolute; /* 或者 absolute 或者 fixed,取决于你的布局需求 */
|
||||
z-index: 1; /* 确保它在元素的上方 */
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.messageContent {
|
||||
.body {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
.messageTitle {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.messageContent_content {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #858BA0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.popup-content {
|
||||
padding: 15px;
|
||||
height: auto;
|
||||
margin: auto;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.popup-content-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #333;
|
||||
}
|
||||
.messageList {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.popup-info {
|
||||
margin-top: 30rpx;
|
||||
color: #fff;
|
||||
background-color: #f2f6fc;
|
||||
}
|
||||
.itemContent {
|
||||
flex: 1; // 核心:scroll-view 占满剩余空间
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.info-text {
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
}
|
||||
|
||||
.messageItem {
|
||||
padding: 30rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
column-gap: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
|
||||
.messageIcon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.noReadTitle {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.noReadTitle:after {
|
||||
content: "*";
|
||||
color: red;
|
||||
display: block;
|
||||
/* 或者其他的块级显示类型,比如 inline-block, table 等 */
|
||||
position: absolute;
|
||||
/* 或者 absolute 或者 fixed,取决于你的布局需求 */
|
||||
z-index: 1;
|
||||
/* 确保它在元素的上方 */
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.messageContent {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.messageTitle {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.messageContent_content {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #858BA0;
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
padding: 15px;
|
||||
height: auto;
|
||||
margin: auto;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.popup-content-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.popup-info {
|
||||
margin-top: 30rpx;
|
||||
color: #fff;
|
||||
background-color: #f2f6fc;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -55,6 +55,7 @@
|
||||
getCoachId,
|
||||
getInviteId,
|
||||
getLocalUserInfo,
|
||||
getStaffType,
|
||||
getToken,
|
||||
removeCoachId,
|
||||
removeInviteId,
|
||||
@ -150,6 +151,8 @@
|
||||
if (res.data != null) {
|
||||
this.qTenantId = res.data.tenantId
|
||||
this.qCoachId = res.data.userId
|
||||
console.log('tenantId', this.qTenantId)
|
||||
console.log('coachId', this.qCoachId)
|
||||
setTenantId(res.data.tenantId)
|
||||
this.getList()
|
||||
if (res.data.type == 'jl') {
|
||||
@ -160,6 +163,8 @@
|
||||
setCoachId(res.data.userId)
|
||||
setStaffType('01')
|
||||
}
|
||||
console.log('getCoachId', getCoachId())
|
||||
console.log('getStaffType', getStaffType())
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -3,7 +3,7 @@
|
||||
{
|
||||
"path": "newPages/newIndex/index",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarTitleText": "首页",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
@ -5,45 +5,46 @@
|
||||
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
|
||||
</headers>
|
||||
</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">
|
||||
<view class="text-wrapper_1">
|
||||
<text class="text_3">¥</text>
|
||||
<text class="text_4">{{ courseDetails.price ? courseDetails.price.toFixed(2) : '--' }}</text>
|
||||
</view>
|
||||
<!-- <text class="text_5">¥3000.00</text>-->
|
||||
<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>
|
||||
<text class="text_6">{{ courseDetails.name }}</text>
|
||||
<view class="section_3 flex-row justify-between">
|
||||
<view class="text-wrapper_2 flex-col">
|
||||
<text class="text_7">{{ courseDetails.tittle }}</text>
|
||||
<view class="group_4 flex-col">
|
||||
<view class="section_2 flex-row justify-between">
|
||||
<view class="text-wrapper_1">
|
||||
<text class="text_3">¥</text>
|
||||
<text class="text_4">{{ courseDetails.price ? courseDetails.price.toFixed(2) : '--' }}</text>
|
||||
</view>
|
||||
<!-- <text class="text_5">¥3000.00</text>-->
|
||||
</view>
|
||||
<view class="text-wrapper_3 flex-col">
|
||||
<text class="text_8">{{ courseDetails.type }}</text>
|
||||
<text class="text_6">{{ courseDetails.name }}</text>
|
||||
<view class="section_3 flex-row justify-between">
|
||||
<view class="text-wrapper_2 flex-col">
|
||||
<text class="text_7">{{ courseDetails.tittle }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_3 flex-col">
|
||||
<text class="text_8">{{ courseDetails.type }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="text_9">周一至周日 08:00-18:00</text>
|
||||
</view>
|
||||
<view class="group_5 flex-col">
|
||||
<view class="section_4 flex-row justify-between">
|
||||
<view class="block_3 flex-col"></view>
|
||||
<text class="text_10">课程介绍</text>
|
||||
</view>
|
||||
<view class="u-content" v-if="courseDetails.remark">
|
||||
<u-parse :content="courseDetails.remark"></u-parse>
|
||||
</view>
|
||||
<view class="u-content" v-else>
|
||||
<u-empty mode="list" text="该课程没有简介...">
|
||||
</u-empty>
|
||||
</view>
|
||||
</view>
|
||||
<text class="text_9">周一至周日 08:00-18:00</text>
|
||||
</view>
|
||||
<view class="group_5 flex-col">
|
||||
<view class="section_4 flex-row justify-between">
|
||||
<view class="block_3 flex-col"></view>
|
||||
<text class="text_10">课程介绍</text>
|
||||
</view>
|
||||
<view class="u-content" v-if="courseDetails.remark">
|
||||
<u-parse :content="courseDetails.remark"></u-parse>
|
||||
</view>
|
||||
<view class="u-content" v-else>
|
||||
<u-empty mode="list" text="该课程没有简介...">
|
||||
</u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="group_6 flex-row">
|
||||
<view class="image-text_1 flex-col justify-between" @click="zxkf()">
|
||||
<image class="label_2" referrerpolicy="no-referrer"
|
||||
@ -78,6 +79,7 @@
|
||||
driveSchoolPhone: [],
|
||||
imagesUrl: config.imagesUrl,
|
||||
userDetails: [],
|
||||
scrollHeight: 0,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -87,6 +89,10 @@
|
||||
this.userDetails = getLocalUserInfo();
|
||||
this.getServicePhone()
|
||||
},
|
||||
onReady() {
|
||||
// 动态计算滚动区域高度
|
||||
this.calculateScrollHeight();
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
@ -123,6 +129,15 @@
|
||||
})
|
||||
},
|
||||
|
||||
calculateScrollHeight() {
|
||||
// 获取屏幕高度
|
||||
const screenHeight = uni.getSystemInfoSync().windowHeight;
|
||||
// 获取顶部区域高度
|
||||
const topHeight = 166;
|
||||
// 计算滚动区域高度
|
||||
this.scrollHeight = screenHeight - topHeight;
|
||||
},
|
||||
|
||||
goRegisterNow() {
|
||||
console.log('token', getToken())
|
||||
if (!getToken()) {
|
||||
@ -156,4 +171,4 @@
|
||||
margin-top: 20rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -221,6 +221,7 @@
|
||||
loading: false,
|
||||
localStaffType: null,
|
||||
localCoachId: null,
|
||||
userDetails: [],
|
||||
columns: [
|
||||
[{
|
||||
label: '全款',
|
||||
@ -235,6 +236,7 @@
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log('option', option)
|
||||
uni.showToast({
|
||||
title: '请完善个人信息',
|
||||
icon: 'none'
|
||||
@ -243,11 +245,15 @@
|
||||
this.hideTeacher = 1
|
||||
}
|
||||
this.jlId = uni.getStorageSync('jlId');
|
||||
this.userDetails = getLocalUserInfo();
|
||||
this.courseId = option.courseId,
|
||||
this.userId = option.userId,
|
||||
this.tenantId = option.tenantId
|
||||
this.userinfo = getLocalUserInfo()
|
||||
this.tenantId = option.tenantId,
|
||||
this.userId = this.userDetails.id,
|
||||
this.userinfo = getLocalUserInfo()
|
||||
this.localStaffType = getStaffType()
|
||||
this.localCoachId = getCoachId()
|
||||
console.log('localCoachId', this.localCoachId);
|
||||
console.log('userId', this.userId);
|
||||
if (this.localStaffType === '02') {
|
||||
this.localCoachId = getCoachId()
|
||||
console.log('localCoachId', this.localCoachId);
|
||||
@ -359,34 +365,34 @@
|
||||
tenantIdFlag: false
|
||||
})
|
||||
console.log('data',res.data)
|
||||
|
||||
|
||||
// 过滤数据,只保留subject为2或3的教练
|
||||
const filteredData = res.data.filter(coach =>
|
||||
const filteredData = res.data.filter(coach =>
|
||||
coach.subject === '2' || coach.subject === '3'
|
||||
);
|
||||
// 去重处理 - 根据coachId去除重复教练
|
||||
const uniqueCoaches = [];
|
||||
const coachIds = new Set();
|
||||
|
||||
|
||||
filteredData.forEach(coach => {
|
||||
if (!coachIds.has(coach.coachId)) {
|
||||
coachIds.add(coach.coachId);
|
||||
uniqueCoaches.push(coach);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
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 =>
|
||||
const defaultCoach = filteredData.find(coach =>
|
||||
String(coach.coachId) === String(this.localCoachId)
|
||||
);
|
||||
console.log('111222333', defaultCoach)
|
||||
@ -659,7 +665,7 @@
|
||||
url: `/small/jxInfo/prepayment?type=jsapi&orderNo=${this.orderNo}&orderId=${this.orderId}&payType=${payType}`,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
|
||||
|
||||
const result = await this.handleWxPayment(res);
|
||||
if (result === 'success') {
|
||||
@ -1339,4 +1345,4 @@
|
||||
.size-lv {
|
||||
margin-right: 35px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user