index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view class="container">
  3. <uni-navbar title="路线详情"></uni-navbar>
  4. <view class="box commonMt" style="overflow: hidden;">
  5. <view class="topMap">
  6. <mapPreview :startPoint='form.startPoint' :endPoint='form.endPoint' v-show="isMap"
  7. :mtRoutePointList='form.mtRoutePointList'></mapPreview>
  8. </view>
  9. <view class="box3">
  10. <view class="reject-box commonBj commonMt">
  11. <view class="reject-box-top">
  12. <view class="top-left">
  13. <image src="../../static/images/path/location.png" mode="widthFix"></image>
  14. <text class="listTitle">路线信息</text>
  15. </view>
  16. </view>
  17. <view class="reject-box-bottom">
  18. <!-- <view class="map">
  19. <mapImg :startPoint='form.startPoint' :endPoint='form.endPoint' :mtRoutePointList='form.mtRoutePointList'></mapImg>
  20. </view> -->
  21. <view class="state-icon">
  22. <view class="flexAlignCenter">
  23. <view class="greenCircle">
  24. </view>
  25. <text class="itemText">开始地址:</text>
  26. </view>
  27. <view class="flexAlignCenter">
  28. <text class="infoText">{{form.startName}}</text>
  29. </view>
  30. </view>
  31. <view class="state-icon">
  32. <view class="flexAlignCenter">
  33. <view class="greenCircle">
  34. </view>
  35. <text class="itemText">结束地址:</text>
  36. </view>
  37. <view class="flexAlignCenter">
  38. <text class="infoText">{{form.endName}}</text>
  39. </view>
  40. </view>
  41. <view class="state-icon">
  42. <view class="flexAlignCenter">
  43. <view class="greenCircle">
  44. </view>
  45. <text class="itemText">发起部门:</text>
  46. </view>
  47. <view class="flexAlignCenter">
  48. <text class="infoText">{{form.startDept}}</text>
  49. </view>
  50. </view>
  51. <view class="state-icon mb0">
  52. <view class="flexAlignCenter">
  53. <view class="greenCircle">
  54. </view>
  55. <text class="itemText">发起时间:</text>
  56. </view>
  57. <view class="flexAlignCenter">
  58. <text class="infoText">{{form.createTime}}</text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 审批状态 -->
  64. <view :class="'reject-box mt28 commonMb '+ (isPass?'commonGreenBj':'commonRedBj')">
  65. <view :class="'reject-box-top just-content-start '+(isPass?'bg-color-green':'bg-color-red')">
  66. <image src="../../static/images/car/yunshu.png" mode="widthFix"></image>
  67. <text class="listTitle">审批状态</text>
  68. </view>
  69. <view class="reject-box-bottom pb0">
  70. <view class="state-icon">
  71. <view class="flexAlignCenter">
  72. <view :class="'greenCircle '+(isPass?'':'bg-color-red') ">
  73. </view>
  74. <text class="itemText">审批状态:</text>
  75. </view>
  76. <view class="flexAlignCenter">
  77. <u-icon :color="isPass?'#017D3E':'#FB5637'" style="margin-right: 12rpx;"
  78. :name="isPass?'checkmark-circle-fill':'close-circle-fill'"></u-icon>
  79. <text :class="isPass?'greenText':'redText'">{{isPass?'通过':'驳回'}}</text>
  80. </view>
  81. </view>
  82. <!-- <view :class="isPass?'border-style mb':'border-style2'"></view> -->
  83. <view class="state-icon" v-if="!isPass">
  84. <view class="flexAlignCenter">
  85. <view class="redCircle">
  86. </view>
  87. <text class="itemText">驳回原因:</text>
  88. </view>
  89. <view class="flexAlignCenter">
  90. <text class="redText">汽车行驶证过期,需重新上传</text>
  91. </view>
  92. </view>
  93. <!-- <view v-if="!isPass" class="border-style2 mb"></view> -->
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. import {
  102. routeInfo
  103. } from "@/api/company/path.js"
  104. export default {
  105. data() {
  106. return {
  107. //通过或者驳回
  108. isPass: true,
  109. form: {
  110. id: null,
  111. endPoint: '',
  112. startName: '',
  113. endName: '',
  114. name: '',
  115. startDept: '',
  116. endPoint: '',
  117. startPoint: '',
  118. mtRoutePointList: [],
  119. auditTime: '',
  120. },
  121. isMap: true,
  122. }
  123. },
  124. methods: {
  125. // 4326转3857
  126. WGS84ToMercator(lonlat) {
  127. const coord = {
  128. lat: 0,
  129. lng: 0
  130. };
  131. const earthRad = 6378137.0; //地球半径
  132. coord.lat = lonlat.lng * Math.PI / 180 * earthRad;
  133. const param = lonlat.lat * Math.PI / 180;
  134. coord.lng = earthRad / 2 * Math.log((1.0 + Math.sin(param)) / (1.0 - Math.sin(param)));
  135. return coord;
  136. },
  137. // 3857转4326
  138. mercatorToWGS84(data) {
  139. let list = data.split(',');
  140. let lonlat = {
  141. lng: list[1],
  142. lat: list[0]
  143. };
  144. const coord = {
  145. lat: 0,
  146. lng: 0
  147. };
  148. const lat = lonlat.lat / 20037508.34 * 180;
  149. let lng = lonlat.lng / 20037508.34 * 180;
  150. lng = 180 / Math.PI * (2 * Math.atan(Math.exp(lng * Math.PI / 180)) - Math.PI / 2);
  151. coord.lat = lat;
  152. coord.lng = lng;
  153. return coord.lat + ',' + coord.lng
  154. },
  155. routeInfo(id) {
  156. this.isMap = false;
  157. routeInfo(id).then(res => {
  158. console.log(res);
  159. this.form = res.data;
  160. this.form.createTime = this.form.createTime.slice(0, -3).replace('-', '年').replace('-', '月')
  161. .replace(' ', '日 ')
  162. this.isMap = true;
  163. // this.form.startPoint =this.mercatorToWGS84(res.data.startPoint);
  164. // this.form.endPoint =this.mercatorToWGS84(res.data.endPoint);
  165. // this.form.mtRoutePointList=res.data.mtRoutePointList.map(item=>{
  166. // return {pointCoordinate:this.mercatorToWGS84(item.pointCoordinate)}
  167. // })
  168. // console.log(this.form,'this.form');
  169. })
  170. },
  171. },
  172. onLoad: function(option) {
  173. if (option.id) {
  174. this.routeInfo(option.id)
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss" scoped>
  180. .reject-box {
  181. .reject-box-top {
  182. width: 100%;
  183. height: 69rpx;
  184. background: #7FB5FF;
  185. border-radius: 26rpx 26rpx 0px 0px;
  186. display: flex;
  187. justify-content: space-between;
  188. uni-image {
  189. width: 50rpx;
  190. margin-left: 32rpx;
  191. vertical-align: middle;
  192. }
  193. }
  194. .reject-box-bottom {
  195. padding: 40rpx;
  196. .state-icon {
  197. display: flex;
  198. margin: 70rpx 0;
  199. }
  200. .state-icon:nth-child(1) {
  201. margin: 0 0 40rpx;
  202. }
  203. .border-style {
  204. border-top: 1rpx dashed #F98803;
  205. width: 90%;
  206. margin: 0 auto;
  207. }
  208. .border-style2 {
  209. border-top: 1rpx dashed #FB5637;
  210. width: 90%;
  211. margin: 0 auto;
  212. }
  213. }
  214. }
  215. .reject-box-bottom:nth-child(2) {
  216. padding: 40rpx 40rx 20rpx !important;
  217. }
  218. .block {
  219. display: block !important;
  220. }
  221. .border {
  222. border: 1rpx solid #495B93;
  223. }
  224. .box-size {
  225. width: 598rpx;
  226. height: 198rpx;
  227. }
  228. .mt30 {
  229. margin-top: 30rpx;
  230. }
  231. .radius15 {
  232. border-radius: 15rpx;
  233. }
  234. .state-box-size {
  235. width: 180rpx;
  236. height: 180rpx;
  237. }
  238. .state-box-size-video {
  239. width: 175rpx !important;
  240. height: 175rpx !important;
  241. }
  242. .space-between {
  243. justify-content: space-between;
  244. }
  245. .just-content-start {
  246. justify-content: flex-start !important;
  247. align-items: center;
  248. }
  249. .bg-color-green {
  250. background: #36C372 !important;
  251. }
  252. .bg-color-red {
  253. background: #FB5637 !important;
  254. }
  255. .fontTongGuo {
  256. font-size: 26rpx !important;
  257. font-weight: bold !important;
  258. color: #007C3C !important;
  259. }
  260. .fontColor {
  261. color: #FC5536 !important;
  262. }
  263. .mb {
  264. margin-bottom: 53rpx !important;
  265. }
  266. .pb0 {
  267. padding-bottom: 0 !important;
  268. }
  269. .mt28 {
  270. margin-top: 40rpx;
  271. }
  272. .mb0 {
  273. margin-bottom: 0rpx !important;
  274. }
  275. .map {
  276. height: 469rpx;
  277. background: #FFFFFF;
  278. border: 2rpx solid #495B93;
  279. border-radius: 15rpx;
  280. margin-top: 20rpx;
  281. }
  282. </style>