From 6b8cc0fee5a873a8d9ba07217175baa7e8055b28 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 21 Oct 2024 17:08:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/VNavigationBar.vue | 24 ++- pages-home/home/content.vue | 12 +- pages-home/home/home.vue | 63 ++++--- pages-order/orderDetail/orderDetail.vue | 92 +++++++--- pages-order/orderList/orderList.vue | 96 +++++++--- pages-shop/notice/notice.vue | 195 ++++++++++++++++++++ pages-shop/notice/noticeContent.vue | 85 +++++++++ pages.json | 12 ++ pages/my/message.vue | 225 +++++++++++++++++------- pages/my/my.vue | 24 ++- static/images/clear.png | Bin 0 -> 2173 bytes 11 files changed, 678 insertions(+), 150 deletions(-) create mode 100644 pages-shop/notice/notice.vue create mode 100644 pages-shop/notice/noticeContent.vue create mode 100644 static/images/clear.png diff --git a/components/VNavigationBar.vue b/components/VNavigationBar.vue index 9f4aebc..1cdd4a4 100644 --- a/components/VNavigationBar.vue +++ b/components/VNavigationBar.vue @@ -17,10 +17,13 @@ {{ title }} + + + - + @@ -45,6 +48,10 @@ leftTitle: { type: Boolean, default: false + }, + showClear: { + type: Boolean, + default: false } }, mounted() { @@ -77,7 +84,10 @@ methods: { back() { uni.navigateBack() - } + }, + clearNoReadFun(){ + this.$emit('clearNoRead') + } } } @@ -108,5 +118,13 @@ font-size: 36rpx; font-weight: bold; } + .navigationBarIcon { + display: flex; + } + .clear-icon{ + width: 40rpx; + height: 40rpx; + border-radius: 50%; + } } - \ No newline at end of file + diff --git a/pages-home/home/content.vue b/pages-home/home/content.vue index f59a1ea..1759bf6 100644 --- a/pages-home/home/content.vue +++ b/pages-home/home/content.vue @@ -11,7 +11,7 @@
- 参与
活动
+ 参与
活动
@@ -33,7 +33,8 @@ export default { }, data() { return { - richTextHtml: '' + richTextHtml: '', + toUrl:null, }; }, onLoad(data) { @@ -49,10 +50,9 @@ export default { }) const data = res.data this.richTextHtml = data.content - // this.richTextHtml = data.content.replace(/(]+src=")([^":]*?)(")/g, (match, p1, p2, p3) => { - // return `${p1}${config.baseImageUrl}/${p2}${p3}`; - // }); - // this.richTextHtml = `data:text/html;charset=utf-8,${encodeURIComponent(this.richTextHtml)}` + if(data.toUrl){ + this.toUrl = data.toUrl + } }catch {} }, toActivity(){ diff --git a/pages-home/home/home.vue b/pages-home/home/home.vue index 9e2a7ad..1d2b50a 100644 --- a/pages-home/home/home.vue +++ b/pages-home/home/home.vue @@ -23,7 +23,7 @@ {{menu.title}} - + @@ -78,11 +78,11 @@ icon: require('@/static/icons/homeMenuIcon/menu2.png'), path: '/pages/myCar/myCar' }, - { - title: '活动礼包', - icon: require('@/static/icons/homeMenuIcon/menu3.png'), - path: '/pages-home/home/active' - }, + // { + // title: '活动礼包', + // icon: require('@/static/icons/homeMenuIcon/menu3.png'), + // path: '/pages-home/home/active' + // }, { title: '操作指南', icon: require('@/static/icons/homeMenuIcon/menu4.png'), @@ -98,28 +98,6 @@ title: '车辆机件“焕新上岗”,武汉公交修旧创效出实招' }, ], - // shopList: [{ - // id: 1, - // title: '顺捷汽车维修搭电救援补胎中心', - // address: '济南市历下区福瑞达历下护理院东南门旁', - // distance: '1.9km', - // image: '' - // }, - // { - // id: 2, - // title: '顺捷汽车维修搭电救援补胎中心', - // address: '济南市历下区福瑞达历下护理院东南门旁', - // distance: '1.9km', - // image: '' - // }, - // { - // id: 3, - // title: '顺捷汽车维修搭电救援补胎中心', - // address: '济南市历下区福瑞达历下护理院东南门旁', - // distance: '1.9km', - // image: '' - // }, - // ] shopList: [], bannerList: [], richTextHtml: null @@ -128,8 +106,29 @@ onShow() { this.getCompanyPage() this.getBannerList() + this.getNoticeList() }, methods: { + /** + * 查通知公告 + */ + async getNoticeList(){ + const res = await request({ + url: "/app-api/base/notice/pageList", + method: "get", + params: { + pageNo:1, + pageSize:2, + type:1, + parentServer: "weixiu", + server: "wx" + }, + tenantIdFlag:false + }) + if(res.code==200){ + this.infoList = res.data.records + } + }, swiperChangeFun(e) { console.log('e', e) this.bannerIndex = e.detail.current @@ -149,6 +148,14 @@ item.url = config.baseImageUrl + item.url }) }, + /** + * 跳转通知公告列表页 + */ + gotoNotice(){ + uni.navigateTo({ + url: '/pages-shop/notice/notice' + }) + }, gotoShopDetail(row) { setJSONData("shopInfo",row) // 直接把那一行的数据转发过去 diff --git a/pages-order/orderDetail/orderDetail.vue b/pages-order/orderDetail/orderDetail.vue index 2a384c8..a4a58a7 100644 --- a/pages-order/orderDetail/orderDetail.vue +++ b/pages-order/orderDetail/orderDetail.vue @@ -83,11 +83,11 @@ 联系方式 - {{ ticketInfo.userMobile }} + {{ ticketInfo.userMobile || "" }} 生日 - {{ ticketInfo.birthday }} + {{ ticketInfo.birthday || "" }} @@ -109,14 +109,14 @@ {{ item.itemName }} - ¥{{ item.itemMoney }} + ¥{{ item.itemMoney }} - 售价:{{ item.itemPrice }} - 数量:{{ item.itemCount }} - 单位:{{ item.itemUnit}} - 折扣:{{ item.itemDiscount }} - 金额:{{ item.itemMoney }} + 售价:{{ item.itemPrice || "" }} + 数量:{{ item.itemCount || "" }} + + 折扣:{{ item.itemDiscount || "" }} + 金额:{{ item.itemMoney || "" }} @@ -124,7 +124,7 @@ 销售人员 - {{item.saleName}} + {{item.saleName || ""}} @@ -136,7 +136,7 @@ 施工人员 - {{ item.repairNames }} + {{ item.repairNames || "" }} @@ -146,7 +146,7 @@ - + 维修配件 @@ -186,8 +186,8 @@ {{ item.remark }} - + @@ -221,7 +221,7 @@ data() { return { ticketsId: null, - ticketInfo:{}, + ticketInfo:null, carInfo: {}, userInfo: {}, imgUrlPrex:config.baseImageUrl, @@ -234,6 +234,19 @@ this.getTicketsInfo() }, methods: { + /** + * 预览图片 + */ + prviewImage(imgList, index) { + let urls = [] + imgList.forEach(i => { + urls.push(this.imgUrlPrex+i.image) + }) + uni.previewImage({ + urls: urls, + current: index + }); + }, gotoEvaluate() { uni.navigateTo({ url: '/pages-order/orderDetail/evaluate' @@ -250,6 +263,10 @@ item.typeStr = "未知数据" } item.createTime = formatTimestamp(item.createTime) + let canReadImg =item.itemList.filter((img)=>{ + return img.isOpen=='1' + }) + item.itemList = canReadImg }) this.ticketInfo = resultObj }, @@ -307,7 +324,40 @@ }) } }, - + //翻译配件单位 + getItemUnit(unitCode){ + if(unitCode){ + let dictArray = getStorageWithExpiry("repair_unit"); + if(null==dictArray || undefined==dictArray){ + request({ + url: '/app-api/system/dict-data/type', + method: 'get', + tenantIdFlag:false, + params:{type:"repair_unit"} + }).then((res) => { + console.log(res) + if (res.code == 200) { + setStorageWithExpiry("repair_unit",res.data,3600) + let dictObj = dictArray.find(dict => dict.value == unitCode) + console.log(dictObj, "dictObj") + if (dictObj) { + return dictObj.label + } else { + return "未知数据" + } + } + }) + }else{ + let dictObj = dictArray.find(dict => dict.value == unitCode) + console.log(dictObj, "dictObj") + if (dictObj) { + return dictObj.label + } else { + return "未知数据" + } + } + } + } } diff --git a/pages-order/orderList/orderList.vue b/pages-order/orderList/orderList.vue index 18d5d24..944b04c 100644 --- a/pages-order/orderList/orderList.vue +++ b/pages-order/orderList/orderList.vue @@ -18,8 +18,8 @@ 订单编号:{{ item.orderNo }} - - {{ getStatus(item.orderStatus) }} + + {{ getStatus(item.orderStatus,item.mainStatus,item.payType) }} @@ -30,16 +30,16 @@ {{ item.tenantName || "蓝安-中鑫之宝" }} - - + + 共计 {{ item.payMoney }} - {{ formatTimestamp(item.createTime) }} + {{ formatTimestamp(item.createTime) }} - 支付 + 支付 查看订单 评价订单 @@ -71,6 +71,7 @@ import request from '../../utils/request'; import VNavigationBar from '@/components/VNavigationBar.vue' import tabBarVue from '@/components/tabBar/tabBar.vue' import drawQrcode from 'weapp-qrcode'; +import {getToken,getUserInfo} from '@/utils/auth' export default { components: { @@ -82,18 +83,23 @@ export default { payShow: false, activeKey: 0, imageUrl: '', - tabList: [{ - id: 0, - title: '全部订单' - }, + tabList: [ + { + id: 0, + title: '维修中' + }, { id: 1, - title: '维修中' + title: '待支付' }, { id: 2, title: '待评价' }, + { + id: 3, + title: '全部订单' + }, ], orderList: [], pageNo: 1, @@ -105,8 +111,14 @@ export default { } }, onLoad() { - this.orderList = [] - this.getList() + if(!getToken()){ + uni.reLaunch({ + url: '/pages/login/login' + }) + }else { + this.orderList = [] + this.getList() + } }, methods: { formatTimestamp(timestamp) { @@ -153,12 +165,16 @@ export default { } switch (this.activeKey) { case 0: + //维修中 + data.selectType = "working" break; case 1: - data.status = "06" + //待支付 + data.selectType = "waitingPay" break; case 2: - data.status = '00' + //待评价 + data.selectType = 'waitingComment' break default: break @@ -193,15 +209,45 @@ export default { this.total = 0 this.getList() }, - getStatus(status) { - switch (status) { - case '0': - return '待支付' - case '1': - return '已支付' - default: - break; + /** + * 获取工单的状态 + * @param orderStatus 订单是否支付 0未支付 1已支付 + * @param mainStatus 工单主状态 + * @param payType 支付方式 + * @returns {string} + */ + getStatus(orderStatus,mainStatus,payType) { + let str = ""; + if("0"==orderStatus){ + //未支付的情况下,返回工单的状态 + if("04"==mainStatus){ + //待派工 + str = "待派工" + }else if("05"==mainStatus){ + //维修中 + str = "维修中" + }else if("01"==mainStatus){ + //待结算 + if(!payType){ + str = "待结算" + }else{ + str = "待支付" + } + }else if("06"==mainStatus){ + //挂单/记账 + str = "挂单/记账" + }else if("02"==mainStatus){ + //已结账 + str = "已结账" + }else if("03"==mainStatus){ + //已作废 + str = "已作废" + } + }else{ + //已支付 + str = "已支付" } + return str; }, async goPay(data) { let that = this @@ -256,10 +302,6 @@ export default { uni.navigateTo({ url: '/pages-order/orderDetail/orderDetail?ticketsId=' + row.goodsId }) - }else { - uni.navigateTo({ - url: '/pages-order/orderDetail/orderDetail' - }) } }, gotoEvaluate(row) { diff --git a/pages-shop/notice/notice.vue b/pages-shop/notice/notice.vue new file mode 100644 index 0000000..7b6337d --- /dev/null +++ b/pages-shop/notice/notice.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/pages-shop/notice/noticeContent.vue b/pages-shop/notice/noticeContent.vue new file mode 100644 index 0000000..a7de3e7 --- /dev/null +++ b/pages-shop/notice/noticeContent.vue @@ -0,0 +1,85 @@ + + + + + + + diff --git a/pages.json b/pages.json index 564bad6..ed68b3a 100644 --- a/pages.json +++ b/pages.json @@ -145,6 +145,18 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "notice/notice", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "notice/noticeContent", + "style": { + "navigationBarTitleText": "" + } } ] }, diff --git a/pages/my/message.vue b/pages/my/message.vue index 14914c2..498267f 100644 --- a/pages/my/message.vue +++ b/pages/my/message.vue @@ -1,15 +1,16 @@ @@ -102,11 +168,12 @@ flex-direction: column; .body { flex: 1; - height: 0; + height: calc(100vh - env(safe-area-inset-top)); overflow: auto; } .messageList { padding: 0 32rpx; + height: 100%; } .messageItem { padding: 30rpx 0; @@ -119,13 +186,25 @@ width: 80rpx; height: 80rpx; } + .noReadTitle { + font-weight: bold; + font-size: 32rpx; + color: #333333; + } + .noReadTitle:after{ + content: "*"; + color: red; + display: block; /* 或者其他的块级显示类型,比如 inline-block, table 等 */ + position: absolute; /* 或者 absolute 或者 fixed,取决于你的布局需求 */ + z-index: 1; /* 确保它在元素的上方 */ + right: 0; + } .messageContent { flex: 1; width: 0; } .messageTitle { - font-weight: bold; font-size: 32rpx; color: #333333; } @@ -138,6 +217,32 @@ white-space: nowrap; text-overflow: ellipsis; } - } + } + .popup-content { + padding: 15px; + height: auto; + margin: auto; + width: 80%; + background-color: #fff; + } + .popup-content-text { + display: flex; + align-items: center; + justify-content: center; + } + + .text { + color: #333; + } + + .popup-info { + margin-top: 30rpx; + color: #fff; + background-color: #f2f6fc; + } + + .info-text { + color: #909399; + } } diff --git a/pages/my/my.vue b/pages/my/my.vue index aba5287..f62e077 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -43,9 +43,6 @@ {{ item.title }} - - {{ '12' }} - @@ -54,6 +51,9 @@ {{ item.title }} + + {{ noReadNum }} + @@ -82,6 +82,8 @@ console.log("已登录") //直接取缓存中的用户信息 this.customInfo = JSON.parse(getUserInfo()) + //查未读消息数量 + this.getNoReadNum() } }, data() { @@ -96,9 +98,10 @@ ], menuCard2: [ { title: '消息中心', icon: require('@/static/icons/my-menu-icon2.png'), path: '/pages/my/message' }, - { title: '客服中心', icon: require('@/static/icons/my-menu-icon4.png') }, + // { title: '客服中心', icon: require('@/static/icons/my-menu-icon4.png') }, { title: '操作指南', icon: require('@/static/icons/my-menu-icon5.png'), path: "/pages/guideList/guideList" }, - ] + ], + noReadNum:0 } }, methods: { @@ -112,6 +115,17 @@ url: '/pages/my/myEquity' }) }, + async getNoReadNum(){ + await request({ + url: "/app-api/system/notify-message/get-unread-count", + method: "GET", + tenantIdFlag:false + }).then((res) => { + if(res.code==200){ + this.noReadNum = res.data + } + }) + } } } diff --git a/static/images/clear.png b/static/images/clear.png new file mode 100644 index 0000000000000000000000000000000000000000..2c0f153b46e5637daed82ba8b0e6147dc81ab5e2 GIT binary patch literal 2173 zcmV-@2!i*CP)uA z+eQ$cS;-a)QtkKu&;j0_X{1PJr7I@&MLu zXI7T9k|ld3OE#qM573w8-B-Iav+sQsE%~tGrU_mg9=bC5x-s6h4<4d zrDSX3&SxPY#l1g(-=BA(B$Pu06VR`<6^d7>=auRyLBm|a6$r`0{1P6V9vm-pW7qK% za{6`p0Fmf4h|E<~s*y!1ojWOukjaQ>T`voFeqYhn&^hirz()Ytfuo;0FbQay5iuLo z*mY`gJ$bqeLW&dd>$eT`;8XHxQRm6Pc?T1BJ_}3=I{Vb{Cd9wEs~l{@yM;fY0P+)& zF$yXtV5l8DjnoH3*f0-MhmK|c?f{OT_aF!I5ka;9z4=qxYJ|u5Nr3lyY6K+l_GSxF z?8l}Ix5>R*%QIDk?S-&+-N63*IT$1;lpmG1urf0e7=JuFQ68=-rJ^Z8r0BNNgR{Mj z-H2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