diff --git a/common/config.service.js b/common/config.service.js index a0a3155..c101ac9 100644 --- a/common/config.service.js +++ b/common/config.service.js @@ -1,5 +1,5 @@ // 接口环境 -let BASE_URL = 'http://8.138.171.103:8082'; +let BASE_URL = '/pixelApi'; let IP = 'http://8.138.171.103/'; let FILE_URL = IP+'static/'; // 火山引擎ai接口地址 diff --git a/common/http.api.js b/common/http.api.js index 2eb97b2..88950c5 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -6,6 +6,10 @@ const install = (Vue, vm) => { vm.$api.login = async (params = {}) => await vm.$u.get('/acUser/phoneLogin', params);// 手机号登录 vm.$api.register = async (params = {}) => await vm.$u.get('/acUser/phoneRegister', params);// 手机号注册 + // 应用服务 + vm.$api.allServices = async (params = {}) => await vm.$u.get('/paServices/all', params);// 获取全部应用 + vm.$api.singleServices = async (id) => await vm.$u.get(`/paServices/${id}`);// 获取单个应用 + // 留言板 vm.$api.addMessage = async (params = {}) => await vm.$u.post('/cpMessage', params);// 添加留言 diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 5f05298..ccf49f1 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -9,9 +9,10 @@ import configService from '@/common/config.service.js'; const install = (Vue, vm) => { let url = '' // 此处仅作调试新接口的开发环境,会在开发环境时影响旧接口的请求,不影响上线使用 - if (process.env.NODE_ENV === 'development') { - url = configService.apiUrl; - } + // if (process.env.NODE_ENV === 'development') { + // url = configService.apiUrl; + // } + url = configService.apiUrl; // #ifdef H5 typeof window.fastUrl !== 'undefined' ? url = window.fastUrl : '', // #endif diff --git a/manifest.json b/manifest.json index d948ccf..a2a2f0f 100644 --- a/manifest.json +++ b/manifest.json @@ -102,6 +102,15 @@ "devServer" : { "disableHostCheck" : true, "proxy" : { + "/pixelApi" : { + "target" : "http://8.138.171.103:8082", + "changeOrigin" : true, + "secure" : true, + "ws" : false, + "pathRewrite" : { + "^/pixelApi" : "" + } + }, "/upload" : { "target" : "http://8.138.171.103", "changeOrigin" : true, diff --git a/pages/mobile_web/home/home.vue b/pages/mobile_web/home/home.vue index 8995777..033833f 100644 --- a/pages/mobile_web/home/home.vue +++ b/pages/mobile_web/home/home.vue @@ -21,18 +21,19 @@ - + - + @@ -51,7 +52,7 @@ 筛选 - @@ -60,7 +61,7 @@ 收藏 - {{ siftList[item.type].label }} + {{ siftList[item.type]?siftList[item.type].label:'暂无' }} @@ -73,6 +74,7 @@ + @@ -123,33 +125,35 @@ export default { // { // // 风格替换 // name: '风格替换', - // picture:'autoreplace.png', - // model: '', + // icon:'autoreplace.png', + // type: '', // // 'stylereplace' // }, { // 人物动漫化 + id: 1, name: '人物动漫化', - picture:'save.png', - model: 'animeization' + icon:'save.png', + type: 0 }, // { // // 证件照 // name: '证件照', - // picture:'passport.png', - // model: '' + // icon:'passport.png', + // type: '' // }, { // 旧照修复 + id: 2, name: '旧照修复', - picture:'oldrepair.png', - model: 'oldrepair' + icon:'oldrepair.png', + type: 0 }, // { // // 人脸修复 // name: '人脸修复', - // picture:'headrepair.png', - // model: '' + // icon:'headrepair.png', + // type: '' // } ], // [] @@ -228,6 +232,20 @@ export default { } }, methods:{ + // 初始化 + async init(){ + let res = await this.$api.allServices(); + if(res.success){ + // 这里按一页5个分组 + this.swiperFunctionList = []; + const arr = res.data; + for (let i = 0; i < arr.length; i += 5) { + this.swiperFunctionList.push(arr.slice(i, i + 5)); + } + }else{ + this.$refs.uToast.show({type:'error',title: "应用列表获取失败!"}); + } + }, // 横向功能列表切换页 categoryChange(event){ this.currentPageindex = event.detail.current+1; @@ -264,9 +282,10 @@ export default { },250) }, // 前往工作室 - toDeal({name, model}){ - if(name && model) - uni.navigateTo({url: `/pages/mobile_web/workshops/index?name=${name}&model=${model}`}); + toDeal(id = null){ + if(id!==null) + uni.navigateTo({url: `/pages/mobile_web/workshops/index?id=${id}`}); + else this.$refs.uToast.show({type:'error',title: "暂未开放对应功能!"}); }, // 轮播图跳转 linkTo(e){ diff --git a/pages/mobile_web/index/index.vue b/pages/mobile_web/index/index.vue index c99a1c1..02159e1 100644 --- a/pages/mobile_web/index/index.vue +++ b/pages/mobile_web/index/index.vue @@ -1,9 +1,10 @@