shop.vue 26 KB

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