shop.vue 27 KB

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