|
|
|
@ -3,12 +3,12 @@
|
|
|
|
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
|
|
|
|
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
|
|
|
|
<view class="wrap">
|
|
|
|
<view class="wrap">
|
|
|
|
<topBanner v-if="banner_list.length>0" :banner_list="banner_list"></topBanner>
|
|
|
|
<topBanner v-if="banner_list.length>0" :banner_list="banner_list"></topBanner>
|
|
|
|
<view class="wrap-status">
|
|
|
|
<view class="wrap-status">
|
|
|
|
<!-- 待审核 -->
|
|
|
|
<!-- 待审核 -->
|
|
|
|
<view v-if="info.status===0">
|
|
|
|
<view v-if="info.status===0">
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-content">{{info.reason?info.reason:wait_tip}}</view>
|
|
|
|
<view class="wrap-status-content">{{info.reason?info.reason:wait_tip}}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 审核通过 -->
|
|
|
|
<!-- 审核通过 -->
|
|
|
|
<view v-else-if="info.status===1">
|
|
|
|
<view v-else-if="info.status===1">
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
@ -23,26 +23,26 @@
|
|
|
|
<view style="justify-content: center;color: #999;" class="wrap-status-btn" v-if="info.fee_status!=1" @click="showCancel = true">
|
|
|
|
<view style="justify-content: center;color: #999;" class="wrap-status-btn" v-if="info.fee_status!=1" @click="showCancel = true">
|
|
|
|
我要放弃
|
|
|
|
我要放弃
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 审核不通过 -->
|
|
|
|
<!-- 审核不通过 -->
|
|
|
|
<view v-else-if="info.status===2 || info.status===6">
|
|
|
|
<view v-else-if="info.status===2 || info.status===6">
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-content">{{info.reason?info.reason:fault_tip}}</view>
|
|
|
|
<view class="wrap-status-content">{{info.reason?info.reason:fault_tip}}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 备选 -->
|
|
|
|
<!-- 备选 -->
|
|
|
|
<view v-else-if="info.status===3">
|
|
|
|
<view v-else-if="info.status===3">
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-content">{{info.reason?info.reason:back_tip}}</view>
|
|
|
|
<view class="wrap-status-content">{{info.reason?info.reason:back_tip}}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 主动放弃 -->
|
|
|
|
<!-- 主动放弃 -->
|
|
|
|
<view v-else-if="info.status===5">
|
|
|
|
<view v-else-if="info.status===5">
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-content">{{info.giveup_reason?info.giveup_reason:'您已主动放弃该课程。'}}</view>
|
|
|
|
<view class="wrap-status-content">{{info.giveup_reason?info.giveup_reason:'您已主动放弃该课程。'}}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 已取消 -->
|
|
|
|
<!-- 已取消 -->
|
|
|
|
<view v-else-if="info.status===4">
|
|
|
|
<view v-else-if="info.status===4">
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-name">{{userInfo.username}}:</view>
|
|
|
|
<view class="wrap-status-content">您已取消该课程报名。</view>
|
|
|
|
<view class="wrap-status-content">您已取消该课程报名。</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="wrap-img">
|
|
|
|
<view class="wrap-img">
|
|
|
|
@ -51,7 +51,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 我要放弃 -->
|
|
|
|
<!-- 我要放弃 -->
|
|
|
|
<u-modal v-model="showCancel" negative-top="400"
|
|
|
|
<u-modal v-model="showCancel" negative-top="400"
|
|
|
|
:show-cancel-button="false" :show-confirm-button="false" :show-title="false">
|
|
|
|
:show-cancel-button="false" :show-confirm-button="false" :show-title="false">
|
|
|
|
<view class="slot-content">
|
|
|
|
<view class="slot-content">
|
|
|
|
<view class="slot-content-title">提示</view>
|
|
|
|
<view class="slot-content-title">提示</view>
|
|
|
|
@ -135,52 +135,94 @@
|
|
|
|
if (this.base.isNull(this.form.giveup_reason)) {
|
|
|
|
if (this.base.isNull(this.form.giveup_reason)) {
|
|
|
|
this.base.toast("请输入放弃原因")
|
|
|
|
this.base.toast("请输入放弃原因")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$u.api.courseUpdateSign({
|
|
|
|
this.$u.api.courseUpdateSign({
|
|
|
|
id:this.info.id,
|
|
|
|
id:this.info.id,
|
|
|
|
giveup_reason:this.form.giveup_reason,
|
|
|
|
giveup_reason:this.form.giveup_reason,
|
|
|
|
status:5
|
|
|
|
status:5
|
|
|
|
}).then(res => {
|
|
|
|
}).then(res => {
|
|
|
|
that.base.toast("已放弃课程", 1500, function() {
|
|
|
|
that.base.toast("已放弃课程", 1500, function() {
|
|
|
|
that.showCancel = false
|
|
|
|
that.showCancel = false
|
|
|
|
setTimeout(function() {
|
|
|
|
setTimeout(function() {
|
|
|
|
uni.redirectTo({
|
|
|
|
uni.redirectTo({
|
|
|
|
url:"/packages/mycourse/index"
|
|
|
|
url:"/packages/mycourse/index"
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}, 1500)
|
|
|
|
}, 1500)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
openFiles(files) {
|
|
|
|
openFiles(files) {
|
|
|
|
console.log("files", files)
|
|
|
|
console.log("files", files)
|
|
|
|
let that = this
|
|
|
|
if (!files || files.length === 0) {
|
|
|
|
uni.downloadFile({
|
|
|
|
return
|
|
|
|
url: files[0].url,
|
|
|
|
}
|
|
|
|
success: function(res) {
|
|
|
|
|
|
|
|
if (res.statusCode === 200) {
|
|
|
|
const file = files[0]
|
|
|
|
console.log("临时路径", res.tempFilePath)
|
|
|
|
const fileUrl = file.url || file.path || ''
|
|
|
|
let filePath = res.tempFilePath
|
|
|
|
|
|
|
|
//调用uni.openDocument打开文件
|
|
|
|
// 判断是否为图片文件
|
|
|
|
uni.openDocument({
|
|
|
|
const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.webp', '.svg']
|
|
|
|
filePath: filePath,
|
|
|
|
const isImage = imageExtensions.some(ext => {
|
|
|
|
success: function(res) {
|
|
|
|
const lowerUrl = fileUrl.toLowerCase()
|
|
|
|
console.log("打开文档成功");
|
|
|
|
return lowerUrl.includes(ext) || lowerUrl.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)(\?|$)/i)
|
|
|
|
},
|
|
|
|
|
|
|
|
fail: function(res) {
|
|
|
|
|
|
|
|
console.log("uni.openDocument,fail");
|
|
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
complete: function(res) {
|
|
|
|
|
|
|
|
console.log("uni.openDocument,complete");
|
|
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
fail: function(err) {
|
|
|
|
|
|
|
|
console.log('文件下载失败', err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isImage) {
|
|
|
|
|
|
|
|
// 如果是图片,使用预览功能
|
|
|
|
|
|
|
|
const urls = files.map(f => f.url || f.path).filter(Boolean)
|
|
|
|
|
|
|
|
uni.previewImage({
|
|
|
|
|
|
|
|
urls: urls,
|
|
|
|
|
|
|
|
current: fileUrl,
|
|
|
|
|
|
|
|
success: function(res) {
|
|
|
|
|
|
|
|
console.log("预览图片成功");
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
fail: function(err) {
|
|
|
|
|
|
|
|
console.log("预览图片失败", err);
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: '预览图片失败',
|
|
|
|
|
|
|
|
icon: 'none'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 如果是其他文件,下载后打开
|
|
|
|
|
|
|
|
let that = this
|
|
|
|
|
|
|
|
uni.downloadFile({
|
|
|
|
|
|
|
|
url: fileUrl,
|
|
|
|
|
|
|
|
success: function(res) {
|
|
|
|
|
|
|
|
if (res.statusCode === 200) {
|
|
|
|
|
|
|
|
console.log("临时路径", res.tempFilePath)
|
|
|
|
|
|
|
|
let filePath = res.tempFilePath
|
|
|
|
|
|
|
|
//调用uni.openDocument打开文件
|
|
|
|
|
|
|
|
uni.openDocument({
|
|
|
|
|
|
|
|
filePath: filePath,
|
|
|
|
|
|
|
|
success: function(res) {
|
|
|
|
|
|
|
|
console.log("打开文档成功");
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
fail: function(res) {
|
|
|
|
|
|
|
|
console.log("uni.openDocument,fail");
|
|
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: '打开文件失败',
|
|
|
|
|
|
|
|
icon: 'none'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
complete: function(res) {
|
|
|
|
|
|
|
|
console.log("uni.openDocument,complete");
|
|
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
fail: function(err) {
|
|
|
|
|
|
|
|
console.log('文件下载失败', err)
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: '文件下载失败',
|
|
|
|
|
|
|
|
icon: 'none'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -202,34 +244,34 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.slot-content {
|
|
|
|
.slot-content {
|
|
|
|
padding: 30rpx;
|
|
|
|
padding: 30rpx;
|
|
|
|
padding-top:20rpx;
|
|
|
|
padding-top:20rpx;
|
|
|
|
&>view{
|
|
|
|
&>view{
|
|
|
|
padding-top:20rpx;
|
|
|
|
padding-top:20rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&-title{
|
|
|
|
&-title{
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&-tip{
|
|
|
|
&-tip{
|
|
|
|
text-indent: 2em;
|
|
|
|
text-indent: 2em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&-btn{
|
|
|
|
&-btn{
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
justify-content: space-between;
|
|
|
|
&>view {
|
|
|
|
&>view {
|
|
|
|
width: 40%;
|
|
|
|
width: 40%;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
margin: 0 auto;
|
|
|
|
margin: 0 auto;
|
|
|
|
color: #fff;
|
|
|
|
color: #fff;
|
|
|
|
background: linear-gradient(to right, #5e5fbc, #0d0398);
|
|
|
|
background: linear-gradient(to right, #5e5fbc, #0d0398);
|
|
|
|
border-radius: 30rpx;
|
|
|
|
border-radius: 30rpx;
|
|
|
|
padding: 10rpx;
|
|
|
|
padding: 10rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&>view:first-child{
|
|
|
|
&>view:first-child{
|
|
|
|
background: #ddd;
|
|
|
|
background: #ddd;
|
|
|
|
color:#333
|
|
|
|
color:#333
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|