Commit b57cc7ec by hank

list 类型不虚删除第一项

parent 8f0255ad
......@@ -49,7 +49,19 @@ export function getWindiwHeight() {
const HeaderHeight = process.env.TARO_ENV === 'rn' ? Header.HEIGHT : 0
return windowHeight - HeaderHeight
}
/**
* @param frameUrl
* 获取资源url
*/
export function getHostUrl(frameUrl, dataUrl) {
if (String(dataUrl).indexOf('http') !== -1) {
return dataUrl
} else {
let arr = frameUrl.split('/')
arr.splice(-1, 2)
console.log(arr.join(''))
}
}
/** ArrayBuffer转16进制字符串 */
export function ArrayBufferToString(buffer: ArrayBuffer) {
const hexArr: any[] = Array.prototype.map.call(new Uint8Array(buffer), bit => {
......
......@@ -96,7 +96,6 @@ 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 = (
......
......@@ -170,14 +170,16 @@ class MenuItem extends Component {
<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>
{schemaData[item.dataKey].length ? (
<Text
className="list-item-del"
onClick={() => {
this.removeItem(index, item.dataKey)
}}
>
删除
</Text>
) : null}
</View>
<ListItem
item={item}
......
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