12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193 |
- <template>
- <view class="container" :style="{ height: winHeight+ 'px' }">
- <!-- 状态栏高度 -->
- <view :style="{ height: `${statusBarHeight}px` }"></view>
- <!-- 导航栏 -->
- <view :style="{ height: `${navigationBarHeight}rpx`,lineHeight: `${navigationBarHeight}rpx`}" class="order-nav">
- <view class="back-button" @tap="handBack()"></view>
- <text>{{merchanInfo.name}}</text>
- </view>
- <view class="main">
- <view class="nav">
- <view class="header">
- <view class="left">
- <view class="store-name">
- <text style="font-weight: 600;font-size: 35rpx;color: #141414;">{{ merchanInfo.name }}</text>
- <view class="iconfont iconarrow-right"></view>
- </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 class="store-addr">
- <text style="font-size: 23rpx;color: #141414;">商家地址:{{ merchanInfo.addressDetail }}</text>
- </view>
- <view class="store-tip" style="padding: 10rpx 30rpx 10rpx 15px ;height: 48rpx;">
- <swiper :indicator-dots="false" :autoplay="true" interval="2500" :duration="500" vertical="true" circular="true">
- <block v-for="(item,index) in merchanInfo.headline" :key='index'>
- <swiper-item catchtouchmove='catchTouchMove'>
- <view class='text acea-row row-between-wrapper'>
- <view class='newsTitle'>
- <text class='iconfont icon-laba ' style="font-size: 24rpx;margin-right: 10rpx;"></text>
- <text>{{item.title}}</text>
- </view>
- </view>
- </swiper-item>
- </block>
- </swiper>
- </view>
- </view>
- </view>
- </view>
- <view style="width: 100%;height: 10rpx; background-color: #F8F9FD;"></view>
- </view>
- <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)">
- <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}`">
- <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.image" class="image" @tap="console.log('点击图片')"></image>
- <view class="right">
- <text class="name">{{ good.name }}</text>
- <text class="tips">{{ good.content }}</text>
- <view class="price_and_action">
- <text class="price">¥{{ good.otPrice }}</text>
- <view class="btn-group" v-if="good.use_property">
- <button type="primary" class="btn property_btn bg-color" hover-class="none" size="mini" @tap="console.log('选规格')">
- 选规格
- </button>
- <view class="dot" v-show="goodCartNum(good.id)">{{ goodCartNum(good.id) }}</view>
- </view>
- <view class="btn-group" v-else>
- <button type="default" v-show="goodCartNum(good.id)" 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.id)">{{ goodCartNum(good.id) }}</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>
- <!-- category end -->
- </view>
- </view>
- </scroll-view>
- <!-- goods list end -->
- </view>
- <!-- content end -->
- <!-- 购物车栏 begin -->
- <view class="cart-box" style="bottom: 77rpx">
- <view class="mark">
- <image src="/static/img/ic-security-settings.png" class="cart-img" @tap=""></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>
- </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
- } from '@/api/merchant.js';
- let app = getApp();
- var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'rpx';
- export default {
- data() {
- return {
- merId: 0,
- winHeight: 0,
- merchanInfo: {},
- statusBarHeight: app.globalData.statusBarHeight,
- navigationBarHeight: 112,
- goods: [], //所有商品
- loading: true,
- currentCateId: 1, //默认分类
- cateScrollTop: 0,
- lastScrollTop: 0,
- menuScrollIntoView: '',
- cart: [], //购物车
- goodDetailModalVisible: false, //是否饮品详情模态框
- good: {}, //当前饮品
- category: {}, //当前饮品所在分类
- cartPopupVisible: false,
- sizeCalcState: false,
- orderType: 'takeout',
- store: {
- min_price: 8
- }
- }
- },
- onLoad(options) {
- let that = this;
- uni.getSystemInfo({
- success: function(res) {
- that.winHeight = res.windowHeight
- },
- });
- this.merId = uni.getStorageSync('merId')
- //首页数据加载
- // 获取商家信息
- getMerchantInfo(this.merId).then(res => {
- this.merchanInfo = res.data
- });
- // 获取商品列表
- 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.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() { //计算单个饮品添加到购物车的数量
- return (id) => this.cart.reduce((acc, cur) => {
- if (cur.id === 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: {
- 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
- }
- },
- handleFoot($event) {
- const nextItems = this.findNextAll(this.goods, item => item.id === this.currentCateId);
- if (nextItems.id) {
- this.currentCateId = nextItems.id
- }
- },
- findNextAll(arr, condition) {
- const index = arr.findIndex(condition);
- if (index !== -1) {
- return arr[index + 1] || {}; // 返回符合条件之后的记录
- }
- return {}; // 如果没有找到符合条件的记录,返回空对象
- },
- 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,
- number: 1
- }))
- 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
- },
- 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(({
- values
- }) => {
- values.forEach(value => {
- if (value.is_default) {
- props.push(type === 'text' ? value.value : value.id)
- }
- })
- })
- return type === 'text' ? props.join(',') : props
- }
- return ''
- },
- handleReduceFromCart(item, good) {
- const index = this.cart.findIndex(item => item.id === good.id)
- this.cart[index].number -= 1
- if (this.cart[index].number <= 0) {
- this.cart.splice(index, 1)
- }
- },
- handleAddToCart(cate, good, num) { //添加到购物车
- const index = this.cart.findIndex(item => {
- if (good.use_property) {
- return (item.id === good.id) && (item.props_text === good.props_text)
- } 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,
- image: good.images,
- use_property: good.use_property,
- props_text: good.props_text,
- props: good.props
- })
- }
- },
- toPay() {
- // if(!this.isLogin) {
- // uni.navigateTo({url: '/pages/login/login'})
- // return
- // }
- uni.showLoading({
- title: '加载中'
- })
- uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
- uni.navigateTo({
- url: '/pages/goods/order_confirm/index'
- })
- uni.hideLoading()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- /* #ifdef H5 */
- page {
- min-height: 100%;
- }
- /* #endif */
- .bg-color {
- background-color: $bg-color-primary;
- }
- .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 57rpx 38rpx 58rpx;
- 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: flex-start;
- align-items: center;
- font-size: $font-size-lg;
- margin-bottom: 10rpx;
- .iconfont {
- margin-left: 10rpx;
- line-height: 100%;
- }
- }
- .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;
- }
- .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: $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;
- }
- </style>
|