master
lion 1 year ago
parent f3343826b9
commit f732459180

@ -25,7 +25,9 @@
course_forms: [],
sign_id: '', // id
opType: 'add', // edit
isLocked: false
isLocked: false,
change_data:[], // form
is_change:0
}
},
onReady() {
@ -60,7 +62,6 @@
this.course_forms = res.course_forms.sort((a, b) => (a.sort - b.sort))
}
this.is_fee = res.is_fee
},
//
async getSignDetail(id) {
@ -78,7 +79,9 @@
}
},
async backForm(e) {
let _arr = []
let _arr = []
let that = this
let change_data_arr = []
e.map(item => {
// _arr.push({
// name: item.name,
@ -87,24 +90,69 @@
// })
item.value = item.value ? item.value : ''
_arr.push(item)
//
if (item.belong_user === 1 && !this.base.isNull(item.value)) {
this.form[item.field] = item.value
// user
if (item.belong_user === 1 && !this.base.isNull(item.value)) {
if(this.form[item.field]!=item.value){
console.log('item.field',item.field)
change_data_arr.push({[item.field]:item.value})
}
// this.form[item.field] = item.value
}
})
this.apply_form = _arr
console.log("this.apply_form", this.apply_form, this.form)
this.apply_form = _arr
this.change_data = change_data_arr
console.log("this.apply_form", this.apply_form, this.form,this.change_data)
// return
if (this.isLocked) {
return
this.is_change = 0
if(this.change_data.length>0){
this.is_change = 1
if (that.isLocked) {
return
}
that.isLocked = true
uni.showModal({
title: '提示',
content:'您当前提交的报名信息与往期数据存在差异,是否确认继续提交报名?',
confirmText:'提交报名',
cancelText:'取消',
success: function(res) {
if(res.confirm){
// user
//is_change01
// change_data
// return
// await this.saveUser()
if (that.opType == 'edit') {
that.updateApplyCourse()
} else {
that.applyCourse()
}
}else{
that.isLocked = false
that.change_data = {}
that.is_change = 0
}
}
})
}else{
that.is_change = 0
if (that.isLocked) {
return
}
that.isLocked = true
// await this.saveUser()
if (that.opType == 'edit') {
that.updateApplyCourse()
} else {
that.applyCourse()
}
}
this.isLocked = true
await this.saveUser()
if (this.opType == 'edit') {
await this.updateApplyCourse()
} else {
await this.applyCourse()
}
},
async saveUser() {
let that = this
@ -121,12 +169,11 @@
},
async applyCourse() {
let that = this
// let that = this
await this.$u.api.courseSign({
course_id: this.course_id,
data: this.apply_form
data: this.apply_form,
change_data:this.change_data,
is_change:this.is_change
}).then(res => {
if (this.is_fee) {
this.newsSubscription()
@ -150,7 +197,9 @@
let that = this
this.$u.api.courseUpdateSign({
id: this.sign_id,
data: this.apply_form
data: this.apply_form,
change_data:this.change_data,
is_change:this.is_change
}).then(res => {
that.base.toast("修改成功", 1500, function() {
setTimeout(function() {

@ -37,20 +37,20 @@
}
},
onShareAppMessage(res) {
return {
path: "/packages/course/freeDetail?id=" + this.course_id, // onload(data){let id=data.id;}
title: this.info.name,
imageUrl: '/static/share.jpg'
}
},
onShareTimeline() {
return {
path: "/packages/course/freeDetail?id=" + this.course_id, // onload(data){let id=data.id;}
title: this.info.name,
imageUrl: '/static/share.jpg'
}
},
// onShareAppMessage(res) {
// return {
// path: "/packages/course/freeDetail?id=" + this.course_id, // onload(data){let id=data.id;}
// title: this.info.name,
// imageUrl: '/static/share.jpg'
// }
// },
// onShareTimeline() {
// return {
// path: "/packages/course/freeDetail?id=" + this.course_id, // onload(data){let id=data.id;}
// title: this.info.name,
// imageUrl: '/static/share.jpg'
// }
// },
onLoad(options) {
this.course_id = options.id
let token = uni.getStorageSync('stbc1_lifeData') ? uni.getStorageSync('stbc1_lifeData').vuex_token : ''

@ -37,7 +37,12 @@
<view class="left-item-card-name">
<view>
<text style="font-size:32rpx;color:#000">{{mess.name}}</text>
<text class="courseName" v-if="mess.position">{{mess.position}}</text>
<block v-if="mess.course_signs">
<text class="courseName" v-if="mess.course_signs[0].position">
{{mess.course_signs[0].position?mess.course_signs[0].position:''}}
</text>
</block>
</view>
</view>
<view v-if="mess['company_name']"

@ -9,11 +9,10 @@
data(){
return{
link:'',
baseUrl:'https://szsatbc2024.115.langye.net'
baseUrl:'https://www.sstbc.com'
}
},
onLoad(options) {
// http://szsatbc2024.115.langye.net
if(options.type==1){
//
this.link = this.baseUrl+'/about/aboutinfo/?from=wx'

@ -23,7 +23,7 @@
return {
user: {},
can_appointment: false,
is_schoolmate: 0,
enter_schoolmate: 0,
door_appointments: false, //
}
},
@ -48,7 +48,7 @@
getUser() {
this.$u.api.user().then(res => {
console.log("res", res)
this.is_schoolmate = res.user.is_schoolmate
this.enter_schoolmate = res.enter_schoolmate
if (res.user.appointment_total - res.user.pass_appointments > 0) {
this.can_appointment = true
} else {
@ -60,19 +60,22 @@
},
async toUrl(type) {
if (type === 1) {
await this.$u.api.user().then(res => {
if (res.user.appointment_total - res.user.pass_appointments > 0) {
this.can_appointment = true
uni.navigateTo({
url: '/packages/booksubmit/appointment'
})
} else {
this.can_appointment = false
this.base.toast("您当前没有可预约次数")
}
})
uni.navigateTo({
url: '/packages/booksubmit/appointment'
})
// await this.$u.api.user().then(res => {
// if (res.user.appointment_total - res.user.pass_appointments > 0) {
// this.can_appointment = true
// uni.navigateTo({
// url: '/packages/booksubmit/appointment'
// })
// } else {
// this.can_appointment = false
// this.base.toast("")
// }
// })
} else if (type === 2) {
if (this.is_schoolmate) {
if (this.enter_schoolmate) {
uni.navigateTo({
url: '/packages/schoolmate/index'
})

@ -189,13 +189,38 @@
this.banner_list = [{}]
}
},
async getNoticesList() {
const res = await this.$u.api.courseNews({
page: 1,
page_size: 5,
async getNoticesList() {
const baseUrl = "https://www.sstbc.com"
let that = this
// const res = await this.$u.api.courseNews({
// page: 1,
// page_size: 5,
// })
// this.notices_list = res.rows
let _arr = []
uni.request({
url:baseUrl+'/e/extend/news.php',
data:{
page:1,
pagesize:5
},
success(res){
console.log("res",res)
if(res.statusCode===200){
if(res.data.rows.length>0){
res.data.rows.map(item=>{
item.titlepic = baseUrl+item.titlepic
})
}
_arr = res.data.rows
}
that.notices_list = _arr
console.log("this.notices_list",that.notices_list)
},
fail(err){
console.log("err",err)
}
})
this.notices_list = res.rows
},
async tourl(type, url) {
if (type === 1) {

Loading…
Cancel
Save