product.vue 66 KB

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