Commit 996fcd8e by hanjixin

对接应用接口

parent 99d4d3e8
...@@ -327,7 +327,7 @@ class UsersApi extends ApiClient { ...@@ -327,7 +327,7 @@ class UsersApi extends ApiClient {
/** 获取应用列表 */ /** 获取应用列表 */
getApplicationList(page: number = 1, limit: number = 10) { getApplicationList(page: number = 1, limit: number = 10) {
return this.request({ return this.request({
method: 'post', method: 'get',
url: `/application/get/list?p=${page}&c=${limit}` url: `/application/get/list?p=${page}&c=${limit}`
}) })
} }
......
...@@ -49,6 +49,18 @@ ...@@ -49,6 +49,18 @@
color: #333; color: #333;
font-size: 30px; font-size: 30px;
.group-item-content {
display: flex;
align-items: center;
.icon {
height: 80px;
width: 80px;
margin-right: 10px;
margin-left: 5px;
}
}
&::after { &::after {
content: ''; content: '';
position: absolute; position: absolute;
......
...@@ -67,6 +67,7 @@ class AppLication extends Component { ...@@ -67,6 +67,7 @@ class AppLication extends Component {
} }
async componentWillMount() { async componentWillMount() {
Taro.setNavigationBarTitle({ title: '应用列表' })
this.getDate() this.getDate()
} }
onShareAppMessage(e) { onShareAppMessage(e) {
...@@ -79,7 +80,7 @@ class AppLication extends Component { ...@@ -79,7 +80,7 @@ class AppLication extends Component {
async getDate() { async getDate() {
this.cancelModal() this.cancelModal()
// this.props.getFilmListData(this.page) // this.props.getFilmListData(this.page)
api.common.getGroupList().then(res => { api.common.getApplicationList(this.page).then(res => {
const list = res.list const list = res.list
this.setState({ this.setState({
list: list list: list
...@@ -147,7 +148,7 @@ class AppLication extends Component { ...@@ -147,7 +148,7 @@ class AppLication extends Component {
goDetail(id, url = 'https://visual-clouds.bdideal.com/html/81462d155bac4302b05ddc2436bf295c/index.html', applayId = 1) { goDetail(id, url = 'https://visual-clouds.bdideal.com/html/81462d155bac4302b05ddc2436bf295c/index.html', applayId = 1) {
let url2 = 'https://visual-clouds.bdideal.com/html/81462d155bac4302b05ddc2436bf295c/index.html' let url2 = 'https://visual-clouds.bdideal.com/html/81462d155bac4302b05ddc2436bf295c/index.html'
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/home/application/app_detail/index?appId=${'lunpanid'}&strangerApplyId=${applayId}&url=${encodeURI(url2)}` url: `/pages/home/application/app_detail/index?appId=${'lunpanid'}&strangerApplyId=${id}&url=${encodeURI(url2)}`
}) })
} }
...@@ -230,35 +231,17 @@ class AppLication extends Component { ...@@ -230,35 +231,17 @@ class AppLication extends Component {
> >
<View <View
className="group-item" className="group-item"
onClick={() => this.goDetail(item.equipmentGroupId, item.equipmentGroupName)} onClick={() => this.goDetail(item.strangerApplyId, item.url)}
> >
<View className="group-item-content"> <View className="group-item-content">
{item.equipmentGroupName}({item.equipmentCount}) <Image className="icon" src={item.strangerApplyIcon} />
<View>{item.strangerApplyName}</View>
</View> </View>
</View> </View>
</AtSwipeAction> </AtSwipeAction>
</View> </View>
))} ))}
</ListView> </ListView>
<View className="device-list-add-btn" onClick={this.AddGroup}>
<Image
className="icon"
src="https://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/create.png"
/>
</View>
{showModal ? (
<Modal title={name} onConfirm={this.inputConfirm} onCancel={this.cancelModal}>
<View className="film-modal">
<Input
placeholder="请输入设备组名称不超过20字"
className="film-modal-input"
maxLength={20}
value={temp.equipmentGroupName}
onInput={this.changeName}
/>
</View>
</Modal>
) : null}
</View> </View>
) )
} }
......
...@@ -33,7 +33,6 @@ class Device extends Component { ...@@ -33,7 +33,6 @@ class Device extends Component {
super(props) super(props)
const { windowHeight } = Taro.getSystemInfoSync() const { windowHeight } = Taro.getSystemInfoSync()
const id = Taro.getStorageSync('isAdd')
this.state = { this.state = {
current: 0, current: 0,
id: '1', id: '1',
...@@ -46,17 +45,13 @@ class Device extends Component { ...@@ -46,17 +45,13 @@ class Device extends Component {
} }
componentDidMount() { componentDidMount() {
Taro.setNavigationBarTitle({ Taro.setNavigationBarTitle({
title: '设备' title: '应用列表'
}) })
} }
componentDidShow() { componentDidShow() {
Taro.setNavigationBarTitle({ Taro.setNavigationBarTitle({
title: '设备' title: '应用列表'
})
const id = Taro.getStorageSync('isAdd')
this.setState({
id: this.$router.params.id || id
}) })
} }
changePage = value => { changePage = value => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment