product.vue 45 KB

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