This commit is contained in:
2026-09-29 15:17:13 +08:00
commit 69e6ed8c59
113 changed files with 36564 additions and 0 deletions
+942
View File
@@ -0,0 +1,942 @@
<template>
<view>
<view v-if="showPopup" class="share-popup-mask" @tap="close" @touchmove.stop.prevent></view>
<view v-if="showPopup" class="share-popup card" @tap.stop>
<view class="popup-head">
<view class="section-title">晒单信息</view>
<view class="close-btn" @tap="close">关闭</view>
</view>
<view class="form-row">
<view class="label">门店</view>
<view class="picker-input" @tap="openMerchantPicker">
<view class="picker-input-inner">
<text :class="form.merchantName ? 'picker-text' : 'picker-placeholder'">
{{ form.merchantName || '请选择门店' }}
</text>
<u-icon name="arrow-right" size="20" color="#9ca3af"/>
</view>
</view>
</view>
<view class="detail-title">商品明细</view>
<view class="detail-actions">
<view class="ghost-btn" @tap="addItem">新增商品</view>
</view>
<view v-if="form.list.length === 0" class="detail-empty">暂无明细</view>
<view v-else class="detail-list">
<view class="detail-item" v-for="(detail, idx) in form.list" :key="idx">
<view class="detail-head">
<view class="detail-index">第 {{ idx + 1 }} 项</view>
<view class="detail-remove" @tap="removeItem(idx)">删除</view>
</view>
<view class="form-row">
<view class="label">商品</view>
<view class="picker-input" @tap="openProductPicker(idx)">
<view class="picker-input-inner">
<text :class="detail.goodsName ? 'picker-text' : 'picker-placeholder'">
{{ detail.goodsName || '点击选择商品' }}
</text>
<u-icon name="arrow-right" size="20" color="#9ca3af"/>
</view>
</view>
</view>
<view class="form-row">
<view class="label">厂家</view>
<view class="form-value">{{ detail.makerAbb || '-' }}</view>
</view>
<view class="form-row">
<view class="label">规格</view>
<view class="form-value">{{ detail.spec || '-' }}</view>
</view>
<!-- <view class="form-row">-->
<!-- <view class="label">红包金额</view>-->
<!-- <view class="form-value">¥{{ detail.income || 0 }}</view>-->
<!-- </view>-->
<view class="form-row">
<view class="label">编码</view>
<view class="form-value">{{ detail.goodsCode || '-' }}</view>
</view>
<view class="form-row">
<view class="label">数量</view>
<input v-model="detail.num" class="input" type="number" placeholder="请输入数量"/>
</view>
</view>
</view>
<!-- <view class="form-row total-bonus-row">-->
<!-- <view class="label">总红包金额</view>-->
<!-- <view class="form-value total-bonus-value">¥{{ totalBonusDisplay }}</view>-->
<!-- </view>-->
<view class="detail-title">小票</view>
<view class="receipt-upload" @tap="chooseReceipt">
<template v-if="form.receiptLocalPath">
<image class="receipt-image" :src="form.receiptLocalPath" mode="aspectFill"/>
<view class="receipt-tip">
{{ receiptUploading ? '上传中...' : (form.receiptUrl ? '已上传,点击重新上传' : '点击重新上传') }}
</view>
</template>
<template v-else>
<u-icon name="camera" size="40" color="#9ca3af"/>
<view class="receipt-tip">{{ receiptUploading ? '上传中...' : '上传小票' }}</view>
</template>
</view>
<view class="detail-title">留言(可选)</view>
<view class="remark-wrap">
<textarea
v-model="form.remark"
class="textarea"
placeholder="请输入留言"
maxlength="200"
auto-height
/>
</view>
<view class="primary-btn submit" @tap="submit">提交</view>
</view>
<u-popup :show="showMerchantPicker" mode="bottom" round="24rpx" @close="closeMerchantPicker">
<view class="merchant-picker">
<view class="merchant-picker-head">
<view class="picker-action" @tap="closeMerchantPicker">取消</view>
<text class="picker-title">选择门店</text>
<view class="picker-action primary" @tap="confirmMerchantPicker">确定</view>
</view>
<view class="merchant-picker-search">
<input
v-model="merchantSearchKeyword"
class="merchant-search-input"
placeholder="搜索门店"
placeholder-class="merchant-search-placeholder"
/>
</view>
<view v-if="merchantLoading" class="merchant-picker-loading">
<u-loading-icon mode="circle"></u-loading-icon>
</view>
<picker-view
v-else
class="merchant-picker-view"
:value="merchantPickerValue"
:indicator-style="merchantIndicatorStyle"
@change="onMerchantPickerChange"
>
<picker-view-column>
<view v-for="(item, idx) in merchantFilteredOptions" :key="idx" class="merchant-picker-item">{{ item.text }}</view>
</picker-view-column>
</picker-view>
</view>
</u-popup>
<u-popup :show="showProductPicker" mode="bottom" round="24rpx" @close="closeProductPicker">
<view class="product-picker">
<view class="merchant-picker-head">
<view class="picker-action" @tap="closeProductPicker">取消</view>
<text class="picker-title">选择商品</text>
<view class="picker-action primary" @tap="closeProductPicker">完成</view>
</view>
<view class="merchant-picker-search">
<input
v-model="productKeyword"
class="merchant-search-input"
placeholder="搜索商品名称/编码/厂家"
placeholder-class="merchant-search-placeholder"
/>
</view>
<view v-if="productLoading" class="merchant-picker-loading">
<u-loading-icon mode="circle"></u-loading-icon>
</view>
<scroll-view v-else class="product-scroll" scroll-y>
<view v-if="filteredProducts.length === 0" class="detail-empty">暂无商品</view>
<view
v-for="(item, idx) in filteredProducts"
:key="idx"
class="product-option"
@tap="selectProduct(item)"
>
<view class="product-option-name">{{ item.goodsName || '-' }}</view>
<view class="product-option-meta">厂家:{{ item.makerAbb || '-' }}</view>
<view class="product-option-meta">规格:{{ item.spec || '-' }}</view>
<!-- <view class="product-option-meta">红包金额:¥{{ item.income || 0 }}</view>-->
<view class="product-option-meta">编码:{{ item.goodsCode || '-' }}</view>
</view>
</scroll-view>
</view>
</u-popup>
</view>
</template>
<script>
import dayjs from 'dayjs'
import {calcDistanceMeters, uploadImg} from "@/util";
import {merchantListReq} from "@/api/shop";
import {shareAddReq} from "@/api/share";
import {productListReq} from "@/api/product";
export default {
name: 'ShareCreatePopup',
props: {
lat: {
type: Number,
default: null
},
lng: {
type: Number,
default: null
},
currentProvince: {
type: String,
default: ''
},
currentCity: {
type: String,
default: ''
},
chain: {
type: String,
default: ''
}
},
data() {
return {
showPopup: false,
showMerchantPicker: false,
showProductPicker: false,
merchantLoading: false,
productLoading: false,
merchantList: [],
productList: [],
merchantSearchKeyword: '',
merchantPickerValue: [0],
productKeyword: '',
activeProductRowIndex: 0,
receiptUploading: false,
form: this.buildForm()
}
},
computed: {
merchantFilteredOptions() {
const list = Array.isArray(this.merchantList) ? this.merchantList : []
const keyword = (this.merchantSearchKeyword || '').trim()
const filtered = keyword ? list.filter(item => (item.text || '').includes(keyword)) : list
return filtered.length ? filtered : [{id: '', text: '无匹配门店'}]
},
merchantPickerIndex() {
const idx = this.merchantFilteredOptions.findIndex(item => item.id === this.form.merchantId)
return idx > -1 ? idx : 0
},
merchantIndicatorStyle() {
return 'height: 44px;'
},
filteredProducts() {
const list = Array.isArray(this.productList) ? this.productList : []
const keyword = (this.productKeyword || '').trim().toLowerCase()
if (!keyword) return list
return list.filter(item => {
const name = (item.goodsName || '').toLowerCase()
const maker = (item.makerAbb || '').toLowerCase()
const spec = (item.spec || '').toLowerCase()
const code = (item.goodsCode || '').toLowerCase()
return name.includes(keyword) || maker.includes(keyword) || spec.includes(keyword) || code.includes(keyword)
})
},
totalBonus() {
const list = Array.isArray(this.form.list) ? this.form.list : []
return list.reduce((sum, item) => {
const hasSelectedProduct = !!(item.goodsName || item.goodsCode)
if (!hasSelectedProduct) return sum
const num = Number(item.num)
const income = Number(item.income)
if (!Number.isFinite(num) || num <= 0) return sum
if (!Number.isFinite(income) || income <= 0) return sum
return sum + (income * num)
}, 0)
},
totalBonusDisplay() {
return this.totalBonus.toFixed(2)
}
},
watch: {
merchantSearchKeyword() {
this.merchantPickerValue = [0]
}
},
methods: {
buildForm() {
return {
merchantName: '',
merchantId: '',
province: '',
city: '',
lat: '',
lng: '',
remark: '',
receiptLocalPath: '',
receiptUrl: '',
list: [this.createEmptyItem()]
}
},
createEmptyItem() {
return {
goodsCode: '',
goodsName: '',
makerAbb: '',
spec: '',
income: '',
num: ''
}
},
normalizeMerchant(item) {
const id = item.id ?? item.merchantId ?? item.merchant_id
const text = item.name || item.merchantName || item.merchant_name || item.title || '未命名门店'
const lat = Number(item.lat ?? item.latitude ?? item.merchantLat ?? item.merchant_lat)
const lng = Number(item.lng ?? item.longitude ?? item.merchantLng ?? item.merchant_lng)
return {
id,
text,
lat: Number.isFinite(lat) ? lat : null,
lng: Number.isFinite(lng) ? lng : null,
province: item.province || item.province_str || '',
city: item.city || item.city_str || ''
}
},
findNearestMerchant(list) {
if (!Number.isFinite(this.lat) || !Number.isFinite(this.lng)) return null
let nearest = null
let minDistance = Infinity
list.forEach(item => {
if (!Number.isFinite(item.lat) || !Number.isFinite(item.lng)) return
const meters = calcDistanceMeters(this.lat, this.lng, item.lat, item.lng)
if (!Number.isFinite(meters)) return
if (meters < minDistance) {
minDistance = meters
nearest = item
}
})
return nearest
},
applyMerchant(merchant) {
if (!merchant) return
this.form.merchantName = merchant.text || ''
this.form.merchantId = merchant.id ?? ''
this.form.province = merchant.province || this.currentProvince || ''
this.form.city = merchant.city || this.currentCity || ''
this.form.lat = Number.isFinite(merchant.lat) ? merchant.lat : ''
this.form.lng = Number.isFinite(merchant.lng) ? merchant.lng : ''
},
normalizeProduct(item) {
const product = item && item.product ? item.product : {}
const code = item.goodsCode || item.code || item.productCode || item.batchCode || product.code || product.goodsCode || product.batchCode || ''
const name = item.goodsName || item.goods_name || item.title || item.name || product.title || product.goodsName || product.name || ''
const maker = item.makerAbb || item.maker || item.manufacturer || product.makerAbb || product.maker || product.manufacturer || ''
const spec = product.spec || item.spec || item.specification || ''
const incomeRaw = product.income !== undefined && product.income !== null ? product.income : (item.income || 0)
const income = Number(incomeRaw) || 0
return {
goodsCode: code,
goodsName: name,
makerAbb: maker,
spec,
income
}
},
uniqueProducts(list) {
const map = {}
list.forEach(item => {
const key = item.goodsCode || `${item.goodsName}_${item.spec}_${item.makerAbb}`
if (!key) return
if (!map[key]) {
map[key] = item
}
})
return Object.keys(map).map(key => map[key])
},
async getMerchantList() {
this.merchantLoading = true
try {
const params = {}
const chain = String(this.chain || this.form.chainName || '').trim()
if (chain) params.chain = chain
const {data} = await merchantListReq(params)
const list = Array.isArray(data)
? data
: (Array.isArray(data && data.records) ? data.records : (Array.isArray(data && data.list) ? data.list : []))
this.merchantList = list.map(item => this.normalizeMerchant(item)).filter(item => item.id !== undefined && item.id !== null)
} catch (error) {
this.merchantList = []
uni.showToast({
title: '门店列表获取失败',
icon: 'none'
})
} finally {
this.merchantLoading = false
}
},
async getProductsByMerchant() {
if (!this.form.merchantId) {
this.productList = []
return
}
this.productLoading = true
try {
const {data} = await productListReq({
merchantId: this.form.merchantId
})
const rawList = Array.isArray(data)
? data
: (Array.isArray(data && data.list)
? data.list
: (Array.isArray(data && data.records) ? data.records : []))
const normalized = rawList.map(item => this.normalizeProduct(item)).filter(item => !!item.goodsName)
this.productList = this.uniqueProducts(normalized)
} catch (error) {
this.productList = []
uni.showToast({
title: '商品数据获取失败',
icon: 'none'
})
} finally {
this.productLoading = false
}
},
async open() {
this.form = this.buildForm()
this.productKeyword = ''
this.merchantSearchKeyword = ''
this.merchantPickerValue = [0]
this.productList = []
this.showPopup = true
await this.getMerchantList()
if (!this.merchantList.length) {
return
}
const nearest = this.findNearestMerchant(this.merchantList)
const target = nearest || this.merchantList[0]
this.applyMerchant(target)
await this.getProductsByMerchant()
},
close() {
this.showPopup = false
this.showMerchantPicker = false
this.showProductPicker = false
},
openMerchantPicker() {
this.merchantPickerValue = [this.merchantPickerIndex]
this.showMerchantPicker = true
},
closeMerchantPicker() {
this.showMerchantPicker = false
},
onMerchantPickerChange(e) {
const value = e.detail && e.detail.value !== undefined ? e.detail.value : e.detail
const index = Array.isArray(value) ? value[0] : Number(value || 0)
this.merchantPickerValue = [index]
},
async confirmMerchantPicker() {
const index = this.merchantPickerValue[0] || 0
const options = this.merchantFilteredOptions
const selected = options[index]
if (!selected || selected.id === '' || selected.id === null || selected.id === undefined) {
return
}
this.applyMerchant(selected)
this.showMerchantPicker = false
this.form.list = [this.createEmptyItem()]
await this.getProductsByMerchant()
},
addItem() {
this.form.list.push(this.createEmptyItem())
},
removeItem(index) {
this.form.list.splice(index, 1)
if (!this.form.list.length) {
this.form.list.push(this.createEmptyItem())
}
},
async openProductPicker(index) {
if (!this.form.merchantId) {
uni.showToast({
title: '请先选择门店',
icon: 'none'
})
return
}
if (!this.productList.length) {
await this.getProductsByMerchant()
}
this.activeProductRowIndex = index
this.productKeyword = ''
this.showProductPicker = true
},
closeProductPicker() {
this.showProductPicker = false
},
selectProduct(item) {
const index = this.activeProductRowIndex
const row = this.form.list[index]
if (!row) return
this.$set(this.form.list, index, {
...row,
goodsCode: item.goodsCode || '',
goodsName: item.goodsName || '',
makerAbb: item.makerAbb || '',
spec: item.spec || '',
income: item.income || 0
})
this.showProductPicker = false
},
chooseReceipt() {
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
sizeType: ['original'],
success: async ({tempFilePaths}) => {
if (tempFilePaths && tempFilePaths[0]) {
const localPath = tempFilePaths[0]
this.form.receiptLocalPath = localPath
this.form.receiptUrl = ''
await this.uploadReceipt(localPath)
}
}
})
},
async uploadReceipt(localPath) {
if (!localPath) return ''
try {
this.receiptUploading = true
const uploadRes = await uploadImg(localPath)
const url = uploadRes && uploadRes.path ? uploadRes.path : ''
if (!url) {
throw new Error('upload failed')
}
this.form.receiptUrl = url
return url
} catch (error) {
this.form.receiptUrl = ''
uni.showToast({
title: '小票上传失败,请重试',
icon: 'none'
})
return ''
} finally {
this.receiptUploading = false
}
},
async ensureReceiptUrl() {
if (this.form.receiptUrl) return this.form.receiptUrl
const path = this.form.receiptLocalPath || ''
if (!path) return ''
if (/^https?:\/\//.test(path)) return path
return this.uploadReceipt(path)
},
validateBeforeSubmit() {
if (!this.form.merchantId) {
uni.showToast({
title: '请选择门店',
icon: 'none'
})
return null
}
const selectedRows = (this.form.list || [])
.map((item, index) => ({
...item,
_index: index
}))
.filter(item => item.goodsName || item.goodsCode)
if (!selectedRows.length) {
uni.showToast({
title: '请至少选择一个商品',
icon: 'none'
})
return null
}
for (let i = 0; i < selectedRows.length; i++) {
const current = selectedRows[i]
const rawNum = current.num === null || current.num === undefined ? '' : String(current.num).trim()
if (!rawNum) {
uni.showToast({
title: `请填写第${current._index + 1}项商品数量`,
icon: 'none'
})
return null
}
const num = Number(rawNum)
if (!Number.isFinite(num) || num <= 0 || num > 1000) {
uni.showToast({
title: `第${current._index + 1}项商品数量格式不正确`,
icon: 'none'
})
return null
}
}
if (!this.form.receiptLocalPath) {
uni.showToast({
title: '请上传小票',
icon: 'none'
})
return null
}
if (this.receiptUploading) {
uni.showToast({
title: '小票上传中,请稍后提交',
icon: 'none'
})
return null
}
return selectedRows
},
async submit() {
const selectedRows = this.validateBeforeSubmit()
if (!selectedRows) return
try {
uni.showLoading({
title: '提交中...'
})
const image = await this.ensureReceiptUrl()
if (!image) {
uni.hideLoading()
uni.showToast({
title: '小票上传失败',
icon: 'none'
})
return
}
const detailList = selectedRows.map(item => ({
goodsCode: item.goodsCode || '',
goodsName: item.goodsName || '',
num: Number(item.num) || 0,
spec: item.spec || '',
amount: '',
sourceCode: ''
}))
const payload = {
merchantName: this.form.merchantName,
merchantId: this.form.merchantId,
province: this.form.province,
city: this.form.city,
date: dayjs().format('YYYY-MM-DD'),
orderNo: '',
amount: '',
remark: this.form.remark || '',
lat: this.form.lat,
lng: this.form.lng,
image,
hasChange: true,
detailList
}
await shareAddReq(payload)
uni.hideLoading()
uni.showToast({
title: '提交成功',
icon: 'success'
})
this.close()
this.$emit('submitted')
} catch (error) {
uni.hideLoading()
uni.showToast({
title: '提交失败',
icon: 'none'
})
}
}
}
}
</script>
<style lang="scss" scoped>
.share-popup-mask {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.45);
z-index: 30;
}
.share-popup {
position: fixed;
left: 50%;
bottom: 40rpx;
transform: translateX(-50%);
width: 88%;
max-height: 70vh;
overflow: auto;
z-index: 40;
}
.popup-head {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12rpx;
}
.section-title {
font-size: 26rpx;
font-weight: 700;
color: #1f2937;
}
.close-btn {
color: #6b7280;
font-size: 24rpx;
}
.form-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12rpx 0;
border-bottom: 1rpx solid #edf1f7;
}
.label {
color: #111827;
font-size: 26rpx;
min-width: 140rpx;
}
.input {
flex: 1;
text-align: right;
font-size: 26rpx;
color: #111827;
}
.form-value {
flex: 1;
text-align: right;
font-size: 26rpx;
color: #111827;
word-break: break-all;
}
.total-bonus-row {
margin-top: 8rpx;
}
.total-bonus-value {
color: #ef4444;
font-weight: 700;
}
.picker-input {
flex: 1;
}
.picker-input-inner {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8rpx;
min-height: 40rpx;
}
.picker-text {
color: #111827;
font-size: 26rpx;
}
.picker-placeholder {
color: #9ca3af;
font-size: 26rpx;
}
.detail-title {
margin-top: 14rpx;
font-weight: 700;
color: #111827;
}
.detail-actions {
margin-top: 8rpx;
display: flex;
justify-content: flex-end;
}
.ghost-btn {
color: #22c3a1;
border: 1rpx solid #22c3a1;
padding: 6rpx 16rpx;
border-radius: 999rpx;
font-size: 24rpx;
}
.detail-empty {
color: #6b7280;
text-align: center;
padding: 14rpx 0;
}
.detail-list {
margin-top: 8rpx;
display: flex;
flex-direction: column;
gap: 12rpx;
}
.detail-item {
border: 1rpx dashed #dfe8f5;
border-radius: 12rpx;
padding: 12rpx;
}
.detail-head {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6rpx;
}
.detail-index {
color: #6b7280;
font-size: 24rpx;
}
.detail-remove {
color: #ff3b30;
font-size: 24rpx;
}
.receipt-upload {
margin-top: 10rpx;
border: 1rpx dashed #d1d5db;
border-radius: 12rpx;
min-height: 220rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8rpx;
background: #f9fafb;
}
.receipt-image {
width: 100%;
height: 220rpx;
border-radius: 12rpx;
}
.receipt-tip {
color: #6b7280;
font-size: 24rpx;
}
.remark-wrap {
margin-top: 10rpx;
border: 1rpx solid #edf1f7;
border-radius: 12rpx;
padding: 10rpx 12rpx;
}
.textarea {
width: 100%;
min-height: 90rpx;
font-size: 26rpx;
color: #111827;
}
.submit {
margin-top: 16rpx;
padding: 14rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
}
.merchant-picker,
.product-picker {
padding: 20rpx 24rpx 30rpx;
}
.merchant-picker-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12rpx;
}
.picker-action {
font-size: 26rpx;
color: #6b7280;
}
.picker-action.primary {
color: #2fc6a7;
font-weight: 700;
}
.picker-title {
font-size: 28rpx;
font-weight: 700;
color: #1f2937;
}
.merchant-picker-search {
margin: 6rpx 0 12rpx;
}
.merchant-search-input {
width: 100%;
background: #f3f4f6;
border-radius: 12rpx;
padding: 12rpx 16rpx;
font-size: 26rpx;
color: #1f2937;
}
.merchant-search-placeholder {
color: #9ca3af;
}
.merchant-picker-loading {
padding: 20rpx 0;
display: flex;
align-items: center;
justify-content: center;
}
.merchant-picker-view {
height: 360rpx;
}
.merchant-picker-item {
height: 44px;
line-height: 44px;
text-align: center;
font-size: 26rpx;
color: #1f2937;
}
.product-scroll {
max-height: 60vh;
}
.product-option {
padding: 16rpx 0;
border-bottom: 1rpx solid #edf1f7;
}
.product-option:last-child {
border-bottom: none;
}
.product-option-name {
font-size: 28rpx;
color: #111827;
font-weight: 700;
margin-bottom: 4rpx;
}
.product-option-meta {
font-size: 22rpx;
color: #4b5563;
margin-top: 2rpx;
}
</style>
File diff suppressed because it is too large Load Diff
+329
View File
@@ -0,0 +1,329 @@
<template>
<view class="share-detail-page">
<view class="page-hero">
<AppNavbar title="分享详情" show-back/>
</view>
<view class="card block">
<view class="section-title">基本信息</view>
<view v-if="loading" class="empty">加载中...</view>
<template v-else>
<view class="info-row">
<text class="info-label">门店</text>
<text class="info-value">{{ detailEntry.merchantName || detailEntry.merchant_name || '未命名门店' }}</text>
</view>
<!-- <view class="info-row">-->
<!-- <text class="info-label">红包</text>-->
<!-- <text class="info-value text-red">¥{{ formatPrice(detailEntry.income || 0) }}</text>-->
<!-- </view>-->
<view class="info-row">
<text class="info-label">提交人</text>
<text class="info-value">{{ detailEntry.owner || '-' }}</text>
</view>
<view class="info-row">
<text class="info-label">日期</text>
<text class="info-value">{{ detailEntry.date || detailEntry.activityDateText || '-' }}</text>
</view>
<view class="info-row">
<text class="info-label">留言</text>
<text class="info-value">{{ detailEntry.remark || '-' }}</text>
</view>
</template>
</view>
<view class="card block">
<view class="section-title">小票查看</view>
<view v-if="receiptImages.length" class="media-images">
<image
v-for="(receipt, receiptIdx) in receiptImages"
:key="`receipt-${receiptIdx}`"
class="media-image"
:src="receipt"
mode="aspectFill"
@tap="previewReceipt(receiptImages, receiptIdx)"
/>
</view>
<view v-else class="detail-empty">暂无小票</view>
</view>
<view class="card block">
<view class="section-title">商品明细</view>
<view v-if="detailList.length" class="detail-list">
<view class="detail-item" v-for="(detail, idx) in detailList" :key="idx">
<view class="detail-head">
<view class="detail-name">{{ detail.goodsName || detail.goods_name || detail.name || detail.title || '商品' }}</view>
</view>
<view class="detail-grid">
<view class="detail-kv">
<text class="detail-label">数量</text>
<text class="detail-value">x {{ detail.num || detail.qty || 0 }}</text>
</view>
<view class="detail-kv">
<text class="detail-label">厂家</text>
<text class="detail-value">{{ resolveManufacturer(detail) }}</text>
</view>
<view class="detail-kv">
<text class="detail-label">编号</text>
<text class="detail-value">{{ resolveCode(detail) }}</text>
</view>
<view class="detail-kv">
<text class="detail-label">规格</text>
<text class="detail-value">{{ resolveSpec(detail) }}</text>
</view>
<view class="detail-kv">
<text class="detail-label">金额</text>
<text class="detail-value text-red">{{ formatMoney(resolveAmount(detail)) }}</text>
</view>
<!-- <view class="detail-kv">-->
<!-- <text class="detail-label">额外加提</text>-->
<!-- <text class="detail-value text-red">{{ formatMoney(resolveExtraAmount(detail)) }}</text>-->
<!-- </view>-->
</view>
</view>
</view>
<view v-else class="detail-empty">暂无明细</view>
</view>
</view>
</template>
<script>
import AppNavbar from "@/components/AppNavbar.vue";
export default {
components: {AppNavbar},
data() {
return {
loading: true,
detailEntry: {}
}
},
computed: {
detailList() {
const list = this.detailEntry.detailList
return Array.isArray(list) ? list : []
},
receiptImages() {
const list = this.detailEntry.receiptImages
return Array.isArray(list) ? list : []
}
},
onLoad(options) {
this.loadDetail(options || {})
},
methods: {
loadDetail(options = {}) {
const rawKey = options.cacheKey || ''
const cacheKey = rawKey ? decodeURIComponent(rawKey) : ''
let payload = null
if (cacheKey) {
try {
payload = uni.getStorageSync(cacheKey)
uni.removeStorageSync(cacheKey)
} catch (error) {
}
}
if (!payload) {
this.loading = false
uni.showToast({
title: '详情数据不存在',
icon: 'none'
})
return
}
this.detailEntry = this.normalizeShareItem(payload)
console.log(this.detailEntry)
this.loading = false
},
normalizeShareItem(item) {
const detailListRaw = item.detailList || item.list || []
const detailList = this.parseJsonMaybe(detailListRaw)
return {
...item,
detailList: Array.isArray(detailList) ? detailList : [],
receiptImages: this.resolveReceiptImages(item)
}
},
parseJsonMaybe(value) {
if (value === null || value === undefined || value === '') return []
if (typeof value === 'string') {
try {
return JSON.parse(value)
} catch (error) {
return []
}
}
return value
},
resolveReceiptImages(item = {}) {
const candidates = [
item.image,
item.images,
item.receiptPhoto,
item.receiptPhotos,
item.receipt_photo,
item.receipt_photos,
item.receiptImages
]
const urls = []
candidates.forEach(value => {
this.appendReceiptValue(urls, value)
})
return Array.from(new Set(urls.filter(url => /^https?:\/\//.test(url) || /^\/\//.test(url))))
},
appendReceiptValue(target, value) {
if (value === null || value === undefined || value === '') return
if (Array.isArray(value)) {
value.forEach(item => this.appendReceiptValue(target, item))
return
}
if (typeof value === 'object') {
const url = value.url || value.path || value.src || value.image || value.img
if (url) this.appendReceiptValue(target, url)
return
}
const text = String(value).trim()
if (!text) return
if (text.startsWith('[') || text.startsWith('{')) {
try {
const parsed = JSON.parse(text)
this.appendReceiptValue(target, parsed)
return
} catch (error) {
}
}
if (text.includes(',')) {
text.split(',').forEach(part => this.appendReceiptValue(target, part))
return
}
target.push(text)
},
previewReceipt(list = [], current = 0) {
if (!Array.isArray(list) || list.length === 0) return
uni.previewImage({
urls: list,
current: list[current] || list[0]
})
},
resolveManufacturer(detail) {
if (!detail) return '-'
const product = detail.product || {}
const value = detail.makerAbb
|| detail.manufacturer
|| detail.vendor
|| detail.factory
|| detail.brand
|| product.makerAbb
|| product.manufacturer
|| product.vendor
|| product.factory
|| product.brand
return this.normalizeText(value)
},
resolveCode(detail) {
if (!detail) return '-'
const value = detail.goodsCode
|| detail.code
|| detail.productCode
|| detail.skuCode
|| detail.barcode
return this.normalizeText(value)
},
resolveSpec(detail) {
if (!detail) return '-'
const product = detail.product || {}
const value = detail.spec
|| detail.specification
|| detail.standard
|| product.spec
|| product.specification
|| product.standard
return this.normalizeText(value)
},
resolveAmount(detail) {
if (!detail) return ''
if (detail.income !== undefined && detail.income !== null && detail.income !== '') return detail.income
if (detail.product && detail.product.income !== undefined && detail.product.income !== null && detail.product.income !== '') {
return detail.product.income
}
return ''
},
resolveExtraAmount(detail) {
if (!detail) return ''
if (detail.extraIncome !== undefined && detail.extraIncome !== null && detail.extraIncome !== '') return detail.extraIncome
if (detail.product && detail.product.extraIncome !== undefined && detail.product.extraIncome !== null && detail.product.extraIncome !== '') {
return detail.product.extraIncome
}
return ''
},
normalizeText(value) {
if (value === 0) return '0'
if (value === null || value === undefined || value === '') return '-'
return String(value)
},
formatMoney(value) {
if (value === null || value === undefined || value === '') return '-'
const num = Number(value)
if (Number.isFinite(num)) return `¥${num.toFixed(2)}`
return String(value)
},
formatPrice(value) {
const num = Number(value || 0)
return num.toFixed(2)
}
}
}
</script>
<style lang="scss" scoped>
@import '../audit/components/record.scss';
.share-detail-page {
min-height: 100vh;
background: #f5f5f5;
}
.page-hero {
background: url('https://yaodongxiao.oss-cn-guangzhou.aliyuncs.com/20260126/462bfa04cf0eff8698884c38b9d17519.png') no-repeat
top center / 100% auto;
}
.block {
margin: 18rpx 20rpx 0;
}
.info-row {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 20rpx;
padding: 10rpx 0;
border-bottom: 1rpx solid #edf1f7;
}
.info-row:last-child {
border-bottom: none;
}
.info-label {
color: #6b7280;
font-size: 24rpx;
white-space: nowrap;
}
.info-value {
color: #1f2937;
font-size: 24rpx;
text-align: right;
word-break: break-all;
}
.text-red {
color: #ef4444;
}
.empty {
color: var(--text-sub);
text-align: center;
padding: 16rpx 0;
}
</style>
File diff suppressed because it is too large Load Diff
+727
View File
@@ -0,0 +1,727 @@
<template>
<view class="my-share-page">
<view class="page-hero">
<AppNavbar title="我的分享" show-back/>
<view class="intro-card">
<view class="card-title">
<view class="title-bar"></view>
<text>我的分享</text>
</view>
<text class="intro-text">查看已提交的晒单记录</text>
</view>
</view>
<view class="card block">
<view class="section-title">筛选查询</view>
<view class="filter-row">
<view class="filter-chip" @tap="openChainPicker">{{ chainLabel }}</view>
<view class="filter-chip" @tap="openDatePicker('start')">{{ filterForm.startDate || '开始日期' }}</view>
<view class="filter-chip" @tap="openDatePicker('end')">{{ filterForm.endDate || '结束日期' }}</view>
</view>
<view class="keyword-row">
<input
v-model="filterForm.merchantKeyword"
class="keyword-input"
type="text"
confirm-type="search"
placeholder="请输入门店关键词"
placeholder-class="keyword-placeholder"
@confirm="handleQuery"
/>
<view class="filter-btn primary" @tap="handleQuery">查询</view>
<view class="filter-btn" @tap="handleReset">重置</view>
</view>
</view>
<view class="block">
<view class="section-title">记录列表</view>
<view v-if="loading" class="empty">加载中...</view>
<view v-else-if="shares.length === 0" class="empty">暂无分享记录</view>
<view v-else-if="filteredShares.length === 0" class="empty">暂无匹配记录</view>
<view v-else>
<view class="record" v-for="item in filteredShares" :key="item._rowKey">
<view class="record-meta">门店:{{ item.merchantName || item.merchant_name || '未命名门店' }}</view>
<!-- <view class="record-meta" style="color: red">-->
<!-- 红包:¥{{ formatPrice(item.income || 0) }}-->
<!-- <text v-if="hasExtraIncome(item)">(含额外加提:{{ formatPrice(resolveExtraIncome(item)) }}元)</text>-->
<!-- </view>-->
<view class="record-meta">提交人:{{ item.owner || '-' }} · {{ item.date || item.activityDateText }}</view>
<view class="record-meta">留言:{{ item.remark || '-' }}</view>
<view class="record-toggle" @tap="openDetail(item)">
<text>点击查看详情</text>
<u-icon name="arrow-right" size="20" color="#2fc6a7"/>
</view>
<view v-if="item.statusValue !== 1" class="record-actions">
<view class="flex-1 mx-15">
<view
:class="['chip w-90p danger-chip', deletingId === item._rowKey ? 'disabled-chip' : '']"
@tap="handleVoid(item)"
>{{ deletingId === item._rowKey ? '作废中...' : '作废' }}</view>
</view>
</view>
</view>
</view>
</view>
<u-picker
:show="showChainPicker"
:columns="[chainOptions]"
:loading="chainLoading"
:defaultIndex="chainPickerIndex"
keyName="text"
@confirm="onChainConfirm"
@cancel="closeChainPicker"
@close="closeChainPicker"
/>
<u-datetime-picker
:show="showStartPicker"
:value="startPickerValue"
mode="date"
@confirm="e => onDateConfirm('start', e)"
@cancel="closeDatePicker('start')"
@close="closeDatePicker('start')"
/>
<u-datetime-picker
:show="showEndPicker"
:value="endPickerValue"
mode="date"
@confirm="e => onDateConfirm('end', e)"
@cancel="closeDatePicker('end')"
@close="closeDatePicker('end')"
/>
</view>
</template>
<script>
import dayjs from "dayjs";
import {shareDeleteReq, shareUserListReq} from "@/api/share";
import AppNavbar from "@/components/AppNavbar.vue";
import {merchantGroupByChainReq} from "@/api/shop";
export default {
components: {AppNavbar},
data() {
return {
shares: [],
loading: false,
chainLoading: false,
showChainPicker: false,
showStartPicker: false,
showEndPicker: false,
chainOptions: [{id: '', text: '全部连锁'}],
chainMerchantMap: {},
deletingId: '',
filterForm: {
chainId: '',
merchantKeyword: '',
startDate: '',
endDate: ''
}
}
},
computed: {
chainLabel() {
const selected = this.chainOptions.find(item => item.id === this.filterForm.chainId)
return (selected && selected.text) || '连锁筛选'
},
chainPickerIndex() {
const idx = this.chainOptions.findIndex(item => item.id === this.filterForm.chainId)
return [idx > -1 ? idx : 0]
},
startPickerValue() {
return this.filterForm.startDate ? dayjs(this.filterForm.startDate).valueOf() : Date.now()
},
endPickerValue() {
return this.filterForm.endDate ? dayjs(this.filterForm.endDate).valueOf() : Date.now()
},
filteredShares() {
const list = Array.isArray(this.shares) ? this.shares : []
const keyword = (this.filterForm.merchantKeyword || '').trim().toLowerCase()
const startTs = this.filterForm.startDate
? dayjs(`${this.filterForm.startDate} 00:00:00`).valueOf()
: null
const endTs = this.filterForm.endDate
? dayjs(`${this.filterForm.endDate} 23:59:59`).valueOf()
: null
return list.filter(item => {
if (this.filterForm.chainId && String(item.chainIdNormalized || '') !== String(this.filterForm.chainId)) {
return false
}
if (keyword) {
const merchantText = String(item.merchantName || item.merchant_name || '').toLowerCase()
if (!merchantText.includes(keyword)) return false
}
if ((startTs || endTs) && !Number.isFinite(item.activityTimestamp)) {
return false
}
if (startTs && item.activityTimestamp < startTs) {
return false
}
if (endTs && item.activityTimestamp > endTs) {
return false
}
return true
})
}
},
onShow() {
this.initPage()
},
methods: {
async initPage() {
await this.fetchChainList()
await this.fetchShareList()
},
async fetchChainList() {
this.chainLoading = true
try {
const {data} = await merchantGroupByChainReq({})
const list = this.unwrapList(data)
const chainList = list
.map((item, index) => this.normalizeMerchantChain(item, index))
.filter(item => item.id !== '' && item.id !== null && item.id !== undefined)
const chainOptions = [{id: '', text: '全部连锁'}]
const chainMerchantMap = {}
chainList.forEach(chain => {
chainOptions.push({
id: chain.id,
text: chain.text
})
const merchants = Array.isArray(chain.merchants) ? chain.merchants : []
merchants.forEach(merchant => {
const merchantId = merchant.id
if (merchantId === '' || merchantId === null || merchantId === undefined) return
chainMerchantMap[String(merchantId)] = {
chainId: chain.id,
chainName: chain.text
}
})
})
this.chainOptions = chainOptions
this.chainMerchantMap = chainMerchantMap
} catch (error) {
this.chainOptions = [{id: '', text: '全部连锁'}]
this.chainMerchantMap = {}
} finally {
this.chainLoading = false
}
},
buildQueryParams() {
const params = {}
const chainId = this.filterForm.chainId
const keyword = (this.filterForm.merchantKeyword || '').trim()
const startDate = this.filterForm.startDate
const endDate = this.filterForm.endDate
const chainIdText = String(chainId || '')
const isVirtualChain = chainIdText.startsWith('chain_')
if (chainId !== '' && chainId !== null && chainId !== undefined && !isVirtualChain) {
params.chainId = chainId
}
if (keyword) {
params.merchantName = keyword
params.keyword = keyword
}
if (startDate) {
params.createTimeStart = `${startDate} 00:00:00`
params.dateStart = startDate
}
if (endDate) {
params.createTimeEnd = `${endDate} 23:59:59`
params.dateEnd = endDate
}
return params
},
async fetchShareList() {
this.loading = true
try {
const {data} = await shareUserListReq(this.buildQueryParams())
const list = Array.isArray(data) ? data : (data && data.list ? data.list : [])
this.shares = list.map((item, index) => this.normalizeShareItem(item, index))
} catch (err) {
uni.showToast({
title: '加载失败',
icon: 'none'
})
console.log(err)
} finally {
this.loading = false
}
},
handleQuery() {
if (!this.validateDateRange()) return
this.fetchShareList()
},
async handleReset() {
this.filterForm = {
chainId: '',
merchantKeyword: '',
startDate: '',
endDate: ''
}
await this.fetchShareList()
},
openChainPicker() {
this.showChainPicker = true
},
closeChainPicker() {
this.showChainPicker = false
},
onChainConfirm(e) {
const selected = e.value && e.value.length ? e.value[0] : null
this.filterForm.chainId = selected ? (selected.id ?? '') : ''
this.showChainPicker = false
this.handleQuery()
},
openDatePicker(type) {
if (type === 'start') {
this.showStartPicker = true
return
}
this.showEndPicker = true
},
closeDatePicker(type) {
if (type === 'start') {
this.showStartPicker = false
return
}
this.showEndPicker = false
},
onDateConfirm(type, event) {
const raw = event && event.value !== undefined ? event.value : Date.now()
const value = dayjs(raw).format('YYYY-MM-DD')
const prevStartDate = this.filterForm.startDate
const prevEndDate = this.filterForm.endDate
if (type === 'start') {
this.filterForm.startDate = value
this.showStartPicker = false
} else {
this.filterForm.endDate = value
this.showEndPicker = false
}
if (!this.validateDateRange()) {
this.filterForm.startDate = prevStartDate
this.filterForm.endDate = prevEndDate
return
}
this.fetchShareList()
},
validateDateRange() {
const {startDate, endDate} = this.filterForm
if (!startDate || !endDate) return true
const startTs = dayjs(`${startDate} 00:00:00`).valueOf()
const endTs = dayjs(`${endDate} 23:59:59`).valueOf()
if (startTs <= endTs) return true
uni.showToast({
title: '开始日期不能晚于结束日期',
icon: 'none'
})
return false
},
normalizeShareItem(item, index) {
const detailListRaw = item.detailList || item.list || []
const detailList = this.parseJsonMaybe(detailListRaw)
const receiptImages = this.resolveReceiptImages(item)
const chainInfo = this.resolveShareChain(item)
const activityRaw = item.date || item.shareDate || item.createTime || item.createdAt || item.create_time || ''
const activityTimestamp = this.parseDateToTimestamp(activityRaw)
const statusValue = Number(item.status)
let statusLabel = '状态未知'
let statusClass = 'pending'
if (statusValue === 0) statusLabel = '待审核'
if (statusValue === 1) {
statusLabel = '已通过'
statusClass = 'success'
}
if (statusValue === 2) {
statusLabel = '已驳回'
statusClass = 'danger'
}
return {
...item,
_rowKey: this.buildRowKey(item, index),
detailList: Array.isArray(detailList) ? detailList : [],
receiptImages,
chainIdNormalized: chainInfo.chainId,
chainName: chainInfo.chainName,
activityDateText: activityRaw || '-',
activityTimestamp,
statusValue,
statusLabel,
owner: item.user.realName || item.user.nickname || '-',
statusClass
}
},
buildRowKey(item, index) {
const keySeed = item.id ?? item.shareId ?? item.orderNo ?? item.createTime ?? item.date
return keySeed !== undefined && keySeed !== null && String(keySeed).trim() !== ''
? `share_${keySeed}`
: `share_${index}`
},
buildDetailCacheKey(item = {}) {
const seed = item._rowKey || item.id || item.shareId || Date.now()
return `share_detail_${seed}`
},
openDetail(item) {
if (!item) return
const cacheKey = this.buildDetailCacheKey(item)
try {
uni.setStorageSync(cacheKey, item)
} catch (error) {
}
uni.navigateTo({
url: `/pages/share/detail?cacheKey=${encodeURIComponent(cacheKey)}`
})
},
async handleVoid(item) {
if (!item || Number(item.statusValue) === 1) return
if (this.deletingId) return
const targetId = item.id ?? item.shareId ?? ''
if (targetId === '' || targetId === null || targetId === undefined) {
uni.showToast({
title: '记录ID缺失,无法作废',
icon: 'none'
})
return
}
const confirmRes = await new Promise(resolve => {
uni.showModal({
title: '确认作废',
content: '作废后不可恢复,是否继续?',
confirmText: '确定',
cancelText: '取消',
success: resolve,
fail: () => resolve({confirm: false})
})
})
if (!confirmRes || !confirmRes.confirm) return
try {
this.deletingId = item._rowKey
const res = await shareDeleteReq(targetId)
if (res && res.code !== undefined && Number(res.code) !== 0) {
throw new Error('delete failed')
}
uni.showToast({
title: '作废成功',
icon: 'success'
})
await this.fetchShareList()
} catch (error) {
uni.showToast({
title: '作废失败',
icon: 'none'
})
} finally {
this.deletingId = ''
}
},
resolveShareChain(item) {
const rawChainId = item.chainId ?? item.chain_id ?? item.chainCode ?? item.chain_code ?? ''
const merchantId = item.merchantId ?? item.merchant_id ?? ''
const directName = item.chainName || item.chain_name || item.chain || item.chainAbb || ''
let chainId = rawChainId
let chainName = directName
const merchantChain = merchantId !== '' && merchantId !== null && merchantId !== undefined
? this.chainMerchantMap[String(merchantId)]
: null
if (!chainId && merchantChain) {
chainId = merchantChain.chainId
}
if (!chainName && merchantChain) {
chainName = merchantChain.chainName
}
if (!chainName && chainId !== '' && chainId !== null && chainId !== undefined) {
const selected = this.chainOptions.find(option => String(option.id) === String(chainId))
chainName = selected ? selected.text : ''
}
return {
chainId: chainId ?? '',
chainName: chainName || '-'
}
},
parseJsonMaybe(value) {
if (value === null || value === undefined || value === '') return []
if (typeof value === 'string') {
try {
return JSON.parse(value)
} catch (err) {
return []
}
}
return value
},
resolveReceiptImages(item = {}) {
const candidates = [
item.image,
item.images,
item.receiptPhoto,
item.receiptPhotos,
item.receipt_photo,
item.receipt_photos
]
const urls = []
candidates.forEach(value => {
this.appendReceiptValue(urls, value)
})
const unique = Array.from(new Set(urls.filter(url => /^https?:\/\//.test(url) || /^\/\//.test(url))))
return unique
},
appendReceiptValue(target, value) {
if (value === null || value === undefined || value === '') return
if (Array.isArray(value)) {
value.forEach(item => this.appendReceiptValue(target, item))
return
}
if (typeof value === 'object') {
const url = value.url || value.path || value.src || value.image || value.img
if (url) this.appendReceiptValue(target, url)
return
}
const text = String(value).trim()
if (!text) return
if (text.startsWith('[') || text.startsWith('{')) {
try {
const parsed = JSON.parse(text)
this.appendReceiptValue(target, parsed)
return
} catch (err) {
}
}
if (text.includes(',')) {
text.split(',').forEach(part => this.appendReceiptValue(target, part))
return
}
target.push(text)
},
parseDateToTimestamp(value) {
if (value === null || value === undefined || value === '') return NaN
const raw = String(value).trim()
if (!raw) return NaN
if (/^-?\d+(\.\d+)?$/.test(raw)) {
const num = Number(raw)
if (!Number.isFinite(num)) return NaN
const millis = Math.abs(num) < 1e12 ? num * 1000 : num
return millis
}
const parsed = dayjs(raw)
if (!parsed.isValid()) return NaN
return parsed.valueOf()
},
normalizeMerchantChain(item, index) {
const chainName = this.pickFirstText(item, ['chainName', 'chain', 'chainAbb', 'name', 'title']) || `连锁${index + 1}`
const rawChainId = item.chainId ?? item.chain_id ?? item.id ?? item.chainCode ?? item.chain_code ?? ''
const chainId = rawChainId === undefined || rawChainId === null || String(rawChainId).trim() === ''
? `chain_${index}`
: rawChainId
const childCandidates = ['children', 'merchantList', 'merchants', 'shopList', 'list', 'records']
let rawChildren = []
for (let i = 0; i < childCandidates.length; i++) {
const list = item[childCandidates[i]]
if (Array.isArray(list) && list.length) {
rawChildren = list
break
}
}
const merchants = rawChildren
.map(child => this.normalizeMerchant(child))
.filter(merchant => merchant.id !== undefined && merchant.id !== null && String(merchant.id).trim() !== '')
return {
id: chainId,
text: chainName,
merchants
}
},
normalizeMerchant(item) {
const id = item.id ?? item.merchantId ?? item.merchant_id
const text = item.name || item.merchantName || item.merchant_name || item.title || '未命名门店'
return {
id,
text
}
},
pickFirstText(source, keys = []) {
if (!source || typeof source !== 'object') return ''
for (let i = 0; i < keys.length; i++) {
const value = source[keys[i]]
if (value !== undefined && value !== null && String(value).trim()) {
return String(value).trim()
}
}
return ''
},
unwrapList(data) {
if (Array.isArray(data)) return data
if (!data || typeof data !== 'object') return []
const keys = ['list', 'records', 'rows', 'items', 'data', 'result', 'chainList']
for (let i = 0; i < keys.length; i++) {
const value = data[keys[i]]
if (Array.isArray(value)) return value
if (value && typeof value === 'object') {
const nested = this.unwrapList(value)
if (nested.length) return nested
}
}
return [data]
},
formatPrice(value) {
const num = Number(value || 0)
return num.toFixed(2)
},
resolveExtraIncome(source = {}) {
const candidates = [
source.extraIncome,
source.extra_income,
source.extraBonus,
source.extra_bonus,
source.otherIncome,
source.other_income
]
for (let i = 0; i < candidates.length; i++) {
const raw = candidates[i]
if (raw === '' || raw === null || raw === undefined) continue
const num = Number(raw)
if (Number.isFinite(num)) return num
}
return 0
},
hasExtraIncome(source = {}) {
return this.resolveExtraIncome(source) !== 0
}
}
}
</script>
<style lang="scss" scoped>
@import '../audit/components/record.scss';
.my-share-page {
min-height: 100vh;
//padding: 0 20rpx 40rpx;
background: #f5f5f5;
}
.page-hero {
//padding: 30rpx 6rpx 18rpx;
background: url('https://yaodongxiao.oss-cn-guangzhou.aliyuncs.com/20260126/462bfa04cf0eff8698884c38b9d17519.png') no-repeat
top center / 100% auto;
}
.page-navbar {
padding: 0 6rpx;
}
.intro-card {
margin: 18rpx 20rpx 0;
padding: 20rpx 18rpx;
border-radius: 20rpx;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.08);
}
.card-title {
display: flex;
align-items: center;
gap: 12rpx;
font-size: 28rpx;
font-weight: 700;
color: #1f2937;
}
.title-bar {
width: 6rpx;
height: 30rpx;
border-radius: 999rpx;
background: #2fc6a7;
}
.intro-text {
margin-top: 12rpx;
font-size: 26rpx;
color: #6b7280;
line-height: 1.6;
}
.block {
margin: 18rpx 20rpx 0;
}
.filter-row {
margin-top: 14rpx;
display: flex;
flex-wrap: wrap;
gap: 12rpx;
}
.filter-chip {
padding: 8rpx 18rpx;
border-radius: 999rpx;
border: 1rpx solid #2fc6a7;
color: #2fc6a7;
font-size: 22rpx;
background: #f3fffb;
}
.keyword-row {
margin-top: 14rpx;
display: flex;
align-items: center;
gap: 10rpx;
}
.keyword-input {
flex: 1;
height: 64rpx;
border-radius: 14rpx;
border: 1rpx solid #d1d5db;
background: #ffffff;
padding: 0 16rpx;
font-size: 24rpx;
color: #374151;
}
.keyword-placeholder {
color: #9ca3af;
}
.filter-btn {
min-width: 96rpx;
height: 64rpx;
padding: 0 20rpx;
border-radius: 14rpx;
border: 1rpx solid #d1d5db;
color: #6b7280;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
background: #ffffff;
}
.filter-btn.primary {
border-color: #2fc6a7;
background: #2fc6a7;
color: #ffffff;
}
.record-toggle {
margin-top: 8rpx;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 4rpx;
font-size: 24rpx;
color: #2fc6a7;
}
.disabled-chip {
color: #9ca3af;
border-color: #e5e7eb;
background: #f3f4f6;
opacity: 0.8;
}
.empty {
color: var(--text-sub);
text-align: center;
padding: 16rpx 0;
}
</style>