product.vue 64 KB

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