1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038 |
- <template>
- <view class="container" :style="{ height: winHeight+ 'px' }">
- <!-- #ifdef MP -->
- <view class="cart_nav">
- <nav-bar iconColor='#fff' ref="navBarRef" :navTitle="merchanInfo.name" backgroundColor="#FF6702" :isBackgroundColor="false">
- </nav-bar>
- </view>
- <!-- #endif -->
- <view class="main">
- <view class="nav">
- <view class="header">
- <view class="left">
- <view class="flex-y-center">
- <image style="width: 96rpx; height: 96rpx;border-radius: 6rpx;" :src="merchanInfo.avatar"></image>
- <view style="flex: 1;margin-left: 20rpx;">
- <view class="store-name">
- <navigator :url="`/pages/merchant/detail/index?merId=${merId}`" hover-class="none">
- <view class="flex-center">
- <text style="font-weight: 600;font-size: 35rpx;color: #141414;">{{ merchanInfo.name }}</text>
- <view class="iconfont icon-jiantou" style="font-size: 24rpx;"></view>
- </view>
- </navigator>
- <button hover-class="none" class="merCollect" :class="!merchanInfo.isCollect ? 'care' : 'bg-color'" @click="followToggle">
- <text v-show="merchanInfo.isCollect" class="iconfont icon-guanzhu" style="margin-top: 6rpx;"></text>
- {{ merchanInfo.isCollect ? '已关注' : '关注' }}
- </button>
- </view>
- <view class="store-score" style="margin: 7rpx 0;">
- <text style="font-weight: 600;font-size: 27rpx;color: #FD6716;">{{ merchanInfo.starLevel }}分</text>
- <text style="font-size: 21rpx;color: #999999;margin-left: 6rpx;">月销 {{ merchanInfo.sales || 0 }}</text>
- </view>
- </view>
- </view>
- <view class="store-addr">
- <text style="font-size: 23rpx;color: #141414;">商家地址:{{ merchanInfo.addressDetail }}</text>
- </view>
-
- <!-- 提示 -->
- <view v-if="merchanInfo.headline && merchanInfo.headline.length" class="store-tip flex-y-center mt-10 mb-10 pl-32">
- <!-- 左侧固定图片 -->
- <text class='iconfont icon-laba ' style="font-size: 24rpx;margin-right: 20rpx;"></text>
-
- <!-- 右侧文字轮播区域 -->
- <view class="flex-1 h-40 mt-10" style="overflow: hidden;">
- <swiper class="swiper" :indicator-dots="false" circular :autoplay="true" :interval="3000" vertical>
- <block v-for="(item,index) in merchanInfo.headline" :key='index'>
- <swiper-item catchtouchmove='catchTouchMove'>
- <view class='newsTitle swiper-item'>
- <text>{{item.title}}</text>
- </view>
- </swiper-item>
- </block>
- </swiper>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view style="width: 100%;height: 10rpx; background-color: #F8F9FD;"></view>
- </view>
- <view class="let-box">
- <view @click="onTabChang(0)" class="let-box1">
- <text :class="{ 'actave1': tabindex == 0 }" class="let-txt">下单</text>
- <view :class="{ 'actave': tabindex == 0 }" class="let-line"></view>
- </view>
- <view @click="onTabChang(1)" class="let-box1">
- <text :class="{ 'actave1': tabindex == 1 }" class="let-txt">评价</text>
- <view :class="{ 'actave': tabindex == 1 }" class="let-line"></view>
- </view>
- </view>
- <template v-if="tabindex == 0">
- <view class="content">
- <scroll-view style="height: 950rpx" class="menus" scroll-with-animation scroll-y>
- <view class="wrapper">
- <view class="menu" :id="`menu-${item.id}`" :class="{'current': item.id === currentCateId}" v-for="(item, index) in goods"
- :key="index" @tap="handleMenuTap(item.id)" v-if="item.childList.length">
- <text>{{ item.name }}</text>
- <view class="dot" v-show="menuCartNum(item.id)">{{ menuCartNum(item.id) }}</view>
- </view>
- </view>
- </scroll-view>
- <!-- goods list begin -->
- <scroll-view class="goods" scroll-with-animation scroll-y :scroll-top="cateScrollTop" @scroll="handleGoodsScroll"
- :scroll-into-view="menuScrollIntoView">
- <view class="wrapper">
- <view class="list">
- <!-- category begin -->
- <view style="font-weight: 400;font-size: 21rpx;color: #999999;text-align: center;margin-bottom: 19rpx;">————温馨提示:湿度选择,避免浪费
- ————</view>
- <view class="category" v-for="(item, index) in goods" :key="index" :id="`cate-${item.id}`" v-if="item.childList.length">
- <view class="title">
- <text v-if="item.childList.length">{{ item.name }}</text>
- <image :src="item.icon" class="icon"></image>
- </view>
- <view class="items">
- <!-- 商品 begin -->
- <!-- <view v-if="!item.goodsList">无商品</view> -->
- <view class="good" v-for="(good, key) in item.childList" :key="key">
- <image :src="good.icon" class="image" @tap="getOrderdetils(good, item)"></image>
- <view class="right">
- <text class="name">{{ good.name }}</text>
- <view class="tips">
- <text>销量 {{good.sales}}</text>
- <text style="margin-left: 39rpx;">好评率 {{ good.replyChance*100}}%</text>
- </view>
- <view class="price_and_action">
- <text class="price">¥{{ good.price }}</text>
- <view class="btn-group">
- <button type="primary" class="btn property_btn bg-color" hover-class="none" size="mini" @tap="Selectpox(item, good)">
- 选规格
- </button>
- <!-- <view class="dot" v-show="goodCartNum(good.id)">{{ goodCartNum(good.id) }}</view> -->
- </view>
- </view>
- </view>
- </view>
- <!-- 商品 end -->
- </view>
- </view>
- <!-- category end -->
- </view>
- </view>
- </scroll-view>
- <!-- goods list end -->
- </view>
- <!-- content end -->
- <!-- 购物车栏 begin -->
- <view class="cart-box">
- <view class="mark">
- <image src="/static/img/ic-shopping-cart.png" class="cart-img" @tap="cart.length !== 0 ? lockcatble = !lockcatble : ''"></image>
- <view class="tag" v-if="cart.length > 0">{{ getCartGoodsNumber }}</view>
- </view>
- <view style="font-weight: 500;font-size: 27rpx;color: #999999;" class="price" v-if="cart.length === 0">配送费2元</view>
- <view style="font-weight: 600;font-size: 27rpx;color: #FFFFFF;" class="price" v-else>¥{{ getCartGoodsPrice || 0 }}</view>
- <button :style="{backgroundColor: disabledPay ? '#000' : ''}" type="primary" class="pay-btn bg-color" @tap="toPay"
- :disabled="disabledPay">
- {{ disabledPay ? `差${spread}元起送` : '去结算' }}
- </button>
- </view>
- <!-- 购物车栏 end -->
- <!-- 打开的购物车 -->
- <view class="mode" v-if="cart.length !== 0 && lockcatble" style="z-index: 9;">
- <view class="mode-1">
- <!-- 判断数量大于0显示 -->
- <view class="mode-clear" v-if="getCartGoodsNumber>0">
- <text class="mode-txt">数量:<text style="color: #FD6716 ;">({{getCartGoodsNumber}})</text></text>
- <text @tap="cart = [], lockcatble = false" class="mode-txt1">清空</text>
- </view>
- <view class="mode-box">
- <view class="items">
- <!-- 商品 begin -->
- <view class="good" v-for="(good, key) in cart" :key="key">
- <image :src="good.iconText" class="image" @tap="console.log('点击图片')"></image>
- <view class="right" style="margin-left: 50rpx;">
- <text class="name">{{ good.name }}</text>
- <view class="tips">
- <text>{{ good.props_text }}</text>
- <text style="margin-left: 39rpx;">销量 {{good.sales}}</text>
- <text style="margin-left: 39rpx;">好评率 {{ good.replyChance*100}}%</text>
- </view>
- <view class="price_and_action">
- <text class="price">¥{{ good.price * good.number }}</text>
- <view class="btn-group">
- <button type="default" v-show="goodCartNum(good.props_text)" plain class="btn reduce_btn" size="mini"
- hover-class="none" @tap="handleReduceFromCart(item, good)">
- <view class="iconfont iconsami-select">-</view>
- </button>
- <view class="number" v-show="goodCartNum(good.props_text)">{{ goodCartNum(good.props_text) }}</view>
- <button type="primary" class="btn add_btn bg-color" size="min" hover-class="none" @tap="handleAddToCart(item, good, 1)">
- <view class="iconfont iconadd-select">+</view>
- </button>
- </view>
- </view>
- </view>
- </view>
- <!-- 商品 end -->
- </view>
- <view style="height: 200rpx;">
- </view>
- </view>
- </view>
- </view>
- <!-- 规格弹窗 -->
- <view class="mode" v-if="selectble">
- <view class="sel-mode-1">
- <view class="good-detail-modal">
- <view class="close" @click="Close">
- <text style="padding: 10rpx; 20rpx">x</text>
- </view>
- <view class="sel-2">
- <image class="neximg" :src="good.icon" />
- <view class="nexbox1">
- <view class="name" style="font-size: 28rpx;margin-bottom: 19rpx;color: #000000;">{{good.name}}</view>
- <view>
- <text>销量 {{good.sales}}</text>
- <text style="margin-left: 39rpx;">好评率 {{ good.replyChance*100}}%</text>
- <text style="margin-left: 39rpx;" class="nexbox-txt3">¥ {{good.price}}</text>
- </view>
- </view>
- </view>
- <!--规格数组 -->
- <scroll-view class="detail" scroll-y>
- <view class="wrapper">
- <view class="properties">
- <view class="property" v-for="(item, index) in good.property" :key="index">
- <view class="title">
- <text class="name">{{ item.attributeName }}</text>
- <!-- <view class="desc" v-if="item.desc">({{ item.desc }})</view> -->
- </view>
- <view class="values">
- <view class="value" v-for="(value, key) in item.optionList" :key="key" :class="{'default': value.is_default}"
- @tap="changePropertyDefault(index, key)">
- {{ value.optionName }}
- </view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- <!-- 数量 -->
- <view class="sel-6">
- <text>数量</text>
- <!-- 加入购物车 -->
- <view class="btn-group">
- <button v-if="!goodCartNum(good.props_text)" type="primary" class="btn property_btn bg-color" size="min"
- hover-class="none" @tap="handleAddToCart(good.category, good, 1)">
- 加入购物车
- </button>
- <template v-else>
- <button type="default" v-show="goodCartNum(good.props_text)" plain class="btn reduce_btn" size="mini"
- hover-class="none" @tap="handleReduceFromCart(good.category, good)">
- <view class="iconfont iconsami-select">-</view>
- </button>
- <view class="number" v-show="goodCartNum(good.props_text)">{{ goodCartNum(good.props_text) }}</view>
- <button type="primary" class="btn add_btn bg-color" size="min" hover-class="none" @tap="handleAddToCart(good.category, good, 1)">
- <view class="iconfont iconadd-select">+</view>
- </button>
- </template>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <template v-if="tabindex == 1">
- <view style="flex: 1;">
- <view class='evaluate-list'>
- <view class='generalComment acea-row row-between-wrapper'>
- <view class='acea-row row-middle font_color'>
- <view class='evaluate'>评分</view>
- <view class='start' :class="'star'+ (replyData.replyStar)">
- </view>
- </view>
- <view><text class='font_color'>{{replyData.replyChance ? (replyData.replyChance)*100 : 0}}%</text>好评率</view>
- </view>
- <view class='nav-tab1 acea-row row-middle'>
- <view class='item' :class='type==0 ? "bg-color":""' @click='changeType(0)'>全部({{replyData.sumCount || 0}})
- </view>
- <view class='item' :class='type==1 ? "bg-color":""' @click='changeType(1)'>好评({{replyData.goodCount || 0}})
- </view>
- <view class='item' :class='type==2 ? "bg-color":""' @click='changeType(2)'>中评({{replyData.inCount || 0}})
- </view>
- <view class='item' :class='type==3 ? "bg-color":""' @click='changeType(3)'>差评({{replyData.poorCount || 0}})
- </view>
- </view>
- <user-evaluation :reply="reply"></user-evaluation>
- </view>
- <view class='loadingicon acea-row row-center-wrapper'>
- <text class='loading iconfont icon-jiazai' v-if='loading!=false'></text>{{loadTitle}}
- </view>
- <view class='noCommodity' v-if="(type==0 && !replyData.sumCount) || (type==1 && !replyData.goodCount) || (type==2 && !replyData.inCount) || (type==3 && !replyData.poorCount)">
- <view class='pictrue'>
- <image :src="urlDomain+'crmebimage/presets/noEvaluate.png'"></image>
- <view class="default_txt">暂无任何评论哦~</view>
- </view>
- </view>
- </view>
- </template>
- </view>
- </template>
- <script>
- // +----------------------------------------------------------------------
- // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
- // +----------------------------------------------------------------------
- // | Author: CRMEB Team <admin@crmeb.com>
- // +----------------------------------------------------------------------
- import {
- getCategoryCacheTree,
- getMerchantInfo,
- getMerchantProList,
- getMerchantReply,
- getMerchantReplyConfig
- } from '@/api/merchant.js';
- import {
- getMerCollectAddApi,
- getMerCollectCancelApi
- } from '@/api/merchant.js';
- import {
- getProductDetail
- } from '@/api/product.js';
- import {
- orderCreate,
- preOrderApi
- } from '@/api/order.js';
- import navBar from '@/components/navBar';
- import {
- getAddressList
- } from '@/api/user.js';
- import userEvaluation from './components/userEvaluation.vue';
- let app = getApp();
- var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'rpx';
- export default {
- components: {
- navBar,
- userEvaluation
- },
- data() {
- return {
- merId: 0,
- winHeight: 0,
- merchanInfo: {},
- statusBarHeight: app.globalData.statusBarHeight,
- navigationBarHeight: 112,
- goods: [], //所有商品
- currentCateId: 1, //默认分类
- cateScrollTop: 0,
- lastScrollTop: 0,
- menuScrollIntoView: '',
- cart: [], //购物车
- goodDetailModalVisible: false, //是否饮品详情模态框
- good: {}, //当前饮品
- category: {}, //当前饮品所在分类
- cartPopupVisible: false,
- sizeCalcState: false,
- orderType: 'takeout',
- store: {
- min_price: 0.01
- },
- specifications: '', //点击的这一项菜品信息
- specificationsList: [], //点击的这一项菜品信息的大类
- selectble: false, //规格弹窗
- productValue: [], //规格数组
- productObj: {}, //规格对象
- productid: '', //选中规格的id
- lockcatble: false, // 购物车弹窗
- tabindex: 0, //点菜评价切换
- addressInfo: {},
- urlDomain: this.$Cache.get("imgHost"),
- replyData: {},
- product_id: 0,
- reply: [],
- type: 0,
- loading: false,
- loadend: false,
- loadTitle: '加载更多',
- page: 1,
- limit: 20,
- orderdetilsOjb: {}
- }
- },
- onShow() {
- console.log(this.cart)
- console.log(this.orderdetilsOjb)
- uni.getStorageSync()
- // this.handleAddToCart()
- },
- onLoad(options) {
- let that = this;
- uni.getSystemInfo({
- success: function(res) {
- that.winHeight = res.windowHeight
- },
- });
- if (options.hasOwnProperty('merId') || options.scene) {
- if (options.scene) { // 仅仅小程序扫码进入
- this.merId = this.globalData.merId ? this.globalData.merId : 0;
- } else {
- this.merId = options.merId ? parseInt(options.merId) : 0;
- }
- }
- //首页数据加载
- // 获取商家信息
- this.getMerchantInfoData()
- // 获取商品列表
- getCategoryCacheTree(this.merId).then(res => {
- console.log(res.data)
- this.goods = res.data
- // this.goods.unshift({
- // id: 9999,
- // name: '推荐'
- // })
- this.currentCateId = this.goods[0].id
- // this.menuScrollIntoView = `cate-${9999}`
- })
- // 获取用户默认地址
- this.getAddressList()
- // this.getIndexConfig();
- // #ifdef MP-WEIXIN
- // 获取微信胶囊的位置信息 width,height,top,right,left,bottom
- const custom = wx.getMenuButtonBoundingClientRect()
- // 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
- // this.navigationBarHeight = custom.height + (custom.top - this.statusBarHeight) * 2
- // console.log("导航栏高度:"+this.globalData.navigationBarHeight)
- // #endif
- },
- computed: {
- goodCartNum() { //计算单个饮品添加到购物车的数量
- // this.good
- return (text) => this.cart.reduce((acc, cur) => {
- !text ? text = this.getGoodSelectedProps(this.good) : ''
- if ((cur.props_text + cur.id) === (text + this.good.id)) {
- return acc += cur.number
- }
- return acc
- }, 0)
- },
- menuCartNum() {
- return (id) => this.cart.reduce((acc, cur) => {
- if (cur.cate_id === id) {
- return acc += cur.number
- }
- return acc
- }, 0)
- },
- getCartGoodsNumber() { //计算购物车总数
- return this.cart.reduce((acc, cur) => acc + cur.number, 0)
- },
- getCartGoodsPrice() { //计算购物车总价
- return this.cart.reduce((acc, cur) => acc + cur.number * cur.price, 0)
- },
- disabledPay() { //是否达到起送价
- return this.orderType == 'takeout' && (this.getCartGoodsPrice < this.store.min_price) ? true : false
- },
- spread() { //差多少元起送
- if (this.orderType != 'takeout') return
- return parseFloat((this.store.min_price - this.getCartGoodsPrice).toFixed(2))
- }
- },
- methods: {
- getMerchantInfoData() {
- getMerchantInfo(this.merId).then(res => {
- this.merchanInfo = res.data
- this.$store.commit('MERCHANTJINFO', res.data);
- });
- },
- // 跳转详情
- getOrderdetils(item, val) {
- this.orderdetilsOjb = {
- good: item,
- category: val
- }
- console.log(this.orderdetilsOjb)
- uni.navigateTo({
- url: `/pages/goods/goods_details/index?id=${item.id}&mt=0&cart=${JSON.stringify(this.cart)}`
- })
- },
- // 设置是否关注
- followToggle: function() {
- if (this.isLogin === false) {
- toLogin();
- } else {
- if (this.merchanInfo.isCollect) {
- getMerCollectCancelApi(this.merId).then(res => {
- console.log()
- if (res.code == 200) {
- this.$util.Tips({
- title: "取消收藏",
- });
- this.getMerchantInfoData() //商家信息
- }
- })
- } else {
- getMerCollectAddApi(this.merId).then(res => {
- console.log('收藏', res)
- if (res.code == 200) {
- this.$util.Tips({
- title: "收藏成功",
- });
- this.getMerchantInfoData() //商家信息
- }
- })
- }
- }
- },
- // 获取地址数据
- getAddressList() {
- getAddressList().then(res => {
- console.log('地址', res)
- if (res.code = 200) {
- this.addressInfo = res.data.find(item => item.isDefault === true);
- console.log('默认地址', this.addressInfo)
- }
- })
- },
- handBack() {
- uni.navigateBack({
- delta: 1
- })
- },
- handleMenuTap(id) { //点击菜单项事件
- this.menuScrollIntoView = `cate-${id}`
- if (!this.sizeCalcState) {
- this.calcSize()
- }
- this.$nextTick(() => this.cateScrollTop = this.goods.find(item => item.id == id).top)
- },
- handleGoodsScroll({
- detail
- }) { //商品列表滚动事件
- if (!this.sizeCalcState) {
- this.calcSize()
- }
- const {
- scrollTop
- } = detail
- let tabs = this.goods.filter(item => item.top <= scrollTop).reverse()
- if (tabs.length > 0) {
- this.currentCateId = tabs[0].id
- }
- },
- calcSize() {
- let h = 10
- this.goods.forEach(item => {
- let view = uni.createSelectorQuery().select(`#cate-${item.id}`)
- view.fields({
- size: true
- }, data => {
- // if (data.goodsList) {
- item.top = h
- h += data.height
- item.bottom = h
- // }
- }).exec()
- })
- this.sizeCalcState = true
- },
- showGoodDetailModal(item, good) {
- this.good = JSON.parse(JSON.stringify({ ...good
- }))
- this.category = JSON.parse(JSON.stringify(item))
- this.goodDetailModalVisible = true
- },
- handlePropertyAdd() {
- this.good.number += 1
- },
- handlePropertyReduce() {
- if (this.good.number === 1) return
- this.good.number -= 1
- },
- changePropertyDefault(index, key) { //改变默认属性值
- this.good.property[index].optionList.forEach(value => this.$set(value, 'is_default', 0))
- this.good.property[index].optionList[key].is_default = 1
- this.good.number = 1
- this.good = JSON.parse(JSON.stringify(this.good))
- },
- handleAddToCartInModal() {
- const product = Object.assign({}, this.good, {
- props_text: this.getGoodSelectedProps(this.good),
- props: this.getGoodSelectedProps(this.good, 'id')
- })
- this.handleAddToCart(this.category, product, this.good.number)
- // this.closeGoodDetailModal()
- },
- getGoodSelectedProps(good, type = 'text') { //计算当前饮品所选属性
- // if (good.use_property) {
- let props = []
- good.property.forEach(({
- optionList
- }) => {
- optionList.forEach(value => {
- if (value.is_default) {
- props.push(type === 'text' ? value.optionName : value.id)
- }
- })
- })
- return type === 'text' ? props.join(',') : props
- // }
- // return ''
- },
- handleReduceFromCart(item, good) {
- const goodText = this.getGoodSelectedProps(this.good) // 购物车当前选中的规格
- const index = this.cart.findIndex(item => item.id === good.id && item.props_text === goodText)
- this.cart[index].number -= 1
- if (this.cart[index].number <= 0) {
- this.cart.splice(index, 1)
- }
- },
- handleAddToCart(cate, good, num) { //添加到购物车
- const goodText = this.getGoodSelectedProps(this.good) // 购物车当前选中的规格
- const index = this.cart.findIndex(item => {
- // if (good.use_property) {
- // !good.props_text ? good.props_text = this.getGoodSelectedProps(good) : ''
- return (item.id === good.id) && (item.props_text === goodText)
- // } else {
- // return item.id === good.id
- // }
- })
- if (index > -1) {
- this.cart[index].number += num
- } else {
- this.cart.push({
- id: good.id,
- cate_id: cate.id,
- name: good.name,
- price: good.price,
- number: num,
- icon: good.icon,
- use_property: good.use_property || goodText,
- props_text: this.getGoodSelectedProps(this.good),
- props: this.getGoodSelectedProps(this.good, 'id'),
- productid: this.productObj[goodText].id,
- iconText: this.productObj[goodText].image,
- ...good
- })
- }
- console.log(this.cart, '购物车')
- },
- toPay() {
- // if(!this.isLogin) {
- // uni.navigateTo({url: '/pages/login/login'})
- // return
- // }
- uni.showLoading({
- title: '加载中'
- })
- let orderDetails = this.cart.map((item) => {
- return {
- attrValueId: item.productid, //商品规格属性id(立即购买、活动购买必填)
- groupBuyActivityId: null, //拼团活动id(拼团下单时必填)
- groupBuyRecordId: 0, // 拼团记录id,营销类型2=拼团 时必填 0=开团 实际
- productId: item.id, //商品id
- productNum: item.number //商品数量
- };
- });
- preOrderApi({
- "preOrderType": 'buyNow',
- //类型 预下单类型(“shoppingCart”:购物车下单,“buyNow”:
- // 立即购买,“video”: 视频号商品下单,“seckill”:秒杀下单,“group”:拼团下单)
- "orderDetails": orderDetails //购物车信息
- }).then(res => {
- console.log('预下单接口', res)
- if (res.code == 200) {
- // uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
- uni.navigateTo({
- // url: `/pages/goods/order_confirm/index?cartList=${cartList}`
- url: '/pages/goods/order_confirm/index?is_address=1&orderNo=' + res.data.orderNo +
- '&addressId=' + this.addressInfo.id
- })
- }
- }).catch(err => {
- uni.showToast({
- title: err,
- icon: 'none'
- })
- })
- uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
- uni.hideLoading()
- },
- // 选规格打开
- Selectpox(item, itemInfo) {
- this.specifications = itemInfo //这一项信息
- this.specificationsList = item //这一项信息
- this.good = {...itemInfo}
- this.good.category = item
- let that = this
- getProductDetail(
- itemInfo.id,
- 0, 0, ''
- ).then((res) => {
- console.log('规格', res)
- if (res.code == 200) {
- that.good.property = res.data.productAttr.map(item => {
- item.optionList.forEach((items, index) => {
- index === 0 ? items.is_default = true : '' // 规格默认选中
- })
- return { ...item
- }
- })
- console.log(that.good)
- // this.productValue = res.data.productAttr //规格数组
- that.productObj = res.data.productValue //默认选择的id
- that.selectble = true
- }
- })
- },
- // 关闭规格
- Close() {
- this.specifications = '' //这一项信息
- this.specificationsList = [] //这一项信息
- this.good = {}
- this.selectble = false
- },
- onTabChang(id) {
- if (this.tabindex === id) return
- this.tabindex = id
- if (id == 1) {
- this.getProductReplyList()
- this.getProductReplyCount()
- }
- },
- /**
- * 分页获取评论
- */
- getProductReplyList: function() {
- let that = this;
- if (that.loadend) return;
- if (that.loading) return;
- that.loading = true;
- that.loadTitle = '';
- getMerchantReply(that.merId, {
- page: that.page,
- limit: that.limit,
- type: that.type,
- }).then(res => {
- let list = res.data.list,
- loadend = list.length < that.limit;
- that.reply = that.$util.SplitArray(list, that.reply);
- that.$set(that, 'reply', that.reply);
- that.loading = false;
- that.loadend = loadend;
- if (that.reply.length) {
- that.loadTitle = loadend ? "??人家是有底线的~~" : "加载更多";
- }
- that.page = that.page + 1;
- }).catch(err => {
- that.loading = false,
- that.loadTitle = '加载更多'
- });
- },
- /*
- * 点击事件切换
- * */
- changeType: function(e) {
- let type = parseInt(e);
- if (type == this.type) return;
- this.type = type;
- this.page = 1;
- this.loadend = false;
- this.$set(this, 'reply', []);
- this.getProductReplyList();
- },
- /**
- * 获取评论统计数据
- *
- */
- getProductReplyCount: function() {
- let that = this;
- getMerchantReplyConfig(that.merId).then(res => {
- that.$set(that, 'replyData', res.data);
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- /* #ifdef H5 */
- page {
- min-height: 100%;
- }
- /* #endif */
- .bg-color {
- background-color: $bg-color-primary;
- }
- .care {
- color: #666666 !important;
- border: 1px solid #CCCCCC;
- background: inherit !important;
- }
- .order-nav {
- // height: 111rpx;
- position: relative;
- background-color: #FF6702;
- display: flex;
- align-items: center;
- justify-content: center;
- .back-button {
- position: absolute;
- left: 20rpx;
- }
- text {
- font-weight: 500;
- font-size: 35rpx;
- color: #FFFFFF;
- }
- }
- .container {
- display: flex;
- flex-direction: column;
- overflow: hidden;
- position: relative;
- }
- .loading {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- image {
- width: 260rpx;
- height: 260rpx;
- position: relative;
- margin-top: -200rpx;
- /* #ifdef h5 */
- margin-top: 0;
- /* #endif */
- }
- }
- .stores {
- width: 100%;
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- margin-bottom: -40rpx;
- .store {
- width: 100%;
- background-color: $bg-color-grey;
- padding: 20rpx;
- display: flex;
- align-items: center;
- margin-bottom: 20rpx;
- border-radius: 6rpx;
- .iconfont {
- font-size: 50rpx;
- margin-right: 15rpx;
- &.iconradio-button-off {
- color: $text-color-assist;
- }
- &.iconradio-button-on {
- color: $color-primary;
- }
- }
- .infos {
- flex: 1;
- display: flex;
- flex-direction: column;
- color: $text-color-base;
- overflow: hidden;
- .name_and_distance {
- width: 100%;
- display: flex;
- justify-content: space-between;
- margin-bottom: 10rpx;
- overflow: hidden;
- .name {
- flex: 1;
- flex-shrink: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: $font-size-lg;
- }
- .distance {
- flex-shrink: 0;
- font-size: $font-size-lg;
- font-weight: bold;
- margin-left: 20rpx;
- }
- }
- .street {
- color: $text-color-assist;
- font-size: $font-size-sm;
- }
- }
- }
- }
- .main {
- overflow: hidden;
- width: 100%;
- display: flex;
- flex-direction: column;
- }
- .nav {
- width: 100%;
- flex-shrink: 0;
- display: flex;
- flex-direction: column;
- border-radius: 23rpx;
- padding: 19rpx 45rpx 38rpx 45rpx;
- background-color: #ffffff;
- .header {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left {
- flex: 1;
- display: flex;
- flex-direction: column;
- .store-name {
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: $font-size-lg;
- margin-bottom: 10rpx;
- .iconfont {
- margin-left: 10rpx;
- line-height: 100%;
- }
- .icon-img {
- width: 40rpx;
- height: 40rpx;
- flex-shrink: 0;
- }
- }
- .store-tip {
- font-weight: 400;
- font-size: 21rpx;
- color: #858687;
- margin-top: 10rpx;
- background: #F8F9FB;
- border-radius: 4rpx;
- }
- }
- .right {
- background-color: $bg-color-grey;
- border-radius: 38rpx;
- display: flex;
- align-items: center;
- font-size: $font-size-sm;
- padding: 0 38rpx;
- color: $text-color-assist;
- .dinein,
- .takeout {
- position: relative;
- display: flex;
- align-items: center;
- &.active {
- padding: 14rpx 38rpx;
- color: #ffffff;
- background-color: $color-primary;
- border-radius: 38rpx;
- }
- }
- .takeout {
- margin-left: 20rpx;
- height: 100%;
- flex: 1;
- padding: 14rpx 0;
- }
- .dinein.active {
- margin-left: -38rpx;
- }
- .takeout.active {
- margin-right: -38rpx;
- }
- }
- }
- .coupon {
- flex: 1;
- width: 100%;
- background-color: $bg-color-primary;
- font-size: $font-size-base;
- color: $color-primary;
- padding: 0 20rpx;
- display: flex;
- align-items: center;
- overflow: hidden;
- .title {
- flex: 1;
- margin-left: 10rpx;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .iconfont {
- line-height: 100%;
- }
- }
- }
- .content {
- flex: 1;
- overflow: hidden;
- width: 100%;
- display: flex;
- border-radius: 23rpx 23rpx 0rpx 0rpx;
- .menus {
- width: 200rpx;
- height: 100%;
- overflow: hidden;
- background-color: $bg-color-grey;
- .wrapper {
- width: 100%;
- height: 100%;
- .menu {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- padding: 30rpx 20rpx;
- font-size: 26rpx;
- color: $text-color-assist;
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- &:nth-last-child(1) {
- margin-bottom: 230rpx;
- }
- &.current {
- background-color: #ffffff;
- color: $text-color-base;
- }
- .dot {
- position: absolute;
- width: 34rpx;
- height: 34rpx;
- line-height: 34rpx;
- font-size: 22rpx;
- background-color: $bg-color-primary;
- color: #ffffff;
- top: 16rpx;
- right: 10rpx;
- border-radius: 100%;
- text-align: center;
- }
- }
- }
- }
- .goods {
- flex: 1;
- height: 100%;
- overflow: hidden;
- background-color: #ffffff;
- .wrapper {
- width: 100%;
- height: 100%;
- padding: 20rpx;
- .ads {
- height: calc(300 / 550 * 510rpx);
- image {
- width: 100%;
- height: 100%;
- border-radius: 8rpx;
- }
- }
- .list {
- width: 100%;
- font-size: $font-size-base;
- padding-bottom: 800rpx;
- .category {
- width: 100%;
- .title {
- padding: 30rpx 0;
- display: flex;
- align-items: center;
- color: $text-color-base;
- .icon {
- width: 38rpx;
- height: 38rpx;
- margin-left: 10rpx;
- }
- }
- }
- .items {
- display: flex;
- flex-direction: column;
- padding-bottom: -30rpx;
- .good {
- display: flex;
- align-items: center;
- margin-bottom: 30rpx;
- .image {
- width: 160rpx;
- height: 160rpx;
- margin-right: 20rpx;
- border-radius: 8rpx;
- }
- .right {
- flex: 1;
- // height: 160rpx;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: space-between;
- padding-right: 14rpx;
- .name {
- font-size: $font-size-base;
- margin-bottom: 10rpx;
- }
- .tips {
- width: 100%;
- height: 40rpx;
- line-height: 40rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: $font-size-sm;
- color: $text-color-assist;
- margin-bottom: 10rpx;
- }
- .price_and_action {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .price {
- font-size: $font-size-base;
- font-weight: 600;
- color: $bg-color-primary;
- }
- .btn-group {
- display: flex;
- justify-content: space-between;
- align-items: center;
- position: relative;
- .btn {
- padding: 0 20rpx;
- box-sizing: border-box;
- font-size: $font-size-sm;
- height: 44rpx;
- line-height: 44rpx;
- &.property_btn {
- border-radius: 24rpx;
- }
- &.add_btn,
- &.reduce_btn {
- padding: 0;
- width: 44rpx;
- border-radius: 44rpx;
- }
- }
- .dot {
- position: absolute;
- background-color: #ffffff;
- border: 1px solid $bg-color-primary;
- color: $bg-color-primary;
- font-size: $font-size-sm;
- width: 36rpx;
- height: 36rpx;
- line-height: 36rpx;
- text-align: center;
- border-radius: 100%;
- right: -12rpx;
- top: -10rpx;
- }
- .number {
- width: 44rpx;
- height: 44rpx;
- line-height: 44rpx;
- text-align: center;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- .modal-box {
- max-height: 90vh;
- }
- .good-detail-modal {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- .cover {
- height: 320rpx;
- padding: 30rpx 0;
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- .image {
- width: 260rpx;
- height: 260rpx;
- }
- .btn-group {
- position: absolute;
- right: 10rpx;
- top: 30rpx;
- display: flex;
- align-items: center;
- justify-content: space-around;
- image {
- width: 80rpx;
- height: 80rpx;
- }
- }
- }
- .detail {
- width: 100%;
- min-height: 1vh;
- max-height: calc(90vh - 320rpx - 80rpx - 120rpx);
- .wrapper {
- width: 100%;
- height: 100%;
- overflow: hidden;
- .basic {
- padding: 0 20rpx 30rpx;
- display: flex;
- flex-direction: column;
- .name {
- font-size: $font-size-base;
- color: $text-color-base;
- margin-bottom: 10rpx;
- }
- .tips {
- font-size: $font-size-sm;
- color: $text-color-grey;
- }
- }
- .properties {
- width: 100%;
- border-top: 2rpx solid $bg-color-grey;
- padding: 10rpx 30rpx 0;
- display: flex;
- flex-direction: column;
- .property {
- width: 100%;
- display: flex;
- flex-direction: column;
- margin-bottom: 30rpx;
- padding-bottom: -16rpx;
- .title {
- width: 100%;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- margin-bottom: 20rpx;
- .name {
- font-size: 26rpx;
- color: $text-color-base;
- margin-right: 20rpx;
- }
- .desc {
- flex: 1;
- font-size: $font-size-sm;
- color: $color-primary;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .values {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- .value {
- border-radius: 8rpx;
- background-color: $bg-color-grey;
- padding: 16rpx 30rpx;
- font-size: 26rpx;
- color: $text-color-assist;
- margin-right: 16rpx;
- margin-bottom: 16rpx;
- &.default {
- background-color: $bg-color-primary;
- color: $text-color-white;
- }
- }
- }
- }
- }
- }
- }
- .action {
- display: flex;
- align-items: center;
- justify-content: space-between;
- background-color: $bg-color-grey;
- height: 120rpx;
- padding: 0 26rpx;
- .left {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- margin-right: 20rpx;
- overflow: hidden;
- .price {
- font-size: $font-size-lg;
- color: $text-color-base;
- }
- .props {
- color: $text-color-assist;
- font-size: 24rpx;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .btn-group {
- display: flex;
- align-items: center;
- justify-content: space-around;
- .number {
- font-size: $font-size-base;
- width: 44rpx;
- height: 44rpx;
- line-height: 44rpx;
- text-align: center;
- }
- .btn {
- padding: 0;
- font-size: $font-size-base;
- width: 44rpx;
- height: 44rpx;
- line-height: 44rpx;
- border-radius: 100%;
- }
- }
- }
- .add-to-cart-btn {
- display: flex;
- justify-content: center;
- align-items: center;
- background-color: $color-primary;
- color: $text-color-white;
- font-size: $font-size-base;
- height: 80rpx;
- border-radius: 0 0 12rpx 12rpx;
- }
- }
- .cart-box {
- // position: absolute;
- // bottom: 30rpx;
- // left: 30rpx;
- // right: 30rpx;
- height: 96rpx;
- border-radius: 48rpx;
- box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);
- background-color: #000;
- display: flex;
- align-items: center;
- justify-content: space-between;
- z-index: 9999;
- .cart-img {
- width: 50rpx;
- height: 47rpx;
- position: relative;
- // margin-top: -48rpx;
- }
- .pay-btn {
- height: 100%;
- padding: 0 30rpx;
- color: #FFFFFF;
- border-radius: 0 50rpx 50rpx 0;
- display: flex;
- align-items: center;
- font-size: $font-size-base;
- }
- .mark {
- padding-left: 46rpx;
- margin-right: 30rpx;
- position: relative;
- .tag {
- background-color: $color-warning;
- color: $text-color-white;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: $font-size-sm;
- position: absolute;
- right: -13rpx;
- top: -20rpx;
- border-radius: 100%;
- padding: 4rpx;
- width: 27rpx;
- height: 27rpx;
- opacity: .9;
- }
- }
- .price {
- flex: 1;
- color: $text-color-base;
- }
- }
- .cart-popup {
- .top {
- background-color: $bg-color-primary;
- color: $color-primary;
- padding: 10rpx 30rpx;
- font-size: 24rpx;
- text-align: right;
- }
- .cart-list {
- background-color: #FFFFFF;
- width: 100%;
- overflow: hidden;
- min-height: 1vh;
- max-height: 60vh;
- .wrapper {
- height: 100%;
- display: flex;
- flex-direction: column;
- padding: 0 30rpx;
- margin-bottom: 156rpx;
- .item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 30rpx 0;
- position: relative;
- &::after {
- content: ' ';
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- background-color: $border-color;
- height: 2rpx;
- transform: scaleY(.6);
- }
- .left {
- flex: 1;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- margin-right: 30rpx;
- .name {
- font-size: $font-size-sm;
- color: $text-color-base;
- }
- .props {
- color: $text-color-assist;
- font-size: 24rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .center {
- margin-right: 120rpx;
- font-size: $font-size-base;
- }
- .right {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .btn {
- width: 46rpx;
- height: 46rpx;
- border-radius: 100%;
- padding: 0;
- text-align: center;
- line-height: 46rpx;
- }
- .number {
- font-size: $font-size-base;
- width: 46rpx;
- height: 46rpx;
- text-align: center;
- line-height: 46rpx;
- }
- }
- }
- }
- }
- }
- .back-button {
- width: 30rpx;
- height: 30rpx;
- border-right: 4rpx solid #fff;
- border-bottom: 4rpx solid #fff;
- transform: rotate(135deg);
- margin-left: 10rpx;
- display: inline-block;
- position: relative;
- }
- .newsTitle {
- display: flex;
- align-items: center;
- }
- .mode {
- position: fixed;
- width: 100%;
- height: 100%;
- left: 0;
- top: 0;
- background: rgba(33, 33, 33, 0.8);
- z-index: 99999;
- display: flex;
- align-items: flex-end;
- }
- .mode-1 {
- width: 100%;
- height: 840rpx;
- background: #FFF;
- display: flex;
- flex-direction: column;
- gap: 20rpx;
- // padding: 30rpx;
- box-sizing: border-box;
- overflow: auto;
- /* 添加这个属性使容器可以滚动 */
- }
- // 规格弹窗
- .sel-mode-1 {
- width: 100%;
- // height: 440rpx;
- background: #FFF;
- display: flex;
- flex-direction: column;
- gap: 20rpx;
- box-sizing: border-box;
- overflow: auto;
- z-index: 99999;
- padding: 20rpx 20rpx 60rpx 20rpx;
- box-sizing: border-box;
- position: relative;
- }
- .close {
- text-align: right;
- font-size: 40rpx;
- }
- .sel-2 {
- display: flex;
- align-items: center;
- gap: 20rpx;
- .nexbox1 {
- flex: 1;
- text-overflow: ellipsis;
- white-space: nowrap;
- color: $text-color-assist;
- }
- }
- .sel-3 {
- display: flex;
- flex-direction: column;
- gap: 10rpx;
- }
- .sel-4 {
- display: flex;
- align-items: center;
- gap: 10rpx;
- }
- .sel-5 {
- width: 80rpx;
- height: 40rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 24rpx;
- background: #999999;
- color: #FFF;
- padding: 8rpx;
- border-radius: 8rpx;
- }
- .sel-6 {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .sel-btn {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- }
- .sel-btn1 {
- width: 110px;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background: rgba(255, 103, 2, 1);
- color: #FFF;
- font-size: 30rpx;
- border-radius: 10rpx;
- }
- .neximg {
- width: 160rpx;
- height: 160rpx;
- margin-right: 20rpx;
- border-radius: 8rpx;
- /* 保持图片等比例缩放,并且不会裁切 */
- }
- .btn-group {
- display: flex;
- justify-content: space-between;
- align-items: center;
- position: relative;
- .btn {
- padding: 0 20rpx;
- box-sizing: border-box;
- font-size: $font-size-sm;
- height: 44rpx;
- line-height: 44rpx;
- &.property_btn {
- border-radius: 24rpx;
- }
- &.add_btn,
- &.reduce_btn {
- padding: 0;
- width: 44rpx;
- border-radius: 44rpx;
- }
- }
- .dot {
- position: absolute;
- background-color: #ffffff;
- border: 1px solid $bg-color-primary;
- color: $bg-color-primary;
- font-size: $font-size-sm;
- width: 36rpx;
- height: 36rpx;
- line-height: 36rpx;
- text-align: center;
- border-radius: 100%;
- right: -12rpx;
- top: -10rpx;
- }
- .number {
- width: 44rpx;
- height: 44rpx;
- line-height: 44rpx;
- text-align: center;
- }
- }
- .nexbox-txt3 {
- color: $bg-color-primary;
- }
- .mode-box {
- width: 100%;
- display: flex;
- flex-direction: column;
- gap: 20rpx;
- padding: 30rpx;
- box-sizing: border-box;
- }
- .items {
- display: flex;
- flex-direction: column;
- padding-bottom: -30rpx;
- .good {
- display: flex;
- align-items: center;
- margin-bottom: 30rpx;
- .image {
- width: 160rpx;
- height: 160rpx;
- margin-right: 20rpx;
- border-radius: 8rpx;
- }
- .right {
- flex: 1;
- // height: 160rpx;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: space-between;
- padding-right: 14rpx;
- .name {
- font-size: $font-size-base;
- margin-bottom: 10rpx;
- }
- .tips {
- width: 100%;
- height: 40rpx;
- line-height: 40rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: $font-size-sm;
- color: $text-color-assist;
- margin-bottom: 10rpx;
- }
- .price_and_action {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .price {
- font-size: $font-size-base;
- font-weight: 600;
- color: $bg-color-primary;
- }
- .btn-group {
- display: flex;
- justify-content: space-between;
- align-items: center;
- position: relative;
- .btn {
- padding: 0 20rpx;
- box-sizing: border-box;
- font-size: $font-size-sm;
- height: 44rpx;
- line-height: 44rpx;
- &.property_btn {
- border-radius: 24rpx;
- }
- &.add_btn,
- &.reduce_btn {
- padding: 0;
- width: 44rpx;
- border-radius: 44rpx;
- }
- }
- .dot {
- position: absolute;
- background-color: #ffffff;
- border: 1px solid $bg-color-primary;
- color: $bg-color-primary;
- font-size: $font-size-sm;
- width: 36rpx;
- height: 36rpx;
- line-height: 36rpx;
- text-align: center;
- border-radius: 100%;
- right: -12rpx;
- top: -10rpx;
- }
- .number {
- width: 44rpx;
- height: 44rpx;
- line-height: 44rpx;
- text-align: center;
- }
- }
- }
- }
- }
- }
- .mode-clear {
- padding: 30rpx;
- box-sizing: border-box;
- position: sticky;
- z-index: 99;
- top: 0;
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: #FFF;
- border-bottom: 1px solid burlywood;
- }
- .mode-txt {
- display: flex;
- align-items: center;
- gap: 8rpx;
- }
- .mode-txt1 {
- font-weight: 500;
- font-size: 32rpx;
- }
- // 点菜评价切换
- .let-box {
- display: flex;
- align-items: center;
- gap: 60rpx;
- padding: 20rpx;
- box-sizing: border-box;
- }
- .let-box1 {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 10rpx;
- }
- .let-line {
- border-radius: 6rpx;
- width: 40rpx;
- height: 10rpx;
- }
- .let-txt {
- overflow-wrap: break-word;
- color: rgba(20, 20, 20, 1);
- font-size: 28rpx;
- font-weight: normal;
- text-align: left;
- white-space: nowrap;
- line-height: 40rpx;
- }
- .actave {
- background-color: rgba(255, 103, 2, 1);
- }
- .actave1 {
- color: rgba(255, 103, 2, 1);
- }
- .font_color {
- color: $bg-color-primary;
- }
- .evaluate-list {
- padding: 30rpx 0 0 0;
- background-color: #fff;
- }
- .evaluate-list .nav-tab1 {
- font-size: 24rpx;
- color: #282828;
- padding: 30rpx;
- background-color: #fff;
- border-bottom: 1rpx solid #f5f5f5;
- }
- .evaluate-list .generalComment {
- padding: 0 30rpx;
- margin-top: 1rpx;
- background-color: #fff;
- font-size: 28rpx;
- color: #808080;
- }
- .evaluate-list .generalComment .evaluate {
- margin-right: 7rpx;
- color: #333333;
- font-size: 28rpx;
- }
- .evaluate-list .nav-tab1 .item {
- font-size: 24rpx;
- color: #282828;
- border-radius: 27rpx;
- height: 54rpx;
- padding: 0 20rpx;
- background-color: #f4f4f4;
- line-height: 54rpx;
- margin-right: 17rpx;
- }
- .evaluate-list .nav-tab1 .item.bg-color {
- color: #fff;
- background-color: $bg-color-primary;
- }
- .noCommodity {
- margin-top: 32%;
- }
- .default_txt {
- font-size: 26rpx;
- color: #999;
- text-align: center;
- }
-
- .swiper {
- display: flex;
- /* 使用flex布局 */
- animation: scrollRight 10s linear infinite;
- /* 应用动画 */
- }
-
- .swiper-item {
- flex-shrink: 0;
- /* 不允许缩小 */
- width: 100%;
- /* 每个item占满一行 */
- }
-
- @keyframes scrollRight {
- from {
- transform: translateX(100%);
- }
-
- /* 从右向左移动 */
- to {
- transform: translateX(-100%);
- }
-
- /* 移出视图 */
- }
- </style>
|