1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <template>
- <view class="cart-fix" @click="toCart">
- <!-- <u-image width="70rpx" height="70rpx" src="/static/cart.png"></u-image>
- <u-badge absolute :offset="[15,10]" type="error" :count="count"></u-badge> -->
- <drag-button
- :isDock="true"
- :existTabBar="true"
- :dragPic="dragPic"
- :badge="count"
- @btnClick="toCart"
- @btnTouchstart="btnTouchstart"
- @btnTouchend="btnTouchend"
- />
- </view>
- </template>
- <script>
- import dragButton from "@/components/drag-button/drag-button.vue";
- export default {
- components: {
- dragButton
- },
- props:{
- closeCurPage:{
- type: Boolean,
- default: false
- },
- dragPic: {
- type: String,
- default: ''
- }
- },
- computed: {
- count() {
- return this.$store.state.vuex_cartNums
- },
- },
- methods: {
- toCart() {
- let _this = this
- if(_this.closeCurPage){
- uni.redirectTo({
- url:"/pagesA/cart/cart"
- })
- }else{
- uni.navigateTo({
- url:"/pagesA/cart/cart"
- })
- }
- },
- btnClick() {
- console.log('btnClick');
- },
- btnTouchstart() {
- console.log('btnTouchstart');
- },
- btnTouchend() {
- console.log('btnTouchend');
- },
- },
- }
- </script>
- <style lang="scss">
- .cart-fix{
- position: fixed;
- z-index: 100000;
- // background: rgba($color: #ffffff, $alpha: 0.7);
- // padding: 10upx;
- // border-radius: 100%;
- bottom: 40%;
- right: 2%;
- // box-shadow: 3upx 3upx 8upx #ccc;
- }
- </style>
|