作者 lihongjuan

1

... ... @@ -79,7 +79,7 @@ page {
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
margin-right: 24rpx;
/* margin-right: 24rpx; */
}
.plan {
... ...
// pages/logining/logining.js
// pages/backpeopledetail/backpeopledetail.js
const app = getApp()
Page({
... ... @@ -6,128 +6,37 @@ Page({
* 页面的初始数据
*/
data: {
protectarr: [],
office: '',
address: '',
is_business: 0,
ishandbook: 0,
materials: [],
time: '请选择营业时间',
town: [],
townname: '请选择所属社区',
townindex: 0,
town_id: '',
name: '',
phone: '',
description: ''
id: '',
peopledetail: '',
uintid: '',
unitname: '',
office:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.gettail()
},
bindTimeChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
onLoad: function (options) {
console.log(options)
this.setData({
time: e.detail.value
id: options.id
})
},
// 是否营业中
selsy() {
this.setData({
is_business: 1
})
},
selsn() {
this.setData({
is_business: 2
})
},
this.getdetail()
// 是否收到疫情防控指南
selsyk() {
this.setData({
ishandbook: 1
})
},
selsnk() {
this.setData({
ishandbook: 2
})
},
// 输入姓名
entername(e) {
this.setData({
name: e.detail.value
})
},
// 输入电话号
enterphone(e) {
this.setData({
phone: e.detail.value
})
},
//获取登记详情
gettail() {
getdetail(){
let that = this;
var url = '/api/office/office_detail';
var url = '/api/office/office_admin_detail';
var params = {
office_token: wx.getStorageSync('office_token'),
admin_token: wx.getStorageSync("usertoken"),
office_id: this.data.id
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
protectarr: res.materials
})
that.data.protectarr.forEach(function(value, index, array) {
value.sel = false
})
that.setData({
office: res.office,
protectarr: that.data.protectarr,
address: res.office.address,
name:res.office.leader,
phone:res.office.mobile,
town_id:res.office.town_id,
townname: res.office.town_name,
is_business:res.office.is_business
})
that.getsocietylist()
console.log(that.data.protectarr)
}).catch((err) => {
})
},
// 获取社区列表
getsocietylist() {
let that = this;
var url = '/api/index/town';
var params = {
type: 2,
pid: that.data.office.town_pid
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
town: res.town
office:res.office
})
... ... @@ -135,212 +44,55 @@ Page({
}).catch((err) => {
})
},
bindtownrChange(e) {
console.log(e.detail.value)
this.setData({
townindex: e.detail.value,
townname: this.data.town[e.detail.value].name,
town_id: this.data.town[e.detail.value].id
})
},
// 选择防疫物资
selprotect(e) {
let that = this;
let index = e.currentTarget.dataset.index;
let id = e.currentTarget.dataset.id
this.data.protectarr.forEach(function(value, indexk, array) {
if (index == indexk) {
value.sel = !value.sel;
if (value.sel == true) {
that.data.materials.push(value.id)
} else {
that.data.materials.forEach(function(value, indexk, array) {
if (id == value) {
that.data.materials.splice(indexk, 1)
}
})
}
}
})
this.setData({
protectarr: this.data.protectarr,
materials: this.data.materials
})
console.log(that.data.materials)
},
// 输入地址
enteraddress() {
this.setData({
address: ''
})
},
enterplace(e) {
this.setData({
address: e.detail.value
})
},
// 存在的困难
entertext(e) {
this.setData({
description: e.detail.value
})
},
// 点击完成
finish() {
let that = this;
var url = '/api/office/office_submit';
if (that.data.address == '') {
wx.showToast({
title: '请输入地址',
icon: "none"
})
return false
}
if (that.data.name == '') {
wx.showToast({
title: '请输入负责人',
icon: 'none'
})
return false
}
if (that.data.phone == '') {
wx.showToast({
title: '请输入联系电话',
icon: 'none'
})
return false
}
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'
})
return false
}
if (that.data.is_business == 0) {
wx.showToast({
title: '请选择营业状态',
icon: 'none'
})
return false
}
if (that.data.time == '请选择营业时间') {
wx.showToast({
title: '请选择营业时间',
icon: 'none'
})
return false
}
if (that.data.ishandbook == 0) {
wx.showToast({
title: '请选择是否收到疫情指控',
icon: 'none'
})
return false
}
var params = {
office_token: wx.getStorageSync('office_token'),
new_address: that.data.address,
town_id: that.data.town_id,
leader: that.data.name,
mobile: that.data.phone,
is_hours: that.data.is_business,
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) => {
console.log(res);
wx.showToast({
title: '提交成功',
icon: 'none',
})
// wx.showToast({
// title: '提交成功',
// icon:'none',
// duration:1500
// })
setTimeout(function() {
wx.navigateTo({
url: '/pages/businessoffice/businessoffice',
})
}, 1500)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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="topbox">
<view class="topboxitem flextwo">
... ... @@ -9,8 +7,9 @@
</view>
<view class="topboxitem flextwo">
<view class="boxitemleft">地址</view>
<view class="boxitemleft itemright" bindtap="enteraddress">
<input placeholder='请输入地址' value="{{address}}" bindinput="enterplace" />
<view class="boxitemleft itemright" >
{{office.address}}
<!-- <input placeholder='请输入地址' value="{{address}}" bindinput="enterplace" /> -->
</view>
</view>
<view class="topboxitem flextwo">
... ... @@ -31,8 +30,9 @@
<view class="itemname commonone">负责人</view>
<view class="flexone">
<view class="commontwo seltype">
<input placeholder="请填写负责人姓名" placeholder-class="commontwo" bindinput="entername" />
{{office.leader}}
<!--
<input placeholder="请填写负责人姓名" placeholder-class="commontwo" bindinput="entername" value="name"/> -->
</view>
</view>
... ... @@ -41,8 +41,8 @@
<view class="itemname commonone">联系电话</view>
<view class="flexone">
<view class="commontwo seltype">
<input placeholder="请填写联系电话" placeholder-class="commontwo" bindinput="enterphone" />
{{office.mobile}}
<!-- <input placeholder="请填写联系电话" placeholder-class="commontwo" bindinput="enterphone" value="phone"/> -->
</view>
... ... @@ -51,23 +51,23 @@
<view class="useboxitem flextwo" bindtap="selectcompany">
<view class="itemname commonone">所属社区</view>
<picker bindchange="bindtownrChange" value="{{townindex}}" range="{{town}}" range-key='name'>
<view class="flexone">
<view class="commontwo seltype">
{{townname}}
{{office.town_name}}
<!-- <input placeholder="请填写工作单位" placeholder-class="commontwo" bindinput="entercompany" value="{{companyname}}" /> -->
</view>
<view class="yourow you">
<!-- <view class="yourow you">
<image src="/img/yourow.png"></image>
</view> -->
</view>
</view>
</picker>
</view>
<view class="useboxitem flextwo">
... ... @@ -76,14 +76,14 @@
<view class="selleft flexone">
<view class="selleftitem selzuo flexone" bindtap="selsy">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_business==1}}"></image>
<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="sellefitemimg">
<image src="/img/sel.png" wx:if="{{is_business==2}}"></image>
<image src="/img/sel.png" wx:if="{{office.is_hours==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">否</view>
... ... @@ -97,17 +97,15 @@
<view class="flexone">
<view class="commontwo">
<picker mode="time" value="{{time}}" start="00:00" end="24:59" bindchange="bindTimeChange">
<view class="picker">
{{time}}
{{office.hours}}
</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>
... ... @@ -124,14 +122,14 @@
<view class="selleft flexone">
<view class="selleftitem selzuo flexone" bindtap="selsyk">
<view class="sellefitemimg">
<image src="/img/sel.png" wx:if="{{ishandbook==1}}"></image>
<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="sellefitemimg">
<image src="/img/sel.png" wx:if="{{ishandbook==2}}"></image>
<image src="/img/sel.png" wx:if="{{office.is_receive==2}}"></image>
<image src="/img/nosel.png" wx:else></image>
</view>
<view class="selname">否</view>
... ... @@ -143,7 +141,8 @@
<view class="useboxitem ">
<view class="itemname commonone have">存在的困难</view>
<view class="flexone difficult">
<textarea placeholder='请输入存在的困难' bindinput="entertext"/>
{{office.description}}
<!-- <textarea placeholder='请输入存在的困难' bindinput="entertext" value="{{description}}"/> -->
</view>
</view>
... ... @@ -151,6 +150,11 @@
</view>
<view class="finish flexthree">
<view class="finishbtn" bindtap="finish">完成</view>
<view class="finishbtn" bindtap="finish" wx:if="{{office.status!=2}}">完成</view>
</view>
</view>
<view class="footerbox flextwo">
<view class="footerboxitem fotleft" bindtap="tongguo">通过</view>
<view class="footerboxitem fotright" bindtap="bohui">驳回</view>
</view>
... ...
... ... @@ -12,7 +12,7 @@ page {
.box {
width: 750rpx;
height: 100%;
background: linear-gradient(180deg, rgba(28, 143, 255, 1) 0%, rgba(249, 249, 249, 1) 100%);
/* background: linear-gradient(180deg, rgba(28, 143, 255, 1) 0%, rgba(249, 249, 249, 1) 100%); */
opacity: 1;
overflow-y: scroll;
}
... ... @@ -174,16 +174,44 @@ page {
border-radius: 10rpx;
}
.difficult{
width:686rpx;
width:647rpx;
border:1rpx solid #f5f5f5;
border-radius: 20rpx;
margin-top:20rpx;
color:#8c9198;
font-size:24rpx;
padding: 20rpx 20rpx;
box-sizing: border-box;
margin-top:20rpx;
/* height:302rpx; */
}
.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;
}
.difficult textarea{
width:100%;
height:302rpx;
padding: 20rpx;
.footerbox{
width:750rpx;
padding: 32rpx 56rpx;
box-sizing: border-box;
background: #fff;
position: fixed;
bottom:0;
left:0;
}
\ No newline at end of file
... ...
... ... @@ -42,7 +42,14 @@ Page({
})
},
// 进入详情页
detail(e){
console.log(888)
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/businessdetail/businessdetail?id='+id,
})
},
selnav(e){
this.setData({
sel:e.currentTarget.dataset.index
... ...
... ... @@ -10,7 +10,7 @@
<view class="box" wx:else>
<view class="commonpadding" wx:for="{{loginlist}}" wx:key="" bindtap="businessdetail" data-id="{{item.id}}">
<view class="commonpadding" wx:for="{{loginlist}}" wx:key="" bindtap="detail" data-id="{{item.id}}">
<view class="statetop flextwo">
<view class="bname">{{item.name}}</view>
<!-- wx:if="{{item.status==1}}" -->
... ...
... ... @@ -78,6 +78,7 @@ image {
align-items: center;
color: #bdc4ce;
font-size: 24rpx;
margin-top:10rpx;
}
/* 处理中 */
... ...
... ... @@ -104,11 +104,15 @@ Page({
townname: res.office.town_name,
ishandbook: res.office.is_receive,
description: res.office.description,
materials: res.materials.split(","),
// materials: res.materials.split(","),
is_business:res.office.is_hours,
ishandbook:res.office.is_receive
ishandbook:res.office.is_receive,
time: res.office.hours,
})
let materials=res.office.materials.split(",");
console.log(materials)
console.log(typeof(materials))
that.getsocietylist()
... ...
... ... @@ -151,6 +151,6 @@
</view>
<view class="finish flexthree">
<view class="finishbtn" bindtap="finish">完成</view>
<view class="finishbtn" bindtap="finish" wx:if="{{office.status!=2}}">完成</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -174,7 +174,7 @@ page {
border-radius: 10rpx;
}
.difficult{
width:686rpx;
width:647rpx;
border:1rpx solid #f5f5f5;
border-radius: 20rpx;
... ...