From 3bdac82e0066f97307fc6a7177cecdf89a5ba7e1 Mon Sep 17 00:00:00 2001
From: whycq <whycq>
Date: 星期四, 07 四月 2022 09:23:39 +0800
Subject: [PATCH] #

---
 pages/basics/demo.vue |  122 ++++++++++++++++++++++++++--------------
 1 files changed, 79 insertions(+), 43 deletions(-)

diff --git a/pages/basics/demo.vue b/pages/basics/demo.vue
index 7db179d..d670295 100644
--- a/pages/basics/demo.vue
+++ b/pages/basics/demo.vue
@@ -1,20 +1,46 @@
 <template>
 	<view>
-		<scroll-view>
-			<view>
-				<view v-for="(item,index) in data" :key="index"  class="demo-list">
-					<view><text>璁㈠崟锛�</text><text>{{item.orderNo}}</text></view>
-					<view>搴斿叆鏁伴噺锛歿{item.anfme}}</view>
-					<view>宸插叆鏁伴噺锛歿{item.inQty}}</view>
-					<view>鍟嗗搧缂栫爜锛歿{item.matnr}}</view>
-					<view>鍟嗗搧鍚嶇О锛歿{item.maktx}}</view>
-					<view>璁㈠崟鐘舵�侊細{{item.state$}}</view>
+		<!-- 鎼滅储鏍� -->
+		<view>
+			<view class="cu-bar bg-white search">
+				<view class="search-form radius">
+					<text class="cuIcon-search"></text>
+					<input v-model="orderNo" :adjust-position="false" type="text" placeholder="鎵爜 / 杈撳叆 (鍗曟嵁缂栧彿)" confirm-type="search" @input="search()"></input>
+					<text class="cuIcon-close" @click="reset()"></text>
+				</view>
+				<view class="action">
+					<button class="cu-btn bg-yellow" style="color: #fff;">鎼� 绱�</button>
 				</view>
 			</view>
-		</scroll-view>
-		<view class="foot flex justify-around">
-			<button class="cu-btn bg-blue lg">涓婃灦</button>
-			<button class="cu-btn bg-blue lg">鎾ら攢涓婃灦</button>
+		</view>
+		<view class="margin-top">
+			<uni-table border stripe type="selection" emptyText="娌℃湁鏇村鏁版嵁">
+				<!-- 琛ㄥご -->
+				<uni-tr >
+					<uni-th align="center" width="200">璁㈠崟</uni-th>
+					<uni-th align="center">搴斿叆搴撻噺</uni-th>
+					<uni-th align="center">宸插叆搴撻噺</uni-th>
+					<uni-th align="center" width="200">鍟嗗搧缂栫爜</uni-th>
+					<uni-th align="center">鍟嗗搧鍚嶇О</uni-th>
+					<uni-th align="center">璁㈠崟鐘舵��</uni-th>
+					<uni-th align="center"width="200">鎿嶄綔</uni-th>
+				</uni-tr>
+				<!-- 琛ㄤ綋 -->
+				<uni-tr v-for="(item, index) in tabData" :key="index">
+					<uni-td align="center">{{item.orderNo}}</uni-td>
+					<uni-td align="center">{{item.anfme}}</uni-td>
+					<uni-td align="center">{{item.inQty}}</uni-td>
+					<uni-td align="center">{{item.matnr}}</uni-td>
+					<uni-td align="center">{{item.maktx}}</uni-td>
+					<uni-td align="center">{{item.state$}}</uni-td>
+					<uni-td>
+						<view class="flex justify-around">
+							<button class="cu-btn bg-orange sm">涓� 鏋�</button>
+							<button class="cu-btn bg-red sm">鎾ら攢涓婃灦</button>
+						</view>
+					</uni-td>
+				</uni-tr>
+			</uni-table>
 		</view>
 	</view>
 </template>
@@ -23,17 +49,54 @@
 	export default {
 		data() {
 			return {
-				data: []
+				tabData: [],
+				searchData: {},
+				orderNo: '',
+				needData:{},
 			}
 		},
-		mounted() {
+		mounted(){
 			const UIP = uni.getStorageSync('UIP');
 			this.baseIP = UIP;
 			const UPORT = uni.getStorageSync('UPORT');
 			this.basePORT = UPORT;
 			this.render()
 		},
+		onLoad() {
+			
+		},
 		methods: {
+			// 鎼滅储
+			search() {
+				let that = this;
+				// that.tabData.forEach(function(e){
+				// 	that.searchData = e.orderNo
+				// })
+				this.render(that.orderNo)
+			},
+			// 閲嶇疆
+			reset() {
+				let that = this;
+				that.orderNo = '';
+				that.needData['order_no'] = '';
+				that.getData();
+			},
+			// 鑾峰彇琛ㄦ牸鏁版嵁
+			getData() {
+				let that = this
+				uni.request({
+					url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/receiveDetl/list/auth",
+					header:{'token':uni.getStorageSync('token')},
+					data: that.needData,
+					success(res) {
+						var res = res.data
+						if (res.code === 200) {
+							that.tabData = res.data.records
+						}
+					}
+				})
+			},
+			
 			// 琛ㄦ牸鍔犺浇
 			render(param) {
 				let that = this;
@@ -44,37 +107,10 @@
 					that.getData();
 				}
 				
-			},
-			getData() {
-				let that = this
-				uni.request({
-					url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/receiveDetl/list/auth",
-					header:{'token':uni.getStorageSync('token')},
-					data: that.needData,
-					success(res) {
-						var res = res.data
-						if (res.code === 200) {
-							
-							that.data = res.data.records
-							console.log(that.data)
-						}
-					}
-				})
-			},
+			}
 		}
 	}
 </script>
 
 <style>
-	.demo-list {
-		background-color: #FFFFFF;
-		box-shadow: 0px 0px 2px #d3d3d3;
-	}
-	.foot {
-		width: 100%;
-		background-color: #ffffff;
-		position: fixed;
-		bottom: 0;
-		box-shadow: 0px -2px 5px gray;
-	}
 </style>

--
Gitblit v1.9.1