invite-new-user.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <layout title="邀请好友得现金" :isGoBack="true" padding="0">
  3. <template #right>
  4. <!-- nav right -->
  5. <img @click="onRightHandle" src="~assets/image/activity/invite-user/invite-new-user/nav-right.png" alt="">
  6. </template>
  7. <!-- 微信环境提示浏览器打开 -->
  8. <WxPopTpis v-if="isWeChatBrowser" />
  9. <!-- container -->
  10. <div v-else class="invite-container">
  11. <!-- 分享按钮 -->
  12. <v-btn @click="shareHandle" class="share-btn mb-8" rounded />
  13. <div class="day-statistics mb-3">今日邀请注册人数:{{ registerCount }}</div>
  14. <div class="user-main pt-3 pr-3 pb-3 pl-3 mb-3">
  15. <div class="userinfo">
  16. <img class="avatar mr-1" src="~assets/image/activity/invite-user/invite-new-user/avatar.png" alt="">
  17. <div class="userinfo-text ml-1">
  18. <div class="userinfo-name">{{ nickname }}</div>
  19. </div>
  20. </div>
  21. <div class="possess-warp mb-3">
  22. <div class="withdrawal-text">可提现<span class="withdrawal-money ml-2">¥{{ withdrawalBalance }}</span></div>
  23. <div class="withdrawal-btn">提现</div>
  24. </div>
  25. <div class="userinfo-detail">
  26. <div class="userinfo-detail-item pt-4 pr-3 pb-3 pl-3">
  27. <div class="userinfo-detail-item-content">{{ inviteBuyAmount }}</div>
  28. <div class="userinfo-detail-item-title">累计邀请购买</div>
  29. </div>
  30. <div style="flex: 0 0 11px"></div>
  31. <div class="userinfo-detail-item pt-4 pr-3 pb-3 pl-3">
  32. <div class="userinfo-detail-item-content">{{ accumulatedWithdrawal }}</div>
  33. <div class="userinfo-detail-item-title">累计邀请金额</div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="record-wrap">
  38. <van-tabs v-model="activeTab" shrink background="#FFFBE2">
  39. <van-tab v-for="(tab, i) in tabs" :title="tab.title" :key="i">
  40. <!-- 邀请记录 -->
  41. <RecordList
  42. v-if="activeTab === 0"
  43. class="mt-3 pr-1 pl-1 list-wrqp"
  44. :data="tab.data"
  45. :key="i"
  46. />
  47. <!-- 购买记录 -->
  48. <BuyRecordList class="mt-3 pr-1 pl-1 list-wrqp" v-if="activeTab === 1" :data="tab.data"/>
  49. <!-- 提现记录 -->
  50. <WithdrawalRecord
  51. v-if="activeTab === 2"
  52. class="mt-3 pr-1 pl-1 list-wrqp"
  53. :data="tab.data"
  54. :key="i"
  55. />
  56. <!-- 分页 -->
  57. <InvitePagination v-if="tab.total" :total="tab.total" :pageSize="tab.query.pageSize" :currentPage="tab.query.pageNum" @onPageChange="pageChangeHandle" />
  58. </van-tab>
  59. </van-tabs>
  60. </div>
  61. <!-- 分享弹窗 -->
  62. <SharePopup ref="sharePopup" />
  63. </div>
  64. </layout>
  65. </template>
  66. <script>
  67. /**
  68. * Date: 2025-4-3 oem商户拉新分佣活动
  69. */
  70. import layoutBack from '@/components/layout';
  71. import layout from './components/layout';
  72. import RecordList from './components/RecordList';
  73. import InvitePagination from './components/InvitePagination';
  74. import BuyRecordList from './components/BuyRecordList';
  75. import WithdrawalRecord from './components/WithdrawalRecord';
  76. import SharePopup from './components/SharePopup';
  77. import WxPopTpis from './components/WxPopTpis';
  78. export default {
  79. auth: false,
  80. name: 'OemInviteNewUser',
  81. head: {
  82. title: '邀请好友得现金',
  83. },
  84. components: { layout, layoutBack, RecordList, InvitePagination, BuyRecordList, WithdrawalRecord, SharePopup, WxPopTpis },
  85. data() {
  86. return {
  87. registerCount: 0, // 今日注册人数
  88. nickname: '', // 用户昵称
  89. withdrawalBalance: 0, // 可提现余额
  90. inviteBuyAmount: 0, // 累计邀请金额
  91. activityId: 1, // 活动ID
  92. accumulatedWithdrawal: 0, // 累计提现金额,
  93. // 查询参数
  94. queryData: {
  95. phoneNumber: '', // 手机号
  96. merchantSign: '', // 商户标识
  97. userName: '', // 邀请人用户名
  98. quiltUserName: '', // 被邀请人用户名
  99. activityId: '', // 活动ID
  100. toDay: '', // 今日日期
  101. inviteUserName: '', // 邀请人名称
  102. },
  103. activeTab: 0,
  104. tabs: [{
  105. title: '邀请记录',
  106. query: {
  107. pageNum: 1, // 页码
  108. pageSize: 10, // 每页数量
  109. },
  110. data: [{
  111. id: 1,
  112. name: '1305677',
  113. phoneNumber: '13800138000',
  114. createTime: '2025-04-03 10:00:00',
  115. money: '100.00',
  116. status: '已提现',
  117. },
  118. {
  119. id: 1,
  120. name: '1305677',
  121. phoneNumber: '13800138000',
  122. createTime: '2025-04-03 10:00:00',
  123. money: '100.00',
  124. status: '已提现',
  125. },
  126. {
  127. id: 1,
  128. name: '1305677',
  129. phoneNumber: '13800138000',
  130. createTime: '2025-04-03 10:00:00',
  131. money: '100.00',
  132. status: '已提现',
  133. },
  134. {
  135. id: 1,
  136. name: '1305677',
  137. phoneNumber: '13800138000',
  138. createTime: '2025-04-03 10:00:00',
  139. money: '100.00',
  140. status: '已提现',
  141. },
  142. {
  143. id: 1,
  144. name: '1305677',
  145. phoneNumber: '13800138000',
  146. createTime: '2025-04-03 10:00:00',
  147. money: '100.00',
  148. status: '已提现',
  149. },
  150. ],
  151. total: 1,
  152. },{
  153. title: '购买记录',
  154. query: {
  155. pageNum: 1,
  156. pageSize: 10,
  157. },
  158. data: [{
  159. id: 1,
  160. newPhone: '13800138000',
  161. finishTime: '2025-04-03 10:00:00',
  162. totalAmount: '100.00',
  163. rakeBackAmount: '30.00',
  164. },{
  165. id: 1,
  166. newPhone: '13800138000',
  167. finishTime: '2025-04-03 10:00:00',
  168. totalAmount: '100.00',
  169. rakeBackAmount: '30.00',
  170. },{
  171. id: 1,
  172. newPhone: '13800138000',
  173. finishTime: '2025-04-03 10:00:00',
  174. totalAmount: '100.00',
  175. rakeBackAmount: '30.00',
  176. },{
  177. id: 1,
  178. newPhone: '13800138000',
  179. finishTime: '2025-04-03 10:00:00',
  180. totalAmount: '100.00',
  181. rakeBackAmount: '30.00',
  182. },{
  183. id: 1,
  184. newPhone: '13800138000',
  185. finishTime: '2025-04-03 10:00:00',
  186. totalAmount: '100.00',
  187. rakeBackAmount: '30.00',
  188. }],
  189. total: 1,
  190. },{
  191. title: '提现记录',
  192. query: {
  193. pageNum: 1,
  194. pageSize: 10,
  195. },
  196. data: [{
  197. withdrawalTime: '2025-04-03 10:00:00',
  198. withdrawalMoney: '100.00',
  199. }],
  200. total: 0,
  201. }],
  202. }
  203. },
  204. // 页面初始化后触发
  205. async fetch() {
  206. await this.getActivityData();
  207. },
  208. computed: {
  209. // 是否为微信浏览器环境
  210. isWeChatBrowser() {
  211. return this.$userAgent.isWx;
  212. }
  213. },
  214. methods: {
  215. // nav right菜单点击事件
  216. onRightHandle() {
  217. this.$router.push({ path: '/activity/invite-user/invite-new-user-rule' })
  218. },
  219. // 分享按钮点击事件
  220. shareHandle() {
  221. this.$refs.sharePopup.showPopup();
  222. },
  223. // 分页点击事件
  224. pageChangeHandle(page) {
  225. let active = this.activeTab;
  226. this.tabs[active].query.pageNum = page;
  227. console.log('pageChangeHandle', page);
  228. // 发起请求
  229. },
  230. // 获取活动页上部分数据
  231. async getActivityData() {
  232. const res = await this.$axios.$get(
  233. '/activity/v5/activity/inviteNewUser/getInviteNewUserPageData',
  234. );
  235. let {
  236. registerCount, // 今日注册人数
  237. nickname, // 用户昵称
  238. withdrawalBalance, // 可提现余额
  239. inviteBuyAmount, // 累计邀请金额
  240. activityId, // 活动ID
  241. accumulatedWithdrawal, // 累计提现金额
  242. } = res.data;
  243. this.registerCount = registerCount;
  244. this.nickname = nickname;
  245. this.withdrawalBalance = withdrawalBalance;
  246. this.inviteBuyAmount = inviteBuyAmount;
  247. this.activityId = activityId;
  248. this.accumulatedWithdrawal = accumulatedWithdrawal;
  249. },
  250. // 获取活动页好友注册记录列表
  251. async getInviteRecordList() {
  252. const res = await this.$axios.$post(
  253. '/activity/v5/activity/inviteNewUser/getInviteNewRegisterUserData',
  254. { ...this.queryData, ...this.tabs[0].query }
  255. );
  256. this.tabs[0].data = res.data.list;
  257. this.tabs[0].total = res.data.total;
  258. },
  259. // 获取活动页好友购买记录列表
  260. async getInviteBuyRecordList() {
  261. const res = await this.$axios.$post(
  262. '/activity/v5/activity/inviteNewUser/getInviteNewUserBuyData',
  263. { ...this.queryData, ...this.tabs[1].query }
  264. );
  265. this.tabs[1].data = res.data.list;
  266. this.tabs[1].total = res.data.total;
  267. },
  268. // 获取活动页好友提现记录列表
  269. async getInviteWithdrawalRecordList() {
  270. const res = await this.$axios.$post(
  271. '/activity/v5/activity/inviteNewUser/getInviteNewUserWithdrawalRecodeList',
  272. {...this.queryData,...this.tabs[2].query }
  273. );
  274. this.tabs[2].data = res.data.list;
  275. this.tabs[2].total = res.data.total;
  276. }
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. .mb-12{
  282. margin-bottom: 12px;
  283. }
  284. // 动态生成 从 0 到 100px 的样式
  285. @for $i from 0 through 100 {
  286. .mb-#{$i} {
  287. margin-bottom: #{$i}px;
  288. }
  289. .mt-#{$i} {
  290. margin-top: #{$i}px;
  291. }
  292. .ml-#{$i} {
  293. margin-left: #{$i}px;
  294. }
  295. .mr-#{$i} {
  296. margin-right: #{$i}px;
  297. }
  298. }
  299. $-radeus-12: 12px;
  300. $-bg-yellow: rgb(255, 253, 241);
  301. .invite-container {
  302. font-size: 12px;
  303. height: 100%;
  304. width: 100%;
  305. display: flex;
  306. flex-direction: column;
  307. background-image: url('~assets/image/activity/invite-user/invite-new-user/bg-img.png');
  308. background-size: 100% auto;
  309. background-position: top;
  310. background-repeat: no-repeat;
  311. background-color: #EB3043;
  312. padding: 372px 16px 16px;
  313. .share-btn {
  314. height: 56px;
  315. background-color: #FF505C;
  316. background-image: url('~/assets/image/activity/invite-user/invite-new-user/share-to-earn-commission.png');
  317. background-size: 100% 100%;
  318. background-repeat: no-repeat;
  319. background-position: center;
  320. background-origin: padding-box;
  321. }
  322. .day-statistics{
  323. line-height: 32px;
  324. font-size: 14px;
  325. color: #FA393A;
  326. font-weight: 500;
  327. border-radius: $-radeus-12;
  328. background-color: $-bg-yellow;
  329. text-align: center;
  330. }
  331. .user-main{
  332. display: flex;
  333. flex-direction: column;
  334. background-color: $-bg-yellow;
  335. border-radius: $-radeus-12;
  336. .userinfo{
  337. display: flex;
  338. align-items: center;
  339. .avatar{
  340. width: 40px;
  341. height: 40px;
  342. border-radius: 50%;
  343. }
  344. .userinfo-text{
  345. display: flex;
  346. flex-direction: column;
  347. .userinfo-name{
  348. font-size: 14px;
  349. color: #242424;
  350. }
  351. .userinfo-id{
  352. color: #979797;
  353. }
  354. }
  355. }
  356. .possess-warp{
  357. display: flex;
  358. align-items: center;
  359. justify-content: space-between;
  360. .withdrawal-text{
  361. color: #0A132B;
  362. .withdrawal-money{
  363. color: #FA393A;
  364. font-size: 24px;
  365. font-weight: bold;
  366. }
  367. }
  368. .withdrawal-btn{
  369. width: 70px;
  370. line-height: 26px;
  371. border-radius: $-radeus-12;
  372. background-color: #FA393A;
  373. color: #fff;
  374. font-size: 14px;
  375. text-align: center;
  376. }
  377. }
  378. .userinfo-detail{
  379. display: flex;
  380. align-items: center;
  381. justify-content: space-between;
  382. .userinfo-detail-item{
  383. flex: 1;
  384. display: flex;
  385. flex-direction: column;
  386. align-items: start;
  387. background-color: rgb(255, 242, 231);
  388. border-radius: 12px;
  389. .userinfo-detail-item-content{
  390. font-size: 18px;
  391. font-weight: bold;
  392. color: #242424;
  393. }
  394. .userinfo-detail-item-title{
  395. font-weight: 400;
  396. color: #979797;
  397. }
  398. }
  399. }
  400. }
  401. .record-wrap{
  402. min-height: 220px;
  403. background-color: $-bg-yellow;
  404. border-radius: $-radeus-12;
  405. overflow: hidden;
  406. }
  407. }
  408. </style>