Commit bf1474cd authored by youjie's avatar youjie

no message

parent 6532eef2
<script>
export default {
onLaunch() {
//调用定义的更新方法
this.VersionUpdate();
},
onShow() {
// console.log('App Show')
......@@ -14,61 +13,7 @@ export default {
// console.log('App Hide')
},
methods:{
//定义更新方法
VersionUpdate() {
// 判断应用的 getUpdateManager 是否在当前版本可用
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
// 向小程序后台请求完新版本信息
updateManager.onCheckForUpdate(function(res) {
if (res.hasUpdate) {
//小程序有新版本,静默下载新版本,新版本下载完成
updateManager.onUpdateReady(function() {
//模态弹窗(确认、取消)
uni.showModal({
title: '更新提示',
content: '小程序已发布新版本,是否重启?',
success: function(res) {
//用户点击确定
if (res.confirm) {
//当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
} //用户点击取消
else if (res.cancel) {
//强制用户更新,弹出第二次弹窗
uni.showModal({
title: '提示',
content: '小程序已发布新版本,是否重启',
showCancel: false, //隐藏取消按钮
success: function(res) {
//第二次提示后,强制更新
if (res.confirm) {
// 当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
}
}
})
}
}
})
})
// 当新版本下载失败
updateManager.onUpdateFailed(function() {
uni.showModal({
title: '提示',
content: '请您删除当前小程序,重新打开小程序',
})
})
}
})
} else {
// 提示用户在最新版本的客户端上体验
uni.showModal({
title: '温馨提示',
content: '当前微信版本过低,可能无法使用该功能,请升级到最新版本后重试。'
})
}
}
}
};
</script>
......
<template>
<view class="classList-box">
<view class="classList-content-box" v-for="(i,indexs) in classList" :key="indexs">
<template v-if="i.SubList.length>0">
<view class="content-time">
<view class="time-Wire">
<view class="time-round"></view>
</view>
<view class="time-date">
<view class="time-num">
<view>{{i.DateStr.slice(5,7)}}/</view>
<view>{{i.DateStr.slice(8,10)}}</view>
</view>
<view class="time-text">
{{getDateData(i.DateStr)}}
</view>
</view>
</view>
<van-swipe-cell class="content-right"
:class="{'activeOne':indexs==0,'activeTwo':indexs==1,
'activeThree':indexs==2,'activeFour':indexs==3,
'activeFive':indexs==4,'activeSix':indexs==5,
'activeSeven':indexs==6}"
id="swipe-cell"
:right-width="116"
async-close
:disabled="true">
<view class="content-text-box">
<view class="right-box">
<view v-for="(item,index) in i.SubList.sort((a,b)=>{a-b})"
:key="index"
class="Festival-box activeOne"
:class="{'activeOne':item.StartTime=='09:30','activeTwo':item.StartTime=='11:10',
'activeThree':item.StartTime=='13:30','activeFour':item.StartTime=='15:10',
'activeFive':item.StartTime=='16:50','activeSix':item.StartTime=='19:00'}">
<view>
<text v-if="item.StartTime=='09:30'"></text>
<text v-if="item.StartTime=='11:10'"></text>
<text v-if="item.StartTime=='13:30'"></text>
<text v-if="item.StartTime=='15:10'"></text>
<text v-if="item.StartTime=='16:50'"></text>
<text v-if="item.StartTime=='19:00'"></text>
</view>
<view>
{{item.StartTime}}
</view>
</view>
</view>
</view>
<view slot="right" class="van-swipe-cell__right">
<van-button square type="danger" custom-style="height:100%;">删除</van-button>
</view>
</van-swipe-cell>
</template>
</view>
</view>
</template>
<script>
import {
ref,
toRefs,
reactive,
getCurrentInstance,
onMounted
} from 'vue'
export default {
components: {
},
props: ['classList'],
setup(props) {
const {
proxy
} = getCurrentInstance()
const data = reactive({
})
const methods = {
// 获取日期
getDateData(d) {
let date = new Date(d)
let week = date.getDay()
let weekStr = ""
switch (week) {
case 0:
weekStr = '星期日';
break;
case 1:
weekStr = '星期一';
break;
case 2:
weekStr = '星期二';
break;
case 3:
weekStr = '星期三';
break;
case 4:
weekStr = '星期四';
break;
case 5:
weekStr = '星期五';
break;
case 6:
weekStr = '星期六';
break;
}
return weekStr
},
}
onMounted(() => {
})
return {
...toRefs(data),
...methods
}
},
}
</script>
<style scoped>
.classList-content-box{
display: flex;
justify-content: space-between;
padding: 0 50rpx 0 0;
}
.content-time{
display: flex;
flex-shrink: 0;
margin-right: 59rpx;
padding: 0 0 0 33rpx;
}
.classList-content-box:last-child .time-Wire{
/* background: #ffffff; */
}
.time-Wire{
width: 1rpx;
height: 100%;
background: #A9A9A9;
position: relative;
flex-shrink: 0;
margin-top: 50rpx;
}
.time-round{
width: 15rpx;
height: 15rpx;
background: #111111;
border-radius: 50%;
position: absolute;
left: -6rpx;
top: 0;
}
.time-date{
display: flex;
flex-direction: column;
margin-left: 33rpx;
padding: 40rpx 0 0 0;
}
.time-num{
display: flex;
font-size: 26rpx;
font-weight: 800;
color: #111111;
}
.time-num view:first-child{
font-size: 22rpx;
padding: 3rpx 0 0 0;
font-weight: 400;
}
.time-text{
font-size: 26rpx;
color: #111111;
font-weight: 500;
}
.content-right{
position: relative;
flex-grow: 1;
border-radius: 24rpx;
padding: 0 0 0 38rpx;
overflow: hidden;
margin-bottom: 50rpx;
}
.content-text-box{
padding: 5rpx 0 34rpx 0;
}
.content-right.activeOne{
background: #FDEAD5;
}
.content-right.activeTwo{
background: #EDD9FF;
}
.content-right.activeThree{
background: #D7F2E9;
}
.content-right.activeFour{
background: #FFF1F4;
}
.content-right.activeFive{
background: #E5F3FE;
}
.content-right.activeSix{
background: #EDF8F9;
}
.content-right.activeSeven{
background: #E5E6FA;
}
.right-box{
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.Festival-box{
display: flex;
margin-top: 29rpx;
padding: 7rpx 19rpx;
border-radius: 10rpx;
color: #ffffff;
margin-right: 31rpx;
font-size: 28rpx;
}
.Festival-box:nth-child(2n){
margin-right: 0;
}
.Festival-box view:last-child{
margin-left: 15rpx;
font-size: 26rpx;
padding: 3rpx 0 0 0;
}
.Festival-box.activeOne{
background: #FF9626;
}
.Festival-box.activeTwo{
background: #B966FF;
}
.Festival-box.activeThree{
background: #35B881;
}
.Festival-box.activeFour{
background: #FE606A;
}
.Festival-box.activeFive{
background: #0588F8;
}
.Festival-box.activeSix{
background: #33BED9;
}
.van-swipe-cell__right {
position: absolute;
top: 0;
bottom: 0;
height: 100%;
right: -111rpx;
width:232px;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
}
</style>
......@@ -69,8 +69,22 @@
console.log(os)
//data.statusBarHeight = os.statusBarHeight
let methods={
changeTabbarHandler(e){
data.active=e.detail
let url
if(data.active=='home'){
url = 'index/index'
}
if(data.active=='classtime'){
url = 'timetable/timeTable'
}
if(data.active=='usercenter'){
url = 'person/person'
}
uni.reLaunch({
url: '/pages/'+url
});
}
}
return {
......
......@@ -8,28 +8,48 @@
<view class="user-name">
{{currentErpUser.AccountName}}
</view>
<view class="user-change-text">
<view v-if="erpUsers.length>1" class="user-change-text">
点击切换学员
</view>
</view>
</view>
<!-- catch:touchstart -->
<van-popup
:show="showChange"
round
catch:touchstart
custom-style="height: 650rpx;width:650rpx"
@close="closeChangeUserHandler"
>
<view class="user-change-box">
<view class="icon">
<van-icon class-prefix='iconfont' name='icon-qiehuan1'></van-icon>
</view>
<view class="title">
切换学员
</view>
<view class="close">
<van-icon name='cross' @click="showChange=false"></van-icon>
@close="closeChangeUserHandler">
<view>
<view class="user-change-box">
<view class="icon">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1663912533000_168.png"
style="width:21rpx;height:21rpx;display: block;"></image>
</view>
<view class="title">
切换学员
</view>
<view class="close">
<van-icon name='cross' @click="showChange=false"></van-icon>
</view>
</view>
<scroll-view scroll-y="true" style="width:100%;height: 470rpx;">
<view class="stuList-box">
<view class="stuList" v-for="(item,index) in erpUsers" :key="index"
:class="{'active':item.AccountId==currentErpUser.AccountId}"
@click="toggleStu(item)">
<view class="stuList-left">
<view class="surname" :style="{background:item.bgColor}">{{item.AccountName.substring(0,1)}}</view>
<text>{{item.AccountName}}</text>
</view>
<view class="stuList-right">
<van-icon name='circle' color="#EFEFEF" size="23"></van-icon>
<image class="stuList-right-img" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1663917392000_451.png"
style="width:36rpx;height:35rpx;"></image>
</view>
</view>
</view>
</scroll-view>
</view>
</van-popup>
</view>
......@@ -48,6 +68,14 @@
data.erpUsers=uni.getStorageSync('ErpStus')
data.currentErpUser=uni.getStorageSync('erpUserInfo')
let methods = {
toggleStu(x){
if(x.AccountId!=data.currentErpUser.AccountId){
uni.removeStorageSync('erpUserInfo')
uni.setStorageSync('erpUserInfo',x)
data.currentErpUser=uni.getStorageSync('erpUserInfo')
this.initColor()
}
},
closeChangeUserHandler(){
},
......@@ -139,5 +167,45 @@
height: 26rpx;
color:#282828;
}
.stuList-box{
padding: 0 56rpx;
}
.stuList{
display: flex;
justify-content: space-between;
margin-bottom: 36rpx;
}
.stuList-left{
display: flex;
align-items: center;
margin-right: 20rpx;
}
.surname{
width: 60rpx;
height: 60rpx;
border-radius: 50%;
overflow: hidden;
margin-right: 32rpx;
color: #ffffff;
font-size: 38rpx;
font-weight: 500;
text-align: center;
line-height: 60rpx;
overflow: hidden;
}
.stuList-right{
position: relative;
flex-shrink: 0;
display: flex;
align-items: center;
}
.stuList-right-img{
display: none;
position: absolute;
left: 1rpx;
top: 8rpx;
}
.stuList.active .stuList-right-img{
display: block;
}
</style>
\ No newline at end of file
......@@ -37,7 +37,8 @@
"style": {
"navigationStyle": "custom"
}
},{
},
{
"path": "pages/login/login",
"style": {
"navigationStyle": "custom"
......@@ -85,10 +86,43 @@
"style": {
"navigationStyle": "custom"
}
},{
"path": "pages/timetable/timeTable", //课表
"style": {
"navigationStyle": "custom"
}
},{
"path": "pages/person/person",
"style": {
"navigationBarTitleText": "个人中心",
"backgroundColor": "#f5f5f5",
"navigationBarBackgroundColor": "#f5f5f5"
}
}
],
"subPackages": [],
"subPackages": [
{
"root": "pages/bookAclass", //约课分包
"pages": [{
"path": "index",
"style": {
"navigationBarTitleText": "上课计划",
"navigationBarBackgroundColor": "#F5F5F5",
"backgroundColor": "#F5F5F5"
}
},
{
"path": "addPlan",
"style": {
"navigationBarTitleText": "添加计划",
"navigationBarBackgroundColor": "#F5F5F5",
"backgroundColor": "#F5F5F5"
}
}
]
}
],
// "tabBar": {
// "color": "#929292",
// "selectedColor": "#929292",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -70,7 +70,7 @@
getSweepCode
} from '../../api/index.js'
import {
getImageColor
getImageColor,VersionUpdate
} from '../../utils/index.js'
import userCard from '../../components/user-card.vue'
import indexassembly from './components/indexassembly.vue'
......@@ -105,6 +105,7 @@
});
let methods = {
VersionUpdate,
changePopStatusHandler(status){
data.showPopu=status==1
},
......@@ -136,62 +137,6 @@
uni.hideLoading()
})
},
//定义更新方法
VersionUpdate() {
// 判断应用的 getUpdateManager 是否在当前版本可用
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
// 向小程序后台请求完新版本信息
updateManager.onCheckForUpdate(function(res) {
console.log(res.hasUpdate);
if (res.hasUpdate) {
//小程序有新版本,静默下载新版本,新版本下载完成
updateManager.onUpdateReady(function() {
//模态弹窗(确认、取消)
uni.showModal({
title: '更新提示',
content: '小程序已发布新版本,是否重启?',
success: function(res) {
//用户点击确定
if (res.confirm) {
//当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
} //用户点击取消
else if (res.cancel) {
//强制用户更新,弹出第二次弹窗
uni.showModal({
title: '提示',
content: '小程序已发布新版本,是否重启',
showCancel: false, //隐藏取消按钮
success: function(res) {
//第二次提示后,强制更新
if (res.confirm) {
// 当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
}
}
})
}
}
})
})
// 当新版本下载失败
updateManager.onUpdateFailed(function() {
uni.showModal({
title: '提示',
content: '请您删除当前小程序,重新打开小程序',
})
})
}
})
} else {
// 提示用户在最新版本的客户端上体验
uni.showModal({
title: '温馨提示',
content: '当前微信版本过低,可能无法使用该功能,请升级到最新版本后重试。'
})
}
}
};
methods.getStuCourse();
data.userData = uni.getStorageSync('userInfo');
......@@ -200,9 +145,10 @@
url:'/pages/index/workSituation'
})
}
// onMounted(() => {
// });
onMounted(() => {
that.VersionUpdate()
});
let that = methods;
return {
...toRefs(data),
...methods,
......@@ -215,8 +161,7 @@
},
onShow(){
//调用定义的更新方法
this.VersionUpdate();
},
onShareAppMessage() {
return {
......
......@@ -82,7 +82,7 @@
getSweepCode
} from '../../api/index.js'
import {
getImageColor
getImageColor,VersionUpdate
} from '../../utils/index.js'
import indexassembly from './components/indexassembly.vue'
import navbar from '../../components/navbar.vue'
......@@ -136,6 +136,7 @@
})
}
let methods = {
VersionUpdate,
changePopStatusHandler(status){
data.showPopu=status==1
},
......@@ -253,66 +254,10 @@
data.pageState = "none";
}
},
//定义更新方法
VersionUpdate() {
// 判断应用的 getUpdateManager 是否在当前版本可用
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
// 向小程序后台请求完新版本信息
updateManager.onCheckForUpdate(function(res) {
console.log(res.hasUpdate);
if (res.hasUpdate) {
//小程序有新版本,静默下载新版本,新版本下载完成
updateManager.onUpdateReady(function() {
//模态弹窗(确认、取消)
uni.showModal({
title: '更新提示',
content: '小程序已发布新版本,是否重启?',
success: function(res) {
//用户点击确定
if (res.confirm) {
//当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
} //用户点击取消
else if (res.cancel) {
//强制用户更新,弹出第二次弹窗
uni.showModal({
title: '提示',
content: '小程序已发布新版本,是否重启',
showCancel: false, //隐藏取消按钮
success: function(res) {
//第二次提示后,强制更新
if (res.confirm) {
// 当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
}
}
})
}
}
})
})
// 当新版本下载失败
updateManager.onUpdateFailed(function() {
uni.showModal({
title: '提示',
content: '请您删除当前小程序,重新打开小程序',
})
})
}
})
} else {
// 提示用户在最新版本的客户端上体验
uni.showModal({
title: '温馨提示',
content: '当前微信版本过低,可能无法使用该功能,请升级到最新版本后重试。'
})
}
}
};
onMounted(() => {
that.VersionUpdate()
});
let that = methods;
return {
......@@ -328,8 +273,6 @@
},
onShow() {
this.getExamPageList()
//调用定义的更新方法
this.VersionUpdate();
},
onShareAppMessage() {
return {
......
This diff is collapsed.
<template>
<view>
<view
class="timetable-item"
v-for="(item, index) in data.PlanTimeList"
:key="index"
>
<view class="flex flex_start_center title-row">
<view class="class-time">
<view class="" style="font-size: 22rpx;font-weight: 400;color: #111111;">
{{data.DateMonth}}-{{data.DateDay}}
</view>
<view class="">
{{ item.StartTime }}
</view>
</view>
<view class="circle"></view>
<view class="class-title one_line flex">
{{ data.ClassName }}
<view v-for="(_item, _index) in data.Chapter" :key="_index">
{{ _item.ChapterName }}
<text v-if="_index !== data.Chapter.length - 1">,</text>
</view>
</view>
</view>
<view class="left-line"></view>
<view class="class-con flex">
<van-image
round
width="84rpx"
height="84rpx"
fit="cover"
:src="item.UserIcon"
class="teacherimg"
/>
<view class="class-right flex_grow flex flex_start_center">
<!-- <view class="study-con"> 今日学习课程内容 </view> -->
<view class="teacher-name flex flex_start-center">
{{ item.TeacherName }}</view
>
</view>
</view>
<view class="class-con class_status">
<view v-if="item.IsLeave === 1 && item.IsCheck == 2">状态:<text style="color:#E6A23C;">已请假</text></view>
<view v-if="item.IsLeave === 0 &&item.IsCheck === 0">状态:<text style="color:#0000FF">正常</text></view>
<view v-if="item.IsLeave === 0 &&item.IsCheck === 1">状态:<text style="color:#F56C6C">缺勤</text></view>
</view>
<view class="btn-box">
<van-button
custom-class="leave-btn"
@click="
jumpPage(`/pages/course/askForLeave?classId=${data.ClassId} `)
"
v-if="item.IsLeave === 1 && item.IsCheck < 2"
>请假</van-button
>
</view>
</view>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
export default {
name: "",
props: { data: Object},
components: {},
setup(props) {
let methods = {
jumpPage(url) {
uni.navigateTo({
url: url,
});
},
};
return {
...toRefs(props),
...methods,
};
},
};
</script>
<style scoped>
.timetable-item {
box-sizing: border-box;
padding: 0 30rpx;
height: 280rpx;
position: relative;
}
.left-line {
width: 2rpx;
height: 275rpx;
background-color: #e2e2e2;
position: absolute;
left: 112rpx;
top: 20rpx;
}
.class-time {
width: 68rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 800;
color: #1b1d1e;
margin-right: 10rpx;
}
.circle {
box-sizing: border-box;
width: 12rpx;
height: 12rpx;
background-color: #ffffff;
border: 4rpx solid #0000ff;
border-radius: 50%;
margin-right: 20rpx;
}
.class-title {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
}
.teacherimg {
margin-right: 30rpx;
}
.class-con {
margin-left: 110rpx;
margin-top: 30rpx;
}
.study-con {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
margin-top: 8rpx;
/* margin-bottom: 8rpx; */
}
.teacher-name {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
}
.btn-box {
position: absolute;
right: 30rpx;
top: 170rpx;
}
/deep/.leave-btn {
width: 142rpx;
height: 52rpx;
background-color: #0000ff;
border-radius: 8rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
}
/deep/.already-leave-btn {
width: 142rpx;
height: 52rpx;
background-color: #0000ff;
opacity: 0.5;
border-radius: 8rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
}
.class_status{
font-size: 26rpx;
}
</style>
This diff is collapsed.
//定义更新方法
export let VersionUpdate = () =>{
// 判断应用的 getUpdateManager 是否在当前版本可用
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
// 向小程序后台请求完新版本信息
updateManager.onCheckForUpdate(function(res) {
console.log(res.hasUpdate);
if (res.hasUpdate) {
//小程序有新版本,静默下载新版本,新版本下载完成
updateManager.onUpdateReady(function() {
//模态弹窗(确认、取消)
uni.showModal({
title: '更新提示',
content: '小程序已发布新版本,是否重启?',
success: function(res) {
//用户点击确定
if (res.confirm) {
//当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
} //用户点击取消
else if (res.cancel) {
//强制用户更新,弹出第二次弹窗
uni.showModal({
title: '提示',
content: '小程序已发布新版本,是否重启',
showCancel: false, //隐藏取消按钮
success: function(res) {
//第二次提示后,强制更新
if (res.confirm) {
// 当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
}
}
})
}
}
})
})
// 当新版本下载失败
updateManager.onUpdateFailed(function() {
uni.showModal({
title: '提示',
content: '请您删除当前小程序,重新打开小程序',
})
})
}
})
} else {
// 提示用户在最新版本的客户端上体验
uni.showModal({
title: '温馨提示',
content: '当前微信版本过低,可能无法使用该功能,请升级到最新版本后重试。'
})
}
}
//脱敏
export let desensitization = (str, beginLen, endLen) => {
let len = str.length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment