Browse Source

1.领取健康码api 2.每日健康打卡api 3.我的健康打卡样式

remotes/origin/HEAD
songsong428 5 years ago
parent
commit
35971358fa
  1. 52
      components/timeline/timeline.vue
  2. 2
      config/api/api.js
  3. 7
      pages.json
  4. 99
      pages/add-stroke/add-stroke.vue
  5. 146
      pages/apply-code/apply-code.vue
  6. 210
      pages/basic-info/basic-info.vue
  7. 14
      pages/index/components/home.vue
  8. 11
      pages/index/components/mine.vue
  9. 141
      pages/my-code/my-code.vue
  10. 9
      store/modules/user/mutations.js
  11. 1
      store/modules/user/state.js

52
components/timeline/timeline.vue

@ -1,32 +1,32 @@
<template>
<view>
<view class="cu-timeline">
<view class="cu-time">昨天</view>
<view class="cu-item cur cuIcon-noticefill">
<view class="content bg-green shadow-blur">
<text>22:22</text>广州市快件已到达地球
</view>
</view>
<view class="cu-item text-red cuIcon-attentionforbidfill">
<view class="content bg-red shadow-blur">这是第一次我家的铲屎官走了这么久久到足足有三天</view>
</view>
</view>
<view>
<view class="cu-timeline">
<view class="cu-time">昨天</view>
<view class="cu-item cur cuIcon-noticefill">
<view class="content bg-green shadow-blur">
<text>22:22</text>广州市快件已到达地球
</view>
</view>
<view class="cu-item text-red cuIcon-attentionforbidfill">
<view class="content bg-red shadow-blur">这是第一次我家的铲屎官走了这么久久到足足有三天</view>
</view>
</view>
<view class="cu-timeline">
<view class="cu-time">06-17</view>
<view class="cu-item">
<view class="content">
<text>01:30</text>喵星 MX-12138 已揽收准备发往银河系
</view>
</view>
</view>
</view>
<view class="cu-timeline">
<view class="cu-time">06-17</view>
<view class="cu-item">
<view class="content">
<text>01:30</text>喵星 MX-12138 已揽收准备发往银河系
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
};
export default {
data() {
return {};
},
};
</script>

2
config/api/api.js

@ -35,4 +35,4 @@ export const SCAN_SIGN = `${sites}/upload`;
export const GET_JOURNEYS = `${journeys}/info`;
// 上报行程
export const SUBMIT_JOURNEYS = `${sites}/upload`;
export const SUBMIT_JOURNEYS = `${journeys}/upload`;

7
pages.json

