product.vue 64 KB

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