home.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template name="basics">
  2. <view>
  3. <cu-custom class="home-custom" bgColor=".bg-sancolor"
  4. bgImage="https://ahwgh.oss-cn-hangzhou.aliyuncs.com/enterprise/6525f808df760.png" :isBack="true">
  5. <view slot="backText">返回</view>
  6. <block slot="content">第三方检测</block>
  7. </cu-custom>
  8. <scroll-view scroll-y class="page">
  9. <view class="nav-list" style="margin-top: 40upx;">
  10. <view hover-class="none" @tap="toNextPage" :data-path="item.path" class="nav-li"
  11. :class="'bg-'+item.color"
  12. :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]" v-for="(item,index) in elements"
  13. :key="index">
  14. <view class="nav-title">{{ item.title }}</view>
  15. <view class="nav-name">{{ item.subTitle }}</view>
  16. </view>
  17. </view>
  18. </scroll-view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. elements: [
  26. {
  27. title: "监督抽查",
  28. name: "layout",
  29. color: "green",
  30. subTitle: "监督",
  31. path: "/pages/sample-check-list/index"
  32. },
  33. {
  34. title: "例行监测",
  35. name: "background",
  36. color: "mauve",
  37. subTitle: "例行",
  38. path: "/pages/zf-task-list/taskList"
  39. }
  40. ]
  41. };
  42. },
  43. onShow() {
  44. /**/
  45. const userInfo = uni.getStorageSync("userInfo");
  46. if ((userInfo.level !== "乡镇级" && userInfo.person_group !== "组长") && this.elements.length === 1) {
  47. this.elements.push({
  48. title: "网格员审核",
  49. name: "background",
  50. color: "red",
  51. subTitle: "Review",
  52. path: "/pages/grid/view"
  53. });
  54. }
  55. },
  56. methods: {
  57. toNextPage(e) {
  58. // console.log();
  59. //判断有没有登录,没有登录直接跳到登录,登录了 跳到任务详情
  60. uni.navigateTo({
  61. url: e.currentTarget.dataset.path
  62. });
  63. }
  64. }
  65. };
  66. </script>