diff --git a/App.vue b/App.vue index a4444f6..edf7bf2 100644 --- a/App.vue +++ b/App.vue @@ -4,7 +4,7 @@ }, onShow: function() { - // this.$store.commit('initConfig') + this.$store.commit('initConfig') }, onHide: function() { diff --git a/api/api.js b/api/api.js index dca411d..1954bd3 100644 --- a/api/api.js +++ b/api/api.js @@ -11,8 +11,6 @@ const config = { loginLogin: { url: '/school/login/login', method: 'GET' , limit : 500 }, //修改个人信息接口 updateInfo: { url: '/api/info/updateInfo', method: 'POST' , limit : 500 }, - //获取用户信息接口 - getInfo: { url: '/api/info/getInfo', method: 'GET' , limit : 500 }, //增加报修单 addSchoolOrder : {url : '/school-api/addSchoolOrder', method : 'GET', limit : 500}, //驳回 @@ -25,6 +23,8 @@ const config = { getActorGoList : {url : '/school-api/getActorGoList', method : 'GET', limit : 500}, //获取室号 getFloorList : {url : '/school-api/getFloorList', method : 'GET', limit : 500}, + //分配给维修的维修单 + getSchoolOrderList : {url : '/school-api/getSchoolOrderList', method : 'GET', limit : 500}, } diff --git a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue index c2d670e..b6834c5 100644 --- a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue +++ b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue @@ -6,7 +6,7 @@ - 欢迎来到xx报修!我们根据最新的法律法规、监管政策要求,更新了《用户协议》和《隐私政策》,请您认真阅读。 + 欢迎来到校园报修!我们根据最新的法律法规、监管政策要求,更新了《用户协议》和《隐私政策》,请您认真阅读。 @@ -14,18 +14,20 @@ - 同意《xx报修隐私政策》 + 同意《校园报修隐私政策》 - 以及《用户协议》 + 以及《用户协议》 - + @@ -40,6 +42,25 @@ checkboxValue : false } }, + mounted() { + if(wx.getPrivacySetting){ + wx.getPrivacySetting({ + success: res => { + // console.log(res) + if (res.needAuthorization) { + // 需要弹出隐私协议 + this.init() + } + }, + fail: () => {} + }) + } + }, + // created(){ + // setTimeout(() => { + // this.init() + // },2000) + // }, methods: { //初始化 @@ -74,10 +95,16 @@ // 同意 handleAgreePrivacyAuthorization() { // 告知平台用户已经同意,参数传同意按钮的id - this.resolvePrivacyAuthorization({ - buttonId: 'agree-btn', - event: 'agree' - }) + // this.resolvePrivacyAuthorization({ + // buttonId: 'agree-btn', + // event: 'agree' + // }) + if(!this.checkboxValue){ + return uni.showToast({ + icon: 'none', + title: '请勾选同意《校园报修隐私政策》和《用户协议》' + }) + } this.$refs.popup.close() }, diff --git a/config.js b/config.js index ccbdff2..4437f2c 100644 --- a/config.js +++ b/config.js @@ -14,7 +14,7 @@ const type = 'dev' const config = { dev : { // baseUrl : 'http://admin.anqi.shop/a-notice-api', - baseUrl : 'http://h5.xzaiyp.top/a-notice-api/', + baseUrl : 'http://h5.xzaiyp.top/school-api', }, prod : { baseUrl : 'http://xxx.xxx.xxx/xxx', diff --git a/pages.json b/pages.json index a4b382e..d2515ae 100644 --- a/pages.json +++ b/pages.json @@ -40,6 +40,13 @@ "style": { "navigationBarTitleText": "获取用户信息" } + }, + { + "path" : "pages/order/order", + "style" : + { + "navigationBarTitleText" : "" + } } ], "globalStyle": { diff --git a/pages/center/center.vue b/pages/center/center.vue index a54d46d..53384d6 100644 --- a/pages/center/center.vue +++ b/pages/center/center.vue @@ -4,15 +4,17 @@ - - + + - {{ userInfo.nickName }} + {{ userInfo.name }} 登录 / 注册 @@ -23,8 +25,12 @@ - + + + @@ -51,20 +57,50 @@ color: '#666666', size: '22', type: 'auth' + }, + extraIcon2: { + color: '#666666', + size: '22', + type: 'chatbubble-filled' + }, + extraIcon3: { + color: '#666666', + size: '22', + type: 'closeempty' } } }, onShow() { - if (uni.getStorageSync('token')) { - this.$store.commit('getUserInfo') + //用户没有登录 + if (!this.userInfo.id) { + this.logout() } }, methods: { + clickList() { uni.navigateTo({ url: '/pages/repairList/repairList' }) + }, + + //退出登录 + logout() { + uni.navigateTo({ + url: '/pages/login/login' + }) + uni.removeStorageSync('token'); + uni.removeStorageSync('userInfo'); + this.$store.commit('setUserInfo', {}) + }, + + //跳转指派给我的维修单 + toOrder() { + uni.navigateTo({ + url: '/pages/order/order' + }) } + } } @@ -81,7 +117,7 @@ position: relative; z-index: 1; overflow: hidden; - padding: 60rpx 20rpx 20rpx; + padding: 20rpx 20rpx 20rpx; box-sizing: border-box; } diff --git a/pages/finish/finish.vue b/pages/finish/finish.vue index 21b2835..123595a 100644 --- a/pages/finish/finish.vue +++ b/pages/finish/finish.vue @@ -4,8 +4,8 @@ - - + @@ -38,7 +38,7 @@ title="选择处理结果" @confirm="floorConfirm"> - @@ -165,13 +165,13 @@ viewImageAsList() { this.$utils.previewImage({ current: this.currentIndex, - urls: this.form.images + urls: this.form.successImage }) }, //删除图片 deleteImageAsList() { - this.form.images = this.form.images.filter((_, index) => { + this.form.successImage = this.form.successImage.filter((_, index) => { return index != this.currentIndex }) }, @@ -225,4 +225,8 @@ .image-item image { width: 100%; } + + /deep/ .uv-safe-area-inset-bottom { + padding-bottom: 0 !important + } \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index da4a751..9edfe8e 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -1,140 +1,159 @@ \ No newline at end of file diff --git a/pages/order/order.vue b/pages/order/order.vue new file mode 100644 index 0000000..4f3c49e --- /dev/null +++ b/pages/order/order.vue @@ -0,0 +1,232 @@ + + + + + \ No newline at end of file diff --git a/pages/repair/repair.vue b/pages/repair/repair.vue index a7e69dc..13e7079 100644 --- a/pages/repair/repair.vue +++ b/pages/repair/repair.vue @@ -60,7 +60,7 @@ @confirm="roomConfirm"> - @@ -186,9 +186,7 @@ //用户选择了图片操作选项 selectImageSheet(imageSheet) { - let { - id - } = imageSheet + let { id } = imageSheet if (id) { this.deleteImageAsList() } else { @@ -200,13 +198,13 @@ viewImageAsList() { this.$utils.previewImage({ current: this.currentIndex, - urls: this.form.images + urls: this.form.image }) }, //删除图片 deleteImageAsList() { - this.form.images = this.form.images.filter((_, index) => { + this.form.image = this.form.image.filter((_, index) => { return index != this.currentIndex }) }, @@ -229,6 +227,12 @@ //打开选择室号 roomPickerOpen() { + if(!this.form.building){ + return uni.showToast({ + icon : 'none', + title: '请先选择楼栋信息' + }) + } this.$refs.roomPicker.open(); }, @@ -337,4 +341,8 @@ .image-item image { width: 100%; } + + /deep/ .uv-safe-area-inset-bottom { + padding-bottom: 0 !important + } \ No newline at end of file diff --git a/pages/repairList/repairList.vue b/pages/repairList/repairList.vue index d12eede..7ab5c2f 100644 --- a/pages/repairList/repairList.vue +++ b/pages/repairList/repairList.vue @@ -1,3 +1,4 @@ + diff --git a/store/store.js b/store/store.js index 5256301..c156a2c 100644 --- a/store/store.js +++ b/store/store.js @@ -19,24 +19,29 @@ const store = new Vuex.Store({ mutations: { // 初始化配置 initConfig(state) { - let config = ['preferential', 'wx'] - config.forEach(k => { - api('getConfig', { - keyValue : k - }, res => { - if (res.code == 200) { - state.configList[k] = res.result - } - }) - }) + // let config = ['preferential', 'wx'] + // config.forEach(k => { + // api('getConfig', { + // keyValue : k + // }, res => { + // if (res.code == 200) { + // state.configList[k] = res.result + // } + // }) + // }) + + // let apiConfig = [ 'getPrivacyPolicy' , 'getUserAgreement' ] //需要访问不同接口才能得到的配置数据 + // let key = ['privacyAgreement','userAgreement'] + // apiConfig.forEach((item,index) => { + // api(item,res => { + // state.configList[key[index]] = res.result + // }) + // }) + //初始化用户信息(防止用户每次点击重新进入小程序用户信息都没有了) + if(uni.getStorageSync('token') && uni.getStorageSync('userInfo')){ + state.userInfo = JSON.parse(uni.getStorageSync('userInfo')) + } - let apiConfig = [ 'getPrivacyPolicy' , 'getUserAgreement' ] //需要访问不同接口才能得到的配置数据 - let key = ['privacyAgreement','userAgreement'] - apiConfig.forEach((item,index) => { - api(item,res => { - state.configList[key[index]] = res.result - }) - }) }, login(state) { uni.login({ @@ -71,12 +76,9 @@ const store = new Vuex.Store({ } }) }, - getUserInfo(state) { - api('getInfo', res => { - if(res.code == 200){ - state.userInfo = res.result - } - }) + setUserInfo(state,userInfo) { + state.userInfo = userInfo + console.log(state.userInfo); }, }, actions: {}, diff --git a/uni.scss b/uni.scss index ad2fa7c..53e244e 100644 --- a/uni.scss +++ b/uni.scss @@ -72,4 +72,4 @@ $uni-font-size-title:20px; $uni-color-subtitle: #555555; // 二级标题颜色 $uni-font-size-subtitle:26px; $uni-color-paragraph: #3F536E; // 文章段落颜色 -$uni-font-size-paragraph:15px; +$uni-font-size-paragraph:15px; \ No newline at end of file