@ -1,5 +1,12 @@
{
"pages": [
// {
// "path": "pages/my-code/my-code",
// "style": {
// "navigationBarTitleText": "我的健康打卡"
// }
// },
{
"path": "pages/index/index",
"style": {

99
pages/add-stroke/add-stroke.vue

@ -33,7 +33,7 @@
以上信息是我本人填写本人对信息的真实性和完整性负责
</view>
</view>
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="addStroke">确认提交</button>
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="handleAddStroke">确认提交</button>
<!-- 历史 -->
<button class="shadow round bg-cyan history-btn iconfont icon-history" hover-class="cc-active" @tap="openPage('/pages/my-trips/my-trips')"></button>
</view>
@ -43,6 +43,7 @@
import { showToast } from 'common/script/util';
import UniCalendar from 'components/uni-calendar/uni-calendar.vue';
import DateSelector from './components/date-selector.vue';
import { SUBMIT_JOURNEYS } from 'api/api';
export default {
components: {UniCalendar,DateSelector},
@ -94,8 +95,8 @@ export default {
* @param {string} start 开始时间
* @param {string} end 截止时间
*/
getData(start, end) {
console.log('出发时间 start, end: ', start, end);
getStartData(start) {
console.log('出发时间 start: ', start);
},
/**
@ -103,32 +104,86 @@ export default {
* @param {string} start 开始时间
* @param {string} end 截止时间
*/
getEndData(start, end) {
console.log('抵达时间 start, end: ', start, end);
getEndData(end) {
console.log('抵达时间 end: ', end);
},
/**
* 提交基本信息
* 添加行程
*/
addStroke() {
if (!this.transports) {
showToast('请选择身份');
return;
}
if (!this.carNumber) {
showToast('请输入学号');
return;
}
if (!this.agree) {
showToast('请确定是否为本人填写');
return;
async handleAddStroke() {
try {
if (!this.checkRules()) return;
const {
address,
animalHeat,
district,
healthTypeId,
hospital,
token,
touchHubei,
touchSick
} = this;
const params = {
param: {
address,
animalHeat,
district,
healthTypeId,
hospital,
token,
touchHubei,
touchSick
}
};
const res = await this.$http.post(HEALTH_SIGN, params);
const {
success,
code,
msg,
data
} = res.data;
if (success && code === 200) {
this.setHealthCode(data.healthCode)
this.success = true;
uni.reLaunch({
url: `/pages/index/index`,
});
} else {
uni.showToast({
title: msg || '申请健康码成功',
icon: 'none'
});
}
} catch (error) {
console.log('error: ', error);
if (error.msg) {
uni.showToast({
title: error.msg || '申请健康码失败',
icon: 'none'
});
}
}
console.log('信息提交');
uni.reLaunch({
url: `/pages/index/index`,
});
},
//
checkRules() {
const { district,address,healthTypeId,animalHeat,agree } = this;
if (!this.transports) {
showToast('请选择身份');
return;
}
if (!this.carNumber) {
showToast('请输入学号');
return;
}
if (!this.agree) {
showToast('请确定是否为本人填写');
return;
}
return true;
},
},
};
</script>

146
pages/apply-code/apply-code.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">*</span>当前所在地区</view>
<input @tap="handleSelectLocation" placeholder="请输入当前所在地区" name="input" type="btn" v-model="area" />
<input @tap="handleSelectLocation" placeholder="请选择当前所在地区" name="input" type="btn" v-model="district" />
</view>
<view class="cu-form-group flex flex-direction padding-tb">
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>当前所在详细地址</view>
@ -15,7 +15,7 @@
<view class="cu-list menu text-left">
<view class="cu-item" v-for="(state,index) in status" :key="index">
<label class="flex justify-between align-center">
<radio class="round margin-right-xs" :checked="index === current" :value="state.value"></radio>
<radio class="round margin-right-xs" :checked="index === healthTypeId" :value="state.value"></radio>
<view class="flex-sub" style="font-size: 34rpx;">{{ state.name }}</view>
</label>
</view>
@ -32,7 +32,7 @@
<view class="flex">
<view class="flex-sub margin-tb-sm" v-for="(tour,index) in tours" :key="index">
<label class="flex justify-between align-center">
<radio class="round margin-right-xs" :checked="index === tourCurrent" :value="tour.value"></radio>
<radio class="round margin-right-xs" :checked="index === touchHubei" :value="tour.value"></radio>
<text class="flex-sub" style="font-size: 34rpx;">{{ tour.name }}</text>
</label>
</view>
@ -46,7 +46,7 @@
<view class="flex">
<view class="flex-sub margin-tb-sm" v-for="(touch,index) in touches" :key="index">
<label class="flex justify-between align-center">
<radio class="round margin-right-xs" :checked="index === touchCurrent" :value="touch.value"></radio>
<radio class="round margin-right-xs" :checked="index === touchSick" :value="touch.value"></radio>
<text class="flex-sub" style="font-size: 34rpx;">{{ touch.name }}</text>
</label>
</view>
@ -55,7 +55,7 @@
</view>
<view class="cu-form-group flex flex-direction padding-tb">
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>当前体温</view>
<input placeholder="请输入当前真实体温" name="input" type="number" v-model="temperature" />
<input placeholder="请输入当前真实体温" name="input" type="number" v-model="animalHeat" />
</view>
</form>
@ -65,7 +65,7 @@
以上信息是我本人填写本人对信息的真实性和完整性负责
</view>
</view>
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="addStroke">确认提交</button>
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="handleHealthSign">确认提交</button>
<!-- 历史 -->
<button class="shadow round bg-cyan history-btn iconfont icon-history" hover-class="cc-active" @tap="openPage('/pages/my-code/my-code')"></button>
</view>
@ -75,11 +75,15 @@
import {
showToast
} from 'common/script/util';
import {
HEALTH_SIGN
} from 'api/api';
import { mapState,mapMutations } from 'vuex';
export default {
data() {
return {
area: '请输入当前所在地区',
district: '请选择当前所在地区',
address: '',
status: [{
value: '0',
@ -87,7 +91,7 @@
},
{
value: '1',
name: '发烧(377.3度以上)',
name: '发烧(37.3度以上)',
},
{
value: '2',
@ -129,24 +133,23 @@
name: '否'
}
],
temperature: '',
current: 0,
tourCurrent: 0,
touchCurrent: 0,
animalHeat: 0,
healthTypeId: 0,
touchHubei: 0,
touchSick: 0,
agree: false,
};
},
computed: mapState('user', ['token']),
methods: {
...mapMutations('user', ['setHealthCode']),
handleSelectLocation() {
const that = this;
uni.chooseLocation({
success: function(res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
console.log('diqu', that.area, res.address)
that.area = res.address;
that.district = res.address;
},
});
},
@ -155,7 +158,7 @@
StateChange: function(evt) {
for (let i = 0; i < this.status.length; i++) {
if (this.status[i].value === evt.target.value) {
this.current = i;
this.healthTypeId = i;
break;
}
}
@ -165,7 +168,7 @@
TourChange: function(evt) {
for (let i = 0; i < this.tours.length; i++) {
if (this.tours[i].value === evt.target.value) {
this.tourCurrent = i;
this.touchHubei = i;
break;
}
}
@ -175,40 +178,95 @@
TouchChange: function(evt) {
for (let i = 0; i < this.touches.length; i++) {
if (this.touches[i].value === evt.target.value) {
this.touchCurrent = i;
this.touchSick = i;
break;
}
}
},
/**
* 提交基本信息
* 申请健康码
*/
addStroke() {
if (!this.area) {
showToast('请输入当前所在地区');
return;
}
if (!this.address) {
showToast('请输入当前所在地址');
return;
}
if (!this.status) {
showToast('请选择状态');
return;
}
if (!this.temperature) {
showToast('请输入当前体温');
return;
}
if (!this.agree) {
showToast('请确定是否为本人填写');
return;
async handleHealthSign() {
try {
if (!this.checkRules()) return;
const {
address,
animalHeat,
district,
healthTypeId,
hospital,
token,
touchHubei,
touchSick
} = this;
const params = {
param: {
address,
animalHeat,
district,
healthTypeId,
hospital,
token,
touchHubei,
touchSick
}
};
const res = await this.$http.post(HEALTH_SIGN, params);
const {
success,
code,
msg,
data
} = res.data;
if (success && code === 200) {
this.setHealthCode(data.healthCode)
this.success = true;
uni.reLaunch({
url: `/pages/index/index`,
});
} else {
uni.showToast({
title: msg || '申请健康码成功',
icon: 'none'
});
}
} catch (error) {
console.log('error: ', error);
if (error.msg) {
uni.showToast({
title: error.msg || '申请健康码失败',
icon: 'none'
});
}
}
console.log('信息提交');
uni.reLaunch({
url: `/pages/index/index`,
});
},
//
checkRules() {
const { district,address,healthTypeId,animalHeat,agree } = this;
if (!district || district === '请选择当前所在地区') {
showToast('请选择当前所在地区');
return;
}
if (!address) {
showToast('请输入当前所在地址');
return;
}
if (healthTypeId<0) {
showToast('请选择状态');
return;
}
if (!animalHeat) {
showToast('请输入当前体温');
return;
}
if (!agree) {
showToast('请确定是否为本人填写');
return;
}
return true;
},
},

210
pages/basic-info/basic-info.vue

@ -7,12 +7,12 @@
</view>
<view class="cu-form-group flex flex-direction padding-tb">
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>身份证</view>
<input placeholder="请输入身份证号" name="input" type="text" v-model="IDcard" />
<input placeholder="请输入身份证号" name="input" type="text" v-model="idCard" />
</view>
<view class="cu-form-group flex flex-direction padding-tb">
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>联系方式</view>
<input placeholder="请输入手机号码" name="input" type="number" v-model="phone" />
</view>
</view>
<view class="cu-form-group flex flex-direction padding-tb">
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>身份</view>
<radio-group class="block" @change="RadioChange">
@ -31,83 +31,159 @@
<input placeholder="请输入学号" name="input" type="text" v-model="studentID" />
</view>
</form>
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="confirm">确认提交</button>
</view>
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="handleSubmitUserInfo">确认提交</button>
</view>
</template>
<script>
import { showToast } from 'common/script/util';
import {
showToast
} from 'common/script/util';
import {
SUBMIT_USER_INFO
} from 'api/api';
export default {
data() {
return {
name: '',
IDcard: '',
phone: '',
identitys: [
{
value: '0',
name: '学生',
export default {
data() {
return {
name: '',
idCard: '',
phone: '',
identitys: [{
value: '0',
name: '学生',
},
{
value: '1',
name: '教师',
},
{
value: '2',
name: '工作人员',
},
],
studentID: '',
current: 0
};
},
methods: {
RadioChange: function(evt) {
for (let i = 0; i < this.identitys.length; i++) {
if (this.identitys[i].value === evt.target.value) {
this.current = i;
break;
}
}
},
{
value: '1',
name: '教师',
/**
* 提交基本信息
*/
async handleSubmitUserInfo() {
try {
if (!this.checkRules()) return;
const {
name,
idCard,
phone,
studentID,
current
} = this;
const params = {
param: {
idCard,
name,
no: studentID,
phone,
post: current
}
};
const res = await this.$http.post(SUBMIT_USER_INFO, params);
const {
success,
code,
msg,
data
} = res.data;
if (success && code === 200) {
console.log('data', data)
name = data.name;
idCard = data.idCard;
phone = data.phone;
studentID = data.no;
current = data.post;
this.success = true;
uni.reLaunch({
url: `/pages/apply-code/apply-code`,
});
} else {
uni.showToast({
title: msg || '提交基本信息成功',
icon: 'none'
});
}
} catch (error) {
console.log('error: ', error);
if (error.msg) {
uni.showToast({
title: error.msg || '提交基本信息失败',
icon: 'none'
});
}
}
},
{
value: '2',
name: '工作人员',
//
checkRules() {
const { name,idCard,phone,identitys,studentID } = this;
if (!name) {
showToast('请输入姓名');
return;
}
if (!this.verifyIdCard(idCard)) {
showToast('请输入正确的身份证号');
return;
}
if (!this.verifyPhone(phone)) {
showToast('请输入正确的手机号');
return false;
}
if (!identitys) {
showToast('请选择身份');
return;
}
if (!studentID) {
showToast('请输入学号');
return;
}
return true;
},
],
studentID: '',
current: 0
};
},
methods: {
RadioChange: function(evt) {
for (let i = 0; i < this.identitys.length; i++) {
if (this.identitys[i].value === evt.target.value) {
this.current = i;
break;
}
}
},
/**
* 提交基本信息
*/
confirm() {
if (!this.name) {
showToast('请输入姓名');
return;
}
if (!this.IDcard) {
showToast('请输入身份证号');
return;
}
if (!this.phone) {
showToast('请输入手机号');
return;
}
if (!this.identitys) {
showToast('请选择身份');
return;
}
if (!this.studentID) {
showToast('请输入学号');
return;
}
console.log('信息提交');
uni.reLaunch({
url: `/pages/index/components/mine`,
});
},
/**
* 验证手机号格式
* @param {string} phone 手机号
*/
verifyPhone(phone) {
const phoneExg = /^1\d{10}$/;
return phoneExg.test(phone);
},
},
};
/**
* 验证身份证号格式
* @param {string} idCard 身份证号
*/
verifyIdCard(idCard) {
const idCardExg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
return idCardExg.test(idCard);
},
},
};
</script>
<style lang="scss" scoped>
.primary-btn{
.primary-btn {
border-radius: 15rpx;
}
</style>

14
pages/index/components/home.vue

@ -1,17 +1,17 @@
<template>
<view class="content flex flex-direction">
<view v-if="coad" style="position: relative;">
<view v-if="healthCode" 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">
<image class="healthy-code" src="../../../static/img/qrcode.png" :style="{'background':healthyCodeColor}"></image>
<image class="healthy-code" :src="healthCode"></image>
</view>
</view>
<image v-else src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9jhx9v1rh8VuBAojvYxrYvg*uVMAXaD2En3CPiaHx7AWMjFTafVrGxwJR4jZd5s4ProhQT1ceDVquyQR7HVquBKk!/b&bo=7gLuAe4C7gEDORw!&rf=viewer_4&t=5"
class="bg"></image>
<view :class="coad ? 'box1' : 'box'">
<view v-show="!coad" class="cu-card flex margin bg-white shadow card-radius" hover-class="cc-active" @tap="openPage('/pages/basic-info/basic-info')">
<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 class="flex align-center padding">
<view class="round lg cu-avatar icon1">
<view class="iconfont icon-qrcode"></view>
@ -61,14 +61,14 @@
</template>
<script>
import { mapState } from 'vuex';
export default {
name: 'Home',
data() {
return {
coad: false,
healthyCodeColor: '#11A20D',
}
}
},
computed: mapState('user', ['healthCode']),
};
</script>

11
pages/index/components/mine.vue

@ -10,7 +10,9 @@
<view class="text-xl">{{ userInfo.nickName }}</view>
<view class="text-df padding-top-xs">{{ userInfo.classes }}</view>
</view>
<view :style="{'color':userInfo.healthyCodeColor}" class="iconfont icon-qrcode healthy-coad"></view>
<!-- <image class="healthy-code" :src="healthCode"></image> -->
<image class="healthy-code" :src="healthCode"></image>
</view>
</view>
<!-- 列表 -->
@ -39,6 +41,7 @@
</template>
<script>
import { mapState } from 'vuex';
export default {
name: 'Mine',
data() {
@ -51,6 +54,7 @@
},
};
},
computed: mapState('user', ['healthCode']),
};
</script>
@ -59,8 +63,9 @@
overflow: hidden;
}
.healthy-coad {
font-size: 40px;
.healthy-code {
width: 70rpx;
height: 70rpx;
}
.more {

141
pages/my-code/my-code.vue

@ -2,52 +2,30 @@
<view>
<!-- 添加 -->
<button class="shadow round bg-cyan add-btn iconfont icon-plus" hover-class="cc-active" @tap="openPage('/pages/apply-code/apply-code')"></button>
<view class="card radius shadow-warp bg-white margin" :key="index" v-for="(item,index) in tableList">
<view class="card-head solid-bottom">
<view class="round bg-green cu-avatar">{{ index+1 }}</view>
<view class="flex flex-sub"></view>
<view class="flex justify-end">
<text class="text-grey text-xl">{{ item.date }}</text>
<view class="cu-timeline" :key="index" v-for="(item,index) in tableList">
<view class="cu-time">{{ item.time }}</view>
<view class="cu-item text-blue cuIcon-locationfill">
<view class="content shadow-blur bg-blue light">
{{ item.district }}{{ item.address }}
</view>
</view>
<view class="card-content padding-lr">
<view class="data-wrap">
<view class="data-item">
<view class="data-title">当前所在地区
<text class="text-gray padding-left-xs">{{ item.area }}</text>
</view>
</view>
<view class="data-item">
<view class="data-title">当前所在详细地址:
<text class="text-gray padding-left-xs">{{ item.address }}</text>
</view>
</view>
<view class="data-item">
<view class="data-title">当前状态:
<text class="text-gray padding-left-xs">{{ item.state }}</text>
</view>
<view class="cu-item text-green cuIcon-wefill">
<view class="content shadow-blur light"
:class="item.healthLevel === 0 ? 'bg-green' : item.healthLevel === 1 ? 'bg-yellow' : 'bg-red'"
>
<view class="margin-bottom">
体温{{ item.animalHeat }}状态{{ item.healthTypeId }}
</view>
<view class="data-item">
<view class="data-title">就诊医院:
<text class="text-gray padding-left-xs">{{ item.hospital }}</text>
</view>
</view>
<view class="data-item">
<view class="data-title">最近14天是否有武汉居住史旅游史或武汉亲戚来访
<text class="text-gray padding-left-xs">{{ item.tour }}</text>
</view>
</view>
<view class="data-item">
<view class="data-title">最近14天是否有新冠肺炎患者或疑似患者接触史
<text class="text-gray padding-left-xs">{{ item.touch }}</text>
</view>
</view>
<view class="data-item">
<view class="data-title">当前体温:
<text class="text-gray padding-left-xs">{{ item.temperature }}</text>
</view>
<view>
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchHubei === 1">
武汉接触史
</text>
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchSick === 1">
患者接触史
</text>
</view>
<view class="margin-top" v-show="item.hospital">就诊医院:{{ item.hospital }}</view>
</view>
</view>
</view>
@ -64,64 +42,37 @@
data() {
return {
tableList: [{
date: '2020-02-05',
area: '太原',
time: '2020-02-05',
district: '太原',
address: '小店',
state: '正常',
hospital: '无',
tour: '否',
touch: '否',
temperature: '36'
healthTypeId: '正常',
hospital: '是深V',
touchHubei: 1,
touchSick: 1,
animalHeat: 0,
healthLevel: 0, // 0 1 2
},
{
date: '2020-02-05',
area: '太原',
address: '迎泽',
state: '正常',
hospital: '无',
tour: '否',
touch: '否',
temperature: '36.5'
},
{
date: '2020-02-05',
area: '太原',
address: '迎泽',
state: '正常',
hospital: '无',
tour: '否',
touch: '否',
temperature: '36.3'
},
{
date: '2020-02-05',
area: '太原',
address: '迎泽',
state: '正常',
hospital: '无',
tour: '否',
touch: '否',
temperature: '36.5'
},
{
date: '2020-02-05',
area: '太原',
address: '迎泽',
state: '正常',
hospital: '无',
tour: '否',
touch: '否',
temperature: '36'
time: '2020-02-05',
district: '太原',
address: '小店',
healthTypeId: '正常',
hospital: '',
touchHubei: 1,
touchSick: 0,
animalHeat: 0,
healthLevel: 1
},
{
date: '2020-02-05',
area: '太原',
address: '迎泽',
state: '正常',
hospital: '无',
tour: '否',
touch: '否',
temperature: '36'
time: '2020-02-05',
district: '太原',
address: '小店',
healthTypeId: '正常',
hospital: '',
touchHubei: 1,
touchSick: 0,
animalHeat: 0,
healthLevel: 2
}
],
};

9
store/modules/user/mutations.js

@ -34,6 +34,15 @@ const mutations = {
state.user = { ...user };
uni.setStorageSync('user', JSON.stringify(user));
},
/**
* 设置健康码
* @param {object} state
* @param {string} data
*/
setHealthCode(state, data) {
state.healthCode = data;
},
};
export default mutations;

1
store/modules/user/state.js

@ -1,6 +1,7 @@
const state = {
token: '',
user: null,
healthCode: '', // 健康码
};
export default state;

Loading…
Cancel
Save