Browse Source

fix: 暂存

GGDemo 3 months ago
parent
commit
18c6649684
2 changed files with 14 additions and 12 deletions
  1. 12 11
      pages/waybillDeliveryOrder/index.vue
  2. 2 1
      utils/api.js

+ 12 - 11
pages/waybillDeliveryOrder/index.vue

@@ -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>

+ 2 - 1
utils/api.js

@@ -11,4 +11,5 @@ export const getBindParamsURL = baseURL+"/admin/order.scanOrder/getBindParams"//
 export const bindShippingURL = baseURL+"/admin/order.scanOrder/bindShipping" /*扫描托盘*/
 export const getWaybillsURL = baseURL+"/admin/order.scanOrder/getWaybills" /*扫描托盘*/
 export const loginURL = baseURL+"/admin/index/login"//登录
-export const getcaptchaURL = baseURL+"/api/common/captcha"//获取验证码
+export const getcaptchaURL = baseURL+"/api/common/captcha"//获取验证码
+export const pickupWaybillDeliveryOrderURL = baseURL + '/admin/pickup.waybillDeliveryOrder'