Commit d0e2b415 by hank

fix editbug

parent e967bfc7
{
"miniprogramRoot": "dist/",
"projectname": "taroDemo",
"description": "",
"appid": "wx9dd4033f37a9fa9f",
"setting": {
"urlCheck": false,
"es6": false,
"postcss": false,
"minified": false,
"newFeature": true,
"autoAudits": false,
"checkInvalidKey": true,
"coverView": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {}
}
\ No newline at end of file
"miniprogramRoot": "dist/",
"projectname": "taroDemo",
"description": "",
"appid": "wxc3dfc37466838046",
"setting": {
"urlCheck": false,
"es6": false,
"postcss": false,
"minified": false,
"newFeature": true,
"autoAudits": false,
"checkInvalidKey": true,
"coverView": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
export const FETCH_TIME_OUT = 5000
// export const BASE_URL = 'https://server.bdideal.com'
export const BASE_URL = 'http://172.16.4.219:8090'
export const BASE_URL = 'https://server.bdideal.com'
// export const BASE_URL = 'http://172.16.4.219:8090'
/** 蓝牙的服务 uuid */
export const BLE_SERVICE_ID = '000088A0-0000-1000-8000-00805F9B34FB'
......
......@@ -24,7 +24,8 @@ interface FilmListItem {
class FilmListItem extends Component {
render() {
const { templateUrl, filmName, equipmentCount, onClick } = this.props
let { templateUrl, filmName, equipmentCount, onClick } = this.props
templateUrl = templateUrl || ''
return (
<View className="films-item" onClick={() => onClick && onClick()}>
<View className="films-item-img-box">
......
......@@ -25,7 +25,8 @@ interface DerailTop {
class DerailTop extends Component {
render() {
const { templateUrl, templateName, templateDescribe } = this.props
let { templateUrl, templateName, templateDescribe } = this.props
templateUrl = templateUrl || ''
return (
<View className="derail-top">
<View className="temp-top-info">
......
......@@ -49,8 +49,9 @@ class EditMenu extends Component {
})
}
render() {
const { schemaData, itemList, setValue } = this.props
let { schemaData, itemList, setValue } = this.props
const activeIndex = this.state.activeIndex
itemList = itemList || []
return (
<View className="edit-container">
{/* <View className="temp-top-info">{itemList}</View> */}
......@@ -61,6 +62,7 @@ class EditMenu extends Component {
onClick={() => {
this.handleClick(index)
}}
isAnimation={false}
title={item.name}
key={index + item.name}
>
......
......@@ -34,7 +34,8 @@ class HomeItem extends Component {
}
render() {
const { templateInfo, typeName } = this.props
let { templateInfo, typeName } = this.props
templateInfo = templateInfo || []
return (
<View className="home-item">
<ScrollView scrollY>
......
......@@ -3,7 +3,7 @@
.menu-item {
&-input {
border: 1px solid #999;
height: 40px;
height: 60px;
margin: 10px 5px;
}
}
......@@ -41,8 +41,20 @@ class ListItem extends Component {
}
checkType(item2, key) {
const { item } = this.props
console.log(item.modelSchema[this.isSchemaIndex(item2)], key)
if (key === 'index' || key === 'schemaIndex') {
return ''
}
return item.modelSchema[this.isSchemaIndex(item2)][key].type
}
checkPlaceHolder(item2, key) {
const { item } = this.props
console.log(item.modelSchema[this.isSchemaIndex(item2)], key)
if (key === 'index' || key === 'schemaIndex') {
return ''
}
return item.modelSchema[this.isSchemaIndex(item2)][key].description
}
chooseImg(key) {
const { setValue, schemaData, index, item } = this.props
......@@ -84,7 +96,7 @@ class ListItem extends Component {
<View>
{Object.keys(objItem).map(key => {
let ele: any = null
console.log(key, '+++++++++++++++++++++', objItem)
if (key !== 'schemaIndex' && key !== 'index') {
if (this.checkType(objItem, key) === 'image') {
ele = (
......@@ -105,6 +117,7 @@ class ListItem extends Component {
<Input
className="menu-item-input"
value={objItem[key]}
placeholder={this.checkPlaceHolder(objItem, key)}
onInput={this.inputValueChage.bind(this, key)}
/>
)
......
......@@ -3,7 +3,26 @@
.menu-item {
&-input {
border: 1px solid #999;
height: 40px;
height: 60px;
margin: 10px 5px;
}
}
.list-item-container {
padding: 20px;
border: 1px solid #999;
margin: 20px;
.list-item-title {
display: flex;
justify-content: space-between;
.list-item-index {
color: #333;
}
.list-item-del {
color: red;
}
}
}
......@@ -62,9 +62,30 @@ class MenuItem extends Component {
})
})
}
removeItem(index, key) {
// schemaData[item.dataKey]
let { schemaData, setValue } = this.props
let newSchemaData = JSON.parse(JSON.stringify(schemaData))
newSchemaData[key].splice(index, 1)
setValue(newSchemaData)
// console.log()
}
addItem() {
// schemaData[item.dataKey]
let { schemaData, setValue, item } = this.props
let newSchemaData = JSON.parse(JSON.stringify(schemaData))
let keys = Object.keys(item.modelSchema[0])
let obj = {}
keys.map(item2 => {
obj[item2] = ''
})
newSchemaData[item.dataKey].push(obj)
setValue(newSchemaData)
// console.log()
}
inputValueChage(dataKey, e) {
const { setValue, schemaData } = this.props
const newSchemaData = JSON.parse(JSON.stringify(schemaData))
let newSchemaData = JSON.parse(JSON.stringify(schemaData))
newSchemaData[dataKey]['value'] = e.target.value
setValue(newSchemaData)
console.log(arguments, 'inputValueChage')
......@@ -102,7 +123,18 @@ class MenuItem extends Component {
{schemaData[item.dataKey].map((item2, index) => {
// const item2Back = item2
return (
<View key={item.dataKey}>
<View className="list-item-container" key={item.dataKey}>
<View className="list-item-title">
<Text className="list-item-index">{index + 1}</Text>
<Text
className="list-item-del"
onClick={() => {
this.removeItem(index, item.dataKey)
}}
>
删除
</Text>
</View>
<ListItem
item={item}
objItem={item2}
......@@ -113,6 +145,13 @@ class MenuItem extends Component {
</View>
)
})}
<Button
onClick={() => {
this.addItem()
}}
>
添加子项
</Button>
</View>
)
} else {
......
......@@ -29,7 +29,7 @@ class TempItem extends Component {
}
render() {
const {
let {
templateName,
templateUrl: url,
filmName,
......@@ -38,6 +38,7 @@ class TempItem extends Component {
filmCount,
templateEnvironment
} = this.props
url = url || ''
return (
<View className="temp-item" onClick={this.goDetail}>
{templateEnvironment === '自有设备' ? <View className="tips">建议内部设备</View> : null}
......
......@@ -108,12 +108,19 @@ class FilmDetail extends Component {
console.log(index, 'changePage')
const pageIndex = index
this.setState({
filmInfo: {
filmName: this.state.filmInfo.filmName,
filmDescribe: this.state.filmInfo.filmDescribe
},
// filmInfo: {
// filmName: this.state.filmInfo.filmName,
// filmDescribe: this.state.filmInfo.filmDescribe
// },
pageIndex: pageIndex
})
// this.setState({
// filmInfo: {
// filmName: this.state.filmInfo.filmName,
// filmDescribe: this.state.filmInfo.filmDescribe
// },
// pageIndex: pageIndex
// })
}
updateFilm() {
const { filmDescribe, filmId, filmName } = this.state.filmInfo
......@@ -170,17 +177,17 @@ class FilmDetail extends Component {
}
})
}
shouldComponentUpdate(_nextProps: IProps, _nextState: PageState) {
const { filmInfo } = this.state
const { filmInfo: _filmInfo } = _nextState
return filmInfo !== _filmInfo
}
// shouldComponentUpdate(_nextProps: IProps, _nextState: PageState) {
// const { filmInfo } = this.state
// const { filmInfo: _filmInfo } = _nextState
// return filmInfo !== _filmInfo
// }
render() {
const { filmInfo, filmData, pageIndex } = this.state
filmInfo.templateName = filmInfo.filmName
filmInfo.templateDescribe = filmInfo.filmDescribe
const pageList = filmData.pageList
const pageList = filmData.pageList || []
console.log('film-edit render', pageList)
return (
<View className="film-detail">
......
......@@ -19,7 +19,8 @@
.page-container {
display: flex;
padding: 20px 20px 50px 20px;
padding: 20px 20px 90px 20px;
height: 300px;
.page-item {
margin-right: 30px;
......@@ -43,7 +44,7 @@
overflow: hidden;
&-view {
height: 240px;
height: 280px;
}
}
......
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