partner-home.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="partner-home">
  3. <!-- 头部信息 -->
  4. <view class="header">
  5. <image class="avatar" src="/static/img/logo.png" mode="aspectFit"></image>
  6. <view class="header-text">
  7. <text class="title">您好,合伙人</text>
  8. <text class="subtitle">这里是合伙人数据中心</text>
  9. </view>
  10. <navigator url="/pages-mine/pages/partner-rule" class="rule-btn">合伙人规则</navigator>
  11. </view>
  12. <view class="content" style="margin-top: -180rpx;">
  13. <!-- 收入统计 -->
  14. <view class="income-section">
  15. <view class="section-header">
  16. <text class="section-title">收入统计</text>
  17. <text class="tip">每月20号到账上月结算收益</text>
  18. </view>
  19. <view class="income-grid">
  20. <view class="income-item">
  21. <text class="amount">¥{{ detail.totalIncome || "0.00" }}</text>
  22. <text class="label">累计收入</text>
  23. </view>
  24. <view class="income-item">
  25. <text class="amount">¥{{ detail.todayEstimateIncome || "0.00" }}</text>
  26. <text class="label">今日预估</text>
  27. </view>
  28. <view class="income-item">
  29. <text class="amount">¥{{ detail.lastMontyEstimateIncome || "0.00" }}</text>
  30. <text class="label">上月预估</text>
  31. </view>
  32. <view class="income-item">
  33. <text class="amount">¥{{ detail.thisMontyEstimateIncome || "0.00" }}</text>
  34. <text class="label">本月预估</text>
  35. </view>
  36. <view class="income-item">
  37. <text class="amount">¥{{ detail.lastMontySettlement || "0.00" }}</text>
  38. <text class="label">上月结算</text>
  39. </view>
  40. <view class="income-item">
  41. <text class="amount">¥{{ detail.waitAccount || "0.00" }}</text>
  42. <text class="label">待到账</text>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 实用工具 -->
  47. <view class="tools-section">
  48. <text class="section-title">实用工具</text>
  49. <view class="tools-grid">
  50. <navigator url="/pages-mine/pages/partner/income-detail" class="tool-item">
  51. <image src="/pages-mine/static/partner1.png" mode="aspectFit"></image>
  52. <text>收入明细</text>
  53. </navigator>
  54. <navigator url="/pages-mine/pages/partner/order-detail" class="tool-item">
  55. <image src="/pages-mine/static/partner2.png" mode="aspectFit"></image>
  56. <text>订单明细</text>
  57. </navigator>
  58. </view>
  59. </view>
  60. <!-- 生成海报按钮 -->
  61. <button class="generate-poster" @click="generatePoster">生成专属二维码海报</button>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. detail: {
  70. totalIncome: 0,
  71. todayEstimateIncome: 0,
  72. lastMontyEstimateIncome: 0,
  73. thisMontyEstimateIncome: 0,
  74. lastMontySettlement: 0,
  75. waitAccount: 0,
  76. },
  77. };
  78. },
  79. onLoad() {
  80. this.getPartnerInfo();
  81. },
  82. methods: {
  83. getPartnerInfo() {
  84. uni.$u.get("/token/getUserPartnerInfo").then((res) => {
  85. if (res.code == 200) {
  86. this.detail = res.data;
  87. }
  88. });
  89. },
  90. generatePoster() {
  91. // TODO: 实现生成海报功能
  92. uni.showToast({
  93. title: "正在生成海报...",
  94. icon: "loading",
  95. });
  96. },
  97. },
  98. };
  99. </script>
  100. <style lang="scss" scoped>
  101. .partner-home {
  102. min-height: 100vh;
  103. background-color: #f5f5f5;
  104. .section-title {
  105. font-size: 32rpx;
  106. font-weight: bold;
  107. margin-bottom: 20rpx;
  108. display: block;
  109. }
  110. .header {
  111. display: flex;
  112. align-items: flex-start;
  113. background-color: #4caf50;
  114. padding: 30rpx;
  115. padding-top: 45rpx;
  116. border-radius: 16rpx;
  117. margin-bottom: 20rpx;
  118. height: 322rpx;
  119. border-radius: 0rpx 0rpx 161rpx 161rpx;
  120. .avatar {
  121. width: 80rpx;
  122. height: 80rpx;
  123. border-radius: 50%;
  124. margin-right: 20rpx;
  125. }
  126. .header-text {
  127. flex: 1;
  128. color: #fff;
  129. .title {
  130. font-size: 32rpx;
  131. font-weight: bold;
  132. display: block;
  133. }
  134. .subtitle {
  135. font-size: 24rpx;
  136. opacity: 0.8;
  137. }
  138. }
  139. .rule-btn {
  140. padding: 10rpx 20rpx;
  141. background: rgba(255, 255, 255, 0.2);
  142. border-radius: 30rpx;
  143. color: #fff;
  144. font-size: 24rpx;
  145. }
  146. }
  147. .income-section {
  148. background-color: #fff;
  149. border-radius: 16rpx;
  150. padding: 30rpx;
  151. margin: 20rpx auto;
  152. width: calc(100% - 40rpx);
  153. .section-header {
  154. display: flex;
  155. justify-content: space-between;
  156. align-items: center;
  157. margin-bottom: 20rpx;
  158. .tip {
  159. font-size: 24rpx;
  160. color: #999;
  161. }
  162. }
  163. .income-grid {
  164. display: grid;
  165. grid-template-columns: repeat(2, 1fr);
  166. gap: 20rpx;
  167. .income-item {
  168. background-color: #f8f8f8;
  169. padding: 20rpx;
  170. border-radius: 12rpx;
  171. text-align: center;
  172. .amount {
  173. color: #ff4d4f;
  174. font-size: 32rpx;
  175. font-weight: bold;
  176. display: block;
  177. }
  178. .label {
  179. font-size: 24rpx;
  180. color: #666;
  181. margin-top: 8rpx;
  182. }
  183. }
  184. }
  185. }
  186. .tools-section {
  187. background-color: #fff;
  188. border-radius: 16rpx;
  189. padding: 30rpx;
  190. margin: 20rpx auto;
  191. width: calc(100% - 40rpx);
  192. .tools-grid {
  193. display: flex;
  194. gap: 30rpx;
  195. .tool-item {
  196. flex: 1;
  197. display: flex;
  198. align-items: center;
  199. padding: 20rpx;
  200. border-radius: 12rpx;
  201. image {
  202. width: 90rpx;
  203. height: 90rpx;
  204. margin-right: 10rpx;
  205. }
  206. text {
  207. font-size: 26rpx;
  208. color: #333;
  209. }
  210. }
  211. }
  212. }
  213. .generate-poster {
  214. width: calc(100% - 60rpx);
  215. height: 88rpx;
  216. line-height: 88rpx;
  217. background-color: #4caf50;
  218. color: #fff;
  219. border-radius: 10rpx;
  220. font-size: 28rpx;
  221. margin: 40rpx auto;
  222. }
  223. }
  224. </style>