diff --git a/common/js/data.js b/common/js/data.js index ac1879e..5de14b2 100644 --- a/common/js/data.js +++ b/common/js/data.js @@ -170,7 +170,39 @@ const areaList = [ id: 300, name: '天河' }] -] +] + +const regionList = [ + [{ + id: 100, + name: '广东' + }, { + id: 101, + name: '海南' + }], + [{ + id: 200, + name: '广州' + }] +] + +const districtList = [{ + id: 0, + name: '天河区', + checked: false +}, { + id: 1, + name: '番禺区', + checked: false +}, { + id: 2, + name: '南沙区', + checked: false +}, { + id: 3, + name: '黄浦区', + checked: false +}] const categoryList = [ [{ @@ -426,7 +458,16 @@ const areaObj = { const specsList = [{ id: 1, + checked: true, name: '电脑式' +}, { + id: 2, + checked: false, + name: '小修(压敏/盘管/传感器/接收器/定时器)' +}, { + id: 3, + checked: false, + name: '小修(压敏/盘管/传感器/接收器/定时器)' }] export default { @@ -445,5 +486,7 @@ export default { servDetail, goodsList, areaObj, - specsList + specsList, + regionList, + districtList } diff --git a/common/js/request.js b/common/js/request.js index a562f16..7d93f30 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -1,12 +1,14 @@ import globalData from '@/common/js/globalData.js'; -export default { +export default { + address: 'http://127.0.0.1:80', // 异步接口拦截 addInterceptor() { uni.addInterceptor('request', { invoke(args) { // request 触发前拼接 url - args.url = 'http://www.opsoul.com' + args.url; + // args.url = 'http://www.opsoul.com' + args.url; + args.url = this.address + args.url; // console.log("停止触发"); // return false; }, @@ -75,9 +77,9 @@ export default { if (!loginRes.logined) { userInfo = await wx.getUserProfile({ desc: '用于小程序登录' - }); - // 获取微信登录凭证 - const wxLoginRes = await wx.login(); + }); + // 获取微信登录凭证 + const wxLoginRes = await wx.login(); console.log(wxLoginRes) // 再次请求小程序服务端存储用户,服务端添加附加用户信息后返回 loginRes = { @@ -87,15 +89,15 @@ export default { userId: 1, wxLoginCode: wxLoginRes.code } - }; - - const wxAuthRes = await uni.request({ - url: '/wx/auth', - header: { - code: wxLoginRes.code - } - }) - console.log(wxAuthRes) + }; + + const wxAuthRes = await uni.request({ + url: '/wx/auth', + header: { + code: wxLoginRes.code + } + }) + console.log(wxAuthRes) loginRes.userInfo.openId = wxAuthRes[1].data.data.openid; } userInfo = loginRes.userInfo; @@ -110,9 +112,22 @@ export default { // 页面存储用户登录有效信息,以便其他页面调用 uni.setStorageSync('userProfile', userInfo); return true; - }, - getCurUserInfo() { - let userProfile = uni.getStorageSync('userProfile'); - return userProfile; }, + getCurUserInfo() { + let userProfile = uni.getStorageSync('userProfile'); + return userProfile; + }, + async uploadFile(filePath) { + let res = await uni.uploadFile({ + url: this.address + '/tool/qiniu/upload', + filePath: filePath, + name: 'uploadFile' + }) + let resStr = res[1].data; + let resObj = {}; + if (resStr != null && resStr.length > 0) { + resObj = JSON.parse(resStr); + } + return resObj; + } } diff --git a/components/uni-combox/my-uni-combox.vue b/components/uni-combox/my-uni-combox.vue index f73b965..98ec755 100644 --- a/components/uni-combox/my-uni-combox.vue +++ b/components/uni-combox/my-uni-combox.vue @@ -58,9 +58,9 @@ default: '' }, candidates: { - type: Object, + type: Array, default () { - return {} + return [] } }, emptyTips: { diff --git a/pages/my/new-serv.vue b/pages/my/new-serv.vue index ae9c0ed..cb01f7d 100644 --- a/pages/my/new-serv.vue +++ b/pages/my/new-serv.vue @@ -9,36 +9,197 @@
@@ -66,4 +307,11 @@ .cu-form-group picker::after { display: none; } + .certern-height { + height: 520rpx; + overflow: hidden; + } + .long-btn{ + width: 95%; + }