city-map.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <app-layout>
  3. <view v-if="is_show" class='city-map-box dir-top-nowrap'>
  4. <view class="top-box dir-left-nowrap">
  5. <image class="goods-image box-grow-0" :src="expressData.goods_pic"></image>
  6. <view class="goods-info dir-top-nowrap box-grow-1">
  7. <!-- #ifdef MP-ALIPAY -->
  8. <view class="t-omit goods-name" style="height: 24rpx;">{{expressData.goods_name}}</view>
  9. <!-- #endif -->
  10. <!-- #ifndef MP-ALIPAY -->
  11. <view class="t-omit goods-name">{{expressData.goods_name}}</view>
  12. <!-- #endif -->
  13. <view class="goods-num">共购买{{expressData.goods_num}}件商品</view>
  14. </view>
  15. </view>
  16. <view>
  17. <map style="width: 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :markers="covers">
  18. </map>
  19. </view>
  20. <view class="city-box dir-top-nowrap">
  21. <view class="status-label">{{expressData.status_text}}</view>
  22. <view class="time-label" v-if="expressData.estimate_time && expressData.status != 302">{{expressData.estimate_time}}</view>
  23. <view class="corporation-box dir-left-nowrap">
  24. <image class="corporation-icon" :src="expressData.corporation_icon"></image>
  25. <view class="corporation-name">{{expressData.corporation_name}}</view>
  26. </view>
  27. <view class="dir-left-nowrap cross-center city-service">
  28. <image class="head" src="/static/image/icon/deliveryman.png"></image>
  29. <view class="info-box dir-top-nowrap box-grow-1">
  30. <template v-if="expressData.city_name && expressData.city_mobile">
  31. <view class="info-label">配送员</view>
  32. <view class="info-man">{{expressData.city_name}} {{expressData.city_mobile}}</view>
  33. </template>
  34. <template v-else>
  35. <view class="await-man">等待分配骑手</view>
  36. </template>
  37. </view>
  38. <view class="icon-box">
  39. <app-jump-button open_type="tel" :number="expressData.city_mobile">
  40. <image class="icon" src="/static/image/icon/store-tel.png"></image>
  41. </app-jump-button>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </app-layout>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. is_show: false,
  53. latitude: 39.909,
  54. longitude: 116.39742,
  55. // 顺序是 配送员位置 用户位置 商家位置
  56. covers: [{
  57. latitude: 0,
  58. longitude: 0,
  59. iconPath: '',
  60. width: 50,
  61. height: 50
  62. }, {
  63. latitude: 0,
  64. longitude: 0,
  65. iconPath: '/static/image/icon/city-service/my.png',
  66. width: 50,
  67. height: 50
  68. },
  69. {
  70. latitude: 0,
  71. longitude: 0,
  72. iconPath: '/static/image/icon/city-service/shop.png',
  73. width: 50,
  74. height: 50
  75. }],
  76. express_id: 0,
  77. expressData: {}
  78. }
  79. },
  80. methods: {
  81. getExpressInfo() {
  82. this.$showLoading();
  83. this.$request({
  84. url: this.$api.order.city_map,
  85. data: {
  86. express_id: this.express_id,
  87. },
  88. method: 'POST',
  89. }).then(response => {
  90. this.$hideLoading();
  91. this.is_show = true;
  92. if (response.code === 0) {
  93. this.expressData = response.data.express_data;
  94. let {
  95. user_longitude, user_latitude,
  96. man_longitude, man_latitude,
  97. corporation_icon, shop_longitude,
  98. shop_latitude
  99. } = this.expressData;
  100. this.longitude = user_longitude;
  101. this.latitude = user_latitude;
  102. this.covers[0].longitude = man_longitude;
  103. this.covers[0].latitude = man_latitude;
  104. this.covers[0].iconPath = corporation_icon;
  105. this.covers[1].longitude = user_longitude;
  106. this.covers[1].latitude = user_latitude;
  107. this.covers[2].longitude = shop_longitude;
  108. this.covers[2].latitude = shop_latitude;
  109. } else {
  110. uni.showModal({
  111. title: '',
  112. content: response.msg,
  113. showCancel: false,
  114. });
  115. }
  116. }).catch(() => {
  117. this.$hideLoading();
  118. });
  119. },
  120. },
  121. onLoad(options) { this.$commonLoad.onload(options);
  122. this.express_id = options.express_id;
  123. this.getExpressInfo();
  124. }
  125. }
  126. </script>
  127. <style lang="scss" scoped>
  128. .top-box {
  129. background-color: #ffffff;
  130. border-radius: #{16rpx};
  131. margin: #{20rpx} #{24rpx};
  132. padding: #{24rpx};
  133. .goods-image {
  134. width: #{68rpx};
  135. height: #{68rpx};
  136. margin-right: #{16rpx};
  137. }
  138. .goods-name {
  139. font-size: #{24rpx};
  140. color: #353535;
  141. margin-bottom: #{15rpx};
  142. }
  143. .goods-num {
  144. color: #999999;
  145. font-size: #{20rpx};
  146. }
  147. }
  148. .city-box {
  149. margin: #{24rpx};
  150. background-color: #ffffff;
  151. padding: #{30rpx};
  152. border-radius: #{16rpx};
  153. .status-label {
  154. font-weight: 800;
  155. font-size: #{32rpx};
  156. color: #353535;
  157. }
  158. .time-label {
  159. font-size: #{28rpx};
  160. color: #353535;
  161. margin-top: #{21rpx};
  162. }
  163. .corporation-box {
  164. margin-top: #{40rpx};
  165. margin-bottom: #{20rpx};
  166. .corporation-icon {
  167. width: #{40rpx};
  168. height: #{40rpx};
  169. margin-right: #{14rpx};
  170. }
  171. .corporation-name {
  172. font-size: #{28rpx};
  173. color: #666666;
  174. }
  175. }
  176. }
  177. .city-service {
  178. width: 100%;
  179. margin-bottom: 10#{rpx};
  180. .await-man {
  181. margin-left: #{12rpx};
  182. font-size: #{28rpx};
  183. color:#666666;
  184. }
  185. .info-box {
  186. margin-left: #{12rpx};
  187. .info-label {
  188. margin-bottom: #{10rpx};
  189. color: #999999;
  190. font-size: #{28rpx};
  191. }
  192. .info-man {
  193. font-size: #{28rpx};
  194. color: #666666;
  195. }
  196. }
  197. .head {
  198. width: #{75rpx};
  199. height: #{75rpx};
  200. }
  201. .icon-box {
  202. padding: 0 #{30rpx};
  203. border-left: #{1rpx} solid #f7f7f7;
  204. .icon {
  205. width: #{45rpx};
  206. height: #{45rpx};
  207. }
  208. }
  209. }
  210. </style>