product.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765
  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 :'https://static.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="https://static-b.caimei365.com/app/img/icon/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="https://static-b.caimei365.com/app/img/icon/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" :bottom="200"></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 parser from "@/components/jyf-Parser/index" //富文本处理
  264. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  265. import recommend from "@/components/cm-module/productDetails/recommend" //相关推荐
  266. import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
  267. import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
  268. import authorize from '@/common/config/authorize.js'
  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:'https://static.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','identity'])
  369. },
  370. methods:{
  371. initData(){// 初始化商品详情查询
  372. this.ProductService.queryProductDetils({userId:this.userID,productID:this.productID,identity:this.identity}).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. goIndex(){//商城首页
  616. uni.switchTab({
  617. url: '/pages/tabBar/home/index'
  618. });
  619. },
  620. goSupplier(){//跳供应商资料页
  621. this.$api.navigateTo('/supplier/pages/user/my-shop?shopId='+this.shopId)
  622. },
  623. discard(){
  624. //丢弃
  625. },
  626. onShare(res){//分享转发
  627. if (res.from === 'button') {
  628. // 来自页面内转发按钮
  629. }
  630. return {
  631. title: `${this.product.name}`,
  632. path: `pages/goods/product?type=share&id=${this.productID}`,
  633. imageUrl:`${this.productImage[0]}`
  634. }
  635. },
  636. showPopup(){
  637. this.popupShow = true
  638. },
  639. hidePopup(){
  640. this.popupShow = false
  641. },
  642. getSectionProps() {//获取每个tab对应区域的scrollTop值
  643. let className = '.product-details',
  644. sectionPropsArr = [];
  645. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  646.   uni.createSelectorQuery().selectAll(className).boundingClientRect((res)=>{//最外层盒子节点
  647. res.forEach((item, index) => {
  648. sectionPropsArr.push({
  649. className: `${className}${index}`,
  650. scrollTop: item.top - data.top - 150
  651. })
  652. })
  653. this.sectionPropsArr = sectionPropsArr;
  654. this.sectionTopRangeArr = this.getSectionRange(sectionPropsArr);
  655.   }).exec()
  656. }).exec()
  657. },
  658. getSectionRange(arr) {// 获取每个tab对应区域的区间
  659. let sectionScrollTopList = [];
  660. for(let i = 0; i < arr.length; i++) {
  661. let thisScrollTop = arr[i].scrollTop;
  662. if(i < arr.length - 1) {
  663. let nextScrollTop = arr[i+1].scrollTop;
  664. if(i == 0) {
  665. sectionScrollTopList.push(`0-${thisScrollTop}`);
  666. } else if(i == arr.length - 1){
  667. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop - this.winHeight}`);
  668. } else {
  669. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop}`);
  670. }
  671. } else {
  672. sectionScrollTopList.push(`${thisScrollTop}-${thisScrollTop+500}`);
  673. }
  674. }
  675. return sectionScrollTopList;
  676. },
  677. activeTab: debounce((top, _this)=> {//当滑动时也能同步激活tab
  678. const { sectionTopRangeArr } = _this;
  679. if(sectionTopRangeArr.length > 0) {
  680. sectionTopRangeArr.forEach((item, index) => {
  681. let splitItem = item.split('-'),
  682. openInterval = Number(splitItem[0]),
  683. closedInterval = Number(splitItem[1]);
  684. if(top >= openInterval && top < closedInterval) {
  685. _this.tabCurrentIndex = index;
  686. }
  687. })
  688. }
  689. },100, true),
  690. getWinHeight() {
  691. this.winHeight = wx.getSystemInfoSync().windowHeight;
  692. },
  693. },
  694. onPageScroll(e){//实时获取到滚动的值
  695. const { scrollTop } = e;
  696. if(!this.tabSelectFlag) {
  697. this.activeTab(scrollTop, this);
  698. }
  699. if(e.scrollTop>100){
  700. this.headerColor = true
  701. this.navbarFiexd = 'fixed'
  702. this.nvabarData={
  703. showCapsule: 1,
  704. title: '商品详情',
  705. }
  706. }else{
  707. this.headerColor = false
  708. this.navbarFiexd = 'none'
  709. this.nvabarData={
  710. showCapsule: 1,
  711. title: '',
  712. }
  713. }
  714. if(e.scrollTop>700){
  715. this.isScrollTop = true
  716. }else{
  717. this.isScrollTop = false
  718. }
  719. },
  720. onShareAppMessage(res){//分享转发
  721. if (res.from === 'button') {
  722. // 来自页面内转发按钮
  723. }
  724. return {
  725. title: `${this.product.name}`,
  726. path: `pages/goods/product?type=share&id=${this.productID}`,
  727. imageUrl:`${this.productImage[0]}`
  728. }
  729. },
  730. onShow() {
  731. this.$api.getStorage().then((resolve) => {
  732. this.userID = resolve.userID ? resolve.userID : '';
  733. this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
  734. this.shopID = resolve.shopID ? resolve.shopID : '';
  735. if(this.userIdentity == 0 || this.userIdentity == 2 || this.userIdentity == 4){
  736. this.isShowButton = true
  737. }else{
  738. this.isShowButton = false
  739. }
  740. if (isPreviewImg) {
  741. isPreviewImg = false;
  742. return;
  743. } else {
  744. this.initData();
  745. }
  746. }).catch(error =>{
  747. this.initData();
  748. })
  749. }
  750. }
  751. </script>
  752. <style lang="scss">
  753. page{
  754. background-color: #FFFFFF;
  755. }
  756. .banner-section{
  757. width: 100%;
  758. height: 750rpx;
  759. position: relative;
  760. }
  761. .banner{
  762. width: 100%;
  763. height: 750rpx;
  764. .product-img{
  765. width: 750rpx;
  766. }
  767. image {
  768. width: 100%;
  769. height: 100%;
  770. }
  771. }
  772. .swiper__dots-box{
  773. position: absolute;
  774. color: #fff;
  775. bottom: 30rpx;
  776. right: 0;
  777. }
  778. .product-wrap{
  779. width: 100%;
  780. height: auto;
  781. padding: 24rpx 0 0 0;
  782. background-color: #FFFFFF;
  783. border-bottom: 20rpx solid #F7F7F7;
  784. .productRemarks{
  785. height: 48rpx;
  786. width: 100%;
  787. float: left;
  788. line-height: 48rpx;
  789. font-size: 24rpx;
  790. color: #999999;
  791. text-align: left;
  792. }
  793. .wrap-top{
  794. width: 702rpx;
  795. padding: 0 24rpx;
  796. height: auto;
  797. float: left;
  798. padding-bottom:20rpx;
  799. border-bottom: 1px solid #F8F8F8;
  800. &.none{
  801. .p-title{
  802. color:#999999
  803. }
  804. }
  805. .p-title{
  806. width: 100%;
  807. height: auto;
  808. float: left;
  809. position: relative;
  810. .p-title-name{
  811. width:602rpx;
  812. height: auto;
  813. float: left;
  814. line-height:48rpx;
  815. font-size: $font-size-28;
  816. color: $text-color;
  817. -o-text-overflow: ellipsis;
  818. text-overflow: ellipsis;
  819. display: -webkit-box;
  820. word-break: break-all;
  821. -webkit-box-orient: vertical;
  822. -webkit-line-clamp: 2;
  823. overflow: hidden;
  824. }
  825. .p-title-share{
  826. width: 96rpx;
  827. height: 96rpx;
  828. position: absolute;
  829. right: 0;
  830. text-align: center;
  831. color: #999999;
  832. font-size: $font-size-24;
  833. box-sizing: border-box;
  834. display: block;
  835. background: transparent;
  836. border-radius: 0;
  837. border: 0;
  838. margin: 0;
  839. padding: 8rpx 0;
  840. z-index: 990;
  841. .icon-fenxiang1{
  842. font-size: $font-size-34;
  843. }
  844. }
  845. .tui-share-btn::after {
  846. border: 0;
  847. }
  848. }
  849. .wrap-main-text{
  850. line-height: 56rpx;
  851. color: #FF2A2A;
  852. font-size: $font-size-26;
  853. display: block;
  854. float: left;
  855. font-weight: normal;
  856. }
  857. .wrap-main-none{
  858. display: block;
  859. width: 256rpx;
  860. height: 44rpx;
  861. padding-left: 20rpx;
  862. border-radius: 11rpx;
  863. background: $btn-confirm;
  864. float: right;
  865. line-height: 44rpx;
  866. color: #FFFFFF;
  867. text-align: center;
  868. font-size: $font-size-24;
  869. }
  870. .p-price-none{
  871. height: 44rpx;
  872. line-height: 44rpx;
  873. float: left;
  874. font-size: $font-size-24;
  875. color: #666;
  876. text-decoration: line-through;
  877. margin-left: 8rpx;
  878. }
  879. .p-minBuy{
  880. height: 44rpx;
  881. line-height: 44rpx;
  882. float: right;
  883. padding: 0 18rpx;
  884. border-radius: 22rpx;
  885. background-color: #f7f7f7;
  886. color: #7F7F7F;
  887. font-size: 24rpx;
  888. text-align: center;
  889. .min-text{
  890. margin: 0 6rpx;
  891. }
  892. }
  893. .p-login{
  894. height: 56rpx;
  895. line-height: 56rpx;
  896. color: $color-system;
  897. font-size: $font-size-24;
  898. &.grade{
  899. .price-left{
  900. float: left;
  901. .none{
  902. display: block;
  903. font-size: $font-size-20;
  904. line-height: 48rpx;
  905. color: #4A4B54;
  906. float: left;
  907. font-weight: bold;
  908. margin-left: 5rpx;
  909. text{
  910. letter-spacing: 4rpx;
  911. font-size: $font-size-32;
  912. }
  913. }
  914. }
  915. }
  916. .p-no{
  917. float: left;
  918. margin-right: 5rpx;
  919. font-size: $font-size-28;
  920. color: $text-color;
  921. }
  922. .p-login-btn{
  923. display: block;
  924. height: 44rpx;
  925. padding: 0 10rpx 0 20rpx;
  926. border-radius: 11rpx;
  927. background: $btn-confirm;
  928. float: right;
  929. line-height: 44rpx;
  930. color: #FFFFFF;
  931. text-align: center;
  932. font-size: $font-size-24;
  933. }
  934. }
  935. }
  936. .wrap-label{
  937. float: left;
  938. width: 100%;
  939. box-sizing: border-box;
  940. .label-a{
  941. padding: 0 18rpx;
  942. line-height: 32rpx;
  943. font-size: $font-size-20;
  944. color:$color-system;
  945. text-align: center;
  946. border-radius: 6rpx;
  947. background:#ffe6dc;
  948. margin: 0 20rpx 15rpx 0;
  949. display: inline-block;
  950. }
  951. }
  952. .wrap-top-price{
  953. float: left;
  954. width: 100%;
  955. box-sizing: border-box;
  956. .wrap-main-item{
  957. width: 100%;
  958. height: 56rpx;
  959. .p-price{
  960. height: 56rpx;
  961. line-height: 56rpx;
  962. float: left;
  963. color: #FF2A2A;
  964. font-weight: bold;
  965. &.none{
  966. text-decoration: line-through;
  967. color: #999999;
  968. font-weight: normal;
  969. }
  970. .txt{
  971. margin:0 2rpx;
  972. }
  973. .txt.sm{
  974. font-size: $font-size-26;
  975. }
  976. .txt.big{
  977. font-size: $font-size-34;
  978. }
  979. }
  980. }
  981. .floor-item-act{
  982. height: 56rpx;
  983. text-align: center;
  984. box-sizing: border-box;
  985. float: left;
  986. padding:10rpx 0;
  987. margin-left: 10rpx;
  988. .floor-tags{
  989. float: right;
  990. height: 28rpx;
  991. border-radius: 6rpx;
  992. background-color: #FFFFFF;
  993. line-height: 28rpx;
  994. color: $color-system;
  995. text-align: center;
  996. display: inline-block;
  997. padding:0 16rpx;
  998. font-size: $font-size-20;
  999. margin-left: 15rpx;
  1000. border: 1px solid #E15616;
  1001. }
  1002. }
  1003. .floor-item-btn{
  1004. float: left;
  1005. height: 40rpx;
  1006. margin-top: 8rpx;
  1007. margin-left: 10rpx;
  1008. .btn{
  1009. line-height: 40rpx;
  1010. padding: 0 20rpx;
  1011. height: 40rpx;
  1012. background: $btn-confirm;
  1013. color: #FFFFFF;
  1014. font-size: $font-size-20;
  1015. border-radius: 4rpx;
  1016. }
  1017. }
  1018. }
  1019. .wrap-info{
  1020. float: left;
  1021. width: 702rpx;
  1022. padding: 24rpx 24rpx 0 24rpx;
  1023. border-bottom: 1px solid #F8F8F8;
  1024. .info-viewT{
  1025. width: 100%;
  1026. min-height: 40rpx;
  1027. font-size: $font-size-28;
  1028. color: $text-color;
  1029. line-height: 40rpx;
  1030. text-align: left;
  1031. &.none{
  1032. color: #999999;
  1033. }
  1034. .info-viewL{
  1035. min-width: 350rpx;
  1036. float: left;
  1037. margin-bottom: 24rpx;
  1038. }
  1039. .info-viewR{
  1040. min-width: 352rpx;
  1041. float: left;
  1042. margin-bottom: 24rpx;
  1043. }
  1044. }
  1045. .info-viewB{
  1046. width: 100%;
  1047. height: auto;
  1048. }
  1049. .info-f{
  1050. width: 50%;
  1051. float: left;
  1052. font-size: $font-size-28;
  1053. color: $text-color;
  1054. line-height: 40rpx;
  1055. margin-bottom: 24rpx;
  1056. text-align: left;
  1057. }
  1058. }
  1059. }
  1060. .product-seve{
  1061. width: 100%;
  1062. height: 60rpx;
  1063. background-color: #FFFFFF;
  1064. position: relative;
  1065. display: flex;
  1066. line-height: 60rpx;
  1067. .iconfont{
  1068. color: #fea785;
  1069. margin-right: 20rpx;
  1070. font-size: $font-size-22;
  1071. }
  1072. .text{
  1073. font-size: $font-size-22;
  1074. color: #fea785;
  1075. margin-left: 10rpx;
  1076. }
  1077. }
  1078. .product-item-none{
  1079. min-height: 348rpx;
  1080. display: flex;
  1081. flex-direction: column;
  1082. align-items: center;
  1083. border-bottom: 20rpx solid #F7F7F7;
  1084. box-sizing: border-box;
  1085. padding: 40rpx 0;
  1086. .none-image{
  1087. width: 284rpx;
  1088. height: 225rpx;
  1089. }
  1090. .none-text{
  1091. text-align: center;
  1092. font-size: $font-size-28;
  1093. color: #fea785;
  1094. line-height: 40rpx;
  1095. }
  1096. }
  1097. .product-parameter{
  1098. width: 702rpx;
  1099. height: 90rpx;
  1100. padding: 0 24rpx;
  1101. background-color: #FFFFFF;
  1102. position: relative;
  1103. display: flex;
  1104. border-bottom: 20rpx solid #F7F7F7;
  1105. .title{
  1106. line-height: 90rpx;
  1107. display: inline-block;
  1108. float: left;
  1109. font-size: $font-size-28;
  1110. color: #666666;
  1111. }
  1112. .name{
  1113. float: right;
  1114. line-height: 90rpx;
  1115. display: inline-block;
  1116. float: left;
  1117. font-size: $font-size-28;
  1118. color: $text-color;
  1119. float: right;
  1120. padding-right: 48rpx;
  1121. overflow: hidden;
  1122. text-overflow:ellipsis;
  1123. white-space: nowrap;
  1124. text-align: right;
  1125. }
  1126. .icon-xiayibu{
  1127. line-height: 90rpx;
  1128. display: inline-block;
  1129. position: absolute;
  1130. width: 48rpx;
  1131. top: 0;
  1132. right: 0;
  1133. color: #b2b2b2;
  1134. }
  1135. }
  1136. .product-supplier{
  1137. width: 100%;
  1138. height: 174rpx;
  1139. padding: 30rpx 24rpx;
  1140. box-sizing: border-box;
  1141. background-color: #FFFFFF;
  1142. position: relative;
  1143. box-sizing: border-box;
  1144. border-bottom: 20rpx solid #F7F7F7;
  1145. .logo{
  1146. width: 128rpx;
  1147. height: 92rpx;
  1148. float: left;
  1149. border: 1px solid #efefef;
  1150. border-radius: 6rpx;
  1151. image{
  1152. width: 100%;
  1153. height: 100%;
  1154. display: block;
  1155. border-radius: 6rpx;
  1156. }
  1157. }
  1158. .main{
  1159. width: 470rpx;
  1160. height: 92rpx;
  1161. float: left;
  1162. margin-left: 20rpx;
  1163. .name{
  1164. width: 100%;
  1165. line-height: 46rpx;
  1166. float: left;
  1167. font-size: $font-size-28;
  1168. color: $text-color;
  1169. float: right;
  1170. overflow: hidden;
  1171. text-overflow:ellipsis;
  1172. white-space: nowrap;
  1173. text-align: left;
  1174. }
  1175. .massgs{
  1176. width: 100%;
  1177. line-height: 46rpx;
  1178. float: left;
  1179. font-size: $font-size-24;
  1180. color: #999999;
  1181. .label{
  1182. float: left;
  1183. }
  1184. .p-stars{
  1185. float: left;
  1186. margin-left: 20rpx;
  1187. }
  1188. .acount{
  1189. float: right;
  1190. text{
  1191. color: $color-system;
  1192. }
  1193. }
  1194. }
  1195. }
  1196. .icon-xiayibu{
  1197. line-height: 154rpx;
  1198. display: inline-block;
  1199. position: absolute;
  1200. width: 48rpx;
  1201. top: 0;
  1202. right: 0;
  1203. color: #b2b2b2;
  1204. }
  1205. }
  1206. .product-details {
  1207. width: 100%;
  1208. background: #FFFFFF;
  1209. border-bottom: 20rpx solid #F7F7F7;
  1210. &.service{
  1211. border-bottom: none;
  1212. }
  1213. &.recommend{
  1214. background-color: #F7F7F7;
  1215. border-bottom: none;
  1216. .title{
  1217. .title-tab{
  1218. background-color: #F7F7F7;
  1219. color: $text-color;
  1220. }
  1221. }
  1222. }
  1223. .content-none{
  1224. width: 100%;
  1225. height: 80rpx;
  1226. line-height: 80rpx;
  1227. text-align: left;
  1228. font-size: $font-size-26;
  1229. color: #999999;
  1230. box-sizing: border-box;
  1231. padding: 0 24rpx;
  1232. }
  1233. .title{
  1234. width: 100%;
  1235. box-sizing: border-box;
  1236. padding: 0 24rpx;
  1237. .title-tab{
  1238. width: 100%;
  1239. height: 100rpx;
  1240. background: #fff;
  1241. z-index: 10;
  1242. font-size: $font-size-30;
  1243. text-align: left;
  1244. color: $text-color;
  1245. line-height: 100rpx;
  1246. font-weight: 600;
  1247. }
  1248. .title-msg{
  1249. width: 100%;
  1250. height: 236rpx;
  1251. padding: 18rpx;
  1252. background-color: rgba(225,86,22, 0.1);
  1253. color: $color-system;
  1254. box-sizing: border-box;
  1255. margin-bottom: 30rpx;
  1256. .tit{
  1257. line-height: 46rpx;
  1258. font-size: $font-size-24;
  1259. text-align: left;
  1260. }
  1261. .txt{
  1262. line-height: 38rpx;
  1263. font-size: $font-size-20;
  1264. text-align: justify;
  1265. }
  1266. }
  1267. }
  1268. .content{
  1269. width: 100%;
  1270. background-color: #FFFFFF;
  1271. }
  1272. }
  1273. .isLower{
  1274. width: 100%;
  1275. height: 116rpx;
  1276. line-height: 116rpx;
  1277. text-align: center;
  1278. color: #000000;
  1279. font-size: $font-size-32;
  1280. font-weight: bold;
  1281. }
  1282. .bottom-btn{
  1283. width: 100%;
  1284. height: 110rpx;
  1285. position: fixed;
  1286. bottom: 0;
  1287. left: 0;
  1288. background: #FFFFFF;
  1289. z-index: 99;
  1290. .bottom-le{
  1291. width: 302rpx;
  1292. height: 86rpx;
  1293. padding:12rpx 24rpx;
  1294. float: left;
  1295. .item-bt{
  1296. width: 86rpx;
  1297. height: 100%;
  1298. margin-right:22rpx;
  1299. display: flex;
  1300. float: left;
  1301. flex-direction: column;
  1302. align-items: center;
  1303. font-size: $font-size-24;
  1304. color: $text-color;
  1305. line-height: 34rpx;
  1306. position: relative;
  1307. .animation-num{
  1308. font-size:$font-size-32 ;
  1309. color: #FF2A2A;
  1310. position: absolute;
  1311. top: -12rpx;
  1312. right: 4rpx;
  1313. font-weight: bold;
  1314. }
  1315. .animation{
  1316. animation: showAmnation 2.2s ease-in-out both;
  1317. }
  1318. .restion{
  1319. animation: hideAmnation 1s ease-in-out both;
  1320. }
  1321. .icon-num{
  1322. position: absolute;
  1323. right:-12rpx;
  1324. top: -9rpx;
  1325. }
  1326. .icon-num.goleft{
  1327. right: 4rpx;
  1328. }
  1329. &:last-child{
  1330. margin-right: 0;
  1331. }
  1332. image {
  1333. width: 40rpx;
  1334. height: 40rpx;
  1335. margin-bottom: 8rpx;
  1336. }
  1337. button.contact-btn{
  1338. width: 100%;
  1339. height: 100%;
  1340. margin: 0;
  1341. padding: 0;
  1342. display: flex;
  1343. flex-direction: column;
  1344. align-items: center;
  1345. box-sizing: border-box;
  1346. font-size: $font-size-24;
  1347. text-align: center;
  1348. text-decoration: none;
  1349. line-height: 34rpx;
  1350. border-radius: 0;
  1351. -webkit-tap-highlight-color: transparent;
  1352. overflow: hidden;
  1353. color: $text-color;
  1354. background-color:#FFFFFF;
  1355. }
  1356. }
  1357. }
  1358. .bottom-ri{
  1359. width: 400rpx;
  1360. height: 100%;
  1361. float: right;
  1362. display: flex;
  1363. box-sizing: border-box;
  1364. padding: 13rpx 20rpx 13rpx 0;
  1365. .btn{
  1366. flex: 1;
  1367. width: 200rpx;
  1368. line-height: 84rpx;
  1369. text-align: center;
  1370. font-size: $font-size-26;
  1371. color: #FFFFFF;
  1372. }
  1373. .btn-cart{
  1374. background-color: #ffe6dc;
  1375. color: $color-system;
  1376. border-radius: 42rpx 0 0 42rpx;
  1377. }
  1378. .btn-cart.disabled{
  1379. background-color: #E1E1E1;
  1380. color: #FFFFFF;
  1381. }
  1382. .btn-bay{
  1383. background:linear-gradient(to right, #f28f31 0%, #e15616 100%);
  1384. border-radius: 0 42rpx 42rpx 0;
  1385. }
  1386. .btn-bay.disabled{
  1387. background: linear-gradient(135deg,rgba(242,143,49,0.5) 0%,rgba(225,86,22,0.5) 100%);
  1388. }
  1389. }
  1390. }
  1391. .uni-badge--small {
  1392. -webkit-transform: scale(.8);
  1393. -ms-transform: scale(.8);
  1394. transform: scale(.8);
  1395. -webkit-transform-origin: center center;
  1396. -ms-transform-origin: center center;
  1397. transform-origin: center center;
  1398. }
  1399. .uni-badge {
  1400. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1401. -webkit-box-sizing: border-box;
  1402. box-sizing: border-box;
  1403. font-size: 12px;
  1404. line-height: 1;
  1405. display: inline-block;
  1406. padding: 3px 6px;
  1407. color: #333;
  1408. border-radius: 100px;
  1409. background-color: #f1f1f1;
  1410. }
  1411. .uni-badge-error {
  1412. color: #fff;
  1413. background-color: #dd524d;
  1414. }
  1415. .navbar {
  1416. width: 100%;
  1417. height: 80rpx;
  1418. box-sizing: border-box;
  1419. padding: 0 24rpx;
  1420. background: #FFFFFF;
  1421. z-index: 10;
  1422. display: flex;
  1423. position: fixed;
  1424. opacity: 0;
  1425. left: 0;
  1426. &.fixed{
  1427. animation: showFixedColor 0.3s ease-in-out both;
  1428. }
  1429. &.none{
  1430. animation: hideFixedColor 0.3s ease-in-out both;
  1431. }
  1432. .nav-item {
  1433. display: flex;
  1434. flex: 1;
  1435. justify-content: center;
  1436. align-items: center;
  1437. height: 80rpx;
  1438. font-size: $font-size-28;
  1439. color: $text-color;
  1440. position: relative;
  1441. float: left;
  1442. position: relative;
  1443. .line{
  1444. width: 60rpx;
  1445. height: 2px;
  1446. border-radius: 1px;
  1447. background: #FFFFFF;
  1448. position: absolute;
  1449. bottom: 0;
  1450. left: 50%;
  1451. margin-left: -30rpx;
  1452. }
  1453. &.current{
  1454. color:$color-system;
  1455. .line{
  1456. background: $color-system;
  1457. }
  1458. }
  1459. }
  1460. }
  1461. @keyframes showFixedColor {
  1462. 0% {background: rgba(255,255,255,0);opacity: 0;}
  1463. 50% {background: rgba(255,255,255,0.5);opacity: 0.5;}
  1464. 100% {background: rgba(255,255,255,1);opacity: 1;}
  1465. }
  1466. @keyframes hideFixedColor {
  1467. 0% {background: rgba(255,255,255,1);opacity: 1;}
  1468. 50% {background: rgba(255,255,255,0.5);opacity: 0.5;}
  1469. 100% {background: rgba(255,255,255,0);opacity: 0;}
  1470. }
  1471. /* 加入购物模态层*/
  1472. @keyframes showPopup {
  1473. 0% {
  1474. opacity: 0;
  1475. }
  1476. 100% {
  1477. opacity: 1;
  1478. }
  1479. }
  1480. @keyframes hidePopup {
  1481. 0% {
  1482. opacity: 1;
  1483. }
  1484. 100% {
  1485. opacity: 0;
  1486. }
  1487. }
  1488. @keyframes showLayer {
  1489. 0% {
  1490. transform: translateY(0);
  1491. }
  1492. 100% {
  1493. transform: translateY(-100%);
  1494. }
  1495. }
  1496. @keyframes hideLayer {
  1497. 0% {
  1498. transform: translateY(-100%);
  1499. }
  1500. 100% {
  1501. transform: translateY(0);
  1502. }
  1503. }
  1504. @keyframes showAmnation {
  1505. 0% {
  1506. top: -12rpx;
  1507. opacity: 0;
  1508. }
  1509. 50% {
  1510. top: -60rpx;
  1511. opacity: 1;
  1512. }
  1513. 100% {
  1514. top: -100rpx;
  1515. opacity: 0;
  1516. }
  1517. }
  1518. @keyframes hideAmnation {
  1519. 0% {
  1520. top: -100rpx;
  1521. opacity: 0;
  1522. }
  1523. 100% {
  1524. top: -12rpx;
  1525. opacity: 0;
  1526. }
  1527. }
  1528. .popup {
  1529. position: fixed;
  1530. top: 0;
  1531. width: 100%;
  1532. height: 100%;
  1533. z-index: 999;
  1534. display: none;
  1535. .mask{
  1536. position: fixed;
  1537. top: 0;
  1538. width: 100%;
  1539. height: 100%;
  1540. z-index: 21;
  1541. background-color: rgba(0, 0, 0, 0.6);
  1542. }
  1543. .layer {
  1544. position: fixed;
  1545. z-index: 22;
  1546. bottom: -294rpx;
  1547. width: 702rpx;
  1548. padding: 24rpx 24rpx 36rpx 24rpx;
  1549. height: 260rpx;
  1550. border-radius: 20rpx 20rpx 0 0;
  1551. background-color: #fff;
  1552. display: flex;
  1553. flex-wrap: wrap;
  1554. align-content: space-between;
  1555. .content {
  1556. width: 100%;
  1557. }
  1558. .btn {
  1559. width: 100%;
  1560. height: 88rpx;
  1561. margin-top: 20rpx;
  1562. .button {
  1563. width: 100%;
  1564. height: 88rpx;
  1565. color: #fff;
  1566. display: flex;
  1567. align-items: center;
  1568. justify-content: center;
  1569. background: $btn-confirm;
  1570. font-size: $font-size-28;
  1571. border-radius: 44rpx;
  1572. }
  1573. }
  1574. }
  1575. &.show {
  1576. display: block;
  1577. .mask{
  1578. animation: showPopup 0.2s linear both;
  1579. }
  1580. .layer {
  1581. animation: showLayer 0.2s linear both;
  1582. }
  1583. }
  1584. &.hide {
  1585. display: block;
  1586. .mask{
  1587. animation: hidePopup 0.2s linear both;
  1588. }
  1589. .layer {
  1590. animation: hideLayer 0.2s linear both;
  1591. }
  1592. }
  1593. &.none {
  1594. display: none;
  1595. }
  1596. &.service {
  1597. .row {
  1598. margin: 30upx 0;
  1599. .title {
  1600. font-size: 30upx;
  1601. margin: 10upx 0;
  1602. }
  1603. .description {
  1604. font-size: 28upx;
  1605. color: #999;
  1606. }
  1607. }
  1608. }
  1609. .layer-smimg{
  1610. width: 114rpx;
  1611. height: 114rpx;
  1612. float: left;
  1613. border-radius: 10rpx;
  1614. margin-right: 24rpx;
  1615. image{
  1616. width: 114rpx;
  1617. height: 114rpx;
  1618. border-radius: 10rpx;
  1619. }
  1620. }
  1621. .layer-nunbox{
  1622. justify-content: space-between;
  1623. align-items: center;
  1624. width: 536rpx;
  1625. height: auto;
  1626. float: left;
  1627. .layer-nunbox-t{
  1628. width: 100%;
  1629. height:44rpx;
  1630. position:relative;
  1631. display: flex;
  1632. margin-bottom: 10rpx;
  1633. .text{
  1634. font-size: $font-size-24;
  1635. line-height: 48rpx;
  1636. color: #999999;
  1637. }
  1638. .layer-nunbox-text{
  1639. line-height: 44rpx;
  1640. font-size: $font-size-28;
  1641. }
  1642. .number-box{
  1643. display: flex;
  1644. justify-content: center;
  1645. align-items: center;
  1646. .iconfont{
  1647. font-size: $font-size-32;
  1648. padding:0 20rpx;
  1649. font-size: $text-color;
  1650. }
  1651. .btn-input{
  1652. width: 62rpx;
  1653. height: 48rpx;
  1654. line-height: 48rpx;
  1655. background: #F8F8F8;
  1656. border-radius: 4rpx;
  1657. text-align: center;
  1658. font-size: $font-size-28;
  1659. }
  1660. }
  1661. .product-step{
  1662. position: absolute;
  1663. left: 45rpx;
  1664. bottom: 0;
  1665. height: 44rpx;
  1666. background: #FFFFFF;
  1667. }
  1668. }
  1669. .layer-nunbox-b{
  1670. width: 100%;
  1671. height:44rpx;
  1672. margin-top: 13rpx;
  1673. }
  1674. .text{
  1675. line-height: 44rpx;
  1676. font-size: $font-size-28;
  1677. .p{
  1678. color: #FF2A2A;
  1679. }
  1680. .p:first-child{
  1681. margin-left: 30rpx;
  1682. }
  1683. .p.sm{
  1684. font-size: $font-size-24;
  1685. }
  1686. }
  1687. }
  1688. }
  1689. .tui-popup-box {
  1690. position: relative;
  1691. box-sizing: border-box;
  1692. min-height: 220rpx;
  1693. padding:0rpx 24rpx 0 24rpx;
  1694. .title{
  1695. font-size: $font-size-34;
  1696. color: $text-color;
  1697. line-height: 88rpx;
  1698. text-align: center;
  1699. float: left;
  1700. width: 100%;
  1701. height: 88rpx;
  1702. }
  1703. .content{
  1704. width: 100%;
  1705. height: auto;
  1706. float: left;
  1707. .content-tr{
  1708. width: 100%;
  1709. height: 58rpx;
  1710. line-height: 58rpx;
  1711. display: flex;
  1712. .content-td{
  1713. display: flex;
  1714. flex: 3;
  1715. font-size: $font-size-26;
  1716. color: #999999;
  1717. line-height: 58rpx;
  1718. text-align: left;
  1719. }
  1720. .content-th{
  1721. display: flex;
  1722. flex: 7;
  1723. font-size: $font-size-26;
  1724. color: #333333;
  1725. line-height: 58rpx;
  1726. text-align: left;
  1727. }
  1728. }
  1729. }
  1730. }
  1731. .tui-popup-btn {
  1732. width: 100%;
  1733. height: auto;
  1734. float: left;
  1735. margin-top: 24rpx;
  1736. .tui-button{
  1737. width: 100%;
  1738. height: 88rpx;
  1739. background: $btn-confirm;
  1740. line-height: 88rpx;
  1741. text-align: center;
  1742. color: #FFFFFF;
  1743. font-size: $font-size-28;
  1744. border-radius: 44rpx;
  1745. }
  1746. }
  1747. /*富文本样式*/
  1748. rich-text.p{
  1749. width: 702rpx !important;
  1750. padding: 0 24rpx;
  1751. text-align: justify;
  1752. }
  1753. rich-text.img{
  1754. width: 100%;
  1755. height: auto;
  1756. }
  1757. </style>