product.vue 75 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509
  1. <template>
  2. <view
  3. class="product "
  4. :style="{
  5. paddingBottom: userIdentity == 1 && userIdentity == 3 ? '0rpx' : '188rpx',
  6. paddingTop: CustomBar + 'px'
  7. }"
  8. >
  9. <custom-p
  10. v-if="isHeaderPoduct"
  11. :systeminfo="systeminfo"
  12. :navbar-data="nvabarData"
  13. :headerBtnPosi="headerBtnPosi"
  14. :headerColor="headerColor"
  15. :type="isShareType"
  16. :page="backPage"
  17. >
  18. </custom-p>
  19. <view
  20. class="product-topnav"
  21. id="topBar"
  22. v-show="isNavbarFiexd"
  23. :class="navbarFiexd"
  24. :style="{ top: CustomBar + 'px' }"
  25. >
  26. <view class="search-input">
  27. <view class="gosearch-btn" :class="navbarFiexd" @click="this.$api.navigateTo(clickPath)">
  28. <view class="search-icon"> <text class="iconfont icon-iconfonticonfontsousuo1"></text> </view>
  29. <view class="search-text">搜索商品/项目仪器</view>
  30. </view>
  31. </view>
  32. <view class="navbar">
  33. <view
  34. class="nav-item tui-skeleton-fillet"
  35. :class="{ current: tabCurrentIndex === 0 }"
  36. @click="tabClick(0)"
  37. >
  38. <text>详情</text> <text class="line"></text>
  39. </view>
  40. <view
  41. class="nav-item tui-skeleton-fillet"
  42. :class="{ current: tabCurrentIndex === 1 }"
  43. @click="tabClick(1)"
  44. >
  45. <text>服务项目</text> <text class="line"></text>
  46. </view>
  47. <view
  48. class="nav-item tui-skeleton-fillet"
  49. :class="{ current: tabCurrentIndex === 2 }"
  50. @click="tabClick(2)"
  51. >
  52. <text>推荐</text> <text class="line"></text>
  53. </view>
  54. <view
  55. class="nav-item tui-skeleton-fillet"
  56. :class="{ current: tabCurrentIndex === 3 }"
  57. @click="tabClick(3)"
  58. v-if="product.archiveId !== 0"
  59. >
  60. <text>相关资料</text> <text class="line"></text>
  61. </view>
  62. </view>
  63. </view>
  64. <tui-skeleton
  65. v-if="skeletonShow"
  66. backgroundColor="#fafafa"
  67. borderRadius="10rpx"
  68. :isLoading="true"
  69. :loadingType="5"
  70. ></tui-skeleton>
  71. <template v-else>
  72. <view class="cart-content empty" v-if="isInvalid">
  73. <view class="empty-container">
  74. <image class="empty-container-image" :src="productNoneImage" mode="aspectFit"></image>
  75. <text class="error-text">商品已失效,去商城逛逛别的吧~</text>
  76. <view class="login-btn" @click="goIndex">去商城</view>
  77. </view>
  78. </view>
  79. <view class="container-product tui-skeleton" v-else>
  80. <view class="container-product-main">
  81. <view class="product-top">
  82. <view class="banner-section">
  83. <uni-swiper-dot :info="productImage" :current="current" field="content" :mode="mode">
  84. <swiper
  85. class="banner tui-banner tui-skeleton-rect"
  86. @change="swiperChange"
  87. :duration="800"
  88. :autoplay="false"
  89. :circular="true"
  90. >
  91. <swiper-item v-for="(item, index) in productImage" :key="index" class="banner-item">
  92. <image :src="item" @click="previewImg(index)" class="product-img" />
  93. <view class="cm-product-cover" v-if="product.appletsActType === 1"
  94. >云上美博会</view
  95. >
  96. </swiper-item>
  97. </swiper>
  98. <view class="swiper__dots-box">
  99. <tui-tag
  100. padding="12rpx 24rpx"
  101. type="translucent"
  102. shape="circleLeft"
  103. size="32rpx"
  104. :scaleMultiple="0.82"
  105. originRight
  106. >
  107. {{ current + 1 }}/{{ productImage.length }}
  108. </tui-tag>
  109. </view>
  110. </uni-swiper-dot>
  111. </view>
  112. <view class="product-wrap clearfix">
  113. <view class="wrap-top" :class="goodsData.isNoneDisabled ? 'none' : ''">
  114. <view class="wrap-top-price">
  115. <cm-price
  116. v-if="isRequest"
  117. :product="product"
  118. :userIdentity="userIdentity"
  119. :shopID="shopID"
  120. :promotions="product.promotions"
  121. :ladderPriceList="ladderPriceList"
  122. />
  123. </view>
  124. <view class="p-title tui-skeleton-fillet">
  125. <view class="mclap-tag" v-if="product.beautyActFlag == '1'">美博会</view>
  126. <view class="p-title-name" :class="product.beautyActFlag == '1' ? 'indent' : ''">
  127. {{ product.name == undefined ? '' : product.name }}
  128. </view>
  129. <button open-type="share" class="p-title-share tui-share-position" @tap="onShare">
  130. <view class=""><text class="iconfont icon-fenxiang1"></text></view>
  131. <view class="">分享</view>
  132. </button>
  133. </view>
  134. <view class="wrap-label" v-if="product.tagsList.length > 0">
  135. <view
  136. class="label-a tui-skeleton-fillet"
  137. v-for="(label, index) in product.tagsList"
  138. :key="index"
  139. >{{ label }}</view
  140. >
  141. </view>
  142. <view class="product-seve" v-if="hasLogin">
  143. <text class="label">采美承诺:</text>
  144. <text class="iconfont icon-dui tui-skeleton-rect"
  145. ><text class="text">无忧退货</text></text
  146. >
  147. <text class="iconfont icon-dui tui-skeleton-rect"
  148. ><text class="text">快速退款</text></text
  149. >
  150. <text class="iconfont icon-dui tui-skeleton-rect"
  151. ><text class="text">正品保证</text></text
  152. >
  153. </view>
  154. <view
  155. class="productRemarks"
  156. v-if="product.productRemarks != '' && product.productRemarks != null"
  157. >
  158. 备注:{{ product.productRemarks }}
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <view class="product-item-none" v-if="goodsData.isNoneDisabled">
  164. <image class="none-image" :src="productNoneImage" mode=""></image>
  165. <view class="none-text">此商品已{{ goodsData.disabledText }},请浏览以下推荐商品~</view>
  166. </view>
  167. <!-- 参数 -->
  168. <view class="product-parameter" @click="showPopup(0)" v-if="!goodsData.isNoneDisabled">
  169. <text class="title">参数:</text> <text class="name">品牌 起订量 分类...</text>
  170. <text class="iconfont icon-xiayibu"></text>
  171. </view>
  172. <!-- 优惠券 -->
  173. <view
  174. class="product-parameter coupon"
  175. v-if="isShowButton && productCoupon.length > 0"
  176. @click="showPopup(2)"
  177. >
  178. <text class="title">优惠券:</text>
  179. <view class="coupon">
  180. <text class="tags" v-for="(coupon, index) in productCoupon.slice(0, 3)" :key="index">
  181. 满{{ coupon.touchPrice }}减{{ coupon.couponAmount }}
  182. </text>
  183. </view>
  184. <text class="iconfont icon-xiayibu"></text>
  185. </view>
  186. <!-- 仪器培训方案 -->
  187. <view
  188. class="product-parameter"
  189. @click="showPopup(1)"
  190. v-if="product.commodityType == 2 && product.trainingMethod"
  191. >
  192. <text class="title">培训方案:</text>
  193. <text class="name">{{ product.trainingMethod == 1 ? '线上培训' : '线下培训' }}</text>
  194. <text class="iconfont icon-xiayibu"></text>
  195. </view>
  196. <!-- 供应商 -->
  197. <view class="product-supplier" v-if="isNoneSupplier" @click="goSupplier">
  198. <view class="logo">
  199. <img :src="shop.logo? shop.logo: 'https://static.caimei365.com/app/img/icon/icon-shoplogo.png'"alt=""/></view>
  200. <view class="main">
  201. <view class="name">{{ shop.name }}</view>
  202. <view class="massgs">
  203. <view class="label">满意度:</view>
  204. <view class="p-stars">
  205. <uni-stars
  206. :stars="6"
  207. :iconClass="iconClass"
  208. :iconColor="iconColor"
  209. :fontSize="36"
  210. :widthInfo="176"
  211. ></uni-stars>
  212. </view>
  213. <view class="acount">
  214. <text>{{ shop.normalNum }}</text
  215. >件商品
  216. </view>
  217. </view>
  218. </view>
  219. <view class="right"><text class="iconfont icon-xiayibu"></text></view>
  220. </view>
  221. </view>
  222. <!-- 商品详情 -->
  223. <view v-show="tabCurrentIndex !== 3">
  224. <view class="product-details product-details0">
  225. <view class="title"> <view class="title-tab">商品详情</view> </view>
  226. <view class="content tui-banner product-rich-text tui-skeleton-rect">
  227. <parser
  228. :html="html"
  229. :img-mode="widthFix"
  230. v-if="!goodsData.isNoneDisabled && product.productDetail.detailInfo"
  231. ></parser>
  232. <view class="product-rich-text-none" v-else>暂无商品信息</view>
  233. </view>
  234. </view>
  235. <!-- 服务项目 -->
  236. <view class="product-details service product-details1">
  237. <view class="title"> <view class="title-tab">服务项目</view> </view>
  238. <view
  239. class="content service"
  240. v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo"
  241. >
  242. <cm-service :product="product.productDetail" v-if="isRequest"></cm-service>
  243. </view>
  244. <view class="content-none" v-else> <text>暂无服务项目</text> </view>
  245. </view>
  246. <!-- 相关推荐 -->
  247. <view class="product-details recommend product-details2">
  248. <view class="title"> <view class="title-tab">相关推荐</view> </view>
  249. <view class="content hot">
  250. <recommend
  251. :query-productid="product.productId"
  252. :query-type="product.recommendType"
  253. v-if="isRequest"
  254. ></recommend>
  255. </view>
  256. </view>
  257. </view>
  258. <!-- 相关资料 -->
  259. <view class="product-details recommend product-details3" v-show="tabCurrentIndex === 3">
  260. <cm-product-doc @previewImage="changePreViewImageStatus" :archiveId="product.archiveId" :userId='userId'></cm-product-doc>
  261. </view>
  262. <!-- 商品参数 -->
  263. <tui-bottom-popup :radius="true" :show="popupShow0" @close="hidePopup(0)">
  264. <view class="tui-popup-box clearfix">
  265. <view class="title">商品参数</view>
  266. <div class="tui-popup-main">
  267. <scroll-view class="tui-popup-scroll" scroll-y="true">
  268. <view class="content-tr">
  269. <view class="content-td">起订量</view>
  270. <view class="content-th">{{ product.minBuyNumber }}</view>
  271. </view>
  272. <view class="content-tr">
  273. <view class="content-td">品牌</view>
  274. <view class="content-th">{{
  275. product.brandName == null ? '其他' : product.brandName
  276. }}</view>
  277. </view>
  278. <view class="content-tr">
  279. <view class="content-td">分类</view>
  280. <view class="content-th">{{
  281. product.typeName == null ? '暂无' : product.typeName
  282. }}</view>
  283. </view>
  284. <view class="content-tr">
  285. <view class="content-td">包装规格</view>
  286. <view class="content-th">{{ product.unit }}</view>
  287. </view>
  288. <view class="content-tr">
  289. <view class="content-td">商品编码</view>
  290. <view class="content-th">{{ product.productCode }}</view>
  291. </view>
  292. <view class="content-tr">
  293. <view class="content-td">库存</view>
  294. <view class="content-th">{{ product.stock }}</view>
  295. </view>
  296. <view
  297. class="content-tr"
  298. v-if="product.parametersList.length > 0"
  299. v-for="(item, index) in product.parametersList"
  300. :key="index"
  301. >
  302. <view class="content-td">{{ item.paramsName }}</view>
  303. <view class="content-th">{{ item.paramsContent }}</view>
  304. </view>
  305. </scroll-view>
  306. </div>
  307. <view
  308. class="tui-right-flex tui-popup-btn"
  309. :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }"
  310. >
  311. <view class="tui-flex-1"> <view class="tui-button" @click="hidePopup(0)">收起</view> </view>
  312. </view>
  313. </view>
  314. </tui-bottom-popup>
  315. <!-- 优惠券 -->
  316. <tui-bottom-popup :radius="true" :show="popupShow2" @close="hidePopup(2)">
  317. <view class="tui-popup-box clearfix">
  318. <view class="title">优惠券</view>
  319. <view class="tui-popup-close" @click="hidePopup(2)">
  320. <text class="iconfont icon-iconfontguanbi"></text>
  321. </view>
  322. <view class="tui-popup-tabs">
  323. <coupon-tabs
  324. :tabs="navbar"
  325. :currentTab="currentTab > 2 ? 0 : currentTab"
  326. @change="couponChange"
  327. :itemWidth="100 / navbar.length + '%'"
  328. selectedColor="#e15616"
  329. sliderBgColor="#e15616"
  330. >
  331. </coupon-tabs>
  332. </view>
  333. <div class="tui-popup-main coupon">
  334. <scroll-view class="tui-popup-scroll" scroll-y="true">
  335. <view class="coupon-empty" v-if="isCouponEmpty">
  336. <image
  337. class="empty-container-image"
  338. :src="StaticUrl + '/icon/icon-coupon-empty@2x.png'"
  339. ></image>
  340. <text class="error-text">暂无可领的优惠券~</text>
  341. </view>
  342. <template v-else>
  343. <view
  344. v-for="(coupon, index) in productCouponList"
  345. :key="index"
  346. :id="coupon.couponId"
  347. class="coupon-list"
  348. >
  349. <view class="list-cell-le">
  350. <view class="coupon-maxMoney"
  351. ><text class="small">¥</text>{{ coupon.couponAmount }}</view
  352. >
  353. <view class="coupon-minMoney">满{{ coupon.touchPrice }}可用</view>
  354. </view>
  355. <view class="list-cell-ri">
  356. <view class="list-cell-top">
  357. <view class="list-cell-type">
  358. <view class="list-cell-tags">
  359. <text class="tags">{{ coupon.couponType | TypeFormat }}</text>
  360. </view>
  361. <view class="list-cell-texts">
  362. <text v-if="coupon.couponType == 0">
  363. {{
  364. coupon.productType && coupon.productType == 1
  365. ? '全商城商品通用'
  366. : '仅可购买指定商品'
  367. }}
  368. </text>
  369. <text v-if="coupon.couponType == 1">
  370. {{
  371. coupon.categoryType == 1
  372. ? '仅限购买产品类商品'
  373. : '仅限购买仪器类商品'
  374. }}
  375. </text>
  376. <text v-if="coupon.couponType == 3"
  377. >仅限购买店铺【{{ coupon.shopName }}】的商品</text
  378. >
  379. <text v-if="coupon.couponType == 4 || coupon.couponType == 2"
  380. >全商城商品通用</text
  381. >
  382. </view>
  383. </view>
  384. <view class="list-cell-btn">
  385. <view class="icon-used">
  386. <view
  387. class="icon-used-btn receive"
  388. v-if="currentTab == 0"
  389. @click="receiveCoupon(coupon)"
  390. >领取</view
  391. >
  392. <view class="icon-used-btn make" v-if="currentTab == 1"
  393. >已领取</view
  394. >
  395. </view>
  396. </view>
  397. </view>
  398. <view class="list-cell-time"
  399. >{{ coupon.startDate }} - {{ coupon.endDate }}</view
  400. >
  401. </view>
  402. </view>
  403. </template>
  404. </scroll-view>
  405. </div>
  406. </view>
  407. </tui-bottom-popup>
  408. <!-- 培训方案 -->
  409. <tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
  410. <view class="tui-popup-box clearfix">
  411. <view class="title">培训方案</view>
  412. <div class="tui-popup-main">
  413. <scroll-view class="tui-popup-scroll train" scroll-y="true">
  414. <view class="content-tr">
  415. <view class="content-td">培训方式:</view>
  416. <view class="content-th">{{
  417. product.trainingMethod == 1 ? '线上培训' : '线下培训'
  418. }}</view>
  419. </view>
  420. <view class="content-tr">
  421. <view class="content-td">培训费用:</view>
  422. <view class="content-th">{{
  423. product.trainingType == 1 ? '¥' + product.trainingFee : '售价已包含'
  424. }}</view>
  425. </view>
  426. </scroll-view>
  427. </div>
  428. <view
  429. class="tui-right-flex tui-popup-btn"
  430. :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }"
  431. >
  432. <view class="tui-flex-1"> <view class="tui-button" @click="hidePopup(1)">收起</view> </view>
  433. </view>
  434. </view>
  435. </tui-bottom-popup>
  436. <!-- 底部按钮 -->
  437. <view class="menu" v-if="isShowButton">
  438. <view class="bottom-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  439. <view class="bottom-le">
  440. <view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">
  441. <image src="../../static/icon-home-active@3x.png"></image> <text>首页</text>
  442. </view>
  443. <button class="item-bt" open-type="contact" @click="handleContact">
  444. <image src="../../static/severs@3x.png"></image> <text>客服</text>
  445. </button>
  446. <view class="item-bt" @click="buyProductCart()">
  447. <image src="https://static.caimei365.com/app/img/icon/icon-cart-active@3x.png"></image>
  448. <text>购物车</text>
  449. <text
  450. v-if="hasLogin && bottomCartNumber > 0"
  451. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  452. :class="[bottomCartNumber < 10 ? 'goleft' : '']"
  453. >
  454. {{ bottomCartNumber >= 100 ? '99+' : bottomCartNumber }}
  455. </text>
  456. <view class="animation-num" :class="isAnimation ? 'animation' : 'restion'">+1</view>
  457. </view>
  458. </view>
  459. <view class="bottom-ri">
  460. <button
  461. :disabled="goodsData.disabled"
  462. class="btn btn-cart"
  463. :class="[goodsData.disabled ? 'disabled' : '']"
  464. @tap.stop="btnGetConfirm('add')"
  465. >
  466. 加入购物车
  467. </button>
  468. <button
  469. :disabled="goodsData.disabled"
  470. class="btn btn-bay"
  471. :class="[goodsData.disabled ? 'disabled' : '']"
  472. @tap.stop="btnGetConfirm('buy')"
  473. >
  474. 立即购买
  475. </button>
  476. </view>
  477. </view>
  478. </view>
  479. <!--底部选择模态层弹窗组件 -->
  480. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" @tap="hideSpec">
  481. <!-- 遮罩层 -->
  482. <view class="mask"></view>
  483. <view
  484. class="layer"
  485. @tap.stop="discard"
  486. :style="{
  487. paddingBottom: isIphoneX ? '68rpx' : '36rpx',
  488. bottom: isIphoneX ? '-352rpx' : '-296rpx'
  489. }"
  490. >
  491. <view class="content">
  492. <view class="layer-smimg"> <image :src="product.mainImage" mode=""></image> </view>
  493. <view class="layer-nunbox">
  494. <view class="layer-nunbox-t" v-if="product.step === 2">
  495. <view class="text">*该商品只能以起订量的整数倍购买</view>
  496. </view>
  497. <view class="layer-nunbox-t">
  498. <view class="layer-nunbox-text">数量:</view>
  499. <view class="number-box">
  500. <view
  501. class="iconfont icon-jianhao"
  502. :class="[isQuantity == true ? 'disabled' : '']"
  503. @click="changeCountSub()"
  504. ></view>
  505. <input
  506. class="btn-input"
  507. type="number"
  508. v-model="number"
  509. maxlength="4"
  510. @blur="changeNumber($event)"
  511. />
  512. <view
  513. class="iconfont icon-jiahao"
  514. :class="[isStock == true ? 'disabled' : '']"
  515. @click="changeCountAdd()"
  516. ></view>
  517. </view>
  518. </view>
  519. <view class="layer-nunbox-b">
  520. <view class="text"
  521. >单价: <text class="p sm">¥</text>
  522. <text class="p bg">{{ buyRetailPrice.toFixed(2) }}</text>
  523. </view>
  524. </view>
  525. </view>
  526. </view>
  527. <view class="btn"><view class="button" @click.stop="btnConfirm">确定</view></view>
  528. </view>
  529. </view>
  530. <!-- 侧边 -->
  531. <scroll-top :isScrollTop="isScrollTop" :bottom="200" v-show="tabCurrentIndex !== 3"></scroll-top>
  532. </view>
  533. </template>
  534. </view>
  535. </template>
  536. <script>
  537. import { mapState,mapMutations } from 'vuex'
  538. import customP from '@/components/cm-module/headerNavbar/header-poduct' //自定义导航
  539. import cmPrice from "@/components/cm-module/productDetails/cm-price.vue" //价格显示
  540. import cmAttributes from "@/components/cm-module/productDetails/cm-attributes.vue" //规格信息
  541. import parser from "@/components/jyf-Parser/index" //富文本处理
  542. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  543. import recommend from "@/components/cm-module/productDetails/recommend" //相关推荐
  544. import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
  545. import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
  546. import couponTabs from '@/components/cm-module/coupon/tui-tabs.vue'
  547. import authorize from '@/common/config/authorize.js'
  548. import wxLogin from "@/common/config/wxLogin.js"
  549. import { debounce } from '@/common/config/common.js'
  550. var isPreviewImg;
  551. export default{
  552. components:{
  553. customP,
  554. parser,
  555. tuiSkeleton,
  556. recommend,
  557. cmPrice,
  558. cmAttributes,
  559. cmParameter,
  560. cmService,
  561. couponTabs
  562. },
  563. data(){
  564. return{
  565. StaticUrl:this.$Static, //静态图片路径
  566. clickPath:'/pages/search/search',
  567. html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
  568. productNoneImage:'https://static.caimei365.com/app/img/icon/icon-pnone.png',
  569. mode:'round',
  570. iconClass:'icon-aixin',
  571. iconColor:'#ff9100',
  572. specClass: '', // 规格弹窗css类,控制开关动画
  573. isBtnType:'',
  574. isRequest:false,
  575. isScrollTop:false,
  576. current:0,
  577. shopId:0,
  578. isShareType:'',
  579. isHeaderPoduct:false,
  580. isNavbarFiexd:false,
  581. navbarFiexd:'none',
  582. ladderPriceFlag:'',
  583. ladderPriceList:'',
  584. isInvalid:false,
  585. isEvaluate:false,
  586. isAnimation:false,
  587. skeletonShow:true,
  588. isQuantity:false,
  589. isStock:false,
  590. disabled:false,
  591. isNoneDisabled:false,
  592. tabCurrentIndex:0,
  593. userId:'',
  594. shopID:'',
  595. productId:0,
  596. userIdentity:0, // 用户类型
  597. goodsData:{}, // 自定义数据
  598. shop:{},//供应商信息
  599. product:{},//采美
  600. productImage:[],
  601. retailPrice:0,
  602. buyRetailPrice:0,
  603. buyRetailPriceStep:1,
  604. stock:0,
  605. number:0,
  606. minBuyNumber:0,
  607. productsList:[],
  608. goodListData:[],
  609. productCoupon:[], // 优惠券
  610. productCouponList:[], // 优惠券弹窗列表
  611. headerBtnPosi: this.setHeaderBtnPosi(), // 获取设备顶部胶囊高度
  612. systeminfo: this.setSysteminfo(), // 获取设备信息
  613. isIphoneX:this.$store.state.isIphoneX,
  614. windowHeight: '',
  615. headerColor:false,
  616. backPage:1,
  617. nvabarData: { // 顶部自定义导航
  618. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  619. title: '' // 导航栏 中间的标题
  620. },
  621. linkPath:'',
  622. CustomBar:this.CustomBar, // 顶部导航栏高度
  623. popupShow0:false, // 参数弹窗
  624. popupShow1:false, // 培训方案
  625. popupShow2:false, // 优惠券
  626. tabSelectFlag:false,
  627. sectionPropsArr: [],
  628. scrollTopArray:[],
  629. sectionTopRangeArr: [],
  630. winHeight:'',
  631. isShowButton:true,
  632. isNoneSupplier:false,
  633. isCouponEmpty:false,
  634. currentTab: 0,
  635. couponParam:{ // 获取弹窗优惠券领取参数
  636. userId:0,
  637. productId:0,
  638. status:1,
  639. source:2
  640. },
  641. bottomCartNumber:0,
  642. navbar: [
  643. { name: "未领取",num:0 },
  644. { name: "已领取",num:0 }
  645. ]
  646. }
  647. },
  648. computed: {
  649. ...mapState(['hasLogin','isWxAuthorize','identity'])
  650. },
  651. filters: {
  652. TypeFormat(value) {
  653. switch (value) {
  654. case 0:
  655. return '活动券';
  656. break;
  657. case 1:
  658. return '品类券';
  659. break;
  660. case 2:
  661. return '用户专享券';
  662. break;
  663. case 3:
  664. return '店铺券';
  665. break;
  666. case 4:
  667. return '新用户券';
  668. break;
  669. }
  670. },
  671. },
  672. onLoad(option) {
  673. this.productId = this.couponParam.productId = option.id;//获取商品ID
  674. this.isShareType = option.type
  675. this.linkPath = option.path
  676. this.isHeaderPoduct = true
  677. if(option.page == 2){
  678. this.backPage = option.page
  679. }
  680. if(this.isShareType =='share'){
  681. wxLogin.wxLoginAuthorize()
  682. }
  683. this.getWinHeight()
  684. },
  685. methods:{
  686. initData(){// 初始化商品详情查询
  687. this.ProductService.QueryProductDetils(
  688. {
  689. userId:this.userId,
  690. productId:this.productId,
  691. identity:this.identity,
  692. }
  693. )
  694. .then(response =>{
  695. this.skeletonShow = false
  696. this.productImage=[];
  697. this.shop = response.data.shop
  698. this.shopId = response.data.shopID
  699. this.product = response.data
  700. //已删除/已冻结
  701. if(this.product.validFlag === 0 || this.product.validFlag ==10){
  702. this.isInvalid = true
  703. }else if(this.product.validFlag === 9){
  704. if(this.userIdentity == 1){
  705. this.isInvalid = false
  706. }else{
  707. this.isInvalid = true
  708. }
  709. }
  710. this.ladderPriceFlag = this.product.ladderPriceFlag;
  711. this.html = this.product.productDetail == null ? this.html : this.$api.adaptRichTextImg(this.product.productDetail.detailInfo)
  712. this.stock = this.product.stock
  713. this.buyRetailPriceStep = this.product.step
  714. this.number = this.product.minBuyNumber
  715. this.minBuyNumber = this.product.minBuyNumber
  716. //处理商品图片列表
  717. this.product.imageList.forEach(item =>{
  718. this.productImage.push(item.image);
  719. })
  720. //处理阶梯价格
  721. if(this.product.ladderPriceList!=null){
  722. this.ladderPriceList = this.product.ladderPriceList;
  723. }
  724. //拆分金额并转千分位格式显示
  725. if(this.product.price!=null){
  726. this.retailPrice = this.product.price.toFixed(2);
  727. this.buyRetailPrice = this.product.price;
  728. }
  729. //处理下架商品和售罄商品
  730. if(this.product.validFlag ==3 || this.stock == 0){
  731. this.isNoneDisabled = true
  732. this.disabled = true
  733. }else{
  734. this.disabled = false
  735. this.isNoneDisabled = false
  736. this.goodsData.disabledText = ''
  737. }
  738. if(this.product.priceFlag == 1){
  739. this.disabled = true
  740. }else if(this.product.priceFlag == 2){
  741. if(this.userIdentity == 4){
  742. this.disabled = true
  743. }else{
  744. this.disabled = false
  745. }
  746. }else{
  747. this.disabled = false
  748. }
  749. this.goodsData.disabled = this.disabled
  750. this.goodsData.isNoneDisabled = this.isNoneDisabled
  751. if(this.product.validFlag ==3){
  752. this.goodsData.disabledText = '下架'
  753. }
  754. if(this.product.validFlag ==10){
  755. this.goodsData.disabledText = '停售'
  756. }
  757. if(this.stock == 0){
  758. this.goodsData.disabledText = '售罄'
  759. }
  760. console.log(this.disabled);
  761. setTimeout(()=>{
  762. this.getSectionProps();
  763. },2000)
  764. this.shoppingHeaderCartNumber()
  765. this.queryProductDetilsCoupons()
  766. this.isRequest = true
  767. })
  768. .catch(error =>{
  769. this.$util.msg(error.msg,2000);
  770. })
  771. },
  772. queryProductDetilsCoupons(){// 初始化商品详情优惠券信息
  773. this.ProductService.QueryProductDetilsCoupons(this.couponParam).then(response =>{
  774. this.productCoupon = response.data.list
  775. })
  776. .catch(error =>{
  777. console.log('获取优惠券列表失败')
  778. })
  779. },
  780. queryPopupCoupons(){// 获取弹窗优惠券列表
  781. this.ProductService.QueryProductDetilsCoupons(this.couponParam).then(response =>{
  782. let data = response.data
  783. this.navbar[0].num = data.notCouponNum
  784. this.navbar[1].num = data.couponNum
  785. if(data.couponList && data.couponList.length >0){
  786. this.productCouponList = data.couponList
  787. this.isCouponEmpty = false
  788. }else{
  789. this.isCouponEmpty = true
  790. }
  791. })
  792. .catch(error =>{
  793. console.log('获取优惠券列表失败')
  794. })
  795. },
  796. shoppingHeaderCartNumber(){// 获取用户购物车储量
  797. this.ProductService.shoppingHeaderCartNumber({userId:this.userId}).then(response =>{
  798. this.bottomCartNumber = response.data.length;
  799. })
  800. .catch(error =>{
  801. console.log('获取购物车数量失败')
  802. })
  803. },
  804. receiveCoupon(coupon){// 点击优惠券领取按钮
  805. this.ProductService.ReceiveCoupon(
  806. {
  807. userId:this.couponParam.userId,
  808. couponId:coupon.couponId,
  809. source:2
  810. }
  811. )
  812. .then(response =>{
  813. this.$util.msg('领取成功',1500,true,'success')
  814. setTimeout(()=>{
  815. this.currentTab = 1
  816. this.couponParam.status = 2
  817. this.queryPopupCoupons()
  818. },1500)
  819. })
  820. .catch(error =>{
  821. this.$util.msg(error.msg,2000);
  822. })
  823. },
  824. swiperChange(e) {//顶部商品图片切换
  825. const index = e.detail.current;
  826. this.current = index;
  827. },
  828. previewImg (index) {//顶部商品图片预览
  829. isPreviewImg = true
  830. let previewUrls = this.productImage
  831. uni.previewImage({
  832. current: index, //图片索引
  833. urls: previewUrls, //必须是http图片,本地图片无效
  834. longPressActions:''
  835. })
  836. },
  837. tabClick(index) {//商品详情&&供应商信息tab切换
  838. this.tabSelectFlag = true
  839. this.tabCurrentIndex = index;
  840. let classIndex = '.product-details'+index;
  841. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  842.   uni.createSelectorQuery().select(classIndex).boundingClientRect((res)=>{//最外层盒子节点
  843.     uni.pageScrollTo({
  844.       duration:300,//过渡时间必须为0,uniapp bug,否则运行到手机会报错
  845.       scrollTop:res.top - data.top - 150,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
  846.     })
  847. setTimeout(()=>{
  848. this.tabSelectFlag = false;
  849. },500)
  850.   }).exec()
  851. }).exec()
  852. },
  853. handleContact(e){//跳转小程序客服
  854. console.log(e.detail.path)
  855. console.log(e.detail.query)
  856. },
  857. buyProductCart(){//底部购物车按钮点击
  858. if(this.hasLogin){
  859. // 友盟埋点商品详情购物车入口点击事件
  860. if(process.env.NODE_ENV != 'development'){
  861. this.$uma.trackEvent('Um_Event_ProductShoppingCart', {
  862. Um_Key_PageName: '去购物车',
  863. Um_Key_SourcePage: '商品详情购物车入口',
  864. })
  865. }
  866. // this.$api.navigateTo('/pages/goods/cart')
  867. this.$api.navigateTo('/pages/goods/cart-index')
  868. }else{
  869. this.$api.navigateTo('/pages/login/login?type=1')
  870. }
  871. },
  872. btnGetConfirm(type){//加入购物车&&立即购买点击
  873. if(this.hasLogin){
  874. switch(type){
  875. case 'add':
  876. // 友盟埋点商品详情加入购物车点击事件
  877. if(process.env.NODE_ENV != 'development'){
  878. this.$uma.trackEvent('Um_Event_ProductAddCart', {
  879. Um_Key_PageName: '加入购物车',
  880. Um_Key_SourcePage: '商品详情',
  881. Um_Key_ProductID:`${this.product.productId}`
  882. })
  883. }
  884. break;
  885. case 'buy':
  886. // 友盟埋点商品详情立即购买点击事件
  887. if(process.env.NODE_ENV != 'development'){
  888. this.$uma.trackEvent('Um_Event_ProductBuyConfirm', {
  889. Um_Key_PageName: '立即购买',
  890. Um_Key_SourcePage: '商品详情',
  891. Um_Key_ProductID:`${this.product.productId}`
  892. })
  893. }
  894. break;
  895. }
  896. this.showSpec(type);
  897. }else{
  898. this.$api.navigateTo('/pages/login/login?type=1')
  899. }
  900. },
  901. changeCountAdd(){//popup弹窗数量增加按钮
  902. if(this.buyRetailPriceStep == 2){
  903. this.number+=this.minBuyNumber
  904. }else{
  905. this.number++
  906. }
  907. this.processActivityPrice()
  908. },
  909. changeCountSub(){//popup弹窗数量减按钮
  910. if(this.number<=this.minBuyNumber){
  911. this.number= this.minBuyNumber
  912. this.isQuantity =true
  913. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  914. return
  915. }else{
  916. if(this.buyRetailPriceStep == 2){
  917. this.number-=this.minBuyNumber
  918. }else{
  919. this.number--
  920. }
  921. this.processActivityPrice()
  922. this.isQuantity =false
  923. }
  924. },
  925. changeNumber(e){
  926. let _value = e.detail.value;
  927. if(!this.$api.isNumber(_value)){
  928. this.number = this.minBuyNumber
  929. }else if(_value < this.minBuyNumber){
  930. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  931. this.number = this.minBuyNumber
  932. }else if( _value % this.minBuyNumber !=0 ){
  933. this.$util.msg(`购买量必须为起订量的整数倍`,2000);
  934. this.number = this.minBuyNumber
  935. }else{
  936. this.number = e.detail.value
  937. }
  938. this.processActivityPrice()
  939. },
  940. processActivityPrice(){//单独处理活动价格和阶梯价格
  941. if(this.ladderPriceFlag == '0' && this.product.actStatus == 0 || this.product.actStatus == 1){
  942. this.buyRetailPrice = this.product.price
  943. }else{
  944. this.ladderPriceList.forEach((item,index)=>{
  945. if(this.number>=item.buyNum){
  946. this.buyRetailPrice = item.buyPrice
  947. }
  948. })
  949. }
  950. },
  951. showSpec(type) {//显示选择数量确认弹窗
  952. this.isBtnType = type
  953. this.specClass = 'show';
  954. if (this.ladderPriceFlag) {
  955. this.processActivityPrice()
  956. }
  957. },
  958. hideSpec() {//关闭选择数量确认弹窗
  959. this.specClass = 'hide';
  960. setTimeout(() => {
  961. this.specClass = 'none';
  962. }, 200);
  963. },
  964. btnConfirm() {//加入购物车&&立即购买跳转订单页并关闭弹窗
  965. // 友盟埋点商品详情确认购买商品点击事件
  966. if(process.env.NODE_ENV != 'development'){
  967. this.$uma.trackEvent('Um_Event_ProductShoppingConfirm', {
  968. Um_Key_PageName: '商品购买确认',
  969. Um_Key_SourcePage: '商品详情',
  970. Um_Key_ProductID:`${this.product.productId}`
  971. })
  972. }
  973. if(this.isBtnType == 'add'){
  974. this.getAddProductCart()
  975. }else{
  976. this.toConfirmation()
  977. }
  978. },
  979. toConfirmation(){//跳转确认订单页面
  980. this.specClass = 'hide';
  981. let productStp ={
  982. allPrice:this.number*this.buyRetailPrice,
  983. allCount:this.number,
  984. productID:this.product.productId,
  985. productCount:this.number
  986. }
  987. this.$api.navigateTo(`/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({data:productStp})}`)
  988. setTimeout(() => {
  989. this.specClass = 'none';
  990. }, 200);
  991. },
  992. getAddProductCart(){//增加购物车成功和toast弹窗提示成功
  993. this.ProductService.shoppingAddCart({productID:this.productId,userID:this.userId,productCount:this.number}).then(response => {
  994. this.specClass = 'hide';
  995. this.$util.msg('加入购物车成功',1500,true,'success')
  996. this.isAnimation = true
  997. setTimeout(() => {this.specClass = 'none'}, 200)
  998. setTimeout(() => {this.isAnimation = false},2000)
  999. this.bottomCartNumber = response.data;
  1000. }).catch(error =>{
  1001. this.$util.msg(error.msg,2000);
  1002. })
  1003. },
  1004. setHeaderBtnPosi(){
  1005. // 获得胶囊按钮位置信息
  1006. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  1007. return headerBtnPosi
  1008. },
  1009. setSysteminfo(){
  1010. let systeminfo;
  1011. uni.getSystemInfo({ // 获取设备信息
  1012. success: (res) => {
  1013. systeminfo = res
  1014. },
  1015. })
  1016. return systeminfo
  1017. },
  1018. goIndex(){//商城首页
  1019. uni.switchTab({
  1020. url: '/pages/tabBar/home/index'
  1021. });
  1022. },
  1023. goSupplier(){//跳供应商资料页
  1024. this.$api.navigateTo('/pages/supplier/user/my-shop?shopId='+this.shopId)
  1025. },
  1026. discard(){
  1027. //丢弃
  1028. },
  1029. onShare(res){//分享转发
  1030. if (res.from === 'button') {
  1031. // 来自页面内转发按钮
  1032. }
  1033. return {
  1034. title: `${this.product.name}`,
  1035. path: `pages/goods/product?type=share&id=${this.productId}`,
  1036. imageUrl:`${this.productImage[0]}`
  1037. }
  1038. },
  1039. showPopup(index){
  1040. switch(index){
  1041. case 0:
  1042. this.popupShow0 = true
  1043. break;
  1044. case 1:
  1045. this.popupShow1 = true
  1046. break;
  1047. case 2:
  1048. if(this.hasLogin){
  1049. this.queryPopupCoupons()
  1050. this.popupShow2 = true
  1051. }else{
  1052. this.$api.navigateTo('/pages/login/login')
  1053. }
  1054. break;
  1055. }
  1056. },
  1057. hidePopup(index){
  1058. switch(index){
  1059. case 0:
  1060. this.popupShow0 = false
  1061. break;
  1062. case 1:
  1063. this.popupShow1 = false
  1064. break;
  1065. case 2:
  1066. this.popupShow2 = false
  1067. break;
  1068. }
  1069. },
  1070. couponChange(e) {
  1071. this.currentTab = e.index
  1072. switch(this.currentTab){
  1073. case 0:
  1074. this.couponParam.status = 1
  1075. this.queryPopupCoupons()
  1076. break;
  1077. case 1:
  1078. this.couponParam.status = 2
  1079. this.queryPopupCoupons()
  1080. break;
  1081. }
  1082. },
  1083. getSectionProps() {//获取每个tab对应区域的scrollTop值
  1084. let className = '.product-details',
  1085. sectionPropsArr = [];
  1086. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  1087.   uni.createSelectorQuery().selectAll(className).boundingClientRect((res)=>{//最外层盒子节点
  1088. res.forEach((item, index) => {
  1089. sectionPropsArr.push({
  1090. className: `${className}${index}`,
  1091. scrollTop: item.top - data.top - 150
  1092. })
  1093. })
  1094. this.sectionPropsArr = sectionPropsArr;
  1095. this.sectionTopRangeArr = this.getSectionRange(sectionPropsArr);
  1096.   }).exec()
  1097. }).exec()
  1098. },
  1099. getSectionRange(arr) {// 获取每个tab对应区域的区间
  1100. let sectionScrollTopList = [];
  1101. for(let i = 0; i < arr.length; i++) {
  1102. let thisScrollTop = arr[i].scrollTop;
  1103. if(i < arr.length - 1) {
  1104. let nextScrollTop = arr[i+1].scrollTop;
  1105. if(i == 0) {
  1106. sectionScrollTopList.push(`0-${thisScrollTop}`);
  1107. } else if(i == arr.length - 1){
  1108. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop - this.winHeight}`);
  1109. } else {
  1110. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop}`);
  1111. }
  1112. } else {
  1113. sectionScrollTopList.push(`${thisScrollTop}-${thisScrollTop+500}`);
  1114. }
  1115. }
  1116. return sectionScrollTopList;
  1117. },
  1118. activeTab: debounce((top, _this)=> {//当滑动时也能同步激活tab
  1119. const { sectionTopRangeArr } = _this;
  1120. if(sectionTopRangeArr.length > 0) {
  1121. sectionTopRangeArr.forEach((item, index) => {
  1122. let splitItem = item.split('-'),
  1123. openInterval = Number(splitItem[0]),
  1124. closedInterval = Number(splitItem[1]);
  1125. if(top >= openInterval && top < closedInterval) {
  1126. _this.tabCurrentIndex = index;
  1127. }
  1128. })
  1129. }
  1130. },100, true),
  1131. getWinHeight() {
  1132. this.winHeight = wx.getSystemInfoSync().windowHeight;
  1133. },
  1134. },
  1135. onPageScroll(e){//实时获取到滚动的值
  1136. const { scrollTop } = e;
  1137. if(!this.tabSelectFlag) {
  1138. this.activeTab(scrollTop, this);
  1139. }
  1140. if(e.scrollTop>60){
  1141. this.headerColor = true
  1142. this.navbarFiexd = 'fixed'
  1143. this.isNavbarFiexd = true
  1144. this.nvabarData={
  1145. showCapsule: 1,
  1146. title: '商品详情',
  1147. }
  1148. }else{
  1149. this.headerColor = false
  1150. this.isNavbarFiexd = false
  1151. this.navbarFiexd = 'none'
  1152. this.nvabarData={
  1153. showCapsule: 1,
  1154. title: '',
  1155. }
  1156. }
  1157. if(e.scrollTop>700){
  1158. this.isScrollTop = true
  1159. }else{
  1160. this.isScrollTop = false
  1161. }
  1162. },
  1163. onShareAppMessage(res){//分享转发
  1164. if (res.from === 'button') {
  1165. // 来自页面内转发按钮
  1166. }
  1167. return {
  1168. title: `${this.product.name}`,
  1169. path: `pages/goods/product?type=share&id=${this.productId}`,
  1170. imageUrl:`${this.productImage[0]}`
  1171. }
  1172. },
  1173. onShow() {
  1174. this.$api.getStorage().then((resolve) => {
  1175. this.userId = this.couponParam.userId = resolve.userId ? resolve.userId : '';
  1176. this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
  1177. this.shopID = resolve.shopId ? resolve.shopId : '';
  1178. if(this.userIdentity == 0 || this.userIdentity == 2 || this.userIdentity == 4){
  1179. this.isShowButton = true
  1180. }else{
  1181. this.isShowButton = false
  1182. }
  1183. if (isPreviewImg) {
  1184. isPreviewImg = false;
  1185. return;
  1186. } else {
  1187. this.initData();
  1188. }
  1189. }).catch(error =>{
  1190. this.initData();
  1191. })
  1192. }
  1193. }
  1194. </script>
  1195. <style lang="scss">
  1196. page{
  1197. background-color: #FFFFFF;
  1198. }
  1199. .banner-section{
  1200. width: 100%;
  1201. height: 750rpx;
  1202. position: relative;
  1203. }
  1204. .banner{
  1205. width: 100%;
  1206. height: 750rpx;
  1207. .product-img{
  1208. width: 750rpx;
  1209. }
  1210. image {
  1211. width: 100%;
  1212. height: 100%;
  1213. }
  1214. .banner-item{
  1215. position: relative;
  1216. .cm-product-cover{
  1217. position: absolute;
  1218. right: 30rpx;
  1219. top: 30rpx;
  1220. width: 147rpx;
  1221. height: 57rpx;
  1222. line-height: 57rpx;
  1223. font-size: 24rpx;
  1224. color: #fff;
  1225. text-align: center;
  1226. background: url(https://static.caimei365.com/app/img/icon2/cm_cover_bg_app.png) no-repeat center;
  1227. background-size: 147rpx;
  1228. }
  1229. }
  1230. }
  1231. .swiper__dots-box{
  1232. position: absolute;
  1233. color: #fff;
  1234. bottom: 30rpx;
  1235. right: 0;
  1236. }
  1237. .product-wrap{
  1238. width: 100%;
  1239. height: auto;
  1240. padding: 24rpx 0 0 0;
  1241. background-color: #FFFFFF;
  1242. border-bottom: 20rpx solid #F7F7F7;
  1243. .productRemarks{
  1244. height: 48rpx;
  1245. width: 100%;
  1246. float: left;
  1247. line-height: 48rpx;
  1248. font-size: 24rpx;
  1249. color: #999999;
  1250. text-align: left;
  1251. }
  1252. .wrap-top{
  1253. width: 702rpx;
  1254. padding: 0 24rpx;
  1255. height: auto;
  1256. float: left;
  1257. padding-bottom:20rpx;
  1258. border-bottom: 1px solid #F8F8F8;
  1259. &.none{
  1260. .p-title{
  1261. color:#999999
  1262. }
  1263. }
  1264. .p-title{
  1265. width: 100%;
  1266. height: auto;
  1267. float: left;
  1268. position: relative;
  1269. .p-title-name{
  1270. width:602rpx;
  1271. height: auto;
  1272. float: left;
  1273. line-height:48rpx;
  1274. font-size: $font-size-28;
  1275. color: $text-color;
  1276. -o-text-overflow: ellipsis;
  1277. text-overflow: ellipsis;
  1278. display: -webkit-box;
  1279. word-break: break-all;
  1280. -webkit-box-orient: vertical;
  1281. -webkit-line-clamp: 2;
  1282. overflow: hidden;
  1283. &.indent{
  1284. text-indent: 95rpx;
  1285. }
  1286. }
  1287. .mclap-tag{
  1288. display: block;
  1289. width: 84rpx;
  1290. height: 32rpx;
  1291. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  1292. border-radius: 4rpx 48rpx 4px 4px;
  1293. line-height: 32rpx;
  1294. font-size: $font-size-22;
  1295. color: #FFFFFF;
  1296. text-align: center;
  1297. position: absolute;
  1298. left: 0;
  1299. top: 6rpx;
  1300. }
  1301. .p-title-share{
  1302. width: 96rpx;
  1303. height: 96rpx;
  1304. position: absolute;
  1305. right: 0;
  1306. text-align: center;
  1307. color: #999999;
  1308. font-size: $font-size-24;
  1309. box-sizing: border-box;
  1310. display: block;
  1311. background: transparent;
  1312. border-radius: 0;
  1313. border: 0;
  1314. margin: 0;
  1315. padding: 8rpx 0;
  1316. z-index: 990;
  1317. .icon-fenxiang1{
  1318. font-size: $font-size-34;
  1319. }
  1320. }
  1321. .tui-share-btn::after {
  1322. border: 0;
  1323. }
  1324. }
  1325. .wrap-main-text{
  1326. line-height: 56rpx;
  1327. color: #FF2A2A;
  1328. font-size: $font-size-26;
  1329. display: block;
  1330. float: left;
  1331. font-weight: normal;
  1332. }
  1333. .wrap-main-none{
  1334. display: block;
  1335. width: 256rpx;
  1336. height: 44rpx;
  1337. padding-left: 20rpx;
  1338. border-radius: 11rpx;
  1339. background: $btn-confirm;
  1340. float: right;
  1341. line-height: 44rpx;
  1342. color: #FFFFFF;
  1343. text-align: center;
  1344. font-size: $font-size-24;
  1345. }
  1346. .p-price-none{
  1347. height: 44rpx;
  1348. line-height: 44rpx;
  1349. float: left;
  1350. font-size: $font-size-24;
  1351. color: #666;
  1352. text-decoration: line-through;
  1353. margin-left: 8rpx;
  1354. }
  1355. .p-minBuy{
  1356. height: 44rpx;
  1357. line-height: 44rpx;
  1358. float: right;
  1359. padding: 0 18rpx;
  1360. border-radius: 22rpx;
  1361. background-color: #f7f7f7;
  1362. color: #7F7F7F;
  1363. font-size: 24rpx;
  1364. text-align: center;
  1365. .min-text{
  1366. margin: 0 6rpx;
  1367. }
  1368. }
  1369. .p-login{
  1370. height: 56rpx;
  1371. line-height: 56rpx;
  1372. color: $color-system;
  1373. font-size: $font-size-24;
  1374. &.grade{
  1375. .price-left{
  1376. float: left;
  1377. .none{
  1378. display: block;
  1379. font-size: $font-size-20;
  1380. line-height: 48rpx;
  1381. color: #4A4B54;
  1382. float: left;
  1383. font-weight: bold;
  1384. margin-left: 5rpx;
  1385. text{
  1386. letter-spacing: 4rpx;
  1387. font-size: $font-size-32;
  1388. }
  1389. }
  1390. }
  1391. }
  1392. .p-no{
  1393. float: left;
  1394. margin-right: 5rpx;
  1395. font-size: $font-size-28;
  1396. color: $text-color;
  1397. }
  1398. .p-login-btn{
  1399. display: block;
  1400. height: 44rpx;
  1401. padding: 0 10rpx 0 20rpx;
  1402. border-radius: 11rpx;
  1403. background: $btn-confirm;
  1404. float: right;
  1405. line-height: 44rpx;
  1406. color: #FFFFFF;
  1407. text-align: center;
  1408. font-size: $font-size-24;
  1409. }
  1410. }
  1411. }
  1412. .wrap-label{
  1413. float: left;
  1414. width: 100%;
  1415. box-sizing: border-box;
  1416. .label-a{
  1417. padding: 0 18rpx;
  1418. line-height: 32rpx;
  1419. font-size: $font-size-20;
  1420. color:$color-system;
  1421. text-align: center;
  1422. border-radius: 6rpx;
  1423. background:#ffe6dc;
  1424. margin: 0 20rpx 15rpx 0;
  1425. display: inline-block;
  1426. }
  1427. }
  1428. .wrap-top-price{
  1429. float: left;
  1430. width: 100%;
  1431. box-sizing: border-box;
  1432. .wrap-main-item{
  1433. width: 100%;
  1434. height: 56rpx;
  1435. .p-price{
  1436. height: 56rpx;
  1437. line-height: 56rpx;
  1438. float: left;
  1439. color: #FF2A2A;
  1440. font-weight: bold;
  1441. &.none{
  1442. text-decoration: line-through;
  1443. color: #999999;
  1444. font-weight: normal;
  1445. }
  1446. .txt{
  1447. margin:0 2rpx;
  1448. }
  1449. .txt.sm{
  1450. font-size: $font-size-26;
  1451. }
  1452. .txt.big{
  1453. font-size: $font-size-34;
  1454. }
  1455. }
  1456. }
  1457. .floor-item-act{
  1458. height: 56rpx;
  1459. text-align: center;
  1460. box-sizing: border-box;
  1461. float: left;
  1462. padding:10rpx 0;
  1463. margin-left: 10rpx;
  1464. .floor-tags{
  1465. float: right;
  1466. height: 28rpx;
  1467. border-radius: 6rpx;
  1468. background-color: #FFFFFF;
  1469. line-height: 28rpx;
  1470. color: $color-system;
  1471. text-align: center;
  1472. display: inline-block;
  1473. padding:0 16rpx;
  1474. font-size: $font-size-20;
  1475. margin-left: 15rpx;
  1476. border: 1px solid #E15616;
  1477. }
  1478. }
  1479. .floor-item-btn{
  1480. float: left;
  1481. height: 40rpx;
  1482. margin-top: 8rpx;
  1483. margin-left: 10rpx;
  1484. .btn{
  1485. line-height: 40rpx;
  1486. padding: 0 20rpx;
  1487. height: 40rpx;
  1488. background: $btn-confirm;
  1489. color: #FFFFFF;
  1490. font-size: $font-size-20;
  1491. border-radius: 4rpx;
  1492. }
  1493. }
  1494. }
  1495. .wrap-info{
  1496. float: left;
  1497. width: 702rpx;
  1498. padding: 24rpx 24rpx 0 24rpx;
  1499. border-bottom: 1px solid #F8F8F8;
  1500. .info-viewT{
  1501. width: 100%;
  1502. min-height: 40rpx;
  1503. font-size: $font-size-28;
  1504. color: $text-color;
  1505. line-height: 40rpx;
  1506. text-align: left;
  1507. &.none{
  1508. color: #999999;
  1509. }
  1510. .info-viewL{
  1511. min-width: 350rpx;
  1512. float: left;
  1513. margin-bottom: 24rpx;
  1514. }
  1515. .info-viewR{
  1516. min-width: 352rpx;
  1517. float: left;
  1518. margin-bottom: 24rpx;
  1519. }
  1520. }
  1521. .info-viewB{
  1522. width: 100%;
  1523. height: auto;
  1524. }
  1525. .info-f{
  1526. width: 50%;
  1527. float: left;
  1528. font-size: $font-size-28;
  1529. color: $text-color;
  1530. line-height: 40rpx;
  1531. margin-bottom: 24rpx;
  1532. text-align: left;
  1533. }
  1534. }
  1535. }
  1536. .product-seve{
  1537. width: 100%;
  1538. height: 60rpx;
  1539. background-color: #FFFFFF;
  1540. position: relative;
  1541. display: flex;
  1542. line-height: 60rpx;
  1543. .label{
  1544. font-size: $font-size-28;
  1545. color: #333333;
  1546. }
  1547. .iconfont{
  1548. color: #fea785;
  1549. margin-right: 20rpx;
  1550. font-size: $font-size-22;
  1551. }
  1552. .text{
  1553. font-size: $font-size-22;
  1554. color: #fea785;
  1555. margin-left: 10rpx;
  1556. }
  1557. }
  1558. .product-item-none{
  1559. min-height: 348rpx;
  1560. display: flex;
  1561. flex-direction: column;
  1562. align-items: center;
  1563. border-bottom: 20rpx solid #F7F7F7;
  1564. box-sizing: border-box;
  1565. padding: 40rpx 0;
  1566. .none-image{
  1567. width: 284rpx;
  1568. height: 225rpx;
  1569. }
  1570. .none-text{
  1571. text-align: center;
  1572. font-size: $font-size-28;
  1573. color: #fea785;
  1574. line-height: 40rpx;
  1575. }
  1576. }
  1577. .product-parameter{
  1578. width: 702rpx;
  1579. height: 90rpx;
  1580. padding: 0 24rpx;
  1581. background-color: #FFFFFF;
  1582. position: relative;
  1583. border-bottom: 20rpx solid #F7F7F7;
  1584. &.coupon{
  1585. .title{
  1586. color: #f94b4b;
  1587. }
  1588. .icon-xiayibu{
  1589. color: #f94b4b;
  1590. }
  1591. .coupon{
  1592. float: right;
  1593. box-sizing: border-box;
  1594. padding: 29rpx 0;
  1595. padding-right: 35rpx;
  1596. .tags{
  1597. height: 32rpx;
  1598. box-sizing: border-box;
  1599. border-radius: 8rpx;
  1600. background-color: #fff1eb;
  1601. line-height: 28rpx;
  1602. color: #f94b4b;
  1603. text-align: center;
  1604. display: inline-block;
  1605. padding:0 10rpx;
  1606. font-size: $font-size-20;
  1607. border: 1px solid #f94b4b;
  1608. float: right;
  1609. margin:0 6rpx;
  1610. }
  1611. }
  1612. }
  1613. .title{
  1614. line-height: 90rpx;
  1615. display: inline-block;
  1616. float: left;
  1617. font-size: $font-size-28;
  1618. color: #666666;
  1619. }
  1620. .name{
  1621. line-height: 90rpx;
  1622. display: inline-block;
  1623. float: left;
  1624. font-size: $font-size-28;
  1625. color: $text-color;
  1626. padding-right: 48rpx;
  1627. overflow: hidden;
  1628. text-overflow:ellipsis;
  1629. white-space: nowrap;
  1630. text-align: right;
  1631. }
  1632. .icon-xiayibu{
  1633. line-height: 90rpx;
  1634. display: inline-block;
  1635. position: absolute;
  1636. width: 48rpx;
  1637. top: 0;
  1638. right: 0;
  1639. color: #b2b2b2;
  1640. }
  1641. }
  1642. .product-supplier{
  1643. width: 100%;
  1644. height: 174rpx;
  1645. padding: 30rpx 24rpx;
  1646. box-sizing: border-box;
  1647. background-color: #FFFFFF;
  1648. position: relative;
  1649. box-sizing: border-box;
  1650. border-bottom: 20rpx solid #F7F7F7;
  1651. .logo{
  1652. width: 128rpx;
  1653. height: 92rpx;
  1654. float: left;
  1655. border: 1px solid #efefef;
  1656. border-radius: 6rpx;
  1657. image{
  1658. width: 100%;
  1659. height: 100%;
  1660. display: block;
  1661. border-radius: 6rpx;
  1662. }
  1663. }
  1664. .main{
  1665. width: 470rpx;
  1666. height: 92rpx;
  1667. float: left;
  1668. margin-left: 20rpx;
  1669. .name{
  1670. width: 100%;
  1671. line-height: 46rpx;
  1672. float: left;
  1673. font-size: $font-size-28;
  1674. color: $text-color;
  1675. float: right;
  1676. overflow: hidden;
  1677. text-overflow:ellipsis;
  1678. white-space: nowrap;
  1679. text-align: left;
  1680. }
  1681. .massgs{
  1682. width: 100%;
  1683. line-height: 46rpx;
  1684. float: left;
  1685. font-size: $font-size-24;
  1686. color: #999999;
  1687. .label{
  1688. float: left;
  1689. }
  1690. .p-stars{
  1691. float: left;
  1692. margin-left: 20rpx;
  1693. }
  1694. .acount{
  1695. float: right;
  1696. text{
  1697. color: $color-system;
  1698. }
  1699. }
  1700. }
  1701. }
  1702. .icon-xiayibu{
  1703. line-height: 154rpx;
  1704. display: inline-block;
  1705. position: absolute;
  1706. width: 48rpx;
  1707. top: 0;
  1708. right: 0;
  1709. color: #b2b2b2;
  1710. }
  1711. }
  1712. .product-details {
  1713. width: 100%;
  1714. background: #FFFFFF;
  1715. border-bottom: 20rpx solid #F7F7F7;
  1716. &.service{
  1717. border-bottom: none;
  1718. }
  1719. &.recommend{
  1720. background-color: #F7F7F7;
  1721. border-bottom: none;
  1722. .title{
  1723. .title-tab{
  1724. background-color: #F7F7F7;
  1725. color: $text-color;
  1726. }
  1727. }
  1728. }
  1729. .product-rich-text-none{
  1730. box-sizing: border-box;
  1731. padding: 0 24rpx;
  1732. text-align: left;
  1733. font-size: 24rpx;
  1734. color: #999999;
  1735. line-height: 60rpx;
  1736. }
  1737. .content-none{
  1738. width: 100%;
  1739. height: 80rpx;
  1740. line-height: 80rpx;
  1741. text-align: left;
  1742. font-size: $font-size-26;
  1743. color: #999999;
  1744. box-sizing: border-box;
  1745. padding: 0 24rpx;
  1746. }
  1747. .title{
  1748. width: 100%;
  1749. box-sizing: border-box;
  1750. padding: 0 24rpx;
  1751. .title-tab{
  1752. width: 100%;
  1753. height: 100rpx;
  1754. background: #fff;
  1755. z-index: 10;
  1756. font-size: $font-size-30;
  1757. text-align: left;
  1758. color: $text-color;
  1759. line-height: 100rpx;
  1760. font-weight: 600;
  1761. }
  1762. .title-msg{
  1763. width: 100%;
  1764. height: 236rpx;
  1765. padding: 18rpx;
  1766. background-color: rgba(225,86,22, 0.1);
  1767. color: $color-system;
  1768. box-sizing: border-box;
  1769. margin-bottom: 30rpx;
  1770. .tit{
  1771. line-height: 46rpx;
  1772. font-size: $font-size-24;
  1773. text-align: left;
  1774. }
  1775. .txt{
  1776. line-height: 38rpx;
  1777. font-size: $font-size-20;
  1778. text-align: justify;
  1779. }
  1780. }
  1781. }
  1782. .content{
  1783. width: 100%;
  1784. background-color: #FFFFFF;
  1785. }
  1786. }
  1787. .isLower{
  1788. width: 100%;
  1789. height: 116rpx;
  1790. line-height: 116rpx;
  1791. text-align: center;
  1792. color: #000000;
  1793. font-size: $font-size-32;
  1794. font-weight: bold;
  1795. }
  1796. .bottom-btn{
  1797. width: 100%;
  1798. height: 100rpx;
  1799. position: fixed;
  1800. bottom: 0;
  1801. left: 0;
  1802. background: #FFFFFF;
  1803. z-index: 99;
  1804. .bottom-le{
  1805. width: 300rpx;
  1806. height: 100rpx;
  1807. padding:10rpx 20rpx 10rpx 0;
  1808. float: left;
  1809. box-sizing: border-box;
  1810. .item-bt{
  1811. width: 80rpx;
  1812. height: 100%;
  1813. margin-right:15rpx;
  1814. display: flex;
  1815. float: left;
  1816. flex-direction: column;
  1817. align-items: center;
  1818. justify-content: center;
  1819. font-size: $font-size-22;
  1820. color: $text-color;
  1821. line-height: 34rpx;
  1822. position: relative;
  1823. .animation-num{
  1824. font-size:$font-size-32 ;
  1825. color: #FF2A2A;
  1826. position: absolute;
  1827. top: -12rpx;
  1828. right: 4rpx;
  1829. font-weight: bold;
  1830. }
  1831. .animation{
  1832. animation: showAmnation 2.2s ease-in-out both;
  1833. }
  1834. .restion{
  1835. animation: hideAmnation 1s ease-in-out both;
  1836. }
  1837. .icon-num{
  1838. position: absolute;
  1839. right:-12rpx;
  1840. top: -5rpx;
  1841. }
  1842. .icon-num.goleft{
  1843. right: 2rpx;
  1844. }
  1845. &:last-child{
  1846. margin-right: 0;
  1847. }
  1848. image {
  1849. width: 44rpx;
  1850. height: 44rpx;
  1851. }
  1852. button.contact-btn{
  1853. width: 100%;
  1854. height: 100%;
  1855. margin: 0;
  1856. padding: 0;
  1857. display: flex;
  1858. flex-direction: column;
  1859. align-items: center;
  1860. justify-content: center;
  1861. box-sizing: border-box;
  1862. font-size: $font-size-24;
  1863. text-align: center;
  1864. text-decoration: none;
  1865. line-height: 34rpx;
  1866. border-radius: 0;
  1867. -webkit-tap-highlight-color: transparent;
  1868. overflow: hidden;
  1869. color: $text-color;
  1870. background-color:#FFFFFF;
  1871. }
  1872. }
  1873. }
  1874. .bottom-ri{
  1875. width: 450rpx;
  1876. height: 100%;
  1877. float: right;
  1878. display: flex;
  1879. box-sizing: border-box;
  1880. padding: 13rpx 20rpx 13rpx 0;
  1881. .btn{
  1882. flex: 1;
  1883. width: 200rpx;
  1884. line-height: 80rpx;
  1885. text-align: center;
  1886. font-size: $font-size-24;
  1887. color: #FFFFFF;
  1888. }
  1889. .btn-cart{
  1890. background-color: #ffe6dc;
  1891. color: $color-system;
  1892. border-radius: 42rpx 0 0 42rpx;
  1893. }
  1894. .btn-cart.disabled{
  1895. background-color: #E1E1E1;
  1896. color: #FFFFFF;
  1897. }
  1898. .btn-bay{
  1899. background:linear-gradient(to right, #f28f31 0%, #e15616 100%);
  1900. border-radius: 0 42rpx 42rpx 0;
  1901. }
  1902. .btn-bay.disabled{
  1903. background: linear-gradient(135deg,rgba(242,143,49,0.5) 0%,rgba(225,86,22,0.5) 100%);
  1904. }
  1905. }
  1906. }
  1907. .uni-badge--small {
  1908. -webkit-transform: scale(.8);
  1909. -ms-transform: scale(.8);
  1910. transform: scale(.8);
  1911. -webkit-transform-origin: center center;
  1912. -ms-transform-origin: center center;
  1913. transform-origin: center center;
  1914. }
  1915. .uni-badge {
  1916. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1917. -webkit-box-sizing: border-box;
  1918. box-sizing: border-box;
  1919. font-size: 12px;
  1920. line-height: 1;
  1921. display: inline-block;
  1922. padding: 3px 6px;
  1923. color: #333;
  1924. border-radius: 100px;
  1925. background-color: #f1f1f1;
  1926. }
  1927. .uni-badge-error {
  1928. color: #fff;
  1929. background-color: #dd524d;
  1930. }
  1931. .product-topnav{
  1932. width: 100%;
  1933. height: 174rpx;
  1934. box-sizing: border-box;
  1935. background: #FFFFFF;
  1936. z-index: 990;
  1937. position: fixed;
  1938. opacity: 1;
  1939. left: 0;
  1940. &.fixed{
  1941. animation: showFixedColor 0.1s ease-in-out both;
  1942. }
  1943. &.none{
  1944. animation: hideFixedColor 0.1s ease-in-out both;
  1945. }
  1946. .navbar {
  1947. width: 100%;
  1948. height: 60rpx;
  1949. box-sizing: border-box;
  1950. padding: 0 24rpx;
  1951. display: flex;
  1952. .nav-item {
  1953. display: flex;
  1954. flex: 1;
  1955. justify-content: center;
  1956. align-items: center;
  1957. height: 60rpx;
  1958. font-size: $font-size-28;
  1959. color: $text-color;
  1960. position: relative;
  1961. float: left;
  1962. position: relative;
  1963. .line{
  1964. width: 60rpx;
  1965. height: 2px;
  1966. border-radius: 1px;
  1967. background: #FFFFFF;
  1968. position: absolute;
  1969. bottom: 0;
  1970. left: 50%;
  1971. margin-left: -30rpx;
  1972. }
  1973. &.current{
  1974. color:$color-system;
  1975. .line{
  1976. background: $color-system;
  1977. }
  1978. }
  1979. }
  1980. }
  1981. .search-input{
  1982. width: 100%;
  1983. height: 114rpx;
  1984. padding:24rpx;
  1985. box-sizing: border-box;
  1986. .gosearch-btn{
  1987. width: 100%;
  1988. height: 100%;
  1989. border-radius: 40rpx;
  1990. margin: 0 auto;
  1991. font-size: 26rpx;
  1992. line-height: 66rpx;
  1993. color: #B2B2B2;
  1994. position: relative;
  1995. box-sizing: border-box;
  1996. padding-left: 66rpx;
  1997. &.fixed{
  1998. background: rgba(70,70,70,0.1);
  1999. }
  2000. &.none{
  2001. background: rgba(70,70,70,0.1);
  2002. }
  2003. .search-icon{
  2004. width: 66rpx;
  2005. height: 66rpx;
  2006. position:absolute ;
  2007. left: 0;
  2008. top: 2rpx;
  2009. text-align: center;
  2010. line-height: 66rpx;
  2011. .icon-iconfonticonfontsousuo1{
  2012. margin:0 6rpx;
  2013. font-size: $font-size-34;
  2014. color: #B2B2B2;
  2015. z-index: 10;
  2016. }
  2017. }
  2018. .search-text{
  2019. font-size: $font-size-24;
  2020. line-height: 66rpx;
  2021. color: #B2B2B2;
  2022. }
  2023. }
  2024. }
  2025. }
  2026. @keyframes showFixedColor {
  2027. 0% {background: rgba(255,255,255,0);}
  2028. 50% {background: rgba(255,255,255,0.5);}
  2029. 100% {background: rgba(255,255,255,1);}
  2030. }
  2031. @keyframes hideFixedColor {
  2032. 0% {background: rgba(255,255,255,1);}
  2033. 50% {background: rgba(255,255,255,0.5);}
  2034. 100% {background: rgba(255,255,255,0);}
  2035. }
  2036. /* 加入购物模态层*/
  2037. @keyframes showPopup {
  2038. 0% {
  2039. opacity: 0;
  2040. }
  2041. 100% {
  2042. opacity: 1;
  2043. }
  2044. }
  2045. @keyframes hidePopup {
  2046. 0% {
  2047. opacity: 1;
  2048. }
  2049. 100% {
  2050. opacity: 0;
  2051. }
  2052. }
  2053. @keyframes showLayer {
  2054. 0% {
  2055. transform: translateY(0);
  2056. }
  2057. 100% {
  2058. transform: translateY(-100%);
  2059. }
  2060. }
  2061. @keyframes hideLayer {
  2062. 0% {
  2063. transform: translateY(-100%);
  2064. }
  2065. 100% {
  2066. transform: translateY(0);
  2067. }
  2068. }
  2069. @keyframes showAmnation {
  2070. 0% {
  2071. top: -12rpx;
  2072. opacity: 0;
  2073. }
  2074. 50% {
  2075. top: -60rpx;
  2076. opacity: 1;
  2077. }
  2078. 100% {
  2079. top: -100rpx;
  2080. opacity: 0;
  2081. }
  2082. }
  2083. @keyframes hideAmnation {
  2084. 0% {
  2085. top: -100rpx;
  2086. opacity: 0;
  2087. }
  2088. 100% {
  2089. top: -12rpx;
  2090. opacity: 0;
  2091. }
  2092. }
  2093. .popup {
  2094. position: fixed;
  2095. top: 0;
  2096. width: 100%;
  2097. height: 100%;
  2098. z-index: 999;
  2099. display: none;
  2100. .mask{
  2101. position: fixed;
  2102. top: 0;
  2103. width: 100%;
  2104. height: 100%;
  2105. z-index: 21;
  2106. background-color: rgba(0, 0, 0, 0.6);
  2107. }
  2108. .layer {
  2109. position: fixed;
  2110. z-index: 22;
  2111. bottom: -294rpx;
  2112. width: 702rpx;
  2113. padding: 24rpx 24rpx 36rpx 24rpx;
  2114. height: 260rpx;
  2115. border-radius: 20rpx 20rpx 0 0;
  2116. background-color: #fff;
  2117. display: flex;
  2118. flex-wrap: wrap;
  2119. align-content: space-between;
  2120. .content {
  2121. width: 100%;
  2122. }
  2123. .btn {
  2124. width: 100%;
  2125. height: 88rpx;
  2126. margin-top: 20rpx;
  2127. .button {
  2128. width: 100%;
  2129. height: 88rpx;
  2130. color: #fff;
  2131. display: flex;
  2132. align-items: center;
  2133. justify-content: center;
  2134. background: $btn-confirm;
  2135. font-size: $font-size-28;
  2136. border-radius: 44rpx;
  2137. }
  2138. }
  2139. }
  2140. &.show {
  2141. display: block;
  2142. .mask{
  2143. animation: showPopup 0.2s linear both;
  2144. }
  2145. .layer {
  2146. animation: showLayer 0.2s linear both;
  2147. }
  2148. }
  2149. &.hide {
  2150. display: block;
  2151. .mask{
  2152. animation: hidePopup 0.2s linear both;
  2153. }
  2154. .layer {
  2155. animation: hideLayer 0.2s linear both;
  2156. }
  2157. }
  2158. &.none {
  2159. display: none;
  2160. }
  2161. &.service {
  2162. .row {
  2163. margin: 30upx 0;
  2164. .title {
  2165. font-size: 30upx;
  2166. margin: 10upx 0;
  2167. }
  2168. .description {
  2169. font-size: 28upx;
  2170. color: #999;
  2171. }
  2172. }
  2173. }
  2174. .layer-smimg{
  2175. width: 114rpx;
  2176. height: 114rpx;
  2177. float: left;
  2178. border-radius: 10rpx;
  2179. margin-right: 24rpx;
  2180. image{
  2181. width: 114rpx;
  2182. height: 114rpx;
  2183. border-radius: 10rpx;
  2184. }
  2185. }
  2186. .layer-nunbox{
  2187. justify-content: space-between;
  2188. align-items: center;
  2189. width: 536rpx;
  2190. height: auto;
  2191. float: left;
  2192. .layer-nunbox-t{
  2193. width: 100%;
  2194. height:44rpx;
  2195. position:relative;
  2196. display: flex;
  2197. margin-bottom: 10rpx;
  2198. .text{
  2199. font-size: $font-size-24;
  2200. line-height: 48rpx;
  2201. color: #999999;
  2202. }
  2203. .layer-nunbox-text{
  2204. line-height: 44rpx;
  2205. font-size: $font-size-28;
  2206. }
  2207. .number-box{
  2208. display: flex;
  2209. justify-content: center;
  2210. align-items: center;
  2211. border:2rpx solid #ffe6dc;
  2212. border-radius: 30rpx;
  2213. height: 48rpx;
  2214. margin-left: 20rpx;
  2215. .iconfont{
  2216. font-size: $font-size-24;
  2217. padding:0 18rpx;
  2218. color: #999999;
  2219. text-align: center;
  2220. line-height: 48rpx;
  2221. font-weight: bold;
  2222. background: #fef6f3;
  2223. &.icon-jianhao{
  2224. border-radius: 30rpx 0 0 30rpx;
  2225. }
  2226. &.icon-jiahao{
  2227. border-radius: 0 30rpx 30rpx 0;
  2228. }
  2229. }
  2230. .btn-input{
  2231. width: 62rpx;
  2232. height: 48rpx;
  2233. line-height: 48rpx;
  2234. background: #FFFFFF;
  2235. border-radius: 4rpx;
  2236. text-align: center;
  2237. font-size: $font-size-28;
  2238. }
  2239. }
  2240. .product-step{
  2241. position: absolute;
  2242. left: 45rpx;
  2243. bottom: 0;
  2244. height: 44rpx;
  2245. background: #FFFFFF;
  2246. }
  2247. }
  2248. .layer-nunbox-b{
  2249. width: 100%;
  2250. height:44rpx;
  2251. margin-top: 13rpx;
  2252. }
  2253. .text{
  2254. line-height: 44rpx;
  2255. font-size: $font-size-28;
  2256. .p{
  2257. color: #FF2A2A;
  2258. }
  2259. .p:first-child{
  2260. margin-left: 30rpx;
  2261. }
  2262. .p.sm{
  2263. font-size: $font-size-24;
  2264. }
  2265. }
  2266. }
  2267. }
  2268. .tui-popup-box {
  2269. position: relative;
  2270. box-sizing: border-box;
  2271. min-height: 220rpx;
  2272. padding:24rpx 24rpx 0 24rpx;
  2273. .tui-popup-close{
  2274. width: 90rpx;
  2275. height: 90rpx;
  2276. position: absolute;
  2277. right: 0;
  2278. top: 24rpx;
  2279. line-height: 90rpx;
  2280. text-align: center;
  2281. color: #b2b2b2;
  2282. .icon-iconfontguanbi{
  2283. font-size: $font-size-40;
  2284. }
  2285. }
  2286. .title{
  2287. font-size: $font-size-34;
  2288. color: $text-color;
  2289. line-height: 88rpx;
  2290. text-align: center;
  2291. float: left;
  2292. width: 100%;
  2293. height: 88rpx;
  2294. font-weight: bold;
  2295. }
  2296. .tui-popup-main{
  2297. width: 100%;
  2298. float: left;
  2299. &.coupon{
  2300. padding-bottom: 40rpx;
  2301. .coupon-empty{
  2302. width: 100%;
  2303. height: 600rpx;
  2304. display: flex;
  2305. align-items: center;
  2306. justify-content: center;
  2307. flex-direction: column;
  2308. position: fixed;
  2309. background: $bg-color;
  2310. .empty-container-image{
  2311. width: 150rpx;
  2312. height: 150rpx;
  2313. margin-bottom: 0;
  2314. margin-top: 0;
  2315. }
  2316. .error-text{
  2317. font-size: $font-size-28;
  2318. color: #999999;
  2319. line-height: 88rpx;
  2320. }
  2321. }
  2322. }
  2323. .tui-popup-scroll{
  2324. width: 100%;
  2325. height: 600rpx;
  2326. .coupon-list{
  2327. width: 100%;
  2328. height: 200rpx;
  2329. margin-top: 24rpx;
  2330. box-sizing: border-box;
  2331. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  2332. background-size: cover;
  2333. &:last-child{
  2334. margin-bottom: 24rpx;
  2335. }
  2336. .list-cell-le{
  2337. width: 224rpx;
  2338. height: 100%;
  2339. box-sizing: border-box;
  2340. padding: 37rpx 0;
  2341. float: left;
  2342. .coupon-maxMoney{
  2343. width: 100%;
  2344. height: 78rpx;
  2345. line-height: 78rpx;
  2346. font-size: 56rpx;
  2347. color: #FFFFFF;
  2348. text-align: center;
  2349. .small{
  2350. font-size: $font-size-24;
  2351. }
  2352. }
  2353. .coupon-minMoney{
  2354. width: 100%;
  2355. height: 33rpx;
  2356. line-height: 33rpx;
  2357. font-size: $font-size-24;
  2358. color: #FFFFFF;
  2359. text-align: center;
  2360. }
  2361. }
  2362. .list-cell-ri{
  2363. width: 478rpx;
  2364. height: 100%;
  2365. box-sizing: border-box;
  2366. padding: 20rpx 24rpx 0 24rpx;
  2367. float: right;
  2368. .list-cell-top{
  2369. width: 100%;
  2370. height: 121rpx;
  2371. float: left;
  2372. border-bottom: 1px solid #e1e1e1;
  2373. .list-cell-type{
  2374. width: 286rpx;
  2375. height: 100%;
  2376. float: left;
  2377. .list-cell-tags{
  2378. width: 100%;
  2379. height: 32rpx;
  2380. margin-bottom: 7rpx;
  2381. .tags{
  2382. display: inline-block;
  2383. padding: 0 10rpx;
  2384. height: 32rpx;
  2385. line-height: 32rpx;
  2386. background-color: #ffdcce;
  2387. color: #f94b4b;
  2388. font-size: $font-size-20;
  2389. border-radius: 8rpx;
  2390. text-align: center;
  2391. float: left;
  2392. }
  2393. }
  2394. .list-cell-texts{
  2395. width: 100%;
  2396. height: auto;
  2397. line-height:35rpx;
  2398. text-overflow:ellipsis;
  2399. display: -webkit-box;
  2400. word-break: break-all;
  2401. -webkit-box-orient: vertical;
  2402. -webkit-line-clamp: 2;
  2403. overflow: hidden;
  2404. font-size: 26rpx;
  2405. color: #333333;
  2406. }
  2407. }
  2408. .list-cell-btn{
  2409. width: 128rpx;
  2410. height: 100%;
  2411. float: right;
  2412. .icon-used{
  2413. width: 100%;
  2414. height: 100%;
  2415. box-sizing: border-box;
  2416. padding-top: 57rpx;
  2417. .icon-used-btn{
  2418. width: 128rpx;
  2419. height: 48rpx;
  2420. border-radius: 28rpx;
  2421. line-height: 48rpx;
  2422. font-size: $font-size-26;
  2423. text-align: center;
  2424. &.receive{
  2425. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);;
  2426. color: #FFFFFF;
  2427. }
  2428. &.make{
  2429. border: solid 1px #f94b4b;
  2430. color: #f94b4b;
  2431. }
  2432. }
  2433. }
  2434. }
  2435. }
  2436. .list-cell-time{
  2437. width: 100%;
  2438. height: 58rpx;
  2439. line-height: 58rpx;
  2440. text-align: left;
  2441. font-size: $font-size-20;
  2442. color: #999999;
  2443. }
  2444. }
  2445. }
  2446. &.train{
  2447. height: 240rpx;
  2448. }
  2449. .content-tr{
  2450. width: 100%;
  2451. min-height: 58rpx;
  2452. line-height: 58rpx;
  2453. display: flex;
  2454. .content-td{
  2455. display: flex;
  2456. flex: 3;
  2457. font-size: $font-size-26;
  2458. color: #999999;
  2459. line-height: 58rpx;
  2460. text-align: left;
  2461. }
  2462. .content-th{
  2463. display: flex;
  2464. flex: 7;
  2465. font-size: $font-size-26;
  2466. color: #333333;
  2467. line-height: 58rpx;
  2468. text-align: left;
  2469. padding-left: 10rpx;
  2470. }
  2471. }
  2472. }
  2473. }
  2474. }
  2475. .tui-popup-btn {
  2476. width: 100%;
  2477. height: auto;
  2478. float: left;
  2479. margin-top: 24rpx;
  2480. .tui-button{
  2481. width: 100%;
  2482. height: 88rpx;
  2483. background: $btn-confirm;
  2484. line-height: 88rpx;
  2485. text-align: center;
  2486. color: #FFFFFF;
  2487. font-size: $font-size-28;
  2488. border-radius: 44rpx;
  2489. }
  2490. }
  2491. /*富文本样式*/
  2492. rich-text.p{
  2493. width: 702rpx !important;
  2494. padding: 0 24rpx;
  2495. text-align: justify;
  2496. }
  2497. rich-text.img{
  2498. width: 100%;
  2499. height: auto;
  2500. }
  2501. </style>