shop.vue 27 KB

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