Commit 0dc28319 authored by 李晓兵's avatar 李晓兵

'修改定位样式'

parent 79eda834
......@@ -43,7 +43,7 @@
</div>
</section>
<!-- 省份 -->
<section ref="pro" class="pro-wrapper">
<section v-show="province_flag" ref="pro" class="pro-wrapper">
<div class="pro-content">
<list-item :item-height="40">
<item v-for="(item,index) in lists" :key="index" :proportion="[5,2]">
......@@ -52,46 +52,47 @@
</list-item>
</div>
</section>
<!-- &lt;!&ndash; 城市 &ndash;&gt;
<scroll v-show="!province_flag" :pullUp="false" class="content-scroll">
<list-item :item-height="40">
<item v-for="(item,index) in cityList" :key="index" :proportion="[5,2]">
<section slot="name" @click="selectCity(item.city_name)">{{ item.city_name }}</section>
</item>
</list-item>
</scroll>-->
<!-- 城市 -->
<section v-show="!province_flag" ref="city" class="pro-wrapper">
<div class="city-content">
<list-item :item-height="40">
<item v-for="(item,index) in cityList" :key="index" :proportion="[5,2]">
<section slot="name" @click="selectCity(item.city_name)">{{ item.city_name }}</section>
</item>
</list-item>
</div>
</section>
</section>
</h-view>
</template>
<script>
import BScroll from 'better-scroll'
export default {
name: 'Location',
data () {
return {
flag: false,
province_flag: true,
province: '请选择省',
city: '请选择市',
places: '',
lists: [],
cityList: [],
}
},
computed: {},
watch: {},
created () {
// 判断是否是初次进入,不是就显示手动绑定的位置
if (window.localStorage.getItem('province')) {
this.places = window.localStorage.getItem('province') + '-' + window.localStorage.getItem('city')
} else {
this.places = this.$route.params.province + '-' + this.$route.params.city
}
this.selectLocation()
},
methods:
import BScroll from 'better-scroll'
export default {
name: 'Location',
data () {
return {
flag: false,
province_flag: true,
province: '请选择省',
city: '请选择市',
places: '',
lists: [],
cityList: [],
}
},
computed: {},
watch: {},
created () {
// 判断是否是初次进入,不是就显示手动绑定的位置
if (window.localStorage.getItem('province')) {
this.places = window.localStorage.getItem('province') + '-' + window.localStorage.getItem('city')
} else {
this.places = this.$route.params.province + '-' + this.$route.params.city
}
this.selectLocation()
},
methods:
{
// 重新定位到当前位置
relocation () {
......@@ -122,7 +123,7 @@
vm.lists = res.lists
vm.$nextTick(() => {
vm.scroll = new BScroll(vm.$refs.pro, {
click: true
click: true,
})
})
})
......@@ -152,8 +153,12 @@
let vm = this
this.hlsHttp.post(url, param).then(function (res) {
console.log(res)
// this.lists = res.lists
vm.cityList = res.lists
vm.$nextTick(() => {
vm.cityScroll = new BScroll(vm.$refs.city, {
click: true,
})
})
})
this.flag = !this.flag
this.province_flag = false
......@@ -175,7 +180,7 @@
})
},
},
}
}
</script>
<style lang='less' scoped>
#location {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment