deliverExtend.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view>
  3. <!--mine/deliverExtend/deliverExtend.wxml-->
  4. <view class="top">该订单已被拆分为{{list.length}}个包裹发货</view>
  5. <view v-for="(item, index) in list" :key="index" class="bgfff content">
  6. <view class="dflex wuliu">
  7. <view class="dflex imag"><image src="/mine/static/mine/images/list.png" class="dingdan"></image>分单{{index+1}} </view>
  8. <view>{{item.express?item.express:''}} {{item.expressNo?item.expressNo:''}}</view>
  9. </view>
  10. <view class="kuaidi">
  11. <view class="psfs dflex" @tap="goUrl" :data-url="'/mine/logistics/logistics?id=' + item.id + '&orderId=' + id">
  12. <image src="/static/pages/images/psico.png" class="psico"></image>
  13. <view class="flex">
  14. <view>{{item.logistics.context}}</view>
  15. <text>{{item.logistics.time?item.logistics.time:time}}</text>
  16. </view>
  17. <image src="/static/pages/images/more.png" class="rico1"></image>
  18. </view>
  19. </view>
  20. <view v-for="(items, index2) in item.extendDTOList" :key="index2" class="product">
  21. <view>{{items.productName}}</view>
  22. <!-- <view class="guige">规格:额阿伟啊</view> -->
  23. <view class="money dflex">
  24. <view class="pic">¥<text>{{items.money}}</text></view>
  25. <view>x{{items.quantity}}</view>
  26. </view>
  27. </view>
  28. <view class="all">查看全部</view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. // mine/deliverExtend/deliverExtend.js
  34. const app = getApp(); // const QRCode = require('../../utils/weapp.qrcode.js')
  35. // const QRCode = require('../../utils/weapp.qrcode.js')
  36. const req = require("../../utils/request.js");
  37. export default {
  38. data() {
  39. return {
  40. id: "",
  41. time: "",
  42. list: ""
  43. };
  44. },
  45. components: {},
  46. props: {},
  47. /**
  48. * 生命周期函数--监听页面加载
  49. */
  50. onLoad: function (options) {
  51. this.query = options;
  52. this.setData({
  53. id: options.orderId
  54. });
  55. },
  56. /**
  57. * 生命周期函数--监听页面显示
  58. */
  59. onShow: function () {
  60. this.deliverExtend();
  61. },
  62. /**
  63. * 生命周期函数--监听页面隐藏
  64. */
  65. onHide: function () {},
  66. /**
  67. * 生命周期函数--监听页面卸载
  68. */
  69. onUnload: function () {},
  70. /**
  71. * 页面相关事件处理函数--监听用户下拉动作
  72. */
  73. onPullDownRefresh: function () {},
  74. /**
  75. * 页面上拉触底事件的处理函数
  76. */
  77. onReachBottom: function () {},
  78. methods: {
  79. // 获取分单发货的
  80. deliverExtend() {
  81. let time = new Date().toLocaleString();
  82. this.setData({
  83. time: time
  84. });
  85. req.postRequest('/api/order/deliverExtend', {
  86. id: this.query.orderId
  87. }, res => {
  88. // console.log(res);
  89. if (!res) {} else {
  90. res = res.map(it => {
  91. it.logistics = JSON.parse(it.logistics);
  92. return it;
  93. });
  94. // console.log(res);
  95. this.setData({
  96. list: res
  97. });
  98. }
  99. });
  100. },
  101. goUrl(e) {
  102. var dataset = e.currentTarget.dataset;
  103. uni.navigateTo({
  104. url: dataset.url
  105. });
  106. }
  107. }
  108. };
  109. </script>
  110. <style>
  111. @import "./deliverExtend.css";
  112. </style>