|
|
@@ -72,19 +72,7 @@ Page({
|
|
|
swiperBannerList: bannerList[0].banner
|
|
|
});
|
|
|
},
|
|
|
- //跳转聊天
|
|
|
- toLinkUpPage(e) {
|
|
|
- const {
|
|
|
- timdialogid,
|
|
|
- fdatastatus
|
|
|
- } = e.currentTarget.dataset;
|
|
|
- this.setData({
|
|
|
- ifShowCommunicationOfNumber: false
|
|
|
- })
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/chatRoom/dialogbox?id=' + timdialogid + '&fdatastatus=' + fdatastatus,
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
/* tabs切换接口 */
|
|
|
getList() {
|
|
|
if (this.data.active == 0) return this.getSupplyAndDemand();
|
|
|
@@ -126,49 +114,7 @@ Page({
|
|
|
'tabbarList[3].fcount': getApp().globalData.msgFcount
|
|
|
})
|
|
|
},
|
|
|
- /* 显示沟通数量 */
|
|
|
- showCommunicationOfNumber(e) {
|
|
|
- let {
|
|
|
- item
|
|
|
- } = e.currentTarget.dataset;
|
|
|
- let imdialogs = [];
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "customer.supplyanddemand.supplyanddemand",
|
|
|
- "method": "query_mysupplyanddemandMain",
|
|
|
- "content": {
|
|
|
- "tsupplyanddemandid": item.tsupplyanddemandid
|
|
|
- }
|
|
|
- }, false).then(res => {
|
|
|
- console.log('沟通列表', res)
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- imdialogs = res.data[0].imdialogs;
|
|
|
- if (imdialogs.length != 0) {
|
|
|
- for (let i = 0; i < imdialogs.length; i++) {
|
|
|
- let checkdate = imdialogs[i].createdate;
|
|
|
- if (checkdate != null && checkdate != undefined) imdialogs[i].createdate = checkdate.slice(0, checkdate.lastIndexOf('.'));
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- ifShowCommunicationOfNumber: true,
|
|
|
- imdialogs
|
|
|
- })
|
|
|
- } else {
|
|
|
- wx.showToast({
|
|
|
- title: '暂无对话信息',
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
|
|
|
- },
|
|
|
- endShowCommunicationOfNumber() {
|
|
|
- this.setData({
|
|
|
- ifShowCommunicationOfNumber: false
|
|
|
- })
|
|
|
- },
|
|
|
postDemand() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/announceDemand/index',
|
|
|
@@ -178,33 +124,6 @@ Page({
|
|
|
stop() {
|
|
|
/* 所有供需列表中,已过期或已解决 不做操作 */
|
|
|
},
|
|
|
- toLinkUp(e) {
|
|
|
- const {
|
|
|
- tsupplyanddemandid,
|
|
|
- tenterprise_userid
|
|
|
- } = e.currentTarget.dataset.item;
|
|
|
- if (tenterprise_userid == wx.getStorageSync('userData').userid) return wx.showToast({
|
|
|
- title: '无法与自己对话',
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "customer.supplyanddemand.supplyanddemand",
|
|
|
- "method": "OpenImDialog",
|
|
|
- "content": {
|
|
|
- "tsupplyanddemandid": tsupplyanddemandid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log("创建聊天", res)
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/chatRoom/dialogbox?id=' + res.data[0].timdialogid,
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
/* 供需下架 */
|
|
|
soldOut(e) {
|
|
|
const that = this;
|
|
|
@@ -285,16 +204,6 @@ Page({
|
|
|
this.InitializeDataPaging();
|
|
|
this.getList();
|
|
|
},
|
|
|
- /* 跳转商品详情页 */
|
|
|
- jumpForDetails(e) {
|
|
|
- const {
|
|
|
- index
|
|
|
- } = e.currentTarget.dataset,
|
|
|
- id = this.data.productList[index].tsupplyanddemandid;
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/tabbar-pages/supplyAndDemand/particulars?tsupplyanddemandid=' + id + '&type=' + this.data.active,
|
|
|
- })
|
|
|
- },
|
|
|
/* 我的需求 */
|
|
|
myNeed() {
|
|
|
//全部加载完成退出请求
|
|
|
@@ -332,16 +241,6 @@ Page({
|
|
|
pageTotal: res.pageTotal,
|
|
|
});
|
|
|
},
|
|
|
- /* 我的需求编辑按钮跳转 */
|
|
|
- productEdit(e) {
|
|
|
- const {
|
|
|
- index
|
|
|
- } = e.currentTarget.dataset
|
|
|
- const data = JSON.stringify(this.data.productList[index])
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/announceDemand/index?data=' + data,
|
|
|
- })
|
|
|
- },
|
|
|
/* 我的需求搜索框获得焦点 */
|
|
|
needSearchFocus() {
|
|
|
this.setData({
|
|
|
@@ -383,12 +282,7 @@ Page({
|
|
|
isOnShow: true
|
|
|
})
|
|
|
},
|
|
|
- /* 阻止刷新列表 */
|
|
|
- stopOnShow() {
|
|
|
- this.setData({
|
|
|
- isOnShow: false
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面卸载
|