diff --git a/package2/group/groupBuyDetail.vue b/package2/group/groupBuyDetail.vue index 0e55ecb..d171464 100644 --- a/package2/group/groupBuyDetail.vue +++ b/package2/group/groupBuyDetail.vue @@ -11,20 +11,30 @@ - - + + - {{shopItem.shopName || ''}} + {{shopItem.shopName || '商家详情'}} - - - {{shopItem.shopAddress || '暂无地址'}} + {{shopItem.subtitle}} + + {{shopTypeText}} + 评分 {{shopScoreText}} + 销量 {{saleCountText}} - - - {{businessTimeText}} + + + {{shopItem.shopAddress || '暂无地址'}} + + + + {{businessTimeText}} + + + + {{deliveryText}} @@ -38,9 +48,14 @@ 商家资质 - - - 暂无资质图片 + + + + {{item.label}} + + + + 暂无资质图片 @@ -52,6 +67,33 @@ 公告:{{shopItem.remark || '暂无公告'}} + + + + 商家信息 + + + + 法人 + {{shopItem.shopLename}} + + + 联系电话 + {{shopItem.contactPhone}} + + + 所属区域 + {{shopItem.shopAreaTitle}} + + + 品牌店铺 + {{shopItem.isbrandflag == 1 ? '是' : '否'}} + + + + + + 商家信息加载中... @@ -63,7 +105,9 @@ menuButtonInfo: {}, isPintuan:true, shopItem:{}, - shopImages:[] + shopImages:[], + qualificationImages:[], + detailLoaded:false } }, computed: { @@ -71,6 +115,32 @@ const takeaway = this.shopItem.shopTakeaway || {}; if (!takeaway.businessHourBegin || !takeaway.businessHourEnd) return '营业时间暂无'; return '周一到周日 ' + takeaway.businessHourBegin + '-' + takeaway.businessHourEnd; + }, + shopTypeText() { + const takeaway = this.shopItem.shopTakeaway || {}; + return this.shopItem.shopTypeTitle || takeaway.type || '美食'; + }, + shopScoreText() { + return this.shopItem.shopScore || '5.0'; + }, + saleCountText() { + return this.shopItem.saleCount != null ? this.shopItem.saleCount : 0; + }, + deliveryText() { + if (this.shopItem.supportShopDelivery == 1) { + const fee = this.shopItem.orderBkge != null ? this.shopItem.orderBkge : 0; + const duration = this.shopItem.shopDeliveryDuration ? this.shopItem.shopDeliveryDuration + '分钟' : '尽快送达'; + const location = this.shopItem.shopDeliveryLocation == 1 ? '送到宿舍' : this.shopItem.shopDeliveryLocation == 2 ? '送到楼下' : '支持自配送'; + return '商家自配送 ' + duration + ',' + location + ',配送费¥' + fee; + } + if (this.shopItem.supportTransferDelivery == 1) { + const duration = this.shopItem.transferDeliveryDuration ? this.shopItem.transferDeliveryDuration + '分钟' : '尽快送达'; + return '中转配送 ' + duration + (this.shopItem.transferAddressName ? ',' + this.shopItem.transferAddressName : ''); + } + if (this.shopItem.groupDeliveryTime) { + return '预计配送 ' + this.shopItem.groupDeliveryTime + '分钟'; + } + return '配送信息暂无'; } }, components: { @@ -84,15 +154,15 @@ }, methods: { initShopItem(option) { - const cacheItem = uni.getStorageSync('groupShopDetail'); - if (cacheItem) { - this.shopItem = cacheItem; - } else if (option.item) { - this.shopItem = this.parseRouteItem(option.item) || {}; + let id = option.id || ''; + if (!id && option.item) { + const routeItem = this.parseRouteItem(option.item) || {}; + id = routeItem.id || (routeItem.shop && routeItem.shop.id) || ''; } - this.setShopImages(); - if (option.id || this.shopItem.id) { - this.getShopDetail(option.id || this.shopItem.id); + if (id) { + this.getShopDetail(id); + } else { + this.detailLoaded = true; } }, parseRouteItem(item) { @@ -107,25 +177,77 @@ } } }, + normalizeDetailResult(result) { + const shop = result.shop ? result.shop : result; + const shopTakeaway = result.shopTakeaway || shop.shopTakeaway || {}; + const products = result.products || shop.products || []; + return { + ...shop, + shopTakeaway, + products, + groupDeliveryTime: shop.groupDeliveryTime || result.groupDeliveryTime + }; + }, setShopImages() { - if (!this.shopItem.shopImages) { + const imageText = this.shopItem.shopImages; + if (!imageText) { this.shopImages = []; + this.qualificationImages = []; return; } - this.shopImages = this.shopItem.shopImages.split('@@').filter(item => item && item !== 'undefined' && item !== 'null'); + const labels = ['', '', '营业执照']; + const images = []; + String(imageText).split('@@').forEach((item, index) => { + if (!item || item === 'undefined' || item === 'null') return; + if (index < 2) return; + if (index === 3) { + this.parseExtraImages(item).forEach((url, extraIndex) => { + images.push({ + label: extraIndex === 0 ? '补充证照' : '补充证照' + (extraIndex + 1), + url + }); + }); + return; + } + images.push({ + label: labels[index] || '资质图片' + (index + 1), + url: item + }); + }); + this.qualificationImages = images.filter(item => item.url); + this.shopImages = this.qualificationImages.map(item => item.url); + }, + parseExtraImages(value) { + try { + const parsed = JSON.parse(value); + if (Array.isArray(parsed)) { + return parsed.filter(item => item && item !== 'undefined' && item !== 'null'); + } + return parsed ? [parsed] : []; + } catch (e) { + return value ? [value] : []; + } }, getShopDetail(id) { + let area = uni.getStorageSync('area'); + let regionId = ''; + try { + regionId = area ? JSON.parse(area).id : ''; + } catch (e) {} this.tui.request("/app/shop/getShopInfoById", "POST", { id: id, - regionId: JSON.parse(uni.getStorageSync('area')).id - }, false, false).then((res) => { + regionId: regionId + }, false, true).then((res) => { if (res.code == 200 && res.result) { - this.shopItem = res.result; - uni.setStorageSync('groupShopDetail', res.result); + this.shopItem = this.normalizeDetailResult(res.result); + uni.setStorageSync('groupShopDetail', this.shopItem); this.setShopImages(); } + this.detailLoaded = true; uni.hideLoading(); - }).catch(() => {}); + }).catch(() => { + this.detailLoaded = true; + }); }, //查看大图 largeImg(img) { @@ -204,11 +326,113 @@ border-radius: 20rpx; padding: 20rpx; } + .shop-name{ + flex: 1; + min-width: 0; + height: 48rpx; + line-height: 48rpx; + font-size: 28rpx; + font-weight: 700; + margin-left: 10rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .shop-subtitle{ + color: #08735d; + line-height: 36rpx; + margin-top: 12rpx; + } + .shop-meta{ + display: flex; + flex-wrap: wrap; + margin-top: 16rpx; + } + .shop-meta text{ + padding: 4rpx 14rpx; + background: rgba(223, 255, 176, 1); + color: #08735d; + border-radius: 8rpx; + line-height: 32rpx; + margin-right: 12rpx; + margin-bottom: 12rpx; + } + .shop-card{ + display: flex; + align-items: flex-start; + } + .shop-info-row{ + display: flex; + align-items: flex-start; + color: #777; + line-height: 40rpx; + margin-top: 20rpx; + } + .shop-info-icon{ + flex-shrink: 0; + line-height: 40rpx; + } + .shop-info-text{ + flex: 1; + min-width: 0; + padding-left: 10rpx; + word-break: break-all; + } + .qualification-list{ + display: flex; + flex-wrap: wrap; + margin-top: 20rpx; + } + .qualification-item{ + width: 156rpx; + margin-right: 20rpx; + margin-bottom: 20rpx; + } + .qualification-item image{ + display: block; + width: 156rpx; + height: 104rpx; + border-radius: 8rpx; + background: #f5f5f5; + } + .qualification-item text{ + display: block; + color: #777; + line-height: 36rpx; + text-align: center; + font-size: 22rpx; + } + .detail-list{ + margin-top: 16rpx; + } + .detail-row{ + display: flex; + justify-content: space-between; + color: #777; + line-height: 44rpx; + } + .detail-row text:first-child{ + flex-shrink: 0; + margin-right: 24rpx; + color: #00231C; + } + .detail-row text:last-child{ + flex: 1; + text-align: right; + word-break: break-all; + } + .empty-text{ + color: #777; + line-height: 48rpx; + } .left{ - width: 80%; + flex: 1; + min-width: 0; } .right{ - width: 20%; + flex-shrink: 0; + width: 120rpx; height: 160rpx; + position: relative; } \ No newline at end of file diff --git a/package2/group/groupBuySingle.vue b/package2/group/groupBuySingle.vue index 1471067..3962afb 100644 --- a/package2/group/groupBuySingle.vue +++ b/package2/group/groupBuySingle.vue @@ -3,7 +3,7 @@ - @@ -573,8 +573,11 @@ - - 若拼团失败,将会为您自动退款 + + 若24小时内拼团失败,将会为您自动退款 + + + 若1小时内拼团失败,将会为您自动退款 { @@ -1983,6 +1986,7 @@ selectMoreBuy(item, index) { this.checkMoreBuyIndex = item.id this.moreBuyList[index].isChecked = !this.moreBuyList[index].isChecked; + let isHas = false let index1 = '' for (let i = 0; i < this.moreBuyList.length; i++) { @@ -2025,6 +2029,9 @@ this.selectedGroupRule.groupPriceAndMore = 0.01 } } + if(this.moreBuyList[index].isChecked == false){ + this.vModelValue = 0 + } }, sliceMsg2(val) { var name = '' @@ -2163,7 +2170,7 @@ let amount = this.getFaceToFaceGoodsAmount(); return this.tui.request('/mall/coupon/available', 'GET', { userId: userId, - applyScene: 1, + applyScene: this.isStoreGroupOrder ? 4 : 1, regionId: regionId, amount: amount, merchantId: this.shopItem.id || '0' @@ -2244,6 +2251,10 @@ box-sizing: border-box; } + .nav-bar--popup-open { + z-index: 90; + } + .radio-check { background: linear-gradient(90deg, #e3ff96, #a6ffea); width: 42rpx; @@ -3686,7 +3697,7 @@ display: flex; align-items: center; justify-content: center; - gap: 18rpx; + gap: 38rpx; line-height: normal; } diff --git a/package2/myCenter/couponList.vue b/package2/myCenter/couponList.vue index d244585..e681e4d 100644 --- a/package2/myCenter/couponList.vue +++ b/package2/myCenter/couponList.vue @@ -1,33 +1,55 @@ @@ -36,18 +58,30 @@ export default { data() { return { - menuButtonInfo: {} + menuButtonInfo: { + top: 0, + height: 32 + }, + regionName: '', + totalCount: 0, + totalPages: 1, + loadStatus: 'more', + searchForm: { + pageNum: 1, + pageSize: 10, + userId: '', + regionId: '' + }, + couponList: [] } }, onReachBottom() { - if (this.searchForm.pageNumber >= this.totalPages) return; - // this.status = 'loading'; - this.searchForm.pageNumber++; - this.getShopList(); - + if (this.loadStatus === 'loading' || this.searchForm.pageNum >= this.totalPages) return + this.searchForm.pageNum += 1 + this.getCouponList() }, onLoad(option) { - + this.initQuery() }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() @@ -55,9 +89,95 @@ methods: { back() { uni.navigateBack() + }, + initQuery() { + const area = uni.getStorageSync('area') + this.searchForm.userId = uni.getStorageSync('id') || '' + if (area) { + try { + const areaInfo = typeof area === 'string' ? JSON.parse(area) : area + this.searchForm.regionId = areaInfo.id || '' + this.regionName = areaInfo.title || areaInfo.name || '' + } catch (e) { + this.searchForm.regionId = '' + this.regionName = '' + } + } + if (!this.searchForm.userId) { + this.tui.toast('请先登录') + return + } + if (!this.searchForm.regionId) { + this.tui.toast('请先选择校区') + return + } + this.getCouponList() + }, + getCouponList() { + this.loadStatus = 'loading' + this.tui.request('/mall/coupon/userList', 'POST', this.searchForm, false, false).then((res) => { + if (res.code == 200) { + const result = res.result || {} + const records = Array.isArray(result.records) ? result.records : [] + if (this.searchForm.pageNum == 1) { + this.couponList = records + } else { + this.couponList = [...this.couponList, ...records] + } + this.totalCount = result.total || this.couponList.length + this.totalPages = result.pages || 1 + this.loadStatus = this.searchForm.pageNum >= this.totalPages ? 'nomore' : 'more' + } else { + this.loadStatus = 'nomore' + this.tui.toast(res.message) + } + }).catch(() => { + this.loadStatus = 'nomore' + this.tui.toast('优惠券加载失败') + }) + }, + formatAmount(value) { + const num = Number(value || 0) + if (Number.isNaN(num)) return '0' + return num % 1 === 0 ? String(num) : num.toFixed(2) + }, + thresholdText(value) { + const amount = Number(value || 0) + if (!amount) return '无门槛' + return '满' + this.formatAmount(amount) + '可用' + }, + sceneText(value) { + const sceneMap = { + 0: '通用', + 1: '外卖/买饭', + 2: '快递/跑腿', + 3: '二手交易', + 4: '团购' + } + return sceneMap[value] || '通用' + }, + issuerText(item) { + if (item.issuerType == 1) return '平台发放' + if (item.issuerType == 2) return '商家:' + (item.issuerId || '-') + return '发放方:' + (item.issuerId || '-') + }, + formatDate(value) { + if (!value) return '-' + const text = String(value) + const match = text.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?/) + if (match) { + return `${match[1]}-${match[2]}-${match[3]} ${match[4] || '00'}:${match[5] || '00'}` + } + const date = new Date(text) + if (Number.isNaN(date.getTime())) return text + const year = date.getFullYear() + const month = String(date.getMonth() + 1).padStart(2, '0') + const day = String(date.getDate()).padStart(2, '0') + const hour = String(date.getHours()).padStart(2, '0') + const minute = String(date.getMinutes()).padStart(2, '0') + return `${year}-${month}-${day} ${hour}:${minute}` } } - } @@ -65,60 +185,238 @@ page { width: 100%; min-height: 100%; - font-size: 24rpx; - background: #F5F8F5; + background: #f4f8f5; color: #00231C; + font-size: 24rpx; } - - .page1 { + + .coupon-page { width: 100%; min-height: 100vh; - font-size: 24rpx; - position: relative; - display: flex; - flex-direction: column; + padding-bottom: 40rpx; + box-sizing: border-box; } - - .title { - flex-shrink: 0; + + .title-wrap { background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat; background-size: 100%; width: 100%; - height: 400rpx; - padding-bottom: 20rpx; + height: 390rpx; + position: relative; } - - .title-sreach{ + + .title-search { width: 100%; - display: flex; - height: 200rpx; + height: 160rpx; position: relative; } - - .back-btn{ + + .back-btn { position: absolute; + left: 18rpx; + display: flex; + align-items: center; + justify-content: center; + z-index: 2; } - .title-name{ - padding-top: 110rpx; + + .title-name { font-size: 36rpx; font-weight: 700; - flex: 1; text-align: center; + color: #063d32; } + + .hero-copy { + padding: 20rpx 48rpx 0; + } + + .hero-title { + font-size: 48rpx; + font-weight: 800; + color: #063d32; + line-height: 1.3; + } + + .hero-sub { + margin-top: 14rpx; + font-size: 26rpx; + color: rgba(0, 35, 28, 0.62); + } + .content { + width: 92%; + margin: -48rpx auto 0; + position: relative; + z-index: 1; + } + + .summary-card { + width: 100%; + min-height: 112rpx; + background: #ffffff; + border-radius: 28rpx; + box-shadow: 0 18rpx 42rpx rgba(8, 115, 93, 0.08); + padding: 20rpx 28rpx; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 24rpx; + } + + .summary-label { + font-size: 22rpx; + color: rgba(0, 35, 28, 0.48); + } + + .summary-name { + margin-top: 4rpx; + font-size: 32rpx; + font-weight: 800; + color: #063d32; + } + + .summary-count { + padding: 12rpx 22rpx; + border-radius: 999rpx; + background: linear-gradient(90deg, #e3ff96, #a6ffea); + color: #063d32; + font-size: 24rpx; + font-weight: 700; + } + + .coupon-card { + width: 100%; + background: #fff; + border-radius: 24rpx; + margin-bottom: 18rpx; + overflow: hidden; + box-shadow: 0 12rpx 30rpx rgba(8, 115, 93, 0.06); + position: relative; + } + + .coupon-card::before, + .coupon-card::after { + content: ''; + position: absolute; + top: 106rpx; + width: 24rpx; + height: 24rpx; + border-radius: 50%; + background: #f4f8f5; + z-index: 2; + } + + .coupon-card::before { + left: -12rpx; + } + + .coupon-card::after { + right: -12rpx; + } + + .coupon-main { + display: flex; + min-height: 168rpx; + } + + .amount-box { + width: 214rpx; + background: linear-gradient(160deg, #08735d, #0fb894); + color: #fff; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 20rpx 14rpx; + box-sizing: border-box; + } + + .amount { + font-size: 54rpx; + font-weight: 900; + line-height: 1; + } + + .amount text { + font-size: 28rpx; + margin-right: 4rpx; + } + + .threshold { + margin-top: 10rpx; + font-size: 23rpx; + color: rgba(255, 255, 255, 0.86); + } + + .coupon-info { flex: 1; - width: 95%; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - position: absolute; - top: 200rpx; - left: 2.5%; - } - .box1 { + padding: 22rpx 24rpx 18rpx; + box-sizing: border-box; + min-width: 0; + } + + .coupon-title { + font-size: 30rpx; + font-weight: 800; + color: #063d32; + } + + .tag-row { + display: flex; + flex-wrap: wrap; + margin: 10rpx 0 8rpx; + } + + .tag-row text { + margin-right: 12rpx; + margin-bottom: 6rpx; + padding: 4rpx 12rpx; + border-radius: 999rpx; + background: rgba(8, 115, 93, 0.08); + color: #08735d; + font-size: 22rpx; + } + + .info-row { + font-size: 22rpx; + line-height: 1.55; + color: rgba(0, 35, 28, 0.62); + word-break: break-all; + } + + .empty-card { width: 100%; - margin: 0 auto 20rpx; background: #fff; - border-radius: 20rpx; - padding: 20rpx; + border-radius: 28rpx; + padding: 70rpx 30rpx; + box-sizing: border-box; + text-align: center; + box-shadow: 0 12rpx 30rpx rgba(8, 115, 93, 0.06); + } + + .empty-icon { + width: 96rpx; + height: 96rpx; + border-radius: 50%; + margin: 0 auto 24rpx; + background: linear-gradient(160deg, #e3ff96, #a6ffea); + color: #08735d; + line-height: 96rpx; + font-size: 40rpx; + font-weight: 800; + } + + .empty-title { + font-size: 32rpx; + font-weight: 800; + color: #063d32; + } + + .empty-sub { + margin-top: 12rpx; + font-size: 24rpx; + color: rgba(0, 35, 28, 0.5); } \ No newline at end of file diff --git a/package2/partTimeJob/partTimeJobCenter.vue b/package2/partTimeJob/partTimeJobCenter.vue index 7781709..704270f 100644 --- a/package2/partTimeJob/partTimeJobCenter.vue +++ b/package2/partTimeJob/partTimeJobCenter.vue @@ -171,16 +171,25 @@ } }, onShow() { - this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() - this.worker = uni.getStorageSync('worker') - this.getData() + this.refreshPage() }, onLoad(option) { }, methods: { + refreshPage() { + this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() + this.worker = uni.getStorageSync('worker') || {} + this.getData() + }, getData() { - this.tui.request("/mall/delivery/countOrderByStatusIndex", "POST", {workerId:uni.getStorageSync('worker').workerId,regionId:JSON.parse(uni.getStorageSync('area')).id}, false, true).then((res) => { + const worker = uni.getStorageSync('worker') || {} + this.daiquCount = 0 + this.daisongCount = 0 + this.shouhouCount = 0 + this.chapingCount = 0 + this.orderData = {} + this.tui.request("/mall/delivery/countOrderByStatusIndex", "POST", {workerId:worker.workerId,regionId:JSON.parse(uni.getStorageSync('area')).id}, false, true).then((res) => { if (res.code == 200) { if(res.result != null){ for(let i = 0;i - - - - - + + + + + + + + + ... - - ... - - - - 低价秒杀 - 团美味 趣露营 - 限时开抢 · 拼着更划算 - - - - 立即抢 + + + 低价秒杀 + 团美味 趣露营 + 限时开抢 · 拼着更划算 + + + + 立即抢 + - - - - - {{item.name}} + + + + {{item.name}} + + + + + + 爆款推荐 + + + + + 搜索 - - - - 爆款推荐 - - - - - 搜索 + + + 随机推荐 + 价格升序 + 价格降序 - - 随机推荐 - 价格升序 - 价格降序 - + @@ -149,6 +153,9 @@ computed: { currentList() { return this.seckillList + }, + headerSpacerHeight() { + return 'calc(' + this.menuButtonInfo.top + 'px + 474rpx)' } }, onLoad() { @@ -424,6 +431,23 @@ box-sizing: border-box; } + .fixed-header { + width: 100%; + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 20; + padding-bottom: 12rpx; + background: linear-gradient(180deg, #ff6a2a 0%, #fff1df 260rpx, #fff8ee 520rpx); + box-sizing: border-box; + } + + .header-spacer { + width: 100%; + flex-shrink: 0; + } + .hero { min-height: 372rpx; padding: 0 22rpx 24rpx; diff --git a/package2/shop/afterService.vue b/package2/shop/afterService.vue index bd5a19d..8fa9057 100644 --- a/package2/shop/afterService.vue +++ b/package2/shop/afterService.vue @@ -62,7 +62,7 @@ - {{item.mallOrder.otherOrder == 1 ? '快递/跑腿单' : '查看订单'}} + {{item.mallOrder.otherOrder == 1 ? '快递/跑腿单' : '查看商品'}} 拼团详情 diff --git a/package2/shop/merchantCenter.vue b/package2/shop/merchantCenter.vue index cce6464..6a15e9a 100644 --- a/package2/shop/merchantCenter.vue +++ b/package2/shop/merchantCenter.vue @@ -130,6 +130,22 @@ 营业额 + + + {{shopData.orderRevenueAndCount.afterSaleCount == undefined?0:shopData.orderRevenueAndCount.afterSaleCount}} + + + 售后笔数 + + + + + {{shopData.orderRevenueAndCount.afterSaleAmount == undefined?0:shopData.orderRevenueAndCount.afterSaleAmount}} + + + 售后金额 + + @@ -207,7 +223,10 @@ businessStatus:1, shop:{}, shopConfig:{}, - shopData:{}, + shopData:{ + orderStatusCount:[], + orderRevenueAndCount:{} + }, daixiaofei:0, daichucan:0, daiquhuo:0, @@ -215,19 +234,28 @@ } }, onShow() { - this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() - this.getBusinessStatus() - this.getData() + this.refreshPage() }, onLoad(option) { }, methods: { + refreshPage(){ + this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() + this.getBusinessStatus() + this.getData() + }, getData(){ this.refreshShopConfig() + this.daixiaofei = 0 + this.daichucan = 0 + this.daiquhuo = 0 + this.daisongda = 0 this.tui.request("/mall/order/countByShop/"+uni.getStorageSync('shopId'), "GET", {}, false, true).then((res) => { if (res.code == 200) { - this.shopData = res.result + this.shopData = res.result || {} + this.shopData.orderStatusCount = this.shopData.orderStatusCount || [] + this.shopData.orderRevenueAndCount = this.shopData.orderRevenueAndCount || {} for(let i=0;i + + + 退款/售后 + + + + 申请时间 + {{item.createTime | formatISOTime}} + + + + + + + + {{goods.productName}} + {{goods.specs | delNode}} + + X{{goods.quantity}} + ¥{{formatAmount(goods.price)}} + + + 餐盒费 + ¥{{formatAmount(goods.packageFee)}} + + + + + 原因 + {{item.reason != null ? item.reason : ''}} + + + 图片 + + + + + + 退款/售后类型 + {{getRefundTypeText(item)}} | {{getRefundReasonTypeText(item)}} + + + 退款/售后状态 + {{getRefundStatusText(item)}} + + + {{getAutoRefundTime(item.createTime)}} 之前未处理系统会自动退款 + + + 处理退款/售后时间 + {{item.successTime | formatISOTime}} + + + @@ -355,6 +415,105 @@ if (value === undefined || value === null || value === '') return '0'; return value; }, + toAmount(value) { + let num = Number(value); + return isNaN(num) ? 0 : num; + }, + getSettlementAmount(item) { + if (!item) return 0; + let price = this.toAmount(item.goodsAmount) + this.toAmount(item.packageFee); + if (item.status == 8 || this.hasMerchantFullRefund(item.mallRefundRecord)) { + return 0; + } + price -= this.getMerchantGoodsRefundAmount(item.mallRefundRecord); + return Math.max(0, Number(price.toFixed(2))); + }, + isRefundAgreed(item) { + return item && (item.status == 1 || item.status == 4); + }, + hasMerchantFullRefund(list) { + if (!Array.isArray(list)) return false; + for (let i = 0; i < list.length; i++) { + let item = list[i]; + if (this.isRefundAgreed(item) && item.refundType == 3 && (item.refundTypeStatus == 1 || item.refundTypeStatus == 3)) { + return true; + } + } + return false; + }, + getMerchantGoodsRefundAmount(list) { + if (!Array.isArray(list)) return 0; + let amount = 0; + for (let i = 0; i < list.length; i++) { + let item = list[i]; + if (this.isRefundAgreed(item) && item.refundType == 1) { + amount += this.getRefundGoodsAmount(item); + } + } + return Number(amount.toFixed(2)); + }, + getRefundGoodsAmount(item) { + if (!item || !Array.isArray(item.items) || item.items.length == 0) { + return this.toAmount(item && item.refundAmount); + } + let amount = 0; + for (let i = 0; i < item.items.length; i++) { + let goods = item.items[i]; + let quantity = this.toAmount(goods.quantity); + quantity = quantity > 0 ? quantity : 1; + amount += (this.toAmount(goods.price) + this.toAmount(goods.packageFee)) * quantity; + } + return Number(amount.toFixed(2)); + }, + getPictureList(pictures) { + if (pictures == null || pictures === '') return []; + if (Array.isArray(pictures)) { + return pictures.filter(item => item != null && item !== ''); + } + return String(pictures).split(',').map(item => item.trim()).filter(item => item !== ''); + }, + previewRefundImage(pictures, index) { + const urls = this.getPictureList(pictures); + if (urls.length === 0) return; + uni.previewImage({ + urls, + current: urls[index] + }); + }, + getRefundTypeText(item) { + if (!item) return ''; + if (item.refundType == 1) return '退商品'; + if (item.refundType == 2) return '退配送费'; + return '全额退款'; + }, + getRefundReasonTypeText(item) { + if (!item) return ''; + if (item.refundTypeStatus == 1) return '商家原因'; + if (item.refundTypeStatus == 2) return '配送员原因'; + if (item.refundTypeStatus == 3) { + return item.linkId && String(item.linkId).indexOf('W') != -1 ? '配送员原因' : '商家原因'; + } + return '平台退款'; + }, + getRefundStatusText(item) { + if (!item) return ''; + if (item.status == 0) return '处理退款中'; + if (item.status == 1) return '同意退款'; + if (item.status == 2) return '拒绝退款'; + if (item.status == 3) return '处理售后中'; + if (item.status == 4) return '同意售后'; + return '拒绝售后'; + }, + isRefundPending(item) { + return item && (item.status == 0 || item.status == 3); + }, + getAutoRefundTime(value) { + if (!value) return ''; + const date = new Date(value); + if (isNaN(date.getTime())) return ''; + date.setHours(date.getHours() + 1); + return this.$options.filters.formatISOTime(date); + }, getHeaderTimeLabel(item) { if (item && item.deliveryType == 1) return item.deliveryInfo && item.deliveryInfo.finishTime ? '送达时间' : '预计送达' if (item && item.payTime) return '支付时间' @@ -380,7 +539,7 @@ that.data = res.result //商家预计收入的计算 - let price = Number(that.data.goodsAmount || 0) + Number(that.data.packageFee || 0) + let price = that.getSettlementAmount(that.data) let shopTakeaway = uni.getStorageSync('shopTakeaway') || {} if(that.data.orderType == 1){ that.data.chouyong = (price/100 * Number(shopTakeaway.commissionRateOne || 0)).toFixed(2) @@ -572,6 +731,136 @@ font-size: 22rpx; line-height: 30rpx; } + .refund-title { + width: 100%; + height: 60rpx; + line-height: 60rpx; + font-size: 32rpx; + font-weight: 700; + } + .refund-card { + margin-top: 12rpx; + padding: 20rpx; + background: rgba(247, 248, 248, 0.8); + border-radius: 20rpx; + } + .refund-row { + display: flex; + height: 70rpx; + line-height: 70rpx; + } + .refund-label { + flex: 1; + color: #777; + font-weight: 700; + } + .refund-value { + color: #00231C; + font-weight: 700; + text-align: right; + } + .refund-amount { + color: red; + font-size: 30rpx; + } + .refund-goods-card { + display: flex; + padding: 18rpx; + margin: 12rpx 0; + background: #fff; + border-radius: 18rpx; + box-sizing: border-box; + } + .refund-goods-img { + width: 132rpx; + height: 132rpx; + flex-shrink: 0; + border-radius: 18rpx; + overflow: hidden; + background: #f0f5f3; + } + .refund-goods-img img { + width: 100%; + height: 100%; + border-radius: 18rpx; + } + .refund-goods-content { + flex: 1; + min-width: 0; + padding-left: 18rpx; + } + .refund-goods-name { + color: #00231C; + font-size: 28rpx; + font-weight: 700; + line-height: 38rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .refund-goods-spec { + margin-top: 8rpx; + color: #777; + font-size: 22rpx; + line-height: 32rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .refund-goods-bottom { + display: flex; + justify-content: space-between; + margin-top: 12rpx; + color: #00231C; + font-size: 24rpx; + font-weight: 700; + line-height: 34rpx; + } + .refund-info-row { + display: flex; + align-items: flex-start; + padding: 16rpx 0; + border-bottom: 1px solid #eee; + } + .refund-info-label { + width: 180rpx; + flex-shrink: 0; + color: #777; + font-weight: 700; + line-height: 38rpx; + } + .refund-info-value { + flex: 1; + min-width: 0; + color: #00231C; + font-weight: 700; + line-height: 38rpx; + text-align: right; + word-break: break-all; + } + .refund-image-list { + display: flex; + justify-content: flex-end; + flex-wrap: wrap; + gap: 12rpx; + } + .refund-image { + width: 160rpx; + height: 160rpx; + border-radius: 16rpx; + background: #f0f5f3; + } + .auto-refund-tip { + margin: 8rpx 0 12rpx; + padding: 16rpx 18rpx; + border-radius: 16rpx; + background: rgba(255, 244, 232, 0.9); + border: 1rpx solid rgba(255, 180, 118, 0.48); + color: #b4572d; + font-size: 24rpx; + font-weight: 700; + line-height: 34rpx; + } .group-content{ background: #fff; width: 300px;