maintainItem.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  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 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="goodsPrice2">¥</view>
  16. <view class="goodsPrice3" >{{itemDefault.money}}</view>
  17. <view class="goodsPrice4" v-if="itemDefault.showCrossedPrice==1">原价:¥{{itemDefault.crossedPrice}}</view>
  18. </view>
  19. <view class="shareBox" >
  20. <view class="shareTxt">分享</view>
  21. <image class="shareIcon" src="../../static/timg/share.png" mode=""></image>
  22. </view>
  23. </view>
  24. <view class="goodsName">{{detail.title}}</view>
  25. <view class="goodsMSBox" >
  26. <!-- <view class="goodsMs" v-if="detail.showOilType">机油类型|{{detail.showOilType}}</view>
  27. <view class="goodsMs" v-if="detail.showOilLevel">机油等级|{{detail.showOilLevel}}</view>
  28. <view class="goodsMs" v-if="detail.showFit">适配粘度|{{detail.showFit}}</view> -->
  29. <view class="goodsMs" v-if="detail.content">{{detail.content}}</view>
  30. </view>
  31. <view class="timeBox">
  32. <view class="itemTime" v-if="detail.validityType==1">套餐有效期:{{detail.validityTime}}</view>
  33. <view class="sell" v-if="itemDefault.showSalesCount==1">
  34. <span>已售:</span><span style="color: #FFC107;">{{itemDefault.dummyCount}}</span>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="buyBOx">
  39. <view class="buyLine" @click="ckCar">
  40. <view class="buyTitle">已选车型</view>
  41. <view class="buyData">{{carInfo.carModel?carInfo.carModel:''}}
  42. <image class="jtIcon" src="../../static/timg/jthei.png" mode=""></image>
  43. </view>
  44. </view>
  45. <view class="carTis" v-if="isRecommend!='true'">此套餐可能与爱车不适配</view>
  46. <view class="buyLine">
  47. <view class="buyTitle">商品规格</view>
  48. <view class="buyData guigeBox">
  49. <!-- <view class="goodsGuige activeGuige" style="margin-right: 24rpx;">单次购买</view> -->
  50. <view class="goodsGuige" @click="goodsGuige(item)"
  51. :class="{activeGuige:item.id==itemDefault.id}"
  52. v-for="(item,index) in detail.packageItems">{{item.title}}</view>
  53. </view>
  54. </view>
  55. <view class="buyLine">
  56. <view class="buyTitle">商品数量</view>
  57. <view class="buyData">
  58. <view class="numJsbox">
  59. <view class="numJj" @click="calculation(1)">-</view>
  60. <view class="goodsnum">
  61. <input type="number" value="" v-model="goodsnum" class="goodsnumInput"/>
  62. </view>
  63. <view class="numJj" @click="calculation(2)">+</view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="buyLine">
  68. <view class="buyTitle">使用方式</view>
  69. <view class="buyData">到店使用</view>
  70. </view>
  71. <view class="buyLine">
  72. <view class="buyTitle">可用门店</view>
  73. <view class="buyData" v-if="itemDefault.packTimeShopName=='全部'">全部门店</view>
  74. <view class="buyData" v-else>{{itemDefault.packTimeShopName.split(',').length}}个门店可用</view>
  75. </view>
  76. </view>
  77. <view class="mealBox">
  78. <view class="fwlcTitle">套餐内容</view>
  79. <rich-text :nodes="itemDefault.content" style="background: #fff;"></rich-text>
  80. <!-- <view class="mealTop">
  81. <view class="mealName">套餐名称</view>
  82. <view class="mealNum">数量</view>
  83. <view class="mealexpire">有效期</view>
  84. </view>
  85. <view class="mealTop2">
  86. <view class="mealName">【豪华车型】全合成机油保养套餐</view>
  87. <view class="mealNum">2</view>
  88. <view class="mealexpire">18个月</view>
  89. </view>
  90. <view class="mealXj">
  91. <view class="xjLine">
  92. <view class="xjyd"></view>
  93. <view class="xjTxt">20项检查</view>
  94. </view>
  95. <view class="xjLine">
  96. <view class="xjyd"></view>
  97. <view class="xjTxt">20美日韩车型专用保养套餐适配机油</view>
  98. </view>
  99. </view>
  100. <view class="mealMs">
  101. <view class="mealMsline">
  102. 1.本套餐不限车辆使用;
  103. 2.机油套餐包含:机油,机油滤,工时费
  104. 3.购买此套餐,共享有2次保养次数。
  105. </view>
  106. </view> -->
  107. </view>
  108. <!-- 商品详情 -->
  109. <view class="goodsDetail" >
  110. <view class="goodsDetailTitle">商品详情</view>
  111. <!-- <view v-html="info.details" style="background: #fff;"></view> -->
  112. <rich-text :nodes="detail.detailContent" style="background: #fff;"></rich-text>
  113. </view>
  114. <view class="bottomTianc"></view>
  115. <view class="bottom">
  116. <view class="bleft">
  117. <image class="kefuIcon" src="../../static/img2/kefu.png" mode=""></image>
  118. <view style="text-align: center;font-size: 20rpx;color: #110B01;">客服</view>
  119. </view>
  120. <view class="Btn" @click="submitFn">立即购买</view>
  121. </view>
  122. </view>
  123. </template>
  124. <script>
  125. export default {
  126. components: {
  127. },
  128. data() {
  129. return {
  130. themeColor:'',
  131. ext:'',
  132. ImgList:[
  133. {url:'http://dmsphoto.66km.com.cn/thFiles/339E5DB5-F727-4F0F-AD41-1A2EBAB73883.png'},
  134. {url:'http://dmsphoto.66km.com.cn/thFiles/53DA3E26-5FA3-42DE-95A4-10BA255290A6.png'},
  135. ],
  136. goodsnum:1,
  137. details:'11233',
  138. maintainId:'',
  139. detail:'',
  140. itemDefault:'',
  141. carInfo:'',
  142. userInfo:'',
  143. isRecommend:'',
  144. }
  145. },
  146. onLoad(opt) {
  147. this.ext = this.$common.getExtStoreId();
  148. this.themeColor = uni.getStorageSync("themeColor");
  149. this.maintainId=opt.maintainId
  150. this.carInfo=this.$store.state.carInfo;
  151. this.userInfo=this.$store.state.userInfo;
  152. this.isRecommend=opt.isRecommend
  153. //console.log("this.isRecommend=="+this.isRecommend)
  154. if(this.userInfo){
  155. this.getdetail()
  156. }else{
  157. this.$common.automaticlogin().then(val => {
  158. this.userInfo=this.$store.state.userInfo;
  159. this.getdetail()
  160. })
  161. }
  162. },
  163. onShow() {
  164. var car =uni.getStorageSync("byCar")
  165. if(car){
  166. this.carInfo=car;
  167. this.getdetail()
  168. this.isRecommend=false
  169. }
  170. },
  171. methods: {
  172. ckCar(){
  173. uni.navigateTo({
  174. url:'../user/addCar/cailist?type=5'
  175. })
  176. },
  177. goodsGuige(item){
  178. this.itemDefault=item
  179. },
  180. submitFn(){
  181. if(this.itemDefault){
  182. this.itemDefault.goodsnum=this.goodsnum
  183. this.itemDefault.goodsname=this.detail.title
  184. this.itemDefault.itemId=this.detail.id
  185. this.itemDefault.mainImgUrl=this.detail.mainImgUrl
  186. uni.setStorage({
  187. key: 'itemDefault',
  188. data: this.itemDefault,
  189. success: function () {
  190. uni.navigateTo({
  191. url:'maintainSubmit'
  192. })
  193. }
  194. });
  195. }else{
  196. uni.showToast({
  197. title: '请选择商品规格',
  198. icon:'none',
  199. duration: 3000
  200. });
  201. /* uni.showModal({
  202. title: '提示',
  203. content:"请选择商品规格",
  204. success: function(resTKk) {
  205. }
  206. }); */
  207. }
  208. },
  209. calculation(type){
  210. if(type==1){
  211. if(this.goodsnum>1){
  212. this.goodsnum--
  213. }
  214. }else{
  215. console.log("+++")
  216. this.goodsnum++
  217. }
  218. },
  219. getdetail(){
  220. uni.showLoading({
  221. title: '加载中'
  222. })
  223. this.$http('openMaintain/detail/'+this.maintainId, {
  224. /* maintainId:this.maintainId */
  225. }, 'GET').then(res => {
  226. uni.hideLoading();
  227. this.detail=res.data
  228. this.detail.packageItems.forEach(item=>{
  229. if(item.isDefault==1){
  230. this.itemDefault=item
  231. }
  232. })
  233. })
  234. },
  235. }
  236. }
  237. </script>
  238. <style scoped lang="less">
  239. .box {
  240. width: 100vw;
  241. min-height: 100vh;
  242. background: #F4F4F4;
  243. }
  244. .swiper{
  245. width: 750rpx;
  246. height: 700rpx;
  247. background: #FFFFFF;
  248. border-bottom: 1px solid #EEEEEE;
  249. }
  250. .swiper-item{
  251. width: 750rpx;
  252. height: 700rpx;
  253. }
  254. .swiper-itemImg{
  255. width: 750rpx;
  256. height: 700rpx;
  257. }
  258. .goodsPrice{
  259. display: flex;
  260. }
  261. .goodsPrice1{
  262. font-size: 24rpx;
  263. font-weight: 400;
  264. color: #FF0000;
  265. padding-top: 14rpx;
  266. padding-right: 14rpx;
  267. }
  268. .goodsPrice2{
  269. font-size: 28rpx;
  270. font-weight: 400;
  271. color: #FF0000;
  272. padding-top: 10rpx;
  273. }
  274. .goodsPrice3{
  275. font-size: 40rpx;
  276. font-weight: 500;
  277. color: #FF0000;
  278. }
  279. .goodsPrice4{
  280. font-size: 24rpx;
  281. font-weight: 400;
  282. color: #999999;
  283. padding-top: 14rpx;
  284. /* text-decoration:line-through; */
  285. padding-left: 10rpx;
  286. }
  287. .Sold{
  288. font-weight: 400;
  289. color: #999999;
  290. font-size: 24rpx;
  291. padding-top: 18rpx;
  292. }
  293. .goodsName{
  294. font-size: 30rpx;
  295. line-height: 42rpx;
  296. font-weight: 500;
  297. color: #333333;
  298. padding: 20rpx 24rpx;
  299. padding-top: 0;
  300. padding-bottom: 16rpx;
  301. }
  302. .goodsMd{
  303. font-weight: 400;
  304. color: #999999;
  305. font-size: 26rpx;
  306. padding: 0 24rpx;
  307. padding-bottom: 20rpx;
  308. }
  309. .shopCont{
  310. background: #FFFFFF;
  311. }
  312. .shopCtop{
  313. display: flex;
  314. padding: 20rpx 24rpx;
  315. justify-content: space-between;
  316. background: #FFFFFF;
  317. }
  318. .goodsMSBox{
  319. display: flex;padding-left: 24rpx;
  320. }
  321. .goodsMs{
  322. font-size: 16rpx;
  323. color: #FF063A;
  324. padding: 4rpx 8rpx;
  325. border-radius: 6rpx;
  326. border: 1px solid #FF063A;
  327. margin-right: 16rpx;
  328. }
  329. .timeBox{
  330. display: flex;justify-content: space-between;
  331. padding: 20rpx 24rpx;
  332. font-size: 26rpx;
  333. color: #666E80;
  334. }
  335. .shareIcon{
  336. width: 33rpx;height: 33rpx;margin-left: 10rpx;
  337. }
  338. .shareBox{
  339. display: flex;font-size: 24rpx;
  340. color: #666666;padding-top: 6rpx;
  341. line-height: 33rpx;
  342. }
  343. .jtIcon{
  344. width: 24rpx;height: 24rpx;margin-top: 6rpx;
  345. }
  346. .buyLine{
  347. display: flex;justify-content: space-between;
  348. padding: 20rpx 24rpx;font-size: 26rpx;
  349. color: #666E80;
  350. }
  351. .buyBOx{
  352. background: #FFFFFF;margin-top: 20rpx;
  353. }
  354. .buyData{
  355. color: #222222;display: flex;
  356. }
  357. .goodsGuige{
  358. width: 150rpx;
  359. height: 50rpx;line-height: 50rpx;
  360. background: #F6F6F6;
  361. border-radius: 5rpx;
  362. font-size: 24rpx;
  363. color: #222222;text-align: center;
  364. margin-left: 24rpx;
  365. }
  366. .activeGuige{
  367. width: 146rpx;
  368. height: 46rpx;line-height: 46rpx;
  369. border: 2rpx solid #FF0035;
  370. border-radius: 5rpx;
  371. font-size: 24rpx;
  372. color: #FF0035;text-align: center;
  373. background: #ffffff;
  374. }
  375. .numJsbox{
  376. display: flex;
  377. }
  378. .buyCont{
  379. position: absolute;
  380. left: 0;
  381. bottom: 0;
  382. width: 750rpx;
  383. height: 688rpx;
  384. background: #FFFFFF;
  385. border-radius: 26rpx 26rpx 0px 0px;
  386. }
  387. .buyNumBox{
  388. padding: 30rpx;
  389. padding-top: 10rpx;
  390. padding-bottom: 70rpx;
  391. }
  392. .buyContCh{
  393. position: absolute;
  394. top: 53rpx;
  395. right: 36rpx;
  396. width: 36rpx;
  397. height: 36rpx;
  398. }
  399. .goodsnum{
  400. width: 88rpx;
  401. height: 44rpx;
  402. background: #F4F5F7;
  403. line-height: 44rpx;
  404. text-align: center;
  405. font-weight: 500;
  406. color: #333333;
  407. font-size: 24rpx;
  408. margin: 0 4rpx;
  409. }
  410. .goodsnumInput{
  411. width: 88rpx;
  412. height: 44rpx;
  413. background: #F4F5F7;
  414. line-height: 44rpx;
  415. text-align: center;
  416. font-weight: 500;
  417. color: #333333;
  418. font-size: 24rpx;
  419. }
  420. .numJj{
  421. width: 44rpx;
  422. height: 44rpx;
  423. background: #F4F5F7;
  424. border-radius: 0px 6rpx 6rpx 0px;
  425. text-align: center;
  426. line-height: 44rpx;
  427. font-size: 32rpx;
  428. color: #999999;
  429. }
  430. .mealBox{
  431. background: #FFFFFF;
  432. padding: 20rpx 24rpx;
  433. margin-top: 20rpx;
  434. }
  435. .fwlcTitle{
  436. color: #333333;font-size: 30rpx;font-weight: 500;
  437. }
  438. .mealTop{
  439. display: flex;
  440. justify-content: space-between;
  441. height: 72rpx;
  442. line-height: 72rpx;
  443. font-weight: 500;
  444. font-size: 26rpx;
  445. color: #222222;
  446. font-size: 26rpx;
  447. padding: 0 20rpx;
  448. }
  449. .mealNum{
  450. text-align: center;
  451. width: 120rpx;
  452. }
  453. .mealexpire{
  454. text-align: center; width: 120rpx;
  455. }
  456. .mealName{
  457. width: 460rpx;
  458. }
  459. .mealTop2{
  460. display: flex;
  461. justify-content: space-between;
  462. height: 72rpx;
  463. line-height: 72rpx;
  464. font-weight: 500;
  465. font-size: 26rpx;
  466. color: #222222;
  467. font-size: 26rpx;
  468. padding: 0 20rpx;
  469. background: #FFF6DB;
  470. }
  471. .mealXj{
  472. background: #FFFCF3;
  473. }
  474. .xjLine{
  475. display: flex;
  476. font-weight: 500;
  477. font-size: 26rpx;
  478. color: #222222;
  479. padding: 20rpx 20rpx;
  480. }
  481. .xjyd{
  482. width: 8rpx;
  483. height: 8rpx;
  484. background: #FABF1B;
  485. border-radius: 50rpx;
  486. margin-top: 12rpx;
  487. margin-right: 10rpx;
  488. }
  489. .mealMs{
  490. background: #FFFFFF;
  491. padding: 20rpx;
  492. font-weight: 400;
  493. font-size: 24rpx;
  494. color: #9A9A9A;
  495. line-height: 38rpx;
  496. }
  497. .goodsDetailTitle{
  498. color: #333333;
  499. font-size: 30rpx;
  500. font-weight: 500;
  501. background: #FFFFFF;
  502. padding: 20rpx 24rpx;
  503. }
  504. .goodsDetail{
  505. margin-top: 20rpx;
  506. padding-bottom: 30rpx;
  507. background: #FFFFFF;
  508. }
  509. .goodsDetail img{
  510. width: 750rpx;
  511. }
  512. .goodsDetail image{
  513. width: 750rpx;
  514. }.bottom{
  515. background: #FFFFFF;
  516. display: flex;
  517. justify-content: space-between;
  518. position: fixed;
  519. width: 100%;
  520. padding:30rpx 0;
  521. padding-bottom: constant(safe-area-inset-bottom);
  522. padding-bottom: env(safe-area-inset-bottom);
  523. left: 0;bottom: 0;
  524. box-shadow: 0rpx -2rpx 16rpx 0rpx rgba(153,153,153,0.2);
  525. }
  526. .bleft{
  527. font-weight: 500;
  528. color: #222222;
  529. padding-left: 50rpx;
  530. }
  531. .Btn{
  532. width: 532rpx;text-align: center;
  533. height: 86rpx;line-height: 86rpx;
  534. background: #FCD903;
  535. border-radius: 43rpx;
  536. font-size: 32rpx;
  537. color: #110B01;
  538. margin-right: 36rpx;
  539. }
  540. .kefuIcon{
  541. width: 50rpx;height: 50rpx;
  542. }
  543. .bottomTianc{
  544. height: 160rpx;
  545. padding-bottom: constant(safe-area-inset-bottom);
  546. padding-bottom: env(safe-area-inset-bottom);
  547. }
  548. .carTis{
  549. color: #EC0F0A;font-size: 20rpx;
  550. text-align: right;
  551. padding-right: 24rpx;
  552. }
  553. .guigeBox{
  554. flex-wrap: wrap;justify-content: flex-end;
  555. width: 500rpx;
  556. }
  557. </style>