mine.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. <template>
  2. <view class="main">
  3. <view class="top">
  4. <!-- <image src="../../static/mine/topbg.png" class="bg" mode=""/> -->
  5. <view class="bg"></view>
  6. <view class="infobox">
  7. <image :src="user.avatar == null || '' ? '../../static/tuijian/head.png' : user.avatar" mode="" />
  8. <view class="name" v-if="hasLogin">{{ user.realname }}</view>
  9. <view v-else class="name" @click="loginBtn">{{ '点击登录' }}</view>
  10. </view>
  11. </view>
  12. <view class="dans">
  13. <image class="bg" src="../../static/mine/dansbg.png" mode="" style="height: 202rpx;}"></image>
  14. <view class="status" v-for="(item, index) in status" :key="index" @click="orderlist(index)">
  15. <view class="status-img">
  16. <image :src="imgHost+item.img" mode="" class="status-img-item" />
  17. </view>
  18. <view class="status-name">{{ item.name }}</view>
  19. </view>
  20. </view>
  21. <view class="main-box">
  22. <view class="mine-box">
  23. <button class="tab" v-for="(item, index) in tabs" :open-type="index == 4 ? 'contact' : ''" :key="index" :class="index == 1 || index == 3 || index == 5 ? 'zuo' : ''"
  24. :style="index == 4 || index == 5 ? 'border-bottom:none;' : ''" @contact="contact" @click="getthis(index)">
  25. <view class="tab-img">
  26. <image class="img-item" :src="imgHost+item.img" mode=""></image>
  27. </view>
  28. <view class="tab-name">
  29. <!-- {{item.name == '在线客服'? '': item.name}} -->
  30. {{ item.name }}
  31. <!-- <button class="button" open-type="contact" v-if="item.name == '在线客服'"@contact="contact">{{item.name}}</button> -->
  32. </view>
  33. </button>
  34. </view>
  35. </view>
  36. <!-- 获取微信信息弹窗框 -->
  37. <view class="cu-modal" :class="modalName == 'WxModal' ? 'show' : ''">
  38. <view class="cu-dialog">
  39. <view class="cu-bar bg-white justify-end">
  40. <view class="content">您还未登录</view>
  41. <view class="action" @tap="modalName = ''">
  42. <text class="cuIcon-close yellow" />
  43. </view>
  44. </view>
  45. <view class="padding-xl">
  46. <view class="top-title" style="">
  47. <!-- <text class="top-title1">您还未登录</text></br> -->
  48. <text class="top-title1">请先登录再进行操作</text>
  49. </view>
  50. <view class="flex justify-around">
  51. <button type="primary" @tap="modalName = ''" class="cu-btn round greyBg lg">暂不登录</button>
  52. <button type="primary" @click="gotologin" class="cu-btn round yellowBg lg" hover-class="btn-hover">立刻登录</button>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 清除微信缓存弹窗框 -->
  58. <view class="cu-modal" :class="modalName == 'WxHCModal' ? 'show' : ''">
  59. <view class="cu-dialog">
  60. <view class="cu-bar bg-white justify-end">
  61. <view class="content">退出登录</view>
  62. <view class="action" @tap="modalName = ''"><text class="cuIcon-close yellow" /></view>
  63. </view>
  64. <view class="padding-xl">
  65. <view class="flex justify-around">
  66. <button type="primary" @tap="modalName = ''" class="cu-btn round greyBg lg">暂不退出</button>
  67. <button type="primary" @click="clearCache" class="cu-btn round yellowBg lg" hover-class="btn-hover">立刻退出</button>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 联系我们 -->
  73. <!-- <view class="cu-modal" :class="modalName == 'phoneme' ? 'show' : ''">
  74. <view class="cu-dialog">
  75. <view class="cu-bar bg-white justify-end">
  76. <view class="content">联系我们</view>
  77. <view class="action" @tap="modalName = ''"><text class="cuIcon-close yellow" /></view>
  78. </view>
  79. <view class="padding-xl">
  80. <view class="flex align-start flex-direction">
  81. <view class="margin-bottom-sm flex align-center">
  82. <text class="cuIcon-mail text-gray" style="font-size: 32rpx;"></text>
  83. <text class="margin-left-sm">541417720@qq.com</text>
  84. <button class="text-sm margin-left-sm" @click="copymail" style="border-color:rgb(251, 198, 0);color: rgb(251, 198, 0);border: 1rpx solid rgb(251, 198, 0);">复制</button>
  85. </view>
  86. <view class="flex align-center">
  87. <text class="cuIcon-phone text-gray" style="font-size: 32rpx;"></text>
  88. <text class="margin-left-sm">13676933748</text>
  89. <button class="text-sm margin-left-sm" @click="copyphone" style="border-color:rgb(251, 198, 0);color: rgb(251, 198, 0);border: 1rpx solid rgb(251, 198, 0);">复制</button>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view> -->
  95. </view>
  96. </template>
  97. <script>
  98. var user = require('../../common/user.js');
  99. import {
  100. mapState,
  101. mapMutations,
  102. mapGetters,
  103. mapActions
  104. } from 'vuex';
  105. import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js'
  106. export default {
  107. data() {
  108. return {
  109. contactIphone: '',
  110. modalName: null, //公告框状态
  111. isShow: 0,
  112. // status: [{
  113. // name: '全部',
  114. // img: '/static/mine/shouhou.png'
  115. // },
  116. // {
  117. // name: '评估中',
  118. // img: '/static/mine/pinggu.png'
  119. // },
  120. // {
  121. // name: '待付款',
  122. // img: '/static/mine/daifu.png'
  123. // },
  124. // {
  125. // name: '进行中',
  126. // img: '/static/mine/jinxing.png'
  127. // },
  128. // {
  129. // name: '已完成',
  130. // img: '/static/mine/wancheng.png'
  131. // }
  132. // ],
  133. status: [{
  134. name: '全部',
  135. img: '/static/mine/shouhou.png'
  136. },
  137. {
  138. name: '评估中',
  139. img: '/static/mine/pinggu.png'
  140. },
  141. {
  142. name: '修复中',
  143. img: '/static/mine/daifu.png'
  144. },
  145. {
  146. name: '已完成',
  147. img: '/static/mine/jinxing.png'
  148. },
  149. {
  150. name: '已取消',
  151. img: '/static/mine/wancheng.png'
  152. }
  153. ],
  154. tabs: [{
  155. img: '/static/mine/info.png',
  156. name: '个人信息'
  157. },
  158. {
  159. img: '/static/mine/shoucang.png',
  160. name: '我的收藏'
  161. },
  162. {
  163. img: '/static/mine/tousu.png',
  164. name: '投诉建议'
  165. },
  166. // {
  167. // img: '/static/mine/kefu.png',
  168. // name: '在线客服'
  169. // },
  170. {
  171. img: '/static/mine/call.png',
  172. name: '联系我们'
  173. },
  174. {
  175. img: '/static/mine/qingchu.png',
  176. name: '关于我们'
  177. },
  178. // {
  179. // img: '/static/mine/qingchu.png',
  180. // name: '退出登录'
  181. // },
  182. ],
  183. imgHost: ''
  184. };
  185. },
  186. onLoad() {
  187. this.imgHost = this.$imgHost
  188. },
  189. onShow() {
  190. this.getUser(true);
  191. },
  192. computed: {
  193. ...mapState(['user']),
  194. ...mapGetters({
  195. hasLogin: 'verifyJwt'
  196. })
  197. },
  198. mounted() {
  199. this.configData();
  200. },
  201. methods: {
  202. ...mapActions({
  203. getUser: 'getUser' // 将 `this.getUser()` 映射为 `this.$store.dispatch('getUser')`
  204. }),
  205. ...mapMutations(['logout', 'setUser']),
  206. // 清除缓存
  207. clearCache: function() {
  208. let that = this;
  209. uni.showLoading({
  210. title: '清除中...'
  211. });
  212. that.modalName = '';
  213. setTimeout(function() {
  214. that.logout();
  215. uni.clearStorage();
  216. uni.hideLoading();
  217. }, 2000);
  218. },
  219. copyphone() {
  220. const result = h5Copy('13676933748')
  221. if (result === false) {
  222. uni.showToast({
  223. title: '复制失败',
  224. icon: "none"
  225. })
  226. } else {
  227. this.modalName = ''
  228. uni.showToast({
  229. title: '复制成功',
  230. icon: 'none'
  231. })
  232. }
  233. },
  234. copymail() {
  235. const result = h5Copy('541417720@qq.com')
  236. if (result === false) {
  237. uni.showToast({
  238. title: '复制失败',
  239. icon: "none"
  240. })
  241. } else {
  242. this.modalName = ''
  243. uni.showToast({
  244. title: '复制成功',
  245. icon: 'none'
  246. })
  247. }
  248. },
  249. loginBtn: function() {
  250. uni.navigateTo({
  251. url: "../login/login",
  252. fail: (err) => {
  253. console.log(err)
  254. }
  255. })
  256. },
  257. gotologin() {
  258. this.modalName = '';
  259. uni.navigateTo({
  260. url: "../login/login",
  261. fail: (err) => {
  262. console.log(err)
  263. }
  264. })
  265. },
  266. // wxLogin: function(e) {
  267. // if (e.detail.userInfo == undefined) {
  268. // uni.showToast({
  269. // title: '微信登录失败'
  270. // });
  271. // return;
  272. // }
  273. // this.modalName = '';
  274. // user.loginByWeixin(e.detail.userInfo)
  275. // .then(res => {
  276. // this.getUser(true);
  277. // })
  278. // .catch(res => {
  279. // uni.showToast({
  280. // title: '微信登录失败'
  281. // });
  282. // });
  283. // },
  284. orderlist(e) {
  285. if (this.$isShow) {
  286. uni.showModal({
  287. title: "提示",
  288. content: "系统维护请等待通知",
  289. showCancel: false,
  290. success: (res) => {}
  291. })
  292. return false
  293. }
  294. if (this.isShow == 1) {
  295. if (!this.hasLogin) {
  296. uni.navigateTo({
  297. url: "../login/login",
  298. fail: (err) => {
  299. console.log(err)
  300. }
  301. })
  302. return;
  303. }
  304. console.log(e);
  305. uni.navigateTo({
  306. url: '/pages/mine/order?index=' + e
  307. });
  308. }
  309. },
  310. getthis(e) {
  311. if (this.$isShow) {
  312. uni.showModal({
  313. title: "提示",
  314. content: "系统维护请等待通知",
  315. showCancel: false,
  316. success: (res) => {}
  317. })
  318. return false
  319. }
  320. if (!this.hasLogin && e !== 2) {
  321. uni.navigateTo({
  322. url: "../login/login",
  323. fail: (err) => {
  324. console.log(err)
  325. }
  326. })
  327. return;
  328. }
  329. if (e == 0) {
  330. uni.navigateTo({
  331. url: '/pages/mine/info'
  332. });
  333. } else if (e == 1) {
  334. uni.navigateTo({
  335. url: '/pages/mine/save'
  336. });
  337. } else if (e == 2) {
  338. uni.navigateTo({
  339. url: '/pages/mine/tousu'
  340. });
  341. } else if (e == 3) {
  342. uni.makePhoneCall({
  343. phoneNumber: this.contactIphone
  344. })
  345. } else if (e == 4) {
  346. uni.navigateTo({
  347. url: '/pages/mine/about'
  348. });
  349. } else if (e == 5) {
  350. this.modalName = 'WxHCModal';
  351. }
  352. },
  353. contact(e) {
  354. console.log(e);
  355. },
  356. // 加载公共配置
  357. configData: async function() {
  358. let res = await this.$request.post('/api/SystemConfig/getSysteConfig');
  359. console.log(res.data);
  360. if (res.code == 200) {
  361. this.contactIphone = res.data.phone;
  362. this.isShow = res.data.is_show
  363. }
  364. }
  365. }
  366. };
  367. </script>
  368. <style>
  369. page {
  370. width: 100%;
  371. background: #fff;
  372. }
  373. .main {
  374. width: 100%;
  375. height: auto;
  376. background: #fff;
  377. }
  378. .top {
  379. width: 100%;
  380. height: 170rpx;
  381. position: relative;
  382. padding-top: 5vw;
  383. }
  384. .top .bg {
  385. width: 100%;
  386. position: absolute;
  387. top: 0;
  388. left: 0;
  389. z-index: 0;
  390. height: 480rpx;
  391. background-color: #FBB929;
  392. }
  393. .top .infobox {
  394. width: 90vw;
  395. height: 250rpx;
  396. border-top-left-radius: 15px;
  397. border-top-right-radius: 15px;
  398. border-bottom-left-radius: 4px;
  399. border-bottom-right-radius: 4px;
  400. /* background: #ffd362; */
  401. margin: 0 5vw;
  402. position: absolute;
  403. display: flex;
  404. /* background-image: url('~@/static/mine/topbg2.png'); */
  405. background-size: cover;
  406. flex-direction: column;
  407. align-items: center;
  408. top: 120rpx;
  409. }
  410. .dans {
  411. width: 86vw;
  412. height: 120px;
  413. display: flex;
  414. justify-content: space-around;
  415. /* background: #fff; */
  416. border-radius: 8px;
  417. margin: 24vw 7vw 0 7vw;
  418. position: relative;
  419. z-index: 3;
  420. display: flex;
  421. justify-content: cneter;
  422. align-items: center;
  423. }
  424. .dans .bg {
  425. width: 100%;
  426. height: 100%;
  427. position: absolute;
  428. z-index: -1;
  429. }
  430. .dans .status {
  431. width: 15vw;
  432. height: 15vw;
  433. }
  434. .status .status-img {
  435. width: 100%;
  436. height: 80rpx;
  437. display: flex;
  438. justify-content: center;
  439. align-items: center;
  440. }
  441. .status .status-img .status-img-item {
  442. width: 36rpx;
  443. height: 36rpx;
  444. /* margin: 18px calc( 6.5vw - 13px ) 9px calc( 6.5vw - 10px ); */
  445. display: flex;
  446. justify-content: center;
  447. align-items: center;
  448. }
  449. .status .status-name {
  450. width: 100%;
  451. height: 30rpx;
  452. line-height: 10px;
  453. font-size: 20rpx;
  454. font-weight: 300;
  455. font-family: PingFangSC-Regular, sans-serif;
  456. text-align: center;
  457. color: #555864;
  458. }
  459. .infobox image {
  460. width: 70px;
  461. height: 70px;
  462. border-radius: 60px;
  463. background: #eee;
  464. /* margin: 25px; */
  465. margin-top: 5px;
  466. }
  467. .infobox .name {
  468. width: calc(90vw - 150px);
  469. height: 40px;
  470. /* line-height: 40px; */
  471. /* margin: 40px 0; */
  472. font-size: 18px;
  473. color: #fff;
  474. text-align: center;
  475. background: transparent;
  476. padding: 0;
  477. line-height: 40px;
  478. }
  479. .infobox .name::after {
  480. border: none;
  481. border-radius: 0;
  482. }
  483. .main-box {
  484. width: 100vw;
  485. /* height: auto; */
  486. /* height: 447rpx; */
  487. background: #fff;
  488. /* padding: 5vw 0; */
  489. /* margin-top: 10px; */
  490. }
  491. .main-box .mine-box {
  492. /* width: 90vw; */
  493. /* height: 180px; */
  494. /* display: flex; */
  495. /* flex-wrap: wrap; */
  496. /* margin: 0 5vw; */
  497. }
  498. .mine-box .tab {
  499. /* width: 49.7%; */
  500. height: 130rpx;
  501. display: flex;
  502. /* justify-content: center; */
  503. align-items: center;
  504. border-bottom: 1px solid #eee;
  505. margin: 0;
  506. padding: 0;
  507. color: #555864;
  508. background: #fff;
  509. border-radius: 0;
  510. padding-left: 60rpx;
  511. }
  512. .tab::after {
  513. border: none;
  514. border-radius: 0;
  515. }
  516. .tab .tab-img {
  517. height: 48rpx;
  518. line-height: 48rpx;
  519. }
  520. .tab .tab-img .img-item {
  521. width: 48rpx;
  522. height: 48rpx;
  523. /* margin: 18px 10px; */
  524. }
  525. .tab .tab-name {
  526. width: 60%;
  527. height: 48rpx;
  528. line-height: 48rpx;
  529. text-align: left;
  530. font-size: 30rpx;
  531. font-family: PingFangSC-Regular, sans-serif;
  532. color: #555864;
  533. padding-left: 20rpx;
  534. /* margin: 20px 0; */
  535. }
  536. .mine-box .xia {
  537. border-bottom: none;
  538. }
  539. .mine-box .zuo {
  540. border-left: 1px solid #eee;
  541. }
  542. .yellow {
  543. color: #f5cc57;
  544. }
  545. .yellowBg {
  546. background: #f5cc57 !important;
  547. }
  548. .greyBg {
  549. background: grey !important;
  550. }
  551. .top-title {
  552. margin-bottom: 15px;
  553. }
  554. .top-title .top-title1 {
  555. font-size: 19px;
  556. color: #000000;
  557. margin-top: 10px;
  558. }
  559. .top-title .top-title2 {
  560. font-size: 13px;
  561. color: #999;
  562. }
  563. </style>