shop.vue 27 KB

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