四零语境前端代码仓库
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 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.navigateTo({
  123. url: '/subPages/user/cash'
  124. })
  125. },
  126. getText(widhdraw) {
  127. // 如果已经领取了
  128. if (widhdraw.withdrawStatus !== '0') {
  129. return '已领取,' + (widhdraw.method === '0' ? '微信打款' : '线下付款')
  130. }else if (widhdraw.status === '0') {
  131. return '提现待审核中'
  132. }else if(widhdraw.status === '2'){
  133. return '审核失败!'
  134. }
  135. },
  136. // 获取推广统计
  137. async getStatistics() {
  138. const res = await this.$api.promotion.statistics()
  139. if (res.code === 200) {
  140. this.num = res.result.num
  141. }
  142. },
  143. // 获取用户信息
  144. async getUserInfo() {
  145. const res = await this.$api.login.getUserInfo()
  146. if (res.code === 200) {
  147. this.userInfo = res.result
  148. }
  149. },
  150. // 去二维码
  151. goQrcode() {
  152. uni.navigateTo({
  153. url: '/subPages/user/share'
  154. })
  155. },
  156. },
  157. async onShow() {
  158. Promise.all([
  159. this.getUserInfo(),
  160. this.getStatistics()
  161. ])
  162. },
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. .promote-page {
  167. min-height: 100vh;
  168. background: linear-gradient(124deg, #22F2EB 0%, #24B0F6 30%);
  169. // background: linear-gradient(124deg, #22F2EB 0%, #24B0F6 100%);
  170. }
  171. .content {
  172. padding: 0rpx 40rpx 0;
  173. .promote-image-container {
  174. display: flex;
  175. justify-content: center;
  176. margin-bottom: 30rpx;
  177. align-items: center;
  178. .promote-image {
  179. margin: 0 auto;
  180. width: 168rpx;
  181. }
  182. }
  183. .slogan-container {
  184. display: flex;
  185. justify-content: center;
  186. margin-bottom: 80rpx;
  187. .slogan-image {
  188. width: 670rpx;
  189. }
  190. }
  191. }
  192. // 外部大容器
  193. .main-container {
  194. width: 100%;
  195. border-radius: 48rpx;
  196. border: 2rpx solid #06DADC12;
  197. box-sizing: border-box;
  198. padding: 40rpx;
  199. padding-bottom: 200rpx;
  200. background: linear-gradient(180deg, #DEFFFF 0%, #FBFEFF 22.65%, #F0FBFF 100%);
  201. // 个人信息容器
  202. .profile-container {
  203. background: #fff;
  204. margin-bottom: 30rpx;
  205. display: flex;
  206. align-items: center;
  207. border-radius: 48rpx;
  208. border-width: 2rpx;
  209. justify-content: space-between;
  210. background: linear-gradient(180deg, #DEFFFF 0%, #FBFEFF 22.65%, #F0FBFF 100%);
  211. // background: red;
  212. border: 2rpx solid #06DADC12;
  213. // padding-top: 32rpx;
  214. padding-right: 40rpx;
  215. // padding-bottom: 32rpx;
  216. // padding-left: 40rpx;
  217. height: 200rpx;
  218. .profile-avatar {
  219. width: 128rpx;
  220. height: 128rpx;
  221. border-radius: 50%;
  222. margin-right: 24rpx;
  223. }
  224. .profile-info {
  225. flex: 1;
  226. .profile-name {
  227. display: block;
  228. font-size: 32rpx;
  229. font-weight: 600;
  230. color: #333;
  231. margin-bottom: 8rpx;
  232. }
  233. .profile-id {
  234. font-size: 24rpx;
  235. color: #999;
  236. }
  237. }
  238. .profile-stats {
  239. display: flex;
  240. .stat-item {
  241. text-align: center;
  242. margin-left: 100rpx;
  243. .stat-number {
  244. display: block;
  245. font-size: 32rpx;
  246. font-weight: bold;
  247. color: #333;
  248. margin-bottom: 8rpx;
  249. }
  250. .stat-label {
  251. font-size: 24rpx;
  252. color: #999;
  253. }
  254. }
  255. }
  256. }
  257. // 功能按钮区域
  258. .function-buttons {
  259. display: flex;
  260. justify-content: space-around;
  261. align-items: center;
  262. margin-bottom: 48rpx;
  263. .function-item {
  264. display: flex;
  265. // flex-direction: column;
  266. align-items: center;
  267. gap: 16rpx;
  268. border-right: 1px solid #06DADC;
  269. padding-right: 30rpx;
  270. &:nth-child(3) {
  271. border-right: none;
  272. }
  273. .function-icon {
  274. width: 46rpx;
  275. height: 46rpx;
  276. // margin-bottom: 16rpx;
  277. }
  278. .function-text {
  279. font-size: 24rpx;
  280. color: #181818;
  281. }
  282. }
  283. }
  284. // 余额显示
  285. .balance-section {
  286. display: flex;
  287. align-items: center;
  288. justify-content: space-between;
  289. margin-bottom: 40rpx;
  290. .balance-label {
  291. font-size: 32rpx;
  292. color: #191919;
  293. font-weight: 500;
  294. }
  295. .balance-amount {
  296. font-size: 32rpx;
  297. font-weight: 500;
  298. color: #191919;
  299. flex: 1;
  300. margin-left: 20rpx;
  301. }
  302. }
  303. // 转账记录容器
  304. .record-container {
  305. .record-list {
  306. border: 1px solid #F0F0F0;
  307. border-radius: 24rpx;
  308. // background: red;
  309. .record-item {
  310. height: 116rpx;
  311. background: #fff;
  312. // border-radius: 16rpx;
  313. padding: 16rpx 32rpx;
  314. // margin-bottom: 20rpx;
  315. display: flex;
  316. align-items: center;
  317. border-bottom: 2rpx solid #F1F1F1 ;
  318. // margin-right: 24rpx;
  319. // box-sizing: border-box;
  320. .record-avatar{
  321. display: flex;
  322. align-items: center;
  323. flex-direction: column;
  324. gap: 12rpx;
  325. .avatar-name {
  326. font-size: 24rpx;
  327. color: #999;
  328. }
  329. .avatar {
  330. width: 50rpx;
  331. height: 50rpx;
  332. border-radius: 50%;
  333. // margin-right: 24rpx;
  334. }
  335. }
  336. .record-info {
  337. flex: 3;
  338. text-align: center;
  339. .record-title {
  340. display: block;
  341. font-size: 28rpx;
  342. color: #333;
  343. margin-bottom: 8rpx;
  344. }
  345. .record-date {
  346. font-size: 26rpx;
  347. color: #A3A3A3;
  348. }
  349. }
  350. .record-amount {
  351. flex: 2;
  352. text-align: center;
  353. .amount {
  354. display: block;
  355. font-size: 28rpx;
  356. font-weight: bold;
  357. color: #333;
  358. margin-bottom: 8rpx;
  359. }
  360. .status {
  361. font-size: 26rpx;
  362. // padding: 8rpx 16rpx;
  363. border-radius: 20rpx;
  364. &.status-received {
  365. // background: #f0f0f0;
  366. color: #A3A3A3;
  367. }
  368. &.status-available {
  369. // background: #22F2EB;
  370. padding: 3rpx 16rpx;
  371. color: $primary-color;
  372. border: 2rpx solid $primary-color;
  373. }
  374. }
  375. }
  376. }
  377. }
  378. }
  379. }
  380. // 底部固定按钮
  381. .bottom-button-container {
  382. position: fixed;
  383. bottom: 0;
  384. left: 0;
  385. right: 0;
  386. padding: 30rpx 40rpx;
  387. background: rgba(255, 255, 255, 0.95);
  388. border-top: 1px solid #F1F1F1;
  389. // height: 143rpx;
  390. // backdrop-filter: blur(10rpx);
  391. }
  392. </style>