12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124 |
- <template>
- <view class="container">
- <!-- 轮播图 -->
- <top-swiper :imgList="imgList" :video="video"></top-swiper>
- <!-- 标题 -->
- <product-content :goodsObjact="goodsObjact"></product-content>
- <view class="ptsf_box" @click="shareLink()">
- <image class="ptsf_img" src="../../static/img/sharejt.png" mode=""></image>
- <view class="ptfx_tit">分享</view>
- </view>
- <!-- 秒杀倒计时 -->
- <!-- <view class="sckill-top" v-if="isSckill">
- <view class="bg"><image src="https://zccy.liuniu946.com/static/img/base-sckill.png" mode=""></image></view>
- <view class="top-left">
- <view class="left-top">限时秒杀价</view>
- <view class="left-btm">
- ¥
- <text class="now-pri">{{ goodsObjact.price }}</text>
- <text class="old-pri">¥{{ goodsObjact.ot_price }}</text>
- </view>
- </view>
- <view class="top-right">
- <view class="right-top">距离本场结束还剩</view>
- <uni-countdown
- class="timeBox"
- color="#901b21"
- background-color="#fff"
- splitor-color="#fff"
- :show-day="true"
- :hour="seckillObj.stopTimeH"
- :minute="seckillObj.stopTimeM"
- :second="seckillObj.stopTimeS"
- ></uni-countdown>
- </view>
- </view> -->
- <!-- 拼货时间及优惠 -->
- <!-- <discounts @clickCoupon="Getcoupon" :Info="goodsObjact.store_info" :showCoupon="true"></discounts> -->
- <!-- 猜你喜欢 -->
- <!-- <guess-like @Addcar='Addcar' @clickNavTo='navToDetailPage' :goodList = 'good_list||[]'></guess-like> -->
- <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="userInfo && userInfo.level > 0 && userInfo.vip_info">
- <text class="tit" style="width: 100%;">一级分佣为<text
- style="color: #ff4e35;">{{((brokerage_origin*1) *(userInfo.vip_info.brokerage_ratio*1) /100).toFixed(2)*1 }}</text>元,二级分佣为<text
- style="color: #ff4e35;">{{((brokerage_origin*1) *(userInfo.vip_info.brokerage_ratio_two*1) /100).toFixed(2)*1}}</text>元</text>
- </view>
- </view>
- <!-- 评价 -->
- <estimate @navTo="navTo('/pages/product/reply?id=' + goodsid)" v-if="reply" :reply="reply" :list="list">
- </estimate>
- <!-- 规格信息 -->
- <fresh-detail :goodsObjact="goodsObjact"></fresh-detail>
- <!-- 图文详情 -->
- <content-text :description="description"></content-text>
- <!-- 底部高度撑开 -->
- <view class="contentBottomHeight"></view>
- <!-- 底部操作菜单 -->
- <product-bottom @buy="buy" :goodsObjact="goodsObjact" :goodsid="goodsid" @specOPne="specOPne"></product-bottom>
- <!-- 规格-模态层弹窗 -->
- <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" mode="aspectFill"></image>
- <view class="right">
- <text class="name">{{ goodsObjact.store_name }}</text>
- <text class="price">¥{{ actionPrice * goodsNumber }}</text>
- <text class="stock">库存:{{ goodsStore }}件</text>
- <view class="selected" v-if="specList != ''">
- 已选:
- <text class="selected-text" v-for="(sItem, sIndex) in specSelected"
- :key="sIndex">{{ sItem }}</text>
- </view>
- </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>
- <button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
- <button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
- </view>
- </view>
- <uni-popup ref="popupshare" type="center">
- <view class="share-box">
- <image :src="shareImage" mode="" class="box-img" @longpress="saveImg()"></image>
- </view>
- </uni-popup>
- <view v-if="shareShow" class="Shraremask" @click="cancel">
- <view class="mask-content">
- <scroll-view class="view-content" scroll-y>
- <view class="share-header">分享到</view>
- <view class="share-list">
- <view class="share-item">
- <button class="wechat-box" open-type="share">
- <image class="itemImage" src="../../static/icon/share1.png" mode=""></image>
- <text class="itemText">微信好友</text>
- </button>
- <view class="wechat-box" @click="shareToFriend()">
- <image class="itemImage" src="../../static/icon/share4.png" mode=""></image>
- <text class="itemText">生成海报</text>
- </view>
- </view>
- </view>
- </scroll-view>
- <view class="bottomButtom b-t" @click="cancel">取消</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- goodsDetail,
- cartAdd,
- seckillGoods,
- poster
- } from '@/api/product.js';
- import {
- mapState
- } from 'vuex';
- import store from '@/store/index.js';
- import {
- timeComputed
- } from '@/utils/rocessor.js';
- import {
- saveUrl
- } from '@/utils/loginUtils.js';
- // #ifdef H5
- import {
- weixindata
- } from '@/utils/wxAuthorized';
- // #endif
- // 头部轮播图
- import topSwiper from './common/topSwiper.vue';
- // 标题
- import productContent from './common/productContent.vue';
- // 到货时间及优惠
- import discounts from './common/discounts.vue';
- // 规格信息
- import freshDetail from './common/freshDetail.vue';
- // 图文详情
- import contentText from './common/contentText.vue';
- // 底部按钮
- import productBottom from './common/productBottom.vue';
- // 猜你喜欢
- import guessLike from './common/guessLike.vue';
- // 评价
- import estimate from './common/estimate.vue';
- export default {
- components: {
- guessLike,
- topSwiper,
- productContent,
- discounts,
- freshDetail,
- contentText,
- productBottom,
- estimate
- },
- data() {
- return {
- video: '',
- shareShow: false,
- shareImage: '', // 获取的分享海报
- isSckill: false,
- goodsStore: 0, //选中库存
- brokerage_origin: 0, //默认佣金
- specList: [],
- buys_show: true,
- buys_shows: false,
- specSelected: [], //选中的分类
- specClass: 'none', //显示隐藏弹窗
- many: 1, //1是单规格 2是多规格
- reply: '', //评论
- option: '', //保存传值
- opt: '', //保存小程序传值
- list: '', //商品详情的数据
- type: 1, //默认支付方式add为
- goodsType: 0,
- goodsNumber: 1, //购买数量
- goodsid: '', //商品id
- description: '', //商品描述
- goodsObjact: {
- percent: 1
- }, //保存商品数据
- //图片循环
- imgList: [],
- // 对比对象
- actionPrice: 0, //默认选中商品价格
- actionImage: '', //默认选中图片
- good_list: '', //猜你喜欢列表
- goodsNumberMax: 0, //最大可购买数量
- // 倒计时数据保存
- seckillObj: {
- stopTime: 0, //结束时间
- stop: false, //是否结束
- stopTimeH: 0, //小时
- stopTimeM: 0, //分钟
- stopTimeS: 0, //秒钟
- stopTimeD: 0, //天
- upTime: 0 //更新组件内部组件用
- },
- // 拼团数据保存
- pink: {
- id: '', //拼团编号
- uid: '', //用户编号
- people: '', //拼团人数
- price: '', //拼团价格
- stop_time: '', //拼团结束时间
- nickname: '', //团长昵称
- avatar: '', //团长头像
- count: '', //拼团剩余人数
- h: '', //时
- i: '', //分
- s: '' //秒
- },
- };
- },
- filters: {
- parseIntTo(percent) {
- percent = +percent * 100;
- if (percent % 1 === 0) {
- return percent;
- } else {
- percent = percent.toFixed(1);
- return percent;
- }
- }
- },
- async onLoad(options) {
- let obj = this;
- if (options.scene) {
- if (typeof options.scene == 'string') {
- let scene = ('{' + options.scene + '}')
- .replace('qr%26', '')
- .replace(/%3D/g, ':')
- .replace(/%26/g, ',')
- .replace('pid', '"pid"')
- .replace('type', '"type"')
- .replace('id', '"id"')
- .replace('sid', '"sid"');
- let opt = JSON.parse(scene);
- this.opt = opt;
- // 保存拼团订单id
- this.goodsid = opt.id;
- if (opt.pid) {
- // 存储邀请人
- // this.spread = opt.pid;
- uni.setStorageSync('spread', opt.pid);
- }
- if (opt.type) {
- this.goodsType = opt.type;
- }
- }
- } else {
- console.log(options.id);
- //保存商品id
- this.goodsid = options.id;
- if (options.type) {
- this.goodsType = options.type;
- }
- }
- if (options.type == 1) {
- obj.isSckill = true;
- }
- // 判断有无人邀请
- if (options.spread) {
- // 存储邀请人
- uni.setStorageSync('spread', options.spread);
- }
- saveUrl();
- this.goodsDetail();
- // 注册邀请信息
- // #ifdef H5
- let bool = uni.getStorageSync('weichatBrowser') || '';
- if (bool) {
- weixindata();
- }
- // #endif
- },
- computed: {
- ...mapState(['weichatObj', 'baseURL', 'urlFile']),
- ...mapState('user', ['userInfo'])
- },
- // 分享
- onShareAppMessage(options) {
- // 设置菜单中的转发按钮触发转发事件时的转发内容
- let pages = getCurrentPages(); //获取加载的页面
- let currentPage = pages[pages.length - 1]; //获取当前页面的对象
- let url = currentPage.route; //当前页面url
- let item = currentPage.options; //如果要获取url中所带的参数可以查看options
- let shareObj = {
- title: this.goodsObjact.store_name + ' 价格:' + this.goodsObjact.price, // 默认是小程序的名称(可以写slogan等)
- path: url + '?id=' + item.id + '&spread=' + this.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
- imageUrl: this.goodsObjact.image,
- success: function(res) {
- // 转发成功之后的回调
- if (res.errMsg == 'shareAppMessage:ok') {}
- },
- fail: function() {
- // 转发失败之后的回调
- if (res.errMsg == 'shareAppMessage:fail cancel') {
- // 用户取消转发
- } else if (res.errMsg == 'shareAppMessage:fail') {
- // 转发失败,其中 detail message 为详细失败信息
- }
- }
- };
- return shareObj;
- },
- methods: {
- //选择规格
- selectSpec(item, arr, ind) {
- arr.attr_value.forEach(function(e) {
- e.check = false;
- });
- item.check = true;
- let obj = this;
- obj.specSelected[ind] = item.attr;
- let str = obj.specSelected.join(',');
- // 获取当前选中的对象
- if (obj.productValue[str]) {
- obj.buys_show = true;
- obj.buys_shows = false;
- obj.actionPrice = obj.productValue[str].price;
- obj.goodsNumberMax = obj.productValue[str].stock;
- obj.actionImage = obj.productValue[str].image;
- obj.uniqueId = obj.productValue[str].unique;
- obj.goodsStore = obj.productValue[str].stock;
- } else {
- (obj.buys_show = false), (obj.buys_shows = true);
- }
- if (obj.goodsStore == 0) {
- obj.buys_show = false;
- obj.buys_shows = true;
- }
- obj.specSelected[ind] = item.attr;
- },
- // 打開彈窗
- specOPne(type = 1) {
- let obj = this;
- obj.specClass = 'show';
- obj.type = type;
- },
- //规格弹窗开关
- 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;
- },
- //领取优惠券
- Getcoupon() {
- uni.navigateTo({
- url: '/pages/coupon/getcoupon'
- });
- },
- //详情页
- navToDetailPage(item) {
- let id = item.id;
- uni.navigateTo({
- url: '/pages/product/product?id=' + id
- });
- },
- shareToFriend() {
- let obj = this;
- uni.showLoading({
- title: 'Loading...',
- mask: true
- });
- // #ifdef H5
- let fromname = 'wechat';
- // #endif
- // #ifdef MP
- let fromname = 'routine';
- // #endif
- console.log(obj.goodsid, 'id');
- poster({
- productId: obj.goodsid,
- from: fromname
- })
- .then(({
- data
- }) => {
- obj.shareImage = data.url;
- console.log(obj.shareImage, '123456');
- uni.hideLoading();
- this.$refs.popupshare.open();
- })
- .catch(e => {
- uni.hideLoading();
- });
- },
- // 跳转页面
- navTo(url) {
- uni.navigateTo({
- url: '/pages/product/reply?id=' + this.goodsid
- });
- },
- //加入购物车
- Addcar(item) {
- let obj = this;
- cartAdd({
- cartNum: '1', //商品数量
- uniqueId: '', //商品标签
- new: 0, //商品是否新增加到购物车1为不加入0为加入
- mer_id: '',
- productId: item.id //商品编号
- })
- .then(function(e) {
- uni.showToast({
- title: '成功加入购物车',
- type: 'top',
- duration: 500,
- icon: 'none'
- });
- obj.goodsDetail();
- })
- .catch(e => {
- console.log(e);
- });
- },
- goodsDetail() {
- let obj = this;
- // 获取普通商品信息
- if (obj.goodsType == 0) {
- goodsDetail({}, this.goodsid).then(function({
- data
- }) {
- obj.list = data;
- obj.good_list = data.good_list; //保存猜你喜欢列表
- obj.reply = data.reply; //保存评论列表
- let goods = data.storeInfo;
- obj.goodsObjact = goods;
- console.log(goods, '123456789');
- if (obj.goodsObjact.description != null) {
- obj.description = obj.goodsObjact.description.replace(/\<img/gi,
- '<img class="rich-img"');
- } //小程序商品详情图超出屏幕问题
- obj.imgList = goods.slider_image; //保存轮播图
- if (goods.video_link) {
- obj.video = goods.video_link
- // obj.imgList = obj.imgList.unshift(goods.video_link)
- }
- obj.specList = data.productAttr; //保存分类列表
- if (Array.isArray(data.productValue) != true) {
- obj.many = 2;
- obj.specList = data.productAttr; //保存产品属性
- obj.productValue = data.productValue; //保存属性值
- 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(',');
- console.log(str, 'str');
- // 设置默认值
- obj.actionPrice = obj.productValue[str].price;
- obj.goodsNumberMax = obj.productValue[str].stock;
- obj.actionImage = obj.productValue[str].image;
- obj.uniqueId = obj.productValue[str].unique;
- obj.goodsStore = obj.productValue[str].stock;
- obj.brokerage_origin = obj.productValue[str].brokerage_origin;
- } else {
- obj.many = 1;
- obj.productValue = data.productValue; //保存分类查询数据
- obj.actionPrice = goods.price; //保存默认选中商品价格
- obj.actionImage = goods.image_base; //保存默认选中商品图片
- obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
- obj.brokerage_origin = goods.brokerage_origin;
- }
- obj.shopId = data.mer_id; //保存商店id
- });
- }
- if (obj.goodsType == 1) {
- seckillGoods({}, this.goodsid).then(({
- data
- }) => {
- obj.list = data;
- console.log(obj.list, '秒杀商品数据++++++++++');
- // obj.good_list = data.good_list; //保存猜你喜欢列表
- obj.reply = data.reply; //保存评论列表
- let goods = data.storeInfo;
- obj.goodsNumberMax = goods.num;
- // console.log('obj.goodsNumberMin+++++++++',obj.goodsNumberMin)
- const time = timeComputed(goods.stop_time * 1000);
- obj.seckillObj = {
- stop: time.tpye, //是否结束
- stopTimeH: time.hours + time.day * 24, //小时
- stopTimeM: time.minutes, //分钟
- stopTimeS: time.seconds //秒钟
- };
- console.log(obj.seckillObj, '数据');
- // console.log(obj.seckillObj,'obj.seckillObj++++++++++++++++++++++')
- obj.goodsObjact = goods;
- if (obj.goodsObjact.description != null) {
- obj.description = obj.goodsObjact.description.replace(/\<img/gi,
- '<img class="rich-img"');
- } //小程序商品详情图超出屏幕问题
- obj.imgList = goods.images; //保存轮播图
- obj.specList = data.productAttr; //保存分类列表
- if (Array.isArray(data.productValue) != true) {
- console.log('多规格+++++++++++++');
- obj.many = 2;
- obj.specList = data.productAttr; //保存产品属性
- obj.productValue = data.productValue; //保存属性值
- 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(',');
- console.log(str, 'str');
- // 设置默认值
- obj.actionPrice = obj.productValue[str].price;
- // obj.goodsNumberMax = obj.productValue[str].quota;
- // console.log(obj.goodsNumberMax,'obj.goodsNumberMax++++++++++++')
- obj.actionImage = obj.productValue[str].image;
- obj.uniqueId = obj.productValue[str].unique;
- obj.goodsStore = obj.productValue[str].stock;
- } else {
- console.log('单规格+++++++++++++');
- obj.many = 1;
- obj.productValue = data.productValue; //保存分类查询数据
- obj.actionPrice = goods.price; //保存默认选中商品价格
- obj.actionImage = goods.image_base; //保存默认选中商品图片
- // obj.goodsNumberMax = goods.quota; //保存默认选中最大可购买商品数量
- console.log(obj.goodsNumberMax, 'obj.goodsNumberMax---------------');
- obj.shopId = data.mer_id; //保存商店id
- }
- });
- }
- },
- shareLink(item) {
- console.log('dainjideniang');
- this.shareShow = true;
- },
- cancel() {
- this.shareShow = false;
- },
- // 长按保存图片
- saveImg(w) {
- console.log(w);
- let obj = this;
- uni.downloadFile({
- //下载图片
- url: obj.shareImage,
- success: res => {
- console.log(res.tempFilePath);
- uni.saveImageToPhotosAlbum({
- //将图片保存在手机
- filePath: res.tempFilePath, //保存的位置
- success: res => {
- uni.showToast({
- title: '保存成功',
- icon: 'none'
- });
- }
- });
- }
- });
- },
- // 立即购买
- buy() {
- let obj = this;
- // 创建传值对象
- let data = {
- productId: obj.goodsid, //商品编号
- cartNum: obj.goodsNumber, //商品数量
- uniqueId: obj.uniqueId, //分类编号
- new: 0,
- secKillId: '',
- integralId: '',
- free_check: 0
- };
- if (obj.type == 2) {
- console.log('加入购物车');
- data.new = 0;
- } else if (obj.type == 1) {
- data.new = 1;
- }
- console.log(obj.goodsType, 'obj.goodsType77777777777777777777');
- if (obj.goodsType == 1) {
- data.secKillId = obj.goodsObjact.id;
- data.new = 1;
- }
- if (obj.goodsType == 2) {
- data.new = 1;
- data.integralId = obj.goodsObjact.id;
- }
- if (obj.goodsType == 3) {
- data.new = 1;
- data.free_check = 1;
- }
- cartAdd(data)
- .then(function(e) {
- let da = e.data;
- if (obj.type == 1) {
- // 跳转到支付页
- console.log(obj.goodsType, 'this.goodsType456444444444444444');
- uni.navigateTo({
- url: '/pages/order/createOrder?id=' + da.cartId + '&goodsType=' + obj.goodsType
- });
- }
- if (obj.type == 2) {
- uni.showToast({
- title: '成功加入购物车',
- type: 'top',
- duration: 2000,
- icon: 'none'
- });
- obj.goodsDetail();
- }
- obj.toggleSpec();
- })
- .catch(e => {
- console.log(e);
- });
- },
- // 阻止触发上级事件
- stopPrevent() {}
- }
- };
- </script>
- <style lang="scss">
- /* 弹出层 */
- .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: 35vh;
- border-radius: 10rpx 10rpx 0 0;
- background-color: #fff;
- .btn {
- height: 66rpx;
- line-height: 66rpx;
- border-radius: 100rpx;
- background: $uni-color-primary;
- 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%);
- }
- }
- }
- /* 规格选择弹窗 */
- .attr-content {
- padding: 25rpx 30rpx;
- .a-t {
- display: flex;
- image {
- width: 170rpx;
- height: 170rpx;
- flex-shrink: 0;
- border-radius: 8rpx;
- }
- .right {
- display: flex;
- flex-direction: column;
- padding-left: 24rpx;
- font-size: $font-sm + 2rpx;
- color: $font-color-base;
- line-height: 42rpx;
- width: 75%;
- .price {
- font-size: $font-lg;
- color: $uni-color-primary;
- margin: 10rpx 0rpx;
- }
- .name {
- font-size: 32rpx;
- color: $font-color-dark;
- height: 50rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- display: block;
- }
- .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: #ddffdf;
- color: $uni-color-primary;
- }
- }
- }
- //默认商品底部高度
- .goodsBottom {
- height: 160rpx;
- }
- page {
- background: #f0f0f0;
- }
- //秒杀、拼团底部高度
- .contentBottomHeight {
- height: 110rpx;
- }
- //默认商品底部高度
- .goodsBottom {
- height: 160rpx;
- }
- /deep/ .iconenter {
- font-size: $font-base + 2rpx;
- color: #888;
- }
- /deep/ .con_image {
- width: 130rpx;
- height: 130rpx;
- display: inline-block;
- padding: 15rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- /* 商品详情中限制图片大小 */
- /deep/ .rich-img {
- width: 100% !important;
- height: auto;
- }
- .sckill-top {
- width: 750rpx;
- height: 165rpx;
- position: relative;
- top: -40rpx;
- margin-bottom: -40rpx;
- display: flex;
- justify-content: space-between;
- .bg {
- width: 750rpx;
- height: 165rpx;
- position: absolute;
- left: 0;
- top: 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .top-left {
- position: relative;
- z-index: 10;
- line-height: 1;
- .left-top {
- padding: 35rpx 0 23rpx 22rpx;
- font-size: 44rpx;
- font-weight: 500;
- color: #ffffff;
- line-height: 1;
- }
- .left-btm {
- line-height: 1;
- font-size: 30rpx;
- font-weight: 500;
- padding-left: 25rpx;
- // text-decoration: line-through;
- color: #ffffff;
- .now-pri {
- display: inline-block;
- padding-right: 8rpx;
- font-size: 44rpx;
- font-weight: 800;
- color: #ffffff;
- }
- .old-pri {
- text-decoration: line-through;
- }
- }
- }
- .top-right {
- position: relative;
- z-index: 10;
- padding: 67rpx 20rpx 18rpx 0;
- .right-top {
- font-size: 22rpx;
- font-weight: 400;
- color: #ffffff;
- line-height: 1;
- padding-bottom: 8rpx;
- }
- }
- }
- .ptsf_box {
- border-radius: 50%;
- position: fixed;
- z-index: 2;
- right: 20rpx;
- top: 60%;
- width: 90rpx;
- height: 90rpx;
- background: #626262;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 10rpx;
- margin: 0;
- &::after {
- border: none;
- }
- .ptsf_img {
- width: 28rpx;
- height: 28rpx;
- display: block;
- }
- .ptfx_tit {
- margin-top: 15rpx;
- font-size: 18rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- line-height: 1;
- }
- }
- .share-box {
- width: 600rpx;
- height: 1000rpx;
- .box-img {
- width: 600rpx;
- height: 1000rpx;
- }
- }
- .Shraremask {
- position: fixed;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- display: flex;
- justify-content: center;
- align-items: flex-end;
- z-index: 998;
- transition: 0.3s;
- background-color: rgba(51, 51, 51, 0.6);
- .bottomButtom {
- position: absolute;
- left: 0;
- bottom: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 90rpx;
- background: #fff;
- z-index: 9;
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- }
- }
- .mask-content {
- margin-bottom: 88rpx;
- width: 100%;
- height: 380rpx;
- transition: 0.3s;
- background: #fff;
- &.has-bottom {
- padding-bottom: 90rpx;
- }
- .view-content {
- height: 100%;
- }
- }
- .share-header {
- height: 110rpx;
- font-size: $font-base + 2rpx;
- color: font-color-dark;
- display: flex;
- align-items: center;
- justify-content: center;
- padding-top: 10rpx;
- &:before,
- &:after {
- content: '';
- width: 240rpx;
- height: 0;
- border-top: 1px solid $border-color-base;
- transform: scaleY(0.5);
- margin-right: 30rpx;
- }
- &:after {
- margin-left: 30rpx;
- margin-right: 0;
- }
- }
- .share-list {
- display: flex;
- width: 80%;
- margin: 0rpx auto;
- }
- .share-item {
- min-width: 33.33%;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 180rpx;
- width: 100%;
- .wechat-box {
- width: 50%;
- height: 100%;
- background: #ffffff;
- border: 0;
- display: flex;
- align-items: center;
- flex-direction: column;
- &::after {
- border: 0;
- }
- .itemImage {
- width: 80rpx;
- height: 80rpx;
- margin-bottom: 16rpx;
- }
- .itemText {
- font-size: $font-base;
- color: $font-color-base;
- line-height: 2;
- }
- }
- }
- .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;
- }
- }
- </style>
|