Commit 9f545820 by hank

修改流程

parent 24f55c42
......@@ -6,7 +6,7 @@ import Index from './pages/index'
import configStore from './store'
import token from './common/token'
import { defaultShareMessage } from '@/common/index'
import './app.scss'
// import 'taro-ui/dist/style/index.scss'
......@@ -115,11 +115,7 @@ 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: '理想屏'
}
return defaultShareMessage
}
// constructor(props: any) {
// super(props)
......
export const FETCH_TIME_OUT = 5000
// export const BASE_URL = 'https://server.bdideal.com'
// export const WEBVIEW_URL = 'https://visual.bdideal.com'
export const BASE_URL = 'https://dev-server.bdideal.com'
export const WEBVIEW_URL = 'https://dev-visual.bdideal.com'
export const BASE_URL = 'https://server.bdideal.com'
export const WEBVIEW_URL = 'https://visual.bdideal.com'
// export const BASE_URL = 'https://dev-server.bdideal.com'
// export const WEBVIEW_URL = 'https://dev-visual.bdideal.com'
// export const WEBVIEW_URL = 'http://127.0.0.1:8080'
/** 蓝牙的服务 uuid */
......@@ -20,3 +20,9 @@ export const POST_WIFI_PASS_ID = '000088A2-0000-1000-8000-00805F9B34FB'
/** 提交WiFi密码特征值 uuid */
export const DEVICE_TOKEN_ID = '0000888A-0000-1000-8000-00805F9B34FB'
export const DEVICE_TOKEN_TOKEN = '000088A3-0000-1000-8000-00805F9B34FB'
export const defaultShareMessage = {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '万屏互联新视界'
}
......@@ -10,7 +10,7 @@ import DeviceItem from '@/conpoments/device_item'
import { getFilmList } from '@/actions/asyncCounter'
import { showMyToast, getBLEState, getBLEData } from '@/common/utils'
import Ble from '@/common/bluetooth'
import { defaultShareMessage } from '@/common/index'
import './index.scss'
export interface IDeviceItem {
filmId: any
......@@ -214,11 +214,7 @@ class MyDevice extends Component {
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imgUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
return defaultShareMessage
}
render() {
......
......@@ -6,6 +6,7 @@ import Taro, { Component, Config } from '@tarojs/taro'
import { View, Text, Input, Image } from '@tarojs/components'
import Modal from '@/conpoments/modal'
import { showMyToast } from '@/common/utils'
import { defaultShareMessage } from '@/common/index'
import './index.scss'
export interface IDeviceItem {
......@@ -69,11 +70,7 @@ class DeviceGroup extends Component {
this.getDate()
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
return defaultShareMessage
}
componentDidShow() {
this.page = 1
......
......@@ -7,7 +7,7 @@ import Taro, { Component, Config } from '@tarojs/taro'
import Modal from './modal/index'
import './index.scss'
import { View, Image } from '@tarojs/components'
import { defaultShareMessage } from '@/common/index'
type PageStateProps = {}
type PageDispatchProps = {}
......@@ -46,11 +46,7 @@ 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: '理想屏'
}
return defaultShareMessage
}
componentDidMount() {
Taro.setNavigationBarTitle({
......
......@@ -48,7 +48,6 @@ class Modal extends Component {
onClose,
marginTop = '-50px'
} = this.props
console.log(onCancel, onClose, onConfirm)
return (
<View className="modal" onClick={this.cancel}>
<View className="modal-wrapper" style={{ marginTop }}>
......
......@@ -8,6 +8,7 @@ import { View, Text } from '@tarojs/components'
import DeviceItem from '@/conpoments/shop_device_item'
import { getShopDeviceList } from '@/actions/asyncCounter'
import { showMyToast } from '@/common/utils'
import { defaultShareMessage } from '@/common/index'
import './index.scss'
export interface IDeviceItem {
......@@ -138,11 +139,7 @@ class MyDevice extends Component {
})
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
return defaultShareMessage
}
shouldComponentUpdate(nextProps: IProps, _nextState) {
const { list } = this.props
......
......@@ -3,7 +3,7 @@ import ScheduleList from './schedule_list'
import { ComponentClass } from 'react'
import { AtTabs, AtTabsPane } from 'taro-ui'
import Taro, { Component, Config } from '@tarojs/taro'
import { defaultShareMessage } from '@/common/index'
import './index.scss'
import { View } from '@tarojs/components'
......@@ -41,11 +41,7 @@ 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: '理想屏'
}
return defaultShareMessage
}
changePage = value => {
......
......@@ -5,6 +5,7 @@ import { showMyToast } from '@/common/utils'
import ListView from '@/conpoments/list_view'
import Taro, { Component, Config } from '@tarojs/taro'
import { AtSwipeAction } from 'taro-ui'
import { defaultShareMessage } from '@/common/index'
import './index.scss'
......@@ -57,11 +58,7 @@ class Schedule extends Component {
}
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
return defaultShareMessage
}
async componentWillMount() {
this.getData()
......
......@@ -9,6 +9,8 @@ import Taro, { Component, Config } from '@tarojs/taro'
import CollectionTtem from '@/conpoments/collection_item'
import TempDetail from './detail'
import events from '@/common/events'
import { defaultShareMessage } from '@/common/index'
import './scss/index.scss'
type PageStateProps = {
......@@ -83,11 +85,7 @@ 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: '理想屏'
}
return defaultShareMessage
}
componentDidShow() {
this.isShow = true
......
......@@ -26,4 +26,25 @@
justify-content: space-between;
}
}
.no-films-container {
.no-films-icon {
width: 201.5px;
display: block;
height: 128.5px;
margin: 0 auto;
}
.no-films-tips {
padding-top: 10px;
line-height: 40px;
font-size: 28px;
color: rgba(102, 102, 102, 1);
text-align: center;
.yellow {
color: #ff9110;
}
}
}
}
import TempItem from '../temp_item2'
import DetailTop from '../detail_top'
import { View, Text } from '@tarojs/components'
import { View, Text, Image } from '@tarojs/components'
import Taro from '@tarojs/taro'
import './index.scss'
interface IProps {
detailData: any
filmDataList: any[]
templateId?: string
onCreate?: () => void
}
export default function TempDetailContent(props: IProps) {
const { detailData, filmDataList, templateId } = props
console.log(templateId, 'TempDetailContent')
// console.log(templateId, 'TempDetailContent')
if (!templateId) {
return null
}
......@@ -21,10 +22,34 @@ export default function TempDetailContent(props: IProps) {
<DetailTop {...Object.assign(detailData, { templateId })} templateId2={templateId} />
<View className="temp-detail-list">
<Text className="temp-detail-list-title">创建过的作品({filmDataList.length})</Text>
<View className="temp-detail-list-content">
{filmDataList && filmDataList.map(item => <TempItem {...item} key={item.templateId} />)}
</View>
{filmDataList && filmDataList.length && (
<View>
<Text className="temp-detail-list-title">创建过的作品({filmDataList.length})</Text>
<View className="temp-detail-list-content">
{filmDataList &&
filmDataList.map(item => <TempItem {...item} key={item.templateId} />)}
</View>
</View>
)}
{(!filmDataList || !filmDataList.length) && (
<View
className="no-films-container"
onClick={() => {
Taro.navigateTo({
url: `/pages/home/tempaltes/film_detail?templateId=${templateId}`
})
}}
>
<Image
className="no-films-icon"
src="http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/no-films.png"
/>
<View className="no-films-tips">
<View>该模版下您未创建作}</View>
您可通过点击上方<Text className="yellow">+号</Text>创建作品
</View>
</View>
)}
</View>
</View>
)
......
......@@ -33,22 +33,24 @@ class TempItem extends Component {
title: '加载中',
mask: true
})
api.tempalte
.getTempalteFilmCount(templateId)
.then(res => {
if (res.data === 0) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?templateId=${templateId}` })
} else {
// Taro.navigateTo({ url: `/pages/home/tempaltes/detail?templateId=${templateId}` })
events.emit('detailShow', templateId)
}
this.isload = false
Taro.hideLoading()
})
.catch(() => {
this.isload = false
Taro.hideLoading()
})
events.emit('detailShow', templateId)
Taro.hideLoading()
// api.tempalte
// .getTempalteFilmCount(templateId)
// .then(res => {
// if (res.data === 0) {
// Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?templateId=${templateId}` })
// } else {
// // Taro.navigateTo({ url: `/pages/home/tempaltes/detail?templateId=${templateId}` })
// events.emit('detailShow', templateId)
// }
// this.isload = false
// Taro.hideLoading()
// })
// .catch(() => {
// this.isload = false
// Taro.hideLoading()
// })
}
} else {
setTimeout(() => {
......
......@@ -32,22 +32,24 @@ class TempItem extends Component {
title: '加载中',
mask: true
})
api.tempalte
.getTempalteFilmCount(templateId)
.then(res => {
if (res.data === 0) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?templateId=${templateId}` })
} else {
Taro.navigateTo({ url: `/pages/home/tempaltes/detail?templateId=${templateId}` })
events.emit('detailShow', templateId)
}
this.isload = false
Taro.hideLoading()
})
.catch(() => {
this.isload = false
Taro.hideLoading()
})
events.emit('detailShow', templateId)
Taro.hideLoading()
// api.tempalte
// .getTempalteFilmCount(templateId)
// .then(res => {
// if (res.data === 0) {
// Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?templateId=${templateId}` })
// } else {
// Taro.navigateTo({ url: `/pages/home/tempaltes/detail?templateId=${templateId}` })
// events.emit('detailShow', templateId)
// }
// this.isload = false
// Taro.hideLoading()
// })
// .catch(() => {
// this.isload = false
// Taro.hideLoading()
// })
}
} else {
setTimeout(() => {
......
......@@ -6,8 +6,9 @@ import DeviceItem from '@/conpoments/device_item'
import { showMyToast } from '@/common/utils'
import Modal from '@/conpoments/modal'
import token from '@/common/token'
import { WEBVIEW_URL } from '@/common/index'
import { WEBVIEW_URL, defaultShareMessage } from '@/common/index'
import './scss/film_detail.scss'
import api from '@/api/index'
type PageStateProps = {}
......@@ -165,18 +166,13 @@ class FilmDetail extends Component {
Taro.hideLoading()
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
return defaultShareMessage
}
render() {
const { filmInfo, filmList, showModal, filmId } = this.state
const templateId = this.$router.params.templateId
filmInfo.templateName = filmInfo.filmName
filmInfo.templateDescribe = filmInfo.filmDescribe
console.log('film-detailRender')
return (
<View className="film-detail">
{/* <View className="film-detail-scroll">
......
......@@ -242,7 +242,7 @@ class FilmDetail extends Component {
filmInfo.templateName = filmInfo.filmName
filmInfo.templateDescribe = filmInfo.filmDescribe
const pageList = filmData.pageList || []
console.log('film-edit render', filmInfo)
// console.log('film-edit render', filmInfo)
return (
<View className="film-detail">
<View className="film-detail-scroll">
......
......@@ -115,7 +115,6 @@ class FilmDetail extends Component {
const { filmInfo, filmList, showModal, filmId } = this.state
filmInfo.templateName = filmInfo.filmName
filmInfo.templateDescribe = filmInfo.filmDescribe
console.log('film-detailRender')
return (
<View className="film-detail">
<View className="film-modal">
......
......@@ -7,6 +7,8 @@ import HomeItem from './conpoments/home_item'
import { View, Image, ScrollView, Text } from '@tarojs/components'
import Api from '@/api/index'
import './scss/index.scss'
import { defaultShareMessage } from '@/common/index'
import events from '@/common/events'
type PageStateProps = {
list: any[]
......@@ -90,11 +92,7 @@ class Tempaltes extends Component {
}
onShareAppMessage(e) {
return {
path: '/pages/home/device/index',
imageUrl: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/SHARELOGO.jpg',
title: '理想屏'
}
return defaultShareMessage
}
componentDidHide() {
......
......@@ -55,12 +55,13 @@
.top-bar-container {
position: absolute;
left: 26px;
left: 16px;
top: 116px;
height: 55px;
width: 37px;
width: 47px;
.close {
left: 10px;
position: absolute;
top: 31px;
width: 37px;
......
......@@ -4,6 +4,7 @@ import { View, Text, Image, ScrollView, Button } from '@tarojs/components'
import api from '@/api/index'
import './index.scss'
import token from '@/common/token'
import { defaultShareMessage } from '@/common/index'
type PageStateProps = {}
......@@ -39,11 +40,7 @@ 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: '理想屏'
}
return defaultShareMessage
}
componentWillMount() {
......@@ -88,6 +85,7 @@ class User extends Component {
render() {
let { avatarUrl, nickName, userPhone, vipState, vipTime } = this.state
vipTime = vipTime ? vipTime : ''
return (
<ScrollView scrollY className="user">
<View className="user-top-info">
......
......@@ -66,6 +66,7 @@ class WifiList extends Component {
protected bluetoothCode = ''
protected initLoading = true
protected timer: any = null
protected resettimer: any = null
protected activeWLAN: IWifiListItem
constructor(props: any) {
super(props)
......@@ -192,6 +193,10 @@ class WifiList extends Component {
})
}
if (state === 'PWDFAILED' || state === 'FAILED' || state === 'NETFAILED') {
clearTimeout(this.resettimer)
this.resettimer = null
clearTimeout(this.timer)
this.timer = null
if (recordObj[this.activeWLAN.ssid]) {
await api.common.deleteMyequipmentWifi(this.activeWLAN.ssid)
wifiList.unshift(this.activeWLAN)
......@@ -287,6 +292,9 @@ class WifiList extends Component {
this.cancelModal()
try {
Taro.showLoading({ title: '连接中...' })
this.resettimer = setTimeout(() => {
Ble.postWifiPassword(id, password, deviceId)
}, 15000)
this.timer = setTimeout(() => {
if (!this.deviceToken) {
Taro.hideLoading()
......@@ -294,7 +302,9 @@ class WifiList extends Component {
title: '请重新扫码连接!',
icon: 'none'
})
Taro.navigateBack()
setTimeout(() => {
Taro.navigateBack()
}, 2000)
}
clearTimeout(this.timer)
}, 30000)
......@@ -307,6 +317,7 @@ class WifiList extends Component {
}
// Taro.hideLoading()
} catch (error) {
Ble.postWifiPassword(id, password, deviceId)
console.error(error)
// Taro.hideLoading()
}
......
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