Blame view

pages/template/nav-search-input/nav-search-input.vue 2.08 KB
4b045f7c   刘淇   江阴初始化项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  <template>
  	<view class="page">
  		<swiper indicator-dots="true">
  			<swiper-item v-for="(img, key) in imgUrls" :key="key"><image :src="img" /></swiper-item>
  		</swiper>
  		<view class="uni-padding-wrap uni-common-mt">
  			<view class="uni-title">
  				
  				<view>本示例为导航栏带搜索框完整功能演示,主要演示有:</view>
  				<view>1. 导航栏为 transparent 模式,向上滑动页面,导航栏会从透明变为实色。</view>
  				<view>2. 点击搜索框跳转到搜索页面。</view>
  				<view>3. 点击导航栏右侧按钮实现关联操作。</view>
  				<view>4. 搜索页面为提示词搜索,输入内容实时显示关联词。</view>
  				<view>5. 搜索结果根据搜索内容高亮显示文字。</view>
  				<view>6. 点击搜索列表或者软键盘搜索按钮,会将结果保存到搜索历史列表。</view>
  				<view>7. 点击删除图标,清空历史搜索列表。</view>
  				<view>Tips </view>
  				<view>1. 本示例目前仅支持 App 端</view>
  				<view>2. 所有示例均为演示使用,具体逻辑需要自己实现。</view>
  
  			</view>
  		</view>
  		<view style="height: 1000rpx;"></view>
  	</view>
  </template>
  
  <script>
  export default {
  	data() {
  		return {
  			showSwiper: false,
  			imgUrls: [
  				'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b4b60b10-5168-11eb-bd01-97bc1429a9ff.jpg',
  				'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b1dcfa70-5168-11eb-bd01-97bc1429a9ff.jpg'
  			]
  		};
  	},
  	/**
  	 * 当 searchInput 配置 disabled 为 true 时触发
  	 */
  	onNavigationBarSearchInputClicked(e) {
  		console.log('事件执行了')
  		uni.navigateTo({
  			url: '/pages/template/nav-search-input/detail/detail'
  		});
  	},
  	/**
  	 *  点击导航栏 buttons 时触发
  	 */
  	onNavigationBarButtonTap() {
  		uni.showModal({
  			title: '提示',
  			content: '用户点击了功能按钮,这里仅做展示。',
  			success: res => {
  				if (res.confirm) {
  					console.log('用户点击了确定');
  				}
  			}
  		});
  	}
  };
  </script>
  
  <style>
  image,
  swiper,
  .img-view {
  	width: 750rpx;
  	width: 100%;
  	height: 500rpx;
  }
  .page-section-title {
  	margin-top: 50rpx;
  }
  </style>