product.vue 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659
  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. shopId: 0,
  598. isShareType: '',
  599. isHeaderPoduct: false,
  600. isNavbarFiexd: false,
  601. navbarFiexd: 'none',
  602. ladderPriceFlag: '',
  603. ladderPriceList: '',
  604. isInvalid: false,
  605. isEvaluate: false,
  606. isAnimation: false,
  607. skeletonShow: true,
  608. isQuantity: false,
  609. isStock: false,
  610. disabled: false,
  611. isNoneDisabled: false,
  612. tabCurrentIndex: 0,
  613. userId: '',
  614. shopID: '',
  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. this.shoppingHeaderCartNumber()
  818. this.queryProductDetilsCoupons()
  819. this.isRequest = true
  820. })
  821. .catch(error => {
  822. this.$util.msg(error.msg, 2000)
  823. })
  824. },
  825. queryProductDetilsCoupons() {
  826. // 初始化商品详情优惠券信息
  827. this.ProductService.QueryProductDetilsCoupons(this.couponParam)
  828. .then(response => {
  829. this.productCoupon = response.data.list
  830. })
  831. .catch(error => {
  832. console.log('获取优惠券列表失败')
  833. })
  834. },
  835. queryPopupCoupons() {
  836. // 获取弹窗优惠券列表
  837. this.ProductService.QueryProductDetilsCoupons(this.couponParam)
  838. .then(response => {
  839. let data = response.data
  840. this.navbar[0].num = data.notCouponNum
  841. this.navbar[1].num = data.couponNum
  842. if (data.couponList && data.couponList.length > 0) {
  843. this.productCouponList = data.couponList
  844. this.isCouponEmpty = false
  845. } else {
  846. this.isCouponEmpty = true
  847. }
  848. })
  849. .catch(error => {
  850. console.log('获取优惠券列表失败')
  851. })
  852. },
  853. shoppingHeaderCartNumber() {
  854. // 获取用户购物车储量
  855. this.ProductService.shoppingHeaderCartNumber({ userId: this.userId })
  856. .then(response => {
  857. this.bottomCartNumber = response.data.length
  858. })
  859. .catch(error => {
  860. console.log('获取购物车数量失败')
  861. })
  862. },
  863. receiveCoupon(coupon) {
  864. // 点击优惠券领取按钮
  865. this.ProductService.ReceiveCoupon({
  866. userId: this.couponParam.userId,
  867. couponId: coupon.couponId,
  868. source: 2
  869. })
  870. .then(response => {
  871. this.$util.msg('领取成功', 1500, true, 'success')
  872. setTimeout(() => {
  873. this.currentTab = 1
  874. this.couponParam.status = 2
  875. this.queryPopupCoupons()
  876. }, 1500)
  877. })
  878. .catch(error => {
  879. this.$util.msg(error.msg, 2000)
  880. })
  881. },
  882. swiperChange(e) {
  883. //顶部商品图片切换
  884. const index = e.detail.current
  885. this.current = index
  886. },
  887. previewImg(index) {
  888. //顶部商品图片预览
  889. isPreviewImg = true
  890. let previewUrls = this.productImage
  891. uni.previewImage({
  892. current: index, //图片索引
  893. urls: previewUrls, //必须是http图片,本地图片无效
  894. longPressActions: ''
  895. })
  896. },
  897. //商品详情&&供应商信息tab切换
  898. tabClick(index) {
  899. // 重新标记
  900. this.getSectionProps()
  901. this.tabCurrentIndex = index
  902. this.tabSelectFlag = true
  903. let timer = null
  904. clearTimeout(timer)
  905. // 点击tab 300ms才执行跳转,避免出错(来回跳动)
  906. timer = setTimeout(() => {
  907. this.tabClickAction(index)
  908. }, 300)
  909. },
  910. // 跳转执行
  911. tabClickAction(index) {
  912. const that = this
  913. if (index === 3) {
  914. return uni.pageScrollTo({
  915. duration: 300, //过渡时间必须为0,uniapp bug,否则运行到手机会报错
  916. scrollTop: this.sectionPropsArr[0].scrollTop
  917. })
  918. }
  919. uni.pageScrollTo({
  920. duration: 300, //过渡时间必须为0,uniapp bug,否则运行到手机会报错
  921. scrollTop: this.sectionPropsArr[index].scrollTop,
  922. success() {
  923. setTimeout(() => {
  924. that.tabSelectFlag = false
  925. }, 300)
  926. }
  927. })
  928. },
  929. handleContact(e) {
  930. //跳转小程序客服
  931. console.log(e.detail.path)
  932. console.log(e.detail.query)
  933. },
  934. buyProductCart() {
  935. //底部购物车按钮点击
  936. if (this.hasLogin) {
  937. // 友盟埋点商品详情购物车入口点击事件
  938. if (process.env.NODE_ENV != 'development') {
  939. this.$uma.trackEvent('Um_Event_ProductShoppingCart', {
  940. Um_Key_PageName: '去购物车',
  941. Um_Key_SourcePage: '商品详情购物车入口'
  942. })
  943. }
  944. this.$api.navigateTo('/pages/goods/cart')
  945. } else {
  946. this.$api.navigateTo('/pages/login/login?type=1')
  947. }
  948. },
  949. btnGetConfirm(type) {
  950. //加入购物车&&立即购买点击
  951. if (this.hasLogin) {
  952. switch (type) {
  953. case 'add':
  954. // 友盟埋点商品详情加入购物车点击事件
  955. if (process.env.NODE_ENV != 'development') {
  956. this.$uma.trackEvent('Um_Event_ProductAddCart', {
  957. Um_Key_PageName: '加入购物车',
  958. Um_Key_SourcePage: '商品详情',
  959. Um_Key_ProductID: `${this.product.productId}`
  960. })
  961. }
  962. break
  963. case 'buy':
  964. // 友盟埋点商品详情立即购买点击事件
  965. if (process.env.NODE_ENV != 'development') {
  966. this.$uma.trackEvent('Um_Event_ProductBuyConfirm', {
  967. Um_Key_PageName: '立即购买',
  968. Um_Key_SourcePage: '商品详情',
  969. Um_Key_ProductID: `${this.product.productId}`
  970. })
  971. }
  972. break
  973. }
  974. this.showSpec(type)
  975. } else {
  976. this.$api.navigateTo('/pages/login/login?type=1')
  977. }
  978. },
  979. //popup弹窗数量增加按钮
  980. changeCountAdd() {
  981. if (this.buyRetailPriceStep == 2) {
  982. this.number += this.minBuyNumber
  983. } else {
  984. this.number++
  985. }
  986. this.processActivityPrice()
  987. },
  988. //popup弹窗数量减按钮
  989. changeCountSub() {
  990. if (this.number <= this.minBuyNumber) {
  991. this.number = this.minBuyNumber
  992. this.isQuantity = true
  993. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`, 2000)
  994. return
  995. } else {
  996. if (this.buyRetailPriceStep == 2) {
  997. this.number -= this.minBuyNumber
  998. } else {
  999. this.number--
  1000. }
  1001. this.processActivityPrice()
  1002. this.isQuantity = false
  1003. }
  1004. },
  1005. changeNumber(e) {
  1006. let _value = e.detail.value
  1007. if (!this.$api.isNumber(_value)) {
  1008. this.number = this.minBuyNumber
  1009. } else if (_value < this.minBuyNumber) {
  1010. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`, 2000)
  1011. this.number = this.minBuyNumber
  1012. } else if (_value % this.minBuyNumber != 0) {
  1013. this.$util.msg('购买量必须为起订量的整数倍', 2000)
  1014. this.number = this.minBuyNumber
  1015. } else {
  1016. this.number = e.detail.value
  1017. }
  1018. this.processActivityPrice()
  1019. },
  1020. processActivityPrice() {
  1021. //单独处理活动价格和阶梯价格
  1022. if ((this.ladderPriceFlag == '0' && this.product.actStatus == 0) || this.product.actStatus == 1) {
  1023. this.buyRetailPrice = this.product.price
  1024. } else {
  1025. this.ladderPriceList.forEach((item, index) => {
  1026. if (this.number >= item.buyNum) {
  1027. this.buyRetailPrice = item.buyPrice
  1028. }
  1029. })
  1030. }
  1031. },
  1032. showSpec(type) {
  1033. //显示选择数量确认弹窗
  1034. this.isBtnType = type
  1035. this.specClass = 'show'
  1036. if (this.ladderPriceFlag) {
  1037. this.processActivityPrice()
  1038. }
  1039. },
  1040. hideSpec() {
  1041. //关闭选择数量确认弹窗
  1042. this.specClass = 'hide'
  1043. setTimeout(() => {
  1044. this.specClass = 'none'
  1045. }, 200)
  1046. },
  1047. btnConfirm() {
  1048. //加入购物车&&立即购买跳转订单页并关闭弹窗
  1049. // 友盟埋点商品详情确认购买商品点击事件
  1050. if (process.env.NODE_ENV != 'development') {
  1051. this.$uma.trackEvent('Um_Event_ProductShoppingConfirm', {
  1052. Um_Key_PageName: '商品购买确认',
  1053. Um_Key_SourcePage: '商品详情',
  1054. Um_Key_ProductID: `${this.product.productId}`
  1055. })
  1056. }
  1057. if (this.isBtnType == 'add') {
  1058. this.getAddProductCart()
  1059. } else {
  1060. this.toConfirmation()
  1061. }
  1062. },
  1063. toConfirmation() {
  1064. //跳转确认订单页面
  1065. this.specClass = 'hide'
  1066. let productStp = {
  1067. productIds: this.product.productId,
  1068. productCount: this.number
  1069. }
  1070. this.$api.navigateTo(
  1071. `/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({ data: productStp })}`
  1072. )
  1073. setTimeout(() => {
  1074. this.specClass = 'none'
  1075. }, 200)
  1076. },
  1077. getAddProductCart() {
  1078. //增加购物车成功和toast弹窗提示成功
  1079. this.ProductService.shoppingAddCart({
  1080. productId: this.productId,
  1081. userId: this.userId,
  1082. productCount: this.number,
  1083. source: 2
  1084. })
  1085. .then(response => {
  1086. this.specClass = 'hide'
  1087. this.$util.msg('加入购物车成功', 1500, true, 'success')
  1088. this.isAnimation = true
  1089. setTimeout(() => {
  1090. this.specClass = 'none'
  1091. }, 200)
  1092. setTimeout(() => {
  1093. this.isAnimation = false
  1094. }, 2000)
  1095. this.bottomCartNumber = response.data
  1096. })
  1097. .catch(error => {
  1098. console.log('error', error.msg)
  1099. })
  1100. },
  1101. setHeaderBtnPosi() {
  1102. // 获得胶囊按钮位置信息
  1103. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  1104. return headerBtnPosi
  1105. },
  1106. setSysteminfo() {
  1107. let systeminfo
  1108. uni.getSystemInfo({
  1109. // 获取设备信息
  1110. success: res => {
  1111. systeminfo = res
  1112. }
  1113. })
  1114. return systeminfo
  1115. },
  1116. goIndex() {
  1117. //商城首页
  1118. uni.switchTab({
  1119. url: '/pages/tabBar/home/index'
  1120. })
  1121. },
  1122. goSupplier() {
  1123. //跳供应商资料页
  1124. this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=' + this.shopId)
  1125. },
  1126. discard() {
  1127. //丢弃
  1128. },
  1129. onShare(res) {
  1130. //分享转发
  1131. if (res.from === 'button') {
  1132. // 来自页面内转发按钮
  1133. }
  1134. return {
  1135. title: `${this.product.name}`,
  1136. path: `pages/goods/product?type=share&id=${this.productId}`,
  1137. imageUrl: `${this.productImage[0]}`
  1138. }
  1139. },
  1140. handleCollection() {
  1141. // 收藏
  1142. if (this.hasLogin) {
  1143. this.ProductService.getProductUserLike({
  1144. userId: this.userId,
  1145. productId: this.product.productId
  1146. })
  1147. .then(response => {
  1148. this.collectionType = !this.collectionType
  1149. this.$util.msg(response.data, 1500, true, 'success')
  1150. })
  1151. .catch(error => {
  1152. this.$util.msg(error.msg, 2000)
  1153. })
  1154. } else {
  1155. this.$api.navigateTo('/pages/login/login')
  1156. }
  1157. },
  1158. showPopup(index) {
  1159. switch (index) {
  1160. case 0:
  1161. this.popupShow0 = true
  1162. break
  1163. case 1:
  1164. this.popupShow1 = true
  1165. break
  1166. case 2:
  1167. if (this.hasLogin) {
  1168. this.queryPopupCoupons()
  1169. this.popupShow2 = true
  1170. } else {
  1171. this.$api.navigateTo('/pages/login/login')
  1172. }
  1173. break
  1174. }
  1175. },
  1176. hidePopup(index) {
  1177. switch (index) {
  1178. case 0:
  1179. this.popupShow0 = false
  1180. break
  1181. case 1:
  1182. this.popupShow1 = false
  1183. break
  1184. case 2:
  1185. this.popupShow2 = false
  1186. break
  1187. }
  1188. },
  1189. couponChange(e) {
  1190. this.currentTab = e.index
  1191. switch (this.currentTab) {
  1192. case 0:
  1193. this.couponParam.status = 1
  1194. this.queryPopupCoupons()
  1195. break
  1196. case 1:
  1197. this.couponParam.status = 2
  1198. this.queryPopupCoupons()
  1199. break
  1200. }
  1201. },
  1202. // 获取每个tab对应区域的区间
  1203. async getSectionProps() {
  1204. const sectionPropsArr = [],
  1205. scrollTopArray = [],
  1206. className = 'product-details'
  1207. // 获取相关节点元素信息
  1208. const productMain = await this.$util.boundingClientRect(this, '.container-product-main', false)
  1209. const productDetail = await this.$util.boundingClientRect(this, '.product-details', true)
  1210. const topBar = await this.$util.boundingClientRect(this, '#topBar', false)
  1211. /*
  1212. 说明:采用累加方式来计算每一个 prdocut-details 的 scrollTop 定位
  1213. scrollTop = 上一个的scrollTop + 上一个的高度
  1214. */
  1215. productDetail.forEach((item, index) => {
  1216. // 上一个 prdocut-details 的 scrollTop 值
  1217. const prev = sectionPropsArr[index - 1]
  1218. const prevScrollTop = prev ? prev.scrollTop : productMain.height
  1219. // 上一个 prdocut-details 的高度
  1220. const add = productDetail[index - 1]
  1221. // 第一个需要减去tabs的高度
  1222. const addHeight = index === 0 ? (add ? add.height : 0) - topBar.height : add ? add.height : 0
  1223. sectionPropsArr.push({
  1224. className: `${className}-${index}`,
  1225. scrollTop: prevScrollTop + addHeight
  1226. })
  1227. // - topBar.height
  1228. })
  1229. this.sectionPropsArr = sectionPropsArr
  1230. console.log('更新tab影响区域')
  1231. },
  1232. //当滑动时也能同步激活tab
  1233. activeTab: debounce(
  1234. (top, _this) => {
  1235. const { sectionPropsArr } = _this
  1236. if (sectionPropsArr.length > 0) {
  1237. sectionPropsArr.forEach((item, index) => {
  1238. // 当前位置为开始位置, 下个起始位置为结束位置
  1239. const openInterval = (index === 0 ? 0 : item.scrollTop) - 20 // 自定义偏移
  1240. const next = sectionPropsArr[index + 1]
  1241. const closedInterval = (next ? next.scrollTop : 10000000) - 20 // 自定义偏移
  1242. if (top >= openInterval && top < closedInterval) {
  1243. _this.tabCurrentIndex = index
  1244. }
  1245. })
  1246. }
  1247. },
  1248. 100,
  1249. true
  1250. ),
  1251. getWinHeight() {
  1252. this.winHeight = wx.getSystemInfoSync().windowHeight
  1253. },
  1254. changePreViewImageStatus(falg) {
  1255. this.isPreviewImage = falg
  1256. }
  1257. },
  1258. onPageScroll(e) {
  1259. //实时获取到滚动的值
  1260. const { scrollTop } = e
  1261. if (!this.tabSelectFlag) {
  1262. this.activeTab(scrollTop, this)
  1263. }
  1264. if (e.scrollTop > 60) {
  1265. this.headerColor = true
  1266. this.navbarFiexd = 'fixed'
  1267. this.isNavbarFiexd = true
  1268. this.nvabarData = {
  1269. showCapsule: 1,
  1270. title: '商品详情'
  1271. }
  1272. } else {
  1273. this.headerColor = false
  1274. this.isNavbarFiexd = false
  1275. this.navbarFiexd = 'none'
  1276. this.nvabarData = {
  1277. showCapsule: 1,
  1278. title: ''
  1279. }
  1280. }
  1281. if (e.scrollTop > 700) {
  1282. this.isScrollTop = true
  1283. } else {
  1284. this.isScrollTop = false
  1285. }
  1286. },
  1287. onShareAppMessage(res) {
  1288. //分享转发
  1289. if (res.from === 'button') {
  1290. // 来自页面内转发按钮
  1291. }
  1292. return {
  1293. title: `${this.product.name}`,
  1294. path: `pages/goods/product?type=share&id=${this.productId}`,
  1295. imageUrl: `${this.productImage[0]}`
  1296. }
  1297. },
  1298. onShow() {
  1299. // 是否开启图片预览 true 不刷新调用接口 false刷新调用接口
  1300. if (!this.isPreviewImage) {
  1301. this.$api
  1302. .getStorage()
  1303. .then(resolve => {
  1304. this.userId = this.couponParam.userId = resolve.userId ? resolve.userId : ''
  1305. this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
  1306. this.shopID = resolve.shopId ? resolve.shopId : ''
  1307. if (this.userIdentity == 0 || this.userIdentity == 2 || this.userIdentity == 4) {
  1308. this.isShowButton = true
  1309. } else {
  1310. this.isShowButton = false
  1311. }
  1312. if (isPreviewImg) {
  1313. isPreviewImg = false
  1314. return
  1315. } else {
  1316. this.initData()
  1317. }
  1318. })
  1319. .catch(error => {
  1320. this.initData()
  1321. })
  1322. }
  1323. this.isPreviewImage = false
  1324. },
  1325. created() {}
  1326. }
  1327. </script>
  1328. <style lang="scss">
  1329. page {
  1330. background-color: #ffffff;
  1331. }
  1332. .banner-section {
  1333. width: 100%;
  1334. height: 750rpx;
  1335. position: relative;
  1336. }
  1337. .banner {
  1338. width: 100%;
  1339. height: 750rpx;
  1340. .product-img {
  1341. width: 750rpx;
  1342. }
  1343. image {
  1344. width: 100%;
  1345. height: 100%;
  1346. }
  1347. .banner-item {
  1348. position: relative;
  1349. .cm-product-cover {
  1350. position: absolute;
  1351. right: 30rpx;
  1352. top: 30rpx;
  1353. width: 147rpx;
  1354. height: 57rpx;
  1355. line-height: 57rpx;
  1356. font-size: 24rpx;
  1357. color: #fff;
  1358. text-align: center;
  1359. background: url(https://static.caimei365.com/app/img/icon2/cm_cover_bg_app.png) no-repeat center;
  1360. background-size: 147rpx;
  1361. }
  1362. }
  1363. }
  1364. .swiper__dots-box {
  1365. position: absolute;
  1366. color: #fff;
  1367. bottom: 30rpx;
  1368. right: 0;
  1369. }
  1370. .product-wrap {
  1371. width: 100%;
  1372. height: auto;
  1373. padding: 24rpx 0 0 0;
  1374. background-color: #ffffff;
  1375. border-bottom: 20rpx solid #f7f7f7;
  1376. .productRemarks {
  1377. height: 48rpx;
  1378. width: 100%;
  1379. float: left;
  1380. line-height: 48rpx;
  1381. font-size: 24rpx;
  1382. color: #999999;
  1383. text-align: left;
  1384. }
  1385. .wrap-top {
  1386. width: 702rpx;
  1387. padding: 0 24rpx;
  1388. height: auto;
  1389. float: left;
  1390. padding-bottom: 20rpx;
  1391. border-bottom: 1px solid #f8f8f8;
  1392. &.none {
  1393. .p-title {
  1394. color: #999999;
  1395. }
  1396. }
  1397. .p-title {
  1398. width: 100%;
  1399. height: auto;
  1400. float: left;
  1401. position: relative;
  1402. .p-title-name {
  1403. width: 602rpx;
  1404. height: auto;
  1405. float: left;
  1406. line-height: 48rpx;
  1407. font-size: $font-size-28;
  1408. color: $text-color;
  1409. -o-text-overflow: ellipsis;
  1410. text-overflow: ellipsis;
  1411. display: -webkit-box;
  1412. word-break: break-all;
  1413. -webkit-box-orient: vertical;
  1414. -webkit-line-clamp: 2;
  1415. overflow: hidden;
  1416. &.indent {
  1417. text-indent: 95rpx;
  1418. }
  1419. }
  1420. .mclap-tag {
  1421. display: block;
  1422. width: 84rpx;
  1423. height: 32rpx;
  1424. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  1425. border-radius: 4rpx 48rpx 4px 4px;
  1426. line-height: 32rpx;
  1427. font-size: $font-size-22;
  1428. color: #ffffff;
  1429. text-align: center;
  1430. position: absolute;
  1431. left: 0;
  1432. top: 6rpx;
  1433. }
  1434. .p-title-share {
  1435. width: 96rpx;
  1436. height: 96rpx;
  1437. position: absolute;
  1438. right: 0;
  1439. text-align: center;
  1440. color: #999999;
  1441. font-size: $font-size-24;
  1442. box-sizing: border-box;
  1443. display: block;
  1444. background: transparent;
  1445. border-radius: 0;
  1446. border: 0;
  1447. margin: 0;
  1448. padding: 8rpx 0;
  1449. z-index: 980;
  1450. .icon-fenxiang1 {
  1451. font-size: $font-size-34;
  1452. }
  1453. }
  1454. .tui-share-btn::after {
  1455. border: 0;
  1456. }
  1457. }
  1458. .wrap-main-text {
  1459. line-height: 56rpx;
  1460. color: #ff2a2a;
  1461. font-size: $font-size-26;
  1462. display: block;
  1463. float: left;
  1464. font-weight: normal;
  1465. }
  1466. .wrap-main-none {
  1467. display: block;
  1468. width: 256rpx;
  1469. height: 44rpx;
  1470. padding-left: 20rpx;
  1471. border-radius: 11rpx;
  1472. background: $btn-confirm;
  1473. float: right;
  1474. line-height: 44rpx;
  1475. color: #ffffff;
  1476. text-align: center;
  1477. font-size: $font-size-24;
  1478. }
  1479. .p-price-none {
  1480. height: 44rpx;
  1481. line-height: 44rpx;
  1482. float: left;
  1483. font-size: $font-size-24;
  1484. color: #666;
  1485. text-decoration: line-through;
  1486. margin-left: 8rpx;
  1487. }
  1488. .p-minBuy {
  1489. height: 44rpx;
  1490. line-height: 44rpx;
  1491. float: right;
  1492. padding: 0 18rpx;
  1493. border-radius: 22rpx;
  1494. background-color: #f7f7f7;
  1495. color: #7f7f7f;
  1496. font-size: 24rpx;
  1497. text-align: center;
  1498. .min-text {
  1499. margin: 0 6rpx;
  1500. }
  1501. }
  1502. .p-login {
  1503. height: 56rpx;
  1504. line-height: 56rpx;
  1505. color: $color-system;
  1506. font-size: $font-size-24;
  1507. &.grade {
  1508. .price-left {
  1509. float: left;
  1510. .none {
  1511. display: block;
  1512. font-size: $font-size-20;
  1513. line-height: 48rpx;
  1514. color: #4a4b54;
  1515. float: left;
  1516. font-weight: bold;
  1517. margin-left: 5rpx;
  1518. text {
  1519. letter-spacing: 4rpx;
  1520. font-size: $font-size-32;
  1521. }
  1522. }
  1523. }
  1524. }
  1525. .p-no {
  1526. float: left;
  1527. margin-right: 5rpx;
  1528. font-size: $font-size-28;
  1529. color: $text-color;
  1530. }
  1531. .p-login-btn {
  1532. display: block;
  1533. height: 44rpx;
  1534. padding: 0 10rpx 0 20rpx;
  1535. border-radius: 11rpx;
  1536. background: $btn-confirm;
  1537. float: right;
  1538. line-height: 44rpx;
  1539. color: #ffffff;
  1540. text-align: center;
  1541. font-size: $font-size-24;
  1542. }
  1543. }
  1544. }
  1545. .wrap-label {
  1546. float: left;
  1547. width: 100%;
  1548. box-sizing: border-box;
  1549. .label-a {
  1550. padding: 0 18rpx;
  1551. line-height: 32rpx;
  1552. font-size: $font-size-20;
  1553. color: $color-system;
  1554. text-align: center;
  1555. border-radius: 6rpx;
  1556. background: #ffe6dc;
  1557. margin: 0 20rpx 15rpx 0;
  1558. display: inline-block;
  1559. }
  1560. }
  1561. .wrap-top-price {
  1562. float: left;
  1563. width: 100%;
  1564. box-sizing: border-box;
  1565. .wrap-main-item {
  1566. width: 100%;
  1567. height: 56rpx;
  1568. .p-price {
  1569. height: 56rpx;
  1570. line-height: 56rpx;
  1571. float: left;
  1572. color: #ff2a2a;
  1573. font-weight: bold;
  1574. &.none {
  1575. text-decoration: line-through;
  1576. color: #999999;
  1577. font-weight: normal;
  1578. }
  1579. .txt {
  1580. margin: 0 2rpx;
  1581. }
  1582. .txt.sm {
  1583. font-size: $font-size-26;
  1584. }
  1585. .txt.big {
  1586. font-size: $font-size-34;
  1587. }
  1588. }
  1589. }
  1590. .floor-item-act {
  1591. height: 56rpx;
  1592. text-align: center;
  1593. box-sizing: border-box;
  1594. float: left;
  1595. padding: 10rpx 0;
  1596. margin-left: 10rpx;
  1597. .floor-tags {
  1598. float: right;
  1599. height: 28rpx;
  1600. border-radius: 6rpx;
  1601. background-color: #ffffff;
  1602. line-height: 28rpx;
  1603. color: $color-system;
  1604. text-align: center;
  1605. display: inline-block;
  1606. padding: 0 16rpx;
  1607. font-size: $font-size-20;
  1608. margin-left: 15rpx;
  1609. border: 1px solid #e15616;
  1610. }
  1611. }
  1612. .floor-item-btn {
  1613. float: left;
  1614. height: 40rpx;
  1615. margin-top: 8rpx;
  1616. margin-left: 10rpx;
  1617. .btn {
  1618. line-height: 40rpx;
  1619. padding: 0 20rpx;
  1620. height: 40rpx;
  1621. background: $btn-confirm;
  1622. color: #ffffff;
  1623. font-size: $font-size-20;
  1624. border-radius: 4rpx;
  1625. }
  1626. }
  1627. }
  1628. .wrap-info {
  1629. float: left;
  1630. width: 702rpx;
  1631. padding: 24rpx 24rpx 0 24rpx;
  1632. border-bottom: 1px solid #f8f8f8;
  1633. .info-viewT {
  1634. width: 100%;
  1635. min-height: 40rpx;
  1636. font-size: $font-size-28;
  1637. color: $text-color;
  1638. line-height: 40rpx;
  1639. text-align: left;
  1640. &.none {
  1641. color: #999999;
  1642. }
  1643. .info-viewL {
  1644. min-width: 350rpx;
  1645. float: left;
  1646. margin-bottom: 24rpx;
  1647. }
  1648. .info-viewR {
  1649. min-width: 352rpx;
  1650. float: left;
  1651. margin-bottom: 24rpx;
  1652. }
  1653. }
  1654. .info-viewB {
  1655. width: 100%;
  1656. height: auto;
  1657. }
  1658. .info-f {
  1659. width: 50%;
  1660. float: left;
  1661. font-size: $font-size-28;
  1662. color: $text-color;
  1663. line-height: 40rpx;
  1664. margin-bottom: 24rpx;
  1665. text-align: left;
  1666. }
  1667. }
  1668. }
  1669. .product-seve {
  1670. width: 100%;
  1671. height: 60rpx;
  1672. background-color: #ffffff;
  1673. position: relative;
  1674. display: flex;
  1675. line-height: 60rpx;
  1676. .label {
  1677. font-size: $font-size-28;
  1678. color: #333333;
  1679. }
  1680. .iconfont {
  1681. color: #fea785;
  1682. margin-right: 20rpx;
  1683. font-size: $font-size-22;
  1684. }
  1685. .text {
  1686. font-size: $font-size-22;
  1687. color: #fea785;
  1688. margin-left: 10rpx;
  1689. }
  1690. }
  1691. .product-item-none {
  1692. min-height: 348rpx;
  1693. display: flex;
  1694. flex-direction: column;
  1695. align-items: center;
  1696. border-bottom: 20rpx solid #f7f7f7;
  1697. box-sizing: border-box;
  1698. padding: 40rpx 0;
  1699. .none-image {
  1700. width: 284rpx;
  1701. height: 225rpx;
  1702. }
  1703. .none-text {
  1704. text-align: center;
  1705. font-size: $font-size-28;
  1706. color: #fea785;
  1707. line-height: 40rpx;
  1708. }
  1709. }
  1710. .product-parameter {
  1711. width: 702rpx;
  1712. height: 90rpx;
  1713. padding: 0 24rpx;
  1714. background-color: #ffffff;
  1715. position: relative;
  1716. border-bottom: 20rpx solid #f7f7f7;
  1717. &.coupon {
  1718. .title {
  1719. color: #f94b4b;
  1720. }
  1721. .icon-xiayibu {
  1722. color: #f94b4b;
  1723. }
  1724. .coupon {
  1725. float: right;
  1726. box-sizing: border-box;
  1727. padding: 29rpx 0;
  1728. padding-right: 35rpx;
  1729. .tags {
  1730. height: 32rpx;
  1731. box-sizing: border-box;
  1732. border-radius: 8rpx;
  1733. background-color: #fff1eb;
  1734. line-height: 28rpx;
  1735. color: #f94b4b;
  1736. text-align: center;
  1737. display: inline-block;
  1738. padding: 0 10rpx;
  1739. font-size: $font-size-20;
  1740. border: 1px solid #f94b4b;
  1741. float: right;
  1742. margin: 0 6rpx;
  1743. }
  1744. }
  1745. }
  1746. .title {
  1747. line-height: 90rpx;
  1748. display: inline-block;
  1749. float: left;
  1750. font-size: $font-size-28;
  1751. color: #666666;
  1752. }
  1753. .name {
  1754. line-height: 90rpx;
  1755. display: inline-block;
  1756. float: left;
  1757. font-size: $font-size-28;
  1758. color: $text-color;
  1759. padding-right: 48rpx;
  1760. overflow: hidden;
  1761. text-overflow: ellipsis;
  1762. white-space: nowrap;
  1763. text-align: right;
  1764. }
  1765. .icon-xiayibu {
  1766. line-height: 90rpx;
  1767. display: inline-block;
  1768. position: absolute;
  1769. width: 48rpx;
  1770. top: 0;
  1771. right: 0;
  1772. color: #b2b2b2;
  1773. }
  1774. }
  1775. .product-supplier {
  1776. width: 100%;
  1777. height: 174rpx;
  1778. padding: 30rpx 24rpx;
  1779. box-sizing: border-box;
  1780. background-color: #ffffff;
  1781. position: relative;
  1782. box-sizing: border-box;
  1783. border-bottom: 20rpx solid #f7f7f7;
  1784. .logo {
  1785. width: 128rpx;
  1786. height: 92rpx;
  1787. float: left;
  1788. border: 1px solid #efefef;
  1789. border-radius: 6rpx;
  1790. image {
  1791. width: 100%;
  1792. height: 100%;
  1793. display: block;
  1794. border-radius: 6rpx;
  1795. }
  1796. }
  1797. .main {
  1798. width: 470rpx;
  1799. height: 92rpx;
  1800. float: left;
  1801. margin-left: 20rpx;
  1802. .name {
  1803. width: 100%;
  1804. line-height: 46rpx;
  1805. float: left;
  1806. font-size: $font-size-28;
  1807. color: $text-color;
  1808. float: right;
  1809. overflow: hidden;
  1810. text-overflow: ellipsis;
  1811. white-space: nowrap;
  1812. text-align: left;
  1813. }
  1814. .massgs {
  1815. width: 100%;
  1816. line-height: 46rpx;
  1817. float: left;
  1818. font-size: $font-size-24;
  1819. color: #999999;
  1820. .label {
  1821. float: left;
  1822. }
  1823. .p-stars {
  1824. float: left;
  1825. margin-left: 20rpx;
  1826. }
  1827. .acount {
  1828. float: right;
  1829. text {
  1830. color: $color-system;
  1831. }
  1832. }
  1833. }
  1834. }
  1835. .icon-xiayibu {
  1836. line-height: 154rpx;
  1837. display: inline-block;
  1838. position: absolute;
  1839. width: 48rpx;
  1840. top: 0;
  1841. right: 0;
  1842. color: #b2b2b2;
  1843. }
  1844. }
  1845. .product-details {
  1846. width: 100%;
  1847. background: #ffffff;
  1848. border-bottom: 20rpx solid #f7f7f7;
  1849. &.service {
  1850. border-bottom: none;
  1851. }
  1852. &.recommend {
  1853. background-color: #f7f7f7;
  1854. border-bottom: none;
  1855. .title {
  1856. .title-tab {
  1857. background-color: #f7f7f7;
  1858. color: $text-color;
  1859. }
  1860. }
  1861. }
  1862. .product-rich-text-none {
  1863. box-sizing: border-box;
  1864. padding: 0 24rpx;
  1865. text-align: left;
  1866. font-size: 24rpx;
  1867. color: #999999;
  1868. line-height: 60rpx;
  1869. }
  1870. .content-none {
  1871. width: 100%;
  1872. height: 80rpx;
  1873. line-height: 80rpx;
  1874. text-align: left;
  1875. font-size: $font-size-26;
  1876. color: #999999;
  1877. box-sizing: border-box;
  1878. padding: 0 24rpx;
  1879. }
  1880. .title {
  1881. width: 100%;
  1882. box-sizing: border-box;
  1883. padding: 0 24rpx;
  1884. .title-tab {
  1885. width: 100%;
  1886. height: 100rpx;
  1887. background: #fff;
  1888. z-index: 10;
  1889. font-size: $font-size-30;
  1890. text-align: left;
  1891. color: $text-color;
  1892. line-height: 100rpx;
  1893. font-weight: 600;
  1894. }
  1895. .title-msg {
  1896. width: 100%;
  1897. height: 236rpx;
  1898. padding: 18rpx;
  1899. background-color: rgba(225, 86, 22, 0.1);
  1900. color: $color-system;
  1901. box-sizing: border-box;
  1902. margin-bottom: 30rpx;
  1903. .tit {
  1904. line-height: 46rpx;
  1905. font-size: $font-size-24;
  1906. text-align: left;
  1907. }
  1908. .txt {
  1909. line-height: 38rpx;
  1910. font-size: $font-size-20;
  1911. text-align: justify;
  1912. }
  1913. }
  1914. }
  1915. .content {
  1916. width: 100%;
  1917. background-color: #ffffff;
  1918. }
  1919. }
  1920. .isLower {
  1921. width: 100%;
  1922. height: 116rpx;
  1923. line-height: 116rpx;
  1924. text-align: center;
  1925. color: #000000;
  1926. font-size: $font-size-32;
  1927. font-weight: bold;
  1928. }
  1929. .bottom-btn {
  1930. width: 100%;
  1931. height: 100rpx;
  1932. position: fixed;
  1933. bottom: 0;
  1934. left: 0;
  1935. background: #ffffff;
  1936. z-index: 99;
  1937. .bottom-le {
  1938. width: 300rpx;
  1939. height: 100rpx;
  1940. padding: 10rpx 20rpx 10rpx 0;
  1941. float: left;
  1942. box-sizing: border-box;
  1943. .item-bt {
  1944. width: 80rpx;
  1945. height: 100%;
  1946. margin-right: 15rpx;
  1947. display: flex;
  1948. float: left;
  1949. flex-direction: column;
  1950. align-items: center;
  1951. justify-content: center;
  1952. font-size: $font-size-22;
  1953. color: $text-color;
  1954. line-height: 34rpx;
  1955. position: relative;
  1956. .animation-num {
  1957. font-size: $font-size-32;
  1958. color: #ff2a2a;
  1959. position: absolute;
  1960. top: -12rpx;
  1961. right: 4rpx;
  1962. font-weight: bold;
  1963. }
  1964. .animation {
  1965. animation: showAmnation 2.2s ease-in-out both;
  1966. }
  1967. .restion {
  1968. animation: hideAmnation 1s ease-in-out both;
  1969. }
  1970. .icon-num {
  1971. position: absolute;
  1972. right: -12rpx;
  1973. top: -5rpx;
  1974. }
  1975. .icon-num.goleft {
  1976. right: 2rpx;
  1977. }
  1978. &:last-child {
  1979. margin-right: 0;
  1980. }
  1981. image {
  1982. width: 44rpx;
  1983. height: 44rpx;
  1984. }
  1985. button.contact-btn {
  1986. width: 100%;
  1987. height: 100%;
  1988. margin: 0;
  1989. padding: 0;
  1990. display: flex;
  1991. flex-direction: column;
  1992. align-items: center;
  1993. justify-content: center;
  1994. box-sizing: border-box;
  1995. font-size: $font-size-24;
  1996. text-align: center;
  1997. text-decoration: none;
  1998. line-height: 34rpx;
  1999. border-radius: 0;
  2000. -webkit-tap-highlight-color: transparent;
  2001. overflow: hidden;
  2002. color: $text-color;
  2003. background-color: #ffffff;
  2004. }
  2005. }
  2006. }
  2007. .bottom-ri {
  2008. width: 450rpx;
  2009. height: 100%;
  2010. float: right;
  2011. display: flex;
  2012. box-sizing: border-box;
  2013. padding: 13rpx 20rpx 13rpx 0;
  2014. .btn {
  2015. flex: 1;
  2016. width: 200rpx;
  2017. line-height: 80rpx;
  2018. text-align: center;
  2019. font-size: $font-size-24;
  2020. color: #ffffff;
  2021. }
  2022. .btn-cart {
  2023. background-color: #ffe6dc;
  2024. color: $color-system;
  2025. border-radius: 42rpx 0 0 42rpx;
  2026. }
  2027. .btn-cart.disabled {
  2028. background-color: #e1e1e1;
  2029. color: #ffffff;
  2030. }
  2031. .btn-bay {
  2032. background: linear-gradient(to right, #f28f31 0%, #e15616 100%);
  2033. border-radius: 0 42rpx 42rpx 0;
  2034. }
  2035. .btn-bay.disabled {
  2036. background: linear-gradient(135deg, rgba(242, 143, 49, 0.5) 0%, rgba(225, 86, 22, 0.5) 100%);
  2037. }
  2038. }
  2039. }
  2040. .uni-badge--small {
  2041. -webkit-transform: scale(0.8);
  2042. -ms-transform: scale(0.8);
  2043. transform: scale(0.8);
  2044. -webkit-transform-origin: center center;
  2045. -ms-transform-origin: center center;
  2046. transform-origin: center center;
  2047. }
  2048. .uni-badge {
  2049. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  2050. -webkit-box-sizing: border-box;
  2051. box-sizing: border-box;
  2052. font-size: 12px;
  2053. line-height: 1;
  2054. display: inline-block;
  2055. padding: 3px 6px;
  2056. color: #333;
  2057. border-radius: 100px;
  2058. background-color: #f1f1f1;
  2059. }
  2060. .uni-badge-error {
  2061. color: #fff;
  2062. background-color: #dd524d;
  2063. }
  2064. .product-topnav {
  2065. width: 100%;
  2066. height: 174rpx;
  2067. box-sizing: border-box;
  2068. background: #ffffff;
  2069. z-index: 990;
  2070. position: fixed;
  2071. opacity: 1;
  2072. left: 0;
  2073. &.fixed {
  2074. animation: showFixedColor 0.1s ease-in-out both;
  2075. }
  2076. &.none {
  2077. animation: hideFixedColor 0.1s ease-in-out both;
  2078. }
  2079. .navbar {
  2080. width: 100%;
  2081. height: 60rpx;
  2082. box-sizing: border-box;
  2083. padding: 0 24rpx;
  2084. display: flex;
  2085. .nav-item {
  2086. display: flex;
  2087. flex: 1;
  2088. justify-content: center;
  2089. align-items: center;
  2090. height: 60rpx;
  2091. font-size: $font-size-28;
  2092. color: $text-color;
  2093. position: relative;
  2094. float: left;
  2095. position: relative;
  2096. .line {
  2097. width: 60rpx;
  2098. height: 2px;
  2099. border-radius: 1px;
  2100. background: #ffffff;
  2101. position: absolute;
  2102. bottom: 0;
  2103. left: 50%;
  2104. margin-left: -30rpx;
  2105. }
  2106. &.current {
  2107. color: $color-system;
  2108. .line {
  2109. background: $color-system;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. .search-input {
  2115. width: 100%;
  2116. height: 114rpx;
  2117. padding: 24rpx;
  2118. box-sizing: border-box;
  2119. .gosearch-btn {
  2120. width: 100%;
  2121. height: 100%;
  2122. border-radius: 40rpx;
  2123. margin: 0 auto;
  2124. font-size: 26rpx;
  2125. line-height: 66rpx;
  2126. color: #b2b2b2;
  2127. position: relative;
  2128. box-sizing: border-box;
  2129. padding-left: 66rpx;
  2130. &.fixed {
  2131. background: rgba(70, 70, 70, 0.1);
  2132. }
  2133. &.none {
  2134. background: rgba(70, 70, 70, 0.1);
  2135. }
  2136. .search-icon {
  2137. width: 66rpx;
  2138. height: 66rpx;
  2139. position: absolute;
  2140. left: 0;
  2141. top: 2rpx;
  2142. text-align: center;
  2143. line-height: 66rpx;
  2144. .icon-iconfonticonfontsousuo1 {
  2145. margin: 0 6rpx;
  2146. font-size: $font-size-34;
  2147. color: #b2b2b2;
  2148. z-index: 10;
  2149. }
  2150. }
  2151. .search-text {
  2152. font-size: $font-size-24;
  2153. line-height: 66rpx;
  2154. color: #b2b2b2;
  2155. }
  2156. }
  2157. }
  2158. }
  2159. @keyframes showFixedColor {
  2160. 0% {
  2161. background: rgba(255, 255, 255, 0);
  2162. }
  2163. 50% {
  2164. background: rgba(255, 255, 255, 0.5);
  2165. }
  2166. 100% {
  2167. background: rgba(255, 255, 255, 1);
  2168. }
  2169. }
  2170. @keyframes hideFixedColor {
  2171. 0% {
  2172. background: rgba(255, 255, 255, 1);
  2173. }
  2174. 50% {
  2175. background: rgba(255, 255, 255, 0.5);
  2176. }
  2177. 100% {
  2178. background: rgba(255, 255, 255, 0);
  2179. }
  2180. }
  2181. /* 加入购物模态层*/
  2182. @keyframes showPopup {
  2183. 0% {
  2184. opacity: 0;
  2185. }
  2186. 100% {
  2187. opacity: 1;
  2188. }
  2189. }
  2190. @keyframes hidePopup {
  2191. 0% {
  2192. opacity: 1;
  2193. }
  2194. 100% {
  2195. opacity: 0;
  2196. }
  2197. }
  2198. @keyframes showLayer {
  2199. 0% {
  2200. transform: translateY(0);
  2201. }
  2202. 100% {
  2203. transform: translateY(-100%);
  2204. }
  2205. }
  2206. @keyframes hideLayer {
  2207. 0% {
  2208. transform: translateY(-100%);
  2209. }
  2210. 100% {
  2211. transform: translateY(0);
  2212. }
  2213. }
  2214. @keyframes showAmnation {
  2215. 0% {
  2216. top: -12rpx;
  2217. opacity: 0;
  2218. }
  2219. 50% {
  2220. top: -60rpx;
  2221. opacity: 1;
  2222. }
  2223. 100% {
  2224. top: -100rpx;
  2225. opacity: 0;
  2226. }
  2227. }
  2228. @keyframes hideAmnation {
  2229. 0% {
  2230. top: -100rpx;
  2231. opacity: 0;
  2232. }
  2233. 100% {
  2234. top: -12rpx;
  2235. opacity: 0;
  2236. }
  2237. }
  2238. .popup {
  2239. position: fixed;
  2240. top: 0;
  2241. width: 100%;
  2242. height: 100%;
  2243. z-index: 999;
  2244. display: none;
  2245. .mask {
  2246. position: fixed;
  2247. top: 0;
  2248. width: 100%;
  2249. height: 100%;
  2250. z-index: 21;
  2251. background-color: rgba(0, 0, 0, 0.6);
  2252. }
  2253. .layer {
  2254. position: fixed;
  2255. z-index: 22;
  2256. bottom: -294rpx;
  2257. width: 702rpx;
  2258. padding: 24rpx 24rpx 36rpx 24rpx;
  2259. height: 260rpx;
  2260. border-radius: 20rpx 20rpx 0 0;
  2261. background-color: #fff;
  2262. display: flex;
  2263. flex-wrap: wrap;
  2264. align-content: space-between;
  2265. .content {
  2266. width: 100%;
  2267. }
  2268. .btn {
  2269. width: 100%;
  2270. height: 88rpx;
  2271. margin-top: 20rpx;
  2272. .button {
  2273. width: 100%;
  2274. height: 88rpx;
  2275. color: #fff;
  2276. display: flex;
  2277. align-items: center;
  2278. justify-content: center;
  2279. background: $btn-confirm;
  2280. font-size: $font-size-28;
  2281. border-radius: 44rpx;
  2282. }
  2283. }
  2284. }
  2285. &.show {
  2286. display: block;
  2287. .mask {
  2288. animation: showPopup 0.2s linear both;
  2289. }
  2290. .layer {
  2291. animation: showLayer 0.2s linear both;
  2292. }
  2293. }
  2294. &.hide {
  2295. display: block;
  2296. .mask {
  2297. animation: hidePopup 0.2s linear both;
  2298. }
  2299. .layer {
  2300. animation: hideLayer 0.2s linear both;
  2301. }
  2302. }
  2303. &.none {
  2304. display: none;
  2305. }
  2306. &.service {
  2307. .row {
  2308. margin: 30upx 0;
  2309. .title {
  2310. font-size: 30upx;
  2311. margin: 10upx 0;
  2312. }
  2313. .description {
  2314. font-size: 28upx;
  2315. color: #999;
  2316. }
  2317. }
  2318. }
  2319. .layer-smimg {
  2320. width: 114rpx;
  2321. height: 114rpx;
  2322. float: left;
  2323. border-radius: 10rpx;
  2324. margin-right: 24rpx;
  2325. image {
  2326. width: 114rpx;
  2327. height: 114rpx;
  2328. border-radius: 10rpx;
  2329. }
  2330. }
  2331. .layer-nunbox {
  2332. justify-content: space-between;
  2333. align-items: center;
  2334. width: 536rpx;
  2335. height: auto;
  2336. float: left;
  2337. .layer-nunbox-t {
  2338. width: 100%;
  2339. height: 44rpx;
  2340. position: relative;
  2341. display: flex;
  2342. margin-bottom: 10rpx;
  2343. .text {
  2344. font-size: $font-size-24;
  2345. line-height: 48rpx;
  2346. color: #999999;
  2347. }
  2348. .layer-nunbox-text {
  2349. line-height: 44rpx;
  2350. font-size: $font-size-28;
  2351. }
  2352. .number-box {
  2353. display: flex;
  2354. justify-content: center;
  2355. align-items: center;
  2356. border: 2rpx solid #ffe6dc;
  2357. border-radius: 30rpx;
  2358. height: 48rpx;
  2359. margin-left: 20rpx;
  2360. .iconfont {
  2361. font-size: $font-size-24;
  2362. padding: 0 18rpx;
  2363. color: #999999;
  2364. text-align: center;
  2365. line-height: 48rpx;
  2366. font-weight: bold;
  2367. background: #fef6f3;
  2368. &.icon-jianhao {
  2369. border-radius: 30rpx 0 0 30rpx;
  2370. }
  2371. &.icon-jiahao {
  2372. border-radius: 0 30rpx 30rpx 0;
  2373. }
  2374. }
  2375. .btn-input {
  2376. width: 62rpx;
  2377. height: 48rpx;
  2378. line-height: 48rpx;
  2379. background: #ffffff;
  2380. border-radius: 4rpx;
  2381. text-align: center;
  2382. font-size: $font-size-28;
  2383. }
  2384. }
  2385. .product-step {
  2386. position: absolute;
  2387. left: 45rpx;
  2388. bottom: 0;
  2389. height: 44rpx;
  2390. background: #ffffff;
  2391. }
  2392. }
  2393. .layer-nunbox-b {
  2394. width: 100%;
  2395. height: 44rpx;
  2396. margin-top: 13rpx;
  2397. }
  2398. .text {
  2399. line-height: 44rpx;
  2400. font-size: $font-size-28;
  2401. .p {
  2402. color: #ff2a2a;
  2403. }
  2404. .p:first-child {
  2405. margin-left: 30rpx;
  2406. }
  2407. .p.sm {
  2408. font-size: $font-size-24;
  2409. }
  2410. }
  2411. }
  2412. }
  2413. .tui-popup-box {
  2414. position: relative;
  2415. box-sizing: border-box;
  2416. min-height: 220rpx;
  2417. padding: 24rpx 24rpx 0 24rpx;
  2418. .tui-popup-close {
  2419. width: 90rpx;
  2420. height: 90rpx;
  2421. position: absolute;
  2422. right: 0;
  2423. top: 24rpx;
  2424. line-height: 90rpx;
  2425. text-align: center;
  2426. color: #b2b2b2;
  2427. .icon-iconfontguanbi {
  2428. font-size: $font-size-40;
  2429. }
  2430. }
  2431. .title {
  2432. font-size: $font-size-34;
  2433. color: $text-color;
  2434. line-height: 88rpx;
  2435. text-align: center;
  2436. float: left;
  2437. width: 100%;
  2438. height: 88rpx;
  2439. font-weight: bold;
  2440. }
  2441. .tui-popup-main {
  2442. width: 100%;
  2443. float: left;
  2444. &.coupon {
  2445. padding-bottom: 40rpx;
  2446. .coupon-empty {
  2447. width: 100%;
  2448. height: 600rpx;
  2449. display: flex;
  2450. align-items: center;
  2451. justify-content: center;
  2452. flex-direction: column;
  2453. position: fixed;
  2454. background: $bg-color;
  2455. .empty-container-image {
  2456. width: 150rpx;
  2457. height: 150rpx;
  2458. margin-bottom: 0;
  2459. margin-top: 0;
  2460. }
  2461. .error-text {
  2462. font-size: $font-size-28;
  2463. color: #999999;
  2464. line-height: 88rpx;
  2465. }
  2466. }
  2467. }
  2468. .tui-popup-scroll {
  2469. width: 100%;
  2470. height: 600rpx;
  2471. .coupon-list {
  2472. width: 100%;
  2473. height: 200rpx;
  2474. margin-top: 24rpx;
  2475. box-sizing: border-box;
  2476. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  2477. background-size: cover;
  2478. &:last-child {
  2479. margin-bottom: 24rpx;
  2480. }
  2481. .list-cell-le {
  2482. width: 224rpx;
  2483. height: 100%;
  2484. box-sizing: border-box;
  2485. padding: 37rpx 0;
  2486. float: left;
  2487. .coupon-maxMoney {
  2488. width: 100%;
  2489. height: 78rpx;
  2490. line-height: 78rpx;
  2491. font-size: 56rpx;
  2492. color: #ffffff;
  2493. text-align: center;
  2494. .small {
  2495. font-size: $font-size-24;
  2496. }
  2497. }
  2498. .coupon-minMoney {
  2499. width: 100%;
  2500. height: 33rpx;
  2501. line-height: 33rpx;
  2502. font-size: $font-size-24;
  2503. color: #ffffff;
  2504. text-align: center;
  2505. }
  2506. }
  2507. .list-cell-ri {
  2508. width: 478rpx;
  2509. height: 100%;
  2510. box-sizing: border-box;
  2511. padding: 20rpx 24rpx 0 24rpx;
  2512. float: right;
  2513. .list-cell-top {
  2514. width: 100%;
  2515. height: 121rpx;
  2516. float: left;
  2517. border-bottom: 1px solid #e1e1e1;
  2518. .list-cell-type {
  2519. width: 286rpx;
  2520. height: 100%;
  2521. float: left;
  2522. .list-cell-tags {
  2523. width: 100%;
  2524. height: 32rpx;
  2525. margin-bottom: 7rpx;
  2526. .tags {
  2527. display: inline-block;
  2528. padding: 0 10rpx;
  2529. height: 32rpx;
  2530. line-height: 32rpx;
  2531. background-color: #ffdcce;
  2532. color: #f94b4b;
  2533. font-size: $font-size-20;
  2534. border-radius: 8rpx;
  2535. text-align: center;
  2536. float: left;
  2537. }
  2538. }
  2539. .list-cell-texts {
  2540. width: 100%;
  2541. height: auto;
  2542. line-height: 35rpx;
  2543. text-overflow: ellipsis;
  2544. display: -webkit-box;
  2545. word-break: break-all;
  2546. -webkit-box-orient: vertical;
  2547. -webkit-line-clamp: 2;
  2548. overflow: hidden;
  2549. font-size: 26rpx;
  2550. color: #333333;
  2551. }
  2552. }
  2553. .list-cell-btn {
  2554. width: 128rpx;
  2555. height: 100%;
  2556. float: right;
  2557. .icon-used {
  2558. width: 100%;
  2559. height: 100%;
  2560. box-sizing: border-box;
  2561. padding-top: 57rpx;
  2562. .icon-used-btn {
  2563. width: 128rpx;
  2564. height: 48rpx;
  2565. border-radius: 28rpx;
  2566. line-height: 48rpx;
  2567. font-size: $font-size-26;
  2568. text-align: center;
  2569. &.receive {
  2570. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);
  2571. color: #ffffff;
  2572. }
  2573. &.make {
  2574. border: solid 1px #f94b4b;
  2575. color: #f94b4b;
  2576. }
  2577. }
  2578. }
  2579. }
  2580. }
  2581. .list-cell-time {
  2582. width: 100%;
  2583. height: 58rpx;
  2584. line-height: 58rpx;
  2585. text-align: left;
  2586. font-size: $font-size-20;
  2587. color: #999999;
  2588. }
  2589. }
  2590. }
  2591. &.train {
  2592. height: 240rpx;
  2593. }
  2594. .content-tr {
  2595. width: 100%;
  2596. min-height: 58rpx;
  2597. line-height: 58rpx;
  2598. display: flex;
  2599. .content-td {
  2600. display: flex;
  2601. flex: 3;
  2602. font-size: $font-size-26;
  2603. color: #999999;
  2604. line-height: 58rpx;
  2605. text-align: left;
  2606. }
  2607. .content-th {
  2608. display: flex;
  2609. flex: 7;
  2610. font-size: $font-size-26;
  2611. color: #333333;
  2612. line-height: 58rpx;
  2613. text-align: left;
  2614. padding-left: 10rpx;
  2615. }
  2616. }
  2617. }
  2618. }
  2619. }
  2620. .tui-popup-btn {
  2621. width: 100%;
  2622. height: auto;
  2623. float: left;
  2624. margin-top: 24rpx;
  2625. .tui-button {
  2626. width: 100%;
  2627. height: 88rpx;
  2628. background: $btn-confirm;
  2629. line-height: 88rpx;
  2630. text-align: center;
  2631. color: #ffffff;
  2632. font-size: $font-size-28;
  2633. border-radius: 44rpx;
  2634. }
  2635. }
  2636. /*富文本样式*/
  2637. rich-text.p {
  2638. width: 702rpx !important;
  2639. padding: 0 24rpx;
  2640. text-align: justify;
  2641. }
  2642. rich-text.img {
  2643. width: 100%;
  2644. height: auto;
  2645. }
  2646. </style>