From 64a477ae0d66809cd6de49e76be2c7f49c60334f Mon Sep 17 00:00:00 2001
From: whycq <whycq>
Date: 星期四, 31 三月 2022 17:04:15 +0800
Subject: [PATCH] #

---
 pages/basics/sale.vue |   63 ++++++++++++++++++++++++-------
 1 files changed, 48 insertions(+), 15 deletions(-)

diff --git a/pages/basics/sale.vue b/pages/basics/sale.vue
index b04ad91..d670295 100644
--- a/pages/basics/sale.vue
+++ b/pages/basics/sale.vue
@@ -5,8 +5,8 @@
 			<view class="cu-bar bg-white search">
 				<view class="search-form radius">
 					<text class="cuIcon-search"></text>
-					<input :adjust-position="false" type="text" placeholder="鎵爜 / 杈撳叆 (鍗曟嵁缂栧彿)" confirm-type="search"></input>
-					<text class="cuIcon-close"></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>
@@ -49,7 +49,10 @@
 	export default {
 		data() {
 			return {
-				tabData:[],
+				tabData: [],
+				searchData: {},
+				orderNo: '',
+				needData:{},
 			}
 		},
 		mounted(){
@@ -57,24 +60,54 @@
 			this.baseIP = UIP;
 			const UPORT = uni.getStorageSync('UPORT');
 			this.basePORT = UPORT;
-			let that = this;
-			uni.request({
-				url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/receiveDetl/list/auth",
-				header:{'token':uni.getStorageSync('token')},
-				success(res) {
-					var res = res.data
-					if (res.code === 200) {
-						that.tabData = res.data.records
-						console.log(that.tabData)
-					}
-				}
-			})
+			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;
+				if(param) {
+					that.needData['order_no'] = param;
+					that.getData();
+				} else {
+					that.getData();
+				}
+				
+			}
 		}
 	}
 </script>

--
Gitblit v1.9.1