master
lion 1 year ago
parent 9da16d2feb
commit 6fde122dbe

@ -21,7 +21,36 @@
// })
// }
// });
// })
// })
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
console.log(res.hasUpdate)
if (res.hasUpdate) {
updateManager.onUpdateReady(function() {
uni.showModal({
title: "更新提示",
content: "新版本已经准备好,是否重启应用?",
success(res) {
if (res.confirm) {
// applyUpdate
updateManager.applyUpdate();
}
}
});
});
updateManager.onUpdateFailed(function() {
//
uni.showModal({
title: "已经有新版本了哟~",
content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~"
});
});
}
});
updateManager.onUpdateFailed(function(res) {
//
});
},

@ -77,7 +77,7 @@
this.course_forms = res.detail.data.sort((a, b) => (a.sort - b.sort))
}
},
backForm(e) {
async backForm(e) {
let _arr = []
e.map(item => {
// _arr.push({
@ -99,11 +99,11 @@
return
}
this.isLocked = true
this.saveUser()
await this.saveUser()
if (this.opType == 'edit') {
this.updateApplyCourse()
await this.updateApplyCourse()
} else {
this.applyCourse()
await this.applyCourse()
}
},
async saveUser() {
@ -153,11 +153,11 @@
data: this.apply_form
}).then(res => {
that.base.toast("修改成功", 1500, function() {
setTimeout(function() {
uni.redirectTo({
url: '/packages/mycourse/index'
setTimeout(function() {
uni.navigateBack({
delta:1
})
}, 500)
}, 1500)
})
}).catch(err => {
console.log("err", err)

@ -8,7 +8,7 @@
<u-input :placeholder="'请选择'" v-model="form.siteName" type="select" @click="siteShow = true" />
</u-form-item>
<u-form-item label="预约日期" prop="date" required>
<picker mode="date" :value="form.date" :start="startDate" @change="dateConfirm">
<picker v-if="showStartDate" mode="date" :value="form.date" :start="startDate" @change="dateConfirm">
<view style="display: flex;align-items: center;justify-content: space-between;">
<view v-if="form.date">{{form.date}}</view>
<view style="color:#808080" v-else></view>
@ -220,21 +220,26 @@
trigger: ['change', 'blur'],
}],
},
},
startDate:'',
showStartDate:false
}
},
onReady() {
this.$refs.uForm.setRules(this.rules);
console.log("this.startDate", this.startDate)
},
computed: {
startDate() {
return this.$moment().format("YYYY-MM-DD").toString()
}
this.$refs.uForm.setRules(this.rules);
},
// computed: {
// startDate() {
// return this.$moment().add(1,'days').format("YYYY-MM-DD").toString()
// }
// },
async onLoad(options) {
this.appoinementType = options.type ? options.type : ''
this.startDate = this.$moment().add(1,'days').format("YYYY-MM-DD").toString()
this.form.date = this.startDate
this.showStartDate = true
await this.getUser()
await this.getSites()
},
@ -445,7 +450,8 @@
}
}
//
result = '时间验证通过';
result = '时间验证通过';
return true
console.log("result", result)
},
submit() {
@ -537,7 +543,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 100)
}, 1500)
})
} else {
//
@ -559,7 +565,7 @@
})
console.log("settime",
that.isLocked)
}, 100)
}, 1500)
})
},
fail(err) {
@ -568,7 +574,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 100)
}, 1500)
})
}
})
@ -578,7 +584,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 100)
}, 1500)
})
}
}
@ -591,7 +597,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 100)
}, 1500)
})
//
}

