import _easycom_u_icon from '@/components/u-icon/u-icon.vue' import { ref } from 'vue'; // --- 数据定义 --- type BillItem = { __$originalPosition?: UTSSourceMapPosition<"BillItem", "pages/index/account.uvue", 195, 7>; orderId : string; projectName : string; amount : number; splitType : string; splitDetail : string; recordTime : string; }; // ✅ 修复点 2: 初始化时不写泛型 ,让 TS 自动推断 // 或者写成: const bills = ref([]); 然后单独 push,但直接推断最方便 const __sfc__ = defineComponent({ __name: 'account', setup(__props) { const __ins = getCurrentInstance()!; const _ctx = __ins.proxy as InstanceType; const _cache = __ins.renderCache; const totalAsset = ref('1978.2'); const cumulativeIncome = ref('1889'); const frozenIncome = ref('1000'); const availableIncome = ref('889'); const taxiFee = ref('89.2'); const frozenTaxi = ref('50'); const availableTaxi = ref('49.2'); // ✅ 修复点 1: 定义类型 (可以用 interface 或 type) const bills = ref([ { orderId: '202506091311123009874638', projectName: '中式推拿', amount: 170.00, splitType: '首单分成', splitDetail: '基本套餐车费收入 x90%=20\n项目套餐收入 x50%=150', recordTime: '2025-06-09 13:58' }, { orderId: '202506091311123009874638', projectName: '中式推拿', amount: 150.00, splitType: '加钟分成', splitDetail: '项目套餐收入 x71%+(70%+等级v1)=150', recordTime: '2025-06-09 13:58' }, { orderId: '202506091311123009874638', projectName: '中式推拿订单退款', amount: -150.00, splitType: '首单分成', splitDetail: '基本套餐车费收入 x90%=20\n项目套餐收入 x50%=150', recordTime: '2025-06-09 13:58' }, { orderId: '', projectName: '打车费转出', amount: -50.00, splitType: '分成', splitDetail: '打车费转出刘大锤账户:45.00元\n费率:0.1 手续费:5.00元', recordTime: '2025-06-09 13:58' } ] as BillItem[]); // 如果自动推断不准,可以在末尾加 'as BillItem[]' 进行断言 // --- 方法定义 --- const refreshData = () => { uni.showLoading({ title: '刷新中...' }); setTimeout(() => { uni.hideLoading(); uni.showToast({ title: '刷新成功', icon: 'success' }); totalAsset.value = (parseFloat(totalAsset.value) + 0.1).toFixed(1); }, 800); }; const handleWithdraw = (type : string) => { const amount = type === 'income' ? availableIncome.value : '0'; uni.showModal({ title: '提现确认', content: `确定要提现 ${amount} 元吗?`, success: (res) => { if (res.confirm) { uni.showToast({ title: '提现申请已提交', icon: 'success' }); } } }); }; const handleTransfer = (type : string) => { uni.showModal({ title: '转出确认', content: '确定要将打车费转出到其他账户吗?', success: (res) => { if (res.confirm) { uni.showToast({ title: '转出成功', icon: 'success' }); } } }); }; const viewWithdrawRecords = () => { uni.showToast({ title: '查看提现记录', icon: 'none' }); }; const viewAllBills = () => { uni.showToast({ title: '查看全部账单', icon: 'none' }); }; return (): any | null => { const _component_u_icon = resolveEasyComponent("u-icon",_easycom_u_icon) return _cE("view", _uM({ class: "page-container" }), [ _cE("view", _uM({ class: "asset-card" }), [ _cE("view", _uM({ class: "total-asset-section row-between" }), [ _cE("text", _uM({ class: "label" }), " 我的资产(元) "), _cE("view", _uM({ class: "amount-row row-start" }), [ _cE("text", _uM({ class: "amount" }), _tD(totalAsset.value), 1 /* TEXT */), _cV(_component_u_icon, _uM({ type: "eye", size: "20", color: "#333" })) ]), _cE("view", _uM({ class: "refresh-btn row-center", onClick: refreshData }), [ _cV(_component_u_icon, _uM({ type: "refresh", size: "18", color: "#333" })), _cE("text", null, " 刷新 ") ]) ]), _cE("view", _uM({ class: "income-section row-start" }), [ _cE("view", _uM({ class: "income-item column" }), [ _cE("view", _uM({ class: "income-header row-start" }), [ _cE("text", _uM({ class: "income-label" }), " 累计收益(元) "), _cV(_component_u_icon, _uM({ type: "help", size: "16", color: "#999" })) ]), _cE("view", _uM({ class: "income-main row-between" }), [ _cE("text", _uM({ class: "income-value" }), _tD(cumulativeIncome.value), 1 /* TEXT */), _cE("view", _uM({ class: "withdraw-btn", onClick: () => {handleWithdraw('income')} }), " 提现 ", 8 /* PROPS */, ["onClick"]) ]), _cE("view", _uM({ class: "income-detail row-start" }), [ _cE("view", _uM({ class: "detail-item column-center" }), [ _cE("text", _uM({ class: "detail-label" }), " 冻结(元) "), _cE("text", _uM({ class: "detail-value" }), _tD(frozenIncome.value), 1 /* TEXT */) ]), _cE("view", _uM({ class: "divider" })), _cE("view", _uM({ class: "detail-item column-center" }), [ _cE("text", _uM({ class: "detail-label" }), " 可提现(元) "), _cE("text", _uM({ class: "detail-value highlight" }), _tD(availableIncome.value), 1 /* TEXT */) ]) ]) ]), _cE("view", _uM({ class: "income-item column" }), [ _cE("view", _uM({ class: "income-header row-start" }), [ _cE("text", _uM({ class: "income-label" }), " 打车费(元) "), _cV(_component_u_icon, _uM({ type: "help", size: "16", color: "#999" })) ]), _cE("view", _uM({ class: "income-main row-between" }), [ _cE("text", _uM({ class: "income-value" }), _tD(taxiFee.value), 1 /* TEXT */), _cE("view", _uM({ class: "transfer-btn", onClick: () => {handleTransfer('taxi')} }), " 转出 ", 8 /* PROPS */, ["onClick"]) ]), _cE("view", _uM({ class: "income-detail row-start" }), [ _cE("view", _uM({ class: "detail-item column-center" }), [ _cE("text", _uM({ class: "detail-label" }), " 冻结(元) "), _cE("text", _uM({ class: "detail-value" }), _tD(frozenTaxi.value), 1 /* TEXT */) ]), _cE("view", _uM({ class: "divider" })), _cE("view", _uM({ class: "detail-item column-center" }), [ _cE("text", _uM({ class: "detail-label" }), " 可使用(元) "), _cE("text", _uM({ class: "detail-value highlight" }), _tD(availableTaxi.value), 1 /* TEXT */) ]) ]) ]) ]), _cE("view", _uM({ class: "record-entry row-between", onClick: viewWithdrawRecords }), [ _cE("text", null, " 提现记录 "), _cV(_component_u_icon, _uM({ type: "arrowright", size: "16", color: "#999" })) ]) ]), _cE("view", _uM({ class: "bill-header row-between" }), [ _cE("text", _uM({ class: "bill-title" }), " 本月账单 "), _cE("text", _uM({ class: "view-all", onClick: viewAllBills }), " 查看全部 ") ]), _cE("view", _uM({ class: "bill-list column" }), [ _cE(Fragment, null, RenderHelpers.renderList(bills.value, (bill, idx, __index, _cached): any => { return _cE("view", _uM({ key: idx, class: "bill-card column" }), [ _cE("view", _uM({ class: "order-id-row row-between" }), [ _cE("text", _uM({ class: "order-id" }), " 订单号:" + _tD(bill.orderId), 1 /* TEXT */), _cV(_component_u_icon, _uM({ type: "arrowright", size: "16", color: "#999" })) ]), _cE("view", _uM({ class: "project-amount-row row-between" }), [ _cE("text", _uM({ class: "project-name" }), _tD(bill.projectName), 1 /* TEXT */), _cE("text", _uM({ class: _nC(['amount', bill.amount > 0 ? 'positive' : 'negative']) }), _tD(bill.amount > 0 ? '+' : '') + _tD(Math.abs(bill.amount).toFixed(2)), 3 /* TEXT, CLASS */) ]), _cE("view", _uM({ class: "split-info column" }), [ _cE("text", _uM({ class: "split-type" }), _tD(bill.splitType), 1 /* TEXT */), _cE("text", _uM({ class: "split-detail" }), _tD(bill.splitDetail), 1 /* TEXT */) ]), _cE("view", _uM({ class: "time-row row-between" }), [ _cE("text", _uM({ class: "time-label" }), " 记录时间 "), _cE("text", _uM({ class: "time-value" }), _tD(bill.recordTime), 1 /* TEXT */) ]) ]) }), 128 /* KEYED_FRAGMENT */) ]) ]) } } }) export default __sfc__ const GenPagesIndexAccountStyles = [_uM([["row-between", _pS(_uM([["flexDirection", "row"], ["justifyContent", "space-between"], ["alignItems", "center"]]))], ["row-start", _pS(_uM([["flexDirection", "row"], ["alignItems", "center"]]))], ["row-center", _pS(_uM([["flexDirection", "row"], ["justifyContent", "center"], ["alignItems", "center"]]))], ["column", _pS(_uM([["flexDirection", "column"]]))], ["column-center", _pS(_uM([["flexDirection", "column"], ["justifyContent", "center"], ["alignItems", "center"]]))], ["page-container", _pS(_uM([["backgroundColor", "#f5f6f8"], ["paddingBottom", "40rpx"]]))], ["asset-card", _pS(_uM([["backgroundImage", "linear-gradient(180deg, #fff9e6 0%, #ffeaa7 100%)"], ["backgroundColor", "rgba(0,0,0,0)"], ["marginTop", "20rpx"], ["marginRight", "20rpx"], ["marginBottom", "20rpx"], ["marginLeft", "20rpx"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["paddingTop", "30rpx"], ["paddingRight", "30rpx"], ["paddingBottom", "30rpx"], ["paddingLeft", "30rpx"], ["boxShadow", "0 4rpx 12rpx rgba(0, 0, 0, 0.08)"]]))], ["total-asset-section", _pS(_uM([["marginBottom", "30rpx"]]))], ["label", _pS(_uM([["fontSize", "26rpx"], ["color", "#666666"]]))], ["amount", _uM([["", _uM([["fontSize", "48rpx"], ["fontWeight", "bold"], ["color", "#333333"]])], [".positive", _uM([["color", "#ff4d4f"], ["fontSize", "32rpx"], ["fontWeight", "bold"]])], [".negative", _uM([["color", "#333333"], ["fontSize", "32rpx"], ["fontWeight", "bold"]])]])], ["refresh-btn", _pS(_uM([["paddingTop", "10rpx"], ["paddingRight", "20rpx"], ["paddingBottom", "10rpx"], ["paddingLeft", "20rpx"], ["backgroundImage", "none"], ["backgroundColor", "#ffffff"], ["borderTopLeftRadius", "30rpx"], ["borderTopRightRadius", "30rpx"], ["borderBottomRightRadius", "30rpx"], ["borderBottomLeftRadius", "30rpx"], ["borderTopWidth", "1rpx"], ["borderRightWidth", "1rpx"], ["borderBottomWidth", "1rpx"], ["borderLeftWidth", "1rpx"], ["borderTopStyle", "solid"], ["borderRightStyle", "solid"], ["borderBottomStyle", "solid"], ["borderLeftStyle", "solid"], ["borderTopColor", "#dddddd"], ["borderRightColor", "#dddddd"], ["borderBottomColor", "#dddddd"], ["borderLeftColor", "#dddddd"], ["fontSize", "24rpx"], ["color", "#333333"]]))], ["income-section", _pS(_uM([["marginBottom", "20rpx"]]))], ["income-item", _pS(_uM([["flexGrow", 1], ["flexShrink", 1], ["flexBasis", "0%"]]))], ["income-label", _pS(_uM([["fontSize", "24rpx"], ["color", "#666666"]]))], ["income-value", _pS(_uM([["fontSize", "40rpx"], ["fontWeight", "bold"], ["color", "#333333"]]))], ["withdraw-btn", _pS(_uM([["fontSize", "24rpx"], ["paddingTop", "8rpx"], ["paddingRight", "20rpx"], ["paddingBottom", "8rpx"], ["paddingLeft", "20rpx"], ["borderTopLeftRadius", "20rpx"], ["borderTopRightRadius", "20rpx"], ["borderBottomRightRadius", "20rpx"], ["borderBottomLeftRadius", "20rpx"], ["backgroundImage", "none"], ["backgroundColor", "#ffffff"], ["borderTopWidth", "1rpx"], ["borderRightWidth", "1rpx"], ["borderBottomWidth", "1rpx"], ["borderLeftWidth", "1rpx"], ["borderTopStyle", "solid"], ["borderRightStyle", "solid"], ["borderBottomStyle", "solid"], ["borderLeftStyle", "solid"], ["borderTopColor", "#ff9900"], ["borderRightColor", "#ff9900"], ["borderBottomColor", "#ff9900"], ["borderLeftColor", "#ff9900"], ["color", "#ff9900"]]))], ["transfer-btn", _pS(_uM([["fontSize", "24rpx"], ["paddingTop", "8rpx"], ["paddingRight", "20rpx"], ["paddingBottom", "8rpx"], ["paddingLeft", "20rpx"], ["borderTopLeftRadius", "20rpx"], ["borderTopRightRadius", "20rpx"], ["borderBottomRightRadius", "20rpx"], ["borderBottomLeftRadius", "20rpx"], ["backgroundImage", "none"], ["backgroundColor", "#ffffff"], ["borderTopWidth", "1rpx"], ["borderRightWidth", "1rpx"], ["borderBottomWidth", "1rpx"], ["borderLeftWidth", "1rpx"], ["borderTopStyle", "solid"], ["borderRightStyle", "solid"], ["borderBottomStyle", "solid"], ["borderLeftStyle", "solid"], ["borderTopColor", "#52c41a"], ["borderRightColor", "#52c41a"], ["borderBottomColor", "#52c41a"], ["borderLeftColor", "#52c41a"], ["color", "#52c41a"]]))], ["income-detail", _pS(_uM([["backgroundImage", "none"], ["backgroundColor", "rgba(255,255,255,0.6)"], ["borderTopLeftRadius", "12rpx"], ["borderTopRightRadius", "12rpx"], ["borderBottomRightRadius", "12rpx"], ["borderBottomLeftRadius", "12rpx"], ["paddingTop", "15rpx"], ["paddingRight", "15rpx"], ["paddingBottom", "15rpx"], ["paddingLeft", "15rpx"]]))], ["detail-item", _pS(_uM([["flexGrow", 1], ["flexShrink", 1], ["flexBasis", "0%"]]))], ["detail-label", _pS(_uM([["fontSize", "22rpx"], ["color", "#999999"]]))], ["detail-value", _uM([["", _uM([["fontSize", "28rpx"], ["fontWeight", "bold"], ["color", "#333333"]])], [".highlight", _uM([["color", "#ff9900"]])]])], ["divider", _pS(_uM([["width", "1rpx"], ["backgroundImage", "none"], ["backgroundColor", "#dddddd"], ["marginTop", 0], ["marginRight", "10rpx"], ["marginBottom", 0], ["marginLeft", "10rpx"]]))], ["record-entry", _pS(_uM([["paddingTop", "20rpx"], ["paddingRight", 0], ["paddingBottom", "20rpx"], ["paddingLeft", 0], ["borderTopWidth", "1rpx"], ["borderTopStyle", "solid"], ["borderTopColor", "rgba(0,0,0,0.05)"], ["fontSize", "28rpx"], ["color", "#333333"]]))], ["bill-header", _pS(_uM([["paddingTop", "20rpx"], ["paddingRight", "30rpx"], ["paddingBottom", "20rpx"], ["paddingLeft", "30rpx"], ["marginTop", "20rpx"]]))], ["bill-title", _pS(_uM([["fontSize", "32rpx"], ["fontWeight", "bold"], ["color", "#333333"]]))], ["view-all", _pS(_uM([["fontSize", "26rpx"], ["color", "#666666"]]))], ["bill-list", _pS(_uM([["paddingTop", 0], ["paddingRight", "20rpx"], ["paddingBottom", 0], ["paddingLeft", "20rpx"]]))], ["bill-card", _pS(_uM([["backgroundImage", "none"], ["backgroundColor", "#ffffff"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["paddingTop", "30rpx"], ["paddingRight", "30rpx"], ["paddingBottom", "30rpx"], ["paddingLeft", "30rpx"], ["boxShadow", "0 2rpx 8rpx rgba(0, 0, 0, 0.04)"]]))], ["order-id-row", _pS(_uM([["fontSize", "26rpx"], ["color", "#666666"]]))], ["project-name", _pS(_uM([["fontSize", "30rpx"], ["fontWeight", "bold"], ["color", "#333333"]]))], ["split-info", _pS(_uM([["fontSize", "24rpx"], ["color", "#999999"], ["lineHeight", 1.4]]))], ["split-type", _pS(_uM([["fontWeight", "400"], ["color", "#666666"]]))], ["time-row", _pS(_uM([["fontSize", "24rpx"], ["color", "#999999"]]))]])]