| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import Apis from '@/common/apis/index'
- const mobileReg = /^1[3456789]\d{9}$/
- export default {
- async initData() {
- try {
- uni.showLoading({
- title: '加载中...'
- })
- const res = await Apis.GetAssociation()
- this.users = res.data
- uni.hideLoading()
- } catch (e) {
- //TODO handle the exception
- }
- },
- onEnterPage(page, val) {
- if (!this.userInfo) {
- return uni.navigateTo({
- url: '../login/index'
- })
- }
- switch (page) {
- case 'index':
- this.$store.commit('SET_CURRENT_PATIENT', val)
- uni.switchTab({
- url: '../index/index'
- })
- break
- case 'addPatient':
- uni.navigateTo({
- url: '../addPatient/index'
- })
- break
- case 'setting':
- uni.navigateTo({
- url: '../setting/index'
- })
- break
- }
- },
- bindOpenUnbundle(val) {
- this.unbundleUser = val
- this.$refs.userPopup.open()
- },
- bindUnbundle() {
- let that = this
- uni.showModal({
- title: '提示',
- content: '确定解绑此学生信息吗?',
- async success(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- await Apis.PostDeleteAssociation({
- id: that.unbundleUser.id
- })
- uni.showToast({
- title: '解绑成功'
- })
- that.initData()
- that.$store.commit('SET_CURRENT_PATIENT', null)
- that.$refs.userPopup.close()
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- }
|