Browse Source

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

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

4
components/timeline/timeline.vue

@ -24,9 +24,9 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return {}; return {};
}, },
}; };
</script> </script>

2
config/api/api.js

@ -35,4 +35,4 @@ export const SCAN_SIGN = `${sites}/upload`;
export const GET_JOURNEYS = `${journeys}/info`; 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": [ "pages": [
// {
// "path": "pages/my-code/my-code",
// "style": {
// "navigationBarTitleText": "我的健康打卡"
// }
// },
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {

79
pages/add-stroke/add-stroke.vue

@ -33,7 +33,7 @@
以上信息是我本人填写本人对信息的真实性和完整性负责 以上信息是我本人填写本人对信息的真实性和完整性负责
</view> </view>
</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> <button class="shadow round bg-cyan history-btn iconfont icon-history" hover-class="cc-active" @tap="openPage('/pages/my-trips/my-trips')"></button>
</view> </view>
@ -43,6 +43,7 @@
import { showToast } from 'common/script/util'; import { showToast } from 'common/script/util';
import UniCalendar from 'components/uni-calendar/uni-calendar.vue'; import UniCalendar from 'components/uni-calendar/uni-calendar.vue';
import DateSelector from './components/date-selector.vue'; import DateSelector from './components/date-selector.vue';
import { SUBMIT_JOURNEYS } from 'api/api';
export default { export default {
components: {UniCalendar,DateSelector}, components: {UniCalendar,DateSelector},
@ -94,8 +95,8 @@ export default {
* @param {string} start 开始时间 * @param {string} start 开始时间
* @param {string} end 截止时间 * @param {string} end 截止时间
*/ */
getData(start, end) { getStartData(start) {
console.log('出发时间 start, end: ', start, end); console.log('出发时间 start: ', start);
}, },
/** /**
@ -103,14 +104,72 @@ export default {
* @param {string} start 开始时间 * @param {string} start 开始时间
* @param {string} end 截止时间 * @param {string} end 截止时间
*/ */
getEndData(start, end) { getEndData(end) {
console.log('抵达时间 start, end: ', start, end); console.log('抵达时间 end: ', end);
}, },
/** /**
* 提交基本信息 * 添加行程
*/ */
addStroke() { 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'
});
}
}
},
//
checkRules() {
const { district,address,healthTypeId,animalHeat,agree } = this;
if (!this.transports) { if (!this.transports) {
showToast('请选择身份'); showToast('请选择身份');
return; return;
@ -123,12 +182,8 @@ export default {
showToast('请确定是否为本人填写'); showToast('请确定是否为本人填写');
return; return;
} }
console.log('信息提交'); return true;
uni.reLaunch({
url: `/pages/index/index`,
});
}, },
}, },
}; };
</script> </script>

120
pages/apply-code/apply-code.vue

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

120
pages/basic-info/basic-info.vue

@ -7,7 +7,7 @@
</view> </view>
<view class="cu-form-group flex flex-direction padding-tb"> <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> <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>
<view class="cu-form-group flex flex-direction padding-tb"> <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> <view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>联系方式</view>
@ -31,21 +31,25 @@
<input placeholder="请输入学号" name="input" type="text" v-model="studentID" /> <input placeholder="请输入学号" name="input" type="text" v-model="studentID" />
</view> </view>
</form> </form>
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="confirm">确认提交</button> <button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="handleSubmitUserInfo">确认提交</button>
</view> </view>
</template> </template>
<script> <script>
import { showToast } from 'common/script/util'; import {
showToast
} from 'common/script/util';
import {
SUBMIT_USER_INFO
} from 'api/api';
export default { export default {
data() { data() {
return { return {
name: '', name: '',
IDcard: '', idCard: '',
phone: '', phone: '',
identitys: [ identitys: [{
{
value: '0', value: '0',
name: '学生', name: '学生',
}, },
@ -75,39 +79,111 @@ export default {
/** /**
* 提交基本信息 * 提交基本信息
*/ */
confirm() { async handleSubmitUserInfo() {
if (!this.name) { 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'
});
}
}
},
//
checkRules() {
const { name,idCard,phone,identitys,studentID } = this;
if (!name) {
showToast('请输入姓名'); showToast('请输入姓名');
return; return;
} }
if (!this.IDcard) { if (!this.verifyIdCard(idCard)) {
showToast('请输入身份证号'); showToast('请输入正确的身份证号');
return; return;
} }
if (!this.phone) { if (!this.verifyPhone(phone)) {
showToast('请输入手机号'); showToast('请输入正确的手机号');
return; return false;
} }
if (!this.identitys) { if (!identitys) {
showToast('请选择身份'); showToast('请选择身份');
return; return;
} }
if (!this.studentID) { if (!studentID) {
showToast('请输入学号'); showToast('请输入学号');
return; return;
} }
console.log('信息提交'); return true;
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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.primary-btn{ .primary-btn {
border-radius: 15rpx; border-radius: 15rpx;
} }
</style> </style>

14
pages/index/components/home.vue

@ -1,17 +1,17 @@
<template> <template>
<view class="content flex flex-direction"> <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" <image src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9joZ6fC6TxFlt9mW4UhUn2PEgUne7OUt4q4mNE.k9gU.rSr8Eu*pFToZoVwUOEGDrKMycDqdn1mLFGE1dxYTGUcE!/b&bo=7gKRAu4CkQIDWXw!&rf=viewer_4&t=5"
class="bg1"></image> class="bg1"></image>
<view class="bg-code"> <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>
</view> </view>
<image v-else src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9jhx9v1rh8VuBAojvYxrYvg*uVMAXaD2En3CPiaHx7AWMjFTafVrGxwJR4jZd5s4ProhQT1ceDVquyQR7HVquBKk!/b&bo=7gLuAe4C7gEDORw!&rf=viewer_4&t=5" <image v-else src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9jhx9v1rh8VuBAojvYxrYvg*uVMAXaD2En3CPiaHx7AWMjFTafVrGxwJR4jZd5s4ProhQT1ceDVquyQR7HVquBKk!/b&bo=7gLuAe4C7gEDORw!&rf=viewer_4&t=5"
class="bg"></image> class="bg"></image>
<view :class="coad ? 'box1' : 'box'"> <view :class="healthCode ? '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 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="flex align-center padding">
<view class="round lg cu-avatar icon1"> <view class="round lg cu-avatar icon1">
<view class="iconfont icon-qrcode"></view> <view class="iconfont icon-qrcode"></view>
@ -61,14 +61,14 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex';
export default { export default {
name: 'Home', name: 'Home',
data() { data() {
return { return {
coad: false,
healthyCodeColor: '#11A20D',
}
} }
},
computed: mapState('user', ['healthCode']),
}; };
</script> </script>

11
pages/index/components/mine.vue

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

139
pages/my-code/my-code.vue

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

9
store/modules/user/mutations.js

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

1
store/modules/user/state.js

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

Loading…
Cancel
Save