更新修改

master
lion 1 year ago
parent 8543f6a2be
commit 55994c3910

@ -151,29 +151,35 @@
console.log("success", data, index, lists, name, item) console.log("success", data, index, lists, name, item)
}, },
onUploaded(lists, name, item) { onUploaded(lists, name, item) {
let arr = [] let arr = []
let arrid = []
if (lists.length > 0) { if (lists.length > 0) {
this.base.toast("全部上传成功") this.base.toast("全部上传成功")
lists.map(item => { lists.map(item => {
arr.push(item.response.url.replace(baseUrl, '')) arr.push(item.response.url.replace(baseUrl, ''))
arrid.push(item.response)
}) })
} }
this.course_forms.map(item1 => { this.course_forms.map(item1 => {
if (item1.field === item.field) { if (item1.field === item.field) {
this.$set(item1, 'value', arr.join(",")) this.$set(item1, 'value', arr.join(","))
this.$set(item1, 'fileList', arrid)
} }
}) })
}, },
onRemove(index, lists, name, item) { onRemove(index, lists, name, item) {
let arr = [] let arr = []
let arrid = []
if (lists.length > 0) { if (lists.length > 0) {
lists.map(item => { lists.map(item => {
arr.push(item.response.url.replace(baseUrl, '')) arr.push(item.response.url.replace(baseUrl, ''))
arrid.push(item.response)
}) })
} }
this.course_forms.map(item1 => { this.course_forms.map(item1 => {
if (item1.field === item.field) { if (item1.field === item.field) {
this.$set(item1, 'value', arr.join(",")) this.$set(item1, 'value', arr.join(","))
this.$set(item1, 'fileList', arrid)
} }
}) })
}, },

