storeOrderDelivery.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <view>
  3. <view class="top-cont">
  4. <!-- 背景图片 -->
  5. <image class="bg" src="../../static/images/order_top_bg2.png" mode=""></image>
  6. <view class="top-inner">
  7. <!-- 这里是状态栏 -->
  8. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  9. <view class="back-box" @click="back">
  10. <image src="../../static/images/back_white.png" mode=""></image>
  11. <text class="title">物流信息</text>
  12. <text></text>
  13. </view>
  14. <!-- 运单号 -->
  15. <view class="waybill-number">
  16. <view class="itemlistall">
  17. <view v-for="(item,index) in ExpressMulti" :key="index" @click="xuanze(index)"
  18. :class="actexpress==index?'itemlist itemact':'itemlist' " >
  19. 物流{{index+1}}</view>
  20. </view>
  21. <view class="inner">
  22. <view class="num-box">
  23. <text class="text">运单号</text>
  24. <text class="text">{{expressList.LogisticCode}}</text>
  25. <view class="copy" @click="copyOrderSn(expressList.LogisticCode)">复制</view>
  26. </view>
  27. <view class="kf-box">
  28. <text class="text">{{expressList.ShipperName}}</text>
  29. <!-- <text class="text">客服电话:95311</text> -->
  30. </view>
  31. </view>
  32. </view>
  33. <view class="content" v-if="expressList!=null">
  34. <!-- 物流信息 -->
  35. <view class="refund-steps" v-if="expressList.Traces!=null">
  36. <view v-for="(item,index) in expressList.Traces" :key="index" class="steps">
  37. <view class="title">
  38. <!-- <text v-if="index == 0" class="text black-text">已签收</text> -->
  39. <!-- <text class="text gray-bold">运输中</text> -->
  40. <!-- 左侧灰色圆点 -->
  41. <view class="dot"></view>
  42. <!-- 对号 -->
  43. <image class="img" src="../../static/images/complete.png" mode=""></image>
  44. <!-- 运输中图标 -->
  45. <image class="img" src="../../static/images/car40.png" mode=""></image>
  46. </view>
  47. <view class="desc-text">
  48. {{item.AcceptStation}}
  49. </view>
  50. <view class="time">{{item.AcceptTime}}</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {getMyStoreOrderById,cancelOrder,getExpress,getExpresslist} from '@/api/storeOrder'
  60. export default {
  61. data() {
  62. return {
  63. statusBarHeight:uni.getStorageSync("menuInfo").statusBarHeight,
  64. orderId:null,
  65. deliveryId:null,
  66. express:{},
  67. expressList:[],
  68. ExpressMulti:[],
  69. actexpress:0
  70. };
  71. },
  72. onLoad(option) {
  73. this.orderId=option.orderId;
  74. // this.getExpress();
  75. this.getExpresslists()
  76. },
  77. methods: {
  78. xuanze(index){
  79. this.actexpress=index
  80. this.getExpresslists()
  81. },
  82. getExpresslists(){
  83. var data={orderId:this.orderId};
  84. getExpresslist(data).then(res => {
  85. if(res.code==200){
  86. this.ExpressMulti=res.data
  87. this.expressList=res.data[this.actexpress]
  88. console.log(this.expressList)
  89. console.log(this.ExpressMulti)
  90. }
  91. })
  92. },
  93. getExpress(){
  94. var data={orderId:this.orderId};
  95. getExpress(data).then(res => {
  96. if(res.code==200){
  97. this.express=res.express;
  98. this.expressList=res.data;
  99. this.deliveryId=res.deliveryId
  100. }else{
  101. uni.showToast({
  102. icon:'none',
  103. title: "请求失败",
  104. });
  105. }
  106. });
  107. },
  108. // 返回上一页
  109. back() {
  110. uni.navigateBack()
  111. },
  112. // 复制运单号
  113. copyOrderSn(text) {
  114. // 复制方法
  115. uni.setClipboardData({
  116. data:text,
  117. success:()=>{
  118. uni.showToast({
  119. title:'内容已成功复制到剪切板',
  120. icon:'none'
  121. })
  122. }
  123. });
  124. },
  125. // 拨打电话
  126. callPhone(phone) {
  127. uni.makePhoneCall({
  128. phoneNumber: phone
  129. })
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss">
  135. .itemlistall{
  136. display: flex;
  137. }
  138. .itemlist{
  139. background-color: #fff;
  140. margin: 10rpx;
  141. padding: 10rpx 30rpx;
  142. border-radius: 10rpx;
  143. }
  144. .itemact{
  145. color: #2BC7B9;
  146. }
  147. .top-cont{
  148. width: 100%;
  149. height: 336upx;
  150. position: relative;
  151. .bg{
  152. width: 100%;
  153. height: 100%;
  154. position: absolute;
  155. top: 0;
  156. left: 0;
  157. z-index: 1;
  158. }
  159. .top-inner{
  160. width: 100%;
  161. height: 100%;
  162. position: absolute;
  163. top: 0;
  164. left: 0;
  165. z-index: 2;
  166. .back-box{
  167. height: 88upx;
  168. padding-left: 22upx;
  169. display: flex;
  170. align-items: center;
  171. justify-content: space-between;
  172. padding: 0 20upx;
  173. image{
  174. width: 40upx;
  175. height: 40upx;
  176. }
  177. .title{
  178. font-size: 36upx;
  179. font-family: PingFang SC;
  180. font-weight: 500;
  181. color: #FFFFFF;
  182. }
  183. }
  184. .waybill-number{
  185. padding: 0 20upx;
  186. margin-top: 66upx;
  187. .inner{
  188. box-sizing: border-box;
  189. height: 150upx;
  190. background: #FFFFFF;
  191. border-radius: 16upx;
  192. padding: 40upx 30upx;
  193. display: flex;
  194. flex-direction: column;
  195. justify-content: space-between;
  196. .num-box{
  197. display: flex;
  198. align-items: center;
  199. .text{
  200. font-size: 28upx;
  201. font-family: PingFang SC;
  202. font-weight: 500;
  203. color: #111111;
  204. line-height: 1;
  205. margin-right: 30upx;
  206. &:last-child{
  207. margin-right: 20upx;
  208. }
  209. }
  210. .copy{
  211. width: 58upx;
  212. height: 32upx;
  213. line-height: 32upx;
  214. text-align: center;
  215. font-size: 22upx;
  216. font-family: PingFang SC;
  217. font-weight: 500;
  218. color: #222222;
  219. background: #F5F5F5;
  220. border-radius: 4upx;
  221. }
  222. }
  223. .kf-box{
  224. display: flex;
  225. align-items: center;
  226. .text{
  227. font-size: 26upx;
  228. font-family: PingFang SC;
  229. font-weight: 500;
  230. color: #999999;
  231. line-height: 1;
  232. margin-right: 20upx;
  233. }
  234. }
  235. }
  236. }
  237. }
  238. }
  239. .content{
  240. margin: 20rpx 0rpx;
  241. padding: 0 20upx;
  242. .refund-steps{
  243. background: #FFFFFF;
  244. border-radius: 16upx;
  245. padding: 40upx 44upx;
  246. .steps{
  247. padding-left: 40upx;
  248. padding-bottom: 56upx;
  249. position: relative;
  250. &::after{
  251. content: "";
  252. width: 4upx;
  253. height: 100%;
  254. background: #F1F1F1;
  255. position: absolute;
  256. left: 0;
  257. top: 20upx;
  258. }
  259. &:last-child{
  260. padding-bottom: 0;
  261. &::after{
  262. display: none;
  263. }
  264. }
  265. .title{
  266. position: relative;
  267. .text{
  268. font-size: 30upx;
  269. font-family: PingFang SC;
  270. font-weight: 500;
  271. color: #666666;
  272. line-height: 38upx;
  273. &.black-text{
  274. color: #111111;
  275. font-weight: bold;
  276. }
  277. &.gray-bold{
  278. font-weight: bold;
  279. color: #666666;
  280. }
  281. }
  282. .dot{
  283. width: 16upx;
  284. height: 16upx;
  285. background: #EBEBEB;
  286. border-radius: 50%;
  287. position: absolute;
  288. left: -46upx;
  289. top: 11upx;
  290. z-index: 10;
  291. &.active{
  292. background-color: #2BC7B9;
  293. }
  294. }
  295. .img{
  296. width: 40upx;
  297. height: 40upx;
  298. position: absolute;
  299. left: -57upx;
  300. top: 2upx;
  301. z-index: 10;
  302. }
  303. }
  304. .desc-text{
  305. font-size: 28upx;
  306. font-family: PingFang SC;
  307. font-weight: 500;
  308. color: #666666;
  309. line-height: 1.6;
  310. margin-top: 10upx;
  311. .phone{
  312. font-size: 28upx;
  313. font-family: PingFang SC;
  314. font-weight: 500;
  315. color: #2BC7B9;
  316. line-height: 1.6;
  317. }
  318. }
  319. .time{
  320. font-size: 24upx;
  321. font-family: Gilroy;
  322. font-weight: 500;
  323. color: #999999;
  324. margin-top: 10upx;
  325. }
  326. }
  327. }
  328. }
  329. </style>