product.vue 64 KB

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