user.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="bg"><image class="imgBg" src="../../static/user/img17.png" mode=""></image></view>
  5. <view class="title">
  6. <view class="header">
  7. <view class="tx"><image src="../../static/error/missing-face.png" mode=""></image></view>
  8. <view class="dl"><image src="../../static/user/jiedian1.png" mode=""></image></view>
  9. </view>
  10. <view class="message">
  11. <view class="name">{{ userInfo.nickname }}</view>
  12. <view class="phone">{{ userInfo.phone }}</view>
  13. <view class="vip-box">
  14. <view class="vip">会员等级LV.{{ userInfo.level }}</view>
  15. <view class="pintuan">拼团等级LV.2</view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="box">
  21. <view class="sweets-box">
  22. <view class="sweets" @click="nav('/pages/money/award')">
  23. <view class="limit">{{ candy || 0 }}</view>
  24. <view class="sweets-name">糖果</view>
  25. </view>
  26. <view class="jiange"></view>
  27. <view class="sweets" @click="nav('/pages/money/integralP')">
  28. <view class="limit">{{ jf || 0 }}</view>
  29. <view class="sweets-name">拼团积分</view>
  30. </view>
  31. <view class="jiange"></view>
  32. <view class="sweets" @click="nav('/pages/money/integralShopping')">
  33. <view class="limit">{{ userInfo.now_money*1 }}</view>
  34. <view class="sweets-name">货款</view>
  35. </view>
  36. <view class="jiange"></view>
  37. <view class="sweets" @click="nav('/pages/money/wallet')">
  38. <view class="limit">{{userInfo.brokerage_price * 1}}</view>
  39. <view class="sweets-name">佣金</view>
  40. </view>
  41. </view>
  42. <view class="my-order">
  43. <view class="box-title flex ">
  44. <view class="title1"><text>我的订单</text></view>
  45. <view class="link" @click="nav('/pages/order/order?state=0')" hover-class="common-hover"><text class="iconfont iconenter"></text></view>
  46. </view>
  47. <view class="order-section">
  48. <view class="order-item" @click="nav('/pages/order/order?state=0')" hover-class="common-hover" :hover-stay-time="50">
  49. <view class=" icon1 position-relative"><image class="icon-img" src="/static/user/user01.png" mode="aspectFit"></image></view>
  50. <text>待付款</text>
  51. </view>
  52. <view class="order-item" @click="nav('/pages/order/order?state=1')" hover-class="common-hover" :hover-stay-time="50">
  53. <view class="icon1 position-relative"><image class="icon-img" src="/static/user/user02.png" mode="aspectFit"></image></view>
  54. <text>待发货</text>
  55. </view>
  56. <view class="order-item" @click="nav('/pages/order/order?state=2')" hover-class="common-hover" :hover-stay-time="50">
  57. <view class="icon1 position-relative"><image class="icon-img" src="/static/user/user03.png" mode="aspectFit"></image></view>
  58. <text>待收货</text>
  59. </view>
  60. <view class="order-item" @click="nav('/pages/order/order?state=4')" hover-class="common-hover" :hover-stay-time="50">
  61. <view class=" icon1 position-relative"><image class="icon-img" src="/static/user/user04.png" mode="aspectFit"></image></view>
  62. <text>已完成</text>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="my-order">
  67. <view class="box-title flex ">
  68. <view class="title1"><text>更多功能</text></view>
  69. <view class="link" hover-class="common-hover"></view>
  70. </view>
  71. <view class="order-section">
  72. <view class="order-item" @click="nav('/pages/user/extension')" hover-class="common-hover" :hover-stay-time="50">
  73. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/myTeam.png" mode="aspectFit"></image></view>
  74. <text>我的资产</text>
  75. </view>
  76. <view class="order-item" @click="nav('/pages/user/extension')" hover-class="common-hover" :hover-stay-time="50">
  77. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/myTeam.png" mode="aspectFit"></image></view>
  78. <text>我的团队</text>
  79. </view>
  80. <view class="order-item" @click="nav('/pages/user/myjiedian')" hover-class="common-hover" :hover-stay-time="50">
  81. <view class="icon1 position-relative"><image class="icon-img" src="../../static/user/myTeams.png" mode="aspectFit"></image></view>
  82. <text>互助团队</text>
  83. </view>
  84. <view class="order-item" @click="nav('/pages/user/shareQrCode')" hover-class="common-hover" :hover-stay-time="50">
  85. <view class="icon1 position-relative"><image class="icon-img" src="../../static/user/myShare.png" mode="aspectFit"></image></view>
  86. <text>团队邀请</text>
  87. </view>
  88. <view class="order-item" @click="nav('/pages/user/extension')" hover-class="common-hover" :hover-stay-time="50">
  89. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/myTeam.png" mode="aspectFit"></image></view>
  90. <text>银行卡管理</text>
  91. </view>
  92. <view class="order-item" @click="nav('/pages/address/address')" hover-class="common-hover" :hover-stay-time="50">
  93. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/myAddress.png" mode="aspectFit"></image></view>
  94. <text>收货地址</text>
  95. </view>
  96. <view class="order-item" @click="server()" hover-class="common-hover" :hover-stay-time="50">
  97. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/myKefu.png" mode="aspectFit"></image></view>
  98. <text>联系客服</text>
  99. </view>
  100. <view class="order-item" @click="nav('/pages/user/about')" hover-class="common-hover" :hover-stay-time="50">
  101. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/myAbout.png" mode="aspectFit"></image></view>
  102. <text>关于我们</text>
  103. </view>
  104. <view class="order-item" @click="nav('/pages/set/set')" hover-class="common-hover" :hover-stay-time="50">
  105. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/mySet.png" mode="aspectFit"></image></view>
  106. <text>设置</text>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="my-order">
  112. <view class="box-title flex ">
  113. <view class="title1"><text>拼购工具</text></view>
  114. <view class="link" hover-class="common-hover"></view>
  115. </view>
  116. <view class="order-section">
  117. <view class="order-item" @click="nav('/pages/assets/myPing')" hover-class="common-hover" :hover-stay-time="50">
  118. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/myPing.png" mode="aspectFit"></image></view>
  119. <text>我的拼购</text>
  120. </view>
  121. <view class="order-item" @click="nav('/pages/user/myNote')" hover-class="common-hover" :hover-stay-time="50">
  122. <view class="icon1 position-relative"><image class="icon-img" src="../../static/user/myPoint.png" mode="aspectFit"></image></view>
  123. <text>我的节点</text>
  124. </view>
  125. <view class="order-item" @click="nav('/pages/market/myCalculation')" hover-class="common-hover" :hover-stay-time="50">
  126. <view class="icon1 position-relative"><image class="icon-img" src="../../static/user/myFu.png" mode="aspectFit"></image></view>
  127. <text>我的服务器</text>
  128. </view>
  129. <view class="order-item" @click="nav('/pages/index/info')" hover-class="common-hover" :hover-stay-time="50">
  130. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/data.png" mode="aspectFit"></image></view>
  131. <text>汇总数据</text>
  132. </view>
  133. </view>
  134. </view>
  135. <uni-popup ref="popup" type="center">
  136. <view class="popup">
  137. <view class="popup-dox">
  138. <image class="popup-logo" src="../../static/img/lianxi.png"></image>
  139. <view class="pop-title">已为您定制专属客服</view>
  140. <view>{{ weixin }}</view>
  141. <image class="popup-text" @longtap="bc_code" :src="erweima"></image>
  142. <view class="btn" @click="copy(weixin)">复制微信号</view>
  143. <view class="pop-tip flex">
  144. <view class="weixin"><image src="../../static/img/weixin.png" mode=""></image></view>
  145. <view>长按保存二维码</view>
  146. </view>
  147. </view>
  148. </view>
  149. <view class="close_icon" @click="close"><image src="../../static/img/Close.png"></image></view>
  150. </uni-popup>
  151. </view>
  152. </template>
  153. <script>
  154. import { wallet } from '@/api/finance.js';
  155. import uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
  156. import { mapState, mapMutations } from 'vuex';
  157. import uniList from '@/components/uni-list/uni-list.vue';
  158. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  159. import { orderData, getUserInfo, service } from '@/api/user.js';
  160. import { saveUrl, interceptor } from '@/utils/loginUtils.js';
  161. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  162. export default {
  163. components: {
  164. uniList,
  165. uniListItem,
  166. uniPopup
  167. },
  168. data() {
  169. return {
  170. erweima: '',
  171. weixin: '',
  172. wallet: '',
  173. candy:'',//糖果数量
  174. jf:'',//拼团积分
  175. };
  176. },
  177. onShow() {
  178. //判断是否已经登录
  179. if (this.hasLogin) {
  180. this.loadBaseData();
  181. } else {
  182. uni.showModal({
  183. title: '登录',
  184. content: '您未登录,是否马上登陆?',
  185. success: e => {
  186. if (e.confirm) {
  187. interceptor();
  188. }
  189. },
  190. fail: e => {
  191. console.log(e);
  192. }
  193. });
  194. }
  195. },
  196. computed: {
  197. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  198. },
  199. methods: {
  200. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  201. loadBaseData() {
  202. console.log(this.userInfo);
  203. getUserInfo({}).then(({ data }) => {
  204. this.setUserInfo(data);
  205. });
  206. service({}).then(({ data }) => {
  207. this.erweima = data.service_qr;
  208. this.weixin = data.service_wechat;
  209. });
  210. wallet({}).then(({ data }) => {
  211. const obj = this
  212. const arr = Object.keys(data.back);
  213. console.log(arr);
  214. let ar = [];
  215. arr.forEach(e => {
  216. console.log(e,'11111')
  217. if(e == 'LALA'){
  218. obj.candy = (data.back[e].money.money*1).toFixed(0)
  219. }
  220. if(e == 'USDC'){
  221. obj.jf = (data.back[e].money.money*1)
  222. }
  223. ar.push(data.back[e]);
  224. });
  225. });
  226. },
  227. server() {
  228. this.$refs.popup.open();
  229. },
  230. close() {
  231. this.$refs.popup.close();
  232. },
  233. nav(url) {
  234. // 判断是否已经登录
  235. // if (this.hasLogin) {
  236. console.log(url);
  237. uni.navigateTo({
  238. url: url,
  239. fail() {
  240. uni.switchTab({
  241. url: url
  242. });
  243. }
  244. });
  245. // }else {
  246. // uni.showModal({
  247. // title: '登录',
  248. // content: '您未登录,是否马上登陆?',
  249. // success: e => {
  250. // if (e.confirm) {
  251. // interceptor();
  252. // }
  253. // },
  254. // fail: e => {{}
  255. // console.log(e);
  256. // }
  257. // });
  258. // }
  259. },
  260. bc_code() {
  261. let that = this;
  262. console.log('保存二维码', this.erweima);
  263. uni.downloadFile({
  264. //获得二维码的临时地址
  265. url: this.erweima,
  266. success: res => {
  267. //console.log('获取url',res)
  268. if (res.statusCode == 200) {
  269. uni.saveImageToPhotosAlbum({
  270. filePath: res.tempFilePath, //传入临时地址
  271. success() {
  272. that.$api.msg('保存成功'); //封装的提示
  273. },
  274. fail() {
  275. that.$api.msg('保存失败');
  276. }
  277. });
  278. }
  279. }
  280. });
  281. },
  282. copy(value) {
  283. let obj = this;
  284. let content = value; //需要复制的内容
  285. console.log('复制的内容:', content);
  286. // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  287. const result = uniCopy(content);
  288. if (result === false) {
  289. uni.showToast({
  290. title: '不支持'
  291. });
  292. } else {
  293. uni.showToast({
  294. title: '复制成功',
  295. icon: 'none'
  296. });
  297. }
  298. }
  299. }
  300. };
  301. </script>
  302. <style lang="scss">
  303. page,
  304. .content {
  305. height: auto;
  306. min-height: 100%;
  307. background-color: #ffffff;
  308. padding-bottom: 44rpx;
  309. }
  310. .top {
  311. width: 100%;
  312. height: 530rpx;
  313. position: relative;
  314. .bg {
  315. position: absolute;
  316. width: 100%;
  317. height: 530rpx;
  318. image {
  319. width: 100%;
  320. height: 100%;
  321. }
  322. }
  323. .title {
  324. position: relative;
  325. display: flex;
  326. flex-direction: column;
  327. top: 20%;
  328. .header {
  329. display: flex;
  330. flex-direction: column;
  331. align-items: center;
  332. .tx {
  333. width: 132rpx;
  334. height: 132rpx;
  335. image {
  336. width: 100%;
  337. height: 100%;
  338. }
  339. }
  340. .dl {
  341. position: relative;
  342. margin-top: -16rpx;
  343. width: 100rpx;
  344. height: 32rpx;
  345. image {
  346. width: 100%;
  347. height: 100%;
  348. }
  349. }
  350. }
  351. .message {
  352. margin-top: 10rpx;
  353. display: flex;
  354. flex-direction: column;
  355. align-items: center;
  356. .name {
  357. font-size: 34rpx;
  358. font-family: PingFang SC;
  359. font-weight: bold;
  360. color: #ffffff;
  361. }
  362. .phone {
  363. font-size: 26rpx;
  364. font-family: PingFang SC;
  365. font-weight: 500;
  366. color: #ffffff;
  367. }
  368. }
  369. .vip-box {
  370. margin-top: 10rpx;
  371. display: flex;
  372. align-items: center;
  373. .vip {
  374. padding: 6rpx 16rpx;
  375. text-align: center;
  376. background: #ffffff;
  377. border-radius: 24rpx;
  378. font-size: 20rpx;
  379. font-family: PingFang SC;
  380. font-weight: bold;
  381. color: #2e58ff;
  382. margin-right: 10rpx;
  383. }
  384. .pintuan {
  385. padding: 6rpx 16rpx;
  386. text-align: center;
  387. background: #ffffff;
  388. border-radius: 24rpx;
  389. font-size: 20rpx;
  390. font-family: PingFang SC;
  391. font-weight: bold;
  392. color: #2e58ff;
  393. }
  394. }
  395. }
  396. }
  397. .box {
  398. display: flex;
  399. flex-direction: column;
  400. width: 710rpx;
  401. position: relative;
  402. margin: -80rpx 20rpx;
  403. color: #fefefe;
  404. }
  405. .sweets-box {
  406. display: flex;
  407. align-items: center;
  408. width: 710rpx;
  409. padding: 48rpx 0;
  410. background: #ffffff;
  411. box-shadow: 0px 0px 20px 0px rgba(50, 50, 52, 0.06);
  412. border-radius: 20rpx;
  413. .jiange {
  414. width: 1rpx;
  415. height: 36rpx;
  416. background: #999999;
  417. }
  418. .sweets {
  419. width: 25%;
  420. display: flex;
  421. flex-direction: column;
  422. align-items: center;
  423. font-size: 28rpx;
  424. font-family: PingFang SC;
  425. font-weight: 500;
  426. .limit {
  427. font-size: 36rpx;
  428. font-family: PingFang SC;
  429. font-weight: bold;
  430. color: #666666;
  431. }
  432. .sweets-name {
  433. font-size: 28rpx;
  434. font-family: PingFang SC;
  435. font-weight: 500;
  436. color: #666666;
  437. }
  438. }
  439. }
  440. .my-order {
  441. margin: 80rpx auto 0;
  442. display: flex;
  443. justify-content: space-between;
  444. flex-direction: column;
  445. width: 710rpx;
  446. background: #ffffff;
  447. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  448. border-radius: 20rpx;
  449. }
  450. .box-title {
  451. border-top-left-radius: 20rpx;
  452. border-top-right-radius: 20rpx;
  453. background-color: #ffffff;
  454. line-height: 1;
  455. padding: 26rpx 34rpx 20rpx;
  456. border-bottom: 1px solid #f5f5f5;
  457. .title1 {
  458. font-size: 30rpx;
  459. font-family: PingFang SC;
  460. font-weight: bold;
  461. color: #333333;
  462. }
  463. .link {
  464. font-size: $font-base - 2rpx;
  465. color: $font-color-light;
  466. }
  467. }
  468. .order-section {
  469. display: flex;
  470. flex-wrap: wrap;
  471. align-items: center;
  472. text-align: center;
  473. padding: 34rpx 0 10rpx;
  474. .order-item {
  475. display: flex;
  476. flex-direction: column;
  477. width: 25%;
  478. align-items: center;
  479. height: 140rpx;
  480. font-size: $font-sm;
  481. color: $font-color-dark;
  482. }
  483. .iconfont {
  484. font-size: 48rpx;
  485. margin-bottom: 18rpx;
  486. color: #fa436a;
  487. }
  488. .icon-shouhoutuikuan {
  489. font-size: 44rpx;
  490. }
  491. .icon {
  492. height: 88rpx;
  493. width: 90rpx;
  494. margin-bottom: 18rpx;
  495. background-size: 100%;
  496. background-repeat: no-repeat;
  497. background-position: center;
  498. .icon-img {
  499. width: 100%;
  500. height: 100%;
  501. }
  502. }
  503. .icon1 {
  504. height: 50rpx;
  505. width: 48rpx;
  506. margin-bottom: 18rpx;
  507. background-size: 100%;
  508. background-repeat: no-repeat;
  509. background-position: center;
  510. .icon-img {
  511. width: 100%;
  512. height: 100%;
  513. }
  514. }
  515. }
  516. .popup {
  517. width: 640rpx;
  518. background-color: #ffffff;
  519. border-radius: 15rpx;
  520. text-align: center;
  521. .popup-dox {
  522. position: relative;
  523. top: -60rpx;
  524. .popup-logo {
  525. width: 460rpx;
  526. height: 132rpx;
  527. }
  528. .pop-title {
  529. font-size: 40rpx;
  530. font-weight: bold;
  531. color: #333333;
  532. padding: 25rpx 0rpx;
  533. margin-bottom: 50rpx;
  534. }
  535. .popup-text {
  536. width: 400rpx;
  537. height: 400rpx;
  538. margin-bottom: 50rpx;
  539. }
  540. .btn {
  541. width: 300rpx;
  542. height: 50rpx;
  543. line-height: 50rpx;
  544. background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
  545. margin: 0 auto;
  546. color: #ffffff;
  547. border-radius: 25rpx;
  548. }
  549. .pop-tip {
  550. font-size: 30rpx;
  551. font-weight: 500;
  552. color: #333333;
  553. justify-content: center;
  554. margin-top: 20rpx;
  555. .weixin {
  556. width: 48rpx;
  557. height: 40rpx;
  558. margin-right: 14rpx;
  559. image {
  560. width: 48rpx;
  561. height: 40rpx;
  562. }
  563. }
  564. }
  565. }
  566. }
  567. .close_icon {
  568. width: 60rpx;
  569. height: 60rpx;
  570. margin: 88rpx auto 0;
  571. image {
  572. width: 100%;
  573. height: 100%;
  574. }
  575. }
  576. </style>