product.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294
  1. <template>
  2. <view :class="[AppTheme]" class="container" v-if="cache">
  3. <view class="carousel">
  4. <u-swiper :list="appalbum" indicator indicatorMode="line" circular radius="0" height="750rpx" showTitle
  5. :autoplay="true" @click="previewImage(index)">
  6. </u-swiper>
  7. </view>
  8. <view class="introduce-section">
  9. <text class="title">{{ cache.name }}</text>
  10. <view class="price-box">
  11. <text class="price-tip">¥</text>
  12. <text class="price text-neutral">{{ cache.price }}</text>
  13. <text class="m-price">¥{{ cache.oprice }}</text>
  14. <!-- <text class="coupon-tip">7折</text> -->
  15. </view>
  16. <view class="bot-row">
  17. <text>销量: {{ cache.dissells }}</text>
  18. <text>单位: {{ cache.unit }}</text>
  19. <text>库存: {{ cache.num }}</text>
  20. </view>
  21. </view>
  22. <!-- 分享 -->
  23. <view class="share-section">
  24. <view class="share-icon">
  25. <text class="yticon icon-xingxing"></text>
  26. </view>
  27. <text class="tit">该商品分享可得佣金</text>
  28. <text class="yticon icon-bangzhu1"></text>
  29. <view class="share-btn" @click="opensharebox">
  30. <u-icon name="share" :color="primary" size="20"></u-icon>
  31. </view>
  32. </view>
  33. <view class="c-list">
  34. <view class="c-row b-b" @click="toggleSpec(0)">
  35. <text class="tit">购买类型</text>
  36. <view class="con">
  37. <text class="selected-text" v-for="(sItem, sIndex) in specSelected"
  38. :key="sIndex">{{ sItem.name }}</text>
  39. </view>
  40. <text class="yticon icon-you"></text>
  41. </view>
  42. <view class="c-row b-b">
  43. <text class="tit">温馨提示</text>
  44. <view class="bz-list con">
  45. <text>{{ cache.title }}</text>
  46. </view>
  47. </view>
  48. <!-- <view class="c-row b-b">
  49. <text class="tit">促销活动</text>
  50. <view class="con-list">
  51. <text>新人首单送20元无门槛代金券</text>
  52. <text>订单满50减10</text>
  53. <text>订单满100减30</text>
  54. <text>单笔购买满两件免邮费</text>
  55. </view>
  56. </view>
  57. <view class="c-row b-b">
  58. <text class="tit">服务</text>
  59. <view class="bz-list con">
  60. <text>7天无理由退换货 ·</text>
  61. <text>假一赔十 ·</text>
  62. </view>
  63. </view> -->
  64. </view>
  65. <view v-if="ifpeon" class="sel">
  66. <view>
  67. <u-checkbox-group size='35rpx' active-color="green" @change="checkboxChange">
  68. <u-checkbox name='tgxy' shape="circle" :checked="isChecked"></u-checkbox>
  69. </u-checkbox-group>
  70. </view>
  71. <text class="text" @click="goContract(partyinfo.id, 2)">
  72. 阅读并同意
  73. <text class="text-primary">《{{ partyinfo != null ? partyinfo.name : '暂无' }}》</text>
  74. </text>
  75. </view>
  76. <!-- 评价 -->
  77. <!-- <view class="eva-section">
  78. <view class="e-header">
  79. <text class="tit">评价</text>
  80. <text>(86)</text>
  81. <text class="tip">好评率 100%</text>
  82. <text class="yticon icon-you"></text>
  83. </view>
  84. <view class="eva-box">
  85. <image class="portrait" src="http://img3.imgtn.bdimg.com/it/u=1150341365,1327279810&fm=26&gp=0.jpg" mode="aspectFill"></image>
  86. <view class="right">
  87. <text class="name">Leo yo</text>
  88. <text class="con">商品收到了,79元两件,质量不错,试了一下有点瘦,但是加个外罩很漂亮,我很喜欢</text>
  89. <view class="bot">
  90. <text class="attr">购买类型:XL 红色</text>
  91. <text class="time">2019-04-01 19:21</text>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. -->
  97. <view class="farm" v-if="cache.farm_id">
  98. <view class="text_area">
  99. <view class="shop_name">
  100. <image :src="farm_info.farm_logo" :lazy-load="true" class="shop_thumbnail"></image>
  101. <view class="right_shop_mess">
  102. <view class="shop_line">
  103. <view class="shop_line_p1">{{farm_info.farm_name}}
  104. </view>
  105. <view class="right_shop_mess_p2" @click="gostoredetail(farm_info.id)">
  106. 进店逛逛
  107. </view>
  108. </view>
  109. <view class="shop_line_fl">
  110. </view>
  111. <view class="shop_line">
  112. <view class="shop_line_p2">
  113. <u-icon name="map" size="20" color="#9C9C9C"></u-icon>
  114. <view class="address">
  115. {{farm_info.farm_address}}
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="shop_one">
  123. <view class="shop_one_1">
  124. <view class="view1">{{farm_info.page_view}}</view>
  125. <view class="view2">访客数</view>
  126. </view>
  127. <view>
  128. <u-line color="#999998" direction="col" length='60%'></u-line>
  129. </view>
  130. <view class="shop_one_1">
  131. <view class="view1">{{farm_info.shopnum}}</view>
  132. <view class="view2">全部商品</view>
  133. </view>
  134. <view>
  135. <u-line color="#999998" direction="col" length='60%'></u-line>
  136. </view>
  137. <view class="shop_one_1">
  138. <view class="view1">{{farm_info.shoporder}}</view>
  139. <view class="view2">已售出</view>
  140. </view>
  141. </view>
  142. <!-- <view style="padding: 0 0 20rpx 0;">
  143. <u-album singleSize="75" multipleSize='75' singleMode="aspectFill"
  144. multipleMode="aspectFill" :urls="farm_info.detail_img" maxCount="4" :showMore='true'
  145. rowCount="4"></u-album>
  146. </view> -->
  147. </view>
  148. <view class="detail-desc">
  149. <view class="d-header"><text>商品详情</text></view>
  150. <u-parse :content="cache.content" :lazy-load="true" :show-with-animation="true">
  151. </u-parse>
  152. </view>
  153. <!-- 底部操作菜单 -->
  154. <view class="page-bottom">
  155. <navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
  156. <u-icon labelSize="12" color="#909399" label="首页" labelPos="bottom" labelColor="#909399" size="25"
  157. name="home"></u-icon>
  158. </navigator>
  159. <view class="p-b-btn" @click="gouwuche">
  160. <view class="">
  161. <u-icon labelSize="12" color="#909399" label="购物车" labelPos="bottom" labelColor="#909399" size="25"
  162. name="shopping-cart"></u-icon>
  163. </view>
  164. <view class="badge">
  165. <u-badge v-if="list.count" :showZero="false" size="mini" bgColor="red" :offset="offset"
  166. type="success" :value="list.count"></u-badge>
  167. </view>
  168. </view>
  169. <view class="p-b-btn " :class="{ active: favorite }" @click="toFavorite">
  170. <u-icon labelSize="12" :color="favorite?primary:'#909399'" label="收藏" labelPos="bottom"
  171. :labelColor="favorite?primary:'#909399'" size="25" name="heart-fill"></u-icon>
  172. </view>
  173. <view class="action-btn-group bg-linear-gradient">
  174. <button type="primary" class=" action-btn no-border add-cart-btn" @click="buy(1)">加入购物车</button>
  175. <button type="primary" class=" action-btn no-border buy-now-btn" @click="buy(2)">立即购买</button>
  176. </view>
  177. </view>
  178. <!-- 规格-模态层弹窗 -->
  179. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec(0)">
  180. <!-- 遮罩层 -->
  181. <view class="mask"></view>
  182. <view class="layer attr-content" @click.stop="stopPrevent">
  183. <view class="a-t">
  184. <image :src=" apppic" v-if="apppic"></image>
  185. <view class="right">
  186. <text class="price text-neutral">¥{{ cache.price }}</text>
  187. <text class="stock">库存:{{ cache.num }}件</text>
  188. <view class="selected" v-if="skujson.length>0">
  189. 已选:
  190. <text class="selected-text">{{ sku.skuattr }}</text>
  191. </view>
  192. </view>
  193. </view>
  194. <view v-for="(item, index) in list.skuinfo" :key="index" class="attr-list">
  195. <text>{{ item.attrlabel }}</text>
  196. <view class="item-list">
  197. <text v-for="(childItem, childIndex) in item.allitems" v-if="childItem.checked === 1"
  198. :key="childIndex" class="tit" :class="{ selected: childItem.selected }"
  199. @click="selectSpec(childIndex, childItem.pid, item)">
  200. {{ childItem.name }}
  201. </text>
  202. </view>
  203. </view>
  204. <view class="row-between">
  205. <text>数量</text>
  206. <u-number-box v-model="num" @change="valChange" :max="cache.num * 1"></u-number-box>
  207. </view>
  208. <button class="btn bg-linear-gradient" @click="toggleSpec(isOpen)">完成</button>
  209. </view>
  210. </view>
  211. <!-- #ifdef MP-WEIXIN -->
  212. <nologin ref="nologin" v-on:loginback="loginback"></nologin>
  213. <!-- #endif -->
  214. <!-- 分享 -->
  215. <sharebox ref="sbox" v-if="sharedata" :data="sharedata"></sharebox>
  216. <admyself :opshow="true"></admyself>
  217. <tarpty :list='parttext' :tarptyshow="tarptyshow" @tarptycolse='tarptycolse' :type='2'></tarpty>
  218. </view>
  219. </template>
  220. <script>
  221. import api from '@/api/mall/index.js';
  222. import nologin from '@/components/nologin/nologin.vue';
  223. import tarpty from '@/components/ui-tarpty/ui-tarpty.vue';
  224. export default {
  225. components: {
  226. nologin,
  227. tarpty
  228. },
  229. data() {
  230. return {
  231. parttext: '',
  232. isChecked: false,
  233. tarptyshow: false,
  234. tarpty: '',
  235. partyinfo: {},
  236. ifpeon: false,
  237. primary: this.$theme.primary,
  238. goodslike: false,
  239. specClass: 'none',
  240. specSelected: [],
  241. offset: [5, 496],
  242. num: 1, // 默认为1
  243. list: '',
  244. cache: '',
  245. apppic: '',
  246. skujson: '',
  247. sku: '',
  248. isOpen: 0,
  249. favorite: false,
  250. shareList: [],
  251. imgList: [],
  252. specList: [],
  253. specChildList: [],
  254. settingFile: getApp().globalData.siteinfo,
  255. timer: null,
  256. appalbum: [],
  257. isc: '',
  258. sharedata: null,
  259. farm_info:''
  260. };
  261. },
  262. onLoad(options) {
  263. //接收传值,id里面放的是标题,因为测试数据并没写id
  264. this.$bindid.getbindid(options, this.$store);
  265. let id = options.id;
  266. this.isc = options.isc;
  267. this.shoopgoods(id);
  268. },
  269. onShow() {
  270. },
  271. onShareAppMessage(res) {
  272. let that = this
  273. let data = {
  274. title: that.sharedata.title,
  275. imageUrl: that.sharedata.imageUrl,
  276. path: that.sharedata.path
  277. };
  278. return data;
  279. },
  280. onShareTimeline(res) {
  281. let that = this
  282. let data = {
  283. title: that.sharedata.title,
  284. imageUrl: that.sharedata.imageUrl,
  285. path: that.sharedata.path
  286. };
  287. return data;
  288. },
  289. methods: {
  290. checkboxChange(e) {
  291. this.tarpty = e
  292. },
  293. goContract(id, type) {
  294. console.log(id,type,'kkkkkk')
  295. if (!this.parttext) {
  296. this.$api.msg(`暂无租赁协议,联系客服添加`);
  297. return;
  298. } else {
  299. this.tarptyshow = true
  300. }
  301. console.log(this.tarptyshow,'this.tarptyshow')
  302. },
  303. gostoredetail(farmid) { //跳转店铺详情
  304. uni.navigateTo({
  305. url: "/pagesC/pages/merchantdetails/merchantdetails?id=" + farmid
  306. })
  307. },
  308. loginback() {
  309. //登录回调
  310. },
  311. previewImage(index) { //预览商品详情轮播图片
  312. uni.previewImage({
  313. current: index,
  314. urls: this.appalbum,
  315. indicator: 'number'
  316. })
  317. },
  318. //规格弹窗开关
  319. toggleSpec(index) {
  320. /* 如果只点击规格 则不进行购买 || 添加购物车 */
  321. if (index == 0) {
  322. this.isOpen = 0
  323. if (this.specClass === 'show') {
  324. this.specClass = 'hide';
  325. setTimeout(() => {
  326. this.specClass = 'none';
  327. }, 250);
  328. } else if (this.specClass === 'none') {
  329. this.specClass = 'show';
  330. }
  331. return
  332. }
  333. if (index == 1) {
  334. if (this.specClass === 'show') {
  335. this.stock();
  336. let id = uni.getStorageSync('userInfo').id;
  337. let obj = {
  338. sid: 0,
  339. goodstype: this.cache.type,
  340. goodsid: this.cache.id,
  341. num: this.num,
  342. isame: this.list.isadmin,
  343. sku: this.sku.sku,
  344. vipid: id
  345. };
  346. api.addtobasket(obj).then(res => {
  347. uni.showToast({
  348. title: res.data.msg,
  349. icon: 'none', //如果要纯文本,不要icon,将值设为'none'
  350. duration: 2000 //持续时间为 2秒
  351. })
  352. if (res.status == 200) {
  353. this.list.count = this.list.count + this.num;
  354. uni.showToast({
  355. title: res.data.msg,
  356. icon: 'none', //如果要纯文本,不要icon,将值设为'none'
  357. duration: 2000 //持续时间为 2秒
  358. })
  359. }
  360. });
  361. this.specClass = 'hide';
  362. setTimeout(() => {
  363. this.specClass = 'none';
  364. }, 250);
  365. } else if (this.specClass === 'none') {
  366. this.specClass = 'show';
  367. }
  368. return
  369. }
  370. /* 如果点击立即购买则为 2 */
  371. if (index == 2) {
  372. if (this.specClass === 'show') {
  373. this.stock();
  374. let id = uni.getStorageSync('userInfo').id;
  375. let obj = {
  376. sid: 0,
  377. goodstype: this.cache.type,
  378. goodsid: this.cache.id,
  379. num: this.num,
  380. isame: this.list.isadmin,
  381. sku: this.sku.sku,
  382. vipid: id
  383. };
  384. api.fastbuys(obj).then(res => {
  385. if (res.status == 200) {
  386. uni.showToast({
  387. icon: 'loading',
  388. title: '生成订单',
  389. duration: 2000
  390. });
  391. setTimeout(() => {
  392. this.$u.route('/pagesD/pages/order/createOrder', {
  393. id,
  394. sid: 0,
  395. goodstype: this.cache.type,
  396. lasturl: this.list.lasturl,
  397. ftype: 2,
  398. goodsid: this.cache.id,
  399. });
  400. }, 2000);
  401. } else {
  402. this.$u.toast(res.msg);
  403. }
  404. });
  405. this.specClass = 'hide';
  406. setTimeout(() => {
  407. this.isOpen = 0
  408. this.specClass = 'none';
  409. }, 250);
  410. } else if (this.specClass === 'none') {
  411. this.specClass = 'show';
  412. }
  413. return
  414. }
  415. },
  416. //选择规格
  417. selectSpec(index, pid, item) {
  418. let list = item.allitems;
  419. let arr_sku = this.cache.id;
  420. list.forEach(item => {
  421. this.$set(item, 'selected', false);
  422. });
  423. this.$set(list[index], 'selected', true);
  424. for (let cItem of this.list.skuinfo) {
  425. for (let cItem2 of cItem.allitems) {
  426. if (cItem2.checked == 1 && cItem2.selected == true) {
  427. arr_sku += '-' + cItem2.path
  428. }
  429. }
  430. }
  431. if (this.skujson) {
  432. this.sku = this.skujson[arr_sku];
  433. }
  434. },
  435. //分享
  436. opensharebox() {
  437. this.$refs.sbox.opensharebox(this.sharedata);
  438. },
  439. //收藏
  440. toFavorite() {
  441. if (this.timer) return
  442. this.timer = setTimeout(() => {}, 1000)
  443. this.favorite = !this.favorite;
  444. let data = {
  445. id: this.cache.id,
  446. status: Number(this.favorite),
  447. goodstype: this.cache.type
  448. }
  449. api.goodslike(data).then(res => {
  450. this.timer = null
  451. this.$u.toast(res.msg)
  452. if (res.msg == "收藏成功") {
  453. this.goodslike = true
  454. } else if (res.msg == "取消成功") {
  455. this.goodslike = false
  456. }
  457. if (this.isc) {
  458. let pages = getCurrentPages();
  459. let prevPage = pages[pages.length - 2]; //获取到A页面
  460. prevPage.onLoad(); // 执行前一个页面的onLoad方法
  461. }
  462. })
  463. },
  464. // 库存校验
  465. stock() {
  466. if (this.cache.issku == 1) {
  467. if (this.cache.num - this.num < 0) {
  468. this.$api.msg(`该属性产品库存不足!请调整购买数量或选择其他属性!`);
  469. return;
  470. }
  471. } else {
  472. if (this.cache.num - this.num < 0) {
  473. this.$api.msg(`该属性产品库存不足!请调整购买数量或选择其他属性!`);
  474. return;
  475. }
  476. }
  477. },
  478. // 购买
  479. buy(e) {
  480. let that = this;
  481. if(that.ifpeon) {
  482. if (this.tarpty[0]!='tgxy') {
  483. this.$api.msg(`请同意${that.partyinfo.name}`);
  484. return;
  485. }
  486. }
  487. that.isOpen = e
  488. // #ifdef MP-WEIXIN
  489. if (that.$store.state.islogin()) {
  490. that.toggleSpec(that.isOpen)
  491. } else {
  492. that.$refs.nologin.open();
  493. }
  494. // #endif
  495. // #ifdef H5 || APP-PLUS
  496. that.toggleSpec(that.isOpen)
  497. // #endif
  498. },
  499. // 计步器
  500. valChange(e) {
  501. },
  502. stopPrevent() {},
  503. shoopgoods(id) {
  504. let that = this;
  505. api.shoopgoods({
  506. id: id + ''
  507. }).then(res => {
  508. let arr = []; //创建空数组
  509. if (res.status == 200) {
  510. if(res.data.party && res.data.party.id) {
  511. that.ifpeon = true
  512. that.partyinfo = res.data.party
  513. that.parttext = that.partyinfo.content
  514. console.log(res.data.party,'res.data.party');
  515. }
  516. that.sharedata = res.data.sharedata;
  517. that.farm_info=res.data.farm;
  518. that.sharedata.title = res.data.cache.name;
  519. that.sharedata.path = '/pagesD/pages/product/product?pid=' + that.$getuid() + '&id=' + id;
  520. that.list = res.data;
  521. that.cache = res.data.cache;
  522. that.apppic = res.data.apppic;
  523. that.appalbum = res.data.appalbum
  524. that.$store.state.lasturl = res.data.lasturl
  525. if (res.data.cache.issku == 1 && res.data.skujson !== "") {
  526. that.skujson = JSON.parse(res.data.skujson);
  527. } else {
  528. that.sku = {
  529. num: that.cache.num,
  530. price: that.cache.price
  531. };
  532. }
  533. that.favorite = that.cache.islike == 1 ? true : false
  534. /* 处理富文本*/
  535. that.cache.content = that.cache.content.replace(/\<img src="/gi,
  536. `<img style='width:100%;display:block' src="${that.settingFile.root_rich_img}`);
  537. if (res.data.skuinfo) {
  538. for (let cItem of res.data.skuinfo) {
  539. let num = 1;
  540. for (let cItem2 of cItem.allitems) {
  541. if (num == 1) {
  542. that.$set(cItem2, 'selected', false);
  543. arr.push(cItem2);
  544. }
  545. num++;
  546. }
  547. }
  548. }
  549. if (arr && arr.length > 0) {
  550. let arr_sku = that.cache.id;
  551. arr.forEach(item => {
  552. arr_sku += '-' + item.path
  553. /* 默认取第一个*/
  554. that.$set(item, 'selected', true);
  555. that.specSelected.push(item);
  556. })
  557. if (that.skujson) {
  558. that.sku = that.skujson[arr_sku];
  559. }
  560. }
  561. } else {
  562. that.$u.toast(res.msg);
  563. }
  564. });
  565. },
  566. gouwuche() {
  567. this.$u.route('pagesE/pages/cart/cart')
  568. }
  569. }
  570. };
  571. </script>
  572. <style lang="scss">
  573. /deep/.buy-now-btn:after {
  574. border: 0rpx
  575. }
  576. /deep/.add-cart-btn:after {
  577. border: 0rpx
  578. }
  579. page {
  580. background: $page-color-base;
  581. padding-bottom: 160upx;
  582. }
  583. .icon-you {
  584. font-size: $font-base + 2upx;
  585. color: #888;
  586. }
  587. .row-between {
  588. display: flex;
  589. justify-content: space-between;
  590. padding: 20rpx;
  591. }
  592. .carousel {
  593. height: 750rpx;
  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:750rpx;
  607. overflow: hidden;
  608. image {
  609. width: 100%;
  610. height: 100%;
  611. }
  612. }
  613. }
  614. /* 标题简介 */
  615. .introduce-section {
  616. background: #fff;
  617. padding: 20upx 30upx;
  618. .title {
  619. font-size: 32upx;
  620. color: $font-color-dark;
  621. height: 50upx;
  622. line-height: 50upx;
  623. }
  624. .price-box {
  625. display: flex;
  626. align-items: baseline;
  627. height: 64upx;
  628. padding: 10upx 0;
  629. font-size: 26upx;
  630. color: $uni-color-primary;
  631. }
  632. .price {
  633. font-size: $font-lg + 2upx;
  634. }
  635. .m-price {
  636. margin: 0 12upx;
  637. color: $font-color-light;
  638. text-decoration: line-through;
  639. }
  640. .coupon-tip {
  641. align-items: center;
  642. padding: 4upx 10upx;
  643. background: $uni-color-primary;
  644. font-size: $font-sm;
  645. color: #fff;
  646. border-radius: 6upx;
  647. line-height: 1;
  648. transform: translateY(-4upx);
  649. }
  650. .bot-row {
  651. display: flex;
  652. align-items: center;
  653. height: 50upx;
  654. font-size: $font-sm;
  655. color: $font-color-light;
  656. text {
  657. flex: 1;
  658. }
  659. }
  660. }
  661. /* 分享 */
  662. .share-section {
  663. display: flex;
  664. align-items: center;
  665. color: $font-color-base;
  666. background: linear-gradient(left, #fdf5f6, #fbebf6);
  667. padding: 12upx 30upx;
  668. .share-icon {
  669. display: flex;
  670. align-items: center;
  671. width: 70upx;
  672. height: 30upx;
  673. line-height: 1;
  674. border: 1px solid $uni-color-primary;
  675. border-radius: 4upx;
  676. position: relative;
  677. overflow: hidden;
  678. font-size: 22upx;
  679. color: $uni-color-primary;
  680. justify-content: center;
  681. display: flex;
  682. &:after {
  683. content: '';
  684. width: 50upx;
  685. height: 50upx;
  686. border-radius: 50%;
  687. left: -20upx;
  688. top: -12upx;
  689. position: absolute;
  690. // background: $uni-color-primary;
  691. }
  692. }
  693. .icon-xingxing {
  694. position: relative;
  695. z-index: 1;
  696. font-size: 24upx;
  697. color: #fff;
  698. line-height: 1;
  699. }
  700. .tit {
  701. font-size: $font-base;
  702. margin-left: 10upx;
  703. }
  704. .icon-bangzhu1 {
  705. padding: 10upx;
  706. font-size: 30upx;
  707. line-height: 1;
  708. }
  709. .share-btn {
  710. flex: 1;
  711. display: flex;
  712. display: flex;
  713. justify-content: flex-end;
  714. font-size: $font-sm;
  715. color: $uni-color-primary;
  716. }
  717. .icon-you {
  718. font-size: $font-sm;
  719. margin-left: 4upx;
  720. color: $uni-color-primary;
  721. }
  722. }
  723. .c-list {
  724. font-size: $font-sm + 2upx;
  725. color: $font-color-base;
  726. background: #fff;
  727. .c-row {
  728. display: flex;
  729. align-items: center;
  730. padding: 20upx 30upx;
  731. position: relative;
  732. }
  733. .tit {
  734. width: 140upx;
  735. }
  736. .con {
  737. flex: 1;
  738. color: $font-color-dark;
  739. .selected-text {
  740. margin-right: 10upx;
  741. }
  742. }
  743. .bz-list {
  744. font-size: $font-sm + 2upx;
  745. color: $font-color-dark;
  746. text {
  747. display: inline-block;
  748. margin-right: 30upx;
  749. line-height: 38upx;
  750. }
  751. }
  752. .con-list {
  753. flex: 1;
  754. display: flex;
  755. flex-direction: column;
  756. color: $font-color-dark;
  757. line-height: 40upx;
  758. }
  759. .red {
  760. color: $uni-color-primary;
  761. }
  762. }
  763. /* 评价 */
  764. .eva-section {
  765. display: flex;
  766. flex-direction: column;
  767. padding: 20upx 30upx;
  768. background: #fff;
  769. margin-top: 16upx;
  770. .e-header {
  771. display: flex;
  772. align-items: center;
  773. height: 70upx;
  774. font-size: $font-sm + 2upx;
  775. color: $font-color-light;
  776. .tit {
  777. font-size: $font-base + 2upx;
  778. color: $font-color-dark;
  779. margin-right: 4upx;
  780. }
  781. .tip {
  782. flex: 1;
  783. text-align: right;
  784. }
  785. .icon-you {
  786. margin-left: 10upx;
  787. }
  788. }
  789. }
  790. .eva-box {
  791. display: flex;
  792. padding: 20upx 0;
  793. .portrait {
  794. flex-shrink: 0;
  795. width: 80upx;
  796. height: 80upx;
  797. border-radius: 100px;
  798. }
  799. .right {
  800. flex: 1;
  801. display: flex;
  802. flex-direction: column;
  803. font-size: $font-base;
  804. color: $font-color-base;
  805. padding-left: 26upx;
  806. .con {
  807. font-size: $font-base;
  808. color: $font-color-dark;
  809. padding: 20upx 0;
  810. }
  811. .bot {
  812. display: flex;
  813. justify-content: space-between;
  814. font-size: $font-sm;
  815. color: $font-color-light;
  816. }
  817. }
  818. }
  819. /* 详情 */
  820. .detail-desc {
  821. background-color: #FFFFFF;
  822. margin-top: 16upx;
  823. line-height: 40rpx;
  824. box-sizing: border-box;
  825. .d-header {
  826. display: flex;
  827. justify-content: center;
  828. align-items: center;
  829. height: 80upx;
  830. font-size: $font-base + 2upx;
  831. position: relative;
  832. text {
  833. padding: 0 20upx;
  834. background: #fff;
  835. position: relative;
  836. z-index: 1;
  837. }
  838. &:after {
  839. position: absolute;
  840. left: 50%;
  841. top: 50%;
  842. transform: translateX(-50%);
  843. width: 300upx;
  844. height: 0;
  845. content: '';
  846. border-bottom: 1px solid #ccc;
  847. }
  848. }
  849. }
  850. /* 规格选择弹窗 */
  851. .attr-content {
  852. padding: 10upx 30upx;
  853. .a-t {
  854. position: relative;
  855. display: flex;
  856. image {
  857. width: 170upx;
  858. height: 170upx;
  859. flex-shrink: 0;
  860. margin-top: -40upx;
  861. border-radius: 8upx;
  862. }
  863. .right {
  864. display: flex;
  865. flex-direction: column;
  866. padding-left: 24upx;
  867. font-size: $font-sm + 2upx;
  868. color: $font-color-base;
  869. line-height: 42upx;
  870. .price {
  871. font-size: $font-lg;
  872. margin-bottom: 10upx;
  873. }
  874. .selected-text {
  875. margin-right: 10upx;
  876. }
  877. }
  878. }
  879. .attr-list {
  880. display: flex;
  881. flex-direction: column;
  882. font-size: $font-base + 2upx;
  883. color: $font-color-base;
  884. padding-top: 30upx;
  885. padding-left: 10upx;
  886. }
  887. .item-list {
  888. padding: 20upx 0 0;
  889. display: flex;
  890. flex-wrap: wrap;
  891. text {
  892. display: flex;
  893. align-items: center;
  894. justify-content: center;
  895. background: #eee;
  896. margin-right: 20upx;
  897. margin-bottom: 20upx;
  898. border-radius: 100upx;
  899. min-width: 60upx;
  900. height: 60upx;
  901. padding: 0 20upx;
  902. font-size: $font-base;
  903. color: $font-color-dark;
  904. }
  905. .selected {
  906. background: $tab-color-2;
  907. color: #fff;
  908. }
  909. }
  910. }
  911. /* 弹出层 */
  912. .popup {
  913. position: fixed;
  914. left: 0;
  915. top: 0;
  916. right: 0;
  917. bottom: 0;
  918. z-index: 99;
  919. &.show {
  920. display: block;
  921. .mask {
  922. animation: showPopup 0.2s linear both;
  923. }
  924. .layer {
  925. animation: showLayer 0.2s linear both;
  926. }
  927. }
  928. &.hide {
  929. .mask {
  930. animation: hidePopup 0.2s linear both;
  931. }
  932. .layer {
  933. animation: hideLayer 0.2s linear both;
  934. }
  935. }
  936. &.none {
  937. display: none;
  938. }
  939. .mask {
  940. position: fixed;
  941. top: 0;
  942. width: 100%;
  943. height: 100%;
  944. z-index: 1;
  945. background-color: rgba(0, 0, 0, 0.4);
  946. }
  947. .layer {
  948. position: fixed;
  949. z-index: 99;
  950. bottom: 0;
  951. width: 94%;
  952. min-height: 40vh;
  953. border-radius: 10upx 10upx 0 0;
  954. background-color: #fff;
  955. .btn {
  956. height: 66upx;
  957. line-height: 66upx;
  958. border-radius: 100upx;
  959. font-size: $font-base + 2upx;
  960. color: #fff;
  961. margin: 30upx auto 20upx;
  962. }
  963. }
  964. @keyframes showPopup {
  965. 0% {
  966. opacity: 0;
  967. }
  968. 100% {
  969. opacity: 1;
  970. }
  971. }
  972. @keyframes hidePopup {
  973. 0% {
  974. opacity: 1;
  975. }
  976. 100% {
  977. opacity: 0;
  978. }
  979. }
  980. @keyframes showLayer {
  981. 0% {
  982. transform: translateY(120%);
  983. }
  984. 100% {
  985. transform: translateY(0%);
  986. }
  987. }
  988. @keyframes hideLayer {
  989. 0% {
  990. transform: translateY(0);
  991. }
  992. 100% {
  993. transform: translateY(120%);
  994. }
  995. }
  996. }
  997. /* 底部操作菜单 */
  998. .page-bottom {
  999. position: fixed;
  1000. left: 30upx;
  1001. bottom: 30upx;
  1002. z-index: 95;
  1003. display: flex;
  1004. justify-content: center;
  1005. align-items: center;
  1006. width: 690upx;
  1007. height: 100upx;
  1008. background: rgba(255, 255, 255, 0.9);
  1009. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, 0.5);
  1010. border-radius: 16upx;
  1011. .p-b-btn {
  1012. position: relative;
  1013. display: flex;
  1014. flex-direction: column;
  1015. align-items: center;
  1016. justify-content: center;
  1017. font-size: $font-sm;
  1018. color: $font-color-base;
  1019. width: 96upx;
  1020. height: 80upx;
  1021. .yticon {
  1022. font-size: 40upx;
  1023. line-height: 48upx;
  1024. color: $font-color-light;
  1025. }
  1026. &.active,
  1027. &.active .yticon {}
  1028. .icon-fenxiang2 {
  1029. font-size: 42upx;
  1030. transform: translateY(-2upx);
  1031. }
  1032. .icon-shoucang {
  1033. font-size: 46upx;
  1034. }
  1035. .badge {
  1036. position: absolute;
  1037. top: -10rpx;
  1038. right: 8rpx;
  1039. }
  1040. }
  1041. .action-btn-group {
  1042. display: flex;
  1043. height: 76upx;
  1044. border-radius: 100px;
  1045. overflow: hidden;
  1046. margin-left: 20upx;
  1047. position: relative;
  1048. &:after {
  1049. content: '';
  1050. position: absolute;
  1051. top: 50%;
  1052. right: 50%;
  1053. transform: translateY(-50%);
  1054. height: 28upx;
  1055. width: 0;
  1056. border-right: 1px solid rgba(255, 255, 255, 0.5);
  1057. }
  1058. .action-btn {
  1059. display: flex;
  1060. align-items: center;
  1061. justify-content: center;
  1062. width: 180upx;
  1063. height: 100%;
  1064. font-size: $font-base;
  1065. padding: 0;
  1066. border-radius: 0;
  1067. background: transparent;
  1068. }
  1069. }
  1070. }
  1071. .text_area {
  1072. .shop_name {
  1073. display: flex;
  1074. justify-content: space-between;
  1075. align-items: center;
  1076. .shop_thumbnail {
  1077. width: 80rpx;
  1078. height: 80rpx;
  1079. border-radius: 50%;
  1080. }
  1081. .right_shop_mess {
  1082. width: calc(100% - 90rpx);
  1083. // margin-left: 15rpx;
  1084. .shop_line {
  1085. display: flex;
  1086. justify-content: space-between;
  1087. align-items: center;
  1088. .shop_line_p1 {
  1089. color: #1f1f1f;
  1090. font-size: 32rpx;
  1091. padding-left: 3rpx;
  1092. font-weight: 300;
  1093. }
  1094. .shop_line_p2 {
  1095. width: 100%;
  1096. display: flex;
  1097. align-items: center;
  1098. .address {
  1099. color: #333;
  1100. font-size: 26rpx;
  1101. overflow: hidden;
  1102. text-overflow: ellipsis;
  1103. white-space: nowrap;
  1104. }
  1105. }
  1106. }
  1107. .shop_line_fl {
  1108. display: flex;
  1109. justify-content: flex-start;
  1110. align-items: center;
  1111. margin: 5rpx 0;
  1112. }
  1113. .right_shop_mess_p2 {
  1114. border: 1rpx solid #cccccc;
  1115. color: #666;
  1116. font-size: 24rpx;
  1117. padding: 12rpx 20rpx;
  1118. border-radius: 40rpx;
  1119. }
  1120. }
  1121. }
  1122. }
  1123. .shop_one {
  1124. display: flex;
  1125. justify-content: space-evenly;
  1126. padding: 30rpx 0rpx;
  1127. .shop_one_1 {
  1128. display: flex;
  1129. flex-direction: column;
  1130. align-items: center;
  1131. .view1 {
  1132. font-size: 28rpx;
  1133. margin-bottom: 10rpx;
  1134. }
  1135. .view2 {
  1136. font-size: 24rpx;
  1137. color: #999999;
  1138. }
  1139. }
  1140. }
  1141. .farm{
  1142. background-color: #ffffff;
  1143. margin-top: 20rpx;
  1144. padding: 20rpx 20rpx 0rpx 20rpx;
  1145. }
  1146. .sel {
  1147. height: 96rpx;
  1148. padding: 0 20rpx;
  1149. display: flex;
  1150. align-items: center;
  1151. border-bottom: 1px solid #f2f2f2;
  1152. background-color: #ffffff;
  1153. }
  1154. .sel .ipt {
  1155. height: 40rpx;
  1156. width: 40rpx;
  1157. border-radius: 10rpx;
  1158. }
  1159. .sel .text {
  1160. position: relative;
  1161. top: -2rpx;
  1162. font-size: 26rpx;
  1163. font-family: PingFang SC;
  1164. font-weight: 500;
  1165. color: rgba(0, 0, 0, 1);
  1166. }
  1167. </style>