Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then(result => {
Taro.hideLoading();
if (result.status === 'error') {
showToast(result.message);
}
console.log('获取最新节点', result);
this.props.dispatch({
type: LATEST_TOPIC_LIST,
data: result.data
});
}).catch(error => {
showToast(error.message);
}).then(result => {
Taro.hideLoading();
if (result.status === 'error') {
showToast(result.message);
}
console.log('获取最热节点', result);
this.props.dispatch({
type: HOT_TOPIC_DATA,
data: result.data
});
}).catch(error => {
showToast(error.message);
}).then(result => {
Taro.hideLoading();
if (result.status === 'error') {
showToast(result.message);
}
console.log('获取最新节点', result);
this.props.dispatch({
type: LATEST_TOPIC_LIST,
data: result.data
});
}).catch(error => {
showToast(error.message);
import React from 'react';
import { hideLoading, navigateTo, showToast } from "@tarojs/taro-rn";
import { AtAvatar, AtTag } from "taro-ui";
import { ScrollView, Text, View } from "@tarojs/components-rn";
import isEmpty from "lodash/isEmpty";
import { connect } from "@tarojs/taro-redux-rn";
import indexStyleSheet from "./index_styles";
import formatAvatar from "../../utils/formatAvatarUrl";
import getDiffTimeStamp from "../../utils/diffTimeStamp";
import showLoading from "../../utils/showLoading";
import callAPI from "../../utils/callAPI";
import api from "../../utils/api";
import { HOT_TOPIC_DATA } from "../../constants";
var _styleSheet = indexStyleSheet;
let LatestDataList = (_dec = connect(state => state), _dec(_class = class LatestDataList extends Taro.Component {
constructor(...args) {
var _temp;
return _temp = super(...args), this.getList = () => {
switch ("rn") {
case 'h5':
this.props.dispatch({
type: HOT_TOPIC_DATA,
data: null
});
hideLoading();
break;
case 'weapp':
this.getLatestTopic();
break;
}
import { hideLoading, navigateTo, showToast } from "@tarojs/taro-rn";
import { AtAvatar, AtIcon, AtTag } from "taro-ui";
import { ScrollView, Text, View } from "@tarojs/components-rn";
import { connect } from "@tarojs/taro-redux-rn";
import indexStyleSheet from "./index_styles";
import formatAvatar from "../../utils/formatAvatarUrl";
import getDiffTimeStamp from "../../utils/diffTimeStamp";
import showLoading from "../../utils/showLoading";
import callAPI from "../../utils/callAPI";
import api from "../../utils/api";
import { LATEST_TOPIC_LIST } from "../../constants";
var _styleSheet = indexStyleSheet;
let LatestDataDefaultList = (_dec = connect(state => state), _dec(_class = class LatestDataDefaultList extends Taro.Component {
constructor(...args) {
var _temp;
return _temp = super(...args), this.getList = () => {
switch ("rn") {
case 'h5':
this.props.dispatch({
type: LATEST_TOPIC_LIST,
data: null
});
hideLoading();
break;
case 'weapp':
this.getLatestTopic();
break;
}
}).catch(error => {
showToast(error.message);
});
}, this.goDetail = topic_id => {
}).then(result => {
Taro.hideLoading();
if (result.status === 'error') {
showToast(result.message);
}
console.log('获取帖子详情', result);
this.props.dispatch({
type: TOPIC_DETAIL_DATA,
data: result.data
});
}).catch(error => {
showToast(error.message);
var _class, _temp;
import Taro from '@tarojs/taro-rn';
import React from 'react';
import { View } from "@tarojs/components-rn";
import LatestDataList from "../../components/latest-data-list/index";
let Index = (_temp = _class = class Index extends Taro.Component {
render() {
return ;
}
}, _class.config = {
navigationBarTitleText: '最热'
}, _temp);
export default Index;
var _class, _temp;
import Taro from '@tarojs/taro-rn';
import React from 'react';
import { View } from "@tarojs/components-rn";
import LatestDataDefaultList from "../../components/latest-data-default-list/index";
let Index = (_temp = _class = class Index extends Taro.Component {
render() {
return ;
import { AtAvatar, AtTag } from "taro-ui";
import isEmpty from "lodash/isEmpty";
import { TaroRichText } from 'taro_rich_text';
import { RichText, Text, View } from "@tarojs/components-rn";
import { connect } from "@tarojs/taro-redux-rn";
import showLoading from "../../utils/showLoading";
import showAlert from "../../utils/showAlert";
import callAPI from "../../utils/callAPI";
import api from "../../utils/api";
import { TOPIC_DETAIL_DATA, TOPIC_REPLIES_DATA } from "../../constants";
import formatAvatar from "../../utils/formatAvatarUrl";
import getDiffTimeStamp from "../../utils/diffTimeStamp";
import indexStyleSheet from "./index_styles";
var _styleSheet = indexStyleSheet;
let Index = (_dec = connect(state => state), _dec(_class = class Index extends Taro.Component {
constructor(...args) {
var _temp;
return _temp = super(...args), this.state = {
topic_id: 0
}, this.clearData = () => {
this.props.dispatch({
type: TOPIC_REPLIES_DATA,
data: null
});
this.props.dispatch({
type: TOPIC_DETAIL_DATA,
data: null
});
}, this.getList = () => {
switch ("rn") {