complete.vue 16 KB

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