You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
1.7 KiB
94 lines
1.7 KiB
<template>
|
|
<view class="city">
|
|
<view class="city-hd">
|
|
<image class="sousuo" src="@/static/city-sousuo.png"></image>
|
|
<input type="search" :value="keyword" @input="changeInput" placeholder="请输入" />
|
|
<image class="clear" src="@/static/city-close.png"></image>
|
|
</view>
|
|
<view class="city-bd">
|
|
<view class="empty">
|
|
<image src="@/static/empty.png"></image>
|
|
<view class="txt">暂无数据</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
city: "",
|
|
keyword: ""
|
|
};
|
|
},
|
|
onLoad(o) {
|
|
this.city = decodeURIComponent(o.city);
|
|
},
|
|
methods: {
|
|
changeInput() {
|
|
console.log(111)
|
|
uni.request({
|
|
url: 'https://restapi.amap.com/v3/assistant/inputtips?datatype=all&type=050301&city='+this.city+'&key=4a6e2ba8eac3864f0d88f9b5abd026e6&keywords='+this.keyword,
|
|
complete(res) {
|
|
console.log(res)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.city{
|
|
min-height: 100vh;
|
|
background-color: #fff;
|
|
padding: 0 25rpx;
|
|
overflow: hidden;
|
|
&-hd{
|
|
margin-top: 30rpx;
|
|
height: 90rpx;
|
|
background: #F5F5F5;
|
|
border-radius: 90rpx;
|
|
border: 1px solid #EAEAEA;
|
|
padding: 0 30rpx;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
align-items: center;
|
|
.sousuo{
|
|
width: 30rpx;
|
|
height: 30rpx;
|
|
margin-right: 15rpx;
|
|
}
|
|
input{
|
|
flex: 1;
|
|
font-weight: 500;
|
|
font-size: 28rpx;
|
|
color: #222222;
|
|
height: 90rpx;
|
|
}
|
|
.clear{
|
|
width: 45rpx;
|
|
height: 45rpx;
|
|
margin-left: 15rpx;
|
|
}
|
|
}
|
|
&-bd{
|
|
padding: 0 25rpx 25rpx;
|
|
overflow: hidden;
|
|
.empty{
|
|
padding: 150rpx 0;
|
|
text-align: center;
|
|
font-weight: 500;
|
|
font-size: 28rpx;
|
|
color: #222222;
|
|
image{
|
|
display: block;
|
|
width: 460rpx;
|
|
height: 400rpx;
|
|
margin: 0 auto;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|