shop.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180
  1. <template>
  2. <view class="container">
  3. <scroll-view style="height: 100vh;" class="floor-list"
  4. :scroll-top="scrollTop" scroll-y="true" @scroll="scroll" @scrolltoupper="upper" @scrolltolower="lower"
  5. :refresher-enabled="false">
  6. <view class="carousel">
  7. <swiper indicator-dots circular=true duration="400">
  8. <swiper-item class="swiper-item" v-for="(item,index) in datalist.images" :key="index">
  9. <view class="image-wrapper">
  10. <image
  11. :src="pictureUrl+'/uploads/home/store/goods/'+item.goodsimage_url.substr(0, item.goodsimage_url.indexOf('\_')) + '/' + item.goodsimage_url"
  12. class="loaded"
  13. mode="aspectFill"
  14. ></image>
  15. </view>
  16. </swiper-item>
  17. </swiper>
  18. </view>
  19. <view class="introduce-section">
  20. <view class="titleLayout" >
  21. <view class="title">{{datalist.goods_name}}</view>
  22. <view @tap="shopDetail" style="display: flex;flex-direction: row;">
  23. <view class="titleRight">
  24. <view style="font-size: 36upx;color: #D9332E;text-align: right;">{{datalist.praise}}%</view>
  25. <view style="color: #606266;font-size: 28upx;">好评率</view>
  26. </view>
  27. <view style="display: flex;align-items: center;">
  28. <uni-icon size="18" type="arrowright"></uni-icon>
  29. </view>
  30. </view>
  31. </view>
  32. <view style="color: #909399;padding: 10upx 0 15upx 0;" v-if="datalist.points>0">购买得{{datalist.points}}圈币</view>
  33. <view class="titleLayout price-box">
  34. <view>
  35. <text class="price-tip">¥</text>
  36. <text class="price">{{datalist.goods_price}}</text>
  37. <text class="m-price">¥{{datalist.goods_marketprice}}</text>
  38. <text class="price-tip" v-if="datalist.goods_storage == 0">已下架</text>
  39. </view>
  40. <view>
  41. <text style="color: #909399">月销售{{datalist.sale_number}}</text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="c-list">
  46. <view style="display: flex;justify-content: space-between;" class="c-row b-b" @click="toggleSpec">
  47. <view style="font-size: 32upx;color: #909399;">规则数量选择</view>
  48. <view>
  49. <uni-icon size="20" type="arrowright"></uni-icon>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 评价 -->
  54. <view @tap="shopDetail" style="border-bottom: 20rpx solid #F5F5F5;" class="eva-section">
  55. <view style="display: flex;justify-content: space-between;" class="c-row b-b">
  56. <view style="font-size: 32upx;color: #909399;">评价</view>
  57. <view>
  58. <uni-icon size="20" type="arrowright"></uni-icon>
  59. </view>
  60. </view>
  61. <assess />
  62. </view>
  63. <!-- :class="iScrolltop == 2?'activeColor' : ''" -->
  64. <view class="detail-desc" >
  65. <van-tabs v-model="active" @click="onChange">
  66. <van-tab :name="0" title="详情">
  67. <view style="padding: 0 32upx;">
  68. <rich-text :nodes="datalist.goods_body"></rich-text>
  69. </view>
  70. </van-tab>
  71. <van-tab :name="1" title="常见问题">
  72. <view style="padding: 0 32upx;">
  73. <rich-text :nodes="datalist.issue"></rich-text>
  74. </view>
  75. </van-tab>
  76. </van-tabs>
  77. </view>
  78. </scroll-view>
  79. <!-- 底部操作菜单 -->
  80. <!-- <view class="page-bottom">
  81. <navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
  82. <text class="yticon icon-xiatubiao--copy"></text>
  83. <text>首页</text>
  84. </navigator>
  85. <navigator url="/pages/index/cart" open-type="navigate" class="p-b-btn">
  86. <text class="yticon icon-gouwuche"></text>
  87. <text>购物车</text>
  88. </navigator>
  89. <view class="p-b-btn" :class="{active: favorite}" @click="toFavorite">
  90. <text class="yticon icon-shoucang"></text>
  91. <text>收藏</text>
  92. </view>
  93. <view class="action-btn-group">
  94. <button type="primary" @click="openCar" class=" action-btn no-border add-cart-btn">加入购物车</button>
  95. <button type="primary" class=" action-btn no-border buy-now-btn" @click="buy">立即购买</button>
  96. </view>
  97. </view> -->
  98. <!-- 规格-模态层弹窗 -->
  99. <view
  100. class="popup spec"
  101. :class="specClass"
  102. @touchmove.stop.prevent="stopPrevent"
  103. @click="toggleSpec"
  104. >
  105. <!-- 遮罩层 -->
  106. <view class="mask"></view>
  107. <view class="layer attr-content" @click.stop="stopPrevent">
  108. <view class="a-t">
  109. <image :src="nuberImg==''?firstImg:nuberImg"></image>
  110. <view class="right">
  111. <text class="price" style="font-size: 36upx;color: #303133">{{totalprice==0?datalist.goods_price:totalprice}}</text>
  112. <view v-if="datalist.spec_list.length > 0 ">
  113. <view class="selected" v-if="specSelected.length > 0 ">
  114. <text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">
  115. {{sItem.value_name}}X {{shopnumber}}
  116. </text>
  117. </view>
  118. <view class="selected" v-else>
  119. <text class="selected-text">
  120. 请选择规格数量
  121. </text>
  122. </view>
  123. </view>
  124. <view v-else>
  125. X {{shopnumber}}
  126. </view>
  127. </view>
  128. <view @click="closeCar" style="position: absolute;right: 10%;">
  129. <uni-icon size="20" type="close"></uni-icon>
  130. </view>
  131. </view>
  132. <view v-for="(item,index) in datalist.spec_list" :key="index" class="attr-list">
  133. <text>{{item.spec_name}}</text>
  134. <view class="item-list">
  135. <!-- v-if="childItem.pid === item.id" , disabled: childItem.goods_storage==0-->
  136. <text
  137. v-for="(childItem, childIndex) in item.value_list"
  138. :key="childIndex" class="tit"
  139. :class="{selected: childItem.selected, disabled: childItem.goods_storage==0}"
  140. @click="selectSpec(index, childItem.value_id, childItem.value_name, childItem.goods_storage)"
  141. >
  142. {{childItem.value_name}}
  143. </text>
  144. </view>
  145. </view>
  146. <view class="numberchange">
  147. <span>数量</span>
  148. <uninumberbox :max="goods_storage" :min="1" @change="changestorage"/>
  149. </view>
  150. </view>
  151. </view>
  152. <!-- 分享 -->
  153. <!-- <share
  154. ref="share"
  155. :contentHeight="580"
  156. :shareList="shareList"
  157. ></share> -->
  158. <View class="page-bottom">
  159. <van-goods-action>
  160. <!-- <van-goods-action-icon @click="goIndex" icon="bag-o" /> -->
  161. <van-goods-action-icon @click="goIndex">
  162. <template slot="icon" style="width: 40upx;height: 40upx;">
  163. <image style="width: 100%;height: 100%;" src='/static/bottombtn0101.png'>
  164. </image>
  165. </template>
  166. </van-goods-action-icon>
  167. <van-goods-action-icon icon="cart-o" @click="openCar" :info="cartnumber" />
  168. <van-goods-action-icon icon="star-o" v-if="has_collected == 0" @click="toFavorite"/>
  169. <van-goods-action-icon icon="star" v-if="has_collected == 1" icon-class="colored" @click="toFavorite"/>
  170. <van-goods-action-button @click="addCar" text="加入购物车" type="warning" />
  171. <van-goods-action-button text="立即购买" @click="buynow" />
  172. </van-goods-action>
  173. </View>
  174. <Gobacktop @getop="getop" :bottomtop="2" v-if="isTop" />
  175. </view>
  176. </template>
  177. <script>
  178. import {
  179. mapMutations,mapState
  180. } from 'vuex'
  181. // import logionDialog from '@/component/loginDialog.vue'
  182. import Gobacktop from '@/component/Gobacktop.vue'
  183. import uninumberbox from '@/component/uinNumber.vue'
  184. import assess from '@/component/assess.vue' // 评价列表
  185. import uniIcon from '@/component/uni-icon/uni-icon.vue'
  186. export default{
  187. components: {
  188. uniIcon,
  189. assess,
  190. uninumberbox,
  191. Gobacktop
  192. },
  193. data() {
  194. return {
  195. isTop: false,
  196. arrayId:[],
  197. bottomtop: '55upx',
  198. scopemapId: 0,
  199. showdialog: false,
  200. has_collected: false, // 是否收藏
  201. cartnumber: 0, // 购物车数量
  202. changnumber: 100,
  203. ismax: false, // 输入狂禁止数量
  204. goods_storage: '', // 规格商品参数
  205. nuberImg:'',
  206. firstImg:'',
  207. shopnumber: 1,
  208. pictureUrl: this.pictureUrl,
  209. datalist: {},
  210. store_id: 0, // 酒店id
  211. goodId: 0, // 商品公共id
  212. goods_id: 0, // 商品规格id
  213. windowHeight: 0, // 窗口高度
  214. iScrolltop: 1,
  215. active: 0,
  216. scrollTop: 0,
  217. old: {
  218. scrollTop: 0
  219. },
  220. specClass: 'none',
  221. specSelected:[],
  222. totalprice:0,
  223. firstprice: 0,
  224. favorite: true,
  225. shareList: [],
  226. imgList: [
  227. ],
  228. desc: `
  229. `,
  230. specList: [
  231. ]
  232. };
  233. },
  234. onLaunch: function(){
  235. this.active = 1;
  236. },
  237. computed:{
  238. ...mapState([
  239. 'hasLogin',
  240. 'userInfo',
  241. 'successlogion'
  242. ]),
  243. },
  244. onShow: function() {
  245. let _this = this;
  246. uni.getSystemInfo({
  247. success: function (res) {
  248. _this.windowHeight = res.screenHeight;
  249. // console.log("屏幕宽度:"+res.screenWidth);
  250. // console.log("屏幕高度:"+res.screenHeight);
  251. // console.log("可使用窗口宽度:"+res.windowWidth);
  252. // console.log("可使用窗口高度:"+res.windowHeight);
  253. }
  254. });
  255. },
  256. async onLoad(options){
  257. this.goodId = options.id; // 商品Id
  258. this.store_id = options.store_id;
  259. this.getshopdetail(); // 获取商品详情
  260. //规格 默认选中第一条
  261. // this.datalist.spec_list[0].value_list.forEach(item=>{
  262. // for(let cItem of this.specChildList){
  263. // if(cItem.pid === item.id){
  264. // this.$set(cItem, 'selected', true);
  265. // this.specSelected.push(cItem);
  266. // break; //forEach不能使用break
  267. // }
  268. // }
  269. // })
  270. //this.shareList = await this.$api.json('shareList');
  271. },
  272. onShareAppMessage(res) {
  273. uni.showShareMenu({
  274. withShareTicket: true
  275. });
  276. let that = this;
  277. let id = this.goodId; // 商品Id
  278. let store_id = this.store_id;
  279. if (res.from === 'button') {
  280. // 来自页面内分享按钮
  281. }
  282. return {
  283. title: that.datalist.goods_name,
  284. path: `/pages/index/shop?id=${id}&store_id=${store_id}`,
  285. imageUrl:that.nuberImg
  286. }
  287. },
  288. onReady: function() {
  289. },
  290. methods:{
  291. getop() {
  292. this.scrollTop = this.old.scrollTop
  293. this.$nextTick(function(){
  294. this.scrollTop=0;
  295. });
  296. this.isTop = false;
  297. },
  298. // 跳转到首页
  299. goIndex() {
  300. let id = this.store_id;
  301. uni.redirectTo({
  302. url: `/pages/index/hotel?id=${id}`
  303. })
  304. // uni.switchTab({
  305. // url:'./index'
  306. // })
  307. // uni.navigateBack();
  308. },
  309. // 更改商品数量
  310. changestorage(e) {
  311. this.shopnumber = e;
  312. let firstprice = this.firstprice;
  313. this.totalprice = firstprice*this.shopnumber;
  314. },
  315. // 获取商品详情
  316. getshopdetail() {
  317. let params = {};
  318. params.goods_commonid =this.goodId;
  319. params.store_id = this.store_id;
  320. this.request({
  321. url:'/v2/goods/detail',
  322. method:'POST',
  323. data: params,
  324. success: (res)=> {
  325. let { data } = res.data;
  326. this.cartnumber = data.cart;
  327. this.has_collected = data.has_collected;
  328. let array = data;
  329. array.images.forEach(item => {
  330. this.firstImg = this.pictureUrl+'/uploads/home/store/goods/'+item.goodsimage_url.substr(0, item.goodsimage_url.indexOf('\_')) + '/' + item.goodsimage_url
  331. })
  332. if(array.spec_list.length == 0) {
  333. this.datalist = data;
  334. this.goods_id = data.goods_list[0].goods_id;
  335. this.goods_storage = data.goods_storage;
  336. //this.specSelected = data.goods_list;
  337. }else {
  338. array.spec_list[0].value_list.forEach( (item,idx) => {
  339. item.goods_storage = data.goods_list[idx].goods_storage;
  340. })
  341. this.datalist = array;
  342. }
  343. const regex1 = new RegExp('stlye="" ', 'gi');
  344. this.datalist.goods_body = this.datalist.goods_body.replace(/\(<img\)/ig, '');
  345. const regex = new RegExp('<img', 'gi');
  346. this.datalist.goods_body = this.datalist.goods_body.replace(regex,
  347. `<img class="changeimg"`);
  348. }
  349. })
  350. },
  351. shopDetail() {
  352. // url: `/pages/index/shop?id=${id}&store_id=${store_id}`
  353. let goodId = this.goodId; // 商品Id
  354. let store_id = this.store_id;
  355. uni.navigateTo({
  356. url: `/pages/index/commemt?goodId=${goodId}&store_id=${store_id}`
  357. });
  358. },
  359. onChange(event) {
  360. this.active = event.detail.name;
  361. console.log(this.active)
  362. },
  363. //规格弹窗开关
  364. toggleSpec() {
  365. this.specClass = 'show';
  366. //this.specSelected = [];
  367. // if(this.specClass === 'show'){
  368. // this.specClass = 'hide';
  369. // setTimeout(() => {
  370. // this.specClass = 'none';
  371. // }, 250);
  372. // }else if(this.specClass === 'none'){
  373. // this.specClass = 'show';
  374. // }
  375. },
  376. // 关闭弹窗
  377. // cancelDiaolog() {
  378. // this.showdialog = false;
  379. // },
  380. // // 确定
  381. // confirmDiaolog() {
  382. // this.showdialog = false;
  383. // uni.navigateTo({
  384. // url: '../myCenter/information' // 我的收藏
  385. // })
  386. // },
  387. openCar() {
  388. if(this.hasLogin && this.successlogion) {
  389. let store_id = this.store_id;
  390. uni.navigateTo({
  391. url:`/pages/index/cart?store_id=${store_id}`
  392. })
  393. }else {
  394. //this.showdialog = true;
  395. uni.navigateTo({
  396. url:'/pages/myCenter/logion'
  397. })
  398. }
  399. },
  400. // 立即购买
  401. buynow() {
  402. if(this.hasLogin && this.successlogion) {
  403. if(this.datalist.store_id == 1 || this.datalist.goods_state != 1 || this.datalist.goods_storage < 1) {
  404. this.$msg("商品已下架");
  405. return;
  406. }
  407. if(this.specSelected.length == 0&&this.datalist.spec_list.length != 0) {
  408. this.$msg("请选择规格数量");
  409. this.specClass = 'show';
  410. return;
  411. }
  412. if(this.specSelected.length == 0&&this.datalist.spec_list.length == 0) {
  413. this.specClass = 'show';
  414. this.specSelected = this.datalist.goods_list;
  415. return;
  416. }
  417. let goods = [];
  418. goods.push({});
  419. goods[0].goods_id = this.goods_id;
  420. goods[0].buy_num = this.shopnumber;
  421. this.request({
  422. url:'/v1/order/save_og',
  423. method: 'post',
  424. data: {
  425. store_id: this.store_id,
  426. goods: JSON.stringify(goods)
  427. },
  428. success:(res) => {
  429. let store = this.store_id;
  430. let order_id = res.data.data.order_id;
  431. this.specClass = 'none';
  432. uni.navigateTo({
  433. url: `/pages/index/sureBuy?store=${store}&order_id=${order_id}`
  434. });
  435. }
  436. })
  437. }else {
  438. uni.navigateTo({
  439. url:'/pages/myCenter/logion'
  440. })
  441. }
  442. },
  443. // 加入购物车
  444. addCar() {
  445. if(this.hasLogin && this.successlogion) {
  446. if(this.datalist.store_id == 1 || this.datalist.goods_state != 1 || this.datalist.goods_storage < 1) {
  447. this.$msg("商品已下架");
  448. return;
  449. }
  450. if(this.specSelected.length == 0&&this.datalist.spec_list.length == 0) {
  451. this.specClass = 'show';
  452. this.specSelected = this.datalist.goods_list;
  453. return;
  454. }
  455. if(this.specSelected.length == 0&&this.datalist.spec_list.length != 0) {
  456. this.specClass = 'show';
  457. this.$msg("请选择规格数量");
  458. return;
  459. }else {
  460. this.request({
  461. url:'/v2/order/add_cart',
  462. method:'POST',
  463. data: {
  464. goods_id: this.goods_id,
  465. goods_num: this.shopnumber
  466. },
  467. success: () => {
  468. this.$msg("商品添加成功");
  469. this.specClass = 'none';
  470. this.getshopdetail();
  471. }
  472. })
  473. }
  474. }else {
  475. uni.navigateTo({
  476. url:'/pages/myCenter/logion'
  477. })
  478. }
  479. },
  480. closeCar() {
  481. this.specClass = 'none';
  482. },
  483. //选择规格
  484. selectSpec(index, pid,value_name,goods_storage){
  485. this.specSelected = [];
  486. if(goods_storage == 0) {
  487. this.$msg("商品没库存啦")
  488. return;
  489. }
  490. let list = this.datalist.spec_list[index].value_list;
  491. this.datalist.spec_list[index].value_list.forEach(item=>{
  492. if(item.value_id === pid){
  493. this.$set(item, 'selected', true);
  494. }else {
  495. this.$set(item, 'selected', false);
  496. }
  497. })
  498. let array = [];
  499. for(let i = 0; i < this.datalist.spec_list.length; i++) {
  500. for(let j = 0; j<this.datalist.spec_list[i].value_list.length;j++) {
  501. if(this.datalist.spec_list[i].value_list[j].selected) {
  502. array.push(this.datalist.spec_list[i].value_list[j].value_id);
  503. }
  504. }
  505. }
  506. this.arrayId = array;
  507. if(this.arrayId.length == this.datalist.spec_list.length) {
  508. this.scopemapId = array.join("_");
  509. let goodId = this.datalist.spec_map[this.scopemapId]; //
  510. let items = this.datalist.goods_list[goodId]
  511. items.value_name = value_name;
  512. this.nuberImg = items.spec_img;
  513. this.specSelected.push(items)
  514. this.goods_storage = items.goods_storage;
  515. this.goods_id = items.goods_id;
  516. this.firstprice = items.goods_price;
  517. this.totalprice = items.goods_price*this.shopnumber;
  518. }
  519. // if(this.arrayId.length == this.datalist.spec_list.length) {
  520. // }
  521. // let obj = {};
  522. // obj.firstId = index;
  523. // obj.pid = pid;
  524. // this.arrayId.push(obj);
  525. // console.log(this.arrayId)
  526. // let arr = this.arrayId;
  527. // for(var i=0; i<arr.length; i++){
  528. // for(var j=i+1; j<arr.length; j++){
  529. // if(arr[i].firstId==arr[j].firstId){
  530. // arr.splice(j,1);
  531. // j--;
  532. // }
  533. // }
  534. // }
  535. // let newarray = []
  536. // arr.forEach(item => {
  537. // newarray.push(item.pid);
  538. // })
  539. // this.arrayId = arr;
  540. // if(this.arrayId.length == 0) {
  541. // this.scopemapId = newarray.toString(); ;
  542. // }else {
  543. // this.scopemapId = newarray.join("_");
  544. // }
  545. // console.log(this.scopemapId);
  546. //this.datalist.spec_list[index].value_list = list;
  547. },
  548. // 滚动到顶部
  549. upper(e) {
  550. },
  551. // 滚到底部
  552. lower(e) {
  553. console.log("底部")
  554. },
  555. // 滚动时触发
  556. scroll(e) {
  557. this.old.scrollTop = e.detail.scrollTop
  558. if(e.detail.scrollTop > this.windowHeight) {
  559. this.iScrolltop = 2;
  560. }else {
  561. this.iScrolltop = 1;
  562. }
  563. if(e.detail.scrollTop > 400) {
  564. this.isTop = true;
  565. }else{ //当距离小于500时显示回到顶部按钮
  566. this.isTop = false;
  567. }
  568. },
  569. //收藏
  570. toFavorite(){
  571. if(this.hasLogin && this.successlogion) {
  572. this.request({
  573. url: '/v1/favorites/collect',
  574. method: 'post',
  575. data: {
  576. type:'goods',
  577. fav_id: this.goodId
  578. },
  579. success: () => {
  580. this.getshopdetail()
  581. }
  582. })
  583. }else {
  584. uni.navigateTo({
  585. url:'/pages/myCenter/logion'
  586. })
  587. }
  588. //this.favorite = !this.favorite;
  589. },
  590. buy(){
  591. uni.navigateTo({
  592. url: './sureBuy'
  593. })
  594. },
  595. stopPrevent(){}
  596. },
  597. }
  598. </script>
  599. <style lang='scss'>
  600. page{
  601. /* background: $page-color-base; */
  602. /* padding-bottom: 160upx; */
  603. position: relative;
  604. }
  605. .icon-you{
  606. font-size: 28upx + 2upx;
  607. color: #888;
  608. }
  609. .carousel {
  610. height: 722upx;
  611. position:relative;
  612. swiper{
  613. height: 100%;
  614. }
  615. .image-wrapper{
  616. width: 100%;
  617. height: 100%;
  618. }
  619. .swiper-item {
  620. display: flex;
  621. justify-content: center;
  622. align-content: center;
  623. height: 750upx;
  624. overflow: hidden;
  625. image {
  626. width: 100%;
  627. height: 100%;
  628. }
  629. }
  630. }
  631. .titleLayout {
  632. display: flex;
  633. justify-content: space-between;
  634. padding-bottom: 20upx;
  635. }
  636. /* 标题简介 */
  637. .introduce-section{
  638. background: #fff;
  639. padding: 20upx 30upx;
  640. .title{
  641. font-size: 36upx;
  642. color: #303133;
  643. height: 50upx;
  644. line-height: 50upx;
  645. width: 70%;
  646. white-space:nowrap;
  647. overflow:hidden;
  648. text-overflow:ellipsis;
  649. }
  650. .titleRight {
  651. border-left: 1px solid #F5F5F5;
  652. padding-left: 32upx;
  653. }
  654. .price-box{
  655. display:flex;
  656. align-items:baseline;
  657. height: 64upx;
  658. padding: 10upx 0;
  659. font-size: 26upx;
  660. color:#fa436a;
  661. }
  662. .price{
  663. font-size: $font-lg + 2upx;
  664. }
  665. .m-price{
  666. margin:0 12upx;
  667. color: #909399;
  668. text-decoration: line-through;
  669. }
  670. .coupon-tip{
  671. align-items: center;
  672. padding: 4upx 10upx;
  673. background: #fa436a;
  674. font-size: 24upx;
  675. color: #fff;
  676. border-radius: 6upx;
  677. line-height: 1;
  678. transform: translateY(-4upx);
  679. }
  680. .bot-row{
  681. display:flex;
  682. align-items:center;
  683. height: 50upx;
  684. font-size: 24upx;
  685. color: #909399;
  686. text{
  687. flex: 1;
  688. }
  689. }
  690. }
  691. /* 分享 */
  692. .share-section{
  693. display:flex;
  694. align-items:center;
  695. color: #606266;
  696. background: linear-gradient(left, #fdf5f6, #fbebf6);
  697. padding: 12upx 30upx;
  698. .share-icon{
  699. display:flex;
  700. align-items:center;
  701. width: 70upx;
  702. height: 30upx;
  703. line-height: 1;
  704. border: 1px solid #fa436a;
  705. border-radius: 4upx;
  706. position:relative;
  707. overflow: hidden;
  708. font-size: 22upx;
  709. color: #fa436a;
  710. &:after{
  711. content: '';
  712. width: 50upx;
  713. height: 50upx;
  714. border-radius: 50%;
  715. left: -20upx;
  716. top: -12upx;
  717. position:absolute;
  718. background: #fa436a;
  719. }
  720. }
  721. .icon-xingxing{
  722. position:relative;
  723. z-index: 1;
  724. font-size: 24upx;
  725. margin-left: 2upx;
  726. margin-right: 10upx;
  727. color: #fff;
  728. line-height: 1;
  729. }
  730. .tit{
  731. font-size: 28upx;
  732. margin-left:10upx;
  733. }
  734. .icon-bangzhu1{
  735. padding: 10upx;
  736. font-size: 30upx;
  737. line-height: 1;
  738. }
  739. .share-btn{
  740. flex: 1;
  741. text-align:right;
  742. font-size: 24upx;
  743. color: #fa436a;
  744. }
  745. .icon-you{
  746. font-size: 24upx;
  747. margin-left: 4upx;
  748. color: #fa436a;
  749. }
  750. }
  751. .c-list{
  752. font-size: 24upx + 2upx;
  753. color: #606266;
  754. background: #fff;
  755. border-top: 20upx solid #F5F5F5;
  756. border-bottom: 20upx solid #F5F5F5;
  757. .c-row{
  758. display:flex;
  759. align-items:center;
  760. padding: 20upx 30upx;
  761. position:relative;
  762. }
  763. .tit{
  764. width: 140upx;
  765. }
  766. .con{
  767. flex: 1;
  768. color: #303133;
  769. .selected-text{
  770. margin-right: 10upx;
  771. }
  772. }
  773. .bz-list{
  774. height: 40upx;
  775. font-size: 24upx+2upx;
  776. color: #303133;
  777. text{
  778. display: inline-block;
  779. margin-right: 30upx;
  780. }
  781. }
  782. .con-list{
  783. flex: 1;
  784. display:flex;
  785. flex-direction: column;
  786. color: #303133;
  787. line-height: 40upx;
  788. }
  789. .red{
  790. color: #fa436a;
  791. }
  792. }
  793. /* 评价 */
  794. .eva-section{
  795. display: flex;
  796. flex-direction: column;
  797. padding: 20upx 30upx;
  798. background: #fff;
  799. margin-top: 16upx;
  800. .e-header{
  801. display: flex;
  802. align-items: center;
  803. height: 70upx;
  804. font-size: 24upx + 2upx;
  805. color: #909399;
  806. .tit{
  807. font-size: 28upx + 2upx;
  808. color: #303133;
  809. margin-right: 4upx;
  810. }
  811. .tip{
  812. flex: 1;
  813. text-align: right;
  814. }
  815. .icon-you{
  816. margin-left: 10upx;
  817. }
  818. }
  819. }
  820. .eva-box{
  821. display: flex;
  822. padding: 20upx 0;
  823. .portrait{
  824. flex-shrink: 0;
  825. width: 80upx;
  826. height: 80upx;
  827. border-radius: 100px;
  828. }
  829. .right{
  830. flex: 1;
  831. display: flex;
  832. flex-direction: column;
  833. font-size: 28upx;
  834. color: #606266;
  835. padding-left: 26upx;
  836. .con{
  837. font-size: 28upx;
  838. color: #303133;
  839. padding: 20upx 0;
  840. }
  841. .bot{
  842. display: flex;
  843. justify-content: space-between;
  844. font-size: 24upx;
  845. color:#909399;
  846. }
  847. }
  848. }
  849. /* 详情 */
  850. .detail-desc{
  851. background: #fff;
  852. margin-top: 16upx;
  853. margin-bottom: 135rpx;
  854. width: 100%;
  855. .d-header{
  856. display: flex;
  857. justify-content: center;
  858. align-items: center;
  859. height: 80upx;
  860. font-size: 28upx + 2upx;
  861. color: #303133;
  862. position: relative;
  863. text{
  864. padding: 0 20upx;
  865. background: #fff;
  866. position: relative;
  867. z-index: 1;
  868. }
  869. &:after{
  870. position: absolute;
  871. left: 50%;
  872. top: 50%;
  873. transform: translateX(-50%);
  874. width: 300upx;
  875. height: 0;
  876. content: '';
  877. border-bottom: 1px solid #ccc;
  878. }
  879. }
  880. }
  881. /* 规格选择弹窗 */
  882. .attr-content{
  883. padding: 10upx 30upx;
  884. .a-t{
  885. display: flex;
  886. image{
  887. width: 170upx;
  888. height: 170upx;
  889. flex-shrink: 0;
  890. margin-top: -40upx;
  891. border-radius: 8upx;;
  892. }
  893. .right{
  894. display: flex;
  895. flex-direction: column;
  896. padding-left: 24upx;
  897. font-size: 24upx + 2upx;
  898. color: #606266;
  899. line-height: 42upx;
  900. justify-content: space-around;
  901. .price{
  902. font-size: $font-lg;
  903. color: #fa436a;
  904. margin-bottom: 10upx;
  905. }
  906. .selected-text{
  907. margin-right: 10upx;
  908. }
  909. }
  910. }
  911. .attr-list{
  912. display: flex;
  913. flex-direction: column;
  914. font-size: 28upx + 2upx;
  915. color: #606266;
  916. padding-top: 30upx;
  917. padding-left: 10upx;
  918. }
  919. .item-list{
  920. padding: 20upx 0 0;
  921. display: flex;
  922. flex-wrap: wrap;
  923. text{
  924. display: flex;
  925. align-items: center;
  926. justify-content: center;
  927. background: #eee;
  928. margin-right: 20upx;
  929. margin-bottom: 20upx;
  930. border-radius: 100upx;
  931. min-width: 60upx;
  932. height: 60upx;
  933. padding: 0 20upx;
  934. font-size: 28upx;
  935. color: #303133;
  936. }
  937. .selected{
  938. background: #fbebee;
  939. color: #fa436a;
  940. }
  941. .disabled {
  942. color:#999;
  943. background: rgba(245,245,245, 0.5);
  944. }
  945. }
  946. }
  947. /* 弹出层 */
  948. .popup {
  949. position: fixed;
  950. left: 0;
  951. top: 0;
  952. right: 0;
  953. bottom: 100upx;
  954. z-index: 99;
  955. &.show {
  956. display: block;
  957. .mask{
  958. animation: showPopup 0.2s linear both;
  959. }
  960. .layer {
  961. animation: showLayer 0.2s linear both;
  962. }
  963. }
  964. &.hide {
  965. .mask{
  966. animation: hidePopup 0.2s linear both;
  967. }
  968. .layer {
  969. animation: hideLayer 0.2s linear both;
  970. }
  971. }
  972. &.none {
  973. display: none;
  974. }
  975. .mask{
  976. position: fixed;
  977. top: 0;
  978. width: 100%;
  979. height: 90%;
  980. z-index: 1;
  981. background-color: rgba(0, 0, 0, 0.4);
  982. }
  983. .layer {
  984. position: fixed;
  985. z-index: 99;
  986. bottom: 100upx;
  987. width: 100%;
  988. min-height: 40vh;
  989. border-radius: 10upx 10upx 0 0;
  990. background-color: #fff;
  991. .btn{
  992. height: 66upx;
  993. line-height: 66upx;
  994. border-radius: 100upx;
  995. background: #fa436a;
  996. font-size: 28upx + 2upx;
  997. color: #fff;
  998. margin: 30upx auto 20upx;
  999. }
  1000. }
  1001. @keyframes showPopup {
  1002. 0% {
  1003. opacity: 0;
  1004. }
  1005. 100% {
  1006. opacity: 1;
  1007. }
  1008. }
  1009. @keyframes hidePopup {
  1010. 0% {
  1011. opacity: 1;
  1012. }
  1013. 90% {
  1014. opacity: 0;
  1015. }
  1016. }
  1017. @keyframes showLayer {
  1018. 0% {
  1019. transform: translateY(120%);
  1020. }
  1021. 100% {
  1022. transform: translateY(0%);
  1023. }
  1024. }
  1025. @keyframes hideLayer {
  1026. 0% {
  1027. transform: translateY(0);
  1028. }
  1029. 100% {
  1030. transform: translateY(120%);
  1031. }
  1032. }
  1033. }
  1034. .colored {
  1035. color: red;
  1036. }
  1037. .van-sticky {
  1038. /* z-index: 0!important; */
  1039. }
  1040. /* 详情固定 */
  1041. .activeColor {
  1042. /* background: #fff!important; */
  1043. position: fixed;
  1044. background-color: #fff;
  1045. top: 0upx;
  1046. z-index: 99;
  1047. margin-top: 0;
  1048. }
  1049. .numberchange {
  1050. padding-top: 48px;
  1051. overflow: hidden;
  1052. clear: both;
  1053. padding-right: 59rpx;
  1054. }
  1055. .uni-numbox {
  1056. float: right;
  1057. }
  1058. /* 底部操作菜单 */
  1059. .page-bottom{
  1060. position: fixed;
  1061. left: 0;
  1062. bottom: 0;
  1063. display: flex;
  1064. justify-content: center;
  1065. align-items: center;
  1066. width: 100vw;
  1067. height: 100upx;
  1068. z-index: 99;
  1069. background: rgba(255,255,255,.9);
  1070. .p-b-btn{
  1071. display:flex;
  1072. flex-direction: column;
  1073. align-items: center;
  1074. justify-content: center;
  1075. font-size: 24upx;
  1076. color: #606266;
  1077. width: 96upx;
  1078. height: 80upx;
  1079. .yticon{
  1080. font-size: 40upx;
  1081. line-height: 48upx;
  1082. color: #909399;
  1083. }
  1084. &.active, &.active .yticon{
  1085. color: #fa436a;
  1086. }
  1087. .icon-fenxiang2{
  1088. font-size: 42upx;
  1089. transform: translateY(-2upx);
  1090. }
  1091. .icon-shoucang{
  1092. font-size: 46upx;
  1093. }
  1094. }
  1095. .action-btn-group{
  1096. display: flex;
  1097. height: 76upx;
  1098. border-radius: 100px;
  1099. overflow: hidden;
  1100. box-shadow: 0 20upx 40upx -16upx #fa436a;
  1101. box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  1102. background: linear-gradient(to right, #ffac30,#fa436a,#F56C6C);
  1103. margin-left: 20upx;
  1104. position:relative;
  1105. &:after{
  1106. content: '';
  1107. position:absolute;
  1108. top: 50%;
  1109. right: 50%;
  1110. transform: translateY(-50%);
  1111. height: 28upx;
  1112. width: 0;
  1113. border-right: 1px solid rgba(255,255,255,.5);
  1114. }
  1115. .action-btn{
  1116. display:flex;
  1117. align-items: center;
  1118. justify-content: center;
  1119. width: 180upx;
  1120. height: 100%;
  1121. font-size: 28upx ;
  1122. padding: 0;
  1123. border-radius: 0;
  1124. background: transparent;
  1125. }
  1126. }
  1127. }
  1128. .changeimg {
  1129. width: 100%;
  1130. height: auto!important;
  1131. display: block;
  1132. text-align: center;
  1133. }
  1134. </style>