Browse Source

版本1.2.8 首页增加悬浮按钮疫苗接种查询;

feature/societyOrg
ZhaoTongYao 5 years ago
parent
commit
381fe94da3
  1. 7
      epdc-resident-mp-yushan/app.json
  2. 47
      epdc-resident-mp-yushan/components/moveButton/moveButton.js
  3. 3
      epdc-resident-mp-yushan/components/moveButton/moveButton.json
  4. 8
      epdc-resident-mp-yushan/components/moveButton/moveButton.wxml
  5. 34
      epdc-resident-mp-yushan/components/moveButton/moveButton.wxss
  6. BIN
      epdc-resident-mp-yushan/images/vaccines.png
  7. 28
      epdc-resident-mp-yushan/pages/index/index.js
  8. 3
      epdc-resident-mp-yushan/pages/index/index.json
  9. 12
      epdc-resident-mp-yushan/pages/index/index.wxml
  10. 2
      epdc-resident-mp-yushan/pages/toRegister/toRegister.js
  11. 18
      epdc-resident-mp-yushan/project.config.json
  12. BIN
      epdc-resident-mp-yushan/subpages/extend/images/no-data.png
  13. BIN
      epdc-resident-mp-yushan/subpages/extend/images/top.png
  14. 79
      epdc-resident-mp-yushan/subpages/extend/pages/vaccines/vaccines.js
  15. 6
      epdc-resident-mp-yushan/subpages/extend/pages/vaccines/vaccines.json
  16. 32
      epdc-resident-mp-yushan/subpages/extend/pages/vaccines/vaccines.wxml
  17. 89
      epdc-resident-mp-yushan/subpages/extend/pages/vaccines/vaccines.wxss
  18. 12
      epdc-resident-mp-yushan/subpages/extend/utils/api.js
  19. 2
      epdc-resident-mp-yushan/utils/config.js

7
epdc-resident-mp-yushan/app.json

@ -144,6 +144,13 @@
"pages/class/class",
"pages/classDetail/classDetail"
]
},
{
"root": "subpages/extend",
"name": "extend",
"pages": [
"pages/vaccines/vaccines"
]
}
],
"preloadRule": {

47
epdc-resident-mp-yushan/components/moveButton/moveButton.js

@ -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')
}
}
})

3
epdc-resident-mp-yushan/components/moveButton/moveButton.json

@ -0,0 +1,3 @@
{
"component": true
}

8
epdc-resident-mp-yushan/components/moveButton/moveButton.wxml

@ -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>

34
epdc-resident-mp-yushan/components/moveButton/moveButton.wxss

@ -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- */

BIN
epdc-resident-mp-yushan/images/vaccines.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

28
epdc-resident-mp-yushan/pages/index/index.js

@ -26,7 +26,8 @@ Page({
completeInfoDialogVisible: false, // 完善信息弹框显隐
gridId: '', // 网格id
departmentName: '', // 所在网格
isCarryLoad: false
isCarryLoad: false,
vaccinationSwitch: false, // 疫苗入口开关
},
onLoad (options) {
if (options.scene) {
@ -52,6 +53,7 @@ Page({
}
this.getUserState()
this.data.isCarryLoad = true
this.getResidentConfig()
},
onTabItemTap () {
this.getUserState()
@ -173,7 +175,7 @@ Page({
projectList: res.data,
})
}).catch(() => {
console.log('获取项目列表失败', res)
console.log('获取项目列表失败')
this.setData({
projectList: []
})
@ -383,5 +385,27 @@ Page({
wx.navigateTo({
url: '/subpages/education/pages/healthyLife/healthyLife?page=zhfw'
})
},
// 获取疫苗配置
getResidentConfig () {
homeApi.getResidentConfig().then(res => {
if (res.code === 0 && res.msg === "success") {
res.data.forEach(item => {
if (item.residentType === "vaccination_config" && item.residentCode === "vaccination_switch") {
this.setData({
vaccinationSwitch:item.residentValue === 'on'
})
}
})
}
}).catch(err => {
console.log(err)
})
},
//疫苗接种
toVaccines () {
wx.navigateTo({
url: '/subpages/extend/pages/vaccines/vaccines'
})
}
})

3
epdc-resident-mp-yushan/pages/index/index.json

@ -9,6 +9,7 @@
"project": "./components/project/project",
"news-list":"./components/newsList/newsList",
"load-more": "../../components/loadMore/loadMore",
"complete-info-dialog": "../../components/completeInfoDialog/completeInfoDialog"
"complete-info-dialog": "../../components/completeInfoDialog/completeInfoDialog",
"move-btn": "/components/moveButton/moveButton"
}
}

12
epdc-resident-mp-yushan/pages/index/index.wxml

@ -63,4 +63,14 @@
<!--完善过信息提示框-->
<complete-info-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></complete-info-dialog>
</view>
</view>
<!-- 悬浮按钮 -->
<move-btn
wx:if="{{vaccinationSwitch}}"
button-width="142"
button-height="164"
area-top="120"
area-height="90%"
img-url="../../images/vaccines.png"
bindmovebtnCallBack="toVaccines"></move-btn>

2
epdc-resident-mp-yushan/pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
}
})
let that = this
const versionNum = '1.2.5'
const versionNum = '1.2.8'
api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data)
let state = res.data.scanFlag

18
epdc-resident-mp-yushan/project.config.json

@ -41,28 +41,16 @@
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": [
{
"id": 0,
@ -84,6 +72,12 @@
"pathName": "pages/complete/complete",
"query": "",
"scene": null
},
{
"name": "网格注册",
"pathName": "pages/formid/formid",
"query": "gid=1258691044142047233",
"scene": null
}
]
}

BIN
epdc-resident-mp-yushan/subpages/extend/images/no-data.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
epdc-resident-mp-yushan/subpages/extend/images/top.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

79
epdc-resident-mp-yushan/subpages/extend/pages/vaccines/vaccines.js

@ -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
})
}
})

6
epdc-resident-mp-yushan/subpages/extend/pages/vaccines/vaccines.json

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "疫苗接种",
"navigationBarBackgroundColor": "#CE0805",
"navigationBarTextStyle": "white",
"usingComponents": {}
}

32
epdc-resident-mp-yushan/subpages/extend/pages/vaccines/vaccines.wxml

@ -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>

89
epdc-resident-mp-yushan/subpages/extend/pages/vaccines/vaccines.wxss

@ -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;
}

12
epdc-resident-mp-yushan/subpages/extend/utils/api.js

@ -0,0 +1,12 @@
const request = require('../../../utils/request')
module.exports = {
getPrecautionList
}
/**
* 查询疫苗接种信息
* userName
* idCard
*/
function getPrecautionList (param) {
return request.get('admin/vim/query',param)
}

2
epdc-resident-mp-yushan/utils/config.js

@ -6,7 +6,7 @@ module.exports = {
};
function BASEURL() {
// return 'https://eug-test.elinkit.com.cn/epdc-api/api/' // 测试环境 接口地址
// return 'http://115.28.104.30:17020/epdc-api/api/' // 测试环境 接口地址
// return "https://epdc-test.elinkservice.cn/epdc-api/api/" // 测试环境 ip接口地址
return 'https://epdc-yushan.elinkservice.cn/epdc-api/api/' // 微笑榆山正式环境
}

Loading…
Cancel
Save