Commit aac4ced6 authored by shuangLSG's avatar shuangLSG

1

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