product.vue 48 KB

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