reward.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view>
  3. <view class="margin-lr-sm margin-top padding" style="background: #FFFFFF;border-radius: 20upx;">
  4. <view class="flex align-center" style="position: relative;">
  5. <view>
  6. <view class="text-sm" style="font-size: 28rpx;">累计获取奖励</view>
  7. <view style="color: #fe6b01; font-size: 50rpx; font-weight: bold; margin-top: 15rpx;">¥ 123.12
  8. </view>
  9. </view>
  10. <view style="position:absolute;right:0rpx;top:0rpx;">
  11. <image v-if="globalImages" :src="globalImages + 'images/my/jiangli.png'" style="width: 46rpx;height: 46rpx;" mode=""></image>
  12. </view>
  13. </view>
  14. <view class="flex align-center" style="position: relative;margin-top: 30rpx;">
  15. <view>
  16. <view class="text-sm" style="font-size: 28rpx;">可提现余额</view>
  17. <view style="color: #fe6b01; font-size: 38rpx; font-weight: bold; margin-top: 15rpx;">¥ 12.12</view>
  18. </view>
  19. <view style="position:absolute;right:0rpx;top:0rpx;">
  20. <button type="default"
  21. style="background-color: #fe6b01;font-size: 30rpx;color: #FFFFFF;">立即提现</button>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="margin-lr-sm margin-top padding" style="background: #FFFFFF;border-radius: 20upx;">
  26. <view class="title">
  27. 邀请数据
  28. </view>
  29. <view class="flex" style="margin-top: 20rpx;">
  30. <view style="width: 33.33%;text-align: center;padding: 20rpx 0;">
  31. <view style="font-size: 48rpx;font-weight: bold; color: #fe6b01;">5</view>
  32. <view style="color: #999;margin-top: 7rpx;">已邀请人数</view>
  33. </view>
  34. <view style="width: 33.33%;text-align: center;padding: 20rpx 0;">
  35. <view style="font-size: 48rpx;font-weight: bold; color: #fe6b01;">5</view>
  36. <view style="color: #999;margin-top: 7rpx;">成功邀请</view>
  37. </view>
  38. <view style="width: 33.33%;text-align: center;padding: 20rpx 0;">
  39. <view style="font-size: 48rpx;font-weight: bold; color: #fe6b01;">5</view>
  40. <view style="color: #999;margin-top: 7rpx;">本月新增</view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="margin-lr-sm margin-top padding" style="border-radius: 20upx;">
  45. <view class="flex align-center" style="position: relative;">
  46. <view>
  47. <view class="title">邀请活动</view>
  48. </view>
  49. <view style="position:absolute;right:0rpx;top:0rpx; color: #999;">
  50. 查看全部
  51. </view>
  52. </view>
  53. <view class="navbar">
  54. <view class="box" style="background: #409eff; color: #fff; padding: 20rpx;">
  55. <view class="flex align-center" style="position: relative;">
  56. <view>
  57. <view class="text-sm" style="font-size: 30rpx;">新用户首单奖励</view>
  58. <view style="font-size: 24rpx;margin-top: 10rpx;">2025-5-15 19:00
  59. </view>
  60. </view>
  61. <view style="position:absolute;right:0rpx;top:0rpx;">
  62. <image v-if="globalImages" :src="globalImages + 'images/my/jiangli2.png'" style="width: 66rpx;height: 66rpx;" mode=""></image>
  63. </view>
  64. </view>
  65. <view style="margin-top: 30rpx;font-size: 40rpx;font-weight: bold;">
  66. ¥ 12
  67. </view>
  68. <view style="font-size: 24rpx;margin-top: 20rpx;">
  69. 每成功邀请1人
  70. </view>
  71. </view>
  72. <view class="box" style="background: #fe6b01; color: #fff; padding: 20rpx;">
  73. <view class="flex align-center" style="position: relative;">
  74. <view>
  75. <view class="text-sm" style="font-size: 30rpx;">新用户首单奖励</view>
  76. <view style="font-size: 24rpx;margin-top: 10rpx;">2025-5-15 19:00
  77. </view>
  78. </view>
  79. <view style="position:absolute;right:0rpx;top:0rpx;">
  80. <image v-if="globalImages" :src="globalImages + 'images/my/jiangli2.png'" style="width: 66rpx;height: 66rpx;" mode=""></image>
  81. </view>
  82. </view>
  83. <view style="margin-top: 30rpx;font-size: 40rpx;font-weight: bold;">
  84. ¥ 12
  85. </view>
  86. <view style="font-size: 24rpx;margin-top: 20rpx;">
  87. 每成功邀请1人
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="margin-lr-sm margin-top padding" style="background: #FFFFFF;border-radius: 20upx;">
  93. <view class="flex align-center" style="position: relative;">
  94. <view>
  95. <view class="text-sm" style="font-size: 28rpx;">邀请记录</view>
  96. </view>
  97. <view style="position:absolute;right:0rpx;top:0rpx; color: #999;">
  98. 全部
  99. </view>
  100. </view>
  101. <view class="boxs" style="margin-top: 15rpx;">
  102. <!-- 外层容器 -->
  103. <view class="flex align-center padding-tb-sm" v-for="(item, index) in personList" :key="index" style="padding: 30rpx 0;">
  104. <!-- 显示头像 -->
  105. <view>
  106. <image :src="item.avatar" style="width: 80rpx;height: 80rpx;" mode=""></image>
  107. </view>
  108. <view style="margin-left: 30rpx; line-height: 40rpx;">
  109. <view>{{ item.nick_name }}</view>
  110. <view style="color: #999;">{{ item.create_time }}</view>
  111. </view>
  112. <view style="position: absolute; right: 60rpx;">
  113. <button type="default" v-if="item.first_order === 1"
  114. style="background-color: #00c18a;font-size: 24rpx;color: #FFFFFF;">已完成</button>
  115. <view style="color: #00c18a; font-size: 28rpx;" v-if="item.first_order === 1">
  116. + ¥{{ item.relationship }}
  117. </view>
  118. <button type="default" v-if="item.first_order === 0"
  119. style="background-color: #fe6b01;font-size: 24rpx;color: #FFFFFF;">待完成</button>
  120. <view style="color: #fe6b01; font-size: 28rpx;" v-if="item.first_order === 0">
  121. {{ item.relationship }}
  122. </view>
  123. </view>
  124. </view>
  125. <view class="login_btn" >加载更多</view>
  126. </view>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  132. export default {
  133. data() {
  134. return {
  135. personList: [],
  136. list: [{
  137. id: 1,
  138. name: '全部'
  139. },{
  140. id: 1,
  141. name: '可使用'
  142. }, {
  143. id: 2,
  144. name: '已使用'
  145. }, {
  146. id: 3,
  147. name: '已失效'
  148. }],
  149. page: 1,
  150. limit: 10,
  151. globalImages: ''
  152. };
  153. },
  154. onLoad() {
  155. this.inviter()
  156. waitForGlobalImages().then((path) => {
  157. console.log('✅ 全局图片路径:', path)
  158. this.globalImages = path
  159. })
  160. },
  161. methods: {
  162. inviter () {
  163. let data = {
  164. page: this.page,
  165. limit: this.limit
  166. }
  167. this.$Request.postT('/app/emergency/inviter', data).then(res => {
  168. if (res.code === 0) {
  169. if (this.page == 1) {
  170. this.personList = res.data.list;
  171. } else {
  172. this.personList = [...this.list, ...res.data.list]
  173. }
  174. }
  175. });
  176. }
  177. },
  178. }
  179. </script>
  180. <style lang="scss">
  181. .title {
  182. font-size: 32rpx;
  183. font-weight: bold;
  184. font-family: PingFang SC;
  185. color: #333333;
  186. }
  187. .login_btn {
  188. width: 100%;
  189. margin: 0 auto;
  190. text-align: center;
  191. background: #f5f5f5;
  192. height: 80rpx;
  193. border-radius: 16rpx;
  194. border: 1px solid #e4e7ed;
  195. color: #999;
  196. line-height: 80rpx;
  197. margin-top: 60rpx;
  198. }
  199. .navbar {
  200. /* 开启 flex 布局 */
  201. display: flex;
  202. padding-top: 30rpx;
  203. /* 允许子元素溢出时横向滚动 */
  204. white-space: nowrap;
  205. /* 当内容溢出时,显示横向滚动条 */
  206. overflow-x: auto;
  207. }
  208. .box {
  209. /* 盒子宽度设置为 400rpx */
  210. width: 400rpx;
  211. height: 240rpx;
  212. /* 不允许子元素换行 */
  213. white-space: nowrap;
  214. /* 固定宽度,不收缩 */
  215. flex-shrink: 0;
  216. border-radius: 18rpx;
  217. }
  218. /* 除了第一个 box 元素,其他 box 元素设置负的左外边距 */
  219. .box:nth-child(n + 2) {
  220. margin-left: 30rpx;
  221. }
  222. </style>