goodsDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. <template>
  2. <view class="box">
  3. <view class="spwBox">
  4. <swiper class="swiper" circular :autoplay="false" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
  5. <swiper-item v-for="(item,index) in info.ImgList">
  6. <view class="swiper-item">
  7. <img mode="aspectFit" :src="item.url" alt="" class="swiper-itemImg">
  8. </view>
  9. </swiper-item>
  10. </swiper>
  11. </view>
  12. <view class="shopCont">
  13. <view class="shopCtop">
  14. <view class="goodsPrice">
  15. <view class="goodsPrice1">店庆价</view>
  16. <view class="goodsPrice2">¥</view>
  17. <view class="goodsPrice3">{{info.scribingPrice?info.scribingPrice:info.salePrice}}</view>
  18. <view class="goodsPrice4" v-if="info.scribingPrice">¥{{info.salePrice}}</view>
  19. </view>
  20. <view class="Sold">已售 {{info.saleQty}}</view>
  21. </view>
  22. <view class="goodsName">{{info.name}}</view>
  23. <view class="goodsMd" v-if="info.sellingPoint">{{info.sellingPoint}}</view>
  24. </view>
  25. <view class="modeBox">
  26. <view class="modeline">
  27. <view class="modelineLeft">配送方式</view>
  28. <view class="modeLineRight">{{info.distributionType==1?'到店取货':'到店使用'}}</view>
  29. </view>
  30. <view class="modeline">
  31. <view class="modelineLeft">限购数量</view>
  32. <view class="modeLineRight">{{info.oneQty}}</view>
  33. </view>
  34. <view class="modeline">
  35. <view class="modelineLeft">售后服务</view>
  36. <view class="modeLineRight">{{info.afterService}}</view>
  37. </view>
  38. </view>
  39. <!-- 服务流程 -->
  40. <view class="fuwuliucBox">
  41. <view class="fwlcTitle">服务流程</view>
  42. <view class="fwlcxian">
  43. <view class="fwlcyuan"></view>
  44. <view class="fwHx"></view>
  45. <view class="fwlcyuan"></view>
  46. <view class="fwHx"></view>
  47. <view class="fwlcyuan"></view>
  48. <view class="fwHx"></view>
  49. <view class="fwlcyuan"></view>
  50. </view>
  51. <view class="fwTxt">
  52. <view class="fwTxtline">选择商品</view>
  53. <view class="fwTxtline">选择门店</view>
  54. <view class="fwTxtline">在线开卡</view>
  55. <view class="fwTxtline">到店服务</view>
  56. </view>
  57. </view>
  58. <!-- 套餐内容 -->
  59. <view class="mealBox" v-if="info.bizType==3">
  60. <view class="fwlcTitle">套餐内容</view>
  61. <view class="mealLine" v-for="(item,index) in 2">
  62. <view class="mealTop">
  63. <view class="mealName">项目名称</view>
  64. <view class="mealTopRight">
  65. <view>数量</view>
  66. <view style="padding-left: 44rpx;">有效期</view>
  67. </view>
  68. </view>
  69. <view class="itemlinebOX">
  70. <view class="itemline">
  71. <view class="itemname">这是项目名称长长长长长项目名称项目名称长长sss长长换行换</view>
  72. <view>20</view>
  73. <view>10个月</view>
  74. </view>
  75. <view class="itemline">
  76. <view class="itemname">这是项目名称</view>
  77. <view>200</view>
  78. <view>10个月</view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <!-- 商品详情 -->
  84. <view class="goodsDetail">
  85. <view class="goodsDetailTitle">商品详情</view>
  86. <view v-html="info.details" style="background: #fff;"></view>
  87. </view>
  88. <view style="height: 120rpx;"></view>
  89. <view class="bottomBox">
  90. <view class="bottomImgBox" @click="goINdex">
  91. <image src="../../static/timg/home.png" mode="" class="bottomImg"></image>
  92. <view class="bottomTxt">首页</view>
  93. </view>
  94. <view class="bottomImgBox" style="margin-left: 20rpx;">
  95. <image src="../../static/timg/share.png" mode="" class="bottomImg"></image>
  96. <view class="bottomTxt">分享</view>
  97. </view>
  98. <view class="bottomBtn" @click="buyShow=true">立即购买</view>
  99. </view>
  100. <!-- 立即购买 -->
  101. <view class="buyBox" v-if="buyShow" @click="buyShow=false">
  102. <view class="buyCont" @click.stop="">
  103. <image src="../../static/timg/chahao.png" mode="" class="buyContCh" @click="buyShow=false"></image>
  104. <view class="goodsBox">
  105. <view class="hotGoodsLine" >
  106. <view>
  107. <image :src="info.ImgList[0].url" mode="" v-if="info.ImgList.length>1" class="hotGoodsLineImg"></image>
  108. <image src="../../static/timg/noimg.png" class="hotGoodsLineImg" v-else></image>
  109. </view>
  110. <view class="hotGoodsLineRIght">
  111. <view class="goodsName2">{{info.name}}</view>
  112. <view class="Sold">已售 {{info.saleQty}}</view>
  113. <view class="goodsPrice">
  114. <view class="goodsPrice11">店庆价</view>
  115. <view class="goodsPrice22">¥</view>
  116. <view class="goodsPrice33">{{info.scribingPrice?info.scribingPrice:info.salePrice}}</view>
  117. <view class="goodsPrice44" v-if="info.scribingPrice">¥{{info.salePrice}}</view>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="buyNumBox">
  123. <view class="bugNUm">
  124. <view class="bugNUmLeft">
  125. <view class="buySl">数量</view>
  126. <view class="buyXg">限购{{info.oneQty}}件</view>
  127. </view>
  128. <view class="numJsbox">
  129. <view class="numJj" @click="calculation(1)">-</view>
  130. <view class="goodsnum">{{goodsnum}}</view>
  131. <view class="numJj" @click="calculation(2)">+</view>
  132. </view>
  133. </view>
  134. <view class="buySHop">
  135. <view>服务门店</view>
  136. <view class="buyShopRight">
  137. <view>连锁一号</view>
  138. <image src="../../static/timg/icon_arrow_right.png" mode="" class="buyShopRightJt"></image>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="buybtnBox">
  143. <view class="buyBtn">立即购买</view>
  144. </view>
  145. </view>
  146. </view>
  147. <!-- <view :style="{color:colorX}">asdfas</view> -->
  148. </view>
  149. </template>
  150. <script>
  151. export default {
  152. components: {
  153. },
  154. data() {
  155. return {
  156. userInfo:'',
  157. goodsnum:1,
  158. buyShow:false,
  159. id:'',
  160. info:'',
  161. }
  162. },
  163. onLoad(opt) {
  164. this.id=opt.id;
  165. this.userInfo = uni.getStorageSync("userInfo");
  166. this.openGoodsDetailById()
  167. },
  168. methods: {
  169. openGoodsDetailById(){
  170. this.$http('openMall/openGoodsDetailById', {
  171. id:this.id
  172. },'GET').then(res => {
  173. this.info=res.data
  174. })
  175. },
  176. goINdex(){
  177. uni.switchTab({
  178. url:'../index/index'
  179. })
  180. },
  181. calculation(type){
  182. if(type==1){
  183. if(this.goodsnum>1){
  184. this.goodsnum--
  185. }
  186. }else{
  187. if(this.info.oneQty>this.goodsnum){
  188. this.goodsnum++
  189. }
  190. }
  191. }
  192. }
  193. }
  194. </script>
  195. <style scoped lang="less">
  196. .box{
  197. background: #F4F5F7;
  198. min-height: 100vh;
  199. }
  200. .buySHop{
  201. display: flex;
  202. justify-content: space-between;
  203. font-size:28rpx ;
  204. color: #666666;
  205. padding-top: 30rpx;
  206. }
  207. .buybtnBox{
  208. width: 750rpx;
  209. height: 120rpx;
  210. background: #FFFFFF;
  211. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.2000);
  212. }
  213. .buyBox{
  214. width: 750rpx;
  215. height: 100vh;
  216. position: fixed;
  217. left: 0;
  218. top: 0;
  219. background: rgba(0,0,0,0.5);
  220. }
  221. .buyBtn{
  222. width: 690rpx;
  223. height: 74rpx;
  224. background: #D53533;
  225. border-radius: 37rpx;
  226. text-align: center;
  227. line-height: 74rpx;
  228. color: #FFFFFF;
  229. font-size: 30rpx;
  230. margin-top: 23rpx;
  231. margin-left: 30rpx;
  232. }
  233. .buyShopRightJt{
  234. width: 12rpx;
  235. height: 20rpx;
  236. margin-top: 8rpx;
  237. margin-left: 10rpx;
  238. }
  239. .buyShopRight{
  240. display: flex;
  241. }
  242. .bugNUm{
  243. border-top: 1px solid #EEEEEE;
  244. border-Bottom: 1px solid #EEEEEE;
  245. padding: 28rpx 0;
  246. display: flex;
  247. justify-content: space-between;
  248. }
  249. .buyXg{
  250. width: 110rpx;
  251. height: 36rpx;
  252. border-radius: 4rpx;
  253. border: 1px solid #F19D01;
  254. text-align: center;
  255. line-height: 36rpx;
  256. color: #F19D01;
  257. font-size: 24rpx;
  258. }
  259. .numJj{
  260. width: 44rpx;
  261. height: 44rpx;
  262. background: #F4F5F7;
  263. border-radius: 0px 6rpx 6rpx 0px;
  264. text-align: center;
  265. line-height: 44rpx;
  266. font-size: 30rpx;
  267. color: #F4F5F7;
  268. }
  269. .bugNUmLeft{
  270. display: flex;
  271. }
  272. .buySl{
  273. color: #666666;font-size: 28rpx;padding-right: 30rpx;
  274. }
  275. .goodsnum{
  276. width: 88rpx;
  277. height: 44rpx;
  278. background: #F4F5F7;
  279. line-height: 44rpx;
  280. text-align: center;
  281. font-weight: 500;
  282. color: #333333;
  283. font-size: 24rpx;
  284. margin: 0 4rpx;
  285. }
  286. .numJsbox{
  287. display: flex;
  288. }
  289. .buyCont{
  290. position: absolute;
  291. left: 0;
  292. bottom: 0;
  293. width: 750rpx;
  294. height: 648rpx;
  295. background: #FFFFFF;
  296. border-radius: 26rpx 26rpx 0px 0px;
  297. }
  298. .buyNumBox{
  299. padding: 30rpx;
  300. }
  301. .buyContCh{
  302. position: absolute;
  303. top: 53rpx;
  304. right: 36rpx;
  305. width: 36rpx;
  306. height: 36rpx;
  307. }
  308. .hotGoodsLine{
  309. margin-top: 30rpx;
  310. padding: 20rpx;
  311. background: #FFFFFF;
  312. border-radius: 16rpx;
  313. display: flex;
  314. }
  315. .hotGoodsLineImg{
  316. width: 208rpx;
  317. height: 194rpx;
  318. border-radius: 16rpx;
  319. border: 1px solid #EEEEEE;
  320. }
  321. .goodsName2{
  322. font-size: 28rpx;
  323. font-family: PingFangSC-Regular, PingFang SC;
  324. font-weight: 400;
  325. color: #333333;
  326. line-height: 40rpx;
  327. text-overflow: -o-ellipsis-lastline;
  328. overflow: hidden;
  329. text-overflow: ellipsis;
  330. display: -webkit-box;
  331. -webkit-line-clamp: 2;
  332. line-clamp: 2;
  333. -webkit-box-orient: vertical;
  334. min-height: 80rpx;
  335. width: 370rpx;
  336. }
  337. .hotGoodsLineRIght{
  338. padding-left: 24rpx;
  339. }
  340. .goodsPrice{
  341. display: flex;
  342. padding-top: 10rpx;
  343. }
  344. .goodsPrice11{
  345. font-size: 24rpx;
  346. font-weight: 400;
  347. color: #F03B3B;
  348. padding-top: 8rpx;
  349. }
  350. .goodsPrice22{
  351. font-size: 22rpx;
  352. font-weight: 400;
  353. color: #F03B3B;
  354. padding-top: 8rpx;
  355. padding-left: 5rpx;
  356. }
  357. .goodsPrice33{
  358. font-size: 32rpx;
  359. font-weight: 400;
  360. color: #F03B3B;
  361. }
  362. .goodsPrice44{
  363. font-size: 24rpx;
  364. font-weight: 400;
  365. color: #999999;
  366. padding-top: 8rpx;
  367. padding-left: 5rpx;
  368. }
  369. .bottomBox{
  370. width: 750px;
  371. height: 120rpx;
  372. background: #FFFFFF;
  373. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.2000);
  374. position: fixed;left: 0;
  375. bottom: 0;
  376. display: flex;
  377. }
  378. .bottomTxt{
  379. color: #666666;font-size: 22rpx;
  380. }
  381. .bottomImg{
  382. width: 48rpx;height: 48rpx;
  383. }
  384. .bottomImgBox{
  385. text-align: center;
  386. padding-top: 20rpx;
  387. padding-left: 40rpx;
  388. }
  389. .bottomBtn{
  390. width: 450rpx;
  391. height: 74rpx;
  392. background: #D53533;
  393. border-radius: 37rpx;
  394. line-height: 74rpx;
  395. text-align: center;
  396. color: #FFFFFF;
  397. font-size: 30rpx;
  398. margin-top: 23rpx;
  399. margin-left: 70rpx;
  400. }
  401. .goodsDetailTitle{
  402. color: #333333;
  403. line-height: 42px;
  404. font-size: 30rpx;
  405. font-weight: 500;
  406. background: #FFFFFF;
  407. padding: 20rpx 24rpx;
  408. }
  409. .goodsDetail{
  410. margin-top: 20rpx;
  411. }
  412. .mealBox{
  413. background: #FFFFFF;
  414. padding: 20rpx 24rpx;
  415. margin-top: 20rpx;
  416. }
  417. .mealTopRight{
  418. display: flex;
  419. }
  420. .mealLine{
  421. margin-top: 20rpx;
  422. }
  423. .itemname{
  424. width: 441rpx;
  425. text-overflow: -o-ellipsis-lastline;
  426. overflow: hidden;
  427. text-overflow: ellipsis;
  428. display: -webkit-box;
  429. -webkit-line-clamp: 2;
  430. line-clamp: 2;
  431. -webkit-box-orient: vertical;
  432. }
  433. .itemline{
  434. display: flex;
  435. padding: 10rpx 20rpx;
  436. justify-content: space-between;
  437. line-height: 37rpx;
  438. font-size: 26rpx;
  439. color: #333333;
  440. }
  441. .itemlinebOX{
  442. border-radius: 0px 0px 10px 10px;
  443. border: 2Rpx solid #EEEEEE;
  444. padding: 10rpx 0;
  445. }
  446. .mealTop{
  447. display: flex;
  448. justify-content: space-between;
  449. height: 72rpx;
  450. background: #F19D01 linear-gradient(90deg, #FFF7EB 0%, #FFEFD5 100%);
  451. border-radius: 10rpx 10rpx 0px 0px;
  452. line-height: 72rpx;
  453. color: #333333;
  454. font-size: 26rpx;
  455. padding: 0 20rpx;
  456. }
  457. .fwlcTitle{
  458. color: #333333;font-size: 30rpx;
  459. }
  460. .fuwuliucBox{
  461. background: #FFFFFF;
  462. padding: 20rpx 24rpx;
  463. margin-top: 20rpx;
  464. }
  465. .fwlcxian{
  466. padding:30rpx 42rpx 20rpx 42rpx ;
  467. display: flex;
  468. }
  469. .fwlcyuan{
  470. width: 16rpx;
  471. height: 16rpx;
  472. background: #F03B3B;
  473. border-radius: 50%;
  474. }
  475. .fwHx{
  476. height: 4rpx;
  477. background: #F03B3B;
  478. width: 186rpx;
  479. margin-top: 7rpx;
  480. }
  481. .fwTxt{
  482. display: flex;
  483. justify-content: space-between;
  484. }
  485. .fwTxtline{
  486. color: #333333;
  487. line-height: 37px;
  488. font-size: 26rpx;
  489. }
  490. .swiper{
  491. width: 750rpx;
  492. height: 700rpx;
  493. background: #FFFFFF;
  494. border-bottom: 1px solid #EEEEEE;
  495. }
  496. .swiper-item{
  497. width: 750rpx;
  498. height: 700rpx;
  499. }
  500. .swiper-itemImg{
  501. width: 750rpx;
  502. height: 700rpx;
  503. }
  504. .shopCtop{
  505. display: flex;
  506. padding: 20rpx 24rpx;
  507. justify-content: space-between;
  508. background: #FFFFFF;
  509. }
  510. .goodsPrice{
  511. display: flex;
  512. }
  513. .goodsPrice1{
  514. font-size: 24rpx;
  515. font-weight: 400;
  516. color: #F03B3B;
  517. padding-top: 14rpx;
  518. }
  519. .goodsPrice2{
  520. font-size: 28rpx;
  521. font-weight: 400;
  522. color: #F03B3B;
  523. padding-top: 10rpx;
  524. padding-left: 14rpx;
  525. }
  526. .goodsPrice3{
  527. font-size:28rpx;
  528. font-weight: 400;
  529. color: #F03B3B;
  530. padding-right: 10rpx;
  531. }
  532. .goodsPrice3{
  533. font-size: 40rpx;
  534. font-weight: 400;
  535. color: #F03B3B;
  536. }
  537. .goodsPrice4{
  538. font-size: 24rpx;
  539. font-weight: 400;
  540. color: #999999;
  541. padding-top: 14rpx;
  542. }
  543. .Sold{
  544. font-weight: 400;
  545. color: #999999;
  546. font-size: 24rpx;
  547. padding-top: 10rpx;
  548. }
  549. .goodsName{
  550. font-size: 30rpx;
  551. line-height: 42rpx;
  552. font-weight: 500;
  553. color: #333333;
  554. padding: 20rpx 24rpx;
  555. }
  556. .goodsMd{
  557. font-weight: 400;
  558. color: #999999;
  559. font-size: 26rpx;
  560. padding: 0 24rpx;
  561. padding-bottom: 20rpx;
  562. }
  563. .shopCont{
  564. background: #FFFFFF;
  565. }
  566. .modeBox{
  567. margin-top:20rpx ;
  568. padding: 5rpx 0;
  569. background: #FFFFFF;
  570. }
  571. .modeline{
  572. display: flex;
  573. padding: 15rpx 24rpx;
  574. }
  575. .modelineLeft{
  576. color: #999999;
  577. font-size: 26rpx;
  578. width: 200rpx;
  579. }
  580. .modeLineRight{
  581. color: #333333;
  582. font-size: 26rpx;
  583. }
  584. </style>