product.vue 65 KB

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