Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
liangxiaojuan committed Dec 24, 2016
1 parent 1e52478 commit 577341e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/components/goods/goods.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@
</li>
</ul>
</div>
<shopCart :delivery-price="seller.deliveryPrice" :min-price="seller.minPrice"></shopCart>
<shopCart :select-foods="selectFoods" :delivery-price="seller.deliveryPrice" :min-price="seller.minPrice"></shopCart>
</div>
</template>
<script type="text/ecmascript-6">
import BScroll from 'better-scroll';
import shopCart from '../shopcart/shopCart.vue';
import cartControl from '../cartControl/cartControl.vue';
const ERR_OK = 0;
export default {
props: {
Expand Down Expand Up @@ -92,16 +91,16 @@
let foods = [];
this.goods.forEach((good) => {
good.foods.forEach((food) => {
})
})
if (food.count) {
foods.push(food);
}
});
});
return foods;
}
},
methods: {
_initScroll() {
// console.log(this.$refs);
// console.log((this.$refs.menuWrapper));
this.menuScroll = new BScroll(this.$refs.menuWrapper, {
click: true
});
Expand Down Expand Up @@ -129,6 +128,9 @@
let foodList = this.$refs.foodWrapper.getElementsByClassName('food-list-hook');
let el = foodList[index];
this.foodScroll.scrollToElement(el, 300);
},
cartAdd: function (target) {
console.log(target);
}
},
components: {
Expand Down
22 changes: 22 additions & 0 deletions src/components/shopcart/shopCart.styl
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,25 @@
&.enough
background #00b43c
color #ffffff
.ball-container
.ball
position fixed
left 32px
bottom 22px
z-index 200
&.fade-enter-active, &.fade-leave-active {
transition: all 0.4s linear
}
&.fade-enter, &.fade-leave-active {
opacity: 0
transform translate3d(24px, 0, 0)
}
.inner
width 16px
height 16px
border-radius 50%
background rgb(0,160,220)
transition: all 0.4s



17 changes: 16 additions & 1 deletion src/components/shopcart/shopcart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@
</div>
<div class="content-right ">
<div class="pay" :class="payClass">
{{payDesc}}
{{payDesc}}
</div>
</div>
</div>
<div class="ball-container">
<trabsition name="fade">
<div v-for="ball in balls" v-show="ball.show">
<trabsition>
<div class="inner">

</div>
</trabsition>
</div>
</trabsition>
</div>
</div>
</template>

Expand All @@ -39,6 +49,11 @@
default: 0
}
},
data () {
return {
balls: [{show: false}, {show: false}, {show: false}, {show: false}, {show: false}]
};
},
computed: {
totalPrice() {
let total = 0;
Expand Down

0 comments on commit 577341e

Please sign in to comment.