product.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619
  1. <template>
  2. <view class="product" :style="{paddingBottom: userIdentity==1 && userIdentity == 3 ? '0rpx' :'188rpx'}">
  3. <custom-p v-if="isHeaderPoduct"
  4. :systeminfo='systeminfo'
  5. :navbar-data='nvabarData'
  6. :headerBtnPosi ="headerBtnPosi"
  7. :headerColor="headerColor"
  8. :type="isShareType"
  9. :page='backPage'>
  10. </custom-p>
  11. <view class="navbar" :class="navbarFiexd" :style="{top:CustomBar +'px'}">
  12. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 0 }" @click="tabClick(0)">
  13. <text>详情</text>
  14. <text class="line"></text>
  15. </view>
  16. <view class="nav-item tui-skeleton-fillet"
  17. :class="{ current: tabCurrentIndex === 2 }"
  18. @click="tabClick(2)"
  19. v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo">
  20. <text>服务项目</text>
  21. <text class="line"></text>
  22. </view>
  23. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 3 }" @click="tabClick(3)">
  24. <text>推荐</text>
  25. <text class="line"></text>
  26. </view>
  27. </view>
  28. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  29. <view v-else class="cart-content empty" v-if="isInvalid">
  30. <view class="empty-container">
  31. <image class="empty-container-image" :src="productNoneImage" mode="aspectFit"></image>
  32. <text class="error-text">商品已失效,去商城逛逛别的吧~</text>
  33. <view class="login-btn" @click="goIndex">去商城</view>
  34. </view>
  35. </view>
  36. <view class="container-product tui-skeleton" v-else>
  37. <view class="product-top">
  38. <view class="banner-section">
  39. <uni-swiper-dot :info="productImage" :current="current" field="content" :mode="mode" >
  40. <swiper class="banner tui-banner tui-skeleton-rect" @change="swiperChange" :duration='800' :autoplay="false" :circular="true" >
  41. <swiper-item v-for="(item, index) in productImage" :key="index" class="banner-item">
  42. <image :src="item" @click="previewImg(index)" class="product-img" />
  43. </swiper-item>
  44. </swiper>
  45. <view class="swiper__dots-box">
  46. <tui-tag padding="12rpx 24rpx" type="translucent" shape="circleLeft" size="32rpx" :scaleMultiple="0.82" originRight>{{ current + 1 }}/{{ productImage.length }}</tui-tag>
  47. </view>
  48. </uni-swiper-dot>
  49. </view>
  50. <view class="product-wrap clearfix">
  51. <view class="wrap-top" :class="goodsData.isNoneDisabled ? 'none' : ''">
  52. <view class="wrap-top-price" v-if="!goodsData.isNoneDisabled">
  53. <cm-price v-if="isRequest"
  54. :product="product"
  55. :userIdentity="userIdentity"
  56. :shopID= "shopID"
  57. :promotions="product.promotions"
  58. :ladderPriceList="ladderPriceList"/>
  59. </view>
  60. <view class="p-title tui-skeleton-fillet">
  61. <view class="p-title-name">
  62. {{product.name == undefined ? '' : product.name}}
  63. </view>
  64. <button open-type="share" class="p-title-share tui-share-position" @tap="onShare">
  65. <view class=""><text class="iconfont icon-fenxiang1"></text></view>
  66. <view class="">分享</view>
  67. </button>
  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="product-seve">
  73. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">无忧退货</text></text>
  74. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">快速退款</text></text>
  75. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">正品保证</text></text>
  76. </view>
  77. <view class="productRemarks" v-if="product.productRemarks!=''&&product.productRemarks!=null">
  78. 备注:{{product.productRemarks}}
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="product-parameter" @click="showPopup">
  84. <text class="title">参数:</text>
  85. <text class="name">品牌 起订量 分类...</text>
  86. <text class="iconfont icon-xiayibu"></text>
  87. </view>
  88. <view class="product-supplier" @click="goSupplier">
  89. <view class="logo"><img :src="shop.logo" alt=""></view>
  90. <view class="main">
  91. <view class="name">{{shop.name}}</view>
  92. <view class="massgs">
  93. <view class="label">满意度:</view>
  94. <view class="p-stars">
  95. <uni-stars :stars="6" :iconClass="iconClass" :iconColor="iconColor" :fontSize="36" :widthInfo="176"></uni-stars>
  96. </view>
  97. <view class="acount">
  98. <text>{{ shop.normalNum }}</text>件商品
  99. </view>
  100. </view>
  101. </view>
  102. <view class="right"><text class="iconfont icon-xiayibu"></text></view>
  103. </view>
  104. <view class="product-details">
  105. <!-- 商品详情 -->
  106. <view class="title">
  107. <view class="title-tab">商品详情</view>
  108. </view>
  109. <view class="content tui-banner product-rich-text tui-skeleton-rect">
  110. <parser :html="html" :img-mode="widthFix"></parser>
  111. </view>
  112. </view>
  113. <view class="product-details service" v-show="product.productDetail.orderInfo || product.productDetail.serviceInfo">
  114. <!-- 服务项目 -->
  115. <view class="title">
  116. <view class="title-tab">服务项目</view>
  117. </view>
  118. <view class="content service">
  119. <cm-service :product="product.productDetail" v-if="isRequest"></cm-service>
  120. </view>
  121. </view>
  122. <view class="product-details recommend">
  123. <!-- 相关推荐 -->
  124. <view class="title">
  125. <view class="title-tab">相关推荐</view>
  126. </view>
  127. <view class="content hot">
  128. <recommend :query-productid="product.productID" v-if="isRequest"></recommend>
  129. </view>
  130. </view>
  131. <!-- 商品参数 -->
  132. <tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
  133. <view class="tui-popup-box clearfix">
  134. <view class="title">商品参数</view>
  135. <view class="content">
  136. <view class="content-tr">
  137. <view class="content-td">起订量</view>
  138. <view class="content-th">{{product.minBuyNumber}}</view>
  139. </view>
  140. <view class="content-tr">
  141. <view class="content-td">品牌</view>
  142. <view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
  143. </view>
  144. <view class="content-tr">
  145. <view class="content-td">包装规格</view>
  146. <view class="content-th">{{product.unit}}</view>
  147. </view>
  148. <view class="content-tr">
  149. <view class="content-td">商品编码</view>
  150. <view class="content-th">{{product.productCode}}</view>
  151. </view>
  152. <view class="content-tr">
  153. <view class="content-td">库存</view>
  154. <view class="content-th">{{product.stock}}</view>
  155. </view>
  156. <view class="content-tr" v-if="product.parametersList.length>0" v-for="(item, index) in product.parametersList" :key="index">
  157. <view class="content-td">{{item.paramsName}}</view>
  158. <view class="content-th">{{item.paramsContent}}</view>
  159. </view>
  160. </view>
  161. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
  162. <view class="tui-flex-1">
  163. <view class="tui-button" @click="hidePopup()">收起</view>
  164. </view>
  165. </view>
  166. </view>
  167. </tui-bottom-popup>
  168. <!-- 底部按钮 -->
  169. <view class="menu" v-if="userIdentity!=1 && userIdentity != 3">
  170. <view class="bottom-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  171. <view class="bottom-le">
  172. <view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">
  173. <image src="../../static/icon-home-active@3x.png"></image>
  174. <text>首页</text>
  175. </view>
  176. <view class="item-bt">
  177. <!-- #ifdef MP-WEIXIN -->
  178. <button class="contact-btn" open-type="contact" @bindcontact="handleContact">
  179. <image src="../../static/severs@3x.png"></image>
  180. <text>客服</text>
  181. </button>
  182. <!-- #endif -->
  183. </view>
  184. <view class="item-bt" @click="buyProductCart()">
  185. <image src="../../static/icon-cart-active@3x.png"></image>
  186. <text>购物车</text>
  187. <text v-if="hasLogin && goodsData.cartCount>0"
  188. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  189. :class="[goodsData.cartCount < 10 ? 'goleft':'']">
  190. {{ goodsData.cartCount >= 100 ? '99+': goodsData.cartCount}}
  191. </text>
  192. <view class="animation-num" :class="isAnimation ? 'animation' : 'restion'">+1</view>
  193. </view>
  194. </view>
  195. <view class="bottom-ri">
  196. <button
  197. :disabled="goodsData.disabled"
  198. class="btn btn-cart"
  199. :class="[goodsData.disabled ? 'disabled':'']"
  200. @tap.stop="btnGetConfirm('add')">加入购物车</button>
  201. <button
  202. :disabled="goodsData.disabled"
  203. class="btn btn-bay"
  204. :class="[goodsData.disabled ? 'disabled':'']"
  205. @tap.stop="btnGetConfirm('buy')">立即购买</button>
  206. </view>
  207. </view>
  208. </view>
  209. <!--底部选择模态层弹窗组件 -->
  210. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" @tap="hideSpec">
  211. <!-- 遮罩层 -->
  212. <view class="mask"></view>
  213. <view class="layer" @tap.stop="discard" :style="{paddingBottom :isIphoneX ? '68rpx' : '36rpx',bottom:isIphoneX ?'-352rpx' : '-296rpx'}">
  214. <view class="content">
  215. <view class="layer-smimg">
  216. <image :src="product.mainImage" mode=""></image>
  217. </view>
  218. <view class="layer-nunbox">
  219. <view class="layer-nunbox-t" v-if="product.step === 2">
  220. <view class="text">*该商品只能以起订量的整数倍购买</view>
  221. </view>
  222. <view class="layer-nunbox-t">
  223. <view class="layer-nunbox-text">数量:</view>
  224. <view class="number-box">
  225. <view class="iconfont icon-jianhao" :class="[isQuantity==true?'disabled':'']" @click="changeCountSub()"></view>
  226. <input class="btn-input" type="number" v-model="number" maxlength='4' @blur="changeNumber($event)">
  227. <view class="iconfont icon-jiahao" :class="[isStock==true?'disabled':'']" @click="changeCountAdd()"></view>
  228. </view>
  229. </view>
  230. <view class="layer-nunbox-b">
  231. <view class="text">单价:
  232. <text class="p sm">¥</text>
  233. <text class="p bg">{{buyRetailPrice.toFixed(2)}}</text>
  234. </view>
  235. </view>
  236. </view>
  237. </view>
  238. <view class="btn"><view class="button" @click.stop="btnConfirm">确定</view></view>
  239. </view>
  240. </view>
  241. <!-- 侧边 -->
  242. <scroll-top v-if="isScrollTop"></scroll-top>
  243. </view>
  244. </view>
  245. </template>
  246. <script>
  247. import { mapState,mapMutations } from 'vuex'
  248. import customP from '@/components/cm-module/headerNavbar/header-poduct' //自定义导航
  249. import cmPrice from "@/components/cm-module/productDetails/cm-price.vue" //价格显示
  250. import cmAttributes from "@/components/cm-module/productDetails/cm-attributes.vue" //规格信息
  251. import authorize from '@/common/config/authorize.js'
  252. import parser from "@/components/jyf-Parser/index" //富文本处理
  253. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  254. import recommend from "@/components/cm-module/productDetails/recommend" //相关推荐
  255. import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
  256. import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
  257. import wxLogin from "@/common/config/wxLogin.js"
  258. var isPreviewImg;
  259. export default{
  260. components:{
  261. customP,
  262. parser,
  263. tuiSkeleton,
  264. recommend,
  265. cmPrice,
  266. cmAttributes,
  267. cmParameter,
  268. cmService
  269. },
  270. data(){
  271. return{
  272. html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
  273. disabledTabNavList:[{name:'相关推荐'}],
  274. mode:'round',
  275. iconClass:'icon-aixin',
  276. iconColor:'#ff9100',
  277. specClass: '',//规格弹窗css类,控制开关动画
  278. isBtnType:'',
  279. isRequest:false,
  280. isScrollTop:false,
  281. current:0,
  282. shopId:0,
  283. isShareType:'',
  284. productNoneImage:'http://static-b.caimei365.com/app/img/icon/icon-pnone.png',
  285. isHeaderPoduct:false,
  286. navbarFiexd:'none',
  287. ladderPriceFlag:'',
  288. ladderPriceList:'',
  289. isInvalid:false,
  290. isEvaluate:false,
  291. isAnimation:false,
  292. skeletonShow:true,
  293. isQuantity:false,
  294. isStock:false,
  295. disabled:false,
  296. isNoneDisabled:false,
  297. tabCurrentIndex:0,
  298. userID:'',
  299. shopID:'',
  300. productID:0,
  301. userIdentity:'',//用户类型
  302. goodsData:{},//自定义数据
  303. shop:{},//供应商信息
  304. product:{},//采美
  305. productImage:[],
  306. retailPrice:0,
  307. buyRetailPrice:0,
  308. buyRetailPriceStep:1,
  309. stock:0,
  310. number:0,
  311. minBuyNumber:0,
  312. productsList:[],
  313. goodListData:[],
  314. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  315. systeminfo: this.setSysteminfo(), //获取设备信息
  316. isIphoneX:this.$store.state.isIphoneX,
  317. windowHeight: '',
  318. headerColor:false,
  319. backPage:1,
  320. nvabarData: { //顶部自定义导航
  321. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  322. title: '' // 导航栏 中间的标题
  323. },
  324. linkPath:'',
  325. CustomBar:this.CustomBar,// 顶部导航栏高度
  326. popupShow:false//参数弹窗
  327. }
  328. },
  329. onLoad(option) {
  330. this.productID = option.id;//获取商品ID
  331. this.isShareType = option.type
  332. this.linkPath = option.path
  333. this.isHeaderPoduct = true
  334. if(option.page == 2){
  335. this.backPage = option.page
  336. }
  337. if(this.isShareType =='share'){
  338. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  339. console.log(wxResponse)
  340. if(wxResponse == 1){
  341. wxLogin.wxLoginAuthorize()
  342. }else{
  343. console.log(new Date +'用户未授权微信信息')
  344. }
  345. })
  346. }
  347. },
  348. computed: {
  349. ...mapState(['hasLogin','isWxAuthorize'])
  350. },
  351. methods:{
  352. initData(){// 初始化商品详情查询
  353. this.ProductService.queryProductDetils({userId:this.userID,productID:this.productID}).then(response =>{
  354. this.skeletonShow = false
  355. this.productImage=[];
  356. this.shop = response.data.shop
  357. this.shopId = response.data.shopID
  358. this.product = response.data
  359. //已删除/已冻结
  360. if(this.product.validFlag === '0'){
  361. this.isInvalid = true
  362. }
  363. this.ladderPriceFlag = this.product.ladderPriceFlag;
  364. this.html = this.product.productDetail == null ? this.html : this.$api.adaptRichTextImg(this.product.productDetail.detailInfo)
  365. this.stock = this.product.stock
  366. this.buyRetailPriceStep = this.product.step
  367. this.number = this.product.minBuyNumber
  368. this.minBuyNumber = this.product.minBuyNumber
  369. //处理商品图片列表
  370. this.product.imageList.forEach(item =>{
  371. this.productImage.push(item.image);
  372. })
  373. //购物车数量
  374. this.goodsData.cartCount = this.product.productCount
  375. //处理阶梯价格
  376. if(this.product.ladderPriceList!=null){
  377. this.ladderPriceList = this.product.ladderPriceList;
  378. }
  379. //拆分金额并转千分位格式显示
  380. if(this.product.retailPrice!=null){
  381. this.retailPrice = this.product.retailPrice.toFixed(2);
  382. this.buyRetailPrice = this.product.retailPrice;
  383. }
  384. //处理下架商品和售罄商品
  385. if(this.product.validFlag =='3' || this.stock == 0 ){
  386. this.disabled = true
  387. this.isNoneDisabled = true
  388. this.tabCurrentIndex = 3;// 页面显示是默认选中第一
  389. this.goodsData.disabledText = '下架'
  390. }else{
  391. this.disabled = false
  392. this.isNoneDisabled = false
  393. this.tabCurrentIndex = 0;// 页面显示是默认选中第三
  394. this.goodsData.disabledText = ''
  395. }
  396. if(this.product.price1TextFlag == "1"){
  397. this.disabled = true
  398. }
  399. if(this.product.price1TextFlag == "2"){
  400. if(this.userIdentity == 4){
  401. this.disabled = true
  402. }else{
  403. this.disabled = false
  404. }
  405. }
  406. this.goodsData.disabled = this.disabled
  407. this.goodsData.isNoneDisabled = this.isNoneDisabled
  408. if(this.product.validFlag =='3'){
  409. this.goodsData.disabledText = '下架'
  410. }
  411. if(this.stock == 0){
  412. this.goodsData.disabledText = '售罄'
  413. }
  414. this.isRequest = true
  415. }).catch(error =>{
  416. this.$util.msg(error.msg,2000);
  417. })
  418. },
  419. swiperChange(e) {//顶部商品图片切换
  420. const index = e.detail.current;
  421. this.current = index;
  422. },
  423. previewImg (index) {//顶部商品图片预览
  424. isPreviewImg = true
  425. let previewUrls = this.productImage
  426. uni.previewImage({
  427. current: index, //图片索引
  428. urls: previewUrls, //必须是http图片,本地图片无效
  429. longPressActions:''
  430. })
  431. },
  432. tabClick(index) {//商品详情&&供应商信息tab切换
  433. console.log(index)
  434. this.tabCurrentIndex = index;
  435. },
  436. handleContact(e){//跳转小程序客服
  437. },
  438. buyProductCart(){//底部购物车按钮点击
  439. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  440. if(wxResponse == 1){
  441. if(this.hasLogin){
  442. this.$api.navigateTo('/pages/goods/cart')
  443. }else{
  444. this.$api.navigateTo('/pages/login/login?type=1')
  445. }
  446. }else{
  447. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  448. }
  449. })
  450. },
  451. btnGetConfirm(type){//加入购物车&&立即购买点击
  452. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  453. if(wxResponse == 1){
  454. if(this.hasLogin){
  455. this.showSpec(type);
  456. }else{
  457. this.$api.navigateTo('/pages/login/login?type=1')
  458. }
  459. }else{
  460. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  461. }
  462. })
  463. },
  464. changeCountAdd(){//popup弹窗数量增加按钮
  465. if(this.buyRetailPriceStep == 2){
  466. this.number+=this.minBuyNumber
  467. }else{
  468. this.number++
  469. }
  470. this.processActivityPrice()
  471. },
  472. changeCountSub(){//popup弹窗数量减按钮
  473. if(this.number<=this.minBuyNumber){
  474. this.number= this.minBuyNumber
  475. this.isQuantity =true
  476. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  477. return
  478. }else{
  479. if(this.buyRetailPriceStep == 2){
  480. this.number-=this.minBuyNumber
  481. }else{
  482. this.number--
  483. }
  484. this.processActivityPrice()
  485. this.isQuantity =false
  486. }
  487. },
  488. changeNumber(e){
  489. let _value = e.detail.value;
  490. if(!this.$api.isNumber(_value)){
  491. this.number = this.minBuyNumber
  492. }else if(_value < this.minBuyNumber){
  493. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  494. this.number = this.minBuyNumber
  495. }else if( _value % this.minBuyNumber !=0 ){
  496. this.$util.msg(`购买量必须为起订量的整数倍`,2000);
  497. this.number = this.minBuyNumber
  498. }else{
  499. this.number = e.detail.value
  500. }
  501. this.processActivityPrice()
  502. },
  503. processActivityPrice(){//单独处理活动价格和阶梯价格
  504. if(this.ladderPriceFlag == '0' && this.product.actStatus == 0 || this.product.actStatus == 1){
  505. this.buyRetailPrice = this.product.retailPrice
  506. }else{
  507. this.ladderPriceList.forEach((item,index)=>{
  508. if(this.number>=item.buyNum){
  509. this.buyRetailPrice = item.buyPrice
  510. }
  511. })
  512. }
  513. },
  514. showSpec(type) {//显示选择数量确认弹窗
  515. this.isBtnType = type
  516. this.specClass = 'show';
  517. },
  518. hideSpec() {//关闭选择数量确认弹窗
  519. this.specClass = 'hide';
  520. setTimeout(() => {
  521. this.specClass = 'none';
  522. }, 200);
  523. },
  524. btnConfirm() {//加入购物车&&立即购买跳转订单页并关闭弹窗
  525. if(this.isBtnType == 'add'){
  526. this.getAddProductCart()
  527. }else{
  528. this.toConfirmation()
  529. }
  530. },
  531. toConfirmation(){//跳转确认订单页面
  532. this.specClass = 'hide';
  533. let productStp ={
  534. allPrice:this.number*this.buyRetailPrice,
  535. allCount:this.number,
  536. productID:this.product.productID,
  537. productCount:this.number
  538. }
  539. this.$api.navigateTo(`/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({data:productStp})}`)
  540. setTimeout(() => {
  541. this.specClass = 'none';
  542. }, 200);
  543. },
  544. getAddProductCart(){//增加购物车成功和toast弹窗提示成功
  545. this.ProductService.shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
  546. this.specClass = 'hide';
  547. this.$util.msg('加入购物车成功',1500,true,'success')
  548. this.isAnimation = true
  549. setTimeout(() => {this.specClass = 'none'}, 200)
  550. setTimeout(() => {this.isAnimation = false},2000)
  551. this.goodsData.cartCount = response.data;
  552. }).catch(error =>{
  553. this.$util.msg(error.msg,2000);
  554. })
  555. },
  556. navToLogin(){
  557. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  558. if(wxResponse == 1){
  559. this.$store.commit('setLoginType',8)
  560. this.$store.commit('setLoginProductId',this.productID)
  561. this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
  562. }else{
  563. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  564. }
  565. })
  566. },
  567. setHeaderBtnPosi(){
  568. // 获得胶囊按钮位置信息
  569. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  570. return headerBtnPosi
  571. },
  572. setSysteminfo(){
  573. let systeminfo;
  574. uni.getSystemInfo({ // 获取设备信息
  575. success: (res) => {
  576. systeminfo = res
  577. },
  578. })
  579. return systeminfo
  580. },
  581. getOptionFn(e){
  582. this.isShareType = e.type
  583. },
  584. goIndex(){//商城首页
  585. uni.switchTab({
  586. url: '/pages/tabBar/home/index'
  587. });
  588. },
  589. goSupplier(){//跳供应商资料页
  590. this.$api.navigateTo('/supplier/pages/user/my-shop?shopId='+this.shopId)
  591. },
  592. discard(){
  593. //丢弃
  594. },
  595. onShare(res){//分享转发
  596. if (res.from === 'button') {
  597. // 来自页面内转发按钮
  598. }
  599. return {
  600. title: `${this.product.name}`,
  601. path: `pages/goods/product?type=share&id=${this.productID}`,
  602. imageUrl:`${this.productImage[0]}`
  603. }
  604. },
  605. showPopup(){
  606. this.popupShow = true
  607. },
  608. hidePopup(){
  609. this.popupShow = false
  610. }
  611. },
  612. onPageScroll(e){//实时获取到滚动的值
  613. if(e.scrollTop>50){
  614. this.headerColor = true
  615. this.navbarFiexd = 'fixed'
  616. this.nvabarData={
  617. showCapsule: 1,
  618. title: '商品详情',
  619. }
  620. }else{
  621. this.headerColor = false
  622. this.navbarFiexd = 'none'
  623. this.nvabarData={
  624. showCapsule: 1,
  625. title: '',
  626. }
  627. }
  628. if(e.scrollTop>700){
  629. this.isScrollTop = true
  630. }else{
  631. this.isScrollTop = false
  632. }
  633. },
  634. onShareAppMessage(res){//分享转发
  635. if (res.from === 'button') {
  636. // 来自页面内转发按钮
  637. }
  638. return {
  639. title: `${this.product.name}`,
  640. path: `pages/goods/product?type=share&id=${this.productID}`,
  641. imageUrl:`${this.productImage[0]}`
  642. }
  643. },
  644. onShow() {
  645. this.$api.getStorage().then((resolve) => {
  646. this.userID = resolve.userID ? resolve.userID : '';
  647. this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 3
  648. this.shopID = resolve.shopID ? resolve.shopID : '';
  649. if (isPreviewImg) {
  650. isPreviewImg = false;
  651. return;
  652. } else {
  653. this.initData();
  654. }
  655. }).catch(error =>{
  656. this.initData();
  657. })
  658. }
  659. }
  660. </script>
  661. <style lang="scss">
  662. page{
  663. background-color: #FFFFFF;
  664. }
  665. .banner-section{
  666. width: 100%;
  667. height: 750rpx;
  668. position: relative;
  669. }
  670. .banner{
  671. width: 100%;
  672. height: 750rpx;
  673. .product-img{
  674. width: 750rpx;
  675. }
  676. image {
  677. width: 100%;
  678. height: 100%;
  679. }
  680. }
  681. .swiper__dots-box{
  682. position: absolute;
  683. color: #fff;
  684. bottom: 30rpx;
  685. right: 0;
  686. }
  687. .product-wrap{
  688. width: 100%;
  689. height: auto;
  690. padding: 24rpx 0 0 0;
  691. background-color: #FFFFFF;
  692. border-bottom: 20rpx solid #F7F7F7;
  693. .productRemarks{
  694. height: 48rpx;
  695. width: 100%;
  696. float: left;
  697. line-height: 48rpx;
  698. font-size: 24rpx;
  699. color: #999999;
  700. text-align: left;
  701. }
  702. .wrap-top{
  703. width: 702rpx;
  704. padding: 0 24rpx;
  705. height: auto;
  706. float: left;
  707. padding-bottom:20rpx;
  708. border-bottom: 1px solid #F8F8F8;
  709. &.none{
  710. .p-title{
  711. color:#999999
  712. }
  713. }
  714. .p-title{
  715. width: 100%;
  716. height: auto;
  717. float: left;
  718. .p-title-name{
  719. width:602rpx;
  720. height: 96rpx;
  721. float: left;
  722. line-height: 42rpx;
  723. font-size: $font-size-28;
  724. color: $text-color;
  725. -o-text-overflow: ellipsis;
  726. text-overflow: ellipsis;
  727. display: -webkit-box;
  728. word-break: break-all;
  729. -webkit-box-orient: vertical;
  730. -webkit-line-clamp: 2;
  731. overflow: hidden;
  732. }
  733. .p-title-share{
  734. width: 96rpx;
  735. height: 96rpx;
  736. float: right;
  737. text-align: center;
  738. color: #999999;
  739. font-size: $font-size-24;
  740. box-sizing: border-box;
  741. padding: 8rpx 0;
  742. .icon-fenxiang1{
  743. font-size: $font-size-34;
  744. }
  745. }
  746. }
  747. .wrap-main-text{
  748. line-height: 56rpx;
  749. color: #FF2A2A;
  750. font-size: $font-size-26;
  751. display: block;
  752. float: left;
  753. font-weight: normal;
  754. }
  755. .wrap-main-none{
  756. display: block;
  757. width: 256rpx;
  758. height: 44rpx;
  759. padding-left: 20rpx;
  760. border-radius: 11rpx;
  761. background: $btn-confirm;
  762. float: right;
  763. line-height: 44rpx;
  764. color: #FFFFFF;
  765. text-align: center;
  766. font-size: $font-size-24;
  767. }
  768. .p-price-none{
  769. height: 44rpx;
  770. line-height: 44rpx;
  771. float: left;
  772. font-size: $font-size-24;
  773. color: #666;
  774. text-decoration: line-through;
  775. margin-left: 8rpx;
  776. }
  777. .p-minBuy{
  778. height: 44rpx;
  779. line-height: 44rpx;
  780. float: right;
  781. padding: 0 18rpx;
  782. border-radius: 22rpx;
  783. background-color: #f7f7f7;
  784. color: #7F7F7F;
  785. font-size: 24rpx;
  786. text-align: center;
  787. .min-text{
  788. margin: 0 6rpx;
  789. }
  790. }
  791. .p-login{
  792. height: 56rpx;
  793. line-height: 56rpx;
  794. color: $color-system;
  795. font-size: $font-size-24;
  796. &.grade{
  797. .price-left{
  798. float: left;
  799. .none{
  800. display: block;
  801. font-size: $font-size-20;
  802. line-height: 48rpx;
  803. color: #4A4B54;
  804. float: left;
  805. font-weight: bold;
  806. margin-left: 5rpx;
  807. text{
  808. letter-spacing: 4rpx;
  809. font-size: $font-size-32;
  810. }
  811. }
  812. }
  813. }
  814. .p-no{
  815. float: left;
  816. margin-right: 5rpx;
  817. font-size: $font-size-28;
  818. color: $text-color;
  819. }
  820. .p-login-btn{
  821. display: block;
  822. height: 44rpx;
  823. padding: 0 10rpx 0 20rpx;
  824. border-radius: 11rpx;
  825. background: $btn-confirm;
  826. float: right;
  827. line-height: 44rpx;
  828. color: #FFFFFF;
  829. text-align: center;
  830. font-size: $font-size-24;
  831. }
  832. }
  833. }
  834. .wrap-label{
  835. float: left;
  836. width: 100%;
  837. box-sizing: border-box;
  838. .label-a{
  839. padding: 0 18rpx;
  840. line-height: 32rpx;
  841. font-size: $font-size-20;
  842. color:$color-system;
  843. text-align: center;
  844. border-radius: 6rpx;
  845. background:#ffe6dc;
  846. margin: 0 20rpx 15rpx 0;
  847. display: inline-block;
  848. }
  849. }
  850. .wrap-top-price{
  851. float: left;
  852. width: 100%;
  853. box-sizing: border-box;
  854. .wrap-main-item{
  855. width: 100%;
  856. height: 56rpx;
  857. .p-price{
  858. height: 56rpx;
  859. line-height: 56rpx;
  860. float: left;
  861. color: #FF2A2A;
  862. font-weight: bold;
  863. &.none{
  864. text-decoration: line-through;
  865. color: #999999;
  866. font-weight: normal;
  867. }
  868. .txt{
  869. margin:0 2rpx;
  870. }
  871. .txt.sm{
  872. font-size: $font-size-26;
  873. }
  874. .txt.big{
  875. font-size: $font-size-34;
  876. }
  877. }
  878. }
  879. .floor-item-act{
  880. height: 56rpx;
  881. text-align: center;
  882. box-sizing: border-box;
  883. float: left;
  884. padding:10rpx 0;
  885. margin-left: 10rpx;
  886. .floor-tags{
  887. float: right;
  888. height: 36rpx;
  889. border-radius: 4rpx;
  890. background-color: rgba(225, 86, 22, 0.1);
  891. line-height: 36rpx;
  892. color: $color-system;
  893. text-align: center;
  894. display: inline-block;
  895. padding:0 16rpx;
  896. font-size: $font-size-20;
  897. }
  898. }
  899. .floor-item-btn{
  900. float: left;
  901. height: 40rpx;
  902. margin-top: 8rpx;
  903. margin-left: 10rpx;
  904. .btn{
  905. line-height: 40rpx;
  906. padding: 0 20rpx;
  907. height: 40rpx;
  908. background: $btn-confirm;
  909. color: #FFFFFF;
  910. font-size: $font-size-20;
  911. border-radius: 4rpx;
  912. }
  913. }
  914. }
  915. .wrap-info{
  916. float: left;
  917. width: 702rpx;
  918. padding: 24rpx 24rpx 0 24rpx;
  919. border-bottom: 1px solid #F8F8F8;
  920. .info-viewT{
  921. width: 100%;
  922. min-height: 40rpx;
  923. font-size: $font-size-28;
  924. color: $text-color;
  925. line-height: 40rpx;
  926. text-align: left;
  927. &.none{
  928. color: #999999;
  929. }
  930. .info-viewL{
  931. min-width: 350rpx;
  932. float: left;
  933. margin-bottom: 24rpx;
  934. }
  935. .info-viewR{
  936. min-width: 352rpx;
  937. float: left;
  938. margin-bottom: 24rpx;
  939. }
  940. }
  941. .info-viewB{
  942. width: 100%;
  943. height: auto;
  944. }
  945. .info-f{
  946. width: 50%;
  947. float: left;
  948. font-size: $font-size-28;
  949. color: $text-color;
  950. line-height: 40rpx;
  951. margin-bottom: 24rpx;
  952. text-align: left;
  953. }
  954. }
  955. }
  956. .product-seve{
  957. width: 100%;
  958. height: 60rpx;
  959. background-color: #FFFFFF;
  960. position: relative;
  961. display: flex;
  962. line-height: 60rpx;
  963. .iconfont{
  964. color: #fea785;
  965. margin-right: 20rpx;
  966. font-size: $font-size-22;
  967. }
  968. .text{
  969. font-size: $font-size-22;
  970. color: #fea785;
  971. margin-left: 10rpx;
  972. }
  973. }
  974. .product-parameter{
  975. width: 702rpx;
  976. height: 90rpx;
  977. padding: 0 24rpx;
  978. background-color: #FFFFFF;
  979. position: relative;
  980. display: flex;
  981. border-bottom: 20rpx solid #F7F7F7;
  982. .title{
  983. line-height: 90rpx;
  984. display: inline-block;
  985. float: left;
  986. font-size: $font-size-28;
  987. color: #666666;
  988. }
  989. .name{
  990. float: right;
  991. line-height: 90rpx;
  992. display: inline-block;
  993. float: left;
  994. font-size: $font-size-28;
  995. color: $text-color;
  996. float: right;
  997. padding-right: 48rpx;
  998. overflow: hidden;
  999. text-overflow:ellipsis;
  1000. white-space: nowrap;
  1001. text-align: right;
  1002. }
  1003. .icon-xiayibu{
  1004. line-height: 90rpx;
  1005. display: inline-block;
  1006. position: absolute;
  1007. width: 48rpx;
  1008. top: 0;
  1009. right: 0;
  1010. color: #b2b2b2;
  1011. }
  1012. }
  1013. .product-supplier{
  1014. width: 100%;
  1015. height: 174rpx;
  1016. padding: 30rpx 24rpx;
  1017. box-sizing: border-box;
  1018. background-color: #FFFFFF;
  1019. position: relative;
  1020. box-sizing: border-box;
  1021. border-bottom: 20rpx solid #F7F7F7;
  1022. .logo{
  1023. width: 128rpx;
  1024. height: 92rpx;
  1025. float: left;
  1026. border: 1px solid #efefef;
  1027. border-radius: 6rpx;
  1028. image{
  1029. width: 100%;
  1030. height: 100%;
  1031. display: block;
  1032. border-radius: 6rpx;
  1033. }
  1034. }
  1035. .main{
  1036. width: 470rpx;
  1037. height: 92rpx;
  1038. float: left;
  1039. margin-left: 20rpx;
  1040. .name{
  1041. width: 100%;
  1042. line-height: 46rpx;
  1043. float: left;
  1044. font-size: $font-size-28;
  1045. color: $text-color;
  1046. float: right;
  1047. overflow: hidden;
  1048. text-overflow:ellipsis;
  1049. white-space: nowrap;
  1050. text-align: left;
  1051. }
  1052. .massgs{
  1053. width: 100%;
  1054. line-height: 46rpx;
  1055. float: left;
  1056. font-size: $font-size-24;
  1057. color: #999999;
  1058. .label{
  1059. float: left;
  1060. }
  1061. .p-stars{
  1062. float: left;
  1063. margin-left: 20rpx;
  1064. }
  1065. .acount{
  1066. float: right;
  1067. text{
  1068. color: $color-system;
  1069. }
  1070. }
  1071. }
  1072. }
  1073. .icon-xiayibu{
  1074. line-height: 154rpx;
  1075. display: inline-block;
  1076. position: absolute;
  1077. width: 48rpx;
  1078. top: 0;
  1079. right: 0;
  1080. color: #b2b2b2;
  1081. }
  1082. }
  1083. .product-details {
  1084. width: 100%;
  1085. background: #FFFFFF;
  1086. border-bottom: 20rpx solid #F7F7F7;
  1087. &.service{
  1088. border-bottom: none;
  1089. }
  1090. &.recommend{
  1091. background-color: #F7F7F7;
  1092. border-bottom: none;
  1093. .title{
  1094. .title-tab{
  1095. background-color: #F7F7F7;
  1096. color: $text-color;
  1097. }
  1098. }
  1099. }
  1100. .title{
  1101. width: 100%;
  1102. box-sizing: border-box;
  1103. padding: 0 24rpx;
  1104. .title-tab{
  1105. width: 100%;
  1106. height: 100rpx;
  1107. background: #fff;
  1108. z-index: 10;
  1109. font-size: $font-size-30;
  1110. text-align: left;
  1111. color: $text-color;
  1112. line-height: 100rpx;
  1113. font-weight: 600;
  1114. }
  1115. .title-msg{
  1116. width: 100%;
  1117. height: 236rpx;
  1118. padding: 18rpx;
  1119. background-color: rgba(225,86,22, 0.1);
  1120. color: $color-system;
  1121. box-sizing: border-box;
  1122. margin-bottom: 30rpx;
  1123. .tit{
  1124. line-height: 46rpx;
  1125. font-size: $font-size-24;
  1126. text-align: left;
  1127. }
  1128. .txt{
  1129. line-height: 38rpx;
  1130. font-size: $font-size-20;
  1131. text-align: justify;
  1132. }
  1133. }
  1134. }
  1135. .content{
  1136. width: 100%;
  1137. min-height: 750rpx;
  1138. background-color: #FFFFFF;
  1139. }
  1140. }
  1141. .isLower{
  1142. width: 100%;
  1143. height: 116rpx;
  1144. line-height: 116rpx;
  1145. text-align: center;
  1146. color: #000000;
  1147. font-size: $font-size-32;
  1148. font-weight: bold;
  1149. }
  1150. .bottom-btn{
  1151. width: 100%;
  1152. height: 110rpx;
  1153. position: fixed;
  1154. bottom: 0;
  1155. left: 0;
  1156. background: #FFFFFF;
  1157. z-index: 99;
  1158. .bottom-le{
  1159. width: 302rpx;
  1160. height: 86rpx;
  1161. padding:12rpx 24rpx;
  1162. float: left;
  1163. .item-bt{
  1164. width: 86rpx;
  1165. height: 100%;
  1166. margin-right:22rpx;
  1167. display: flex;
  1168. float: left;
  1169. flex-direction: column;
  1170. align-items: center;
  1171. font-size: $font-size-24;
  1172. color: $text-color;
  1173. line-height: 34rpx;
  1174. position: relative;
  1175. .animation-num{
  1176. font-size:$font-size-32 ;
  1177. color: #FF2A2A;
  1178. position: absolute;
  1179. top: -12rpx;
  1180. right: 4rpx;
  1181. font-weight: bold;
  1182. }
  1183. .animation{
  1184. animation: showAmnation 2.2s ease-in-out both;
  1185. }
  1186. .restion{
  1187. animation: hideAmnation 1s ease-in-out both;
  1188. }
  1189. .icon-num{
  1190. position: absolute;
  1191. right:-12rpx;
  1192. top: -9rpx;
  1193. }
  1194. .icon-num.goleft{
  1195. right: 4rpx;
  1196. }
  1197. &:last-child{
  1198. margin-right: 0;
  1199. }
  1200. image {
  1201. width: 40rpx;
  1202. height: 40rpx;
  1203. margin-bottom: 8rpx;
  1204. }
  1205. button.contact-btn{
  1206. width: 100%;
  1207. height: 100%;
  1208. margin: 0;
  1209. padding: 0;
  1210. display: flex;
  1211. flex-direction: column;
  1212. align-items: center;
  1213. box-sizing: border-box;
  1214. font-size: $font-size-24;
  1215. text-align: center;
  1216. text-decoration: none;
  1217. line-height: 34rpx;
  1218. border-radius: 0;
  1219. -webkit-tap-highlight-color: transparent;
  1220. overflow: hidden;
  1221. color: $text-color;
  1222. background-color:#FFFFFF;
  1223. }
  1224. }
  1225. }
  1226. .bottom-ri{
  1227. width: 400rpx;
  1228. height: 100%;
  1229. float: right;
  1230. display: flex;
  1231. box-sizing: border-box;
  1232. padding: 13rpx 20rpx 13rpx 0;
  1233. .btn{
  1234. flex: 1;
  1235. width: 200rpx;
  1236. line-height: 84rpx;
  1237. text-align: center;
  1238. font-size: $font-size-28;
  1239. color: #FFFFFF;
  1240. }
  1241. .btn-cart{
  1242. background-color: #ffe6dc;
  1243. color: $color-system;
  1244. border-radius: 42rpx 0 0 42rpx;
  1245. }
  1246. .btn-cart.disabled{
  1247. background-color: #E1E1E1;
  1248. }
  1249. .btn-bay{
  1250. background:linear-gradient(to right, #f28f31 0%, #e15616 100%);
  1251. border-radius: 0 42rpx 42rpx 0;
  1252. }
  1253. .btn-bay.disabled{
  1254. background-color: linear-gradient(135deg,rgba(242,143,49,0.5) 0%,rgba(225,86,22,0.5) 100%);;
  1255. }
  1256. }
  1257. }
  1258. .uni-badge--small {
  1259. -webkit-transform: scale(.8);
  1260. -ms-transform: scale(.8);
  1261. transform: scale(.8);
  1262. -webkit-transform-origin: center center;
  1263. -ms-transform-origin: center center;
  1264. transform-origin: center center;
  1265. }
  1266. .uni-badge {
  1267. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1268. -webkit-box-sizing: border-box;
  1269. box-sizing: border-box;
  1270. font-size: 12px;
  1271. line-height: 1;
  1272. display: inline-block;
  1273. padding: 3px 6px;
  1274. color: #333;
  1275. border-radius: 100px;
  1276. background-color: #f1f1f1;
  1277. }
  1278. .uni-badge-error {
  1279. color: #fff;
  1280. background-color: #dd524d;
  1281. }
  1282. .navbar {
  1283. width: 100%;
  1284. height: 80rpx;
  1285. box-sizing: border-box;
  1286. padding: 0 24rpx;
  1287. background: #FFFFFF;
  1288. z-index: 10;
  1289. display: flex;
  1290. position: fixed;
  1291. opacity: 0;
  1292. left: 0;
  1293. &.fixed{
  1294. opacity: 1;
  1295. }
  1296. .nav-item {
  1297. display: flex;
  1298. flex: 1;
  1299. justify-content: center;
  1300. align-items: center;
  1301. height: 80rpx;
  1302. font-size: $font-size-28;
  1303. color: $text-color;
  1304. position: relative;
  1305. float: left;
  1306. position: relative;
  1307. .line{
  1308. width: 60rpx;
  1309. height: 2px;
  1310. border-radius: 1px;
  1311. background: #FFFFFF;
  1312. position: absolute;
  1313. bottom: 0;
  1314. left: 50%;
  1315. margin-left: -30rpx;
  1316. }
  1317. &.current{
  1318. color:$color-system;
  1319. .line{
  1320. background: $color-system;
  1321. }
  1322. }
  1323. }
  1324. }
  1325. /* 加入购物模态层*/
  1326. @keyframes showPopup {
  1327. 0% {
  1328. opacity: 0;
  1329. }
  1330. 100% {
  1331. opacity: 1;
  1332. }
  1333. }
  1334. @keyframes hidePopup {
  1335. 0% {
  1336. opacity: 1;
  1337. }
  1338. 100% {
  1339. opacity: 0;
  1340. }
  1341. }
  1342. @keyframes showLayer {
  1343. 0% {
  1344. transform: translateY(0);
  1345. }
  1346. 100% {
  1347. transform: translateY(-100%);
  1348. }
  1349. }
  1350. @keyframes hideLayer {
  1351. 0% {
  1352. transform: translateY(-100%);
  1353. }
  1354. 100% {
  1355. transform: translateY(0);
  1356. }
  1357. }
  1358. @keyframes showAmnation {
  1359. 0% {
  1360. top: -12rpx;
  1361. opacity: 0;
  1362. }
  1363. 50% {
  1364. top: -60rpx;
  1365. opacity: 1;
  1366. }
  1367. 100% {
  1368. top: -100rpx;
  1369. opacity: 0;
  1370. }
  1371. }
  1372. @keyframes hideAmnation {
  1373. 0% {
  1374. top: -100rpx;
  1375. opacity: 0;
  1376. }
  1377. 100% {
  1378. top: -12rpx;
  1379. opacity: 0;
  1380. }
  1381. }
  1382. .popup {
  1383. position: fixed;
  1384. top: 0;
  1385. width: 100%;
  1386. height: 100%;
  1387. z-index: 999;
  1388. display: none;
  1389. .mask{
  1390. position: fixed;
  1391. top: 0;
  1392. width: 100%;
  1393. height: 100%;
  1394. z-index: 21;
  1395. background-color: rgba(0, 0, 0, 0.6);
  1396. }
  1397. .layer {
  1398. position: fixed;
  1399. z-index: 22;
  1400. bottom: -294rpx;
  1401. width: 702rpx;
  1402. padding: 24rpx 24rpx 36rpx 24rpx;
  1403. height: 260rpx;
  1404. border-radius: 20rpx 20rpx 0 0;
  1405. background-color: #fff;
  1406. display: flex;
  1407. flex-wrap: wrap;
  1408. align-content: space-between;
  1409. .content {
  1410. width: 100%;
  1411. }
  1412. .btn {
  1413. width: 100%;
  1414. height: 88rpx;
  1415. margin-top: 20rpx;
  1416. .button {
  1417. width: 100%;
  1418. height: 88rpx;
  1419. color: #fff;
  1420. display: flex;
  1421. align-items: center;
  1422. justify-content: center;
  1423. background: $btn-confirm;
  1424. font-size: $font-size-28;
  1425. border-radius: 14rpx;
  1426. }
  1427. }
  1428. }
  1429. &.show {
  1430. display: block;
  1431. .mask{
  1432. animation: showPopup 0.2s linear both;
  1433. }
  1434. .layer {
  1435. animation: showLayer 0.2s linear both;
  1436. }
  1437. }
  1438. &.hide {
  1439. display: block;
  1440. .mask{
  1441. animation: hidePopup 0.2s linear both;
  1442. }
  1443. .layer {
  1444. animation: hideLayer 0.2s linear both;
  1445. }
  1446. }
  1447. &.none {
  1448. display: none;
  1449. }
  1450. &.service {
  1451. .row {
  1452. margin: 30upx 0;
  1453. .title {
  1454. font-size: 30upx;
  1455. margin: 10upx 0;
  1456. }
  1457. .description {
  1458. font-size: 28upx;
  1459. color: #999;
  1460. }
  1461. }
  1462. }
  1463. .layer-smimg{
  1464. width: 114rpx;
  1465. height: 114rpx;
  1466. float: left;
  1467. border-radius: 10rpx;
  1468. margin-right: 24rpx;
  1469. image{
  1470. width: 114rpx;
  1471. height: 114rpx;
  1472. border-radius: 10rpx;
  1473. }
  1474. }
  1475. .layer-nunbox{
  1476. justify-content: space-between;
  1477. align-items: center;
  1478. width: 536rpx;
  1479. height: auto;
  1480. float: left;
  1481. .layer-nunbox-t{
  1482. width: 100%;
  1483. height:44rpx;
  1484. position:relative;
  1485. display: flex;
  1486. margin-bottom: 10rpx;
  1487. .text{
  1488. font-size: $font-size-24;
  1489. line-height: 48rpx;
  1490. color: #999999;
  1491. }
  1492. .layer-nunbox-text{
  1493. line-height: 44rpx;
  1494. font-size: $font-size-28;
  1495. }
  1496. .number-box{
  1497. display: flex;
  1498. justify-content: center;
  1499. align-items: center;
  1500. .iconfont{
  1501. font-size: $font-size-32;
  1502. padding:0 20rpx;
  1503. font-size: $text-color;
  1504. }
  1505. .btn-input{
  1506. width: 62rpx;
  1507. height: 48rpx;
  1508. line-height: 48rpx;
  1509. background: #F8F8F8;
  1510. border-radius: 4rpx;
  1511. text-align: center;
  1512. font-size: $font-size-28;
  1513. }
  1514. }
  1515. .product-step{
  1516. position: absolute;
  1517. left: 45rpx;
  1518. bottom: 0;
  1519. height: 44rpx;
  1520. background: #FFFFFF;
  1521. }
  1522. }
  1523. .layer-nunbox-b{
  1524. width: 100%;
  1525. height:44rpx;
  1526. margin-top: 13rpx;
  1527. }
  1528. .text{
  1529. line-height: 44rpx;
  1530. font-size: $font-size-28;
  1531. .p{
  1532. color: #FF2A2A;
  1533. }
  1534. .p:first-child{
  1535. margin-left: 30rpx;
  1536. }
  1537. .p.sm{
  1538. font-size: $font-size-24;
  1539. }
  1540. }
  1541. }
  1542. }
  1543. .tui-popup-box {
  1544. position: relative;
  1545. box-sizing: border-box;
  1546. min-height: 220rpx;
  1547. padding:0rpx 24rpx 0 24rpx;
  1548. .title{
  1549. font-size: $font-size-34;
  1550. color: $text-color;
  1551. line-height: 88rpx;
  1552. text-align: center;
  1553. float: left;
  1554. width: 100%;
  1555. height: 88rpx;
  1556. }
  1557. .content{
  1558. width: 100%;
  1559. height: auto;
  1560. float: left;
  1561. .content-tr{
  1562. width: 100%;
  1563. height: 58rpx;
  1564. line-height: 58rpx;
  1565. display: flex;
  1566. .content-td{
  1567. display: flex;
  1568. flex: 3;
  1569. font-size: $font-size-26;
  1570. color: #999999;
  1571. line-height: 58rpx;
  1572. text-align: left;
  1573. }
  1574. .content-th{
  1575. display: flex;
  1576. flex: 7;
  1577. font-size: $font-size-26;
  1578. color: #333333;
  1579. line-height: 58rpx;
  1580. text-align: left;
  1581. }
  1582. }
  1583. }
  1584. }
  1585. .tui-popup-btn {
  1586. width: 100%;
  1587. height: auto;
  1588. float: left;
  1589. margin-top: 24rpx;
  1590. .tui-button{
  1591. width: 100%;
  1592. height: 88rpx;
  1593. background: $btn-confirm;
  1594. line-height: 88rpx;
  1595. text-align: center;
  1596. color: #FFFFFF;
  1597. font-size: $font-size-28;
  1598. border-radius: 44rpx;
  1599. }
  1600. }
  1601. /*富文本样式*/
  1602. rich-text.p{
  1603. width: 702rpx !important;
  1604. padding: 0 24rpx;
  1605. text-align: justify;
  1606. }
  1607. rich-text.img{
  1608. width: 100%;
  1609. height: auto;
  1610. }
  1611. </style>