product.vue 42 KB

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