product.vue 45 KB

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