share.vue 12 KB

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