Commit 84e44ab0 by lirandong

添加我的设备

parent a4cdf55e
......@@ -2,12 +2,23 @@
"miniprogramRoot": "dist/",
"projectname": "taroDemo",
"description": "",
"appid": "touristappid",
"appid": "wxc3dfc37466838046",
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": false,
"postcss": false,
"minified": false
"minified": false,
"newFeature": true,
"coverView": true,
"autoAudits": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"simulatorType": "wechat",
......
......@@ -34,13 +34,13 @@ class App extends Component {
config: Config = {
pages: [
'pages/home/device/index',
'pages/home/film/film_list/index',
'pages/home/device/my_film/index',
'pages/home/user/index',
'pages/home/tempaltes/film_detail',
'pages/home/tempaltes/detail',
'pages/home/tempaltes/index',
'pages/home/index',
'pages/index/index',
'pages/index/index'
// 'pages/home/tempaltes/detail'
],
window: {
......
export const ADD = 'ADD'
export const MINUS = 'MINUS'
export const BASE_URL = 'http://server.bdideal.com'
export const BASE_URL = 'https://server.bdideal.com'
export const FETCH_TIME_OUT = 5000
export const INTERFACE_REPEAT = '接口重复,请求已取消'
......@@ -2,7 +2,7 @@
.films {
width: 100%;
height: 100%;
height: 1036px;
background-color: $bgColor;
}
......@@ -29,3 +29,7 @@
padding-left: 20px;
flex-direction: column;
}
.scroll-view {
height: 100%;
}
import api from '@/api/index'
import { ComponentClass } from 'react'
import Taro, { Component, Config } from '@tarojs/taro'
import Taro, { Component } from '@tarojs/taro'
import { View, Text, ScrollView, Image } from '@tarojs/components'
import './index.scss'
type PageStateProps = {}
......@@ -24,10 +25,6 @@ interface Films {
}
class Films extends Component {
config: Config = {
navigationBarTitleText: '我的视片'
}
constructor(props) {
super(props)
this.state = {
......@@ -45,7 +42,6 @@ class Films extends Component {
count,
flimListData: list
})
// console.log({ res })
} catch (error) {
console.error(error)
}
......@@ -57,14 +53,21 @@ class Films extends Component {
return flimListData !== FD
}
goDetail({ filmId }: any) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${filmId}` })
}
render() {
const { flimListData } = this.state
// const {templateUrl} = flimListData
return (
<View className="films">
<ScrollView className="scroll-view">
<ScrollView className="scroll-view" scrollY>
{flimListData.map(item => (
<View className="films-item-wrapper" key={item.filmId}>
<View
className="films-item-wrapper"
key={item.filmId}
onClick={() => this.goDetail(item)}
>
<View className="img-box">
<Image className="films-item-img" src={item.templateUrl} />
</View>
......@@ -75,9 +78,6 @@ class Films extends Component {
</View>
))}
</ScrollView>
{/* <Text className="films-count-bar">hello world</Text> */}
{/* <View className="scroll-wrapper">
</View> */}
</View>
)
}
......
@import '@styles/var.scss';
@import "~taro-ui/dist/style/components/tabs.scss";
@import '~taro-ui/dist/style/components/tabs.scss';
import FilmList from './film_list'
import MyDevice from './my_device'
import { ComponentClass } from 'react'
import FilmList from '../film/film_list/index1'
import { AtTabs, AtTabsPane } from 'taro-ui'
import { View, Text } from '@tarojs/components'
import Taro, { Component, Config } from '@tarojs/taro'
import './index.scss'
type PageStateProps = {}
......@@ -31,7 +32,7 @@ class Device extends Component {
constructor(props) {
super(props)
this.state = {
current: 0
current: 1
}
}
......@@ -42,12 +43,17 @@ class Device extends Component {
render() {
const { current } = this.state
return (
<AtTabs current={current} tabList={tabList} onClick={this.changePage}>
<AtTabsPane current={current} index={0}>
<AtTabs
current={current}
tabList={tabList}
onClick={this.changePage}
className="at-tabs-wrapper"
>
<AtTabsPane className="at-tabs-page" current={current} index={0}>
<FilmList />
</AtTabsPane>
<AtTabsPane current={current} index={1}>
<FilmList />
<AtTabsPane className="at-tabs-page" current={current} index={1}>
<MyDevice />
</AtTabsPane>
</AtTabs>
)
......
@import '@styles/var.scss';
@import '~taro-ui/dist/style/components/icon.scss';
.my-device {
width: 100%;
height: 1036px;
position: relative;
}
.add-device {
right: 80px;
bottom: 80px;
width: 120px;
height: 120px;
display: flex;
position: absolute;
border-radius: 60px;
align-items: center;
justify-content: center;
background-color: $bgColor;
}
import { AtIcon } from 'taro-ui'
import { ComponentClass } from 'react'
import Taro, { Component } from '@tarojs/taro'
import { View, Text, ScrollView } from '@tarojs/components'
// import './icon.scss'
import './index.scss'
type PageStateProps = {}
type PageDispatchProps = {}
type PageOwnProps = {}
type PageState = {
name: string
}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface MyDevice {
props: IProps
state: PageState
}
class MyDevice extends Component {
constructor(props) {
super(props)
this.state = {
name: '小红'
}
}
render() {
return (
<View className="my-device">
<ScrollView>
<Text>1111</Text>
{/* <View className="at-icon at-icon-settings" /> */}
</ScrollView>
<View className="add-device">
{/* <AtIcon value="clock" size="30" color="#000" /> */}
{/* <Text className="icon">添加</Text> */}
</View>
{/* <Text>hello world</Text> */}
</View>
)
}
}
export default MyDevice as ComponentClass<PageOwnProps, PageState>
.my-film {
width: 100%;
height: 100%;
}
import { ComponentClass } from 'react'
import { View } from '@tarojs/components'
import FilmList from '../film_list/index'
import Taro, { Component, Config } from '@tarojs/taro'
import './index.scss'
type PageStateProps = {}
type PageDispatchProps = {}
type PageOwnProps = {}
type PageState = {}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface MyFilm {
props: IProps
state: PageState
}
class MyFilm extends Component {
config: Config = {
navigationBarTitleText: '我的视片'
}
render() {
return (
<View className="my-film">
<FilmList />
</View>
)
}
}
export default MyFilm as ComponentClass<PageOwnProps, PageState>
import api from '@/api/index'
import { ComponentClass } from 'react'
import Taro, { Component, Config } from '@tarojs/taro'
import { View, Text, ScrollView, Image } from '@tarojs/components'
import './index.scss'
type PageStateProps = {}
type PageDispatchProps = {}
type PageOwnProps = {}
type PageState = {
page: number
count: number
flimListData: any[]
}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface Films {
props: IProps
state: PageState
}
class Films extends Component {
config: Config = {
navigationBarTitleText: '我的视片'
}
constructor(props) {
super(props)
this.state = {
page: 1,
count: 0,
flimListData: []
}
}
async componentWillMount() {
try {
const { page } = this.state
const { count, list } = await api.common.getMyFilmsList(page)
this.setState({
count,
flimListData: list
})
// console.log({ res })
} catch (error) {
console.error(error)
}
}
shouldComponentUpdate(_nextProps, _nextState) {
const { flimListData } = this.state
const { flimListData: FD } = _nextState
return flimListData !== FD
}
render() {
const { flimListData } = this.state
// const {templateUrl} = flimListData
return (
<View className="films">
<ScrollView className="scroll-view">
{flimListData.map(item => (
<View className="films-item-wrapper" key={item.filmId}>
<View className="img-box">
<Image className="films-item-img" src={item.templateUrl} />
</View>
<View className="films-item-info">
<Text>{item.filmName}</Text>
<Text>播放设备数量:{item.equipmentCount}</Text>
</View>
</View>
))}
</ScrollView>
{/* <Text className="films-count-bar">hello world</Text> */}
{/* <View className="scroll-wrapper">
</View> */}
</View>
)
}
}
export default Films as ComponentClass<PageOwnProps, PageState>
......@@ -37,10 +37,7 @@
.bottom-btn {
width: 100%;
height: 80px;
font-size: 28px;
border-radius: 0;
// padding: 20px 0;
background-color: $primary-color;
}
......
......@@ -50,5 +50,5 @@
.logout-btn {
width: 500px;
font-size: 28px;
// font-size: 28px;
}
import { ComponentClass } from 'react'
import Taro, { Component, Config } from '@tarojs/taro'
import { View, Text, Image, ScrollView, Button } from '@tarojs/components'
// import './User.less'
import './index.scss'
type PageStateProps = {}
......@@ -46,6 +46,10 @@ class User extends Component {
}
}
goPage(url: string) {
Taro.navigateTo({ url })
}
shouldComponentUpdate(_nextPorps, _nextState) {
const { nickName, avatarUrl } = this.state
const { nickName: _nickName, avatarUrl: _avatarUrl } = _nextState
......@@ -61,7 +65,10 @@ class User extends Component {
<Text className="top-user-name">{nickName}</Text>
</View>
<View className="item-wrapper">
<View className="item-view">
<View
onClick={() => this.goPage('/pages/home/device/my_film/index')}
className="item-view"
>
<Text>我的视片</Text>
</View>
<View className="item-view">
......
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