product.vue 66 KB

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