product.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  1. <template>
  2. <view class="product">
  3. <header-back :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :headerColor="headerColor" :page='backPage'></header-back>
  4. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="9"></tui-skeleton>
  5. <view class="container-product tui-skeleton">
  6. <view class="product-top">
  7. <view class="banner-section">
  8. <uni-swiper-dot :info="productImage" :current="current" field="content" :mode="mode" >
  9. <swiper class="banner tui-banner tui-skeleton-rect" circular @change="swiperChange" :duration='800' :autoplay="false" :circular="false" >
  10. <swiper-item v-for="(item, index) in productImage" :key="index" class="banner-item">
  11. <image :src="item" @click="previewImg(index)" />
  12. </swiper-item>
  13. </swiper>
  14. <view class="swiper__dots-box">
  15. <view v-for="(item,idx) in productImage"
  16. :key="idx"
  17. :class="[idx===current?'swiper__dots-long':'none']"
  18. :data-index="current" class="swiper__dots-item">
  19. </view>
  20. </view>
  21. </uni-swiper-dot>
  22. </view>
  23. <view class="product-wrap clearfix">
  24. <view class="wrap-top" :class="goodsData.disabled ? 'none' : ''">
  25. <view class="p-title tui-skeleton-fillet">
  26. {{product.name == undefined ? '' : product.name}}
  27. </view>
  28. <view class="wrap-top-price" v-if="!goodsData.disabled">
  29. <view v-if="!hasLogin" class="p-login grade tui-skeleton-fillet">
  30. <text class="p-no">价格:</text>
  31. <uni-stars :stars="parseInt(product.price1Grade)" :font-size='36' :width-info="180"></uni-stars>
  32. </view>
  33. <view v-if="!hasLogin" class="p-login tui-skeleton-fillet">
  34. <text @click.stop="navToLogin">登录查看价格<text class="iconfont icon-xiayibu" style="font-size: 22rpx;margin: 0 6rpx;"></text></text>
  35. </view>
  36. <view class="wrap-main" v-else>
  37. <view class="p-main" v-if="ladderPriceFlag == '0'">
  38. <view class="p-price tui-skeleton-fillet">
  39. <text class="txt sm">¥</text>
  40. <text class="txt big">{{retailPrice}}</text>
  41. <text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
  42. </view>
  43. <view class="p-minBuy">
  44. 起订量:
  45. <text class="min-text">{{minBuyNumber}}</text>
  46. </view>
  47. </view>
  48. <view class="wrap-ladder" v-else>
  49. <view class="ladder-text">
  50. <text class="ladder-h1">说明:</text>
  51. <text class="ladder-p">本商品有以下优惠购物方案</text>
  52. </view>
  53. <view class="ladder-main tui-skeleton-fillet">
  54. <view class="ladder-left">
  55. <view class="ladder-b">起订量:</view>
  56. <view class="ladder-b">价格:</view>
  57. </view>
  58. <view class="ladder-right">
  59. <view class="ladder-li" v-for="(ladder,index) in ladderPriceList" :key="index">
  60. <view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
  61. <view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="wrap-label" v-if="product.tagsList.length>0">
  70. <view class="label-a tui-skeleton-fillet" v-for="(label,index) in product.tagsList" :key="index">{{label}}</view>
  71. </view>
  72. <view class="wrap-label" v-if="goodsData.disabled">
  73. <view class="isLower">此商品已{{disabledText}},请浏览以下推荐商品~</view>
  74. </view>
  75. <view class="wrap-info">
  76. <view class="info-viewT" :class="goodsData.disabled ? 'none' : ''">
  77. <view class="info-viewL tui-skeleton-fillet">品牌:<text>{{product.brandName == null? '其他' : product.brandName}}</text></view>
  78. <view class="info-viewR tui-skeleton-fillet">包装规格:<text>{{product.unit}}</text></view>
  79. </view>
  80. </view>
  81. <view class="wrap-seve" :class="goodsData.disabled ? 'none' : ''">
  82. <text class="tui-skeleton-rect">服务:</text>
  83. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">无忧退货</text></text>
  84. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">快速退款</text></text>
  85. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">正品保证</text></text>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="product-details">
  90. <!-- 头部 -->
  91. <view v-if="goodsData.disabled" class="navbar" :class="navbarFiexd"
  92. :style="{top:headerBtnPosi.bottom + (headerBtnPosi.bottom - headerBtnPosi.height - systeminfo.statusBarHeight) +'px'}">
  93. <view class="nav-item tui-skeleton-fillet" v-for="(item,index) in disabledTabNavList" :key="index" :class="{ current: tabCurrentIndex === index+2 }" @click="tabClick(index+2)">
  94. <text class="line"></text>
  95. <text>{{item.name}}</text>
  96. </view>
  97. </view>
  98. <view v-else class="navbar" :class="navbarFiexd"
  99. :style="{top:headerBtnPosi.bottom + (headerBtnPosi.bottom - headerBtnPosi.height - systeminfo.statusBarHeight) +'px'}">
  100. <view class="nav-item tui-skeleton-fillet" v-for="(item,index) in tabNavList" :key="index" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">
  101. <text class="line"></text>
  102. <text>{{item.name}}</text>
  103. </view>
  104. </view>
  105. <!-- 商品详情,供应商详情展示,相关推荐,评价-->
  106. <view class="content tui-banner tui-skeleton-rect" v-if="tabCurrentIndex === 0">
  107. <parser :html="html" :img-mode="widthFix"></parser>
  108. </view>
  109. <view class="content sup" v-if="tabCurrentIndex === 1">
  110. <supplier-details :shop="shop"></supplier-details>
  111. </view>
  112. <view class="content hot" v-if="tabCurrentIndex === 2">
  113. <recommend :query-productid="product.productID" v-if="isRecommend"></recommend>
  114. </view>
  115. <view class="content hot" v-if="tabCurrentIndex === 3">
  116. <evaluate :query-productid ="product.productID" v-if="isEvaluate"></evaluate>
  117. </view>
  118. </view>
  119. <!-- 底部按钮 -->
  120. <view class="menu">
  121. <view class="bottom-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  122. <view class="bottom-le">
  123. <view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/home')">
  124. <image src="../../static/icon-home-active@3x.png"></image>
  125. <text>首页</text>
  126. </view>
  127. <view class="item-bt">
  128. <!-- #ifdef MP-WEIXIN -->
  129. <button class="contact-btn" open-type="contact" @bindcontact="handleContact">
  130. <image src="../../static/severs@3x.png"></image>
  131. <text>客服</text>
  132. </button>
  133. <!-- #endif -->
  134. </view>
  135. <view class="item-bt" @click="buyProductCart()">
  136. <image src="../../static/icon-cart-active@3x.png"></image>
  137. <text>购物车</text>
  138. <text v-if="goodsData.cartCount > 0"
  139. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  140. :class="[goodsData.cartCount < 10 ? 'goleft':'']">
  141. {{ goodsData.cartCount >= 100 ? '99+': goodsData.cartCount}}
  142. </text>
  143. <view class="animation-num" :class="isAnimation ? 'animation' : 'restion'">+1</view>
  144. </view>
  145. </view>
  146. <view class="bottom-ri">
  147. <button
  148. :disabled="goodsData.disabled"
  149. class="btn btn-cart"
  150. :class="[goodsData.disabled ? 'disabled':'']"
  151. @tap.stop="btnGetConfirm('add')">加入购物车</button>
  152. <button
  153. :disabled="goodsData.disabled"
  154. class="btn btn-bay"
  155. :class="[goodsData.disabled ? 'disabled':'']"
  156. @tap.stop="btnGetConfirm('buy')">立即购买</button>
  157. </view>
  158. </view>
  159. </view>
  160. <!--底部选择模态层弹窗组件 -->
  161. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" @tap="hideSpec">
  162. <!-- 遮罩层 -->
  163. <view class="mask"></view>
  164. <view class="layer" @tap.stop="discard">
  165. <view class="content">
  166. <view class="layer-smimg">
  167. <image :src="product.mainImage" mode=""></image>
  168. </view>
  169. <view class="layer-nunbox">
  170. <view class="layer-nunbox-t">
  171. <view class="layer-nunbox-text">数量:</view>
  172. <view class="number-box">
  173. <view class="iconfont icon-jianhao" :class="[isQuantity==true?'disabled':'']" @click="changeCountSub()"></view>
  174. <input class="btn-input" type="number" v-model="number" maxlength='4' @blur="changeNumber($event)">
  175. <view class="iconfont icon-jiahao" :class="[isStock==true?'disabled':'']" @click="changeCountAdd()"></view>
  176. </view>
  177. </view>
  178. <view class="layer-nunbox-b">
  179. <view class="text">单价:
  180. <text class="p sm">¥</text>
  181. <text class="p bg">{{buyRetailPrice.toFixed(2)}}</text>
  182. </view>
  183. </view>
  184. </view>
  185. </view>
  186. <view class="btn"><view class="button" @click.stop="btnConfirm">确定</view></view>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </template>
  192. <script>
  193. import { mapState,mapMutations } from 'vuex'
  194. import headerBack from '@/components/module/headerNavbar/header-poduct' //自定义导航
  195. import uniStars from '@/components/uni-stars/uni-stars.vue'
  196. import parser from "@/components/jyf-Parser/index" //富文本处理
  197. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  198. import supplierDetails from "@/components/module/productDetails/supplierDetails" //供应商详情
  199. import recommend from "@/components/module/productDetails/recommend" //供应商详情
  200. import evaluate from "@/components/module/productDetails/evaluate" //供应商详情
  201. import { queryProductDetils } from "@/api/product.js"
  202. import { shoppingAddCart } from "@/api/cart.js"
  203. var isPreviewImg;
  204. export default{
  205. components:{
  206. headerBack,
  207. parser,
  208. tuiSkeleton,
  209. supplierDetails,
  210. recommend,
  211. evaluate
  212. },
  213. data(){
  214. return{
  215. html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
  216. tabNavList:[{name:'商品详情'},{name:'供应商细信息'},{name:'相关推荐'},{name:'评价'}],
  217. disabledTabNavList:[{name:'相关推荐'},{name:'评价'}],
  218. mode:'round',
  219. specClass: '',//规格弹窗css类,控制开关动画
  220. isBtnType:'',
  221. current:0,
  222. telPhone:'',
  223. navbarFiexd:'none',
  224. ladderPriceFlag:'',
  225. ladderPriceList:'',
  226. isRecommend:false,
  227. isEvaluate:false,
  228. isAnimation:false,
  229. skeletonShow:true,
  230. isQuantity:false,
  231. isStock:false,
  232. disabled:false,
  233. disabledText:'',
  234. tabCurrentIndex:0,
  235. userID:'',
  236. productID:0,
  237. classifyID:'',//分类ID
  238. goodsData:{},//自定义数据
  239. shop:{},//供应商信息
  240. product:{},//采美
  241. productImage:[],
  242. retailPrice:0,
  243. buyRetailPrice:0,
  244. stock:0,
  245. number:0,
  246. minBuyNumber:0,
  247. productsList:[],
  248. goodListData:[],
  249. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  250. systeminfo: this.setSysteminfo(), //获取设备信息
  251. isIphoneX:this.$store.state.isIphoneX,
  252. windowHeight: '',
  253. headerColor:false,
  254. backPage:1,
  255. nvabarData: { //顶部自定义导航
  256. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  257. title: '' // 导航栏 中间的标题
  258. }
  259. }
  260. },
  261. onLoad(option) {
  262. let self = this;
  263. this.productID = option.id;//获取商品ID
  264. if(option.page == 2){
  265. this.backPage = option.page
  266. }
  267. },
  268. computed: {
  269. ...mapState(['hasLogin','userInfo'])
  270. },
  271. methods:{
  272. initData(){// 初始化商品详情查询
  273. queryProductDetils({productID:this.productID}).then(response =>{
  274. this.skeletonShow = false
  275. this.productImage=[];
  276. this.shop = response.data.shop
  277. this.product = response.data
  278. this.ladderPriceFlag = this.product.ladderPriceFlag;
  279. this.html = this.product.productDetail == null ? this.html : this.$api.adaptRichTextImg(this.product.productDetail.detailInfo)
  280. this.stock = this.product.stock
  281. this.number = this.product.minBuyNumber
  282. this.minBuyNumber = this.product.minBuyNumber
  283. this.classifyID = this.product.classifyID
  284. //处理商品图片列表
  285. this.product.imageList.forEach(item =>{
  286. this.productImage.push(item.image);
  287. })
  288. this.goodsData.cartCount = this.product.productCount
  289. //处理阶梯价格
  290. if(this.product.ladderPriceList!=null){
  291. this.ladderPriceList = this.product.ladderPriceList;
  292. }
  293. //拆分金额并转千分位格式显示
  294. this.retailPrice = this.product.retailPrice.toFixed(2);
  295. this.buyRetailPrice = this.product.retailPrice;
  296. //处理下架商品和售罄商品
  297. if(this.product.validFlag =='3' || this.stock == 0){
  298. this.disabled = true
  299. this.tabCurrentIndex = 2;// 页面显示是默认选中第一
  300. this.isRecommend = true
  301. this.disabledText = '下架'
  302. }else{
  303. this.disabled = false
  304. this.tabCurrentIndex = 0;// 页面显示是默认选中第三
  305. this.disabledText = ''
  306. }
  307. this.goodsData.disabled = this.disabled
  308. if(this.product.validFlag =='3'){
  309. this.disabledText = '下架'
  310. }
  311. if(this.stock == 0){
  312. this.disabledText = '售罄'
  313. }
  314. }).catch(response =>{
  315. this.$util.msg(response.msg,2000);
  316. })
  317. },
  318. swiperChange(e) {//顶部商品图片切换
  319. const index = e.detail.current;
  320. this.current = index;
  321. },
  322. previewImg (index) {//顶部商品图片预览
  323. isPreviewImg = true
  324. let previewUrls = this.productImage
  325. uni.previewImage({
  326. current: index, //图片索引
  327. urls: previewUrls, //必须是http图片,本地图片无效
  328. longPressActions:''
  329. })
  330. },
  331. tabClick(index) {//商品详情&&供应商信息tab切换
  332. this.tabCurrentIndex = index;
  333. if(this.tabCurrentIndex == 2){
  334. console.log(this.product.productID)
  335. this.isRecommend = true
  336. }
  337. if(this.tabCurrentIndex == 3){
  338. this.isEvaluate = true
  339. }
  340. },
  341. changeTab(e) {
  342. this.tabCurrentIndex = e.target.current;
  343. },
  344. handleContact(e){//跳转小程序客服
  345. console.log(e.detail.path)
  346. console.log(e.detail.query)
  347. },
  348. buyProductCart(){//底部购物车按钮点击
  349. if(this.hasLogin){
  350. this.$api.switchTabTo('/pages/tabBar/cart/cart')
  351. }else{
  352. this.$api.navigateTo('/pages/user-module/login-accont?type=1')
  353. }
  354. },
  355. btnGetConfirm(type){//加入购物车&&立即购买点击
  356. if(this.hasLogin){
  357. this.showSpec(type);
  358. }else{
  359. this.$api.navigateTo('/pages/user-module/login-accont?type=1')
  360. }
  361. },
  362. changeCountAdd(){//popup弹窗数量增加按钮
  363. this.number++
  364. if(this.ladderPriceFlag == '1'){
  365. this.ladderPriceList.forEach((item,index)=>{
  366. if(this.number>=item.buyNum){
  367. this.buyRetailPrice = item.buyPrice
  368. }
  369. })
  370. }
  371. },
  372. changeCountSub(){//popup弹窗数量减按钮
  373. if(this.number<=this.minBuyNumber){
  374. this.number= this.minBuyNumber
  375. this.isQuantity =true
  376. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  377. return
  378. }else{
  379. this.number--
  380. if(this.ladderPriceFlag == '1'){
  381. this.ladderPriceList.forEach((item,index)=>{
  382. if(this.number>=item.buyNum){
  383. this.buyRetailPrice = item.buyPrice
  384. }
  385. })
  386. }
  387. this.isQuantity =false
  388. }
  389. },
  390. changeNumber(e){
  391. let _value = e.detail.value;
  392. if(!this.$api.isNumber(_value)){
  393. this.number = this.minBuyNumber
  394. }else if(_value < this.minBuyNumber){
  395. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  396. this.number = this.minBuyNumber
  397. }else{
  398. this.number = e.detail.value
  399. }
  400. },
  401. showSpec(type) {//显示选择数量确认弹窗
  402. this.isBtnType = type
  403. this.specClass = 'show';
  404. },
  405. hideSpec() {//关闭选择数量确认弹窗
  406. this.specClass = 'hide';
  407. setTimeout(() => {
  408. this.specClass = 'none';
  409. }, 200);
  410. },
  411. btnConfirm() {//加入购物车&&立即购买跳转订单页并关闭弹窗
  412. if(this.isBtnType == 'add'){
  413. console.log(this.isBtnType)
  414. this.getAddProductCart()
  415. }else{
  416. console.log(this.number)
  417. this.toConfirmation()
  418. }
  419. },
  420. toConfirmation(){//跳转确认订单页面
  421. this.specClass = 'hide';
  422. let productStp ={
  423. allPrice:this.number*this.buyRetailPrice,
  424. allCount:this.number,
  425. id:this.product.productID,
  426. productCount:this.number
  427. }
  428. this.$api.navigateTo(`/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({data:productStp})}`)
  429. setTimeout(() => {
  430. this.specClass = 'none';
  431. }, 200);
  432. },
  433. getAddProductCart(){//增加购物车成功和toast弹窗提示成功
  434. console.log(this.number)
  435. shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
  436. this.specClass = 'hide';
  437. this.$util.msg(response.msg,1500,true,'success')
  438. this.isAnimation = true
  439. setTimeout(() => {this.specClass = 'none'}, 200)
  440. setTimeout(() => {this.isAnimation = false},2000)
  441. this.goodsData.cartCount = this.product;
  442. }).catch(response =>{
  443. this.$util.msg(response.msg,2000);
  444. })
  445. },
  446. navToLogin(){
  447. this.$api.navigateTo(`/pages/user-module/login-accont?type=detilType&id=${this.productID}`)
  448. },
  449. setHeaderBtnPosi(){
  450. // 获得胶囊按钮位置信息
  451. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  452. // console.log(headerBtnPosi)
  453. return headerBtnPosi
  454. },
  455. setSysteminfo(){
  456. let systeminfo;
  457. uni.getSystemInfo({ // 获取设备信息
  458. success: (res) => {
  459. // console.log(res);
  460. // console.log(res.fontSizeSetting);
  461. // console.log(res.system);
  462. systeminfo = res
  463. },
  464. })
  465. return systeminfo
  466. },
  467. discard(){
  468. //丢弃
  469. }
  470. },
  471. onPageScroll(e){
  472. // console.log(e.scrollTop);//实时获取到滚动的值
  473. if(e.scrollTop>50){
  474. this.headerColor = true
  475. this.nvabarData={
  476. showCapsule: 1,
  477. title: '商品详情',
  478. }
  479. }else{
  480. this.headerColor = false
  481. this.nvabarData={
  482. showCapsule: 1,
  483. title: '',
  484. }
  485. }
  486. if(e.scrollTop>700){
  487. this.navbarFiexd = 'fixed'
  488. }else{
  489. this.navbarFiexd = 'none'
  490. }
  491. },
  492. onShow() {
  493. this.$api.getStorage().then((resolve) => {
  494. this.userID = resolve.userID;
  495. })
  496. if (isPreviewImg) {
  497. isPreviewImg = false;
  498. return;
  499. } else {
  500. this.initData();
  501. }
  502. }
  503. }
  504. </script>
  505. <style lang="scss">
  506. page{
  507. background-color: #F7F7F7;
  508. }
  509. .product{
  510. padding-bottom: 120rpx;
  511. }
  512. .banner-section{
  513. width: 100%;
  514. height: 750rpx;
  515. position: relative;
  516. border-bottom: 1px solid #EBEBEB;
  517. }
  518. .banner{
  519. width: 100%;
  520. height: 750rpx;
  521. image {
  522. width: 100%;
  523. height: 100%;
  524. }
  525. }
  526. .swiper__dots-box{
  527. position: absolute;
  528. bottom: 24px;
  529. right: 24rpx;
  530. /* #ifndef APP-NVUE */
  531. display: flex;
  532. /* #endif */
  533. flex: 1;
  534. flex-direction: row;
  535. justify-content: center;
  536. align-items: center;
  537. height: 12rpx;
  538. padding: 10rpx;
  539. background: rgba(174,174,174,0.6);
  540. border-radius:16rpx;
  541. .swiper__dots-item{
  542. width: 12rpx;
  543. height: 12rpx;
  544. border-radius: 100%;
  545. margin: 6rpx;
  546. background: rgba(62,62,62,1);
  547. }
  548. .none{
  549. background:#FFFFFF;
  550. }
  551. .swiper__dots-long{
  552. background: rgba(62,62,62,1);
  553. transition: all 0.1s;
  554. }
  555. }
  556. .product-wrap{
  557. width: 702rpx;
  558. height: auto;
  559. padding: 24rpx 24rpx 0 24rpx;
  560. background-color: #FFFFFF;
  561. border-bottom: 20rpx solid #F7F7F7;
  562. .wrap-top{
  563. width: 100%;
  564. height: auto;
  565. float: left;
  566. padding-bottom: 24rpx;
  567. border-bottom: 1px solid #F8F8F8;
  568. &.none{
  569. .p-title{
  570. color:#999999
  571. }
  572. }
  573. .p-title{
  574. line-height: 40rpx;
  575. font-size: $font-size-28;
  576. color: $text-color;
  577. font-weight: Bold;
  578. -o-text-overflow: ellipsis;
  579. text-overflow: ellipsis;
  580. display: -webkit-box;
  581. word-break: break-all;
  582. -webkit-box-orient: vertical;
  583. -webkit-line-clamp: 2;
  584. overflow: hidden;
  585. margin-bottom: 16rpx;
  586. }
  587. .p-price{
  588. height: 44rpx;
  589. line-height: 44rpx;
  590. float: left;
  591. .txt{
  592. color: #FF2A2A;
  593. margin:0 2rpx;
  594. }
  595. .txt.sm{
  596. font-size: $font-size-24;
  597. }
  598. .txt.big{
  599. font-size: $font-size-32;
  600. }
  601. }
  602. .p-minBuy{
  603. height: 44rpx;
  604. line-height: 44rpx;
  605. float: right;
  606. padding: 0 18rpx;
  607. border-radius: 22rpx;
  608. background-color: #EBEBEB;
  609. color: #7F7F7F;
  610. font-size: 24rpx;
  611. text-align: center;
  612. .min-text{
  613. margin: 0 6rpx;
  614. }
  615. }
  616. .p-login{
  617. height: 44rpx;
  618. line-height: 44rpx;
  619. color: $color-system;
  620. font-size: $font-size-24;
  621. &.grade{
  622. margin-bottom: 20rpx;
  623. }
  624. .p-no{
  625. float: left;
  626. margin-right: 5rpx;
  627. font-size: $font-size-28;
  628. }
  629. }
  630. }
  631. .wrap-ladder{
  632. float: left;
  633. width: 100%;
  634. border-bottom: 1px solid #F8F8F8;
  635. .ladder-text{
  636. height: 34rpx;
  637. line-height: 34rpx;
  638. margin-bottom: 24rpx;
  639. font-size: 24rpx;
  640. color: #999999;
  641. .ladder-p{
  642. font-size: 20rpx;
  643. }
  644. }
  645. .ladder-main{
  646. width: 654rpx;
  647. height: 102rpx;
  648. padding: 24rpx;
  649. background: url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/02/%E9%98%B6%E6%A2%AF%E4%BB%B7%E6%A0%BC%E8%83%8C%E6%99%AF%403x.png);
  650. background-size: cover;
  651. border-radius: 20rpx;
  652. display: flex;
  653. .ladder-left{
  654. flex: 1.5;
  655. line-height: 51rpx;
  656. font-size: 24rpx;
  657. .ladder-b{
  658. text-align-last: justify;
  659. }
  660. }
  661. .ladder-right{
  662. height: 100%;
  663. display: flex;
  664. align-items: center;
  665. flex: 8.5;
  666. .ladder-li{
  667. height: 100%;
  668. flex: 1;
  669. display:flex;
  670. flex-flow: column;
  671. align-items: center;
  672. .ladder-a{
  673. flex: 1;
  674. height: 51rpx;
  675. line-height: 51rpx;
  676. font-size: 26rpx;
  677. text-align: justify;
  678. color: #FA6400;
  679. font-weight: bold;
  680. }
  681. }
  682. }
  683. }
  684. }
  685. .wrap-label{
  686. float: left;
  687. width: 100%;
  688. padding: 24rpx 0 0 0;
  689. border-bottom: 1px solid #F8F8F8;
  690. .label-a{
  691. padding: 0 18rpx;
  692. line-height: 40rpx;
  693. font-size: $font-size-24;
  694. color: #FFFFFF;
  695. text-align: center;
  696. border-radius: 20rpx;
  697. background:linear-gradient(135deg,rgba(250,100,0,0.7) 0%,rgba(249,80,63,0.7) 100%);
  698. margin: 0 22rpx 22rpx 0;
  699. display: inline-block;
  700. }
  701. }
  702. .wrap-info{
  703. float: left;
  704. width: 100%;
  705. padding: 24rpx 0 0 0;
  706. border-bottom: 1px solid #F8F8F8;
  707. .info-viewT{
  708. width: 100%;
  709. min-height: 40rpx;
  710. font-size: $font-size-28;
  711. color: $text-color;
  712. line-height: 40rpx;
  713. text-align: left;
  714. &.none{
  715. color: #999999;
  716. }
  717. .info-viewL{
  718. min-width: 350rpx;
  719. float: left;
  720. margin-bottom: 24rpx;
  721. }
  722. .info-viewR{
  723. min-width: 352rpx;
  724. float: left;
  725. margin-bottom: 24rpx;
  726. }
  727. }
  728. .info-viewB{
  729. width: 100%;
  730. height: auto;
  731. }
  732. .info-f{
  733. width: 50%;
  734. float: left;
  735. font-size: $font-size-28;
  736. color: $text-color;
  737. line-height: 40rpx;
  738. margin-bottom: 24rpx;
  739. text-align: left;
  740. }
  741. }
  742. .wrap-seve{
  743. float: left;
  744. width: 100%;
  745. height: 72rpx;
  746. line-height: 72rpx;
  747. font-size: $font-size-28;
  748. color: $text-color;
  749. border-bottom: 1px solid #F8F8F8;
  750. &.none{
  751. color: #999999;
  752. .text{
  753. color: #999999;
  754. }
  755. }
  756. .iconfont{
  757. color: $color-system;
  758. margin-left: 20rpx;
  759. font-size: $font-size-24;
  760. }
  761. .text{
  762. font-size: $font-size-24;
  763. color: $text-color;
  764. margin-left: 10rpx;
  765. }
  766. }
  767. }
  768. .product-details {
  769. height: 100%;
  770. background: #FFFFFF;
  771. .navbar {
  772. width: 702rpx;
  773. height: 96rpx;
  774. padding: 0 24rpx;
  775. background: #fff;
  776. z-index: 10;
  777. display: flex;
  778. &.fixed{
  779. position: fixed;
  780. left: 0;
  781. }
  782. .nav-item {
  783. display: flex;
  784. flex: 1;
  785. justify-content: center;
  786. align-items: center;
  787. height: 96rpx;
  788. font-size: $font-size-28;
  789. color: $text-color;
  790. position: relative;
  791. float: left;
  792. position: relative;
  793. .line{
  794. width: 60%;
  795. height: 2px;
  796. border-radius: 1px;
  797. background: #FFFFFF;
  798. position: absolute;
  799. bottom: 0;
  800. left: 50%;
  801. margin-left: -30%;
  802. }
  803. &.current{
  804. color:$color-system;
  805. .line{
  806. background: $color-system;
  807. }
  808. }
  809. }
  810. }
  811. .content{
  812. width: 100%;
  813. min-height: 750rpx;
  814. }
  815. }
  816. .isLower{
  817. width: 100%;
  818. height: 116rpx;
  819. line-height: 116rpx;
  820. text-align: center;
  821. color: #000000;
  822. font-size: $font-size-32;
  823. font-weight: bold;
  824. }
  825. .bottom-btn{
  826. width: 100%;
  827. height: 110rpx;
  828. position: fixed;
  829. bottom: 0;
  830. left: 0;
  831. background: #FFFFFF;
  832. z-index: 99;
  833. .bottom-le{
  834. width: 302rpx;
  835. height: 86rpx;
  836. padding:12rpx 24rpx;
  837. float: left;
  838. .item-bt{
  839. width: 86rpx;
  840. height: 100%;
  841. margin-right:22rpx;
  842. display: flex;
  843. float: left;
  844. flex-direction: column;
  845. align-items: center;
  846. font-size: $font-size-24;
  847. color: $text-color;
  848. line-height: 34rpx;
  849. position: relative;
  850. .animation-num{
  851. font-size:$font-size-32 ;
  852. color: #FF2A2A;
  853. position: absolute;
  854. top: -12rpx;
  855. right: 4rpx;
  856. font-weight: bold;
  857. }
  858. .animation{
  859. animation: showAmnation 2.2s ease-in-out both;
  860. }
  861. .restion{
  862. animation: hideAmnation 1s ease-in-out both;
  863. }
  864. .icon-num{
  865. position: absolute;
  866. right:-12rpx;
  867. top: -9rpx;
  868. }
  869. .icon-num.goleft{
  870. right: 4rpx;
  871. }
  872. &:last-child{
  873. margin-right: 0;
  874. }
  875. image {
  876. width: 40rpx;
  877. height: 40rpx;
  878. margin-bottom: 8rpx;
  879. }
  880. button.contact-btn{
  881. width: 100%;
  882. height: 100%;
  883. margin: 0;
  884. padding: 0;
  885. display: flex;
  886. flex-direction: column;
  887. align-items: center;
  888. box-sizing: border-box;
  889. font-size: $font-size-24;
  890. text-align: center;
  891. text-decoration: none;
  892. line-height: 34rpx;
  893. border-radius: 0;
  894. -webkit-tap-highlight-color: transparent;
  895. overflow: hidden;
  896. color: $text-color;
  897. background-color:#FFFFFF;
  898. }
  899. }
  900. }
  901. .bottom-ri{
  902. width: 400rpx;
  903. height: 100%;
  904. float: right;
  905. display: flex;
  906. .btn{
  907. flex: 1;
  908. width: 200rpx;
  909. line-height: 110rpx;
  910. text-align: center;
  911. font-size: $font-size-28;
  912. color: #FFFFFF;
  913. }
  914. .btn-cart{
  915. background-color: #EFAF00;
  916. }
  917. .btn-cart.disabled{
  918. background-color: rgba(239, 175, 0, 0.5);
  919. }
  920. .btn-bay{
  921. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  922. }
  923. .btn-bay.disabled{
  924. background-color: linear-gradient(135deg,rgba(242,143,49,0.5) 0%,rgba(225,86,22,0.5) 100%);;
  925. }
  926. }
  927. }
  928. .uni-badge--small {
  929. -webkit-transform: scale(.8);
  930. -ms-transform: scale(.8);
  931. transform: scale(.8);
  932. -webkit-transform-origin: center center;
  933. -ms-transform-origin: center center;
  934. transform-origin: center center;
  935. }
  936. .uni-badge {
  937. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  938. -webkit-box-sizing: border-box;
  939. box-sizing: border-box;
  940. font-size: 12px;
  941. line-height: 1;
  942. display: inline-block;
  943. padding: 3px 6px;
  944. color: #333;
  945. border-radius: 100px;
  946. background-color: #f1f1f1;
  947. }
  948. .uni-badge-error {
  949. color: #fff;
  950. background-color: #dd524d;
  951. }
  952. /* 加入购物模态层*/
  953. @keyframes showPopup {
  954. 0% {
  955. opacity: 0;
  956. }
  957. 100% {
  958. opacity: 1;
  959. }
  960. }
  961. @keyframes hidePopup {
  962. 0% {
  963. opacity: 1;
  964. }
  965. 100% {
  966. opacity: 0;
  967. }
  968. }
  969. @keyframes showLayer {
  970. 0% {
  971. transform: translateY(0);
  972. }
  973. 100% {
  974. transform: translateY(-100%);
  975. }
  976. }
  977. @keyframes hideLayer {
  978. 0% {
  979. transform: translateY(-100%);
  980. }
  981. 100% {
  982. transform: translateY(0);
  983. }
  984. }
  985. @keyframes showAmnation {
  986. 0% {
  987. top: -12rpx;
  988. opacity: 0;
  989. }
  990. 50% {
  991. top: -60rpx;
  992. opacity: 1;
  993. }
  994. 100% {
  995. top: -100rpx;
  996. opacity: 0;
  997. }
  998. }
  999. @keyframes hideAmnation {
  1000. 0% {
  1001. top: -100rpx;
  1002. opacity: 0;
  1003. }
  1004. 100% {
  1005. top: -12rpx;
  1006. opacity: 0;
  1007. }
  1008. }
  1009. .popup {
  1010. position: fixed;
  1011. top: 0;
  1012. width: 100%;
  1013. height: 100%;
  1014. z-index: 999;
  1015. display: none;
  1016. .mask{
  1017. position: fixed;
  1018. top: 0;
  1019. width: 100%;
  1020. height: 100%;
  1021. z-index: 21;
  1022. background-color: rgba(0, 0, 0, 0.6);
  1023. }
  1024. .layer {
  1025. position: fixed;
  1026. z-index: 22;
  1027. bottom: -294rpx;
  1028. width: 702rpx;
  1029. padding: 24rpx 24rpx 36rpx 24rpx;
  1030. height: 236rpx;
  1031. border-radius: 30rpx 30rpx 0 0;
  1032. background-color: #fff;
  1033. display: flex;
  1034. flex-wrap: wrap;
  1035. align-content: space-between;
  1036. .content {
  1037. width: 100%;
  1038. }
  1039. .btn {
  1040. width: 100%;
  1041. height: 88rpx;
  1042. .button {
  1043. width: 100%;
  1044. height: 88rpx;
  1045. color: #fff;
  1046. display: flex;
  1047. align-items: center;
  1048. justify-content: center;
  1049. background: $btn-confirm;
  1050. font-size: $font-size-28;
  1051. border-radius: 14rpx;
  1052. }
  1053. }
  1054. }
  1055. &.show {
  1056. display: block;
  1057. .mask{
  1058. animation: showPopup 0.2s linear both;
  1059. }
  1060. .layer {
  1061. animation: showLayer 0.2s linear both;
  1062. }
  1063. }
  1064. &.hide {
  1065. display: block;
  1066. .mask{
  1067. animation: hidePopup 0.2s linear both;
  1068. }
  1069. .layer {
  1070. animation: hideLayer 0.2s linear both;
  1071. }
  1072. }
  1073. &.none {
  1074. display: none;
  1075. }
  1076. &.service {
  1077. .row {
  1078. margin: 30upx 0;
  1079. .title {
  1080. font-size: 30upx;
  1081. margin: 10upx 0;
  1082. }
  1083. .description {
  1084. font-size: 28upx;
  1085. color: #999;
  1086. }
  1087. }
  1088. }
  1089. .layer-smimg{
  1090. width: 114rpx;
  1091. height: 114rpx;
  1092. float: left;
  1093. border-radius: 10rpx;
  1094. margin-right: 24rpx;
  1095. image{
  1096. width: 114rpx;
  1097. height: 114rpx;
  1098. border-radius: 10rpx;
  1099. }
  1100. }
  1101. .layer-nunbox{
  1102. justify-content: space-between;
  1103. align-items: center;
  1104. width: 536rpx;
  1105. height: 88rpx;
  1106. padding: 13rpx 0 0 0;
  1107. float: left;
  1108. .layer-nunbox-t{
  1109. width: 100%;
  1110. height:44rpx;
  1111. position:relative;
  1112. display: flex;
  1113. .layer-nunbox-text{
  1114. line-height: 44rpx;
  1115. font-size: $font-size-28;
  1116. }
  1117. .number-box{
  1118. display: flex;
  1119. justify-content: center;
  1120. align-items: center;
  1121. .iconfont{
  1122. font-size: $font-size-32;
  1123. padding:0 20rpx;
  1124. font-size: $text-color;
  1125. }
  1126. .btn-input{
  1127. width: 62rpx;
  1128. height: 48rpx;
  1129. line-height: 48rpx;
  1130. background: #F8F8F8;
  1131. border-radius: 4rpx;
  1132. text-align: center;
  1133. font-size: $font-size-28;
  1134. }
  1135. }
  1136. .product-step{
  1137. position: absolute;
  1138. left: 45rpx;
  1139. bottom: 0;
  1140. height: 44rpx;
  1141. background: #FFFFFF;
  1142. }
  1143. }
  1144. .layer-nunbox-b{
  1145. width: 100%;
  1146. height:44rpx;
  1147. margin-top: 13rpx;
  1148. }
  1149. .text{
  1150. line-height: 44rpx;
  1151. font-size: $font-size-28;
  1152. .p{
  1153. color: #FF2A2A;
  1154. }
  1155. .p:first-child{
  1156. margin-left: 30rpx;
  1157. }
  1158. .p.sm{
  1159. font-size: $font-size-24;
  1160. }
  1161. }
  1162. }
  1163. }
  1164. /*富文本样式*/
  1165. rich-text.p{
  1166. width: 702rpx !important;
  1167. padding: 0 24rpx;
  1168. text-align: justify;
  1169. }
  1170. rich-text.img{
  1171. width: 100%;
  1172. height: auto;
  1173. }
  1174. </style>