@ -33,7 +33,8 @@
export default {
data() {
return {
showCourse: false,
showCourse: false,
isLocked:false,
form: {
username: '',
course: '',
@ -94,11 +95,13 @@
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()
}
onLoad() {
let token = uni.getStorageSync('stbc1_lifeData') ? uni.getStorageSync('stbc1_lifeData').vuex_token : ''
if (this.base.isNull(token)) {
this.getToken()
} else {
this.getUserInfo()
}
},
methods: {
selectCourse(e) {
@ -108,15 +111,21 @@
saveDonates() {
let that = this
this.$refs.uForm.validate(valid => {
if (valid) {
if (valid) {
if(this.isLocked){
return
}
this.isLocked = true
this.$u.api.updateDonates(this.form).then(res => {
this.base.toast('提交成功',1500,function(){
setTimeout(function(){
uni.switchTab({
url:'/pages/me/index'
})
},100)
this.base.toast('提交成功', 1500, function() {
setTimeout(function() {
uni.switchTab({
url: '/pages/me/index'
})
}, 1500)
})
}).catch(res => {
this.isLocked = false
})
} else {
console.log('验证失败');
@ -124,26 +133,45 @@
}
});
},
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))
}
});
},
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
})
this.$u.api.user().then(res2 => {
that.form.username = res2.user.username
that.form.mobile = res2.user.mobile
that.form.company_position = res2.user.company_position
that.form.company_name = res2.user.company_name
uni.setStorageSync("stbc1_lifeData", {
'vuex_token': res1.token,
'vuex_user': res2.user
})
})
}).catch(err => {
console.log('login-error:', JSON.stringify(err))
})
},
fail: (res) => {
console.log("errtoken", JSON.stringify(res))
}
});
},
getUserInfo() {
this.$u.api.user().then(res => {
this.form.username = res.user.username
this.form.mobile = res.user.mobile
this.form.company_position = res.user.company_position
this.form.company_name = res.user.company_name
this.$u.vuex('vuex_user', res.user)
})
},
}
}

@ -84,7 +84,8 @@
},
plateList: [],
showPark: false,
showPark: false,
isLocked:false,
plate1: '',
plateNumber: ['苏', 'E', '', '', '', '', ''],
rules: {
@ -114,7 +115,7 @@
email: [{
validator: (rule, value, callback) => {
if (!this.base.isNull(value)) {
return this.$u.test.idCard(value);
return this.$u.test.email(value);
} else {
return true
}
@ -122,7 +123,6 @@
message: '邮箱不正确',
trigger: ['blur'],
}],
}
}
},
@ -159,8 +159,11 @@
this.plateList.splice(index, 1)
}
})
}
}
this.isLocked = false
this.$u.vuex('vuex_user', res.user)
}).catch(res=>{
this.isLocked = false
})
},
addPlate() {
@ -201,10 +204,15 @@
if (type == 'del') {
this.form.plate = this.plateList.join(",")
}
console.log("plateList", this.plateList)
console.log("plateList", this.plateList)
let that = this
this.$refs.uForm.validate(valid => {
if (valid) {
if (valid) {
if(this.isLocked){
return
}
this.isLocked = true
this.$u.api.saveUser(this.form).then(res => {
this.showPark = false
this.plate1 = ''
@ -231,6 +239,8 @@
})
}).catch(err=>{
this.isLocked = false
})
} else {
console.log('验证失败');

@ -152,7 +152,7 @@
that.base.toast("上传成功", 1500, function() {
setTimeout(function() {
that.newsSubscription()
}, 500)
}, 1500)
})
})
},

@ -147,7 +147,7 @@
uni.redirectTo({
url:"/packages/mycourse/index"
})
}, 500)
}, 1500)
})
})
},

@ -246,7 +246,7 @@
that.cancelItem = null
that.showCancel = false
that.getMyCourse()
}, 500)
}, 1500)
})
})
},

@ -95,30 +95,30 @@
this.$u.api.checkMobile({
mobile: this.form.mobile,
code: this.form.code
}).then(res => {
if(res.msg==='手机号不存在'){
this.base.toast('校友库中还没有您的信息,请先注册')
return
}
}).then(res => {
this.base.toast('绑定成功')
if (that.sendTimer) {
clearInterval(that.sendTimer);
that.hasSend = false;
}
this.$u.api.user().then(res => {
this.$u.vuex('vuex_user', res.user)
if(that.type=='course'){
uni.switchTab({
url: '/pages/course/index'
})
}else{
uni.switchTab({
url: '/pages/me/index'
})
}
})
uni.removeStorageSync("stbc1_lifeData")
uni.setStorageSync("stbc1_lifeData", {
'vuex_token': res.token
})
if(that.type=='course'){
uni.switchTab({
url: '/pages/course/index'
})
}else{
uni.switchTab({
url: '/pages/me/index'
})
}
// this.$u.api.user().then(res => {
// this.$u.vuex('vuex_user', res.user)
// })
})
},
toRegister(){

Loading…
Cancel
Save