index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <page-theme :theme="theme">
  3. <template>
  4. <view class="p-30" style="background-color: white;padding-top: 60px;padding-bottom: 30px;">
  5. <view class="flex-dir-row flex-y-center flex-x-between">
  6. <view class="m-l-30">
  7. <view class="f-34 t-bold m-b-20">{{nickName}}</view>
  8. <u-icon name="arrow-right" size="15" :color="$u.color['info']" @click="toProfile" label="更新个人信息"
  9. labelPos="left" labelSize="15" :labelColor="$u.color['info']" />
  10. </view>
  11. <u-avatar :src="face" size="60" />
  12. </view>
  13. </view>
  14. <view class="p-30">
  15. <view v-for="(item,i) in allCells" :key="i">
  16. <bt-cell :cells="item" />
  17. </view>
  18. <!-- <view class="flex-dir-row flex-x-between m-t-20 f-28">
  19. <view class="flex-dir-row flex-x-center flex-y-center p-b-t-20 border-round-10 c-g-white width-100"
  20. @click="toLogout">
  21. <u--image src="/static/images/logout.png" width="20px" height="20px" />
  22. <view class="m-l-10 col-info">退出登录</view>
  23. </view>
  24. </view> -->
  25. <view class="f-24 col-info-m t-c width-100 m-t-40" @click.stop="clickVersion">当前版本:{{version}}</view>
  26. </view>
  27. </template>
  28. </page-theme>
  29. </template>
  30. <script>
  31. import btCell from '@/pages/components/btcell.vue'
  32. import {
  33. version
  34. } from '@/common/setting'
  35. import {
  36. clickEvent
  37. } from '@/utils/util.js'
  38. import themeMixins from '../mixins/themeMixins.js';
  39. export default {
  40. mixins: [themeMixins],
  41. components: {
  42. btCell
  43. },
  44. data() {
  45. return {
  46. face: '',
  47. nickName: '',
  48. version: version,
  49. allCells: [
  50. [{
  51. icon: '',
  52. text: '名菜收藏',
  53. url: '/pages/yuecai/collection/index?type=dish',
  54. }, {
  55. icon: '',
  56. text: '名点收藏',
  57. url: '/pages/yuecai/collection/index?type=snacks',
  58. }, {
  59. icon: '',
  60. text: '名店收藏',
  61. url: '/pages/yuecai/collection/index?type=restaurant',
  62. }],
  63. [{
  64. icon: '',
  65. text: '用户协议',
  66. url: '/pages/yuecai/usercenter/protocol/index',
  67. }, {
  68. icon: '',
  69. text: '了解隐私保护政策',
  70. url: '/pages/yuecai/usercenter/privacy/index',
  71. }, {
  72. icon: '',
  73. text: '关于我们',
  74. url: './aboutus',
  75. }],
  76. ],
  77. }
  78. },
  79. methods: {
  80. toProfile() { //个人信息
  81. uni.navigateTo({
  82. url: './profile/index',
  83. })
  84. },
  85. toQuestion() {
  86. },
  87. toService() {
  88. },
  89. toLogout() {
  90. this.$u.func.logout()
  91. },
  92. clickVersion(e) { //点击版本号
  93. if (this.userInfo.nick_name == '嘉曦') { //满足条件就支持双击
  94. clickEvent(e, null, this.showMeTheMoney)
  95. }
  96. },
  97. showMeTheMoney() { //作弊
  98. if (!this.userInfo.isVIP) { //不是VIP,就作弊
  99. this.$u.vuex('userInfo.isVIP', true) //给予VIP
  100. uni.reLaunch({ //跳回登录页,但是不登出,让tab页重新加载
  101. url: '../../index',
  102. })
  103. }
  104. },
  105. refresh(face, nickName) {
  106. this.face = face
  107. this.nickName = nickName
  108. },
  109. },
  110. onShow() {
  111. this.face = this.userInfo.avatar || '/static/images/face.png'
  112. this.nickName = this.userInfo.nick_name || '小机灵鬼'
  113. },
  114. onUnload() {},
  115. }
  116. </script>
  117. <style scoped lang="scss">
  118. .k-pink {
  119. background-color: #FDEAD2;
  120. }
  121. </style>