更新修改

master
lion 1 year ago
parent b1440c7368
commit e3b1d206ba

@ -7,8 +7,8 @@ let apiApp = {
saveUser: '/api/mobile/user/update-user',
getUserMobile: '/api/mobile/user/mobile',
sendSms: '/api/mobile/user/send-sms',
bindMobile: '/api/mobile/user/bind-mobile',
checkMobile:'/api/mobile/user/check-mobile',
bindMobile: '/api/mobile/user/bind-mobile',
checkMobile: '/api/mobile/user/check-mobile',
// 课程
courseNotices: '/api/mobile/course/notices',
@ -25,14 +25,14 @@ let apiApp = {
// 预约
scheduleIndex: '/api/mobile/schedule/index',
scheduleSave: '/api/mobile/schedule/save',
scheduleDetail: '/api/mobile/schedule/detail',
scheduleCheck:'/api/mobile/schedule/check',
scheduleDetail: '/api/mobile/schedule/detail',
scheduleCheck: '/api/mobile/schedule/check',
// 其他
otherConfig: '/api/mobile/other/config',
otherBanner: '/api/mobile/other/banner',
otherUploadFile: '/api/mobile/upload-file',
getparameter:'/api/admin/parameter/show'
otherUploadFile: '/api/mobile/upload-file',
getparameter: '/api/admin/parameter/show',
updateDonates: '/api/mobile/user/update-donates'
}
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作
@ -44,8 +44,8 @@ const install = (Vue, vm) => {
let saveUser = (params = {}) => vm.$u.post(apiApp.saveUser, params);
let getUserMobile = (params = {}) => vm.$u.get(apiApp.getUserMobile, params);
let sendSms = (params = {}) => vm.$u.get(apiApp.sendSms, params);
let bindMobile = (params = {}) => vm.$u.get(apiApp.bindMobile, params);
let checkMobile = (params = {}) => vm.$u.get(apiApp.checkMobile, params);
let bindMobile = (params = {}) => vm.$u.get(apiApp.bindMobile, params);
let checkMobile = (params = {}) => vm.$u.get(apiApp.checkMobile, params);
// 课程
let courseNotices = (params = {}) => vm.$u.get(apiApp.courseNotices, params);
@ -64,23 +64,15 @@ const install = (Vue, vm) => {
// 预约
let scheduleIndex = (params = {}) => vm.$u.get(apiApp.scheduleIndex, params);
let scheduleSave = (params = {}) => vm.$u.post(apiApp.scheduleSave, params);
let scheduleDetail = (params = {}) => vm.$u.get(apiApp.scheduleDetail, params);
let scheduleDetail = (params = {}) => vm.$u.get(apiApp.scheduleDetail, params);
let scheduleCheck = (params = {}) => vm.$u.get(apiApp.scheduleCheck, params);
// 其他
let otherConfig = (params = {}) => vm.$u.get(apiApp.otherConfig, params);
let otherBanner = (params = {}) => vm.$u.get(apiApp.otherBanner, params);
let otherUploadFile = (params = {}) => vm.$u.post(apiApp.otherUploadFile, params);
let getparameter = (params = {}) => vm.$u.get(apiApp.getparameter, params);
// export function getparameter(param, loading = true) {
// return request({
// url: '/api/admin/parameter/show',
// method: 'get',
// params: param,
// paramsSerializer: customParamsSerializer,
// isLoading: loading
// })
// }
let otherUploadFile = (params = {}) => vm.$u.post(apiApp.otherUploadFile, params);
let getparameter = (params = {}) => vm.$u.get(apiApp.getparameter, params);
let updateDonates = (params = {}) => vm.$u.post(apiApp.updateDonates, params);
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = {
@ -91,8 +83,8 @@ const install = (Vue, vm) => {
saveUser,
getUserMobile,
sendSms,
bindMobile,
checkMobile:checkMobile,
bindMobile,
checkMobile: checkMobile,
// 课程
courseNotices,
@ -107,15 +99,16 @@ const install = (Vue, vm) => {
// 预约
scheduleIndex,
scheduleSave,
scheduleDetail,
scheduleCheck,
// 资讯
scheduleDetail,
scheduleCheck,
// 资讯
courseNews,
// 其他
otherConfig,
otherBanner,
otherUploadFile,
getparameter:getparameter
otherUploadFile,
getparameter: getparameter,
updateDonates:updateDonates
};
}

@ -102,7 +102,8 @@ const install = (Vue, vm) => {
title: res.data.errmsg,
duration: 2000
})
}, 20)
}, 20)
}
return false;

