master
lion 3 days ago
parent c18d873b42
commit a4bbdbfb7c

@ -505,13 +505,14 @@
String(now.getDate()).padStart(2, '0')
const visitType = parseInt(options.type || 1)
this.form.type = visitType
if (visitType == 4) {
if (parseInt(visitType, 10) === 4) {
this.vipGatePassed = false
this.areaShow = false
} else {
this.areaShow = (visitType == 1)
// / /
this.areaShow = (visitType === 1 || visitType === 2 || visitType === 3)
}
// VIP 访访使 keyvipxz访 ptfk closeArea
// key 访
this.configKey =
visitType == 4 ? 'vipxz' :
visitType == 1 ? 'ptfk' :
@ -522,9 +523,6 @@
if (visitType !== 4) {
this.showStudy()
}
if (visitType == 2 || visitType == 3) {
this.getConfig()
}
this.init()
if (uni.getStorageSync('formdata')) {
this.form = uni.getStorageSync('formdata')
@ -535,6 +533,8 @@
this.vipGateForm.name = (this.form.name || '').trim()
this.vipGateForm.mobile = (this.form.mobile || '').trim()
}
// 访
this.getVisitArea()
// this.getAdminList()
},
onShareAppMessage() {
@ -555,7 +555,6 @@
onReady() {},
methods: {
init() {
this.getVisitArea()
this.getVisitTime()
this.getReason()
this.getPark()
@ -715,6 +714,7 @@
that.form.name = name
that.form.mobile = mobile
that.areaShow = true
that.getVisitArea()
that.showStudy()
},
utilFail: function(err) {
@ -730,13 +730,27 @@
this.util.alert("请先选择前往区域")
return
}
// VIP 访访vipxz ptfk/cjfk/yffk
// VIP vipxz
if (Number(this.form.type) === 4) {
this.configKey = 'vipxz'
this.getConfig()
this.areaShow = false
return
}
// / 访 key
if (Number(this.form.type) === 2) {
this.configKey = 'sgfk'
this.getConfig()
this.areaShow = false
return
}
if (Number(this.form.type) === 3) {
this.configKey = 'wlcl'
this.getConfig()
this.areaShow = false
return
}
// 访
if (this.visitAreaText == "生产区") {
this.configKey = 'cjfk'
this.getConfig()
@ -763,10 +777,24 @@
// requestType: 'bd',
utilSuccess: function(res) {
console.log(res)
let data = res
let data = Array.isArray(res) ? res : []
let found = null
for (let k of data) {
if (k.key == that.configKey) {
that.configInfo = k
found = k
break
}
}
if (found) {
that.configInfo = {
name: found.name != null && found.name !== '' ? found.name : '访客须知',
value: found.value != null ? found.value : ''
}
} else {
that.configInfo = {
name: '访客须知',
value: '<p style="color:#999;">未配置 key 为 <strong>' + that.configKey +
'</strong> 的须知内容,请在后台【配置管理】中新增后再试。</p>'
}
}
that.configshow = true
@ -778,26 +806,32 @@
getVisitArea() {
let that = this
that.visitArea = [{
name: '非生产区',
id: 3
}, {
name: '生产区',
id: 4
}, {
name: "研发R&D",
id: 5
}]
// this.util.request({
// api: '/api/mobile/visit/visit-area',
// data: {},
// utilSuccess: function(res) {
// console.log(res)
// that.visitArea = res
// },
// utilFail: function(res) {}
// })
const that = this
const visitType = parseInt(this.form.type, 10) || 1
this.util.request({
api: '/api/mobile/visit/visit-area',
data: {
type: visitType
},
utilSuccess: function(res) {
that.visitArea = Array.isArray(res) ? res : []
if (that.form.visit_area_id) {
const row = that.visitArea.find(a => String(a.id) === String(that.form.visit_area_id))
if (row) {
that.visitAreaText = row.name
}
}
if (that.visitArea.length === 0) {
uni.showToast({
title: '暂无可选前往区域',
icon: 'none'
})
}
},
utilFail: function() {
that.visitArea = []
}
})
},
changeVisitArea(e) {
console.log(e)

Loading…
Cancel
Save