account.uvue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. import _easycom_u_icon from '@/components/u-icon/u-icon.vue';
  2. import { ref } from 'vue';
  3. // --- 数据定义 ---
  4. type BillItem = {
  5. __$originalPosition?: UTSSourceMapPosition<"BillItem", "pages/index/account.uvue", 195, 7>;
  6. orderId: string;
  7. projectName: string;
  8. amount: number;
  9. splitType: string;
  10. splitDetail: string;
  11. recordTime: string;
  12. };
  13. // ✅ 修复点 2: 初始化时不写泛型 <BillItem[]>,让 TS 自动推断
  14. // 或者写成: const bills = ref<BillItem[]>([]); 然后单独 push,但直接推断最方便
  15. const __sfc__ = defineComponent({
  16. __name: 'account',
  17. setup(__props) {
  18. const __ins = getCurrentInstance()!;
  19. const _ctx = __ins.proxy as InstanceType<typeof __sfc__>;
  20. const _cache = __ins.renderCache;
  21. const totalAsset = ref('1978.2');
  22. const cumulativeIncome = ref('1889');
  23. const frozenIncome = ref('1000');
  24. const availableIncome = ref('889');
  25. const taxiFee = ref('89.2');
  26. const frozenTaxi = ref('50');
  27. const availableTaxi = ref('49.2');
  28. // ✅ 修复点 1: 定义类型 (可以用 interface 或 type)
  29. const bills = ref([
  30. {
  31. orderId: '202506091311123009874638',
  32. projectName: '中式推拿',
  33. amount: 170.00,
  34. splitType: '首单分成',
  35. splitDetail: '基本套餐车费收入 x90%=20\n项目套餐收入 x50%=150',
  36. recordTime: '2025-06-09 13:58'
  37. } as BillItem,
  38. {
  39. orderId: '202506091311123009874638',
  40. projectName: '中式推拿',
  41. amount: 150.00,
  42. splitType: '加钟分成',
  43. splitDetail: '项目套餐收入 x71%+(70%+等级v1)=150',
  44. recordTime: '2025-06-09 13:58'
  45. } as BillItem,
  46. {
  47. orderId: '202506091311123009874638',
  48. projectName: '中式推拿订单退款',
  49. amount: -150.00,
  50. splitType: '首单分成',
  51. splitDetail: '基本套餐车费收入 x90%=20\n项目套餐收入 x50%=150',
  52. recordTime: '2025-06-09 13:58'
  53. } as BillItem,
  54. {
  55. orderId: '',
  56. projectName: '打车费转出',
  57. amount: -50.00,
  58. splitType: '分成',
  59. splitDetail: '打车费转出刘大锤账户:45.00元\n费率:0.1 手续费:5.00元',
  60. recordTime: '2025-06-09 13:58'
  61. } as BillItem
  62. ] as BillItem[]); // 如果自动推断不准,可以在末尾加 'as BillItem[]' 进行断言
  63. // --- 方法定义 ---
  64. const refreshData = () => {
  65. uni.showLoading({ title: '刷新中...' });
  66. setTimeout(() => {
  67. uni.hideLoading();
  68. uni.showToast({ title: '刷新成功', icon: 'success' });
  69. totalAsset.value = (parseFloat(totalAsset.value) + 0.1).toFixed(1);
  70. }, 800);
  71. };
  72. const handleWithdraw = (type: string) => {
  73. const amount = type === 'income' ? availableIncome.value : '0';
  74. uni.showModal({
  75. title: '提现确认',
  76. content: `确定要提现 ${amount} 元吗?`,
  77. success: (res) => {
  78. if (res.confirm) {
  79. uni.showToast({ title: '提现申请已提交', icon: 'success' });
  80. }
  81. }
  82. });
  83. };
  84. const handleTransfer = (type: string) => {
  85. uni.showModal({
  86. title: '转出确认',
  87. content: '确定要将打车费转出到其他账户吗?',
  88. success: (res) => {
  89. if (res.confirm) {
  90. uni.showToast({ title: '转出成功', icon: 'success' });
  91. }
  92. }
  93. });
  94. };
  95. const viewWithdrawRecords = () => {
  96. uni.showToast({ title: '查看提现记录', icon: 'none' });
  97. };
  98. const viewAllBills = () => {
  99. uni.showToast({ title: '查看全部账单', icon: 'none' });
  100. };
  101. return (): any | null => {
  102. const _component_u_icon = resolveEasyComponent("u-icon", _easycom_u_icon);
  103. return _cE("view", _uM({ class: "page-container" }), [
  104. _cE("view", _uM({ class: "asset-card" }), [
  105. _cE("view", _uM({ class: "total-asset-section row-between" }), [
  106. _cE("text", _uM({ class: "label" }), " 我的资产(元) "),
  107. _cE("view", _uM({ class: "amount-row row-start" }), [
  108. _cE("text", _uM({ class: "amount" }), _tD(totalAsset.value), 1 /* TEXT */),
  109. _cV(_component_u_icon, _uM({
  110. type: "eye",
  111. size: "20",
  112. color: "#333"
  113. }))
  114. ]),
  115. _cE("view", _uM({
  116. class: "refresh-btn row-center",
  117. onClick: refreshData
  118. }), [
  119. _cV(_component_u_icon, _uM({
  120. type: "refresh",
  121. size: "18",
  122. color: "#333"
  123. })),
  124. _cE("text", null, " 刷新 ")
  125. ])
  126. ]),
  127. _cE("view", _uM({ class: "income-section row-start" }), [
  128. _cE("view", _uM({ class: "income-item column" }), [
  129. _cE("view", _uM({ class: "income-header row-start" }), [
  130. _cE("text", _uM({ class: "income-label" }), " 累计收益(元) "),
  131. _cV(_component_u_icon, _uM({
  132. type: "help",
  133. size: "16",
  134. color: "#999"
  135. }))
  136. ]),
  137. _cE("view", _uM({ class: "income-main row-between" }), [
  138. _cE("text", _uM({ class: "income-value" }), _tD(cumulativeIncome.value), 1 /* TEXT */),
  139. _cE("view", _uM({
  140. class: "withdraw-btn",
  141. onClick: () => { handleWithdraw('income'); }
  142. }), " 提现 ", 8 /* PROPS */, ["onClick"])
  143. ]),
  144. _cE("view", _uM({ class: "income-detail row-start" }), [
  145. _cE("view", _uM({ class: "detail-item column-center" }), [
  146. _cE("text", _uM({ class: "detail-label" }), " 冻结(元) "),
  147. _cE("text", _uM({ class: "detail-value" }), _tD(frozenIncome.value), 1 /* TEXT */)
  148. ]),
  149. _cE("view", _uM({ class: "divider" })),
  150. _cE("view", _uM({ class: "detail-item column-center" }), [
  151. _cE("text", _uM({ class: "detail-label" }), " 可提现(元) "),
  152. _cE("text", _uM({ class: "detail-value highlight" }), _tD(availableIncome.value), 1 /* TEXT */)
  153. ])
  154. ])
  155. ]),
  156. _cE("view", _uM({ class: "income-item column" }), [
  157. _cE("view", _uM({ class: "income-header row-start" }), [
  158. _cE("text", _uM({ class: "income-label" }), " 打车费(元) "),
  159. _cV(_component_u_icon, _uM({
  160. type: "help",
  161. size: "16",
  162. color: "#999"
  163. }))
  164. ]),
  165. _cE("view", _uM({ class: "income-main row-between" }), [
  166. _cE("text", _uM({ class: "income-value" }), _tD(taxiFee.value), 1 /* TEXT */),
  167. _cE("view", _uM({
  168. class: "transfer-btn",
  169. onClick: () => { handleTransfer('taxi'); }
  170. }), " 转出 ", 8 /* PROPS */, ["onClick"])
  171. ]),
  172. _cE("view", _uM({ class: "income-detail row-start" }), [
  173. _cE("view", _uM({ class: "detail-item column-center" }), [
  174. _cE("text", _uM({ class: "detail-label" }), " 冻结(元) "),
  175. _cE("text", _uM({ class: "detail-value" }), _tD(frozenTaxi.value), 1 /* TEXT */)
  176. ]),
  177. _cE("view", _uM({ class: "divider" })),
  178. _cE("view", _uM({ class: "detail-item column-center" }), [
  179. _cE("text", _uM({ class: "detail-label" }), " 可使用(元) "),
  180. _cE("text", _uM({ class: "detail-value highlight" }), _tD(availableTaxi.value), 1 /* TEXT */)
  181. ])
  182. ])
  183. ])
  184. ]),
  185. _cE("view", _uM({
  186. class: "record-entry row-between",
  187. onClick: viewWithdrawRecords
  188. }), [
  189. _cE("text", null, " 提现记录 "),
  190. _cV(_component_u_icon, _uM({
  191. type: "arrowright",
  192. size: "16",
  193. color: "#999"
  194. }))
  195. ])
  196. ]),
  197. _cE("view", _uM({ class: "bill-header row-between" }), [
  198. _cE("text", _uM({ class: "bill-title" }), " 本月账单 "),
  199. _cE("text", _uM({
  200. class: "view-all",
  201. onClick: viewAllBills
  202. }), " 查看全部 ")
  203. ]),
  204. _cE("view", _uM({ class: "bill-list column" }), [
  205. _cE(Fragment, null, RenderHelpers.renderList(bills.value, (bill, idx, __index, _cached): any => {
  206. return _cE("view", _uM({
  207. key: idx,
  208. class: "bill-card column"
  209. }), [
  210. _cE("view", _uM({ class: "order-id-row row-between" }), [
  211. _cE("text", _uM({ class: "order-id" }), " 订单号:" + _tD(bill.orderId), 1 /* TEXT */),
  212. _cV(_component_u_icon, _uM({
  213. type: "arrowright",
  214. size: "16",
  215. color: "#999"
  216. }))
  217. ]),
  218. _cE("view", _uM({ class: "project-amount-row row-between" }), [
  219. _cE("text", _uM({ class: "project-name" }), _tD(bill.projectName), 1 /* TEXT */),
  220. _cE("text", _uM({
  221. class: _nC(['amount', bill.amount > 0 ? 'positive' : 'negative'])
  222. }), _tD(bill.amount > 0 ? '+' : '') + _tD(Math.abs(bill.amount).toFixed(2)), 3 /* TEXT, CLASS */)
  223. ]),
  224. _cE("view", _uM({ class: "split-info column" }), [
  225. _cE("text", _uM({ class: "split-type" }), _tD(bill.splitType), 1 /* TEXT */),
  226. _cE("text", _uM({ class: "split-detail" }), _tD(bill.splitDetail), 1 /* TEXT */)
  227. ]),
  228. _cE("view", _uM({ class: "time-row row-between" }), [
  229. _cE("text", _uM({ class: "time-label" }), " 记录时间 "),
  230. _cE("text", _uM({ class: "time-value" }), _tD(bill.recordTime), 1 /* TEXT */)
  231. ])
  232. ]);
  233. }), 128 /* KEYED_FRAGMENT */)
  234. ])
  235. ]);
  236. };
  237. }
  238. });
  239. export default __sfc__;
  240. 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"]]))]])];
  241. //# sourceMappingURL=account.uvue.map