index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <template>
  2. <view class="setMealDetail">
  3. <image :src="baseImagePath + setMeal.imgUrl" alt="">
  4. <view class="header-card">
  5. <view class="header">
  6. {{setMeal.name}}
  7. </view>
  8. <view class="content">
  9. {{setMeal.title}}
  10. </view>
  11. <view class="bottom" v-if="setMeal.invalidDay">
  12. <view class="left">
  13. {{setMeal.invalidDay}}前有效
  14. </view>
  15. <view class="right" v-if="setMeal.status">
  16. 生效中
  17. </view>
  18. <view class="right" v-else>
  19. 已失效
  20. </view>
  21. </view>
  22. <view class="bottom" v-else>
  23. <view class="left">
  24. 购买后{{setMeal.invalidTime}}天内有效
  25. </view>
  26. <view class="right" v-if="setMeal.status">
  27. 生效中
  28. </view>
  29. <view class="right" v-else>
  30. 已失效
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 套餐项目 -->
  35. <view class="servicesAvailable">
  36. <view class="header">
  37. <view class="title">
  38. 套餐项目
  39. </view>
  40. <view class="border"></view>
  41. </view>
  42. <view class="body" v-for="(item, index) in servicesAvailableList" :key="index">
  43. <view class="title">
  44. {{item.sstName}}
  45. </view>
  46. <view class="border">
  47. </view>
  48. <view class="length">
  49. ×{{item.buyNum}}
  50. </view>
  51. <view class="lengths">
  52. 余 <span>{{item.surplusSum}}</span>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 可用门店 -->
  57. <view class="shop">
  58. <view class="header">
  59. <view class="title">
  60. 可用门店
  61. </view>
  62. <view class="border"></view>
  63. </view>
  64. <view class="flexView">
  65. <view class="body" v-for="(item, index) in shopList" :key="index">
  66. <image :src="baseImagePath + item.logoUrl" alt="">
  67. <view class="subbody">
  68. <view class="title">
  69. {{item.name}}
  70. </view>
  71. <view class="content">
  72. <view class="location">
  73. {{item.address}}
  74. </view>
  75. <view class="right">
  76. <image :src="require('../../../static/address.png')" alt="" style="margin-right: 10rpx;">
  77. <view class="km">
  78. {{item.distance}}km
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 套餐详情 -->
  87. <view class="detail">
  88. <view class="header">
  89. <view class="title">
  90. 套餐详情
  91. </view>
  92. <view class="border"></view>
  93. </view>
  94. <view class="content" v-html="setMeal.introduce">
  95. </view>
  96. </view>
  97. <view style="height: 200rpx;">
  98. </view>
  99. <!-- 底部按钮 -->
  100. <view class="bottomBtn" v-if="type !== 'my'">
  101. <view class="leftView">
  102. <view class="chooseNum">
  103. <view style="font-size: 26rpx;">
  104. </view>
  105. <view style="font-size: 56rpx;">
  106. {{setMeal.carPrice}}-{{setMeal.truckPrice}}
  107. </view>
  108. </view>
  109. </view>
  110. <view class="rightView" @click="routerTo()">
  111. 立即购买
  112. </view>
  113. </view>
  114. </view>
  115. </template>
  116. <script>
  117. import {
  118. userPackageDefail
  119. } from '../../../api/myApi.js'
  120. const app = getApp()
  121. export default {
  122. components: {},
  123. data() {
  124. return {
  125. longitude: app.globalData.longitude,
  126. latitude: app.globalData.latitude,
  127. baseImagePath:this.baseImagePath,
  128. packageId:null,
  129. setMeal: {},
  130. shopList: [],
  131. servicesAvailableList: [],
  132. type:''
  133. };
  134. },
  135. onLoad(options) {
  136. this.packageId = options.id
  137. this.type = options.type
  138. this.getInfo()
  139. },
  140. methods: {
  141. routerTo(item) {
  142. this.$yrouter.push({
  143. path: "/pages/maintenance/setMeal/buySetMeal/index?item=" + JSON.stringify(this.setMeal)
  144. });
  145. },
  146. getInfo(){
  147. let data = {
  148. longitude: this.longitude,
  149. latitude: this.latitude,
  150. id:this.packageId
  151. }
  152. userPackageDefail(data).then(res=>{
  153. this.setMeal = res.data.packagesVO
  154. console.log(this.setMeal);
  155. this.servicesAvailableList = res.data.userPackageSerVOS
  156. console.log(this.servicesAvailableList);
  157. this.shopList = res.data.shopVOList
  158. })
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="less">
  164. page {
  165. background: #EDEDED;
  166. }
  167. .bottomBtn {
  168. width: 690rpx;
  169. height: 110rpx;
  170. background: #FFFFFF;
  171. border: 1px solid #EEEEEE;
  172. box-shadow: 0px 8rpx 17rpx 0px rgba(168, 165, 165, 0.26);
  173. border-radius: 55rpx;
  174. margin-left: 30rpx;
  175. position: fixed;
  176. bottom: 67rpx;
  177. z-index: 9998;
  178. .leftView {
  179. float: left;
  180. height: 100%;
  181. display: flex;
  182. align-items: center;
  183. margin-left: 57rpx;
  184. .chooseNum {
  185. font-size: 30rpx;
  186. font-family: PingFang SC;
  187. font-weight: 500;
  188. color: #FF3C00;
  189. line-height: 31rpx;
  190. display: flex;
  191. align-items: baseline;
  192. }
  193. }
  194. .rightView {
  195. float: right;
  196. width: 210rpx;
  197. height: 108rpx;
  198. background: linear-gradient(0deg, #005AFF 0%, #0078FF 100%);
  199. border-radius: 0 55rpx 55rpx 0;
  200. font-size: 34rpx;
  201. font-family: PingFang SC;
  202. font-weight: 500;
  203. color: #FEFEFE;
  204. line-height: 108rpx;
  205. text-align: center;
  206. }
  207. }
  208. .detail {
  209. background: #FFFFFF;
  210. border-radius: 10px;
  211. margin-top: 20rpx;
  212. padding: 36rpx 30rpx;
  213. .header {
  214. padding-bottom: 36rpx;
  215. .title {
  216. font-size: 28rpx;
  217. font-family: PingFang SC;
  218. font-weight: bold;
  219. color: #333333;
  220. line-height: 29rpx;
  221. }
  222. .border {
  223. width: 106rpx;
  224. height: 6rpx;
  225. background: linear-gradient(90deg, #005BFF 0%, #FFFFFF 100%);
  226. opacity: 0.6;
  227. }
  228. }
  229. .content {
  230. font-size: 26rpx;
  231. font-family: PingFang SC;
  232. font-weight: 500;
  233. color: #666666;
  234. line-height: 36rpx;
  235. padding: 0 30rpx 0 0;
  236. overflow: hidden;
  237. display: flex;
  238. }
  239. }
  240. .shop {
  241. max-height: 514rpx;
  242. background: #FFFFFF;
  243. border-radius: 10rpx;
  244. margin-top: 20rpx;
  245. padding: 36rpx 30rpx 0;
  246. .header {
  247. padding-bottom: 36rpx;
  248. .title {
  249. font-size: 28rpx;
  250. font-family: PingFang SC;
  251. font-weight: bold;
  252. color: #333333;
  253. line-height: 29rpx;
  254. }
  255. .border {
  256. width: 106rpx;
  257. height: 6rpx;
  258. background: linear-gradient(90deg, #005BFF 0%, #FFFFFF 100%);
  259. opacity: 0.6;
  260. }
  261. }
  262. .flexView {
  263. max-height: 420rpx;
  264. overflow-x: auto;
  265. flex-direction: column;
  266. display: flex;
  267. flex-wrap: wrap;
  268. .body {
  269. width: 655rpx;
  270. height: 101rpx;
  271. background: #FFFFFF;
  272. border-radius: 10rpx;
  273. display: flex;
  274. padding-bottom: 36rpx;
  275. image {
  276. width: 100rpx;
  277. height: 100rpx;
  278. }
  279. .subbody {
  280. width: 76%;
  281. padding: 11rpx 21rpx 11rpx 21rpx;
  282. .title {
  283. font-size: 32rpx;
  284. font-family: PingFang SC;
  285. font-weight: bold;
  286. color: #333333;
  287. line-height: 31rpx;
  288. }
  289. .content {
  290. padding-top: 21rpx;
  291. .location {
  292. width: 350rpx;
  293. font-size: 24rpx;
  294. font-family: PingFang SC;
  295. font-weight: 500;
  296. color: #999999;
  297. line-height: 31rpx;
  298. float: left;
  299. overflow: hidden;
  300. text-overflow: ellipsis;
  301. white-space: nowrap;
  302. }
  303. .right {
  304. display: flex;
  305. align-items: center;
  306. image {
  307. width: 23rpx;
  308. height: 23rpx;
  309. }
  310. .km {
  311. font-size: 24rpx;
  312. font-family: PingFang SC;
  313. font-weight: 500;
  314. color: #333333;
  315. line-height: 31rpx;
  316. }
  317. }
  318. }
  319. }
  320. }
  321. }
  322. }
  323. .servicesAvailable {
  324. background: #FFFFFF;
  325. border-radius: 10rpx;
  326. margin-top: 20rpx;
  327. padding: 36rpx 30rpx;
  328. .header {
  329. padding-bottom: 36rpx;
  330. .title {
  331. font-size: 28rpx;
  332. font-family: PingFang SC;
  333. font-weight: bold;
  334. color: #333333;
  335. line-height: 29rpx;
  336. }
  337. .border {
  338. width: 106rpx;
  339. height: 6rpx;
  340. background: linear-gradient(90deg, #005BFF 0%, #FFFFFF 100%);
  341. opacity: 0.6;
  342. }
  343. }
  344. .body {
  345. display: flex;
  346. padding: 19rpx;
  347. justify-content: space-around;
  348. align-items: center;
  349. .title {
  350. font-size: 26rpx;
  351. font-family: PingFang SC;
  352. font-weight: 500;
  353. color: #666666;
  354. line-height: 29rpx;
  355. }
  356. .border {
  357. width: 354rpx;
  358. height: 1rpx;
  359. border-top: 1px dashed #CCCCCC;
  360. }
  361. .length {
  362. font-size: 26rpx;
  363. font-family: PingFang SC;
  364. font-weight: 500;
  365. color: #666666;
  366. line-height: 29rpx;
  367. }
  368. .lengths {
  369. font-size: 24rpx;
  370. font-family: PingFang SC;
  371. font-weight: 500;
  372. color: #666666;
  373. line-height: 29rpx;
  374. span {
  375. color: #005BFF;
  376. }
  377. }
  378. }
  379. }
  380. .setMealDetail {
  381. image {
  382. width: 100%;
  383. height: 750rpx;
  384. }
  385. .header-card {
  386. background: #FFFFFF;
  387. border-radius: 0px 0px 16rpx 16rpx;
  388. padding: 40rpx 0 0 29rpx;
  389. .header {
  390. font-size: 32rpx;
  391. font-family: PingFang SC;
  392. font-weight: bold;
  393. color: #333333;
  394. line-height: 31rpx;
  395. padding-right: 29rpx;
  396. }
  397. .content {
  398. font-size: 26rpx;
  399. font-family: PingFang SC;
  400. font-weight: 500;
  401. color: #999999;
  402. line-height: 36rpx;
  403. padding-top: 25rpx;
  404. padding-right: 29rpx;
  405. }
  406. .bottom {
  407. display: flex;
  408. justify-content: space-between;
  409. padding-top: 37rpx;
  410. position: relative;
  411. .left {
  412. font-size: 26rpx;
  413. font-family: PingFang SC;
  414. font-weight: 500;
  415. color: #005BFF;
  416. line-height: 55rpx;
  417. padding-bottom: 22rpx;
  418. }
  419. .right {
  420. width: 167rpx;
  421. height: 62rpx;
  422. background: linear-gradient(-35deg, #FF6000 0%, #FFA800 100%);
  423. border-radius: 10rpx 0rpx 10rpx 0rpx;
  424. font-size: 30rpx;
  425. font-family: PingFang SC;
  426. font-weight: bold;
  427. color: #FFFFFF;
  428. line-height: 62rpx;
  429. text-align: center;
  430. position: absolute;
  431. right: 0;
  432. bottom: 0;
  433. }
  434. }
  435. }
  436. }
  437. </style>