productGroup.vue 27 KB

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