shop.vue 26 KB

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