861 lines
19 KiB
JavaScript
861 lines
19 KiB
JavaScript
// pages/user/user.js
|
||
var app = getApp()
|
||
var config = {};
|
||
var miucms = require('../../utils/miucms.js');
|
||
// 发布的状态码不要删除
|
||
// status 状态 1正常,0未发布,2关闭,-3被投诉下架,-1用户删除,-2论坛删帖,-4待审,-5到期自动下架
|
||
|
||
var WxParse = require('../../wxParse/wxParse.js');
|
||
Page({
|
||
/**
|
||
* 页面的初始数据
|
||
*/
|
||
data: {
|
||
loding: true,
|
||
showTOTOP: false,
|
||
fav_list: [],
|
||
fav_page: {
|
||
next_page: 1
|
||
},
|
||
publish_list: [],
|
||
publish_page: {
|
||
next_page: 1
|
||
},
|
||
user: {},
|
||
tab: 'fav',
|
||
fav_count: 0,
|
||
publish_count: 0,
|
||
loading: false,
|
||
status: 0,
|
||
q: '',
|
||
orderby: {
|
||
title: 'orderby',
|
||
value: "new",
|
||
name: '按最新消息排序',
|
||
show: false,
|
||
list: {
|
||
"new": '按最新消息排序',
|
||
"impression": '按印象排序'
|
||
}
|
||
},
|
||
message_page: {
|
||
next_page: 1
|
||
},
|
||
message_list: [],
|
||
impression: {},
|
||
impression_obj: {
|
||
show: false,
|
||
index: 1,
|
||
impression: 0,
|
||
uniqid: ''
|
||
},
|
||
del_obj: {
|
||
show: false,
|
||
index: 1,
|
||
uniqid: ''
|
||
},
|
||
chage_status_obj: {
|
||
show: false,
|
||
uniqid: '',
|
||
token: '',
|
||
index: 0
|
||
},
|
||
options: {},
|
||
isAuthorization: 0,
|
||
raisePopupState: false,
|
||
screen_data: {
|
||
windowHeight: 0,
|
||
totalTopHeight: 0,
|
||
statusBarHeight: 0,
|
||
titleBarHeight: 0,
|
||
},
|
||
raisePopupMessage: "", // 顶上去升起弹出框的文本
|
||
initState: false,
|
||
triggerRules: 0, // 触发规则状态 0 是未触发 1 是触发规则 1 2 是触发规则2
|
||
|
||
},
|
||
launchAppError(e) {
|
||
console.log(e.detail.errMsg)
|
||
},
|
||
onPageScroll(e) {
|
||
if (e.scrollTop > 1000 && !this.data.showTOTOP) {
|
||
this.setData({
|
||
showTOTOP: true
|
||
})
|
||
} else if (e.scrollTop < 1000 && this.data.showTOTOP) {
|
||
this.setData({
|
||
showTOTOP: false
|
||
})
|
||
}
|
||
},
|
||
/**
|
||
* 生命周期函数--监听页面加载
|
||
*/
|
||
timer: null,
|
||
onLoad: function (options) {
|
||
let that = this
|
||
this.setData({
|
||
q: options.q ? options.q : '',
|
||
tab: options.tab ? options.tab : 'fav',
|
||
options: options || {},
|
||
screen_data: app.globalData.screen_data,
|
||
})
|
||
|
||
this.get_config();
|
||
this.getNoticeNumber()
|
||
},
|
||
|
||
// 获取系统通知数量
|
||
getNoticeNumber() {
|
||
if (app.globalData.unreadMessagesState) return
|
||
miucms.count().then(res => {
|
||
this.setData({
|
||
unreadMessages: res.data.count
|
||
})
|
||
}).catch(() => {})
|
||
},
|
||
|
||
// 如果用户已经同意授权。则开始获取数据
|
||
islogin() {
|
||
wx.showLoading({
|
||
title: '加载中',
|
||
})
|
||
this.setData({
|
||
initState: true
|
||
})
|
||
this.get_config();
|
||
},
|
||
|
||
get_config: function () {
|
||
var that = this;
|
||
if (app.globalData.config.lists) {
|
||
config = app.globalData.config;
|
||
|
||
this.setData({
|
||
// user: app.globalData.user,
|
||
status: app.globalData.status,
|
||
bottomLift: app.globalData.screen_data.bottomLift
|
||
})
|
||
|
||
this.initData()
|
||
// this['get_' + this.data.tab]()
|
||
} else {
|
||
setTimeout(function () {
|
||
that.get_config()
|
||
}, 200)
|
||
}
|
||
},
|
||
|
||
initData() {
|
||
miucms.request(`${app.globalData.baseURL}/tenement/my`).then(res => {
|
||
if (res.code == 401) {
|
||
this.setData({
|
||
isAuthorization: 1,
|
||
loding: false,
|
||
})
|
||
return false
|
||
}
|
||
if (res.code == 200) {
|
||
let data = res.data
|
||
if (this.data.tab == 'fav' && data.count.fav != 0) {
|
||
this['get_' + this.data.tab]()
|
||
} else if (this.data.tab == 'publish' && data.count.post != 0) {
|
||
this['get_' + this.data.tab]()
|
||
} else {
|
||
wx.hideLoading()
|
||
}
|
||
|
||
this.setData({
|
||
landlordcertification: data.landlordcertification,
|
||
user: data.user,
|
||
initState: true,
|
||
loding: false
|
||
})
|
||
} else {
|
||
wx.hideLoading()
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: res.message
|
||
})
|
||
}
|
||
}, err => {
|
||
wx.hideLoading()
|
||
})
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面初次渲染完成
|
||
*/
|
||
onReady: function () {
|
||
|
||
},
|
||
|
||
first_in: true,
|
||
/**
|
||
* 页面相关事件处理函数--监听用户下拉动作
|
||
*/
|
||
onPullDownRefresh: function () {
|
||
let tab = this.data.tab;
|
||
if (!app.globalData.config.lists) {
|
||
wx.stopPullDownRefresh();
|
||
return false
|
||
}
|
||
|
||
if (tab == 'fav') {
|
||
this.setData({
|
||
fav_page: {
|
||
next_page: 1
|
||
},
|
||
fav_list: []
|
||
|
||
})
|
||
} else if (tab == 'message') {
|
||
this.setData({
|
||
message_page: {
|
||
next_page: 1
|
||
},
|
||
message_list: [],
|
||
})
|
||
} else if (tab == 'publish') {
|
||
this.setData({
|
||
publish_page: {
|
||
next_page: 1
|
||
},
|
||
publish_list: []
|
||
})
|
||
}
|
||
|
||
this['get_' + this.data.tab]();
|
||
wx.stopPullDownRefresh();
|
||
},
|
||
|
||
/**
|
||
* 页面上拉触底事件的处理函数
|
||
*/
|
||
onReachBottom: function () {
|
||
if (!app.globalData.config.lists) {
|
||
return false
|
||
}
|
||
if (this.data.tab == 'fav') {
|
||
this.get_fav()
|
||
} else if (this.data.tab == 'publish') {
|
||
this.get_publish()
|
||
} else {
|
||
this.get_message();
|
||
}
|
||
},
|
||
|
||
change_tab: function (e) {
|
||
this.setData({
|
||
tab: e.currentTarget.dataset.tab,
|
||
})
|
||
if (this.data[this.data.tab + '_list'].length == 0 && this.data[this.data.tab + '_page'].next_page == 1 && app.globalData.config.lists) {
|
||
// 首次点击tab,加载数据
|
||
this['get_' + this.data.tab]()
|
||
}
|
||
|
||
},
|
||
// 收藏列表
|
||
get_fav: function () {
|
||
var that = this;
|
||
if (!app.globalData.config.lists) {
|
||
return false
|
||
}
|
||
if (that.data.fav_page.next_page == 0) {
|
||
return false
|
||
}
|
||
this.setData({
|
||
loading: true
|
||
})
|
||
var sendData = Object.assign({}, this.data.options, {
|
||
session: wx.getStorageSync('session'),
|
||
page: that.data.fav_page.next_page,
|
||
q: that.data.q
|
||
})
|
||
// miucms.request(app.globalData.config.collection.init, {
|
||
miucms.request(`${app.globalData.baseURL}/tenement/my/favList`, {
|
||
page: that.data.fav_page.next_page,
|
||
}).then(data => {
|
||
wx.hideLoading()
|
||
if (data.code == 401) {
|
||
that.setData({
|
||
loding: false,
|
||
isAuthorization: 1,
|
||
})
|
||
return false
|
||
}
|
||
if (data.code == 200) {
|
||
data = data.data
|
||
|
||
let list = data.data
|
||
list.forEach(element => {
|
||
if (Array.isArray(element.rent)) element.rent = element.rent.join(' ~ ')
|
||
})
|
||
|
||
console.log(data, "0");
|
||
|
||
that.data.fav_list = that.data.fav_list.concat(list)
|
||
if (that.data.fav_list.length >= data.count) this.data.fav_page.next_page = 0
|
||
else this.data.fav_page.next_page += 1
|
||
|
||
that.setData({
|
||
fav_list: that.data.fav_list,
|
||
fav_page: this.data.fav_page,
|
||
fav_count: data.count,
|
||
loading: false,
|
||
})
|
||
|
||
} else {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: data.message,
|
||
})
|
||
}
|
||
}).catch(res => {})
|
||
},
|
||
// 发布列表
|
||
get_publish: function () {
|
||
if (!app.globalData.config.lists) {
|
||
return false
|
||
}
|
||
var that = this;
|
||
if (that.data.publish_page.next_page == 0) {
|
||
return false
|
||
}
|
||
this.setData({
|
||
loading: true
|
||
})
|
||
|
||
// miucms.request(app.globalData.config.post.init, {
|
||
miucms.request(`${app.globalData.baseURL}/tenement/my/releaseList`, {
|
||
page: this.data.publish_page.next_page
|
||
}).then(data => {
|
||
wx.hideLoading()
|
||
if (data.code == 401) {
|
||
that.setData({
|
||
isAuthorization: 1,
|
||
loding: false,
|
||
})
|
||
return false
|
||
}
|
||
if (!data.extraparam) {
|
||
data = data.data
|
||
let list = data.data
|
||
list.forEach(element => {
|
||
if (Array.isArray(element.rent)) element.rent = element.rent.join(' ~ ')
|
||
})
|
||
|
||
that.data.publish_list = that.data.publish_list.concat(list);
|
||
if (that.data.publish_list.length != 0 && that.data.publish_list.length == data.count) {
|
||
this.data.publish_page.next_page = 0;
|
||
} else {
|
||
this.data.publish_page.next_page += 1;
|
||
}
|
||
|
||
that.setData({
|
||
publish_list: that.data.publish_list,
|
||
publish_page: that.data.publish_page,
|
||
publish_count: data.count,
|
||
loading: false,
|
||
})
|
||
} else {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: data.message,
|
||
})
|
||
}
|
||
}).catch(res => {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: res,
|
||
})
|
||
})
|
||
},
|
||
add_to_fav: function (e) {
|
||
let that = this;
|
||
let uniqid = e.currentTarget.dataset.uniqid;
|
||
let token = e.currentTarget.dataset.token;
|
||
let index = e.currentTarget.dataset.index;
|
||
miucms.request(app.globalData.config.collection.operation, {
|
||
token: token,
|
||
uniqid: uniqid
|
||
}).then(data => {
|
||
that.data.fav_list.splice(index, 1);
|
||
that.setData({
|
||
fav_count: data.data.user_count,
|
||
fav_list: that.data.fav_list
|
||
})
|
||
wx.showToast({
|
||
title: data.message,
|
||
})
|
||
}).catch(res => {})
|
||
|
||
},
|
||
// 删除帖子
|
||
del_item: function (e) {
|
||
let uniqid = e.currentTarget.dataset.uniqid;
|
||
let token = e.currentTarget.dataset.token;
|
||
let index = e.currentTarget.dataset.index;
|
||
let that = this;
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: '确定删除吗?',
|
||
success: function (res) {
|
||
if (res.confirm === true) {
|
||
wx.showLoading({
|
||
title: '正在提交...',
|
||
})
|
||
miucms.request(app.globalData.config.post.delete, {
|
||
token: token,
|
||
uniqid: uniqid
|
||
}).then(data => {
|
||
wx.hideLoading()
|
||
if (data.extraparam.mode == 'right') {
|
||
// 成功
|
||
that.data.publish_list.splice(index, 1);
|
||
that.data.publish_count--;
|
||
that.setData({
|
||
publish_list: that.data.publish_list,
|
||
publish_count: that.data.publish_count
|
||
})
|
||
wx.showToast({
|
||
title: data.message,
|
||
})
|
||
} else {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: data.message,
|
||
})
|
||
}
|
||
}).catch(res => {
|
||
wx.hideLoading()
|
||
})
|
||
}
|
||
}
|
||
})
|
||
},
|
||
|
||
bindcontact: function (re) {
|
||
|
||
},
|
||
show_select: function (e) {
|
||
var title = e.currentTarget.dataset.title;
|
||
this.data.orderby.show = true;
|
||
this.setData({
|
||
orderby: this.data.orderby
|
||
})
|
||
},
|
||
select_value: function (e) {
|
||
var that = this;
|
||
let change = true;
|
||
let title = e.currentTarget.dataset.title;
|
||
let value = e.currentTarget.dataset.value;
|
||
let name = e.currentTarget.dataset.name;
|
||
if (that.data[title].value == value) {
|
||
change = false
|
||
} else {
|
||
that.data[title].value = value;
|
||
that.data[title].name = name;
|
||
}
|
||
that.data[title].show = false;
|
||
this.setData({
|
||
orderby: this.data.orderby
|
||
})
|
||
if (change) {
|
||
this.clear_data()
|
||
}
|
||
},
|
||
clear_data: function () {
|
||
this.setData({
|
||
message_page: {
|
||
next_page: 1
|
||
},
|
||
message_list: []
|
||
})
|
||
this.get_message()
|
||
},
|
||
// 留言列表
|
||
get_message: function () {
|
||
var that = this;
|
||
if (!app.globalData.config.lists) {
|
||
return false
|
||
}
|
||
if (that.data.message_page.next_page == 0) {
|
||
return false
|
||
}
|
||
this.setData({
|
||
loading: true
|
||
})
|
||
var sendData = Object.assign({}, this.data.options, {
|
||
session: wx.getStorageSync('session'),
|
||
page: that.data.message_page.next_page,
|
||
order: that.data.orderby.value,
|
||
q: that.data.q
|
||
})
|
||
miucms.request(app.globalData.config.message.lists, sendData, ).then(data => {
|
||
wx.hideLoading()
|
||
if (!data.extraparam) {
|
||
that.data.message_list = that.data.message_list.concat(data.data);
|
||
// that.data.user.newpm = data.newpm;
|
||
that.setData({
|
||
message_list: that.data.message_list,
|
||
message_page: data.page,
|
||
impression: data.impression,
|
||
user: that.data.user,
|
||
loading: false
|
||
})
|
||
app.globalData.user.newpm = data.newpm;
|
||
|
||
} else {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: data.message,
|
||
})
|
||
}
|
||
}).catch(res => {})
|
||
},
|
||
show_more_item: function (e) {
|
||
let that = this;
|
||
let index = e.currentTarget.dataset.index;
|
||
let show = that.data.message_list[index]['show_more'] ? false : true;
|
||
that.data.message_list[index]['show_more'] = show;
|
||
that.setData({
|
||
message_list: that.data.message_list
|
||
})
|
||
},
|
||
// 设置印象
|
||
set_impression: function (e) {
|
||
let that = this;
|
||
that.data.impression_obj.index = e.currentTarget.dataset.i;
|
||
that.data.impression_obj.impression = e.currentTarget.dataset.impression;
|
||
that.data.impression_obj.uniqid = e.currentTarget.dataset.uniqid;
|
||
that.data.impression_obj.show = true;
|
||
that.data.del_obj.index = e.currentTarget.dataset.i;
|
||
that.data.del_obj.uniqid = e.currentTarget.dataset.uniqid;
|
||
that.data.del_obj.token = e.currentTarget.dataset.token;
|
||
that.setData({
|
||
impression_obj: that.data.impression_obj,
|
||
del_obj: that.data.del_obj
|
||
})
|
||
},
|
||
check_item: function (e) {
|
||
var that = this;
|
||
var impression = e.currentTarget.dataset.impression;
|
||
that.data.impression_obj.impression = impression;
|
||
that.setData({
|
||
impression_obj: that.data.impression_obj
|
||
})
|
||
wx.showLoading({
|
||
title: '数据提交中',
|
||
})
|
||
miucms.request(app.globalData.config.message.setimpression, {
|
||
uniqid: that.data.impression_obj.uniqid,
|
||
impression: that.data.impression_obj.impression
|
||
}).then(data => {
|
||
if (data.extraparam.mode == 'right') {
|
||
that.data.impression_obj.show = false;
|
||
that.data.message_list[that.data.impression_obj.index]['impression'] = impression;
|
||
that.setData({
|
||
impression_obj: that.data.impression_obj,
|
||
message_list: that.data.message_list
|
||
})
|
||
}
|
||
}).catch(res => {})
|
||
},
|
||
close_alert: function (e) {
|
||
let that = this;
|
||
that.data.impression_obj.show = false;
|
||
that.data.del_obj.show = false;
|
||
that.data.orderby.show = false;
|
||
this.data.chage_status_obj.show = false;
|
||
that.setData({
|
||
impression_obj: that.data.impression_obj,
|
||
del_obj: that.data.del_obj,
|
||
orderby: that.data.orderby,
|
||
chage_status_obj: that.data.chage_status_obj
|
||
})
|
||
},
|
||
del_contacts_item: function (e) {
|
||
let that = this;
|
||
that.data.del_obj.index = e.currentTarget.dataset.i;
|
||
that.data.del_obj.uniqid = e.currentTarget.dataset.uniqid;
|
||
that.data.del_obj.token = e.currentTarget.dataset.token;
|
||
that.data.del_obj.show = true;
|
||
that.setData({
|
||
del_obj: that.data.del_obj
|
||
})
|
||
},
|
||
del_contacts: function (e) {
|
||
let that = this;
|
||
wx.showLoading({
|
||
title: '数据提交中',
|
||
})
|
||
miucms.request(app.globalData.config.message.delete, {
|
||
uniqid: that.data.del_obj.uniqid,
|
||
token: that.data.del_obj.token
|
||
}).then(data => {
|
||
if (data.extraparam.mode == 'right') {
|
||
that.data.del_obj.show = false;
|
||
that.data.impression_obj.show = false;
|
||
that.data.message_list.splice([that.data.del_obj.index], 1);
|
||
that.setData({
|
||
del_obj: that.data.del_obj,
|
||
impression_obj: that.data.impression_obj,
|
||
message_list: that.data.message_list
|
||
})
|
||
wx.showToast({
|
||
title: data.message,
|
||
})
|
||
} else {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: data.message,
|
||
})
|
||
}
|
||
|
||
}).catch(res => {})
|
||
|
||
},
|
||
send_form_id: function (e) {
|
||
return false;
|
||
miucms.request(app.globalData.config.FormidInsert, {
|
||
formid: e.detail.formId
|
||
}).then(data => {}).catch(res => {})
|
||
},
|
||
|
||
wxParseTagATap: function (e) {
|
||
var url = e.currentTarget.dataset.src;
|
||
wx.navigateTo({
|
||
url: url,
|
||
})
|
||
},
|
||
change_item_status: function (e) {
|
||
let uniqid = e.currentTarget.dataset.uniqid;
|
||
let token = e.currentTarget.dataset.token;
|
||
let index = e.currentTarget.dataset.index;
|
||
let status = e.currentTarget.dataset.status;
|
||
this.setData({
|
||
chage_status_obj: {
|
||
show: true,
|
||
uniqid: uniqid,
|
||
token: token,
|
||
index: index,
|
||
status: status
|
||
}
|
||
})
|
||
},
|
||
change_status: function () {
|
||
var that = this;
|
||
wx.showLoading({
|
||
title: '提交中',
|
||
})
|
||
miucms.request(app.globalData.config.post.status, {
|
||
token: that.data.chage_status_obj.token,
|
||
uniqid: that.data.chage_status_obj.uniqid,
|
||
status: that.data.chage_status_obj.status == 1 ? 2 : 1
|
||
}).then(data => {
|
||
// if (data.extraparam.mode == 'right') {
|
||
if (data.code == 200) {
|
||
// 成功
|
||
that.data.publish_list[that.data.chage_status_obj.index].status = data.data.status;
|
||
that.data.chage_status_obj.show = false;
|
||
that.setData({
|
||
publish_list: that.data.publish_list,
|
||
chage_status_obj: that.data.chage_status_obj
|
||
})
|
||
wx.showToast({
|
||
title: data.message,
|
||
})
|
||
} else {
|
||
wx.hideLoading()
|
||
if (data.data && data.data.message) {
|
||
// 触发规则是 不需要wx.showModal 但是 接口有data.message ,所以排除掉
|
||
} else {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: data.message
|
||
})
|
||
}
|
||
|
||
if (data.data && data.data.rule) {
|
||
this.setData({
|
||
triggerRules: data.data.rule,
|
||
appealtoken: data.data.appealtoken
|
||
})
|
||
}
|
||
|
||
this.close_alert()
|
||
}
|
||
}).catch(res => {})
|
||
},
|
||
// 已租出提示
|
||
have_rent_info: function () {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: '该房源信息已出租或已失效',
|
||
})
|
||
},
|
||
// 点击顶上去
|
||
bindtopUp(e) {
|
||
let token = e.currentTarget.dataset.token
|
||
let index = e.currentTarget.dataset.index
|
||
let isding = e.currentTarget.dataset.isding
|
||
if (isding == 1) {
|
||
this.setData({
|
||
raisePopupMessage: "今天已顶过啦,明天再来吧!",
|
||
raisePopupState: true,
|
||
isdingState: 1
|
||
})
|
||
setTimeout(() => {
|
||
this.setData({
|
||
raisePopupState: false,
|
||
})
|
||
setTimeout(() => {
|
||
this.setData({
|
||
isdingState: 0
|
||
})
|
||
}, 500)
|
||
}, 1500)
|
||
|
||
return
|
||
}
|
||
miucms.request(app.globalData.baseURL + "/tenement/post/ding", {
|
||
token
|
||
}).then(res => {
|
||
if (res.code == 200) {
|
||
if (isding == 0) {
|
||
this.data.publish_list[index].isding = 1
|
||
} else {
|
||
this.data.publish_list[index].isding = 0
|
||
}
|
||
this.setData({
|
||
raisePopupMessage: res.message,
|
||
raisePopupState: true,
|
||
publish_list: this.data.publish_list
|
||
})
|
||
setTimeout(() => {
|
||
this.setData({
|
||
raisePopupState: false
|
||
})
|
||
}, 1500)
|
||
return
|
||
}
|
||
this.setData({
|
||
raisePopupMessage: res.message,
|
||
raisePopupState: true,
|
||
isdingState: 1
|
||
})
|
||
setTimeout(() => {
|
||
this.setData({
|
||
raisePopupState: false,
|
||
})
|
||
setTimeout(() => {
|
||
this.setData({
|
||
isdingState: 0
|
||
})
|
||
}, 500)
|
||
}, 1500)
|
||
})
|
||
},
|
||
|
||
// 撤销审核
|
||
cancelAudit(e) {
|
||
let that = this
|
||
let {
|
||
token,
|
||
index
|
||
} = e.currentTarget.dataset
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: '确认撤销审核?',
|
||
success(res) {
|
||
if (res.confirm) {
|
||
miucms.request(app.globalData.baseURL + '/tenement/appeal/revoke', {
|
||
token
|
||
}).then(res => {
|
||
if (res.code == 200) {
|
||
that.data.publish_list[index].status = 0
|
||
that.setData({
|
||
publish_list: that.data.publish_list
|
||
})
|
||
wx.showToast({
|
||
title: res.message,
|
||
})
|
||
} else if (res.code == 201) {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: res.message
|
||
})
|
||
}
|
||
})
|
||
}
|
||
}
|
||
})
|
||
},
|
||
unreadMessagesalter(e) {
|
||
if (this.data.isAuthorization == 1) {
|
||
wx.showModal({
|
||
title: '提示',
|
||
content: "权限受限,请先授权"
|
||
})
|
||
return
|
||
}
|
||
wx.navigateTo({
|
||
url: '/pages/messageCenter/messageCenter',
|
||
success: () => {
|
||
if (this.data.unreadMessages > 0) {
|
||
this.setData({
|
||
unreadMessages: 0
|
||
})
|
||
}
|
||
app.globalData.unreadMessages = 0
|
||
}
|
||
})
|
||
},
|
||
|
||
// 跳转我要申述
|
||
goAppeal() {
|
||
wx.navigateTo({
|
||
url: '/pages/appeal/appeal?appealtoken=' + this.data.appealtoken,
|
||
})
|
||
},
|
||
|
||
// 点击关闭
|
||
triggerRulesClose() {
|
||
this.setData({
|
||
triggerRules: 0
|
||
})
|
||
},
|
||
|
||
// 上架触发规则2 弹窗点击下架房源
|
||
goUser() {
|
||
this.triggerRulesClose()
|
||
},
|
||
// 上架触发规则3 点击右上角叉叉
|
||
WechatIDClose() {
|
||
this.triggerRulesClose()
|
||
},
|
||
|
||
// 上架触发规则3中的图片预览
|
||
methodPreview() {
|
||
wx.previewImage({
|
||
urls: ["https://oss.gter.net/attachment/Zvt57TuJSUvkyhw-xG7Y2l-T_pIqc3nqqsgFptxhXa6RWi26P-BuTQdCF7eV7tkb8MVYZjQ0Mjk~"],
|
||
current: "https://oss.gter.net/attachment/Zvt57TuJSUvkyhw-xG7Y2l-T_pIqc3nqqsgFptxhXa6RWi26P-BuTQdCF7eV7tkb8MVYZjQ0Mjk~"
|
||
})
|
||
},
|
||
|
||
// 授权成功后需要处理的事件
|
||
authorizationSuccess() {
|
||
this.setData({
|
||
initState: false
|
||
})
|
||
},
|
||
|
||
// 跳转到认证 介绍
|
||
goApprove() {
|
||
let url = this.data.landlordcertification
|
||
wx.navigateTo({
|
||
url: `/pages/webViewwebweb/index?url=${url}`,
|
||
})
|
||
}
|
||
}) |