logisticsdetail.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view v-show="!is_loading">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{paddingTop:navH}" style="background-color: #fff;"></view>
  6. <view class="address">
  7. <view class="address_icon">
  8. <image style="width: 50rpx;height: 50rpx;" :src="picture.icon_loc" mode="">
  9. </image>
  10. </view>
  11. <view style="width: 70%;">
  12. <view style="display: flex;">
  13. <p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
  14. <p class='ipon'>{{address.phone_number}}</p>
  15. </view>
  16. <p class='ipon'>{{address.full_detail_addr}}</p>
  17. </view>
  18. </view>
  19. <view class="logistics1">
  20. <view>
  21. <p style="margin-bottom: 10rpx;">物流公司:{{logistics_company}}</p>
  22. <p>物流单号:{{logistics_number}}
  23. <image :src="picture.icon_copy" mode="" class="copy-img" @click="handleCopy(logistics_number)" />
  24. </p>
  25. </view>
  26. </view>
  27. <view class="logistics-detail" v-for="item in logisticsData">
  28. <view class="logistics-item">
  29. <p>{{ item.context }}</p>
  30. <p>{{ item.time }}</p>
  31. </view>
  32. </view>
  33. <view style="height: 100rpx;"></view>
  34. </view>
  35. </template>
  36. <script>
  37. import region from '@/components/pca-code.json';
  38. import mvBar from "@/components/mys_navBar/mysNavBar";
  39. export default {
  40. components: {
  41. mvBar,
  42. },
  43. data() {
  44. return {
  45. navH: getApp().globalData.navHeight,
  46. picture: getApp().globalData.picture,
  47. mysNavConfig: {
  48. /* 开启单页显示首页图标 */
  49. isHome: true,
  50. /* 固定导航 */
  51. navFixed: true,
  52. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  53. navTitle: {
  54. text: "物流信息",
  55. color: "",
  56. fontSize: "32rpx", // px upx rpx
  57. fontWeight: "normal", // 100 - 700
  58. },
  59. btnType: "type2",
  60. onLeftClick: '',
  61. /* type2 按钮 */
  62. type2Config: {
  63. // 左图标
  64. leftPath: "/static/img/png2.png",
  65. // 右图标
  66. rightPath: "/static/img/png4.png",
  67. // 圆角
  68. radius: "40rpx",
  69. },
  70. },
  71. task_id: "",
  72. logistics_number: "",
  73. logistics_company: "",
  74. logisticsData: [{
  75. context: "",
  76. time: ""
  77. }],
  78. address: {},
  79. is_loading: true,
  80. }
  81. },
  82. async onLoad(options) {
  83. let data = options.textObj.replace(/""/g, "");
  84. data = JSON.parse(decodeURIComponent(data))
  85. this.task_id = data.taskId
  86. uni.showLoading({
  87. title: '加载中'
  88. });
  89. this.is_loading = true
  90. await this.getLogisticsDetail(this.task_id)
  91. this.is_loading = false
  92. uni.hideLoading();
  93. },
  94. methods: {
  95. getLogisticsDetail(secTaskId) {
  96. // 获取物流信息
  97. return this.$https.get('/youngee/c/api/t/secTask/logistics/detail?task_id=' + secTaskId).then(res => {
  98. console.log(res)
  99. let resData = res.data.data
  100. this.logistics_number = resData.logistics_number
  101. this.logistics_company = resData.logistics_company
  102. this.logisticsData = resData.logistics_context.data
  103. // 地址解析
  104. this.address = JSON.parse(resData.address_snap);
  105. let a = this.address.region_code.toString().slice(0, 2)
  106. let b = this.address.region_code.toString().slice(0, 4)
  107. let c = 0
  108. for (var i = 0; i < region.length; i++) {
  109. if (region[i].code == a) {
  110. a = region[i].name
  111. for (var j = 0; j < region[i].children.length; j++) {
  112. if (region[i].children[j].code == b) {
  113. b = region[i].children[j].name
  114. for (var o = 0; o < region[i].children[j].children.length; o++) {
  115. if (region[i].children[j].children[o].code == this.address
  116. .region_code) {
  117. c = region[i].children[j].children[o].name
  118. }
  119. }
  120. }
  121. }
  122. }
  123. }
  124. this.address.full_detail_addr = a + b + c + this.address.detail_addr
  125. })
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. p {
  132. font-size: 30rpx;
  133. }
  134. .address {
  135. display: flex;
  136. margin: 20rpx 0;
  137. // padding: 20rpx 20rpx;
  138. background-color: #FFFFFF;
  139. justify-content: flex-start;
  140. align-items: center;
  141. .address_icon {
  142. width: 15%;
  143. vertical-align: middle;
  144. display: flex;
  145. justify-content: center;
  146. }
  147. .address_edit {
  148. width: 15%;
  149. }
  150. .address_edit image {
  151. vertical-align: middle;
  152. width: 50rpx;
  153. height: 50rpx;
  154. display: inline-block;
  155. padding-right: 14rpx;
  156. }
  157. .ipon {
  158. color: #333333;
  159. font-size: 30rpx;
  160. font-weight: 500;
  161. margin-bottom: 10rpx;
  162. }
  163. }
  164. .logistics1 {
  165. margin: 50rpx;
  166. display: flex;
  167. flex-flow: column;
  168. align-items: flex-start;
  169. justify-content: center;
  170. }
  171. .logistics-detail {
  172. padding: 20rpx 30rpx;
  173. }
  174. .logistics-item {
  175. background-color: #f1f1f1;
  176. padding: 10rpx 30rpx;
  177. }
  178. </style>