|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="history">
|
|
|
+ <view class="list">
|
|
|
<view class="item" v-for="(item, i) in waybillDelivery">
|
|
|
<text class="code" :style="{ color: item.status ? 'green' : '#666' }">
|
|
|
{{ item.orderNum }}
|
|
@@ -11,95 +11,112 @@
|
|
|
{{ '\r\n' + item.createTime }}
|
|
|
</text>
|
|
|
</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>
|
|
|
</uni-popup>
|
|
|
+ <uni-drawer ref="showRightRef" mode="right" :mask-click="true">
|
|
|
+ <scroll-view style="height: 100%" scroll-y="true">
|
|
|
+ <view class="button-group">
|
|
|
+ <button @click="resetForm" type="info">重置</button>
|
|
|
+ <button @click="confirmForm" type="primary">确认</button>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </uni-drawer>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { reactive, ref } from 'vue';
|
|
|
- import { onLoad } from '@dcloudio/uni-app';
|
|
|
- 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: pickupWaybillDeliveryOrderURL + '/index',
|
|
|
- method: 'GET',
|
|
|
- header: {
|
|
|
- batoken: token.value
|
|
|
- },
|
|
|
- success: ({data} : any) => {
|
|
|
- loading.value = false;
|
|
|
- console.log(data);
|
|
|
- if (data.code == 1) {
|
|
|
- waybillDelivery.value = data.data.list;
|
|
|
- } else {
|
|
|
- messageType.value = 'error';
|
|
|
- messageText.value = data.msg;
|
|
|
- messageRef.value.open();
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- loading.value = false;
|
|
|
+import { reactive, ref } from 'vue';
|
|
|
+import { onLoad, onNavigationBarButtonTap } from '@dcloudio/uni-app';
|
|
|
+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 showRightRef = ref();
|
|
|
+
|
|
|
+const resetForm = () => {};
|
|
|
+const confirmForm = () => {
|
|
|
+ showRightRef.value.close();
|
|
|
+};
|
|
|
+
|
|
|
+const getHistory = () => {
|
|
|
+ loading.value = true;
|
|
|
+ uni.request({
|
|
|
+ url: pickupWaybillDeliveryOrderURL + '/index',
|
|
|
+ method: 'GET',
|
|
|
+ header: {
|
|
|
+ batoken: token.value
|
|
|
+ },
|
|
|
+ success: ({ data }: any) => {
|
|
|
+ loading.value = false;
|
|
|
+ console.log(data);
|
|
|
+ if (data.code == 1) {
|
|
|
+ waybillDelivery.value = data.data.list;
|
|
|
+ } else {
|
|
|
+ messageType.value = 'error';
|
|
|
+ messageText.value = data.msg;
|
|
|
+ messageRef.value.open();
|
|
|
}
|
|
|
- });
|
|
|
- };
|
|
|
- onLoad(() => {
|
|
|
- token.value = uni.getStorageSync('token');
|
|
|
- getHistory();
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
});
|
|
|
+};
|
|
|
+onLoad(() => {
|
|
|
+ token.value = uni.getStorageSync('token');
|
|
|
+ getHistory();
|
|
|
+});
|
|
|
+onNavigationBarButtonTap((event) => {
|
|
|
+ if (event.index === 0) {
|
|
|
+ showRightRef.value.open();
|
|
|
+ }
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .history {
|
|
|
- display: flex;
|
|
|
- width: 100%;
|
|
|
- flex-direction: column;
|
|
|
- justify-items: start;
|
|
|
-
|
|
|
- .title {
|
|
|
- padding: 20rpx;
|
|
|
- font-size: 24rpx;
|
|
|
- font-weight: 600;
|
|
|
- }
|
|
|
-
|
|
|
- .type {
|
|
|
- padding-right: 20rpx;
|
|
|
- font-size: 24rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .code {
|
|
|
- font-weight: 600;
|
|
|
- }
|
|
|
-
|
|
|
- .item {
|
|
|
- padding: 20rpx;
|
|
|
- font-size: 20rpx;
|
|
|
- color: #666;
|
|
|
-
|
|
|
- .status {
|
|
|
- padding-left: 20rpx;
|
|
|
- }
|
|
|
+.list {
|
|
|
+ margin: 0 auto;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ // justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ flex: 1;
|
|
|
+ // width: 100%;
|
|
|
+ .item {
|
|
|
+ margin-top: 20rpx;
|
|
|
+ width: 95%;
|
|
|
+ box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.2);
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ // display: inline-block;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+}
|
|
|
+.button-group {
|
|
|
+ margin-top: 15px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-around;
|
|
|
|
|
|
- .fail {
|
|
|
- font-weight: 600;
|
|
|
- color: #f00;
|
|
|
- }
|
|
|
- }
|
|
|
+ button {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ height: 35px;
|
|
|
+ width: 50%;
|
|
|
+ margin-left: 10px;
|
|
|
+ font-size: 16rpx;
|
|
|
+ }
|
|
|
|
|
|
- .is-empty {
|
|
|
- text-align: center;
|
|
|
- margin: 40px 0;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
+ .uni-icons {
|
|
|
+ margin-right: 10px;
|
|
|
}
|
|
|
-</style>
|
|
|
+}
|
|
|
+</style>
|