预览资源及填写正式姓名修改

master
yujialong 2 months ago
parent 9a8f513b09
commit 39a802c0bb
  1. 59
      components/realName/realName.vue
  2. 29
      course/courseDetail/courseDetail.vue
  3. 2
      pages/index/index.vue

@ -1,15 +1,13 @@
<template>
<uni-popup ref="alertDialog" :is-mask-click="false">
<uni-popup ref="alertDialog" :is-mask-click="false" type="bottom" background-color="#fff" borderRadius="20px 20px 0 0">
<view class="realname-wrap">
<view class="realname-form">
<uni-forms label-width="70" label-align="right">
<uni-forms-item label="真实姓名" required>
<uni-easyinput type="text" v-model.trim="realNameForm.userName" placeholder="请输入真实姓名" />
</uni-forms-item>
<uni-forms-item label="学号">
<uni-easyinput type="text" v-model.trim="realNameForm.workNumber" placeholder="请输入学号" />
</uni-forms-item>
</uni-forms>
<view class="line">
<input type="text" v-model.trim="realNameForm.userName" placeholder="请输入真实姓名" />
</view>
<view class="line">
<input type="text" v-model.trim="realNameForm.workNumber" placeholder="请输入学号" />
</view>
</view>
<view class="btn" @click="realNameSubmit">确认</view>
</view>
@ -35,8 +33,13 @@
async handleRealName () {
const res = await checkUserNameOrWorkNumber()
//
if (!res.hasName) this.realNameForm.workNumber = res.workNumber || ''
this.$refs.alertDialog[res.hasName ? 'close' : 'open']()
if (!res.hasName) {
this.$refs.alertDialog.open('bottom')
this.realNameForm.workNumber = res.workNumber || ''
} else {
this.$refs.alertDialog.close()
}
},
//
async realNameSubmit() {
@ -54,19 +57,39 @@
<style scoped lang="scss">
.realname-wrap {
width: 460rpx;
width: 100%;
padding-bottom: 20rpx;
background-color: #fff;
border-radius: 20rpx;
border-radius: 20rpx 20rpx 0 0;
.realname-form {
padding: 30rpx 30rpx 0;
}
.line {
padding: 20rpx 0;
margin-bottom: 10rpx;
&:not(.not-bd) {
border-bottom: 1px solid #f3f3f3;
}
}
.label {
width: 200rpx;
font-size: 28rpx;
color: #565656;
}
input {
font-size: 28rpx;
color: #333;
}
.btn {
flex: 1;
padding: 22rpx 16rpx;
font-size: 24rpx;
color: #007EFF;
width: 300rpx;
height: 60rpx;
margin: 30rpx auto 0;
font-size: 30rpx;
text-align: center;
border-top: 1px solid #eee;
color: #fff;
line-height: 60rpx;
background-color: #007EFF;
border-radius: 40rpx;
}
}
</style>

@ -1,9 +1,5 @@
<template>
<view class="wrap">
<!-- <view class="header">
<uni-icons class="back" type="back" size="20" color="#fff" @click="back"></uni-icons>
<text>课程详情</text>
</view> -->
<!-- <web-view class="wv" src="https://view.officeapps.live.com/op/view.aspx?src=https://huoran.oss-cn-shenzhen.aliyuncs.com/1732588133977.xlsx"></web-view> -->
<view class="file-wrap">
<image v-if="!curRow.viewUrl && coverUrl" class="pic" :src="coverUrl" mode="widthFix"></image>
@ -13,7 +9,7 @@
<!-- pdfwordexcelppt都用webview展示 -->
<view v-else-if="curRow.isDoc" class="webview-wrap">
<web-view class="webview" :webview-styles="webviewStyles" :fullscreen="false" :src="curRow.viewUrl" @click="hidePlayList"></web-view>
<cover-view :class="['webview-mask', {ppt: curRow.isPpt}]" @click="closePreview">
<cover-view class="webview-mask" @click="closePreview">
<cover-image class="icon" src="https://eduvessel.com/images/occupationlab/close-gray.png" alt="" mode="widthFix" />
</cover-view>
</view>
@ -362,23 +358,15 @@
// //pdf
handleFileType(row) {
const type = row.fileType
if (type === 'pptx' || type === 'ppt') {
row.isPpt = true
if (this.$util.exts.video.includes(type)) {
row.isVideo = true
} else if (this.$util.exts.img.includes(type)) {
row.isPic = true
} else if (this.$util.exts.doc.includes(type)) {
row.isDoc = true
row.viewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + row.fileUrl
} else {
if (this.$util.exts.video.includes(type)) {
row.isVideo = true
} else if (this.$util.exts.img.includes(type)) {
row.isPic = true
} else if (this.$util.exts.doc.includes(type)) {
row.isDoc = true
}
row.viewUrl = row.fileUrl
}
row.viewUrl = row.fileUrl
this.curRow = row
const pages = getCurrentPages()
console.log('preview:',pages)
},
//
secClick(row) {
@ -600,7 +588,10 @@
}
}
.detail {
max-height: calc(100vh - 562rpx);
padding: 0 30rpx 30rpx;
overflow: auto;
box-sizing: border-box;
.chapters {
margin-top: 20rpx;
}

@ -56,7 +56,7 @@
}, 1500)
},
onShow() {
// uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjkwMTEyLCJyblN0ciI6ImFUamlTeGw0WWxIMlZTQzFnaERGUmJBb1dWU1VHU01CIiwiYWNjb3VudElkIjo5MDExMiwidXNlcklkIjo5MDExOCwic2Nob29sSWQiOjI4ODYsInVzZXJOYW1lIjoiUmFpbiIsInBsYXRmb3JtSWQiOiIxIn0.nZYZCgt1ERL6Y4L4cfFid00PwAgKCMYr_f88fzhgjYw')
// uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjQ2NzQ1LCJyblN0ciI6IjMwRWUxeGdZdWNVRldRbnVvQ2g4VW91UHVEM2FCT3ZIIiwiYWNjb3VudElkIjo0Njc0NSwidXNlcklkIjo0Njc0NCwic2Nob29sSWQiOjI4NDYsInBsYXRmb3JtSWQiOiIxIn0.cYd_MaosBesD8iwoPV6XB91bit2vtmzpOVThQtPVxxs')
this.$refs.realName.handleRealName()
this.getTab()
},

Loading…
Cancel
Save