作者 lihongjuan

1

正在显示 73 个修改的文件 包含 4849 行增加0 行删除

要显示太多修改。

为保证性能只显示 73 of 73+ 个文件。

//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
post: function (url, data, headerParams) {
wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data;
let baseUrl = 'https://jhfy.jjjtech.cn';
//网络请求
let header = {
// 'XX-Device-Type': 'wxapp',
'token': wx.getStorageSync("token") || ''
}
header = Object.assign(header, headerParams)
//网络请求
wx.request({
url: baseUrl + url,
data: postData,
method: headerParams,
header: header,
success: function (res) { //返回取得的数据
if (res.data.code == '1') {
resolve(res.data.data);
} else if (res.data.code == '201') {
resolve(res.data);
} else {
// wx.showToast({
// title: res.data.msg,
// duration: 1200,
// icon: 'none'
// })
reject(res)
}
// else if (res.data.code == '42002') {
// }
// setTimeout(function () {
// wx.hideNavigationBarLoading()
// }, 600)
},
fail: function (e) {
reject('网络出错');
// wx.hideLoading()
wx.hideNavigationBarLoading()
},
complete: function () {
wx.hideNavigationBarLoading()
},
})
});
return promise;
},
upload(filetype, file) {
var promise = new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
wx.showLoading({
title: '上传中',
})
let url = 'https://jhfy.jjjtech.cn/api/common/upload';
let head = {
'token': wx.getStorageSync('token'),
'XX-Device-Type': ''
}
let typename = {
filetype: filetype
}
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: file,
name: 'file',
header: head,
formData: typename,
success: function (res) {
console.log('上传文件后', res)
let temdata = JSON.parse(res.data);
console.log(temdata)
let urlobj = {
url: temdata.data.preview_url,
kurl: temdata.data.url
}
resolve(urlobj);
},
fail: function (res) {
reject('网络出错');
wx.hideNavigationBarLoading()
wx.hideLoading()
},
complete: () => {
wx.hideNavigationBarLoading()
wx.hideLoading()
},
})
});
return promise;
},
globalData: {
userInfo: null
}
})
\ No newline at end of file
... ...
{
"pages": [
"pages/logining/logining",
"pages/businessoffice/businessoffice",
"pages/start/start",
"pages/service/service",
"pages/login/login",
"pages/fugongshenqing/fugongshenqing",
"pages/selectdanwei/selectdanwei",
"pages/clock/clock",
"pages/clocklist/clocklist",
"pages/write/write",
"pages/backdetail/backdetail",
"pages/backpeopledetail/backpeopledetail",
"pages/companyidentity/companyidentity",
"pages/homepage/homepage",
"pages/replaydetail/replaydetail",
"pages/backpeoplelist/backpeoplelist",
"pages/backpeople/backpeople",
"pages/detail/detail",
"pages/index/index",
"pages/logs/logs",
"pages/publish/publish",
"pages/interaction/interaction",
"pages/usercenter/usercenter",
"pages/shenhez/shenhez"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#1C8FFF",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "white"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
... ...
/**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;
}
.flexfour{
display: flex;
flex-direction: column;
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;
}
... ...

11.5 KB

513 字节

861 字节

780 字节

870 字节

// 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_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.first
})
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/backpeople/backpeople?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">车牌号</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">出行信息1</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">
{{first.identity}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">工作单位</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{first.company_name}}
</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 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.from_province}}{{first.from_city}}{{first.from_region}}
</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">1月1日以来到过的城市</view>
<view class="itemright flexone">
<view class="commontwo men">
{{first.arrivecity}}
</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="backbox">
<view class="backtop peopleitem" wx:for="{{back_list}}" wx:key="index">
<view class="useboxitem flextwo">
<view class="itemname commonone topname">出行信息{{index+2}}</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">姓名</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.name}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">身份证号</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.identity}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">工作单位</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.unit_id}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">联系电话</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.mobile}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">到静海时间(计划)</view>
<view class="itemright flexone time">
<view class="commontwo commonenter">
{{item.arrivetime}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">从何地返静</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.from_province}}{{item.from_city}}{{item.from_region}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">目的地</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.town_p_name}}{{item.town_name}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">详细地址(具体到门牌号)</view>
<view class="itemright flexone">
<view class="commontwo men">
{{item.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="{{item.is_symptom==1}}">
</view>
<view class="commontwo commonenter" wx:else>
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">1月1日以来到过的城市</view>
<view class="itemright flexone">
<view class="commontwo men">
{{item.arrivecity}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">两周内有无重度疫情区来往接触史</view>
<view class="itemright flexone istouch">
<view class="commontwo commonenter" wx:if="{{item.is_epidemic==1}}">
</view>
<view class="commontwo commonenter" wx:else>
</view>
</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:''
},
/**
* 生命周期函数--监听页面加载
*/
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
})
}
},
// 选择工作单位
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
})
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
})
},
enterzheng() {
let that = this;
let card = that.data.card;
console.log(card.length)
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (!reg.test(card)) {
wx.showToast({
title: '请输入正确身份证号',
icon: "none"
})
} else {
if (that.data.type == '') {
var url = '/api/user/back_identity';
var params = {
identity: that.data.card,
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
basicinfo: res.back
})
if (res.is_have == 1) {
wx.showModal({
content: '是否自动匹配信息',
success(res) {
if (res.confirm) {
that.setData({
xingname: that.data.basicinfo.name,
card: that.data.basicinfo.identity,
companyname: that.data.basicinfo.unit_id,
danweiname: that.data.basicinfo.unit,
phone: that.data.basicinfo.mobile,
date: that.data.basicinfo.arrivetime,
fromname: that.data.basicinfo.from_province + that.data.basicinfo.from_city + that.data.basicinfo.from_region,
from_province_id: that.data.basicinfo.from_province_id,
from_region_id: that.data.basicinfo.from_region_id,
from_city_id: that.data.basicinfo.from_city_id,
from_province: that.data.basicinfo.from_province,
from_city: that.data.basicinfo.from_city,
from_region: that.data.basicinfo.from_region,
xiangname: that.data.basicinfo.town_p_name,
xiangid: that.data.basicinfo.town_pid||1,
quname: that.data.basicinfo.town_name,
quid: that.data.basicinfo.town_id,
detailadd: that.data.basicinfo.add,
is_epidemic: that.data.basicinfo.is_epidemic,
is_symptom: that.data.basicinfo.is_symptom,
gocity: that.data.basicinfo.arrivecity,
xiangindex: that.data.basicinfo.town_pid - 1,
quindex: that.data.basicinfo.town_id - 41
})
that.getqu()
} else if (res.cancel) {
}
}
})
}
}).catch((err) => {
console.log(err)
wx.showToast({
title: '该人员信息已经注册,请勿重复注册',
icon: 'none'
})
})
}
}
},
enterzhengk() {
let that = this;
let card = that.data.card;
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (!reg.test(card)) {
wx.showToast({
title: '请输入正确身份证号',
icon: "none"
})
}
},
// 身份证号
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';
console.log(this.data.people)
if (that.data.chuxing == '请选择出行方式') {
wx.showToast({
title: '请选择出行方式',
icon: "none"
})
return false
}
if(that.data.shortworkname==''){
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,
identity: this.data.card,
unit_id: this.data.shortworkname,
company_id:this.data.workid,
company_name:this.data.companyname,
arrivetime: this.data.date,
from_province: this.data.from_province,
from_province_id: this.data.from_province_id,
from_city: this.data.from_city,
from_city_id: this.data.from_city_id,
from_region: this.data.from_region,
from_region_id: this.data.from_region_id,
town_pid: this.data.xiangid,
town_id: this.data.quid,
add: this.data.detailadd,
is_symptom: this.data.is_symptom,
arrivecity: this.data.gocity,
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/backdetail/backdetail',
})
}, 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/backpeople/backpeople';
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/topimg.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==0||chuxingindex==2||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 class="useboxitem flextwo" wx:if="{{chuxingindex==1}}">
<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==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==5}}">
<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>
<view class="useboxitem flextwo">
<view class="itemname commonone">身份证号</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
<input placeholder="请填写身份证号" placeholder-class="commontwo" bindinput="entercard" value="{{card}}" bindblur="enterzheng"/>
</view>
</view>
</view>
<view class="useboxitem flextwo" bindtap="selectcompany">
<view class="itemname commonone">工作单位</view>
<view class="itemright flexone" >
<view class="commontwo seltype">
{{companyname}}
<!-- <input placeholder="请填写工作单位" placeholder-class="commontwo" bindinput="entercompany" value="{{companyname}}" /> -->
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</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>
<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>
<view class="useboxitem flextwo">
<view class="itemname commonone">从何地返静</view>
<picker mode="region" bindchange="bindRegionChange" value="{{[from_province,from_city,from_region]}}" custom-item="{{customItem}}">
<view class="picker">
<view class="itemright flexone">
<view class="commontwo seltype">
{{fromname||'请选择返乡地点'}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</picker>
</view>
<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">
<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="suichebox">
<view class="backtop userbox" wx:for="{{people}}" wx:key="" data-index="{{index}}">
<view class="flex range" bindtap="del" data-index="{{index}}">
<view class="rangeimg">
<image src="/img/delete.png"></image>
</view>
<view class="rangename">删除</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="enternamek" data-index="{{index}}" value="{{item.name}}" />
</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="entercardk" data-index="{{index}}" value="{{item.identity}}" bindblur="enterzhengk"/>
</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="entercompanyk" value="{{item.unit_id}}" data-index="{{index}}"/>
</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="enterphonek" data-index="{{index}}" value="{{item.mobile}}" />
</view>
</view>
</view>
<picker mode="date" value="{{date}}" start="2020-01-01" bindchange="bindDateChangek" data-index="{{index}}">
<view class="picker">
<view class="useboxitem flextwo">
<view class="itemname commonone">到静海时间(计划)</view>
<view class="itemright flexone ">
<view class="commontwo seltype plan">
{{item.arrivetime}}
</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>
<picker mode="region" bindchange="bindRegionChangek" value="{{[item.from_province,item.from_city,item.from_region]}}" custom-item="{{customItem}}" data-index="{{index}}">
<view class="picker">
<view class="itemright flexone">
<view class="commontwo seltype">
{{item.from_province}} {{item.from_city}} {{item.from_region}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</picker>
</view>
<picker value="{{item.xiangindex||0}}" range="{{xiangarray}}" range-key="name" bindchange="bindxiangChangek" data-index="{{index}}" >
<view class="picker">
<view class="useboxitem flextwo">
<view class="itemname commonone">目的地乡镇</view>
<view class="itemright flexone">
<view class="commontwo seltype">
{{item.town_p_name}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</view>
</picker>
<view class="useboxitem flextwo" wx:if="{{item.town_p_name=='请选择乡镇'}}" bindtap="panduan" data-index="{{index}}">
<view class="itemname commonone">目的地社区</view>
<view class="itemright flexone">
<view class="commontwo seltype">
{{item.town_name}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
<view wx:else >
<picker value="{{item.quindex}}" range="{{item.quarrayk}}" range-key="name" bindchange="bindquChangek" data-index='{{index}}'>
<view class="picker">
<view class="useboxitem flextwo">
<view class="itemname commonone">目的地社区</view>
<view class="itemright flexone">
<view class="commontwo seltype">
{{item.town_name}}
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</view>
</picker>
</view>
<view class="useboxitem flextwo">
<view class="itemname commonone">详细地址(具体到门牌号)</view>
<view class="itemright flexone">
<view class="commontwo men">
<input placeholder="请填详细地址" placeholder-class="commontwo" bindinput="enterdetailaddk" data-index="{{index}}" value="{{item.add}}" />
</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="selsyk" data-index="{{index}}">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{item.is_symptom==1}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">是</view>
</view>
<view class="selleftitem flexone " bindtap="selsnk" data-index="{{index}}">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{item.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="gocityk" data-index="{{index}}" value="{{item.arrivecity}}" />
</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="selzyk" data-index="{{index}}">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{item.is_epidemic==1}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">是</view>
</view>
<view class="selleftitem flexone " bindtap="selznk" data-index="{{index}}">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{item.is_epidemic==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">否</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="addbtn" bindtap="addsuiche">添加随车人员信息</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;
}
... ...
// pages/backpeopledetail/backpeopledetail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id: '',
peopledetail: '',
uintid: '',
unitname: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
id: options.id
})
this.getpeopledetail()
},
// 获取工作单位
getdanweilist() {
let that = this;
var url = '/api/index/unit';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
for (var obj of res.unit) {
if (obj.id == that.data.unitid) {
that.setData({
unitname: obj.name
})
}
}
}).catch((err) => {
})
},
// 获取单位
getpeopledetail() {
let that = this;
var url = '/api/user/back_people_detail';
var params = {
admin_token: wx.getStorageSync("usertoken"),
back_id: this.data.id
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
peopledetail: res.back,
uintid: res.back.unit_id
})
that.getdanweilist()
}).catch((err) => {
})
},
tongguo() {
let that = this;
wx.showModal({
title: '提示',
content: '是否通过审核',
success(res) {
if (res.confirm) {
let url = '/api/user/back_people_examine',
params = {
admin_token: wx.getStorageSync("usertoken"),
back_id: that.data.id,
is_company: 1,
}
app.post(url, params, "post").then((res) => {
console.log(res);
wx.showToast({
title: '审核通过',
icon: 'none'
})
setTimeout(function() {
that.getpeopledetail()
}, 1500)
}).catch((err) => {
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
bohui() {
let that = this;
wx.showModal({
title: '提示',
content: '是否驳回审核',
success(res) {
if (res.confirm) {
let url = '/api/user/back_people_examine',
params = {
admin_token: wx.getStorageSync("usertoken"),
back_id: that.data.id,
is_company: 2,
}
app.post(url, params, "post").then((res) => {
console.log(res);
wx.showToast({
title: '审核驳回',
icon: 'none'
})
setTimeout(function() {
that.getpeopledetail()
}, 1500)
}).catch((err) => {
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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 backitem flextwo">
<view class="itemname commonone">出行方式</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{peopledetail.travel}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone" wx:if="{{peopledetail.travel=='货车'||peopledetail.travel=='自驾'||peopledetail.travel=='大巴'}}">车牌号</view>
<view class="itemname commonone" wx:if="{{peopledetail.travel=='火车'}}">车次</view>
<view class="itemname commonone" wx:if="{{peopledetail.travel=='飞机'}}">航班号</view>
<view class="itemname commonone" wx:if="{{peopledetail.travel=='其他'}}">有效证件</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{peopledetail.number}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">姓名</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{peopledetail.name}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">身份证号</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{peopledetail.identity}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">工作单位</view>
<view class="itemright flexone">
<view class="commontwo commonenter danweiname">
{{peopledetail.unit_id}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">联系电话</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{peopledetail.mobile}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">到静海时间(计划)</view>
<view class="itemright flexone time">
<view class="commontwo commonenter">
{{peopledetail.arrivetime_text}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">从何地返静</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{peopledetail.from_province}}--{{peopledetail.from_city}}--{{peopledetail.from_region}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">目的地</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{peopledetail.town_p_name}}--{{peopledetail.town_name}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">详细地址(具体到门牌号)</view>
<view class="itemright flexone">
<view class="commontwo men">
{{peopledetail.add}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">是否有相应症状(发热、呕吐)</view>
<view class="itemright flexone">
<view class="commontwo commonenter" wx:if="{{peopledetail.is_symptom==1}}">
</view>
<view class="commontwo commonenter" wx:else>
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">1月1日以来到过的城市</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{peopledetail.arrivecity}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">两周内有无重度疫情区来往接触史</view>
<view class="itemright flexone istouch">
<view class="commontwo commonenter" wx:if="{{peopledetail.is_epidemic==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">
<view class="commontwo commonenter">
{{peopledetail.is_company}}
</view>
</view>
</view>
<view class="footerbox flextwo" wx:if="{{peopledetail.is_company=='审核中'}}">
<view class="footerboxitem fotleft" bindtap="tongguo">通过</view>
<view class="footerboxitem fotright" bindtap="bohui">驳回</view>
</view>
</view>
\ No newline at end of file
... ...
page {
background: #fbf8fb;
}
.commonenter {
margin-right: 0;
text-align: right;
}
.danweiname {
width: 420rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.istouch {
width: 150rpx;
}
.fotleft{
width:200rpx;
height:80rpx;
color:#fff;
font-size: 28rpx;
text-align: center;
line-height: 80rpx;
border-radius: 40rpx;
background: #1C8FFF;
}
.fotright{
width:200rpx;
height:80rpx;
color:#fff;
font-size: 28rpx;
text-align: center;
line-height: 80rpx;
border-radius: 40rpx;
background: #BDC4CE;
}
.footerbox{
padding: 32rpx 56rpx;
box-sizing: border-box;
}
\ No newline at end of file
... ...
// pages/backpeoplelist/backpeoplelist.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
page:1,
peoplelist:[],
xiangindex: 0,
xiangname: '请选择乡镇',
xiangid: '',
quname: '请选择社区',
quid: '',
quindex: 0,
xiangarray:[],
quarray:[],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getpeoplelist();
},
selectqu(){
if(this.data.xiangid==''){
wx.showToast({
title: '请先选择乡镇',
icon:'none'
})
}
},
// 获取乡镇
// 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,
// xiangname: res.town[0].name,
// xiangid: res.town[0].id
// })
// console.log(this.data.xiangarray)
// that.getqu()
// }).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
// })
// this.getqu()
// },
// getqu() {
// let that = this;
// var url = '/api/index/town';
// var params = {
// type: 2,
// pid: that.data.xiangid
// }
// app.post(url, params).then((res) => {
// console.log(res);
// that.setData({
// quarray: res.town,
// quid:res.town[0].id,
// quname:res.town[0].name
// })
// console.log(this.data.quid)
// }).catch((err) => {
// })
// },
// bindquChange: function (e) {
// this.setData({
// quname: this.data.quarray[e.detail.value].name,
// quid: this.data.quarray[e.detail.value].id,
// quindex: e.detail.value
// })
// },
getpeoplelist(){
let that = this;
var url = '/api/user/back_people';
var params = {
town_pid:that.data.xiangid,
town_id:that.data.quid,
admin_token: wx.getStorageSync("usertoken"),
page:this.data.page
}
app.post(url, params,"post").then((res) => {
console.log(res);
that.setData({
peoplelist: that.data.peoplelist.concat(res.back)
})
}).catch((err) => {
})
},
peopledetail(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/backpeopledetail/backpeopledetail?id='+id,
})
},
search(){
this.getpeoplelist()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
wx.showNavigationBarLoading() //在标题栏中显示加载
this.setData({
page: 1,
peoplelist: []
})
this.getpeoplelist()
//模拟加载
setTimeout(function () {
// complete
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
}, 1000);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let newpage=this.data.page;
newpage++;
this.setData({
page:newpage
})
this.getpeoplelist()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "返静人员管理"
}
\ No newline at end of file
... ...
<!-- <view class="flextwo range">
<view class="flexone">
<view class="rangeimg">
<image src="/img/address.png"></image>
</view>
<view class="flexone">
<picker value="{{xiangindex}}" range="{{xiangarray}}" range-key="name" bindchange="bindxiangChange">
<view class="picker">
<view class="rangename">{{xiangname}}</view>
</view>
</picker>
<view class="rangename" wx:if="{{xiangid==''}}" bindtap="selectqu">请选择社区</view>
<picker value="{{quindex}}" range="{{quarray}}" range-key="name" bindchange="bindquChange" wx:else>
<view class="picker">
<view class="rangename">{{quname}}</view>
</view>
</picker>
</view>
</view>
<view class="sou" bindtap="search">搜索</view>
</view> -->
<view class="nodata" wx:if="{{peoplelist.length==0}}">暂无数据</view>
<view class="backpeoplebox" wx:else>
<view class="backtop" wx:for="{{peoplelist}}" wx:key="" bindtap="peopledetail" data-id="{{item.id}}">
<view class="useboxitem flextwo">
<view class="itemname commonone">{{item.name}}</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">联系电话</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.mobile}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">到静海时间(计划)</view>
<view class="itemright flexone time">
<view class="commontwo commonenter">
{{item.arrivetime_text}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">从何地返静</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.from_province}}--{{item.from_city}}--{{item.from_region}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">目的地</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
{{item.town_p_name}}--{{item.town_name}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">详细地址(具体到门牌号)</view>
<view class="itemright flexone">
<view class="commontwo men">
{{item.add}}
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">企业审核确认</view>
<view class="itemright flexone">
<view class="commontwo men">
{{item.is_company}}
</view>
</view>
</view>
</view>
<!--
<view class="backtop">
<view class="useboxitem flextwo">
<view class="itemname commonone">王某某</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">联系电话</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
13247219819
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">到静海时间(计划)</view>
<view class="itemright flexone time">
<view class="commontwo commonenter">
2020/1/21/15:00
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">从何地返静</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
河北沧州
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">目的地</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
天津静海
</view>
</view>
</view>
</view>
<view class="backtop">
<view class="useboxitem flextwo">
<view class="itemname commonone">王某某</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">联系电话</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
13247219819
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">到静海时间(计划)</view>
<view class="itemright flexone time">
<view class="commontwo commonenter">
2020/1/21/15:00
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">从何地返静</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
河北沧州
</view>
</view>
</view>
<view class="useboxitem backitem flextwo">
<view class="itemname commonone">目的地</view>
<view class="itemright flexone">
<view class="commontwo commonenter">
天津静海
</view>
</view>
</view>
</view> -->
</view>
\ No newline at end of file
... ...
page{
background: #FBF8FB
}
.rangeimg{
width:32rpx;
height:32rpx;
font-size: 0;
margin-right: 8rpx;
}
.rangename{
color:#06121E;
font-size:28rpx;
margin-left:12rpx;
}
.range{
padding:30rpx;
background: #fff;
}
.backtop{
width:690rpx;
margin:20rpx auto 0;
border-radius:16rpx;
}
.commonenter{
margin-right:0;
text-align: right
}
.backitem{
border-bottom:none
}
.time{
width:300rpx;
}
.backpeoplebox{
padding-bottom: 30rpx;
}
.sou{
color:#232323;
font-size: 28rpx;
padding:5rpx 20rpx;
box-sizing: border-box;
border:1rpx solid #f5f5f5;
border-radius: 14rpx;
}
.nodata{
color:#999;
font-size: 36rpx;
text-align: center;
margin-top:36rpx;
}
\ No newline at end of file
... ...
// pages/businessoffice/businessoffice.js
Page({
/**
* 页面的初始数据
*/
data: {
navarr:['全部','登记中','登记完成','登记失败'],
sel:0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
selnav(e){
this.setData({
sel:e.currentTarget.dataset.index
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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="nav flexone">
<view class="navitem {{sel==index?'navactive':''}}" wx:for="{{navarr}}" data-index="{{index}}" bindtap="selnav">{{item}}</view>
<!-- <view class="navitem">登记中</view>
<view class="navitem">登记完成</view>
<view class="navitem">登记失败</view> -->
</view>
<view class="box">
<view class="commonpadding">
<view class="statetop flextwo">
<view class="bname">隔离上报</view>
<!-- wx:if="{{item.status==1}}" -->
<view class="stateing" >处理中</view>
<view class="statefinish" >处理中</view>
<view class="statefail" >处理中</view>
<!-- <view class="statek" wx:else>已处理</view> -->
</view>
<view class="reason">12月3日营业</view>
<view class="itembox">
<view class="item flexone">
<view class="itemleft">联系人:</view>
<view class="itemright">123</view>
</view>
<view class="item flexone">
<view class="itemleft">联系电话:</view>
<view class="itemright">123</view>
</view>
<view class="item flex">
<view class="itemleft">现住地址:</view>
<view class="itemright">456 </view>
</view>
<view class="itemdate">
<view class="datetime">7896</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
page {
background: #f9f9f9;
}
.item {
padding: 8rpx 0;
box-sizing: border-box;
}
.itemleft {
color: #bdc4ce;
font-size: 28rpx;
width: 160rpx;
}
.itemright {
width: 547rpx;
color: #3d444c;
font-size: 28rpx;
margin-left: 10rpx;
}
.bname {
color: #06121f;
font-size: 32rpx;
font-weight: bold;
}
.reason {
color: #3d444c;
font-size: 28rpx;
margin-top: 24rpx;
}
.itembox {
margin-top: 24rpx;
}
.commonpadding {
padding: 40rpx 32rpx;
box-sizing: border-box;
margin-bottom: 16rpx;
}
.nodatabox {
width: 400rpx;
height: 400rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
image {
width: 100%;
height: 100%;
}
.noimg {
width: 258rpx;
height: 218rpx;
font-size: 0;
}
.nodataword {
color: #8c9198;
font-size: 28rpx;
margin-top: 48rpx;
}
.itemdate {
display: flex;
justify-content: flex-end;
align-items: center;
color: #bdc4ce;
font-size: 24rpx;
}
/* 处理中 */
.stateing {
width: 88rpx;
height: 42rpx;
background: rgba(255, 242, 238, 1);
opacity: 1;
border-radius: 8rpx;
color: #f95828;
font-size: 24rpx;
text-align: center;
line-height: 42rpx;
font-weight: bold;
}
/* 登记完成 */
.statefinish {
width: 112rpx;
height: 42rpx;
background: rgba(238, 238, 238, 1);
opacity: 1;
border-radius: 8rpx;
color: #8c9198;
font-size: 24rpx;
text-align: center;
line-height: 42rpx;
font-weight: bold;
}
.statefail {
width: 112rpx;
height: 42rpx;
background: rgba(255, 238, 238, 1);
opacity: 1;
border-radius: 8rpx;
color: #ff1414;
font-size: 24rpx;
text-align: center;
line-height: 42rpx;
font-weight: bold;
}
/* 头部导航 */
.nav {
padding: 22rpx 32rpx;
box-sizing: border-box;
background: #fff;
margin-bottom: 16rpx;
justify-content: space-around;
}
.navitem {
color: #8c9198;
font-size: 32rpx;
margin-right: 76rpx;
}
.navitem:last-child {
margin-right: 0;
}
.navactive {
color: #000;
font-size: 32rpx;
font-weight: bold;
position: relative;
}
.navactive:after {
display:block;
content:'';
width: 32rpx;
height: 8rpx;
background: rgba(28, 143, 255, 1);
opacity: 1;
position: absolute;
left:50%;
bottom:-20rpx;
transform: translateX(-50%)
}
... ...
// pages/clock/clock.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
wai:false,
companyid:'',
is_first: '',
day: '',
status: '',
token:'',
qrcode: '',
address:'',
first_scan: '',
this_scan: '',
// 二维码显示
showcode:false,
codeurl:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
companyid: options.scene
})
this.clock()
},
// 显示二维码
sub(){
this.setData({
showcode:true
})
},
// 隐藏二维码
closecode(){
this.setData({
showcode:false
})
},
// 保存图片
//点击保存到相册
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) { },
})
},
getuser() {
let that = this;
var url = '/api/user/index';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
codeurl: res.user_qrcode,
})
that.savefilecode()
}).catch((err) => {
})
},
clock(){
let that = this;
var url = '/api/user/check_in';
var params = {
company_id: that.data.companyid,
}
app.post(url, params,"post").then((res) => {
console.log(res);
that.setData({
address: res.address,
is_first: res.is_first,
day: res.day,
status:res.status,
first_scan: res.first_scan,
this_scan: res.this_scan
})
if(res.day<14&&res.status==2){
wx.setNavigationBarColor({
frontColor: '#ffffff', // 必写项
backgroundColor: '#D4012D', // 必写项
})
}
}).catch((err) => {
})
},
clocklist(){
wx.navigateTo({
url: '/pages/clocklist/clocklist',
})
},
dengji() {
wx.redirectTo({
url: '/pages/backpeople/backpeople?clock=' + 1 + '&scene=' + this.data.companyid,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let token = wx.getStorageSync("token");
this.setData({
token:token
})
if (token == '') {
wx.setNavigationBarTitle({
title: '等待打卡'
})
wx.showToast({
title: '请先授权登录',
icon: "none"
})
setTimeout(function () {
wx.redirectTo({
url: '/pages/start/start',
})
}, 1000)
let url = '/pages/clock/clock?scene='+this.data.companyid;
wx.setStorageSync("url", url)
wx.setStorageSync("nologin", true)
}else {
let that = this;
var url = '/api/user/index';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
qrcode: res.qrcode
})
if (res.qrcode==''){
wx.setNavigationBarTitle({
title: '请登记'
})
}else{
wx.setNavigationBarTitle({
title: '打卡成功'
})
that.getuser()
}
}).catch((err) => {
})
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": ""
}
... ...
<view class="dengbox" wx:if="{{qrcode==''&&token!=''}}">
<view class="writebac">
<!-- -->
<view class="toppic">
<image src="/img/write.png"></image>
</view>
<view class="writename">请先登记个人信息</view>
<view class="writebtn" bindtap="dengji">去登记</view>
</view>
</view>
<view class="{{day<14&&status==2?'dakapagered':'dakapageblue'}}" wx:else>
<view class="clockbac">
<!-- -->
<!-- 打卡图标-->
<view class="clockpic" wx:if="{{day<14&&status==2}}">
<image src="/img/rediusse.png"></image>
</view>
<view class="clockpic" wx:else>
<image src="/img/clocksuccess.png"></image>
</view>
<view class="clocknameone" wx:if="{{token!=''}}">打卡成功</view>
<view class="clocknameone" wx:else>等待打卡</view>
<view wx:if="{{token!=''&&qrcode!=''}}">
<view class="clocktext" wx:if="{{is_first==1}}">
您已完成
<text class="first">首次</text>打卡
</view>
<view class="clocktext" wx:else>
您距离首次打卡
<text class="first">{{day}}</text>天
</view>
</view>
<!-- 打卡时间 -->
<view class="clocktimebox" wx:if="{{qrcode!=''&&token!=''}}">
<view class="clocktimetop flextwo onetop">
<view class="clocktimeleft">
首次打卡
</view>
<view class="clocktimeright">
<view class="clockname">
{{first_scan.company_name}}
</view>
<view class="clocktime">{{first_scan.createtime}}</view>
</view>
</view>
<view class="clocktimetop flextwo sectop">
<view class="clocktimeleft">
本次打卡
</view>
<view class="clocktimeright">
<view class="clockname">
{{this_scan.company_name}}
</view>
<view class="clocktime">{{this_scan.createtime}}</view>
</view>
</view>
</view>
<!-- 外地还是本地 -->
<view class="waiben" wx:if="{{token!=''&&qrcode!=''}}">
<!-- -->
<view class="wai" wx:if="{{status=='1'}}">{{address}}</view>
<view class="nei" wx:else>{{address}}</view>
<view class="writebtn jilubtn redbtn" bindtap="clocklist" wx:if="{{day<14&&status==2}}">打卡记录</view>
<view class="writebtn jilubtn " bindtap="clocklist" wx:else>打卡记录</view>
<!-- 页面二维码 -->
<view class="jiaotop">
<view class="botjiao" bindtap="sub">
<image src="/img/icon_q.png"></image>
</view>
</view>
</view>
</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: #1d8efe;
} */
.writebac {
background: #1d8efe;
}
.clockbac {
width: 686rpx;
height: 1113rpx;
background: rgba(255, 255, 255, 1);
opacity: 1;
border-radius: 8rpx;
margin: 64rpx auto 0;
overflow: hidden;
}
.clockpic {
width: 220rpx;
height: 220rpx;
font-size: 0;
margin: 62rpx auto 0;
}
.clocknameone {
color: #06121e;
font-size: 40rpx;
font-weight: bold;
margin-top: 32rpx;
text-align: center;
}
.clocktext {
margin-top: 50rpx;
color: #06121e;
font-size: 32rpx;
font-weight: bold;
text-align: center;
}
/* 打卡时间 */
.clocktimebox {
padding: 0 48rpx;
box-sizing: border-box;
margin-top: 34rpx;
}
.clocktimetop {
padding: 36rpx 0;
box-sizing: border-box;
}
.clocktimeleft {
color: #06121e;
font-size: 30rpx;
font-weight: bold;
}
.clockname {
width:440rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
color: #0a1015;
font-size: 24rpx;
}
.clocktime {
width:440rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
color: #8c9198;
font-size: 20rpx;
margin-top: 8rpx;
}
.sectop {
margin-top: 32rpx;
border-bottom: 1rpx solid #f5f5f5;
padding-top: 0;
}
.writebtn{
margin-top:60rpx
}
.onetop {
border-top: 1rpx solid #f5f5f5;
}
.first {
color: #1c8fff;
font-size: 60rpx;
font-weight: bold;
margin: 0 10rpx;
}
.wai {
width: 488rpx;
padding: 0 12rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 92rpx;
background: rgba(230, 243, 255, 1);
opacity: 1;
border-radius: 8rpx;
color: #1c8fff;
font-size: 32rpx;
text-align: center;
line-height: 92rpx;
margin: 32rpx auto 0;
}
.nei {
width: 488rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 12rpx;
box-sizing: border-box;
height: 92rpx;
background: rgba(255, 240, 230, 1);
opacity: 1;
border-radius: 8rpx;
color: #fc8749;
font-size: 32rpx;
text-align: center;
line-height: 92rpx;
margin: 32rpx auto 0;
}
/* page {
background: #1d8efe;
} */
page {
height: 100%;
}
.dengbox {
width: 100%;
height: 100%;
overflow: hidden;
background: #1d8efe;
}
.dakapageblue {
width: 100%;
height: 100%;
overflow: hidden;
background: #1d8efe;
}
.dakapagered {
width: 100%;
height: 100%;
overflow: hidden;
background: #d3012e;
}
.writebac {
width: 686rpx;
height: 660rpx;
background: #fff;
opacity: 1;
border-radius: 8rpx;
margin: 64rpx auto 0;
overflow: hidden;
}
.toppic {
width: 300rpx;
height: 300rpx;
font-size: 0;
margin: 72rpx auto 0;
}
.writename {
color: #06121e;
font-size: 40rpx;
font-weight: bold;
margin-top: 32rpx;
text-align: center;
}
.redbtn{
background: #D4012D;
color:#fff;
}
/*二维码 */
.jiaotop {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top:10rpx;
right: 0rpx;
z-index: 999
}
.botjiao {
width: 80rpx;
height: 80rpx;
background: rgba(28, 143, 255, 1);
border-radius: 50%;
opacity: 1;
display: flex;
align-items: center;
justify-content: center
}
.codeimg {
width: 50rpx;
height: 50rpx;
font-size: 0;
}
/* 弹层二维码 */
.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;
}
.waiben{
position: relative
}
\ No newline at end of file
... ...