@ -1,7 +1,7 @@
<template>
<view class="container">
<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">
<view class="qrcode-text">
<text></text>
<text></text>
@ -9,7 +9,7 @@
<text></text>
</view>
<view class="qrcode-code">
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode.qrcode" :sizeUnit="'rpx'"
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="myQrcode.qrcode" :sizeUnit="'rpx'"
:size="100" :options="{
margin: 5,
foregroundImageSrc: '/static/index_icon1.png',
@ -177,9 +177,27 @@
// this.getUser()
},
onLoad() {
// console.log("123",this.isCurrentDateGreaterOrEqual('2024-09-06'))
// console.log("123",this.isCurrentDateGreaterOrEqual('2024-09-06'))
let that = this
this.getBookList()
this.getSites()
this.getSites()
if(!this.timer){
this.timer = setInterval(function(){
that.getBookList()
},3*60*1000)
}
},
onUnload() {
if(this.timer){
clearInterval(this.timer)
this.timer = null
}
},
onHide() {
if(this.timer){
clearInterval(this.timer)
this.timer = null
}
},
methods: {
//

@ -64,7 +64,7 @@
<!-- 新增车牌 -->
<view class="modal">
<u-popup v-model="showPlate" mode="bottom">
<u-popup v-model="showPlate" mode="bottom" @close="closePlate">
<view class="modal-tip">车牌号</view>
<view class="modal-content" style="height:400rpx">
<plate ref="plates" @listenPlateChange="(val)=>{plateChange(val,index)}"
@ -77,7 +77,7 @@
</view>
<!-- 新增修改同行人 -->
<view class="modal">
<u-popup v-model="accompanyShow" mode="bottom">
<u-popup v-model="accompanyShow" mode="bottom" @close="">
<view class="modal-tip">同行人</view>
<view class="modal-content">
姓名<u-input :placeholder="'请输入姓名'" v-model="accompanyObj.name" />
@ -128,7 +128,8 @@
confirmTips: false,
hMin: 0,
hMax: 24,
appoinementType: '',
appoinementType: '',
user_id:"",
dateParams: {
year: true,
month: true,
@ -211,7 +212,8 @@
getUser() {
this.$u.api.user().then(res => {
console.log("res", res)
this.form.idcard = res.user.idcard
this.form.idcard = res.user.idcard
this.user_id = res.user
this.$u.vuex('vuex_user', res.user)
})
},
@ -287,7 +289,6 @@
this.plateList.splice(index, 1)
},
confirmPlate() {
console.log("this.plateList[this.plateIndex]", this.plateList[this.plateIndex])
console.log(this.plateList[this.plateIndex]['plate'])
console.log(this.plateList[this.plateIndex]['plate'].length < 7)
@ -305,6 +306,15 @@
this.plateIndex = -1
this.$refs.plates.panelReset()
this.plateNumber = ['苏', 'E', '', '', '', '', '']
},
closePlate(){
if(this.plateIndex>-1){
this.showPlate = false
this.plateList[this.plateIndex]['show'] = false
this.plateIndex = -1
this.$refs.plates.panelReset()
this.plateNumber = ['苏', 'E', '', '', '', '', '']
}
},
//
addAccompany() {
@ -351,7 +361,8 @@
},
submit() {
let start_time = ''
let end_time = ''
let end_time = ''
let that = this
// this.$u.api.scheduleCheck({
// site:this.siteList[e[0]].id
// }).then(res=>{
@ -364,35 +375,60 @@
this.form.accompany_total = this.form.accompany.length
console.log("accompany_total", this.plateList, this.form.accompany_total)
let _plate = []
if (this.plateList.length > 0) {
if (this.plateList.length > this.form.accompany_total + 1) {
if (this.plateList.length > 0) {
this.plateList.map(item => {
if(item.show){
_plate.push(item.plate)
}
})
if (_plate.length > this.form.accompany_total + 1) {
this.base.toast("车辆数量已经大于预约人数了")
return
}
this.plateList.map(item => {
_plate.push(item.plate)
})
}
this.form.plate = _plate.join(',')
console.log("plate", this.form)
// return
// if(this.isLocked){
// return
// }
// this.isLocked = true
if(this.isLocked){
return
}
this.isLocked = true
console.log("this.isLocked",this.isLocked)
this.$u.api.scheduleSave({
...this.form,
start_time: start_time,
end_time: end_time
}).then(res => {
this.newsSubscription()
}).then(res => {
console.log("res",res)
this.saveOther()
}).catch(err=>{
console.log("err",err)
that.isLocked = false
})
} else {
console.log('验证失败');
// this.base.toast("")
}
});
},
async saveOther(){
await this.saveUser()
await this.newsSubscription()
},
saveUser() {
let that = this
this.$u.api.saveUser({
...this.user_id,
idcard:this.form.idcard
}).then(res => {
console.log("user")
// this.$u.api.user().then(res => {
// this.$u.vuex('vuex_user', res.user)
// })
})
},
//
newsSubscription() {
@ -410,7 +446,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 500)
}, 100)
})
} else {
//
@ -423,13 +459,15 @@
tmplIds: [
'0WMaFZ_0FOS5gtxEAi-fM3pFcYPySRMwYFNASz9oig0',
],
success(res) {
success(res) {
console.log("success",that.isLocked)
that.base.toast("预约已提交", 1500, function() {
setTimeout(function() {
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 500)
})
console.log("settime",that.isLocked)
}, 100)
})
},
fail(err) {
@ -438,7 +476,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 500)
}, 100)
})
}
})
@ -448,7 +486,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 500)
}, 100)
})
}
}
@ -461,7 +499,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 500)
}, 100)
})
//
}

