| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399 |
- <template>
- <view class="page">
- <navBar title="智能控制系统" :back="true" color="black" background="white" />
- <image :src="picUrl + '/static/other/c1.png'" mode="" class="topBg"></image>
- <view class="content">
- <view class="topBox">
- <view class="lTxt">
- <image src="/static/index/water.png" mode="" class="water1"></image>
- <view class="main">
- <image src="/static/index/halfCircle_275.png" mode="" style="width: 56rpx;height: 56rpx;">
- </image>
- <text style="z-index: 3;position: relative;">定制我家的智能控制</text>
- </view>
- </view>
- <view class="rDes">
- <view class="con">
- 详情
- </view>
- <image src="/static/index/halfRight.png" mode="" style="width: 24rpx;height: 8rpx;">
- </image>
- </view>
- </view>
- <view class="label" @click="handleOpenOrClose(1)">
- <view class="txt">
- 户型
- </view>
- <image :src="addOrLessIcon1" mode="" class="" :style="{height:addOrLessIcon1=='/static/index/shortLine.png'
- ?'2rpx':'22rpx'}" style="width: 22rpx;margin-right: 56rpx;">
- </image>
- </view>
- <view class="parms">
- <view v-if="show1" @click="sel('hx', item, index)" class="item "
- :class="[currHouseIndex==index?'act':'']" v-for="(item,index) in houseTypeList">
- {{item.value}}
- </view>
- </view>
- <view class="label" @click="handleOpenOrClose(2)">
- <view class="txt">
- 生态-品牌
- </view>
- <image :src="addOrLessIcon2" mode="" class="" :style="{height:addOrLessIcon2=='/static/index/shortLine.png'
- ?'2rpx':'22rpx'}" style="width: 22rpx;margin-right: 56rpx;">
- </image>
- </view>
- <view class="parms">
- <view v-if="show2" @click="sel('pp', item, index)" class="item "
- :class="[currHouseIndex1==index?'act':'']" v-for="(item,index) in brandTypeList">
- {{item.value}}
- </view>
- </view>
- <view class="label" @click="handleOpenOrClose(3)">
- <view class="txt">
- 智能锁
- </view>
- <image :src="addOrLessIcon3" mode="" class="" :style="{height:addOrLessIcon3=='/static/index/shortLine.png'
- ?'2rpx':'22rpx'}" style="width: 22rpx;margin-right: 56rpx;">
- </image>
- </view>
- <view class="parms">
- <view v-if="show3" @click="sel('suo', item, index)" class="item "
- :class="[currHouseIndex2==index?'act':'']" v-for="(item,index) in lockTypeList">
- {{item.value}}
- </view>
- </view>
- <view class="label" @click="handleOpenOrClose(4)">
- <view class="txt">
- 智能面板
- </view>
- <image :src="addOrLessIcon4" mode="" class="" :style="{height:addOrLessIcon4=='/static/index/shortLine.png'
- ?'2rpx':'22rpx'}" style="width: 22rpx;margin-right: 56rpx;">
- </image>
- </view>
- <view class="parms">
- <view v-if="show4" @click="sel('mb', item, index)" class="item "
- :class="[currHouseIndex3==index?'act':'']" v-for="(item,index) in pannelTypeList">
- {{item.value}}
- </view>
- </view>
- <view class="label" @click="handleOpenOrClose(5)">
- <view class="txt">
- 智能窗帘
- </view>
- <image :src="addOrLessIcon5" mode="" class="" :style="{height:addOrLessIcon5=='/static/index/shortLine.png'
- ?'2rpx':'22rpx'}" style="width: 22rpx;margin-right: 56rpx;">
- </image>
- </view>
- <view class="parms">
- <view v-if="show5" @click="sel('cl', item, index)" class="item "
- :class="[currHouseIndex4==index?'act':'']" v-for="(item,index) in chuanglianTypeList">
- {{item.value}}
- </view>
- </view>
- <view class="label" @click="handleOpenOrClose(6)">
- <view class="txt">
- 智能空调
- </view>
- <image :src="addOrLessIcon6" mode="" class="" :style="{height:addOrLessIcon6=='/static/index/shortLine.png'
- ?'2rpx':'22rpx'}" style="width: 22rpx;margin-right: 56rpx;">
- </image>
- </view>
- <view class="parms">
- <view v-if="show6" @click="sel('kt', item, index)" class="item "
- :class="[currHouseIndex5==index?'act':'']" v-for="(item,index) in ktTypeList">
- {{item.value}}
- </view>
- </view>
- </view>
- <view class="rule" @click="toRule">
- <image src="/static/index/ruleImg.png" mode=""></image>
- <view class="txt">
- 挑选规则
- </view>
- </view>
- <view class="bot">
- <view class="left" @click="showConfig=true">
- <view class="price">
- ¥{{totalPrice.toFixed(2)}}
- </view>
- <image src="/static/index/arrDown.png" mode=""></image>
- </view>
- <view class="right" @click="toNext">
- 预览配置
- </view>
- </view>
- <u-popup :show="showConfig" @close="close" @open="open" round='10'>
- <view class="topBar" style="">
- <view class="left">
- </view>
- <view class="cen">
- 清单
- </view>
- <view class="close" @click="showConfig=false">
- <u-icon name="close"></u-icon>
- </view>
- </view>
- <view class="pupopCon">
- <view class="item">
- <view class="top">
- <view class="name">
- 户型
- </view>
- <view class="info">
- 一室两厅
- </view>
- </view>
- </view>
- <view class="item">
- <view class="top">
- <view class="name">
- 类别
- </view>
- <view class="info">
- 3系
- </view>
- </view>
- <view class="bottom">
- <view class="name">
- 智能锁
- </view>
- <view class="info">
- 1
- </view>
- </view>
- <view class="bottom">
- <view class="name">
- 智能开关
- </view>
- <view class="info">
- 1
- </view>
- </view>
- <view class="bottom">
- <view class="name">
- 智能窗帘
- </view>
- <view class="info">
- 2
- </view>
- </view>
- </view>
- <view class="item">
- <view class="top">
- <view class="name">
- 品牌
- </view>
- <view class="info">
- 启源
- </view>
- </view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import {
- getIndexConfigReq,
- } from '@/api/test/index.js'
- import {
- getDataMoneyReq
- } from '@/api/index/index.js'
- export default {
- components: {
- },
- data() {
- return {
- picUrl: this.$picUrl,
- picBase: this.$picBase,
- addOrLessIcon1: '/static/index/add.png',
- addOrLessIcon2: '/static/index/add.png',
- addOrLessIcon3: '/static/index/add.png',
- addOrLessIcon4: '/static/index/add.png',
- addOrLessIcon5: '/static/index/add.png',
- addOrLessIcon6: '/static/index/add.png',
- show1: false,
- show2: false,
- show3: false,
- show4: false,
- show5: false,
- show6: false,
- showConfig: false,
- currHouseIndex: 0,
- currHouseIndex1: 0,
- currHouseIndex2: 0,
- currHouseIndex3: 0,
- currHouseIndex4: 0,
- currHouseIndex5: 0,
- houseTypeList: [],
- brandTypeList: [
- ],
- lockTypeList: [
- ],
- pannelTypeList: [
- ],
- chuanglianTypeList: [
- ],
- ktTypeList: [
- ],
- rule: null,
- totalPrice: 0,
- selHx: null,
- selPp: [],
- selSuo: null,
- selMb: [],
- selCl: [],
- selkt: [],
- pConfig: -1
- }
- },
- async onLoad(options) {
- let res = await getIndexConfigReq({
- type: 3
- })
- if (res.code == 0) {
- console.log('获取首页配置返回值-智控: ', res);
- this.houseTypeList = res.data.house_type
- 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
- // 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)
- }
- },
- methods: {
- sel(type, item, index) {
- if (type == 'hx') {
- this.currHouseIndex = index
- this.selHx = item
- } else if (type == 'pp') {
- this.currHouseIndex1 = index
- this.selPp = item
- } else if (type == 'suo') {
- this.currHouseIndex2 = index
- this.selSuo = item
- } else if (type == 'mb') {
- this.currHouseIndex3 = index
- this.selMb = item
- } else if (type == 'cl') {
- this.currHouseIndex4 = index
- this.selCl = item
- } else if (type == 'kt') {
- this.currHouseIndex5 = index
- this.selKt = item
- }
- this.getPrice(3, this.selHx.id, this.selPp.id, this.selSuo.id, this.selMb.id, this.selCl.id, this.selKt
- .id)
- },
- 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
- })
- if (res.code == 0) {
- console.log('配置价格-智控: ', res)
- this.totalPrice = res.data.money
- this.pConfig = res.data.id
- } else {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- }
- },
- toRule() {
- getApp().content = this.rule
- uni.navigateTo({
- url: '/pages/index/rule/index?type=ctrl'
- })
- },
- toNext() {
- getApp().selHx = this.selHx
- getApp().selPp = this.selPp
- getApp().selSuo = this.selSuo
- getApp().selMb = this.selMb
- getApp().selCl = this.selCl
- getApp().selKt = this.selKt
- getApp().totalPrice = this.totalPrice
- getApp().pConfig = this.pConfig
- uni.navigateTo({
- url: '/pages/index/aiControlSys_step2/index'
- })
- },
- handleOpenOrClose(i) {
- if (this['addOrLessIcon' + i] == '/static/index/shortLine.png') {
- this['addOrLessIcon' + i] = '/static/index/add.png'
- this['show' + i] = false
- } else if (this['addOrLessIcon' + i] == '/static/index/add.png') {
- this['addOrLessIcon' + i] = '/static/index/shortLine.png'
- this['show' + i] = true
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "./index.scss";
- </style>
|