user.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  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/assets')" hover-class="common-hover" :hover-stay-time="50">
  73. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/myMoney.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/collection/collection')" hover-class="common-hover" :hover-stay-time="50">
  89. <view class=" icon1 position-relative"><image class="icon-img" src="../../static/user/bank.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" style="margin-top: 80rpx;">
  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. console.log(data)
  212. const obj = this
  213. const arr = Object.keys(data.back);
  214. console.log(arr);
  215. let ar = [];
  216. arr.forEach(e => {
  217. console.log(e,'11111')
  218. if(e == 'LALA'){
  219. obj.candy = (data.back[e].money.money*1).toFixed(0)
  220. }
  221. if(e == 'USDC'){
  222. obj.jf = (data.back[e].money.money*1)
  223. }
  224. ar.push(data.back[e]);
  225. });
  226. });
  227. },
  228. server() {
  229. this.$refs.popup.open();
  230. },
  231. close() {
  232. this.$refs.popup.close();
  233. },
  234. nav(url) {
  235. // 判断是否已经登录
  236. // if (this.hasLogin) {
  237. console.log(url);
  238. uni.navigateTo({
  239. url: url,
  240. fail() {
  241. uni.switchTab({
  242. url: url
  243. });
  244. }
  245. });
  246. // }else {
  247. // uni.showModal({
  248. // title: '登录',
  249. // content: '您未登录,是否马上登陆?',
  250. // success: e => {
  251. // if (e.confirm) {
  252. // interceptor();
  253. // }
  254. // },
  255. // fail: e => {{}
  256. // console.log(e);
  257. // }
  258. // });
  259. // }
  260. },
  261. bc_code() {
  262. let that = this;
  263. console.log('保存二维码', this.erweima);
  264. uni.downloadFile({
  265. //获得二维码的临时地址
  266. url: this.erweima,
  267. success: res => {
  268. //console.log('获取url',res)
  269. if (res.statusCode == 200) {
  270. uni.saveImageToPhotosAlbum({
  271. filePath: res.tempFilePath, //传入临时地址
  272. success() {
  273. that.$api.msg('保存成功'); //封装的提示
  274. },
  275. fail() {
  276. that.$api.msg('保存失败');
  277. }
  278. });
  279. }
  280. }
  281. });
  282. },
  283. copy(value) {
  284. let obj = this;
  285. let content = value; //需要复制的内容
  286. console.log('复制的内容:', content);
  287. // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  288. const result = uniCopy(content);
  289. if (result === false) {
  290. uni.showToast({
  291. title: '不支持'
  292. });
  293. } else {
  294. uni.showToast({
  295. title: '复制成功',
  296. icon: 'none'
  297. });
  298. }
  299. }
  300. }
  301. };
  302. </script>
  303. <style lang="scss">
  304. page,
  305. .content {
  306. height: auto;
  307. min-height: 100%;
  308. background-color: #ffffff;
  309. padding-bottom: 44rpx;
  310. }
  311. .top {
  312. width: 100%;
  313. height: 530rpx;
  314. position: relative;
  315. .bg {
  316. position: absolute;
  317. width: 100%;
  318. height: 530rpx;
  319. image {
  320. width: 100%;
  321. height: 100%;
  322. }
  323. }
  324. .title {
  325. position: relative;
  326. display: flex;
  327. flex-direction: column;
  328. top: 20%;
  329. .header {
  330. display: flex;
  331. flex-direction: column;
  332. align-items: center;
  333. .tx {
  334. width: 132rpx;
  335. height: 132rpx;
  336. image {
  337. width: 100%;
  338. height: 100%;
  339. }
  340. }
  341. .dl {
  342. position: relative;
  343. margin-top: -16rpx;
  344. width: 100rpx;
  345. height: 32rpx;
  346. image {
  347. width: 100%;
  348. height: 100%;
  349. }
  350. }
  351. }
  352. .message {
  353. margin-top: 10rpx;
  354. display: flex;
  355. flex-direction: column;
  356. align-items: center;
  357. .name {
  358. font-size: 34rpx;
  359. font-family: PingFang SC;
  360. font-weight: bold;
  361. color: #ffffff;
  362. }
  363. .phone {
  364. font-size: 26rpx;
  365. font-family: PingFang SC;
  366. font-weight: 500;
  367. color: #ffffff;
  368. }
  369. }
  370. .vip-box {
  371. margin-top: 10rpx;
  372. display: flex;
  373. align-items: center;
  374. .vip {
  375. padding: 6rpx 16rpx;
  376. text-align: center;
  377. background: #ffffff;
  378. border-radius: 24rpx;
  379. font-size: 20rpx;
  380. font-family: PingFang SC;
  381. font-weight: bold;
  382. color: #2e58ff;
  383. margin-right: 10rpx;
  384. }
  385. .pintuan {
  386. padding: 6rpx 16rpx;
  387. text-align: center;
  388. background: #ffffff;
  389. border-radius: 24rpx;
  390. font-size: 20rpx;
  391. font-family: PingFang SC;
  392. font-weight: bold;
  393. color: #2e58ff;
  394. }
  395. }
  396. }
  397. }
  398. .box {
  399. display: flex;
  400. flex-direction: column;
  401. width: 710rpx;
  402. position: relative;
  403. margin: -80rpx 20rpx;
  404. color: #fefefe;
  405. }
  406. .sweets-box {
  407. display: flex;
  408. align-items: center;
  409. width: 710rpx;
  410. padding: 48rpx 0;
  411. background: #ffffff;
  412. box-shadow: 0px 0px 20px 0px rgba(50, 50, 52, 0.06);
  413. border-radius: 20rpx;
  414. .jiange {
  415. width: 1rpx;
  416. height: 36rpx;
  417. background: #999999;
  418. }
  419. .sweets {
  420. width: 25%;
  421. display: flex;
  422. flex-direction: column;
  423. align-items: center;
  424. font-size: 28rpx;
  425. font-family: PingFang SC;
  426. font-weight: 500;
  427. .limit {
  428. font-size: 36rpx;
  429. font-family: PingFang SC;
  430. font-weight: bold;
  431. color: #666666;
  432. }
  433. .sweets-name {
  434. font-size: 28rpx;
  435. font-family: PingFang SC;
  436. font-weight: 500;
  437. color: #666666;
  438. }
  439. }
  440. }
  441. .my-order {
  442. margin: 20rpx auto 0;
  443. display: flex;
  444. justify-content: space-between;
  445. flex-direction: column;
  446. width: 710rpx;
  447. background: #ffffff;
  448. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  449. border-radius: 20rpx;
  450. }
  451. .box-title {
  452. border-top-left-radius: 20rpx;
  453. border-top-right-radius: 20rpx;
  454. background-color: #ffffff;
  455. line-height: 1;
  456. padding: 26rpx 34rpx 20rpx;
  457. border-bottom: 1px solid #f5f5f5;
  458. .title1 {
  459. font-size: 30rpx;
  460. font-family: PingFang SC;
  461. font-weight: bold;
  462. color: #333333;
  463. }
  464. .link {
  465. font-size: $font-base - 2rpx;
  466. color: $font-color-light;
  467. }
  468. }
  469. .order-section {
  470. display: flex;
  471. flex-wrap: wrap;
  472. align-items: center;
  473. text-align: center;
  474. padding: 34rpx 0 10rpx;
  475. .order-item {
  476. display: flex;
  477. flex-direction: column;
  478. width: 25%;
  479. align-items: center;
  480. height: 140rpx;
  481. font-size: $font-sm;
  482. color: $font-color-dark;
  483. }
  484. .iconfont {
  485. font-size: 48rpx;
  486. margin-bottom: 18rpx;
  487. color: #fa436a;
  488. }
  489. .icon-shouhoutuikuan {
  490. font-size: 44rpx;
  491. }
  492. .icon {
  493. height: 88rpx;
  494. width: 90rpx;
  495. margin-bottom: 18rpx;
  496. background-size: 100%;
  497. background-repeat: no-repeat;
  498. background-position: center;
  499. .icon-img {
  500. width: 100%;
  501. height: 100%;
  502. }
  503. }
  504. .icon1 {
  505. height: 50rpx;
  506. width: 48rpx;
  507. margin-bottom: 18rpx;
  508. background-size: 100%;
  509. background-repeat: no-repeat;
  510. background-position: center;
  511. .icon-img {
  512. width: 100%;
  513. height: 100%;
  514. }
  515. }
  516. }
  517. .popup {
  518. width: 640rpx;
  519. background-color: #ffffff;
  520. border-radius: 15rpx;
  521. text-align: center;
  522. .popup-dox {
  523. position: relative;
  524. top: -60rpx;
  525. .popup-logo {
  526. width: 460rpx;
  527. height: 132rpx;
  528. }
  529. .pop-title {
  530. font-size: 40rpx;
  531. font-weight: bold;
  532. color: #333333;
  533. padding: 25rpx 0rpx;
  534. margin-bottom: 50rpx;
  535. }
  536. .popup-text {
  537. width: 400rpx;
  538. height: 400rpx;
  539. margin-bottom: 50rpx;
  540. }
  541. .btn {
  542. width: 300rpx;
  543. height: 50rpx;
  544. line-height: 50rpx;
  545. background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
  546. margin: 0 auto;
  547. color: #ffffff;
  548. border-radius: 25rpx;
  549. }
  550. .pop-tip {
  551. font-size: 30rpx;
  552. font-weight: 500;
  553. color: #333333;
  554. justify-content: center;
  555. margin-top: 20rpx;
  556. .weixin {
  557. width: 48rpx;
  558. height: 40rpx;
  559. margin-right: 14rpx;
  560. image {
  561. width: 48rpx;
  562. height: 40rpx;
  563. }
  564. }
  565. }
  566. }
  567. }
  568. .close_icon {
  569. width: 60rpx;
  570. height: 60rpx;
  571. margin: 88rpx auto 0;
  572. image {
  573. width: 100%;
  574. height: 100%;
  575. }
  576. }
  577. </style>