productGroup.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081
  1. <template>
  2. <view class="container">
  3. <!-- 轮播图 -->
  4. <top-swiper :imgList="imgList"></top-swiper>
  5. <!-- 拼团倒计时 -->
  6. <group-time :goodsObjact="goodsObjact" :key='goodsObjact.product_price' :seckillObj="seckillObj" ></group-time>
  7. <view class="jg"></view>
  8. <!-- 拼团标题 -->
  9. <group-content :goodsObjact="goodsObjact"></group-content>
  10. <!-- <view class="row b-b">
  11. <text class="tit">选择</text>
  12. <picker mode="selector" :range="choNum" @change="bindChange">
  13. <view class="refund" v-if="goodsNumber !== 1">{{ goodsNumber || '请选择' }}</view>
  14. <view class="noRefund" v-else>请选择购买数量</view>
  15. </picker>
  16. </view> -->
  17. <view class="have-know">{{kttitle}}<view v-html="ktcontent"></view></view>
  18. <view class="way">{{dhtitle}}<view v-html="dhcontent"></view></view>
  19. <!-- 拼团到货时间及优惠 -->
  20. <!-- <discounts :mark='goodsObjact.mark' :Info="goodsObjact.info" @clickCoupon="Getcoupon" :showCoupon='false'> -->
  21. </discounts>
  22. <!-- 规格信息 -->
  23. <!-- <fresh-detail :goodsObjact="goodsObjact"></fresh-detail> -->
  24. <!-- <view class="uni-padding-wrap pinklistbox" v-if="pinkTlist.length > 0">
  25. <view class="pinklist">
  26. <view v-for="(ls, ind) in showlist">
  27. <view class="flex pinklist_list">
  28. <view class="pink_img"><image :src="ls.avatar"></image></view>
  29. <view class="pink_name">{{ ls.nickname }}</view>
  30. <view class="pink_tpl">
  31. <view class="pink_people">
  32. 还差
  33. <text>{{ ls.count }}</text>
  34. 人拼团
  35. </view>
  36. </view>
  37. <view class="pint" @click="groupBooking(ls.id)">
  38. 去拼团
  39. <text class="iconfont iconenter"></text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="More" @click="clickMore" v-if="more">查看更多</view>
  45. </view> -->
  46. <!-- <view class="ping-plan">
  47. <view class="participate-7 flex-between-center">
  48. <view class="participate-7-1">
  49. <text class="word" v-if="pink_type == 1">AA团</text>
  50. <text class="word" v-else>达人团</text>
  51. <text>玩法</text>
  52. </view>
  53. <view class="participate-7-1" @click="ToRule()">
  54. <text class="word1">详细规则</text>
  55. <image src="../../../static/img/img74.png"></image>
  56. </view>
  57. </view>
  58. <view class="participate-8 flex-between-center">
  59. <view class="participate-8-1">
  60. <image class="img1" src="https://shicai.liuniu946.com/img/img76.png"></image>
  61. <view class="word-1">开团/参团</view>
  62. <view class="word-2">拼团享低价</view>
  63. </view>
  64. <image src="https://shicai.liuniu946.com/img/img75.png"></image>
  65. <view class="participate-8-1">
  66. <image class="img2" src="https://shicai.liuniu946.com/img/img77.png"></image>
  67. <view class="word-1">邀请邻里参团</view>
  68. <view class="word-2">分享优惠多</view>
  69. </view>
  70. <image src="https://shicai.liuniu946.com/img/img75.png"></image>
  71. <view class="participate-8-1">
  72. <image class="img3" src="https://shicai.liuniu946.com/img/img78.png"></image>
  73. <view class="word-1">人满发货</view>
  74. <view class="word-2">人不满退款</view>
  75. </view>
  76. </view>
  77. </view> -->
  78. <!-- 大家都在拼 达人团显示 -->
  79. <!-- <now-list v-if="pink_type == 2" :recommendedlist="recommendedlist"></now-list> -->
  80. <!-- 图文详情 -->
  81. <content-text :description="description"></content-text>
  82. <!-- 底部高度撑开 -->
  83. <view class="contentBottomHeight"></view>
  84. <!-- 底部操作菜单 -->
  85. <view>
  86. <view>
  87. <group-bottom :peoplePrize='goodsObjact.people_prize' @buy="openPinkT" @specOPne="specOPne"
  88. :seckillObj="seckillObj" :many='many'></group-bottom>
  89. </view>
  90. </view>
  91. <!-- 规格-模态层弹窗 -->
  92. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec()">
  93. <!-- 遮罩层 -->
  94. <view class="mask"></view>
  95. <view class="layer attr-content" @click.stop="stopPrevent">
  96. <view class="a-t">
  97. <image :src="actionImage"></image>
  98. <view class="right">
  99. <text class="name">{{ goodsObjact.store_name }}</text>
  100. <text class="price">¥{{ actionPrice * goodsNumber }}</text>
  101. <text class="stock">库存:{{ goodsStore }}件</text>
  102. <view class="selected" v-if="specList != ''">
  103. 已选:
  104. <text class="selected-text" v-for="(sItem, sIndex) in specSelected"
  105. :key="sIndex">{{ sItem }}</text>
  106. </view>
  107. </view>
  108. </view>
  109. <view v-for="(item, index) in specList" :key="index" class="attr-list">
  110. <text>{{ item.attr_name }}</text>
  111. <view class="item-list">
  112. <text v-for="(childItem, childIndex) in item.attr_value" :key="childIndex" class="tit"
  113. :class="{ selected: childItem.check }" @click="selectSpec(childItem, item, index)">
  114. {{ childItem.attr }}
  115. </text>
  116. </view>
  117. </view>
  118. <view class="attr-list">
  119. <text>购买数量</text>
  120. <view class="item-list">
  121. <uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
  122. </view>
  123. </view>
  124. <button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
  125. <button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
  126. </view>
  127. </view>
  128. <!-- 返回按钮 -->
  129. <!-- <return-button></return-button> -->
  130. </view>
  131. </template>
  132. <script>
  133. import { getArticleDetail } from '@/api/index.js'
  134. import { nowPinkLst } from '@/api/order.js';
  135. import {
  136. goodsDetail,
  137. cartAdd,
  138. collectAdd,
  139. collectDel,
  140. seckillGoods,
  141. groupGoods
  142. } from '@/api/product.js';
  143. import {
  144. mapState
  145. } from 'vuex';
  146. import store from '@/store/index.js';
  147. import {
  148. saveUrl
  149. } from '@/utils/loginUtils.js';
  150. import {
  151. timeComputed
  152. } from '@/utils/rocessor.js';
  153. // #ifdef H5
  154. import {
  155. weixindata
  156. } from '@/utils/wxAuthorized';
  157. // #endif
  158. // 头部轮播图
  159. import topSwiper from '../common/topSwiper.vue';
  160. // 拼团倒计时
  161. import groupTime from '../common/groupTime.vue';
  162. // 拼团标题
  163. import groupContent from '../common/groupContent.vue';
  164. // 拼团到货时间及优惠
  165. // 规格信息
  166. // import freshDetail from '../common/freshDetail.vue';
  167. // 图文详情
  168. import contentText from '../common/contentText.vue';
  169. // 底部按钮
  170. import groupBottom from '../common/groupBottom.vue';
  171. // 大家还在拼
  172. // import NowList from '@/components/newlist/nowList.vue';
  173. //数量盒子
  174. import uniNumberBox from '@/components/uni-number-box.vue'
  175. export default {
  176. components: {
  177. topSwiper,
  178. groupTime,
  179. groupContent,
  180. // freshDetail,
  181. contentText,
  182. groupBottom,
  183. // NowList,
  184. uniNumberBox
  185. },
  186. data() {
  187. return {
  188. goodsStore: 0, //选中库存
  189. specList: [],
  190. buys_show: true,
  191. buys_shows: false,
  192. specSelected: [], //选中的分类
  193. reply: '', //评论
  194. list: '', //商品详情的数据
  195. type: 1, //默认支付方式add为
  196. goodsNumber: 1, //购买数量
  197. goodsid: '', //商品id
  198. description: '', //商品描述
  199. goodsObjact: {}, //保存商品数据
  200. //图片循环
  201. imgList: [],
  202. // 对比对象
  203. actionPrice: 0, //默认选中商品价格
  204. actionImage: '', //默认选中图片
  205. good_list: '', //猜你喜欢列表
  206. goodsNumberMax: 0, //最大可购买数量
  207. many:1,//1是单规格 2是多规格
  208. // 倒计时数据保存
  209. seckillObj: {
  210. stopTime: 0, //结束时间
  211. stop: false, //是否结束
  212. stopTimeH: 0, //小时
  213. stopTimeM: 0, //分钟
  214. stopTimeS: 0, //秒钟
  215. stopTimeD: 0, //天
  216. upTime: 0 //更新组件内部组件用
  217. },
  218. // 拼团数据保存
  219. pink: {
  220. id: '', //拼团编号
  221. uid: '', //用户编号
  222. people: '', //拼团人数
  223. price: '', //拼团价格
  224. stop_time: '', //拼团结束时间
  225. nickname: '', //团长昵称
  226. avatar: '', //团长头像
  227. count: '', //拼团剩余人数
  228. h: '', //时
  229. i: '', //分
  230. s: '' //秒
  231. },
  232. userInfo: '',
  233. pinkTlist: '', //拼团数据
  234. more: true, //查看更多按钮
  235. showlist: [],
  236. pink_type: 1, //拼团类别
  237. show: false, // 是否显示底部按钮
  238. recommendedlist:[],// 大家都在拼
  239. specClass: 'none' ,//显示隐藏弹窗
  240. kttitle: '',//拼团须知
  241. ktcontent: '',//须知内容
  242. dhcontent: '',//开团介绍
  243. dhtitle: '',//开团标题
  244. };
  245. },
  246. filters: {
  247. parseIntTo(percent) {
  248. percent = +percent * 100;
  249. if (percent % 1 === 0) {
  250. return percent;
  251. } else {
  252. percent = percent.toFixed(1);
  253. return percent;
  254. }
  255. }
  256. },
  257. async onLoad(options) {
  258. let obj = this;
  259. obj.getDhsm(3,'kttitle','ktcontent')
  260. obj.getDhsm(4,'dhtitle','dhcontent')
  261. obj.userInfo = uni.getStorageSync('userInfo');
  262. //保存商品id
  263. this.goodsid = options.id;
  264. if (options.show) {
  265. this.show = options.show;
  266. }
  267. console.log(this.show, 5656)
  268. // 判断有无人邀请
  269. if (options.spread) {
  270. // 存储邀请人
  271. uni.setStorageSync('spread', options.spread);
  272. }
  273. saveUrl();
  274. // 家在数据
  275. this.groupGoods();
  276. return;
  277. // 注册邀请信息
  278. // #ifdef H5
  279. let bool = uni.getStorageSync('weichatBrowser') || '';
  280. if (bool) {
  281. weixindata();
  282. }
  283. // #endif
  284. },
  285. computed: {
  286. ...mapState(['weichatObj', 'baseURL', 'urlFile'])
  287. },
  288. //分享
  289. onShareAppMessage(options) {
  290. // 设置菜单中的转发按钮触发转发事件时的转发内容
  291. let pages = getCurrentPages(); //获取加载的页面
  292. let currentPage = pages[pages.length - 1]; //获取当前页面的对象
  293. let url = currentPage.route; //当前页面url
  294. let item = currentPage.options; //如果要获取url中所带的参数可以查看options
  295. let shareObj = {
  296. title: this.goodsObjact.title + ' 价格:' + this.goodsObjact.price, // 默认是小程序的名称(可以写slogan等)
  297. path: url + '?id=' + item.id + '&spread=' + this.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
  298. imageUrl: this.goodsObjact.image,
  299. success: function(res) {
  300. // 转发成功之后的回调
  301. if (res.errMsg == 'shareAppMessage:ok') {}
  302. },
  303. fail: function() {
  304. // 转发失败之后的回调
  305. if (res.errMsg == 'shareAppMessage:fail cancel') {
  306. // 用户取消转发
  307. } else if (res.errMsg == 'shareAppMessage:fail') {
  308. // 转发失败,其中 detail message 为详细失败信息
  309. }
  310. }
  311. };
  312. return shareObj;
  313. },
  314. methods: {
  315. //获取兑换说明
  316. getDhsm(id,title,content) {
  317. getArticleDetail({},id).then( ({data}) => {
  318. console.log(data)
  319. this.$set(this,title,data.title)
  320. this.$set(this,content,data.content)
  321. })
  322. },
  323. // 跳转详细规则
  324. ToRule() {
  325. if( this.pink_type == 1 ) {
  326. // AA团
  327. uni.navigateTo({
  328. url: '/pages/rule/AArule'
  329. })
  330. } else {
  331. // 达人团
  332. uni.navigateTo({
  333. url: '/pages/rule/DaRrule'
  334. })
  335. }
  336. },
  337. //选择规格
  338. selectSpec(item, arr, ind) {
  339. arr.attr_value.forEach(function(e) {
  340. e.check = false;
  341. });
  342. item.check = true;
  343. let obj = this;
  344. obj.specSelected[ind] = item.attr;
  345. let str = obj.specSelected.join(',');
  346. console.log(obj.productValue[str],116)
  347. if (obj.productValue[str]) {
  348. obj.buys_show = true;
  349. obj.buys_shows = false;
  350. obj.actionPrice = obj.productValue[str].price;
  351. obj.goodsNumberMax = obj.productValue[str].stock;
  352. obj.actionImage = obj.productValue[str].image;
  353. obj.uniqueId = obj.productValue[str].unique;
  354. obj.goodsStore = obj.productValue[str].stock;
  355. // if (obj.goodsType == 2) {
  356. // obj.goodsStore = obj.productValue[str].quota;
  357. // } else {
  358. // obj.goodsStore = obj.productValue[str].product_stock;
  359. // }
  360. } else {
  361. (obj.buys_show = false), (obj.buys_shows = true);
  362. }
  363. },
  364. // 立即购买
  365. buy(item) {
  366. let obj = this;
  367. /* obj.toggleSpec();
  368. this.specClass='show',
  369. console.log(obj.list.productValue.默认.unique)
  370. console.log(obj.chooseGoodsNumber,'chooseGoodsNumber')
  371. return */
  372. // 创建传值对象
  373. console.log(obj.list.productValue);
  374. console.log(obj.list);
  375. let data = {
  376. // cartNum: obj.goodsNumber, //商品数量
  377. cartNum: obj.chooseGoodsNumber, //商品数量
  378. uniqueId: obj.uniqueId, //商品标签
  379. new: 1, //商品是否新增加到购物车1为不加入0为加入
  380. mer_id: obj.shopId,
  381. combinationId: obj.goodsid, //拼团编号
  382. productId: obj.goodsObjact.product_id, //商品编号
  383. };
  384. this.specClass = 'none';
  385. cartAdd(data)
  386. .then(function(e) {
  387. let da = e.data;
  388. console.log(e);
  389. if (obj.type == 1) {
  390. // 跳转到支付页
  391. uni.navigateTo({
  392. url: '/pages/order/createOrder?id=' + da.cartId + '&goodsType=' + obj.goodsType
  393. });
  394. }
  395. if (obj.type == 2) {
  396. obj.$api.msg('成功加入购物车');
  397. obj.toggleSpec();
  398. }
  399. })
  400. .catch(e => {
  401. console.log(e);
  402. });
  403. },
  404. // 去开团
  405. ToKaiTuan(item) {
  406. let id = item.id;
  407. uni.navigateTo({
  408. url: '/pages/product/productGroup?id=' + id
  409. });
  410. },
  411. // 跳转页面
  412. navTo(url) {
  413. uni.navigateTo({
  414. url
  415. });
  416. },
  417. // 查看更多
  418. clickMore() {
  419. this.showlist = this.pinkTlist;
  420. console.log(this.showlist, 22);
  421. this.more = false;
  422. },
  423. //去拼团
  424. groupBooking(item) {
  425. uni.navigateTo({
  426. url: '/pages/groupBooking/groupdetails?id=' + item
  427. });
  428. },
  429. // 获取拼团商品详情
  430. groupGoods() {
  431. let obj = this;
  432. // // 大家还在拼
  433. // nowPinkLst({}).then(({data}) => {
  434. // this.recommendedlist = data;
  435. // })
  436. groupGoods({}, this.goodsid).then(function({
  437. data
  438. }) {
  439. console.log(data,'拼团商品数据++++++++++')
  440. let goods = data.storeInfo;
  441. obj.goodsObjact = goods;
  442. console.log(obj.goodsObjact, 88)
  443. if (obj.goodsObjact.description != null) {
  444. obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
  445. } //小程序商品详情图超出屏幕问题
  446. console.log(Array.isArray(data.productValue), 99)
  447. // let len = 0
  448. // for( let item in data.productValue) {
  449. // len++
  450. // }
  451. // console.log(len,'len6666')
  452. // if(len > 1){
  453. // obj.many = 2;
  454. // obj.specList = data.productAttr;//保存产品属性
  455. // obj.productValue = data.productValue; //保存属性值
  456. // obj.specSelected = []; //初始化默认选择对象
  457. // for (let i = 0; i < obj.specList.length; i++) {
  458. // // 设置默认数据
  459. // let attrValue = obj.specList[i].attr_value[0];
  460. // attrValue.check = true;
  461. // obj.specSelected.push(attrValue.attr);
  462. // }
  463. // let str = obj.specSelected.join(',');
  464. // console.log(str,'str')
  465. // // 设置默认值
  466. // obj.actionPrice = obj.productValue[str].price;
  467. // obj.goodsNumberMax = obj.productValue[str].stock;
  468. // obj.actionImage = obj.productValue[str].image;
  469. // obj.uniqueId = obj.productValue[str].unique;
  470. // obj.goodsStore = obj.productValue[str].quota;
  471. // }else{
  472. // obj.many = 1;
  473. // }
  474. if (Array.isArray(data.productValue) != true) {
  475. console.log('多规格++++++++++')
  476. obj.many = 2;
  477. obj.specList = data.productAttr; //保存产品属性
  478. obj.productValue = data.productValue; //保存属性值
  479. obj.specSelected = []; //初始化默认选择对象
  480. for (let i = 0; i < obj.specList.length; i++) {
  481. // 设置默认数据
  482. let attrValue = obj.specList[i].attr_value[0];
  483. attrValue.check = true;
  484. obj.specSelected.push(attrValue.attr);
  485. }
  486. let str = obj.specSelected.join(',');
  487. console.log(str, 'str');
  488. // 设置默认值
  489. obj.actionPrice = obj.productValue[str].price;
  490. // obj.goodsNumberMax = obj.productValue[str].quota;
  491. // console.log(obj.goodsNumberMax,'obj.goodsNumberMax++++++++++++')
  492. obj.actionImage = obj.productValue[str].image;
  493. obj.uniqueId = obj.productValue[str].unique;
  494. obj.goodsStore = obj.productValue[str].stock;
  495. } else {
  496. obj.many = 1;
  497. obj.productValue = data.productValue; //保存分类查询数据
  498. obj.actionPrice = goods.price; //保存默认选中商品价格
  499. obj.actionImage = goods.image_base; //保存默认选中商品图片
  500. // obj.goodsNumberMax = goods.quota; //保存默认选中最大可购买商品数量
  501. console.log(obj.goodsNumberMax,'obj.goodsNumberMax---------------')
  502. obj.shopId = data.mer_id; //保存商店id
  503. }
  504. // console.log(obj.description,'')
  505. obj.imgList = goods.images; //保存轮播图
  506. obj.actionPrice = goods.price; //保存默认选中商品价格
  507. obj.actionImage = goods.image_base; //保存默认选中商品图片
  508. obj.goodsNumberMax = 1; //保存默认选中最大可购买商品数量
  509. if (obj.goodsObjact.pink_type == 'AA团') {
  510. obj.pink_type = 1;
  511. } else {
  512. obj.pink_type = 2;
  513. }
  514. obj.pinkTlist = data.pink;
  515. obj.showlist = obj.pinkTlist.slice(0, 2);
  516. if (obj.pinkTlist.length <= 2) {
  517. obj.more = false;
  518. }
  519. // 保存结束时间
  520. obj.seckillObj.stopTime = goods.stop_time * 1000;
  521. // 获取当前时间
  522. let acitonTime = new Date();
  523. // 判断当前时间是否大于结束时间
  524. if (acitonTime.getTime() > obj.seckillObj.stopTime) {
  525. // 当前秒杀时间已经结束
  526. obj.seckillObj.stop = true;
  527. } else {
  528. // 计算倒计时
  529. let time = timeComputed(obj.seckillObj.stopTime)
  530. // 倒计时数据保存
  531. obj.seckillObj = {
  532. stopTime: goods.stop_time * 1000, //结束时间
  533. stop: false, //是否结束
  534. stopTimeD: time.day, //天
  535. stopTimeH: time.hours, //小时
  536. stopTimeM: time.minutes, //分钟
  537. stopTimeS: time.seconds, //秒钟
  538. upTime: (new Date()).getTime()
  539. }
  540. }
  541. });
  542. },
  543. // 立即购买
  544. openPinkT(item) {
  545. let obj = this;
  546. obj.type = item;
  547. // 创建传值对象
  548. let data = {
  549. cartNum: obj.goodsNumber, //商品数量
  550. new: 1, //商品是否新增加到购物车1为不加入0为加入
  551. combinationId: obj.goodsid,
  552. productId: obj.goodsObjact.product_id
  553. };
  554. cartAdd(data)
  555. .then(function(e) {
  556. let da = e.data;
  557. if (obj.type == 1) {
  558. // 跳转到支付页
  559. uni.navigateTo({
  560. url: '/pages/order/createOrder?id=' + da.cartId+'&goodsType=2'
  561. });
  562. }
  563. })
  564. .catch(e => {
  565. console.log(e);
  566. });
  567. },
  568. specOPne(item) {
  569. let obj = this;
  570. obj.specClass = 'show';
  571. console.log(obj.specClass,'this.specClass')
  572. },
  573. //规格弹窗开关
  574. toggleSpec(str) {
  575. if (this.specClass === 'show') {
  576. this.specClass = 'hide';
  577. setTimeout(() => {
  578. this.specClass = 'none';
  579. }, 250);
  580. } else if (this.specClass === 'none') {
  581. this.specClass = 'show';
  582. }
  583. // 判断是否为数字
  584. if (typeof str == 'number') {
  585. // 保存当前购买类型
  586. this.type = str;
  587. }
  588. },
  589. // 阻止触发上级事件
  590. stopPrevent() {}
  591. }
  592. };
  593. </script>
  594. <style lang="scss" scoped>
  595. /* 弹出层 */
  596. .popup {
  597. position: fixed;
  598. left: 0;
  599. top: 0;
  600. right: 0;
  601. bottom: 0;
  602. z-index: 999;
  603. &.show {
  604. display: block;
  605. .mask {
  606. animation: showPopup 0.2s linear both;
  607. }
  608. .layer {
  609. animation: showLayer 0.2s linear both;
  610. }
  611. }
  612. &.hide {
  613. .mask {
  614. animation: hidePopup 0.2s linear both;
  615. }
  616. .layer {
  617. animation: hideLayer 0.2s linear both;
  618. }
  619. }
  620. &.none {
  621. display: none;
  622. }
  623. .mask {
  624. position: fixed;
  625. top: 0;
  626. width: 100%;
  627. height: 100%;
  628. z-index: 1;
  629. background-color: rgba(0, 0, 0, 0.4);
  630. }
  631. .layer {
  632. position: fixed;
  633. z-index: 99;
  634. bottom: 0;
  635. width: 100%;
  636. min-height: 35vh;
  637. border-radius: 10rpx 10rpx 0 0;
  638. background-color: #fff;
  639. .btn {
  640. height: 66rpx;
  641. line-height: 66rpx;
  642. border-radius: 100rpx;
  643. // background: $uni-color-primary;
  644. background-color: #901b21;
  645. font-size: $font-base + 2rpx;
  646. color: #fff;
  647. margin: 30rpx auto 20rpx;
  648. }
  649. }
  650. @keyframes showPopup {
  651. 0% {
  652. opacity: 0;
  653. }
  654. 100% {
  655. opacity: 1;
  656. }
  657. }
  658. @keyframes hidePopup {
  659. 0% {
  660. opacity: 1;
  661. }
  662. 100% {
  663. opacity: 0;
  664. }
  665. }
  666. @keyframes showLayer {
  667. 0% {
  668. transform: translateY(120%);
  669. }
  670. 100% {
  671. transform: translateY(0%);
  672. }
  673. }
  674. @keyframes hideLayer {
  675. 0% {
  676. transform: translateY(0);
  677. }
  678. 100% {
  679. transform: translateY(120%);
  680. }
  681. }
  682. }
  683. /* 规格选择弹窗 */
  684. .attr-content {
  685. padding: 25rpx 30rpx;
  686. .a-t {
  687. display: flex;
  688. image {
  689. width: 170rpx;
  690. height: 170rpx;
  691. flex-shrink: 0;
  692. border-radius: 8rpx;
  693. }
  694. .right {
  695. display: flex;
  696. flex-direction: column;
  697. padding-left: 24rpx;
  698. font-size: $font-sm + 2rpx;
  699. color: $font-color-base;
  700. line-height: 42rpx;
  701. width: 75%;
  702. .price {
  703. font-size: $font-lg;
  704. color: #901b21;
  705. margin: 10rpx 0rpx;
  706. }
  707. .name {
  708. font-size: 32rpx;
  709. color: $font-color-dark;
  710. height: 50rpx;
  711. overflow: hidden;
  712. text-overflow: ellipsis;
  713. white-space: nowrap;
  714. display: block;
  715. }
  716. .selected-text {
  717. margin-right: 10rpx;
  718. }
  719. }
  720. }
  721. .attr-list {
  722. display: flex;
  723. flex-direction: column;
  724. font-size: $font-base + 2rpx;
  725. color: $font-color-base;
  726. padding-top: 30rpx;
  727. padding-left: 10rpx;
  728. }
  729. .item-list {
  730. padding: 20rpx 0 0;
  731. display: flex;
  732. flex-wrap: wrap;
  733. text {
  734. display: flex;
  735. align-items: center;
  736. justify-content: center;
  737. background: #eee;
  738. margin-right: 20rpx;
  739. margin-bottom: 20rpx;
  740. border-radius: 100rpx;
  741. min-width: 60rpx;
  742. height: 60rpx;
  743. padding: 0 20rpx;
  744. font-size: $font-base;
  745. color: $font-color-dark;
  746. }
  747. .selected {
  748. // background: #ddffdf;
  749. background-color: rgba($color: #901b21, $alpha: 0.2);
  750. color: #901b21;
  751. }
  752. }
  753. }
  754. //默认商品底部高度
  755. .goodsBottom {
  756. height: 160rpx;
  757. }
  758. page {
  759. background: #f0f0f0;
  760. }
  761. //秒杀、拼团底部高度
  762. .contentBottomHeight {
  763. height: 135rpx;
  764. background-color: #FFFFFF;
  765. }
  766. //默认商品底部高度
  767. .goodsBottom {
  768. height: 160rpx;
  769. }
  770. /deep/ .iconenter {
  771. font-size: $font-base + 2rpx;
  772. color: #888;
  773. }
  774. /deep/ .con_image {
  775. width: 130rpx;
  776. height: 130rpx;
  777. display: inline-block;
  778. padding: 15rpx;
  779. image {
  780. width: 100%;
  781. height: 100%;
  782. }
  783. }
  784. /* 商品详情中限制图片大小 */
  785. /deep/ .rich-img {
  786. width: 100% !important;
  787. height: auto;
  788. }
  789. .pinklistbox {
  790. background: #ffffff;
  791. margin-top: 25rpx;
  792. overflow: hidden;
  793. }
  794. .pink_num {
  795. background: -webkit-linear-gradient(left, #fdf5f6, #fbebf6);
  796. padding: 15rpx 25rpx;
  797. font-size: 26rpx;
  798. color: #dd524d;
  799. }
  800. .pint {
  801. background: -webkit-linear-gradient(left, #ff1f4f, #ff0409);
  802. padding: 10rpx 25rpx;
  803. color: #ffffff;
  804. font-size: 24rpx;
  805. border-radius: 25rpx;
  806. .iconenter {
  807. font-size: 15px;
  808. color: #ffffff;
  809. }
  810. }
  811. .pinklist {
  812. padding: 0rpx 25rpx;
  813. padding-top: 45rpx !important;
  814. }
  815. .pinklist_list {
  816. margin-bottom: 10rpx;
  817. }
  818. .pink_img {
  819. width: 100rpx;
  820. height: 100rpx;
  821. image {
  822. width: 100%;
  823. height: 100%;
  824. border-radius: 100%;
  825. }
  826. }
  827. .pink_people {
  828. font-size: 28rpx;
  829. text {
  830. color: #dd524d;
  831. }
  832. }
  833. .pink_time {
  834. font-size: 26rpx;
  835. color: #909399;
  836. }
  837. .pink_name {
  838. width: 200rpx;
  839. overflow: hidden;
  840. white-space: nowrap;
  841. text-overflow: ellipsis;
  842. padding-left: 10rpx;
  843. // background: #FC2A3F;
  844. // height: 50rpx;
  845. }
  846. .More {
  847. width: 100%;
  848. line-height: 2;
  849. background-color: #fc2a3f;
  850. font-size: $font-lg;
  851. margin: 0 auto;
  852. text-align: center;
  853. color: #ffffff;
  854. // border-radius: 50rpx;
  855. }
  856. .ping-plan {
  857. background-color: #FFFFFF;
  858. padding: 25rpx 35rpx;
  859. border-top: 15rpx solid #F3F3F4;
  860. border-bottom: 15rpx solid #F3F3F4;
  861. }
  862. .participate-7 {
  863. color: #000000;
  864. font-size: 29rpx;
  865. font-weight: 500;
  866. padding-bottom: 25rpx;
  867. .participate-7-1 {
  868. .word {
  869. color: #ff0a1a;
  870. }
  871. .word1 {
  872. font-size: 25rpx;
  873. color: #989aa0;
  874. }
  875. image {
  876. width: 10rpx;
  877. height: 20rpx;
  878. margin-left: 15rpx;
  879. }
  880. }
  881. }
  882. //左右顶格加上下居中
  883. .flex-between-center {
  884. display: flex;
  885. justify-content: space-between;
  886. align-items: center;
  887. }
  888. .participate-8 {
  889. image {
  890. width: 26rpx;
  891. height: 12rpx;
  892. }
  893. .participate-8-1 {
  894. text-align: center;
  895. .img1 {
  896. width: 43rpx;
  897. height: 50rpx;
  898. }
  899. .img2 {
  900. width: 43rpx;
  901. height: 42rpx;
  902. }
  903. .img3 {
  904. width: 60rpx;
  905. height: 46rpx;
  906. }
  907. .word-1 {
  908. font-size: 23rpx;
  909. color: #000000;
  910. line-height: 34rpx;
  911. }
  912. .word-2 {
  913. font-size: 21rpx;
  914. color: #91949B;
  915. line-height: 34rpx;
  916. }
  917. }
  918. }
  919. .jg {
  920. background-color: #fff;
  921. height: 60.5rpx;
  922. position: relative;
  923. top: -60.5rpx;
  924. margin-bottom: -60.5rpx;
  925. }
  926. .have-know {
  927. height: 100rpx;
  928. width: 750rpx;
  929. line-height: 1;
  930. padding: 35rpx 0 0 30rpx;
  931. background-color: #fff;
  932. margin: 15rpx 0;
  933. font-size: 32rpx;
  934. font-weight: bold;
  935. color: #3B3B3B;
  936. view {
  937. display: inline-block;
  938. padding-left: 31rpx;
  939. font-size: 26rpx;
  940. font-weight: 500;
  941. color: #8A8A8A;
  942. }
  943. }
  944. .way {
  945. padding: 34rpx 97rpx 0 30rpx;
  946. background-color: #fff;
  947. margin: 15rpx 0;
  948. font-size: 32rpx;
  949. font-weight: bold;
  950. color: #3B3B3B;
  951. line-height: 1;
  952. view {
  953. display: inline-block;
  954. padding-left: 186rpx;
  955. font-size: 26rpx;
  956. font-weight: 500;
  957. color: #8A8A8A;
  958. // width: 100%;
  959. position: relative;
  960. top:-34rpx;
  961. line-height: 1.5;
  962. }
  963. }
  964. .row {
  965. display: flex;
  966. align-items: center;
  967. position: relative;
  968. padding: 0 30rpx;
  969. height: 110rpx;
  970. background: #fff;
  971. .refund {
  972. font-size: 30rpx;
  973. color: $font-color-dark;
  974. padding-left: 128rpx;
  975. }
  976. .noRefund {
  977. font-size: 30rpx;
  978. color: $font-color-light;
  979. padding-left: 128rpx;
  980. }
  981. .tit {
  982. flex-shrink: 0;
  983. width: 120rpx;
  984. font-size: 30rpx;
  985. color: $font-color-dark;
  986. }
  987. .input {
  988. flex: 1;
  989. font-size: 30rpx;
  990. color: $font-color-dark;
  991. padding-left: 128rpx;
  992. &.payColor {
  993. color: $color-red;
  994. }
  995. }
  996. .iconlocation {
  997. font-size: 36rpx;
  998. color: $font-color-light;
  999. }
  1000. }
  1001. </style>