share.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. *-+
  2. <template>
  3. <view class="content">
  4. <top></top>
  5. <view class="top-tit">邀请好友 变成壕友</view>
  6. <view class="center-wrap">
  7. <image src="../../static/img/tj-bg.png" mode="" class="tj-bg"></image>
  8. <view class="center-tit">邀请地址</view>
  9. <!-- <view class="tj-jl flex" @click="opneYj">
  10. <text>业</text>
  11. <text>绩</text>
  12. </view> -->
  13. <view class="tj-lj-tit">【链接地址】</view>
  14. <view class="tj-lj flex">
  15. <view class="lj-tit">邀请链接:</view>
  16. <view class="lj-info clamp">{{ address | addFile }}</view>
  17. <view class="lj-copy" @click="copy(address)">复制链接</view>
  18. </view>
  19. <view class="tj-lj1 flex">
  20. <view class="lj-tit">绑定关系:</view>
  21. <view class="lj-info clamp" v-if="!userInfo.spread"><input type="text" v-model="recommend" value="" /></view>
  22. <view class="lj-info clamp" v-if="userInfo.spread">{{ userInfo.spread.address | addFile }}</view>
  23. <view class="lj-copy" v-if="!userInfo.spread" @click="spare()">绑定关系</view>
  24. </view>
  25. </view>
  26. <<<<<<< HEAD
  27. <view class="bottom">
  28. <image class="bottom-bg" src="../../static/img/bottom.png" mode=""></image>
  29. <view class="btn" @click="button()">查看推荐</view>
  30. </view>
  31. <!-- <uni-popup ref="yeji" type="center">
  32. =======
  33. <<<<<<< HEAD
  34. <view class="tj-look" @click="getReferrer()">
  35. 查看推荐
  36. </view>
  37. =======
  38. <view class="tj-look" @click="button()">查看推荐</view>
  39. >>>>>>> 5fe50ff5c260e745ba7833a119b93bf915605eb5
  40. <uni-popup ref="yeji" type="center">
  41. >>>>>>> be58bfe5874c430483ea559c136a0a93cde5e317
  42. <view class="yj-wrap">
  43. <view class="yj-tit">收益明细</view>
  44. <image src="../../static/img/yj-bg.png" mode="" class="yj-logo"></image>
  45. <view class="yj-hj flex">
  46. <view class="yj-hj-item">
  47. <view class="hj-item-val">0</view>
  48. <view class="hj-item-name">KGC总业绩</view>
  49. </view>
  50. <view class="yj-hj-item">
  51. <view class="hj-item-val">0</view>
  52. <view class="hj-item-name">FL总业绩</view>
  53. </view>
  54. </view>
  55. <view class="yj-nav flex">
  56. <view class="nav-item" v-for="(navitem, index) in navList" :class="{ active: index == tabIndex }" @click="navClick(index)">{{ navitem.name }}</view>
  57. </view>
  58. <view class="yj-info-wrap">
  59. <view class="yj-info-tit flex">
  60. <view class="">时间</view>
  61. <view class="">金额(KGC)</view>
  62. </view>
  63. <swiper class="yj-info-scroll" :current="tabIndex" duration="300">
  64. <swiper-item v-for="item in navList">
  65. <scroll-view scroll-y="true" class="yj-info-scroll" @scrolltolower="loadMore">
  66. <view v-for="itemt in item.list" class="">
  67. <view class="flex yj-info">
  68. <view class="">{{ itemt.time }}</view>
  69. <view class="">{{ itemt.val }}</view>
  70. </view>
  71. </view>
  72. <uni-load-more :status="item.loadingType"></uni-load-more>
  73. </scroll-view>
  74. </swiper-item>
  75. </swiper>
  76. </view>
  77. </view>
  78. </uni-popup> -->
  79. <uni-popup ref="yeji1" type="center">
  80. <view class="yj-wrap">
  81. <view class="yj-tit">我的推荐</view>
  82. <image src="../../static/img/yj-bg.png" mode="" class="yj-logo"></image>
  83. <view class="yj-info-wrap">
  84. <view class="yj-info-tit flex">
  85. <view class="">钱包地址</view>
  86. <view class="">时间</view>
  87. </view>
  88. <scroll-view scroll-y="true" class="yj-info-scroll" @scrolltolower="spreadList">
  89. <view v-for="itemt in List" class="">
  90. <view class="flex yj-info">
  91. <view class="address clamp">{{ itemt.address }}</view>
  92. <view class="time">{{ itemt.spread_time }}</view>
  93. </view>
  94. </view>
  95. <uni-load-more :status="loadingType"></uni-load-more>
  96. </scroll-view>
  97. </view>
  98. </view>
  99. <view class="popup-x" @click="closeRecord()"><image src="../../static/img/x.png" mode=""></image></view>
  100. </uni-popup>
  101. </view>
  102. </template>
  103. <script>
  104. import top from '@/components/top/top.vue';
  105. import { mapState, mapMutations } from 'vuex';
  106. import { addSpread, spreadList } from '@/api/index.js';
  107. import { getTime } from '@/utils/rocessor.js';
  108. import uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
  109. export default {
  110. comments: {
  111. top
  112. },
  113. computed: {
  114. ...mapState('user', ['address', 'hasLogin', 'userInfo'])
  115. },
  116. filters: {
  117. addFile(provider) {
  118. if (provider.length >= 19) {
  119. var subStr1 = provider.substr(0, 13);
  120. var subStr2 = provider.substr(provider.length - 6, 6);
  121. var subStr = subStr1 + '...' + subStr2;
  122. provider = subStr;
  123. }
  124. return provider;
  125. }
  126. },
  127. data() {
  128. return {
  129. navList: [
  130. {
  131. name: '直推业绩',
  132. page: 1,
  133. limit: 8,
  134. list: [],
  135. loaded: false,
  136. loadingType: 'more'
  137. },
  138. {
  139. name: '间推业绩',
  140. page: 1,
  141. limit: 8,
  142. list: [],
  143. loaded: false,
  144. loadingType: 'more'
  145. }
  146. ],
  147. List:[],
  148. tabIndex: 0,
  149. page: 1,
  150. limit: 8,
  151. loadingType: 'more'
  152. };
  153. },
  154. onShow() {
  155. this.spreadList();
  156. },
  157. methods: {
  158. closeRecord() {
  159. this.$refs.yeji1.close();
  160. },
  161. spreadList(){
  162. let obj = this;
  163. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  164. return;
  165. }
  166. spreadList({page:obj.page,limit:obj.limit}).then(({data}) =>{
  167. data.data.list.forEach(e =>{
  168. if(e.spread_time != null){
  169. e.spread_time = getTime(e.spread_time)
  170. }
  171. })
  172. this.List = this.List.concat(data.data.list);
  173. if(data.data.list.length != obj.limit){
  174. obj.loadingType = 'noMore'
  175. }else {
  176. obj.page++
  177. obj.loadingType = 'more'
  178. }
  179. })
  180. obj.loadingType = 'loading';
  181. },
  182. copy(value) {
  183. let obj = this;
  184. let content = value; //需要复制的内容
  185. console.log('复制的内容:', content);
  186. // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  187. const result = uniCopy(content);
  188. if (result === false) {
  189. uni.showToast({
  190. title: '不支持'
  191. });
  192. } else {
  193. uni.showToast({
  194. title: '复制成功',
  195. icon: 'none'
  196. });
  197. }
  198. },
  199. spare() {
  200. const obj = this;
  201. if (this.recommend == '') {
  202. this.$api.msg('请填写要加入流量的地址');
  203. return;
  204. }
  205. uni.showModal({
  206. title: '提示',
  207. content: '您是否要绑定到改流量(' + this.recommend + ')',
  208. success: function(res) {
  209. if (res.confirm) {
  210. addSpread({ address: obj.recommend }).then(e => {
  211. console.log(e, '123468');
  212. if (e.code == 1) {
  213. obj.$api.msg('绑定成功');
  214. window.location.reload();
  215. }
  216. });
  217. } else if (res.cancel) {
  218. console.log('用户点击取消');
  219. }
  220. }
  221. });
  222. },
  223. qrR() {},
  224. opneYj() {
  225. this.$refs.yeji.open();
  226. },
  227. button() {
  228. this.$refs.yeji1.open();
  229. },
  230. // 点击切换
  231. navClick(index) {
  232. this.tabIndex = index;
  233. },
  234. // 下滑到底加载更多
  235. loadMore() {
  236. let obj = this;
  237. let index = obj.tabIndex;
  238. let navItem = obj.navList[index];
  239. if (navItem.loadingType == 'noMore' || navItem.loadingType == 'loading') {
  240. return;
  241. }
  242. navItem.loadingType = 'loading';
  243. console.log('jiaz');
  244. }
  245. }
  246. };
  247. </script>
  248. <style lang="scss" scoped>
  249. page {
  250. background-color: #00050f;
  251. }
  252. .top-tit {
  253. text-align: center;
  254. font-size: 160rpx;
  255. font-family: zihun164hao-fangyuehei;
  256. font-weight: 400;
  257. font-style: italic;
  258. color: #08ede7;
  259. line-height: 168rpx;
  260. margin-bottom: 62rpx;
  261. }
  262. .box-top {
  263. display: flex;
  264. padding: 36rpx 41rpx 72rpx 41rpx;
  265. .bg3 {
  266. width: 56rpx;
  267. height: 62rpx;
  268. image {
  269. width: 100%;
  270. height: 100%;
  271. }
  272. }
  273. .two {
  274. margin-left: 36rpx;
  275. image {
  276. width: 100%;
  277. height: 100%;
  278. }
  279. }
  280. }
  281. .center-wrap {
  282. width: 680rpx;
  283. height: 891rpx;
  284. margin: auto;
  285. position: relative;
  286. .tj-bg {
  287. position: absolute;
  288. width: 680rpx;
  289. height: 891rpx;
  290. }
  291. .center-tit {
  292. width: 680rpx;
  293. height: 102rpx;
  294. line-height: 102rpx;
  295. text-align: center;
  296. font-size: 44rpx;
  297. font-family: zihun100hao-fangfangxianfengti;
  298. font-weight: 900;
  299. color: #08ede7;
  300. position: absolute;
  301. top: 0;
  302. }
  303. .tj-jl {
  304. text-align: center;
  305. width: 61rpx;
  306. height: 110rpx;
  307. background: #08ede7;
  308. border-radius: 10rpx 0px 0px 10rpx;
  309. position: absolute;
  310. right: 0;
  311. top: 170rpx;
  312. font-size: 32rpx;
  313. font-family: PingFang SC;
  314. font-weight: bold;
  315. color: #001337;
  316. // line-height: 40rpx;
  317. flex-direction: column;
  318. justify-content: center;
  319. }
  320. .tj-qr {
  321. width: 383rpx;
  322. height: 383rpx;
  323. background: #ffffff;
  324. border: 5rpx solid #08ede7;
  325. position: absolute;
  326. right: 0;
  327. left: 0;
  328. top: 204rpx;
  329. margin: auto;
  330. }
  331. .tj-lj-tit {
  332. width: 680rpx;
  333. text-align: center;
  334. font-size: 31rpx;
  335. font-family: PingFang SC;
  336. font-weight: bold;
  337. color: #ffffff;
  338. line-height: 103px;
  339. position: absolute;
  340. top: 560rpx;
  341. }
  342. .tj-lj1 {
  343. width: 636rpx;
  344. height: 67rpx;
  345. background: #233b75;
  346. border: 2rpx solid #08ede7;
  347. border-radius: 10rpx;
  348. position: absolute;
  349. bottom: 30rpx;
  350. right: 0;
  351. left: 0;
  352. margin: auto;
  353. }
  354. .tj-lj {
  355. width: 636rpx;
  356. height: 67rpx;
  357. background: #233b75;
  358. border: 2rpx solid #08ede7;
  359. border-radius: 10rpx;
  360. position: absolute;
  361. bottom: 124rpx;
  362. right: 0;
  363. left: 0;
  364. margin: auto;
  365. }
  366. .lj-tit {
  367. width: 148rpx;
  368. flex-shrink: 0;
  369. text-align: right;
  370. font-size: 28rpx;
  371. font-family: PingFang SC;
  372. font-weight: bold;
  373. color: #ffffff;
  374. line-height: 67rpx;
  375. }
  376. .lj-info {
  377. width: 148rpx;
  378. flex-grow: 1;
  379. text-align: left;
  380. font-size: 28rpx;
  381. font-family: PingFang SC;
  382. font-weight: bold;
  383. color: #ffffff;
  384. line-height: 67rpx;
  385. }
  386. .lj-copy {
  387. flex-shrink: 0;
  388. width: 148rpx;
  389. font-size: 28rpx;
  390. font-family: PingFang SC;
  391. font-weight: bold;
  392. color: #08ede7;
  393. line-height: 67rpx;
  394. // opacity: 0.75;
  395. }
  396. }
  397. .bottom {
  398. padding-top: 182rpx;
  399. position: relative;
  400. width: 750rpx;
  401. height: 434rpx;
  402. margin-top: -118rpx;
  403. .bottom-bg {
  404. position: absolute;
  405. top: 0;
  406. left: 0;
  407. right: 0;
  408. height: 100%;
  409. width: 100%;
  410. }
  411. .btn {
  412. position: relative;
  413. z-index: 3;
  414. margin: 0 auto;
  415. width: 450rpx;
  416. height: 76rpx;
  417. background: linear-gradient(0deg, #ff7206, #ffdd7e);
  418. box-shadow: 0px 2px 8px 0px rgba(207, 126, 57, 0.7);
  419. border-radius: 38rpx;
  420. text-align: center;
  421. line-height: 76rpx;
  422. font-size: 36rpx;
  423. font-family: zihun164hao-fangyuehei;
  424. font-weight: 400;
  425. color: #ffffff;
  426. }
  427. }
  428. .yj-wrap {
  429. width: 680rpx;
  430. height: 854rpx;
  431. background: linear-gradient(180deg, #254fab 0%, #230a8e 100%);
  432. border-radius: 20rpx;
  433. .yj-logo {
  434. display: block;
  435. width: 326rpx;
  436. height: 16rpx;
  437. margin: auto;
  438. border-radius: 20px;
  439. }
  440. .yj-tit {
  441. width: 100%;
  442. padding-top: 60rpx;
  443. padding-bottom: 15rpx;
  444. text-align: center;
  445. font-size: 46rpx;
  446. font-family: zihun100hao-fangfangxianfengti;
  447. font-weight: bold;
  448. color: #ffffff;
  449. // line-height: 38px;
  450. }
  451. .yj-hj {
  452. width: 653rpx;
  453. height: 147rpx;
  454. background: #233b75;
  455. border: 2rpx solid #08ede7;
  456. border-radius: 10rpx;
  457. margin: 40rpx auto;
  458. .yj-hj-item {
  459. width: 50%;
  460. text-align: center;
  461. font-size: 28rpx;
  462. font-family: PingFang SC;
  463. font-weight: bold;
  464. color: #ffffff;
  465. line-height: 38rpx;
  466. // opacity: 0.7;
  467. .hj-item-val {
  468. font-size: 41rpx;
  469. padding-bottom: 10rpx;
  470. font-family: PingFang SC;
  471. font-weight: bold;
  472. color: #08ede7;
  473. line-height: 38rpx;
  474. }
  475. }
  476. }
  477. .yj-nav {
  478. width: 582rpx;
  479. border-bottom: 2rpx solid #fff;
  480. margin: auto;
  481. font-size: 28rpx;
  482. font-family: PingFang SC;
  483. font-weight: bold;
  484. color: #97a1d2;
  485. line-height: 38rpx;
  486. .nav-item {
  487. padding: 20rpx 40rpx;
  488. }
  489. .active {
  490. color: #fff;
  491. }
  492. }
  493. }
  494. .yj-info-wrap {
  495. height: 362rpx;
  496. width: 582rpx;
  497. margin: auto;
  498. // background-color: #fff;
  499. .yj-info-tit {
  500. font-size: 28rpx;
  501. font-family: PingFang SC;
  502. font-weight: bold;
  503. color: #ffffff;
  504. line-height: 38rpx;
  505. justify-content: space-between;
  506. padding: 10rpx 0;
  507. }
  508. .yj-info-scroll {
  509. width: 582rpx;
  510. height: 320rpx;
  511. .yj-info {
  512. font-size: 28rpx;
  513. font-family: PingFang SC;
  514. font-weight: bold;
  515. color: #ffffff;
  516. line-height: 38rpx;
  517. .address {
  518. width: 60%;
  519. }
  520. }
  521. }
  522. }
  523. .popup-x {
  524. margin: 62rpx auto 0;
  525. width: 66rpx;
  526. height: 66rpx;
  527. image {
  528. width: 100%;
  529. height: 100%;
  530. }
  531. }
  532. </style>