logistics.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view>
  3. <!-- <view class="status" bindtap="goUrl" data-url="/pages/my/seperate/seperate?id={{orderId}}&fdid={{id}}" > -->
  4. <view class="status">
  5. <text v-if="orderId">订单编号:{{orderId}}</text>
  6. <text v-if="detail.expressNo">{{detail.express}}:{{detail.expressNo}}</text>
  7. <text v-if="detail.mobile">客服电话:{{detail.mobile}}</text>
  8. <image src="/static/pages/images/rico.png" class="rico1"></image>
  9. </view>
  10. <view class="wuliu">
  11. <view class="tit">物流跟踪</view>
  12. <view class="pslist" v-if="detail.messages">
  13. <block v-for="(item, index) in detail.messages" :key="index">
  14. <view :class="'li ' + (index==0?'ing':'')">
  15. <view class="lis">
  16. <view>{{item.context}}</view>
  17. <text>{{item.ftime}}</text>
  18. </view>
  19. </view>
  20. </block>
  21. </view>
  22. <view class="nodata" v-else>
  23. <image :src="picUrlss+'empty.png'"></image>
  24. <text>暂无</text>
  25. </view>
  26. </view>
  27. <view class="confirm" @click="confirmOrder" v-if="!isReceived&&type!=1">确认收货</view>
  28. </view>
  29. </template>
  30. <script>
  31. const app = getApp();
  32. const req = require("../../utils/request.js");
  33. export default {
  34. data() {
  35. return {
  36. picUrlss: req.public.picUrls,
  37. detail: {},
  38. //物流详情
  39. id: 0,
  40. orderId: '',
  41. fdidx: '',
  42. type: 0,
  43. isReceived: false
  44. };
  45. },
  46. components: {},
  47. props: {},
  48. onLoad: function(options) {
  49. this.setData({
  50. id: options.id,
  51. orderId: options.orderId ? options.orderId : '',
  52. type: options.type ? options.type : 0,
  53. isReceived: options.isReceived ? true : false
  54. });
  55. if (options.fdidx) {
  56. this.fdidx = options.fdidx;
  57. uni.setNavigationBarTitle({
  58. title: "分单" + this.chinanum(options.fdidx) + "物流"
  59. });
  60. }
  61. this.getDetail();
  62. },
  63. methods: {
  64. chinanum(num) {
  65. var china = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
  66. var arr = [];
  67. num = num.toString();
  68. var english = num.split('');
  69. for (var i = 0; i < english.length; i++) {
  70. arr.push(china[english[i] * 1]);
  71. }
  72. return arr.join("");
  73. },
  74. goUrl(e) {
  75. var dataset = e.currentTarget.dataset;
  76. // console.log(dataset.url);
  77. uni.navigateTo({
  78. url: dataset.url
  79. });
  80. },
  81. getDetail() {
  82. var _this = this;
  83. req.getRequest('/api/deliver/detail', {
  84. id: this.id,
  85. type: this.type
  86. }, res => {
  87. _this.setData({
  88. detail: res
  89. });
  90. });
  91. },
  92. confirmOrder() {
  93. //确认收货
  94. // let index = event.currentTarget.dataset.index;
  95. // let page = this.data.pageList[index];
  96. let that = this;
  97. req.msgConfirm('确认执行该操作?', () => {
  98. req.postRequest(
  99. '/api/order/newReceiving',
  100. {
  101. id: that.id
  102. },
  103. () => {
  104. uni.navigateBack();
  105. }
  106. );
  107. });
  108. },
  109. }
  110. };
  111. </script>
  112. <style>
  113. @import "./logistics.css";
  114. </style>