diff --git a/src/app.wpy b/src/app.wpy index d326e23..29b8d48 100644 --- a/src/app.wpy +++ b/src/app.wpy @@ -216,6 +216,7 @@ subPackages: [ 'myDynamic', 'logoutDefault', 'ImageCropper', + 'myDynamicDetail', ] }, { diff --git a/src/components/dynamicDiscuss.wpy b/src/components/dynamicDiscuss.wpy index 7351958..86eb63c 100644 --- a/src/components/dynamicDiscuss.wpy +++ b/src/components/dynamicDiscuss.wpy @@ -263,11 +263,11 @@ 复制 | - 删除 + 删除 | - 删除 + 删除 @@ -363,7 +363,8 @@ inputVal: '', showReplyView: true, inputBoxH: 86, - modalName: '' + modalName: '', + userInfo: {} }, mixins: [https, base], methods: { @@ -503,11 +504,35 @@ }, jumpPath(url) { wx.navigateTo({url: url}) - } + }, + // 评论删除 + deleteComment(e, index) { + let vm = this + if (vm.throttle) { + vm.throttle = false + vm.$delete({url: `${service.host}/moment/comment/${e.comment_id}/delete`}).then(({code, data}) => { + // const pages = getCurrentPages() + // const prevPage = pages[pages.length - 2] // 上一页// 调用上一个页面的setData 方法,将数据存储 + // console.log(prevPage.data, prevPage.data.list, '===') + // prevPage.data.list.splice(index, 1) + vm.$showToast('删除成功') + vm.$emit('deleteComment', index) + // wx.navigateBack({ + // delta: 1 + // }) + wx.hideLoading() + vm.throttle = true + }).catch(() => { + vm.throttle = true + wx.hideLoading() + }) + } + } }, - created() { + ready() { let vm = this vm.userInfo = wx.getStorageSync('userInfo') + console.log(vm.userInfo, '333') } }) diff --git a/src/components/dynamicList.wpy b/src/components/dynamicList.wpy index 48102a1..7310746 100644 --- a/src/components/dynamicList.wpy +++ b/src/components/dynamicList.wpy @@ -203,7 +203,7 @@ scroll-view { + + { + navigationBarTitleText: '动态详情', + backgroundColorTop: '#ffffff', + backgroundColorBottom: '#ffffff', + usingComponents: { + dynamicList: '~@/components/dynamicList', + dynamicOperation: '~@/components/dynamicOperation', + dynamicDiscuss: '~@/components/dynamicDiscuss', + } + } + diff --git a/src/pages/users/selfTextarea.wpy b/src/pages/users/selfTextarea.wpy index 79e235a..c0ab316 100644 --- a/src/pages/users/selfTextarea.wpy +++ b/src/pages/users/selfTextarea.wpy @@ -148,7 +148,17 @@ 取消 - 确认 + 确认 + + + + + + 删除自定义标签 + + + 取消 + 确认 @@ -274,7 +284,13 @@ import base from '../../mixins/base' for (let i = 140; i < 200; i++) { this.heightArray[0].push(i) } - this.GetAddress() + if (e.text == '兴趣标签') { + this.GetAllLabel() + } else if (e.text == '期望对方' || e.text == '编辑资料') { + this.GetAddress() + } else { + this.getuser() + } if (e.text) { wx.setNavigationBarTitle({ title: e.text @@ -306,6 +322,22 @@ import base from '../../mixins/base' this.getuser() }) }, + GetAllLabel() { // 获取所有标签 + let that = this + that.$get({url: `${service.host}/interest/labels/list`}).then(({code, data}) => { + that.hobbiesList = data.d_labels + that.customHobbiesList = data.c_labels + // that.provinces = data + // that.provinces.forEach(item => { + // if (item.Name == '中国') { + // item.Children.forEach(sonItem => { + // that.regionArray.push(sonItem.Name) + // }) + // } + // }) + this.getuser() + }) + }, getuser() { let that = this that.$get({url: `${service.host}/user/profile`}).then(({code, data}) => { @@ -326,44 +358,20 @@ import base from '../../mixins/base' that.tscList = [] that.submitList = [] } - that.customHobbiesList = wx.getStorageSync('customHobList') || [] // 兴趣爱好有值 if (data.interest_label && data.interest_label.length > 0) { that.hobbiesList = that.hobbiesList.map(item => { - return { - title: item.title, - show: data.interest_label.includes(item.title) - } - }) - let objectValue = that.hobbiesList.map(item => { return item.title }) - let newHobbies = data.interest_label.filter(item => { - console.log(objectValue.includes(item), 'obj===') - return !objectValue.includes(item) - }) - console.log(objectValue, newHobbies, 'newHobbies===') - - if (newHobbies && newHobbies.length > 0) { - // newHobbies = newHobbies.map(item => { - // return { - // title: item, - // show: true - // } - // }) - that.customHobbiesList = [...new Set([...that.customHobbiesList, ...newHobbies])] - that.customHobbiesList = that.customHobbiesList.map(item => { - return { - title: item, - show: data.interest_label.includes(item) - } - }) - } - } else { - that.customHobbiesList = that.customHobbiesList.map(item => { return { title: item, - show: false + show: data.interest_label.includes(item) } }) + that.customHobbiesList = that.customHobbiesList.map(item => { + return { + title: item, + show: data.interest_label.includes(item) + } + }) } try { @@ -397,10 +405,7 @@ import base from '../../mixins/base' } this.heightArray = [this.heightArray[0], staturePickerArr] this.heightArray[1].forEach((item, index) => { - console.log(item, statureArr) if (item == statureArr[1].replace('cm', '')) { - console.log('----9988') - console.log(index, 'index===') this.heightIndex = [this.heightIndex[0], index] } }) @@ -719,28 +724,34 @@ import base from '../../mixins/base' cancel() { this.modalName = '' }, - changeOccupation() { + delCustomHob(item, index) { // 删除标签 + this.customName = item.title + this.modalName = 'customDel' + }, + changeOccupation(type) { let that = this let data = { - customName: that.customName + name: that.customName } + if (type == '0') { // 添加 + that.$post({url: `${service.host}/interest/labels/add`, data}).then(({code, data}) => { + // that.getuser() + that.customHobbiesList.push({ + title: that.customName, + show: false + }) + that.modalName = '' + }) + } else { // 删除 + that.$post({url: `${service.host}/interest/labels/delete`, data}).then(({code, data}) => { + that.customHobbiesList = that.customHobbiesList.filter(item => { + return item.title != that.customName + }) + that.modalName = '' + }) + } + }, - that.customHobbiesList.push({title: that.customName, show: false}) - let list = that.customHobbiesList.map(item => item.title) - wx.setStorageSync('customHobList', list) - that.modalName = '' - // that.$post({url: `${service.host}/addresses/v2`}, data).then(({code, data}) => { - // that.getuser() - // that.modalName = '' - // }) - }, - delCustomHob(item, index) { - let that = this - that.customHobbiesList.splice(index, 1) - let list = that.customHobbiesList.map(item => item.title) - wx.setStorageSync('customHobList', list) - console.log(that.customHobbiesList, 'that.customHobbiesList==') - }, changeSelectHob(item) { console.log('22') return this.selectHobbiesList.includes(item) diff --git a/src/utils/im.js b/src/utils/im.js index 139b07d..b211adf 100644 --- a/src/utils/im.js +++ b/src/utils/im.js @@ -123,7 +123,7 @@ const IM = (account, token) => { return item }) } else { - teamCount.push({id: e.to, unread: notiTypeData.muteTeam === false ? 0 : 1}) + teamCount.push({id: e.to, unread: notiTypeData.muteTeam ? 0 : 1}) } wx.setStorageSync('teamsSessionsCount', teamCount) } @@ -170,10 +170,17 @@ const IM = (account, token) => { }) nim.on('myTeamMembers', function (e) { + let pages = getCurrentPages() + let currentPage = pages[pages.length - 1] + if (currentPage.route == 'pages/news/groupChitchatDetail') { + return + } let muteNotList = [] + console.log(e, 'e===') if (e && e.length > 0) { e.forEach((i) => { if (i.muteTeam) { + console.log(i, 'i====') muteNotList.push({ teamId: i.teamId, muteNotiType: i.muteTeam ? 1 : 0, @@ -182,6 +189,7 @@ const IM = (account, token) => { } }) setTimeout(() => { + console.log(muteNotList, '99399') wx.setStorageSync('muteNotList', muteNotList) }) }