product.vue 45 KB

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