expressInfo.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="container">
  3. <view class="express-box">
  4. <view class="top-text">
  5. <image class='logo' :src="expressList.result.logo" mode="widthFix"></image>
  6. <text class="top-com" v-if="expressList.result.deliverystatus=='0'">揽件中</text>
  7. <text class="top-com" v-if="expressList.result.deliverystatus=='1'">运输中</text>
  8. <text class="top-com" v-if="expressList.result.deliverystatus=='2'">派件中</text>
  9. <text class="top-com" v-if="expressList.result.deliverystatus=='3'">已签收</text>
  10. </view>
  11. <view class="top-text">
  12. <text>国内承运物流:</text>
  13. <text class="top-com">{{expressList.result.expName}}</text>
  14. </view>
  15. <view class="top-text">
  16. <text>运单号:</text>
  17. <text>{{expressList.result.number }}</text>
  18. <view class="fz" @click="copy(expressList.result.number)">
  19. 复制
  20. </view>
  21. </view>
  22. <view class="top-text">
  23. <text>联系电话:</text>
  24. <text>{{expressList.result.expPhone }}</text>
  25. <view class="bh" @click="bh(expressList.result.expPhone)">
  26. 拨打
  27. </view>
  28. </view>
  29. <view class="express-body">
  30. <uni-steps :options="expressList.result.list" active-color="#007AFF" :active="active"
  31. direction="column">
  32. </uni-steps>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. // #ifdef H5
  39. import {
  40. weixindata,
  41. shareLoad
  42. } from '@/utils/wxAuthorized';
  43. // #endif
  44. import {
  45. express
  46. } from '@/api/order.js';
  47. import uniSteps from '@/components/uni-steps/uni-steps.vue';
  48. export default {
  49. components: {
  50. uniSteps
  51. },
  52. data() {
  53. return {
  54. id: '',
  55. expressList: [],
  56. active: 0
  57. }
  58. },
  59. onLoad(option) {
  60. this.id = option.id
  61. // #ifdef H5
  62. this.IndexShare()
  63. // #endif
  64. },
  65. onShow() {
  66. this.loadData()
  67. },
  68. onShareAppMessage(res) {
  69. return {
  70. title: '物流详情', //分享的名称
  71. path: 'pages/order/expressInfo?id=' + this.id,
  72. }
  73. console.log('pages/index/index?' + path, '分享数据');
  74. },
  75. methods: {
  76. IndexShare() {
  77. let obj = this;
  78. let path = 'https://hy.liuniu946.com/pages/order/expressInfo?id=' + this.id
  79. let data = {
  80. link: path,
  81. title: '物流详情',
  82. desc: '欢迎加入玲卿加',
  83. imgUrl: 'https://hy.liuniu946.com/static/image/hylogo.jpg'
  84. };
  85. console.log(data, '分享数据');
  86. shareLoad(data);
  87. },
  88. loadData() {
  89. express({
  90. id: this.id,
  91. }).then(({
  92. data
  93. }) => {
  94. this.expressList = data.express;
  95. console.log(this.expressList, '000000')
  96. })
  97. },
  98. copy(e) {
  99. uni.setClipboardData({
  100. data: e,
  101. success: () => { //复制成功的回调函数
  102. uni.showToast({ //提示
  103. title: "复制快递单号成功"
  104. })
  105. }
  106. })
  107. },
  108. bh(e) {
  109. uni.makePhoneCall({
  110. phoneNumber: e, //电话号码
  111. success: function(e) {
  112. console.log(e);
  113. },
  114. fail: function(e) {
  115. console.log(e);
  116. }
  117. })
  118. }
  119. },
  120. }
  121. </script>
  122. <style lang="scss">
  123. .container {
  124. .logo {
  125. border-radius: 10rpx;
  126. margin: 10rpx;
  127. width: 60rpx;
  128. }
  129. .fz {
  130. text-align: center;
  131. width: 110rpx;
  132. border-radius: 30rpx;
  133. padding: 8rpx;
  134. color: #FFFFFF;
  135. background-color: #f75022;
  136. }
  137. .bh {
  138. text-align: center;
  139. width: 110rpx;
  140. border-radius: 30rpx;
  141. padding: 8rpx;
  142. color: #FFFFFF;
  143. background-color: #1090ff;
  144. }
  145. .express-box {
  146. letter-spacing: 8rpx;
  147. padding: 30rpx;
  148. border-bottom-left-radius: 40rpx;
  149. border-bottom-right-radius: 40rpx;
  150. height: 320rpx;
  151. background-color: #FFFFFF;
  152. .top-text {
  153. width: 100%;
  154. height: 60rpx;
  155. background: #FFFFFF;
  156. padding-left: 20rpx;
  157. font-size: $font-base;
  158. border-radius: $border-radius-sm;
  159. display: flex;
  160. align-items: center;
  161. .top-com {
  162. margin-right: 10rpx;
  163. }
  164. }
  165. .express-body {
  166. margin-top: 80rpx;
  167. background: #FFFFFF;
  168. border-radius: $border-radius-sm;
  169. padding: 20rpx 10rpx 20rpx 0;
  170. }
  171. }
  172. }
  173. </style>