19 changed files with 364 additions and 18 deletions
@ -0,0 +1,47 @@ |
|||||
|
Component({ |
||||
|
data: { |
||||
|
}, |
||||
|
properties: { |
||||
|
areaTop: { |
||||
|
type: Number, |
||||
|
value: 0 |
||||
|
}, |
||||
|
areaLeft: { |
||||
|
type: Number, |
||||
|
value: 0 |
||||
|
}, |
||||
|
areaWidth: { |
||||
|
type: String, |
||||
|
value: '100%' |
||||
|
}, |
||||
|
areaHeight: { |
||||
|
type: String, |
||||
|
value: '100%' |
||||
|
}, |
||||
|
buttonWidth: { |
||||
|
type: Number, |
||||
|
value: 178 |
||||
|
}, |
||||
|
buttonHeight: { |
||||
|
type: Number, |
||||
|
value: 178 |
||||
|
}, |
||||
|
buttonTop: { |
||||
|
type: Number, |
||||
|
value: 1000 |
||||
|
}, |
||||
|
buttonLeft: { |
||||
|
type: Number, |
||||
|
value: 580 |
||||
|
}, |
||||
|
imgUrl: { |
||||
|
type: String, |
||||
|
value: '' |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
onClickButton () { |
||||
|
this.triggerEvent('movebtnCallBack') |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
<movable-area class="movable-area" style="top:{{areaTop}}rpx;left:{{areaLeft}}rpx;width:{{areaWidth}};height:{{areaHeight}};"> |
||||
|
<movable-view class="movable-view" direction="all" inertia="true" friction="10" |
||||
|
style="width:{{buttonWidth}}rpx;height:{{buttonHeight}}rpx;top:{{buttonTop}}rpx;left:{{buttonLeft}}rpx;"> |
||||
|
<view class="img-box" bindtap="onClickButton"> |
||||
|
<image src="{{imgUrl}}" /> |
||||
|
</view> |
||||
|
</movable-view> |
||||
|
</movable-area> |
||||
@ -0,0 +1,34 @@ |
|||||
|
|
||||
|
/* 悬浮按钮 -start- */ |
||||
|
.movable-area{ |
||||
|
pointer-events:none; |
||||
|
z-index: 999; |
||||
|
width: 100%; |
||||
|
height: 90%; |
||||
|
position: fixed; |
||||
|
top: 60px; |
||||
|
left: 0; |
||||
|
right: 0; |
||||
|
bottom: 0; |
||||
|
} |
||||
|
.movable-view{ |
||||
|
pointer-events:auto; |
||||
|
width: 178rpx; |
||||
|
height: 178rpx; |
||||
|
transform: translateX(0rpx) translateY(0rpx) translateZ(0rpx) scale(1); |
||||
|
transform-origin: center center; |
||||
|
will-change: auto; |
||||
|
position: absolute; |
||||
|
top: 0rpx; |
||||
|
left: 0rpx; |
||||
|
} |
||||
|
.img-box { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
.img-box image { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
object-fit: cover; |
||||
|
} |
||||
|
/* 悬浮按钮 -end- */ |
||||
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,79 @@ |
|||||
|
// subpages/extend/pages/vaccines/vaccines.js
|
||||
|
const api = require('../../utils/api') |
||||
|
Page({ |
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
userName: '', |
||||
|
idCard: '', |
||||
|
infoObj: {} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面显示 |
||||
|
*/ |
||||
|
onShow: function () { |
||||
|
|
||||
|
}, |
||||
|
inputUserName (e) { |
||||
|
this.setData({ |
||||
|
userName: e.detail.value |
||||
|
}) |
||||
|
}, |
||||
|
inputIdCard (e) { |
||||
|
this.setData({ |
||||
|
idCard: e.detail.value |
||||
|
}) |
||||
|
}, |
||||
|
queryInfo () { |
||||
|
// console.log(this.data.userName, this.data.idCard)
|
||||
|
this.getPrecautionList() |
||||
|
}, |
||||
|
getPrecautionList () { |
||||
|
if (!this.data.userName.trim('')) { |
||||
|
this.Toast('姓名不能为空') |
||||
|
return |
||||
|
} |
||||
|
if (!this.data.idCard.trim('')) { |
||||
|
this.Toast('身份证号不能为空') |
||||
|
return |
||||
|
} |
||||
|
if (this.data.idCard.length < 15) { |
||||
|
this.Toast('请输入正确的身份证号') |
||||
|
return |
||||
|
} |
||||
|
wx.showLoading({ |
||||
|
title: '查询中...' |
||||
|
}) |
||||
|
let param = { |
||||
|
userName: this.data.userName.trim(''), |
||||
|
idCard: this.data.idCard.trim('') |
||||
|
} |
||||
|
api.getPrecautionList(param).then(res => { |
||||
|
wx.hideLoading() |
||||
|
console.log(res.data) |
||||
|
this.setData({ |
||||
|
infoObj: res.data |
||||
|
}) |
||||
|
}).catch(err => { |
||||
|
wx.hideLoading() |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
// 简化 toast
|
||||
|
Toast (title, sec=2500) { |
||||
|
wx.showToast({ |
||||
|
title: title, |
||||
|
icon: 'none', |
||||
|
duration: sec |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "疫苗接种", |
||||
|
"navigationBarBackgroundColor": "#CE0805", |
||||
|
"navigationBarTextStyle": "white", |
||||
|
"usingComponents": {} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
<!--subpages/extend/pages/vaccines/vaccines.wxml--> |
||||
|
<image src="../../images/top.png" class="topbk"/> |
||||
|
<view class="vacciness"> |
||||
|
<view class="query-card"> |
||||
|
<input class="query-input" placeholder="请输入姓名" value="{{userName}}" bindinput="inputUserName"/> |
||||
|
<input class="query-input" placeholder="请输入身份证号" value="{{idCard}}" bindinput="inputIdCard"/> |
||||
|
<button class="query-button" bindtap="queryInfo">查询</button> |
||||
|
</view> |
||||
|
<view class="query-list"> |
||||
|
<view class="no-data" wx:if="{{!infoObj.userName}}"> |
||||
|
<image class="no-image" src="../../images/no-data.png" /> |
||||
|
<view class="no-text">未查到该用户的接种记录</view> |
||||
|
</view> |
||||
|
<view class="list" wx:else> |
||||
|
<view class="title">基本信息</view> |
||||
|
<view class="info"> |
||||
|
<view class="info-item">姓名: {{infoObj.userName}}</view> |
||||
|
<view class="info-item">身份证号: {{infoObj.idCard}}</view> |
||||
|
<view class="info-item">是否接种完成: {{infoObj.vaccinationState == '1' ? '接种中' : infoObj.vaccinationState == '2' ? '接种完成' : '未接种'}}</view> |
||||
|
<!-- <view class="info-item">下次接种时间: {{infoObj.nextDoseDate}}</view> --> |
||||
|
</view> |
||||
|
<view class="title">接种信息</view> |
||||
|
<view class="info" wx:for="{{infoObj.vaccinationList}}" wx:key="index"> |
||||
|
<view class="info-item">生产企业: {{item.vaccinationCompany}}</view> |
||||
|
<view class="info-item">剂次: {{item.vaccinationNum == 1 ? '第一针' : item.vaccinationNum == 2 ? '第二针' : item.vaccinationNum == 3 ? '第三针' : '无'}}</view> |
||||
|
<view class="info-item">接种地点: {{item.vaccinationSite}}</view> |
||||
|
<view class="info-item">接种时间: {{item.vaccinationTime}}</view> |
||||
|
<view class="info-line" wx:if="{{index < infoObj.vaccinationList.length-1}}"></view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
@ -0,0 +1,89 @@ |
|||||
|
/* subpages/extend/pages/vaccines/vaccines.wxss */ |
||||
|
.topbk { |
||||
|
width: 100%; |
||||
|
height: 192rpx; |
||||
|
} |
||||
|
.vacciness { |
||||
|
position: absolute; |
||||
|
top: 30rpx; |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
justify-content: flex-start; |
||||
|
} |
||||
|
.vacciness .query-card { |
||||
|
width: 690rpx; |
||||
|
height: 432rpx; |
||||
|
background: #FFFFFF; |
||||
|
box-shadow: 0px 5rpx 32rpx 0px rgba(184, 184, 184, 0.25); |
||||
|
border-radius: 14rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
padding: 50rpx 0; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
.query-card .query-input { |
||||
|
width: 630rpx; |
||||
|
height: 80rpx; |
||||
|
background: #F0F0F0; |
||||
|
border-radius: 40rpx; |
||||
|
margin-bottom: 30rpx; |
||||
|
padding-left: 32rpx; |
||||
|
box-sizing: border-box; |
||||
|
font-size: 32rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 500; |
||||
|
color: #333333; |
||||
|
} |
||||
|
.query-card .query-button { |
||||
|
width: 440rpx; |
||||
|
height: 80rpx; |
||||
|
line-height: 80rpx; |
||||
|
color: #FFFFFF; |
||||
|
background: linear-gradient(90deg, #DB1A1F, #E95027); |
||||
|
box-shadow: 0rpx 4rpx 27rpx 0rpx rgba(220, 28, 31, 0.29); |
||||
|
border-radius: 40rpx; |
||||
|
margin-top: 30rpx; |
||||
|
} |
||||
|
.query-list { |
||||
|
margin-bottom: 60rpx; |
||||
|
} |
||||
|
.query-list .no-data { |
||||
|
margin-top: 150rpx; |
||||
|
} |
||||
|
.query-list .no-data .no-image { |
||||
|
width: 534rpx; |
||||
|
height: 250rpx; |
||||
|
} |
||||
|
.query-list .no-data .no-text { |
||||
|
font-size: 28rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 500; |
||||
|
color: #BCBCBC; |
||||
|
text-align: center; |
||||
|
} |
||||
|
.query-list .list { |
||||
|
width: 690rpx; |
||||
|
} |
||||
|
.query-list .list .title { |
||||
|
margin-top: 50rpx; |
||||
|
font-size: 34rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: bold; |
||||
|
color: #333333; |
||||
|
} |
||||
|
.query-list .list .info .info-item { |
||||
|
margin: 20rpx 0; |
||||
|
font-size: 32rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #000000; |
||||
|
} |
||||
|
.query-list .list .info .info-line { |
||||
|
width: 690rpx; |
||||
|
height: 1px; |
||||
|
background: #E5E5E5; |
||||
|
border-radius: 1px; |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
const request = require('../../../utils/request') |
||||
|
module.exports = { |
||||
|
getPrecautionList |
||||
|
} |
||||
|
/** |
||||
|
* 查询疫苗接种信息 |
||||
|
* userName |
||||
|
* idCard |
||||
|
*/ |
||||
|
function getPrecautionList (param) { |
||||
|
return request.get('admin/vim/query',param) |
||||
|
} |
||||
Loading…
Reference in new issue