product.vue 45 KB

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