Commit 0ce7625a by hank

fix bug

parent 0299c284
......@@ -114,6 +114,13 @@ class App extends Component {
}
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
// constructor(props: any) {
// super(props)
// this.initToekn()
......
......@@ -93,7 +93,7 @@
.device-item-info-state-active {
font-size: 26px;
color: #5ff054;
// color: #5ff054;
.dian {
background: #5ff054;
......
......@@ -8,6 +8,7 @@
&-img-box {
width: 261px;
min-width: 261px;
background: $bgColor;
text-align: center;
position: relative;
......@@ -38,11 +39,21 @@
display: flex;
padding-left: 15px;
flex-direction: column;
word-break: break-all;
box-sizing: border-box;
width: 400px;
&-name {
font-size: 32px;
color: #333;
margin-bottom: 15px;
font-weight: bold;
overflow: hidden;
height: 35px;
word-break: break-all;
text-overflow: ellipsis;
white-space: nowrap;
// display: -webkit-box;
}
&-detail {
......
......@@ -20,10 +20,19 @@
border-radius: 16px;
flex-direction: column;
background-color: white;
position: relative;
@include rn(height, 600px);
}
.modal-close {
position: absolute;
margin: 0 auto;
width: 43px;
height: 43px;
bottom: -72px;
}
&-title {
text-align: center;
padding-bottom: 20px;
......
......@@ -213,6 +213,14 @@ class MyDevice extends Component {
this.getDate()
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imgUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
render() {
const { count, height } = this.props
const { list, showModal, name } = this.state
......
......@@ -68,7 +68,13 @@ class DeviceGroup extends Component {
async componentWillMount() {
this.getDate()
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
componentDidShow() {
this.page = 1
this.getDate()
......@@ -256,8 +262,9 @@ class DeviceGroup extends Component {
<Modal title={name} onConfirm={this.inputConfirm} onCancel={this.cancelModal}>
<View className="film-modal">
<Input
placeholder="请输入设备组名称"
placeholder="请输入设备组名称不超过20字"
className="film-modal-input"
maxLength={20}
value={temp.equipmentGroupName}
onInput={this.changeName}
/>
......
@import '@styles/var.scss';
@import '~taro-ui/dist/style/components/modal.scss';
// @import '~taro-ui/dist/style/components/modal.scss';
.at-modal__content {
padding: 52px 24px !important;
......@@ -8,6 +8,33 @@
color: #666;
}
.device-container {
.modal {
.modal-bottom-btn {
justify-content: center !important;
}
}
.go-template-container {
padding-bottom: 83px;
padding-top: 100px;
font-size: 34px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(102, 102, 102, 1);
}
.go-tempalte {
width: 320px;
height: 245px;
}
}
.modal {
.modal-bottom-btn {
justify-content: center !important;
}
}
// @import '~taro-ui/dist/style/components/tabs.scss';
// .at-tabs__item-underline {
......
......@@ -4,9 +4,9 @@ import DeviceGroup from './group_list'
import { ComponentClass } from 'react'
import { AtTabs, AtTabsPane, AtModal } from 'taro-ui'
import Taro, { Component, Config } from '@tarojs/taro'
import Modal from './modal/index'
import './index.scss'
import { View } from '@tarojs/components'
import { View, Image } from '@tarojs/components'
type PageStateProps = {}
......@@ -38,14 +38,21 @@ class Device extends Component {
const { windowHeight } = Taro.getSystemInfoSync()
const id = Taro.getStorageSync('isAdd')
console.log(id, this.$router.params.id, 'isAdd')
this.state = {
current: 0,
id: '',
id: '1',
windowHeight: windowHeight
}
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
componentDidShow() {
const id = Taro.getStorageSync('isAdd')
console.log(id, this.$router.params.id, 'isAdd')
......@@ -60,31 +67,43 @@ class Device extends Component {
render() {
const { current, windowHeight, id } = this.state
return (
<View style={`height: ${windowHeight}px;`}>
<View className="device-container" style={`height: ${windowHeight}px;`}>
<DeviceList height={windowHeight} />
<AtModal
isOpened={!!id}
content="设备已添加成功~去模板市场逛一逛吧~"
confirmText="确认"
onClose={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState({
id: ''
})
}}
onCancel={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState({
id: ''
})
}}
onConfirm={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState({
id: ''
})
}}
/>
{!!id && (
<Modal
onClose={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState({
id: ''
})
}}
onCancel={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState({
id: ''
})
}}
onConfirm={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState(
{
id: ''
},
() => {
Taro.switchTab({ url: '/pages/home/tempaltes/index' })
}
)
}}
>
<View className="go-template-container">
<Image
className="go-tempalte"
src="http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/goTempalte.png"
/>
<View>设备添加成功,去模版市场逛一逛吧</View>
</View>
</Modal>
)}
</View>
// <AtTabs current={current} tabList={tabList} onClick={this.changePage} swipeable={false}>
......
@import '@styles/var.scss';
.modal {
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
position: absolute;
align-items: center;
justify-content: center;
background-color: rgba($color: #000, $alpha: 0.5);
&-wrapper {
width: 674px;
display: flex;
// margin-top: -50px;
padding-top: 21px;
padding-bottom: 66px;
border-radius: 16px;
flex-direction: column;
background-color: white;
position: relative;
@include rn(height, 600px);
}
.modal-close {
position: absolute;
margin: 0 auto;
width: 85px;
height: 85px;
bottom: -144px;
left: 0;
right: 0;
}
&-title {
text-align: center;
padding-bottom: 20px;
border: 0 solid $border-color;
border-bottom-width: 1px;
@include eject(display, block);
}
&-content-wrapper {
flex: 1;
text-align: center;
}
&-bottom-btn {
display: flex;
flex-direction: row;
justify-content: center;
padding: 0 56px;
border: 0 solid $border-color;
border-top-width: 0;
}
&-confirm-text {
flex: 1;
width: 252px;
max-width: 252px;
height: 86px;
line-height: 86px;
text-align: center;
background: linear-gradient(266deg, rgba(255, 171, 32, 1) 0%, rgba(255, 114, 14, 1) 100%);
border-radius: 43px;
font-size: 36px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: white;
}
&-cancel-text {
flex: 1;
width: 252px;
max-width: 252px;
height: 86px;
line-height: 86px;
text-align: center;
background: rgba(230, 230, 230, 1);
border-radius: 43px;
font-size: 36px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(102, 102, 102, 1);
}
}
import { ComponentClass } from 'react'
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import './index.scss'
type PageStateProps = {}
type PageDispatchProps = {}
type PageOwnProps = {
/** 标题 */
title?: string
/** 内容 */
children: any
marginTop?: string
/** 取消文字 */
cancelText?: string | '取消'
confirmText?: string | '确定'
onClose?: () => void
onCancel?: () => void
onConfirm?: () => void
}
type PageState = {}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface Modal {
props: IProps
state: PageState
}
class Modal extends Component {
cancel = e => {
// e.stopPropagation()
// this.props.onCancel && this.props.onCancel()
}
render() {
const {
title,
children,
onCancel,
onConfirm,
cancelText,
confirmText,
onClose,
marginTop = '-50px'
} = this.props
console.log(onCancel, onClose, onConfirm)
return (
<View className="modal" onClick={this.cancel}>
<View className="modal-wrapper" style={{ marginTop }}>
{title && <Text className="modal-title">{title || '标题'}</Text>}
<View className="modal-content-wrapper">{children}</View>
<View className="modal-bottom-btn">
<Text className="modal-confirm-text" onClick={() => onConfirm && onConfirm()}>
{confirmText || '确定'}
</Text>
</View>
<Image
className="modal-close"
src="http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/modal-close.png"
onClick={() => {
onClose && onClose()
}}
/>
</View>
</View>
)
}
}
export default Modal as ComponentClass<PageOwnProps, PageState>
......@@ -137,7 +137,13 @@ class MyDevice extends Component {
url: `/pages/home/device/shop_device_detail/index?equipmentShopId=${equipmentId}`
})
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
shouldComponentUpdate(nextProps: IProps, _nextState) {
const { list } = this.props
const { list: _list } = nextProps
......
......@@ -34,6 +34,7 @@
}
.type-tab-item-active {
font-weight: bold;
font-size: 38px;
color: #000;
......
......@@ -40,6 +40,14 @@ class Device extends Component {
}
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
changePage = value => {
this.setState({ current: value })
}
......
......@@ -214,7 +214,7 @@ class DeviceSelect extends Component {
async updateBind() {
// 更新设备绑定
const { checked, list } = this.state
const { checked, allList } = this.state
let { cId } = this.state
let { fId } = this.$router.params
if (cId === 'null') {
......@@ -224,10 +224,11 @@ class DeviceSelect extends Component {
let checkedArr: any = []
const equipmentsIds: any = []
const equipmentTopicList: any = []
list.map(item => {
allList.map(item => {
if (checked.has(item.equipmentId)) {
checkedArr.push(item)
if (fId) {
console.log(item)
equipmentsIds.push(item.equipmentId)
equipmentTopicList.push(item.mqttTopic)
}
......
......@@ -66,6 +66,7 @@
}
.type-tab-item-active {
font-weight: bold;
font-size: 38px;
color: #000;
......
......@@ -56,6 +56,13 @@ class Schedule extends Component {
list: []
}
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
async componentWillMount() {
this.getData()
}
......
......@@ -82,6 +82,13 @@ class Collection extends Component {
})
this.getData()
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
componentDidShow() {
this.isShow = true
this.setState({
......
......@@ -164,7 +164,13 @@ class FilmDetail extends Component {
webviewLoad() {
Taro.hideLoading()
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
render() {
const { filmInfo, filmList, showModal, filmId } = this.state
const templateId = this.$router.params.templateId
......
......@@ -89,6 +89,14 @@ class Tempaltes extends Component {
Taro.showTabBar()
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
componentDidHide() {
this.isShow = false
}
......
......@@ -35,6 +35,7 @@
}
.type-tab-item-active {
font-weight: bold;
font-size: 38px;
color: #000;
......@@ -116,6 +117,7 @@
}
.type-tab-item-active {
font-weight: bold;
font-size: 38px;
color: #000;
}
......
......@@ -38,6 +38,14 @@ class User extends Component {
}
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
}
componentWillMount() {
this.getUserInfo()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment