Commit 996fcd8e by hanjixin

对接应用接口

parent 99d4d3e8
......@@ -327,7 +327,7 @@ class UsersApi extends ApiClient {
/** 获取应用列表 */
getApplicationList(page: number = 1, limit: number = 10) {
return this.request({
method: 'post',
method: 'get',
url: `/application/get/list?p=${page}&c=${limit}`
})
}
......
......@@ -49,6 +49,18 @@
color: #333;
font-size: 30px;
.group-item-content {
display: flex;
align-items: center;
.icon {
height: 80px;
width: 80px;
margin-right: 10px;
margin-left: 5px;
}
}
&::after {
content: '';
position: absolute;
......
......@@ -67,6 +67,7 @@ class AppLication extends Component {
}
async componentWillMount() {
Taro.setNavigationBarTitle({ title: '应用列表' })
this.getDate()
}
onShareAppMessage(e) {
......@@ -79,7 +80,7 @@ class AppLication extends Component {
async getDate() {
this.cancelModal()
// this.props.getFilmListData(this.page)
api.common.getGroupList().then(res => {
api.common.getApplicationList(this.page).then(res => {
const list = res.list
this.setState({
list: list
......@@ -147,7 +148,7 @@ class AppLication extends Component {
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'
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 {
>
<View
className="group-item"
onClick={() => this.goDetail(item.equipmentGroupId, item.equipmentGroupName)}
onClick={() => this.goDetail(item.strangerApplyId, item.url)}
>
<View className="group-item-content">
{item.equipmentGroupName}({item.equipmentCount})
<Image className="icon" src={item.strangerApplyIcon} />
<View>{item.strangerApplyName}</View>
</View>
</View>
</AtSwipeAction>
</View>
))}
</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>
)
}
......
......@@ -33,7 +33,6 @@ class Device extends Component {
super(props)
const { windowHeight } = Taro.getSystemInfoSync()
const id = Taro.getStorageSync('isAdd')
this.state = {
current: 0,
id: '1',
......@@ -46,17 +45,13 @@ class Device extends Component {
}
componentDidMount() {
Taro.setNavigationBarTitle({
title: '设备'
title: '应用列表'
})
}
componentDidShow() {
Taro.setNavigationBarTitle({
title: '设备'
})
const id = Taro.getStorageSync('isAdd')
this.setState({
id: this.$router.params.id || id
title: '应用列表'
})
}
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