移动端
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

480 líneas
13 KiB

  1. <template>
  2. <div class="app-container">
  3. <div class="header">
  4. <div class="header_block">
  5. <img class="header_img" src="../../../static/images/contracted/contracted_index_head.png" alt="">
  6. <p>{{ nickName }}</p>
  7. </div>
  8. <div class="icon_block">
  9. <img class="header_setting" src="../../../static/images/pest/index/index_icon_01.png" alt="">
  10. <img class="header_setting" src="../../../static/images/pest/index/login_out.png" alt="">
  11. </div>
  12. </div>
  13. <div class="tab">
  14. <div class="tab_block">
  15. <div style="flex: 1;">
  16. <p>新住作物有限公司</p>
  17. <p>部门名称名称</p>
  18. </div>
  19. <img src="../../../static/images/pest/index/pest_index_icon_4.png" alt="">
  20. </div>
  21. <div class="tab_block" @click="changeTaskOption('UNFINISHED')">
  22. <div style="flex: 1;">
  23. <div class="tab_tit">
  24. <p>小麦</p>
  25. <span>切换作物 ></span>
  26. </div>
  27. <p>返青期</p>
  28. </div>
  29. <img src="../../../static/images/pest/index/pest_index_icon_5.png" alt="">
  30. </div>
  31. </div>
  32. <img src="../../../static/images/pest/index/pest_index_icon_6.png" width="100%" style="border-radius: 4vw;margin-top: 15px;box-shadow: 0 5PX 10PX #DDDDDD;" alt="">
  33. <van-grid :column-num="4" :border="false" style="background-color: #ffffff;border-radius: 4vw;overflow: hidden;margin-top: 15px;box-shadow: 0 5PX 10PX #DDDDDD;">
  34. <van-grid-item :to="{name:'pestAgriculturalRecords'}">
  35. <img src="../../../static/images/pest/index/pest_index_icon_7.png" alt="">
  36. <p>农事记录</p>
  37. </van-grid-item>
  38. <van-grid-item :to="{name:'insectMonitoring'}">
  39. <img src="../../../static/images/pest/index/pest_index_icon_8.png" alt="">
  40. <p>虫情监测</p>
  41. </van-grid-item>
  42. <van-grid-item :to="{name:'soilTesting'}">
  43. <img src="../../../static/images/pest/index/pest_index_icon_9.png" alt="">
  44. <p>土壤检测</p>
  45. </van-grid-item>
  46. <van-grid-item :to="{name:'weather'}">
  47. <img src="../../../static/images/pest/index/pest_index_icon_10.png" alt="">
  48. <p>气象服务</p>
  49. </van-grid-item>
  50. <van-grid-item :to="{name:'temperatureAndHumidity'}">
  51. <img src="../../../static/images/pest/index/pest_index_icon_11.png" alt="">
  52. <p>温湿度</p>
  53. </van-grid-item>
  54. <van-grid-item :to="{name:'growthMonitoring'}">
  55. <img src="../../../static/images/pest/index/pest_index_icon_12.png" alt="">
  56. <p>长势监测</p>
  57. </van-grid-item>
  58. <van-grid-item>
  59. <img src="../../../static/images/pest/index/pest_index_icon_13.png" alt="">
  60. <p>物联网设备</p>
  61. </van-grid-item>
  62. </van-grid>
  63. <div class="list_tt">
  64. <p>预警 <img src="../../../static/images/pest/index/pest_index_icon_14.png" style="vertical-align: middle;" alt=""></p>
  65. <p>
  66. <span>查看全部 ></span>
  67. </p>
  68. </div>
  69. <div class="list_main">
  70. <van-list>
  71. <van-swipe-cell v-for="(item,index) in 10" :key="index" >
  72. <div class="item" @click="goDetail(item)">
  73. <img src="../../../static/images/pest/index/pest_index_icon_15.png" alt="">
  74. <div class="info">
  75. <div class="title">
  76. <p class="news_title">物品名称名称名称名称</p>
  77. <p class="tips_mark">仓库</p>
  78. </div>
  79. <div class="time">
  80. <p>库存量 <span>+100</span></p>
  81. <p>预警值 <span>50</span></p>
  82. </div>
  83. </div>
  84. </div>
  85. <!-- <template #right>
  86. <div class="operation">
  87. delete 删除 edit编辑 view查看 list榜单
  88. <div class="opera_btn">
  89. <img src="../../assets/images/sunVillage_info/signature_icon_02.png" alt="" width="35">
  90. <p>签名</p>
  91. </div>
  92. <div class="opera_btn" style="margin: 0 10px;">
  93. <img src="../../assets/images/sunVillage_info/signature_icon_03.png" alt="" width="35">
  94. <p>预览</p>
  95. </div>
  96. <div class="opera_btn">
  97. <img src="../../assets/images/sunVillage_info/signature_icon_04.png" alt="" width="35">
  98. <p>电子合同</p>
  99. </div>
  100. <div class="opera_btn">
  101. <img src="../../assets/images/sunVillage_info/signature_icon_04.png" alt="" width="35">
  102. <p>线下合同</p>
  103. </div>
  104. </div>
  105. </template> -->
  106. </van-swipe-cell>
  107. </van-list>
  108. </div>
  109. </div>
  110. </template>
  111. <script>
  112. import Cookies from "js-cookie";
  113. import { listSurveyTask } from "@/api/contracted";
  114. import { getInfo, logout } from "@/api/login";
  115. export default {
  116. name: "contractedIndex",
  117. data() {
  118. return {
  119. showPopover: false,
  120. // 通过 actions 属性来定义菜单选项
  121. actions: [
  122. { text: '修改密码',value:1 },
  123. { text: '退出登录',value:2 }
  124. ],
  125. nickName: null,
  126. phone: null,
  127. // 调查任务
  128. surveyTask: {
  129. 'FINISHED': [], // 已完成任务
  130. 'UNFINISHED': [] // 进行中任务
  131. },
  132. // 任务选项
  133. taskOption: 'FINISHED',
  134. };
  135. },
  136. created() {
  137. this.getUserInfo();
  138. },
  139. methods: {
  140. getUserInfo() {
  141. getInfo().then(response => {
  142. this.nickName = response.user.nickName;
  143. this.phone = response.user.phonenumber;
  144. this.getList(response.user.userId);
  145. });
  146. },
  147. getList(userId){
  148. listSurveyTask({userId: userId}).then(response => {
  149. this.surveyTask = response.data;
  150. });
  151. },
  152. goDetail(item){
  153. // 调查任务完成状态:已完成标记为1,未完成标记为2
  154. let status = '1';
  155. if (item.surStatus === 'UNFINISHED') {
  156. status = '2';
  157. }
  158. Cookies.set('taskStatus', status, { expires: 30 });
  159. this.$router.push({path:'/contracted/village/contractor', query: { deptId: item.deptId, deptName: item.deptName }})
  160. },
  161. onSelect(action) {
  162. switch (action.value) {
  163. case 1:
  164. this.$router.push({path:'/contracted/user/passWord'})
  165. break;
  166. case 2:
  167. this.loginOut();
  168. break;
  169. }
  170. },
  171. changeTaskOption(option) {
  172. this.taskOption = option;
  173. },
  174. loginOut() {
  175. logout().then(res => {
  176. this.$router.push({ path: '/contracted/login' });
  177. })
  178. }
  179. },
  180. };
  181. </script>
  182. <style scoped lang="scss">
  183. .app-container{
  184. background: #F2F6F2 url("../../../static/images/pest/index/pest_index_bg.png") no-repeat top;
  185. background-size: 100% auto;
  186. height: 100vh;
  187. padding: 0 4vw;
  188. }
  189. /deep/ .van-popover__wrapper{
  190. margin-left: auto;
  191. }
  192. /deep/ .van-grid-item{
  193. &:nth-child(-n+4){
  194. .van-grid-item__content {
  195. padding-bottom: 0;
  196. }
  197. }
  198. }
  199. /deep/ .van-grid-item__content{
  200. p{
  201. margin-top: 15px;
  202. color: #1C234C;
  203. }
  204. }
  205. .header{
  206. display: flex;
  207. align-items: center;
  208. padding: 5vh 0 0;
  209. .header_img{
  210. display: block;
  211. width: 10vw;
  212. height: 10vw;
  213. border-radius: 50%;
  214. border: 3PX solid #ffffff;
  215. }
  216. .header_block{
  217. display: flex;
  218. align-items: center;
  219. background-color: rgba(255,255,255,.8);
  220. padding-right: 5vw;
  221. border-radius: 100vh;
  222. p{
  223. font-size: .4rem;
  224. margin-left: 10px;
  225. }
  226. }
  227. .icon_block{
  228. display: flex;
  229. margin-left: auto;
  230. }
  231. .header_setting{
  232. width: 4.5vw;
  233. margin-bottom: auto;
  234. margin-left: 40px;
  235. }
  236. }
  237. .tab{
  238. display: flex;
  239. align-items: center;
  240. justify-content: space-between;
  241. .tab_block{
  242. width: 45vw;
  243. height: 18vw;
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. padding: 0 2vw;
  248. border-radius: 4vw;
  249. margin-top: 3vh;
  250. position: relative;
  251. box-shadow: 0 5PX 10PX #DDDDDD;
  252. &:nth-child(1){
  253. background: #ffffff url("../../../static/images/pest/index/pest_index_icon_2.png") no-repeat center;
  254. background-size: 100% 100%;
  255. }
  256. &:nth-child(2){
  257. background: #ffffff url("../../../static/images/pest/index/pest_index_icon_3.png") no-repeat center;
  258. background-size: 100% 100%;
  259. }
  260. img{
  261. width: 10vw;
  262. display: block;
  263. margin-left: 2vw;
  264. }
  265. .tab_tit{
  266. display: flex;
  267. align-items: center;
  268. span{
  269. font-size: .25rem;
  270. border: 1px solid #FCC762;
  271. background-color: #FED565;
  272. color: #F58D1F;
  273. padding: 2px 10px;
  274. border-radius: 100vh;
  275. margin-left: auto;
  276. }
  277. }
  278. p{
  279. display: flex;
  280. align-items: center;
  281. display: -webkit-box;
  282. -webkit-box-orient: vertical;
  283. -webkit-line-clamp: 1;
  284. word-break: break-all;
  285. overflow: hidden;
  286. &:nth-child(1){
  287. font-size: .35rem;
  288. }
  289. &:nth-child(2){
  290. font-size: .3rem;
  291. align-items: end;
  292. line-height: 1;
  293. margin-top: 2vw;
  294. color: rgba(28,35,76,.5);
  295. }
  296. }
  297. }
  298. }
  299. .list_tt{
  300. display: flex;
  301. justify-content: space-between;
  302. align-items: center;
  303. margin-top: 3vh;
  304. p{
  305. &:first-child{
  306. font-size: .38rem;
  307. }
  308. &:last-child{
  309. span{
  310. color: #999999;
  311. margin-left: 2vh;
  312. i{
  313. display: inline-block;
  314. width: 1vh;
  315. height: 1vh;
  316. border-radius: 100%;
  317. margin-right: 5PX;
  318. }
  319. &:first-child i{
  320. background: #fc8e13;
  321. }
  322. &:last-child i{
  323. background: #5fe495;
  324. }
  325. }
  326. }
  327. }
  328. }
  329. .list_main{
  330. margin-top: 15PX;
  331. height: 35vh;
  332. overflow-y: scroll;
  333. .item{
  334. border-radius: 30px;
  335. background: #fff;
  336. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  337. padding:25px 32px;
  338. margin-bottom: 20px;
  339. display: flex;
  340. align-items: center;
  341. img{
  342. width: 12%;
  343. margin-right: 2vh;
  344. }
  345. .info{
  346. flex: 1;
  347. .title{
  348. display: flex;
  349. font-size: 32px;
  350. align-items: center;
  351. height: 58px;
  352. justify-content: space-between;
  353. .news_title{
  354. display: -webkit-box;
  355. -webkit-box-orient: vertical;
  356. -webkit-line-clamp: 1;
  357. word-break: break-all;
  358. overflow: hidden;
  359. font-weight: bold;
  360. }
  361. .tips_mark{
  362. font-size: 14PX;
  363. color: #1C234C;
  364. text-align: center;
  365. flex-shrink: 0;
  366. background: linear-gradient(to right,#8AE15B,#BBFE9C);
  367. padding: 5px 25px;
  368. border-radius: 100vh;
  369. }
  370. }
  371. .time{
  372. font-size: 16PX;
  373. color: #c1c1c1;
  374. display: flex;
  375. align-items: center;
  376. margin-top: 5PX;
  377. justify-content: space-between;
  378. p:first-child{
  379. display: -webkit-box;
  380. -webkit-box-orient: vertical;
  381. -webkit-line-clamp: 1;
  382. word-break: break-all;
  383. overflow: hidden;
  384. span{
  385. color: #5fe495;
  386. font-weight: bold;
  387. }
  388. }
  389. p:last-child{
  390. font-size: 16PX;
  391. text-align: center;
  392. flex-shrink: 0;
  393. span{
  394. color: #5fe495;
  395. font-weight: bold;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. .operation{
  402. display: flex;
  403. align-items: center;
  404. justify-content: right;
  405. text-align: center;
  406. border-radius: 30px;
  407. background: #fff;
  408. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  409. height: 100%;
  410. padding: 0 15Px;
  411. margin-left: 10PX;
  412. .opera_btn{
  413. border-radius: 50%;
  414. &.delete{
  415. background:#df0707;
  416. margin-left: 10PX;
  417. .icon{
  418. width: 22PX;
  419. height: 29PX;
  420. background: url('../../assets/images/sunVillage_info/signature_icon_03.png') no-repeat;
  421. background-size: 100% 100%;
  422. display: block;
  423. }
  424. }
  425. &.edit{
  426. background: #79cf13;
  427. margin-left: 10PX;
  428. .icon {
  429. width: 26PX;
  430. height: 25PX;
  431. background: url('../../assets/images/sunVillage_info/signature_icon_02.png') no-repeat;
  432. background-size: 100% 100%;
  433. display: block;
  434. }
  435. }
  436. &.view{
  437. background: #3494ff;
  438. margin-left: 10PX;
  439. .icon {
  440. width: 29PX;
  441. height: 21PX;
  442. background: url('../../assets/images/sunVillage_info/signature_icon_04.png') no-repeat;
  443. background-size: 100% 100%;
  444. display: block;
  445. }
  446. }
  447. &.list{
  448. background: #79cf13;
  449. margin-left: 10PX;
  450. .icon {
  451. width: 29px;
  452. height: 21px;
  453. background: url('../../assets/images/sunVillage_info/list_icon_10.png') no-repeat;
  454. background-size: 100% 100%;
  455. display: block;
  456. }
  457. }
  458. }
  459. }
  460. }
  461. </style>