product.vue 65 KB

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