|
@@ -53,25 +53,21 @@ class Index extends Component {
|
|
|
// title: name + '-一房一价表' || '一房一价表'
|
|
|
// })
|
|
|
const {eId, id} = this.$router.params
|
|
|
- Taro.api.house.apiestatelottery2batchinfo({
|
|
|
- lottery_id: id,
|
|
|
+ Taro.api.room.apibuildingunitlist({
|
|
|
estate_id: eId,
|
|
|
}).then(res => {
|
|
|
- let ll = res.lottery_list || []
|
|
|
+ let ll = res.list || []
|
|
|
let buildingNumList = []
|
|
|
ll.forEach(item => {
|
|
|
- const arr = item.building_num.split(',')
|
|
|
- arr.forEach(sub => {
|
|
|
- buildingNumList.push({
|
|
|
- id: item.id,
|
|
|
- title: sub,
|
|
|
- lottery_time: item.lottery_time
|
|
|
- })
|
|
|
+ buildingNumList.push({
|
|
|
+ id: item.id,
|
|
|
+ title: `${item.building}栋${item.unit}单元`,
|
|
|
+ lottery_time: item.lottery_time
|
|
|
})
|
|
|
})
|
|
|
this.setState({
|
|
|
buildingNumList,
|
|
|
- curObj: res || {}
|
|
|
+ curObj: buildingNumList[0] || {}
|
|
|
}, () => {
|
|
|
this.getDtl()
|
|
|
})
|
|
@@ -81,14 +77,12 @@ class Index extends Component {
|
|
|
getDtl = () => {
|
|
|
const { curNav, buildingNumList } = this.state
|
|
|
const {eId, name, id} = this.$router.params
|
|
|
- Taro.api.house.apiestatelotterypricelist2({
|
|
|
+ Taro.api.room.apinewhousepricelist({
|
|
|
estate_id: eId,
|
|
|
- lottery_id: buildingNumList[curNav].id,
|
|
|
- building_num: buildingNumList[curNav].title,
|
|
|
+ building_id: buildingNumList[curNav].id,
|
|
|
}).then(res => {
|
|
|
this.setState({
|
|
|
- allData: res || {},
|
|
|
- roomArr: res.data || []
|
|
|
+ roomArr: res || []
|
|
|
})
|
|
|
if (this.subChat) {
|
|
|
this.subChat.getData({name, id: eId}, 'pt')
|
|
@@ -101,12 +95,13 @@ class Index extends Component {
|
|
|
if (curObj.id === buildingNumList[curNav].id) {
|
|
|
return
|
|
|
}
|
|
|
- Taro.api.house.apiestatelottery2batchinfo({
|
|
|
- lottery_id: buildingNumList[curNav].id,
|
|
|
+ Taro.api.room.apinewhousepricelist({
|
|
|
+ building_id: buildingNumList[curNav].id,
|
|
|
estate_id: eId,
|
|
|
}).then(res => {
|
|
|
this.setState({
|
|
|
- curObj: res || {}
|
|
|
+ curObj: buildingNumList[curNav] || {},
|
|
|
+ roomArr: res || []
|
|
|
})
|
|
|
})
|
|
|
}
|
|
@@ -120,25 +115,12 @@ class Index extends Component {
|
|
|
componentDidHide () { }
|
|
|
|
|
|
renderTop () {
|
|
|
- const {eId, id, name} = this.$router.params
|
|
|
- const curParams = `eId=${eId}&id=${id}&name=${name}`
|
|
|
- const { allData, curObj, curNav, buildingNumList } = this.state
|
|
|
- let newTabList = JSON.parse(JSON.stringify(buildingNumList))
|
|
|
- if (newTabList[curNav] && newTabList[curNav].title) {
|
|
|
- newTabList[curNav].title = `${newTabList[curNav].title}(${allData.avg_price}/㎡)`
|
|
|
- }
|
|
|
+ const { name} = this.$router.params
|
|
|
+ const { curNav, buildingNumList } = this.state
|
|
|
const nameIcon = require('./img/yfyj/yfyj04.png')
|
|
|
- const i1 = require('./img/yfyj/yfyj05.png')
|
|
|
- const i2 = require('./img/yfyj/yfyj06.png')
|
|
|
- const op1 = require('./img/yfyj/yfyj_icon1.png')
|
|
|
- const op2 = require('./img/yfyj/yfyj_icon2.png')
|
|
|
- const op3 = require('./img/yfyj/yfyj_icon3.png')
|
|
|
- const op4 = require('./img/yfyj/yfyj_icon4.png')
|
|
|
- const bg = require('./img/yfyj/bg.jpg')
|
|
|
return (
|
|
|
<View className="scoped-header">
|
|
|
<View className="scoped-top">
|
|
|
- <Image src={bg} className="bg"></Image>
|
|
|
<View className="st-wrap">
|
|
|
<View className="st-header">
|
|
|
<View className="text">
|
|
@@ -147,28 +129,13 @@ class Index extends Component {
|
|
|
</View>
|
|
|
<View className="r" onClick={this.urlDtlLink.bind(this)}>返回楼盘详情</View>
|
|
|
</View>
|
|
|
- <View className="st-p1">
|
|
|
- <Image className="i" src={i1}></Image>
|
|
|
- <View className="t">{curObj.under_way}</View>
|
|
|
- </View>
|
|
|
- <View className="st-p1">
|
|
|
- <Image className="i" src={i2}></Image>
|
|
|
- <View className="t2">{curObj.lottery_time}</View>
|
|
|
- </View>
|
|
|
- <View className="st-p2">
|
|
|
- <Image src={op1} className="op1" onClick={this.urlLink.bind(this, '/pagesRoom/roomPriceList', curParams)}></Image>
|
|
|
- <Image src={op2} className="op2" onClick={this.urlLink.bind(this, '/pagesRoom/roomPriceImg', curParams)}></Image>
|
|
|
- <Image src={op3} className="op3" onClick={this.previewImageHandle.bind(this, curObj.project_img, [curObj.project_img])}></Image>
|
|
|
- <Image src={op4} className="op4" onClick={this.previewQrcodeImageHandle.bind(this, 'http://icon.honglounews.com/ncfxw2.jpg', ['http://icon.honglounews.com/ncfxw2.jpg'])}></Image>
|
|
|
- </View>
|
|
|
- {this.renderQrcode()}
|
|
|
</View>
|
|
|
</View>
|
|
|
<View className="sh-nav">
|
|
|
<AtTabs
|
|
|
current={curNav}
|
|
|
scroll
|
|
|
- tabList={newTabList}
|
|
|
+ tabList={buildingNumList}
|
|
|
onClick={this.navClick.bind(this)}>
|
|
|
</AtTabs>
|
|
|
</View>
|
|
@@ -213,16 +180,13 @@ class Index extends Component {
|
|
|
}
|
|
|
|
|
|
renderInfo () {
|
|
|
- const { roomArr, allData } = this.state
|
|
|
- const house_type_total = allData.house_type_total || {}
|
|
|
- const htaArr = house_type_total.house_type_avg || []
|
|
|
+ const { roomArr } = this.state
|
|
|
let cArr = roomArr || []
|
|
|
const htArr = cArr[0] ? cArr[0].data : []
|
|
|
const htArrIndex = htArr.length
|
|
|
const htitems = htArr.map((item, index) => {
|
|
|
- let boxClassStr = `'srp-col num'${htArrIndex}`
|
|
|
return (
|
|
|
- <View className={boxClassStr} key={index}>
|
|
|
+ <View className={'srp-col num' + htArrIndex} key={index}>
|
|
|
<View className="srp-ht">
|
|
|
<View className="srp-img">
|
|
|
<Image src={item.house_img + '_xs'} className="img" onClick={this.previewImageHandle.bind(this, item.house_img, [item.house_img])}/>
|
|
@@ -233,7 +197,6 @@ class Index extends Component {
|
|
|
</View>
|
|
|
<View className="p1">{item.house_type}</View>
|
|
|
<View className="p2">{item.built}㎡</View>
|
|
|
- <View className="p2">¥{htaArr[index]}/㎡</View>
|
|
|
{
|
|
|
item.house_rate === '100%'
|
|
|
? ''
|
|
@@ -420,10 +383,10 @@ class Index extends Component {
|
|
|
let { curRoomObj } = this.state
|
|
|
if (curRoomObj.id == curRoomObj.inputId) {
|
|
|
Taro.$msgConfirm(`确定该单元全部改为已售?`, () => {
|
|
|
- Taro.api.house.apiestatelotterypricebatch({
|
|
|
+ Taro.api.room.apinewhousepricebatch({
|
|
|
estate_id: eId,
|
|
|
house_sale_state: '已售',
|
|
|
- building_num: buildingNumList[curNav].title
|
|
|
+ building_id: buildingNumList[curNav].id
|
|
|
}).then(res => {
|
|
|
this.getDtl()
|
|
|
this.closeRulePopup()
|
|
@@ -458,7 +421,7 @@ class Index extends Component {
|
|
|
if (str === 'edit') {
|
|
|
let { curRoomObj } = this.state
|
|
|
let house_discount = curRoomObj.house_discount ? curRoomObj.house_discount.replace(/,|、|\/|\\/g, ',') : ''
|
|
|
- Taro.api.house.apiestatelotterypriceedit({
|
|
|
+ Taro.api.room.apinewhousepriceedit({
|
|
|
id: curRoomObj.id,
|
|
|
house_sale_state: curRoomObj.house_sale_state,
|
|
|
house_sale_remark: curRoomObj.house_sale_remark || '',
|