product.vue 46 KB

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