card.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view>
  3. <view class="" v-for="(item,index) in menuList" :key="index" @click="jump(item.path)">
  4. <button v-if="index!=4" class="card btnCss" style="font-size: 30rpx;color: #5c5c5c;border-radius: 0;border: none;">
  5. <view style="display: flex;">
  6. <view class="center">
  7. <image v-if="index!=1 && index!=5" style="width:36rpx;height: 36rpx;" :src="item.icon" ></image>
  8. <image v-else style="width:38rpx;height: 38rpx;" :src="item.icon"></image>
  9. </view>
  10. <view class="center">
  11. <text class="padding-left-10">{{item.name}}</text>
  12. </view>
  13. </view>
  14. <view class="">
  15. <text class="cuIcon-right"></text>
  16. </view>
  17. </button>
  18. <button v-else open-type="contact" class="card btnCss"
  19. style="font-size: 30rpx;color: #5c5c5c;border-radius: 0;border: none;">
  20. <view style="display: flex;">
  21. <view class="center">
  22. <image style="width: 36rpx;height: 36rpx;" src="/static/icon/kefu1.png"></image>
  23. </view>
  24. <view class="center">
  25. <text class="padding-left-10">在线咨询</text>
  26. </view>
  27. </view>
  28. <view class="">
  29. <text class="cuIcon-right"></text>
  30. </view>
  31. </button>
  32. </view>
  33. <u-modal @confirm="$jump('/pages/member/member')" :show-cancel-button="true" confirm-color="#ff9447" confirm-text="立即开启" cancel-text="暂不开启" v-model="isOpenMemberShow" content="请先创建会员中心"></u-modal>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. menuList: [{
  41. icon: '/static/icon/info.png',
  42. name: '商家资料',
  43. path: '/pages/shop-info/shop-info?edit=true&phone=' + this.$cache.get('phone')
  44. },
  45. {
  46. icon: '/static/icon/yinhangka.png',
  47. name: '银行卡',
  48. path: '/pages/userBank/userBank'
  49. },
  50. {
  51. icon: '/static/icon/xiazai1.png',
  52. name: '物料下载',
  53. path: '/pages/material-download/material-download'
  54. },
  55. {
  56. icon: '/static/icon/yijian.png',
  57. name: '意见反馈',
  58. path: '/pages/card/feedback'
  59. },
  60. {
  61. icon: '/static/icon/kefu1.png',
  62. name: '在线咨询',
  63. path: '/pages/card/feedback'
  64. },
  65. {
  66. icon: '/static/icon/logout1.png',
  67. name: '退出登录',
  68. path: 'logout'
  69. },
  70. ],
  71. isOpenMemberShow:false
  72. }
  73. },
  74. methods: {
  75. logout() {
  76. this.$dialog.showModal('确定要退出吗?').then(res => {
  77. uni.clearStorage()
  78. uni.reLaunch({
  79. url: "../login/account-login"
  80. })
  81. })
  82. },
  83. jump(url) {
  84. if (url=='logout') {
  85. this.logout()
  86. return
  87. }
  88. if (this.$isEmpty(url)) {
  89. this.$u.toast('即将推出')
  90. return
  91. }
  92. if (url=='/pages/material-download/material-download'&&!this.vuex_isOpenMember) {
  93. //物料下载
  94. this.isOpenMemberShow=true
  95. return
  96. }
  97. uni.navigateTo({
  98. url
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .card {
  106. display: flex;
  107. justify-content: space-between;
  108. margin: 16rpx 0;
  109. padding: 8rpx 30rpx;
  110. background-color: #FFFFFF;
  111. }
  112. </style>