绿满眶商城微信小程序-uniapp
xiangpei
2025-05-09 c3e6cdbb29580e77444541c7953aca33581a4267
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<template>
  <view class="container " style="font-size: 13px;">
     <block v-for="(row, index) in messageList" :key="index">
        <view class="msgItem">
          <div class="msgMsg">
            <div class="bagbar">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div>
          </div>
          <u-card @click="goDetail(row.sn,row.logi_id,row.ship_no)" :title="title" title-color="#666666" title-size="24" sub-title-color="#666666" sub-title-size="24" :border="false" :sub-title=row.status>
            <view class="msg-body" slot="body">
              <image class="msgImg" :src="row.goods_img" mode=""></image>
              <view class="msgView">
                <view>{{row.goodsName}}</view>
                <view class="msgNum">订单号:{{row.sn}}</view>
              </view>
            </view>
          </u-card>
        </view>
    </block>    
    <uni-load-more :status="loadStatus"></uni-load-more>
  </view>
</template>
 
<script>
import * as API_Message from "@/api/message.js";
export default {
  data() {
    return {
      messageList: [],
      title: "物流更新通知",
      subTitle: "运输中",
      loadStatus:'more',
      params: {
        pageNumber: 1,
        pageSize: 10,
      },
      loadStatus:'more'
    };
  },
  onLoad(){
      this.GET_LogisticsList(true);
  },
  onReachBottom() {
      this.params.pageNumber++
      this.GET_LogisticsList(false)
  },
  methods: {
    goDetail(sn,logi_id,ship_no){
        uni.navigateTo({
            url:'/pages/msgTips/packagemsg/logisticsDetail?order_sn=' + sn +'&logi_id='+logi_id+'&ship_no='+ship_no,
        })
    },
    //获取物流消息
    GET_LogisticsList(reset){
        if (reset) {
            this.params.pageNumber = 1
         }
        uni.showLoading({
            title:"加载中"
        })
        API_Message.getLogisticsMessages(this.params).then(async response => {
             if (this.$store.state.isShowToast){ uni.hideLoading() }
            const { data } = response
            if (!data || !data.length) {
                this.messageList.push(...data.data)
            }
         })
        
    }
        
  }
};
</script>
 
<style scoped lang='scss'>
.ddnumber {
  color: $u-tips-color;
  font-size: 24rpx;
}
.msg-body{
    display: flex;
    background-color: rgba(102, 110, 232, 0.0470588235294118);
    
    
    .msgImg{
        width: 160rpx;
        height: 160rpx;
    }
    .msgView{
        margin-left: 20rpx;
        .msgNum:last-child{
            margin-top: 60rpx;
        }
    }
    
}
.bagbar {
  display: inline;
  border-radius: 500px;
  color: #fff;
  font-size: 24rpx;
  padding: 10rpx 20rpx;
  background: $u-type-info-disabled;
}
.storeImg {
  width: 100%;
  height: 100rpx;
  margin-right: 20rpx;
}
.container {
  background: #F9F9F9;
  min-height: 100vh;
}
.msgMsg {
  text-align: center;
  color: $u-tips-color;
}
.msgItem {
  padding: 1em 0;
}
view{
    font-size: 13px;
    color: #666666;
}
u-card{
    font-size: 13px;
    color: #666666;
}
</style>