product.vue 66 KB

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