inquirySelect.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view class="paddingNo">
  3. <block v-for="(item, ind) in queryBean.Children" :key="ind">
  4. <view
  5. class="chargingMenuList displayFlexCol"
  6. @click="goto(item)"
  7. v-if="item.IsShow == 1"
  8. >
  9. <text>{{ item.MenuName }}</text>
  10. <image class="bg" :src="item.Icon"></image>
  11. </view>
  12. </block>
  13. </view>
  14. </template>
  15. <script setup lang="ts">
  16. import { ref, getCurrentInstance } from 'vue';
  17. import { useOnLoad } from '@dcloudio/uni-app';
  18. import { menuClick } from '@/utils';
  19. const { proxy } = getCurrentInstance() as any;
  20. const app = getApp();
  21. const queryBean = ref<any>({});
  22. useOnLoad(() => {
  23. /**如果点击菜单时 有多级页面 会给selectUrl_x赋值 */
  24. queryBean.value = app.globalData.selectUrl_x
  25. ? JSON.parse(app.globalData.selectUrl_x)
  26. : {};
  27. app.globalData.selectUrl_x = null;
  28. });
  29. const goto = async (item: any) => {
  30. menuClick(item, proxy);
  31. };
  32. </script>
  33. <style lang="scss">
  34. .chargingMenuList {
  35. height: 280upx;
  36. position: relative;
  37. margin: 0 30upx 30upx;
  38. align-items: flex-start;
  39. }
  40. .chargingMenuList text {
  41. font-size: 42upx;
  42. z-index: 2;
  43. font-family: PingFang SC;
  44. color: #fefefe;
  45. padding-left: 47upx;
  46. }
  47. .bg {
  48. width: 100%;
  49. height: 100%;
  50. position: absolute;
  51. top: 0;
  52. left: 0;
  53. z-index: 1;
  54. }
  55. </style>