product.vue 48 KB

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