goodsDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  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" @click="goBuy">立即购买</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. goBuy(){
  182. uni.navigateTo({
  183. url:'confirm'
  184. })
  185. },
  186. calculation(type){
  187. if(type==1){
  188. if(this.goodsnum>1){
  189. this.goodsnum--
  190. }
  191. }else{
  192. if(this.info.oneQty>this.goodsnum){
  193. this.goodsnum++
  194. }
  195. }
  196. }
  197. }
  198. }
  199. </script>
  200. <style scoped lang="less">
  201. .box{
  202. background: #F4F5F7;
  203. min-height: 100vh;
  204. }
  205. .buySHop{
  206. display: flex;
  207. justify-content: space-between;
  208. font-size:28rpx ;
  209. color: #666666;
  210. padding-top: 30rpx;
  211. }
  212. .buybtnBox{
  213. width: 750rpx;
  214. height: 120rpx;
  215. background: #FFFFFF;
  216. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.2000);
  217. }
  218. .buyBox{
  219. width: 750rpx;
  220. height: 100vh;
  221. position: fixed;
  222. left: 0;
  223. top: 0;
  224. background: rgba(0,0,0,0.5);
  225. }
  226. .buyBtn{
  227. width: 690rpx;
  228. height: 74rpx;
  229. background: #D53533;
  230. border-radius: 37rpx;
  231. text-align: center;
  232. line-height: 74rpx;
  233. color: #FFFFFF;
  234. font-size: 30rpx;
  235. margin-top: 23rpx;
  236. margin-left: 30rpx;
  237. }
  238. .buyShopRightJt{
  239. width: 12rpx;
  240. height: 20rpx;
  241. margin-top: 8rpx;
  242. margin-left: 10rpx;
  243. }
  244. .buyShopRight{
  245. display: flex;
  246. }
  247. .bugNUm{
  248. border-top: 1px solid #EEEEEE;
  249. border-Bottom: 1px solid #EEEEEE;
  250. padding: 28rpx 0;
  251. display: flex;
  252. justify-content: space-between;
  253. }
  254. .buyXg{
  255. width: 110rpx;
  256. height: 36rpx;
  257. border-radius: 4rpx;
  258. border: 1px solid #F19D01;
  259. text-align: center;
  260. line-height: 36rpx;
  261. color: #F19D01;
  262. font-size: 24rpx;
  263. }
  264. .numJj{
  265. width: 44rpx;
  266. height: 44rpx;
  267. background: #F4F5F7;
  268. border-radius: 0px 6rpx 6rpx 0px;
  269. text-align: center;
  270. line-height: 44rpx;
  271. font-size: 30rpx;
  272. color: #F4F5F7;
  273. }
  274. .bugNUmLeft{
  275. display: flex;
  276. }
  277. .buySl{
  278. color: #666666;font-size: 28rpx;padding-right: 30rpx;
  279. }
  280. .goodsnum{
  281. width: 88rpx;
  282. height: 44rpx;
  283. background: #F4F5F7;
  284. line-height: 44rpx;
  285. text-align: center;
  286. font-weight: 500;
  287. color: #333333;
  288. font-size: 24rpx;
  289. margin: 0 4rpx;
  290. }
  291. .numJsbox{
  292. display: flex;
  293. }
  294. .buyCont{
  295. position: absolute;
  296. left: 0;
  297. bottom: 0;
  298. width: 750rpx;
  299. height: 648rpx;
  300. background: #FFFFFF;
  301. border-radius: 26rpx 26rpx 0px 0px;
  302. }
  303. .buyNumBox{
  304. padding: 30rpx;
  305. }
  306. .buyContCh{
  307. position: absolute;
  308. top: 53rpx;
  309. right: 36rpx;
  310. width: 36rpx;
  311. height: 36rpx;
  312. }
  313. .hotGoodsLine{
  314. margin-top: 30rpx;
  315. padding: 20rpx;
  316. background: #FFFFFF;
  317. border-radius: 16rpx;
  318. display: flex;
  319. }
  320. .hotGoodsLineImg{
  321. width: 208rpx;
  322. height: 194rpx;
  323. border-radius: 16rpx;
  324. border: 1px solid #EEEEEE;
  325. }
  326. .goodsName2{
  327. font-size: 28rpx;
  328. font-family: PingFangSC-Regular, PingFang SC;
  329. font-weight: 400;
  330. color: #333333;
  331. line-height: 40rpx;
  332. text-overflow: -o-ellipsis-lastline;
  333. overflow: hidden;
  334. text-overflow: ellipsis;
  335. display: -webkit-box;
  336. -webkit-line-clamp: 2;
  337. line-clamp: 2;
  338. -webkit-box-orient: vertical;
  339. min-height: 80rpx;
  340. width: 370rpx;
  341. }
  342. .hotGoodsLineRIght{
  343. padding-left: 24rpx;
  344. }
  345. .goodsPrice{
  346. display: flex;
  347. padding-top: 10rpx;
  348. }
  349. .goodsPrice11{
  350. font-size: 24rpx;
  351. font-weight: 400;
  352. color: #FF0000;
  353. padding-top: 8rpx;
  354. }
  355. .goodsPrice22{
  356. font-size: 22rpx;
  357. font-weight: 400;
  358. color: #FF0000;
  359. padding-top: 8rpx;
  360. padding-left: 5rpx;
  361. }
  362. .goodsPrice33{
  363. font-size: 32rpx;
  364. font-weight: 400;
  365. color: #FF0000;
  366. }
  367. .goodsPrice44{
  368. font-size: 24rpx;
  369. font-weight: 400;
  370. color: #999999;
  371. padding-top: 8rpx;
  372. padding-left: 5rpx;
  373. }
  374. .bottomBox{
  375. width: 750px;
  376. height: 120rpx;
  377. background: #FFFFFF;
  378. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.2000);
  379. position: fixed;left: 0;
  380. bottom: 0;
  381. display: flex;
  382. }
  383. .bottomTxt{
  384. color: #666666;font-size: 22rpx;
  385. }
  386. .bottomImg{
  387. width: 48rpx;height: 48rpx;
  388. }
  389. .bottomImgBox{
  390. text-align: center;
  391. padding-top: 20rpx;
  392. padding-left: 40rpx;
  393. }
  394. .bottomBtn{
  395. width: 450rpx;
  396. height: 74rpx;
  397. background: #D53533;
  398. border-radius: 37rpx;
  399. line-height: 74rpx;
  400. text-align: center;
  401. color: #FFFFFF;
  402. font-size: 30rpx;
  403. margin-top: 23rpx;
  404. margin-left: 70rpx;
  405. }
  406. .goodsDetailTitle{
  407. color: #333333;
  408. line-height: 42px;
  409. font-size: 30rpx;
  410. font-weight: 500;
  411. background: #FFFFFF;
  412. padding: 20rpx 24rpx;
  413. }
  414. .goodsDetail{
  415. margin-top: 20rpx;
  416. }
  417. .mealBox{
  418. background: #FFFFFF;
  419. padding: 20rpx 24rpx;
  420. margin-top: 20rpx;
  421. }
  422. .mealTopRight{
  423. display: flex;
  424. }
  425. .mealLine{
  426. margin-top: 20rpx;
  427. }
  428. .itemname{
  429. width: 441rpx;
  430. text-overflow: -o-ellipsis-lastline;
  431. overflow: hidden;
  432. text-overflow: ellipsis;
  433. display: -webkit-box;
  434. -webkit-line-clamp: 2;
  435. line-clamp: 2;
  436. -webkit-box-orient: vertical;
  437. }
  438. .itemline{
  439. display: flex;
  440. padding: 10rpx 20rpx;
  441. justify-content: space-between;
  442. line-height: 37rpx;
  443. font-size: 26rpx;
  444. color: #333333;
  445. }
  446. .itemlinebOX{
  447. border-radius: 0px 0px 10px 10px;
  448. border: 2Rpx solid #EEEEEE;
  449. padding: 10rpx 0;
  450. }
  451. .mealTop{
  452. display: flex;
  453. justify-content: space-between;
  454. height: 72rpx;
  455. background: #F19D01 linear-gradient(90deg, #FFF7EB 0%, #FFEFD5 100%);
  456. border-radius: 10rpx 10rpx 0px 0px;
  457. line-height: 72rpx;
  458. color: #333333;
  459. font-size: 26rpx;
  460. padding: 0 20rpx;
  461. }
  462. .fwlcTitle{
  463. color: #333333;font-size: 30rpx;
  464. }
  465. .fuwuliucBox{
  466. background: #FFFFFF;
  467. padding: 20rpx 24rpx;
  468. margin-top: 20rpx;
  469. }
  470. .fwlcxian{
  471. padding:30rpx 42rpx 20rpx 42rpx ;
  472. display: flex;
  473. }
  474. .fwlcyuan{
  475. width: 16rpx;
  476. height: 16rpx;
  477. background: #FF0000;
  478. border-radius: 50%;
  479. }
  480. .fwHx{
  481. height: 4rpx;
  482. background: #FF0000;
  483. width: 186rpx;
  484. margin-top: 7rpx;
  485. }
  486. .fwTxt{
  487. display: flex;
  488. justify-content: space-between;
  489. }
  490. .fwTxtline{
  491. color: #333333;
  492. line-height: 37px;
  493. font-size: 26rpx;
  494. }
  495. .swiper{
  496. width: 750rpx;
  497. height: 700rpx;
  498. background: #FFFFFF;
  499. border-bottom: 1px solid #EEEEEE;
  500. }
  501. .swiper-item{
  502. width: 750rpx;
  503. height: 700rpx;
  504. }
  505. .swiper-itemImg{
  506. width: 750rpx;
  507. height: 700rpx;
  508. }
  509. .shopCtop{
  510. display: flex;
  511. padding: 20rpx 24rpx;
  512. justify-content: space-between;
  513. background: #FFFFFF;
  514. }
  515. .goodsPrice{
  516. display: flex;
  517. }
  518. .goodsPrice1{
  519. font-size: 24rpx;
  520. font-weight: 400;
  521. color: #FF0000;
  522. padding-top: 14rpx;
  523. }
  524. .goodsPrice2{
  525. font-size: 28rpx;
  526. font-weight: 400;
  527. color: #FF0000;
  528. padding-top: 10rpx;
  529. padding-left: 14rpx;
  530. }
  531. .goodsPrice3{
  532. font-size:28rpx;
  533. font-weight: 400;
  534. color: #FF0000;
  535. padding-right: 10rpx;
  536. }
  537. .goodsPrice3{
  538. font-size: 40rpx;
  539. font-weight: 400;
  540. color: #FF0000;
  541. }
  542. .goodsPrice4{
  543. font-size: 24rpx;
  544. font-weight: 400;
  545. color: #999999;
  546. padding-top: 14rpx;
  547. }
  548. .Sold{
  549. font-weight: 400;
  550. color: #999999;
  551. font-size: 24rpx;
  552. padding-top: 10rpx;
  553. }
  554. .goodsName{
  555. font-size: 30rpx;
  556. line-height: 42rpx;
  557. font-weight: 500;
  558. color: #333333;
  559. padding: 20rpx 24rpx;
  560. }
  561. .goodsMd{
  562. font-weight: 400;
  563. color: #999999;
  564. font-size: 26rpx;
  565. padding: 0 24rpx;
  566. padding-bottom: 20rpx;
  567. }
  568. .shopCont{
  569. background: #FFFFFF;
  570. }
  571. .modeBox{
  572. margin-top:20rpx ;
  573. padding: 5rpx 0;
  574. background: #FFFFFF;
  575. }
  576. .modeline{
  577. display: flex;
  578. padding: 15rpx 24rpx;
  579. }
  580. .modelineLeft{
  581. color: #999999;
  582. font-size: 26rpx;
  583. width: 200rpx;
  584. }
  585. .modeLineRight{
  586. color: #333333;
  587. font-size: 26rpx;
  588. }
  589. </style>