diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/pages/information/information.vue b/pages/information/information.vue index 6299c8d..513a75b 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -61,9 +61,8 @@ + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/pages/information/information.vue b/pages/information/information.vue index 6299c8d..513a75b 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -61,9 +61,8 @@ @@ -450,10 +425,45 @@ diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/pages/information/information.vue b/pages/information/information.vue index 6299c8d..513a75b 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -61,9 +61,8 @@ @@ -450,10 +425,45 @@ diff --git a/pages/message/message.vue b/pages/message/message.vue index 401287c..1122e40 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -50,21 +50,8 @@ - - - - + + @@ -75,17 +62,17 @@ import { dateToString, getDateTime } from "@/common/utils.js"; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { isManager: false, list: [], phone: "", - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 }; }, onShow() { @@ -99,6 +86,12 @@ this.checkphone(); this.fetchMessageList(); }, + //下拉刷新 + onPullDownRefresh() { + this.fetchMessageList().then(() => { + uni.stopPullDownRefresh(); //停止下拉刷新 + }); + }, mounted() { if (uni.getStorageSync("userInfo")) { const userInfo = JSON.parse(uni.getStorageSync("userInfo")); @@ -115,11 +108,6 @@ url: `/pages/checkMessageDetail/checkMessageDetail?id=${id}`, }); }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, //获取消息列表 async fetchMessageList() { const res = await getMessageList(); @@ -161,9 +149,13 @@ } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; + console.log('消息页面', this.popShow) } }, + closePop() { + this.popShow = false; + } }, }; diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/pages/information/information.vue b/pages/information/information.vue index 6299c8d..513a75b 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -61,9 +61,8 @@ @@ -450,10 +425,45 @@ diff --git a/pages/message/message.vue b/pages/message/message.vue index 401287c..1122e40 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -50,21 +50,8 @@ - - - - + + @@ -75,17 +62,17 @@ import { dateToString, getDateTime } from "@/common/utils.js"; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { isManager: false, list: [], phone: "", - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 }; }, onShow() { @@ -99,6 +86,12 @@ this.checkphone(); this.fetchMessageList(); }, + //下拉刷新 + onPullDownRefresh() { + this.fetchMessageList().then(() => { + uni.stopPullDownRefresh(); //停止下拉刷新 + }); + }, mounted() { if (uni.getStorageSync("userInfo")) { const userInfo = JSON.parse(uni.getStorageSync("userInfo")); @@ -115,11 +108,6 @@ url: `/pages/checkMessageDetail/checkMessageDetail?id=${id}`, }); }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, //获取消息列表 async fetchMessageList() { const res = await getMessageList(); @@ -161,9 +149,13 @@ } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; + console.log('消息页面', this.popShow) } }, + closePop() { + this.popShow = false; + } }, }; diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index 924a9f1..6a26652 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -16,21 +16,8 @@ 账号设置 - - - - + + @@ -39,9 +26,10 @@ import { updateImg } from '@/api/mine.js'; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; + import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -69,8 +57,7 @@ value: '' }, ], - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 } }, mounted() { @@ -115,8 +102,14 @@ getUserProfile(); } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; } + }, + closePop() { + this.popShow = false; + uni.switchTab({ + url: '/pages/index/index' + }); } }, } diff --git a/App.vue b/App.vue index 713089d..5c55a7c 100644 --- a/App.vue +++ b/App.vue @@ -4,31 +4,8 @@ export default { onLaunch: function() { console.log('App Launch'); - // const updateManager = wx.getUpdateManager(); - // updateManager.applyUpdate(); - // updateManager.onCheckForUpdate(function (res) { - // console.log('onCheckForUpdate', res); - // }); - // updateManager.onUpdateReady(function () { - // wx.showModal({ - // title: '更新提示', - // content: '新版本已经准备好,是否重启应用?', - // success: function (res) { - // if (res.confirm) { - // updateManager.applyUpdate(); - // } - // }, - // }); - // }); - // updateManager.onUpdateFailed(function () { - // uni.showToast({ - // title: '新版本下载失败,请重启', - // icon: 'none' - // }); - // }); const sessionId = uni.getStorageSync('sessionId'); - console.log('-----', sessionId); if (!sessionId) { getLogin(); } diff --git a/api/index.js b/api/index.js index f832a2c..ab57b27 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ const VERIFY_PHONE = BASE_URL + '/user/userLogin'; const GET_USER_INFO = BASE_URL + '/user/getUserInfo'; +const GET_USER_PHONE_NUMBER = BASE_URL + '/user/getUserPhoneNumber'; //验证手机号是否为员工 export function verifyPhone(phone) { @@ -19,4 +20,13 @@ export function getUserInfo(phone) { useNetWork(); return fetch.post(GET_USER_INFO).then(res => res); +} + +//获取手机号 +export function getUserPhoneNumber(phoneCode) { + useNetWork(); + const params = { + phoneCode: phoneCode, + }; + return fetch.post(GET_USER_PHONE_NUMBER, params).then(res => res); } \ No newline at end of file diff --git a/components/base/getphonePopup.vue b/components/base/getphonePopup.vue new file mode 100644 index 0000000..4d2ecb0 --- /dev/null +++ b/components/base/getphonePopup.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/pages/information/information.vue b/pages/information/information.vue index 6299c8d..513a75b 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -61,9 +61,8 @@ @@ -450,10 +425,45 @@ diff --git a/pages/message/message.vue b/pages/message/message.vue index 401287c..1122e40 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -50,21 +50,8 @@ - - - - + + @@ -75,17 +62,17 @@ import { dateToString, getDateTime } from "@/common/utils.js"; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { isManager: false, list: [], phone: "", - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 }; }, onShow() { @@ -99,6 +86,12 @@ this.checkphone(); this.fetchMessageList(); }, + //下拉刷新 + onPullDownRefresh() { + this.fetchMessageList().then(() => { + uni.stopPullDownRefresh(); //停止下拉刷新 + }); + }, mounted() { if (uni.getStorageSync("userInfo")) { const userInfo = JSON.parse(uni.getStorageSync("userInfo")); @@ -115,11 +108,6 @@ url: `/pages/checkMessageDetail/checkMessageDetail?id=${id}`, }); }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, //获取消息列表 async fetchMessageList() { const res = await getMessageList(); @@ -161,9 +149,13 @@ } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; + console.log('消息页面', this.popShow) } }, + closePop() { + this.popShow = false; + } }, }; diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index 924a9f1..6a26652 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -16,21 +16,8 @@ 账号设置 - - - - + + @@ -39,9 +26,10 @@ import { updateImg } from '@/api/mine.js'; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; + import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -69,8 +57,7 @@ value: '' }, ], - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 } }, mounted() { @@ -115,8 +102,14 @@ getUserProfile(); } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; } + }, + closePop() { + this.popShow = false; + uni.switchTab({ + url: '/pages/index/index' + }); } }, } diff --git a/pages/register/register.vue b/pages/register/register.vue index 6346a9c..dfaede6 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -49,20 +49,14 @@ labelWidth="80" class="form-item" > - - + @@ -75,7 +69,7 @@ @select="sexSelect" > - 允许 - + --> - 拒绝将无法进行注册! - - 仍要拒绝 - 允许授权 + 提示 + 拒绝将无法进行注册! + + + + - 注册成功! + 提示 + 注册成功! - + 提示 + 注册失败!请重新填写信息或联系管理人员 - - - 返回 - - - 确认 - + + + @@ -151,8 +151,8 @@ + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/pages/information/information.vue b/pages/information/information.vue index 6299c8d..513a75b 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -61,9 +61,8 @@ @@ -450,10 +425,45 @@ diff --git a/pages/message/message.vue b/pages/message/message.vue index 401287c..1122e40 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -50,21 +50,8 @@ - - - - + + @@ -75,17 +62,17 @@ import { dateToString, getDateTime } from "@/common/utils.js"; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { isManager: false, list: [], phone: "", - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 }; }, onShow() { @@ -99,6 +86,12 @@ this.checkphone(); this.fetchMessageList(); }, + //下拉刷新 + onPullDownRefresh() { + this.fetchMessageList().then(() => { + uni.stopPullDownRefresh(); //停止下拉刷新 + }); + }, mounted() { if (uni.getStorageSync("userInfo")) { const userInfo = JSON.parse(uni.getStorageSync("userInfo")); @@ -115,11 +108,6 @@ url: `/pages/checkMessageDetail/checkMessageDetail?id=${id}`, }); }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, //获取消息列表 async fetchMessageList() { const res = await getMessageList(); @@ -161,9 +149,13 @@ } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; + console.log('消息页面', this.popShow) } }, + closePop() { + this.popShow = false; + } }, }; diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index 924a9f1..6a26652 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -16,21 +16,8 @@ 账号设置 - - - - + + @@ -39,9 +26,10 @@ import { updateImg } from '@/api/mine.js'; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; + import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -69,8 +57,7 @@ value: '' }, ], - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 } }, mounted() { @@ -115,8 +102,14 @@ getUserProfile(); } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; } + }, + closePop() { + this.popShow = false; + uni.switchTab({ + url: '/pages/index/index' + }); } }, } diff --git a/pages/register/register.vue b/pages/register/register.vue index 6346a9c..dfaede6 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -49,20 +49,14 @@ labelWidth="80" class="form-item" > - - + @@ -75,7 +69,7 @@ @select="sexSelect" > - 允许 - + --> - 拒绝将无法进行注册! - - 仍要拒绝 - 允许授权 + 提示 + 拒绝将无法进行注册! + + + + - 注册成功! + 提示 + 注册成功! - + 提示 + 注册失败!请重新填写信息或联系管理人员 - - - 返回 - - - 确认 - + + + @@ -151,8 +151,8 @@ + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/pages/information/information.vue b/pages/information/information.vue index 6299c8d..513a75b 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -61,9 +61,8 @@ @@ -450,10 +425,45 @@ diff --git a/pages/message/message.vue b/pages/message/message.vue index 401287c..1122e40 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -50,21 +50,8 @@ - - - - + + @@ -75,17 +62,17 @@ import { dateToString, getDateTime } from "@/common/utils.js"; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { isManager: false, list: [], phone: "", - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 }; }, onShow() { @@ -99,6 +86,12 @@ this.checkphone(); this.fetchMessageList(); }, + //下拉刷新 + onPullDownRefresh() { + this.fetchMessageList().then(() => { + uni.stopPullDownRefresh(); //停止下拉刷新 + }); + }, mounted() { if (uni.getStorageSync("userInfo")) { const userInfo = JSON.parse(uni.getStorageSync("userInfo")); @@ -115,11 +108,6 @@ url: `/pages/checkMessageDetail/checkMessageDetail?id=${id}`, }); }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, //获取消息列表 async fetchMessageList() { const res = await getMessageList(); @@ -161,9 +149,13 @@ } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; + console.log('消息页面', this.popShow) } }, + closePop() { + this.popShow = false; + } }, }; diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index 924a9f1..6a26652 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -16,21 +16,8 @@ 账号设置 - - - - + + @@ -39,9 +26,10 @@ import { updateImg } from '@/api/mine.js'; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; + import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -69,8 +57,7 @@ value: '' }, ], - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 } }, mounted() { @@ -115,8 +102,14 @@ getUserProfile(); } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; } + }, + closePop() { + this.popShow = false; + uni.switchTab({ + url: '/pages/index/index' + }); } }, } diff --git a/pages/register/register.vue b/pages/register/register.vue index 6346a9c..dfaede6 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -49,20 +49,14 @@ labelWidth="80" class="form-item" > - - + @@ -75,7 +69,7 @@ @select="sexSelect" > - 允许 - + --> - 拒绝将无法进行注册! - - 仍要拒绝 - 允许授权 + 提示 + 拒绝将无法进行注册! + + + + - 注册成功! + 提示 + 注册成功! - + 提示 + 注册失败!请重新填写信息或联系管理人员 - - - 返回 - - - 确认 - + + + @@ -151,8 +151,8 @@ + + \ No newline at end of file diff --git a/pages.json b/pages.json index ab349c6..7fe2933 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,7 @@ "style" : { "navigationBarTitleText": "消息", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 19e036a..89e61e6 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -1,55 +1,58 @@ @@ -175,7 +178,7 @@ async fetchMessageInfo(id) { const res = await getMessageInfo(id); this.status = res.visitorApplyStatus === "1" ? '已提交' : res.visitorApplyStatus === "2" ? - '已通过' : '不通过'; + '已通过' : '未通过'; this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; @@ -200,72 +203,78 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index f9c31af..a5b3d3d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,28 +3,16 @@ - {{ item.name }} + >{{ item.name }} + - - - - + + @@ -34,9 +22,11 @@ import { getLogin, getUserProfile } from "@/utils/auth.js"; import { verifyPhone } from "@/api/index.js"; import { getLocationParams } from "@/common/utils.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue"; +import { subscription } from "@/utils/common.js" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -52,9 +42,8 @@ }, ], phone: "", - show: false, + popShow: false, //控制授权手机号弹出框 active: "", //点击的是哪个按钮 - inputValue: "", }; }, mounted() { @@ -70,6 +59,8 @@ methods: { // ...mapMutations(['setNavRect']) async handleClick(id) { + + // subscription(); this.active = id; const sessionId = uni.getStorageSync("sessionId"); //如果this.phone为空,先弹出获取手机号,得到手机号之后验证此人是都注册过 @@ -79,15 +70,11 @@ if (this.phone) { this.checkphone(); } else { - //如果没有电话就弹出填写电话的框 - this.show = true; + //弹获取手机号 + this.popShow = true; } }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, + //通过手机号检查是否存在这个用户 async checkphone() { const res = await verifyPhone(this.phone); if (res === "用户未注册") { @@ -96,7 +83,15 @@ }); } else { uni.setStorageSync("registerPhone", this.phone); - getUserProfile(); + await getUserProfile(); + + if (uni.getStorageSync("userInfo")) { + const userInfo = JSON.parse(uni.getStorageSync("userInfo")); + if (userInfo.salt === "物业人员") { + subscription(); + } + } + if (this.active === "submit") { wx.navigateTo({ url: `/pages/information/information?id=${this.active}`, @@ -104,6 +99,10 @@ } } }, + + closePop() { + this.popShow = false; + } }, }; @@ -126,14 +125,12 @@ border: 1px solid gray; } } -.poppo { - padding: 30rpx; -} diff --git a/pages/info/info.vue b/pages/info/info.vue index a1d6bcb..3580802 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -2,47 +2,47 @@ - 申请单号 + 申请单号 {{info.applyNo}} - 申请状态 + 申请状态 {{status}} - 申请者工号 + 申请者工号 {{info.staffCode}} - 申请者姓名 + 申请者姓名 {{info.staffName}} - 访客姓名 + 访客姓名 {{info.visitorName}} - 访客身份证 + 访客身份证 {{info.visitorIdCard}} - 访客联系方式 + 访客联系方式 {{info.visitorPhone}} - 访客目的 + 访客目的 {{info.visitReason}} - 访客区域 + 访客区域 {{info.visitPosition}} - 访客时间 + 访客时间 {{info.inTime }} - 备注 + 备注 {{info.remarks}} @@ -100,7 +100,9 @@ .check-message-detail { padding: 18rpx; height: 100%; - + .title { + font-weight: 600; + } .detail-content { padding: 22rpx; background-color: #fff; @@ -110,7 +112,7 @@ .detail-item { display: flex; justify-content: space-between; - margin-top: 44rpx; + margin-bottom: 44rpx; } } .green{ diff --git a/pages/information/information.vue b/pages/information/information.vue index 6299c8d..513a75b 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -61,9 +61,8 @@ @@ -450,10 +425,45 @@ diff --git a/pages/message/message.vue b/pages/message/message.vue index 401287c..1122e40 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -50,21 +50,8 @@ - - - - + + @@ -75,17 +62,17 @@ import { dateToString, getDateTime } from "@/common/utils.js"; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; +import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { isManager: false, list: [], phone: "", - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 }; }, onShow() { @@ -99,6 +86,12 @@ this.checkphone(); this.fetchMessageList(); }, + //下拉刷新 + onPullDownRefresh() { + this.fetchMessageList().then(() => { + uni.stopPullDownRefresh(); //停止下拉刷新 + }); + }, mounted() { if (uni.getStorageSync("userInfo")) { const userInfo = JSON.parse(uni.getStorageSync("userInfo")); @@ -115,11 +108,6 @@ url: `/pages/checkMessageDetail/checkMessageDetail?id=${id}`, }); }, - confirmPhone() { - this.phone = this.inputValue; - this.show = false; - this.checkphone(); - }, //获取消息列表 async fetchMessageList() { const res = await getMessageList(); @@ -161,9 +149,13 @@ } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; + console.log('消息页面', this.popShow) } }, + closePop() { + this.popShow = false; + } }, }; diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index 924a9f1..6a26652 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -16,21 +16,8 @@ 账号设置 - - - - + + @@ -39,9 +26,10 @@ import { updateImg } from '@/api/mine.js'; import { verifyPhone } from "@/api/index.js"; import { getLogin, getUserProfile } from "@/utils/auth.js"; + import GetPhonePopup from "@/components/base/getphonePopup.vue" export default { components: { - TabBar, + TabBar, GetPhonePopup }, data() { return { @@ -69,8 +57,7 @@ value: '' }, ], - show: false, - inputValue: "", + popShow: false, //控制授权手机号弹出框 } }, mounted() { @@ -115,8 +102,14 @@ getUserProfile(); } } else { //没有电话就弹出授权 - this.show = true; + this.popShow = true; } + }, + closePop() { + this.popShow = false; + uni.switchTab({ + url: '/pages/index/index' + }); } }, } diff --git a/pages/register/register.vue b/pages/register/register.vue index 6346a9c..dfaede6 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -49,20 +49,14 @@ labelWidth="80" class="form-item" > - - + @@ -75,7 +69,7 @@ @select="sexSelect" > - 允许 - + --> - 拒绝将无法进行注册! - - 仍要拒绝 - 允许授权 + 提示 + 拒绝将无法进行注册! + + + + - 注册成功! + 提示 + 注册成功! - + 提示 + 注册失败!请重新填写信息或联系管理人员 - - - 返回 - - - 确认 - + + + @@ -151,8 +151,8 @@