From 54fce333aae7d6f596616a6eb5e65c27c28a9994 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期三, 21 八月 2024 12:39:26 +0800 Subject: [PATCH] # --- pages/basics/matSelect.vue | 67 +++++++++++++++++++++++++++++++++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/pages/basics/matSelect.vue b/pages/basics/matSelect.vue index aac13f7..b35dd92 100644 --- a/pages/basics/matSelect.vue +++ b/pages/basics/matSelect.vue @@ -35,6 +35,12 @@ </label> </checkbox-group> </scroll-view> + <!-- <view class="record" v-show="recordShow"> + <label class="record-card" v-for="(item,index) in record" :key="index" @click="chose(index)"> + <view style="padding: 0 5rpx 0 10rpx;">{{item}}</view> + <uni-icons style="padding: 0 5rpx 0 5rpx;" type="closeempty" size="22" color="#a5a5a5" @click="del(index)"></uni-icons> + </label> + </view> --> </view> </template> @@ -46,6 +52,8 @@ condition:null, tag: [], data: [], + record: [], + recordShow: false, } }, onLoad() { @@ -57,6 +65,7 @@ eventChannel.on('commonUrl', function(data) { that.commonUrl = data.commonUrl that.showTag(1) + that.record = uni.getStorageSync("record") }) }, methods: { @@ -67,10 +76,18 @@ this.condition = null uni.vibrateShort(); }, + // 鑱氱劍 + inputF() { + if (this.record.length == 0) { + return + } + this.recordShow = true + }, search(condition) { let that = this that.tag = null that.data = null + that.recordShow = false uni.vibrateShort(); uni.showLoading({ title: '鎼滅储涓�...' @@ -86,10 +103,12 @@ 'token':uni.getStorageSync('token'), }, success(result) { + console.log(result); uni.hideLoading(); var res = result.data if (res.code === 200 ) { that.data = res.data + that.save() } else if (res.code == 403) { uni.showToast({title: res.msg, icon: "none", position: 'top'}) setTimeout(() => { @@ -103,6 +122,31 @@ } }); }, + // 淇濆瓨 + save() { + if (this.record === '') { + this.record = [] + } + this.record.push(this.condition) + for (var i = 0; i < this.record.length; i++) { + for (var j = i + 1;j < this.record.length; j++) { + if (this.record[i] ===this.record[j]){ + this.record.splice(j,1); + j--; + } + } + } + + uni.setStorageSync("record",this.record) + }, + // 鍒犻櫎 + del(i) { + this.record.splice(i,1) + uni.setStorageSync("record",this.record) + }, + // chose(i) { + // this.condition = this.record[i] + // }, showTag(parentId) { let that = this uni.showLoading(); @@ -196,6 +240,29 @@ </script> <style> + .record { + display: flex; + align-items: center; + flex-wrap: wrap; + z-index: 1; + position: fixed; + top: 188rpx; + /* #ifdef APP-PLUS */ + top: 89rpx; + /* #endif */ + width: 100%; + min-height: 50rpx; + background-color: #E4E7ED; + } + .record-card { + display: flex; + align-items: center; + min-width: 100rpx; + height: 60rpx; + background-color: #C0C4CC; + margin: 10rpx 10rpx 10rpx 10rpx; + border-radius: 10rpx; + } .matnr { margin-left: 60rpx; margin-top: 20rpx; -- Gitblit v1.9.1