Commit a22e20c1 authored by zhangjinyang's avatar zhangjinyang

悬浮菜单

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