@ -0,0 +1,191 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="wrap">
<u-form :model="form" :label-width="140" ref="uForm" :label-align="'left'" :error-type="['message']">
<u-form-item label="姓名" prop="username" required>
<u-input v-model="form.username" placeholder="请输入姓名" />
</u-form-item>
<u-form-item label="就读班级" prop="course" required>
<u-input @click="showCourse = true" placeholder="请选择就读班级" v-model="form.course" type="select" />
</u-form-item>
<u-form-item label="联系方式" prop="mobile" required>
<u-input type="number" placeholder="请输入联系方式" v-model="form.mobile" />
</u-form-item>
<u-form-item label="公司名称" prop="company_name">
<u-input v-model="form.company_name" placeholder="请输入公司名称" />
</u-form-item>
<u-form-item label="职务" prop="company_position">
<u-input v-model="form.company_position" type="text" placeholder="请输入职务" /></u-form-item>
<u-form-item label="我希望捐赠" prop="donate" label-position="top">
<u-input v-model="form.donate" type="textarea" placeholder="我希望捐赠" /></u-form-item>
</u-form>
</view>
<view class="form-btn">
<view @click="saveDonates"></view>
</view>
<u-picker @confirm="selectCourse" v-model="showCourse" :range="courseList" range-key="value"
mode="selector"></u-picker>
</view>
</template>
<script>
export default {
data() {
return {
showCourse: false,
form: {
username: '',
course: '',
mobile: '',
company_name: '',
company_position: '',
donate: ''
},
courseList: [{
label: '高研班|第一期高级科创人才研修班',
value: '高研班|第一期高级科创人才研修班'
}, {
label: '高研班|第二期高级科创人才研修班',
value: '高研班|第二期高级科创人才研修班'
}, {
label: '高研班|第三期高级科创人才研修班',
value: '高研班|第三期高级科创人才研修班'
}, {
label: '高研班|第四期高级科创人才研修班',
value: '高研班|第四期高级科创人才研修班'
}, {
label: '高研班|第五期高级科创人才研修班',
value: '高研班|第五期高级科创人才研修班'
}, {
label: '高研班|第六期高级科创人才研修班',
value: '高研班|第六期高级科创人才研修班'
}, {
label: '其他',
value: '其他'
}],
rules: {
username: [{
required: true,
message: '请输入姓名',
trigger: ['blur'],
}],
course: [{
required: true,
message: '请选择就读班级',
trigger: ['change', 'blur'],
}],
mobile: [{
required: true,
message: '请输入联系方式',
trigger: ['blur'],
}, {
validator: (rule, value, callback) => {
return this.$u.test.mobile(value);
},
message: '手机号码不正确',
trigger: ['blur'],
}],
}
}
},
onReady() {
this.$refs.uForm.setRules(this.rules);
},
onLoad() {
let token = uni.getStorageSync('stbc1_lifeData') ? uni.getStorageSync('stbc1_lifeData').vuex_token : ''
if (this.base.isNull(token)) {
this.getToken()
}
},
methods: {
selectCourse(e) {
this.form.course = this.courseList[e[0]]['value']
},
//
saveDonates() {
let that = this
this.$refs.uForm.validate(valid => {
if (valid) {
this.$u.api.updateDonates(this.form).then(res => {
this.base.toast('提交成功',1000,function(){
setTimeout(function(){
uni.switchTab({
url:'/pages/me/index'
})
},50)
})
})
} else {
console.log('验证失败');
// this.base.toast("")
}
});
},
async getToken() {
let that = this
await uni.login({
provider: 'weixin',
success: (res) => {
this.$u.api.login({
code: res.code
}).then(res1 => {
uni.setStorageSync("stbc1_lifeData", {
'vuex_token': res1.token
})
}).catch(err => {
console.log('login-error:', JSON.stringify(err))
})
},
fail: (res) => {
console.log("errtoken", JSON.stringify(res))
}
});
},
}
}
</script>
<style scoped lang="scss">
.container {
padding: 30rpx;
height: 100vh;
overflow: scroll;
.cbg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
}
.wrap {
background: #fff;
position: relative;
padding: 35rpx;
border-radius: 30rpx;
padding-top: 0;
}
.form-btn {
width: 100%;
position: relative;
padding: 60rpx 0;
&>view {
width: 70%;
text-align: center;
margin: 0 auto;
color: #fff;
background: linear-gradient(to right, #5e5fbc, #0d0398);
border-radius: 30rpx;
padding: 20rpx;
}
}
}
</style>

