goodsDetail.vue 13 KB

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