|
@@ -8,7 +8,7 @@ import './uploadRoom2.scss'
|
|
|
|
|
|
import qiniuUploader from '@utils/qiniuUploader'
|
|
|
import { TaroCropper } from 'taro-cropper'
|
|
|
-import { arrToObj } from '@utils'
|
|
|
+import { arrToObj, convertFileName } from '@utils'
|
|
|
|
|
|
class Index extends Component {
|
|
|
|
|
@@ -50,6 +50,7 @@ class Index extends Component {
|
|
|
curProductTypeName: '',
|
|
|
productHouseList: [],
|
|
|
custObj: {},
|
|
|
+ uploadProgressObj: {},
|
|
|
}
|
|
|
}
|
|
|
config = {
|
|
@@ -363,7 +364,8 @@ class Index extends Component {
|
|
|
qiniuUploader.upload(f.tempFilePath, (suc) => {
|
|
|
formObj.video = suc.fileURL
|
|
|
that.setState({
|
|
|
- formObj
|
|
|
+ formObj,
|
|
|
+ uploadProgressObj: {},
|
|
|
})
|
|
|
}, (error) => {
|
|
|
console.error('error: ' + JSON.stringify(error));
|
|
@@ -371,11 +373,17 @@ class Index extends Component {
|
|
|
// 此项为qiniuUploader.upload的第四个参数options。若想在单个方法中变更七牛云相关配置,可以使用上述参数。如果不需要在单个方法中变更七牛云相关配置,则可使用 null 作为参数占位符。推荐填写initQiniu()中的七牛云相关参数,然后此处使用null做占位符。
|
|
|
// 若想自定义上传key,请把自定义key写入此处options的key值。如果在使用自定义key后,其它七牛云配置参数想维持全局配置,请把此处options除key以外的属性值置空。
|
|
|
// 启用options参数请记得删除null占位符
|
|
|
+
|
|
|
+ // 楼盘视频 E 开头 户型视频 A 开头,房源视频 H 开头
|
|
|
{
|
|
|
- key: `${userInfo.phone}-${+new Date()}${f.tempFilePath.split('.').length > 0 ? '.'+f.tempFilePath.split('.')[1] : ''}`,
|
|
|
+ // key: `${userInfo.phone}-${+new Date()}${f.tempFilePath.split('.').length > 0 ? '.'+f.tempFilePath.split('.')[1] : ''}`,
|
|
|
+ key: 'H'+convertFileName(f.tempFilePath, 'onlyName'),
|
|
|
},
|
|
|
// null,
|
|
|
(progress) => {
|
|
|
+ that.setState({
|
|
|
+ uploadProgressObj: progress
|
|
|
+ })
|
|
|
console.log('上传进度', progress.progress);
|
|
|
console.log('已经上传的数据长度', progress.totalBytesSent);
|
|
|
console.log('预期需要上传的数据总长度', progress.totalBytesExpectedToSend);
|
|
@@ -513,11 +521,12 @@ class Index extends Component {
|
|
|
const { addr1, addr2, addr3, formObj } = this.state
|
|
|
return (
|
|
|
<View className={formObj.id ? 'scoped-addr-box dis' : 'scoped-addr-box'}>
|
|
|
- <Input type="number" disabled={formObj.id} value={addr1} onInput={this.changeAddrInput.bind(this, 'addr1')} className="i" placeholder="__" />
|
|
|
+ {/* disabled={formObj.id} */}
|
|
|
+ <Input type="number" value={addr1} onInput={this.changeAddrInput.bind(this, 'addr1')} className="i" placeholder="__" />
|
|
|
<View className='t'>栋座</View>
|
|
|
- <Input type="number" disabled={formObj.id} value={addr2} onInput={this.changeAddrInput.bind(this, 'addr2')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" value={addr2} onInput={this.changeAddrInput.bind(this, 'addr2')} className="i" placeholder="__" />
|
|
|
<View className='t'>单元</View>
|
|
|
- <Input type="number" disabled={formObj.id} value={addr3} onInput={this.changeAddrInput.bind(this, 'addr3')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" value={addr3} onInput={this.changeAddrInput.bind(this, 'addr3')} className="i" placeholder="__" />
|
|
|
<View className='t'>室号</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -550,11 +559,12 @@ class Index extends Component {
|
|
|
const { hType1, hType2, hType3, formObj } = this.state
|
|
|
return (
|
|
|
<View className={formObj.id ? 'scoped-addr-box dis' : 'scoped-addr-box'}>
|
|
|
- <Input type="number" value={hType1} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType1')} className="i" placeholder="__" />
|
|
|
+ {/* disabled={formObj.id} */}
|
|
|
+ <Input type="number" value={hType1} onInput={this.changeAddrInput.bind(this, 'hType1')} className="i" placeholder="__" />
|
|
|
<View className='t'>室</View>
|
|
|
- <Input type="number" value={hType2} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType2')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" value={hType2} onInput={this.changeAddrInput.bind(this, 'hType2')} className="i" placeholder="__" />
|
|
|
<View className='t'>厅</View>
|
|
|
- <Input type="number" value={hType3} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType3')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" value={hType3} onInput={this.changeAddrInput.bind(this, 'hType3')} className="i" placeholder="__" />
|
|
|
<View className='t'>卫</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -570,9 +580,9 @@ class Index extends Component {
|
|
|
const { sRate1, sRate2, formObj } = this.state
|
|
|
return (
|
|
|
<View className={formObj.id ? 'scoped-floor-height-box dis' : 'scoped-floor-height-box'}>
|
|
|
- <Input type="number" disabled={formObj.id} value={sRate1} onInput={this.changeAddrInput.bind(this, 'sRate1')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" value={sRate1} onInput={this.changeAddrInput.bind(this, 'sRate1')} className="i" placeholder="__" />
|
|
|
<View className='t'>梯</View>
|
|
|
- <Input type="number" disabled={formObj.id} value={sRate2} onInput={this.changeAddrInput.bind(this, 'sRate2')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" value={sRate2} onInput={this.changeAddrInput.bind(this, 'sRate2')} className="i" placeholder="__" />
|
|
|
<View className='t'>户</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -581,9 +591,9 @@ class Index extends Component {
|
|
|
const { formObj } = this.state
|
|
|
return (
|
|
|
<View className={formObj.id ? 'scoped-floor-height-box dis' : 'scoped-floor-height-box'}>
|
|
|
- <Input type="number" disabled={formObj.id} value={formObj.floor} onInput={this.changeFormObjInput.bind(this, 'floor')} className="i" placeholder="所在楼层" />
|
|
|
+ <Input type="number" value={formObj.floor} onInput={this.changeFormObjInput.bind(this, 'floor')} className="i" placeholder="所在楼层" />
|
|
|
<View className='t'>/</View>
|
|
|
- <Input type="number" disabled={formObj.id} value={formObj.storeys} onInput={this.changeFormObjInput.bind(this, 'storeys')} className="i" placeholder="总楼层" />
|
|
|
+ <Input type="number" value={formObj.storeys} onInput={this.changeFormObjInput.bind(this, 'storeys')} className="i" placeholder="总楼层" />
|
|
|
<View className='t'>层</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -1002,7 +1012,13 @@ class Index extends Component {
|
|
|
</View>
|
|
|
<View className='scoped-has-right'>
|
|
|
<View className="scoped-box">
|
|
|
- <View className="sb-title">房源视频</View>
|
|
|
+ <View className="sb-title">房源视频
|
|
|
+ {
|
|
|
+ uploadProgressObj && uploadProgressObj.progress
|
|
|
+ ? <View className="s">上传进度:{uploadProgressObj.progress}%</View>
|
|
|
+ : ''
|
|
|
+ }
|
|
|
+ </View>
|
|
|
<View className="scoped-img">
|
|
|
{
|
|
|
formObj.video
|