This commit is contained in:
2021-11-11 17:35:55 +08:00
parent 628da9d057
commit 52c1603176
3 changed files with 25 additions and 25 deletions
+17 -22
View File
@@ -4,43 +4,38 @@
<van-nav-bar left-arrow v-if="$route.meta.showNavBar" :title="$route.meta.title" @click-left="$router.back()" :style="{backgroundColor: $route.meta.navBarBackgroundColor}" />
</div>
<div class="focus-list-container">
<buddha-process></buddha-process>
<buddha-process></buddha-process>
<buddha-process></buddha-process>
<buddha-process></buddha-process>
<div class="no-more" v-if="list.length === 0">暂无数据</div>
<buddha-process v-for="li in list" :key="li.id" :data="li" @collection="onCancelCollection"></buddha-process>
</div>
</div>
</template>
<script>
import TMAPLoader from '@/common/tmap';
import { getMyCollectionList } from '@/api'
export default {
data(){
return {
containerHeight: 0,
keyword: '',
activeName: ''
activeName: '',
list: [],
page: 1,
}
},
inject: ['root', 'tabbar'],
mounted(){
this.$nextTick(() => {
const { offsetHeight } = this.root.$refs.tabbar.$el;
this.containerHeight = window.innerHeight - this.$refs.topbar.offsetHeight - offsetHeight - 20;
})
TMAPLoader.load({
key: process.env.VUE_APP_TMAP_KEY
}).then(TMap => {
console.log(TMap)
var center = new TMap.LatLng(39.984104, 116.307503);
//初始化地图
var map = new TMap.Map("container", {
zoom:12,//设置地图缩放级别
center: center//设置地图中心点坐标
});
console.log(map)
})
this.getMyCollectionList();
},
methods: {
async getMyCollectionList(){
const res = await getMyCollectionList(this.page)
this.list = this.list.concat(res.results);
},
onCancelCollection(id){
const index = this.list.map(item => item.id).indexOf(id);
this.list.splice(index, 1)
}
}
}
</script>