From 6fd43d281bf8a560e506e150137b5e5434390c67 Mon Sep 17 00:00:00 2001 From: wesley88 <9519127+wesley88@user.noreply.gitee.com> Date: Thu, 27 Mar 2025 17:54:37 +0800 Subject: [PATCH] 1 --- lvdao-miniapp/pages.json | 8 ++++++++ lvdao-miniapp/pages/my/my.vue | 13 ++++++++----- lvdao-miniapp/pages/my/remove.vue | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lvdao-miniapp/pages/workbench/workbench.vue | 4 ++-- lvdao-miniapp/pagesA/rentPay/rentPay.vue | 9 +++------ lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue | 261 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------- lvdao-miniapp/utils/request.js | 6 +++--- 7 files changed, 333 insertions(+), 137 deletions(-) create mode 100644 lvdao-miniapp/pages/my/remove.vue diff --git a/lvdao-miniapp/pages.json b/lvdao-miniapp/pages.json index ab9346f..ee43a34 100644 --- a/lvdao-miniapp/pages.json +++ b/lvdao-miniapp/pages.json @@ -414,6 +414,14 @@ "navigationBarBackgroundColor": "#FFFFFF", "navigationBarTitleText": "商品详情" } + }, + { + "path" : "pages/my/remove", + "style" : + { + "navigationBarBackgroundColor": "#FFFFFF", + "navigationBarTitleText": "修改资料" + } } ], "subpackages": [{ diff --git a/lvdao-miniapp/pages/my/my.vue b/lvdao-miniapp/pages/my/my.vue index c6470a7..abf6797 100644 --- a/lvdao-miniapp/pages/my/my.vue +++ b/lvdao-miniapp/pages/my/my.vue @@ -34,8 +34,8 @@ - - + + @@ -286,18 +286,21 @@ }; }, onload() { - + }, onShow() { const isLogin = uni.getStorageSync('token'); - this.user = uni.getStorageSync('user') + // this.user = uni.getStorageSync('user') if (isLogin == '') { // 如果未登录,跳转到登录页面 uni.navigateTo({ url: '/pages/login/login' }) } else { - + this.$http.sendRequest('/business/getUserDetails', 'GET', {}).then(res => { + + this.user = res.data.data + }) this.$http.sendRequest('/cerePlatformMerchant/queryByPage', 'POST',{pageSize:10,pageNumber:0,phone:uni.getStorageSync('user').phone},1).then(res => { if(res.data.data.content.length>0) { let c1 = res.data.data.content[0] diff --git a/lvdao-miniapp/pages/my/remove.vue b/lvdao-miniapp/pages/my/remove.vue new file mode 100644 index 0000000..be339ac --- /dev/null +++ b/lvdao-miniapp/pages/my/remove.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/lvdao-miniapp/pages/workbench/workbench.vue b/lvdao-miniapp/pages/workbench/workbench.vue index 82bc231..4707686 100644 --- a/lvdao-miniapp/pages/workbench/workbench.vue +++ b/lvdao-miniapp/pages/workbench/workbench.vue @@ -318,8 +318,8 @@ "page": 1, "pageSize": 1 }, 1).then(res => { - if (res.data.data.list.length > 0) { - uni.setStorageSync('shopId', res.data.data.list[0].shopId); + if (res.data.data.content.length > 0) { + uni.setStorageSync('shopId', res.data.data.content[0].shopId); } else { // uni.show uni.setStorageSync('shopId', ''); diff --git a/lvdao-miniapp/pagesA/rentPay/rentPay.vue b/lvdao-miniapp/pagesA/rentPay/rentPay.vue index cad2ed7..f6b662f 100644 --- a/lvdao-miniapp/pagesA/rentPay/rentPay.vue +++ b/lvdao-miniapp/pagesA/rentPay/rentPay.vue @@ -51,7 +51,7 @@ 合计:{{payAll}} - 去支付 + 去支付 @@ -208,7 +208,7 @@ const msg = JSON.stringify(this.list1[this.ListIndex]) uni.navigateTo({ - url: `/pagesA/rentPay/rentPayDetails?msg=${msg}&merchants=${this.relatedMerchants}` + url: `/pagesA/rentPay/rentPayDetails?msg=${encodeURIComponent(msg)}&merchants=${encodeURIComponent(this.relatedMerchants)}` }) }, async joinShow() { @@ -236,10 +236,7 @@ }) // return - const payId = this.$http.sendRequest('/order/rentAggregatePayment', 'POST', arr, 3).then(res => { - console.log(res.data) - console.log(JSON.parse(res.data.data).payUrl) - + const payId = await this.$http.sendRequest('/order/rentAggregatePayment', 'POST', arr, 3).then(res => { if (res.data.data) { let payUrl = JSON.parse(res.data.data).payUrl let c1 = payUrl.split('=')[1] diff --git a/lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue b/lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue index c73001e..3b1ac68 100644 --- a/lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue +++ b/lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue @@ -5,18 +5,27 @@ {{pageIndex.time}}年 -
{{allPay}}
+
+ {{allPay}} + +
- + - {{item.dingPay}} + + {{item.dingPay}} + - {{value.tenementOrderParent==''?value.tenementOrder:value.tenementOrderParent}} - {{value.paymentAmount}} + + {{value.tenementOrderParent==''?value.tenementOrder:value.tenementOrderParent}} + + {{value.paymentAmount}} + + {{value.payState==1?'支付成功':''}} @@ -25,7 +34,7 @@ - + 暂无数据 @@ -37,141 +46,151 @@ return { show: false, dataList: [], - allPay:0, - pageIndex:{ - time:'' + allPay: 0, + pageIndex: { + time: '' }, - merchants:'' + merchants: '' } }, - onShow(){ + onShow() { this.pageIndex.time = this.getCurrentYear() - }, - onLoad(options) { - if(options.msg && options.merchants){ - this.allPay = 0 - let receivedMsg = JSON.parse(options.msg) - this.merchants = options.merchants - this.getAll(receivedMsg.list) - } - }, + }, + onLoad(options) { + console.error(options) + if (options.msg && options.merchants) { + this.allPay = 0 + let receivedMsg = JSON.parse(decodeURIComponent(options.msg)) + this.merchants = decodeURIComponent(options.merchants) + console.error(this.merchants) + this.getAll(receivedMsg.list) + } + }, methods: { - getAll(receivedMsg){ - let totalPay= 0 - const redList = [] - // 用于存储 tenementOrderParent 相同的项 - const groupedItems = {}; - // 遍历 receivedMsg.list 数组 - receivedMsg.forEach(item => { - if(item.payState ==1){ - totalPay += item.paymentAmount - if (item.tenementOrderParent === '') { - // 如果 tenementOrderParent 为空,添加 dingPay 字段并添加到 redList - let newItem = { ...item,ziList:[], dingPay: item.paymentAmount }; - newItem.ziList.push(item) - redList.push(newItem); - } else { - // 如果 tenementOrderParent 不为空,将相同 tenementOrderParent 的项分组 - if (!groupedItems[item.tenementOrderParent]) { - groupedItems[item.tenementOrderParent] = { - ziList: [], - dingPay: 0 - }; - } - groupedItems[item.tenementOrderParent].ziList.push(item); - groupedItems[item.tenementOrderParent].dingPay += item.paymentAmount; - groupedItems[item.tenementOrderParent].paymentTime = item.paymentTime; - groupedItems[item.tenementOrderParent].payDay = item.payDay; - groupedItems[item.tenementOrderParent].payState = item.payState; - } - } - - }); - // 将分组后的对象添加到 redList - for (const key in groupedItems) { - redList.push({ - tenementOrderParent: key, - ...groupedItems[key] - }); - } - - // receivedMsg.list.map(item=>{ - // let obj ={ - // ...item, - // dingPay:0, - // ziList:[] - // } - // if (item.payState == 1) { - // obj.ziList.push(item) - // if(item.tenementOrderParent ){ - - // } - // obj.dingPay +=item.paymentAmount - // this.orderPay+=item.paymentAmount - // this.allPay+=item.paymentAmount - // redList.push(obj) - // } - - // }) - this.allPay = totalPay; - this.dataList = redList - + getAll(receivedMsg) { + let totalPay = 0 + const redList = [] + // 用于存储 tenementOrderParent 相同的项 + const groupedItems = {}; + // 遍历 receivedMsg.list 数组 + receivedMsg.forEach(item => { + if (item.payState == 1) { + totalPay += item.paymentAmount + if (item.tenementOrderParent === '') { + // 如果 tenementOrderParent 为空,添加 dingPay 字段并添加到 redList + let newItem = { + ...item, + ziList: [], + dingPay: item.paymentAmount + }; + newItem.ziList.push(item) + redList.push(newItem); + } else { + // 如果 tenementOrderParent 不为空,将相同 tenementOrderParent 的项分组 + if (!groupedItems[item.tenementOrderParent]) { + groupedItems[item.tenementOrderParent] = { + ziList: [], + dingPay: 0 + }; + } + groupedItems[item.tenementOrderParent].ziList.push(item); + groupedItems[item.tenementOrderParent].dingPay += item.paymentAmount; + groupedItems[item.tenementOrderParent].paymentTime = item.paymentTime; + groupedItems[item.tenementOrderParent].payDay = item.payDay; + groupedItems[item.tenementOrderParent].payState = item.payState; + } + } + + }); + // 将分组后的对象添加到 redList + for (const key in groupedItems) { + redList.push({ + tenementOrderParent: key, + ...groupedItems[key] + }); + } + + // receivedMsg.list.map(item=>{ + // let obj ={ + // ...item, + // dingPay:0, + // ziList:[] + // } + // if (item.payState == 1) { + // obj.ziList.push(item) + // if(item.tenementOrderParent ){ + + // } + // obj.dingPay +=item.paymentAmount + // this.orderPay+=item.paymentAmount + // this.allPay+=item.paymentAmount + // redList.push(obj) + // } + + // }) + this.allPay = totalPay; + this.dataList = redList + }, getCurrentYear() { - const year = new Date().getFullYear(); - return `${year}`; + const year = new Date().getFullYear(); + return `${year}`; }, - confirm(e){ - this.pageIndex.time = e.year - - const { firstDay, lastDay } = this.getYearFirstAndLastDay(e.year) + confirm(e) { + this.pageIndex.time = e.year + + const { + firstDay, + lastDay + } = this.getYearFirstAndLastDay(e.year) this.$http.sendRequest('/cerePropertyOrder/queryByName', 'POST', { - relatedMerchants:this.merchants, - paymentTimeStart:firstDay, - paymentTimeEnd:lastDay + relatedMerchants: this.merchants, + paymentTimeStart: firstDay, + paymentTimeEnd: lastDay }, 1).then(res => { + console.log(res) if (res.data.data.length > 0) { - + this.getAll(res.data.data[0].cerePropertyOrderList) - }else{ - this.dataList=[] + } else { + this.dataList = [] this.allPay = 0 } - }) + }) }, getYearFirstAndLastDay(year) { console.log(year) - const firstDay = new Date(year, 0, 1); - const lastDay = new Date(year, 11, 31); - console.log(firstDay.toISOString().split('T')) - return { - firstDay: firstDay.toISOString().split('T')[0], - lastDay: lastDay.toISOString().split('T')[0] - } + const firstDay = new Date(year, 0, 1); + const lastDay = new Date(year, 11, 31); + console.log(firstDay.toISOString().split('T')) + return { + firstDay: firstDay.toISOString().split('T')[0], + lastDay: lastDay.toISOString().split('T')[0] + } }, formatDateTime(dateTimeStr) { - // 创建 Date 对象 - const date = new Date(dateTimeStr); - // 获取月份,由于 getMonth() 返回值从 0 开始,所以要加 1,并确保为两位数字 - const month = String(date.getMonth() + 1).padStart(2, '0'); - // 获取日期,并确保为两位数字 - const day = String(date.getDate()).padStart(2, '0'); - // 获取小时,并确保为两位数字 - const hours = String(date.getHours()).padStart(2, '0'); - // 获取分钟,并确保为两位数字 - const minutes = String(date.getMinutes()).padStart(2, '0'); - - // 按照所需格式拼接并返回结果 - return `${month}.${day} ${hours}:${minutes}`; + // 创建 Date 对象 + const date = new Date(dateTimeStr); + // 获取月份,由于 getMonth() 返回值从 0 开始,所以要加 1,并确保为两位数字 + const month = String(date.getMonth() + 1).padStart(2, '0'); + // 获取日期,并确保为两位数字 + const day = String(date.getDate()).padStart(2, '0'); + // 获取小时,并确保为两位数字 + const hours = String(date.getHours()).padStart(2, '0'); + // 获取分钟,并确保为两位数字 + const minutes = String(date.getMinutes()).padStart(2, '0'); + + // 按照所需格式拼接并返回结果 + return `${month}月${day}日 ${hours}:${minutes}`; }, formatDate(dateStr) { - // 使用 split 方法将日期字符串按 - 分割成数组 - const [year, month, day] = dateStr.split('-'); - // 将 month 和 day 转换为数字,去除可能存在的前导零 - const formattedMonth = parseInt(month, 10); - const formattedDay = parseInt(day, 10); - // 按照目标格式拼接字符串 - return `${formattedMonth}月${formattedDay}号`; + // 使用 split 方法将日期字符串按 - 分割成数组 + const [year, month, day] = dateStr.split('-'); + // 将 month 和 day 转换为数字,去除可能存在的前导零 + const formattedMonth = parseInt(month, 10); + const formattedDay = parseInt(day, 10); + // 按照目标格式拼接字符串 + return `${formattedMonth}月${formattedDay}号`; }, } } @@ -179,4 +198,4 @@ \ No newline at end of file + \ No newline at end of file diff --git a/lvdao-miniapp/utils/request.js b/lvdao-miniapp/utils/request.js index b24bbdf..529cda7 100644 --- a/lvdao-miniapp/utils/request.js +++ b/lvdao-miniapp/utils/request.js @@ -21,7 +21,7 @@ const sendRequest = (url, method = 'GET', data = {}, baseUrl,contentType) => { // bases = 'https://zhgw.028wlkj.com:20443/cdwlMall/meserver/admin-server' + url; // bases = 'https://jy.scjysm.asia:18086/cdwlMall/meserver/admin-server' + url; - // bases = 'http://128.10.249.41:9003'+ url; + // bases = 'http://128.10.249.23:9003'+ url; // bases = 'https://zhld.028wlkj.com:49008/cdwlMall/admin-server' + url; bases = c1 + 'cdwlMall/meserver/admin-server' + url; @@ -30,7 +30,7 @@ const sendRequest = (url, method = 'GET', data = {}, baseUrl,contentType) => { // bases = 'https://jy.scjysm.asia:18086/cdwlMall/meserver/api' + url; // bases = 'https://zhgw.028wlkj.com:20443/cdwlMall/meserver/api' + url; // bases = 'http://128.10.249.22:9003:9007' + url; - // bases = 'http://128.10.249.41:9007' + url; + // bases = 'http://128.10.249.23:9007' + url; bases = c1 + 'cdwlMall/meserver/api' + url; }else{ @@ -39,7 +39,7 @@ const sendRequest = (url, method = 'GET', data = {}, baseUrl,contentType) => { // bases = 'http://172.16.61.123/cdwlMall/business-server' + url; // bases = 'https://jy.scjysm.asia:18086/cdwlMall/business-server' + url; // bases = 'https://zhgw.028wlkj.com:20443/cdwlMall/business-server' + url; - // bases = 'http://128.10.249.41:9004' + url; + // bases = 'http://128.10.249.23:9004' + url; // bases = 'https://zhld.028wlkj.com:49008/cdwlMall/business-server' + url; bases = c1 + 'cdwlMall/business-server' + url; -- libgit2 0.21.4