diff --git a/api/api.js b/api/api.js index b042328..60197b2 100644 --- a/api/api.js +++ b/api/api.js @@ -8,7 +8,11 @@ const config = { // }, getConfig : {url : '/api/getConfig', method : 'GET', limit : 500}, // 登录接口 - loginLogin: { url: '/cheer/login/login', method: 'GET', }, + loginLogin: { url: '/api/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}, //驳回 diff --git a/api/http.js b/api/http.js index d329600..9f44de7 100644 --- a/api/http.js +++ b/api/http.js @@ -25,8 +25,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { } if(res.statusCode == 401){ - localStorage.removeItem('token') - localStorage.removeItem('userInfo') + uni.removeStorageSync('token'); + uni.removeStorageSync('userInfo'); console.error('登录过期'); uni.navigateTo({ url: '/pages/login/login' @@ -35,8 +35,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { //后端接口token出现问题 if(res.data && res.data.code == 500 && res.data.message == '操作失败,token非法无效!'){ - localStorage.removeItem('token') - localStorage.removeItem('userInfo') + uni.removeStorageSync('token'); + uni.removeStorageSync('userInfo'); console.error('登录过期'); uni.navigateTo({ url: '/pages/login/login' diff --git a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue index ef6d435..c2d670e 100644 --- a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue +++ b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue @@ -14,7 +14,7 @@ - 同意《xx报修隐私政策》 + 同意《xx报修隐私政策》 以及《用户协议》 @@ -79,7 +79,16 @@ event: 'agree' }) this.$refs.popup.close() - } + }, + + handleOpenPrivacyContract() { + // 打开隐私协议页面 + wx.openPrivacyContract({ + success: () => {}, // 打开成功 + fail: () => {}, // 打开失败 + complete: () => {} + }) + } } } diff --git a/components/base/navbar.vue b/components/base/navbar.vue index bf79db1..57c8792 100644 --- a/components/base/navbar.vue +++ b/components/base/navbar.vue @@ -1,6 +1,37 @@ @@ -10,17 +41,124 @@ props : { title : { type : String, - default : '参数' + default : '' }, leftClick : { type : Function, - require : true + }, + moreClick : { + type : Function, + }, + isSearch : { + type : Boolean, + default : false, + }, + isPlus : { + type : Boolean, + default : false, + }, + moreText : { + } + }, + created() { + }, + beforeDestroy() { + }, + data() { + return { + }; + }, + methods : { } } \ No newline at end of file diff --git a/config.js b/config.js index 69040c7..49694c8 100644 --- a/config.js +++ b/config.js @@ -13,7 +13,7 @@ const type = 'dev' // 环境配置 const config = { dev : { - baseUrl : 'http://8.138.162.67:8000/a-notice-api', + baseUrl : 'http://admin.anqi.shop/a-notice-api', }, prod : { baseUrl : 'http://xxx.xxx.xxx/xxx', diff --git a/manifest.json b/manifest.json index 952a447..fd59c4e 100644 --- a/manifest.json +++ b/manifest.json @@ -54,7 +54,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wxe7ae8cbe1673834c", + "appid" : "wx3c24e397e3b132ea", "setting" : { "urlCheck" : false }, @@ -72,5 +72,10 @@ "uniStatistics" : { "enable" : false }, - "vueVersion" : "2" + "vueVersion" : "2", + "h5" : { + "router" : { + "base" : "" + } + } } diff --git a/pages.json b/pages.json index 1cb4674..0728828 100644 --- a/pages.json +++ b/pages.json @@ -1,20 +1,21 @@ { "pages": [{ - "path": "pages/login/login", + "path": "pages/repair/repair", "style": { - "navigationBarTitleText": "登录", - "navigationStyle": "custom" + "navigationBarTitleText": "申请报修" } }, { - "path": "pages/repair/repair", + "path": "pages/login/login", "style": { - "navigationBarTitleText": "报修" + "navigationBarTitleText": "登录", + "navigationStyle": "custom" } }, { "path": "pages/repairList/repairList", "style": { - "navigationBarTitleText": "记录" + "navigationBarTitleText": "我的报修", + "enablePullDownRefresh": false } }, { @@ -34,6 +35,12 @@ "style": { "navigationBarTitleText": "个人中心" } + }, + { + "path": "pages/login/wxUserInfo", + "style": { + "navigationBarTitleText": "获取用户信息" + } } ], "globalStyle": { diff --git a/pages/center/center.vue b/pages/center/center.vue index c306557..a54d46d 100644 --- a/pages/center/center.vue +++ b/pages/center/center.vue @@ -55,9 +55,9 @@ } }, onShow() { - // if (uni.getStorageSync('token')) { - // this.$store.commit('getUserInfo') - // } + if (uni.getStorageSync('token')) { + this.$store.commit('getUserInfo') + } }, methods: { clickList() { @@ -94,7 +94,7 @@ top: 0; z-index: -1; border-radius: 0 0 30% 50%; - background: #00aaff; + /* background: #00aaff; */ } .txt { diff --git a/pages/finish/finish.vue b/pages/finish/finish.vue index 69e24f9..71ebd8b 100644 --- a/pages/finish/finish.vue +++ b/pages/finish/finish.vue @@ -3,22 +3,22 @@ - - + + - + - + - + @@ -61,17 +61,40 @@ successImage: [] }, rules: { - + successTitle: { + type: 'string', + required: true, + message: '请选择处理结果', + trigger: ['blur', 'change'] + }, + successPrice: { + type: 'string', + required: true, + message: '请填写收费金额', + trigger: ['blur', 'change'] + }, + sucessText: { + type: 'string', + required: true, + message: '请输入处理说明', + trigger: ['blur', 'change'] + }, + successImage: { + type: 'array', + required: true, + message: '请上传图片', + trigger: ['blur', 'change'] + }, }, processingList: [ [{ id: 0, - label: '已处理' + label: '处理完成' }, - { - id: 1, - label: '未处理' - } + // { + // id: 1, + // label: '未处理' + // } ] ], maxUpload: 4, @@ -95,7 +118,7 @@ //返回 leftClick() { uni.switchTab({ - url: '/pages/repairList/repairList' + url: '/pages/center/center' }) }, @@ -154,12 +177,17 @@ //结单 submit() { - this.form.successImage = this.form.successImage.join(',') - this.$api('editSchoolOrderSuccess', this.form, res => { - if (res.code == 200) { - console.log(res); - } - }) + this.$refs.form.validate().then(res => { + this.$api('editSchoolOrderSuccess', { ...this.form , successImage : this.form.successImage.join(',') }, res => { + if (res.code == 200) { + uni.showToast({ + icon: 'none', + title: '结单完成' + }) + this.leftClick() + } + }) + }).catch(errors => {}) } } } diff --git a/pages/login/login.vue b/pages/login/login.vue index cff5cd5..fb7d1ae 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -59,10 +59,7 @@ methods: { wxLogin(){ - // this.$store.commit('login') - uni.switchTab({ - url: '/pages/repair/repair' - }) + this.$store.commit('login') }, //打开应用配置 diff --git a/pages/login/wxUserInfo.vue b/pages/login/wxUserInfo.vue index d0ec311..991fa43 100644 --- a/pages/login/wxUserInfo.vue +++ b/pages/login/wxUserInfo.vue @@ -13,10 +13,10 @@ 头像 - - + @@ -74,9 +74,11 @@ return } - self.$api('infoUpdateInfo', self.userInfo, res => { + self.$api('updateInfo', self.userInfo, res => { if (res.code == 200) { - uni.navigateBack(-1) + uni.switchTab({ + url: '/pages/repair/repair' + }) } }) }) diff --git a/pages/repair/repair.vue b/pages/repair/repair.vue index 7cfcbe1..9feed15 100644 --- a/pages/repair/repair.vue +++ b/pages/repair/repair.vue @@ -1,9 +1,9 @@