|
@@ -157,7 +157,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="pupopCon">
|
|
<view class="pupopCon">
|
|
- <view class="item">
|
|
|
|
|
|
+ <view class="item" v-if="selHx">
|
|
<view class="top">
|
|
<view class="top">
|
|
<view class="name">
|
|
<view class="name">
|
|
户型
|
|
户型
|
|
@@ -169,7 +169,7 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="item">
|
|
<view class="item">
|
|
- <view class="top">
|
|
|
|
|
|
+ <view class="top" v-if="selPp">
|
|
<view class="name">
|
|
<view class="name">
|
|
品牌
|
|
品牌
|
|
</view>
|
|
</view>
|
|
@@ -177,7 +177,7 @@
|
|
{{selPp.value}}
|
|
{{selPp.value}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="top">
|
|
|
|
|
|
+ <view class="top" v-if="selSuo">
|
|
<view class="name">
|
|
<view class="name">
|
|
智能锁
|
|
智能锁
|
|
</view>
|
|
</view>
|
|
@@ -186,7 +186,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="top">
|
|
|
|
|
|
+ <view class="top" v-if="selMb">
|
|
<view class="name">
|
|
<view class="name">
|
|
智能开关
|
|
智能开关
|
|
</view>
|
|
</view>
|
|
@@ -194,7 +194,7 @@
|
|
{{selMb.value}}
|
|
{{selMb.value}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="top">
|
|
|
|
|
|
+ <view class="top" v-if="selCl">
|
|
<view class="name">
|
|
<view class="name">
|
|
智能窗帘
|
|
智能窗帘
|
|
</view>
|
|
</view>
|
|
@@ -202,7 +202,7 @@
|
|
{{selCl.value}}
|
|
{{selCl.value}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="top">
|
|
|
|
|
|
+ <view class="top" v-if="selKt">
|
|
<view class="name">
|
|
<view class="name">
|
|
智能空调
|
|
智能空调
|
|
</view>
|
|
</view>
|
|
@@ -229,6 +229,7 @@
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
getIndexConfigReq,
|
|
getIndexConfigReq,
|
|
|
|
+ getHomeDataNextReq
|
|
} from '@/api/test/index.js'
|
|
} from '@/api/test/index.js'
|
|
import {
|
|
import {
|
|
getDataMoneyReq
|
|
getDataMoneyReq
|
|
@@ -259,12 +260,12 @@
|
|
|
|
|
|
showConfig: false,
|
|
showConfig: false,
|
|
|
|
|
|
- currHouseIndex: 0,
|
|
|
|
- currHouseIndex1: 0,
|
|
|
|
- currHouseIndex2: 0,
|
|
|
|
- currHouseIndex3: 0,
|
|
|
|
- currHouseIndex4: 0,
|
|
|
|
- currHouseIndex5: 0,
|
|
|
|
|
|
+ currHouseIndex: -1,
|
|
|
|
+ currHouseIndex1: -1,
|
|
|
|
+ currHouseIndex2: -1,
|
|
|
|
+ currHouseIndex3: -1,
|
|
|
|
+ currHouseIndex4: -1,
|
|
|
|
+ currHouseIndex5: -1,
|
|
houseTypeList: [],
|
|
houseTypeList: [],
|
|
brandTypeList: [
|
|
brandTypeList: [
|
|
|
|
|
|
@@ -286,11 +287,11 @@
|
|
totalPrice: 0,
|
|
totalPrice: 0,
|
|
|
|
|
|
selHx: null,
|
|
selHx: null,
|
|
- selPp: [],
|
|
|
|
|
|
+ selPp: null,
|
|
selSuo: null,
|
|
selSuo: null,
|
|
- selMb: [],
|
|
|
|
- selCl: [],
|
|
|
|
- selKt: [],
|
|
|
|
|
|
+ selMb: null,
|
|
|
|
+ selCl: null,
|
|
|
|
+ selKt: null,
|
|
pConfig: -1,
|
|
pConfig: -1,
|
|
cutdownRatio: 1
|
|
cutdownRatio: 1
|
|
}
|
|
}
|
|
@@ -311,55 +312,295 @@
|
|
|
|
|
|
this.rule = res.data.rule.content
|
|
this.rule = res.data.rule.content
|
|
|
|
|
|
- this.selHx = res.data.house_type[0]
|
|
|
|
- this.selPp = res.data.brand[0]
|
|
|
|
- this.selSuo = res.data.mind_lock[0]
|
|
|
|
- this.selMb = res.data.mind_switch[0]
|
|
|
|
- this.selCl = res.data.mind_curtain[0]
|
|
|
|
- this.selKt = res.data.mind_air_conditioner[0]
|
|
|
|
- this.getPrice(3, this.selHx.id, this.selPp.id, this.selSuo.id, this.selMb.id, this.selCl.id, this.selKt
|
|
|
|
- .id)
|
|
|
|
|
|
+ // this.selHx = res.data.house_type[0]
|
|
|
|
+ // this.selPp = res.data.brand[0]
|
|
|
|
+ // this.selSuo = res.data.mind_lock[0]
|
|
|
|
+ // this.selMb = res.data.mind_switch[0]
|
|
|
|
+ // this.selCl = res.data.mind_curtain[0]
|
|
|
|
+ // this.selKt = res.data.mind_air_conditioner[0]
|
|
|
|
+ // this.getPrice(3, this.selHx.id, this.selPp.id, this.selSuo.id, this.selMb.id, this.selCl.id, this.selKt
|
|
|
|
+ // .id)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
this.cutdownRatio = this.$getCutDown()
|
|
this.cutdownRatio = this.$getCutDown()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- sel(type, item, index) {
|
|
|
|
|
|
+ async sel(type, item, index) {
|
|
if (type == 'hx') {
|
|
if (type == 'hx') {
|
|
- this.currHouseIndex = index
|
|
|
|
|
|
+ this.currHouseIndex = -1
|
|
|
|
+ this.currHouseIndex1 = -1
|
|
|
|
+ this.currHouseIndex2 = -1
|
|
|
|
+ this.currHouseIndex3 = -1
|
|
|
|
+ this.currHouseIndex4 = -1
|
|
|
|
+ this.currHouseIndex5 = -1
|
|
|
|
+
|
|
|
|
+ this.selHx = null,
|
|
|
|
+ this.selPp = null,
|
|
|
|
+ this.selSuo = null,
|
|
|
|
+ this.selMb = null,
|
|
|
|
+ this.selCl = null,
|
|
|
|
+ this.selKt = null,
|
|
|
|
+
|
|
|
|
+ this.currHouseIndex = index
|
|
this.selHx = item
|
|
this.selHx = item
|
|
|
|
+
|
|
|
|
+ let p = {
|
|
|
|
+ type: 3,
|
|
|
|
+ house_type: this.selHx.id
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.selHx && this.selPp && this.selSuo && this.selMb && this.selCl && this.selKt) {
|
|
|
|
+ this.getPrice(p)
|
|
|
|
+ } else {
|
|
|
|
+ this.totalPrice = 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let res = await getHomeDataNextReq(p)
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ this.brandTypeList = res.data.brand
|
|
|
|
+ this.lockTypeList = res.data.mind_lock
|
|
|
|
+ this.pannelTypeList = res.data.mind_switch
|
|
|
|
+ this.chuanglianTypeList = res.data.mind_curtain
|
|
|
|
+ this.ktTypeList = res.data.mind_air_conditioner
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else if (type == 'pp') {
|
|
} else if (type == 'pp') {
|
|
- this.currHouseIndex1 = index
|
|
|
|
|
|
+ if (!this.selHx) {
|
|
|
|
+ return this.$toast('请先选择户型')
|
|
|
|
+ }
|
|
|
|
+ this.currHouseIndex1 = -1
|
|
|
|
+ this.currHouseIndex2 = -1
|
|
|
|
+ this.currHouseIndex3 = -1
|
|
|
|
+ this.currHouseIndex4 = -1
|
|
|
|
+ this.currHouseIndex5 = -1
|
|
|
|
+
|
|
|
|
+ this.selPp = null,
|
|
|
|
+ this.selSuo = null,
|
|
|
|
+ this.selMb = null,
|
|
|
|
+ this.selCl = null,
|
|
|
|
+ this.selKt = null,
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.currHouseIndex1 = index
|
|
this.selPp = item
|
|
this.selPp = item
|
|
|
|
+
|
|
|
|
+ let p = {
|
|
|
|
+ type: 3,
|
|
|
|
+ house_type: this.selHx.id,
|
|
|
|
+ brand: this.selPp.id
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.selHx && this.selPp && this.selSuo && this.selMb && this.selCl && this.selKt) {
|
|
|
|
+ this.getPrice(p)
|
|
|
|
+ } else {
|
|
|
|
+ this.totalPrice = 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let res = await getHomeDataNextReq(p)
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ this.lockTypeList = res.data.mind_lock
|
|
|
|
+ this.pannelTypeList = res.data.mind_switch
|
|
|
|
+ this.chuanglianTypeList = res.data.mind_curtain
|
|
|
|
+ this.ktTypeList = res.data.mind_air_conditioner
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else if (type == 'suo') {
|
|
} else if (type == 'suo') {
|
|
- this.currHouseIndex2 = index
|
|
|
|
|
|
+ if (!this.selHx) {
|
|
|
|
+ return this.$toast('请先选择户型')
|
|
|
|
+ } else if (!this.selPp) {
|
|
|
|
+ return this.$toast('请先选择品牌')
|
|
|
|
+ }
|
|
|
|
+ this.currHouseIndex2 = -1
|
|
|
|
+ this.currHouseIndex3 = -1
|
|
|
|
+ this.currHouseIndex4 = -1
|
|
|
|
+ this.currHouseIndex5 = -1
|
|
|
|
+
|
|
|
|
+ this.selSuo = null,
|
|
|
|
+ this.selMb = null,
|
|
|
|
+ this.selCl = null,
|
|
|
|
+ this.selKt = null,
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.currHouseIndex2 = index
|
|
this.selSuo = item
|
|
this.selSuo = item
|
|
|
|
+
|
|
|
|
+ let p = {
|
|
|
|
+ type: 3,
|
|
|
|
+ house_type: this.selHx.id,
|
|
|
|
+ brand: this.selPp.id,
|
|
|
|
+ mind_lock: this.selSuo.id,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.selHx && this.selPp && this.selSuo && this.selMb && this.selCl && this.selKt) {
|
|
|
|
+ this.getPrice(p)
|
|
|
|
+ } else {
|
|
|
|
+ this.totalPrice = 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let res = await getHomeDataNextReq(p)
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ this.pannelTypeList = res.data.mind_switch
|
|
|
|
+ this.chuanglianTypeList = res.data.mind_curtain
|
|
|
|
+ this.ktTypeList = res.data.mind_air_conditioner
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else if (type == 'mb') {
|
|
} else if (type == 'mb') {
|
|
- this.currHouseIndex3 = index
|
|
|
|
|
|
+ if (!this.selHx) {
|
|
|
|
+ return this.$toast('请先选择户型')
|
|
|
|
+ } else if (!this.selPp) {
|
|
|
|
+ return this.$toast('请先选择品牌')
|
|
|
|
+ } else if (!this.selSuo) {
|
|
|
|
+ return this.$toast('请先选择智能锁')
|
|
|
|
+ }
|
|
|
|
+ this.currHouseIndex3 = -1
|
|
|
|
+ this.currHouseIndex4 = -1
|
|
|
|
+ this.currHouseIndex5 = -1
|
|
|
|
+
|
|
|
|
+ this.selMb = null,
|
|
|
|
+ this.selCl = null,
|
|
|
|
+ this.selKt = null,
|
|
|
|
+
|
|
|
|
+ this.currHouseIndex3 = index
|
|
this.selMb = item
|
|
this.selMb = item
|
|
|
|
+
|
|
|
|
+ let p = {
|
|
|
|
+ type: 3,
|
|
|
|
+ house_type: this.selHx.id,
|
|
|
|
+ brand: this.selPp.id,
|
|
|
|
+ mind_lock: this.selSuo.id,
|
|
|
|
+ mind_switch: this.selMb.id,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.selHx && this.selPp && this.selSuo && this.selMb && this.selCl && this.selKt) {
|
|
|
|
+ this.getPrice(p)
|
|
|
|
+ } else {
|
|
|
|
+ this.totalPrice = 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let res = await getHomeDataNextReq(p)
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ this.chuanglianTypeList = res.data.mind_curtain
|
|
|
|
+ this.ktTypeList = res.data.mind_air_conditioner
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else if (type == 'cl') {
|
|
} else if (type == 'cl') {
|
|
- this.currHouseIndex4 = index
|
|
|
|
|
|
+ if (!this.selHx) {
|
|
|
|
+ return this.$toast('请先选择户型')
|
|
|
|
+ } else if (!this.selPp) {
|
|
|
|
+ return this.$toast('请先选择品牌')
|
|
|
|
+ } else if (!this.selSuo) {
|
|
|
|
+ return this.$toast('请先选择智能锁')
|
|
|
|
+ } else if (!this.selMb) {
|
|
|
|
+ return this.$toast('请先选择智能面板')
|
|
|
|
+ }
|
|
|
|
+ this.currHouseIndex4 = -1
|
|
|
|
+ this.currHouseIndex5 = -1
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.selCl = null,
|
|
|
|
+ this.selKt = null,
|
|
|
|
+
|
|
|
|
+ this.currHouseIndex4 = index
|
|
this.selCl = item
|
|
this.selCl = item
|
|
|
|
+
|
|
|
|
+ let p = {
|
|
|
|
+ type: 3,
|
|
|
|
+ house_type: this.selHx.id,
|
|
|
|
+ brand: this.selPp.id,
|
|
|
|
+ mind_lock: this.selSuo.id,
|
|
|
|
+ mind_switch: this.selMb.id,
|
|
|
|
+ mind_curtain: this.selCl.id,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.selHx && this.selPp && this.selSuo && this.selMb && this.selCl && this.selKt) {
|
|
|
|
+ this.getPrice(p)
|
|
|
|
+ } else {
|
|
|
|
+ this.totalPrice = 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let res = await getHomeDataNextReq(p)
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ this.ktTypeList = res.data.mind_air_conditioner
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else if (type == 'kt') {
|
|
} else if (type == 'kt') {
|
|
- this.currHouseIndex5 = index
|
|
|
|
|
|
+ if (!this.selHx) {
|
|
|
|
+ return this.$toast('请先选择户型')
|
|
|
|
+ } else if (!this.selPp) {
|
|
|
|
+ return this.$toast('请先选择品牌')
|
|
|
|
+ } else if (!this.selSuo) {
|
|
|
|
+ return this.$toast('请先选择智能锁')
|
|
|
|
+ } else if (!this.selMb) {
|
|
|
|
+ return this.$toast('请先选择智能面板')
|
|
|
|
+ } else if (!this.selCl) {
|
|
|
|
+ return this.$toast('请先选择智能窗帘')
|
|
|
|
+ }
|
|
|
|
+ this.currHouseIndex5 = -1
|
|
|
|
+
|
|
|
|
+ this.selKt = null,
|
|
|
|
+
|
|
|
|
+ this.currHouseIndex5 = index
|
|
this.selKt = item
|
|
this.selKt = item
|
|
|
|
+ let p = {
|
|
|
|
+ type: 3,
|
|
|
|
+ house_type: this.selHx.id,
|
|
|
|
+ brand: this.selPp.id,
|
|
|
|
+ mind_lock: this.selSuo.id,
|
|
|
|
+ mind_switch: this.selMb.id,
|
|
|
|
+ mind_curtain: this.selCl.id,
|
|
|
|
+ mind_air_conditioner: this.selKt.id,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.selHx && this.selPp && this.selSuo && this.selMb && this.selCl && this.selKt) {
|
|
|
|
+ this.getPrice(p)
|
|
|
|
+ } else {
|
|
|
|
+ this.totalPrice = 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let res = await getHomeDataNextReq(p)
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ // this.ktTypeList = res.data.mind_air_conditioner
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- this.getPrice(3, this.selHx.id, this.selPp.id, this.selSuo.id, this.selMb.id, this.selCl.id, this.selKt
|
|
|
|
- .id)
|
|
|
|
|
|
+ // this.getPrice(prmas)
|
|
},
|
|
},
|
|
|
|
|
|
- async getPrice(type = 3, house_type, brand, mind_lock, mind_switch, mind_curtain, mind_air_conditioner) {
|
|
|
|
- let res = await getDataMoneyReq({
|
|
|
|
- type,
|
|
|
|
- house_type,
|
|
|
|
- brand,
|
|
|
|
- mind_lock,
|
|
|
|
- mind_switch,
|
|
|
|
- mind_curtain,
|
|
|
|
- mind_air_conditioner
|
|
|
|
- })
|
|
|
|
|
|
+ async getPrice(prmas) {
|
|
|
|
+ let res = await getDataMoneyReq(prmas)
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
console.log('配置价格-智控: ', res)
|
|
console.log('配置价格-智控: ', res)
|
|
this.totalPrice = res.data.money * this.cutdownRatio
|
|
this.totalPrice = res.data.money * this.cutdownRatio
|
|
@@ -380,6 +621,16 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
toNext() {
|
|
toNext() {
|
|
|
|
+ if (this.houseTypeList.length == 0 || this.brandTypeList.length == 0 || this.lockTypeList.length == 0 ||
|
|
|
|
+ this.pannelTypeList.length == 0 || this.chuanglianTypeList.length == 0 || this.ktTypeList.length == 0
|
|
|
|
+ ) {
|
|
|
|
+ return this.$toast('抱歉!参数配置缺失,暂无法预览配置')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!(this.selHx && this.selSuo && this.selPp && this.selMb && this.selCl && this.selKt)) {
|
|
|
|
+ return this.$toast('请全部选择后预览配置')
|
|
|
|
+ }
|
|
|
|
+
|
|
getApp().selHx = this.selHx
|
|
getApp().selHx = this.selHx
|
|
getApp().selPp = this.selPp
|
|
getApp().selPp = this.selPp
|
|
getApp().selSuo = this.selSuo
|
|
getApp().selSuo = this.selSuo
|