detail.vue 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904
  1. <template>
  2. <view class="app-container">
  3. <view class="recommender-container" v-if="isGroupbuyGoods && !isHeadUser">
  4. <view class="content">
  5. <image :src="detail.groupPic"></image>
  6. <view class="name ellipsis">{{detail.groupUserName}}</view>
  7. <view>向你推荐</view>
  8. </view>
  9. </view>
  10. <!-- <no-data v-if="!isLoaded" :showText="'加载中'"></no-data> -->
  11. <no-data v-if="isLoaded && noData" :showText="'该商品已失效'"></no-data>
  12. <block v-if="isLoaded && !noData">
  13. <view class="swiper-container">
  14. <swiper @change="changeBanner">
  15. <swiper-item v-if="detail.vedio">
  16. <video id="video1" :src="detail.vedio" @play="playVideo" @pause="pauseVideo" controls loop :enable-progress-gesture="false" :muted="isFixedVideo"></video>
  17. </swiper-item>
  18. <block v-for="(item, index) in bannerList" :key='index' v-if="bannerList.length > 0">
  19. <swiper-item>
  20. <!-- <image :src="item.url" mode="aspectFill" @tap="previewImage(item.url)" ></image> -->
  21. <view class="image" @tap="previewImage(item.url)">
  22. <image :src="item.url" mode="aspectFill" class="img"></image>
  23. <image :src="detail.logo" mode="aspectFill" class="water" v-if="isShowWater"></image>
  24. </view>
  25. </swiper-item>
  26. </block>
  27. </swiper>
  28. <view class="nums" v-show="(detail.vedio && bannerCurrent != 0) || !detail.vedio">{{bannerCurrent + 1}}/{{bannerList.length + (detail.vedio ? 1 : 0)}}</view>
  29. </view>
  30. <view class="video-container" :class="isFixedVideo ? 'isFixed':''" v-if="detail.vedio">
  31. <view class="content">
  32. <view class="close" @tap="closeFixedVideo"><image src="@/static/icon/close.png"></image></view>
  33. <video id="video2" :src="detail.vedio" @error="videoErrorCallback" controls loop :enable-progress-gesture="false"></video>
  34. </view>
  35. </view>
  36. <view class="seckill-container" v-if="isSeckillGoods">
  37. <view class="price">
  38. <view class="price-1">¥{{detail.goodsPrice | priceFilter}}</view>
  39. <view class="price-2">¥{{detail.orgGoodsPrice | priceFilter}}</view>
  40. </view>
  41. <view class="right">
  42. <text>距结束还剩:</text>
  43. <view class="time"><text>{{countdownTime[0]}}</text>时<text>{{countdownTime[1]}}</text>分<text>{{countdownTime[2]}}</text>秒</view>
  44. </view>
  45. <view class="clock"><image src="@/static/icon/clock.png"></image></view>
  46. </view>
  47. <view class="main-container">
  48. <view class="title">{{detail.goodsName}}</view>
  49. <view class="des">{{detail.describeText ? detail.describeText : ''}}</view>
  50. <view class="tags" v-if="detail.tags1 && detail.tags1.length > 0">
  51. <view class="it" v-for="(it, idx) in detail.tags1" :key="idx">{{it}}</view>
  52. </view>
  53. <view class="tags2" v-if="(detail.tags2 && detail.tags2.length > 0) || detail.promotionFullPiece || detail.isTrade == 'YES'">
  54. <view class="it" v-if="detail.promotionFullPiece">满件打折</view>
  55. <view class="it" v-if="detail.isTrade == 'YES'">以旧换新</view>
  56. <view class="it" v-for="(it, idx) in detail.tags2" :key="idx">{{it}}</view>
  57. </view>
  58. <view class="stock">
  59. <block v-if="!isSeckillGoods">
  60. <view class="left">
  61. <text>剩余{{detail.stock}}件</text>
  62. </view>
  63. </block>
  64. <block v-if="isSeckillGoods">
  65. <view class="left">
  66. <text>剩余{{detail.secStockNum}}件</text>
  67. <view class="progress-box">
  68. <progress :percent="detail.secStockNum / detail.limitBuy * 100" activeColor="#FF3F42" active stroke-width="6" />
  69. </view>
  70. </view>
  71. <view class="right" @tap="isOpen = !isOpen" v-if="((isServiceUser || isWorkerUser) && !isGroupbuyGoods) || (isHeadUser && isGroupbuyGoods)">
  72. <text>{{isOpen ? '收起':'展开'}}</text>
  73. <image :src="isOpen ? '../../static/icon/arrow_2.png':'../../static/icon/arrow_1.png'"></image>
  74. </view>
  75. </block>
  76. </view>
  77. <view class="price-con" v-if="!isSeckillGoods">
  78. <view class="left">
  79. <view class="price">
  80. <view class="price-1">¥{{detail.goodsPrice | priceFilter}}</view>
  81. <view class="price-2">¥{{detail.orgGoodsPrice | priceFilter}}</view>
  82. </view>
  83. <view class="box" v-if="detail.promotionFullPiece">
  84. {{detail.promotionFullPieceNum}}件单价约¥{{detail.promotionFullPiecePrice}}
  85. </view>
  86. </view>
  87. <view class="right" @tap="isOpen = !isOpen" v-if="((isServiceUser || isWorkerUser) && !isGroupbuyGoods) || (isHeadUser && isGroupbuyGoods)">
  88. <text>{{isOpen ? '收起':'展开'}}</text>
  89. <image :src="isOpen ? '../../static/icon/arrow_2.png':'../../static/icon/arrow_1.png'"></image>
  90. </view>
  91. </view>
  92. <view class="bottom" v-if="isOpen">
  93. <block v-if="detail.isMaster">
  94. <view class="row">
  95. <view>分销金额</view>
  96. <view>¥{{commission | priceFilter}}{{detail.goodsSpecs.length > 1 ? '起':''}}</view>
  97. </view>
  98. <view class="row">
  99. <view>内部分销金额</view>
  100. <view>¥{{commission2 | priceFilter}}{{detail.goodsSpecs.length > 1 ? '起':''}}</view>
  101. </view>
  102. </block>
  103. <block v-else-if="userInfo.innerr">
  104. <view class="row">
  105. <view>分享可获得收益</view>
  106. <view>¥{{commission2 | priceFilter}}{{detail.goodsSpecs.length > 1 ? '起':''}}</view>
  107. </view>
  108. </block>
  109. <block v-else>
  110. <view class="row">
  111. <view>分享可获得收益</view>
  112. <view>¥{{commission | priceFilter}}{{detail.goodsSpecs.length > 1 ? '起':''}}</view>
  113. </view>
  114. </block>
  115. </view>
  116. </view>
  117. <view class="line-container">
  118. <view>运费:包邮</view>
  119. <view>销量:<text>{{detail.soldNum}}</text></view>
  120. </view>
  121. <view class="evaluate-container" v-if="evaluateList.length">
  122. <view class="title">
  123. <view class="left">用户评价({{evaluateList.length}})</view>
  124. <view class="right" @tap="toAllEvaluate">查看全部<text class="iconfont icon-jinru"></text></view>
  125. </view>
  126. <view class="list">
  127. <view class="item" v-for="(item, index) in evaluateList.filter((o, i) => i === 0)" :key="index">
  128. <view class="top">
  129. <view class="user">
  130. <image :src="item.avatar" mode="aspectFill" v-if="item.avatar.indexOf('http') >= 0"></image>
  131. <image :src="imageUrl + item.avatar" mode="aspectFill" v-else></image>
  132. <view class="right">
  133. <view class="name ellipsis">{{item.userName}}</view>
  134. <view class="date">{{item.createTime}}</view>
  135. </view>
  136. </view>
  137. </view>
  138. <view class="tags">
  139. <view class="it" v-for="(it, idx) in item.tags" :key="idx">{{it}}</view>
  140. </view>
  141. <view class="content">{{item.content}}</view>
  142. <view class="images" v-if="item.imgs && item.imgs.length > 0">
  143. <image v-for="(it, idx) in item.imgs" :key="idx" :src="it" @tap="previewEvaluateImage(it, item.imgs)"></image>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. <view class="tradein-container" v-if="detail.isTrade == 'YES'">
  149. <view class="left">
  150. <view class="top">
  151. <text class="iconfont icon-huishou"></text>
  152. <view class="text">以旧换新</view>
  153. <u-tag :text="`最高补贴${tradeMaxPrice}元`" plain size="mini" type="warning"></u-tag>
  154. </view>
  155. <view class="bottom">旧机拆运免费,新机补贴可立减!</view>
  156. </view>
  157. <view class="right" @tap="clickCartOrBuy(5)">立即换新<text class="iconfont icon-jinru"></text></view>
  158. </view>
  159. <view class="detail-container">
  160. <view class="title">商品详情</view>
  161. <view class="content" v-if="detail.pubCommonTemplate">
  162. <u-parse :content="detail.pubCommonTemplate.content"></u-parse>
  163. </view>
  164. <view class="content" v-if="detail.commonTemplate">
  165. <u-parse :content="detail.commonTemplate.content"></u-parse>
  166. </view>
  167. <view class="content">
  168. <u-parse :content="detail.content"></u-parse>
  169. </view>
  170. </view>
  171. <view class="allBottom-container">
  172. <view class="tradeinBottom-container" v-if="detail.isTrade == 'YES'">
  173. <view class="left">
  174. <view class="tag">
  175. <text class="iconfont icon-huishou"></text>
  176. <view class="name">以旧换新</view>
  177. </view>
  178. <view class="text">旧机拆运免费,新机补贴可立减!</view>
  179. </view>
  180. <view class="right" @tap="clickCartOrBuy(5)">立即换新<text class="iconfont icon-jinru"></text></view>
  181. </view>
  182. <view class="bottom-container">
  183. <view class="left">
  184. <view class="item" @tap="clickShare">
  185. <view class="iconfont icon-fenxiang"></view>
  186. <text>分享</text>
  187. </view>
  188. <view class="item" @tap="handleCollect" v-if="!isGroupbuyGoods">
  189. <block v-if="detail.favorite">
  190. <view class="iconfont icon-shoucang2 active"></view>
  191. <text>已收藏</text>
  192. </block>
  193. <block v-else>
  194. <view class="iconfont icon-shoucang"></view>
  195. <text>收藏</text>
  196. </block>
  197. </view>
  198. <view class="item" @tap="$navPage(`/packageGoods/pages/cart`)">
  199. <view class="iconfont icon-gouwuche1"></view>
  200. <text>购物车</text>
  201. <view class="dot" v-if="cartCount > 0">{{cartCount <= 99 ? cartCount : '99+'}}</view>
  202. </view>
  203. </view>
  204. <view class="right" v-if="!isSeckillGoods && !isGroupbuyGoods">
  205. <view class="button cart" @tap="clickCartOrBuy(1)">加入购物车</view>
  206. <view class="button buy" @tap="clickCartOrBuy(2)">立即购买</view>
  207. </view>
  208. <view class="right" v-if="!isSeckillGoods && isGroupbuyGoods">
  209. <view class="button cart" @tap="clickCartOrBuy(1)">加入购物车</view>
  210. <view class="button buy" @tap="clickCartOrBuy(4)">立即拼团</view>
  211. </view>
  212. <view class="right" v-if="isSeckillGoods">
  213. <view class="button cart" @tap="clickCartOrBuy(1)">加入购物车</view>
  214. <view class="button buy" @tap="clickCartOrBuy(3)">马上抢购</view>
  215. </view>
  216. </view>
  217. </view>
  218. <u-popup
  219. :round="10"
  220. :closeable="true"
  221. :show="isBuyDialog"
  222. @close="isBuyDialog = false">
  223. <view class="cart-container">
  224. <view class="main">
  225. <image :src="specList[specCurrent].imgUrl" mode="aspectFill"></image>
  226. <view class="right">
  227. <view class="title ellipsis-2">{{detail.goodsName}}</view>
  228. <block v-if="isGroupbuyGoods">
  229. <view class="price">
  230. <view class="price-con">
  231. <view class="price-1">¥{{specList[specCurrent].price}}</view>
  232. <view class="price-2">¥{{specList[specCurrent].orgPrice}}</view>
  233. </view>
  234. <view class="box" v-if="detail.promotionFullPiece">
  235. {{specList[specCurrent].promotionFullPieceNum}}件单价约¥{{specList[specCurrent].promotionFullPiecePrice}}
  236. </view>
  237. </view>
  238. <view class="stock">剩余{{specList[specCurrent].stockNum}}件</view>
  239. </block>
  240. <block v-else-if="isSeckillGoods">
  241. <view class="price">
  242. <view class="price-con">
  243. <view class="price-1">¥{{specList[specCurrent].secPrice}}</view>
  244. <view class="price-2">¥{{specList[specCurrent].price}}</view>
  245. </view>
  246. <view class="box" v-if="detail.promotionFullPiece">
  247. {{specList[specCurrent].promotionFullPieceNum}}件单价约¥{{specList[specCurrent].promotionFullPiecePrice}}
  248. </view>
  249. </view>
  250. <view class="stock">剩余{{detail.secStockNum}}件</view>
  251. </block>
  252. <block v-else>
  253. <view class="price">
  254. <view class="price-con">
  255. <view class="price-1">¥{{specList[specCurrent].price}}</view>
  256. <view class="price-2">¥{{detail.orgGoodsPrice}}</view>
  257. </view>
  258. <view class="box" v-if="detail.promotionFullPiece">
  259. {{specList[specCurrent].promotionFullPieceNum}}件单价约¥{{specList[specCurrent].promotionFullPiecePrice}}
  260. </view>
  261. </view>
  262. <view class="stock">剩余{{specList[specCurrent].stockNum}}件</view>
  263. </block>
  264. </view>
  265. </view>
  266. <view class="attr">
  267. <view class="title">已选属性</view>
  268. <view class="list">
  269. <block v-for="(item, index) in specList" :key='index'>
  270. <view class="item" @tap="changeSpec(index)" :class="specCurrent == index ? 'current':''">{{item.specValue}}</view>
  271. </block>
  272. </view>
  273. </view>
  274. <view class="num">
  275. <view class="title">购买数量</view>
  276. <u-number-box
  277. v-model="buyNum"
  278. :disabled="isTradeTag"
  279. :min="1"
  280. :buttonSize="26"
  281. iconStyle="font-size: 12px;">
  282. </u-number-box>
  283. </view>
  284. <view class="tradein" v-if="dialogType == 5">
  285. <view class="top">
  286. <view class="name">以旧换新:</view>
  287. <view class="text">{{detail.tradeRemark}}</view>
  288. </view>
  289. <view class="tag" :class="isTradeTag ? 'active' : ''" @click="changeTradeTag">旧机拆运免费,新机补贴可立减!</view>
  290. <view class="agreement">
  291. <view class="content" v-if="isTradeTag">
  292. <text class="iconfont" :class="isTradeAgree ? 'icon-danxuan2' : 'icon-danxuan'" @click="isTradeAgree = !isTradeAgree"></text>
  293. <view class="text">我已阅读并同意<text @click="toAgreement">《以旧换新协议》</text></view>
  294. </view>
  295. </view>
  296. </view>
  297. <block v-if="dialogType == 5">
  298. <view class="button buy" v-if="isTradeTag" @tap="toTradein">立即换新</view>
  299. <view class="button buy" v-if="!isTradeTag" @tap="nowBuy">立即购买</view>
  300. </block>
  301. <view class="button cart" v-if="dialogType == 1" @tap="addToCart">加入购物车</view>
  302. <view class="button buy" v-if="dialogType == 2" @tap="nowBuy">立即购买</view>
  303. <view class="button sec" v-if="dialogType == 3" @tap="rushBuy">马上抢购</view>
  304. <view class="button sec" v-if="dialogType == 4" @tap="nowBuy">马上拼团</view>
  305. </view>
  306. </u-popup>
  307. <u-popup
  308. :round="10"
  309. :closeable="false"
  310. :show="isShareDialog"
  311. @close="isShareDialog = false">
  312. <view class="sharelist-container">
  313. <view class="item" v-if="isH5" @tap="isShareDialog = false; isShowShareGuideDialog = true;">
  314. <image src="@/static/icon/wechat.png"></image>
  315. <text>分享给微信好友</text>
  316. </view>
  317. <view class="item" @tap="markImage">
  318. <image src="@/static/icon/image.png"></image>
  319. <text>生成图片分享</text>
  320. </view>
  321. </view>
  322. </u-popup>
  323. <view class="global-mask" v-show="isShowCanvas" @tap="closeCanvas"></view>
  324. <view class="canvas-container" v-show="isShowCanvas">
  325. <view class="content">
  326. <image style="width: 300px; height: 520px;" :src="canvasImg" v-if="canvasImg"></image>
  327. <canvas style="width: 300px; height: 520px;" canvas-id="myCanvas" id="myCanvas" v-else></canvas>
  328. </view>
  329. <view class="button"><text>长按图片保存</text></view>
  330. </view>
  331. <view class="shareGuideDialog" v-if="isShowShareGuideDialog" @tap="isShowShareGuideDialog = false">
  332. <view class="content">
  333. <view class="icon">
  334. <text class="iconfont icon-arrow-up-right"></text>
  335. </view>
  336. <view class="text">
  337. <view>点击右上角</view>
  338. <view>与好友分享好物!</view>
  339. </view>
  340. </view>
  341. </view>
  342. </block>
  343. </view>
  344. </template>
  345. <script>
  346. import { compareTime, wxShare, getQueryVariable, mini_env } from '@/common/utils/util.js'
  347. import { toBase64src } from '@/common/utils/base.js';
  348. export default {
  349. data() {
  350. return {
  351. imageUrl: this.$imageUrl,
  352. userInfo: {},
  353. configInfo: {},
  354. isLoaded: false,
  355. noData: true,
  356. goodsId: null, // 商品id
  357. detail: {}, // 商品详情
  358. commission: 0, // 分佣金额(师傅)
  359. commission2: 0, // 分佣金额(分销员)
  360. bannerList: [], // 轮播图列表
  361. bannerCurrent: 0, // 轮播图当前值
  362. specList: [], // 规格列表
  363. specCurrent: 0, // 规格当前值
  364. isOpen: false, // 是否展开
  365. isBuyDialog: false, // 是否显示购买/加入购物车弹窗
  366. dialogType: 1, // 弹窗类型: 1加入购物车,2立即购买,3秒杀抢购
  367. isShareDialog: false, // 是否显示分享弹窗
  368. isShowCanvas: false, // 是否显示海报弹窗
  369. buyNum: 1, // 购买/加入购物车 数量
  370. isSeckillGoods: false, // 是否秒杀商品
  371. isGroupbuyGoods: false, // 是否团购商品
  372. cartCount: 0, // 购物车内商品数
  373. isFinishCanvas: false, // 是否已完成海报
  374. canvasImg: '',
  375. codeUrl: '', // 商品码
  376. videoContext1: '', // 视频对象
  377. videoContext2: '', // 视频对象
  378. isFixedVideo: false, // 是否显示视频弹窗
  379. isPlayVideo: false, // 视频是否播放中
  380. isCloseMyself: false, // 是否亲自关闭视频弹窗
  381. countdownTime: '', // 倒计时
  382. endHour: 0, // 倒计时结束时间
  383. evaluateList: [],
  384. isShowWater: false,
  385. isShowShareGuideDialog: false,
  386. isH5: false,
  387. isTradeTag: true,
  388. isTradeAgree: false,
  389. tradeMaxPrice: 0,
  390. }
  391. },
  392. computed:{
  393. isLogin() {
  394. return this.$store.state.user.token ? true : false;
  395. },
  396. isHeadUser() { // 是否团长
  397. return this.userInfo.promotionGroupLeader;
  398. },
  399. isServiceUser() { // 是否业务员
  400. return this.userInfo.type === 'SERVICE';
  401. },
  402. isWorkerUser() { // 是否师傅
  403. return this.userInfo.type === 'WORKER';
  404. }
  405. },
  406. watch: {
  407. countdownTime() {
  408. if(this.countdownTime[0] == 0 && this.countdownTime[1] == 0 && this.countdownTime[2] == 0){
  409. this.getDetail();
  410. }
  411. }
  412. },
  413. onPageScroll(res) {
  414. if(res.scrollTop > 300 && this.isPlayVideo && !this.isCloseMyself && this.detail.vedio) {
  415. this.isFixedVideo = true;
  416. this.videoContext2.play();
  417. }else {
  418. this.isFixedVideo = false;
  419. this.videoContext2.pause();
  420. }
  421. if(res.scrollTop < 300) {
  422. this.isCloseMyself = false;
  423. }
  424. },
  425. async onLoad({id}) {
  426. this.goodsId = id;
  427. uni.showLoading({
  428. title: '加载中'
  429. });
  430. await this.getDetail();
  431. this.configInfo = await this.$getConfigInfo();
  432. this.userInfo = await this.$getUserInfo();
  433. this.getEvaluateList();
  434. mini_env((bool) => {
  435. if (bool) {
  436. this.isH5 = false;
  437. }else {
  438. this.isH5 = true;
  439. var appid = getQueryVariable('appid') || getQueryVariable('appId');
  440. wxShare({
  441. configInfo: this.configInfo,
  442. userInfo: this.userInfo,
  443. title: `分享商品「 ${this.detail.goodsName} 」`,
  444. desc: `点击前往购买`,
  445. link: `${process.env.VUE_APP_HREF}/packageGoods/pages/detail?appid=${appid}&id=${this.goodsId}&serviceId=${this.$store.state.user.userId}`,
  446. imgUrl: this.detail.imgUrl,
  447. })
  448. }
  449. })
  450. },
  451. onShow() {
  452. this.isBuyDialog = false;
  453. this.getCartCount();
  454. },
  455. onReady() {
  456. this.videoContext1 = uni.createVideoContext('video1');
  457. this.videoContext2 = uni.createVideoContext('video2');
  458. },
  459. methods: {
  460. // 获取详情
  461. getDetail() {
  462. return new Promise((resolve, reject) => {
  463. this.$api.get('/goods/detail', {
  464. goodsId: this.goodsId,
  465. userId: this.$store.state.user.userId,
  466. }).then(res => {
  467. this.detail = res.data;
  468. this.noData = false;
  469. this.isLoaded = true;
  470. // 团购
  471. this.isGroupbuyGoods = res.data.promotionGroup;
  472. // 秒杀
  473. this.isSeckillGoods = res.data.secType;
  474. this.endHour = res.data.endHour;
  475. this.countTime();
  476. this.bannerList = res.data.images;
  477. this.specList = res.data.goodsSpecs;
  478. this.specCurrent = 0;
  479. let commissionList = [];
  480. let commission2List = [];
  481. this.specList.forEach((item, index) => {
  482. item.price = item.price.toFixed(2);
  483. item.orgPrice = item.orgPrice.toFixed(2);
  484. commissionList.push(item.shareAmount);
  485. commission2List.push(item.innerShareAmount);
  486. })
  487. this.commission = Math.min(...commissionList);
  488. this.commission2 = Math.min(...commission2List);
  489. // 水印
  490. if(res.data.logo && res.data.logoStartTime) {
  491. this.isShowWater = compareTime(res.data.logoStartTime, res.data.logoEndTime);
  492. }else {
  493. this.isShowWater = false;
  494. }
  495. if(res.data.isTrade == 'YES') {
  496. this.getMaxPrice();
  497. }
  498. resolve(1);
  499. }).catch(res => {
  500. this.noData = true;
  501. this.isLoaded = true;
  502. reject(0);
  503. }).finally(res => {
  504. uni.hideLoading();
  505. })
  506. })
  507. },
  508. getMaxPrice() {
  509. this.$api.get('/trade/getMaxPrice').then(res => {
  510. this.tradeMaxPrice = res.data || 0;
  511. })
  512. },
  513. // 获取评价列表
  514. getEvaluateList() {
  515. this.$api.get('/order/comment/goods', {
  516. pageNo: 1,
  517. pageSize: 5,
  518. goodsId: this.goodsId,
  519. }).then(res => {
  520. this.evaluateList = res.data.records;
  521. })
  522. },
  523. // 查询结束时间
  524. checkEndTime(val) {
  525. let yy = new Date().getFullYear();
  526. let mm = new Date().getMonth() + 1;
  527. let dd = new Date().getDate();
  528. // dd = val == 10 ? dd + 1 : dd;
  529. // 每月有多少天
  530. let days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  531. if(yy%4 == 0 && yy%100 != 0 || yy%400 == 0){
  532. days[1] = 29;
  533.    }
  534. // 如果结束时间=10(表示第二天10点),dd需加一天
  535. if(val == 10) {
  536. if(dd >= days[mm - 1]) {
  537. mm = mm + 1;
  538. }else {
  539. dd = dd + 1;
  540. }
  541. }
  542. let date = yy + '/' + mm + '/' + dd;
  543. let dateTime = date + ' ' + val + ':00:00';
  544. return dateTime;
  545. },
  546. // 计算倒计时
  547. countTime() {
  548. let endDateTime = this.checkEndTime(this.endHour);
  549. var nowtime = new Date(), //获取当前时间
  550. endtime = new Date(endDateTime); //定义结束时间
  551. var lefttime = endtime.getTime() - nowtime.getTime(), //距离结束时间的毫秒数
  552. hh = Math.floor(lefttime/(1000*60*60)), //计算小时数
  553. mm = Math.floor(lefttime/(1000*60)%60), //计算分钟数
  554. ss = Math.floor(lefttime/1000%60); //计算秒数
  555. function checkTime(i){
  556. if (i<10) {
  557. i = "0"+i;
  558. }
  559. return i;
  560. }
  561. setTimeout(() => {
  562. this.countTime();
  563. }, 1000);
  564. this.countdownTime = [checkTime(hh), checkTime(mm), checkTime(ss)];
  565. },
  566. // 获取商品二维码
  567. async getGoodsCode() {
  568. return new Promise((resolve, reject) => {
  569. var appid = getQueryVariable('appid') || getQueryVariable('appId');
  570. this.$api.get('/goods/qrcode', {
  571. url: `${process.env.VUE_APP_HREF}/packageGoods/pages/detail?appid=${appid}&id=${this.goodsId}&serviceId=${this.$store.state.user.userId}`
  572. }).then(res => {
  573. // this.codeUrl = 'data:image/jpeg;base64,' + res.data;
  574. this.codeUrl = res.data;
  575. resolve(res.data);
  576. })
  577. });
  578. },
  579. // 视频播放
  580. playVideo(e) {
  581. this.isPlayVideo = true;
  582. },
  583. // 视频暂停
  584. pauseVideo(e) {
  585. this.isPlayVideo = false;
  586. },
  587. // 关闭视频弹窗
  588. closeFixedVideo() {
  589. this.isFixedVideo = false;
  590. this.isCloseMyself = true;
  591. this.videoContext2.pause();
  592. },
  593. // 从个人信息获取购物车商品数量
  594. getCartCount() {
  595. this.$api.get('/user/user/detail', {
  596. userId: this.$store.state.user.userId
  597. }).then(res => {
  598. this.cartCount = res.data.shoppingCartNums;
  599. if(!res.data.openId) {
  600. return this.$navToPage({
  601. url: '/pages/login/index?isNotOpenid=' + true
  602. })
  603. }
  604. })
  605. },
  606. // 查看所有评价
  607. toAllEvaluate() {
  608. this.$navToPage({
  609. url: '/packageGoods/pages/evaluate?goodsId=' + this.goodsId
  610. })
  611. },
  612. // 收藏/取消收藏
  613. handleCollect() {
  614. if(!this.isLogin) {
  615. return this.$navToPage({
  616. url: '/pages/login/index'
  617. })
  618. }
  619. if(!this.detail.favorite) {
  620. this.$api.post('/goods/favorite/add', {
  621. goodsId: this.goodsId,
  622. userId: this.$store.state.user.userId
  623. }).then(res => {
  624. this.$successToast('收藏成功');
  625. this.getDetail();
  626. })
  627. }else {
  628. this.$api.post('/goods/favorite/detail/del', {
  629. goodsId: this.goodsId,
  630. userId: this.$store.state.user.userId
  631. }).then(res => {
  632. this.$successToast('取消收藏成功');
  633. this.getDetail();
  634. })
  635. }
  636. },
  637. // 切换图片
  638. changeBanner(e) {
  639. this.bannerCurrent = e.detail.current;
  640. if(this.bannerCurrent > 0 && this.detail.vedio) {
  641. this.videoContext1.pause();
  642. }
  643. },
  644. // 预览图片
  645. previewImage(url) {
  646. let imgs = [];
  647. this.bannerList.forEach((item, index) => {
  648. imgs.push(item.url);
  649. })
  650. uni.previewImage({
  651. urls: imgs,
  652. current: url
  653. });
  654. },
  655. // 预览评价图片
  656. previewEvaluateImage(url, imgs) {
  657. uni.previewImage({
  658. urls: imgs,
  659. current: url
  660. });
  661. },
  662. // 点击分享
  663. clickShare() {
  664. if(!this.isLogin) {
  665. return this.$navToPage({
  666. url: '/pages/login/index'
  667. })
  668. }
  669. // this.getGoodsCode();
  670. this.isShareDialog = true;
  671. },
  672. // 点击加入购物车/立即购买
  673. clickCartOrBuy(type) {
  674. if(!this.isLogin) {
  675. return this.$navToPage({
  676. url: '/pages/login/index'
  677. })
  678. }
  679. if(type == 5) {
  680. this.buyNum = 1;
  681. this.isTradeTag = true;
  682. this.isTradeAgree = false;
  683. }else {
  684. this.isTradeTag = false;
  685. }
  686. this.dialogType = type;
  687. this.isBuyDialog = true;
  688. },
  689. // 切换规格
  690. changeSpec(index) {
  691. this.specCurrent = index;
  692. },
  693. // 加入购物车
  694. addToCart() {
  695. if(this.specList[this.specCurrent].stockNum == 0) {
  696. return this.$toast('该规格库存不足');
  697. }
  698. this.$api.postJson('/shpping/cart/add/one', {
  699. userId: this.$store.state.user.userId,
  700. buyGoods: [{
  701. goodsId: this.goodsId,
  702. goodsSpecId: this.specList[this.specCurrent].goodsSpecId,
  703. num: this.buyNum,
  704. secKillId: this.detail.secKillId || '',
  705. promotionGroupId: this.detail.promotionGroupId || '',
  706. }]
  707. }).then(res => {
  708. this.$successToast('添加成功');
  709. this.getCartCount();
  710. this.isBuyDialog = false;
  711. })
  712. },
  713. // 立即购买
  714. nowBuy() {
  715. if(this.specList[this.specCurrent].stockNum == 0) {
  716. return this.$toast('该规格库存不足');
  717. }
  718. let buyList = [{
  719. goodsId: this.goodsId,
  720. goodsSpecId: this.specList[this.specCurrent].goodsSpecId,
  721. num: this.buyNum,
  722. secKillId: this.detail.secKillId || '',
  723. promotionGroupId: this.detail.promotionGroupId || '',
  724. }];
  725. let url = '/packageGoods/pages/order';
  726. if(this.detail.promotionGroupId) {
  727. url = url + '?groupbuyId=' + this.detail.promotionGroupId
  728. }
  729. this.$setStorage('goodsBuyList', buyList);
  730. this.$navToPage({
  731. url
  732. })
  733. },
  734. // 马上抢购(秒杀)
  735. rushBuy() {
  736. if(this.detail.secStockNum == 0) {
  737. return this.$toast('该规格库存不足');
  738. }
  739. this.$api.post('/goods/sec/kill/start', {
  740. secKillId: this.detail.secKillId,
  741. }).then(res => {
  742. if(res.data) {
  743. let buyList = [{
  744. goodsId: this.goodsId,
  745. goodsSpecId: this.specList[this.specCurrent].goodsSpecId,
  746. num: this.buyNum,
  747. secKillId: this.detail.secKillId || '',
  748. promotionGroupId: this.detail.promotionGroupId || '',
  749. }];
  750. this.$setStorage('goodsBuyList', buyList);
  751. this.$navToPage({
  752. url: '/packageGoods/pages/order?secKillId=' + this.detail.secKillId + '&secKillSpecId=' + this.detail.secKillSpecId + '&secToken=' + res.data
  753. })
  754. }else {
  755. this.$toast('活动异常');
  756. }
  757. })
  758. },
  759. // 去购物车
  760. toCart() {
  761. this.$navToPage({
  762. url:'/packageGoods/pages/cart'
  763. })
  764. },
  765. // 去以旧换新协议
  766. toAgreement() {
  767. this.$navToPage({
  768. url: `/packageMine/pages/agreement?type=4`
  769. })
  770. },
  771. changeTradeTag() {
  772. this.isTradeTag = !this.isTradeTag;
  773. this.buyNum = 1;
  774. },
  775. toTradein() {
  776. if(!this.isTradeAgree) return this.$toast('请阅读并同意《以旧换新协议》');
  777. let buyList = [{
  778. goodsId: this.goodsId,
  779. goodsSpecId: this.specList[this.specCurrent].goodsSpecId,
  780. num: this.buyNum,
  781. secKillId: this.detail.secKillId || '',
  782. promotionGroupId: this.detail.promotionGroupId || '',
  783. }];
  784. this.$setStorage('goodsBuyList', buyList);
  785. this.$navToPage({
  786. url: `/packageGoods/pages/tradein/category?goodsId=${this.goodsId}`
  787. })
  788. },
  789. // 生成图片
  790. async markImage() {
  791. this.isShareDialog = false;
  792. this.isShowCanvas = true;
  793. if(this.isFinishCanvas) {
  794. return false;
  795. }
  796. uni.showLoading({
  797. title: '海报生成中'
  798. });
  799. await this.getGoodsCode();
  800. let img = this.detail.imgUrl;
  801. let title = this.detail.goodsName;
  802. let des = this.detail.describeText;
  803. let price1 = this.detail.goodsPrice;
  804. let price2 = this.detail.orgGoodsPrice;
  805. let sales = this.detail.soldNum;
  806. let fullPieceNum = this.detail.promotionFullPieceNum;
  807. let fullPiecePrice = this.detail.promotionFullPiecePrice;
  808. let fullPiece = `${fullPieceNum}件单价约¥${fullPiecePrice}`;
  809. // let code = this.codeUrl;
  810. // base64src(this.codeUrl , resCurrent => {
  811. // code = resCurrent;
  812. // })
  813. var ctx = uni.createCanvasContext('myCanvas')
  814. /**
  815. * @param {Object} str 要绘制的字符串
  816. * @param {Number} initX 绘制字符串起始x坐标
  817. * @param {Number} initY 绘制字符串起始y坐标
  818. * @param {Number} lineHeight 字行高
  819. */
  820. function canvasTextAutoLine(str,initX,initY,lineHeight){
  821. var lineWidth = 0;
  822. var canvasWidth = 260;
  823. var lastSubStrIndex= 0;
  824. var lineNum = 0;
  825. var state = true;
  826. for(let i=0;i<str.length;i++){
  827. lineWidth += ctx.measureText(str[i]).width;
  828. if(lineWidth>canvasWidth && lineNum < 1){
  829. ctx.fillText(str.substring(lastSubStrIndex,i),initX,initY);
  830. initY+=lineHeight;
  831. lineWidth=0;
  832. lastSubStrIndex=i;
  833. lineNum ++;
  834. } else if(lineWidth>canvasWidth && lineNum < 2) {
  835. ctx.fillText(str.substring(lastSubStrIndex+2,i)+'...',initX,initY);
  836. lineNum ++;
  837. state = false
  838. }
  839. if(i==str.length-1 && state){
  840. ctx.fillText(str.substring(lastSubStrIndex,i+1),initX,initY);
  841. }
  842. }
  843. }
  844. // 白色背景
  845. ctx.rect(0, 0, 300, 520)
  846. ctx.setFillStyle('#FFFFFF')
  847. ctx.fill()
  848. ctx.stroke()
  849. // 商品名称
  850. ctx.setFontSize(14)
  851. ctx.setFillStyle('#333333')
  852. canvasTextAutoLine(title, 20, 300, 18)
  853. // 商品描述
  854. if(des) {
  855. ctx.setFontSize(12)
  856. ctx.setFillStyle('#999999')
  857. canvasTextAutoLine(des, 20, 336, 16)
  858. }
  859. // 现价
  860. ctx.setFontSize(16)
  861. ctx.setFillStyle('#FF3F42')
  862. ctx.fillText('¥'+price1, 20, 380)
  863. // 原价
  864. ctx.setFontSize(13)
  865. ctx.setFillStyle('#666666')
  866. ctx.fillText('¥'+price2, 20, 396)
  867. ctx.setStrokeStyle("#666666")
  868. ctx.moveTo(20, 392)
  869. ctx.lineTo(ctx.measureText('¥'+price2).width + 20, 392)
  870. ctx.stroke()
  871. // 销量
  872. ctx.setFontSize(12)
  873. ctx.setFillStyle('#666666')
  874. ctx.fillText('销量:'+sales, 260 - ctx.measureText('销量:'+sales).width + 20, 380)
  875. // 满件打折
  876. if(fullPieceNum) {
  877. ctx.setFillStyle('#FF3F42')
  878. ctx.fillRect(ctx.measureText('¥'+price1).width + 40, 370, ctx.measureText(fullPiece).width + 16, 22)
  879. ctx.setFontSize(12)
  880. ctx.setFillStyle('#FFFFFF')
  881. ctx.fillText(fullPiece, ctx.measureText('¥'+price1).width + 48, 385)
  882. }
  883. // 二维码
  884. // ctx.drawImage(code, 110, 404, 80, 80)
  885. // 提示
  886. ctx.setFontSize(12)
  887. ctx.setFillStyle('#FE781F')
  888. ctx.fillText('打开微信扫描识别查看商品', 78, 500)
  889. // 图片
  890. // const imgRes = await toBase64src(process.env.VUE_APP_BASE_URL + process.env.VUE_APP_BASE_API + '/redirect?url=' + img)
  891. // const codeRes = await toBase64src(process.env.VUE_APP_BASE_URL + process.env.VUE_APP_BASE_API + '/redirect?url=' + this.codeUrl)
  892. if(img.indexOf('https://zf-mall.oss-cn-shenzhen.aliyuncs.com') >= 0) {
  893. img = img.replace('https://zf-mall.oss-cn-shenzhen.aliyuncs.com', 'https://sxbh5.zfire.top/imgfile');
  894. }
  895. if(img.indexOf('https://train-2023.oss-cn-shenzhen.aliyuncs.com') >= 0) {
  896. img = img.replace('https://train-2023.oss-cn-shenzhen.aliyuncs.com', 'https://jiasm.zfire.top/sxbh5/imgfile');
  897. }
  898. let codeUrl = '';
  899. if(this.codeUrl.indexOf('https://zf-mall.oss-cn-shenzhen.aliyuncs.com') >= 0) {
  900. codeUrl = this.codeUrl.replace('https://zf-mall.oss-cn-shenzhen.aliyuncs.com', 'https://sxbh5.zfire.top/imgfile');
  901. }
  902. if(this.codeUrl.indexOf('https://train-2023.oss-cn-shenzhen.aliyuncs.com') >= 0) {
  903. codeUrl = this.codeUrl.replace('https://train-2023.oss-cn-shenzhen.aliyuncs.com', 'https://jiasm.zfire.top/sxbh5/imgfile');
  904. }
  905. const imgRes = await toBase64src(img)
  906. const codeRes = await toBase64src(codeUrl)
  907. ctx.drawImage(imgRes, 20, 20, 260, 260)
  908. ctx.drawImage(codeRes, 110, 404, 80, 80)
  909. ctx.draw()
  910. setTimeout(() => {
  911. uni.canvasToTempFilePath({
  912. x: 0,
  913. y: 0,
  914. width: 300,
  915. height: 520,
  916. canvasId: 'myCanvas',
  917. success: res => {
  918. this.canvasImg = res.tempFilePath;
  919. console.log(res.tempFilePath);
  920. console.log('生成画布成功')
  921. uni.hideLoading();
  922. this.isFinishCanvas = true;
  923. },
  924. fail: res => {
  925. console.log(res);
  926. },
  927. complete: res => {
  928. console.log(res);
  929. }
  930. }, this)
  931. }, 500)
  932. },
  933. // 关闭canvas
  934. closeCanvas() {
  935. this.isShowCanvas = false;
  936. uni.hideLoading();
  937. },
  938. }
  939. }
  940. </script>
  941. <style lang="scss">
  942. .app-container {
  943. background: #F4F2F2;
  944. box-sizing: border-box;
  945. padding-bottom: 100rpx;
  946. }
  947. .recommender-container {
  948. position: fixed;
  949. top: 20rpx;
  950. left: 0;
  951. z-index: 99;
  952. display: flex;
  953. justify-content: center;
  954. width: 100%;
  955. .content {
  956. font-size: 28rpx;
  957. color: #FFFFFF;
  958. background: rgba($color: #000000, $alpha: 0.8);
  959. display: flex;
  960. padding: 0 15rpx;
  961. height: 60rpx;
  962. border-radius: 60rpx;
  963. justify-content: center;
  964. align-items: center;
  965. image {
  966. width: 40rpx;
  967. height: 40rpx;
  968. display: block;
  969. border-radius: 50%;
  970. margin-right: 10rpx;
  971. }
  972. .name {
  973. max-width: 160rpx;
  974. margin-right: 6rpx;
  975. }
  976. }
  977. }
  978. .swiper-container {
  979. position: relative;
  980. swiper {
  981. height: 750rpx;
  982. }
  983. .image {
  984. width: 750rpx;
  985. height: 750rpx;
  986. display: block;
  987. margin: 0 auto;
  988. overflow: hidden;
  989. position: relative;
  990. .img {
  991. width: 750rpx;
  992. height: 750rpx;
  993. display: block;
  994. }
  995. .water {
  996. width: 750rpx;
  997. height: 750rpx;
  998. display: block;
  999. position: absolute;
  1000. left: 0;
  1001. top: 0;
  1002. z-index: 1;
  1003. }
  1004. }
  1005. // image {
  1006. // height: 750rpx;
  1007. // width: 750rpx;
  1008. // display: block;
  1009. // margin: 0 auto;
  1010. // overflow: hidden;
  1011. // }
  1012. video {
  1013. height: 750rpx;
  1014. width: 750rpx;
  1015. display: block;
  1016. margin: 0 auto;
  1017. overflow: hidden;
  1018. }
  1019. .nums {
  1020. position: absolute;
  1021. right: 20rpx;
  1022. bottom: 20rpx;
  1023. background: rgba($color: #000000, $alpha: 0.2);
  1024. border-radius: 8rpx;
  1025. line-height: 48rpx;
  1026. padding: 0 12rpx;
  1027. font-size: 28rpx;
  1028. color: #FFFFFF;
  1029. }
  1030. }
  1031. .video-container {
  1032. position: fixed;
  1033. right: 20rpx;
  1034. bottom: 300rpx;
  1035. z-index: -99;
  1036. &.isFixed {
  1037. z-index: 99;
  1038. }
  1039. .content {
  1040. position: relative;
  1041. }
  1042. video {
  1043. height: 200rpx;
  1044. width: 375rpx;
  1045. }
  1046. .close {
  1047. position: absolute;
  1048. right: 0;
  1049. top: 0;
  1050. z-index: 100;
  1051. background: rgba($color: #000000, $alpha: .4);
  1052. padding: 10rpx;
  1053. image {
  1054. width: 28rpx;
  1055. height: 28rpx;
  1056. display: block;
  1057. }
  1058. }
  1059. }
  1060. .seckill-container {
  1061. height: 120rpx;
  1062. background: linear-gradient(-90deg,rgba(255,37,118,1.00) 0%, #ff5648 100%);
  1063. display: flex;
  1064. justify-content: space-between;
  1065. align-items: center;
  1066. padding: 0 20rpx;
  1067. position: relative;
  1068. .clock {
  1069. position: absolute;
  1070. right: 220rpx;
  1071. top: 20rpx;
  1072. image {
  1073. width: 74rpx;
  1074. height: 72rpx;
  1075. display: block;
  1076. }
  1077. }
  1078. .price-1 {
  1079. font-size: 40rpx;
  1080. color: #FFFFFF;
  1081. line-height: 44rpx;
  1082. }
  1083. .price-2 {
  1084. font-size: 28rpx;
  1085. line-height: 32rpx;
  1086. color: #DDDDDD;
  1087. text-decoration: line-through;
  1088. }
  1089. .right {
  1090. display: flex;
  1091. flex-direction: column;
  1092. align-items: center;
  1093. text {
  1094. font-size: 24rpx;
  1095. color: #FFFFFF;
  1096. }
  1097. .time {
  1098. font-size: 24rpx;
  1099. color: #FFFFFF;
  1100. display: flex;
  1101. align-items: center;
  1102. margin-top: 6rpx;
  1103. text {
  1104. width: 40rpx;
  1105. height: 40rpx;
  1106. background: #FFFFFF;
  1107. border-radius: 4rpx;
  1108. color: #FF2775;
  1109. font-size: 24rpx;
  1110. line-height: 40rpx;
  1111. text-align: center;
  1112. margin: 0 4rpx;
  1113. }
  1114. }
  1115. }
  1116. }
  1117. .main-container {
  1118. background: #FFFFFF;
  1119. padding: 20rpx 20rpx 0;
  1120. .title {
  1121. font-size: 32rpx;
  1122. color: #333333;
  1123. line-height: 40rpx;
  1124. font-weight: 600;
  1125. }
  1126. .des {
  1127. font-size: 24rpx;
  1128. color: #999999;
  1129. line-height: 28rpx;
  1130. margin-top: 8rpx;
  1131. }
  1132. .tags {
  1133. display: flex;
  1134. flex-wrap: wrap;
  1135. .it {
  1136. height: 28rpx;
  1137. padding: 0 10rpx;
  1138. line-height: 28rpx;
  1139. border-radius: 10rpx;
  1140. background: #e8e8e8;
  1141. font-size: 20rpx;
  1142. color: #666666;
  1143. margin-right: 10rpx;
  1144. margin-top: 10rpx;
  1145. }
  1146. }
  1147. .tags2 {
  1148. display: flex;
  1149. flex-wrap: wrap;
  1150. .it {
  1151. font-size: 20rpx;
  1152. height: 30rpx;
  1153. line-height: 30rpx;
  1154. padding: 0 6rpx;
  1155. margin-right: 10rpx;
  1156. border: 1px solid #FE781F;
  1157. color: #FE781F;
  1158. box-sizing: border-box;
  1159. margin-top: 10rpx;
  1160. display: flex;
  1161. align-items: center;
  1162. flex-direction: row;
  1163. border-radius: 10rpx;
  1164. }
  1165. }
  1166. .stock {
  1167. display: flex;
  1168. justify-content: space-between;
  1169. align-items: flex-end;
  1170. margin-top: 20rpx;
  1171. padding-bottom: 20rpx;
  1172. .left {
  1173. display: flex;
  1174. align-items: center;
  1175. text {
  1176. font-size: 24rpx;
  1177. color: #666666;
  1178. }
  1179. .progress-box {
  1180. width: 140rpx;
  1181. border-radius: 6px;
  1182. overflow: hidden;
  1183. margin-left: 10rpx;
  1184. }
  1185. }
  1186. .right {
  1187. font-size: 28rpx;
  1188. color: #999999;
  1189. display: flex;
  1190. align-items: center;
  1191. image {
  1192. width: 20rpx;
  1193. height: 20rpx;
  1194. display: block;
  1195. margin-left: 10rpx;
  1196. }
  1197. }
  1198. }
  1199. .price-con {
  1200. display: flex;
  1201. justify-content: space-between;
  1202. align-items: flex-end;
  1203. margin-top: 10rpx;
  1204. padding-bottom: 20rpx;
  1205. .left {
  1206. display: flex;
  1207. align-items: center;
  1208. .price {
  1209. display: flex;
  1210. flex-direction: column;
  1211. .price-1 {
  1212. color: $minor-color;
  1213. font-weight: 500;
  1214. font-size: 32rpx;
  1215. text {
  1216. font-size: 24rpx;
  1217. }
  1218. }
  1219. .price-2 {
  1220. font-size: 26rpx;
  1221. color: #666666;
  1222. line-height: 30rpx;
  1223. text-decoration: line-through;
  1224. }
  1225. }
  1226. .box {
  1227. background: $minor-color;
  1228. border-radius: 8rpx;
  1229. padding: 8rpx 12rpx;
  1230. color: #ffffff;
  1231. font-size: 26rpx;
  1232. margin-left: 20rpx;
  1233. }
  1234. }
  1235. .right {
  1236. font-size: 28rpx;
  1237. color: #999999;
  1238. display: flex;
  1239. align-items: center;
  1240. image {
  1241. width: 20rpx;
  1242. height: 20rpx;
  1243. display: block;
  1244. margin-left: 10rpx;
  1245. }
  1246. }
  1247. }
  1248. .bottom {
  1249. border-top: 1px solid #eaeaea;
  1250. .row {
  1251. display: flex;
  1252. align-items: center;
  1253. justify-content: space-between;
  1254. height: 76rpx;
  1255. font-size: 28rpx;
  1256. color: #666666;
  1257. }
  1258. }
  1259. }
  1260. .line-container {
  1261. background: #FFFFFF;
  1262. margin-top: 20rpx;
  1263. display: flex;
  1264. justify-content: space-between;
  1265. align-items: center;
  1266. height: 88rpx;
  1267. font-size: 28rpx;
  1268. color: #333333;
  1269. padding: 0 20rpx;
  1270. text {
  1271. color: #FE781F;
  1272. }
  1273. }
  1274. .tradein-container {
  1275. background: #ffffff;
  1276. margin-top: 20rpx;
  1277. padding: 30rpx 20rpx;
  1278. display: flex;
  1279. align-items: center;
  1280. justify-content: space-between;
  1281. .left {
  1282. .top {
  1283. display: flex;
  1284. align-items: center;
  1285. .iconfont {
  1286. color: $theme-color;
  1287. font-size: 36rpx;
  1288. }
  1289. .text {
  1290. color: $theme-color;
  1291. margin-left: 8rpx;
  1292. font-weight: 500;
  1293. }
  1294. ::v-deep .u-tag {
  1295. margin-left: 16rpx;
  1296. border-color: $assist-color;
  1297. .u-tag__text {
  1298. color: $assist-color;
  1299. }
  1300. }
  1301. }
  1302. .bottom {
  1303. font-size: 24rpx;
  1304. margin-top: 20rpx;
  1305. }
  1306. }
  1307. .right {
  1308. display: flex;
  1309. align-items: center;
  1310. color: $assist-color;
  1311. font-size: 28rpx;
  1312. .iconfont {
  1313. margin-left: 8rpx;
  1314. color: $sec-font;
  1315. }
  1316. }
  1317. }
  1318. .allBottom-container {
  1319. position: fixed;
  1320. bottom: 0;
  1321. left: 0;
  1322. }
  1323. .tradeinBottom-container {
  1324. width: 100%;
  1325. box-sizing: border-box;
  1326. padding: 20rpx;
  1327. background: #E6F0FF;
  1328. display: flex;
  1329. align-items: center;
  1330. justify-content: space-between;
  1331. .left {
  1332. display: flex;
  1333. align-items: center;
  1334. .tag {
  1335. display: flex;
  1336. align-items: center;
  1337. background: $theme-color;
  1338. padding: 8rpx 16rpx;
  1339. border-radius: 8rpx;
  1340. .iconfont {
  1341. color: #ffffff;
  1342. font-size: 32rpx;
  1343. }
  1344. .name {
  1345. font-size: 24rpx;
  1346. color: #ffffff;
  1347. margin-left: 8rpx;
  1348. }
  1349. }
  1350. .text {
  1351. font-size: 24rpx;
  1352. margin-left: 12rpx;
  1353. }
  1354. }
  1355. .right {
  1356. display: flex;
  1357. align-items: center;
  1358. color: $assist-color;
  1359. font-size: 28rpx;
  1360. .iconfont {
  1361. margin-left: 8rpx;
  1362. color: $sec-font;
  1363. }
  1364. }
  1365. }
  1366. .detail-container {
  1367. background: #FFFFFF;
  1368. margin-top: 20rpx;
  1369. padding-bottom: 100rpx;
  1370. .title {
  1371. font-size: 32rpx;
  1372. color: #333333;
  1373. line-height: 88rpx;
  1374. text-align: center;
  1375. font-weight: 600;
  1376. }
  1377. .content {
  1378. image, img {
  1379. width: 100%;
  1380. display: block;
  1381. }
  1382. }
  1383. }
  1384. .evaluate-container {
  1385. background: #FFFFFF;
  1386. margin-top: 20rpx;
  1387. padding: 0 20rpx;
  1388. .title {
  1389. height: 88rpx;
  1390. display: flex;
  1391. justify-content: space-between;
  1392. align-items: center;
  1393. .left {
  1394. font-size: 32rpx;
  1395. text-align: center;
  1396. font-weight: 600;
  1397. }
  1398. .right {
  1399. display: flex;
  1400. align-items: center;
  1401. color: $sec-font;
  1402. text {
  1403. margin-left: 8rpx;
  1404. font-size: 24rpx;
  1405. }
  1406. }
  1407. }
  1408. .list {
  1409. .item {
  1410. padding-bottom: 30rpx;
  1411. .top {
  1412. display: flex;
  1413. justify-content: space-between;
  1414. align-items: center;
  1415. .user {
  1416. display: flex;
  1417. align-items: center;
  1418. image {
  1419. width: 80rpx;
  1420. height: 80rpx;
  1421. display: block;
  1422. border-radius: 50%;
  1423. margin-right: 20rpx;
  1424. }
  1425. .right {
  1426. .name {
  1427. max-width: 300rpx;
  1428. font-size: 28rpx;
  1429. color: #333333;
  1430. font-weight: 500;
  1431. }
  1432. .date {
  1433. font-size: 24rpx;
  1434. color: #999999;
  1435. margin-top: 12rpx;
  1436. }
  1437. }
  1438. }
  1439. }
  1440. .tags {
  1441. display: flex;
  1442. flex-wrap: wrap;
  1443. .it {
  1444. line-height: 44rpx;
  1445. padding: 0 15rpx;
  1446. border: 1px solid #eaeaea;
  1447. border-radius: 44rpx;
  1448. font-size: 24rpx;
  1449. margin-right: 14rpx;
  1450. margin-top: 14rpx;
  1451. color: #666666;
  1452. }
  1453. }
  1454. .content {
  1455. font-size: 28rpx;
  1456. color: #333333;
  1457. margin-top: 14rpx;
  1458. }
  1459. .images {
  1460. display: flex;
  1461. flex-wrap: wrap;
  1462. margin-top: 14rpx;
  1463. image {
  1464. width: 140rpx;
  1465. height: 140rpx;
  1466. margin-right: 20rpx;
  1467. margin-bottom: 20rpx;
  1468. }
  1469. }
  1470. }
  1471. }
  1472. }
  1473. .bottom-container {
  1474. width: 710rpx;
  1475. padding: 0 20rpx;
  1476. padding-bottom: env(safe-area-inset-bottom);
  1477. background: #FFFFFF;
  1478. display: flex;
  1479. justify-content: space-between;
  1480. align-items: center;
  1481. height: 100rpx;
  1482. border-top: 1px solid #eaeaea;
  1483. .left {
  1484. display: flex;
  1485. width: 280rpx;
  1486. .item {
  1487. display: flex;
  1488. flex-direction: column;
  1489. align-items: center;
  1490. justify-content: center;
  1491. margin-right: 40rpx;
  1492. position: relative;
  1493. width: 66rpx;
  1494. &:last-child {
  1495. margin-right: 0;
  1496. }
  1497. .iconfont {
  1498. font-size: 48rpx;
  1499. &.active {
  1500. color: $minor-color;
  1501. }
  1502. }
  1503. text {
  1504. font-size: 20rpx;
  1505. color: #333333;
  1506. margin-top: 4rpx;
  1507. white-space: nowrap;
  1508. }
  1509. .dot {
  1510. position: absolute;
  1511. right: -4rpx;
  1512. top: -8rpx;
  1513. background: $minor-color;
  1514. width: 32rpx;
  1515. height: 32rpx;
  1516. line-height: 32rpx;
  1517. text-align: center;
  1518. border-radius: 32rpx;
  1519. font-size: 20rpx;
  1520. color: #FFFFFF;
  1521. }
  1522. }
  1523. }
  1524. .right {
  1525. display: flex;
  1526. .button {
  1527. width: 190rpx;
  1528. height: 80rpx;
  1529. line-height: 80rpx;
  1530. text-align: center;
  1531. border-radius: 80rpx;
  1532. font-size: 28rpx;
  1533. &.cart {
  1534. color: $theme-color;
  1535. background: #E6F0FF;
  1536. }
  1537. &.buy {
  1538. color: #ffffff;
  1539. background: $theme-color;
  1540. margin-left: 10rpx;
  1541. }
  1542. &.sec {
  1543. color: #ffffff;
  1544. background: $minor-color;
  1545. margin-left: 10rpx;
  1546. }
  1547. }
  1548. }
  1549. }
  1550. .cart-container {
  1551. padding: 60rpx 20rpx 30rpx;
  1552. .main {
  1553. display: flex;
  1554. padding: 20rpx 0;
  1555. border-bottom: 1px solid #eaeaea;
  1556. image {
  1557. width: 200rpx;
  1558. height: 200rpx;
  1559. display: block;
  1560. flex-shrink: 0;
  1561. }
  1562. .right {
  1563. margin-left: 26rpx;
  1564. display: flex;
  1565. flex-direction: column;
  1566. justify-content: space-between;
  1567. .title {
  1568. font-size: 28rpx;
  1569. font-weight: 500;
  1570. line-height: 36rpx;
  1571. }
  1572. .price {
  1573. display: flex;
  1574. align-items: center;
  1575. .price-con {
  1576. display: flex;
  1577. flex-direction: column;
  1578. .price-1 {
  1579. color: $minor-color;
  1580. font-weight: 500;
  1581. font-size: 32rpx;
  1582. text {
  1583. font-size: 24rpx;
  1584. }
  1585. }
  1586. .price-2 {
  1587. font-size: 26rpx;
  1588. color: #666666;
  1589. line-height: 30rpx;
  1590. text-decoration: line-through;
  1591. }
  1592. }
  1593. .box {
  1594. background: $minor-color;
  1595. border-radius: 8rpx;
  1596. padding: 8rpx 12rpx;
  1597. color: #ffffff;
  1598. font-size: 26rpx;
  1599. margin-left: 20rpx;
  1600. }
  1601. }
  1602. .stock {
  1603. font-size: 24rpx;
  1604. color: #999999;
  1605. }
  1606. }
  1607. }
  1608. .attr {
  1609. padding: 20rpx 0;
  1610. border-bottom: 1px solid #eaeaea;
  1611. .title {
  1612. font-size: 28rpx;
  1613. color: #333333;
  1614. }
  1615. .list {
  1616. display: flex;
  1617. flex-wrap: wrap;
  1618. .item {
  1619. margin-top: 16rpx;
  1620. padding: 10rpx 16rpx;
  1621. font-size: 24rpx;
  1622. color: #666666;
  1623. background: #f5f5f5;
  1624. border-radius: 5rpx;
  1625. margin-right: 16rpx;
  1626. &.current {
  1627. color: $theme-color;
  1628. background: #E6F0FF;
  1629. }
  1630. }
  1631. }
  1632. }
  1633. .num {
  1634. padding: 20rpx 0;
  1635. display: flex;
  1636. justify-content: space-between;
  1637. align-items: center;
  1638. .title {
  1639. font-size: 28rpx;
  1640. color: #333333;
  1641. }
  1642. ::v-deep .u-number-box {
  1643. .u-number-box__minus, .u-number-box__plus {
  1644. width: 26px;
  1645. }
  1646. }
  1647. }
  1648. .tradein {
  1649. border-top: 1px solid #eaeaea;
  1650. padding: 30rpx 0 0;
  1651. .top {
  1652. display: flex;
  1653. .name {
  1654. font-size: 28rpx;
  1655. flex-shrink: 0;
  1656. }
  1657. .text {
  1658. font-size: 24rpx;
  1659. line-height: 32rpx;
  1660. }
  1661. }
  1662. .tag {
  1663. display: inline-block;
  1664. margin-top: 16rpx;
  1665. padding: 12rpx 24rpx;
  1666. font-size: 24rpx;
  1667. color: #666666;
  1668. background: #f5f5f5;
  1669. border-radius: 50rpx;
  1670. margin-right: 16rpx;
  1671. &.active {
  1672. color: $assist-color;
  1673. background: rgba($color: $assist-color, $alpha: .2);
  1674. }
  1675. }
  1676. .agreement {
  1677. height: 80rpx;
  1678. padding-top: 20rpx;
  1679. display: flex;
  1680. align-items: flex-end;
  1681. .content {
  1682. display: flex;
  1683. align-items: center;
  1684. .iconfont {
  1685. font-size: 36rpx;
  1686. &.icon-danxuan {
  1687. color: $sec-font;
  1688. }
  1689. &.icon-danxuan2 {
  1690. color: $theme-color;
  1691. }
  1692. }
  1693. .text {
  1694. margin-left: 8rpx;
  1695. font-size: 24rpx;
  1696. text {
  1697. color: $theme-color;
  1698. }
  1699. }
  1700. }
  1701. }
  1702. }
  1703. .button {
  1704. text-align: center;
  1705. line-height: 74rpx;
  1706. border-radius: 74rpx;
  1707. font-size: 28rpx;
  1708. margin-top: 20rpx;
  1709. &.cart {
  1710. color: #ffffff;
  1711. background: $theme-color;
  1712. }
  1713. &.buy {
  1714. color: #ffffff;
  1715. background: $theme-color;
  1716. }
  1717. &.sec {
  1718. color: #ffffff;
  1719. background: $minor-color;
  1720. }
  1721. }
  1722. }
  1723. .sharelist-container {
  1724. padding: 30rpx 0;
  1725. display: flex;
  1726. button {
  1727. background: none;
  1728. border-radius:0;
  1729. &::after {
  1730. border: none;
  1731. }
  1732. }
  1733. .item {
  1734. display: flex;
  1735. width: 50%;
  1736. flex-direction: column;
  1737. align-items: center;
  1738. image {
  1739. width: 100rpx;
  1740. height: 100rpx;
  1741. display: block;
  1742. margin-bottom: 20rpx;
  1743. }
  1744. text {
  1745. font-size: 28rpx;
  1746. line-height: 32rpx;
  1747. color: #333333;
  1748. }
  1749. }
  1750. }
  1751. .canvas-container {
  1752. position: fixed;
  1753. left: 50%;
  1754. top: 50%;
  1755. z-index: 999;
  1756. margin-left: -150px;
  1757. margin-top: -280px;
  1758. .button {
  1759. display: flex;
  1760. justify-content: center;
  1761. text {
  1762. display: block;
  1763. width: 280rpx;
  1764. height: 70rpx;
  1765. border-radius: 70rpx;
  1766. background: $theme-color;
  1767. font-size: 28rpx;
  1768. color: #FFFFFF;
  1769. text-align: center;
  1770. line-height: 70rpx;
  1771. margin-top: 20rpx;
  1772. }
  1773. }
  1774. }
  1775. .shareGuideDialog {
  1776. position: fixed;
  1777. top: 0;
  1778. left: 0;
  1779. width: 100%;
  1780. height: 100vh;
  1781. background: rgba($color: #000000, $alpha: .4);
  1782. display: flex;
  1783. justify-content: flex-end;
  1784. .content {
  1785. .icon {
  1786. text-align: right;
  1787. margin-right: 50rpx;
  1788. margin-top: 20rpx;
  1789. text {
  1790. font-size: 52rpx;
  1791. color: #ffffff;
  1792. }
  1793. }
  1794. .text {
  1795. view {
  1796. font-size: 28rpx;
  1797. color: #ffffff;
  1798. margin-top: 12rpx;
  1799. text-align: center;
  1800. }
  1801. }
  1802. }
  1803. }
  1804. </style>