|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="history">
|
|
|
- <view class="item" v-for="(item, i) in instockHistory">
|
|
|
+ <view class="item" v-for="(item, i) in waybillDelivery">
|
|
|
<text class="code" :style="{ color: item.status ? 'green' : '#666' }">
|
|
|
{{ item.orderNum }}
|
|
|
{{ item.type }}
|
|
@@ -11,7 +11,7 @@
|
|
|
{{ '\r\n' + item.createTime }}
|
|
|
</text>
|
|
|
</view>
|
|
|
- <view v-if="instockHistory.length === 0" class="is-empty">暂无派送单</view>
|
|
|
+ <view v-if="waybillDelivery.length === 0" class="is-empty">暂无派送单</view>
|
|
|
|
|
|
<uni-popup ref="messageRef" type="message">
|
|
|
<uni-popup-message :type="messageType" :message="messageText" :duration="2000"></uni-popup-message>
|
|
@@ -22,29 +22,29 @@
|
|
|
<script setup lang="ts">
|
|
|
import { reactive, ref } from 'vue';
|
|
|
import { onLoad } from '@dcloudio/uni-app';
|
|
|
- import { getWaybillsURL } from '@/utils/api.js';
|
|
|
+ import { pickupWaybillDeliveryOrderURL } from '@/utils/api.js';
|
|
|
const loading = ref(false);
|
|
|
const token = ref();
|
|
|
+ const waybillDelivery = ref([]);
|
|
|
const messageType = ref();
|
|
|
const messageText = ref();
|
|
|
const messageRef = ref();
|
|
|
const getHistory = () => {
|
|
|
loading.value = true;
|
|
|
uni.request({
|
|
|
- url: getWaybillsURL,
|
|
|
- method: 'POST',
|
|
|
+ url: pickupWaybillDeliveryOrderURL + '/index',
|
|
|
+ method: 'GET',
|
|
|
header: {
|
|
|
batoken: token.value
|
|
|
},
|
|
|
- data: {},
|
|
|
- success: (res : any) => {
|
|
|
+ success: ({data} : any) => {
|
|
|
loading.value = false;
|
|
|
- if (res.data.code == 1) {
|
|
|
-
|
|
|
-
|
|
|
+ console.log(data);
|
|
|
+ if (data.code == 1) {
|
|
|
+ waybillDelivery.value = data.data.list;
|
|
|
} else {
|
|
|
messageType.value = 'error';
|
|
|
- messageText.value = res.data.msg;
|
|
|
+ messageText.value = data.msg;
|
|
|
messageRef.value.open();
|
|
|
}
|
|
|
},
|
|
@@ -54,6 +54,7 @@
|
|
|
});
|
|
|
};
|
|
|
onLoad(() => {
|
|
|
+ token.value = uni.getStorageSync('token');
|
|
|
getHistory();
|
|
|
});
|
|
|
</script>
|