12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307 |
- <template>
- <view class="container">
- <view class="carousel">
- <swiper indicator-dots :circular="true" duration="400">
- <swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="index">
- <view class="image-wrapper"><image :src="item" class="loaded" mode="aspectFill"></image></view>
- </swiper-item>
- </swiper>
- </view>
- <view class="introduce-section seckill-box-title" v-if="goodsType == 1">
- <view class="title flex">
- <view class="title-box">
- <text class="price-tip">¥</text>
- <text class="price">{{ goodsObjact.price }}</text>
- {{ goodsObjact.ot_price }}
-
- </view>
- <view class="flex timeStop">
- <view>距离结束</view>
- <uni-countdown
- color="#ffffff"
- background-color="#D65B3F"
- splitor-color="#FFFFFF"
- :show-day="false"
- :hour="seckillObj.stopTimeH"
- :minute="seckillObj.stopTimeM"
- :second="seckillObj.stopTimeS"
- ></uni-countdown>
- </view>
- </view>
- </view>
- <view class="introduce-section">
- <text class="title" v-if="goodsType == 1">{{ goodsObjact.title }}</text>
- <view class="price-box" v-if="goodsType == 0">
- <text class="price-tip">¥</text>
- <text class="price">{{ goodsObjact.price }}</text>
- <text class="price-tip" v-if="goodsObjact.max_use_integral * 1 > 0">+</text>
- <text class="price" v-if="goodsObjact.max_use_integral * 1 > 0">{{ goodsObjact.max_use_integral }}积分</text>
- <text class="m-price" v-if="goodsObjact.ot_price > goodsObjact.price">¥{{ goodsObjact.ot_price }}</text>
-
- </view>
- <text class="title" v-if="goodsType == 0">{{ goodsObjact.store_name }}</text>
- <view class="bot-row">
- <text>快递: {{ goodsObjact.postage }}</text>
- <text style="text-align: center;">销量: {{ goodsObjact.sales }}</text>
- <text style="text-align: right;">{{ storeObjact.address | address }}</text>
- </view>
- </view>
-
- <view class="eva-section" v-if="reply" @click="navTo('/pages/product/reply?id=' + goodsid)">
- <view class="e-header">
- <text class="tit">评价</text>
- <text>({{ details.replyCount }})</text>
- <text class="tip">好评率 {{ details.replyChance }}%</text>
- <text class="iconfont iconenter"></text>
- </view>
- <view class="eva-box">
- <image class="portrait" :src="reply.avatar" mode="aspectFill"></image>
- <view class="right">
- <text class="name">{{ reply.nickname }}</text>
- <text class="con">{{ reply.comment }}</text>
- <view class="con_box">
- <view class="con_image" v-for="item in reply.pics"><image :src="item"></image></view>
- </view>
- <view class="bot">
- <text class="attr"></text>
- <text class="time">{{ reply.add_time }}</text>
- </view>
- </view>
- </view>
- <view class="eva-boxs" v-if="reply.merchant_reply_content">
- <view class="right">
- <text class="con">
- <text style="color: #FD5B23;margin-right: 8rpx;">商家回复 :</text>
- {{ reply.merchant_reply_content }}
- </text>
- <view class="bot">
- <text class="attr"></text>
- <text class="time">{{ reply.merchant_reply_time }}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="c-list">
- <view class="c-row b-b" @click="toggleSpec">
- <text class="tit">购买数量</text>
- <view class="con">
- <text class="selected-text">{{ goodsNumber }}</text>
- </view>
- <text class="iconfont iconenter"></text>
- </view>
- <view class="c-row b-b" v-if="goodsType == 1">
- <text class="tit">限购数量</text>
- <view class="con">
- <text class="selected-text">{{ goodsObjact.num + goodsObjact.unit_name }}</text>
- </view>
- </view>
- <view class="c-row b-b" v-if="goodsObjact.give_integral != 0">
- <text class="tit">获取积分</text>
- <text class="con t-r red">每购买一件商品送{{ goodsObjact.give_integral }}积分</text>
-
- </view>
- </view>
- <view class="shop-box flex" v-if="goodsType == 0 && shopId > 0">
- <view class="flex">
- <image :src="shopInfo.logo" mode=" aspectFit" class="shop-img"></image>
- <text class="font-size-lg">{{ shopInfo.title }}</text>
- </view>
- <navigator :url="'/pages/shoping/index?merid=' + shopId"><view class="shop-button">进店逛逛</view></navigator>
- </view>
- <view class="detail-desc">
-
- {{ goodsObjact.description }}
- <rich-text :nodes="goodsObjact.description"></rich-text>
-
- </view>
-
- <view class="page-bottom" v-if="goodsType == 0">
-
- <view class="p-b-btn" :class="{ active: goodsObjact.userCollect }" @click="toFavorite(goodsObjact)">
- <text class="iconfont " :class="{ iconlike: !goodsObjact.userCollect, iconlikefill: goodsObjact.userCollect }"></text>
- <text>收藏</text>
- </view>
- <view class="action-btn-group" v-if="goodsObjact.max_use_integral == 0">
- <button type="primary" class=" action-btn no-border buy-now-btn" @click="toggleSpec(2)">加入购物车</button>
- <button type="primary" class=" action-btn no-border add-cart-btn" @click="toggleSpec(1)">立即购买</button>
- </view>
- <view class="action-btn-group" v-if="goodsObjact.max_use_integral != 0">
- <button type="primary" class=" action-btn no-border add-cart-btn" style="width: 750rpx;" @click="toggleSpec(1)">立即购买</button>
- </view>
- </view>
-
- <view class="goods-pay-box flex" :class="{ stop: seckillObj.stop }" v-if="goodsType == 1">
- <view class="goods-pay bgLine" v-if="!seckillObj.stop" @click="toggleSpec(1)"><text>立即购买</text></view>
- <view class="goods-pay-stop" v-else>活动已结束</view>
- </view>
-
- <view class="goods-pay-box flex" v-if="goodsType == 2">
- <view class="goods-pay bg-warning" @click="navToProductGoods">
- <view class="goods-buttom-money">¥{{ goodsObjact.product_price }}</view>
- <view class="goods-buttom">单独购买</view>
- </view>
- <view class="goods-pay bg-danger" @click="toggleSpec(1)">
- <view class="goods-buttom-money">¥{{ goodsObjact.price }}</view>
- <view class="goods-buttom">我要拼团</view>
- </view>
- </view>
-
- <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
-
- <view class="mask"></view>
- <view class="layer attr-content" @click.stop="stopPrevent">
- <view class="a-t">
- <image :src="actionImage"></image>
- <view class="right">
- <view class="good-name clamp">{{ goodsObjact.store_name }}</view>
- <text class="price" v-if="goodsObjact.max_use_integral > 0">¥{{ actionPrice }}+{{ goodsObjact.max_use_integral * 1 }}积分</text>
- <text class="price" v-else>¥{{ actionPrice }}</text>
- {{ goodsObjact.stock }}
-
- {{ sItem }}
- </view>
- </view>
- <view v-for="(item, index) in specList" :key="index" class="attr-list">
- <text>{{ item.attr_name }}</text>
- <view class="item-list">
- <text
- v-for="(childItem, childIndex) in item.attr_value"
- :key="childIndex"
- class="tit"
- :class="{ selected: childItem.check }"
- @click="selectSpec(childItem, item, index)"
- >
- {{ childItem.attr }}
- </text>
- </view>
- </view>
- <view class="attr-list">
- <text>购买数量</text>
- <view class="item-list">
- <uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
- </view>
- </view>
- <button class="btn" @click.stop="buy">完成</button>
- </view>
- </view>
- <view :class="{ seckillBottom: goodsType == 1, goodsBottom: goodsType == 0 }"></view>
-
-
- </view>
- </template>
- <script>
- import share from '@/components/share';
- import uniNumberBox from '@/components/uni-number-box.vue';
- import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
- import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods } from '@/api/product.js';
- import { getShoping } from '@/api/shoping.js';
- import { mapState } from 'vuex';
- import { weixindata, weixinlocation, shareLoad } from '@/utils/wxAuthorized';
- export default {
- components: {
- share,
- uniNumberBox,
- uniCountdown
- },
- filters: {
- address(val) {
- let str = '';
- if (val) {
- str = val[0] + ' ' + val[1];
- }
- return str;
- }
- },
- data() {
- return {
- paying: false,
- details: '',
- reply: '',
- type: 1,
- goodsNumber: 1,
- goodsid: '',
- specClass: 'none',
- shareList: [],
- goodsObjact: {},
- storeObjact: {},
-
- imgList: [],
- specList: [],
-
- productValue: [],
- actionPrice: 0,
- actionIntegral: 0,
- actionImage: '',
- uniqueId: '',
- specSelected: [],
- specSelectedName: '',
- goodsNumberMax: 0,
- shopId: '',
-
- shopInfo: {
- logo: '',
- title: ''
- },
- goodsType: 0,
-
- seckillObj: {
- stopTime: 0,
- stop: false,
- stopTimeH: 0,
- stopTimeM: 0,
- stopTimeS: 0
- },
-
- pink: {
- id: '',
- uid: '',
- people: '',
- price: '',
- stop_time: '',
- nickname: '',
- avatar: '',
- count: '',
- h: '',
- i: '',
- s: ''
- }
- };
- },
- async onLoad(options) {
- let obj = this;
-
- this.goodsid = options.id;
-
- if (options.spread) {
-
- uni.setStorageSync('spread', options.spread);
- }
-
- if (options.type == 1) {
-
- this.goodsType = 1;
-
- this.seckillObj.stopTime = options.stoptime;
-
- let stoptime = options.stoptime * 1000;
-
- let acitonTime = new Date();
-
- if (acitonTime.getTime() > stoptime) {
-
- this.seckillObj.stop = true;
- } else {
-
- this.timeComputed(stoptime, this.seckillObj);
- }
- this.seckillGoods();
- return;
- }
- if (options.type == 2) {
-
- this.goodsType = 2;
-
- this.groupGoods();
- return;
- }
- if (this.goodsType == 0) {
-
- this.goodsDetail();
- }
- },
- computed: {
-
- ...mapState(['weichatObj', 'baseURL', 'urlFile']),
- ...mapState('user', ['userInfo'])
-
- },
- methods: {
-
-
- IndexShare() {
- let obj = this;
-
-
- let pages = getCurrentPages();
- let currentPage = pages[pages.length - 1];
- let url = '/' + currentPage.route;
- let item = currentPage.options;
- let shareObj = {
- title: obj.goodsObjact.store_name,
- link: obj.baseURL + url + '?id=' + item.id + '&spread=' + obj.userInfo.uid,
- desc: obj.goodsObjact.store_name + ' 价格:' + obj.goodsObjact.price,
- imgUrl: obj.goodsObjact.image,
- success: function(res) {
-
- if (res.errMsg == 'shareAppMessage:ok') {
- }
- },
- fail: function() {
-
- if (res.errMsg == 'shareAppMessage:fail cancel') {
-
- } else if (res.errMsg == 'shareAppMessage:fail') {
-
- }
- }
- };
- console.log(shareObj, '8888888888888888888');
- shareLoad(shareObj);
- },
-
- navTo(url) {
- uni.navigateTo({
- url
- });
- },
-
- getShoping() {
- let obj = this;
- getShoping({
- mer_id: this.shopId
- })
- .then(function({ data }) {
- console.log(data);
- obj.shopInfo = data;
- })
- .catch(e => {
- console.log(e);
- });
- },
-
- moneyNum: function(value) {
- return +value;
- },
- navToProductGoods() {
- uni.redirectTo({
- url: '/pages/product/product?id=' + this.goodsObjact.product_id
- });
- },
-
- groupGoods() {
- let obj = this;
- groupGoods({}, this.goodsid).then(function({ data }) {
- obj.pink = data.pink[0];
- let goods = data.storeInfo;
- obj.goodsObjact = goods;
- console.log(goods, '123456');
- obj.imgList = goods.images;
- obj.specList = data.productAttr;
- obj.productValue = data.productValue;
- obj.actionPrice = goods.price;
- obj.actionImage = goods.image_base;
- obj.goodsNumberMax = 1;
- obj.shopId = data.mer_id;
- if (obj.shopId > 0) {
- obj.getShoping();
- }
-
- obj.shareDate();
-
- });
- },
-
- seckillGoods() {
- let obj = this;
- seckillGoods({}, this.goodsid).then(function({ data }) {
- let goods = data.storeInfo;
- obj.goodsObjact = goods;
- obj.imgList = goods.images;
- obj.specList = data.productAttr;
- obj.productValue = data.productValue;
- obj.actionPrice = goods.price;
- obj.actionImage = goods.image_base;
- obj.goodsNumberMax = goods.num;
- obj.shopId = data.mer_id;
- if (obj.shopId > 0) {
- obj.getShoping();
- }
-
- obj.shareDate();
-
- });
- },
-
- timeComputed(da, ar) {
- let obj = ar;
-
- let time = new Date(da);
-
- let actTime = new Date();
-
- let tH = time.getHours();
- let tM = time.getMinutes();
- let tS = time.getSeconds();
-
- let aH = actTime.getHours();
- let aM = actTime.getMinutes();
- let aS = actTime.getSeconds();
-
- obj.stopTimeH = tH - aH;
- obj.stopTimeM = tM - aM;
- obj.stopTimeS = tS - aS;
- },
-
- goodsDetail() {
- let obj = this;
- goodsDetail({}, this.goodsid).then(function({ data }) {
- obj.details = data;
- let goods = data.storeInfo;
- let store_info = data.system_store;
- console.log(store_info);
- obj.storeObjact = store_info;
- obj.goodsObjact = goods;
-
- if (obj.goodsObjact.description != null) {
- obj.goodsObjact.description = obj.goodsObjact.description.replace(/<img/g, '<img class="rich-img"').replace(/<p>\s*<img/g, '<p class="pHeight"><img');
- }
- if (obj.goodsObjact.rule != null) {
- obj.goodsObjact.rule = '<p>' + obj.goodsObjact.rule.replace(/\n/g, '</p><p>').trim() + '</p>';
- }
- obj.reply = data.reply;
- obj.imgList = goods.slider_image;
- obj.specList = data.productAttr;
- console.log(data.productAttr);
- obj.productValue = data.productValue;
- obj.actionPrice = goods.price;
- obj.actionIntegral = goods.integral;
- obj.actionImage = goods.image_base;
- obj.goodsNumberMax = goods.stock;
- obj.shopId = data.mer_id;
-
- obj.specSelected = [];
- for (let i = 0; i < obj.specList.length; i++) {
-
- let attrValue = obj.specList[i].attr_value[0];
- attrValue.check = true;
- obj.specSelected.push(attrValue.attr);
- }
-
- let str = obj.specSelected.join(',');
-
- obj.actionImage = obj.productValue[str].image;
- obj.uniqueId = obj.productValue[str].unique;
-
- obj.shareDate();
-
- });
- },
-
-
- shareDate() {
- let obj = this;
-
- let url = window.location.href + '&spread=' + this.userInfo.uid;
-
- let bool = uni.getStorageSync('weichatBrowser') || '';
- if (bool) {
-
- url = url.replace(/[\?,&]from=singlemessage/g, '');
- let data = {
- link: url,
- imgUrl: obj.goodsObjact.image,
- desc: obj.goodsObjact.store_info,
- title: obj.goodsObjact.store_name,
- success: function(e) {
- console.log(e);
- }
- };
- weixindata(data);
- }
- },
-
-
- numberChange(e) {
- this.goodsNumber = e.number;
- },
-
- toggleSpec(str) {
- if (this.specClass === 'show') {
- this.specClass = 'hide';
- setTimeout(() => {
- this.specClass = 'none';
- }, 250);
- } else if (this.specClass === 'none') {
- this.specClass = 'show';
- }
-
- this.type = str;
- },
-
- selectSpec(item, arr, ind) {
- arr.attr_value.forEach(function(e) {
- e.check = false;
- });
- item.check = true;
- this.specSelected[ind] = item.attr;
- let str = this.specSelected.join(',');
- this.specSelectedName = this.specSelected.join(' ');
- if (this.productValue[str]) {
- let data = this.productValue[str];
- this.actionPrice = data.price;
- this.goodsNumberMax = data.stock;
- this.actionIntegral = data.integral;
- this.actionImage = data.image;
- this.uniqueId = data.unique;
- }
- },
-
- share() {
- this.$refs.share.toggleMask();
- },
-
- toFavorite(item) {
- let obj = this;
- item.userCollect = !item.userCollect;
- if (!item.userCollect) {
- collectDel({ id: obj.goodsid, category: 'product' }).then(function(e) {
- uni.showToast({
- title: '成功取消收藏',
- type: 'top',
- duration: 1500
- });
- });
- } else {
- collectAdd({ id: obj.goodsid, category: 'product' }).then(function(e) {
- uni.showToast({
- title: '成功加入收藏',
- type: 'top',
- duration: 1500
- });
- });
- }
- },
-
- buy() {
- let obj = this;
- let data = {
- cartNum: obj.goodsNumber,
- uniqueId: obj.uniqueId,
- new: '1',
- mer_id: obj.shopId,
- is_consumer: 0
-
- };
- if (obj.paying) {
- return;
- }
- obj.paying = true;
- if (obj.type == 2) {
- data.new = 0;
- }
- if (obj.goodsType == 0) {
- data.productId = obj.goodsid;
- }
-
- if (obj.goodsType == 1) {
- data.secKillId = obj.goodsid;
- data.productId = obj.goodsObjact.product_id;
-
- if (obj.seckillObj.stop) {
- uni.showModal({
- title: '提示',
- content: '当前活动已经结束',
- showCancel: false
- });
- return;
- }
- }
-
- if (obj.goodsType == 2) {
- data.combinationId = obj.goodsid;
- data.productId = obj.goodsObjact.product_id;
- }
- cartAdd(data)
- .then(function({ data }) {
- obj.paying = false;
- if (obj.type == 1) {
-
- uni.navigateTo({
- url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType
- });
- }
- if (obj.type == 2) {
- uni.showToast({
- title: '成功加入购物车',
- type: 'top',
- duration: 2000
- });
- obj.toggleSpec();
- }
- })
- .catch(e => {
- obj.paying = false;
- console.log(e);
- });
- },
- stopPrevent() {}
- }
- };
- </script>
- <style lang="scss">
- page {
- background: $page-color-base;
- }
- //秒杀底部高度
- .seckillBottom {
- height: 110rpx;
- }
- // 文章页底部高度撑开
- .contentBottomHeight {
- height: 110rpx;
- }
- //默认商品底部高度
- .goodsBottom {
- height: 160rpx;
- }
- .iconenter {
- font-size: $font-base + 2rpx;
- color: #888;
- }
- .carousel {
- /* #ifdef APP-PLUS */
- padding-top: var(--status-bar-height);
- /* #endif */
- height: 722rpx;
- position: relative;
- swiper {
- height: 100%;
- }
- .image-wrapper {
- width: 100%;
- height: 100%;
- }
- .swiper-item {
- display: flex;
- justify-content: center;
- align-content: center;
- // height: 750rpx;
- height: 710rpx;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- // 秒杀
- .seckill-box-title {
- background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%) !important;
- .price,
- .price-tip,
- .timeStop,
- .m-price {
- color: #ffffff !important;
- }
- .price-tip {
- font-size: $font-base;
- }
- .price {
- font-size: 45rpx !important;
- font-weight: bold;
- }
- .timeStop {
- }
- }
- // 底部拼团、秒杀支付按钮
- .goods-pay-box {
- position: fixed;
- left: 0;
- bottom: 0;
- z-index: 95;
- width: 750rpx;
- height: 100rpx;
- line-height: 1;
- color: #ffffff;
- text-align: center;
- font-size: $font-lg;
- .bgLine {
- background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%);
- }
- // 拼团支付按钮
- .goods-pay {
- display: flex;
- align-content: center;
- flex-wrap: wrap;
- justify-content: center;
- .goods-buttom,
- .goods-buttom-money {
- width: 100%;
- }
- .goods-buttom-money {
- font-size: $font-base;
- }
- }
- .goods-pay-stop,
- .goods-pay {
- padding: 15rpx 0;
- height: 100%;
- width: 100%;
- }
- .goods-pay-stop {
- background: $color-gray;
- line-height: 70rpx;
- }
- }
- /* 标题简介 */
- .introduce-section {
- background: #fff;
- padding: 20rpx 30rpx;
- .title {
- font-size: 32rpx;
- color: $font-color-dark;
- height: 50rpx;
- line-height: 50rpx;
- }
- .price-box {
- display: flex;
- align-items: baseline;
- height: 64rpx;
- padding: 10rpx 0;
- font-size: 26rpx;
- color: $uni-color-primary;
- }
- .price {
- font-size: $font-lg + 2rpx;
- }
- .m-price {
- margin: 0 12rpx;
- color: $font-color-light;
- text-decoration: line-through;
- }
- .coupon-tip {
- align-items: center;
- padding: 4rpx 10rpx;
- background: $uni-color-primary;
- font-size: $font-sm;
- color: #fff;
- border-radius: 6rpx;
- line-height: 1;
- transform: translateY(-4rpx);
- }
- .bot-row {
- display: flex;
- align-items: center;
- height: 50rpx;
- font-size: $font-sm;
- color: $font-color-light;
- text {
- flex: 1;
- }
- }
- }
- /* 分享 */
- .share-section {
- display: flex;
- align-items: center;
- color: $font-color-base;
- background: linear-gradient(left, #fdf5f6, #fbebf6);
- padding: 12rpx 30rpx;
- .share-icon {
- display: flex;
- align-items: center;
- width: 70rpx;
- height: 30rpx;
- line-height: 1;
- border: 1px solid $uni-color-primary;
- border-radius: 4rpx;
- position: relative;
- overflow: hidden;
- font-size: 22rpx;
- color: $uni-color-primary;
- &:after {
- content: '';
- width: 50rpx;
- height: 50rpx;
- border-radius: 50%;
- left: -20rpx;
- top: -12rpx;
- position: absolute;
- background: $uni-color-primary;
- }
- }
- .iconfavorfill {
- position: relative;
- z-index: 1;
- font-size: 24rpx;
- margin-left: 2rpx;
- margin-right: 10rpx;
- color: #fff;
- line-height: 1;
- }
- .tit {
- font-size: $font-base;
- margin-left: 10rpx;
- }
- .iconprompt {
- padding: 10rpx;
- font-size: 30rpx;
- line-height: 1;
- }
- .share-btn {
- flex: 1;
- text-align: right;
- font-size: $font-sm;
- color: $uni-color-primary;
- }
- .iconenter {
- font-size: $font-sm;
- margin-left: 4rpx;
- color: $uni-color-primary;
- }
- }
- .c-list {
- margin-top: 20rpx;
- font-size: $font-sm + 2rpx;
- color: $font-color-base;
- background: #fff;
- .c-row {
- display: flex;
- align-items: center;
- padding: 20rpx 30rpx;
- position: relative;
- }
- .tit {
- width: 140rpx;
- }
- .con {
- flex: 1;
- color: $font-color-dark;
- .selected-text {
- margin-right: 10rpx;
- }
- }
- .bz-list {
- height: 40rpx;
- font-size: $font-sm + 2rpx;
- color: $font-color-dark;
- text {
- display: inline-block;
- margin-right: 30rpx;
- }
- }
- .con-list {
- flex: 1;
- display: flex;
- flex-direction: column;
- color: $font-color-dark;
- line-height: 40rpx;
- }
- .red {
- color: $uni-color-primary;
- }
- }
- /* 评价 */
- .eva-section {
- display: flex;
- flex-direction: column;
- padding: 20rpx 30rpx;
- background: #fff;
- margin-top: 16rpx;
- .e-header {
- display: flex;
- align-items: center;
- height: 70rpx;
- font-size: $font-sm + 2rpx;
- color: $font-color-light;
- .tit {
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- margin-right: 4rpx;
- }
- .tip {
- flex: 1;
- text-align: right;
- }
- .iconenter {
- margin-left: 10rpx;
- }
- }
- }
- .eva-box {
- display: flex;
- padding: 20rpx 0;
- .portrait {
- flex-shrink: 0;
- width: 80rpx;
- height: 80rpx;
- border-radius: 100px;
- }
- .right {
- flex: 1;
- display: flex;
- flex-direction: column;
- font-size: $font-base;
- color: $font-color-base;
- padding-left: 26rpx;
- .con {
- font-size: $font-base;
- color: $font-color-dark;
- padding: 20rpx 0;
- }
- .bot {
- display: flex;
- justify-content: space-between;
- font-size: $font-sm;
- color: $font-color-light;
- }
- }
- }
- .eva-boxs {
- width: 100%;
- overflow: hidden;
- padding: 10px 28rpx;
- background: #f4f4f4;
- border-radius: 12rpx;
- font-size: $font-sm + 2rpx;
- color: #333;
- .portrait {
- flex-shrink: 0;
- width: 80rpx;
- height: 80rpx;
- border-radius: 100px;
- }
- .right {
- flex: 1;
- display: flex;
- flex-direction: column;
- font-size: $font-base;
- color: $font-color-base;
- .con {
- font-size: $font-base;
- color: $font-color-dark;
- }
- .bot {
- display: flex;
- justify-content: space-between;
- font-size: $font-sm;
- color: $font-color-light;
- }
- }
- }
- /* 详情 */
- .detail-desc {
- background: #fff;
- margin-top: 16rpx;
- /deep/ img {
- max-width: 100% !important;
- display: inline !important;
- }
- /deep/ div {
- max-width: 100% !important;
- }
- .d-header {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 80rpx;
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- position: relative;
- text {
- padding: 0 20rpx;
- background: #fff;
- position: relative;
- z-index: 1;
- }
- &:after {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translateX(-50%);
- width: 300rpx;
- height: 0;
- content: '';
- border-bottom: 1px solid #ccc;
- }
- }
- }
- /* 规格选择弹窗 */
- .attr-content {
- padding: 10rpx 30rpx;
- .a-t {
- display: flex;
- image {
- width: 170rpx;
- height: 170rpx;
- flex-shrink: 0;
- margin-top: -40rpx;
- border-radius: 8rpx;
- }
- .right {
- display: flex;
- flex-direction: column;
- padding-left: 24rpx;
- font-size: $font-sm + 2rpx;
- color: $font-color-base;
- line-height: 42rpx;
- .good-name {
- padding-top: 20rpx;
- max-width: 320rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #1d2023;
- line-height: 42rpx;
- margin-bottom: 15rpx;
- }
- .price {
- font-size: 60rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ff6f0f;
- // font-size: $font-lg;
- // color: $uni-color-primary;
- // margin-bottom: 10rpx;
- }
- .selected-text {
- margin-right: 10rpx;
- }
- }
- }
- .attr-list {
- display: flex;
- flex-direction: column;
- font-size: $font-base + 2rpx;
- color: $font-color-base;
- padding-top: 30rpx;
- padding-left: 10rpx;
- }
- .item-list {
- padding: 20rpx 0 0;
- display: flex;
- flex-wrap: wrap;
- text {
- display: flex;
- align-items: center;
- justify-content: center;
- background: #eee;
- margin-right: 20rpx;
- margin-bottom: 20rpx;
- border-radius: 100rpx;
- min-width: 60rpx;
- height: 60rpx;
- padding: 0 20rpx;
- font-size: $font-base;
- color: $font-color-dark;
- }
- .selected {
- background: #fbebee;
- color: $uni-color-primary;
- }
- }
- }
- /* 弹出层 */
- .popup {
- position: fixed;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- z-index: 99;
- &.show {
- display: block;
- .mask {
- animation: showPopup 0.2s linear both;
- }
- .layer {
- animation: showLayer 0.2s linear both;
- }
- }
- &.hide {
- .mask {
- animation: hidePopup 0.2s linear both;
- }
- .layer {
- animation: hideLayer 0.2s linear both;
- }
- }
- &.none {
- display: none;
- }
- .mask {
- position: fixed;
- top: 0;
- width: 100%;
- height: 100%;
- z-index: 1;
- background-color: rgba(0, 0, 0, 0.4);
- }
- .layer {
- position: fixed;
- z-index: 99;
- bottom: 0;
- width: 100%;
- min-height: 30vh;
- border-radius: 10rpx 10rpx 0 0;
- background-color: #fff;
- .btn {
- height: 66rpx;
- line-height: 66rpx;
- border-radius: 100rpx;
- // background: $uni-color-primary;
- background: $base-color;
- font-size: $font-base + 2rpx;
- color: #fff;
- margin: 30rpx auto 20rpx;
- }
- }
- @keyframes showPopup {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
- }
- @keyframes hidePopup {
- 0% {
- opacity: 1;
- }
- 100% {
- opacity: 0;
- }
- }
- @keyframes showLayer {
- 0% {
- transform: translateY(120%);
- }
- 100% {
- transform: translateY(0%);
- }
- }
- @keyframes hideLayer {
- 0% {
- transform: translateY(0);
- }
- 100% {
- transform: translateY(120%);
- }
- }
- }
- /* 底部操作菜单 */
- .page-bottom {
- position: fixed;
- left: 0rpx;
- bottom: 0rpx;
- z-index: 95;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 750rpx;
- height: 98rpx;
- background: rgba(255, 255, 255, 0.9);
- box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
- // border-radius: 16rpx;
- .p-b-btn {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- font-size: $font-sm;
- color: $font-color-base;
- width: 100rpx;
- height: 98rpx;
- .iconfont {
- font-size: 40rpx;
- line-height: 48rpx;
- color: $font-color-light;
- }
- &.active,
- &.active .iconfont {
- color: $uni-color-primary;
- }
- .icon-fenxiang2 {
- font-size: 42rpx;
- transform: translateY(-2rpx);
- }
- .iconlikefill {
- font-size: 46rpx;
- }
- }
- .action-btn-group {
- display: flex;
- height: 98rpx;
- // border-radius: 100px;
- overflow: hidden;
- // margin-left: 20rpx;
- position: relative;
- // &:after {
- // content: '';
- // position: absolute;
- // top: 50%;
- // right: 50%;
- // transform: translateY(-50%);
- // height: 28rpx;
- // width: 0;
- // border-right: 1px solid rgba(255, 255, 255, 0.5);
- // }
- .action-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 350rpx;
- height: 100%;
- font-size: $font-base;
- padding: 0;
- border-radius: 0;
- // background: transparent;
- background: #31332d;
- &.buy-now-btn {
- background-color: #303e49;
- }
- &.add-cart-btn {
- background-color: $base-color;
- }
- }
- }
- }
- // 商店头
- .shop-box {
- background-color: #ffffff;
- margin-top: 20rpx;
- margin-bottom: 10rpx;
- padding: 20rpx;
- .shop-img {
- border-radius: 300rpx;
- height: 80rpx;
- width: 80rpx;
- margin-right: 20rpx;
- }
- .shop-button {
- border-radius: 100rpx;
- padding: 10rpx 20rpx;
- color: $color-red;
- border: 1px solid $color-red;
- font-size: $font-lg;
- line-height: 1;
- }
- }
- </style>
|