goodsDetail.vue 13 KB

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