diff --git a/pages/bd/bddetail.vue b/pages/bd/bddetail.vue index 674f02a..f1dfdc1 100644 --- a/pages/bd/bddetail.vue +++ b/pages/bd/bddetail.vue @@ -63,7 +63,7 @@ - 车牌:{{item}} + 车牌:{{item?item:'无'}} @@ -214,7 +214,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) @@ -262,7 +262,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) diff --git a/pages/bd/mine.vue b/pages/bd/mine.vue index 63fc0e2..4d9d1ae 100644 --- a/pages/bd/mine.vue +++ b/pages/bd/mine.vue @@ -159,11 +159,11 @@ this.loadList() } }, - methods: { - toForm(type){ - uni.navigateTo({ - url:"/pages/visit/addrecord?iscall=call&type="+type - }) + methods: { + toForm(type) { + uni.navigateTo({ + url: "/pages/visit/addrecord?iscall=call&type=" + type + }) }, toUrl(isyy, url) { if (isyy) { @@ -181,12 +181,12 @@ }) }, getBdInfo() { - let that = this - let userInfo_bd = uni.getStorageSync('userInfo_Bd') - if(userInfo_bd){ - that.userName = userInfo_bd.name - that.userEmail = userInfo_bd.email?userInfo_bd.email:'' - return + let that = this + let userInfo_bd = uni.getStorageSync('userInfo_Bd') + if (userInfo_bd) { + that.userName = userInfo_bd.name + that.userEmail = userInfo_bd.email ? userInfo_bd.email : '' + return } }, loadList() { @@ -201,8 +201,8 @@ audit_status: this.select.audit_status, keyword: this.select.keyword }, - utilSuccess: function(res) { - that.isEmpty = res.total == 0; + utilSuccess: function(res) { + that.isEmpty = res.total == 0; if (that.select.page == 1) { that.list = res.data } else { @@ -213,7 +213,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) @@ -298,17 +298,18 @@ /deep/ .u-popup__content { width: 80%; background: #fff; - padding: 47rpx; - text-align: center; - + padding: 47rpx; + text-align: center; + + } + + .popupVisit>view:first-child { + margin-bottom: 20rpx } - .popupVisit>view:first-child{ - margin-bottom:20rpx - } - .popupVisit>view button{ - padding: 0 20rpx; - background-color: #044ed7; - color:#fff + .popupVisit>view button { + padding: 0 20rpx; + background-color: #044ed7; + color: #fff } - + \ No newline at end of file diff --git a/pages/bd/record.vue b/pages/bd/record.vue index 00f05eb..482fae8 100644 --- a/pages/bd/record.vue +++ b/pages/bd/record.vue @@ -162,7 +162,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) diff --git a/pages/bd/signpic.vue b/pages/bd/signpic.vue index 7a83972..06d73cc 100644 --- a/pages/bd/signpic.vue +++ b/pages/bd/signpic.vue @@ -97,7 +97,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) diff --git a/pages/index/index.vue b/pages/index/index.vue index 9b79695..37987b3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -38,7 +38,11 @@ }, onLoad() { this.winHeight = uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().statusBarHeight * 2-20; - this.isBd = uni.getStorageSync("userInfo_BD_token").token + + }, + onShow(){ + this.isBd = uni.getStorageSync("userInfo_BD_token").token + console.log("bd",this.isBd) }, methods: { toUrl(type) { diff --git a/pages/visit/addrecord.vue b/pages/visit/addrecord.vue index 79c5978..4778c60 100644 --- a/pages/visit/addrecord.vue +++ b/pages/visit/addrecord.vue @@ -128,21 +128,17 @@ 被访人信息 - - + - - - + + @@ -194,7 +190,7 @@ title: '完成' }], stepActive: 0, - configshow: true, + configshow: false, configInfo: {}, configKey: "ptfk", toadyStart: '', @@ -369,10 +365,10 @@ } }, - onLoad(options) { - // uni.navigateTo({ - // url:'/pages/visit/testStudy?type=1' - // }) + onLoad(options) { + // uni.navigateTo({ + // url:'/pages/visit/testStudy?type=3' + // }) // return this.toadyStart = new Date() this.form.type = options.type @@ -416,12 +412,16 @@ this.form.goodsName = '' } }, - submitAccept(e) { + submitAccept(e) { + console.log(e) if (this.acceptType == 'accept') { - this.form.accept_admin_id = e.id + this.form.accept_admin_id = e.id + this.form.accpet_department_id = e.department_id this.form.acceptName = e.name } else { - this.form.accept_goods_admin_id = e.id + this.form.accept_goods_admin_id = e.id + this.form.accept_admin_id = e.id + this.form.accpet_department_id = e.department_id this.form.goodsName = e.name } this.adminListShow = false @@ -452,7 +452,8 @@ if (k.key == that.configKey) { that.configInfo = k } - } + } + that.configshow = true }, utilFail: function(res) {} }) @@ -609,7 +610,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) diff --git a/pages/visit/detail.vue b/pages/visit/detail.vue index fa6c811..0322e1f 100644 --- a/pages/visit/detail.vue +++ b/pages/visit/detail.vue @@ -64,7 +64,7 @@ - 车牌:{{item}} + 车牌:{{item?item:'无'}} @@ -216,7 +216,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) @@ -239,7 +239,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) diff --git a/pages/visit/study.vue b/pages/visit/study.vue index 9eded1a..5573352 100644 --- a/pages/visit/study.vue +++ b/pages/visit/study.vue @@ -78,7 +78,11 @@ timer: null, } }, - onLoad(options) { + onLoad(options) { + // uni.navigateTo({ + // url:'/pages/visit/testStudy?type=1' + // }) + // return let that = this this.type = options.type this.getStudy() diff --git a/pages/visit/testStudy.vue b/pages/visit/testStudy.vue index 6e70240..b73b5b1 100644 --- a/pages/visit/testStudy.vue +++ b/pages/visit/testStudy.vue @@ -143,27 +143,46 @@ duration: 2000, icon: 'none' }) - // wx.requestSubscribeMessage({ - // tmplIds: ['IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'], - // success (res) { - // console.log("res",res) - // uni.removeStorageSync('formdata') - // uni.redirectTo({ - // url:'/pages/visit/successform' - // }) - // } - // }) - + that.newsSubscription() }, utilFail: function(res) { + console.log(res) uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' }) } }) - } + }, + newsSubscription() { + uni.getSetting({ + withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回 + success(res) { + if (res.authSetting['scope.subscribeMessage']) { + uni.removeStorageSync('formdata') + uni.redirectTo({ + url: '/pages/visit/successform' + }) + } else { + // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息 + uni.requestSubscribeMessage({ + tmplIds: ['DmzNRREPFdZrMWconNDdbj_ebtVPRWufq27kRQ25eNg','IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'], + success(res) { + console.log("res", res) + uni.showToast({ + title:'订阅成功' + }) + uni.removeStorageSync('formdata') + uni.redirectTo({ + url: '/pages/visit/successform' + }) + } + }) + } + } + }); + }, } } diff --git a/pages/visit/visithistory.vue b/pages/visit/visithistory.vue index 548cae1..836186b 100644 --- a/pages/visit/visithistory.vue +++ b/pages/visit/visithistory.vue @@ -139,7 +139,7 @@ }, utilFail: function(res) { uni.showToast({ - title: res.errmsg, + title: res, duration: 2000, icon: 'none' })