修改了router/index.js中的魅宠详情
另外跳转是跳转到魅宠详情,pet/index.vue中已经修改
petInfo中route.params拿到的是pid,而不是id,之后可以拿到数据了
| | |
| | | # 页面标题 |
| | | VUE_APP_TITLE = 若依管理系统 |
| | | VUE_APP_TITLE = 张氏APP管理系统 |
| | | |
| | | # 开发环境配置 |
| | | ENV = 'development' |
| | |
| | | //魅宠主人信息 |
| | | |
| | | //根据宠物id查询主人信息 |
| | | export function getPetowner(id,pid) { |
| | | export function getPetowner(id) { |
| | | return request({ |
| | | url: '/zfMaster/' + id + '/pid='+pid, |
| | | url: '/zfMaster/' + id, |
| | | method: 'get', |
| | | }) |
| | | } |
| | |
| | | } |
| | | ] |
| | | }, |
| | | //魅宠备忘录 |
| | | //魅宠详情 |
| | | { |
| | | path: '/familymodel/pet', |
| | | component: Layout, |
| | | // permissions: [], |
| | | hidden: true, |
| | | permissions: ['familymodel:pet:list'], |
| | | permissions: ['familymodel:pet:info'], |
| | | |
| | | children: [ |
| | | { |
| | | path: 'petnote/:pid(\\d+)', |
| | | component: () => import('@/views/pet/petnote'), |
| | | name: 'petnote', |
| | | path: 'petInfo/:pid(\\d+)', |
| | | component: () => import('@/views/pet/petInfo'), |
| | | name: 'petInfo', |
| | | meta: { title: '备忘录',activeMenu: '/familymodel/zfPetNote'} |
| | | } |
| | | ] |
| | |
| | | computed: {}, |
| | | watch: {}, |
| | | created() { |
| | | const id = this.$route.params && this.$route.params.id; |
| | | const id = this.$route.params && this.$route.params.pid; |
| | | let jd; |
| | | if(this.$route.query.detail!=undefined) |
| | | { |
| | |
| | | this.loading = true; |
| | | getPetList(id).then((response) => { |
| | | this.petList = response.data; |
| | | let paths = response.data.url.split(","); |
| | | for(let i = 0; i < paths.length; i++) |
| | | { |
| | | if(paths[i]!="") { |
| | | |
| | | let pth = paths[i].substr(paths[i].length - 4, paths[i].length) |
| | | |
| | | if (_this.fot.includes(pth) === true) |
| | | _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) |
| | | else { |
| | | // alert(paths[i]) |
| | | let nms = paths[i].split("\/") |
| | | let nm = nms[nms.length - 1] |
| | | _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | console.log(response.data) |
| | | |
| | | this.loading = false; |
| | | |
| | | }); |
| | | this.getCateInfor() |
| | | |
| | | }; |
| | | if (id,pid) { |
| | | if (id) { |
| | | this.loading = true; |
| | | getPetownerList(id,pid).then((response) => { |
| | | getPetownerList(id).then((response) => { |
| | | this.petownerList = response.data; |
| | | let paths = response.data.url.split(","); |
| | | for(let i = 0; i < paths.length; i++) |
| | | { |
| | | if(paths[i]!="") { |
| | | console.log(response.data) |
| | | |
| | | let pth = paths[i].substr(paths[i].length - 4, paths[i].length) |
| | | |
| | | if (_this.fot.includes(pth) === true) |
| | | _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) |
| | | else { |
| | | // alert(paths[i]) |
| | | let nms = paths[i].split("\/") |
| | | let nm = nms[nms.length - 1] |
| | | _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) |
| | | } |
| | | } |
| | | } |
| | | this.loading = false; |
| | | |
| | | |