product.vue 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764
  1. <template>
  2. <view class="product" :style="{paddingBottom: userIdentity==1 && userIdentity == 3 ? '0rpx' :'188rpx'}">
  3. <custom-p v-if="isHeaderPoduct"
  4. :systeminfo='systeminfo'
  5. :navbar-data='nvabarData'
  6. :headerBtnPosi ="headerBtnPosi"
  7. :headerColor="headerColor"
  8. :type="isShareType"
  9. :page='backPage'>
  10. </custom-p>
  11. <view class="navbar" :class="navbarFiexd" :style="{top:CustomBar +'px'}">
  12. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 0 }" @click="tabClick(0)">
  13. <text>详情</text>
  14. <text class="line"></text>
  15. </view>
  16. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 1 }" @click="tabClick(1)">
  17. <text>服务项目</text>
  18. <text class="line"></text>
  19. </view>
  20. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 2 }" @click="tabClick(2)">
  21. <text>推荐</text>
  22. <text class="line"></text>
  23. </view>
  24. </view>
  25. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  26. <template v-else >
  27. <view class="cart-content empty" v-if="isInvalid">
  28. <view class="empty-container">
  29. <image class="empty-container-image" :src="productNoneImage" mode="aspectFit"></image>
  30. <text class="error-text">商品已失效,去商城逛逛别的吧~</text>
  31. <view class="login-btn" @click="goIndex">去商城</view>
  32. </view>
  33. </view>
  34. <view class="container-product tui-skeleton" v-else>
  35. <view class="container-product-main">
  36. <view class="product-top">
  37. <view class="banner-section">
  38. <uni-swiper-dot :info="productImage" :current="current" field="content" :mode="mode" >
  39. <swiper class="banner tui-banner tui-skeleton-rect" @change="swiperChange" :duration='800' :autoplay="false" :circular="true" >
  40. <swiper-item v-for="(item, index) in productImage" :key="index" class="banner-item">
  41. <image :src="item" @click="previewImg(index)" class="product-img" />
  42. </swiper-item>
  43. </swiper>
  44. <view class="swiper__dots-box">
  45. <tui-tag padding="12rpx 24rpx" type="translucent" shape="circleLeft" size="32rpx" :scaleMultiple="0.82" originRight>{{ current + 1 }}/{{ productImage.length }}</tui-tag>
  46. </view>
  47. </uni-swiper-dot>
  48. </view>
  49. <view class="product-wrap clearfix">
  50. <view class="wrap-top" :class="goodsData.isNoneDisabled ? 'none' : ''">
  51. <view class="wrap-top-price">
  52. <cm-price v-if="isRequest"
  53. :product="product"
  54. :userIdentity="userIdentity"
  55. :shopID= "shopID"
  56. :promotions="product.promotions"
  57. :ladderPriceList="ladderPriceList"/>
  58. </view>
  59. <view class="p-title tui-skeleton-fillet">
  60. <view class="p-title-name">
  61. {{product.name == undefined ? '' : product.name}}
  62. </view>
  63. <button open-type="share" class="p-title-share tui-share-position" @tap="onShare">
  64. <view class=""><text class="iconfont icon-fenxiang1"></text></view>
  65. <view class="">分享</view>
  66. </button>
  67. </view>
  68. <view class="wrap-label" v-if="product.tagsList.length>0">
  69. <view class="label-a tui-skeleton-fillet" v-for="(label,index) in product.tagsList" :key="index">{{label}}</view>
  70. </view>
  71. <view class="product-seve">
  72. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">无忧退货</text></text>
  73. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">快速退款</text></text>
  74. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">正品保证</text></text>
  75. </view>
  76. <view class="productRemarks" v-if="product.productRemarks!=''&&product.productRemarks!=null">
  77. 备注:{{product.productRemarks}}
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="product-item-none" v-if="goodsData.isNoneDisabled">
  83. <image class="none-image" :src="productNoneImage" mode=""></image>
  84. <view class="none-text">此商品已{{goodsData.disabledText}},请浏览以下推荐商品~</view>
  85. </view>
  86. <view class="product-parameter" @click="showPopup" v-if="!goodsData.isNoneDisabled">
  87. <text class="title">参数:</text>
  88. <text class="name">品牌 起订量 分类...</text>
  89. <text class="iconfont icon-xiayibu"></text>
  90. </view>
  91. <view class="product-supplier" @click="goSupplier">
  92. <view class="logo"><img :src="shop.logo ? shop.logo :'https://static.caimei365.com/app/img/icon/icon-shoplogo.png'" alt=""></view>
  93. <view class="main">
  94. <view class="name">{{shop.name}}</view>
  95. <view class="massgs">
  96. <view class="label">满意度:</view>
  97. <view class="p-stars">
  98. <uni-stars :stars="6" :iconClass="iconClass" :iconColor="iconColor" :fontSize="36" :widthInfo="176"></uni-stars>
  99. </view>
  100. <view class="acount">
  101. <text>{{ shop.normalNum }}</text>件商品
  102. </view>
  103. </view>
  104. </view>
  105. <view class="right"><text class="iconfont icon-xiayibu"></text></view>
  106. </view>
  107. </view>
  108. <view class="product-details product-details0">
  109. <!-- 商品详情 -->
  110. <view class="title">
  111. <view class="title-tab">商品详情</view>
  112. </view>
  113. <view class="content tui-banner product-rich-text tui-skeleton-rect">
  114. <parser :html="html" :img-mode="widthFix"></parser>
  115. </view>
  116. </view>
  117. <view class="product-details service product-details1">
  118. <!-- 服务项目 -->
  119. <view class="title">
  120. <view class="title-tab">服务项目</view>
  121. </view>
  122. <view class="content service" v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo">
  123. <cm-service :product="product.productDetail" v-if="isRequest"></cm-service>
  124. </view>
  125. <view class="content-none" v-else>
  126. <text>暂无服务项目</text>
  127. </view>
  128. </view>
  129. <view class="product-details recommend product-details2">
  130. <!-- 相关推荐 -->
  131. <view class="title">
  132. <view class="title-tab">相关推荐</view>
  133. </view>
  134. <view class="content hot">
  135. <recommend :query-productid="product.productID" :query-type="product.recommendType" v-if="isRequest"></recommend>
  136. </view>
  137. </view>
  138. <!-- 商品参数 -->
  139. <tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
  140. <view class="tui-popup-box clearfix">
  141. <view class="title">商品参数</view>
  142. <view class="content">
  143. <view class="content-tr">
  144. <view class="content-td">起订量</view>
  145. <view class="content-th">{{product.minBuyNumber}}</view>
  146. </view>
  147. <view class="content-tr">
  148. <view class="content-td">品牌</view>
  149. <view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
  150. </view>
  151. <view class="content-tr">
  152. <view class="content-td">分类</view>
  153. <view class="content-th">{{product.typeName == null? '暂无' : product.typeName}}</view>
  154. </view>
  155. <view class="content-tr">
  156. <view class="content-td">包装规格</view>
  157. <view class="content-th">{{product.unit}}</view>
  158. </view>
  159. <view class="content-tr">
  160. <view class="content-td">商品编码</view>
  161. <view class="content-th">{{product.productCode}}</view>
  162. </view>
  163. <view class="content-tr">
  164. <view class="content-td">库存</view>
  165. <view class="content-th">{{product.stock}}</view>
  166. </view>
  167. <view class="content-tr" v-if="product.parametersList.length>0" v-for="(item, index) in product.parametersList" :key="index">
  168. <view class="content-td">{{item.paramsName}}</view>
  169. <view class="content-th">{{item.paramsContent}}</view>
  170. </view>
  171. </view>
  172. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
  173. <view class="tui-flex-1">
  174. <view class="tui-button" @click="hidePopup()">收起</view>
  175. </view>
  176. </view>
  177. </view>
  178. </tui-bottom-popup>
  179. <!-- 底部按钮 -->
  180. <view class="menu" v-if="isShowButton">
  181. <view class="bottom-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  182. <view class="bottom-le">
  183. <view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">
  184. <image src="https://static.caimei365.com/app/img/icon/icon-logo.png"></image>
  185. </view>
  186. <view class="item-bt">
  187. <!-- #ifdef MP-WEIXIN -->
  188. <button class="contact-btn" open-type="contact" @bindcontact="handleContact">
  189. <image src="../../static/severs@3x.png"></image>
  190. </button>
  191. <!-- #endif -->
  192. </view>
  193. <view class="item-bt" @click="buyProductCart()">
  194. <image src="https://static.caimei365.com/app/img/icon/icon-cart-active@3x.png"></image>
  195. <text v-if="hasLogin && goodsData.cartCount>0"
  196. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  197. :class="[goodsData.cartCount < 10 ? 'goleft':'']">
  198. {{ goodsData.cartCount >= 100 ? '99+': goodsData.cartCount}}
  199. </text>
  200. <view class="animation-num" :class="isAnimation ? 'animation' : 'restion'">+1</view>
  201. </view>
  202. </view>
  203. <view class="bottom-ri">
  204. <button
  205. :disabled="goodsData.disabled"
  206. class="btn btn-cart"
  207. :class="[goodsData.disabled ? 'disabled':'']"
  208. @tap.stop="btnGetConfirm('add')">加入购物车</button>
  209. <button
  210. :disabled="goodsData.disabled"
  211. class="btn btn-bay"
  212. :class="[goodsData.disabled ? 'disabled':'']"
  213. @tap.stop="btnGetConfirm('buy')">立即购买</button>
  214. </view>
  215. </view>
  216. </view>
  217. <!--底部选择模态层弹窗组件 -->
  218. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" @tap="hideSpec">
  219. <!-- 遮罩层 -->
  220. <view class="mask"></view>
  221. <view class="layer" @tap.stop="discard" :style="{paddingBottom :isIphoneX ? '68rpx' : '36rpx',bottom:isIphoneX ?'-352rpx' : '-296rpx'}">
  222. <view class="content">
  223. <view class="layer-smimg">
  224. <image :src="product.mainImage" mode=""></image>
  225. </view>
  226. <view class="layer-nunbox">
  227. <view class="layer-nunbox-t" v-if="product.step === 2">
  228. <view class="text">*该商品只能以起订量的整数倍购买</view>
  229. </view>
  230. <view class="layer-nunbox-t">
  231. <view class="layer-nunbox-text">数量:</view>
  232. <view class="number-box">
  233. <view class="iconfont icon-jianhao" :class="[isQuantity==true?'disabled':'']" @click="changeCountSub()"></view>
  234. <input class="btn-input" type="number" v-model="number" maxlength='4' @blur="changeNumber($event)">
  235. <view class="iconfont icon-jiahao" :class="[isStock==true?'disabled':'']" @click="changeCountAdd()"></view>
  236. </view>
  237. </view>
  238. <view class="layer-nunbox-b">
  239. <view class="text">单价:
  240. <text class="p sm">¥</text>
  241. <text class="p bg">{{buyRetailPrice.toFixed(2)}}</text>
  242. </view>
  243. </view>
  244. </view>
  245. </view>
  246. <view class="btn"><view class="button" @click.stop="btnConfirm">确定</view></view>
  247. </view>
  248. </view>
  249. <!-- 侧边 -->
  250. <scroll-top :isScrollTop="isScrollTop" :bottom="200"></scroll-top>
  251. </view>
  252. </template>
  253. </view>
  254. </template>
  255. <script>
  256. import { mapState,mapMutations } from 'vuex'
  257. import customP from '@/components/cm-module/headerNavbar/header-poduct' //自定义导航
  258. import cmPrice from "@/components/cm-module/productDetails/cm-price.vue" //价格显示
  259. import cmAttributes from "@/components/cm-module/productDetails/cm-attributes.vue" //规格信息
  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 authorize from '@/common/config/authorize.js'
  266. import wxLogin from "@/common/config/wxLogin.js"
  267. import { debounce } from '@/common/config/common.js'
  268. var isPreviewImg;
  269. export default{
  270. components:{
  271. customP,
  272. parser,
  273. tuiSkeleton,
  274. recommend,
  275. cmPrice,
  276. cmAttributes,
  277. cmParameter,
  278. cmService
  279. },
  280. data(){
  281. return{
  282. html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
  283. productNoneImage:'https://static.caimei365.com/app/img/icon/icon-pnone.png',
  284. mode:'round',
  285. iconClass:'icon-aixin',
  286. iconColor:'#ff9100',
  287. specClass: '',//规格弹窗css类,控制开关动画
  288. isBtnType:'',
  289. isRequest:false,
  290. isScrollTop:false,
  291. current:0,
  292. shopId:0,
  293. isShareType:'',
  294. isHeaderPoduct:false,
  295. navbarFiexd:'none',
  296. ladderPriceFlag:'',
  297. ladderPriceList:'',
  298. isInvalid:false,
  299. isEvaluate:false,
  300. isAnimation:false,
  301. skeletonShow:true,
  302. isQuantity:false,
  303. isStock:false,
  304. disabled:false,
  305. isNoneDisabled:false,
  306. tabCurrentIndex:0,
  307. userID:'',
  308. shopID:'',
  309. productID:0,
  310. userIdentity:0,//用户类型
  311. goodsData:{},//自定义数据
  312. shop:{},//供应商信息
  313. product:{},//采美
  314. productImage:[],
  315. retailPrice:0,
  316. buyRetailPrice:0,
  317. buyRetailPriceStep:1,
  318. stock:0,
  319. number:0,
  320. minBuyNumber:0,
  321. productsList:[],
  322. goodListData:[],
  323. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  324. systeminfo: this.setSysteminfo(), //获取设备信息
  325. isIphoneX:this.$store.state.isIphoneX,
  326. windowHeight: '',
  327. headerColor:false,
  328. backPage:1,
  329. nvabarData: { //顶部自定义导航
  330. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  331. title: '' // 导航栏 中间的标题
  332. },
  333. linkPath:'',
  334. CustomBar:this.CustomBar,// 顶部导航栏高度
  335. popupShow:false,//参数弹窗
  336. tabSelectFlag:false,
  337. sectionPropsArr: [],
  338. scrollTopArray:[],
  339. sectionTopRangeArr: [],
  340. winHeight:'',
  341. isShowButton:true,
  342. }
  343. },
  344. onLoad(option) {
  345. this.productID = option.id;//获取商品ID
  346. this.isShareType = option.type
  347. this.linkPath = option.path
  348. this.isHeaderPoduct = true
  349. if(option.page == 2){
  350. this.backPage = option.page
  351. }
  352. if(this.isShareType =='share'){
  353. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  354. console.log(wxResponse)
  355. if(wxResponse == 1){
  356. wxLogin.wxLoginAuthorize()
  357. }else{
  358. console.log(new Date +'用户未授权微信信息')
  359. }
  360. })
  361. }
  362. this.getWinHeight()
  363. },
  364. computed: {
  365. ...mapState(['hasLogin','isWxAuthorize','identity'])
  366. },
  367. methods:{
  368. initData(){// 初始化商品详情查询
  369. this.ProductService.queryProductDetils({userId:this.userID,productID:this.productID,identity:this.identity}).then(response =>{
  370. this.skeletonShow = false
  371. this.productImage=[];
  372. this.shop = response.data.shop
  373. this.shopId = response.data.shopID
  374. this.product = response.data
  375. //已删除/已冻结
  376. if(this.product.validFlag === '0'){
  377. this.isInvalid = true
  378. }
  379. this.ladderPriceFlag = this.product.ladderPriceFlag;
  380. this.html = this.product.productDetail == null ? this.html : this.$api.adaptRichTextImg(this.product.productDetail.detailInfo)
  381. this.stock = this.product.stock
  382. this.buyRetailPriceStep = this.product.step
  383. this.number = this.product.minBuyNumber
  384. this.minBuyNumber = this.product.minBuyNumber
  385. //处理商品图片列表
  386. this.product.imageList.forEach(item =>{
  387. this.productImage.push(item.image);
  388. })
  389. //购物车数量
  390. this.goodsData.cartCount = this.product.productCount
  391. //处理阶梯价格
  392. if(this.product.ladderPriceList!=null){
  393. this.ladderPriceList = this.product.ladderPriceList;
  394. }
  395. //拆分金额并转千分位格式显示
  396. if(this.product.retailPrice!=null){
  397. this.retailPrice = this.product.retailPrice.toFixed(2);
  398. this.buyRetailPrice = this.product.retailPrice;
  399. }
  400. //处理下架商品和售罄商品
  401. if(this.product.validFlag =='3' || this.product.validFlag =='10' || this.stock == 0 ){
  402. this.disabled = true
  403. this.isNoneDisabled = true
  404. }else{
  405. this.disabled = false
  406. this.isNoneDisabled = false
  407. this.goodsData.disabledText = ''
  408. }
  409. if(this.product.price1TextFlag == "1"){
  410. this.disabled = true
  411. }
  412. if(this.product.price1TextFlag == "2"){
  413. if(this.userIdentity == 4){
  414. this.disabled = true
  415. }else{
  416. this.disabled = false
  417. }
  418. }
  419. this.goodsData.disabled = this.disabled
  420. this.goodsData.isNoneDisabled = this.isNoneDisabled
  421. if(this.product.validFlag =='3'){
  422. this.goodsData.disabledText = '下架'
  423. }
  424. if(this.product.validFlag =='10'){
  425. this.goodsData.disabledText = '停售'
  426. }
  427. if(this.stock == 0){
  428. this.goodsData.disabledText = '售罄'
  429. }
  430. setTimeout(()=>{
  431. this.getSectionProps();
  432. },2000)
  433. this.isRequest = true
  434. }).catch(error =>{
  435. this.$util.msg(error.msg,2000);
  436. })
  437. },
  438. swiperChange(e) {//顶部商品图片切换
  439. const index = e.detail.current;
  440. this.current = index;
  441. },
  442. previewImg (index) {//顶部商品图片预览
  443. isPreviewImg = true
  444. let previewUrls = this.productImage
  445. uni.previewImage({
  446. current: index, //图片索引
  447. urls: previewUrls, //必须是http图片,本地图片无效
  448. longPressActions:''
  449. })
  450. },
  451. tabClick(index) {//商品详情&&供应商信息tab切换
  452. this.tabSelectFlag = true
  453. this.tabCurrentIndex = index;
  454. let classIndex = '.product-details'+index;
  455. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  456.   uni.createSelectorQuery().select(classIndex).boundingClientRect((res)=>{//最外层盒子节点
  457.     uni.pageScrollTo({
  458.       duration:300,//过渡时间必须为0,uniapp bug,否则运行到手机会报错
  459.       scrollTop:res.top - data.top - 150,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
  460.     })
  461. setTimeout(()=>{
  462. this.tabSelectFlag = false;
  463. },500)
  464.   }).exec()
  465. }).exec()
  466. },
  467. handleContact(e){//跳转小程序客服
  468. },
  469. buyProductCart(){//底部购物车按钮点击
  470. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  471. if(wxResponse == 1){
  472. if(this.hasLogin){
  473. this.$api.navigateTo('/pages/goods/cart')
  474. }else{
  475. this.$api.navigateTo('/pages/login/login?type=1')
  476. }
  477. }else{
  478. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  479. }
  480. })
  481. },
  482. btnGetConfirm(type){//加入购物车&&立即购买点击
  483. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  484. if(wxResponse == 1){
  485. if(this.hasLogin){
  486. this.showSpec(type);
  487. }else{
  488. this.$api.navigateTo('/pages/login/login?type=1')
  489. }
  490. }else{
  491. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  492. }
  493. })
  494. },
  495. changeCountAdd(){//popup弹窗数量增加按钮
  496. if(this.buyRetailPriceStep == 2){
  497. this.number+=this.minBuyNumber
  498. }else{
  499. this.number++
  500. }
  501. this.processActivityPrice()
  502. },
  503. changeCountSub(){//popup弹窗数量减按钮
  504. if(this.number<=this.minBuyNumber){
  505. this.number= this.minBuyNumber
  506. this.isQuantity =true
  507. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  508. return
  509. }else{
  510. if(this.buyRetailPriceStep == 2){
  511. this.number-=this.minBuyNumber
  512. }else{
  513. this.number--
  514. }
  515. this.processActivityPrice()
  516. this.isQuantity =false
  517. }
  518. },
  519. changeNumber(e){
  520. let _value = e.detail.value;
  521. if(!this.$api.isNumber(_value)){
  522. this.number = this.minBuyNumber
  523. }else if(_value < this.minBuyNumber){
  524. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  525. this.number = this.minBuyNumber
  526. }else if( _value % this.minBuyNumber !=0 ){
  527. this.$util.msg(`购买量必须为起订量的整数倍`,2000);
  528. this.number = this.minBuyNumber
  529. }else{
  530. this.number = e.detail.value
  531. }
  532. this.processActivityPrice()
  533. },
  534. processActivityPrice(){//单独处理活动价格和阶梯价格
  535. if(this.ladderPriceFlag == '0' && this.product.actStatus == 0 || this.product.actStatus == 1){
  536. this.buyRetailPrice = this.product.retailPrice
  537. }else{
  538. this.ladderPriceList.forEach((item,index)=>{
  539. if(this.number>=item.buyNum){
  540. this.buyRetailPrice = item.buyPrice
  541. }
  542. })
  543. }
  544. },
  545. showSpec(type) {//显示选择数量确认弹窗
  546. this.isBtnType = type
  547. this.specClass = 'show';
  548. },
  549. hideSpec() {//关闭选择数量确认弹窗
  550. this.specClass = 'hide';
  551. setTimeout(() => {
  552. this.specClass = 'none';
  553. }, 200);
  554. },
  555. btnConfirm() {//加入购物车&&立即购买跳转订单页并关闭弹窗
  556. if(this.isBtnType == 'add'){
  557. this.getAddProductCart()
  558. }else{
  559. this.toConfirmation()
  560. }
  561. },
  562. toConfirmation(){//跳转确认订单页面
  563. this.specClass = 'hide';
  564. let productStp ={
  565. allPrice:this.number*this.buyRetailPrice,
  566. allCount:this.number,
  567. productID:this.product.productID,
  568. productCount:this.number
  569. }
  570. this.$api.navigateTo(`/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({data:productStp})}`)
  571. setTimeout(() => {
  572. this.specClass = 'none';
  573. }, 200);
  574. },
  575. getAddProductCart(){//增加购物车成功和toast弹窗提示成功
  576. this.ProductService.shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
  577. this.specClass = 'hide';
  578. this.$util.msg('加入购物车成功',1500,true,'success')
  579. this.isAnimation = true
  580. setTimeout(() => {this.specClass = 'none'}, 200)
  581. setTimeout(() => {this.isAnimation = false},2000)
  582. this.goodsData.cartCount = response.data;
  583. }).catch(error =>{
  584. this.$util.msg(error.msg,2000);
  585. })
  586. },
  587. navToLogin(){
  588. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  589. if(wxResponse == 1){
  590. this.$store.commit('setLoginType',8)
  591. this.$store.commit('setLoginProductId',this.productID)
  592. this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
  593. }else{
  594. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  595. }
  596. })
  597. },
  598. setHeaderBtnPosi(){
  599. // 获得胶囊按钮位置信息
  600. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  601. return headerBtnPosi
  602. },
  603. setSysteminfo(){
  604. let systeminfo;
  605. uni.getSystemInfo({ // 获取设备信息
  606. success: (res) => {
  607. systeminfo = res
  608. },
  609. })
  610. return systeminfo
  611. },
  612. goIndex(){//商城首页
  613. uni.switchTab({
  614. url: '/pages/tabBar/home/index'
  615. });
  616. },
  617. goSupplier(){//跳供应商资料页
  618. this.$api.navigateTo('/supplier/pages/user/my-shop?shopId='+this.shopId)
  619. },
  620. discard(){
  621. //丢弃
  622. },
  623. onShare(res){//分享转发
  624. if (res.from === 'button') {
  625. // 来自页面内转发按钮
  626. }
  627. return {
  628. title: `${this.product.name}`,
  629. path: `pages/goods/product?type=share&id=${this.productID}`,
  630. imageUrl:`${this.productImage[0]}`
  631. }
  632. },
  633. showPopup(){
  634. this.popupShow = true
  635. },
  636. hidePopup(){
  637. this.popupShow = false
  638. },
  639. getSectionProps() {//获取每个tab对应区域的scrollTop值
  640. let className = '.product-details',
  641. sectionPropsArr = [];
  642. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  643.   uni.createSelectorQuery().selectAll(className).boundingClientRect((res)=>{//最外层盒子节点
  644. res.forEach((item, index) => {
  645. sectionPropsArr.push({
  646. className: `${className}${index}`,
  647. scrollTop: item.top - data.top - 150
  648. })
  649. })
  650. this.sectionPropsArr = sectionPropsArr;
  651. this.sectionTopRangeArr = this.getSectionRange(sectionPropsArr);
  652.   }).exec()
  653. }).exec()
  654. },
  655. getSectionRange(arr) {// 获取每个tab对应区域的区间
  656. let sectionScrollTopList = [];
  657. for(let i = 0; i < arr.length; i++) {
  658. let thisScrollTop = arr[i].scrollTop;
  659. if(i < arr.length - 1) {
  660. let nextScrollTop = arr[i+1].scrollTop;
  661. if(i == 0) {
  662. sectionScrollTopList.push(`0-${thisScrollTop}`);
  663. } else if(i == arr.length - 1){
  664. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop - this.winHeight}`);
  665. } else {
  666. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop}`);
  667. }
  668. } else {
  669. sectionScrollTopList.push(`${thisScrollTop}-${thisScrollTop+500}`);
  670. }
  671. }
  672. return sectionScrollTopList;
  673. },
  674. activeTab: debounce((top, _this)=> {//当滑动时也能同步激活tab
  675. const { sectionTopRangeArr } = _this;
  676. if(sectionTopRangeArr.length > 0) {
  677. sectionTopRangeArr.forEach((item, index) => {
  678. let splitItem = item.split('-'),
  679. openInterval = Number(splitItem[0]),
  680. closedInterval = Number(splitItem[1]);
  681. if(top >= openInterval && top < closedInterval) {
  682. _this.tabCurrentIndex = index;
  683. }
  684. })
  685. }
  686. },100, true),
  687. getWinHeight() {
  688. this.winHeight = wx.getSystemInfoSync().windowHeight;
  689. },
  690. },
  691. onPageScroll(e){//实时获取到滚动的值
  692. const { scrollTop } = e;
  693. if(!this.tabSelectFlag) {
  694. this.activeTab(scrollTop, this);
  695. }
  696. if(e.scrollTop>100){
  697. this.headerColor = true
  698. this.navbarFiexd = 'fixed'
  699. this.nvabarData={
  700. showCapsule: 1,
  701. title: '商品详情',
  702. }
  703. }else{
  704. this.headerColor = false
  705. this.navbarFiexd = 'none'
  706. this.nvabarData={
  707. showCapsule: 1,
  708. title: '',
  709. }
  710. }
  711. if(e.scrollTop>700){
  712. this.isScrollTop = true
  713. }else{
  714. this.isScrollTop = false
  715. }
  716. },
  717. onShareAppMessage(res){//分享转发
  718. if (res.from === 'button') {
  719. // 来自页面内转发按钮
  720. }
  721. return {
  722. title: `${this.product.name}`,
  723. path: `pages/goods/product?type=share&id=${this.productID}`,
  724. imageUrl:`${this.productImage[0]}`
  725. }
  726. },
  727. onShow() {
  728. this.$api.getStorage().then((resolve) => {
  729. this.userID = resolve.userID ? resolve.userID : '';
  730. this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
  731. this.shopID = resolve.shopID ? resolve.shopID : '';
  732. if(this.userIdentity == 0 || this.userIdentity == 2 || this.userIdentity == 4){
  733. this.isShowButton = true
  734. }else{
  735. this.isShowButton = false
  736. }
  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: 28rpx;
  988. border-radius: 6rpx;
  989. background-color: #FFFFFF;
  990. line-height: 28rpx;
  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. justify-content: center;
  1301. font-size: $font-size-24;
  1302. color: $text-color;
  1303. line-height: 34rpx;
  1304. position: relative;
  1305. .animation-num{
  1306. font-size:$font-size-32 ;
  1307. color: #FF2A2A;
  1308. position: absolute;
  1309. top: -12rpx;
  1310. right: 4rpx;
  1311. font-weight: bold;
  1312. }
  1313. .animation{
  1314. animation: showAmnation 2.2s ease-in-out both;
  1315. }
  1316. .restion{
  1317. animation: hideAmnation 1s ease-in-out both;
  1318. }
  1319. .icon-num{
  1320. position: absolute;
  1321. right:-12rpx;
  1322. top: 0;
  1323. }
  1324. .icon-num.goleft{
  1325. right: 4rpx;
  1326. }
  1327. &:last-child{
  1328. margin-right: 0;
  1329. }
  1330. image {
  1331. width: 48rpx;
  1332. height: 48rpx;
  1333. margin-bottom: 8rpx;
  1334. }
  1335. button.contact-btn{
  1336. width: 100%;
  1337. height: 100%;
  1338. margin: 0;
  1339. padding: 0;
  1340. display: flex;
  1341. flex-direction: column;
  1342. align-items: center;
  1343. justify-content: center;
  1344. box-sizing: border-box;
  1345. font-size: $font-size-24;
  1346. text-align: center;
  1347. text-decoration: none;
  1348. line-height: 34rpx;
  1349. border-radius: 0;
  1350. -webkit-tap-highlight-color: transparent;
  1351. overflow: hidden;
  1352. color: $text-color;
  1353. background-color:#FFFFFF;
  1354. }
  1355. }
  1356. }
  1357. .bottom-ri{
  1358. width: 400rpx;
  1359. height: 100%;
  1360. float: right;
  1361. display: flex;
  1362. box-sizing: border-box;
  1363. padding: 13rpx 20rpx 13rpx 0;
  1364. .btn{
  1365. flex: 1;
  1366. width: 200rpx;
  1367. line-height: 84rpx;
  1368. text-align: center;
  1369. font-size: $font-size-26;
  1370. color: #FFFFFF;
  1371. }
  1372. .btn-cart{
  1373. background-color: #ffe6dc;
  1374. color: $color-system;
  1375. border-radius: 42rpx 0 0 42rpx;
  1376. }
  1377. .btn-cart.disabled{
  1378. background-color: #E1E1E1;
  1379. color: #FFFFFF;
  1380. }
  1381. .btn-bay{
  1382. background:linear-gradient(to right, #f28f31 0%, #e15616 100%);
  1383. border-radius: 0 42rpx 42rpx 0;
  1384. }
  1385. .btn-bay.disabled{
  1386. background: linear-gradient(135deg,rgba(242,143,49,0.5) 0%,rgba(225,86,22,0.5) 100%);
  1387. }
  1388. }
  1389. }
  1390. .uni-badge--small {
  1391. -webkit-transform: scale(.8);
  1392. -ms-transform: scale(.8);
  1393. transform: scale(.8);
  1394. -webkit-transform-origin: center center;
  1395. -ms-transform-origin: center center;
  1396. transform-origin: center center;
  1397. }
  1398. .uni-badge {
  1399. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1400. -webkit-box-sizing: border-box;
  1401. box-sizing: border-box;
  1402. font-size: 12px;
  1403. line-height: 1;
  1404. display: inline-block;
  1405. padding: 3px 6px;
  1406. color: #333;
  1407. border-radius: 100px;
  1408. background-color: #f1f1f1;
  1409. }
  1410. .uni-badge-error {
  1411. color: #fff;
  1412. background-color: #dd524d;
  1413. }
  1414. .navbar {
  1415. width: 100%;
  1416. height: 80rpx;
  1417. box-sizing: border-box;
  1418. padding: 0 24rpx;
  1419. background: #FFFFFF;
  1420. z-index: 10;
  1421. display: flex;
  1422. position: fixed;
  1423. opacity: 0;
  1424. left: 0;
  1425. &.fixed{
  1426. animation: showFixedColor 0.3s ease-in-out both;
  1427. }
  1428. &.none{
  1429. animation: hideFixedColor 0.3s ease-in-out both;
  1430. }
  1431. .nav-item {
  1432. display: flex;
  1433. flex: 1;
  1434. justify-content: center;
  1435. align-items: center;
  1436. height: 80rpx;
  1437. font-size: $font-size-28;
  1438. color: $text-color;
  1439. position: relative;
  1440. float: left;
  1441. position: relative;
  1442. .line{
  1443. width: 60rpx;
  1444. height: 2px;
  1445. border-radius: 1px;
  1446. background: #FFFFFF;
  1447. position: absolute;
  1448. bottom: 0;
  1449. left: 50%;
  1450. margin-left: -30rpx;
  1451. }
  1452. &.current{
  1453. color:$color-system;
  1454. .line{
  1455. background: $color-system;
  1456. }
  1457. }
  1458. }
  1459. }
  1460. @keyframes showFixedColor {
  1461. 0% {background: rgba(255,255,255,0);opacity: 0;}
  1462. 50% {background: rgba(255,255,255,0.5);opacity: 0.5;}
  1463. 100% {background: rgba(255,255,255,1);opacity: 1;}
  1464. }
  1465. @keyframes hideFixedColor {
  1466. 0% {background: rgba(255,255,255,1);opacity: 1;}
  1467. 50% {background: rgba(255,255,255,0.5);opacity: 0.5;}
  1468. 100% {background: rgba(255,255,255,0);opacity: 0;}
  1469. }
  1470. /* 加入购物模态层*/
  1471. @keyframes showPopup {
  1472. 0% {
  1473. opacity: 0;
  1474. }
  1475. 100% {
  1476. opacity: 1;
  1477. }
  1478. }
  1479. @keyframes hidePopup {
  1480. 0% {
  1481. opacity: 1;
  1482. }
  1483. 100% {
  1484. opacity: 0;
  1485. }
  1486. }
  1487. @keyframes showLayer {
  1488. 0% {
  1489. transform: translateY(0);
  1490. }
  1491. 100% {
  1492. transform: translateY(-100%);
  1493. }
  1494. }
  1495. @keyframes hideLayer {
  1496. 0% {
  1497. transform: translateY(-100%);
  1498. }
  1499. 100% {
  1500. transform: translateY(0);
  1501. }
  1502. }
  1503. @keyframes showAmnation {
  1504. 0% {
  1505. top: -12rpx;
  1506. opacity: 0;
  1507. }
  1508. 50% {
  1509. top: -60rpx;
  1510. opacity: 1;
  1511. }
  1512. 100% {
  1513. top: -100rpx;
  1514. opacity: 0;
  1515. }
  1516. }
  1517. @keyframes hideAmnation {
  1518. 0% {
  1519. top: -100rpx;
  1520. opacity: 0;
  1521. }
  1522. 100% {
  1523. top: -12rpx;
  1524. opacity: 0;
  1525. }
  1526. }
  1527. .popup {
  1528. position: fixed;
  1529. top: 0;
  1530. width: 100%;
  1531. height: 100%;
  1532. z-index: 999;
  1533. display: none;
  1534. .mask{
  1535. position: fixed;
  1536. top: 0;
  1537. width: 100%;
  1538. height: 100%;
  1539. z-index: 21;
  1540. background-color: rgba(0, 0, 0, 0.6);
  1541. }
  1542. .layer {
  1543. position: fixed;
  1544. z-index: 22;
  1545. bottom: -294rpx;
  1546. width: 702rpx;
  1547. padding: 24rpx 24rpx 36rpx 24rpx;
  1548. height: 260rpx;
  1549. border-radius: 20rpx 20rpx 0 0;
  1550. background-color: #fff;
  1551. display: flex;
  1552. flex-wrap: wrap;
  1553. align-content: space-between;
  1554. .content {
  1555. width: 100%;
  1556. }
  1557. .btn {
  1558. width: 100%;
  1559. height: 88rpx;
  1560. margin-top: 20rpx;
  1561. .button {
  1562. width: 100%;
  1563. height: 88rpx;
  1564. color: #fff;
  1565. display: flex;
  1566. align-items: center;
  1567. justify-content: center;
  1568. background: $btn-confirm;
  1569. font-size: $font-size-28;
  1570. border-radius: 44rpx;
  1571. }
  1572. }
  1573. }
  1574. &.show {
  1575. display: block;
  1576. .mask{
  1577. animation: showPopup 0.2s linear both;
  1578. }
  1579. .layer {
  1580. animation: showLayer 0.2s linear both;
  1581. }
  1582. }
  1583. &.hide {
  1584. display: block;
  1585. .mask{
  1586. animation: hidePopup 0.2s linear both;
  1587. }
  1588. .layer {
  1589. animation: hideLayer 0.2s linear both;
  1590. }
  1591. }
  1592. &.none {
  1593. display: none;
  1594. }
  1595. &.service {
  1596. .row {
  1597. margin: 30upx 0;
  1598. .title {
  1599. font-size: 30upx;
  1600. margin: 10upx 0;
  1601. }
  1602. .description {
  1603. font-size: 28upx;
  1604. color: #999;
  1605. }
  1606. }
  1607. }
  1608. .layer-smimg{
  1609. width: 114rpx;
  1610. height: 114rpx;
  1611. float: left;
  1612. border-radius: 10rpx;
  1613. margin-right: 24rpx;
  1614. image{
  1615. width: 114rpx;
  1616. height: 114rpx;
  1617. border-radius: 10rpx;
  1618. }
  1619. }
  1620. .layer-nunbox{
  1621. justify-content: space-between;
  1622. align-items: center;
  1623. width: 536rpx;
  1624. height: auto;
  1625. float: left;
  1626. .layer-nunbox-t{
  1627. width: 100%;
  1628. height:44rpx;
  1629. position:relative;
  1630. display: flex;
  1631. margin-bottom: 10rpx;
  1632. .text{
  1633. font-size: $font-size-24;
  1634. line-height: 48rpx;
  1635. color: #999999;
  1636. }
  1637. .layer-nunbox-text{
  1638. line-height: 44rpx;
  1639. font-size: $font-size-28;
  1640. }
  1641. .number-box{
  1642. display: flex;
  1643. justify-content: center;
  1644. align-items: center;
  1645. .iconfont{
  1646. font-size: $font-size-32;
  1647. padding:0 20rpx;
  1648. font-size: $text-color;
  1649. }
  1650. .btn-input{
  1651. width: 62rpx;
  1652. height: 48rpx;
  1653. line-height: 48rpx;
  1654. background: #F8F8F8;
  1655. border-radius: 4rpx;
  1656. text-align: center;
  1657. font-size: $font-size-28;
  1658. }
  1659. }
  1660. .product-step{
  1661. position: absolute;
  1662. left: 45rpx;
  1663. bottom: 0;
  1664. height: 44rpx;
  1665. background: #FFFFFF;
  1666. }
  1667. }
  1668. .layer-nunbox-b{
  1669. width: 100%;
  1670. height:44rpx;
  1671. margin-top: 13rpx;
  1672. }
  1673. .text{
  1674. line-height: 44rpx;
  1675. font-size: $font-size-28;
  1676. .p{
  1677. color: #FF2A2A;
  1678. }
  1679. .p:first-child{
  1680. margin-left: 30rpx;
  1681. }
  1682. .p.sm{
  1683. font-size: $font-size-24;
  1684. }
  1685. }
  1686. }
  1687. }
  1688. .tui-popup-box {
  1689. position: relative;
  1690. box-sizing: border-box;
  1691. min-height: 220rpx;
  1692. padding:0rpx 24rpx 0 24rpx;
  1693. .title{
  1694. font-size: $font-size-34;
  1695. color: $text-color;
  1696. line-height: 88rpx;
  1697. text-align: center;
  1698. float: left;
  1699. width: 100%;
  1700. height: 88rpx;
  1701. }
  1702. .content{
  1703. width: 100%;
  1704. height: auto;
  1705. float: left;
  1706. .content-tr{
  1707. width: 100%;
  1708. height: 58rpx;
  1709. line-height: 58rpx;
  1710. display: flex;
  1711. .content-td{
  1712. display: flex;
  1713. flex: 3;
  1714. font-size: $font-size-26;
  1715. color: #999999;
  1716. line-height: 58rpx;
  1717. text-align: left;
  1718. }
  1719. .content-th{
  1720. display: flex;
  1721. flex: 7;
  1722. font-size: $font-size-26;
  1723. color: #333333;
  1724. line-height: 58rpx;
  1725. text-align: left;
  1726. }
  1727. }
  1728. }
  1729. }
  1730. .tui-popup-btn {
  1731. width: 100%;
  1732. height: auto;
  1733. float: left;
  1734. margin-top: 24rpx;
  1735. .tui-button{
  1736. width: 100%;
  1737. height: 88rpx;
  1738. background: $btn-confirm;
  1739. line-height: 88rpx;
  1740. text-align: center;
  1741. color: #FFFFFF;
  1742. font-size: $font-size-28;
  1743. border-radius: 44rpx;
  1744. }
  1745. }
  1746. /*富文本样式*/
  1747. rich-text.p{
  1748. width: 702rpx !important;
  1749. padding: 0 24rpx;
  1750. text-align: justify;
  1751. }
  1752. rich-text.img{
  1753. width: 100%;
  1754. height: auto;
  1755. }
  1756. </style>