master
lion 5 days ago
parent c18d873b42
commit a4bbdbfb7c

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

Loading…
Cancel
Save