user.vue 16 KB

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