my.vue 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view class="container-view">
  3. <view class="user-switch-row">
  4. <view class="name-wrap">{{ userInfo.name }}</view>
  5. <image class="message" @tap="routerLink({ url: '/pages/message/index' })"
  6. :src="QINIU_URL + 'FghCVNMWDBKJpqbIrqoxT-de9Has'" />
  7. </view>
  8. <view class="user-info-wrap">
  9. <image class="head-img" :src="userInfo.headImg" />
  10. <view class="user-name">{{ userInfo.userName }}</view>
  11. <view class="e-mail">{{ userInfo.eMail }}</view>
  12. </view>
  13. <view class="common-tabs">
  14. <view class="item" v-for="(item, index) in commonTabs" :key="index" @click="routerLink(item)">
  15. <image :src="QINIU_URL + item.icon" class="icon" />
  16. <view class="name">{{ item.name }}</view>
  17. </view>
  18. </view>
  19. <view class="tabs-wrap">
  20. <view class="tab-item" v-for="(item, index) in baseTabs" :key="index" @click="routerLink(item)">
  21. <image :src="QINIU_URL + item.icon" class="icon" />
  22. <view class="name">{{ item.name }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import { QINIU_URL } from '@/common/constant'
  29. export default {
  30. data() {
  31. return {
  32. QINIU_URL,
  33. userInfo: {
  34. name: 'Real name',
  35. userName: 'Kabuda-4',
  36. eMail: '1007929522@Mail.com',
  37. headImg: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.lmGw9aECIAIIvJK_U92f_gAAAA?w=169&h=180&c=7&r=0&o=5&pid=1.7'
  38. }
  39. }
  40. },
  41. computed: {
  42. commonTabs() {
  43. return [
  44. { name: `${this.$t('我的车辆')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  45. { name: `${this.$t('用车人')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  46. { name: `${this.$t('换电套餐')}`, jumpCheck: 'combo', url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  47. ]
  48. },
  49. baseTabs() {
  50. const lang = t => this.$t(t)
  51. return [
  52. { name: `${lang('我的订单')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  53. { name: `${lang('换电记录')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  54. { name: `${lang('关于我们')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  55. { name: `${lang('客服中心')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  56. { name: `${lang('设置')}`, url: '/pages/my/set', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  57. ]
  58. }
  59. },
  60. methods: {
  61. checkHandle_combo() {
  62. this.$confirm({
  63. title: '温馨提示',
  64. text: '您还未购买换电套餐,是否前往进行换电套餐?',
  65. confirmBtnText: '前往购买',
  66. showCancelButton: false
  67. }).then(confirm => {
  68. console.log('confirm', confirm)
  69. })
  70. },
  71. routerLink({ url, jumpCheck }) {
  72. if (jumpCheck) {
  73. this[`checkHandle_${jumpCheck}`]()
  74. return
  75. }
  76. uni.navigateTo({ url })
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. @import './my.scss';
  83. </style>