product.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301
  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(tarp)">
  68. <u-checkbox v-model="tarpty" 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: false,
  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. if (this.tarp == 1) {
  292. this.tarp = 2
  293. this.tarpty = true
  294. } else {
  295. this.tarpty = false
  296. this.tarp = 1
  297. }
  298. },
  299. goContract(id, type) {
  300. console.log(id,type,'kkkkkk')
  301. if (!this.parttext) {
  302. this.$api.msg(`暂无租赁协议,联系客服添加`);
  303. return;
  304. } else {
  305. this.tarptyshow = true
  306. }
  307. console.log(this.tarptyshow,'this.tarptyshow')
  308. },
  309. gostoredetail(farmid) { //跳转店铺详情
  310. uni.navigateTo({
  311. url: "/pagesC/pages/merchantdetails/merchantdetails?id=" + farmid
  312. })
  313. },
  314. loginback() {
  315. //登录回调
  316. },
  317. previewImage(index) { //预览商品详情轮播图片
  318. uni.previewImage({
  319. current: index,
  320. urls: this.appalbum,
  321. indicator: 'number'
  322. })
  323. },
  324. //规格弹窗开关
  325. toggleSpec(index) {
  326. /* 如果只点击规格 则不进行购买 || 添加购物车 */
  327. if (index == 0) {
  328. this.isOpen = 0
  329. if (this.specClass === 'show') {
  330. this.specClass = 'hide';
  331. setTimeout(() => {
  332. this.specClass = 'none';
  333. }, 250);
  334. } else if (this.specClass === 'none') {
  335. this.specClass = 'show';
  336. }
  337. return
  338. }
  339. if (index == 1) {
  340. if (this.specClass === 'show') {
  341. this.stock();
  342. let id = uni.getStorageSync('userInfo').id;
  343. let obj = {
  344. sid: 0,
  345. goodstype: this.cache.type,
  346. goodsid: this.cache.id,
  347. num: this.num,
  348. isame: this.list.isadmin,
  349. sku: this.sku.sku,
  350. vipid: id
  351. };
  352. api.addtobasket(obj).then(res => {
  353. uni.showToast({
  354. title: res.data.msg,
  355. icon: 'none', //如果要纯文本,不要icon,将值设为'none'
  356. duration: 2000 //持续时间为 2秒
  357. })
  358. if (res.status == 200) {
  359. this.list.count = this.list.count + this.num;
  360. uni.showToast({
  361. title: res.data.msg,
  362. icon: 'none', //如果要纯文本,不要icon,将值设为'none'
  363. duration: 2000 //持续时间为 2秒
  364. })
  365. }
  366. });
  367. this.specClass = 'hide';
  368. setTimeout(() => {
  369. this.specClass = 'none';
  370. }, 250);
  371. } else if (this.specClass === 'none') {
  372. this.specClass = 'show';
  373. }
  374. return
  375. }
  376. /* 如果点击立即购买则为 2 */
  377. if (index == 2) {
  378. if (this.specClass === 'show') {
  379. this.stock();
  380. let id = uni.getStorageSync('userInfo').id;
  381. let obj = {
  382. sid: 0,
  383. goodstype: this.cache.type,
  384. goodsid: this.cache.id,
  385. num: this.num,
  386. isame: this.list.isadmin,
  387. sku: this.sku.sku,
  388. vipid: id
  389. };
  390. api.fastbuys(obj).then(res => {
  391. if (res.status == 200) {
  392. uni.showToast({
  393. icon: 'loading',
  394. title: '生成订单',
  395. duration: 2000
  396. });
  397. setTimeout(() => {
  398. this.$u.route('/pagesD/pages/order/createOrder', {
  399. id,
  400. sid: 0,
  401. goodstype: this.cache.type,
  402. lasturl: this.list.lasturl,
  403. ftype: 2,
  404. goodsid: this.cache.id,
  405. });
  406. }, 2000);
  407. } else {
  408. this.$u.toast(res.msg);
  409. }
  410. });
  411. this.specClass = 'hide';
  412. setTimeout(() => {
  413. this.isOpen = 0
  414. this.specClass = 'none';
  415. }, 250);
  416. } else if (this.specClass === 'none') {
  417. this.specClass = 'show';
  418. }
  419. return
  420. }
  421. },
  422. //选择规格
  423. selectSpec(index, pid, item) {
  424. let list = item.allitems;
  425. let arr_sku = this.cache.id;
  426. list.forEach(item => {
  427. this.$set(item, 'selected', false);
  428. });
  429. this.$set(list[index], 'selected', true);
  430. for (let cItem of this.list.skuinfo) {
  431. for (let cItem2 of cItem.allitems) {
  432. if (cItem2.checked == 1 && cItem2.selected == true) {
  433. arr_sku += '-' + cItem2.path
  434. }
  435. }
  436. }
  437. if (this.skujson) {
  438. this.sku = this.skujson[arr_sku];
  439. }
  440. },
  441. //分享
  442. opensharebox() {
  443. this.$refs.sbox.opensharebox(this.sharedata);
  444. },
  445. //收藏
  446. toFavorite() {
  447. if (this.timer) return
  448. this.timer = setTimeout(() => {}, 1000)
  449. this.favorite = !this.favorite;
  450. let data = {
  451. id: this.cache.id,
  452. status: Number(this.favorite),
  453. goodstype: this.cache.type
  454. }
  455. api.goodslike(data).then(res => {
  456. this.timer = null
  457. this.$u.toast(res.msg)
  458. if (res.msg == "收藏成功") {
  459. this.goodslike = true
  460. } else if (res.msg == "取消成功") {
  461. this.goodslike = false
  462. }
  463. if (this.isc) {
  464. let pages = getCurrentPages();
  465. let prevPage = pages[pages.length - 2]; //获取到A页面
  466. prevPage.onLoad(); // 执行前一个页面的onLoad方法
  467. }
  468. })
  469. },
  470. // 库存校验
  471. stock() {
  472. if (this.cache.issku == 1) {
  473. if (this.cache.num - this.num < 0) {
  474. this.$api.msg(`该属性产品库存不足!请调整购买数量或选择其他属性!`);
  475. return;
  476. }
  477. } else {
  478. if (this.cache.num - this.num < 0) {
  479. this.$api.msg(`该属性产品库存不足!请调整购买数量或选择其他属性!`);
  480. return;
  481. }
  482. }
  483. },
  484. // 购买
  485. buy(e) {
  486. let that = this;
  487. if(that.ifpeon) {
  488. if (!this.tarpty) {
  489. this.$api.msg(`请同意${that.partyinfo.name}`);
  490. return;
  491. }
  492. }
  493. that.isOpen = e
  494. // #ifdef MP-WEIXIN
  495. if (that.$store.state.islogin()) {
  496. that.toggleSpec(that.isOpen)
  497. } else {
  498. that.$refs.nologin.open();
  499. }
  500. // #endif
  501. // #ifdef H5 || APP-PLUS
  502. that.toggleSpec(that.isOpen)
  503. // #endif
  504. },
  505. // 计步器
  506. valChange(e) {
  507. },
  508. stopPrevent() {},
  509. shoopgoods(id) {
  510. let that = this;
  511. api.shoopgoods({
  512. id: id + ''
  513. }).then(res => {
  514. let arr = []; //创建空数组
  515. if (res.status == 200) {
  516. if(res.data.party && res.data.party.id) {
  517. that.ifpeon = true
  518. that.partyinfo = res.data.party
  519. that.parttext = that.partyinfo.content
  520. console.log(res.data.party,'res.data.party');
  521. }
  522. that.sharedata = res.data.sharedata;
  523. that.farm_info=res.data.farm;
  524. that.sharedata.title = res.data.cache.name;
  525. that.sharedata.path = '/pagesD/pages/product/product?pid=' + that.$getuid() + '&id=' + id;
  526. that.list = res.data;
  527. that.cache = res.data.cache;
  528. that.apppic = res.data.apppic;
  529. that.appalbum = res.data.appalbum
  530. that.$store.state.lasturl = res.data.lasturl
  531. if (res.data.cache.issku == 1 && res.data.skujson !== "") {
  532. that.skujson = JSON.parse(res.data.skujson);
  533. } else {
  534. that.sku = {
  535. num: that.cache.num,
  536. price: that.cache.price
  537. };
  538. }
  539. that.favorite = that.cache.islike == 1 ? true : false
  540. /* 处理富文本*/
  541. that.cache.content = that.cache.content.replace(/\<img src="/gi,
  542. `<img style='width:100%;display:block' src="${that.settingFile.root_rich_img}`);
  543. if (res.data.skuinfo) {
  544. for (let cItem of res.data.skuinfo) {
  545. let num = 1;
  546. for (let cItem2 of cItem.allitems) {
  547. if (num == 1) {
  548. that.$set(cItem2, 'selected', false);
  549. arr.push(cItem2);
  550. }
  551. num++;
  552. }
  553. }
  554. }
  555. if (arr && arr.length > 0) {
  556. let arr_sku = that.cache.id;
  557. arr.forEach(item => {
  558. arr_sku += '-' + item.path
  559. /* 默认取第一个*/
  560. that.$set(item, 'selected', true);
  561. that.specSelected.push(item);
  562. })
  563. if (that.skujson) {
  564. that.sku = that.skujson[arr_sku];
  565. }
  566. }
  567. } else {
  568. that.$u.toast(res.msg);
  569. }
  570. });
  571. },
  572. gouwuche() {
  573. this.$u.route('pagesE/pages/cart/cart')
  574. }
  575. }
  576. };
  577. </script>
  578. <style lang="scss">
  579. /deep/.buy-now-btn:after {
  580. border: 0rpx
  581. }
  582. /deep/.add-cart-btn:after {
  583. border: 0rpx
  584. }
  585. page {
  586. background: $page-color-base;
  587. padding-bottom: 160upx;
  588. }
  589. .icon-you {
  590. font-size: $font-base + 2upx;
  591. color: #888;
  592. }
  593. .row-between {
  594. display: flex;
  595. justify-content: space-between;
  596. padding: 20rpx;
  597. }
  598. .carousel {
  599. height: 750rpx;
  600. position: relative;
  601. swiper {
  602. height: 100%;
  603. }
  604. .image-wrapper {
  605. width: 100%;
  606. height: 100%;
  607. }
  608. .swiper-item {
  609. display: flex;
  610. justify-content: center;
  611. align-content: center;
  612. height:750rpx;
  613. overflow: hidden;
  614. image {
  615. width: 100%;
  616. height: 100%;
  617. }
  618. }
  619. }
  620. /* 标题简介 */
  621. .introduce-section {
  622. background: #fff;
  623. padding: 20upx 30upx;
  624. .title {
  625. font-size: 32upx;
  626. color: $font-color-dark;
  627. height: 50upx;
  628. line-height: 50upx;
  629. }
  630. .price-box {
  631. display: flex;
  632. align-items: baseline;
  633. height: 64upx;
  634. padding: 10upx 0;
  635. font-size: 26upx;
  636. color: $uni-color-primary;
  637. }
  638. .price {
  639. font-size: $font-lg + 2upx;
  640. }
  641. .m-price {
  642. margin: 0 12upx;
  643. color: $font-color-light;
  644. text-decoration: line-through;
  645. }
  646. .coupon-tip {
  647. align-items: center;
  648. padding: 4upx 10upx;
  649. background: $uni-color-primary;
  650. font-size: $font-sm;
  651. color: #fff;
  652. border-radius: 6upx;
  653. line-height: 1;
  654. transform: translateY(-4upx);
  655. }
  656. .bot-row {
  657. display: flex;
  658. align-items: center;
  659. height: 50upx;
  660. font-size: $font-sm;
  661. color: $font-color-light;
  662. text {
  663. flex: 1;
  664. }
  665. }
  666. }
  667. /* 分享 */
  668. .share-section {
  669. display: flex;
  670. align-items: center;
  671. color: $font-color-base;
  672. background: linear-gradient(left, #fdf5f6, #fbebf6);
  673. padding: 12upx 30upx;
  674. .share-icon {
  675. display: flex;
  676. align-items: center;
  677. width: 70upx;
  678. height: 30upx;
  679. line-height: 1;
  680. border: 1px solid $uni-color-primary;
  681. border-radius: 4upx;
  682. position: relative;
  683. overflow: hidden;
  684. font-size: 22upx;
  685. color: $uni-color-primary;
  686. justify-content: center;
  687. display: flex;
  688. &:after {
  689. content: '';
  690. width: 50upx;
  691. height: 50upx;
  692. border-radius: 50%;
  693. left: -20upx;
  694. top: -12upx;
  695. position: absolute;
  696. // background: $uni-color-primary;
  697. }
  698. }
  699. .icon-xingxing {
  700. position: relative;
  701. z-index: 1;
  702. font-size: 24upx;
  703. color: #fff;
  704. line-height: 1;
  705. }
  706. .tit {
  707. font-size: $font-base;
  708. margin-left: 10upx;
  709. }
  710. .icon-bangzhu1 {
  711. padding: 10upx;
  712. font-size: 30upx;
  713. line-height: 1;
  714. }
  715. .share-btn {
  716. flex: 1;
  717. display: flex;
  718. display: flex;
  719. justify-content: flex-end;
  720. font-size: $font-sm;
  721. color: $uni-color-primary;
  722. }
  723. .icon-you {
  724. font-size: $font-sm;
  725. margin-left: 4upx;
  726. color: $uni-color-primary;
  727. }
  728. }
  729. .c-list {
  730. font-size: $font-sm + 2upx;
  731. color: $font-color-base;
  732. background: #fff;
  733. .c-row {
  734. display: flex;
  735. align-items: center;
  736. padding: 20upx 30upx;
  737. position: relative;
  738. }
  739. .tit {
  740. width: 140upx;
  741. }
  742. .con {
  743. flex: 1;
  744. color: $font-color-dark;
  745. .selected-text {
  746. margin-right: 10upx;
  747. }
  748. }
  749. .bz-list {
  750. font-size: $font-sm + 2upx;
  751. color: $font-color-dark;
  752. text {
  753. display: inline-block;
  754. margin-right: 30upx;
  755. line-height: 38upx;
  756. }
  757. }
  758. .con-list {
  759. flex: 1;
  760. display: flex;
  761. flex-direction: column;
  762. color: $font-color-dark;
  763. line-height: 40upx;
  764. }
  765. .red {
  766. color: $uni-color-primary;
  767. }
  768. }
  769. /* 评价 */
  770. .eva-section {
  771. display: flex;
  772. flex-direction: column;
  773. padding: 20upx 30upx;
  774. background: #fff;
  775. margin-top: 16upx;
  776. .e-header {
  777. display: flex;
  778. align-items: center;
  779. height: 70upx;
  780. font-size: $font-sm + 2upx;
  781. color: $font-color-light;
  782. .tit {
  783. font-size: $font-base + 2upx;
  784. color: $font-color-dark;
  785. margin-right: 4upx;
  786. }
  787. .tip {
  788. flex: 1;
  789. text-align: right;
  790. }
  791. .icon-you {
  792. margin-left: 10upx;
  793. }
  794. }
  795. }
  796. .eva-box {
  797. display: flex;
  798. padding: 20upx 0;
  799. .portrait {
  800. flex-shrink: 0;
  801. width: 80upx;
  802. height: 80upx;
  803. border-radius: 100px;
  804. }
  805. .right {
  806. flex: 1;
  807. display: flex;
  808. flex-direction: column;
  809. font-size: $font-base;
  810. color: $font-color-base;
  811. padding-left: 26upx;
  812. .con {
  813. font-size: $font-base;
  814. color: $font-color-dark;
  815. padding: 20upx 0;
  816. }
  817. .bot {
  818. display: flex;
  819. justify-content: space-between;
  820. font-size: $font-sm;
  821. color: $font-color-light;
  822. }
  823. }
  824. }
  825. /* 详情 */
  826. .detail-desc {
  827. background-color: #FFFFFF;
  828. margin-top: 16upx;
  829. line-height: 40rpx;
  830. box-sizing: border-box;
  831. .d-header {
  832. display: flex;
  833. justify-content: center;
  834. align-items: center;
  835. height: 80upx;
  836. font-size: $font-base + 2upx;
  837. position: relative;
  838. text {
  839. padding: 0 20upx;
  840. background: #fff;
  841. position: relative;
  842. z-index: 1;
  843. }
  844. &:after {
  845. position: absolute;
  846. left: 50%;
  847. top: 50%;
  848. transform: translateX(-50%);
  849. width: 300upx;
  850. height: 0;
  851. content: '';
  852. border-bottom: 1px solid #ccc;
  853. }
  854. }
  855. }
  856. /* 规格选择弹窗 */
  857. .attr-content {
  858. padding: 10upx 30upx;
  859. .a-t {
  860. position: relative;
  861. display: flex;
  862. image {
  863. width: 170upx;
  864. height: 170upx;
  865. flex-shrink: 0;
  866. margin-top: -40upx;
  867. border-radius: 8upx;
  868. }
  869. .right {
  870. display: flex;
  871. flex-direction: column;
  872. padding-left: 24upx;
  873. font-size: $font-sm + 2upx;
  874. color: $font-color-base;
  875. line-height: 42upx;
  876. .price {
  877. font-size: $font-lg;
  878. margin-bottom: 10upx;
  879. }
  880. .selected-text {
  881. margin-right: 10upx;
  882. }
  883. }
  884. }
  885. .attr-list {
  886. display: flex;
  887. flex-direction: column;
  888. font-size: $font-base + 2upx;
  889. color: $font-color-base;
  890. padding-top: 30upx;
  891. padding-left: 10upx;
  892. }
  893. .item-list {
  894. padding: 20upx 0 0;
  895. display: flex;
  896. flex-wrap: wrap;
  897. text {
  898. display: flex;
  899. align-items: center;
  900. justify-content: center;
  901. background: #eee;
  902. margin-right: 20upx;
  903. margin-bottom: 20upx;
  904. border-radius: 100upx;
  905. min-width: 60upx;
  906. height: 60upx;
  907. padding: 0 20upx;
  908. font-size: $font-base;
  909. color: $font-color-dark;
  910. }
  911. .selected {
  912. background: $tab-color-2;
  913. color: #fff;
  914. }
  915. }
  916. }
  917. /* 弹出层 */
  918. .popup {
  919. position: fixed;
  920. left: 0;
  921. top: 0;
  922. right: 0;
  923. bottom: 0;
  924. z-index: 99;
  925. &.show {
  926. display: block;
  927. .mask {
  928. animation: showPopup 0.2s linear both;
  929. }
  930. .layer {
  931. animation: showLayer 0.2s linear both;
  932. }
  933. }
  934. &.hide {
  935. .mask {
  936. animation: hidePopup 0.2s linear both;
  937. }
  938. .layer {
  939. animation: hideLayer 0.2s linear both;
  940. }
  941. }
  942. &.none {
  943. display: none;
  944. }
  945. .mask {
  946. position: fixed;
  947. top: 0;
  948. width: 100%;
  949. height: 100%;
  950. z-index: 1;
  951. background-color: rgba(0, 0, 0, 0.4);
  952. }
  953. .layer {
  954. position: fixed;
  955. z-index: 99;
  956. bottom: 0;
  957. width: 94%;
  958. min-height: 40vh;
  959. border-radius: 10upx 10upx 0 0;
  960. background-color: #fff;
  961. .btn {
  962. height: 66upx;
  963. line-height: 66upx;
  964. border-radius: 100upx;
  965. font-size: $font-base + 2upx;
  966. color: #fff;
  967. margin: 30upx auto 20upx;
  968. }
  969. }
  970. @keyframes showPopup {
  971. 0% {
  972. opacity: 0;
  973. }
  974. 100% {
  975. opacity: 1;
  976. }
  977. }
  978. @keyframes hidePopup {
  979. 0% {
  980. opacity: 1;
  981. }
  982. 100% {
  983. opacity: 0;
  984. }
  985. }
  986. @keyframes showLayer {
  987. 0% {
  988. transform: translateY(120%);
  989. }
  990. 100% {
  991. transform: translateY(0%);
  992. }
  993. }
  994. @keyframes hideLayer {
  995. 0% {
  996. transform: translateY(0);
  997. }
  998. 100% {
  999. transform: translateY(120%);
  1000. }
  1001. }
  1002. }
  1003. /* 底部操作菜单 */
  1004. .page-bottom {
  1005. position: fixed;
  1006. left: 30upx;
  1007. bottom: 30upx;
  1008. z-index: 95;
  1009. display: flex;
  1010. justify-content: center;
  1011. align-items: center;
  1012. width: 690upx;
  1013. height: 100upx;
  1014. background: rgba(255, 255, 255, 0.9);
  1015. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, 0.5);
  1016. border-radius: 16upx;
  1017. .p-b-btn {
  1018. position: relative;
  1019. display: flex;
  1020. flex-direction: column;
  1021. align-items: center;
  1022. justify-content: center;
  1023. font-size: $font-sm;
  1024. color: $font-color-base;
  1025. width: 96upx;
  1026. height: 80upx;
  1027. .yticon {
  1028. font-size: 40upx;
  1029. line-height: 48upx;
  1030. color: $font-color-light;
  1031. }
  1032. &.active,
  1033. &.active .yticon {}
  1034. .icon-fenxiang2 {
  1035. font-size: 42upx;
  1036. transform: translateY(-2upx);
  1037. }
  1038. .icon-shoucang {
  1039. font-size: 46upx;
  1040. }
  1041. .badge {
  1042. position: absolute;
  1043. top: -10rpx;
  1044. right: 8rpx;
  1045. }
  1046. }
  1047. .action-btn-group {
  1048. display: flex;
  1049. height: 76upx;
  1050. border-radius: 100px;
  1051. overflow: hidden;
  1052. margin-left: 20upx;
  1053. position: relative;
  1054. &:after {
  1055. content: '';
  1056. position: absolute;
  1057. top: 50%;
  1058. right: 50%;
  1059. transform: translateY(-50%);
  1060. height: 28upx;
  1061. width: 0;
  1062. border-right: 1px solid rgba(255, 255, 255, 0.5);
  1063. }
  1064. .action-btn {
  1065. display: flex;
  1066. align-items: center;
  1067. justify-content: center;
  1068. width: 180upx;
  1069. height: 100%;
  1070. font-size: $font-base;
  1071. padding: 0;
  1072. border-radius: 0;
  1073. background: transparent;
  1074. }
  1075. }
  1076. }
  1077. .text_area {
  1078. .shop_name {
  1079. display: flex;
  1080. justify-content: space-between;
  1081. align-items: center;
  1082. .shop_thumbnail {
  1083. width: 80rpx;
  1084. height: 80rpx;
  1085. border-radius: 50%;
  1086. }
  1087. .right_shop_mess {
  1088. width: calc(100% - 90rpx);
  1089. // margin-left: 15rpx;
  1090. .shop_line {
  1091. display: flex;
  1092. justify-content: space-between;
  1093. align-items: center;
  1094. .shop_line_p1 {
  1095. color: #1f1f1f;
  1096. font-size: 32rpx;
  1097. padding-left: 3rpx;
  1098. font-weight: 300;
  1099. }
  1100. .shop_line_p2 {
  1101. width: 100%;
  1102. display: flex;
  1103. align-items: center;
  1104. .address {
  1105. color: #333;
  1106. font-size: 26rpx;
  1107. overflow: hidden;
  1108. text-overflow: ellipsis;
  1109. white-space: nowrap;
  1110. }
  1111. }
  1112. }
  1113. .shop_line_fl {
  1114. display: flex;
  1115. justify-content: flex-start;
  1116. align-items: center;
  1117. margin: 5rpx 0;
  1118. }
  1119. .right_shop_mess_p2 {
  1120. border: 1rpx solid #cccccc;
  1121. color: #666;
  1122. font-size: 24rpx;
  1123. padding: 12rpx 20rpx;
  1124. border-radius: 40rpx;
  1125. }
  1126. }
  1127. }
  1128. }
  1129. .shop_one {
  1130. display: flex;
  1131. justify-content: space-evenly;
  1132. padding: 30rpx 0rpx;
  1133. .shop_one_1 {
  1134. display: flex;
  1135. flex-direction: column;
  1136. align-items: center;
  1137. .view1 {
  1138. font-size: 28rpx;
  1139. margin-bottom: 10rpx;
  1140. }
  1141. .view2 {
  1142. font-size: 24rpx;
  1143. color: #999999;
  1144. }
  1145. }
  1146. }
  1147. .farm{
  1148. background-color: #ffffff;
  1149. margin-top: 20rpx;
  1150. padding: 20rpx 20rpx 0rpx 20rpx;
  1151. }
  1152. .sel {
  1153. height: 96rpx;
  1154. padding: 0 20rpx;
  1155. display: flex;
  1156. align-items: center;
  1157. border-bottom: 1px solid #f2f2f2;
  1158. background-color: #ffffff;
  1159. }
  1160. .sel .ipt {
  1161. height: 40rpx;
  1162. width: 40rpx;
  1163. border-radius: 10rpx;
  1164. }
  1165. .sel .text {
  1166. position: relative;
  1167. top: -2rpx;
  1168. font-size: 26rpx;
  1169. font-family: PingFang SC;
  1170. font-weight: 500;
  1171. color: rgba(0, 0, 0, 1);
  1172. }
  1173. </style>