product.vue 48 KB

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