index.nvue 价格显示

博客指出页面存在正常与异常情况,异常页面产生的原因是在nvue页面中text标签换行。

正常页面 异常页面

造成的原因是 

 

在nvue页面中 text标签换行造成的。

<template> <view class="work-container"> <!-- 轮播图 --> <uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content"> <swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper"> <swiper-item v-for="(item, index) in data" :key="index"> <view class="swiper-item" @click="clickBannerItem(item)"> <image :src="item.image" mode="aspectFill" :draggable="false" /> </view> </swiper-item> </swiper> </uni-swiper-dot> <!-- 宫格组件 --> <uni-section title="系统管理" type="line"></uni-section> </view> </template> <script> export default { data() { return { current: 0, swiperDotIndex: 0, data: [{ image: '/static/images/banner/banner01.jpg' }, { image: '/static/images/banner/banner02.jpg' }, { image: '/static/images/banner/banner03.jpg' } ] } }, methods: { clickBannerItem(item) { console.info(item) }, changeSwiper(e) { this.current = e.detail.current }, changeGrid(e) { // this.$modal.showToast('模块建设中~') }, handleShop(){ this.$tab.navigateTo('/pages/work/shop/index') this.$modal.showToast('点餐模块建设中~') } } } </script> <style lang="scss" scoped> /* #ifndef APP-NVUE */ page { display: flex; flex-direction: column; box-sizing: border-box; background-color: #fff; min-height: 100%; height: auto; } view { font-size: 14px; line-height: inherit; } /* #endif */ .text { text-align: center; font-size: 26rpx; margin-top: 10rpx; } .grid-item-box { flex: 1; /* #ifndef APP-NVUE */ display: flex; /* #endif */ flex-direction: column; align-items: center; justify-content: center; padding: 15px 0; } .uni-margin-wrap { width: 690rpx; width: 100%; ; } .swiper { height: 300rpx; } .swiper-box { height: 150px; } .swiper-item { /* #ifndef APP-NVUE */ display: flex; /* #endif */ flex-direction: column; justify-content: center; align-items: center; color: #fff; height: 300rpx; line-height: 300rpx; } @media screen and (min-width: 500px) { .uni-swiper-dot-box { width: 400px; /* #ifndef APP-NVUE */ margin: 0 auto; /* #endif */ margin-top: 8px; } .image { width: 100%; } } </style> 编写一个点餐页面,要求 : 按行的形式显示菜品 ,要显示菜品图片 ,剩余数量,点击添加按钮
07-18
{ "lazyCodeLoading": "requiredComponents", "pages": [{ "path": "pages/home/index", "style": { "navigationBarTitleText": "首页", "onReachBottomDistance": 50, "enablePullDownRefresh": true, "navigationStyle": "custom", "navigationBarTextStyle": "black" } }, { "path": "pages/course/index", "style": { "navigationBarTitleText": "课程", "navigationStyle": "custom" } }, { "path": "pages/course/StaticCustomerService", "style": { "navigationBarTitleText": "客服", "navigationStyle": "custom" } }, { "path": "pages/course/detail", "style": { "navigationBarTitleText": "详情", "navigationBarBackgroundColor": "#F4F9FF" // "navigationStyle": "custom" } }, { "path": "pages/course/player", "style": { "navigationBarTitleText": "播放", "navigationStyle": "custom" } }, { "path": "pages/course/order_detail", "style": { "navigationBarTitleText": "订单详情", "navigationStyle": "custom" } }, { "path": "pages/guide/index", "style": { "app-plus": { "titleNView": false }, "navigationStyle": "custom", "disableScroll": true } }, { "path": "pages/live/index", "style": { "navigationBarTitleText": "直播", "navigationStyle": "custom" } }, { "path": "pages/index/index", "style": { "onReachBottomDistance": 50, "navigationBarTitleText": "商城", "navigationStyle": "custom", "navigationBarTextStyle": "black", "enablePullDownRefresh": true } }, { "path": "pages/live/live-player", "style": { "navigationStyle": "custom", "disableScroll": true, "app-plus": { "bounce": "none", "pullToRefresh": { "support": false }, "titleNView": { "autoBackButton": false, "backgroundColor": "transparent" } } } }, { "path": "pages/goods_cate/index", "style": { "navigationBarTitleText": "商品分类", "navigationStyle": "custom" } }, { "path": "pages/message/message", "style": { "navigationBarTitleText": "消息" } }, { "path": "pages/discover_index/index", "style": { "navigationBarTitleText": "逛逛", "navigationStyle": "custom", "navigationBarTextStyle": "black" } }, { "path": "pages/release/index", "style": { "navigationBarTitleText": "发布", "navigationStyle": "custom", "navigationBarTextStyle": "black" } }, { "path": "pages/user/list", "style": { "navigationBarTitleText": "个人中心", "navigationStyle": "custom", "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "#fff", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "pages/message/list", "style": { "navigationBarTitleText": "对话" } } ], "subPackages": [{ "root": "pages/homeSub", "name": "homeSubPackage", "pages": [{ "path": "Personal", "style": { "navigationBarTitleText": "个人中心", "navigationStyle": "custom", "navigationBarTextStyle": "black", "enablePullDownRefresh": true } }, { "path": "NoteDetail", "name": "notedetail", "style": { "navigationBarTitleText": "详情页", "navigationStyle": "custom", "navigationBarTextStyle": "black" // "enablePullDownRefresh": true } }, { "path": "list", "name": "notedelist", "style": { "navigationBarTitleText": "直播列表", "navigationStyle": "custom", "navigationBarTextStyle": "black", "enablePullDownRefresh": true } } ] }, // 新增 orderAddcartSub 子包:存放原主包中 pages/order_addcart/order_addcart 页面 { "root": "pages/order_addcart", "name": "orderAddcartSubPackage", "pages": [{ "path": "order_addcart", "style": { "navigationStyle": "custom", "navigationBarTitleText": "购物车" } }] }, // 原有 recordSub 子包:存放 pages/record/ 下所有页面 { "root": "pages/record", "name": "recordSubPackage", "pages": [{ "path": "create-live", "style": { "navigationBarTitleText": "" } }, { "path": "live-permission", "style": { "navigationBarTitleText": "" } }, { "path": "live-preview", "style": { "navigationBarTitleText": "" } }, { "path": "live-broadcast", "style": { "navigationBarTitleText": "" } } ] }, { "root": "pages/userSub", "name": "userSubPackage", "pages": [{ "path": "index", "style": { "navigationBarTitleText": "个人中心" } }, { "path": "Modifyinformation", "style": { "navigationBarTitleText": "修改资料" } }, { "path": "Allfeatures", "style": { "navigationBarTitleText": "全部功能", "navigationBarBackgroundColor": "#f5f5f5" } }, { "path": "DouyinSettings", "style": { "navigationBarTitleText": "设置" } }, { "path": "follow", "style": { "navigationBarTitleText": "关注列表" } }, { "path": "fans", "style": { "navigationBarTitleText": "粉丝列表" } }, { "path": "common/creator", "style": { "navigationBarTitleText": "创作者申请" } }, { "path": "common/mobile-complete", "style": { "navigationBarTitleText": "创作者中心" } } ] }, { "root": "pages/users", "name": "users", "pages": [{ "path": "web_page/index", "style": { "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "same_city/index", "style": { "navigationBarTitleText": "同城位置", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "AI_face/index", "style": { "navigationBarTitleText": "Ai检测", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "AI_face/list", "style": { "navigationBarTitleText": "AI面诊分析结果", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "AI_face/face", "style": { "navigationBarTitleText": "AI面部分析", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_info/index", "style": { "navigationBarTitleText": "个人资料", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_setting/index", "style": { "navigationBarTitleText": "个人信息", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_money/index", "style": { "navigationBarTitleText": "我的账户", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_bill/index", "style": { "navigationBarTitleText": "账单明细", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_spread_user/index", "style": { "navigationBarTitleText": "我的推广", "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "#fff", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_spread_code/index", "style": { "navigationBarTitleText": "推广海报", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_spread_money/index", "style": { "navigationBarTitleText": "佣金记录", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_transferOut/index", "style": { "navigationBarTitleText": "佣金提现", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_transferOut/status", "style": { "navigationBarTitleText": "提现审核", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_phone/index", "style": { "navigationBarTitleText": "修改手机号", "navigationBarBackgroundColor": "#e93323", "navigationBarTextStyle": "black", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_payment/index", "style": { "navigationBarTitleText": "余额充值", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_spread_brokerage_out/index", "style": { "navigationBarTitleText": "佣金转入", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_pwd_edit/index", "style": { "navigationBarTitleText": "修改密码", "navigationBarTextStyle": "black", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "promoter-list/index", "style": { "navigationBarTitleText": "推广人列表", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "promoter-order/index", "style": { "navigationBarTitleText": "推广人订单", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "promoter_rank/index", "style": { "navigationBarTitleText": "推广人排行", "navigationStyle": "custom" } }, { "path": "commission_rank/index", "style": { "navigationBarTitleText": "佣金排行", "navigationStyle": "custom" } }, { "path": "login/index", "style": { "navigationBarTitleText": "登录", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "wechat_login/index", "style": { "navigationBarTitleText": "账户登录", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "app_login/index", "style": { "navigationBarTitleText": "绑定手机号", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "app_update/app_update", "style": { "navigationBarTitleText": "检查更新", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "settled/index", "style": { "navigationBarTitleText": "商户入驻", "navigationStyle": "custom", "enablePullDownRefresh": false, "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "settledlist/index", "style": { "navigationBarTitleText": "营养师入驻", "navigationStyle": "custom", "enablePullDownRefresh": false, "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_sgin_info/index", "style": { "navigationBarTitleText": "签到说明", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_coupon/index", "style": { "navigationBarTitleText": "我的优惠券", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "search/search", "style": { "navigationBarTitleText": "" } } ] }, { "root": "pages/merchant", "name": "merchant", "pages": [{ "path": "home/index", "style": { "navigationBarTitleText": "商户首页", "navigationStyle": "custom", "enablePullDownRefresh": false } }, { "path": "classify_coupon/index", "style": { "navigationBarTitleText": "商品分类", "navigationStyle": "custom", "enablePullDownRefresh": false, "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "application_record/index", "style": { "navigationBarTitleText": "申请记录", "enablePullDownRefresh": false, "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "application_record/list", "style": { "navigationBarTitleText": "申请记录", "enablePullDownRefresh": false, "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "detail/index", "style": { "navigationStyle": "custom", "navigationBarTitleText": "商户详情", "navigationBarBackgroundColor": "#000", "navigationBarTextStyle": "white", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_integral/index", "style": { "navigationBarTitleText": "积分详情", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_sgin/index", "style": { "navigationBarTitleText": "签到", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_sgin_list/index", "style": { "navigationBarTitleText": "签到记录", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "merchant_street/index", "style": { "navigationBarTitleText": "店铺街", "app-plus": { "titleNView": { "type": "default" } } } } ] }, { "root": "pages/goods", "pages": [{ "path": "goods_details/index", "style": { "navigationBarTitleText": "商品详情", "navigationStyle": "custom" } }, { "path": "goods_list/index", "style": { "navigationBarTitleText": "商品搜索", "navigationBarTextStyle": "black", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "coupon_goods_list/index", "style": { "navigationBarTitleText": "商品搜索", "navigationBarBackgroundColor": "#fff", "navigationBarTextStyle": "black", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "systemIframe/index", "style": { "navigationBarTitleText": "系统表单", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "goods_search/index", "style": { "navigationBarTitleText": "搜索商品", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "news_list/index", "style": { "navigationBarTitleText": "资讯", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "news_details/index", "style": { "navigationBarTitleText": "资讯详情", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "browsing_history/index", "style": { "navigationBarTitleText": "浏览记录", "backgroundColor": "#FFFFFF", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "order_list/index", "style": { "navigationBarTitleText": "我的订单", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "order_logistics/index", "style": { "navigationBarTitleText": "发货记录", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "order_confirm/index", "style": { "navigationBarTitleText": "提交订单", "navigationStyle": "custom" } }, { "path": "order_payment/index", "style": { "navigationBarTitleText": "支付订单", "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "#fff", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "refund_details/index", "style": { "navigationBarTitleText": "售后详情", "navigationBarBackgroundColor": "#fff", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "order_pay_status/index", "style": { "navigationBarTitleText": "支付结果", "navigationBarBackgroundColor": "#f5f5f5", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "order_details/index", "style": { "navigationBarTitleText": "订单详情", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "virtual_order_details/index", "style": { "navigationBarTitleText": "订单详情", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_return_list/index", "style": { "navigationBarTitleText": "售后列表", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "goods_return/index", "style": { "navigationBarTitleText": "售后退款", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "after_sales_type/index", "style": { "navigationBarTitleText": "售后类型", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "returns_and_refunds/index", "style": { "navigationBarTitleText": "退货退款", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "goods_comment_con/index", "style": { "navigationBarTitleText": "商品评价", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "evaluation_list/index", "style": { "navigationBarTitleText": "评价列表", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "goods_comment_list/index", "style": { "navigationBarTitleText": "商品评分", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "goods_logistics/index", "style": { "navigationBarTitleText": "物流信息", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "send_record/index", "style": { "navigationBarTitleText": "发货记录", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "agreement_rules/index", "style": { "navigationBarTitleText": "隐私协议", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_goods_collection/index", "style": { "navigationBarTitleText": "收藏商品", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_merchant_collection/index", "style": { "navigationBarTitleText": "收藏店铺", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "alipay_return/alipay_return", "style": { "navigationBarTitleText": "", "enablePullDownRefresh": false } }, { "path": "alipay_invoke/index", "style": { "navigationBarTitleText": "", "enablePullDownRefresh": false } }, { "path": "agreement_info/index", "style": { "navigationBarTitleText": "", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_grade/index", "style": { "navigationBarTitleText": "我的等级", "navigationBarBackgroundColor": "#181818", "navigationBarTextStyle": "white", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "exp_record/index", "style": { "navigationBarTitleText": "经验值明细", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "level_rule/index", "style": { "navigationBarTitleText": "等级规则说明", "navigationBarBackgroundColor": "#282828", "navigationBarTextStyle": "white", "app-plus": { "titleNView": { "type": "default" } } } } ] }, { "root": "pages/address", "name": "address", "pages": [{ "path": "user_address_list/index", "style": { "navigationBarTitleText": "地址管理", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "user_address/index", "style": { "navigationBarTitleText": "添加地址", "app-plus": { "titleNView": { "type": "default" } } } } ] }, { "root": "pages/activity", "name": "activity", "pages": [{ "path": "goods_seckill/index", "style": { "navigationBarTitleText": "秒杀列表", "navigationStyle": "custom", "navigationBarTextStyle": "black" } }, { "path": "mer-good-seckill/index", "style": { "navigationBarTitleText": "秒杀列表", "navigationStyle": "custom", "navigationBarTextStyle": "black" } }, { "path": "goods_group/index", "style": { "navigationBarTitleText": "拼团活动", "navigationStyle": "custom", "navigationBarTextStyle": "black" } }, { "path": "liveBroadcast/index", "style": { "navigationBarTitleText": "列表", "navigationBarBackgroundColor": "#F2F2F2" } }, { "path": "status/index", "style": { "navigationBarTitleText": "拼团活动", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "couponList/index", "style": { "navigationBarTitleText": "领券中心", "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "#F2F2F2", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "small_page/index", "style": { "navigationBarTitleText": "", "enablePullDownRefresh": false, "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "vip_paid/index", "style": { "navigationBarTitleText": "SVIP会员", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "vip_paid_benefits/index", "style": { "navigationBarTitleText": "会员权益", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "vip_order_record/index", "style": { "navigationBarTitleText": "会员购买记录", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "points_mall/index", "style": { "navigationBarTitleText": "积分商城", "navigationStyle": "custom" } }, { "path": "goods_points/index", "style": { "navigationBarTitleText": "热门推荐", "navigationStyle": "custom", "navigationBarTextStyle": "black" } }, { "path": "integral_activity/index", "style": { "navigationBarTitleText": "积分活动", "navigationStyle": "custom", "navigationBarTextStyle": "black" } } ] }, { "root": "pages/discover", "name": "discover", "pages": [{ "path": "discover_search_list/index", "style": { "navigationBarTitleText": "搜索页面", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "discover_release/index", "style": { "navigationBarTitleText": "内容发布", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "discover_video/routineVideo/index", "style": { "navigationBarTitleText": "逛逛短视频", "navigationStyle": "custom", "app-plus": { "titleNView": false, "bounce": "none" } } }, { "path": "discover_video/appVideo/index", "style": { "navigationBarTitleText": "逛逛短视频", "navigationStyle": "custom", "navigationBarTextStyle": "black", "app-plus": { "titleNView": false, "bounce": "none" } } }, { "path": "discover_user/index", "style": { "navigationBarTitleText": "个人主页", "navigationStyle": "custom" } }, { "path": "discover_follow/index", "style": { "navigationBarTitleText": "我的关注", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "discover_note_topic/index", "style": { "navigationBarTitleText": "话题", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "discover_details/index", "style": { "navigationBarTitleText": "内容详情", "app-plus": { "titleNView": { "type": "default" } } } } ] }, { "root": "pages/admin", "name": "admin", "pages": [{ "path": "work/index", "style": { "navigationBarTitleText": "工作台", "navigationStyle": "custom" } }, { "path": "skipRefund/index", "style": { "navigationBarTitleText": "售后订单", "navigationStyle": "custom" } }, { "path": "order/index", "style": { "navigationBarTitleText": "订单管理", "navigationStyle": "custom" } }, { "path": "logistics/index", "style": { "navigationBarTitleText": "物流信息", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "logistics/detail", "style": { "navigationBarTitleText": "发货记录", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "logistics/record", "style": { "navigationBarTitleText": "发货记录", "navigationStyle": "custom", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "refund/index", "style": { "navigationBarTitleText": "立即退款", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "order/send", "style": { "navigationBarTitleText": "发货", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "order/detail", "style": { "navigationStyle": "custom" } }, { "path": "after_sale/index", "style": { "navigationBarTitleText": "售后订单", "navigationStyle": "custom" } }, { "path": "statistics/index", "style": { "navigationStyle": "custom", "navigationBarTitleText": "销售额统计", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "cancel/index", "style": { "navigationBarTitleText": "订单核销", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "cancel/list", "style": { "navigationBarTitleText": "核销订单", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "cancel/result", "style": { "navigationBarTitleText": "核销结果", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "refundOrderDetail/index", "style": { "navigationStyle": "custom" } }, { "path": "goods/index", "style": { "navigationStyle": "custom", "navigationBarTitleText": "商品管理" } }, { "path": "goods/specs", "style": { "navigationBarTitleText": "修改价格/库存", "navigationBarBackgroundColor": "#F5F5F5", "app-plus": { "titleNView": { "type": "default" } } } }, { "path": "goods/inventory", "style": { "navigationBarTitleText": "增加库存", "navigationBarBackgroundColor": "#F5F5F5", "app-plus": { "titleNView": { "type": "default" } } } } ] }, { "root": "pages/auth", "name": "authindex", "pages": [{ "path": "index", "style": { "navigationBarTitleText": "CRMEB" } }] } ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "crmeb", "navigationBarBackgroundColor": "#fff", "backgroundColor": "#F8F8F8", "app-plus": { "scrollIndicator": "none" } }, "tabBar": { "custom": false, "color": "#282828", "selectedColor": "#fc4141", "borderStyle": "white", "backgroundColor": "#ffffff", "list": [{ "pagePath": "pages/home/index", "iconPath": "/static/tabBar/riFill-home-3-fill@1x.png", "selectedIconPath": "/static/tabBar/riFill-home-3-fill@1x (2).png", "text": "首页" }, { "pagePath": "pages/course/index", "iconPath": "/static/tabBar/riFill-video-fill@1x (2).png", "selectedIconPath": "/static/tabBar/riFill-video-fill@1x.png", "text": "课程" }, { "pagePath": "pages/release/index", "iconPath": "/static/tabBar/riFill-add-circle-fill 1@1x.png", "selectedIconPath": "/static/tabBar/riFill-add-circle-fill 1@1x (2).png", "text": "发布" }, { "pagePath": "pages/message/message", "iconPath": "/static/tabBar/riFill-message-2-fill@1x (2).png", "selectedIconPath": "/static/tabBar/riFill-message-2-fill@1x.png", "text": "消息" }, { "pagePath": "pages/user/list", "iconPath": "/static/tabBar/riFill-account-circle-fill@1x (2).png", "selectedIconPath": "/static/tabBar/riFill-account-circle-fill@1x.png", "text": "我的" } ] }, "condition": { "current": 0, "list": [{ "name": "", "path": "", "query": "" }] } }这是我pages代码应该怎么加subNVue
10-31
<template> <view class="detail-container"> <!-- 标题 --> <view class="detail-title">{{ product.product_title }}</view> <!-- 第一张图片 --> <view class="image-container"> <image :src="`/static/${product.img1}`" class="detail-image"></image> <view class="image-footer"> <view class="left-part"> <text class="product-name">{{ product.product_name }}</text> <text class="product-price">¥{{ product.price }}</text> </view> </view> </view> <!-- 商品内容 --> <view class="product-content">{{ product.product_content }}</view> <!-- 第二张图片 --> <view class="image-container"> <image :src="`/static/${product.img2}`" class="detail-image"></image> <view class="image-footer"> <view class="left-part"> <text class="product-name">{{ product.product_name }}</text> <text class="product-price">¥{{ product.price }}</text> </view> </view> </view> <!-- 到底了提示 --> <view class="end-of-page" v-if="isEndOfPage">到底了</view> <popupVue ref="popup"></popupVue> <!-- 底部购买栏 --> <view class="goods-carts"> <uni-goods-nav :options="options" :fill="true" :button-group="buttonGroup" @click="onClick" @buttonClick="buttonClick" /> </view> </view> </template> <script> import popupVue from './popup.vue'; export default { data() { return { product: {}, // 当前商品信息 isEndOfPage: false, // 是否到达页面底部 options: [ { icon: 'chat', text: '客服' }, { icon: 'shop', text: '店铺', info: 0, infoBackgroundColor: '#007aff', infoColor: "#f5f5f5" }, { icon: 'cart', text: '购物车', info: 0 } ], buttonGroup: [ { text: '加入购物车', backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)', color: '#fff' }, { text: '立即购买', backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)', color: '#fff' } ] }; }, components: { popupVue }, onLoad(options) { // 获取传递的商品ID const productId = options.id; // 模拟从后端获取商品详情数据 this.fetchProductDetails(productId); }, methods: { // 模拟获取商品详情数据 fetchProductDetails(productId) { const products = { 1008: { product_id: 1008, product_name: "双胞胎辣条", img: "双胞胎辣条.png", img1: "双胞胎辣条1.png", img2: "双胞胎辣条2.png", price: 3, product_title: "便宜!实惠!就选双胞胎辣条", product_content: "双胞胎辣条,这个让人欲罢不能的网红零食是怎么来的?其实背后有着一段有趣的故事。创始人受童年回忆启发,结合现代口味,经过无数次尝试,最终创造了这款美味的辣条。" }, 1012: { product_id: 1012, product_name: "烤酸奶", img: "烤酸奶.png", img1: "烤酸奶1.png", img2: "烤酸奶2.png", price: 48, product_title: "古老的制作手艺!传统甜食——烤酸奶", product_content: "烤酸奶是源自俄罗斯的一种传统的酸奶制作工艺,也称为俄罗斯烤酸奶。在十六世纪中期,俄罗斯北高加索地区的牧羊人发现,随身携带羊皮囊中的牛奶由于受到篝火炙烤,经过发酵后,色泽金黄,带有微醺的酪香,成为当地流行的特色酸奶。" } }; if (products[productId]) { this.product = products[productId]; } else { uni.showToast({ title: "未找到对应商品", icon: "none" }); } }, onClick(e) { if (e.content.text === '购物车') { // 使用 getCurrentPages() 获取当前页面栈 const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; console.log('当前页面路径:', currentPage.route); // 确认路径格式 uni.setStorageSync('lastPageRoute', currentPage.route); uni.switchTab({ url: '/pages/Shopping_Cart/Shopping_Cart' }); } }, buttonClick(e) { let id = this.product.product_id; // 修改为 this.product.product_id let index = e.index; this.$refs.popup.open(id, index); if (index === 0) { // 加入购物车逻辑 this.options[2].info++; uni.showToast({ title: "已加入购物车", icon: "success" }); } else if (index === 1) { // 立即购买逻辑 uni.showToast({ title: "即将跳转到支付页面", icon: "none" }); } } }, onReachBottom() { // 页面滚动到底部时触发 this.isEndOfPage = true; } }; </script> <style lang="scss"> /* 商品详情页容器 */ .detail-container { padding: 20rpx; background-color: #f5f5f5; } /* 标题样式 */ .detail-title { font-size: 36rpx; font-weight: bold; text-align: center; margin-bottom: 20rpx; } /* 图片容器 */ .image-container { margin-bottom: 20rpx; background-color: #ffffff; border-radius: 10rpx; overflow: hidden; box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1); } /* 商品图片 */ .detail-image { width: 100%; height: 330rpx; } /* 图片下方内容 */ .image-footer { display: flex; justify-content: space-between; align-items: center; padding: 10rpx; } /* 左部分 */ .left-part { display: flex; flex-direction: column; } .product-name { font-size: 28rpx; font-weight: bold; color: #333; } .product-price { font-size: 24rpx; color: #ff4d4f; margin-top: 5rpx; } /* 商品内容 */ .product-content { font-size: 26rpx; line-height: 1.5; color: #666; margin-bottom: 20rpx; } /* 到底了提示 */ .end-of-page { text-align: center; font-size: 24rpx; color: #999; margin-top: 20rpx; } /* 底部购买栏 */ .goods-carts { /* #ifndef APP-NVUE */ display: flex; /* #endif */ flex-direction: column; position: fixed; left: 0; right: 0; /* #ifdef H5 */ left: var(--window-left); right: var(--window-right); /* #endif */ bottom: 0; } </style>以上代码使用了哪些前后端技术简要说明一下
05-23
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值