Browse Source

添加白名单 个人信息提交成功提示

remotes/origin/HEAD
songsong428 5 years ago
parent
commit
d3ba210549
  1. 17
      App.vue
  2. 6
      main.js
  3. 21
      pages/basic-info/basic-info.vue
  4. 6
      pages/index/components/home.vue

17
App.vue

@ -17,9 +17,22 @@ export default {
});
await this.login();
const params = { param: { token: this.token } };
const startTime = +this.$moment()
.startOf('year')
.format('x');
const endTime = +this.$moment()
.endOf('day')
.format('x');
const params = {
param: {
startTime,
endTime,
token: this.token
}
};
await this.getUserInfo(params);
await this.getHealthTypeStaus();
await this.getHealthTypeStatus();
},
computed: mapState('user', ['token']),

6
main.js

@ -29,9 +29,13 @@ Vue.prototype.goHome = () => {
Vue.prototype.openPage = function(path, query = '') {
let url = query ? `${path}?${query}` : path;
store.commit('user/setPagePath',url)
if(!store.state.user.userInfo) {
// 白名单页面
const whiteListPath = ['/pages/basic-info/basic-info','/pages/statistics/statistics','/pages/user-code/user-code']
const choosePath = whiteListPath.indexOf(path)
if(!store.state.user.userInfo && !store.state.user.userInfo.id && choosePath === -1) {
url = '/pages/basic-info/basic-info';
}
uni.navigateTo({ url });
};

21
pages/basic-info/basic-info.vue

@ -3,7 +3,7 @@
<form class="padding-lr cu-form-group flex-direction">
<view class="cu-form-group flex flex-direction padding-tb">
<view class="title padding-bottom-sm">
<span class="text-red padding-right-xs" v-show="!userInfo">*</span>姓名
<span class="text-red padding-right-xs" v-show="!(userInfo && userInfo.id)">*</span>姓名
</view>
<input
:disabled="(userinfo && userInfo.id) ? true : false"
@ -76,7 +76,7 @@
/>
</view>
</form>
<user-agreement @changeIntentions="changeIntentions"></user-agreement>
<user-agreement v-if="!(userinfo && userInfo.id)" @changeIntentions="changeIntentions"></user-agreement>
<button
@tap="handleSubmitUserInfo"
class="bg-cyan margin primary-btn"
@ -143,6 +143,16 @@ export default {
changeIntentions(data) {
this.agree = data;
},
ceshi(){
uni.showToast({
title: '信息提交成功',
duration: 2000
});
const ggg = this.pagePath;
this.openPage(ggg);
},
/**
* 提交基本信息
@ -151,7 +161,7 @@ export default {
try {
if (!this.checkRules()) return;
const { name, idCard, phone, studentID, current } = this;
const { name, idCard, phone, studentID, current, pagePath } = this;
const params = {
param: {
idCard,
@ -167,7 +177,12 @@ export default {
if (success && code === 200) {
this.success = true;
this.setUserInfo(data);
uni.showToast({
title: '信息提交成功',
duration: 2000
});
this.openPage(pagePath);
console.log('跳转路径',pagePath)
} else {
uni.showToast({
title: msg || '提交基本信息成功',

6
pages/index/components/home.vue

@ -1,6 +1,6 @@
<template>
<view class="content flex flex-direction">
<view v-if="healthCode" style="position: relative;">
<view v-if="userInfo && userInfo.id" style="position: relative;">
<image src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9joZ6fC6TxFlt9mW4UhUn2PEgUne7OUt4q4mNE.k9gU.rSr8Eu*pFToZoVwUOEGDrKMycDqdn1mLFGE1dxYTGUcE!/b&bo=7gKRAu4CkQIDWXw!&rf=viewer_4&t=5"
class="bg1"></image>
<view class="bg-code">
@ -11,7 +11,7 @@
class="bg"></image>
<view :class="healthCode ? 'box1' : 'box'">
<view v-show="!healthCode" class="cu-card flex margin bg-white shadow card-radius" hover-class="cc-active" @tap="openPage('/pages/basic-info/basic-info')">
<view v-show="!(userInfo && userInfo.id)" class="cu-card flex margin bg-white shadow card-radius" hover-class="cc-active" @tap="openPage('/pages/basic-info/basic-info')">
<view class="flex align-center padding">
<view class="round lg cu-avatar icon1">
<view class="iconfont icon-qrcode"></view>
@ -68,7 +68,7 @@
return {
}
},
computed: mapState('user', ['healthCode']),
computed: mapState('user', ['userInfo','healthCode']),
};
</script>

Loading…
Cancel
Save