Browse Source

榕川公众号页面新增优化

luhuan 1 week ago
parent
commit
ab2d265014
4 changed files with 195 additions and 5 deletions
  1. 12 0
      api/index.js
  2. 7 1
      pages.json
  3. 26 4
      pages/index/index.vue
  4. 150 0
      pages/index/orderDetailList.vue

+ 12 - 0
api/index.js

@@ -47,6 +47,18 @@ export function getOrderList(params) {
 	});
 }
 
+export function getOrderDetailList(params) {
+	console.log(params)
+	return request({
+		url: 'TransportOrder/getOrderDetailList.action',
+		method: 'POST',
+		data: params,
+		header:{
+		"Content-Type": "application/x-www-form-urlencoded"
+		}
+	});
+}
+
 export function evaluationOrder(params) {
 	return request({
 		url: 'TransportOrder/evaluationOrder.action',

+ 7 - 1
pages.json

@@ -1,5 +1,5 @@
 {
-	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+	"pages": [ 
 		{
 			"path": "pages/index/login",
 			"style": {
@@ -29,6 +29,12 @@
 			"style": {
 				"navigationBarTitleText": "签收详情"
 			}
+		},
+		{
+			"path": "pages/index/orderDetailList",
+			"style": {
+				"navigationBarTitleText": "订单明细"
+			}
 		}
 	],
 	"globalStyle": {

+ 26 - 4
pages/index/index.vue

@@ -8,11 +8,18 @@
       <view v-for="(item, index) in orderList" :key="index">
         <u-cell :value="item.CURRENT_VALUE" :isLink="true" :url="item.URL" :stop="false">
           <view slot="title" class="u-slot-title">
-            <text class="u-cell-text">{{item.ORDER_CENTER_ORDER_ID}}</text>
+            <text class="u-cell-text">{{item.CUSTOMER_REFFERENCE_ID}}</text>
             <u-tag  :text="item.STATUS_TEXT" size="mini" :type="item.TEXT_TYPE"></u-tag>
           </view>
+          <view slot="title" class="u-slot-title">
+            <text class="u-cell-text">货主名称:{{item.CUSTOMER_NAME}}</text>
+          </view>
+          <view slot="title" class="u-slot-title">
+            <text class="u-cell-text">收货方名称:{{item.RECEIVER_NAME}}</text>
+          </view>
           <view style="display: flex;flex-direction: column;align-items: flex-start;padding-top: 10px" slot="label">
             <u-row>
+              <u-button  type="primary" size="mini" @click.native.stop="handleDetails(item)">明细详情</u-button>
               <u-button  type="primary" size="mini" @click.native.stop="handleEvaluation($event,item)">{{item.EVALUATION_STATUS}}</u-button>
             </u-row>
           </view>
@@ -70,7 +77,7 @@
 </template>
 
 <script>
-import {evaluationOrder, getOrderList} from "@/api";
+import {evaluationOrder, getOrderList,getOrderDetailList} from "@/api";
 
   export default {
 		data() {
@@ -185,6 +192,13 @@ import {evaluationOrder, getOrderList} from "@/api";
         });
       },
 
+      handleDetails(item) {
+        // 跳转到orderDetailList页面并传递参数
+        uni.navigateTo({
+          url: `/pages/index/orderDetailList?accountId=${item.ACCOUNT_ID}&userId=${item.USER_ID}&orderCenterOrderId=${item.ORDER_CENTER_ORDER_ID}`
+        });
+      },
+
 
       handleEvaluation(event,item) {
         // 阻止事件冒泡,这样点击按钮就不会触发 u-cell 的点击事件了
@@ -274,7 +288,6 @@ import {evaluationOrder, getOrderList} from "@/api";
   padding: 0;
 
   &__item {
-
     &__title {
       color: $u-tips-color;
       background-color: $u-bg-color;
@@ -293,6 +306,7 @@ import {evaluationOrder, getOrderList} from "@/api";
   @include flex;
   flex-direction: row;
   align-items: center;
+  margin-bottom: 4px;
 }
 
 .u-cell-text {
@@ -303,7 +317,7 @@ import {evaluationOrder, getOrderList} from "@/api";
 }
 
 .u-slot-value {
-  line-height: 17px;
+  line-height: 14px;
   text-align: center;
   font-size: 10px;
   padding: 0 5px;
@@ -313,6 +327,14 @@ import {evaluationOrder, getOrderList} from "@/api";
   background-color: #f56c6c;
 }
 
+/deep/ .u-button {
+  min-width: 80px;
+  margin-right: 10px;
+}
+
+/deep/ .u-cell {
+  margin-bottom: 4px;
+}
 .evaluation-container {
   padding: 20rpx 30rpx;
   

+ 150 - 0
pages/index/orderDetailList.vue

@@ -0,0 +1,150 @@
+<template>
+  <view class="u-page">
+    <u-list @scrolltolower="scrolltolower">
+      <view class="list-wrap">
+        <view v-for="(item, index) in detailList" :key="index" class="card-item">
+              <view class="info-item">
+                <u-col span="6">
+                  <text class="label">商品名称:{{item.itemName}}</text>
+                </u-col>
+                <u-col span="6">
+                  <text class="label">体积:{{ item.cube }} m³</text>
+                </u-col>
+              </view>
+              <view class="info-item">
+                <u-col span="6">
+                <text class="label">重量:{{ item.weight }} kg</text>
+                </u-col>
+                <u-col span="6">
+                  <text class="label">数量:{{ item.peiceNum }} 件</text>
+                </u-col>
+              </view>
+        </view>
+      </view>
+    </u-list>
+  </view>
+</template>
+
+<script>
+import { getOrderDetailList } from '@/api/index.js';
+
+export default {
+  data() {
+    return {
+      detailList: [],
+      page: 1,
+      limit: 10,
+      // loadStatus: 'loadmore',
+      total: 0
+    };
+  },
+
+  onLoad(options) {
+    console.log(options)
+    let item = {}
+    item.accountId = options.accountId
+    item.orderCenterOrderId = options.orderCenterOrderId
+    this.getDetailList(item);
+  },
+
+  methods: {
+    // 获取明细列表数据
+
+    // let params = {
+    //   accountId: item.ACCOUNT_ID,
+    //   userId: item.USER_ID,
+    //   orderCenterOrderId: item.ORDER_CENTER_ORDER_ID
+    // }
+    // getOrderDetailList(params).then(res => {
+    //   if (res.data) {
+    //       console.log(res.data)
+    //   }
+    // })
+    async getDetailList(item) {
+      try {
+        // this.loadStatus = 'loading';
+        // 这里替换为实际的API调用
+        const res = await getOrderDetailList({
+            accountId: item.accountId,
+            userId: item.userId,
+            orderCenterOrderId: item.orderCenterOrderId
+        });
+
+        console.log(1111)
+        console.log(res)
+        if (res.code === 'success') {
+          this.detailList = res.data
+        } else {
+          // this.loadStatus = 'loadmore';
+          uni.$u.toast(res.message || '获取数据失败');
+        }
+      } catch (error) {
+        // this.loadStatus = 'loadmore';
+        uni.$u.toast('获取数据失败');
+      }
+    },
+
+    // // 滚动到底部触发
+    // scrolltolower() {
+    //   if (this.loadStatus === 'loadmore') {
+    //     this.page++;
+    //     this.getDetailList();
+    //   }
+    // }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.u-page {
+  padding: 0;
+}
+
+.list-wrap {
+  padding: 15px;
+  background-color: #f8f8f8;
+}
+
+.card-item {
+  margin-bottom: 15px;
+  background-color: #ffffff;
+  border-radius: 8px;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+  padding: 12px;
+  border: 1px solid #eaeaea;
+}
+
+.info-item {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  padding: 8px 0;
+  
+  &:not(:last-child) {
+    border-bottom: 1px solid #f0f0f0;
+  }
+  
+  .label {
+    color: #333;
+    font-size: 14px;
+    margin-right: 5px;
+    white-space: nowrap;
+    
+    &::after {
+      content: '';
+      display: inline-block;
+      width: 1px;
+      height: 12px;
+      background-color: #dcdfe6;
+      margin: 0 8px;
+      vertical-align: middle;
+    }
+  }
+  
+  .value {
+    color: #666;
+    font-size: 14px;
+    flex: 1;
+  }
+}
+</style>