product.vue 63 KB

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