Commit aac4ced6 authored by shuangLSG's avatar shuangLSG

1

parent 35d4fcdb
......@@ -10,11 +10,14 @@
"dependencies": {
"amap-js": "^1.2.1",
"amfe-flexible": "^2.2.1",
"axios": "^0.19.0",
"core-js": "^2.6.5",
"cube-ui": "~1.12.15",
"vant": "^2.1.3",
"vue": "^2.6.10",
"vue-amap": "^0.5.10",
"vue-router": "^3.0.3",
"vuex": "^3.1.1",
"weixin-js-sdk": "^1.4.0-test"
},
"devDependencies": {
......
<template>
<div class="cube-scroll-nav" :class="{'cube-scroll-nav_side': side}">
<!-- {{disable}} -->
{{disable}}
<cube-sticky ref="sticky" :pos="scrollY" @change="stickyChangeHandler">
<cube-scroll
ref="scroll"
......
......@@ -15,7 +15,7 @@
:key="item.category_name"
:label="item.category_name"
:title="item.category_name"
>
>
<div class="content">
<section class="card" v-for="food in item.goods_list" :key="food.id">
<van-card desc="月售360 好评率88%" :title="food.name">
......
<template>
<cube-scroll class="seller" :options="sellerScrollOptions">
<cube-scroll class="seller" @scroll="onScrollHandle" :options="sellerScrollOptions">
<div class="seller-content">
<div class="overview bg-white">
<h1 class="title">{{seller.name}}</h1>
......@@ -115,7 +116,12 @@ export default {
toggleFavorite() {
this.favorite = !this.favorite;
// saveToLocal(this.seller.id, "favorite", this.favorite);
}
},
onScrollHandle(e) {
console.log(e);
// 内层滚动到顶部时,禁止滚动
this.$emit("scroll0");
},
},
components: {
SupportIco
......
<template>
<div class="scroll-list-wrap " :class="{'view-wrapper':!pageLoading}">
<cube-loading v-if="pageLoading" :size="40"></cube-loading>
<cube-sticky :pos="scrollY" :check-top="checkTop" fixed-show-ani="sticky-fixed-show">
<cube-sticky :pos="scrollY" :check-top="checkTop" @diff-change="diffChangeHandler" fixed-show-ani="sticky-fixed-show">
<!-- <header class="sticky-header cube-sticky-fixed">
<div class="icons-box" :style="{opacity:1-opacity}">
<i class="van-icon van-icon-search"></i>
......@@ -86,7 +86,6 @@ export default {
data() {
return {
disable: true, // 外层滚动时,内层禁止滚动
disableInner: false,
scrollY: 0,
scrollEvents: ["scroll"],
checkTop: true,
......@@ -138,15 +137,23 @@ export default {
scrollHandler({ y }) {
this.scrollY = -y;
if (this.scrollY >= this.headerH) {
this.disable = false;
// this.disable = false;
} else {
this.disable = true;
// this.disable = true;
}
},
changeHandler(label) {
this.currentTab = label;
console.log("changed to:", label);
},
diffChangeHandler(diff) {
if (diff && diff >= 1) {
console.log(diff);
this.disable = false;
} else {
// this.disable = false;
}
},
scrollTop() {
this.disable = true;
},
......
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