index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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/64bdccea7bd72.png">
  5. <block slot="content">精准大田专家填报系统</block>
  6. </cu-custom>
  7. <scroll-view scroll-y class="page">
  8. <view class="nav-list" style="margin-top: 40%;">
  9. <navigator hover-class="none" @tap="toPage(index)" class="nav-li" :class="'bg-'+item.color"
  10. v-for="(item,index) in elements" :key="index" style="width: 60%;margin-left: 20%">
  11. <view class="nav-title" style="text-align: center;font-size: 50rpx;">{{item.title}}</view>
  12. <view class="nav-name"></view>
  13. </navigator>
  14. </view>
  15. <view class="footer">
  16. <view>主办单位:安徽省农业农村厅质监处</view>
  17. <view>技术支持:安徽省北斗精准农业信息工程实验室</view>
  18. </view>
  19. <view class="cu-tabbar-height"></view>
  20. </scroll-view>
  21. </view>
  22. </template>
  23. <script>
  24. import { Messages } from "prettier/parser-postcss";
  25. import { _home } from "./home.js";
  26. export default {
  27. name: "basics",
  28. data() {
  29. return {
  30. elements: [{
  31. title: '信息填报',
  32. name: 'layout',
  33. color: 'green',
  34. cuIcon: 'shengchanjidi',
  35. subTitle:'基地'
  36. },
  37. {
  38. title: '填报记录',
  39. name: 'layout',
  40. color: 'blue',
  41. cuIcon: 'renzheng',
  42. subTitle:'检测'
  43. }],
  44. cardCur: 0,
  45. dotStyle: false,
  46. towerStart: 0,
  47. direction: "",
  48. userInfo:{},
  49. imgList: [],//图片list
  50. caseTypeList:[],//'黑塔镇蒋杨村','韦集镇陈圩村','灵城镇界沟村','支河镇鸭湖村'
  51. };
  52. },
  53. computed: {
  54. pickerRange() {
  55. return this.caseTypeList.map(item => item.site);
  56. }
  57. },
  58. created() {
  59. this.toNextPage();
  60. },
  61. methods: {
  62. toPage(index){
  63. console.log("选择index" + index);
  64. if(index==0){
  65. uni.navigateTo({
  66. url:'/pages/check/index'
  67. })
  68. }else if(index==1){
  69. uni.navigateTo({
  70. url:'/pages/check-record/index'
  71. })
  72. }
  73. },
  74. toNextPage() {
  75. console.log("判断登录");
  76. //判断有没有登录,没有登录直接跳到登录,登录了 跳到任务详情
  77. let username = wx.getStorageSync("username");
  78. if (username == "") {
  79. //没有登录
  80. console.log("没有登录");
  81. //跳入登录
  82. uni.navigateTo({
  83. url: "/pages/login/index"
  84. });
  85. } else {
  86. console.log("已登录")
  87. /* let role = uni.getStorageSync("role");
  88. console.log(index)
  89. if (index == 2 ) { //抽样人员的角色id
  90. //表示点了抽样单位且角色是抽样单位
  91. if(role === '85f63893de834bb898edc01cfd2cc46c'){
  92. //检测机构人员
  93. uni.navigateTo({
  94. url: "/pages/sample-check-list/home"
  95. });
  96. } else if(role === "f35551e4a06647dea5c2c43aaba22c2a"){
  97. uni.navigateTo({
  98. url: "/pages/task-list/index"
  99. });
  100. }else{
  101. uni.showToast({
  102. icon: 'error',
  103. title: "当前角色不可查看",
  104. duration: 1500
  105. })
  106. }
  107. }
  108. if (index == 0 && role == "a1cbf841b0514b47bbdd3f50c80b729f") { //快检站的角色
  109. //表示点了检测单位且角色是检测单位
  110. uni.navigateTo({
  111. url: "/pages/quick-task/list"
  112. });
  113. }
  114. if (index == 1) {
  115. // && role == "a1cbf841b0514b47bbdd3f50c80b729f"
  116. uni.navigateTo({
  117. url: "/pages/quick-task/quick-list"
  118. });
  119. } */
  120. }
  121. }
  122. }
  123. };
  124. </script>
  125. <style>
  126. .page {
  127. height: 100vh;
  128. }
  129. .footer {
  130. position: fixed;
  131. text-align: center;
  132. line-height: 40px;
  133. margin-bottom: 2px;
  134. bottom: 10vh;
  135. width: 100%;
  136. font-size: 12px;
  137. }
  138. .footer view {
  139. line-height: 22px;
  140. }
  141. </style>