invite-new-user.vue 12 KB

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