card.vue 2.8 KB

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