Commit e98ae274 by fengzhaoyu

访客“

git push
git push origin dev
git add .
git commit -m访客修复“
parent 60aa7fdf
...@@ -28,10 +28,13 @@ const $http = (url, data, type, loadingType) => { ...@@ -28,10 +28,13 @@ const $http = (url, data, type, loadingType) => {
data:data, data:data,
success: function(res) { success: function(res) {
if( res.data.code == 0 || res.data.resultCode === 0 ) { if( res.data.code == 0 || res.data.resultCode === 0 ) {
console.log(1111)
return resolve(res.data.data) return resolve(res.data.data)
dd.hideLoading() dd.hideLoading()
} }
else if(res.data.code == 401) { else if(res.data.code == 401) {
console.log(222)
dd.removeStorageSync({key: 'token'}) dd.removeStorageSync({key: 'token'})
dd.hideLoading() dd.hideLoading()
dd.redirectTo({ dd.redirectTo({
...@@ -80,6 +83,7 @@ const $http = (url, data, type, loadingType) => { ...@@ -80,6 +83,7 @@ const $http = (url, data, type, loadingType) => {
fail: function(err) { fail: function(err) {
dd.hideLoading() dd.hideLoading()
if(err.status == 426) { if(err.status == 426) {
console.log(1121229383)
dd.removeStorageSync({key: 'token'}) dd.removeStorageSync({key: 'token'})
dd.redirectTo({ dd.redirectTo({
url: '/pages/reTry/reTry' url: '/pages/reTry/reTry'
...@@ -143,7 +147,6 @@ const $http = (url, data, type, loadingType) => { ...@@ -143,7 +147,6 @@ const $http = (url, data, type, loadingType) => {
}) })
}, },
fail: function(err) { fail: function(err) {
debugger
if(err.status == 426) { if(err.status == 426) {
dd.hideLoading() dd.hideLoading()
dd.removeStorageSync({ dd.removeStorageSync({
......
...@@ -8,6 +8,7 @@ Page({ ...@@ -8,6 +8,7 @@ Page({
currentPage: 1, currentPage: 1,
pageNumber: 10, pageNumber: 10,
totalCount: '' totalCount: ''
}, },
onLoad(query) { onLoad(query) {
dd.setNavigationBar({title: '津贴列表'}); dd.setNavigationBar({title: '津贴列表'});
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
border-radius: 50%; border-radius: 50%;
border: 2rpx solid #DADADE; border: 2rpx solid #3296FA;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
color: white; color: white;
...@@ -195,4 +195,9 @@ ...@@ -195,4 +195,9 @@
text-align: center; text-align: center;
line-height: 96rpx; line-height: 96rpx;
color: white; color: white;
}
.empty {
height: 160rpx;
width: 750rpx;
background: #fafafa;
} }
\ No newline at end of file
...@@ -22,11 +22,12 @@ ...@@ -22,11 +22,12 @@
</view> </view>
<view> <view>
<view class="time"> <view class="time">
2019-10-27 17:41 {{item.startTime.allTime}}
</view> </view>
<view class="byVisitor">被访人:{{item.byVisitorName}}</view> <view class="byVisitor">被访人:{{item.byVisitorName}}</view>
</view> </view>
</view> </view>
<view class="empty"></view>
<view class="button"> <view class="button">
<view onTap="confirm">确认选择</view> <view onTap="confirm">确认选择</view>
</view> </view>
......
...@@ -35,7 +35,6 @@ create.Page({ ...@@ -35,7 +35,6 @@ create.Page({
$http.$http('/admin/visitor/getRecordList', data, 'post').then(res => { $http.$http('/admin/visitor/getRecordList', data, 'post').then(res => {
let dataList = res.records; let dataList = res.records;
let dataListSource = _that.data.dataList;; let dataListSource = _that.data.dataList;;
console.log(dataList.length)
if (dataList.length > 0) { if (dataList.length > 0) {
dataList.forEach((item, index) => { dataList.forEach((item, index) => {
if (new Date(item.endTime.replace(/\-/g, "/")).getTime() < new Date().getTime()) { if (new Date(item.endTime.replace(/\-/g, "/")).getTime() < new Date().getTime()) {
...@@ -81,14 +80,13 @@ create.Page({ ...@@ -81,14 +80,13 @@ create.Page({
minute: minute.toString().length > 1 ? minute : '0' + minute, minute: minute.toString().length > 1 ? minute : '0' + minute,
yearMonthDate: `${year}${month.toString().length > 1 ? month : '0' + month}${date.toString().length > 1 ? date : '0' + date}日`, yearMonthDate: `${year}${month.toString().length > 1 ? month : '0' + month}${date.toString().length > 1 ? date : '0' + date}日`,
hourMinute: `${hour.toString().length > 1 ? hour : '0' + hour}:${minute.toString().length > 1 ? minute : '0' + minute}`, hourMinute: `${hour.toString().length > 1 ? hour : '0' + hour}:${minute.toString().length > 1 ? minute : '0' + minute}`,
allTime: `${year}${month.toString().length > 1 ? month : '0' + month}${date.toString().length > 1 ? date : '0' + date}${hour.toString().length > 1 ? hour : '0' + hour}:${minute.toString().length > 1 ? minute : '0' + minute}` allTime: `${year}-${month.toString().length > 1 ? month : '0' + month}-${date.toString().length > 1 ? date : '0' + date} ${hour.toString().length > 1 ? hour : '0' + hour}:${minute.toString().length > 1 ? minute : '0' + minute}`
} }
}, },
onLoad(query) { onLoad(query) {
dd.setNavigationBar({ dd.setNavigationBar({
title: '历史访客', title: '历史访客',
}); });
console.log(this.store.data.visitorPeer)
this.setData({ this.setData({
index: query.index, index: query.index,
dataList: [] dataList: []
......
{} {"pullRefresh": false}
\ No newline at end of file \ No newline at end of file
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
.visitorName { .visitorName {
padding: 0 32rpx; padding: 0 32rpx;
width: 684rpx;
height: 112rpx; height: 112rpx;
line-height: 112rpx; line-height: 112rpx;
background: white; background: white;
...@@ -65,6 +64,7 @@ ...@@ -65,6 +64,7 @@
} }
.visitorInput input { .visitorInput input {
padding: 0;
letter-spacing: -0.48rpx; letter-spacing: -0.48rpx;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
...@@ -171,12 +171,12 @@ ...@@ -171,12 +171,12 @@
} }
.purposeContent { .purposeContent {
text-indent: 4rpx;
width: 50%; width: 50%;
color: #191F25; color: #191F25;
opacity: 0.8rpx; opacity: 0.8rpx;
letter-spacing: -0.48rpx; letter-spacing: -0.48rpx;
font-size: 30rpx; font-size: 30rpx;
margin-left: 55rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
} }
.inputPurpose { .inputPurpose {
width: 490rpx; width: 510rpx;
float: right; float: right;
height: 110rpx; height: 110rpx;
line-height: 110rpx; line-height: 110rpx;
...@@ -219,6 +219,7 @@ ...@@ -219,6 +219,7 @@
} }
.inputPurpose input { .inputPurpose input {
padding: 0;
font-size: 30rpx; font-size: 30rpx;
line-height: 110rpx; line-height: 110rpx;
vertical-align: middle; vertical-align: middle;
...@@ -245,13 +246,12 @@ ...@@ -245,13 +246,12 @@
} }
.addressDetail { .addressDetail {
width: 482rpx; width: 50%;
height: auto; height: auto;
line-height: 40rpx; line-height: 40rpx;
font-size: 30rpx; font-size: 30rpx;
color: #191F25; color: #191F25;
opacity: 0.8; opacity: 0.8;
margin-left: 20rpx;
display: -webkit-box; display: -webkit-box;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -387,8 +387,9 @@ ...@@ -387,8 +387,9 @@
align-items: center; align-items: center;
} }
.ccPeople view { .ccPeople view,.ccPeople image {
position: relative; position: relative;
line-height: 100rpx;
height: 100rpx; height: 100rpx;
width: 100rpx; width: 100rpx;
border-radius: 50%; border-radius: 50%;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
访客手机 访客手机
</view> </view>
<view class=" visitorInput visitorPhoneInput "> <view class=" visitorInput visitorPhoneInput ">
<input placeholder="请输入" pattern="[0-9]*" data-type='visitorPhone' onInput='visitorInput' type="number" value="{{visitorPhone}}"/> <input placeholder="请输入" pattern="[0-9]*" data-type='visitorPhone' onInput='visitorInput' type="number" value="{{visitorPhone}}"/>
</view> </view>
</view> </view>
<view class="visitorName"> <view class="visitorName">
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
访客手机 访客手机
</view> </view>
<view class=" visitorInput visitorPhoneInput "> <view class=" visitorInput visitorPhoneInput ">
<input type="number" pattern="[0-9]*" placeholder="请输入" data-type='visitorPeerPhone' data-index='{{index + 1}}' onInput='visitorInput' value="{{item.phone}}" /> <input type="number" pattern="[0-9]*" placeholder="请输入" data-type='visitorPeerPhone' data-index='{{index + 1}}' onInput='visitorInput' value="{{item.phone}}" />
</view> </view>
</view> </view>
</view> </view>
...@@ -121,7 +121,8 @@ ...@@ -121,7 +121,8 @@
</view> </view>
<view class="ccPeople" a:if='{{copyPerson.length}}'> <view class="ccPeople" a:if='{{copyPerson.length}}'>
<view a:for="{{copyPerson}}" a:for-index="index" a:for-item="item"> <view a:for="{{copyPerson}}" a:for-index="index" a:for-item="item">
{{item.name.substring(item.name.length-2)}} <image a:if="{{item.avatar}}" mode="scaleToFill" src="{{item.avatar || '../../../assets/avatar.png'}}"/>
<view a:else="{{!item.avatar}}">{{item.name.substring(item.name.length - 2,item.name.length)}}</view>
<text class="iconshanchu iconfont ccPeopleShanChu" data-index='{{index}}' onTap="deleateCcPeople"></text> <text class="iconshanchu iconfont ccPeopleShanChu" data-index='{{index}}' onTap="deleateCcPeople"></text>
</view> </view>
</view> </view>
......
...@@ -25,8 +25,7 @@ create.Page({ ...@@ -25,8 +25,7 @@ create.Page({
visitorPurpose: '', // 访客手动输入的目的 visitorPurpose: '', // 访客手动输入的目的
visitorNode: '',// 访客的备注 visitorNode: '',// 访客的备注
isPackUp: false, // 是否收起更多消息 isPackUp: false, // 是否收起更多消息
formValidation: false, formValidation: false
selectVisitors:''
}, },
onLoad(query) { onLoad(query) {
console.log('onload') console.log('onload')
...@@ -64,7 +63,7 @@ create.Page({ ...@@ -64,7 +63,7 @@ create.Page({
isPackUp: false // 是否收起更多消息 isPackUp: false // 是否收起更多消息
}) })
_that.store.data.visitorName = '', _that.store.data.visitorName = '',
_that.store.data.visitorPhone = '', _that.store.data.visitorPhone = '',
_that.store.data.selectVisitors = false, _that.store.data.selectVisitors = false,
_that.store.data.visitorPeer = [], _that.store.data.visitorPeer = [],
_that.update() _that.update()
...@@ -105,12 +104,12 @@ create.Page({ ...@@ -105,12 +104,12 @@ create.Page({
console.log(_that.store.data.visitorPeer[event.currentTarget.dataset.index - 1]) console.log(_that.store.data.visitorPeer[event.currentTarget.dataset.index - 1])
_that.store.data.visitorPeer[event.currentTarget.dataset.index - 1].name = event.detail.value _that.store.data.visitorPeer[event.currentTarget.dataset.index - 1].name = event.detail.value
_that.store.data.visitorPeer[event.currentTarget.dataset.index - 1].index = event.currentTarget.dataset.index _that.store.data.visitorPeer[event.currentTarget.dataset.index - 1].index = event.currentTarget.dataset.index
_that.update _that.update()
break; break;
case "visitorPeerPhone": case "visitorPeerPhone":
_that.store.data.visitorPeer[event.currentTarget.dataset.index - 1].phone = event.detail.value _that.store.data.visitorPeer[event.currentTarget.dataset.index - 1].phone = event.detail.value
_that.store.data.visitorPeer[event.currentTarget.dataset.index - 1].index = event.currentTarget.dataset.index _that.store.data.visitorPeer[event.currentTarget.dataset.index - 1].index = event.currentTarget.dataset.index
_that.update _that.update()
console.log(_that.store.data.visitorPeer[event.currentTarget.dataset.index - 1]) console.log(_that.store.data.visitorPeer[event.currentTarget.dataset.index - 1])
break; break;
case "visitorNode": case "visitorNode":
...@@ -135,6 +134,8 @@ create.Page({ ...@@ -135,6 +134,8 @@ create.Page({
// 点击外部联系人 // 点击外部联系人
externalContactSelect(event) { externalContactSelect(event) {
const _that = this const _that = this
_that.store.data.selectVisitors = false
_that.update()
dd.chooseExternalUsers({ dd.chooseExternalUsers({
title: '外部联人', title: '外部联人',
multiple: false, //是否多选 true多选,false单选,默认是单选 multiple: false, //是否多选 true多选,false单选,默认是单选
...@@ -161,11 +162,17 @@ create.Page({ ...@@ -161,11 +162,17 @@ create.Page({
}, },
// 点击历史访客 // 点击历史访客
historyVistiorsSelect(event) { historyVistiorsSelect(event) {
const _that = this
_that.store.data.selectVisitors = false
_that.update()
dd.navigateTo({ url: `./../historyVistiors/historyVistiors?index=${this.data.index}` }); dd.navigateTo({ url: `./../historyVistiors/historyVistiors?index=${this.data.index}` });
}, },
// 点击手机通讯录 // 点击手机通讯录
phoneAddressBookSelect() { phoneAddressBookSelect() {
const _that = this const _that = this
_that.store.data.selectVisitors = false
_that.update()
dd.choosePhonebook({ dd.choosePhonebook({
title: '手机通讯录', title: '手机通讯录',
multiple: false, //是否多选: true多选 false单选; 默认true multiple: false, //是否多选: true多选 false单选; 默认true
...@@ -252,8 +259,7 @@ create.Page({ ...@@ -252,8 +259,7 @@ create.Page({
content: '最多可选取6人', content: '最多可选取6人',
buttonText: '确定' buttonText: '确定'
}) })
} } },
},
// 周知人去重 // 周知人去重
duplicateRemoval(person) { duplicateRemoval(person) {
let obj = {}; let obj = {};
...@@ -348,6 +354,11 @@ create.Page({ ...@@ -348,6 +354,11 @@ create.Page({
dd.alert({ content: '结束时间不能早于开始时间', buttonText: '确定' }) dd.alert({ content: '结束时间不能早于开始时间', buttonText: '确定' })
return return
} }
else if (new Date(this.data.endTime.replace(/\-/g, "/")).getTime() < new Date().getTime()) {
dd.alert({ content: '结束时间不能早于当前时间', buttonText: '确定' })
return
}
else if (this.data.visitorPurpose.length > 20) { else if (this.data.visitorPurpose.length > 20) {
dd.alert({ content: '来访目的的长度小于20个字符', buttonText: '确定' }) dd.alert({ content: '来访目的的长度小于20个字符', buttonText: '确定' })
return return
...@@ -361,7 +372,7 @@ create.Page({ ...@@ -361,7 +372,7 @@ create.Page({
return return
} }
else if (mobile) { else if (mobile) {
return dd.alert({ content: '访客手机号不能为空且长度小于10个字符', buttonText: '确定' }) return dd.alert({ content: '访客手机号不能为空且长度小于11个字符', buttonText: '确定' })
} }
else if (this.data.defaultAddress == '') { else if (this.data.defaultAddress == '') {
return dd.alert({ content: '请选择或添加到访地址', buttonText: '确定' }) return dd.alert({ content: '请选择或添加到访地址', buttonText: '确定' })
...@@ -501,12 +512,12 @@ create.Page({ ...@@ -501,12 +512,12 @@ create.Page({
onShow() { onShow() {
// 页面显示 // 页面显示
// 关闭遮照层 // 关闭遮照层
console.log(this.store.data) const _that = this
this.store.data.selectVisitors = false; setTimeout(function(res) {
this.update() _that.store.data.selectVisitors = false;
this.setData({ _that.update()
selectVisitors: this.store.data.selectVisitors }, 0.1)
})
}, },
onHide() { onHide() {
// 页面隐藏 // 页面隐藏
......
...@@ -184,10 +184,13 @@ ...@@ -184,10 +184,13 @@
.appointment { .appointment {
padding: 16rpx 36rpx; padding: 16rpx 36rpx;
background: white; background: white;
position: absolute;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
transform: translateZ(0);
-webkit-transform: translateZ(0);
} }
.appointmentButton { .appointmentButton {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<text>{{todayVisit}}</text>位访客,到访 <text>{{todayVisit}}</text>位访客,到访
<text>{{arrivedVisit}}</text>位 <text>{{arrivedVisit}}</text>位
</view> </view>
<view class="nullImage" a:if="{{dataList.length === 0}}"> <view class="nullImage" a:if="{{isNull}}">
<image mode="scaleToFill" src="../../../assets/noPermission.png"/> <image mode="scaleToFill" src="../../../assets/noPermission.png"/>
<text>当前暂无访客记录</text> <text>当前暂无访客记录</text>
</view> </view>
......
...@@ -9,7 +9,8 @@ Page({ ...@@ -9,7 +9,8 @@ Page({
totalCount: '', totalCount: '',
overdue: false, overdue: false,
todayVisit: 0, todayVisit: 0,
arrivedVisit: 0 arrivedVisit: 0,
isNull: true // 列表默认为空
}, },
arriveStaus(self) { arriveStaus(self) {
const _that = this const _that = this
...@@ -33,7 +34,7 @@ Page({ ...@@ -33,7 +34,7 @@ Page({
currentPage: 1 currentPage: 1
}) })
this.visitorList(this.data.type) this.visitorList(this.data.type)
this.arriveStaus(this.data.typ) this.arriveStaus(this.data.type)
}, },
visitorList(type) { visitorList(type) {
const _that = this const _that = this
...@@ -45,7 +46,6 @@ Page({ ...@@ -45,7 +46,6 @@ Page({
$http.$http('/admin/visitor/getRecordList', data, 'post').then(res => { $http.$http('/admin/visitor/getRecordList', data, 'post').then(res => {
let dataList = res.records; let dataList = res.records;
let dataListSource = _that.data.dataList;; let dataListSource = _that.data.dataList;;
console.log(dataList.length)
if (dataList.length > 0) { if (dataList.length > 0) {
dataList.forEach((item, index) => { dataList.forEach((item, index) => {
if (new Date(item.endTime.replace(/\-/g, "/")).getTime() < new Date().getTime()) { if (new Date(item.endTime.replace(/\-/g, "/")).getTime() < new Date().getTime()) {
...@@ -68,7 +68,15 @@ Page({ ...@@ -68,7 +68,15 @@ Page({
let totalCount = Math.ceil(parseInt(res.total) / _that.data.pageSize) let totalCount = Math.ceil(parseInt(res.total) / _that.data.pageSize)
_that.setData({ _that.setData({
dataList: dataList, dataList: dataList,
totalCount: totalCount totalCount: totalCount,
isNull: false
})
}
else {
_that.setData({
dataList: [],
totalCount: 1,
isNull: true
}) })
} }
}) })
...@@ -117,7 +125,7 @@ Page({ ...@@ -117,7 +125,7 @@ Page({
this.resetData() this.resetData()
dd.setNavigationBar({ title: '智能访客' }); dd.setNavigationBar({ title: '智能访客' });
this.visitorList(1) this.visitorList(1)
this.arriveStaus(0) this.arriveStaus(1)
}, },
onReady() { onReady() {
...@@ -155,8 +163,9 @@ Page({ ...@@ -155,8 +163,9 @@ Page({
overdue: false, overdue: false,
}) })
this.visitorList(this.data.type) this.visitorList(this.data.type)
this.arriveStaus(1)
dd.stopPullDownRefresh() dd.stopPullDownRefresh()
this.arriveStaus()
}, },
onShareAppMessage() { onShareAppMessage() {
// 返回自定义分享信息 // 返回自定义分享信息
......
...@@ -238,12 +238,17 @@ image { ...@@ -238,12 +238,17 @@ image {
.participatorUserList { .participatorUserList {
display: flex; display: flex;
margin-top: 14rpx; flex-wrap: wrap;
margin-left: 52rpx; margin-left: 52rpx;
color: #000000; color: #000000;
font-size: 30rpx; font-size: 30rpx;
} }
.participatorUserList:nth-child(6) {
margin-right: 0
}
.participatorUserListname { .participatorUserListname {
margin-right: 20rpx; margin-right: 20rpx;
margin-top: 14rpx;
} }
\ No newline at end of file
{} { "pullRefresh": false}
\ No newline at end of file \ No newline at end of file
...@@ -35,7 +35,7 @@ var webSocket = { ...@@ -35,7 +35,7 @@ var webSocket = {
socketClose = false socketClose = false
socketMsgQueue = [] socketMsgQueue = []
dd.connectSocket({ dd.connectSocket({
url: `wss://mingpay-websocket.mingwork.com/v1/mingpaywebsocket?param=${dd.corpId}_${dd.getStorageSync({ key: 'userId' }).data}`, url: `wss://gateway-beta.mingwork.com/mingpay-phone-websocket/v1/mingpaywebsocket?param=${dd.corpId}_${dd.getStorageSync({ key: 'userId' }).data}`,
// url: `ws://192.168.1.102:8400/v1/mingpaywebsocket?param=${dd.corpId}_${dd.getStorageSync({ key: 'userId' }).data}`, // url: `ws://192.168.1.102:8400/v1/mingpaywebsocket?param=${dd.corpId}_${dd.getStorageSync({ key: 'userId' }).data}`,
data: { data: {
userType: 0 userType: 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment