complete.vue 13 KB

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