index-my.vue 16 KB

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