123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- <template>
- <view class="container-view-contril">
- <scroll-view class="scroll-view flex-row" scroll-x="true">
- <view @tap="tapOpen" v-for="(item,index) of contrilList" :key="index" :data-item="item" class="contril-item flex-row">
- <img class="contril-item-img" :src="item.isTurnOn==0?item.offUrl:item.iconUrl" alt="">
- <text >{{item.name}}</text>
- </view>
- <view class="contril-item flex-row" @tap="toMoreFunctionSet">
- <img class="contril-item-img" src="https://qiniu.bms16.com/Ft3pNyStT22LP8Ds1Mru2LoTHadx" alt="">
- <text>{{$t("更多功能")}}</text>
- </view>
- </scroll-view>
- <view class="flex-row power-view">
- <view class="power-on-off flex-row" >
- <view :style="sliderStyle" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd" class="power-on-btn"><image style="width: 52rpx;height: 52rpx;" src="https://qiniu.bms16.com/Fkovrpq1bexe-Unal_VJREbLUhdu" mode=""></image></view>
- <view class="power-on-text" >滑动启动</view>
- </view>
- <view class="car-change-battery flex-row">
- <view class="car-change-btn"><image style="width: 80rpx;height: 80rpx;" src="https://qiniu.bms16.com/FgvnT-msLbL5RHjl6fvNlM0kab5N" mode=""></image></view>
- <view class="car-change-text">车辆换电</view>
- </view>
- </view>
- <view v-if="popupControlShow" class="show-modal">
- <view class="modal-info">
- <view class="popup-title">{{($t(popText)==$t('开机'))?$t('开启车辆'):($t(popText)==$t('关机')?$t('关闭车辆'):$t(popText))}}</view>
- <view class="popup-content">{{$t("您确认")+(($t(popText)==$t('开机'))?$t('开启车辆'):($t(popText)==$t('关机')?$t('关闭车辆'):$t(popText)))+$t("吗")}}</view>
- <view class="flex-row modal-footer">
- <view class="show-btn cencel-btn-pop" @tap="closePopup">{{$t("取消")}}</view>
- <view class="show-btn ok-btn-pop" @tap="tapBlueToothCmd">{{$t("确定")}}</view>
- </view>
- </view>
- </view>
- <!-- <u-popup v-model="popupControlShow" mode="center" border-radius="30" height="30%" length="60%">
- <view class="popup-title">开启车辆</view>
- <view class="popup-content">确定打开</view>
- <view class="flex-row">
- <view class="sure-btn cencel-btn" @tap="closePopup">取消</view>
- <view class="sure-btn ok-btn" >确定</view>
- </view>
- </u-popup> -->
- <!-- <view v-if="isShowMore" class="show-more">
- <view class="more-info">
- <view class="flex-row flex-between model-title">
- <view>{{$t("更多功能")}}</view>
- <view>
- <image style="width: 32rpx;height: 32rpx;" @tap="isShowMore = false"
- src="https://qiniu.bms16.com/FtoTEHOJiUf_gjPCJGGHMsAtHI5M" />
- </view>
- </view>
- <view style="height: 300rpx;">
- <view data-url="test" @tap="navUrl" class="more-item flex-row">
- <img class="more-img" src="https://qiniu.bms16.com/FgxiD-W96FGvgyLI_kXUfWVDYLQ9" alt="">
- <text>{{$t("胎压")}}</text>
- </view>
- <view class="more-item flex-row">
- <img class="more-img" src="https://qiniu.bms16.com/FgxiD-W96FGvgyLI_kXUfWVDYLQ9" alt="">
- <text>{{$t("电池信息")}}</text>
- </view>
- <view @tap="navCarLocation" class="more-item flex-row">
- <img class="more-img" src="https://qiniu.bms16.com/FgxiD-W96FGvgyLI_kXUfWVDYLQ9" alt="">
- <text>{{$t("导航")}}</text>
- </view>
- </view>
- <view class="lift-btn-view">
- <view class="lift-btn">{{$t("解除绑定")}}</view>
- </view>
- </view>
- </view>
- -->
-
- </view>
- </template>
- <script>
- var bluetooth = require('@/common/bluetooth.js');
- var config = require('@/common/config.js');
- var common = require('@/common/common.js');
- var http = require('@/common/http.js');
- import controlMixin from '@/mixin/index';
- import i18n from '@/locale/index.js'
- import {
- getFunctionTag,
- setFunctionTag
- } from '@/common/storage.js';
- export default {
- mixins: [controlMixin],
- props:{
- contrilList: {
- type: Array,
- default: () => []
- },
- online: {
- type: Boolean,
- default: false
- },
- },
-
- data() {
- return {
-
-
-
- isShowMore:false,
- car_line:false,
- startX: 0,
- moveX: 0,
- unlocked: false
- };
- },
- computed: {
-
- sliderStyle() {
- return {
- transform: `translateX(${this.moveX}px)`
- };
- }
- },
- mounted() {
-
- },
-
-
- methods: {
- tapOpen(e){
- const item = e.currentTarget.dataset.item;
- this.changClick(item)
- },
- toMoreFunctionSet() {
- uni.navigateTo({
- url: '/pages/carFunctionSet/more?online='+this.online
- })
- },
- touchStart(event) {
- console.log(event,'test');
- this.startX = this.unlocked?this.moveX:event.touches[0].clientX;
- },
- touchMove(event) {
- this.moveX = event.touches[0].clientX - this.startX;
- console.log( event.touches[0].clientX,this.startX,'this.moveX');
- if (this.moveX < 0) this.moveX = 0;
- if (this.moveX > 70 &&!this.unlocked) this.moveX = 135;
-
- },
- touchEnd() {
- console.log(this.moveX,'this.moveX1111');
- if (this.moveX >= 135) {
- this.unlocked = true;
- console.log('解锁成功');
- } else {
-
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- };
- </script>
- <style>
- @import './control.css';
- </style>
|