作者 lihongjuan

1

... ... @@ -7,25 +7,26 @@ Page({
*/
data: {
id: '',
peopledetail: '',
uintid: '',
unitname: '',
office:''
office: '',
protectarr: [],
materials: [],
status:""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
console.log(options)
this.setData({
id: options.id
})
this.getdetail()
},
getdetail(){
getdetail() {
let that = this;
var url = '/api/office/office_admin_detail';
var params = {
... ... @@ -36,63 +37,179 @@ Page({
console.log(res);
that.setData({
office:res.office
protectarr: res.materials
})
that.data.protectarr.forEach(function(value, index, array) {
value.sel = false
})
console.log(that.data.protectarr)
that.setData({
office: res.office,
materials: res.office.materials,
status:res.office.status
})
that.data.protectarr.forEach(function(value, index, array) {
that.data.materials.forEach(function(valuek, indexk, arrayk) {
if (value.id == valuek) {
value.sel = true
}
})
})
that.setData({
protectarr: that.data.protectarr,
})
}).catch((err) => {
})
},
// 通过
tongguo() {
let that = this;
wx.showModal({
title: '提示',
content: '是否通过审核',
success(res) {
if (res.confirm) {
var url = '/api/office/office_examine';
var params = {
admin_token: wx.getStorageSync('usertoken'),
office_id: that.data.id,
status: 2
}
app.post(url, params, "post").then((res) => {
console.log(res);
wx.showToast({
title: '审核通过',
icon: 'none'
})
setTimeout(function(){
wx.navigateBack({
checked: true
})
},1500)
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.data.msg,
icon: 'none'
})
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
bohui() {
let that = this;
wx.showModal({
title: '提示',
content: '是否驳回审核',
success(res) {
if (res.confirm) {
var url = '/api/office/office_examine';
var params = {
admin_token: wx.getStorageSync('usertoken'),
office_id: that.data.id,
status: 3
}
app.post(url, params, "post").then((res) => {
console.log(res);
wx.showToast({
title: '审核驳回',
icon: 'none'
})
setTimeout(function(){
wx.navigateBack({
checked: true
})
},1500)
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.data.msg,
icon: 'none'
})
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
... ... @@ -5,7 +5,7 @@
<view class="boxitemleft">名称</view>
<view class="boxitemleft itemright">{{office.name}}</view>
</view>
<view class="topboxitem flextwo">
<view class="topboxitem dizhi">
<view class="boxitemleft">地址</view>
<view class="boxitemleft itemright" >
{{office.address}}
... ... @@ -26,7 +26,7 @@
<!-- 表单 -->
<view class="topbox formbox">
<view class="useboxitem flextwo" bindtap="selectcompany">
<view class="useboxitem flextwo" >
<view class="itemname commonone">负责人</view>
<view class="flexone">
<view class="commontwo seltype">
... ... @@ -37,7 +37,7 @@
</view>
</view>
<view class="useboxitem flextwo" bindtap="selectcompany">
<view class="useboxitem flextwo" >
<view class="itemname commonone">联系电话</view>
<view class="flexone">
<view class="commontwo seltype">
... ... @@ -48,7 +48,7 @@
</view>
</view>
<view class="useboxitem flextwo" bindtap="selectcompany">
<view class="useboxitem flextwo" >
<view class="itemname commonone">所属社区</view>
... ... @@ -74,14 +74,14 @@
<view class="itemname commonone">是否营业中</view>
<view class=" flexone">
<view class="selleft flexone">
<view class="selleftitem selzuo flexone" bindtap="selsy">
<view class="selleftitem selzuo flexone" >
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{office.is_hours==1}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">是</view>
</view>
<view class="selleftitem flexone " bindtap="selsn">
<view class="selleftitem flexone " >
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{office.is_hours==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
... ... @@ -92,8 +92,9 @@
</view>
</view>
<view class="useboxitem flextwo" bindtap="selectcompany">
<view class="itemname commonone yingye">营业时间(预计)</view>
<view class="useboxitem flextwo" >
<view class="itemname commonone yingye" wx:if="{{office.is_hours==1}}">营业时间</view>
<view class="itemname commonone yingye" wx:else>营业时间(预计)</view>
<view class="flexone">
<view class="commontwo">
... ... @@ -112,7 +113,7 @@
<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 class="protectitem {{item.sel==true?'protectactive':''}}" wx:for="{{protectarr}}" wx:key="" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
</view>
</view>
... ... @@ -120,14 +121,14 @@
<view class="itemname commonone yiiqng">是否收到疫情防控指南</view>
<view class=" flexone">
<view class="selleft flexone">
<view class="selleftitem selzuo flexone" bindtap="selsyk">
<view class="selleftitem selzuo flexone" >
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{office.is_receive==1}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">是</view>
</view>
<view class="selleftitem flexone " bindtap="selsnk">
<view class="selleftitem flexone ">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{office.is_receive==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
... ... @@ -149,12 +150,12 @@
</view>
<view class="finish flexthree">
<!-- <view class="finish flexthree">
<view class="finishbtn" bindtap="finish" wx:if="{{office.status!=2}}">完成</view>
</view>
</view> -->
</view>
<view class="footerbox flextwo">
<view class="footerbox flextwo" wx:if="{{status==1}}">
<view class="footerboxitem fotleft" bindtap="tongguo">通过</view>
<view class="footerboxitem fotright" bindtap="bohui">驳回</view>
</view>
... ...
... ... @@ -34,10 +34,14 @@ page {
.itemright {
width: 510rpx;
overflow: hidden;
/* overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
text-align: right; */
}
.dizhi{
display:flex;
justify-content: space-between
}
.itemright input{
width: 510rpx;
... ... @@ -208,7 +212,7 @@ page {
width:750rpx;
padding: 32rpx 56rpx;
padding: 22rpx 56rpx;
box-sizing: border-box;
background: #fff;
position: fixed;
... ...
... ... @@ -27,7 +27,6 @@ Page({
status: that.data.sel,
admin_token: wx.getStorageSync("usertoken"),
page:that.data.page
}
app.post(url,params,"post").then((res) => {
... ... @@ -52,7 +51,9 @@ Page({
},
selnav(e){
this.setData({
sel:e.currentTarget.dataset.index
sel:e.currentTarget.dataset.index,
loginlist: [],
page: 1
})
this.getdengjilist()
... ... @@ -78,6 +79,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
page:1,
loginlist:[]
})
this.getdengjilist()
},
... ... @@ -106,7 +112,13 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let newpage=this.data.page;
newpage++;
this.setData({
page:newpage,
})
this.getdengjilist()
},
/**
... ...
... ... @@ -19,6 +19,16 @@ Page({
this.setData({
type:options.type
})
if(options.type==1){
wx.setNavigationBarTitle({
title: '营业场所登记'
})
}else{
wx.setNavigationBarTitle({
title: '返静人员管理登录'
})
}
},
entercount(e){
this.setData({
... ... @@ -55,7 +65,7 @@ Page({
wx.setStorageSync("office_token", res.office_token.token)
setTimeout(function () {
wx.navigateTo({
wx.redirectTo({
url: '/pages/logining/logining',
})
}, 1500)
... ... @@ -90,8 +100,9 @@ Page({
wx.setStorageSync("usertoken", res.admin_token.token)
setTimeout(function () {
wx.navigateTo({
url: '/pages/backpeoplelist/backpeoplelist',
wx.redirectTo({
url: '/pages/enterdoor/enterdoor',
})
}, 1500)
... ...
{
"navigationBarTitleText": "返静人员管理登录"
"navigationBarTitleText": ""
}
\ No newline at end of file
... ...
// pages/logining/logining.js
const app=getApp()
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
protectarr:[],
office:'',
address:'',
is_business:0,
ishandbook:0,
materials:[],
protectarr: [],
office: '',
address: '',
is_business: 0,
ishandbook: 0,
materials: [],
time: '请选择营业时间',
town:[],
townname:'请选择所属社区',
townindex:0,
town_id:'',
name:'',
phone:'',
description:''
town: [],
townname: '请选择所属社区',
townindex: 0,
town_id: '',
name: '',
phone: '',
description: '',
addressshow:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
this.gettail()
},
shuruaddress(){
this.setData({
addressshow:true
})
},
bindTimeChange: function (e) {
bindTimeChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
time: e.detail.value
... ... @@ -39,24 +43,24 @@ Page({
},
// 是否营业中
selsy(){
selsy() {
this.setData({
is_business:1
is_business: 1
})
},
selsn(){
selsn() {
this.setData({
is_business: 2
})
},
// 是否收到疫情防控指南
selsyk(){
selsyk() {
this.setData({
ishandbook:1
ishandbook: 1
})
},
},
selsnk() {
this.setData({
ishandbook: 2
... ... @@ -64,59 +68,71 @@ Page({
},
// 输入姓名
entername(e){
entername(e) {
this.setData({
name:e.detail.value
name: e.detail.value
})
},
// 输入电话号
enterphone(e){
enterphone(e) {
this.setData({
phone:e.detail.value
phone: e.detail.value
})
},
//获取登记详情
gettail(){
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) => {
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.data.protectarr.forEach(function(value, index, array) {
value.sel = false
})
that.setData({
office:res.office,
protectarr:that.data.protectarr,
address:res.office.address,
name:res.office.leader,
phone:res.office.mobile,
town_id:res.office.town_id,
townname: res.office.town_name,
office: res.office,
protectarr: that.data.protectarr,
address: res.office.address,
name: res.office.leader,
phone: res.office.mobile,
town_id: res.office.town_id,
townname: res.office.town_name == '' ? '请选择所属社区' : res.office.town_name,
ishandbook: res.office.is_receive,
description: res.office.description,
// materials: res.materials.split(","),
is_business:res.office.is_hours,
ishandbook:res.office.is_receive,
time: res.office.hours,
materials: res.office.materials,
is_business: res.office.is_hours,
ishandbook: res.office.is_receive,
time: res.office.hours == '' ? '请选择营业时间' : res.office.hours,
})
console.log(that.data.materials)
that.data.protectarr.forEach(function(value, index, array) {
that.data.materials.forEach(function(valuek, indexk, arrayk) {
if (value.id == valuek) {
value.sel = true
}
})
})
let materials=res.office.materials.split(",");
console.log(materials)
console.log(typeof(materials))
that.setData({
protectarr: that.data.protectarr,
})
that.getsocietylist()
console.log(that.data.protectarr)
... ... @@ -126,20 +142,30 @@ Page({
},
// 获取社区列表
getsocietylist(){
getsocietylist() {
let that = this;
var url = '/api/index/town';
var params = {
type:2,
type: 2,
pid: that.data.office.town_pid
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
town:res.town
town: res.town
})
// 默认选中社区
if (that.data.office.town_id != '') {
console.log('9999', that.data.town)
that.data.town.forEach(function (value, index, array) {
if (that.data.office.town_id == value.id) {
that.setData({
townindex: index
})
}
})
}
}).catch((err) => {
... ... @@ -147,7 +173,7 @@ Page({
})
},
bindtownrChange(e){
bindtownrChange(e) {
console.log(e.detail.value)
this.setData({
townindex: e.detail.value,
... ... @@ -158,60 +184,60 @@ Page({
// 选择防疫物资
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){
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){
if (value.sel == true) {
that.data.materials.push(value.id)
}else{
that.data.materials.forEach(function(value,indexk,array){
if(id==value){
} else {
that.data.materials.forEach(function(value, indexk, array) {
if (id == value) {
that.data.materials.splice(indexk, 1)
}
})
}
}
})
this.setData({
protectarr:this.data.protectarr,
protectarr: this.data.protectarr,
materials: this.data.materials
})
console.log(that.data.materials)
},
// 输入地址
enteraddress(){
// enteraddress() {
// this.setData({
// address: ''
// })
// },
enterplace(e) {
this.setData({
address:''
})
},
enterplace(e){
this.setData({
address:e.detail.value
address: e.detail.value
})
},
// 存在的困难
entertext(e){
entertext(e) {
this.setData({
description:e.detail.value
description: e.detail.value
})
},
// 点击完成
finish(){
finish() {
let that = this;
var url = '/api/office/office_submit';
if(that.data.address==''){
if (that.data.address == '') {
wx.showToast({
title: '请输入地址',
icon:"none"
icon: "none"
})
return false
}
... ... @@ -230,10 +256,20 @@ Page({
})
return false
}
if (that.data.town_id==''){
if (that.data.phone != '') {
if (!(/^1[3456789]\d{9}$/.test(that.data.phone))) {
wx.showToast({
title: '请输入正确联系电话',
icon: 'none'
})
return false;
}
}
if (that.data.town_id == '') {
wx.showToast({
title: '请选择所属社区',
icon:'none'
icon: 'none'
})
return false
}
... ... @@ -244,7 +280,7 @@ Page({
})
return false
}
if (that.data.time =='请选择营业时间') {
if (that.data.time == '请选择营业时间') {
wx.showToast({
title: '请选择营业时间',
icon: 'none'
... ... @@ -261,86 +297,97 @@ Page({
var params = {
office_token: wx.getStorageSync('office_token'),
new_address:that.data.address,
new_address: that.data.address,
town_id: that.data.town_id,
leader:that.data.name,
mobile:that.data.phone,
leader: that.data.name,
mobile: that.data.phone,
is_hours: that.data.is_business,
hours:that.data.time,
hours: that.data.time,
materials: that.data.materials.join(","),
is_receive: that.data.ishandbook,
description: that.data.description
}
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.showToast({
// title: '提交成功',
// icon:'none',
// duration:1500
// })
setTimeout(function(){
wx.navigateTo({
url: '/pages/businessoffice/businessoffice',
setTimeout(function() {
// wx.navigateTo({
// url: '/pages/businessoffice/businessoffice',
// })
wx.navigateBack({
checked: true
})
},1500)
}, 1500)
}).catch((err) => {
})
},
// 退出登录
exit(){
wx.setStorageSync("office_token", "");
wx.redirectTo({
url: '/pages/start/start',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
<view class="box">
<view class="title">登记中</view>
<view class="title" wx:if="{{office.status==0}}">待登记</view>
<view class="title" wx:if="{{office.status==1}}">登记中</view>
<view class="title" wx:if="{{office.status==2}}">登记成功</view>
<view class="title" wx:if="{{office.status==3}}">登记失败</view>
<!--基本信息-->
<view class="topbox">
<view class="topboxitem flextwo">
<view class="boxitemleft">名称</view>
<view class="boxitemleft itemright">{{office.name}}</view>
</view>
<view class="topboxitem flextwo">
<view class="topboxitem dizhi">
<view class="boxitemleft">地址</view>
<view class="boxitemleft itemright" bindtap="enteraddress">
<input placeholder='请输入地址' value="{{address}}" bindinput="enterplace" />
<view class="boxitemleft itemright dizghienter">
<textarea placeholder='请输入地址' value="{{address}}" bindinput="enterplace" auto-height="true"></textarea>
<!-- <input placeholder='请输入地址' value="{{address}}" bindinput="enterplace" focus='true'/> -->
</view>
</view>
<!-- <view class="topboxitem dizhi" wx:else bindtap="shuruaddress">
<view class="boxitemleft">地址</view>
<view class="boxitemleft itemright">
{{address}}
</view>
</view> -->
<view class="topboxitem flextwo">
<view class="boxitemleft">所属行业</view>
<view class="boxitemleft itemright">{{office.industry}}</view>
... ... @@ -32,7 +42,7 @@
<view class="flexone">
<view class="commontwo seltype">
<input placeholder="请填写负责人姓名" placeholder-class="commontwo" bindinput="entername" value="name"/>
<input placeholder="请填写负责人姓名" placeholder-class="commontwo" bindinput="entername" value="{{name}}" />
</view>
</view>
... ... @@ -42,7 +52,7 @@
<view class="flexone">
<view class="commontwo seltype">
<input placeholder="请填写联系电话" placeholder-class="commontwo" bindinput="enterphone" value="phone"/>
<input placeholder="请填写联系电话" placeholder-class="commontwo" bindinput="enterphone" value="{{phone}}" type="number"/>
</view>
... ... @@ -52,22 +62,22 @@
<view class="itemname commonone">所属社区</view>
<picker bindchange="bindtownrChange" value="{{townindex}}" range="{{town}}" range-key='name'>
<view class="flexone">
<view class="commontwo seltype">
{{townname}}
<!-- <input placeholder="请填写工作单位" placeholder-class="commontwo" bindinput="entercompany" value="{{companyname}}" /> -->
</view>
<view class="flexone">
<view class="commontwo seltype">
<view class="yourow you">
<image src="/img/yourow.png"></image>
{{townname}}
<!-- <input placeholder="请填写工作单位" placeholder-class="commontwo" bindinput="entercompany" value="{{companyname}}" /> -->
</view>
<view class="yourow you">
<image src="/img/yourow.png"></image>
</view>
</view>
</view>
</picker>
</picker>
</view>
<view class="useboxitem flextwo">
... ... @@ -92,12 +102,30 @@
</view>
</view>
<view class="useboxitem flextwo" bindtap="selectcompany">
<view class="useboxitem flextwo" bindtap="selectcompany" wx:if="{{is_business==1}}">
<view class="itemname commonone yingye">营业时间</view>
<view class="flexone">
<view class="commontwo">
<picker mode="date" value="{{time}}" start="2017-09-01" end="2025-12-31" bindchange="bindTimeChange">
<view class="picker">
{{time}}
</view>
</picker>
<!-- <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" bindtap="selectcompany" wx:else>
<view class="itemname commonone yingye">营业时间(预计)</view>
<view class="flexone">
<view class="commontwo">
<picker mode="time" value="{{time}}" start="00:00" end="24:59" bindchange="bindTimeChange">
<picker mode="date" value="{{time}}" start="2017-09-01" end="2025-12-31" bindchange="bindTimeChange">
<view class="picker">
{{time}}
</view>
... ... @@ -143,14 +171,20 @@
<view class="useboxitem ">
<view class="itemname commonone have">存在的困难</view>
<view class="flexone difficult">
<textarea placeholder='请输入存在的困难' bindinput="entertext" value="{{description}}"/>
<textarea placeholder='请输入存在的困难' bindinput="entertext" value="{{description}}" />
</view>
</view>
</view>
<view class="finish flexthree">
<view class="finishbtn" bindtap="finish" wx:if="{{office.status!=2}}">完成</view>
</view>
</view>
\ No newline at end of file
</view>
<cover-view class="finish flexthree">
<cover-view class="finishbtn" bindtap="exit">登记其他场所</cover-view>
<cover-view class="finishbtn wancheng" bindtap="finish" wx:if="{{office.status!=2}}">完成</cover-view>
<!-- <cover-view class="subtwo" wx:else bindtap="subsuccess">提交</cover-view> -->
</cover-view>
... ...
... ... @@ -34,23 +34,27 @@ page {
.itemright {
width: 510rpx;
overflow: hidden;
/* overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
text-align: right; */
}
.itemright input{
width: 510rpx;
overflow: hidden;
/* overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
text-align: right; */
}
.topboxitem {
padding: 34rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.dizhi{
display:flex;
justify-content: space-between
}
.title {
position: relative;
... ... @@ -163,7 +167,7 @@ page {
}
.finishbtn {
width: 686rpx;
width: 300rpx;
height: 88rpx;
background: rgba(28, 143, 255, 1);
opacity: 1;
... ... @@ -186,4 +190,18 @@ page {
width:100%;
height:302rpx;
padding: 20rpx;
}
.wancheng{
margin-left:20rpx;
}
.dizghienter{
/* height:69rpx; */
}
.dizghienter textarea{
width:100%;
/* height:69rpx; */
border:none;
outline: none;
margin-top:2rpx;
}
\ No newline at end of file
... ...