You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.7 KiB
78 lines
1.7 KiB
// pages/resource/list/index.js
|
|
import { config } from '../../../config.js'
|
|
Component({
|
|
/**
|
|
* 组件的属性列表
|
|
*/
|
|
properties: {
|
|
list:{
|
|
type:Array,
|
|
value:[],
|
|
},
|
|
tp:{
|
|
type:String,
|
|
value:'1'
|
|
},
|
|
apartmentId:String
|
|
},
|
|
|
|
/**
|
|
* 组件的初始数据
|
|
*/
|
|
data: {
|
|
titlePic:config.api_url + "/image/head.jpg"
|
|
},
|
|
|
|
/**
|
|
* 组件的方法列表
|
|
*/
|
|
methods: {
|
|
|
|
detail:function(e){
|
|
if (!e.currentTarget.dataset.id){
|
|
return;
|
|
}
|
|
|
|
if(this.properties.tp == '1'){ // 资源列表
|
|
if(e.currentTarget.dataset.url){ // 跳转网站
|
|
wx.navigateTo({
|
|
url: '/pages/resource/navigate/index?url=' + encodeURIComponent(e.currentTarget.dataset.url)
|
|
})
|
|
|
|
return;
|
|
}else if(e.currentTarget.dataset.appid){ // 跳转小程序
|
|
wx.navigateToMiniProgram({
|
|
appId: e.currentTarget.dataset.appid,
|
|
// path: 'page/index/index?id=123',
|
|
extraData: {
|
|
// foo: 'bar'
|
|
},
|
|
envVersion: 'release',
|
|
success(res) {
|
|
// 打开成功
|
|
}
|
|
})
|
|
return;
|
|
}else{ // 查看详情
|
|
wx.navigateTo({
|
|
url: '/pages/resource/detail/index?id=' + e.currentTarget.dataset.id
|
|
})
|
|
return;
|
|
}
|
|
}else if(this.properties.tp == '2'){ // 房屋列表
|
|
wx.navigateTo({
|
|
url: '/pages/topics/rent/detail/index?id=' + e.currentTarget.dataset.id
|
|
})
|
|
return;
|
|
}
|
|
|
|
|
|
},
|
|
onTap:function(){
|
|
wx.navigateTo({
|
|
url: '/pages/resource/demand/index?type=rent&id=' + this.properties.apartmentId
|
|
})
|
|
}
|
|
|
|
}
|
|
})
|
|
|