detail.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view>
  3. <view class="total">此订单共计{{total}}个包裹</view>
  4. <view class="list">
  5. <view class='item' v-for="(item,index) in subOrder" :key="index">
  6. <view v-if="item.shop_name">店 铺:{{item.shop_name}}</view>
  7. <view v-if="item.out_order_id">订单号:{{item.out_order_id}}</view>
  8. <view>{{item.name}} {{item.mobile}}</view>
  9. <view>{{item.address}}</view>
  10. <view v-if="item.exp_number">{{item.exp_name}} {{item.exp_number}}<text class='copy' @tap='copy(item.exp_number)'>复制</text></view>
  11. <view v-if="item.send_time">发货时间:{{item._send_time}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import {
  18. mapGetters
  19. } from "vuex";
  20. import {
  21. toLogin
  22. } from '@/libs/login.js';
  23. import {
  24. orderSubItem
  25. } from '@/api/api.js';
  26. import H5Api from '@/utils/ican-H5Api.js'
  27. export default {
  28. data() {
  29. return {
  30. id: '',
  31. total: '',
  32. subOrder: []
  33. };
  34. },
  35. computed: mapGetters(['isLogin']),
  36. onLoad(options) {
  37. if (this.isLogin) {
  38. this.id = options.id || '';
  39. this.getSubOrder();
  40. } else {
  41. toLogin();
  42. }
  43. },
  44. methods: {
  45. getSubOrder: function() {
  46. orderSubItem({'id':this.id}).then(res => {
  47. this.total = res.data.pageCount;
  48. this.subOrder = res.data.list;
  49. });
  50. },
  51. copy: function(text) {
  52. uni.setClipboardData({
  53. data: text,
  54. success:function(){
  55. uni.showToast({
  56. title: '复制成功'
  57. })
  58. }
  59. });
  60. }
  61. }
  62. }
  63. </script>
  64. <style scoped lang="scss">
  65. .total{
  66. background: #fff;
  67. text-align: center;
  68. padding: 20rpx 0;
  69. margin-bottom: 20rpx;
  70. }
  71. .list{
  72. background: #fff;
  73. .item{
  74. padding: 20rpx;
  75. border-bottom: 1px solid #eee;
  76. view{
  77. margin-bottom: 8rpx;
  78. }
  79. .copy {
  80. font-size: 20rpx;
  81. border-radius: 3rpx;
  82. border: 1rpx solid #eee;
  83. padding: 3rpx 15rpx;
  84. margin-left: 30rpx;
  85. }
  86. }
  87. }
  88. </style>