diff --git a/common/config.js b/common/config.js index c5c743d..204ac8b 100644 --- a/common/config.js +++ b/common/config.js @@ -30,5 +30,5 @@ const config = { config.baseUrl = 'http://183.230.235.66:11010/api'; -// config.baseUrl = 'http://46a44a1b.r28.cpolar.top'; +// config.baseUrl = 'http://5b35f15d.r28.cpolar.top'; export default config; diff --git a/common/http.api.js b/common/http.api.js index 768a0d0..479f083 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -16,6 +16,8 @@ const install = (Vue, vm) => { //首页公告 getNotices:(params = {})=>vm.$u.get(config.adminPath+'/property/mobile/notices/todayList', params), + //首页活动 + getActivityList:(params = {})=>vm.$u.get(config.adminPath+'/property/mobile/activity/list', params), //工作台列表 getFunList:(params = {})=>vm.$u.get(config.adminPath+'/system/funList/list', params), //我的访客列表 @@ -29,10 +31,13 @@ const install = (Vue, vm) => { getOrderList2:(params = {})=>vm.$u.get(config.adminPath+'/property/mobile/workOrders/list',params), //订单类型 + getOrdersType:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrdersType/list',params), + getOrdersType:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrdersType/list',params), //报事报修订单类型 getRepairTypes:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrdersType/queryList',params), - + //报事报修订单类型 + getRepairTypes2:(params = {})=>vm.$u.get(config.adminPath+'/property/mobile/workOrders/typeTree',params), //工单详情 getRepairDetail:(params = {}, id) => vm.$u.get(config.adminPath+`/property/workOrders/{id}`,params), diff --git a/pages/sys/home/home.vue b/pages/sys/home/home.vue index 5f50724..9c2ce41 100644 --- a/pages/sys/home/home.vue +++ b/pages/sys/home/home.vue @@ -53,17 +53,17 @@ 热门活动 - 全部热门活动 > + 全部热门活动 > - - + + #热门活动 {{ item.title }} - {{ item.date }} - 进行中 + {{ item.startTime }} + {{ getStatusText(item.status) }} @@ -80,13 +80,13 @@ import toast from '../../../uview-ui/libs/function/toast'; name: 'Home', data() { return { - banners: [{ - img: '/static/aaa_banner1.png' - } - // , - // { - // img: 'https://picsum.photos/750/300?random=2' - // } + banners: [{ + img: '/static/aaa_banner1.png' + } + // , + // { + // img: 'https://picsum.photos/750/300?random=2' + // } ], current: 0, gridList: [ @@ -120,29 +120,37 @@ import toast from '../../../uview-ui/libs/function/toast'; scrollTop: 0, scrollInterval: null, scrollHeight: 0, - hotList: [{ - img: '/static/aaa_hd1.png', - title: '世界骑行日 低碳出行 让城市更美好', - date: '2025-07-03' - }, - { - img: '/static/aaa_hd2.png', - title: '仲夏之夜低碳出行·绿色生活让城市更美好', - date: '2025-07-03' - } + hotList: [ ] } }, onLoad() { this.getNotices() + this.getActivityList() }, methods: { + // 获取状态文字描述 + getStatusText(status) { + const statusMap = { + '1': '待进行', + '2': '进行中', + '3': '已完成' + }; + return statusMap[status] || '未知状态'; + }, + async getNotices() { let res = await this.$u.api.getNotices(); if (res.code == '200') { this.newsList = res.rows } }, + async getActivityList() { + let res = await this.$u.api.getActivityList(); + if (res.code == '200') { + this.hotList = res.rows + } + }, goNoticeDetail(item){ let params = {} params.title = item.title @@ -151,6 +159,15 @@ import toast from '../../../uview-ui/libs/function/toast'; const itemStr = encodeURIComponent(JSON.stringify(params)); uni.navigateTo({ url: '/pages/sys/user/serviceCenter/questionDetail?item=' + itemStr }); }, + goActivityDetail(item){ + let params = {} + params.title = item.title + params.content = item.activityContent + params.time = item.startTime + params.img = item.activityImgUrl + const itemStr = encodeURIComponent(JSON.stringify(params)); + uni.navigateTo({ url: '/pages/sys/user/serviceCenter/questionDetail?item=' + itemStr }); + }, onBannerChange(e) { this.current = e.detail.current; }, diff --git a/pages/sys/user/myRepair/addRepair.vue b/pages/sys/user/myRepair/addRepair.vue index d25bf04..435a574 100644 --- a/pages/sys/user/myRepair/addRepair.vue +++ b/pages/sys/user/myRepair/addRepair.vue @@ -71,14 +71,33 @@ this.selectedType = item; }, async getOrderType() { + this.repairTypes = [] let params = { parentId: '1952989217332658178' } - let res = await this.$u.api.getRepairTypes(params); + let res = await this.$u.api.getRepairTypes2(params); if (res.code == '200') { - this.repairTypes = res.data - this.repairInfo.type = res.data[0].id; - this.selectType(res.data[0].orderTypeName) + // 只处理前两条数据 + const types = []; + const data = res.data.slice(0, 2); // 只取前两条数据 + + // 遍历前两个父级分类 + data.forEach(parent => { + // 如果没有children或者children为空,则添加父级数据 + if (!parent.children || parent.children.length === 0) { + types.push(parent); + } else { + // 如果有children,则添加所有children数据 + types.push(...parent.children); + } + }); + + this.repairTypes = types; + + if (this.repairTypes.length > 0) { + this.repairInfo.type = this.repairTypes[0].id; + this.selectType(this.repairTypes[0].orderTypeName) + } } }, // 删除图片 @@ -122,7 +141,7 @@ uni.showToast({ title: '上传失败', icon: 'none' - }); + }); uni.hideLoading(); return; } @@ -136,21 +155,21 @@ async realSubmit() { let res = await this.$u.api.addOrder2(this.repairInfo); - if (res.code == '200') { + if (res.code == '200') { uni.hideLoading(); // 关闭页面前发送事件通知前页面刷新 uni.$emit('refreshData', ''); // 返回上一页 - uni.navigateBack(); - const itemStr = encodeURIComponent(JSON.stringify(this.repairInfo)); - uni.navigateTo({ - url: "/pages/sys/user/myRepair/addSuc?item=" + itemStr, + uni.navigateBack(); + const itemStr = encodeURIComponent(JSON.stringify(this.repairInfo)); + uni.navigateTo({ + url: "/pages/sys/user/myRepair/addSuc?item=" + itemStr, + }); + }else{ + uni.showToast({ + title: res.msg, + icon: 'none' }); - }else{ - uni.showToast({ - title: res.msg, - icon: 'none' - }); } }, diff --git a/pages/sys/user/myRepair/myRepair.vue b/pages/sys/user/myRepair/myRepair.vue index ded84d8..47ae8f4 100644 --- a/pages/sys/user/myRepair/myRepair.vue +++ b/pages/sys/user/myRepair/myRepair.vue @@ -34,7 +34,7 @@ 建立时间:{{ item.createTime }} 工单类型:{{ item.typeName }} 报事位置:{{ item.location }} - 服务评价 + 服务评价 @@ -138,7 +138,7 @@ pageNum: this.pageNum, pageSize: this.pageSize }; - let res = await this.$u.api.getOrderList(params); + let res = await this.$u.api.getOrderList2(params); if (res.code == '200') { const rows = res.rows || []; if (reset) { @@ -212,10 +212,10 @@ }; return statusMap[status] || ''; }, - goTEvaluate() { - const detailItemStr = encodeURIComponent(JSON.stringify(this.detailItem)); + goTEvaluate(item) { + const itemStr = encodeURIComponent(JSON.stringify(item)); uni.navigateTo({ - url: `/pages/sys/user/myRepair/repairEvaluate?detailItem=${detailItemStr}` + url: "/pages/sys/user/myRepair/repairEvaluate?item=" + itemStr }); }, handleScroll(e) { diff --git a/pages/sys/user/myRepair/repairEvaluate.vue b/pages/sys/user/myRepair/repairEvaluate.vue index 0824e2c..2a9c515 100644 --- a/pages/sys/user/myRepair/repairEvaluate.vue +++ b/pages/sys/user/myRepair/repairEvaluate.vue @@ -1,6 +1,5 @@