master
lion 2 years ago
parent 9da16d2feb
commit 6fde122dbe

@ -22,6 +22,35 @@
// }
// });
// })
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() {
@ -154,10 +154,10 @@
}).then(res => {
that.base.toast("修改成功", 1500, function() {
setTimeout(function() {
uni.redirectTo({
url: '/packages/mycourse/index'
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>
@ -221,20 +221,25 @@
}],
},
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()
}
},
// 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()
},
@ -446,6 +451,7 @@
}
//
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)
})
//
}

@ -34,6 +34,7 @@
data() {
return {
showCourse: false,
isLocked:false,
form: {
username: '',
course: '',
@ -98,6 +99,8 @@
let token = uni.getStorageSync('stbc1_lifeData') ? uni.getStorageSync('stbc1_lifeData').vuex_token : ''
if (this.base.isNull(token)) {
this.getToken()
} else {
this.getUserInfo()
}
},
methods: {
@ -109,14 +112,20 @@
let that = this
this.$refs.uForm.validate(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)
}, 1500)
})
}).catch(res => {
this.isLocked = false
})
} else {
console.log('验证失败');
@ -136,6 +145,16 @@
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))
})
@ -145,6 +164,15 @@
}
});
},
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)
})
},
}
}
</script>

@ -85,6 +85,7 @@
},
plateList: [],
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'],
}],
}
}
},
@ -160,7 +160,10 @@
}
})
}
this.isLocked = false
this.$u.vuex('vuex_user', res.user)
}).catch(res=>{
this.isLocked = false
})
},
addPlate() {
@ -202,9 +205,14 @@
this.form.plate = this.plateList.join(",")
}
console.log("plateList", this.plateList)
let that = this
this.$refs.uForm.validate(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)
})
})
},

@ -96,17 +96,16 @@
mobile: this.form.mobile,
code: this.form.code
}).then(res => {
if(res.msg==='手机号不存在'){
this.base.toast('校友库中还没有您的信息,请先注册')
return
}
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)
uni.removeStorageSync("stbc1_lifeData")
uni.setStorageSync("stbc1_lifeData", {
'vuex_token': res.token
})
if(that.type=='course'){
uni.switchTab({
url: '/pages/course/index'
@ -116,9 +115,10 @@
url: '/pages/me/index'
})
}
})
// this.$u.api.user().then(res => {
// this.$u.vuex('vuex_user', res.user)
// })
})
},
toRegister(){

Loading…
Cancel
Save