Commit a22e20c1 authored by zhangjinyang's avatar zhangjinyang

悬浮菜单

parent 0b313973
......@@ -7,18 +7,57 @@
:draggable="true"
inactiveIcon="a-controlplatform"
>
<view class="custom-button" @click="go('/pages/ticket/ticket')">
<image class="fab-icon" src="../../static/index/coupon.png"></image>
<text class="fab-text">优惠券</text>
<!-- 助农总入口 -->
<view v-if="position === '0'" class="outer-view">
<view class="custom-button" @click="go('/pages/order/order')">
<image class="fab-icon" src="../../static/index/order.png"></image>
<text class="fab-text">订单</text>
</view>
</view>
<view class="custom-button" @click="go('/pages/order/order')">
<image class="fab-icon" src="../../static/index/order.png"></image>
<text class="fab-text">订单</text>
<!-- 团购 -->
<view v-if="position === '1'" class="outer-view">
<view class="custom-button" @click="go('/pages/ticket/ticket')">
<image class="fab-icon" src="../../static/index/coupon.png"></image>
<text class="fab-text">优惠券</text>
</view>
<view class="custom-button" @click="go('/pages/order/order')">
<image class="fab-icon" src="../../static/index/order.png"></image>
<text class="fab-text">订单</text>
</view>
</view>
<!-- 预售主页 -->
<view v-if="position === '2'" class="outer-view">
<view class="custom-button" @click="go('/pages/order/order')">
<image class="fab-icon" src="../../static/index/order.png"></image>
<text class="fab-text">订单</text>
</view>
<view class="custom-button" @click="go('/pages/assistingAgriculture/cart/cart')">
<image class="fab-icon" src="../../static/index/gwc.png"></image>
<text class="fab-text">购物车</text>
</view>
</view>
<!-- 旅居主页 -->
<view v-if="position === '3'" class="outer-view">
<view class="custom-button" @click="go('/pages/order/order')">
<image class="fab-icon" src="../../static/index/order.png"></image>
<text class="fab-text">订单</text>
</view>
</view>
</wd-fab>
</template>
<script setup>
const props = defineProps({
// 悬浮按钮
position: {
type: String,
default: '1',
},
cartCount: {
type: Number,
default: 0,
},
});
// 前往个人中心
const go = (url) => {
xma.navigateTo({
......@@ -28,6 +67,9 @@ const go = (url) => {
</script>
<style lang="scss" scoped>
.outer-view {
display: flex;
}
.custom-button {
min-width: auto;
box-sizing: border-box;
......
......@@ -190,7 +190,7 @@
</view>
</view>
</view>
<fab />
<fab position="3" />
</view>
</template>
......
......@@ -134,7 +134,7 @@
</view>
</view>
<!-- 购物车悬浮按钮 -->
<view class="cart-floating" @tap="toCart">
<!--<view class="cart-floating" @tap="toCart">
<wd-badge :modelValue="subscript">
<img
class="shop-car"
......@@ -142,8 +142,8 @@
style="width: 40rpx; height: 40rpx"
/>
</wd-badge>
</view>
<fab />
</view>-->
<fab position="2" />
</view>
</template>
......
......@@ -74,7 +74,7 @@
</view>
</view>
</view>
<fab />
<fab position="0" />
</view>
</template>
......
......@@ -128,7 +128,7 @@
</view>
</view>
<!-- 购物车悬浮按钮 -->
<view class="cart-floating" @tap="toCart">
<!--<view class="cart-floating" @tap="toCart">
<wd-badge :modelValue="subscript">
<img
class="shop-car"
......@@ -136,7 +136,8 @@
style="width: 40rpx; height: 40rpx"
/>
</wd-badge>
</view>
</view>-->
<fab position="2" />
</template>
<script setup>
......@@ -150,7 +151,7 @@ import {
getStrictSelection,
} from '../../../api/assistingAgriculture/building';
import { getshoppingCartList } from '@/api/packageDetail';
import fab from '../../../components/fab/fab.vue';
const swiperList = ref([]);
const current = ref(0);
// 轮播图数据
......
......@@ -10,8 +10,8 @@ import { getTokenUser } from '../../api/index';
import { getToken } from '../../utils/auth';
onLoad(async (options) => {
await signIn();
// if (!getToken()) await signIn2();
// await signIn();
if (!getToken()) await signIn2();
const { type } = options;
switch (type) {
case '0':
......
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