product.vue 45 KB

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