index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <script setup>
  2. import {
  3. ref,
  4. reactive
  5. } from "vue";
  6. import {
  7. onLoad,
  8. } from "@dcloudio/uni-app";
  9. import {
  10. getProcessList,
  11. getVideoAddress,
  12. getProcessContact
  13. } from "@/api/work/preFlow.js";
  14. import config from '@/config.js';
  15. const videoPoster = ref(null);
  16. let orginalList = [];
  17. let processList = ref([]);
  18. let lastItem = ref([]);
  19. let videoUrl = ref(null);
  20. let funcCurrut = ref(0)
  21. let funcList = [{
  22. name: '前期决策阶段',
  23. },
  24. {
  25. name: '开工准备阶段',
  26. },
  27. {
  28. name: '投产运营阶段',
  29. }
  30. ]
  31. function onChangeFunc(index) {
  32. funcCurrut.value = index
  33. }
  34. let imageUrl = ref(null);
  35. const preViewImage = () => {
  36. uni.previewImage({
  37. current: 0,
  38. urls: [imageUrl.value],
  39. longPressActions: true,
  40. });
  41. }
  42. let contactValue = reactive({
  43. namePt: null,
  44. telPt: null,
  45. nameZrr: null,
  46. tel: null,
  47. nameLead: null,
  48. simCode: null
  49. })
  50. const getContact = id => {
  51. getProcessContact({
  52. id
  53. }).then(res => {
  54. contactValue.nameLead = res.data.nameLead;
  55. contactValue.namePt = res.data.namePt;
  56. contactValue.nameZrr = res.data.nameZrr;
  57. contactValue.simCode = res.data.simCode;
  58. contactValue.tel = res.data.tel;
  59. contactValue.telPt = res.data.telPt;
  60. })
  61. }
  62. // 弹窗显隐
  63. let dialogFlag = ref(false);
  64. const dialogShow = id => {
  65. dialogFlag.value = true;
  66. getContact(id);
  67. }
  68. const dialogHide = () => {
  69. dialogFlag.value = false;
  70. }
  71. let videoContext = ref()
  72. function onPlayVideo() {
  73. console.log('播放');
  74. videoContext.value = uni.createVideoContext('videoId')
  75. videoContext.value.requestFullScreen()
  76. videoContext.value.play()
  77. }
  78. //关闭视频播放
  79. function onOffVideo(e) {
  80. console.log(e,'打开关闭');
  81. if (!e.detail.fullScreen) {
  82. videoContext.value.pause()
  83. }
  84. }
  85. let fristData = ref([])
  86. let twoData = ref([])
  87. let threeData = ref([])
  88. onLoad(() => {
  89. getProcessList().then(res => {
  90. orginalList = [...res.data.list];
  91. console.log(orginalList, 'sss');
  92. orginalList.forEach(item => {
  93. if (item.numStage == 1) {
  94. fristData.value = item.list
  95. } else if (item.numStage == 2) {
  96. twoData.value = item.list
  97. } else if (item.numStage == 4) {
  98. threeData.value = item.list
  99. }
  100. })
  101. // if (res.data.list.length === 0) return;
  102. // if (res.data.list.length > 1) {
  103. // res.data.list.length = res.data.list.length - 1;
  104. // let tempArr = [];
  105. // for (let i in res.data.list) {
  106. // tempArr.push(res.data.list[i].list)
  107. // }
  108. // processList.value = tempArr;
  109. // lastItem.value = orginalList[orginalList.length - 1].list;
  110. // } else {
  111. // lastItem.value = res.data.list[0].list;
  112. // }
  113. })
  114. const serverAddress = uni.getStorageSync('serverAddress');
  115. const baseUrlIp = serverAddress ? serverAddress : config.baseUrl;
  116. videoUrl.value = baseUrlIp + '/projects/outApi/preFlow/vedio';
  117. videoPoster.value = baseUrlIp + '/projects/asset/css/images/video_main.png';
  118. imageUrl.value = baseUrlIp + '/projects/outApi/preFlow/img';
  119. })
  120. </script>
  121. <template>
  122. <view class="container">
  123. <page-title>办事流程</page-title>
  124. <view class="main">
  125. <view class="top-btn-box">
  126. <view class="item" @click="onPlayVideo()">
  127. <text>培训视频</text>
  128. <image src="../../static/process-video-icon.png" mode=""></image>
  129. </view>
  130. <view class="item" @click="preViewImage()">
  131. <text>流程图表</text>
  132. <image src="../../static/process-image-icon.png" mode=""></image>
  133. </view>
  134. </view>
  135. <view class="func-list">
  136. <view class="list-item" v-for="(item,index) in funcList" :key="index"
  137. :class="index === funcCurrut ? 'func-boxShadow' : ''" @click="onChangeFunc(index)">
  138. <text class="item-index">{{index + 1}}</text>
  139. <view class="item-text">
  140. {{item.name}}
  141. </view>
  142. <view class="delta" v-if="index === funcCurrut">
  143. </view>
  144. </view>
  145. </view>
  146. <view class="process-box" v-if="funcCurrut == 0">
  147. <view class="process-item" v-for="(item,index) in fristData" :key="index">
  148. <view class="process-title">
  149. <view class="title">
  150. {{item.title}}
  151. </view>
  152. <view class="process-item-btn" @click="dialogShow(item.id)">查看</view>
  153. </view>
  154. <view class="process-item-info">
  155. <view class="process-item-key">审核用时</view>
  156. <view class="process-item-value">{{item.num1}}天-{{item.num2}}天
  157. </view>
  158. </view>
  159. <view class="process-item-info">
  160. <view class="process-item-key">审核单位</view>
  161. <view class="process-item-value">{{item.spUnitDesc??"--"}}</view>
  162. </view>
  163. <view class="process-item-info">
  164. <view class="process-item-key">科室</view>
  165. <view class="process-item-value">{{item.departDesc??"--"}}</view>
  166. </view>
  167. <view class="process-item-info">
  168. <view class="process-item-key">备注</view>
  169. <view class="process-item-value">{{item.remark??"--"}}</view>
  170. </view>
  171. </view>
  172. </view>
  173. <view class="process-box" v-if="funcCurrut == 1">
  174. <view class="process-item" v-for="(item,index) in twoData" :key="index">
  175. <view class="process-title">
  176. <view class="title">
  177. {{item.title}}
  178. </view>
  179. <view class="process-item-btn" @click="dialogShow()">查看</view>
  180. </view>
  181. <view class="process-item-info">
  182. <view class="process-item-key">审核用时</view>
  183. <view class="process-item-value">{{item.num1}}天-{{item.num2}}天
  184. </view>
  185. </view>
  186. <view class="process-item-info">
  187. <view class="process-item-key">审核单位</view>
  188. <view class="process-item-value">{{item.spUnitDesc??"--"}}</view>
  189. </view>
  190. <view class="process-item-info">
  191. <view class="process-item-key">科室</view>
  192. <view class="process-item-value">{{item.departDesc??"--"}}</view>
  193. </view>
  194. <view class="process-item-info">
  195. <view class="process-item-key">备注</view>
  196. <view class="process-item-value">{{item.remark??"--"}}</view>
  197. </view>
  198. </view>
  199. </view>
  200. <view class="process-box" v-if="funcCurrut == 2">
  201. <view class="process-item" v-for="(item,index) in threeData" :key="index">
  202. <view class="process-title">
  203. <view class="title">
  204. {{item.title}}
  205. </view>
  206. <view class="process-item-btn" @click="dialogShow()">查看</view>
  207. </view>
  208. <view class="process-item-info">
  209. <view class="process-item-key">审核用时</view>
  210. <view class="process-item-value">{{item.num1}}天-{{item.num2}}天
  211. </view>
  212. </view>
  213. <view class="process-item-info">
  214. <view class="process-item-key">审核单位</view>
  215. <view class="process-item-value">{{item.spUnitDesc??"--"}}</view>
  216. </view>
  217. <view class="process-item-info">
  218. <view class="process-item-key">科室</view>
  219. <view class="process-item-value">{{item.departDesc??"--"}}</view>
  220. </view>
  221. <view class="process-item-info">
  222. <view class="process-item-key">备注</view>
  223. <view class="process-item-value">{{item.remark??"--"}}</view>
  224. </view>
  225. </view>
  226. </view>
  227. </view>
  228. <u-popup :show="dialogFlag" :round="20" @close="dialogHide()" mode="center">
  229. <view class="remind-box">
  230. <view class="remind-title">
  231. <view class="remind-title-text">联系人信息</view>
  232. </view>
  233. <view class="remind-content">
  234. <view class="card no-padding">
  235. <view class="card-item first-card-item">
  236. <view class="card-item-name">项目负责人</view>
  237. <view class="card-item-content">{{contactValue.nameZrr ?? "--"}}</view>
  238. </view>
  239. <view class="card-item">
  240. <view class="card-item-name">项目负责电话</view>
  241. <view class="card-item-content">{{contactValue.tel ?? "--"}}</view>
  242. </view>
  243. <view class="card-item">
  244. <view class="card-item-name">项目分管领导</view>
  245. <view class="card-item-content">{{contactValue.nameLead ?? "--"}}</view>
  246. </view>
  247. <view class="card-item">
  248. <view class="card-item-name">项目分管领导电话</view>
  249. <view class="card-item-content">{{contactValue.simCode ?? "--"}}</view>
  250. </view>
  251. <view class="card-item">
  252. <view class="card-item-name">项目管理平台联系人</view>
  253. <view class="card-item-content">{{contactValue.namePt ?? "--"}}</view>
  254. </view>
  255. <view class="card-item">
  256. <view class="card-item-name">项目管理平台电话</view>
  257. <view class="card-item-content">{{contactValue.telPt ?? "--"}}</view>
  258. </view>
  259. </view>
  260. </view>
  261. <view class="remind-btns">
  262. <view class="remind-btn" @click="dialogHide()">关闭</view>
  263. </view>
  264. </view>
  265. </u-popup>
  266. <video :src="videoUrl" id="videoId" :poster="videoPoster" style="width: 0 ;height: 0;"
  267. @fullscreenchange='onOffVideo'></video>
  268. </view>
  269. </template>
  270. <style lang="scss" scoped>
  271. .func-boxShadow {
  272. filter: drop-shadow(0rpx 2rpx 2rpx #9EBCFF) !important;
  273. border: 2rpx solid #9EBCFF !important;
  274. background: #FFFFFF;
  275. }
  276. .main {
  277. position: absolute;
  278. top: 8%;
  279. left: 0;
  280. display: flex;
  281. flex-direction: column;
  282. align-items: center;
  283. justify-content: flex-start;
  284. width: 100%;
  285. min-height: 92%;
  286. padding-top: calc(var(--status-bar-height) + 65px);
  287. background-color: #F2F7FF;
  288. .top-btn-box {
  289. display: flex;
  290. justify-content: space-between;
  291. align-items: center;
  292. width: 95%;
  293. gap: 4%;
  294. .item {
  295. display: flex;
  296. justify-content: center;
  297. align-items: center;
  298. gap: 20rpx;
  299. width: 48%;
  300. height: 120rpx;
  301. box-shadow: 0rpx 0rpx 8rpx 0rpx #D8EEFF, inset 0rpx 0rpx 6rpx 0rpx #D8EEFF, inset 2rpx 2rpx 0rpx 0rpx #FFFFFF;
  302. border: 2rpx solid rgba(255, 255, 255, 0.8);
  303. border-radius: 12rpx;
  304. background: #FBFDFF;
  305. text {
  306. font-size: 28rpx;
  307. font-weight: 500;
  308. color: #222222;
  309. }
  310. image {
  311. width: 88rpx;
  312. height: 88rpx;
  313. }
  314. }
  315. }
  316. .func-list {
  317. margin-top: 36rpx;
  318. display: flex;
  319. justify-content: space-between;
  320. align-items: center;
  321. width: 95%;
  322. .list-item {
  323. position: relative;
  324. display: flex;
  325. flex-direction: column;
  326. justify-content: center;
  327. align-items: center;
  328. gap: 5rpx;
  329. width: 220rpx;
  330. height: 127.06rpx;
  331. border: 2rpx solid #EBEBEB;
  332. border-radius: 12rpx;
  333. transition: all .3s;
  334. .item-index {
  335. font-weight: bold;
  336. font-size: 42rpx;
  337. color: #3F90FF;
  338. }
  339. .delta {
  340. position: absolute;
  341. bottom: -10rpx;
  342. content: '';
  343. width: 20rpx;
  344. height: 20rpx;
  345. border-radius: 3rpx;
  346. background-color: #FFFFFF;
  347. transform: rotateZ(45deg)skew(10deg, 10deg);
  348. }
  349. image {
  350. width: 80rpx;
  351. height: 80rpx;
  352. }
  353. .item-text {
  354. font-size: 24rpx;
  355. font-weight: 500;
  356. color: #999999;
  357. }
  358. }
  359. }
  360. }
  361. .process-box {
  362. position: relative;
  363. display: flex;
  364. flex-direction: column;
  365. justify-content: center;
  366. align-items: flex-start;
  367. margin-top: 32rpx;
  368. gap: 32rpx;
  369. width: 95%;
  370. .process-item {
  371. width: 100%;
  372. border-radius: 10rpx;
  373. box-shadow: 0rpx 0rpx 8rpx 0rpx #EEEEEE;
  374. padding: 40rpx 24rpx;
  375. background: #FFFFFF;
  376. .process-title {
  377. display: flex;
  378. justify-content: space-between;
  379. align-items: center;
  380. padding-bottom: 30rpx;
  381. .title {
  382. width: 500rpx;
  383. display: -webkit-box;
  384. -webkit-line-clamp: 2;
  385. -webkit-box-orient: vertical;
  386. overflow: hidden;
  387. }
  388. .process-item-btn {
  389. display: flex;
  390. justify-content: center;
  391. align-items: center;
  392. width: 128rpx;
  393. height: 56rpx;
  394. font-weight: 500;
  395. font-size: 32rpx;
  396. color: #002F69;
  397. background: #D6ECFF;
  398. border-radius: 30rpx;
  399. }
  400. }
  401. .process-item-info {
  402. margin-top: 3rpx;
  403. display: flex;
  404. justify-content: flex-start;
  405. gap: 20rpx;
  406. width: 100%;
  407. height: 34rpx;
  408. font-weight: 400;
  409. font-size: 24rpx;
  410. .process-item-key {
  411. display: flex;
  412. justify-content: space-between;
  413. width: 100rpx;
  414. font-size: 24rpx;
  415. font-weight: 500;
  416. color: #999999;
  417. }
  418. .process-item-value {
  419. display: flex;
  420. align-items: center;
  421. color: #333333;
  422. font-size: 24rpx;
  423. font-weight: 500;
  424. }
  425. }
  426. }
  427. }
  428. .video-play {
  429. width: 683rpx;
  430. height: 384rpx;
  431. margin: 100rpx auto 50rpx;
  432. border-radius: 16rpx;
  433. overflow: hidden;
  434. video {
  435. width: 100%;
  436. height: 100%;
  437. }
  438. }
  439. .image-show {
  440. width: 683rpx;
  441. height: 512rpx;
  442. margin: 0 auto 50rpx;
  443. border-radius: 16rpx;
  444. overflow: hidden;
  445. image {
  446. width: 100%;
  447. height: 100%;
  448. }
  449. }
  450. .remind-box {
  451. width: 618rpx;
  452. // height: 810rpx;
  453. padding: 0 20rpx;
  454. overflow: hidden;
  455. .remind-title {
  456. display: flex;
  457. justify-content: center;
  458. align-items: center;
  459. width: 100%;
  460. height: 100rpx;
  461. .remind-title-text {
  462. font-size: 38rpx;
  463. font-weight: 500;
  464. color: #3A3333;
  465. }
  466. }
  467. .remind-content {
  468. width: 100%;
  469. box-sizing: border-box;
  470. border-radius: 16rpx;
  471. .no-padding {
  472. padding: 20rpx 0;
  473. }
  474. .test {
  475. width: 100%;
  476. height: 1000rpx;
  477. background-color: green;
  478. }
  479. }
  480. .remind-btns {
  481. display: flex;
  482. justify-content: space-between;
  483. align-items: center;
  484. width: 100%;
  485. height: 92rpx;
  486. margin-top: 20rpx;
  487. font-size: 30rpx;
  488. .remind-btn {
  489. width: 100%;
  490. height: 64rpx;
  491. text-align: center;
  492. line-height: 64rpx;
  493. font-size: 24rpx;
  494. font-weight: 500;
  495. color: #FFFFFF;
  496. background: #1763E7;
  497. border-radius: 39rpx;
  498. }
  499. }
  500. }
  501. ::v-deep .u-popup__content {
  502. overflow: hidden;
  503. }
  504. </style>