|
|
@ -2,24 +2,40 @@ |
|
|
|
<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> |
|
|
|
<view class="title padding-bottom-sm"> |
|
|
|
<span class="text-red padding-right-xs">*</span>当前所在地区 |
|
|
|
</view> |
|
|
|
<view class="flex align-center"> |
|
|
|
<input class="flex-sub padding-left-xs" @tap="handleSelectLocation" placeholder="请选择当前所在地区" name="input" type="btn" |
|
|
|
v-model="district" /> |
|
|
|
<input |
|
|
|
@tap="handleSelectLocation" |
|
|
|
class="flex-sub padding-left-xs" |
|
|
|
name="input" |
|
|
|
placeholder="请选择当前所在地区" |
|
|
|
type="btn" |
|
|
|
v-model="district" |
|
|
|
/> |
|
|
|
<text class="cuIcon-location timer"></text> |
|
|
|
</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> |
|
|
|
<input placeholder="请输入详细地址(含门牌号)" name="input" type="text" v-model="address" /> |
|
|
|
<view class="title padding-bottom-sm"> |
|
|
|
<span class="text-red padding-right-xs">*</span>当前所在详细地址 |
|
|
|
</view> |
|
|
|
<input name="input" placeholder="请输入详细地址(含门牌号)" 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="title padding-bottom-sm"> |
|
|
|
<span class="text-red padding-right-xs">*</span>当前状态 |
|
|
|
</view> |
|
|
|
<radio-group @change="StateChange" class="block"> |
|
|
|
<view class="cu-list menu text-left"> |
|
|
|
<view class="cu-item" v-for="(state,index) in status" :key="index"> |
|
|
|
<view :key="index" class="cu-item" v-for="(state,index) in status"> |
|
|
|
<label class="flex justify-between align-center"> |
|
|
|
<radio class="round margin-right-xs" :checked="index === healthTypeId" :value="state.id"></radio> |
|
|
|
<radio |
|
|
|
:checked="index === healthTypeId" |
|
|
|
:value="state.id" |
|
|
|
class="round margin-right-xs" |
|
|
|
></radio> |
|
|
|
<view class="flex-sub" style="font-size: 34rpx;">{{ state.name }}</view> |
|
|
|
</label> |
|
|
|
</view> |
|
|
@ -28,15 +44,19 @@ |
|
|
|
</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" /> |
|
|
|
<input name="input" placeholder="请输入就诊医院" 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"> |
|
|
|
<radio-group @change="TourChange" class="block"> |
|
|
|
<view class="flex"> |
|
|
|
<view class="flex-sub margin-tb-sm" v-for="(tour,index) in tours" :key="index"> |
|
|
|
<view :key="index" class="flex-sub margin-tb-sm" v-for="(tour,index) in tours"> |
|
|
|
<label class="flex justify-between align-center"> |
|
|
|
<radio class="round margin-right-xs" :checked="index === touchHubei" :value="tour.value"></radio> |
|
|
|
<radio |
|
|
|
:checked="index === touchHubei" |
|
|
|
:value="tour.value" |
|
|
|
class="round margin-right-xs" |
|
|
|
></radio> |
|
|
|
<text class="flex-sub" style="font-size: 34rpx;">{{ tour.name }}</text> |
|
|
|
</label> |
|
|
|
</view> |
|
|
@ -46,11 +66,15 @@ |
|
|
|
|
|
|
|
<view class="cu-form-group flex flex-direction padding-top"> |
|
|
|
<view class="title padding-bottom-sm">最近14天是否有新冠肺炎患者或疑似患者接触史</view> |
|
|
|
<radio-group class="block" @change="TouchChange"> |
|
|
|
<radio-group @change="TouchChange" class="block"> |
|
|
|
<view class="flex"> |
|
|
|
<view class="flex-sub margin-tb-sm" v-for="(touch,index) in touches" :key="index"> |
|
|
|
<view :key="index" class="flex-sub margin-tb-sm" v-for="(touch,index) in touches"> |
|
|
|
<label class="flex justify-between align-center"> |
|
|
|
<radio class="round margin-right-xs" :checked="index === touchSick" :value="touch.value"></radio> |
|
|
|
<radio |
|
|
|
:checked="index === touchSick" |
|
|
|
:value="touch.value" |
|
|
|
class="round margin-right-xs" |
|
|
|
></radio> |
|
|
|
<text class="flex-sub" style="font-size: 34rpx;">{{ touch.name }}</text> |
|
|
|
</label> |
|
|
|
</view> |
|
|
@ -58,50 +82,55 @@ |
|
|
|
</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="animalHeat" /> |
|
|
|
<view class="title padding-bottom-sm"> |
|
|
|
<span class="text-red padding-right-xs">*</span>当前体温(℃) |
|
|
|
</view> |
|
|
|
<input name="input" placeholder="请输入当前真实体温" type="number" v-model="animalHeat" /> |
|
|
|
</view> |
|
|
|
</form> |
|
|
|
<user-agreement @changeIntentions="changeIntentions"></user-agreement> |
|
|
|
<button class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="handleHealthSign">确认提交</button> |
|
|
|
<button @tap="handleHealthSign" class="bg-cyan margin primary-btn" hover-class="cc-active">确认提交</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 |
|
|
|
@tap="openPage('/pages/my-code/my-code')" |
|
|
|
class="shadow round bg-cyan history-btn iconfont icon-history" |
|
|
|
hover-class="cc-active" |
|
|
|
></button> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
showToast |
|
|
|
} from 'common/script/util'; |
|
|
|
import { |
|
|
|
HEALTH_SIGN |
|
|
|
} from 'api/api'; |
|
|
|
import { |
|
|
|
mapState, |
|
|
|
mapMutations |
|
|
|
} from 'vuex'; |
|
|
|
import { showToast } from 'common/script/util'; |
|
|
|
import { HEALTH_SIGN } from 'api/api'; |
|
|
|
import { mapState, mapMutations } from 'vuex'; |
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
district: '请选择当前所在地区', |
|
|
|
address: '', |
|
|
|
// status: [], |
|
|
|
hospital: '', |
|
|
|
tours: [{ |
|
|
|
tours: [ |
|
|
|
{ |
|
|
|
value: '0', |
|
|
|
name: '否' |
|
|
|
}, { |
|
|
|
name: '否', |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '1', |
|
|
|
name: '是' |
|
|
|
}], |
|
|
|
touches: [{ |
|
|
|
name: '是', |
|
|
|
}, |
|
|
|
], |
|
|
|
touches: [ |
|
|
|
{ |
|
|
|
value: '0', |
|
|
|
name: '否' |
|
|
|
}, { |
|
|
|
name: '否', |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '1', |
|
|
|
name: '是' |
|
|
|
}], |
|
|
|
name: '是', |
|
|
|
}, |
|
|
|
], |
|
|
|
animalHeat: 0, |
|
|
|
healthTypeId: 0, |
|
|
|
touchHubei: 0, |
|
|
@ -150,7 +179,7 @@ |
|
|
|
|
|
|
|
// 接触 |
|
|
|
TouchChange(evt) { |
|
|
|
console.log(this.touches,'aa') |
|
|
|
console.log(this.touches, 'aa'); |
|
|
|
for (let b = 0; b < this.touches.length; b++) { |
|
|
|
if (this.touches[b].value === evt.target.value) { |
|
|
|
this.touchSick = b; |
|
|
@ -174,7 +203,7 @@ |
|
|
|
hospital, |
|
|
|
token, |
|
|
|
touchHubei, |
|
|
|
touchSick |
|
|
|
touchSick, |
|
|
|
} = this; |
|
|
|
const params = { |
|
|
|
param: { |
|
|
@ -185,31 +214,26 @@ |
|
|
|
hospital, |
|
|
|
token, |
|
|
|
touchHubei, |
|
|
|
touchSick |
|
|
|
} |
|
|
|
touchSick, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|
|
|
|
const res = await this.$http.post(HEALTH_SIGN, params); |
|
|
|
const { |
|
|
|
success, |
|
|
|
code, |
|
|
|
msg, |
|
|
|
data |
|
|
|
} = res.data; |
|
|
|
const { success, code, msg, data } = res.data; |
|
|
|
if (success && code === 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: '申请健康码成功', |
|
|
|
duration: 2000 |
|
|
|
duration: 2000, |
|
|
|
}); |
|
|
|
this.success = true; |
|
|
|
this.setHealthCode(data.healthCode) |
|
|
|
this.setHealthCode(data.healthCode); |
|
|
|
uni.reLaunch({ |
|
|
|
url: `/pages/index/index`, |
|
|
|
}); |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: msg || '申请健康码失败', |
|
|
|
icon: 'none' |
|
|
|
icon: 'none', |
|
|
|
}); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
@ -217,7 +241,7 @@ |
|
|
|
if (error.msg) { |
|
|
|
uni.showToast({ |
|
|
|
title: error.msg || '申请健康码失败', |
|
|
|
icon: 'none' |
|
|
|
icon: 'none', |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -225,13 +249,7 @@ |
|
|
|
|
|
|
|
// 验证信息 |
|
|
|
checkRules() { |
|
|
|
const { |
|
|
|
district, |
|
|
|
address, |
|
|
|
healthTypeId, |
|
|
|
animalHeat, |
|
|
|
agree |
|
|
|
} = this; |
|
|
|
const { district, address, healthTypeId, animalHeat, agree } = this; |
|
|
|
if (!district || district === '请选择当前所在地区') { |
|
|
|
showToast('请选择当前所在地区'); |
|
|
|
return; |
|
|
@ -254,30 +272,29 @@ |
|
|
|
} |
|
|
|
return true; |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.agree-box { |
|
|
|
.agree-box { |
|
|
|
width: 70rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.agree-text { |
|
|
|
.agree-text { |
|
|
|
line-height: 60rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.timer { |
|
|
|
.timer { |
|
|
|
font-size: 34rpx !important; |
|
|
|
color: $gray; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.primary-btn { |
|
|
|
.primary-btn { |
|
|
|
border-radius: 15rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.history-btn { |
|
|
|
.history-btn { |
|
|
|
position: fixed; |
|
|
|
bottom: 40rpx; |
|
|
|
right: 40rpx; |
|
|
@ -285,9 +302,9 @@ |
|
|
|
height: 96rpx; |
|
|
|
line-height: 96rpx; |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.history-btn::after { |
|
|
|
.history-btn::after { |
|
|
|
border: none; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|