product.vue 94 KB

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