product.vue 45 KB

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