Browse Source

领取健康码

remotes/origin/HEAD
songsong428 5 years ago
parent
commit
426cd84b6f
  1. 10
      pages.json
  2. 55
      pages/apply-code/apply-code.vue
  3. 216
      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": [
{
"path": "pages/statistics/statistics",
"style": { "navigationBarTitleText": "统计" }
},
{
"path": "pages/index/index",
"style": {
@ -34,7 +30,7 @@
}
},
{
"path": "pages/add-stroke/add-stroke",
"path": "pages/punch-the-clock/punch-the-clock",
"style": {
"navigationBarTitleText": "添加行程"
}
@ -45,6 +41,10 @@
"navigationBarTitleText": "申请健康码"
}
},
{
"path": "pages/statistics/statistics",
"style": { "navigationBarTitleText": "统计" }
},
{
"path": "pages/my-code/my-code",
"style": {

55
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 placeholder="请输入当前所在地区" name="input" type="text" v-model="area" />
<input @tap="handleSelectLocation" placeholder="请输入当前所在地区" name="input" type="btn" v-model="area" />
</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>
@ -67,20 +67,21 @@
</view>
<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>
</template>
<script>
import { showToast } from 'common/script/util';
import {
showToast
} from 'common/script/util';
export default {
export default {
data() {
return {
area: '',
area: '请输入当前所在地区',
address: '',
status: [
{
status: [{
value: '0',
name: '正常',
},
@ -110,8 +111,7 @@ export default {
}
],
hospital: '',
tours: [
{
tours: [{
value: 1,
name: '是'
},
@ -120,8 +120,7 @@ export default {
name: '否'
}
],
touches: [
{
touches: [{
value: 1,
name: '是'
},
@ -138,6 +137,20 @@ export default {
};
},
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++) {
@ -199,29 +212,33 @@ export default {
},
},
};
};
</script>
<style lang="scss" scoped>
.agree-box{
.agree-box {
width: 70rpx;
}
.agree-text{
.agree-text {
line-height: 60rpx;
}
.primary-btn{
.primary-btn {
border-radius: 15rpx;
}
.history-btn{
.history-btn {
position: fixed;
top: 30rpx;
right: 30rpx;
bottom: 40rpx;
right: 40rpx;
width: 96rpx;
height: 96rpx;
line-height: 96rpx;
padding: 0;
}
.history-btn::after{
.history-btn::after {
border: none;
}
</style>

216
pages/get-code/get-code.vue

@ -1,13 +1,142 @@
<template>
<view>
<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>
</template>
<script>
import { showToast } from 'common/script/util';
export default {
data() {
return {};
return {
area: '',
address: '',
status: [
{
value: '0',
name: '正常',
},
{
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() {
@ -20,6 +149,91 @@ export default {
},
});
},
//
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>
<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>
<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="round lg cu-avatar icon1">
<view class="iconfont icon-qrcode"></view>
@ -33,7 +33,7 @@
</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="round lg cu-avatar icon3">
<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>
<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>
</template>
@ -145,8 +145,8 @@ export default {
}
.history-btn{
position: fixed;
top: 30rpx;
right: 30rpx;
bottom: 40rpx;
right: 40rpx;
width: 96rpx;
height: 96rpx;
line-height: 96rpx;
Loading…
Cancel
Save