uni-cart-fix.vue 887 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="cart-fix" @click="toCart">
  3. <u-image width="70rpx" height="70rpx" src="/static/cart.png"></u-image>
  4. <u-badge absolute :offset="[15,10]" type="error" :count="count"></u-badge>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. computed: {
  10. count() {
  11. return this.$store.state.vuex_cartNums
  12. },
  13. hide_good_box(){
  14. return this.$store.state.vuex_goodBox
  15. },
  16. bus_x(){
  17. return this.$store.state.vuex_bus_x
  18. },
  19. bus_y(){
  20. return this.$store.state.vuex_bus_y
  21. }
  22. },
  23. methods: {
  24. toCart() {
  25. uni.navigateTo({
  26. url:"/pages/cart/cart"
  27. })
  28. }
  29. },
  30. }
  31. </script>
  32. <style lang="scss">
  33. .cart-fix{
  34. position: fixed;
  35. z-index: 100000;
  36. background: rgba($color: #ffffff, $alpha: 0.7);
  37. padding: 10upx;
  38. border-radius: 100%;
  39. bottom: 40%;
  40. right: 2%;
  41. box-shadow: 3upx 3upx 8upx #ccc;
  42. }
  43. </style>