移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

410 rindas
11 KiB

  1. <template>
  2. <div class="app-container">
  3. <div class="header">
  4. <img class="header_img" src="../../../static/images/contracted/contracted_index_head.png" alt="">
  5. <div class="header_block">
  6. <p>欢迎,{{ nickName }}</p>
  7. <p>{{ phone }}</p>
  8. </div>
  9. <van-popover
  10. v-model="showPopover"
  11. trigger="click"
  12. :actions="actions"
  13. @select="onSelect"
  14. placement="bottom-end"
  15. >
  16. <template #reference>
  17. <img class="header_setting" src="../../../static/images/contracted/contracted_index_icon_1.png" alt="">
  18. </template>
  19. </van-popover>
  20. </div>
  21. <div class="tab">
  22. <div :class="{active:taskOption=='FINISHED'}" @click="changeTaskOption('FINISHED')">
  23. <p><img src="../../../static/images/contracted/contracted_index_icon_4.png" alt="">已完成任务</p>
  24. <p><span>{{ surveyTask['FINISHED'].length }}</span>个</p>
  25. </div>
  26. <div :class="{active:taskOption=='UNFINISHED'}" @click="changeTaskOption('UNFINISHED')">
  27. <p><img src="../../../static/images/contracted/contracted_index_icon_5.png" alt="">进行中任务</p>
  28. <p><span>{{ surveyTask['UNFINISHED'].length }}</span>个</p>
  29. </div>
  30. </div>
  31. <div class="list_tt">
  32. <p>任务清单({{surveyTask[taskOption].length}})</p>
  33. <p>
  34. <span><i></i>已完成</span>
  35. <span><i></i>总数</span>
  36. </p>
  37. </div>
  38. <div class="list_main">
  39. <van-list>
  40. <van-swipe-cell v-for="item in surveyTask[taskOption]" :key="item.id" >
  41. <div class="item" @click="goDetail(item)">
  42. <img src="../../../static/images/contracted/contracted_index_icon_6.png" alt="">
  43. <div class="info">
  44. <div class="title">
  45. <p class="news_title">{{item.parentName}} {{item.deptName}}</p>
  46. <p class="tips_mark">{{item.cbfFinishNum}}</p>
  47. </div>
  48. <div class="time">
  49. <p>{{item.surUsernames}}</p>
  50. <p>{{item.cbfNum}}</p>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- <template #right>
  55. <div class="operation">
  56. delete 删除 edit编辑 view查看 list榜单
  57. <div class="opera_btn">
  58. <img src="../../assets/images/sunVillage_info/signature_icon_02.png" alt="" width="35">
  59. <p>签名</p>
  60. </div>
  61. <div class="opera_btn" style="margin: 0 10px;">
  62. <img src="../../assets/images/sunVillage_info/signature_icon_03.png" alt="" width="35">
  63. <p>预览</p>
  64. </div>
  65. <div class="opera_btn">
  66. <img src="../../assets/images/sunVillage_info/signature_icon_04.png" alt="" width="35">
  67. <p>电子合同</p>
  68. </div>
  69. <div class="opera_btn">
  70. <img src="../../assets/images/sunVillage_info/signature_icon_04.png" alt="" width="35">
  71. <p>线下合同</p>
  72. </div>
  73. </div>
  74. </template> -->
  75. </van-swipe-cell>
  76. </van-list>
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import Cookies from "js-cookie";
  82. import { listSurveyTask } from "@/api/contracted";
  83. import { getInfo, logout } from "@/api/login";
  84. export default {
  85. name: "contractedIndex",
  86. data() {
  87. return {
  88. showPopover: false,
  89. // 通过 actions 属性来定义菜单选项
  90. actions: [
  91. { text: '修改密码',value:1 },
  92. { text: '退出登录',value:2 }
  93. ],
  94. nickName: null,
  95. phone: null,
  96. // 调查任务
  97. surveyTask: {
  98. 'FINISHED': [], // 已完成任务
  99. 'UNFINISHED': [] // 进行中任务
  100. },
  101. // 任务选项
  102. taskOption: 'FINISHED',
  103. };
  104. },
  105. created() {
  106. this.getUserInfo();
  107. },
  108. methods: {
  109. getUserInfo() {
  110. getInfo().then(response => {
  111. this.nickName = response.user.nickName;
  112. this.phone = response.user.phonenumber;
  113. this.getList(response.user.userId);
  114. });
  115. },
  116. getList(userId){
  117. listSurveyTask({userId: userId}).then(response => {
  118. this.surveyTask = response.data;
  119. });
  120. },
  121. goDetail(item){
  122. // 调查任务完成状态:已完成标记为1,未完成标记为2
  123. let status = '1';
  124. if (item.surStatus === 'UNFINISHED') {
  125. status = '2';
  126. }
  127. Cookies.set('taskStatus', status, { expires: 30 });
  128. this.$router.push({path:'/contracted/village/contractor', query: { deptId: item.deptId, deptName: item.deptName }})
  129. },
  130. onSelect(action) {
  131. switch (action.value) {
  132. case 1:
  133. this.$router.push({path:'/contracted/user/passWord'})
  134. break;
  135. case 2:
  136. this.loginOut();
  137. break;
  138. }
  139. },
  140. changeTaskOption(option) {
  141. this.taskOption = option;
  142. },
  143. loginOut() {
  144. logout().then(res => {
  145. this.$router.push({ path: '/contracted/login' });
  146. })
  147. }
  148. },
  149. };
  150. </script>
  151. <style scoped lang="scss">
  152. .app-container{
  153. background: #fff url("../../../static/images/contracted/contracted_index_bg.png") no-repeat center;
  154. background-size: 100% 100%;
  155. height: 100vh;
  156. padding: 0 4vw;
  157. }
  158. /deep/ .van-popover__wrapper{
  159. margin-left: auto;
  160. }
  161. .header{
  162. display: flex;
  163. align-items: center;
  164. padding: 5vh 0 0;
  165. .header_img{
  166. display: block;
  167. width: 15vw;
  168. height: 15vw;
  169. border-radius: 50%;
  170. border: 3PX solid #ffffff;
  171. }
  172. .header_block{
  173. margin-left: 4vw;
  174. p{
  175. font-size: .4rem;
  176. &:nth-child(1){
  177. font-size: .5rem;
  178. font-weight: bold;
  179. margin-bottom: 1vh;
  180. }
  181. }
  182. }
  183. .header_setting{
  184. margin-left: auto;
  185. width: 6vw;
  186. margin-bottom: auto;
  187. }
  188. }
  189. .tab{
  190. display: flex;
  191. align-items: center;
  192. justify-content: space-between;
  193. .active{
  194. box-shadow: 0 5PX 10PX #c9c9c9;
  195. }
  196. div{
  197. width: 44vw;
  198. height: 22vw;
  199. display: flex;
  200. flex-direction: column;
  201. justify-content: center;
  202. padding: 0 5vw;
  203. border-radius: 4vw;
  204. margin-top: 3vh;
  205. position: relative;
  206. &:nth-child(1){
  207. background: url("../../../static/images/contracted/contracted_index_icon_2.png") no-repeat center;
  208. background-size: 100% 100%;
  209. }
  210. &:nth-child(2){
  211. background: url("../../../static/images/contracted/contracted_index_icon_3.png") no-repeat center;
  212. background-size: 100% 100%;
  213. }
  214. p img{
  215. width: 5vw;
  216. display: block;
  217. margin-right: 2vw;
  218. }
  219. p{
  220. display: flex;
  221. align-items: center;
  222. &:nth-child(1){
  223. font-size: .4rem;
  224. }
  225. &:nth-child(2){
  226. font-size: .3rem;
  227. align-items: end;
  228. line-height: 1;
  229. padding-left: 8vw;
  230. margin-top: 2vw;
  231. span{
  232. font-size: .5rem;
  233. font-weight: bold;
  234. margin-right: 2vw;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. .list_tt{
  241. display: flex;
  242. justify-content: space-between;
  243. align-items: center;
  244. margin-top: 3vh;
  245. p{
  246. &:first-child{
  247. font-size: .38rem;
  248. font-weight: bold;
  249. }
  250. &:last-child{
  251. span{
  252. color: #999999;
  253. margin-left: 2vh;
  254. i{
  255. display: inline-block;
  256. width: 1vh;
  257. height: 1vh;
  258. border-radius: 100%;
  259. margin-right: 5PX;
  260. }
  261. &:first-child i{
  262. background: #fc8e13;
  263. }
  264. &:last-child i{
  265. background: #5fe495;
  266. }
  267. }
  268. }
  269. }
  270. }
  271. .list_main{
  272. margin-top: 15PX;
  273. height: 65vh;
  274. overflow-y: scroll;
  275. .item{
  276. border-radius: 30px;
  277. background: #fff;
  278. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  279. padding:25px 32px;
  280. margin-bottom: 20px;
  281. display: flex;
  282. align-items: center;
  283. img{
  284. width: 12%;
  285. margin-right: 2vh;
  286. }
  287. .info{
  288. flex: 1;
  289. .title{
  290. display: flex;
  291. font-size: 32px;
  292. align-items: center;
  293. height: 58px;
  294. justify-content: space-between;
  295. .news_title{
  296. display: -webkit-box;
  297. -webkit-box-orient: vertical;
  298. -webkit-line-clamp: 1;
  299. word-break: break-all;
  300. overflow: hidden;
  301. font-weight: bold;
  302. }
  303. .tips_mark{
  304. font-size: 16PX;
  305. color: #fc8e13;
  306. text-align: center;
  307. flex-shrink: 0;
  308. font-weight: bold;
  309. }
  310. }
  311. .time{
  312. font-size: 16PX;
  313. color: #999999;
  314. display: flex;
  315. align-items: center;
  316. margin-top: 5PX;
  317. justify-content: space-between;
  318. p:first-child{
  319. display: -webkit-box;
  320. -webkit-box-orient: vertical;
  321. -webkit-line-clamp: 1;
  322. word-break: break-all;
  323. overflow: hidden;
  324. }
  325. p:last-child{
  326. font-size: 16PX;
  327. color: #5fe495;
  328. text-align: center;
  329. flex-shrink: 0;
  330. font-weight: bold;
  331. }
  332. }
  333. }
  334. }
  335. .operation{
  336. display: flex;
  337. align-items: center;
  338. justify-content: right;
  339. text-align: center;
  340. border-radius: 30px;
  341. background: #fff;
  342. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  343. height: 100%;
  344. padding: 0 15Px;
  345. margin-left: 10PX;
  346. .opera_btn{
  347. border-radius: 50%;
  348. &.delete{
  349. background:#df0707;
  350. margin-left: 10PX;
  351. .icon{
  352. width: 22PX;
  353. height: 29PX;
  354. background: url('../../assets/images/sunVillage_info/signature_icon_03.png') no-repeat;
  355. background-size: 100% 100%;
  356. display: block;
  357. }
  358. }
  359. &.edit{
  360. background: #79cf13;
  361. margin-left: 10PX;
  362. .icon {
  363. width: 26PX;
  364. height: 25PX;
  365. background: url('../../assets/images/sunVillage_info/signature_icon_02.png') no-repeat;
  366. background-size: 100% 100%;
  367. display: block;
  368. }
  369. }
  370. &.view{
  371. background: #3494ff;
  372. margin-left: 10PX;
  373. .icon {
  374. width: 29PX;
  375. height: 21PX;
  376. background: url('../../assets/images/sunVillage_info/signature_icon_04.png') no-repeat;
  377. background-size: 100% 100%;
  378. display: block;
  379. }
  380. }
  381. &.list{
  382. background: #79cf13;
  383. margin-left: 10PX;
  384. .icon {
  385. width: 29px;
  386. height: 21px;
  387. background: url('../../assets/images/sunVillage_info/list_icon_10.png') no-repeat;
  388. background-size: 100% 100%;
  389. display: block;
  390. }
  391. }
  392. }
  393. }
  394. }
  395. </style>