四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

444 lines
11 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="promote-page">
  3. <uv-status-bar></uv-status-bar>
  4. <!-- 主要内容区域 -->
  5. <view class="content">
  6. <!-- 推广官图片 -->
  7. <view class="promote-image-container">
  8. <uv-icon name="arrow-left" size="20" color="black" @click="goBack"></uv-icon>
  9. <view :style="{flex: 1, justifyContent: 'center', display: 'flex'}">
  10. <image
  11. class="promote-image"
  12. src="/static/推广官.png"
  13. mode="widthFix"
  14. ></image>
  15. </view>
  16. </view>
  17. <!-- 推广标语图片 -->
  18. <view class="slogan-container">
  19. <image
  20. class="slogan-image"
  21. src="/static/推广标语.png"
  22. mode="widthFix"
  23. ></image>
  24. </view>
  25. </view>
  26. <!-- 外部大容器 -->
  27. <view class="main-container">
  28. <!-- 个人信息容器 -->
  29. <view class="profile-container">
  30. <image class="profile-avatar" :src="userInfo.avatar" mode="aspectFill"></image>
  31. <view class="profile-info">
  32. <text class="profile-name">{{ userInfo.name }}</text>
  33. <!-- <text class="profile-id">ID: {{ userInfo.id }}</text> -->
  34. </view>
  35. <view class="profile-stats">
  36. <view class="stat-item">
  37. <text class="stat-number">{{ num }}</text>
  38. <text class="stat-label">推广人数</text>
  39. </view>
  40. <view class="stat-item">
  41. <text class="stat-number">{{ userInfo.price }}</text>
  42. <text class="stat-label">总佣金</text>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 功能按钮区域 -->
  47. <view class="function-buttons">
  48. <view class="function-item" @click="goTeam">
  49. <image class="function-icon" src="/static/团队图标.png" mode="aspectFit"></image>
  50. <text class="function-text">我的团队</text>
  51. </view>
  52. <view class="function-item" @click="goQrcode">
  53. <image class="function-icon" src="/static/二维码图标.png" mode="aspectFit"></image>
  54. <text class="function-text">我的二维码</text>
  55. </view>
  56. <view class="function-item" @click="goCash">
  57. <image class="function-icon" src="/static/提现图标.png" mode="aspectFit"></image>
  58. <text class="function-text">提现</text>
  59. </view>
  60. </view>
  61. <!-- 余额显示 -->
  62. <view class="balance-section">
  63. <text class="balance-label">余额</text>
  64. <text class="balance-amount">¥88.32</text>
  65. <uv-icon name="arrow-right" size="16" color="#999"></uv-icon>
  66. </view>
  67. <!-- 转账记录容器 -->
  68. <view class="record-container">
  69. <view class="record-list">
  70. <view class="record-item" v-for="(item, index) in list" :key="index">
  71. <view class="record-avatar">
  72. <image class="avatar" :src="item.userInfo.avatar" mode="aspectFill"></image>
  73. <text class="avatar-name">{{ item.user_dictText }}</text>
  74. </view>
  75. <view class="record-info">
  76. <text class="record-title">{{ item.title }}</text>
  77. <text class="record-date">{{ item.createTime }}</text>
  78. </view>
  79. <view class="record-amount">
  80. <text class="amount">+{{ item.money }}</text>
  81. <text class="status" :class="item.withdrawal.status === '1' && withdrawStatus === '0' ? 'status-available' : 'status-received'" v-if="item.withdrawal">{{ getText(item.withdrawal) }}</text>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- 底部固定按钮 -->
  88. <view class="bottom-button-container">
  89. <uv-button :custom-style="{
  90. height: '82rpx',
  91. borderRadius: '198rpx',
  92. background: '#06DADC',
  93. border: '2rpx solid #06DADC',
  94. lineHeight: '82rpx',
  95. fontSize: '36rpx'
  96. }" type="primary" @click="goQrcode">分享</uv-button>
  97. <uv-safe-bottom></uv-safe-bottom>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import MixinList from '@/mixins/list'
  103. export default {
  104. mixins: [MixinList],
  105. data() {
  106. return {
  107. mixinListApi: 'promotion.water',
  108. num: 0,
  109. userInfo: {},
  110. }
  111. },
  112. methods: {
  113. goBack() {
  114. uni.navigateBack()
  115. },
  116. goTeam() {
  117. uni.navigateTo({
  118. url: '/subPages/user/team'
  119. })
  120. },
  121. goCash() {
  122. uni.requestMerchantTransfer({
  123. })
  124. },
  125. getText(widhdraw) {
  126. // 如果已经领取了
  127. if (widhdraw.withdrawStatus !== '0') {
  128. return '已领取,' + (widhdraw.method === '0' ? '微信打款' : '线下付款')
  129. }else if (widhdraw.status === '0') {
  130. return '提现待审核中'
  131. }else if(widhdraw.status === '2'){
  132. return '审核失败!'
  133. }
  134. },
  135. // 获取推广统计
  136. async getStatistics() {
  137. const res = await this.$api.promotion.statistics()
  138. if (res.code === 200) {
  139. this.num = res.result.num
  140. }
  141. },
  142. // 获取用户信息
  143. async getUserInfo() {
  144. const res = await this.$api.login.getUserInfo()
  145. if (res.code === 200) {
  146. this.userInfo = res.result
  147. }
  148. },
  149. // 去二维码
  150. goQrcode() {
  151. uni.navigateTo({
  152. url: '/subPages/user/share'
  153. })
  154. },
  155. },
  156. async onShow() {
  157. Promise.all([
  158. this.getUserInfo(),
  159. this.getStatistics()
  160. ])
  161. },
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .promote-page {
  166. min-height: 100vh;
  167. background: linear-gradient(124deg, #22F2EB 0%, #24B0F6 30%);
  168. // background: linear-gradient(124deg, #22F2EB 0%, #24B0F6 100%);
  169. }
  170. .content {
  171. padding: 0rpx 40rpx 0;
  172. .promote-image-container {
  173. display: flex;
  174. justify-content: center;
  175. margin-bottom: 30rpx;
  176. align-items: center;
  177. .promote-image {
  178. margin: 0 auto;
  179. width: 168rpx;
  180. }
  181. }
  182. .slogan-container {
  183. display: flex;
  184. justify-content: center;
  185. margin-bottom: 80rpx;
  186. .slogan-image {
  187. width: 670rpx;
  188. }
  189. }
  190. }
  191. // 外部大容器
  192. .main-container {
  193. width: 100%;
  194. border-radius: 48rpx;
  195. border: 2rpx solid #06DADC12;
  196. box-sizing: border-box;
  197. padding: 40rpx;
  198. padding-bottom: 200rpx;
  199. background: linear-gradient(180deg, #DEFFFF 0%, #FBFEFF 22.65%, #F0FBFF 100%);
  200. // 个人信息容器
  201. .profile-container {
  202. background: #fff;
  203. margin-bottom: 30rpx;
  204. display: flex;
  205. align-items: center;
  206. border-radius: 48rpx;
  207. border-width: 2rpx;
  208. justify-content: space-between;
  209. background: linear-gradient(180deg, #DEFFFF 0%, #FBFEFF 22.65%, #F0FBFF 100%);
  210. // background: red;
  211. border: 2rpx solid #06DADC12;
  212. // padding-top: 32rpx;
  213. padding-right: 40rpx;
  214. // padding-bottom: 32rpx;
  215. // padding-left: 40rpx;
  216. height: 200rpx;
  217. .profile-avatar {
  218. width: 128rpx;
  219. height: 128rpx;
  220. border-radius: 50%;
  221. margin-right: 24rpx;
  222. }
  223. .profile-info {
  224. flex: 1;
  225. .profile-name {
  226. display: block;
  227. font-size: 32rpx;
  228. font-weight: 600;
  229. color: #333;
  230. margin-bottom: 8rpx;
  231. }
  232. .profile-id {
  233. font-size: 24rpx;
  234. color: #999;
  235. }
  236. }
  237. .profile-stats {
  238. display: flex;
  239. .stat-item {
  240. text-align: center;
  241. margin-left: 100rpx;
  242. .stat-number {
  243. display: block;
  244. font-size: 32rpx;
  245. font-weight: bold;
  246. color: #333;
  247. margin-bottom: 8rpx;
  248. }
  249. .stat-label {
  250. font-size: 24rpx;
  251. color: #999;
  252. }
  253. }
  254. }
  255. }
  256. // 功能按钮区域
  257. .function-buttons {
  258. display: flex;
  259. justify-content: space-around;
  260. align-items: center;
  261. margin-bottom: 48rpx;
  262. .function-item {
  263. display: flex;
  264. // flex-direction: column;
  265. align-items: center;
  266. gap: 16rpx;
  267. border-right: 1px solid #06DADC;
  268. padding-right: 30rpx;
  269. &:nth-child(3) {
  270. border-right: none;
  271. }
  272. .function-icon {
  273. width: 46rpx;
  274. height: 46rpx;
  275. // margin-bottom: 16rpx;
  276. }
  277. .function-text {
  278. font-size: 24rpx;
  279. color: #181818;
  280. }
  281. }
  282. }
  283. // 余额显示
  284. .balance-section {
  285. display: flex;
  286. align-items: center;
  287. justify-content: space-between;
  288. margin-bottom: 40rpx;
  289. .balance-label {
  290. font-size: 32rpx;
  291. color: #191919;
  292. font-weight: 500;
  293. }
  294. .balance-amount {
  295. font-size: 32rpx;
  296. font-weight: 500;
  297. color: #191919;
  298. flex: 1;
  299. margin-left: 20rpx;
  300. }
  301. }
  302. // 转账记录容器
  303. .record-container {
  304. .record-list {
  305. border: 1px solid #F0F0F0;
  306. border-radius: 24rpx;
  307. // background: red;
  308. .record-item {
  309. height: 116rpx;
  310. background: #fff;
  311. // border-radius: 16rpx;
  312. padding: 16rpx 32rpx;
  313. // margin-bottom: 20rpx;
  314. display: flex;
  315. align-items: center;
  316. border-bottom: 2rpx solid #F1F1F1 ;
  317. // margin-right: 24rpx;
  318. // box-sizing: border-box;
  319. .record-avatar{
  320. display: flex;
  321. align-items: center;
  322. flex-direction: column;
  323. gap: 12rpx;
  324. .avatar-name {
  325. font-size: 24rpx;
  326. color: #999;
  327. }
  328. .avatar {
  329. width: 50rpx;
  330. height: 50rpx;
  331. border-radius: 50%;
  332. // margin-right: 24rpx;
  333. }
  334. }
  335. .record-info {
  336. flex: 3;
  337. text-align: center;
  338. .record-title {
  339. display: block;
  340. font-size: 28rpx;
  341. color: #333;
  342. margin-bottom: 8rpx;
  343. }
  344. .record-date {
  345. font-size: 26rpx;
  346. color: #A3A3A3;
  347. }
  348. }
  349. .record-amount {
  350. flex: 2;
  351. text-align: center;
  352. .amount {
  353. display: block;
  354. font-size: 28rpx;
  355. font-weight: bold;
  356. color: #333;
  357. margin-bottom: 8rpx;
  358. }
  359. .status {
  360. font-size: 26rpx;
  361. // padding: 8rpx 16rpx;
  362. border-radius: 20rpx;
  363. &.status-received {
  364. // background: #f0f0f0;
  365. color: #A3A3A3;
  366. }
  367. &.status-available {
  368. // background: #22F2EB;
  369. padding: 3rpx 16rpx;
  370. color: $primary-color;
  371. border: 2rpx solid $primary-color;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. }
  378. }
  379. // 底部固定按钮
  380. .bottom-button-container {
  381. position: fixed;
  382. bottom: 0;
  383. left: 0;
  384. right: 0;
  385. padding: 30rpx 40rpx;
  386. background: rgba(255, 255, 255, 0.95);
  387. border-top: 1px solid #F1F1F1;
  388. // height: 143rpx;
  389. // backdrop-filter: blur(10rpx);
  390. }
  391. </style>