user.vue 17 KB

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