|
@@ -0,0 +1,112 @@
|
|
|
+import Taro, { Component } from '@tarojs/taro'
|
|
|
+import { View, Image, Text } from '@tarojs/components'
|
|
|
+import LoginJudge from '@/c/login/Judge'
|
|
|
+
|
|
|
+import './desc.scss'
|
|
|
+
|
|
|
+class Index extends Component {
|
|
|
+
|
|
|
+ config = {
|
|
|
+ navigationBarTitleText: '点击底部领资料',
|
|
|
+ // navigationStyle: 'custom',
|
|
|
+ // navigationBarTextStyle: 'white',
|
|
|
+ }
|
|
|
+
|
|
|
+ onShareAppMessage() {
|
|
|
+ return {
|
|
|
+ title: '让买房,更省心!',
|
|
|
+ }
|
|
|
+ }
|
|
|
+ onShareTimeline () {
|
|
|
+ return {
|
|
|
+ title: '洪楼Plus,专注南昌本地房地产市场,让买房,更省心!',
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ constructor (props) {
|
|
|
+ super(props)
|
|
|
+ this.state = {
|
|
|
+ userInfo: {},
|
|
|
+ curSaleObj: {},
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillMount () {
|
|
|
+ Taro.$AHU(this)
|
|
|
+ this.getDtl()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ saleChat () {
|
|
|
+ let token = Taro.getStorageSync('APP_token')
|
|
|
+ if (!token) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const { curSaleObj } = this.state
|
|
|
+ let params = {
|
|
|
+ target_id: 999,
|
|
|
+ target_type: 3,
|
|
|
+ sale_id: curSaleObj.sale_id,
|
|
|
+ click_type: '1'
|
|
|
+ }
|
|
|
+ Taro.api.room.apiusercontactclick(params).then((res) => {
|
|
|
+ Taro.navigateTo({
|
|
|
+ url: `/pagesQa/msg/chat?to_user_id=${curSaleObj.user_id}&diyText=领取楼盘资料`
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ Taro.navigateTo({
|
|
|
+ url: `/pagesQa/msg/chat?to_user_id=${curSaleObj.user_id}&diyText=领取楼盘资料`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ getDtl = () => {
|
|
|
+ const curSaleObj = Taro.getStorageSync('APP_cur_sale')
|
|
|
+ if (curSaleObj.curObj) {
|
|
|
+ this.setState({
|
|
|
+ curSaleObj: curSaleObj.curObj,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.getSaleList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getSaleList () {
|
|
|
+ let params = {
|
|
|
+ show_status: 1,
|
|
|
+ page_size: 99
|
|
|
+ }
|
|
|
+ const referrer = Taro.getStorageSync('APP_MY_REFERRER')
|
|
|
+ if (referrer) params.referrer = referrer
|
|
|
+ Taro.api.room.apisalelist(params).then(res => {
|
|
|
+ const list = res.list || []
|
|
|
+ if (list.length === 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const arrIndex = Math.floor(Math.random() * list.length)
|
|
|
+ this.setState({
|
|
|
+ curSaleObj: list[arrIndex],
|
|
|
+ })
|
|
|
+ Taro.setStorageSync('APP_cur_sale', {curObj: list[arrIndex]})
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ render () {
|
|
|
+ const img1 = require('./img/desc/desc_01.jpg')
|
|
|
+ const img2 = require('./img/desc/desc_02.jpg')
|
|
|
+ const img3 = require('./img/desc/desc_03.jpg')
|
|
|
+ const img4 = require('./img/desc/desc_04.jpg')
|
|
|
+ return (
|
|
|
+ <View className="l-box">
|
|
|
+ <View className="desc-box">
|
|
|
+ <Image className="db-img1" src={img1} />
|
|
|
+ <Image className="db-img2" src={img2} />
|
|
|
+ <Image className="db-img3" src={img3} />
|
|
|
+ <Image className="db-img4" src={img4} onClick={this.saleChat.bind(this)} />
|
|
|
+ <LoginJudge />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export default Index
|