import Taro, { Component } from '@tarojs/taro' import { View, Image } from '@tarojs/components' import './remindCust.scss' export default class Popup extends Component { constructor (props) { super(props) this.state = { dataList: [], isPopupShow: false, total: 0, } } componentWillMount () { this.getData() } getData () { const uoObj = Taro.getStorageSync('APP_userInfo') if (uoObj) { Taro.api.base.apiuserhouselist().then(res => { const dataList = res.list || [] this.setState({ dataList, total: res.total || 0, isPopupShow: dataList.length > 0 ? true : false }) }) } } openPopup () { this.setState({ isPopupShow: true }) } closePopup () { this.setState({ isPopupShow: false }) } linkRoomDtl (item) { Taro.navigateTo({ url: `/pagesMore/center/uploadRoom2?cid=${item.id}` }) } callHandle (phone) { Taro.makePhoneCall({ phoneNumber: phone }) } previewImageHandle (item) { const imgArr = item.images && item.images.length > 0 ? item.images.split(',') : [] const urls = [item.house_cert, ...imgArr] Taro.previewImage({ current: item.house_cert, urls }) } verifyHandle (item) { let that = this Taro.$msgConfirm('确定已上传该房源吗,确定后将隐藏该条记录?', () => { Taro.api.base.apiuserhouseverify({id: item.id}).then(res => { Taro.$msg('已隐藏!') that.getData() }) }) } render () { const { isPopupShow, dataList, total } = this.state const bgClose = require('@img/icon_g_close2.png') return ( 已分配房源({total}) { dataList.map(item => { return( [{item.id}]挂价{item.price}w,电:{item.phone} {item.remark} 去上传房源 已上传 ) }) } ) } }