修改意见

master
lion 1 year ago
parent 2b09eb5395
commit 2b1f373026

@ -252,7 +252,7 @@
let valueArr = [] let valueArr = []
let fileListArr = [] let fileListArr = []
console.log("item.fileListArr",item.fileListArr) console.log("item.fileListArr",item.fileListArr)
if(item.fileListArr.length>0){ if(item.fileListArr && item.fileListArr.length>0){
item.fileListArr.map(f=>{ item.fileListArr.map(f=>{
if(f.response){ if(f.response){
valueArr.push(f.response.url.replace(baseUrl, '')) valueArr.push(f.response.url.replace(baseUrl, ''))
@ -262,6 +262,8 @@
fileListArr.push(f) fileListArr.push(f)
} }
}) })
}else{
item.fileListArr = []
} }
item.value = valueArr.join(",") item.value = valueArr.join(",")
item.fileList = fileListArr item.fileList = fileListArr

@ -22,9 +22,10 @@
is_fee: 0, // is_fee: 0, //
form: {}, form: {},
apply_form: [], apply_form: [],
course_forms: [], course_forms: [],
sign_id:'', // id sign_id: '', // id
opType:'add', // edit opType: 'add', // edit
isLocked: false
} }
}, },
onReady() { onReady() {
@ -32,8 +33,8 @@
}, },
onLoad(options) { onLoad(options) {
this.course_id = options.id this.course_id = options.id
if (options.type === 'edit') { if (options.type === 'edit') {
this.opType = 'edit' this.opType = 'edit'
this.getSignDetail(options.id) this.getSignDetail(options.id)
} else { } else {
this.getCourseDetail(options.id) this.getCourseDetail(options.id)
@ -65,7 +66,7 @@
async getSignDetail(id) { async getSignDetail(id) {
const res = await this.$u.api.courseGetSign({ const res = await this.$u.api.courseGetSign({
course_id: id course_id: id
}) })
this.sign_id = res.detail.id this.sign_id = res.detail.id
if (res.detail.data && res.detail.data.length > 0) { if (res.detail.data && res.detail.data.length > 0) {
res.detail.data.map(item => { res.detail.data.map(item => {
@ -93,23 +94,17 @@
}) })
this.apply_form = _arr this.apply_form = _arr
console.log("this.apply_form", this.apply_form, this.form) console.log("this.apply_form", this.apply_form, this.form)
// return // return
this.saveUser() if (this.isLocked) {
if(this.opType == 'edit'){ return
this.updateApplyCourse() }
}else{ this.isLocked = true
this.saveUser()
this.applyCourse() if (this.opType == 'edit') {
this.updateApplyCourse()
} else {
this.applyCourse()
} }
// this.$refs.uForm.validate(valid => {
// if (valid) {
// } else {
// console.log('');
// // this.base.toast("")
// }
// });
}, },
async saveUser() { async saveUser() {
let that = this let that = this
@ -119,11 +114,16 @@
// this.$u.api.user().then(res => { // this.$u.api.user().then(res => {
// this.$u.vuex('vuex_user', res.user) // this.$u.vuex('vuex_user', res.user)
// }) // })
}).catch(err => {
console.log("err", err)
that.isLocked = false
}) })
}, },
async applyCourse() { async applyCourse() {
let that = this let that = this
// let that = this // let that = this
await this.$u.api.courseSign({ await this.$u.api.courseSign({
course_id: this.course_id, course_id: this.course_id,
data: this.apply_form data: this.apply_form
@ -140,23 +140,29 @@
}) })
} }
}).catch(err => {
console.log("err", err)
that.isLocked = false
})
},
//
async updateApplyCourse() {
let that = this
this.$u.api.courseUpdateSign({
id: this.sign_id,
data: this.apply_form
}).then(res => {
that.base.toast("修改成功", 1500, function() {
setTimeout(function() {
uni.redirectTo({
url: '/packages/mycourse/index'
})
}, 500)
})
}).catch(err => {
console.log("err", err)
that.isLocked = false
}) })
},
//
async updateApplyCourse() {
let that = this
this.$u.api.courseUpdateSign({
id: this.sign_id,
data:this.apply_form
}).then(res => {
that.base.toast("修改成功", 1500, function() {
setTimeout(function() {
uni.redirectTo({
url: '/packages/mycourse/index'
})
}, 500)
})
})
}, },
// //

@ -1,10 +1,10 @@
<template> <template>
<view class="container"> <view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image> <image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="qrcode" @click="showBigCode = true" > <view class="qrcode" @click="showBigCode = true" v-if="myQrcode.qrcode">
<view class="qrcode-code"> <view class="qrcode-code">
<!-- myQrcode.qrcode --> <!-- myQrcode.qrcode -->
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="'123'" :sizeUnit="'rpx'" :size="110" :options="{ <uqrcode ref="uqrcode" canvas-id="qrcode" :value="myQrcode.qrcode" :sizeUnit="'rpx'" :size="110" :options="{
margin: 5, margin: 5,
foregroundImageSrc: '/static/index_icon1.png', foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode> }"></uqrcode>

@ -101,7 +101,9 @@
</u-popup> </u-popup>
</view> </view>
<!-- 预约须知 --> <!-- 预约须知 -->
<u-popup v-model="showTips" mode="bottom" border-radius="30rpx" :mask-close-able="false" class="configwrap"> <u-popup v-model="showTips" mode="bottom"
height="800rpx"
border-radius="30rpx" :mask-close-able="false" class="configwrap">
<view class="slot-content"> <view class="slot-content">
<!-- <view class="configtitle"> <!-- <view class="configtitle">
{{configInfo.name}} {{configInfo.name}}
@ -625,7 +627,7 @@
} }
.slot-content { .slot-content {
padding: 30rpx; padding: 40rpx;
padding-top: 20rpx; padding-top: 20rpx;
&>view { &>view {
@ -637,9 +639,9 @@
} }
&-input { &-input {
height: 700rpx; // height: 700rpx;
// line-height: 1.6; // // line-height: 1.6;
overflow: scroll; // overflow: scroll;
} }
&-btn { &-btn {

@ -100,7 +100,6 @@
this.hasMobile = false this.hasMobile = false
} }
this.getCourseDetail(this.course_id) this.getCourseDetail(this.course_id)
this.getCourseSign()
} }
}, },
onHide() { onHide() {
@ -135,7 +134,6 @@
that.hasMobile = false that.hasMobile = false
} }
that.getCourseDetail(that.course_id) that.getCourseDetail(that.course_id)
that.getCourseSign(that.course_id)
}, },
fail(err) { fail(err) {
console.log("err", err) console.log("err", err)
@ -170,9 +168,7 @@
} }
}); });
}, },
async getCourseSign() {
},
// //
// //
// //

Loading…
Cancel
Save