Browse Source

领取健康码

remotes/origin/HEAD
songsong428 5 years ago
parent
commit
426cd84b6f
  1. 10
      pages.json
  2. 275
      pages/apply-code/apply-code.vue
  3. 248
      pages/get-code/get-code.vue
  4. 4
      pages/index/components/home.vue
  5. 0
      pages/punch-the-clock/components/date-selector.vue
  6. 6
      pages/punch-the-clock/punch-the-clock.vue

10
pages.json

@ -1,9 +1,5 @@
{ {
"pages": [ "pages": [
{
"path": "pages/statistics/statistics",
"style": { "navigationBarTitleText": "统计" }
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
@ -34,7 +30,7 @@
} }
}, },
{ {
"path": "pages/add-stroke/add-stroke", "path": "pages/punch-the-clock/punch-the-clock",
"style": { "style": {
"navigationBarTitleText": "添加行程" "navigationBarTitleText": "添加行程"
} }
@ -45,6 +41,10 @@
"navigationBarTitleText": "申请健康码" "navigationBarTitleText": "申请健康码"
} }
}, },
{
"path": "pages/statistics/statistics",
"style": { "navigationBarTitleText": "统计" }
},
{ {
"path": "pages/my-code/my-code", "path": "pages/my-code/my-code",
"style": { "style": {

275
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 placeholder="请输入当前所在地区" name="input" type="text" v-model="area" /> <input @tap="handleSelectLocation" placeholder="请输入当前所在地区" name="input" type="btn" v-model="area" />
</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>
@ -67,161 +67,178 @@
</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="addStroke">确认提交</button>
<!-- 历史 --> <!-- 历史 -->
<button class="shadow round text-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>
</template> </template>
<script> <script>
import { showToast } from 'common/script/util'; import {
showToast
} from 'common/script/util';
export default { export default {
data() { data() {
return { return {
area: '', area: '请输入当前所在地区',
address: '', address: '',
status: [ status: [{
{ value: '0',
value: '0', name: '正常',
name: '正常', },
}, {
{ value: '1',
value: '1', name: '发烧(377.3度以上)',
name: '发烧(377.3度以上)', },
}, {
{ value: '2',
value: '2', name: '咳嗽',
name: '咳嗽', },
}, {
{ value: '3',
value: '3', name: '咽喉疼痛',
name: '咽喉疼痛', },
}, {
{ value: '4',
value: '4', name: '流鼻涕',
name: '流鼻涕', },
}, {
{ value: '5',
value: '5', name: '头痛',
name: '头痛', },
}, {
{ value: '6',
value: '6', name: '其他',
name: '其他', }
} ],
], hospital: '',
hospital: '', tours: [{
tours: [ value: 1,
{ name: '是'
value: 1, },
name: '是' {
}, value: 0,
{ name: '否'
value: 0, }
name: '否' ],
} touches: [{
], value: 1,
touches: [ name: '是'
{ },
value: 1, {
name: '是' value: 0,
}, name: '否'
{ }
value: 0, ],
name: '否' temperature: '',
current: 0,
tourCurrent: 0,
touchCurrent: 0,
agree: false,
};
},
methods: {
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;
},
});
},
//
StateChange: function(evt) {
for (let i = 0; i < this.status.length; i++) {
if (this.status[i].value === evt.target.value) {
this.current = i;
break;
}
} }
], },
temperature: '',
current: 0, //
tourCurrent: 0, TourChange: function(evt) {
touchCurrent: 0, for (let i = 0; i < this.tours.length; i++) {
agree: false, if (this.tours[i].value === evt.target.value) {
}; this.tourCurrent = i;
}, break;
methods: { }
//
StateChange: function(evt) {
for (let i = 0; i < this.status.length; i++) {
if (this.status[i].value === evt.target.value) {
this.current = i;
break;
} }
} },
},
// //
TourChange: function(evt) { TouchChange: function(evt) {
for (let i = 0; i < this.tours.length; i++) { for (let i = 0; i < this.touches.length; i++) {
if (this.tours[i].value === evt.target.value) { if (this.touches[i].value === evt.target.value) {
this.tourCurrent = i; this.touchCurrent = i;
break; break;
}
} }
} },
},
// /**
TouchChange: function(evt) { * 提交基本信息
for (let i = 0; i < this.touches.length; i++) { */
if (this.touches[i].value === evt.target.value) { addStroke() {
this.touchCurrent = i; if (!this.area) {
break; showToast('请输入当前所在地区');
return;
} }
} if (!this.address) {
}, showToast('请输入当前所在地址');
return;
}
if (!this.status) {
showToast('请选择状态');
return;
}
if (!this.temperature) {
showToast('请输入当前体温');
return;
}
if (!this.agree) {
showToast('请确定是否为本人填写');
return;
}
console.log('信息提交');
uni.reLaunch({
url: `/pages/index/index`,
});
},
/**
* 提交基本信息
*/
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;
}
console.log('信息提交');
uni.reLaunch({
url: `/pages/index/index`,
});
}, },
};
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.agree-box{ .agree-box {
width: 70rpx; width: 70rpx;
} }
.agree-text{
.agree-text {
line-height: 60rpx; line-height: 60rpx;
} }
.primary-btn{
.primary-btn {
border-radius: 15rpx; border-radius: 15rpx;
} }
.history-btn{
.history-btn {
position: fixed; position: fixed;
top: 30rpx; bottom: 40rpx;
right: 30rpx; right: 40rpx;
width: 96rpx; width: 96rpx;
height: 96rpx; height: 96rpx;
line-height: 96rpx; line-height: 96rpx;
padding: 0; padding: 0;
} }
.history-btn::after{
.history-btn::after {
border: none; border: none;
} }
</style> </style>

