product.vue 94 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619
  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. allPrice: this.number * this.buyRetailPrice,
  1045. allCount: this.number,
  1046. productID: this.product.productId,
  1047. productCount: this.number
  1048. }
  1049. this.$api.navigateTo(
  1050. `/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({ data: productStp })}`
  1051. )
  1052. setTimeout(() => {
  1053. this.specClass = 'none'
  1054. }, 200)
  1055. },
  1056. getAddProductCart() {
  1057. //增加购物车成功和toast弹窗提示成功
  1058. this.ProductService.shoppingAddCart({
  1059. productID: this.productId,
  1060. userID: this.userId,
  1061. productCount: this.number
  1062. })
  1063. .then(response => {
  1064. this.specClass = 'hide'
  1065. this.$util.msg('加入购物车成功', 1500, true, 'success')
  1066. this.isAnimation = true
  1067. setTimeout(() => {
  1068. this.specClass = 'none'
  1069. }, 200)
  1070. setTimeout(() => {
  1071. this.isAnimation = false
  1072. }, 2000)
  1073. this.bottomCartNumber = response.data
  1074. })
  1075. .catch(error => {
  1076. this.$util.msg(error.msg, 2000)
  1077. })
  1078. },
  1079. setHeaderBtnPosi() {
  1080. // 获得胶囊按钮位置信息
  1081. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  1082. return headerBtnPosi
  1083. },
  1084. setSysteminfo() {
  1085. let systeminfo
  1086. uni.getSystemInfo({
  1087. // 获取设备信息
  1088. success: res => {
  1089. systeminfo = res
  1090. }
  1091. })
  1092. return systeminfo
  1093. },
  1094. goIndex() {
  1095. //商城首页
  1096. uni.switchTab({
  1097. url: '/pages/tabBar/home/index'
  1098. })
  1099. },
  1100. goSupplier() {
  1101. //跳供应商资料页
  1102. this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=' + this.shopId)
  1103. },
  1104. discard() {
  1105. //丢弃
  1106. },
  1107. onShare(res) {
  1108. //分享转发
  1109. if (res.from === 'button') {
  1110. // 来自页面内转发按钮
  1111. }
  1112. return {
  1113. title: `${this.product.name}`,
  1114. path: `pages/goods/product?type=share&id=${this.productId}`,
  1115. imageUrl: `${this.productImage[0]}`
  1116. }
  1117. },
  1118. showPopup(index) {
  1119. switch (index) {
  1120. case 0:
  1121. this.popupShow0 = true
  1122. break
  1123. case 1:
  1124. this.popupShow1 = true
  1125. break
  1126. case 2:
  1127. if (this.hasLogin) {
  1128. this.queryPopupCoupons()
  1129. this.popupShow2 = true
  1130. } else {
  1131. this.$api.navigateTo('/pages/login/login')
  1132. }
  1133. break
  1134. }
  1135. },
  1136. hidePopup(index) {
  1137. switch (index) {
  1138. case 0:
  1139. this.popupShow0 = false
  1140. break
  1141. case 1:
  1142. this.popupShow1 = false
  1143. break
  1144. case 2:
  1145. this.popupShow2 = false
  1146. break
  1147. }
  1148. },
  1149. couponChange(e) {
  1150. this.currentTab = e.index
  1151. switch (this.currentTab) {
  1152. case 0:
  1153. this.couponParam.status = 1
  1154. this.queryPopupCoupons()
  1155. break
  1156. case 1:
  1157. this.couponParam.status = 2
  1158. this.queryPopupCoupons()
  1159. break
  1160. }
  1161. },
  1162. // 获取每个tab对应区域的区间
  1163. async getSectionProps() {
  1164. const sectionPropsArr = [],
  1165. scrollTopArray = [],
  1166. className = 'product-details'
  1167. // 获取相关节点元素信息
  1168. const productMain = await this.$util.boundingClientRect(this, '.container-product-main', false)
  1169. const productDetail = await this.$util.boundingClientRect(this, '.product-details', true)
  1170. const topBar = await this.$util.boundingClientRect(this, '#topBar', false)
  1171. /*
  1172. 说明:采用累加方式来计算每一个 prdocut-details 的 scrollTop 定位
  1173. scrollTop = 上一个的scrollTop + 上一个的高度
  1174. */
  1175. productDetail.forEach((item, index) => {
  1176. // 上一个 prdocut-details 的 scrollTop 值
  1177. const prev = sectionPropsArr[index - 1]
  1178. const prevScrollTop = prev ? prev.scrollTop : productMain.height
  1179. // 上一个 prdocut-details 的高度
  1180. const add = productDetail[index - 1]
  1181. // 第一个需要减去tabs的高度
  1182. const addHeight = index === 0 ? (add ? add.height : 0) - topBar.height : add ? add.height : 0
  1183. sectionPropsArr.push({
  1184. className: `${className}-${index}`,
  1185. scrollTop: prevScrollTop + addHeight
  1186. })
  1187. // - topBar.height
  1188. })
  1189. this.sectionPropsArr = sectionPropsArr
  1190. console.log('更新tab影响区域')
  1191. },
  1192. //当滑动时也能同步激活tab
  1193. activeTab: debounce(
  1194. (top, _this) => {
  1195. const { sectionPropsArr } = _this
  1196. if (sectionPropsArr.length > 0) {
  1197. sectionPropsArr.forEach((item, index) => {
  1198. // 当前位置为开始位置, 下个起始位置为结束位置
  1199. const openInterval = (index === 0 ? 0 : item.scrollTop) - 20 // 自定义偏移
  1200. const next = sectionPropsArr[index + 1]
  1201. const closedInterval = (next ? next.scrollTop : 10000000) - 20 // 自定义偏移
  1202. if (top >= openInterval && top < closedInterval) {
  1203. _this.tabCurrentIndex = index
  1204. }
  1205. })
  1206. }
  1207. },
  1208. 100,
  1209. true
  1210. ),
  1211. getWinHeight() {
  1212. this.winHeight = wx.getSystemInfoSync().windowHeight
  1213. },
  1214. changePreViewImageStatus(falg){
  1215. this.isPreviewImage = falg
  1216. }
  1217. },
  1218. onPageScroll(e) {
  1219. //实时获取到滚动的值
  1220. const { scrollTop } = e
  1221. if (!this.tabSelectFlag) {
  1222. this.activeTab(scrollTop, this)
  1223. }
  1224. if (e.scrollTop > 60) {
  1225. this.headerColor = true
  1226. this.navbarFiexd = 'fixed'
  1227. this.isNavbarFiexd = true
  1228. this.nvabarData = {
  1229. showCapsule: 1,
  1230. title: '商品详情'
  1231. }
  1232. } else {
  1233. this.headerColor = false
  1234. this.isNavbarFiexd = false
  1235. this.navbarFiexd = 'none'
  1236. this.nvabarData = {
  1237. showCapsule: 1,
  1238. title: ''
  1239. }
  1240. }
  1241. if (e.scrollTop > 700) {
  1242. this.isScrollTop = true
  1243. } else {
  1244. this.isScrollTop = false
  1245. }
  1246. },
  1247. onShareAppMessage(res) {
  1248. //分享转发
  1249. if (res.from === 'button') {
  1250. // 来自页面内转发按钮
  1251. }
  1252. return {
  1253. title: `${this.product.name}`,
  1254. path: `pages/goods/product?type=share&id=${this.productId}`,
  1255. imageUrl: `${this.productImage[0]}`
  1256. }
  1257. },
  1258. onShow() {
  1259. // 是否开启图片预览 true 不刷新调用接口 false刷新调用接口
  1260. if(!this.isPreviewImage){
  1261. this.$api
  1262. .getStorage()
  1263. .then(resolve => {
  1264. this.userId = this.couponParam.userId = resolve.userId ? resolve.userId : ''
  1265. this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
  1266. this.shopID = resolve.shopId ? resolve.shopId : ''
  1267. if (this.userIdentity == 0 || this.userIdentity == 2 || this.userIdentity == 4) {
  1268. this.isShowButton = true
  1269. } else {
  1270. this.isShowButton = false
  1271. }
  1272. if (isPreviewImg) {
  1273. isPreviewImg = false
  1274. return
  1275. } else {
  1276. this.initData()
  1277. }
  1278. })
  1279. .catch(error => {
  1280. this.initData()
  1281. })
  1282. }
  1283. this.isPreviewImage = false
  1284. },
  1285. created() {}
  1286. }
  1287. </script>
  1288. <style lang="scss">
  1289. page {
  1290. background-color: #ffffff;
  1291. }
  1292. .banner-section {
  1293. width: 100%;
  1294. height: 750rpx;
  1295. position: relative;
  1296. }
  1297. .banner {
  1298. width: 100%;
  1299. height: 750rpx;
  1300. .product-img {
  1301. width: 750rpx;
  1302. }
  1303. image {
  1304. width: 100%;
  1305. height: 100%;
  1306. }
  1307. .banner-item {
  1308. position: relative;
  1309. .cm-product-cover {
  1310. position: absolute;
  1311. right: 30rpx;
  1312. top: 30rpx;
  1313. width: 147rpx;
  1314. height: 57rpx;
  1315. line-height: 57rpx;
  1316. font-size: 24rpx;
  1317. color: #fff;
  1318. text-align: center;
  1319. background: url(https://static.caimei365.com/app/img/icon2/cm_cover_bg_app.png) no-repeat center;
  1320. background-size: 147rpx;
  1321. }
  1322. }
  1323. }
  1324. .swiper__dots-box {
  1325. position: absolute;
  1326. color: #fff;
  1327. bottom: 30rpx;
  1328. right: 0;
  1329. }
  1330. .product-wrap {
  1331. width: 100%;
  1332. height: auto;
  1333. padding: 24rpx 0 0 0;
  1334. background-color: #ffffff;
  1335. border-bottom: 20rpx solid #f7f7f7;
  1336. .productRemarks {
  1337. height: 48rpx;
  1338. width: 100%;
  1339. float: left;
  1340. line-height: 48rpx;
  1341. font-size: 24rpx;
  1342. color: #999999;
  1343. text-align: left;
  1344. }
  1345. .wrap-top {
  1346. width: 702rpx;
  1347. padding: 0 24rpx;
  1348. height: auto;
  1349. float: left;
  1350. padding-bottom: 20rpx;
  1351. border-bottom: 1px solid #f8f8f8;
  1352. &.none {
  1353. .p-title {
  1354. color: #999999;
  1355. }
  1356. }
  1357. .p-title {
  1358. width: 100%;
  1359. height: auto;
  1360. float: left;
  1361. position: relative;
  1362. .p-title-name {
  1363. width: 602rpx;
  1364. height: auto;
  1365. float: left;
  1366. line-height: 48rpx;
  1367. font-size: $font-size-28;
  1368. color: $text-color;
  1369. -o-text-overflow: ellipsis;
  1370. text-overflow: ellipsis;
  1371. display: -webkit-box;
  1372. word-break: break-all;
  1373. -webkit-box-orient: vertical;
  1374. -webkit-line-clamp: 2;
  1375. overflow: hidden;
  1376. &.indent {
  1377. text-indent: 95rpx;
  1378. }
  1379. }
  1380. .mclap-tag {
  1381. display: block;
  1382. width: 84rpx;
  1383. height: 32rpx;
  1384. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  1385. border-radius: 4rpx 48rpx 4px 4px;
  1386. line-height: 32rpx;
  1387. font-size: $font-size-22;
  1388. color: #ffffff;
  1389. text-align: center;
  1390. position: absolute;
  1391. left: 0;
  1392. top: 6rpx;
  1393. }
  1394. .p-title-share {
  1395. width: 96rpx;
  1396. height: 96rpx;
  1397. position: absolute;
  1398. right: 0;
  1399. text-align: center;
  1400. color: #999999;
  1401. font-size: $font-size-24;
  1402. box-sizing: border-box;
  1403. display: block;
  1404. background: transparent;
  1405. border-radius: 0;
  1406. border: 0;
  1407. margin: 0;
  1408. padding: 8rpx 0;
  1409. z-index: 980;
  1410. .icon-fenxiang1 {
  1411. font-size: $font-size-34;
  1412. }
  1413. }
  1414. .tui-share-btn::after {
  1415. border: 0;
  1416. }
  1417. }
  1418. .wrap-main-text {
  1419. line-height: 56rpx;
  1420. color: #ff2a2a;
  1421. font-size: $font-size-26;
  1422. display: block;
  1423. float: left;
  1424. font-weight: normal;
  1425. }
  1426. .wrap-main-none {
  1427. display: block;
  1428. width: 256rpx;
  1429. height: 44rpx;
  1430. padding-left: 20rpx;
  1431. border-radius: 11rpx;
  1432. background: $btn-confirm;
  1433. float: right;
  1434. line-height: 44rpx;
  1435. color: #ffffff;
  1436. text-align: center;
  1437. font-size: $font-size-24;
  1438. }
  1439. .p-price-none {
  1440. height: 44rpx;
  1441. line-height: 44rpx;
  1442. float: left;
  1443. font-size: $font-size-24;
  1444. color: #666;
  1445. text-decoration: line-through;
  1446. margin-left: 8rpx;
  1447. }
  1448. .p-minBuy {
  1449. height: 44rpx;
  1450. line-height: 44rpx;
  1451. float: right;
  1452. padding: 0 18rpx;
  1453. border-radius: 22rpx;
  1454. background-color: #f7f7f7;
  1455. color: #7f7f7f;
  1456. font-size: 24rpx;
  1457. text-align: center;
  1458. .min-text {
  1459. margin: 0 6rpx;
  1460. }
  1461. }
  1462. .p-login {
  1463. height: 56rpx;
  1464. line-height: 56rpx;
  1465. color: $color-system;
  1466. font-size: $font-size-24;
  1467. &.grade {
  1468. .price-left {
  1469. float: left;
  1470. .none {
  1471. display: block;
  1472. font-size: $font-size-20;
  1473. line-height: 48rpx;
  1474. color: #4a4b54;
  1475. float: left;
  1476. font-weight: bold;
  1477. margin-left: 5rpx;
  1478. text {
  1479. letter-spacing: 4rpx;
  1480. font-size: $font-size-32;
  1481. }
  1482. }
  1483. }
  1484. }
  1485. .p-no {
  1486. float: left;
  1487. margin-right: 5rpx;
  1488. font-size: $font-size-28;
  1489. color: $text-color;
  1490. }
  1491. .p-login-btn {
  1492. display: block;
  1493. height: 44rpx;
  1494. padding: 0 10rpx 0 20rpx;
  1495. border-radius: 11rpx;
  1496. background: $btn-confirm;
  1497. float: right;
  1498. line-height: 44rpx;
  1499. color: #ffffff;
  1500. text-align: center;
  1501. font-size: $font-size-24;
  1502. }
  1503. }
  1504. }
  1505. .wrap-label {
  1506. float: left;
  1507. width: 100%;
  1508. box-sizing: border-box;
  1509. .label-a {
  1510. padding: 0 18rpx;
  1511. line-height: 32rpx;
  1512. font-size: $font-size-20;
  1513. color: $color-system;
  1514. text-align: center;
  1515. border-radius: 6rpx;
  1516. background: #ffe6dc;
  1517. margin: 0 20rpx 15rpx 0;
  1518. display: inline-block;
  1519. }
  1520. }
  1521. .wrap-top-price {
  1522. float: left;
  1523. width: 100%;
  1524. box-sizing: border-box;
  1525. .wrap-main-item {
  1526. width: 100%;
  1527. height: 56rpx;
  1528. .p-price {
  1529. height: 56rpx;
  1530. line-height: 56rpx;
  1531. float: left;
  1532. color: #ff2a2a;
  1533. font-weight: bold;
  1534. &.none {
  1535. text-decoration: line-through;
  1536. color: #999999;
  1537. font-weight: normal;
  1538. }
  1539. .txt {
  1540. margin: 0 2rpx;
  1541. }
  1542. .txt.sm {
  1543. font-size: $font-size-26;
  1544. }
  1545. .txt.big {
  1546. font-size: $font-size-34;
  1547. }
  1548. }
  1549. }
  1550. .floor-item-act {
  1551. height: 56rpx;
  1552. text-align: center;
  1553. box-sizing: border-box;
  1554. float: left;
  1555. padding: 10rpx 0;
  1556. margin-left: 10rpx;
  1557. .floor-tags {
  1558. float: right;
  1559. height: 28rpx;
  1560. border-radius: 6rpx;
  1561. background-color: #ffffff;
  1562. line-height: 28rpx;
  1563. color: $color-system;
  1564. text-align: center;
  1565. display: inline-block;
  1566. padding: 0 16rpx;
  1567. font-size: $font-size-20;
  1568. margin-left: 15rpx;
  1569. border: 1px solid #e15616;
  1570. }
  1571. }
  1572. .floor-item-btn {
  1573. float: left;
  1574. height: 40rpx;
  1575. margin-top: 8rpx;
  1576. margin-left: 10rpx;
  1577. .btn {
  1578. line-height: 40rpx;
  1579. padding: 0 20rpx;
  1580. height: 40rpx;
  1581. background: $btn-confirm;
  1582. color: #ffffff;
  1583. font-size: $font-size-20;
  1584. border-radius: 4rpx;
  1585. }
  1586. }
  1587. }
  1588. .wrap-info {
  1589. float: left;
  1590. width: 702rpx;
  1591. padding: 24rpx 24rpx 0 24rpx;
  1592. border-bottom: 1px solid #f8f8f8;
  1593. .info-viewT {
  1594. width: 100%;
  1595. min-height: 40rpx;
  1596. font-size: $font-size-28;
  1597. color: $text-color;
  1598. line-height: 40rpx;
  1599. text-align: left;
  1600. &.none {
  1601. color: #999999;
  1602. }
  1603. .info-viewL {
  1604. min-width: 350rpx;
  1605. float: left;
  1606. margin-bottom: 24rpx;
  1607. }
  1608. .info-viewR {
  1609. min-width: 352rpx;
  1610. float: left;
  1611. margin-bottom: 24rpx;
  1612. }
  1613. }
  1614. .info-viewB {
  1615. width: 100%;
  1616. height: auto;
  1617. }
  1618. .info-f {
  1619. width: 50%;
  1620. float: left;
  1621. font-size: $font-size-28;
  1622. color: $text-color;
  1623. line-height: 40rpx;
  1624. margin-bottom: 24rpx;
  1625. text-align: left;
  1626. }
  1627. }
  1628. }
  1629. .product-seve {
  1630. width: 100%;
  1631. height: 60rpx;
  1632. background-color: #ffffff;
  1633. position: relative;
  1634. display: flex;
  1635. line-height: 60rpx;
  1636. .label {
  1637. font-size: $font-size-28;
  1638. color: #333333;
  1639. }
  1640. .iconfont {
  1641. color: #fea785;
  1642. margin-right: 20rpx;
  1643. font-size: $font-size-22;
  1644. }
  1645. .text {
  1646. font-size: $font-size-22;
  1647. color: #fea785;
  1648. margin-left: 10rpx;
  1649. }
  1650. }
  1651. .product-item-none {
  1652. min-height: 348rpx;
  1653. display: flex;
  1654. flex-direction: column;
  1655. align-items: center;
  1656. border-bottom: 20rpx solid #f7f7f7;
  1657. box-sizing: border-box;
  1658. padding: 40rpx 0;
  1659. .none-image {
  1660. width: 284rpx;
  1661. height: 225rpx;
  1662. }
  1663. .none-text {
  1664. text-align: center;
  1665. font-size: $font-size-28;
  1666. color: #fea785;
  1667. line-height: 40rpx;
  1668. }
  1669. }
  1670. .product-parameter {
  1671. width: 702rpx;
  1672. height: 90rpx;
  1673. padding: 0 24rpx;
  1674. background-color: #ffffff;
  1675. position: relative;
  1676. border-bottom: 20rpx solid #f7f7f7;
  1677. &.coupon {
  1678. .title {
  1679. color: #f94b4b;
  1680. }
  1681. .icon-xiayibu {
  1682. color: #f94b4b;
  1683. }
  1684. .coupon {
  1685. float: right;
  1686. box-sizing: border-box;
  1687. padding: 29rpx 0;
  1688. padding-right: 35rpx;
  1689. .tags {
  1690. height: 32rpx;
  1691. box-sizing: border-box;
  1692. border-radius: 8rpx;
  1693. background-color: #fff1eb;
  1694. line-height: 28rpx;
  1695. color: #f94b4b;
  1696. text-align: center;
  1697. display: inline-block;
  1698. padding: 0 10rpx;
  1699. font-size: $font-size-20;
  1700. border: 1px solid #f94b4b;
  1701. float: right;
  1702. margin: 0 6rpx;
  1703. }
  1704. }
  1705. }
  1706. .title {
  1707. line-height: 90rpx;
  1708. display: inline-block;
  1709. float: left;
  1710. font-size: $font-size-28;
  1711. color: #666666;
  1712. }
  1713. .name {
  1714. line-height: 90rpx;
  1715. display: inline-block;
  1716. float: left;
  1717. font-size: $font-size-28;
  1718. color: $text-color;
  1719. padding-right: 48rpx;
  1720. overflow: hidden;
  1721. text-overflow: ellipsis;
  1722. white-space: nowrap;
  1723. text-align: right;
  1724. }
  1725. .icon-xiayibu {
  1726. line-height: 90rpx;
  1727. display: inline-block;
  1728. position: absolute;
  1729. width: 48rpx;
  1730. top: 0;
  1731. right: 0;
  1732. color: #b2b2b2;
  1733. }
  1734. }
  1735. .product-supplier {
  1736. width: 100%;
  1737. height: 174rpx;
  1738. padding: 30rpx 24rpx;
  1739. box-sizing: border-box;
  1740. background-color: #ffffff;
  1741. position: relative;
  1742. box-sizing: border-box;
  1743. border-bottom: 20rpx solid #f7f7f7;
  1744. .logo {
  1745. width: 128rpx;
  1746. height: 92rpx;
  1747. float: left;
  1748. border: 1px solid #efefef;
  1749. border-radius: 6rpx;
  1750. image {
  1751. width: 100%;
  1752. height: 100%;
  1753. display: block;
  1754. border-radius: 6rpx;
  1755. }
  1756. }
  1757. .main {
  1758. width: 470rpx;
  1759. height: 92rpx;
  1760. float: left;
  1761. margin-left: 20rpx;
  1762. .name {
  1763. width: 100%;
  1764. line-height: 46rpx;
  1765. float: left;
  1766. font-size: $font-size-28;
  1767. color: $text-color;
  1768. float: right;
  1769. overflow: hidden;
  1770. text-overflow: ellipsis;
  1771. white-space: nowrap;
  1772. text-align: left;
  1773. }
  1774. .massgs {
  1775. width: 100%;
  1776. line-height: 46rpx;
  1777. float: left;
  1778. font-size: $font-size-24;
  1779. color: #999999;
  1780. .label {
  1781. float: left;
  1782. }
  1783. .p-stars {
  1784. float: left;
  1785. margin-left: 20rpx;
  1786. }
  1787. .acount {
  1788. float: right;
  1789. text {
  1790. color: $color-system;
  1791. }
  1792. }
  1793. }
  1794. }
  1795. .icon-xiayibu {
  1796. line-height: 154rpx;
  1797. display: inline-block;
  1798. position: absolute;
  1799. width: 48rpx;
  1800. top: 0;
  1801. right: 0;
  1802. color: #b2b2b2;
  1803. }
  1804. }
  1805. .product-details {
  1806. width: 100%;
  1807. background: #ffffff;
  1808. border-bottom: 20rpx solid #f7f7f7;
  1809. &.service {
  1810. border-bottom: none;
  1811. }
  1812. &.recommend {
  1813. background-color: #f7f7f7;
  1814. border-bottom: none;
  1815. .title {
  1816. .title-tab {
  1817. background-color: #f7f7f7;
  1818. color: $text-color;
  1819. }
  1820. }
  1821. }
  1822. .product-rich-text-none {
  1823. box-sizing: border-box;
  1824. padding: 0 24rpx;
  1825. text-align: left;
  1826. font-size: 24rpx;
  1827. color: #999999;
  1828. line-height: 60rpx;
  1829. }
  1830. .content-none {
  1831. width: 100%;
  1832. height: 80rpx;
  1833. line-height: 80rpx;
  1834. text-align: left;
  1835. font-size: $font-size-26;
  1836. color: #999999;
  1837. box-sizing: border-box;
  1838. padding: 0 24rpx;
  1839. }
  1840. .title {
  1841. width: 100%;
  1842. box-sizing: border-box;
  1843. padding: 0 24rpx;
  1844. .title-tab {
  1845. width: 100%;
  1846. height: 100rpx;
  1847. background: #fff;
  1848. z-index: 10;
  1849. font-size: $font-size-30;
  1850. text-align: left;
  1851. color: $text-color;
  1852. line-height: 100rpx;
  1853. font-weight: 600;
  1854. }
  1855. .title-msg {
  1856. width: 100%;
  1857. height: 236rpx;
  1858. padding: 18rpx;
  1859. background-color: rgba(225, 86, 22, 0.1);
  1860. color: $color-system;
  1861. box-sizing: border-box;
  1862. margin-bottom: 30rpx;
  1863. .tit {
  1864. line-height: 46rpx;
  1865. font-size: $font-size-24;
  1866. text-align: left;
  1867. }
  1868. .txt {
  1869. line-height: 38rpx;
  1870. font-size: $font-size-20;
  1871. text-align: justify;
  1872. }
  1873. }
  1874. }
  1875. .content {
  1876. width: 100%;
  1877. background-color: #ffffff;
  1878. }
  1879. }
  1880. .isLower {
  1881. width: 100%;
  1882. height: 116rpx;
  1883. line-height: 116rpx;
  1884. text-align: center;
  1885. color: #000000;
  1886. font-size: $font-size-32;
  1887. font-weight: bold;
  1888. }
  1889. .bottom-btn {
  1890. width: 100%;
  1891. height: 100rpx;
  1892. position: fixed;
  1893. bottom: 0;
  1894. left: 0;
  1895. background: #ffffff;
  1896. z-index: 99;
  1897. .bottom-le {
  1898. width: 300rpx;
  1899. height: 100rpx;
  1900. padding: 10rpx 20rpx 10rpx 0;
  1901. float: left;
  1902. box-sizing: border-box;
  1903. .item-bt {
  1904. width: 80rpx;
  1905. height: 100%;
  1906. margin-right: 15rpx;
  1907. display: flex;
  1908. float: left;
  1909. flex-direction: column;
  1910. align-items: center;
  1911. justify-content: center;
  1912. font-size: $font-size-22;
  1913. color: $text-color;
  1914. line-height: 34rpx;
  1915. position: relative;
  1916. .animation-num {
  1917. font-size: $font-size-32;
  1918. color: #ff2a2a;
  1919. position: absolute;
  1920. top: -12rpx;
  1921. right: 4rpx;
  1922. font-weight: bold;
  1923. }
  1924. .animation {
  1925. animation: showAmnation 2.2s ease-in-out both;
  1926. }
  1927. .restion {
  1928. animation: hideAmnation 1s ease-in-out both;
  1929. }
  1930. .icon-num {
  1931. position: absolute;
  1932. right: -12rpx;
  1933. top: -5rpx;
  1934. }
  1935. .icon-num.goleft {
  1936. right: 2rpx;
  1937. }
  1938. &:last-child {
  1939. margin-right: 0;
  1940. }
  1941. image {
  1942. width: 44rpx;
  1943. height: 44rpx;
  1944. }
  1945. button.contact-btn {
  1946. width: 100%;
  1947. height: 100%;
  1948. margin: 0;
  1949. padding: 0;
  1950. display: flex;
  1951. flex-direction: column;
  1952. align-items: center;
  1953. justify-content: center;
  1954. box-sizing: border-box;
  1955. font-size: $font-size-24;
  1956. text-align: center;
  1957. text-decoration: none;
  1958. line-height: 34rpx;
  1959. border-radius: 0;
  1960. -webkit-tap-highlight-color: transparent;
  1961. overflow: hidden;
  1962. color: $text-color;
  1963. background-color: #ffffff;
  1964. }
  1965. }
  1966. }
  1967. .bottom-ri {
  1968. width: 450rpx;
  1969. height: 100%;
  1970. float: right;
  1971. display: flex;
  1972. box-sizing: border-box;
  1973. padding: 13rpx 20rpx 13rpx 0;
  1974. .btn {
  1975. flex: 1;
  1976. width: 200rpx;
  1977. line-height: 80rpx;
  1978. text-align: center;
  1979. font-size: $font-size-24;
  1980. color: #ffffff;
  1981. }
  1982. .btn-cart {
  1983. background-color: #ffe6dc;
  1984. color: $color-system;
  1985. border-radius: 42rpx 0 0 42rpx;
  1986. }
  1987. .btn-cart.disabled {
  1988. background-color: #e1e1e1;
  1989. color: #ffffff;
  1990. }
  1991. .btn-bay {
  1992. background: linear-gradient(to right, #f28f31 0%, #e15616 100%);
  1993. border-radius: 0 42rpx 42rpx 0;
  1994. }
  1995. .btn-bay.disabled {
  1996. background: linear-gradient(135deg, rgba(242, 143, 49, 0.5) 0%, rgba(225, 86, 22, 0.5) 100%);
  1997. }
  1998. }
  1999. }
  2000. .uni-badge--small {
  2001. -webkit-transform: scale(0.8);
  2002. -ms-transform: scale(0.8);
  2003. transform: scale(0.8);
  2004. -webkit-transform-origin: center center;
  2005. -ms-transform-origin: center center;
  2006. transform-origin: center center;
  2007. }
  2008. .uni-badge {
  2009. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  2010. -webkit-box-sizing: border-box;
  2011. box-sizing: border-box;
  2012. font-size: 12px;
  2013. line-height: 1;
  2014. display: inline-block;
  2015. padding: 3px 6px;
  2016. color: #333;
  2017. border-radius: 100px;
  2018. background-color: #f1f1f1;
  2019. }
  2020. .uni-badge-error {
  2021. color: #fff;
  2022. background-color: #dd524d;
  2023. }
  2024. .product-topnav {
  2025. width: 100%;
  2026. height: 174rpx;
  2027. box-sizing: border-box;
  2028. background: #ffffff;
  2029. z-index: 990;
  2030. position: fixed;
  2031. opacity: 1;
  2032. left: 0;
  2033. &.fixed {
  2034. animation: showFixedColor 0.1s ease-in-out both;
  2035. }
  2036. &.none {
  2037. animation: hideFixedColor 0.1s ease-in-out both;
  2038. }
  2039. .navbar {
  2040. width: 100%;
  2041. height: 60rpx;
  2042. box-sizing: border-box;
  2043. padding: 0 24rpx;
  2044. display: flex;
  2045. .nav-item {
  2046. display: flex;
  2047. flex: 1;
  2048. justify-content: center;
  2049. align-items: center;
  2050. height: 60rpx;
  2051. font-size: $font-size-28;
  2052. color: $text-color;
  2053. position: relative;
  2054. float: left;
  2055. position: relative;
  2056. .line {
  2057. width: 60rpx;
  2058. height: 2px;
  2059. border-radius: 1px;
  2060. background: #ffffff;
  2061. position: absolute;
  2062. bottom: 0;
  2063. left: 50%;
  2064. margin-left: -30rpx;
  2065. }
  2066. &.current {
  2067. color: $color-system;
  2068. .line {
  2069. background: $color-system;
  2070. }
  2071. }
  2072. }
  2073. }
  2074. .search-input {
  2075. width: 100%;
  2076. height: 114rpx;
  2077. padding: 24rpx;
  2078. box-sizing: border-box;
  2079. .gosearch-btn {
  2080. width: 100%;
  2081. height: 100%;
  2082. border-radius: 40rpx;
  2083. margin: 0 auto;
  2084. font-size: 26rpx;
  2085. line-height: 66rpx;
  2086. color: #b2b2b2;
  2087. position: relative;
  2088. box-sizing: border-box;
  2089. padding-left: 66rpx;
  2090. &.fixed {
  2091. background: rgba(70, 70, 70, 0.1);
  2092. }
  2093. &.none {
  2094. background: rgba(70, 70, 70, 0.1);
  2095. }
  2096. .search-icon {
  2097. width: 66rpx;
  2098. height: 66rpx;
  2099. position: absolute;
  2100. left: 0;
  2101. top: 2rpx;
  2102. text-align: center;
  2103. line-height: 66rpx;
  2104. .icon-iconfonticonfontsousuo1 {
  2105. margin: 0 6rpx;
  2106. font-size: $font-size-34;
  2107. color: #b2b2b2;
  2108. z-index: 10;
  2109. }
  2110. }
  2111. .search-text {
  2112. font-size: $font-size-24;
  2113. line-height: 66rpx;
  2114. color: #b2b2b2;
  2115. }
  2116. }
  2117. }
  2118. }
  2119. @keyframes showFixedColor {
  2120. 0% {
  2121. background: rgba(255, 255, 255, 0);
  2122. }
  2123. 50% {
  2124. background: rgba(255, 255, 255, 0.5);
  2125. }
  2126. 100% {
  2127. background: rgba(255, 255, 255, 1);
  2128. }
  2129. }
  2130. @keyframes hideFixedColor {
  2131. 0% {
  2132. background: rgba(255, 255, 255, 1);
  2133. }
  2134. 50% {
  2135. background: rgba(255, 255, 255, 0.5);
  2136. }
  2137. 100% {
  2138. background: rgba(255, 255, 255, 0);
  2139. }
  2140. }
  2141. /* 加入购物模态层*/
  2142. @keyframes showPopup {
  2143. 0% {
  2144. opacity: 0;
  2145. }
  2146. 100% {
  2147. opacity: 1;
  2148. }
  2149. }
  2150. @keyframes hidePopup {
  2151. 0% {
  2152. opacity: 1;
  2153. }
  2154. 100% {
  2155. opacity: 0;
  2156. }
  2157. }
  2158. @keyframes showLayer {
  2159. 0% {
  2160. transform: translateY(0);
  2161. }
  2162. 100% {
  2163. transform: translateY(-100%);
  2164. }
  2165. }
  2166. @keyframes hideLayer {
  2167. 0% {
  2168. transform: translateY(-100%);
  2169. }
  2170. 100% {
  2171. transform: translateY(0);
  2172. }
  2173. }
  2174. @keyframes showAmnation {
  2175. 0% {
  2176. top: -12rpx;
  2177. opacity: 0;
  2178. }
  2179. 50% {
  2180. top: -60rpx;
  2181. opacity: 1;
  2182. }
  2183. 100% {
  2184. top: -100rpx;
  2185. opacity: 0;
  2186. }
  2187. }
  2188. @keyframes hideAmnation {
  2189. 0% {
  2190. top: -100rpx;
  2191. opacity: 0;
  2192. }
  2193. 100% {
  2194. top: -12rpx;
  2195. opacity: 0;
  2196. }
  2197. }
  2198. .popup {
  2199. position: fixed;
  2200. top: 0;
  2201. width: 100%;
  2202. height: 100%;
  2203. z-index: 999;
  2204. display: none;
  2205. .mask {
  2206. position: fixed;
  2207. top: 0;
  2208. width: 100%;
  2209. height: 100%;
  2210. z-index: 21;
  2211. background-color: rgba(0, 0, 0, 0.6);
  2212. }
  2213. .layer {
  2214. position: fixed;
  2215. z-index: 22;
  2216. bottom: -294rpx;
  2217. width: 702rpx;
  2218. padding: 24rpx 24rpx 36rpx 24rpx;
  2219. height: 260rpx;
  2220. border-radius: 20rpx 20rpx 0 0;
  2221. background-color: #fff;
  2222. display: flex;
  2223. flex-wrap: wrap;
  2224. align-content: space-between;
  2225. .content {
  2226. width: 100%;
  2227. }
  2228. .btn {
  2229. width: 100%;
  2230. height: 88rpx;
  2231. margin-top: 20rpx;
  2232. .button {
  2233. width: 100%;
  2234. height: 88rpx;
  2235. color: #fff;
  2236. display: flex;
  2237. align-items: center;
  2238. justify-content: center;
  2239. background: $btn-confirm;
  2240. font-size: $font-size-28;
  2241. border-radius: 44rpx;
  2242. }
  2243. }
  2244. }
  2245. &.show {
  2246. display: block;
  2247. .mask {
  2248. animation: showPopup 0.2s linear both;
  2249. }
  2250. .layer {
  2251. animation: showLayer 0.2s linear both;
  2252. }
  2253. }
  2254. &.hide {
  2255. display: block;
  2256. .mask {
  2257. animation: hidePopup 0.2s linear both;
  2258. }
  2259. .layer {
  2260. animation: hideLayer 0.2s linear both;
  2261. }
  2262. }
  2263. &.none {
  2264. display: none;
  2265. }
  2266. &.service {
  2267. .row {
  2268. margin: 30upx 0;
  2269. .title {
  2270. font-size: 30upx;
  2271. margin: 10upx 0;
  2272. }
  2273. .description {
  2274. font-size: 28upx;
  2275. color: #999;
  2276. }
  2277. }
  2278. }
  2279. .layer-smimg {
  2280. width: 114rpx;
  2281. height: 114rpx;
  2282. float: left;
  2283. border-radius: 10rpx;
  2284. margin-right: 24rpx;
  2285. image {
  2286. width: 114rpx;
  2287. height: 114rpx;
  2288. border-radius: 10rpx;
  2289. }
  2290. }
  2291. .layer-nunbox {
  2292. justify-content: space-between;
  2293. align-items: center;
  2294. width: 536rpx;
  2295. height: auto;
  2296. float: left;
  2297. .layer-nunbox-t {
  2298. width: 100%;
  2299. height: 44rpx;
  2300. position: relative;
  2301. display: flex;
  2302. margin-bottom: 10rpx;
  2303. .text {
  2304. font-size: $font-size-24;
  2305. line-height: 48rpx;
  2306. color: #999999;
  2307. }
  2308. .layer-nunbox-text {
  2309. line-height: 44rpx;
  2310. font-size: $font-size-28;
  2311. }
  2312. .number-box {
  2313. display: flex;
  2314. justify-content: center;
  2315. align-items: center;
  2316. border: 2rpx solid #ffe6dc;
  2317. border-radius: 30rpx;
  2318. height: 48rpx;
  2319. margin-left: 20rpx;
  2320. .iconfont {
  2321. font-size: $font-size-24;
  2322. padding: 0 18rpx;
  2323. color: #999999;
  2324. text-align: center;
  2325. line-height: 48rpx;
  2326. font-weight: bold;
  2327. background: #fef6f3;
  2328. &.icon-jianhao {
  2329. border-radius: 30rpx 0 0 30rpx;
  2330. }
  2331. &.icon-jiahao {
  2332. border-radius: 0 30rpx 30rpx 0;
  2333. }
  2334. }
  2335. .btn-input {
  2336. width: 62rpx;
  2337. height: 48rpx;
  2338. line-height: 48rpx;
  2339. background: #ffffff;
  2340. border-radius: 4rpx;
  2341. text-align: center;
  2342. font-size: $font-size-28;
  2343. }
  2344. }
  2345. .product-step {
  2346. position: absolute;
  2347. left: 45rpx;
  2348. bottom: 0;
  2349. height: 44rpx;
  2350. background: #ffffff;
  2351. }
  2352. }
  2353. .layer-nunbox-b {
  2354. width: 100%;
  2355. height: 44rpx;
  2356. margin-top: 13rpx;
  2357. }
  2358. .text {
  2359. line-height: 44rpx;
  2360. font-size: $font-size-28;
  2361. .p {
  2362. color: #ff2a2a;
  2363. }
  2364. .p:first-child {
  2365. margin-left: 30rpx;
  2366. }
  2367. .p.sm {
  2368. font-size: $font-size-24;
  2369. }
  2370. }
  2371. }
  2372. }
  2373. .tui-popup-box {
  2374. position: relative;
  2375. box-sizing: border-box;
  2376. min-height: 220rpx;
  2377. padding: 24rpx 24rpx 0 24rpx;
  2378. .tui-popup-close {
  2379. width: 90rpx;
  2380. height: 90rpx;
  2381. position: absolute;
  2382. right: 0;
  2383. top: 24rpx;
  2384. line-height: 90rpx;
  2385. text-align: center;
  2386. color: #b2b2b2;
  2387. .icon-iconfontguanbi {
  2388. font-size: $font-size-40;
  2389. }
  2390. }
  2391. .title {
  2392. font-size: $font-size-34;
  2393. color: $text-color;
  2394. line-height: 88rpx;
  2395. text-align: center;
  2396. float: left;
  2397. width: 100%;
  2398. height: 88rpx;
  2399. font-weight: bold;
  2400. }
  2401. .tui-popup-main {
  2402. width: 100%;
  2403. float: left;
  2404. &.coupon {
  2405. padding-bottom: 40rpx;
  2406. .coupon-empty {
  2407. width: 100%;
  2408. height: 600rpx;
  2409. display: flex;
  2410. align-items: center;
  2411. justify-content: center;
  2412. flex-direction: column;
  2413. position: fixed;
  2414. background: $bg-color;
  2415. .empty-container-image {
  2416. width: 150rpx;
  2417. height: 150rpx;
  2418. margin-bottom: 0;
  2419. margin-top: 0;
  2420. }
  2421. .error-text {
  2422. font-size: $font-size-28;
  2423. color: #999999;
  2424. line-height: 88rpx;
  2425. }
  2426. }
  2427. }
  2428. .tui-popup-scroll {
  2429. width: 100%;
  2430. height: 600rpx;
  2431. .coupon-list {
  2432. width: 100%;
  2433. height: 200rpx;
  2434. margin-top: 24rpx;
  2435. box-sizing: border-box;
  2436. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  2437. background-size: cover;
  2438. &:last-child {
  2439. margin-bottom: 24rpx;
  2440. }
  2441. .list-cell-le {
  2442. width: 224rpx;
  2443. height: 100%;
  2444. box-sizing: border-box;
  2445. padding: 37rpx 0;
  2446. float: left;
  2447. .coupon-maxMoney {
  2448. width: 100%;
  2449. height: 78rpx;
  2450. line-height: 78rpx;
  2451. font-size: 56rpx;
  2452. color: #ffffff;
  2453. text-align: center;
  2454. .small {
  2455. font-size: $font-size-24;
  2456. }
  2457. }
  2458. .coupon-minMoney {
  2459. width: 100%;
  2460. height: 33rpx;
  2461. line-height: 33rpx;
  2462. font-size: $font-size-24;
  2463. color: #ffffff;
  2464. text-align: center;
  2465. }
  2466. }
  2467. .list-cell-ri {
  2468. width: 478rpx;
  2469. height: 100%;
  2470. box-sizing: border-box;
  2471. padding: 20rpx 24rpx 0 24rpx;
  2472. float: right;
  2473. .list-cell-top {
  2474. width: 100%;
  2475. height: 121rpx;
  2476. float: left;
  2477. border-bottom: 1px solid #e1e1e1;
  2478. .list-cell-type {
  2479. width: 286rpx;
  2480. height: 100%;
  2481. float: left;
  2482. .list-cell-tags {
  2483. width: 100%;
  2484. height: 32rpx;
  2485. margin-bottom: 7rpx;
  2486. .tags {
  2487. display: inline-block;
  2488. padding: 0 10rpx;
  2489. height: 32rpx;
  2490. line-height: 32rpx;
  2491. background-color: #ffdcce;
  2492. color: #f94b4b;
  2493. font-size: $font-size-20;
  2494. border-radius: 8rpx;
  2495. text-align: center;
  2496. float: left;
  2497. }
  2498. }
  2499. .list-cell-texts {
  2500. width: 100%;
  2501. height: auto;
  2502. line-height: 35rpx;
  2503. text-overflow: ellipsis;
  2504. display: -webkit-box;
  2505. word-break: break-all;
  2506. -webkit-box-orient: vertical;
  2507. -webkit-line-clamp: 2;
  2508. overflow: hidden;
  2509. font-size: 26rpx;
  2510. color: #333333;
  2511. }
  2512. }
  2513. .list-cell-btn {
  2514. width: 128rpx;
  2515. height: 100%;
  2516. float: right;
  2517. .icon-used {
  2518. width: 100%;
  2519. height: 100%;
  2520. box-sizing: border-box;
  2521. padding-top: 57rpx;
  2522. .icon-used-btn {
  2523. width: 128rpx;
  2524. height: 48rpx;
  2525. border-radius: 28rpx;
  2526. line-height: 48rpx;
  2527. font-size: $font-size-26;
  2528. text-align: center;
  2529. &.receive {
  2530. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);
  2531. color: #ffffff;
  2532. }
  2533. &.make {
  2534. border: solid 1px #f94b4b;
  2535. color: #f94b4b;
  2536. }
  2537. }
  2538. }
  2539. }
  2540. }
  2541. .list-cell-time {
  2542. width: 100%;
  2543. height: 58rpx;
  2544. line-height: 58rpx;
  2545. text-align: left;
  2546. font-size: $font-size-20;
  2547. color: #999999;
  2548. }
  2549. }
  2550. }
  2551. &.train {
  2552. height: 240rpx;
  2553. }
  2554. .content-tr {
  2555. width: 100%;
  2556. min-height: 58rpx;
  2557. line-height: 58rpx;
  2558. display: flex;
  2559. .content-td {
  2560. display: flex;
  2561. flex: 3;
  2562. font-size: $font-size-26;
  2563. color: #999999;
  2564. line-height: 58rpx;
  2565. text-align: left;
  2566. }
  2567. .content-th {
  2568. display: flex;
  2569. flex: 7;
  2570. font-size: $font-size-26;
  2571. color: #333333;
  2572. line-height: 58rpx;
  2573. text-align: left;
  2574. padding-left: 10rpx;
  2575. }
  2576. }
  2577. }
  2578. }
  2579. }
  2580. .tui-popup-btn {
  2581. width: 100%;
  2582. height: auto;
  2583. float: left;
  2584. margin-top: 24rpx;
  2585. .tui-button {
  2586. width: 100%;
  2587. height: 88rpx;
  2588. background: $btn-confirm;
  2589. line-height: 88rpx;
  2590. text-align: center;
  2591. color: #ffffff;
  2592. font-size: $font-size-28;
  2593. border-radius: 44rpx;
  2594. }
  2595. }
  2596. /*富文本样式*/
  2597. rich-text.p {
  2598. width: 702rpx !important;
  2599. padding: 0 24rpx;
  2600. text-align: justify;
  2601. }
  2602. rich-text.img {
  2603. width: 100%;
  2604. height: auto;
  2605. }
  2606. </style>