123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535 |
- <template>
- <view class="setMealDetail">
- <image :src="'https://biaodianfuhao.oss-cn-beijing.aliyuncs.com/'+setMeal.imgUrl" alt="">
- <view class="header-card">
- <view class="header">
- {{setMeal.name}}
- </view>
- <view class="content">
- {{setMeal.title}}
- </view>
- <view class="bottom">
- <view class="left">
- {{setMeal.endTime}}
- </view>
- <view class="right">
- 已售{{setMeal.buyNum}}
- </view>
- </view>
- </view>
- <!-- 套餐项目 -->
- <view class="servicesAvailable">
- <view class="header">
- <view class="title">
- 套餐项目
- </view>
- <view class="border"></view>
- </view>
- <view class="body" v-for="(item, index) in setMeal.serviceList" :key="index">
- <view class="title">
- {{item.serviceName}}
- </view>
- <view class="border">
- </view>
- <view class="length">
- ×{{item.sum||0}}
- </view>
- </view>
- </view>
- <!-- 可用门店 -->
- <view class="shop">
- <view class="header">
- <view class="title">
- 可用门店
- </view>
- <view class="border"></view>
- </view>
- <view class="flexView">
- <view class="body" v-for="(item, index) in setMeal.shopList" :key="index">
- <image :src="'https://biaodianfuhao.oss-cn-beijing.aliyuncs.com/'+item.logoUrl" alt="">
- <view class="subbody">
- <view class="title">
- {{item.name}}
- </view>
- <view class="content">
- <view class="location">
- {{item.address}}
- </view>
- <view class="right">
- <image :src="require('../../../../static/address.png')" alt="">
- <view class="km">
- {{item.distance}}km
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 套餐详情 -->
- <view class="detail">
- <view class="header">
- <view class="title">
- 套餐详情
- </view>
- <view class="border"></view>
- </view>
- <view class="content">
- {{setMeal.title}}
- </view>
- </view>
- <view style="height: 200rpx;">
- </view>
- <!-- 底部按钮 -->
- <view class="bottomBtn">
- <view class="leftView">
- <view class="chooseNum">
- <view style="font-size: 26rpx;">
- ¥
- </view>
- <view style="font-size: 56rpx;">
- {{price}}
- </view>
- </view>
- </view>
- <view class="rightView" @click="routerTo()">
- 立即购买
- </view>
- </view>
- </view>
- </template>
- <script>
- const app = getApp();
- import {
- packageDetail
- } from "@/api/maintain.js";
- import {
- getUserCar
- } from "@/api/shop.js"
- export default {
- components: {},
- data() {
- return {
- setMeal: {},
- shopList: [{
- name: "海通洗车华南店",
- url: "https://biaodianfuhao.oss-cn-beijing.aliyuncs.com/1539087000475328514.png",
- location: "大连市甘井子区友好路236号 拷贝 3",
- km: "8.9km"
- },
- {
- name: "海通洗车华南店",
- url: "https://biaodianfuhao.oss-cn-beijing.aliyuncs.com/1539087000475328514.png",
- location: "大连市甘井子区友好路236号 拷贝 3",
- km: "8.9km"
- },
- {
- name: "海通洗车华南店",
- url: "https://biaodianfuhao.oss-cn-beijing.aliyuncs.com/1539087000475328514.png",
- location: "大连市甘井子区友好路236号 拷贝 3",
- km: "8.9km"
- },
- {
- name: "海通洗车华南店",
- url: "https://biaodianfuhao.oss-cn-beijing.aliyuncs.com/1539087000475328514.png",
- location: "大连市甘井子区友好路236号 拷贝 3",
- km: "8.9km"
- },
- ],
- servicesAvailableList: [{
- name: "普通洗车",
- list: [{
- name: "xxxxxxx"
- },
- {
- name: "xxxxxxx"
- },
- ]
- },
- {
- name: "常规保养",
- list: [{
- name: "xxxxxxx"
- },
- {
- name: "xxxxxxx"
- },
- ]
- },
- {
- name: "二级保养",
- list: [{
- name: "xxxxxxx"
- },
- {
- name: "xxxxxxx"
- },
- ]
- },
- {
- name: "钣金修复",
- list: [{
- name: "xxxxxxx"
- },
- {
- name: "xxxxxxx"
- },
- {
- name: "xxxxxxx"
- },
- ]
- },
- {
- name: "磨泥打蜡",
- list: [{
- name: "xxxxxxx"
- }, ]
- },
- ],
- price: "",
- longitude: app.globalData.longitude,
- latitude: app.globalData.latitude,
- userCar:{}
- };
- },
- onLoad(options) {
- // this.setMeal = JSON.parse(options.item);
- console.log(options);
- this.$nextTick(()=> {
- console.log(options);
- this.packageDetail(JSON.parse(options.item).id)
- this.getUserCar();
- });
- },
- methods: {
- getUserCar(){
- getUserCar().then(res=>{
- this.userCar = res.data;
- })
- },
- packageDetail(id) {
- console.log(id);
- packageDetail({
- longitude: this.longitude || "111",
- latitude: this.latitude || "111",
- id: id
- }).then(res => {
- console.log(res);
- this.setMeal = res.data;
- this.price = this.setMeal.carPrice < this.setMeal.suvPrice ? (this.setMeal.carPrice < this
- .setMeal.truckPrice ?
- this.setMeal.carPrice : this.setMeal.truckPrice) : (this.setMeal.suvPrice < this
- .setMeal.truckPrice ?
- this.setMeal.suvPrice : this.setMeal.truckPrice)
- console.log(setMeal.buyNum);
- })
- },
- routerTo(item) {
- if(this.userCar.id == null){
- uni.showToast({
- title: '请添加默认车辆',
- icon: 'none',
- duration: 2000
- });
- }else{
- this.$yrouter.push({
- path: "/pages/maintenance/setMeal/buySetMeal/index?item=" + JSON.stringify(this.setMeal)
- });
- }
- }
- }
- }
- </script>
- <style lang="less">
- page {
- background: #EDEDED;
- }
- .bottomBtn {
- width: 690rpx;
- height: 110rpx;
- background: #FFFFFF;
- border: 1px solid #EEEEEE;
- box-shadow: 0px 8rpx 17rpx 0px rgba(168, 165, 165, 0.26);
- border-radius: 55rpx;
- margin-left: 30rpx;
- position: fixed;
- bottom: 67rpx;
- z-index: 9998;
- .leftView {
- float: left;
- height: 100%;
- display: flex;
- align-items: center;
- margin-left: 57rpx;
- .chooseNum {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FF3C00;
- line-height: 31rpx;
- display: flex;
- align-items: baseline;
- }
- }
- .rightView {
- float: right;
- width: 210rpx;
- height: 108rpx;
- background: linear-gradient(0deg, #005AFF 0%, #0078FF 100%);
- border-radius: 0 55rpx 55rpx 0;
- font-size: 34rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FEFEFE;
- line-height: 108rpx;
- text-align: center;
- }
- }
- .detail {
- background: #FFFFFF;
- border-radius: 10px;
- margin-top: 20rpx;
- padding: 36rpx 30rpx;
- .header {
- padding-bottom: 36rpx;
- .title {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 29rpx;
- }
- .border {
- width: 106rpx;
- height: 6rpx;
- background: linear-gradient(90deg, #005BFF 0%, #FFFFFF 100%);
- opacity: 0.6;
- }
- }
- .content {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 36rpx;
- }
- }
- .shop {
- max-height: 514rpx;
- background: #FFFFFF;
- border-radius: 10rpx;
- margin-top: 20rpx;
- padding: 36rpx 30rpx;
- .header {
- padding-bottom: 36rpx;
- .title {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 29rpx;
- }
- .border {
- width: 106rpx;
- height: 6rpx;
- background: linear-gradient(90deg, #005BFF 0%, #FFFFFF 100%);
- opacity: 0.6;
- }
- }
- .flexView {
- max-height: 420rpx;
- overflow-x: auto;
- display: flex;
- flex-wrap: wrap;
- flex-direction: column;
- .body {
- width: 655rpx;
- height: 101rpx;
- background: #FFFFFF;
- border-radius: 10rpx;
- display: flex;
- align-items: center;
- padding-bottom: 36rpx;
- image {
- width: 100rpx;
- height: 100rpx;
- }
- .subbody {
- width: 76%;
- padding: 11rpx 21rpx 0rpx 21rpx;
- .title {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 31rpx;
- }
- .content {
- padding-top: 21rpx;
- .location {
- width: 350rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 31rpx;
- float: left;
- }
- .right {
- display: flex;
- align-items: center;
- float: right;
- image {
- width: 23rpx;
- height: 23rpx;
- }
- .km {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- }
- }
- }
- }
- }
- }
- .servicesAvailable {
- background: #FFFFFF;
- border-radius: 10rpx;
- margin-top: 20rpx;
- padding: 36rpx 30rpx;
- .header {
- padding-bottom: 36rpx;
- .title {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 29rpx;
- }
- .border {
- width: 106rpx;
- height: 6rpx;
- background: linear-gradient(90deg, #005BFF 0%, #FFFFFF 100%);
- opacity: 0.6;
- }
- }
- .body {
- display: flex;
- padding: 19rpx;
- align-items: center;
- justify-content: space-around;
- .title {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 29rpx;
- }
- .border {
- width: 437rpx;
- height: 1rpx;
- border-bottom: 1px dashed #CCCCCC;
- }
- .length {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 29rpx;
- }
- }
- }
- .setMealDetail {
- image {
- width: 100%;
- height: 750rpx;
- }
- .header-card {
- background: #FFFFFF;
- border-radius: 0px 0px 16rpx 16rpx;
- padding: 40rpx 29rpx 35rpx 29rpx;
- .header {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 31rpx;
- }
- .content {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 36rpx;
- padding-top: 25rpx;
- }
- .bottom {
- display: flex;
- justify-content: space-between;
- padding-top: 37rpx;
- .left {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #005BFF;
- line-height: 55rpx;
- }
- .right {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 55rpx;
- }
- }
- }
- }
- </style>
|