作者 lihongjuan

1

{
"pages": [
"pages/start/start",
"pages/enterdoor/enterdoor",
"pages/logining/logining",
"pages/businessoffice/businessoffice",
"pages/start/start",
"pages/service/service",
"pages/login/login",
"pages/fugongshenqing/fugongshenqing",
... ... @@ -23,8 +24,10 @@
"pages/publish/publish",
"pages/interaction/interaction",
"pages/usercenter/usercenter",
"pages/shenhez/shenhez"
"pages/shenhez/shenhez",
"pages/backenterdoor/backenterdoor",
"pages/outbackpeopledoor/outbackpeopledoor",
"pages/outbackpeopledetail/outbackpeopledetail"
],
"window": {
"backgroundTextStyle": "light",
... ...
/**app.wxss**/
image {
width: 100%;
height: 100%;
}
.commonpadding {
padding: 24rpx 32rpx;
box-sizing: border-box;
background: #fff;
}
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
.commontwo {
color: #232323;
font-size: 28rpx;
}
.flex {
display: flex;
}
.flexone {
display: flex;
align-items: center;
}
.flextwo {
display: flex;
align-items: center;
justify-content: space-between;
}
.flexthree {
display: flex;
align-items: center;
justify-content: center;
}
.commonone {
color: #06121e;
font-size: 28rpx;
font-weight: bold;
}
.commontwo {
color: #8c9198;
font-size: 28rpx;
}
.selname {
color: #06121e;
font-size: 28rpx;
}
.yourow {
width: 28rpx;
height: 28rpx;
font-size: 0;
}
.nodata {
width: 300rpx;
color: #8c9198;
font-size: 32rpx;
text-align: center;
position: absolute;
top: 30%;
left: 50%;
transform: translate(-50%, -50%);
}
.yourow {
width: 28rpx;
height: 28rpx;
font-size: 0;
}
.bot {
width: 750rpx;
display: flex;
justify-content: center;
align-items: center;
background: #fff;
padding: 14rpx 32rpx;
box-sizing: border-box;
margin-top: 40rpx;
}
.botk {
width: 750rpx;
display: flex;
justify-content: center;
align-items: center;
background: #fff;
position: fixed;
bottom: 0;
left: 0;
padding: 14rpx 32rpx;
box-sizing: border-box;
margin-top: 40rpx;
}
.subtwo {
width: 686rpx;
height: 88rpx;
background: #1c8fff;
opacity: 1;
color: #fff;
font-size: 28rpx;
text-align: center;
line-height: 88rpx;
}
/* 列表 */
.useboxitem {
width: 100%;
padding: 30rpx 0;
box-sizing: border-box;
background: #fff;
border-bottom: 1rpx solid #f5f5f5;
}
.leftimg {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
.itemname {
font-size: 28rpx;
font-weight: bold;
}
.backtop {
width: 750rpx;
background: #fff;
opacity: 1;
border-radius: 8rpx;
padding: 0 32rpx;
box-sizing: border-box;
}
.commonenter {
width: 420rpx;
margin-right: 50rpx;
}
.commonenter input {
width: 100%;
height: 100%;
text-align: right;
}
/* 登录遮罩层 */
.registerk {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 999;
}
.userwrap {
width: 750rpx;
height: 512rpx;
background: rgba(255, 255, 255, 1);
border-radius: 24rpx 24rpx 0rpx 0rpx;
position: absolute;
bottom: 0;
left: 0;
}
.loimg {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
.shoubtn {
width: 686rpx !important;
height: 100rpx;
background: rgba(0, 194, 95, 1);
border-radius: 50rpx;
margin: 64rpx auto 0;
}
.word {
color: #fff;
font-size: 32rpx;
margin-left: 8rpx;
}
.shou {
color: #06121f;
font-size: 56rpx;
font-weight: bold;
margin-top: 32rpx;
}
.shoutext {
width: 686rpx;
color: #8c9198;
font-size: 32rpx;
margin-top: 40rpx;
}
.lotop {
display: flex;
justify-content: flex-end;
align-items: center;
}
.men {
width: 260rpx!important;
text-align: right;
}
.writebtn {
width: 590rpx;
height: 88rpx;
background: rgba(28, 143, 255, 1);
opacity: 1;
border-radius: 12rpx;
color: #fff;
font-size: 28rpx;
text-align: center;
line-height: 88rpx;
margin: 64rpx auto 0;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
... ...
// pages/enterdoor/enterdoor.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
scene:'',
clock: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
scene: options.scene,
clock: options.clock
})
},
// 返静人员管理
backlist() {
wx.navigateTo({
url: '/pages/backpeoplelist/backpeoplelist',
})
},
// 营业场所管理
ground() {
wx.navigateTo({
url: '/pages/businessoffice/businessoffice',
})
},
// 境内人员管理
incountry(){
let that = this;
var url = '/api/user/index';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
// if (res.qrcode == '') {
// wx.navigateTo({
// url: '/pages/backpeople/backpeople',
// })
// } else {
// wx.navigateTo({
// url: '/pages/backdetail/backdetail',
// })
// }
if (res.back_type == 0) {
wx.navigateTo({
url: '/pages/backpeople/backpeople?clock=' + this.data.clock + '&scene=' + this.data.scene,
})
} else if(res.back_type == 1) {
wx.navigateTo({
url: '/pages/backdetail/backdetail',
})
} else if(res.back_type == 2) {
wx.navigateTo({
url: '/pages/outbackpeopledetail/outbackpeopledetail',
})
}
}).catch((err) => {
})
},
// 境外人员管理
outcountry(){
let that = this;
var url = '/api/user/index';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
// wx.navigateTo({
// url: '/pages/outbackpeopledetail/outbackpeopledetail',
// })
// if (res.qrcode == '') {
// wx.navigateTo({
// url: '/pages/outbackpeopledoor/outbackpeopledoor',
// })
// } else {
// wx.navigateTo({
// url: '/pages/backdetail/backdetail',
// })
// }
if (res.back_type == 0) {
wx.navigateTo({
url: '/pages/outbackpeopledoor/outbackpeopledoor?clock=' + this.data.clock + '&scene=' + this.data.scene,
})
} else if(res.back_type == 1) {
wx.navigateTo({
url: '/pages/backdetail/backdetail',
})
} else if (res.back_type == 2) {
wx.navigateTo({
url: '/pages/outbackpeopledetail/outbackpeopledetail',
})
}
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "静海防疫服务平台"
}
\ No newline at end of file
... ...
<view class="topimg">
<image src="/img/bg.png"></image>
<view class="topback">
<view class="topitem flextwo">
<view class="topitemblock" bindtap="incountry">
<view class="topitemimg">
<image src="/img/icon_yingye.png"></image>
</view>
<view class="topitmname">境内人员登记</view>
</view>
<view class="topitemblock" bindtap="outcountry">
<view class="topitemimg">
<image src="/img/icon_fanjing.png"></image>
</view>
<view class="topitmname">境外人员登记</view>
</view>
</view>
</view>
</view>
... ...
.topimg {
width: 750rpx;
height: 342rpx;
font-size: 0;
position: relative;
}
.topback {
width: 686rpx;
height: 244rpx;
background: rgba(255, 255, 255, 1);
box-shadow: 0rpx 12rpx 24rpx rgba(16, 104, 191, 0.08);
opacity: 1;
border-radius: 8rpx;
position: absolute;
top:160rpx;
left:32rpx;
}
.topitemblock{
display:flex;
flex-direction: column;
align-items: center;
justify-content: center
}
.topitemimg{
width:92rpx;
height:92rpx;
font-size: 0
}
.topitmname{
color:#06121E;
font-size: 28rpx;
margin-top:16rpx;
}
.topitem{
padding: 48rpx 90rpx;
box-sizing: border-box
}
\ No newline at end of file
... ...
<view class="backtop">
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">出行方式</view>
<view class="itemname">出行方式</view>
<view class="itemright flexone">
... ...
... ... @@ -258,7 +258,7 @@ Page({
wx.redirectTo({
url: '/pages/backpeople/backpeople?clock=' + 1 + '&scene=' + this.data.companyid,
url: '/pages/backenterdoor/backenterdoor?clock=' + 1 + '&scene=' + this.data.companyid,
})
},
... ...
// pages/enterdoor/enterdoor.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
// 返静人员管理
backlist(){
wx.navigateTo({
url: '/pages/backpeoplelist/backpeoplelist',
})
},
// 营业场所管理
ground(){
wx.navigateTo({
url: '/pages/businessoffice/businessoffice',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "静海防疫服务平台"
}
\ No newline at end of file
... ...
<view class="topimg">
<image src="/img/bg.png"></image>
<view class="topback">
<view class="topitem flextwo">
<view class="topitemblock" bindtap="ground">
<view class="topitemimg">
<image src="/img/icon_yingye.png"></image>
</view>
<view class="topitmname">营业场所管理</view>
</view>
<view class="topitemblock" bindtap="backlist">
<view class="topitemimg">
<image src="/img/icon_fanjing.png"></image>
</view>
<view class="topitmname">返静人员管理</view>
</view>
</view>
</view>
</view>
... ...
.topimg {
width: 750rpx;
height: 342rpx;
font-size: 0;
position: relative;
}
.topback {
width: 686rpx;
height: 244rpx;
background: rgba(255, 255, 255, 1);
box-shadow: 0rpx 12rpx 24rpx rgba(16, 104, 191, 0.08);
opacity: 1;
border-radius: 8rpx;
position: absolute;
top:160rpx;
left:32rpx;
}
.topitemblock{
display:flex;
flex-direction: column;
align-items: center;
justify-content: center
}
.topitemimg{
width:92rpx;
height:92rpx;
font-size: 0
}
.topitmname{
color:#06121E;
font-size: 28rpx;
margin-top:16rpx;
}
.topitem{
padding: 48rpx 90rpx;
box-sizing: border-box
}
\ No newline at end of file
... ...
... ... @@ -7,14 +7,18 @@ Page({
*/
data: {
account:'',
password:''
password:'',
type:""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
type:options.type
})
},
entercount(e){
this.setData({
... ... @@ -27,34 +31,77 @@ Page({
})
},
login(){
if(this.data.type==1){
this.businesslogin()
}else{
this.countrylogin()
}
},
// 营业场所登记
businesslogin(){
let that = this;
var url = '/api/office/office_login';
var params = {
username: this.data.account,
password: this.data.password
}
app.post(url, params, "post").then((res) => {
console.log(res);
wx.showToast({
title: '登录成功',
icon: "none"
})
wx.setStorageSync("office_token", res.office_token.token)
setTimeout(function () {
wx.navigateTo({
url: '/pages/logining/logining',
})
}, 1500)
}).catch((err) => {
wx.showToast({
title: err.data.msg,
icon: 'none'
})
})
},
// 乡镇登录
countrylogin(){
let that = this;
var url = '/api/user/admin_login';
var params = {
username: this.data.account,
password:this.data.password
password: this.data.password
}
app.post(url, params,"post").then((res) => {
app.post(url, params, "post").then((res) => {
console.log(res);
wx.showToast({
title: '登录成功',
icon:"none"
icon: "none"
})
wx.setStorageSync("usertoken", res.admin_token.token)
setTimeout(function(){
setTimeout(function () {
wx.navigateTo({
url: '/pages/backpeoplelist/backpeoplelist',
})
},1500)
}, 1500)
}).catch((err) => {
wx.showToast({
title: err.data.msg,
icon:'none'
icon: 'none'
})
})
},
... ... @@ -82,8 +129,9 @@ Page({
url: '/pages/start/start',
})
}, 1500)
let url = '/pages/login/login';
let url = '/pages/login/login?type='+this.data.type;
wx.setStorageSync("url", url)
wx.setStorageSync("nologin", true)
}
... ...
// pages/logining/logining.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
protectarr:[],
office:'',
address:'',
is_business:0,
ishandbook:0,
materials:[],
time: '请选择营业时间',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.gettail()
},
bindTimeChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
time: e.detail.value
})
},
// 是否营业中
selsy(){
this.setData({
is_business:1
})
},
selsn(){
this.setData({
is_business: 2
})
},
// 是否收到疫情防控指南
selsy(){
this.setData({
ishandbook:1
})
},
selsn() {
this.setData({
ishandbook: 2
})
},
//获取登记详情
gettail(){
let that = this;
var url = '/api/office/office_detail';
var params = {
office_token: wx.getStorageSync('office_token'),
}
app.post(url, params,"post").then((res) => {
console.log(res);
that.setData({
protectarr: res.materials
})
that.data.protectarr.forEach(function(value,index,array){
value.sel=false
})
that.setData({
office:res.office,
protectarr:that.data.protectarr,
address:res.office.address
})
console.log(that.data.protectarr)
}).catch((err) => {
})
},
// 选择防疫物资
selprotect(e){
let that=this;
let index=e.currentTarget.dataset.index;
let id=e.currentTarget.dataset.id
this.data.protectarr.forEach(function(value,indexk,array){
if(index==indexk){
value.sel = !value.sel;
if(value.sel==true){
that.data.materials.push(value.id)
}else{
that.data.materials.forEach(function(value,indexk,array){
if(id==value){
that.data.materials.splice(indexk, 1)
}
})
}
}
})
this.setData({
protectarr:this.data.protectarr,
materials: this.data.materials
})
console.log(that.data.materials)
},
// 输入地址
enteraddress(){
this.setData({
address:''
})
},
enterplace(e){
this.setData({
address:e.detail.value
})
},
/**
... ...
{
"usingComponents": {}
"navigationBarTitleText": "营业登记场所"
}
\ No newline at end of file
... ...
... ... @@ -5,19 +5,22 @@
<view class="topbox">
<view class="topboxitem flextwo">
<view class="boxitemleft">名称</view>
<view class="boxitemleft itemright">王某某</view>
<view class="boxitemleft itemright">{{office.name}}</view>
</view>
<view class="topboxitem flextwo">
<view class="boxitemleft">地址</view>
<view class="boxitemleft itemright">21321132199719301201</view>
<view class="boxitemleft itemright" bindtap="enteraddress">
<input placeholder='请输入地址' value="{{address}}" bindinput="enterplace" />
</view>
</view>
<view class="topboxitem flextwo">
<view class="boxitemleft">所属行业</view>
<view class="boxitemleft itemright">静海网信办</view>
<view class="boxitemleft itemright">{{office.industry}}</view>
</view>
<view class="topboxitem flextwo">
<view class="boxitemleft">所属乡镇</view>
<view class="boxitemleft itemright">15822187890</view>
<view class="boxitemleft itemright">{{office.town_pname}}</view>
</view>
... ... @@ -30,7 +33,7 @@
<view class="flexone">
<view class="commontwo seltype">
<input placeholder="请填写负责人姓名" placeholder-class="commontwo" bindinput="entercompany" />
<input placeholder="请填写负责人姓名" placeholder-class="commontwo" bindinput="entername" />
</view>
</view>
... ... @@ -40,7 +43,7 @@
<view class="flexone">
<view class="commontwo seltype">
<input placeholder="请填写联系电话" placeholder-class="commontwo" bindinput="entercompany" />
<input placeholder="请填写联系电话" placeholder-class="commontwo" bindinput="enterphone" />
</view>
... ... @@ -66,14 +69,14 @@
<view class="selleft flexone">
<view class="selleftitem selzuo flexone" bindtap="selsy">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_symptom==1}}"></image>
<image src="/img/sel.png" wx:if="{{is_business==1}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">是</view>
</view>
<view class="selleftitem flexone " bindtap="selsn">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_symptom==2}}"></image>
<image src="/img/sel.png" wx:if="{{is_business==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">否</view>
... ... @@ -83,10 +86,15 @@
</view>
<view class="useboxitem flextwo" bindtap="selectcompany">
<view class="itemname commonone">营业时间(预计)</view>
<view class="itemname commonone yingye">营业时间(预计)</view>
<view class="flexone">
<view class="commontwo seltype">
请选择营业时间
<view class="commontwo">
<picker mode="time" value="{{time}}" start="00:00" end="24:59" bindchange="bindTimeChange">
<view class="picker">
{{time}}
</view>
</picker>
<!-- <input placeholder="请填写工作单位" placeholder-class="commontwo" bindinput="entercompany" value="{{companyname}}" /> -->
</view>
... ... @@ -96,20 +104,27 @@
</view>
</view>
<view class="useboxitem flextwo">·
<view class="itemname commonone">是否收到疫情防控指南</view>
<view class="useboxitem ">
<view class="itemname commonone have">是否有以下防疫物资?(多选)</view>
<view class=" flexone protect">
<view class="protectitem {{item.sel==true?'protectactive':''}}" wx:for="{{protectarr}}" wx:key="" bindtap="selprotect" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
</view>
</view>
<view class="useboxitem flextwo">
<view class="itemname commonone yiiqng">是否收到疫情防控指南</view>
<view class=" flexone">
<view class="selleft flexone">
<view class="selleftitem selzuo flexone" bindtap="selsy">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_symptom==1}}"></image>
<image src="/img/sel.png" wx:if="{{ishandbook==1}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">是</view>
</view>
<view class="selleftitem flexone " bindtap="selsn">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_symptom==2}}"></image>
<image src="/img/sel.png" wx:if="{{ishandbook==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">否</view>
... ... @@ -121,5 +136,7 @@
</view>
<view class="finish flexthree">
<view class="finishbtn">完成</view>
</view>
</view>
\ No newline at end of file
... ...
@import "../backpeople/backpeople.wxss";
image {
width: 100%;
height: 100%;
... ... @@ -18,7 +19,6 @@ page {
.topbox {
width: 690rpx;
margin: 48rpx auto 0;
padding: 0 24rpx;
box-sizing: border-box;
... ... @@ -39,15 +39,19 @@ page {
white-space: nowrap;
text-align: right;
}
.itemright input{
width: 510rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
}
.topboxitem {
padding: 34rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.title {
position: relative;
text-align: center;
... ... @@ -63,7 +67,8 @@ page {
width: 144rpx;
height: 1px;
position: absolute;
background: #ccc;
background: rgba(128, 192, 255, 1);
opacity: 0.4;
top: 50%;
}
... ... @@ -75,21 +80,96 @@ page {
.title::after {
margin-left: 64rpx;
}
.formbox{
margin-top:20rpx;
.formbox {
margin-top: 20rpx;
margin-bottom: 150rpx;
}
.seltype input{
.seltype input {
font-size: 24rpx;
}
.commontwo{
.commontwo {
font-size: 24rpx;
}
.itemname{
width:200rpx;
.itemname {
width: 200rpx;
}
.selname{
color:#06121E;
.selname {
color: #06121e;
font-size: 28rpx;
font-weight: bold;
}
\ No newline at end of file
}
.yiiqng {
width: 300rpx;
}
.yingye {
width: 260rpx !important;
}
.protect {
flex-wrap: wrap;
}
.protect {
margin-top: 6rpx;
}
.protectitem {
width: 302rpx;
height: 64rpx;
background: rgba(255, 255, 255, 1);
border: 1rpx solid rgba(219, 219, 219, 1);
opacity: 1;
border-radius: 48rpx;
color: #3d444d;
font-size: 24rpx;
text-align: center;
line-height: 64rpx;
margin-top: 20rpx;
}
.protectitem:nth-child(2n) {
margin-left: 28rpx;
}
.itemone {
margin-right: 28rpx;
}
.have {
width: 400rpx;
}
.protectactive {
background: rgba(232, 244, 255, 1);
color: #1b8ffd;
border: 1rpx solid rgba(27, 143, 253, 1);
}
.finish {
width: 750rpx;
padding: 14rpx 0;
box-sizing: border-box;
position: fixed;
left: 0;
bottom: 0;
background: #e7f0f9;
}
.finishbtn {
width: 686rpx;
height: 88rpx;
background: rgba(28, 143, 255, 1);
opacity: 1;
color: #fefefe;
font-size: 32rpx;
text-align: center;
line-height: 88rpx;
border-radius: 10rpx;
}
... ...
// pages/backdetail/backdetail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
showcode: false,
back_list: '',
basic: '',
first: '',
codeurl: ''
},
closecode() {
this.setData({
showcode: false
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getdetail()
this.getuser()
},
dian() {
this.setData({
showcode: true
})
},
getdetail() {
let that = this;
var url = '/api/user/back_nation_detail';
var params = {
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
back_list: res.back_list,
basic: res.basic,
first: res.back
})
app.globalData.workname = res.first.company_name;
app.globalData.workid = res.first.company_id;
app.globalData.shortworkname = res.first.unit_id
}).catch((err) => {
})
},
edit() {
wx.navigateTo({
url: '/pages/outbackpeopledoor/outbackpeopledoor?type=' + 1,
})
},
getuser() {
let that = this;
var url = '/api/user/index';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
codeurl: res.qrcode,
})
that.savefilecode()
}).catch((err) => {
})
},
// 保存图片
//点击保存到相册
baocun: function () {
console.log(999)
var that = this
wx.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
wx.authorize({
scope: 'scope.writePhotosAlbum',
success() { //这里是用户同意授权后的回调
wx.saveImageToPhotosAlbum({
filePath: that.data.codeurl,
success(res) {
wx.showModal({
content: '图片已保存到相册',
showCancel: false,
confirmText: '好的',
confirmColor: '#333',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
/* 该隐藏的隐藏 */
that.setData({
maskHidden: false
})
}
},
fail: function (res) {
}
})
}
})
},
fail() { //这里是用户拒绝授权后的回调
// wx.openSetting({
// success: function (data) {
// console.log(data)
// if (data.authSetting["scope.writePhotosAlbum"] === true) {
// console.log("是否授权成功")
// } else {
// applyApi.toast("授权失败");
// }
// }
// })
wx.showModal({
title: '提示',
content: '您取消授权,无法保存图片,点击确定打开权限',
success(res) {
if (res.confirm) {
console.log('用户点击确定')
wx.openSetting({
success(res) {
console.log(res.authSetting)
// res.authSetting = {
// "scope.userInfo": true,
// "scope.userLocation": true
// }
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
})
} else { //用户已经授权过了
console.log(that.data.codeurl)
wx.saveImageToPhotosAlbum({
filePath: that.data.codeurl,
success(res) {
wx.showModal({
content: '图片已保存到相册',
showCancel: false,
confirmText: '好的',
confirmColor: '#333',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
/* 该隐藏的隐藏 */
that.setData({
maskHidden: false
})
}
},
fail: function (res) {
}
})
}
})
}
}
})
},
savefilecode() {
let that = this;
console.log(that.data.codeurl)
wx.downloadFile({
url: that.data.codeurl,
header: {},
success: function (res) {
console.log('下载图片下载图片下载图片', res)
var tempFilePath = res.tempFilePath
//console.log('临时文件地址是:' + tempFilePath)
wx.saveFile({
tempFilePath: tempFilePath,
success: function (res) {
console.log(res)
var saveFilePath = res.savedFilePath;
that.setData({
codeurl: res.savedFilePath
})
console.log('123456855555555', that.data.qrcode)
}, //可以将saveFilePath写入到页面数据中
fail: function (res) { },
complete: function (res) {
console.log('complete后的res数据:')
},
}) //,
},
// fail: function (res) {
// wx.showModal({
// title: '下载失败',
// content: '请联系管理员',
// })
// },
complete: function (res) { },
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "返静人员详情"
}
\ No newline at end of file
... ...
<view class="backtop">
<view class="useboxitem flextwo">
<view class="itemname commonone topname">出行信息</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">出行方式</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{basic.travel}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone" wx:if="{{basic.travel == '飞机'}}">航班号</view>
<view class="itemname commonone" wx:elif="{{basic.travel == '自驾' || basic.travel == '大巴'}}">车牌号</view>
<view class="itemname commonone" wx:elif="{{basic.travel == '火车'}}">车次</view>
<view class="itemname commonone" wx:else>有效证件号</view>
<view class="itemright flexone time">
<view class="commontwo commonenter">
{{basic.number}}
</view>
</view>
</view>
</view>
<view class="backtop peopleitem">
<view class="useboxitem flextwo">
<view class="itemname commonone topname">人员信息</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">姓名</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{first.name}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">国籍</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<text wx:if="{{first.nation==1}}">中国</text>
<text wx:if="{{first.nation==2}}">港澳台</text>
<text wx:if="{{first.nation==3}}">外籍</text>
</view>
</view>
</view>
<!-- wx:if="{{first.credentials_type==1}}" -->
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">证件类型</view>
<view class="itemright flexone">
<view class="commontwo commonenter" wx:if="{{first.credentials_type==1}}">
身份证
</view>
<view class="commontwo commonenter" wx:if="{{first.credentials_type==2}}">
港澳台通行证
</view>
<view class="commontwo commonenter" wx:if="{{first.credentials_type==3}}">
护照
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">证件号码</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{first.identity}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">联系电话</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{first.mobile}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">从何国返静</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{first.from_province}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">途经国家或城市</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{first.arrivecity}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">到静海时间(计划)</view>
<view class="itemright flexone time">
<view class="commontwo commonenter">
{{first.arrivetime}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">目的地</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{first.town_p_name}}{{first.town_name}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">详细地址(具体到门牌号)</view>
<view class="itemright flexone">
<view class="commontwo men">
{{first.add}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">是否有相应症状(发热、呕吐)</view>
<view class="itemright flexone istouch">
<view class="commontwo commonenter" wx:if="{{first.is_symptom==1}}">
</view>
<view class="commontwo commonenter" wx:else>
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">两周内有无重度疫情区来往接触史</view>
<view class="itemright flexone istouch">
<view class="commontwo commonenter" wx:if="{{first.is_epidemic==1}}">
</view>
<view class="commontwo commonenter" wx:else>
</view>
</view>
</view>
</view>
<view class="code flextwo">
<view class="codeleft">
二维码
</view>
<view class="coderight flexone" bindtap="dian">
<view class="commontwo">点击查看/保存</view>
<view class="codeimg">
<image src="{{codeurl}}"></image>
</view>
</view>
</view>
<view class="bot" bindtap="edit">
<view class="subtwo">编辑</view>
</view>
<view class="registerk" wx:if="{{showcode}}">
<view class="codewrap">
<view class="codetop">
<image src="/img/codetopimg.png"></image>
<view class="codename">我的二维码</view>
</view>
<view class="codekimg" bindlongpress="baocun">
<image src="{{codeurl}}"></image>
</view>
<view class="ansave">长按保存二维码</view>
</view>
<view class="closeimg" bindtap="closecode">
<image src="/img/closecode.png"></image>
</view>
</view>
\ No newline at end of file
... ...
page{
background: #F9F9FB
}
.commonenter{
margin-right:0;
text-align: right
}
.topname{
font-size: 36rpx;
}
.istouch{
width:150rpx;
}
.peopleitem{
margin-top:22rpx;
}
.codeleft{
color:#06121E;
font-size: 36rpx;
font-weight:bold;
}
.codename{
margin-right:24rpx;
}
.codeimg{
width:54rpx;
height:54rpx;
font-size:0;
}
.code{
padding: 36rpx 32rpx;
box-sizing: border-box;
background: #fff;
margin-top:20rpx;
}
.codewrap {
width: 606rpx;
height: 696rpx;
background: rgba(255, 255, 255, 1);
box-shadow: 0rpx 6rpx 12rpx rgba(0, 0, 0, 0.16);
opacity: 1;
border-radius: 24rpx;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%)
}
.codetop{
width:606rpx;
height:186rpx;
font-size: 0;
position: relative;
top:0;
left:0
}
.codename{
color:#fff;
font-size: 40rpx;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%)
}
.closeimg{
width:72rpx;
height:72rpx;
font-size: 0;
position: absolute;
bottom:10%;
left:50%;
transform: translateX(-50%)
}
.ansave{
color:#06121E;
font-size: 36rpx;
font-weight: bold;
margin-top:40rpx;
text-align: center
}
.codekimg{
width:260rpx;
height:260rpx;
font-size: 0;
margin:80rpx auto 0;
}
.commontwo{
margin-right:10rpx;
}
\ No newline at end of file
... ...
// pages/backpeople/backpeople.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
chuxing: '请选择出行方式',
chuixngarray: ['飞机', '自驾', '火车', '大巴', '其他'],
chuxingindex: 0,
chuxingid: '',
danweiarray: [],
danweiindex: 0,
danweiname: '请选择工作单位',
danweiid: "",
danweiindexk: 0,
danweinamek: '请选择工作单位',
danweiidk: "",
phone: "",
date: '请选择时间',
datek: '请选择时间',
time: '请选择时间',
timek: '请选择时间',
fromname: '请选择来源地',
fromnamek: '请选择来源地',
toname: "请选择目的地",
region: ['天津市', '天津市', '静海区'],
xiangarray: [],
xiangindex: 0,
xiangname: '请选择乡镇',
xiangid: '',
xiangindexk: 0,
xiangnamek: '请选择乡镇',
xiangidk: '',
quarray: [],
quname: '请选择社区',
quid: '',
quindex: 0,
qunamek: '请选择社区',
quidk: '',
quindexk: 0,
is_symptom: 2,
is_symptomk: 2,
gocity: '',
is_epidemic: 2,
is_epidemick: 2,
from_province_id: '',
from_city_id: '',
from_region_id: '',
from_province: '',
from_city: '',
from_region: '',
from_province_idk: '',
from_city_idk: '',
from_region_idk: '',
from_provincek: '',
from_cityk: '',
from_regionk: '',
xingname: '',
card: '',
people: [],
suichebox: [1],
detailadd: '',
back_list: '',
basic: '',
first: '',
companyname: '',
shortworkname: '',
type: "",
basicinfo: '',
clock: '',
scene: '',
falsebtn: false,
workid: '',
nationarray: [{
id: 1,
name: '中国'
},
{
id: 2,
name: '港澳台'
},
{
id: 3,
name: '外籍'
},
],
nationindex: 0,
nation: '中国',
nationid: 1,
certificate: '身份证',
certificateid: 1,
certificatearray: [{
id: 1,
name: '身份证'
},
{
id: 2,
name: '港澳台通行证'
},
{
id: 3,
name: '护照'
},
],
certificateindex:0,
// 从何国返静
from_province:"",
arrivecity:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log(options)
this.setData({
falsebtn: false
})
this.getdanweilist();
// 获取乡
this.getxiang();
if (options.type != undefined) {
this.setData({
type: options.type
})
this.getbackinfo()
}
if (options.clock != undefined) {
this.setData({
clock: options.clock,
scene: options.scene
})
}
},
// 选择国籍
bindnationChange(e) {
this.setData({
nationindex: e.detail.value,
nation: this.data.nationarray[e.detail.value].name,
nationid: this.data.nationarray[e.detail.value].id
})
},
// 从何国返静
fromprovince(e){
this.setData({
from_province:e.detail.value
})
},
//途径国家城市
enterbyway(e){
this.setData({
arrivecity:e.detail.value
})
},
// 选择证件类型
bindcertificateChange(e){
this.setData({
certificateindex:e.detail.value,
certificate: this.data.certificatearray[e.detail.value].name,
certificateid: this.data.certificatearray[e.detail.value].id
})
},// 选择工作单位
selectcompany() {
console.log(8888)
wx.navigateTo({
url: '/pages/selectdanwei/selectdanwei',
})
},
// 获取详细信息
getbackinfo() {
let that = this;
var url = '/api/user/back_detail';
var params = {};
app.post(url, params, "post").then((res) => {
console.log(res);
let tempPeople = res.back_list;
that.setData({
people: res.back_list,
basic: res.basic,
chuxing: res.basic.travel,
typename: res.basic.number,
xingname: res.first.name,
card: res.first.identity,
companyname: res.first.company_name,
workid: res.first.company_id,
danweiname: res.first.unit,
phone: res.first.mobile,
date: res.first.arrivetime,
fromname: res.first.from_province + res.first.from_city + res.first.from_region,
from_province_id: res.first.from_province_id,
from_region_id: res.first.from_region_id,
from_city_id: res.first.from_city_id,
from_province: res.first.from_province,
from_city: res.first.from_city,
from_region: res.first.from_region,
xiangname: res.first.town_p_name,
xiangid: res.first.town_pid,
quname: res.first.town_name,
quid: res.first.town_id,
detailadd: res.first.add,
is_epidemic: res.first.is_epidemic,
is_symptom: res.first.is_symptom,
gocity: res.first.arrivecity,
xiangindex: res.first.town_pid - 1,
quindex: res.first.town_id - 41,
arrivecity: res.first.arrivecity,
nation: res.first.nation == 1 ? '中国' : res.first.nation == 2 ? '港澳台通行证' :'护照',
nationid: res.first.nation,
certificate: res.first.credentials_type == 1 ? '身份证号' : res.first.credentials_type == 2 ? '港澳台通行证' :'护照',
certificateid: res.first.credentials_type,
})
let chuixngarray = that.data.chuixngarray;
for (var i = 0; i < chuixngarray.length; i++) {
if (chuixngarray[i] == res.basic.travel) {
that.setData(({
chuxingindex: i
}))
}
}
that.getqu();
// 获取司机目标社区
var first = res.first;
if (first.length == 0) {
that.setData({
xiangname: that.data.xiangarray[0].name,
xiangid: that.data.xiangarray[0].id,
xiangindex: 0
})
} else {
app.post('/api/index/town', {
type: 2,
pid: first.town_pid || 1
}).then((res) => {
let town = res.town;
first.quarray = town;
for (let i in town) {
if (town[i].id == first.town_id) {
first.quindex = i;
break;
}
}
that.setData({
first: first,
})
}).catch((err) => {
})
}
// 初始化随车人员乡镇所在地
for (let obj of tempPeople) {
for (let i in that.data.xiangarray) {
if (obj.town_pid == that.data.xiangarray[i].id) {
obj.xiangindex = i
}
}
}
this.setData({
people: tempPeople
})
for (let i in tempPeople) {
that.getTown(tempPeople[i].town_pid, i, tempPeople[i].town_id)
}
}).catch((err) => {
})
},
// 添加随车人员
addsuiche() {
let newsuichebox = this.data.suichebox;
var newpeople = this.data.people;
let obj = {
is_symptom: 2,
is_epidemic: 2,
unit_id: '',
town_p_name: '请选择乡镇',
town_name: '请选择社区',
arrivetime: '请选择时间',
from_province: '请选择来源地',
}
newsuichebox.push(1);
newpeople.push(obj)
this.setData({
suichebox: newsuichebox,
people: newpeople
})
console.log(this.data.people)
this.getxiang();
},
selsy() {
this.setData({
is_symptom: 1
})
},
selsyk(e) {
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].is_symptom = 1;
this.setData({
people: newpeople
})
console.log(this.data.people)
},
selsn(e) {
this.setData({
is_symptom: 2
})
},
selsnk(e) {
this.setData({
is_symptomk: 2
})
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].is_symptom = 2;
this.setData({
people: newpeople
})
console.log(this.data.people)
},
selzy(e) {
this.setData({
is_epidemic: 1
})
},
selzyk(e) {
this.setData({
is_epidemick: 1
})
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].is_epidemic = 1;
this.setData({
people: newpeople
})
},
selzn(e) {
this.setData({
is_epidemic: 2
})
},
selznk(e) {
this.setData({
is_epidemick: 2
})
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].is_epidemic = 2;
this.setData({
people: newpeople
})
},
gocity(e) {
this.setData({
gocity: e.detail.value
})
console.log(this.data.gocity)
},
gocityk(e) {
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].arrivecity = e.detail.value;
this.setData({
people: newpeople
})
console.log(this.data.people)
},
// 获取乡镇
getxiang() {
let that = this;
var url = '/api/index/town';
var params = {
type: 1,
pid: ''
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
xiangarray: res.town
})
console.log(this.data.xiangarray)
}).catch((err) => {
})
},
bindxiangChange: function(e) {
this.setData({
xiangname: this.data.xiangarray[e.detail.value].name,
xiangid: this.data.xiangarray[e.detail.value].id,
xiangindex: e.detail.value,
quname: '',
quid: ''
})
this.getqu()
},
bindxiangChangek: function(e) {
console.log(e)
let that = this,
index = e.currentTarget.dataset.index,
t_index = e.detail.value,
xiangArry = this.data.xiangarray;
let pid = xiangArry[t_index].id;
if (that.data.people[index].town_pid != pid) {
that.data.people[index].xiangindex = index;
that.data.people[index].town_p_name = xiangArry[t_index].name;
that.data.people[index].town_pid = pid;
that.data.people[index].town_name = ""
that.data.people[index].town_id = ""
this.setData({
people: that.data.people
})
this.getTown(pid, index, '')
}
},
getqu() {
let that = this;
var url = '/api/index/town';
var params = {
type: 2,
pid: that.data.xiangid || 1
}
app.post(url, params).then((res) => {
console.log(res);
this.setData({
'first.quarray': res.town,
'first.quindex': 0,
quname: this.data.quname || res.town[0].name,
quid: this.data.quid || res.town[0].id
})
}).catch((err) => {
})
},
getTown(id, index, townId) {
let that = this;
var url = '/api/index/town';
var params = {
type: 2,
pid: id
}
app.post(url, params).then((res) => {
let town = res.town;
that.data.people[index].quarrayk = town;
for (let i in town) {
if (town[i].id == townId) {
that.data.people[index].quindex = i;
that.data.people[index].town_name = town[i].name;
that.data.people[index].town_id = town[i].id;
break;
} else {
that.data.people[index].quindex = 0;
that.data.people[index].town_id = town[0].id;
that.data.people[index].town_name = town[0].name;
}
}
that.setData({
people: that.data.people,
})
}).catch((err) => {
})
},
bindquChange: function(e) {
this.setData({
quname: this.data.first.quarray[e.detail.value].name,
quid: this.data.first.quarray[e.detail.value].id,
quindex: e.detail.value,
'first.quindex': e.detail.value,
})
},
bindquChangek: function(e) {
console.log(e)
let index = e.currentTarget.dataset.index,
chooseIndex = e.detail.value;
this.data.people[index].quindex = chooseIndex;
this.data.people[index].town_name = this.data.people[index].quarrayk[chooseIndex].name;
this.data.people[index].town_id = this.data.people[index].quarrayk[chooseIndex].id;
this.setData({
people: this.data.people
})
},
// 判断乡镇
panduan(e) {
console.log(343)
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people
for (var i = 0; i < newpeople.length; i++) {
if (newpeople[i].town_p_name == '请选择乡镇') {
wx.showToast({
title: '请先选择乡镇',
icon: "none"
})
}
}
},
bindtypeChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
chuxingindex: e.detail.value,
chuxing: this.data.chuixngarray[e.detail.value]
})
},
// 获取工作单位
getdanweilist() {
let that = this;
var url = '/api/index/unit';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
danweiarray: res.unit
})
}).catch((err) => {
})
},
binddanChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
danweiindex: e.detail.value,
danweiname: this.data.danweiarray[e.detail.value].name,
danweiid: this.data.danweiarray[e.detail.value].id
})
},
binddanChangek: function(e) {
console.log(e)
console.log('picker发送选择改变,携带值为', e.detail.value)
// this.setData({
// danweiindexk: e.detail.value,
// danweinamek: this.data.danweiarray[e.detail.value].name,
// danweiidk: this.data.danweiarray[e.detail.value].id
// })
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].unit_id = this.data.danweiarray[e.detail.value].id;
newpeople[index].unit = this.data.danweiarray[e.detail.value].name;
this.setData({
people: newpeople
})
},
// 到达静海时间
bindDateChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
date: e.detail.value
})
},
bindDateChangek: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
datek: e.detail.value
})
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].arrivetime = e.detail.value
this.setData({
people: newpeople
})
},
bindTimeChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
time: e.detail.value
})
},
bindTimeChangek: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
timek: e.detail.value
})
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].arrivetime = this.data.dateK = this.data.timeK
},
bindRegionChange: function(e) {
console.log(e)
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
fromname: e.detail.value[0] + e.detail.value[1] + e.detail.value[2],
from_province_id: e.detail.code[0],
from_city_id: e.detail.code[1],
from_region_id: e.detail.code[2],
from_province: e.detail.value[0],
from_city: e.detail.value[1],
from_region: e.detail.value[2]
})
},
bindRegionChangek: function(e) {
console.log(e)
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
fromnamek: e.detail.value[0] + e.detail.value[1] + e.detail.value[2],
from_province_idk: e.detail.code[0],
from_city_idk: e.detail.code[1],
from_region_idk: e.detail.code[2],
from_provincek: e.detail.value[0],
from_cityk: e.detail.value[1],
from_regionk: e.detail.value[2]
})
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].from_province_id = e.detail.code[0],
newpeople[index].from_city_id = e.detail.code[1],
newpeople[index].from_region_id = e.detail.code[2],
newpeople[index].from_province = e.detail.value[0],
newpeople[index].from_city = e.detail.value[1],
newpeople[index].from_region = e.detail.value[2]
this.setData({
people: newpeople
})
},
entertype(e) {
this.setData({
typename: e.detail.value
})
},
// 手机号
enterphone(e) {
this.setData({
phone: e.detail.value
})
},
enterphonek(e) {
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].mobile = e.detail.value;
this.setData({
people: newpeople
})
},
// 姓名
entername(e) {
this.setData({
xingname: e.detail.value
})
},
enternamek(e) {
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].name = e.detail.value;
this.setData({
people: newpeople
})
console.log(this.data.people)
},
// 输入公司
entercompany(e) {
this.setData({
companyname: e.detail.value
})
},
entercompanyk(e) {
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].unit_id = e.detail.value;
this.setData({
people: newpeople
})
},
// 身份证号
entercard(e) {
let that = this
that.setData({
card: e.detail.value
})
if (that.data.type == '') {
}
console.log(this.data.card)
},
entercardk(e) {
let index = e.currentTarget.dataset.index;
console.log(index)
let newpeople = this.data.people;
newpeople[index].identity = e.detail.value;
this.setData({
people: newpeople
})
console.log(this.data.people)
},
// 详细地址
enterdetailadd(e) {
this.setData({
detailadd: e.detail.value
})
},
enterdetailaddk(e) {
let index = e.currentTarget.dataset.index;
let newpeople = this.data.people;
newpeople[index].add = e.detail.value;
this.setData({
people: newpeople
})
},
del(e) {
let index = e.currentTarget.dataset.index;
console.log(index)
let newpeople = this.data.people;
for (var i = 0; i < newpeople.length; i++) {
newpeople.splice(index, 1)
}
this.setData({
people: newpeople
})
},
finish() {
let that = this;
console.log(that.data.falsebtn)
var url = '/api/user/back_nation';
console.log(this.data.people)
if (that.data.chuxing == '请选择出行方式') {
wx.showToast({
title: '请选择出行方式',
icon: "none"
})
return false
}
let newpeople = that.data.people;
newpeople.forEach(item => delete item.quarray)
console.log(newpeople)
for (let obj of newpeople) {
delete obj['quarrayk'];
delete obj['quindex'];
delete obj['xiangindex'];
}
var params = {
travel: that.data.chuxing,
number: that.data.typename,
name: this.data.xingname,
mobile: this.data.phone,
nation: that.data.nationid,
credentials_type: that.data.certificateid,
identity: this.data.card,
from_province: this.data.from_province,
arrivecity: this.data.arrivecity,
arrivetime: this.data.date,
town_pid: this.data.xiangid,
town_id: this.data.quid,
add: this.data.detailadd,
is_symptom: this.data.is_symptom,
is_epidemic: this.data.is_epidemic,
people: JSON.stringify(newpeople),
}
app.post(url, params, "post").then((res) => {
console.log(res);
wx.showToast({
title: '提交成功',
icon: 'none'
})
that.setData({
falsebtn: true
})
if (that.data.clock == 1) {
setTimeout(function() {
wx.redirectTo({
url: '/pages/clock/clock?scene=' + that.data.scene,
})
}, 1500)
} else {
setTimeout(function() {
wx.redirectTo({
url: '/pages/outbackpeopledetail/outbackpeopledetail',
})
}, 1500)
}
}).catch((err) => {
wx.showToast({
title: err.data.msg,
icon: 'none'
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
companyname: app.globalData.workname != undefined ? app.globalData.workname : '请选择工作单位',
shortworkname: app.globalData.shortworkname != undefined ? app.globalData.shortworkname : '',
workid: app.globalData.workid != undefined ? app.globalData.workid : ''
})
console.log(app.globalData.workname);
console.log(app.globalData.workid)
console.log(app.globalData.shortworkname)
let token = wx.getStorageSync("token");
if (token == '') {
wx.showToast({
title: '请先授权登录',
icon: "none"
})
setTimeout(function() {
wx.navigateTo({
url: '/pages/start/start',
})
}, 1500)
let url = '/pages/outbackpeopledoor/outbackpeopledoor';
wx.setStorageSync("url", url)
wx.setStorageSync("nologin", true)
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "返静人员注册"
}
\ No newline at end of file
... ...
<view class="backhead">
<image src="/img/outdoor.png"></image>
</view>
<view class="backbox">
<view class="backboxitem">
<!-- 出行方式--车牌号码 -->
<view class="backtop">
<picker bindchange="bindtypeChange" value="{{chuxingindex}}" range="{{chuixngarray}}">
<view class="picker">
<!-- 当前选择:{{array[index]}} -->
<view class="useboxitem flextwo">
<view class="itemname commonone">返静方式</view>
<view class="itemright flexone">
<view class="commontwo seltype">
{{chuxing}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</view>
</picker>
<view class="useboxitem flextwo" wx:if="{{chuxingindex==1||chuxingindex==3}}">
<view class="itemname commonone">车牌号码</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写车牌号码" placeholder-class="commontwo" bindinput="entertype" value="{{typename}}" />
</view>
</view>
</view>
<view class="useboxitem flextwo" wx:if="{{chuxingindex==2}}">
<view class="itemname commonone">车次</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写车次" placeholder-class="commontwo" bindinput="entertype" value="{{typename}}" />
</view>
</view>
</view>
<view class="useboxitem flextwo" wx:if="{{chuxingindex==0}}">
<view class="itemname commonone">航班号</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写航班号" placeholder-class="commontwo" bindinput="entertype" value="{{typename}}" />
</view>
</view>
</view>
<view class="useboxitem flextwo" wx:if="{{chuxingindex==4}}">
<view class="itemname commonone">其他</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写交通方式" placeholder-class="commontwo" bindinput="entertype" value="{{typename}}" />
</view>
</view>
</view>
</view>
<!-- 司机及随车人员信息 -->
<!-- <text class="enterzhong">*填写身份证号,自动匹配已录入信息。</text> -->
<view class="backtop userbox">
<view class="useboxitem flextwo">
<view class="itemname commonone">姓名</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写姓名" placeholder-class="commontwo" bindinput="entername" value="{{xingname}}" />
</view>
</view>
</view>
<picker bindchange="bindnationChange" value="{{nationindex}}" range="{{nationarray}}" range-key='name'>
<view class="picker">
<!-- 当前选择:{{array[index]}} -->
<view class="useboxitem flextwo">
<view class="itemname commonone">国籍/地区</view>
<view class="itemright flexone">
<view class="commontwo seltype">
{{nation}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</view>
</picker>
<picker bindchange="bindcertificateChange" value="{{certificateindex}}" range="{{ certificatearray}}" range-key='name'>
<view class="picker">
<!-- 当前选择:{{array[index]}} -->
<view class="useboxitem flextwo">
<view class="itemname commonone">证件类型</view>
<view class="itemright flexone">
<view class="commontwo seltype">
{{certificate}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</view>
</picker>
<view class="useboxitem flextwo" wx:if="{{certificateid==1}}">
<view class="itemname commonone">身份证号</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写身份证号" placeholder-class="commontwo" bindinput="entercard" value="{{card}}" />
</view>
</view>
</view>
<view class="useboxitem flextwo" wx:if="{{certificateid==2}}">
<view class="itemname commonone">港澳台通行证号</view>
<view class="itemright flexone">
<view class="commontwo tu">
<input placeholder="港澳台通行证号" placeholder-class="commontwo" bindinput="entercard" value="{{card}}" />
</view>
</view>
</view>
<view class="useboxitem flextwo" wx:if="{{certificateid==3}}">
<view class="itemname commonone">护照号</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写护照号" placeholder-class="commontwo" bindinput="entercard" value="{{card}}"/>
</view>
</view>
</view>
<view class="useboxitem flextwo">
<view class="itemname commonone">联系电话</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填联系电话" placeholder-class="commontwo" bindinput="enterphone" value="{{phone}}" />
</view>
</view>
</view>
<view class="useboxitem flextwo">
<view class="itemname commonone">从何国返静</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写从何国返静" placeholder-class="commontwo" bindinput="fromprovince" value="{{from_province}}" />
</view>
</view>
</view>
<view class="useboxitem flextwo">
<view class="itemname commonone">途经国家或城市</view>
<view class="itemright flexone">
<view class="commontwo tu">
<input placeholder="请填写途经国家或城市" placeholder-class="commontwo" bindinput="enterbyway" value="{{arrivecity}}" />
</view>
</view>
</view>
<picker mode="date" value="{{date}}" start="2020-01-01" bindchange="bindDateChange">
<view class="picker">
<view class="useboxitem flextwo">
<view class="itemname commonone">到静海时间(计划)</view>
<view class="itemright flexone ">
<view class="commontwo seltype plan">
{{date}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</view>
</picker>
<picker value="{{xiangindex||0}}" range="{{xiangarray}}" range-key="name" bindchange="bindxiangChange">
<view class="picker">
<view class="useboxitem flextwo">
<view class="itemname commonone">目的地乡镇</view>
<view class="itemright flexone">
<view class="commontwo seltype">
{{xiangname}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</view>
</picker>
<picker value="{{first.quindex}}" range="{{first.quarray}}" range-key="name" bindchange="bindquChange">
<view class="picker">
<view class="useboxitem flextwo">
<view class="itemname commonone">目的地社区</view>
<view class="itemright flexone">
<view class="commontwo seltype">
{{quname}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</view>
</picker>
<view class="useboxitem flextwo">
<view class="itemname commonone">详细地址(具体到门牌号)</view>
<view class="itemright flexone tu">
<view class="commontwo men">
<input placeholder="请填详细地址" placeholder-class="commontwo" bindinput="enterdetailadd" value="{{detailadd}}" />
</view>
</view>
</view>
<view class="useboxitem flextwo">
<view class="itemname commonone">是否有相应症状(发热、呕吐)</view>
<view class="itemright flexone">
<view class="selleft flexone">
<view class="selleftitem selzuo flexone" bindtap="selsy">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_symptom==1}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">是</view>
</view>
<view class="selleftitem flexone " bindtap="selsn">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_symptom==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">否</view>
</view>
</view>
</view>
</view>
<!-- <view class="useboxitem flextwo">
<view class="itemname commonone">1月1日以来到过的城市</view>
<view class="itemright flexone gicity">
<view class="commontwo men">
<input placeholder="请填写去过的城市" placeholder-class="commontwo" bindinput="gocity" value="{{gocity}}" />
</view>
</view>
</view> -->
<view class="useboxitem flextwo">
<view class="itemname commonone">两周内有无重度疫情区来往接触史</view>
<view class="itemright flexone">
<view class="selleft flexone">
<view class="selleftitem selzuo flexone" bindtap="selzy">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_epidemic==1}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">是</view>
</view>
<view class="selleftitem flexone " bindtap="selzn">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_epidemic==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">否</view>
</view>
</view>
</view>
</view>
</view>
<view class="bot">
<view class="subtwo" bindtap="{{falsebtn==false?'finish':''}}">完成</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
page {
background: #f9f9fb;
}
.backhead {
width: 750rpx;
height: 320rpx;
font-size: 0;
}
.backbox {
width: 750rpx;
height: 860rpx;
background: linear-gradient(180deg, rgba(28, 143, 255, 1) 0%, rgba(249, 249, 249, 1) 100%);
opacity: 1;
position: relative;
}
.backboxitem {
width: 100%;
position: absolute;
top: 0;
left: 0;
display: flex;
justify-content: center;
flex-direction: column;
}
.backtop {
width: 690rpx;
background: rgba(255, 255, 255, 1);
opacity: 1;
border-radius: 8rpx;
padding: 0 26rpx;
box-sizing: border-box;
margin: 0 auto;
}
.useboxitem {
width: 100%;
padding: 30rpx 0;
box-sizing: border-box;
background: #fff;
border-bottom: 1rpx solid #f5f5f5;
}
.leftimg {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
.itemname {
font-size: 28rpx;
font-weight: bold;
}
.ren {
color: #ef7847;
font-size: 28rpx;
margin-right: 26rpx;
}
.loimg {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
.lotop {
display: flex;
justify-content: flex-end;
align-items: center;
}
.seltype {
width: 400rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
margin-right: 24rpx;
}
.plan {
width: 300rpx;
}
.commonenter {
width: 420rpx;
margin-right: 50rpx;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
.commonenter input {
width: 100%;
height: 100%;
text-align: right;
}
.userbox {
margin-top: 30rpx;
}
.selzuo {
margin-right: 56rpx;
}
.sellefitemimg {
width: 24rpx;
height: 24rpx;
font-size: 0;
margin-right: 18rpx;
}
.gicity {
width: 300rpx;
}
.addbtn {
width: 364rpx;
height: 88rpx;
background: #1c8fff;
border-radius: 44rpx;
margin: 56rpx auto 0;
color: #fff;
font-size: 32rpx;
text-align: center;
line-height: 88rpx;
}
.rangeimg {
width: 32rpx;
height: 32rpx;
font-size: 0;
margin-right: 8rpx;
}
.rangename {
color: #fa3030;
font-size: 28rpx;
}
.range {
padding: 30rpx;
justify-content: flex-end;
}
.enterzhong {
color: #fa3030;
font-size: 32rpx;
width: 690rpx;
margin:0 auto;
padding: 26rpx 0 0;
box-sizing: border-box;
}
.tu{
text-align: right;
margin-right:50rpx;
}
... ...
... ... @@ -349,6 +349,8 @@ Page({
},
back(){
let that = this;
var url = '/api/user/index';
var params = {
... ... @@ -357,18 +359,24 @@ Page({
}
app.post(url, params).then((res) => {
console.log(res);
if (res.qrcode == '') {
if (res.back_type == 0) {
wx.navigateTo({
url: '/pages/backpeople/backpeople',
url: '/pages/backenterdoor/backenterdoor',
})
} else {
} else if (res.back_type == 1) {
wx.navigateTo({
url: '/pages/backdetail/backdetail',
})
}else{
wx.navigateTo({
url: '/pages/outbackpeopledetail/outbackpeopledetail',
})
}
... ... @@ -383,42 +391,16 @@ Page({
},
resup(){
let that = this;
var url = '/api/user/index';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
company_status: res.company_status
let office_token = wx.getStorageSync("office_token");
if (office_token == '') {
wx.navigateTo({
url: '/pages/login/login?type=' + 1,
})
console.log(this.data.company_status)
if (that.data.company_status == 0) {
console.log(43894)
wx.navigateTo({
url: '/pages/companyidentity/companyidentity',
})
} else if (that.data.company_status == 1){
wx.navigateTo({
url: '/pages/shenhez/shenhez',
})
} else if (that.data.company_status == 2){
console.log(6666)
wx.navigateTo({
url: '/pages/fugongshenqing/fugongshenqing',
})
}
}).catch((err) => {
})
} else {
wx.navigateTo({
url: '/pages/logining/logining',
})
}
},
manager(){
wx.navigateTo({
... ... @@ -429,11 +411,14 @@ Page({
let usertoken=wx.getStorageSync("usertoken");
if (usertoken==''){
wx.navigateTo({
url: '/pages/login/login',
url: '/pages/login/login?type='+2,
})
}else{
// wx.navigateTo({
// url: '/pages/backpeoplelist/backpeoplelist',
// })
wx.navigateTo({
url: '/pages/backpeoplelist/backpeoplelist',
url: '/pages/enterdoor/enterdoor',
})
}
... ...
... ... @@ -17,12 +17,19 @@
<image src="/img/img_fanjing.png"></image>
</view>
</view>
<view class="startitem" bindtap="resup">
<!-- <view class="startitem" bindtap="resup">
<view class="startitemtop">营业场所</view>
<view class="register">登记</view>
<view class="startimg">
<image src="/img/img_fugong.png"></image>
</view>
</view> -->
<view class="startitem" bindtap="backlist">
<view class="startitemtop">乡镇管理员</view>
<view class="register">入口</view>
<view class="startimg">
<image src="/img/guanli.png"></image>
</view>
</view>
<view class="startitem" bindtap="manager">
<view class="startitemtop">企业</view>
... ... @@ -31,13 +38,7 @@
<image src="/img/img_qiye.png"></image>
</view>
</view>
<view class="startitem" bindtap="backlist">
<view class="startitemtop">乡镇管理员</view>
<view class="register">入口</view>
<view class="startimg">
<image src="/img/guanli.png"></image>
</view>
</view>
</view>
... ...
<view class="topimg">
<image src="/img/bg.png"></image>
<view class="logoimg">
<image src="/img/logo.png"></image>
</view>
<view class="startbanner">
<image src="/img/startbanner.png"></image>
</view>
</view>
<view class="startbox">
<view class="startitem" bindtap="back">
<view class="startitemtop">返静人员</view>
<view class="register">注册</view>
<view class="startimg">
<image src="/img/img_fanjing.png"></image>
</view>
</view>
<!-- <view class="startitem" bindtap="resup">
<view class="startitemtop">企业复工</view>
<view class="register">申请</view>
<view class="startimg">
<image src="/img/img_fugong.png"></image>
</view>
</view> -->
<view class="startitem" bindtap="backlist">
<view class="startitemtop">返静人员</view>
<view class="register">管理</view>
<view class="startimg">
<image src="/img/guanli.png"></image>
</view>
</view>
<view class="startitem" bindtap="manager">
<view class="startitemtop">企业</view>
<view class="register">管理及服务</view>
<view class="startimg">
<image src="/img/img_qiye.png"></image>
</view>
</view>
</view>
<view class="jiaotop">
<view class="botjiao" bindtap="sub">
<view class="codeimg">
<image src="/img/erweima.png"></image>
</view>
</view>
</view>
<view class="registerk" wx:if="{{nologin}}">
<view class="userwrap commonpadding">
<view class="lotop" bindtap="hidelogin">
<view class="loimg">
<image src="/img/chahao.png"></image>
</view>
</view>
<view class="shou">请先授权登录</view>
<view class="shoutext">为了更好的为你提供服务,请允许微信授权后再使用功能</view>
<button open-type="getUserInfo" bindgetuserinfo='start' class="shoubtn flexthree">
<view class="shoubtnleft loimg">
<image src="/img/wechat.png"></image>
</view>
<view class="word">微信授权登录</view>
</button>
</view>
</view>
<view class="registerk" wx:if="{{showcode}}">
<view class="codewrap">
<view class="codetop">
<image src="/img/codetopimg.png"></image>
<view class="codename">我的二维码</view>
</view>
<view class="codekimg" bindlongpress="baocun">
<image src="{{codeurl}}"></image>
</view>
<view class="ansave">长按保存二维码</view>
</view>
<view class="closeimg" bindtap="closecode">
<image src="/img/closecode.png"></image>
</view>
</view>
\ No newline at end of file
... ...