product.vue 43 KB

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