|
@@ -3,8 +3,9 @@
|
|
|
<view class="topBox">
|
|
|
<view class="status" :style="{height: iStatusBarHeight + 'px'}"></view>
|
|
|
<view class="topNav" :style="{top: iStatusBarHeight + 'px'}">
|
|
|
- <view class="topCity">
|
|
|
- <view class="location">济南市</view>
|
|
|
+ <view class="topCity">
|
|
|
+ <view class="location" v-if="!cityName" @click="showCity">定位失败</view>
|
|
|
+ <view class="location" v-else @click="showCity">{{cityName}}</view>
|
|
|
<image src="../../static/img/xiala.png" mode="widthFix" class="xiala"></image>
|
|
|
</view>
|
|
|
<view class="topTitle">车蓝图</view>
|
|
@@ -14,7 +15,7 @@
|
|
|
<view style="height: 70px;"></view>
|
|
|
<!-- 车辆信息 -->
|
|
|
<view class="topCar">
|
|
|
- <!-- <view class="car">
|
|
|
+ <view class="car" v-if="!memberCar" @click="addCar()">
|
|
|
<view>
|
|
|
<image src="../../static/img/addcar.png" mode="" class="addCar"></image>
|
|
|
</view>
|
|
@@ -22,20 +23,19 @@
|
|
|
<view class="addcarTis">添加我的爱车</view>
|
|
|
<view class="addcarMs">按照车型推荐保养套餐</view>
|
|
|
</view>
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
|
|
|
- <view class="car">
|
|
|
+ <view class="car" v-else @click="goCarList()">
|
|
|
<view>
|
|
|
- <image :src="carData.brandLogo" mode="" class="addCar"></image>
|
|
|
+ <image :src="memberCar.brandLogo" mode="" class="addCar"></image>
|
|
|
</view>
|
|
|
<view class="carRight">
|
|
|
<view class="carMes">
|
|
|
<view class="plateNum">
|
|
|
- <view class="addcarTis">鲁A0HJ21</view>
|
|
|
- <view class="mileage">10932km</view>
|
|
|
- </view>
|
|
|
- <view class="carMod">丰田 卡罗拉 2021款 1.2T无极S-CV丰田 卡罗拉 2021款 1.2T无极S-CV丰田 卡罗拉 2021款 1.2T无极S-CV
|
|
|
+ <view class="addcarTis">{{memberCar.plateNumber}}</view>
|
|
|
+ <view class="mileage">{{mileage}}km</view>
|
|
|
</view>
|
|
|
+ <view class="carMod">{{memberCar.carModel}}</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="qhcar">
|
|
@@ -171,18 +171,136 @@
|
|
|
return {
|
|
|
iStatusBarHeight: '',
|
|
|
page: 1,
|
|
|
- itemData: [],
|
|
|
+ itemData: [],
|
|
|
+
|
|
|
+ uid: '',
|
|
|
+ cityName: '',
|
|
|
+ cityCode: '',
|
|
|
+ memberCar: '',
|
|
|
+ locationCity: {
|
|
|
+ cityName: '',
|
|
|
+ cityCode: '',
|
|
|
+ lng: '',
|
|
|
+ lat: '',
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ mileage: '',
|
|
|
+
|
|
|
+ brand:'',
|
|
|
+ cityRole:'',
|
|
|
}
|
|
|
},
|
|
|
- onShow() {
|
|
|
-
|
|
|
+ onShow() {
|
|
|
+
|
|
|
+ var that = this;
|
|
|
+
|
|
|
+
|
|
|
+ that.uid = uni.getStorageSync("logodata").uid;
|
|
|
+
|
|
|
+
|
|
|
+ var selectCity = uni.getStorageSync("selectCity");
|
|
|
+
|
|
|
+ if (selectCity) {
|
|
|
+ //有选择的城市
|
|
|
+ that.cityName = selectCity.city
|
|
|
+ that.cityCode = selectCity.code
|
|
|
+ } else{
|
|
|
+ //定位到的城市
|
|
|
+ var nowCity = uni.getStorageSync("locationCity");
|
|
|
+ if (nowCity) {
|
|
|
+ that.cityName = nowCity.cityName
|
|
|
+ that.cityCode = nowCity.cityCode
|
|
|
+
|
|
|
+ if (that.uid) {
|
|
|
+ that.queryHomeDetail();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 重新去定位城市
|
|
|
+ that.getLocation()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (that.uid) {
|
|
|
+ that.queryHomeDetail();
|
|
|
+ }
|
|
|
+
|
|
|
+ this.page = 1
|
|
|
+ this.getItemData()
|
|
|
+
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
|
|
- this.page = 1
|
|
|
- this.getItemData()
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
+ goCarList() {
|
|
|
+ if (this.uid) {
|
|
|
+ uni.navigateTo({
|
|
|
+
|
|
|
+ url:'../index/cailist?type=1'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addCar() {
|
|
|
+ if (!this.uid) {
|
|
|
+ this.goLonIn();
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '../index/addCar'
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ queryHomeDetail() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+
|
|
|
+ this.$http('worldKeepCar/worldHome/queryHomeDetail', {
|
|
|
+ cityCode: this.cityCode
|
|
|
+ }, 'GET').then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.cityRole = res.data.cityRole
|
|
|
+ this.imgData = res.data.banners
|
|
|
+ this.memberCar = res.data.memberCar
|
|
|
+ if (res.data.memberCar) {
|
|
|
+ this.mileage = res.data.memberCar.milage
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.mileage =''
|
|
|
+ }
|
|
|
+
|
|
|
+ this.brand = res.data.memberCar.brand
|
|
|
+
|
|
|
+ var cardata = uni.getStorageSync("maintainCarData")
|
|
|
+
|
|
|
+ if (cardata) {
|
|
|
+ this.memberCar = cardata
|
|
|
+ if (cardata) {
|
|
|
+ this.mileage = this.memberCar.milage
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.mileage =''
|
|
|
+ }
|
|
|
+
|
|
|
+ this.brand = this.memberCar.brand
|
|
|
+ }else{
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'maintainCarData',
|
|
|
+ data: this.memberCar,
|
|
|
+ success: function () {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showCity(){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'../chooseCity/chooseCity'
|
|
|
+ })
|
|
|
+ },
|
|
|
getItemData() {
|
|
|
uni.showLoading({
|
|
|
title: '加载中'
|
|
@@ -218,7 +336,38 @@
|
|
|
})
|
|
|
},
|
|
|
go4S(){
|
|
|
-
|
|
|
+ if (!this.uid) {
|
|
|
+ this.goLonIn();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.cityCode) {
|
|
|
+ uni.showToast({
|
|
|
+ title:'请选择城市',
|
|
|
+ icon:'none',
|
|
|
+ duration: 3000,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.memberCar) {
|
|
|
+ uni.showToast({
|
|
|
+ title:'请选择车辆',
|
|
|
+ icon:'none',
|
|
|
+ duration: 3000,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.cityRole == 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title:'所选城市暂时不支持保养,我们正在努力开通哦~',
|
|
|
+ icon:'none',
|
|
|
+ duration: 3000,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '../module/maintain?brand='+this.brand
|
|
|
+ })
|
|
|
},
|
|
|
goNo(){
|
|
|
uni.showToast({
|