Commit b616278a authored by linwenqing's avatar linwenqing

refactor:弹窗样式修改

parent 7f883aff
...@@ -177,7 +177,10 @@ export default { ...@@ -177,7 +177,10 @@ export default {
}, },
onShow: function(param) { onShow: function(param) {
if (!this.vuex_token) { if (!this.vuex_token) {
this.$u.toast('请先登录') this.$refs.uToast.show({
title: '请先登录',
type: 'error',
})
let that = this let that = this
setTimeout(function(){ setTimeout(function(){
that.$u.route({ that.$u.route({
...@@ -185,13 +188,6 @@ export default { ...@@ -185,13 +188,6 @@ export default {
}) })
}, 1000) }, 1000)
} }
// try {
// if (param.tabs) {
// this.current = param.tabs
// this.swiperCurrent = param.tabs
// }
// } catch (e) {}
// this.tabsChange(this.current)
}, },
onUnload(){ onUnload(){
uni.hideLoading() uni.hideLoading()
...@@ -199,11 +195,19 @@ export default { ...@@ -199,11 +195,19 @@ export default {
methods: { methods: {
submit(){ submit(){
if(!this.certId){ if(!this.certId){
this.$u.toast('请填写证件号码!') this.$refs.uToast.show({
title: '请填写证件号码!',
type: 'error',
duration: 2000
})
return return
} }
if(!this.certName){ if(!this.certName){
this.$u.toast('请填写姓名!') this.$refs.uToast.show({
title: '请填写姓名!',
type: 'error',
duration: 2000
})
return return
} }
let param = { let param = {
...@@ -216,7 +220,11 @@ export default { ...@@ -216,7 +220,11 @@ export default {
this.$u.api.getCertFromOut(param).then((res) => { this.$u.api.getCertFromOut(param).then((res) => {
uni.hideLoading() uni.hideLoading()
if(!res){ if(!res){
this.$u.toast('证书暂未公布') this.$refs.uToast.show({
title: '未查询到相关记录,请稍后再试',
type: 'warning',
duration: 2000
})
return return
} }
let data = [] let data = []
......
...@@ -44,7 +44,9 @@ export default { ...@@ -44,7 +44,9 @@ export default {
}, },
}, },
onLoad(params) { onLoad(params) {
this.returnUrl = decodeURIComponent(params?.path) if (params && params.path) {
this.returnUrl = decodeURIComponent(params.path)
}
}, },
methods: { methods: {
wxLogin() { wxLogin() {
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
</u-cell-item> </u-cell-item>
</u-cell-group> </u-cell-group>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
...@@ -129,7 +130,10 @@ export default { ...@@ -129,7 +130,10 @@ export default {
!this.student.identityNumber || !this.student.identityNumber ||
!this.student.certificateValidityDate !this.student.certificateValidityDate
) { ) {
this.$u.toast('请上传身份证正反面信息') this.$refs.uToast.show({
title: '请上传身份证正反面信息',
type: 'error',
})
return return
} }
this.$u.api this.$u.api
...@@ -141,7 +145,11 @@ export default { ...@@ -141,7 +145,11 @@ export default {
name: this.student.name, name: this.student.name,
}) })
.then((res) => { .then((res) => {
this.$u.toast('认证成功') this.$refs.uToast.show({
title: '认证成功',
type: 'success',
duration: 2000,
})
this.student.isCertify = true this.student.isCertify = true
setTimeout(() => { setTimeout(() => {
this.$u.route({ this.$u.route({
...@@ -169,9 +177,13 @@ export default { ...@@ -169,9 +177,13 @@ export default {
}) })
.catch((data) => { .catch((data) => {
uni.hideLoading() uni.hideLoading()
uni.hideToast()
this.student.name = '' this.student.name = ''
this.student.identityNumber = '' this.student.identityNumber = ''
this.$u.toast('识别身份证信息错误') this.$refs.uToast.show({
title: '识别身份证信息错误',
type: 'error',
})
}) })
}) })
}, },
...@@ -192,8 +204,13 @@ export default { ...@@ -192,8 +204,13 @@ export default {
}) })
.catch((data) => { .catch((data) => {
uni.hideLoading() uni.hideLoading()
uni.hideToast()
this.student.certificateValidityDate = '' this.student.certificateValidityDate = ''
this.$u.toast('识别身份证信息错误') this.$refs.uToast.show({
title: '识别身份证信息错误',
type: 'error',
duration: 2000,
})
}) })
}) })
}, },
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
</view> </view>
<button @click="submit" class="sub-input">提交</button> <button @click="submit" class="sub-input">提交</button>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
...@@ -53,7 +54,11 @@ export default { ...@@ -53,7 +54,11 @@ export default {
}) })
.then((res) => { .then((res) => {
this.isNotSet = false this.isNotSet = false
this.$u.toast('保存成功') this.$refs.uToast.show({
title: '保存成功',
type: 'success',
duration: 2000,
})
setTimeout(() => { setTimeout(() => {
this.$u.route({ this.$u.route({
type: 'back', type: 'back',
......
...@@ -74,12 +74,12 @@ ...@@ -74,12 +74,12 @@
></u-cell-item> ></u-cell-item>
</u-cell-group> </u-cell-group>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import upload from '@/common/upload' import upload from '@/common/upload'
import login from '@/common/login'
export default { export default {
data() { data() {
return { return {
...@@ -118,12 +118,10 @@ export default { ...@@ -118,12 +118,10 @@ export default {
}, },
onLoad() { onLoad() {
this.refleshCode() this.refleshCode()
this.$u.api this.$u.api.getQiNiuToken({ bucketName: 'wsy-exam' }).then((res) => {
.getQiNiuToken({ bucketName: 'wsy-exam' }) this.qiToken = res
.then((res) => { getApp().globalData.qiNiuToken = res
this.qiToken = res })
getApp().globalData.qiNiuToken = res
})
this.$u.api.getUserInfo().then((res) => { this.$u.api.getUserInfo().then((res) => {
if (res) { if (res) {
res.isCertify = res.isCertify =
...@@ -160,11 +158,19 @@ export default { ...@@ -160,11 +158,19 @@ export default {
iv: e.detail.iv, iv: e.detail.iv,
} }
} else { } else {
this.$u.toast(e.detail.errMsg) this.$refs.uToast.show({
title: e.detail.errMsg,
type: 'error',
duration: 2000,
})
return return
} }
} else { } else {
this.$u.toast('授权失败,请重新授权') this.$refs.uToast.show({
title: '授权失败,请重新授权',
type: 'error',
duration: 2000,
})
return return
} }
this.syncUserinfo(params) this.syncUserinfo(params)
...@@ -212,11 +218,19 @@ export default { ...@@ -212,11 +218,19 @@ export default {
phoneNumber: res.phoneNumber, phoneNumber: res.phoneNumber,
}) })
.then((ret) => { .then((ret) => {
this.$u.toast('绑定成功!') this.$refs.uToast.show({
title: '绑定成功!',
type: 'success',
duration: 2000,
})
}) })
}) })
.catch((err) => { .catch((err) => {
this.$u.toast('请登录后再绑定') this.$refs.uToast.show({
title: '请登录后再绑定',
type: 'warning',
duration: 2000,
})
this.$u.route({ this.$u.route({
url: 'pages/login/index', url: 'pages/login/index',
params: { params: {
...@@ -246,7 +260,11 @@ export default { ...@@ -246,7 +260,11 @@ export default {
}) })
}, },
toLogin() { toLogin() {
this.$u.toast('登录信息已失效,请重新登录') this.$refs.uToast.show({
title: '登录信息已失效,请重新登录',
type: 'warning',
duration: 2000,
})
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: 'pages/login/index', url: 'pages/login/index',
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
></u-cell-item> ></u-cell-item>
</u-cell-group> </u-cell-group>
<view class="logout" @tap="logout">退出登录</view> <view class="logout" @tap="logout">退出登录</view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
...@@ -23,22 +24,25 @@ export default { ...@@ -23,22 +24,25 @@ export default {
onLoad() {}, onLoad() {},
methods: { methods: {
upgrade: function() { upgrade: function() {
wx.showToast({ let that = this
uni.showLoading({
title: '正在更新版本...', title: '正在更新版本...',
icon: 'loading',
}) })
const um = wx.getUpdateManager() const um = wx.getUpdateManager()
um.onCheckForUpdate(function(res) { um.onCheckForUpdate(function(res) {
uni.hideLoading()
if (res.hasUpdate) { if (res.hasUpdate) {
um.onUpdateReady(function() { um.onUpdateReady(function() {
um.applyUpdate() um.applyUpdate()
wx.showToast({ that.$refs.uToast.show({
title: '更新完成', title: '更新完成',
type: 'success',
}) })
}) })
} else { } else {
wx.showToast({ that.$refs.uToast.show({
title: '已是最新版本', title: '已是最新版本',
type: 'success',
}) })
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment