【类 型】:fix

【原  因】:按钮冒泡问题 点击不跳转
【过  程】:首页按钮组件 链接改为参数放到 组件内部  修改像是解决 按钮冒泡问题
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
air 2025-01-16 12:24:40 +08:00
parent 963813ec0b
commit ae63df0591
3 changed files with 26 additions and 22 deletions

View File

@ -1,11 +1,13 @@
<template> <template>
<view class="flex column boxshadow rad32 but mac ofh" :style="{background:bg}"> <navigator :url="url">
<view class="imgBox"> <view class="flex column boxshadow rad32 but mac ofh" :style="{background:bg}">
<u--image :src="imgSrc" width="128rpx" height="128rpx"></u--image> <view class="imgBox">
<u--image :src="imgSrc" width="188rpx" height="188rpx"></u--image>
</view>
<view class="tc w100 fb butBt fci fz44 l-h-12">{{butBt}}</view>
<view class="tc w100 butSt fci fz32">{{butSt}}</view>
</view> </view>
<view class="tc w100 fb butBt fci fz44 l-h-12">{{butBt}}</view> </navigator>
<view class="tc w100 butSt fci fz32">{{butSt}}</view>
</view>
</template> </template>
<script> <script>
@ -17,6 +19,10 @@
}; };
}, },
props: { props: {
url:{
type:String,
required: true,
},
bg: { bg: {
type: String, type: String,
default: '', default: '',
@ -52,9 +58,9 @@
} }
.imgBox { .imgBox {
width: 128rpx; width: 188rpx;
height: 128rpx; height: 188rpx;
margin-top: 24rpx; margin-top: 36rpx;
} }
.butBt { .butBt {

View File

@ -22,18 +22,14 @@
</view> </view>
<!-- 新订单 提示框 --> <!-- 新订单 提示框 -->
<!-- 新订单提示框 --> <!-- 新订单提示框 -->
<view v-for="(item, index) in orderList" :key="index"> <!-- <view v-for="(item, index) in orderList" :key="index">
订单{{ item.order_sn }} 订单{{ item.order_sn }}
<text>状态{{ item.shipment_status }}</text> <text>状态{{ item.shipment_status }}</text>
</view> </view> -->
<!-- 主按钮 --> <!-- 主按钮 -->
<view class="flex mse" style="height: 222rpx;margin-top: 30rpx;"> <view class="flex mse" style="margin-top: 30rpx;">
<navigator url="/pages/shop/list"> <mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" butSt="Order Now" />
<mainBut bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" butSt="Order Now" /> <mainBut url="/pages/order/index" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品" butSt="Buy Goods" />
</navigator>
<navigator url="/pages/order/index">
<mainBut bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品" butSt="Buy Goods" />
</navigator>
<!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> --> <!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
</view> </view>
<!-- 站长推荐 --> <!-- 站长推荐 -->

View File

@ -20,10 +20,12 @@
<view class="m-t-24 m-r-24 m-l-24 bg-w p-24 rad8 boxshadow"> <view class="m-t-24 m-r-24 m-l-24 bg-w p-24 rad8 boxshadow">
<view class="fb fz36 p-b-12 borderBDas">常用功能</view> <view class="fb fz36 p-b-12 borderBDas">常用功能</view>
<view class="flex msb"> <view class="flex msb">
<view class="setItemBox flex mac column p-24"> <navigator url="/pages/order/index">
<u-icon name="order" size="28"></u-icon> <view class="setItemBox flex mac column p-24">
<view class="fz24">订单</view> <u-icon name="order" size="28"></u-icon>
</view> <view class="fz24">订单</view>
</view>
</navigator>
<view class="setItemBox flex mac column p-24"> <view class="setItemBox flex mac column p-24">
<u-icon name="map-fill" size="28"></u-icon> <u-icon name="map-fill" size="28"></u-icon>
<view class="fz24">地图</view> <view class="fz24">地图</view>