product.vue 65 KB

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