product.vue 50 KB

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