product.vue 67 KB

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