248
pages/get-code/get-code.vue

@ -1,25 +1,239 @@
<template> <template>
<view> <view>
<button @tap="handleSelectLocation">选择位置</button> <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 placeholder="请输入当前所在地区" name="input" type="text" v-model="area" />
<button @tap="handleSelectLocation">选择位置</button>
</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="address" />
</view>
<view class="cu-form-group flex flex-direction padding-top">
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>当前状态</view>
<radio-group class="block" @change="StateChange">
<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>
<view class="flex-sub" style="font-size: 34rpx;">{{ state.name }}</view>
</label>
</view>
</view>
</radio-group>
</view>
<view class="cu-form-group flex flex-direction padding-tb">
<view class="title padding-bottom-sm">就诊医院若无填无</view>
<input placeholder="请输入就诊医院" name="input" type="text" v-model="hospital" />
</view>
<view class="cu-form-group flex flex-direction padding-top">
<view class="title padding-bottom-sm">最近14天是否有武汉居住史旅游史或武汉亲戚来访</view>
<radio-group class="block" @change="TourChange">
<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>
<text class="flex-sub" style="font-size: 34rpx;">{{ tour.name }}</text>
</label>
</view>
</view>
</radio-group>
</view>
<view class="cu-form-group flex flex-direction padding-top">
<view class="title padding-bottom-sm">最近14天是否有新冠肺炎患者或疑似患者接触史</view>
<radio-group class="block" @change="TouchChange">
<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>
<text class="flex-sub" style="font-size: 34rpx;">{{ touch.name }}</text>
</label>
</view>
</view>
</radio-group>
</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" />
</view>
</form>
<view class="margin flex flex-wrap">
<view @click="agree = !agree" class="iconfont agree-box" :class="[agree ? 'text-blue icon-check-square': 'text-gray icon-border']"></view>
<view class="text-df text-black flex-sub agree-text">
以上信息是我本人填写本人对信息的真实性和完整性负责
</view>
</view>
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="addStroke">确认提交</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>
</template> </template>
<script> <script>
import { showToast } from 'common/script/util';
export default { export default {
data() { data() {
return {}; return {
}, area: '',
methods: { address: '',
handleSelectLocation() { status: [
uni.chooseLocation({ {
success: function(res) { value: '0',
console.log('位置名称:' + res.name); name: '正常',
console.log('详细地址:' + res.address); },
console.log('纬度:' + res.latitude); {
console.log('经度:' + res.longitude); value: '1',
}, name: '发烧(377.3度以上)',
}); },
}, {
}, value: '2',
name: '咳嗽',
},
{
value: '3',
name: '咽喉疼痛',
},
{
value: '4',
name: '流鼻涕',
},
{
value: '5',
name: '头痛',
},
{
value: '6',
name: '其他',
}
],
hospital: '',
tours: [
{
value: 1,
name: '是'
},
{
value: 0,
name: '否'
}
],
touches: [
{
value: 1,
name: '是'
},
{
value: 0,
name: '否'
}
],
temperature: '',
current: 0,
tourCurrent: 0,
touchCurrent: 0,
agree: false,
};
},
methods: {
handleSelectLocation() {
uni.chooseLocation({
success: function(res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
},
});
},
//
StateChange: function(evt) {
for (let i = 0; i < this.status.length; i++) {
if (this.status[i].value === evt.target.value) {
this.current = i;
break;
}
}
},
//
TourChange: function(evt) {
for (let i = 0; i < this.tours.length; i++) {
if (this.tours[i].value === evt.target.value) {
this.tourCurrent = i;
break;
}
}
},
//
TouchChange: function(evt) {
for (let i = 0; i < this.touches.length; i++) {
if (this.touches[i].value === evt.target.value) {
this.touchCurrent = 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;
}
console.log('信息提交');
uni.reLaunch({
url: `/pages/index/index`,
});
},
},
}; };
</script> </script>
<style lang="scss" scoped>
.agree-box{
width: 70rpx;
}
.agree-text{
line-height: 60rpx;
}
.primary-btn{
border-radius: 15rpx;
}
.history-btn{
position: fixed;
bottom: 40rpx;
right: 40rpx;
width: 96rpx;
height: 96rpx;
line-height: 96rpx;
padding: 0;
}
.history-btn::after{
border: none;
}
</style>

4
pages/index/components/home.vue

@ -11,7 +11,7 @@
class="bg"></image> class="bg"></image>
<view :class="coad ? 'box1' : 'box'"> <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/get-code/get-code')"> <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="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>
@ -33,7 +33,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="cu-card flex margin bg-white shadow card-radius" hover-class="cc-active" @tap="openPage('/pages/add-stroke/add-stroke')"> <view class="cu-card flex margin bg-white shadow card-radius" hover-class="cc-active" @tap="openPage('/pages/punch-the-clock/punch-the-clock')">
<view class="flex align-center padding"> <view class="flex align-center padding">
<view class="round lg cu-avatar icon3"> <view class="round lg cu-avatar icon3">
<view class="iconfont icon-car"></view> <view class="iconfont icon-car"></view>

0
pages/add-stroke/components/date-selector.vue → pages/punch-the-clock/components/date-selector.vue

6
pages/add-stroke/add-stroke.vue → pages/punch-the-clock/punch-the-clock.vue

@ -35,7 +35,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="addStroke">确认提交</button>
<!-- 历史 --> <!-- 历史 -->
<button class="shadow round text-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>
</template> </template>
@ -145,8 +145,8 @@ export default {
} }
.history-btn{ .history-btn{
position: fixed; position: fixed;
top: 30rpx; bottom: 40rpx;
right: 30rpx; right: 40rpx;
width: 96rpx; width: 96rpx;
height: 96rpx; height: 96rpx;
line-height: 96rpx; line-height: 96rpx;
Loading…
Cancel
Save