@ -166,6 +166,9 @@
if(item.belong_user===1){ if(item.belong_user===1){
item.value = this.form[item.field] item.value = this.form[item.field]
} }
if(item.value===null){
item.value = ''
}
}) })
this.course_forms = res.course_forms.sort((a,b)=>(a.sort-b.sort)) this.course_forms = res.course_forms.sort((a,b)=>(a.sort-b.sort))
} }
@ -175,11 +178,12 @@
backForm(e) { backForm(e) {
let _arr = [] let _arr = []
e.map(item => { e.map(item => {
_arr.push({ // _arr.push({
name: item.name, // name: item.name,
field: item.field, // field: item.field,
value: item.value ? item.value : '' // value: item.value ? item.value : ''
}) // })
_arr.push(item)
// //
if (item.belong_user === 1 && !this.base.isNull(item.value)) { if (item.belong_user === 1 && !this.base.isNull(item.value)) {
this.form[item.field] = item.value this.form[item.field] = item.value

@ -1,77 +1,79 @@
<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="wrap"> <view class="wrap">
<u-form :model="form" ref="uForm" :label-width="140" :label-align="'left'" :error-type="['message']"> <u-form :model="form" ref="uForm" :label-width="140" :label-align="'left'" :error-type="['message']">
<u-form-item label="预约场地" prop="siteName" required> <u-form-item label="预约场地" prop="siteName" required>
<u-input :placeholder="'请选择'" v-model="form.siteName" type="select" @click="siteShow = true" /> <u-input :placeholder="'请选择'" v-model="form.siteName" type="select" @click="siteShow = true" />
</u-form-item> </u-form-item>
<u-form-item label="预约日期" prop="date" required> <u-form-item label="预约日期" prop="date" required>
<u-input :placeholder="'请选择'" v-model="form.date" :type="'select'" @click="dateShow = true" /> <u-input :placeholder="'请选择'" v-model="form.date" :type="'select'" @click="dateShow = true" />
</u-form-item> </u-form-item>
<u-form-item label="预约时间" prop="timeRange" required> <u-form-item label="预约时间" prop="timeRange" required>
<u-input :placeholder="'请选择'" v-model="form.timeRange" :type="'select'" @click="openTime" /> <u-input :placeholder="'请选择'" v-model="form.timeRange" :type="'select'" @click="openTime" />
</u-form-item> </u-form-item>
<u-form-item label="预约事项" prop="content" required> <u-form-item label="预约事项" prop="content" required>
<u-input :placeholder="'请输入预约事项'" v-model="form.content" type="textarea" /> <u-input :placeholder="'请输入预约事项'" v-model="form.content" type="textarea" />
</u-form-item> </u-form-item>
<u-form-item label="身份证号" prop="idcard" required> <u-form-item label="身份证号" prop="idcard" required>
<u-input :placeholder="'请输入身份证号'" v-model="form.idcard" type="idcard" /> <u-input :placeholder="'请输入身份证号'" v-model="form.idcard" type="idcard" />
</u-form-item> </u-form-item>
<u-form-item label="车牌" prop="plate"> <u-form-item label="车牌" prop="plate">
<u-button size="mini" type="primary" @click="openPlate(-1)"></u-button> <u-button size="mini" type="primary" @click="openPlate(-1)"></u-button>
<view v-for="(item,index) in plateList"> <view v-for="(item,index) in plateList">
<view v-if="plateList[index]['show']" style="display: flex;justify-content: space-between;align-items: center;"> <view v-if="plateList[index]['show']"
<u-input :placeholder="''" v-model="plateList[index]['plate']" :disabled="true" @click="openPlate(index)"/> style="display: flex;justify-content: space-between;align-items: center;">
<u-button size="mini" type="error" @click="delPlate(index)"></u-button> <u-input :placeholder="''" v-model="plateList[index]['plate']" :disabled="true"
</view> @click="openPlate(index)" />
</view> <u-button size="mini" type="error" @click="delPlate(index)"></u-button>
</u-form-item> </view>
<u-form-item label="同行人" prop="accompany"> </view>
<u-button size="mini" :disabled="isTotal" :type="isTotal?'':'primary'" @click="addAccompany"></u-button> </u-form-item>
<text v-if="siteTotal && siteTotal>0">{{siteTotal}}</text> <u-form-item label="同行人" prop="accompany">
<u-table> <u-button size="mini" :disabled="isTotal" :type="isTotal?'':'primary'"
<u-tr> @click="addAccompany">新增</u-button>
<u-th>姓名</u-th> <text v-if="siteTotal && siteTotal>0">{{siteTotal}}</text>
<u-th>操作</u-th> <u-table>
</u-tr> <u-tr>
<u-tr v-for="(item,index) in form.accompany"> <u-th>姓名</u-th>
<u-td>{{item.name}}</u-td> <u-th>操作</u-th>
<u-td> </u-tr>
<u-button size="mini" type="error" @click="delAccompany(index)"></u-button> <u-tr v-for="(item,index) in form.accompany">
</u-td> <u-td>{{item.name}}</u-td>
</u-tr> <u-td>
</u-table> <u-button size="mini" type="error" @click="delAccompany(index)"></u-button>
</u-form-item> </u-td>
</u-form> </u-tr>
</u-table>
<view class="form-btn"> </u-form-item>
<view @click="submit" type="primary">预约</view> </u-form>
</view>
<view class="form-btn">
<view @click="submit" type="primary">预约</view>
</view>
</view> </view>
<u-picker @confirm="dateConfirm" mode="time" v-model="dateShow" :params="dateParams"></u-picker> <u-picker @confirm="dateConfirm" mode="time" v-model="dateShow" :params="dateParams"></u-picker>
<timeSlot ref="timeslot" :title="'选择时间段'" <timeSlot ref="timeslot" :title="'选择时间段'" :min="hMin" :max="hMax" @confirm="confirmTime"></timeSlot>
:min="hMin" :max="hMax"
@confirm="confirmTime"></timeSlot>
<u-picker @confirm="siteConfirm" v-model="siteShow" :range="siteList" range-key="name" <u-picker @confirm="siteConfirm" v-model="siteShow" :range="siteList" range-key="name"
mode="selector"></u-picker> mode="selector"></u-picker>
<!-- 新增车牌 --> <!-- 新增车牌 -->
<view class="modal"> <view class="modal">
<u-popup v-model="showPlate" mode="bottom"> <u-popup v-model="showPlate" mode="bottom">
<view class="modal-tip">车牌号</view> <view class="modal-tip">车牌号</view>
<view class="modal-content" style="height:400rpx"> <view class="modal-content" style="height:400rpx">
<plate ref="plates" @listenPlateChange="(val)=>{plateChange(val,index)}" :defaultPlate="plateNumber" /> <plate ref="plates" @listenPlateChange="(val)=>{plateChange(val,index)}"
</view> :defaultPlate="plateNumber" />
<view class="form-btn" @click="confirmPlate"> </view>
<view type="primary">确认</view> <view class="form-btn" @click="confirmPlate">
</view> <view type="primary">确认</view>
</u-popup> </view>
</u-popup>
</view> </view>
<!-- 新增修改同行人 --> <!-- 新增修改同行人 -->
<view class="modal"> <view class="modal">
@ -85,31 +87,47 @@
</view> </view>
<view class="modal-content"> <view class="modal-content">
手机号<u-input type="number" :placeholder="'请输入手机号'" v-model="accompanyObj.mobile" /> 手机号<u-input type="number" :placeholder="'请输入手机号'" v-model="accompanyObj.mobile" />
</view> </view>
<view class="form-btn"> <view class="form-btn">
<view @click="submitAccompany" type="primary">提交</view> <view @click="submitAccompany" type="primary">提交</view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
<!-- 预约须知 -->
<u-modal v-model="showTips" negative-top="400" :show-cancel-button="false" :show-confirm-button="false"
:show-title="false">
<view class="slot-content">
<view class="slot-content-title">预约须知</view>
<view class="slot-content-input">
<view>1使用权限仅限校友本人使用不可代为预约否则取消预约资格</view>
<view>2图书馆禁止饮食抽烟</view>
</view>
<view class="slot-content-btn" style="padding-top:30rpx">
<view @click="confirmTips = true,showTips=false">我已知晓</view>
</view>
</view>
</u-modal>
</view> </view>
</template> </template>
<script> <script>
import timeSlot from "@/components/wanghexu-timeslot/wanghexu-timeslot.vue" import timeSlot from "@/components/wanghexu-timeslot/wanghexu-timeslot.vue"
import { import {
plate plate
} from '@/components/plate/index.vue' } from '@/components/plate/index.vue'
export default { export default {
components: { components: {
timeSlot, timeSlot,
plate plate
}, },
data() { data() {
return { return {
dateShow: false, dateShow: false,
hMin:0, showTips: false,
hMax:24, confirmTips: false,
appoinementType:'', hMin: 0,
hMax: 24,
appoinementType: '',
dateParams: { dateParams: {
year: true, year: true,
month: true, month: true,
@ -117,26 +135,26 @@
hour: false, hour: false,
minute: false, minute: false,
second: false second: false
}, },
showPlate:false, showPlate: false,
plateIndex:-1, plateIndex: -1,
plateList:[], plateList: [],
plateNumber: ['苏', 'E', '', '', '', '', ''], plateNumber: ['苏', 'E', '', '', '', '', ''],
form: { form: {
date: '', date: '',
timeRange: '', timeRange: '',
start_time: '', start_time: '',
end_time: '', end_time: '',
content: '', content: '',
idcard:'', idcard: '',
site: "", site: "",
siteName: '', siteName: '',
accompany: [] accompany: []
}, },
siteShow: false, siteShow: false,
siteList: [], siteList: [],
siteTotal:0, siteTotal: 0,
isTotal:false, isTotal: false,
accompanyShow: false, accompanyShow: false,
accompanyObj: { accompanyObj: {
name: '', name: '',
@ -149,52 +167,52 @@
required: true, required: true,
message: '请选择预约日期', message: '请选择预约日期',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}], }],
content: [{ content: [{
required: true, required: true,
message: '请输入预约事项', message: '请输入预约事项',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}], }],
idcard: [{ idcard: [{
required: true, required: true,
message: '请输入身份证号', message: '请输入身份证号',
trigger: ['blur'], trigger: ['blur'],
}, { }, {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
return this.$u.test.idCard(value); return this.$u.test.idCard(value);
}, },
message: '身份证号不正确', message: '身份证号不正确',
trigger: ['blur'], trigger: ['blur'],
}], }],
timeRange: [{ timeRange: [{
required: true, required: true,
message: '请选择预约时段', message: '请选择预约时段',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}], }],
siteName: [{ siteName: [{
required: true, required: true,
message: '请选择预约场地', message: '请选择预约场地',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}], }],
}, },
} }
}, },
onReady() { onReady() {
this.$refs.uForm.setRules(this.rules); this.$refs.uForm.setRules(this.rules);
}, },
onLoad(options) { onLoad(options) {
this.appoinementType = options.type?options.type:'' this.appoinementType = options.type ? options.type : ''
this.getUser() this.getUser()
this.getSites() this.getSites()
}, },
methods: { methods: {
getUser() { getUser() {
this.$u.api.user().then(res => { this.$u.api.user().then(res => {
console.log("res", res) console.log("res", res)
this.form.idcard = res.user.idcard this.form.idcard = res.user.idcard
this.$u.vuex('vuex_user', res.user) this.$u.vuex('vuex_user', res.user)
}) })
}, },
// //
dateConfirm(e) { dateConfirm(e) {
@ -207,162 +225,166 @@
this.$refs.timeslot.open() this.$refs.timeslot.open()
}, },
// //
confirmTime(e) { confirmTime(e) {
// //
// //
let nowTime = this.$moment().format("HH:mm") let nowTime = this.$moment().format("HH:mm")
console.log("nowtime",nowTime) console.log("nowtime", nowTime)
this.form.timeRange = e.start.hour + ":" + e.start.min + '~' + e.end.hour + ":" + e.end.min this.form.timeRange = e.start.hour + ":" + e.start.min + '~' + e.end.hour + ":" + e.end.min
this.form.start_time = e.start.hour + ":" + e.start.min this.form.start_time = e.start.hour + ":" + e.start.min
this.form.end_time = e.end.hour + ":" + e.end.min this.form.end_time = e.end.hour + ":" + e.end.min
}, },
// //
getSites() { getSites() {
this.$u.api.otherConfig({ this.$u.api.otherConfig({
appointment_type_id:this.appoinementType appointment_type_id: this.appoinementType
}).then(res => { }).then(res => {
this.siteList = res.appointment.filter(item=>item.status===1) this.siteList = res.appointment.filter(item => item.status === 1)
if(this.siteList.length===0){ if (this.siteList.length === 0) {
this.base.toast("当前没有场地可以预约") this.base.toast("当前没有场地可以预约")
}else{ } else {
this.siteList = this.siteList.sort((a, b) => a['sort'] - b['sort']); this.siteList = this.siteList.sort((a, b) => a['sort'] - b['sort']);
} }
}) })
}, },
siteConfirm(e) { siteConfirm(e) {
this.form.site = this.siteList[e[0]].id this.form.site = this.siteList[e[0]].id
this.form.siteName = this.siteList[e[0]].name this.form.siteName = this.siteList[e[0]].name
this.siteTotal = this.siteList[e[0]].total this.siteTotal = this.siteList[e[0]].total
if(this.siteList[e[0]].start_time){ if (this.siteList[e[0]].start_time) {
let _arr = this.siteList[e[0]].start_time.split(":") let _arr = this.siteList[e[0]].start_time.split(":")
this.hMin = parseInt(_arr[0]) this.hMin = parseInt(_arr[0])
let _arr1 = this.siteList[e[0]].end_time.split(":") let _arr1 = this.siteList[e[0]].end_time.split(":")
this.hMax = parseInt(_arr1[0]) this.hMax = parseInt(_arr1[0])
console.log(this.hMin,this.hMax) console.log(this.hMin, this.hMax)
} }
}, },
plateChange(val,index) { plateChange(val, index) {
console.log(val,this.plateIndex) console.log(val, this.plateIndex)
if(val.length>=7){ if (val.length >= 7) {
this.plateList[this.plateIndex]['plate'] = val.join("") this.plateList[this.plateIndex]['plate'] = val.join("")
} }
console.log(this.plateList[this.plateIndex]) console.log(this.plateList[this.plateIndex])
}, },
openPlate(index){ openPlate(index) {
if(index===-1){ if (index === -1) {
this.showPlate=true this.showPlate = true
this.plateList.push({ this.plateList.push({
plate:'', plate: '',
show:false show: false
}) })
this.plateIndex= this.plateList.length-1 this.plateIndex = this.plateList.length - 1
}else{ } else {
this.showPlate=true this.showPlate = true
this.plateNumber = this.plateList[index]['plate'] this.plateNumber = this.plateList[index]['plate']
this.plateIndex = index this.plateIndex = index
} }
}, },
delPlate(index){ delPlate(index) {
this.plateList.splice(index,1) this.plateList.splice(index, 1)
}, },
confirmPlate(){ confirmPlate() {
console.log("this.plateList[this.plateIndex]",this.plateList[this.plateIndex]) console.log("this.plateList[this.plateIndex]", this.plateList[this.plateIndex])
console.log(this.plateList[this.plateIndex]['plate']) console.log(this.plateList[this.plateIndex]['plate'])
console.log(this.plateList[this.plateIndex]['plate'].length<7) console.log(this.plateList[this.plateIndex]['plate'].length < 7)
if(!this.plateList[this.plateIndex]){ if (!this.plateList[this.plateIndex]) {
this.base.toast("请输入车牌号") this.base.toast("请输入车牌号")
return return
} }
if(this.base.isNull(this.plateList[this.plateIndex]['plate']) if (this.base.isNull(this.plateList[this.plateIndex]['plate']) ||
|| this.plateList[this.plateIndex]['plate'].length<7){ this.plateList[this.plateIndex]['plate'].length < 7) {
this.base.toast("请输入正确的车牌号") this.base.toast("请输入正确的车牌号")
return return
} }
this.showPlate=false this.showPlate = false
this.plateList[this.plateIndex]['show'] = true this.plateList[this.plateIndex]['show'] = true
this.plateIndex= -1 this.plateIndex = -1
this.$refs.plates.panelReset() this.$refs.plates.panelReset()
this.plateNumber = ['苏', 'E', '', '', '', '', ''] this.plateNumber = ['苏', 'E', '', '', '', '', '']
}, },
// //
addAccompany() { addAccompany() {
this.accompanyShow = true this.accompanyShow = true
}, },
submitAccompany() { submitAccompany() {
if(this.base.isNull(this.accompanyObj.name)){ if (this.base.isNull(this.accompanyObj.name)) {
this.base.toast("请输入陪同人姓名") this.base.toast("请输入陪同人姓名")
return return
} }
if(this.base.isNull(this.accompanyObj.idcard)){ if (this.base.isNull(this.accompanyObj.idcard)) {
this.base.toast("请输入陪同人身份证") this.base.toast("请输入陪同人身份证")
return return
}else{ } else {
if(!this.$u.test.idCard(this.accompanyObj.idcard)){ if (!this.$u.test.idCard(this.accompanyObj.idcard)) {
this.base.toast("陪同人身份证不正确") this.base.toast("陪同人身份证不正确")
return return
} }
} }
if(this.base.isNull(this.accompanyObj.mobile)){ if (this.base.isNull(this.accompanyObj.mobile)) {
this.base.toast("请输入陪同人联系方式") this.base.toast("请输入陪同人联系方式")
return return
}else{ } else {
if(!this.$u.test.mobile(this.accompanyObj.mobile)){ if (!this.$u.test.mobile(this.accompanyObj.mobile)) {
this.base.toast("陪同人联系方式不正确") this.base.toast("陪同人联系方式不正确")
return return
} }
} }
this.form.accompany.push(this.accompanyObj) this.form.accompany.push(this.accompanyObj)
this.accompanyIndex = -1 this.accompanyIndex = -1
this.accompanyObj = {} this.accompanyObj = {}
this.accompanyShow = false this.accompanyShow = false
if(this.siteTotal && this.siteTotal>0){ if (this.siteTotal && this.siteTotal > 0) {
if(this.form.accompany.length===this.siteTotal-1){ if (this.form.accompany.length === this.siteTotal - 1) {
this.isTotal = true this.isTotal = true
} }
} }
}, },
delAccompany(index) { delAccompany(index) {
this.form.accompany.splice(index, 1) this.form.accompany.splice(index, 1)
}, },
submit() { submit() {
let start_time = '' let start_time = ''
let end_time = '' let end_time = ''
// this.$u.api.scheduleCheck({ // this.$u.api.scheduleCheck({
// site:this.siteList[e[0]].id // site:this.siteList[e[0]].id
// }).then(res=>{ // }).then(res=>{
// console.log("res",res) // console.log("res",res)
// }) // })
this.$refs.uForm.validate(valid => { this.$refs.uForm.validate(valid => {
if (valid) { if (valid) {
start_time = this.form.date + ' ' + this.form.start_time + ':00' if(!this.confirmTips){
end_time = this.form.date + ' ' + this.form.end_time + ':00' this.showTips = true
this.form.accompany_total = this.form.accompany.length return
console.log("accompany_total",this.plateList,this.form) }
let _plate = [] start_time = this.form.date + ' ' + this.form.start_time + ':00'
if(this.plateList.length>0){ end_time = this.form.date + ' ' + this.form.end_time + ':00'
if(this.plateList.length>this.form.accompany_total + 1){ this.form.accompany_total = this.form.accompany.length
this.base.toast("车辆数量已经大于预约人数了") console.log("accompany_total", this.plateList, this.form)
return let _plate = []
} if (this.plateList.length > 0) {
this.plateList.map(item=>{ if (this.plateList.length > this.form.accompany_total + 1) {
_plate.push(item.plate) this.base.toast("车辆数量已经大于预约人数了")
}) return
} }
this.form.plate = _plate.join(',') this.plateList.map(item => {
console.log("plate",this.form) _plate.push(item.plate)
})
}
this.form.plate = _plate.join(',')
console.log("plate", this.form)
// return // return
this.$u.api.scheduleSave({ this.$u.api.scheduleSave({
...this.form, ...this.form,
start_time:start_time, start_time: start_time,
end_time:end_time end_time: end_time
}).then(res => { }).then(res => {
this.newsSubscription() this.newsSubscription()
}) })
} else { } else {
@ -370,136 +392,177 @@
// this.base.toast("") // this.base.toast("")
} }
}); });
}, },
// //
newsSubscription() { newsSubscription() {
let that = this let that = this
uni.getSetting({ uni.getSetting({
withSubscriptions: true, //false withSubscriptions: true, //false
success(res) { success(res) {
console.log("resdfg", res) console.log("resdfg", res)
if (res.subscriptionsSetting.mainSwitch) { if (res.subscriptionsSetting.mainSwitch) {
if (res.subscriptionsSetting.itemSettings && res.subscriptionsSetting.itemSettings[ if (res.subscriptionsSetting.itemSettings && res.subscriptionsSetting.itemSettings[
'0WMaFZ_0FOS5gtxEAi-fM3pFcYPySRMwYFNASz9oig0'] === 'accept') { '0WMaFZ_0FOS5gtxEAi-fM3pFcYPySRMwYFNASz9oig0'] === 'accept') {
// //
that.base.toast("预约已提交",2000,function(){ that.base.toast("预约已提交", 1500, function() {
setTimeout(function(){ setTimeout(function() {
uni.redirectTo({ uni.redirectTo({
url:'/packages/mybook/index' url: '/packages/mybook/index'
}) })
},2000) }, 1000)
}) })
} else { } else {
// //
uni.showModal({ uni.showModal({
title: '订阅消息', title: '订阅消息',
content: '是否需要订阅预约结果消息', content: '是否需要订阅预约结果消息',
success(res1) { success(res1) {
if (res1.confirm) { if (res1.confirm) {
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: [ tmplIds: [
'0WMaFZ_0FOS5gtxEAi-fM3pFcYPySRMwYFNASz9oig0', '0WMaFZ_0FOS5gtxEAi-fM3pFcYPySRMwYFNASz9oig0',
], ],
success(res) { success(res) {
that.base.toast("预约已提交",2000,function(){ that.base.toast("预约已提交", 1500, function() {
setTimeout(function(){ setTimeout(function() {
uni.redirectTo({ uni.redirectTo({
url:'/packages/mybook/index' url: '/packages/mybook/index'
}) })
},2000) }, 1000)
}) })
}, },
fail(err) { fail(err) {
that.base.toast("预约已提交",2000,function(){ that.base.toast("预约已提交", 1500, function() {
setTimeout(function(){ setTimeout(function() {
uni.redirectTo({ uni.redirectTo({
url:'/packages/mybook/index' url: '/packages/mybook/index'
}) })
},2000) }, 1000)
}) })
} }
}) })
} else { } else {
that.base.toast("预约已提交",2000,function(){ that.base.toast("预约已提交", 1500, function() {
setTimeout(function(){ setTimeout(function() {
uni.redirectTo({ uni.redirectTo({
url:'/packages/mybook/index' url: '/packages/mybook/index'
}) })
},2000) }, 1000)
}) })
} }
} }
}) })
} }
} else { } else {
that.base.toast("预约已提交",2000,function(){ that.base.toast("预约已提交", 1500, function() {
setTimeout(function(){ setTimeout(function() {
uni.redirectTo({ uni.redirectTo({
url:'/packages/mybook/index' url: '/packages/mybook/index'
}) })
},2000) }, 1000)
}) })
// //
} }
} }
}); });
}, },
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container{ .container {
padding: 30rpx; padding: 30rpx;
width:100%; width: 100%;
height:100vh; height: 100vh;
.cbg {
position: absolute; .cbg {
top: 0; position: absolute;
left: 0; top: 0;
width: 100%; left: 0;
height: 100vh; width: 100%;
} height: 100vh;
.wrap{ }
background: #fff;
position: relative; .wrap {
padding: 35rpx; background: #fff;
border-radius: 30rpx; position: relative;
padding-top: 0; padding: 35rpx;
height: 100%; border-radius: 30rpx;
overflow: scroll; padding-top: 0;
} height: 100%;
.form-btn { overflow: scroll;
width: 100%; }
position: relative;
padding: 60rpx 0; .slot-content {
// z-index:9999; padding: 30rpx;
&>view { padding-top: 20rpx;
width: 70%;
text-align: center; &>view {
margin: 0 auto; padding-top: 20rpx;
color: #fff; }
background: linear-gradient(to right, #5e5fbc, #0d0398);
border-radius: 30rpx; &-title {
padding: 20rpx; text-align: center;
} }
}
.modal { &-input {
::v-deep .u-drawer-bottom { height: 300rpx;
border-radius: 40rpx; line-height: 1.6;
} overflow: scroll;
}
&-tip {
text-align: center; &-btn {
padding: 30rpx; display: flex;
font-size: 32rpx; align-items: center;
} justify-content: space-between;
padding: 30rpx 0;
&-content {
// height: 400rpx; &>view {
padding: 0 30rpx; width: 40%;
} text-align: center;
} margin: 0 auto;
color: #fff;
background: linear-gradient(to right, #5e5fbc, #0d0398);
border-radius: 30rpx;
padding: 10rpx;
}
}
}
.form-btn {
width: 100%;
position: relative;
padding: 60rpx 0;
// z-index:9999;
&>view {
width: 70%;
text-align: center;
margin: 0 auto;
color: #fff;
background: linear-gradient(to right, #5e5fbc, #0d0398);
border-radius: 30rpx;
padding: 20rpx;
}
}
.modal {
::v-deep .u-drawer-bottom {
border-radius: 40rpx;
}
&-tip {
text-align: center;
padding: 30rpx;
font-size: 32rpx;
}
&-content {
// height: 400rpx;
padding: 0 30rpx;
}
}
} }
</style> </style>

@ -12,14 +12,14 @@
<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:pass_tip}}</view> <view class="wrap-status-content">{{info.reason?info.reason:pass_tip}}</view>
<!-- v-if="courseInfo.is_fee===1 && info.fee_status!=1" --> <!-- v-if="courseInfo.is_fee===1 && info.fee_status!=1" -->
<view class="wrap-status-btn"> <view class="wrap-status-btn" v-if="info.files && info.files.length>0">
<view v-if="info.files && info.files.length>0" @click="openFiles(info.files)"></view> <view @click="openFiles(info.files)"></view>
</view> </view>
<view class="wrap-status-btn"> <view class="wrap-status-btn" v-if="courseInfo.is_fee===1 && info.fee_status!=1">
<view @click="toPay" v-if="courseInfo.is_fee===1 && info.fee_status!=1"></view> <view @click="toPay"></view>
</view> </view>
<view class="wrap-status-btn"> <view class="wrap-status-btn" @click="showCancel = true">
<view @click="showCancel = true">我要放弃</view> <view>我要放弃</view>
</view> </view>
</view> </view>
<view v-else-if="info.status===2"> <view v-else-if="info.status===2">
@ -121,7 +121,21 @@
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({
id:this.info.id,
giveup_reason:this.form.giveup_reason,
status:5
}).then(res => {
that.base.toast("已放弃课程", 1500, function() {
this.showCancel = false
setTimeout(function() {
uni.redirectTo({
url:"/packages/mycourse/index"
})
}, 500)
})
})
}, },
openFiles(files) { openFiles(files) {
console.log("files", files) console.log("files", files)

@ -3,7 +3,7 @@
<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">
<view v-if="teacher"> <view v-if="teacher">
<view class="teacher"> <view class="teacher" v-for="tea in teacher">
<view> <view>
<image style="width:97rpx;height:97rpx;margin-right:30rpx" <image style="width:97rpx;height:97rpx;margin-right:30rpx"
:src="base.imgHost('txl-teacher.png')"></image> :src="base.imgHost('txl-teacher.png')"></image>
@ -11,14 +11,14 @@
<view> <view>
<view class="teacher-name"> <view class="teacher-name">
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;">
<text>{{teacher.name}}</text> <text>{{tea.name}}</text>
<text class="courseName">班主任</text> <text class="courseName">班主任</text>
</view> </view>
</view> </view>
<view class="teacher-mobile"> <view class="teacher-mobile">
<image style="width:22rpx;height:22rpx;margin-right:20rpx" <image style="width:22rpx;height:22rpx;margin-right:20rpx"
:src="base.imgHost('txl-phone.png')"></image> :src="base.imgHost('txl-phone.png')"></image>
<view>{{teacher.mobile?teacher.mobile:''}}</view> <view>{{tea.mobile?tea.mobile:''}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -38,9 +38,9 @@
<text class="courseName">{{item.course_signs[0]['position']}}</text> <text class="courseName">{{item.course_signs[0]['position']}}</text>
</view> </view>
</view> </view>
<view class="teacher-company">{{item.company_name}}</view> <view class="teacher-company">{{item.company_name?item.company_name:''}}</view>
<view class="teacher-company">{{item.company_position}}</view> <view class="teacher-company">{{item.company_position?item.company_position:''}}</view>
<view v-if="show_mobile" class="teacher-company">{{item.mobile}}</view> <view v-if="show_mobile" class="teacher-company">{{item.mobile?item.mobile:''}}</view>
<!-- <view class="teacher-mobile"> <!-- <view class="teacher-mobile">
<view style="font-size:24rpx;color:#999;margin-bottom:10rpx">如需联系方式请联系班主任</view> <view style="font-size:24rpx;color:#999;margin-bottom:10rpx">如需联系方式请联系班主任</view>
</view> --> </view> -->
@ -69,7 +69,7 @@
data() { data() {
return { return {
list: [], list: [],
teacher: null, teacher: [],
studentList: [], studentList: [],
show_mobile: false, show_mobile: false,
} }

@ -46,17 +46,17 @@
</u-button> </u-button>
</view> </view>
<view class="list-item-btn"> <view class="list-item-btn">
<text @click="toUrl(item.id,3)" <text @click="toUrl(item,3)"
v-if="item.course_signs[0]['status']===1 && item.is_fee===0">进入</text> v-if="item.course_signs[0]['status']===1 && item.is_fee===0">进入</text>
<text @click="toUrl(item.id,1)" <text @click="toUrl(item,1)"
v-if="item.course_signs[0]['status']===1 && item.is_fee===1">进入</text> v-if="item.course_signs[0]['status']===1 && item.is_fee===1">进入</text>
<!-- 待审核 备选 --> <!-- 待审核 备选 -->
<text @click="cancelSign(item)" style="margin-right:20rpx;color:#999999" <text @click="cancelSign(item)" style="margin-right:20rpx;color:#999999"
v-if="item.course_signs[0]['status']===0||item.course_signs[0]['status']===3">取消报名</text> v-if="item.course_signs[0]['status']===0||item.course_signs[0]['status']===3">取消报名</text>
<text @click="toUrl(item.id,2)" <text @click="toUrl(item,2)"
v-if="item.course_signs[0]['status']===0||item.course_signs[0]['status']===3">查看进度</text> v-if="item.course_signs[0]['status']===0||item.course_signs[0]['status']===3">查看进度</text>
<!-- 审核不通过 --> <!-- 审核不通过 -->
<text @click="toUrl(item.id,2)" v-if="item.course_signs[0]['status']===2"></text> <text @click="toUrl(item,2)" v-if="item.course_signs[0]['status']===2"></text>
</view> </view>
</view> </view>
</view> </view>
@ -148,22 +148,29 @@
clickShareId(item) { clickShareId(item) {
this.shareObj = item this.shareObj = item
}, },
toUrl(id, type) { toUrl(item, type) {
// //
if (type === 1) { if (type === 1) {
uni.navigateTo({ uni.navigateTo({
url: '/packages/mycourse/detail?id=' + id url: '/packages/mycourse/detail?id=' + item.id
}) })
} else if (type === 2) { } else if (type === 2) {
// //
uni.navigateTo({ uni.navigateTo({
url: '/packages/mycourse/courseStatus?id=' + id url: '/packages/mycourse/courseStatus?id=' + item.id
}) })
} else if (type === 3) { } else if (type === 3) {
// //
uni.navigateTo({ //
url: '/packages/course/freeDetail?id=' + id if(!this.base.isNull(item.qun_image_id)){
}) uni.navigateTo({
url: '/packages/course/freeDetail?id=' + item.id
})
}else{
uni.navigateTo({
url: '/packages/mycourse/courseStatus?id=' + item.id
})
}
} }
}, },
@ -184,6 +191,17 @@
}, },
submitCancel(item){ submitCancel(item){
console.log("item",item) console.log("item",item)
let that = this
this.$u.api.courseUpdateSign({
id:item.course_signs[0].id,
status:4
}).then(res => {
that.base.toast("已取消课程", 1500, function() {
setTimeout(function() {
that.getMyCourse()
}, 500)
})
})
}, },
async getBannerList() { async getBannerList() {
const res = await this.$u.api.otherBanner({ const res = await this.$u.api.otherBanner({

@ -3,11 +3,11 @@
<image class="cbg" :src="base.imgHost('book-bg.png')"></image> <image class="cbg" :src="base.imgHost('book-bg.png')"></image>
<view class="schoolmate btn"> <view class="schoolmate btn">
<image mode="widthFix" @click="toUrl(2)" :src="base.imgHost('book-schoolmate1.png')"></image> <image mode="widthFix" @click="toUrl(2)" :src="base.imgHost('book-schoolmate1.png')"></image>
<view>加入我们</view> <!-- <view>加入我们</view> -->
</view> </view>
<view class="book btn"> <view class="book btn">
<image mode="widthFix" @click="toUrl(1)" :src="base.imgHost('book-book1.png')"></image> <image mode="widthFix" @click="toUrl(1)" :src="base.imgHost('book-book1.png')"></image>
<view>立即预约</view> <!-- <view>立即预约</view> -->
</view> </view>
<tabbar :currentPage="2"></tabbar> <tabbar :currentPage="2"></tabbar>
</view> </view>
@ -78,7 +78,10 @@
url: '/packages/schoolmate/index' url: '/packages/schoolmate/index'
}) })
} else { } else {
this.base.toast("您还不是校友,无权查看") this.base.toast("您还不是校友,无权查看")
uni.switchTab({
url: '/pages/course/index'
})
} }
} }

@ -3,7 +3,8 @@
<image class="cbg" :src="base.imgHost('common_bg.png')"></image> <image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<!-- <view> --> <!-- <view> -->
<scroll-view :scroll-y="true" @scrolltolower="scrollGet" class="list"> <scroll-view :scroll-y="true" @scrolltolower="scrollGet" class="list">
<topBanner v-if="banner_list.length>0" :banner_list="banner_list"></topBanner> <!-- <topBanner v-if="banner_list.length>0" :banner_list="banner_list"></topBanner> -->
<image @click="goCourse" class="list-img" :src="base.imgHost('course-top.png')"></image>
<view v-if="hasData" style="padding-bottom: 200rpx;"> <view v-if="hasData" style="padding-bottom: 200rpx;">
<!-- 10进行中 40已结束 --> <!-- 10进行中 40已结束 -->
<view class="list-item" :class="{'list-end':item.sign_status===40}" v-for="item in course_list"> <view class="list-item" :class="{'list-end':item.sign_status===40}" v-for="item in course_list">
@ -129,7 +130,7 @@
} }
}, },
onLoad() { onLoad() {
this.getBannerList() // this.getBannerList()
this.getCourseList() this.getCourseList()
}, },
@ -147,7 +148,12 @@
}, },
methods: { methods: {
goCourse(){
uni.navigateTo({
url:'/packages/mycourse/index'
})
},
scrollGet() { scrollGet() {
if (!this.hasData) { if (!this.hasData) {
return return
@ -293,7 +299,8 @@
.list { .list {
height: 100vh; height: 100vh;
padding:30rpx 0;
position: relative; position: relative;
top: 0; top: 0;
left: 0; left: 0;
@ -305,7 +312,12 @@
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
&-img {
width: calc(100% - 60rpx);
height: 125rpx;
display: block;
margin: 0 auto;
}
&-item { &-item {
margin: 30rpx; margin: 30rpx;
background-color: #fff; background-color: #fff;

@ -17,14 +17,14 @@
<view class="container-content"> <view class="container-content">
<image :src="base.imgHost('index_bg.png')" width="100%" height="100%"></image> <image :src="base.imgHost('index_bg.png')" width="100%" height="100%"></image>
<view class="container-content-icons"> <view class="container-content-icons">
<view @click="tourl(1)">
<image :src="base.imgHost('index_icon2.png')"></image>
</view>
<view @click="tourl(2)"> <view @click="tourl(2)">
<image :src="base.imgHost('index_icon3.png')"></image> <image :src="base.imgHost('index_icon3.png')"></image>
</view> </view>
<view @click="tourl(3)"> <view @click="tourl(3)">
<image :src="base.imgHost('index_icon4.png')"></image> <image :src="base.imgHost('index_icon4.png')"></image>
</view>
<view @click="tourl(1)">
<image :src="base.imgHost('index_icon21.png')"></image>
</view> </view>
</view> </view>
@ -180,8 +180,11 @@
}, },
tourl(type, url) { tourl(type, url) {
if (type === 1) { if (type === 1) {
uni.navigateTo({ // uni.navigateTo({
url: '/packages/webview/index?type=1' // url: '/packages/webview/index?type=1'
// })
uni.navigateTo({
url:'/packages/mycourse/index'
}) })
} else if (type === 2) { } else if (type === 2) {
uni.switchTab({ uni.switchTab({

@ -15,7 +15,7 @@
</view> </view>
<view class="usersigns" v-if="course_signs.length>0"> <view class="usersigns" v-if="course_signs.length>0">
<text>学籍</text> <text>学籍</text>
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text> <text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</view> </view>
</view> </view>
<view class="usercode"> <view class="usercode">
@ -87,7 +87,7 @@
<view class="modal-wrap" v-if="showCard"> <view class="modal-wrap" v-if="showCard">
<view class="modal-image"> <view class="modal-image">
<view class="modal-close" @click="showCard = false">X</view> <view class="modal-close" @click="showCard = false">X</view>
<image mode="widthFix" :src="base.imgHost('me-xyk.png')"></image> <image mode="widthFix" :src="base.imgHost('me-xyk1.png')"></image>
</view> </view>
<view class="modal-xyk"> <view class="modal-xyk">
@ -111,7 +111,7 @@
</view> </view>
<view class="modal-xyk-name-course" v-if="course_signs.length>0"> <view class="modal-xyk-name-course" v-if="course_signs.length>0">
<text>学籍</text> <text>学籍</text>
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text> <text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</view> </view>
</view> </view>

Loading…
Cancel
Save