working.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. <template>
  2. <view class="box">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'施工报告'"></homenav>
  4. <view class="topbox">
  5. <view class="IncoBox">
  6. <img src="../../static/timg/icon_ddztty@2x.png" alt="" class="iconwg">
  7. <view class="wgTitle">施工报告</view>
  8. </view>
  9. </view>
  10. <view class="shopBox">
  11. <view class="shopleft">
  12. <img src="../../static/timg/wgshop.png" alt="" class="shopIcon">
  13. <view class="shopNameBox">
  14. <view class="shopName">{{headInfo.shopName}}</view>
  15. <view class="shopAddress">{{headInfo.address?headInfo.address:''}}</view>
  16. </view>
  17. </view>
  18. <view class="shopRight" @click="call">
  19. <img src="../../static/timg/wgcall.png" alt="" class="wgCall">
  20. <view class="wgmobilePhone">电话</view>
  21. </view>
  22. </view>
  23. <view class="carBox">
  24. <view class="carLeft">
  25. <img src="../../static/timg/icon_che.png" alt="" class="shopIcon">
  26. </view>
  27. <view class="carRight">
  28. <view class="carRtop">
  29. <view class="carCp">{{headInfo.plateNumber}}</view>
  30. <view class="carGongli" v-if="headInfo.currentMileage">{{headInfo.currentMileage}}km</view>
  31. </view>
  32. <view class="carMname">{{headInfo.carModel}}</view>
  33. </view>
  34. </view>
  35. <view class="newIiembox">
  36. <view class="newItime">
  37. <view class="newIname3">项目名称</view>
  38. <view class="newIname3">施工前照片</view>
  39. <view class="newIname3">施工后照片</view>
  40. <view class="newIname3">施工备注</view>
  41. </view>
  42. <view class="newItem" v-for="(v,i) in itemDetailList">
  43. <view class="newItemLine">
  44. <view class="newsectionName">{{v.sectionName}}</view>
  45. <view class="itemImgBox" >
  46. <view class="itemImghz" v-if="v.beforePhotoList" @click="sphotos(v.beforePhotoList.split(','))">
  47. <img :src="v.beforePhotoList.split(',')[0]" alt="" class="newcarPhotoImg">
  48. <view class="itemImgYy" v-if="v.beforePhotoList.split(',').length>1">
  49. <img src=".../../static/timg/icon_pic.png" alt="" class="itemImgYyImg">
  50. <view class="itemImgYyNUm">{{v.beforePhotoList.split(',').length}}</view>
  51. </view>
  52. </view>
  53. <view class="itemImghz" v-else>
  54. <img src=".../../static/timg/noimg.png" alt="" class="newcarPhotoImg">
  55. </view>
  56. </view>
  57. <view class="itemImgBox" >
  58. <view class="itemImghz" v-if="v.afterPhotoList" @click="sphotos(v.afterPhotoList.split(','))">
  59. <img :src="v.afterPhotoList.split(',')[0]" alt="" class="newcarPhotoImg">
  60. <view class="itemImgYy" v-if="v.afterPhotoList.split(',').length>1" >
  61. <img src=".../../static/timg/icon_pic.png" alt="" class="itemImgYyImg">
  62. <view class="itemImgYyNUm">{{v.afterPhotoList.split(',').length}}</view>
  63. </view>
  64. </view>
  65. <view class="itemImghz" v-else>
  66. <img src=".../../static/timg/noimg.png" alt="" class="newcarPhotoImg">
  67. </view>
  68. </view>
  69. <view class="newsectionName">{{v.workComment?v.workComment:''}}</view>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 手机号授权 -->
  74. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  75. <view class="authorizCont" @click.stop="">
  76. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  77. <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
  78. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  79. </view>
  80. <view style="text-align: center;padding-top: 56rpx;">
  81. <image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import homenav from "../../components/homenav/nav.vue"
  88. import nodata from '../../components/nodata/nodata.vue'
  89. export default {
  90. components: {
  91. homenav,nodata
  92. },
  93. data() {
  94. return {
  95. location: '',
  96. id: '',
  97. orderData: '',
  98. themeColor: '',
  99. authorizShow: false,
  100. userInfo: '',
  101. ext: '',
  102. wxOpenData: '',
  103. headInfo: {},
  104. itemDetailList: '',
  105. Photos:[],
  106. PhotosShow:false,
  107. demo01_index:0,
  108. iStatusBarHeight:'',
  109. }
  110. },
  111. onLoad(opt) {
  112. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  113. this.id = opt.id
  114. this.themeColor = uni.getStorageSync("themeColor");
  115. this.userInfo = this.$store.state.userInfo;
  116. this.ext = this.$common.getExtStoreId();
  117. if (this.userInfo) {
  118. this.getData()
  119. } else {
  120. this.$common.automaticlogin().then(val => {
  121. this.userInfo = this.$store.state.userInfo;
  122. this.wxOpenData = this.$store.state.wxOpenData;
  123. this.themeColor = uni.getStorageSync("themeColor");
  124. this.getData();
  125. if(!this.userInfo){
  126. this.authorizShow=true
  127. }
  128. })
  129. }
  130. },
  131. methods: {
  132. sphotos(img){
  133. console.log(img)
  134. // 预览图片
  135. uni.previewImage({
  136. urls: img,
  137. //current: img,
  138. longPressActions: {
  139. itemList: ['发送给朋友', '保存图片', '收藏'],
  140. success: function(data) {
  141. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  142. },
  143. fail: function(err) {
  144. console.log(err.errMsg);
  145. }
  146. }
  147. });
  148. },
  149. decryptPhoneNumber: function(e) {
  150. console.log(e);
  151. this.code = e.detail.code
  152. this.wxPhoneLogin()
  153. this.authorizShow = false;
  154. },
  155. wxPhoneLogin() {
  156. var that = this;
  157. this.$http('miniApp2/sys/wxPhoneLogin', {
  158. appId: this.ext.appId,
  159. unionId: this.ext.unionId,
  160. code: this.code,
  161. openId: this.wxOpenData.openid
  162. }, 'POST').then(res => {
  163. var data = res.data;
  164. if (data.loginInfo) {
  165. this.userInfo = data.loginInfo.openUser;
  166. this.wxOpenData = data.loginInfo;
  167. this.$store.commit('mutationswxOpenData', data)
  168. this.$store.commit('mutationsuserInfo', this.userInfo)
  169. this.getData()
  170. }
  171. })
  172. },
  173. map() {
  174. console.log("打开地图")
  175. var that = this;
  176. if (!that.orderData.billsheet.lat || !that.orderData.billsheet.lng) {
  177. uni.showToast({
  178. title: '该店铺未设置定位',
  179. icon: 'none',
  180. duration: 3000
  181. });
  182. } else {
  183. uni.openLocation({
  184. latitude: Number(that.orderData.billsheet.lat),
  185. longitude: Number(that.orderData.billsheet.lng),
  186. name: that.orderData.billsheet.ShopName,
  187. address: that.orderData.billsheet.Address,
  188. success: function() {
  189. console.log('success');
  190. },
  191. fail(err) {
  192. console.log(err)
  193. }
  194. });
  195. }
  196. },
  197. call() {
  198. uni.makePhoneCall({
  199. phoneNumber: this.headInfo.mobilePhone
  200. });
  201. },
  202. getData() {
  203. let that = this
  204. uni.showLoading({
  205. title: '加载中'
  206. });
  207. this.$http('checkCarApi/workingReport', {
  208. sheetID:this.id,// '56D5F8C1-9F11-40BA-8937-B4AABD4666B5',
  209. }, 'GET').then(res => {
  210. uni.hideLoading();
  211. this.itemDetailList=res.data.itemDetailList;
  212. this.headInfo=res.data.headInfo;
  213. //console.log('data===', this.orderData);
  214. })
  215. },
  216. //时间对比
  217. getDateBeforeNow(stringTime) {
  218. console.log("传参未格式化", stringTime);
  219. stringTime = new Date(stringTime.replace(/-/g, '/'))
  220. // 统一单位换算
  221. var minute = 1000 * 60;
  222. var hour = minute * 60;
  223. var day = hour * 24;
  224. var week = day * 7;
  225. var month = day * 30;
  226. var year = month * 12;
  227. var time1 = new Date().getTime(); //当前的时间戳 console.log("当前时间", time1);
  228. // 对时间进行毫秒单位转换 var time2 = new Date(stringTime).getTime(); //指定时间的时间戳
  229. console.log("传过来的时间", time2);
  230. var time = time1 - time2;
  231. console.log("计算后的时间", time);
  232. var result =
  233. null; // if (time < 0) { // // alert("传过来的时间的时间不能晚于当前时间!"); // result = stringTime; // } else if (time / year >= 1) {
  234. // result = parseInt(time / year) + "年前";
  235. // } else if (time / month >= 1) {
  236. // result = parseInt(time / month) + "月前";
  237. // } else if (time / week >= 1) { // result = parseInt(time / week) + "周前"; // } else if (time / day >= 1) {
  238. // result = parseInt(time / day) + "天前";
  239. // } else if (time / hour >= 1) { // result = parseInt(time / hour) + "小时前";
  240. // } else if (time / minute >= 1) {
  241. // result = parseInt(time / minute) + "分钟前"; // } else {
  242. // result = "刚刚"; // }
  243. if (time < 0) {
  244. // alert("传过来的时间的时间不能晚于当前时间!");
  245. result = -1;
  246. } else if (time / day >= 0) {
  247. result = parseInt(time / day); //多少天前
  248. }
  249. console.log("多少天前", result);
  250. return result;
  251. },
  252. goback() {
  253. uni.navigateBack({})
  254. },
  255. },
  256. onPullDownRefresh() {
  257. this.getData()
  258. setTimeout(function() {
  259. uni.stopPullDownRefresh();
  260. }, 1000);
  261. },
  262. }
  263. </script>
  264. <style scoped>
  265. .box{
  266. width: 100vw;
  267. min-height: 100vh;
  268. background: #F4F5F7;
  269. }
  270. .topbox{
  271. width: 750rpx;
  272. height: 200rpx;
  273. background: #FF0000;
  274. }
  275. .carBox{
  276. width: 702rpx;
  277. padding-bottom: 30rpx;
  278. background: #FFFFFF;
  279. border-radius: 10rpx;
  280. margin-left:24rpx;
  281. margin-top:20rpx;
  282. display: flex;
  283. }
  284. .shopBox{
  285. width: 702rpx;
  286. padding-bottom: 30rpx;
  287. background: #FFFFFF;
  288. border-radius: 10rpx;
  289. margin-left:24rpx;
  290. margin-top:-70rpx;
  291. display: flex;
  292. justify-content: space-between;
  293. }
  294. .shopleft{
  295. display: flex;
  296. padding-top: 32rpx;
  297. padding-left: 20rpx;
  298. }
  299. .shopNameBox{
  300. padding-left: 20rpx;
  301. }
  302. .shopAddress{
  303. width: 450rpx;color: #999999;padding-top: 10rpx;font-size: 24rpx;
  304. }
  305. .shopName{
  306. font-size: 30rpx;
  307. font-family: PingFangSC-Medium, PingFang SC;
  308. font-weight: 500;
  309. color: #3C3C3C;
  310. }
  311. .wgCall{
  312. width:44rpx;
  313. height:44rpx;
  314. }
  315. .carIcon{
  316. width: 72rpx;
  317. height: 72rpx;
  318. border-radius: 36rpx;
  319. }
  320. .wgmobilePhone{
  321. color: #999999;
  322. font-size: 24rpx;
  323. padding-top: 10rpx;
  324. }
  325. .shopRight{
  326. text-align: center;padding-top: 30rpx;
  327. padding-right: 20rpx;
  328. }
  329. .carRtop{
  330. display: flex;
  331. }
  332. .carCp{
  333. font-size: 30rpx;
  334. font-family: PingFangSC-Medium, PingFang SC;
  335. font-weight: 500;
  336. color: #333333;
  337. line-height: 36rpx;
  338. padding-right: 30rpx;
  339. }
  340. .carGongli{
  341. font-weight: 500;
  342. color: #F19D01;
  343. font-size: 24rpx;
  344. line-height: 36rpx;
  345. background: #FFF8EB;
  346. border-radius: 5rpx;
  347. padding: 0 10rpx;
  348. }
  349. .carLeft{
  350. padding-left: 20rpx;
  351. padding-top: 30rpx;
  352. padding-right: 20rpx;
  353. }
  354. .carMname{
  355. font-weight: 400;
  356. color: #999999;
  357. line-height: 33rpx;
  358. font-size: 24rpx;
  359. width: 570rpx;
  360. padding: 10rpx 0;
  361. overflow: hidden; /*内容会被修剪,并且其余内容是不可见的*/
  362. text-overflow:ellipsis; /*显示省略符号来代表被修剪的文本。*/
  363. white-space: nowrap;
  364. }
  365. .carRight{
  366. padding-top: 30rpx;
  367. }
  368. .reception{
  369. display: flex;
  370. }
  371. .receptionImg{
  372. width: 27rpx;
  373. height: 29rpx;
  374. }
  375. .receptionName{
  376. font-weight: 400;
  377. color: #999999;
  378. font-size: 24rpx;
  379. line-height: 29rpx;
  380. padding-left: 12rpx;
  381. }
  382. .itemLIne{
  383. width: 662rpx;
  384. margin-top: 20rpx;
  385. margin-left: 24rpx;
  386. background: #FFFFFF;
  387. border-radius: 10rpx;
  388. padding: 0 20rpx 15rpx 20rpx;
  389. }
  390. .itemTitieBox{
  391. display: flex;
  392. justify-content: space-between;
  393. padding: 28rpx 0;
  394. border-bottom: 1rpx solid #EEEEEE;
  395. }
  396. .itemTitle{
  397. font-weight: 500;
  398. color: #333333;
  399. line-height: 42rpx;
  400. font-size: 30rpx;
  401. }
  402. .itemstate{
  403. font-weight: 400;
  404. color: #3F90F7;
  405. line-height: 42rpx;
  406. font-size: 28rpx;
  407. }
  408. .Construction{
  409. display: flex;
  410. padding-top: 29rpx;
  411. padding-bottom: 15rpx;
  412. }
  413. .itemMs{
  414. font-weight: 400;
  415. color: #666666;
  416. font-size: 28rpx;
  417. }
  418. .personnel{
  419. font-weight: 400;
  420. color: #3C3C3C;
  421. font-size: 28rpx;
  422. padding-left: 72rpx;
  423. }
  424. .carPhotoImg{
  425. width: 150rpx;
  426. height: 150rpx;
  427. border-radius: 5rpx;
  428. margin-right: 20rpx;
  429. margin-top: 16rpx;
  430. }
  431. .carPhoto{
  432. display: flex;
  433. flex-wrap: wrap;
  434. }
  435. .carPhotoImg:nth-child(4n){
  436. margin-right: 0;
  437. }
  438. .carPhotoBox{
  439. padding-top: 15rpx;
  440. padding-bottom: 15rpx;
  441. }
  442. .IncoBox{
  443. display: flex;
  444. justify-content: center;
  445. padding-top:43rpx;
  446. }
  447. .iconwg{
  448. width:44rpx;
  449. height:44rpx;
  450. }
  451. .wgTitle{
  452. color:#ffffff;
  453. line-height:44rpx;
  454. padding-left: 18rpx;
  455. font-size: 36rpx;
  456. }
  457. .shopIcon{
  458. width:44rpx;
  459. height:44rpx;
  460. }
  461. .newIiembox{
  462. background: #ffffff;
  463. margin-top:20rpx;
  464. width: 702rpx;
  465. margin-left:24rpx;
  466. }
  467. .newItime{
  468. display: flex; border-bottom:1rpx solid #EEEEEE;
  469. }
  470. .newIname1{
  471. width:338rpx;
  472. text-align: center;
  473. color: #999999;
  474. padding:20rpx 0;
  475. }
  476. .newIname2{
  477. width:182rpx;
  478. text-align: center;
  479. color: #999999;
  480. padding:20rpx 0;
  481. }
  482. .newItemName{
  483. width:318rpx;
  484. color: #333333;
  485. padding-left:20rpx;
  486. height:150rpx;
  487. display: flex;
  488. align-items: center;
  489. }
  490. .newcarPhotoImg{
  491. width: 150rpx;
  492. height: 150rpx;
  493. border-radius: 10rpx;
  494. }
  495. .itemImgBox{
  496. width: 150rpx;
  497. padding:0 16rpx;
  498. height: 150rpx;
  499. }
  500. .itemImghz{
  501. width: 150rpx;
  502. height: 150rpx;
  503. border-radius: 10rpx;
  504. overflow: hidden;
  505. position: relative;
  506. }
  507. .itemImgYy{
  508. position:absolute;
  509. width: 68rpx;
  510. height: 36rpx;
  511. background: rgba(0, 0, 0, 0.4);
  512. border-radius: 10rpx 0rpx 10rpx 0rpx;
  513. display: flex;
  514. justify-content: center;
  515. align-items: center;
  516. bottom:0;
  517. right:0;
  518. }
  519. .newItemLine{
  520. display: flex;
  521. padding:20rpx 0;
  522. border-bottom:1rpx solid #EEEEEE;
  523. }
  524. .itemImgYyImg{
  525. width: 26rpx;
  526. height: 26rpx;
  527. }
  528. .itemImgYyNUm{
  529. color: #FFFFFF;
  530. line-height: 26rpx;
  531. font-size: 22rpx;
  532. padding-left: 5rpx;
  533. }
  534. .lbImgBOx{
  535. position: fixed;
  536. width: 100%;
  537. height:100vh;
  538. background: rgba(0, 0, 0, 0.9);
  539. left: 0;
  540. top: 0;
  541. display: flex;
  542. justify-content: center;
  543. align-items: center;
  544. }
  545. .lbImgview{
  546. width:100%;
  547. }
  548. .newIname3{
  549. width:175rpx;
  550. text-align: center;
  551. color: #999999;
  552. padding:20rpx 0;
  553. font-size: 24rpx;
  554. }
  555. .newsectionName{
  556. width:155rpx;
  557. color: #333333;
  558. padding-left:20rpx;
  559. height:150rpx;
  560. display: flex;
  561. align-items: center;
  562. font-size: 26rpx;
  563. }
  564. .authorizBox{
  565. width: 100vw;
  566. height: 100vh;
  567. background: rgba(0, 0, 0, 0.5);
  568. position: fixed;
  569. top: 0;
  570. left: 0;
  571. }
  572. .authorizCont{
  573. margin-top: 30vh;
  574. width: 564rpx;
  575. height: 408rpx;
  576. background: #FFFFFF;
  577. border-radius: 24rpx;
  578. margin-left: 93rpx;
  579. position: relative;
  580. }
  581. .authorizCloseImg{
  582. width: 62rpx;
  583. height: 62rpx;
  584. }
  585. .sqLogoBox{
  586. width: 180rpx;
  587. height: 180rpx;
  588. background: #FFFFFF;
  589. border-radius: 90rpx;
  590. text-align: center;
  591. position: absolute;
  592. top: -50rpx;
  593. left: 192rpx;
  594. }
  595. .authorizName{
  596. color: #333333;
  597. line-height: 42rpx;
  598. font-size: 30rpx;
  599. text-align: center;
  600. padding-top: 58rpx;
  601. }
  602. .authorizMs{
  603. color: #999999;
  604. line-height: 36rpx;
  605. font-size: 26rpx;
  606. width: 452rpx;
  607. padding-top: 24rpx;
  608. text-align: center;
  609. margin-left: 56rpx;
  610. }
  611. .authorizContbutton{
  612. width: 422rpx;
  613. height: 88rpx;
  614. background: #D53533;
  615. border-radius: 44rpx;
  616. line-height: 88rpx;
  617. text-align: center;
  618. font-size:30rpx;
  619. color: #FFFFFF;
  620. margin-top: 62rpx;
  621. margin-left:71rpx;
  622. }
  623. </style>