index-my.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. <template>
  2. <view class="MyContainer">
  3. <view class="MyInfo">
  4. <view class="InfoBody">
  5. <view :style="{ backgroundImage: `url(${logged ? userinfo.avatar : ''})` }" class="avatar">
  6. <!-- <view class="avatar-yuan" @click="toCard"><image src="../../static/new_my/pen.png" mode="widthFix" style="width: 28rpx;"></image></view> -->
  7. </view>
  8. <view class="nameBox">
  9. <view class="name" v-if="userinfo.nickname">
  10. <!-- {{ logged ? userinfo.nickname.slice(0, 10) : '请登录' }} -->
  11. <text v-if="logged">{{ userinfo.nickname | getName(10) }}</text>
  12. <text v-else>请登录</text>
  13. </view>
  14. <view class="nameBottom">
  15. <!-- <view class="Id">{{ logged && userinfo.uuid ? `ID:${userinfo.uuid}` : '' }}</view> -->
  16. <!-- <view class="card" @click="toCard">
  17. <view class="text">名片</view>
  18. </view> -->
  19. <!-- <view class="nameBottom-level" v-if="logged">{{ userinfo.level }}</view> -->
  20. </view>
  21. </view>
  22. <view v-if="logged" class="warea" @click="goPolitical">
  23. <image src="../../static/new_my/kefu.png" mode="widthFix" style="width: 40rpx;"></image>
  24. <text class="text">客服</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="orderContainer">
  29. <!-- <view class="orderTop">
  30. <view class="title">我的订单</view>
  31. <view class="all" @click="toUrlLink('my-order/my-order?type=0')">
  32. <view>全部订单</view>
  33. </view>
  34. </view>
  35. <view class="orderList">
  36. <view
  37. v-for="(item, i) in orderList"
  38. :key="i"
  39. class="orderItem"
  40. @click="toUrlLink(item.url)"
  41. >
  42. <image
  43. mode="widthFix"
  44. :src="`../../static/new_my/new_order/${item.icon}`"
  45. class="icon"
  46. />
  47. <view class="name">{{ item.name }}</view>
  48. <view class="messageNumber" v-if="item.num">{{ userinfo[item.num] || 0 }}</view>
  49. </view>
  50. </view> -->
  51. </view>
  52. <!-- <view class="topList">
  53. <view v-for="(item, i) in topList" :key="i" class="topItem" @click="toUrlLink(item.url)">
  54. <image mode="widthFix" :src="`../../static/new_my/new_honor/${item.icon}`" :class="item.class" />
  55. <view class="name">{{ item.name }}</view>
  56. </view>
  57. </view> -->
  58. <view class="setList">
  59. <view v-for="(item, i) in setList" :key="i" class="setItem" @click="toUrlLink(item.url)">
  60. <view class="setItem-left">
  61. <image mode="widthFix" :src="`../../static/new_my/new_icon/${item.icon}`" class="icon" />
  62. <view>{{ item.name }}</view>
  63. </view>
  64. <view class="setItem-right">
  65. <text>{{ item.remark }}</text>
  66. <image mode="widthFix" src="../../static/new_my/arrow.png" class="right" />
  67. </view>
  68. </view>
  69. </view>
  70. <!-- <view v-if="showSigup" class="showSigup" @click="goSigup">
  71. 报名入口
  72. </view> -->
  73. </view>
  74. </template>
  75. <script>
  76. import {
  77. _API_GetUserInfo
  78. } from '@/apis/user.js';
  79. // { name: '库存管理', icon: '1.png', url: 'stock/stock' },
  80. const setListArr = [
  81. // {
  82. // name: '我的授权',
  83. // icon: '10.png',
  84. // url: 'auth-card/auth-card'
  85. // },
  86. // {
  87. // name: '收货地址',
  88. // remark: '添加、修改',
  89. // icon: '1.png',
  90. // url: 'address-manage/address-manage'
  91. // },
  92. {
  93. name: '实战营报名',
  94. icon: '8.png',
  95. url: 'payment-xx/payment'
  96. },
  97. {
  98. name: '直播报名',
  99. icon: '8.png',
  100. url: 'payment/payment'
  101. },
  102. {
  103. name: '礼品兑换',
  104. icon: '3.png',
  105. url: 'zbs-exchange/exchange',
  106. width: 39,
  107. height: 37
  108. },
  109. {
  110. name: '安全管理',
  111. remark: '退出、修改手机号',
  112. icon: '2.png',
  113. url: 'safe-manage/safe-manage'
  114. },
  115. // {
  116. // name: '使用教程',
  117. // remark: '注册授权、微店铺',
  118. // icon: '3.png',
  119. // url: 'help-use/help-use',
  120. // width: 37,
  121. // height: 41
  122. // },
  123. // {
  124. // name: '微店铺',
  125. // icon: '4.png',
  126. // url: 'shop/shop',
  127. // width: 39,
  128. // height: 37
  129. // },
  130. // {
  131. // name: '公司荣誉殿堂',
  132. // icon: '6.png',
  133. // url: 'webView/webView',
  134. // width: 40,
  135. // height: 40
  136. // },
  137. {
  138. name: '评价客服',
  139. icon: '7.png',
  140. url: 'webView/appraise'
  141. }
  142. // { name: '购买肥皂', icon: '4.png', url: 'soap/index',width:36,height:37 }
  143. ];
  144. export default {
  145. data() {
  146. return {
  147. // showSigup: true,
  148. warea: '',
  149. orderList: [{
  150. name: '待付款',
  151. icon: '1.png',
  152. url: 'my-order/my-order?type=1',
  153. num: ''
  154. },
  155. {
  156. name: '待审核',
  157. icon: '2.png',
  158. url: 'my-order/my-order?type=2',
  159. num: 'order_num1'
  160. },
  161. {
  162. name: '待收货',
  163. icon: '3.png',
  164. url: 'my-order/my-order?type=3',
  165. num: 'order_num2'
  166. },
  167. {
  168. name: '已完成',
  169. icon: '4.png',
  170. url: 'my-order/my-order?type=4',
  171. num: 'order_num3'
  172. }
  173. ],
  174. topList: [{
  175. name: '个人荣誉',
  176. icon: '1.png',
  177. class: 'honer_icon',
  178. url: 'honor/index'
  179. },
  180. {
  181. name: '我的授权',
  182. icon: '2.png',
  183. class: 'accredit_icon',
  184. url: 'auth-card/auth-card'
  185. }
  186. ],
  187. show_store: false, //true显示微店 false不显示微信
  188. warea_info: '', //战区信息A
  189. };
  190. },
  191. onPullDownRefresh() {
  192. this.showShop()
  193. },
  194. onShow() {
  195. if (this.userinfo.mobile === '18737108730' || this.userinfo.mobile === '15236877164' || this.userinfo.mobile === '15515667892') {
  196. const data = {
  197. name: '扫码',
  198. icon: '7.png',
  199. url: 'scanC/scanC'
  200. }
  201. setListArr.push(data)
  202. }
  203. if (this.userinfo.level == 3) {
  204. const data ={
  205. name: '收货地址',
  206. remark: '添加、修改',
  207. icon: '1.png',
  208. url: 'address-manage/address-manage'
  209. }
  210. setListArr.push(data)
  211. }
  212. this.showShop(); //判断是否显示店铺
  213. },
  214. computed: {
  215. tabBerList() {
  216. return this.$store.state.tabBer.list;
  217. },
  218. userinfo() {
  219. return this.$store.state.userinfo;
  220. },
  221. logged() {
  222. return this.$store.state.app.token ? true : false;
  223. },
  224. messageNum() {
  225. return this.$store.getters['message/messageNum'];
  226. },
  227. money() {
  228. return this.$store.state.userinfo.money;
  229. },
  230. setList() {
  231. let arr = Object.assign([], setListArr);
  232. return arr;
  233. }
  234. },
  235. methods: {
  236. // 跳转到报名支付
  237. goSigup() {
  238. uni.navigateTo({
  239. url: '../payment/payment'
  240. })
  241. },
  242. //判断是否显示微店测试
  243. showShop() {
  244. _API_GetUserInfo().then(res => {
  245. if (res.code == 200) {
  246. this.show_store = res.data.show_store;
  247. this.warea = res.data.warea;
  248. this.warea_info = res.data.warea_info;
  249. } else {
  250. uni.showModal({
  251. content: '获取信息失败',
  252. showCancel: false
  253. });
  254. }
  255. });
  256. },
  257. //跳转到微店测试
  258. toShop() {
  259. uni.navigateTo({
  260. url: '../shop/shop'
  261. });
  262. },
  263. // 跳转我的名片
  264. toCard() {
  265. uni.navigateTo({
  266. url: '../../pages/person-card/person-card?&self=1&id=' + this.userinfo.id
  267. });
  268. },
  269. // 跳转
  270. toUrlLink(url) {
  271. if (!url) return false;
  272. uni.navigateTo({
  273. url: `../../pages/${url}`
  274. });
  275. },
  276. goPolitical() {
  277. if (!this.warea_info) {
  278. uni.showModal({
  279. content: '暂无客服信息',
  280. showCancel: false
  281. })
  282. return false;
  283. }
  284. this.warea_info.warea = this.warea;
  285. let warea = encodeURIComponent(JSON.stringify(this.warea_info));
  286. uni.navigateTo({
  287. url: '../political/political?warea=' + warea
  288. });
  289. }
  290. }
  291. };
  292. </script>
  293. <style lang="scss" scoped>
  294. .showSigup {
  295. width: 132rpx;
  296. height: 132rpx;
  297. padding: 10rpx;
  298. background: linear-gradient(150deg, #FFAA01 0%, #FE0000 100%);
  299. box-shadow: 0px 3px 10px rgba(254, 34, 0, 0.43);
  300. border-radius: 50%;
  301. opacity: 1;
  302. position: fixed;
  303. right: 40rpx;
  304. bottom: 160rpx;
  305. z-index: 100;
  306. color: #fff;
  307. font-weight: bold;
  308. line-height: 112rpx;
  309. }
  310. page {
  311. width: 100%;
  312. display: flex;
  313. flex-direction: column;
  314. }
  315. .MyContainer {
  316. width: 100%;
  317. flex: 1;
  318. background-color: #f9f9fb;
  319. padding-bottom: 100rpx;
  320. .MyInfo {
  321. width: 100%;
  322. height: 320rpx;
  323. background-image: url(../../static/new_my/bg.png);
  324. padding: 30rpx;
  325. box-sizing: border-box;
  326. .InfoBody {
  327. width: 100%;
  328. margin-top: 10rpx;
  329. display: flex;
  330. justify-content: flex-start;
  331. align-items: flex-end;
  332. position: relative;
  333. .avatar {
  334. position: relative;
  335. width: 126rpx;
  336. height: 126rpx;
  337. border-radius: 50%;
  338. background-position: center;
  339. background-repeat: no-repeat;
  340. background-size: cover;
  341. background-color: #999999;
  342. border: 4rpx solid #fff;
  343. &-yuan {
  344. position: absolute;
  345. right: -5rpx;
  346. top: 0;
  347. width: 40rpx;
  348. height: 40rpx;
  349. display: flex;
  350. justify-content: center;
  351. align-items: center;
  352. border-radius: 50%;
  353. background: linear-gradient(180deg, #ffe9c2 0%, #ffcd81 100%);
  354. }
  355. }
  356. .nameBox {
  357. flex: 1;
  358. min-width: 0;
  359. display: flex;
  360. justify-content: space-between;
  361. flex-direction: column;
  362. margin-left: 30rpx;
  363. .name {
  364. color: #ffffff;
  365. font-size: 44rpx;
  366. margin-bottom: 10rpx;
  367. text {
  368. color: #fff;
  369. }
  370. }
  371. .nameBottom {
  372. display: flex;
  373. align-items: center;
  374. justify-content: flex-start;
  375. &-level {
  376. padding: 6rpx 28rpx;
  377. border-radius: 28rpx;
  378. // padding: 0 12rpx;
  379. // background: linear-gradient(227deg, #ffa600 0%, #fcbc05 100%);
  380. background: rgba(255, 255, 255, 0.4);
  381. color: #fff !important;
  382. font-size: 28rpx;
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. // margin-left: 20rpx;
  387. // &::before {
  388. // content: '';
  389. // display: block;
  390. // width: 27rpx;
  391. // height: 32rpx;
  392. // background-image: url(../../static/new_my/level.png);
  393. // background-size: auto 100%;
  394. // background-position: center;
  395. // margin-right: 8rpx;
  396. // background-repeat: no-repeat;
  397. // }
  398. }
  399. .Id {
  400. color: #ffffff;
  401. font-size: 24rpx;
  402. }
  403. .card {
  404. width: 130rpx;
  405. height: 56rpx;
  406. border-radius: 28rpx;
  407. background: linear-gradient(180deg, #ffa600 0%, #fcbc05 100%);
  408. display: flex;
  409. align-items: center;
  410. justify-content: center;
  411. color: #ffffff;
  412. font-size: 28rpx;
  413. // margin-left: 20rpx;
  414. &::before {
  415. content: '';
  416. display: block;
  417. width: 28rpx;
  418. height: 28rpx;
  419. background-image: url(../../static/new_my/card.png);
  420. background-size: cover;
  421. background-position: center;
  422. margin-right: 8rpx;
  423. }
  424. .text {
  425. color: #ffffff !important;
  426. }
  427. }
  428. }
  429. }
  430. .warea {
  431. position: absolute;
  432. right: -30rpx;
  433. top: 60rpx;
  434. border-radius: 32rpx 0rpx 0rpx 32rpx;
  435. padding: 10rpx 20rpx 10rpx 16rpx;
  436. background: linear-gradient(203deg, #fbdcac 0%, #ffefd7 31%, #ffdca5 55%, #feeacb 90%, #f9d193 100%);
  437. color: #f44545 !important;
  438. font-size: 28rpx;
  439. font-weight: bold;
  440. display: flex;
  441. align-items: center;
  442. justify-content: center;
  443. .text {
  444. color: #f44545 !important;
  445. }
  446. }
  447. }
  448. }
  449. .orderContainer {
  450. width: calc(100% - 60rpx);
  451. margin: 0 auto 30rpx auto;
  452. box-sizing: border-box;
  453. // background: #FFFFFF;
  454. border-radius: 24rpx;
  455. .orderTop {
  456. width: 100%;
  457. display: flex;
  458. align-items: center;
  459. justify-content: space-between;
  460. margin-bottom: 42rpx;
  461. .title {
  462. color: #333333;
  463. font-size: 32rpx;
  464. }
  465. .all {
  466. color: #999999;
  467. font-size: 24rpx;
  468. display: flex;
  469. align-items: center;
  470. justify-content: flex-end;
  471. &::after {
  472. content: '';
  473. display: block;
  474. width: 20rpx;
  475. height: 20rpx;
  476. background-position: center;
  477. background-size: cover;
  478. background-image: url(../../static/new_my/arrow.png);
  479. margin-left: 8rpx;
  480. }
  481. }
  482. }
  483. .orderList {
  484. width: 100%;
  485. display: flex;
  486. align-items: center;
  487. justify-content: space-between;
  488. margin-bottom: 28rpx;
  489. .orderItem {
  490. width: 25%;
  491. display: flex;
  492. align-items: center;
  493. justify-content: center;
  494. flex-direction: column;
  495. position: relative;
  496. .icon {
  497. display: block;
  498. width: 58rpx;
  499. max-height: 58rpx;
  500. margin-bottom: 16rpx;
  501. }
  502. .name {
  503. color: #333333;
  504. font-size: 24rpx;
  505. line-height: 30rpx;
  506. }
  507. .messageNumber {
  508. position: absolute;
  509. padding: 0 6rpx;
  510. height: 32rpx;
  511. border-radius: 32rpx;
  512. background: linear-gradient(to right, #ffc401 0%, #fe2400 51%, #fe0000 100%);
  513. color: #ffffff;
  514. line-height: 32rpx;
  515. text-align: center;
  516. font-size: 28rpx;
  517. top: 0;
  518. left: 50%;
  519. min-width: 48rpx;
  520. box-sizing: border-box;
  521. transform: translate(25%, -16rpx);
  522. }
  523. }
  524. }
  525. .orderBottom {
  526. width: 100%;
  527. height: 212rpx;
  528. border-radius: 24rpx;
  529. background-image: url(../../static/new_my/bg2.png);
  530. background-position: center;
  531. background-repeat: no-repeat;
  532. background-size: cover;
  533. padding: 30rpx;
  534. box-sizing: border-box;
  535. display: flex;
  536. align-items: center;
  537. justify-content: space-between;
  538. .orderMoney {
  539. .money {
  540. color: #ce7e06;
  541. font-size: 66rpx;
  542. margin-bottom: 10rpx;
  543. font-weight: bold;
  544. .spec {
  545. color: #ce7e06;
  546. font-size: 40rpx !important;
  547. font-weight: bold;
  548. }
  549. }
  550. .desc {
  551. color: #333;
  552. font-size: 28rpx;
  553. }
  554. }
  555. .link {
  556. width: 164rpx;
  557. height: 60rpx;
  558. line-height: 60rpx;
  559. border-radius: 60rpx;
  560. // background-color: #FFF1AD;
  561. background-image: linear-gradient(to right, #fe6738, #f63737);
  562. color: #fff;
  563. font-size: 28rpx;
  564. text-align: center;
  565. }
  566. }
  567. }
  568. .topList {
  569. display: flex;
  570. justify-content: space-between;
  571. margin-bottom: 30rpx;
  572. padding: 0 30rpx;
  573. .topItem {
  574. width: 330rpx;
  575. height: 168rpx;
  576. background-color: #ffffff;
  577. border-radius: 18rpx;
  578. display: flex;
  579. justify-content: center;
  580. align-items: center;
  581. .name {
  582. color: #333333;
  583. font-size: 30rpx;
  584. font-weight: bold;
  585. }
  586. .accredit_icon {
  587. width: 78rpx;
  588. max-height: 72rpx;
  589. margin-right: 22rpx;
  590. }
  591. .honer_icon {
  592. width: 50rpx;
  593. max-height: 70rpx;
  594. margin-right: 22rpx;
  595. }
  596. }
  597. }
  598. .setList {
  599. width: calc(100% - 60rpx);
  600. margin: 0 auto;
  601. padding: 0 16rpx 0 30rpx;
  602. box-sizing: border-box;
  603. background-color: #ffffff;
  604. margin-bottom: 30rpx;
  605. .setItem {
  606. width: 100%;
  607. height: 120rpx;
  608. border-bottom: 2rpx solid #eeeeee;
  609. display: flex;
  610. align-items: center;
  611. justify-content: space-between;
  612. color: #333333;
  613. font-size: 30rpx;
  614. &-left {
  615. display: flex;
  616. align-items: center;
  617. font-size: 28rpx;
  618. font-weight: bold;
  619. }
  620. &-right {
  621. display: flex;
  622. align-items: center;
  623. text {
  624. color: #999;
  625. font-size: 30rpx;
  626. }
  627. .right {
  628. width: 48rpx;
  629. height: 48rpx;
  630. // margin-top: 8rpx;
  631. }
  632. }
  633. .icon {
  634. width: 48rpx;
  635. max-height: 48rpx;
  636. display: block;
  637. margin-right: 20rpx;
  638. }
  639. &:nth-last-of-type(1) {
  640. border-bottom: 0;
  641. }
  642. }
  643. }
  644. }
  645. .showTotal {
  646. .box {
  647. width: 620rpx;
  648. height: 384rpx;
  649. background-color: #fff;
  650. position: fixed;
  651. left: 0;
  652. right: 0;
  653. top: 300rpx;
  654. margin: auto;
  655. z-index: 10000;
  656. border-radius: 26rpx;
  657. &-image {
  658. width: 200rpx;
  659. position: absolute;
  660. top: -50rpx;
  661. left: 225rpx;
  662. }
  663. .show {
  664. height: 384rpx;
  665. padding-bottom: 40rpx;
  666. display: flex;
  667. justify-content: space-between;
  668. align-items: center;
  669. flex-direction: column;
  670. &-top {
  671. // width: 620rpx;
  672. margin-top: 120rpx;
  673. font-size: 36rpx;
  674. color: #333;
  675. font-weight: bold;
  676. }
  677. &-middle {
  678. font-size: 32rpx;
  679. color: #999;
  680. }
  681. &-button {
  682. width: 528rpx;
  683. line-height: 88rpx;
  684. text-align: center;
  685. color: #fff;
  686. border-radius: 44rpx;
  687. }
  688. }
  689. }
  690. .over {
  691. width: 100%;
  692. height: 100%;
  693. background-color: #000;
  694. opacity: 0.6;
  695. position: fixed;
  696. top: 0;
  697. left: 0;
  698. z-index: 999;
  699. }
  700. .button {
  701. width: 400rpx;
  702. height: 96rpx;
  703. background: linear-gradient(90deg, #f97c55 0%, #f44545 100%);
  704. }
  705. }
  706. </style>