@ -112,8 +112,12 @@
trigger: ['blur'],
}],
email: [{
validator: (rule, value, callback) => {
return this.$u.test.email(value);
validator: (rule, value, callback) => {
if (!this.base.isNull(value)) {
return this.$u.test.idCard(value);
} else {
return true
}
},
message: '邮箱不正确',
trigger: ['blur'],

@ -105,6 +105,12 @@
clearInterval(this.timer)
this.timer = null
}
},
onHide() {
if(this.timer){
clearInterval(this.timer)
this.timer = null
}
},
methods: {
async getBookDetail(id) {

@ -45,7 +45,7 @@
</view>
</view>
<view class="nodata" v-else>
<u-empty mode="data"></u-empty>
<u-empty text="当前没有预约" mode="data"></u-empty>
</view>
</scroll-view>

@ -181,13 +181,18 @@
return
}
this.plateList.push(this.plate1)
this.showParkNumber = false
this.$refs.plates.panelReset()
},
updatePlate() {
let _plate = ''
_plate = this.plateList.join(",")
_plate = this.plateList.join(",")
console.log("plate", this.plateList,_plate)
if(this.base.isNull(_plate)){
this.base.toast("未填写车牌")
return
}
// return
this.$u.api.saveUser({
...this.userInfo,
plate: _plate

@ -15,10 +15,10 @@
<text class="courseName">班主任</text>
</view>
</view>
<view class="teacher-mobile">
<view class="teacher-mobile" @click="callPhone(tea.mobile)">
<image style="width:22rpx;height:22rpx;margin-right:20rpx"
:src="base.imgHost('txl-phone.png')"></image>
<view>{{tea.mobile?tea.mobile:''}}</view>
<view style="color:blue">{{tea.mobile?tea.mobile:''}}</view>
</view>
</view>
</view>
@ -49,8 +49,8 @@
</view>
<!-- <view v-if="list.length>0"> -->
<nextIndexedXlist ref="txllist" :dataList="list" :show-avatar="false">
</nextIndexedXlist>
<nextIndexedXlist ref="txllist" :dataList="list" :show-avatar="false">
</nextIndexedXlist>
<!-- </view> -->
<!-- <view class="nodata" v-else>
<u-empty mode="data"></u-empty>
@ -74,13 +74,13 @@
show_mobile: false,
}
},
onLoad(options) {
onLoad(options) {
let that = this
this.show_mobile = options.show_mobile == 1 ? true : false
console.log("this.$refs.txllist",options.show_mobile,this.show_mobile,this.$refs.txllist)
this.$nextTick(function() {
that.$refs.txllist.setShowMobile(options.show_mobile)
this.show_mobile = options.show_mobile == 1 ? true : false
console.log("this.$refs.txllist", options.show_mobile, this.show_mobile, this.$refs.txllist)
this.$nextTick(function() {
that.$refs.txllist.setShowMobile(options.show_mobile)
})
this.getMyCourseTxl(options.id)
},
@ -106,9 +106,21 @@
this.studentList = _student
this.list = _other
this.teacher = res.teacher
},
callPhone(phoneNumber) {
if(this.base.isNull(phoneNumber)){
return
}
uni.makePhoneCall({
phoneNumber: phoneNumber, //
success: function() {
console.log('拨打电话成功');
},
fail: function() {
console.log('拨打电话失败');
}
});
}
}
}

@ -60,6 +60,9 @@
</view>
</view>
</view>
</view>
<view class="nodata" v-else>
<u-empty text="当前没有报名课程" mode="data"></u-empty>
</view>
</view>
@ -233,7 +236,12 @@
width: 100%;
height: 100vh;
}
.nodata {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.wrap {
position: relative;
height: 100%;

@ -21,16 +21,14 @@
<u-input v-model="form.company_name" placeholder="请输入公司名称"/>
</u-form-item>
<u-form-item label="职务" prop="company_position">
<u-input @click="showPosition = true" v-model="form.company_position" type="select" placeholder="请选择职务"/></u-form-item>
<u-input v-model="form.company_position" type="text" placeholder="请输入职务"/></u-form-item>
</u-form>
</view>
<view class="form-btn">
<view @click="saveUser"></view>
</view>
<u-picker @confirm="selectSex" v-model="showSex" :range="sexList" range-key="value" mode="selector"></u-picker>
<u-picker @confirm="dateConfirm" mode="time" v-model="dateShow" :params="dateParams"></u-picker>
<u-picker @confirm="selectPosition" v-model="showPosition" :range="positionList" range-key="value" mode="selector"></u-picker>
<u-picker @confirm="dateConfirm" mode="time" v-model="dateShow" :params="dateParams"></u-picker>
</view>
</template>
@ -100,27 +98,15 @@
},
onLoad(options) {
this.course_id = options.id?options.id:null
this.getPosition()
},
methods: {
selectSex(e) {
this.form.sex = this.sexList[e[0]]['value']
},
selectPosition(e){
this.form.company_position = this.positionList[e[0]]['value']
},
//
dateConfirm(e) {
this.form.birthday = e.year + '-' + e.month + '-' + e.day
},
getPosition(){
this.$u.api.getparameter({
number:'company_position'
}).then(res=>{
this.positionList = res.detail
})
},
saveUser() {
let that = this

@ -112,6 +112,11 @@
"style": {
"navigationBarTitleText": "预约详情"
}
},{
"path": "donate/index",
"style": {
"navigationBarTitleText": "校友捐赠"
}
},{
"path": "webview/index",
"style": {

@ -78,10 +78,15 @@
url: '/packages/schoolmate/index'
})
} else {
this.base.toast("您还不是校友,无权查看")
uni.switchTab({
url: '/pages/course/index'
})
this.base.toast("您还不是校友,无权查看",1000,function(){
setTimeout(function(){
uni.switchTab({
url: '/pages/course/index'
})
},500)
})
}
}

@ -61,7 +61,7 @@
</view>
<view class="nodata" v-else>
<u-empty mode="data"></u-empty>
<u-empty text="当前没有课程" mode="data"></u-empty>
</view>
</scroll-view>

@ -183,7 +183,7 @@
hasMobile: false,
course_signs: [],
showBigCode:false,
myQrcode:'',
myQrcode:'STBC',
timer:null
}
},
@ -262,9 +262,9 @@
url: '/packages/webview/index?type=4'
})
} else if (type === 5) {
// uni.navigateTo({
// url: '/packages/webview/index?type=4'
// })
uni.navigateTo({
url: '/packages/donate/index'
})
}
},
getUserInfo() {
@ -273,7 +273,7 @@
this.$u.vuex('vuex_user', res.user)
this.userInfo = res.user
this.course_signs = res.user.course_signs ? res.user.course_signs : [],
this.myQrcode = res.course_signs?res.course_signs.qrcode:''
this.myQrcode = res.course_signs?res.course_signs.qrcode:'STBC'
if (this.base.isNull(res.user.mobile)) {
this.showRegister = true
this.hasMobile = false
@ -288,7 +288,7 @@
title: '...'
})
this.$u.api.user().then(res => {
this.myQrcode = res.course_signs?res.course_signs.qrcode:''
this.myQrcode = res.course_signs?res.course_signs.qrcode:'STBC'
setTimeout(function() {
uni.hideLoading()
}, 500)
@ -296,7 +296,6 @@
},
//
goBind() {
console.log("qwe")
uni.navigateTo({
url: '/packages/register/login'
})

Loading…
Cancel
Save