diff --git a/src/components/cuCustom.wpy b/src/components/cuCustom.wpy
index 2fbfc32..3ed89f3 100644
--- a/src/components/cuCustom.wpy
+++ b/src/components/cuCustom.wpy
@@ -2,7 +2,7 @@
.m_search {
width: 446rpx;
height: 64rpx;
- background-color: #F8F8F8;
+ background-color: #f8f8f8;
border-radius: 100rpx;
padding: 0 22rpx;
margin-left: 30rpx;
@@ -15,14 +15,15 @@
}
-
-
+
+
-
+
+
diff --git a/src/components/recommendDialog.wpy b/src/components/recommendDialog.wpy
index facac05..ff5ba28 100644
--- a/src/components/recommendDialog.wpy
+++ b/src/components/recommendDialog.wpy
@@ -155,9 +155,9 @@
-
+
- 是否确定申请“{{title}}”?
+ 是否确定申请“{{title}}”?
@@ -165,10 +165,10 @@
-
+
- 你的资料正在审核中
- 如有紧急,请拨打18922809346
+ 你的资料正在审核中
+ 如有紧急,请拨打18922809346
diff --git a/src/components/selectCity.wpy b/src/components/selectCity.wpy
index c492c0c..e91c102 100644
--- a/src/components/selectCity.wpy
+++ b/src/components/selectCity.wpy
@@ -64,15 +64,7 @@ wepy.component({
methods: {
GetAddress() {
let vm = this
- let url = ``
- console.log(vm.selfTextareaShow, vm.multiIndex, '88888888888888888')
- if (vm.selfTextareaShow) {
- url = `${service.host}/addresses`
- } else {
- url = `${service.host}/address/country/list`
- }
-
- vm.$get({url: url}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/address/country/list`}).then(({code, data}) => {
vm.provinces = data
console.log(vm.provinces, 'vm.provinces')
if (vm.AddressValue.length > 0) {
@@ -101,7 +93,7 @@ wepy.component({
for (let item of vm.provinces[vm.provinceId].Children) {
vm.objectArray[1].push(item.Name)
}
- for (let item of vm.provinces[vm.cityId].Children[vm.selfTextareaShow ? 0 : 18].Children) {
+ for (let item of vm.provinces[vm.cityId].Children[18].Children) {
vm.objectArray[2].push(item.Name)
}
}
diff --git a/src/components/uploadVideo.wpy b/src/components/uploadVideo.wpy
new file mode 100644
index 0000000..cd9494a
--- /dev/null
+++ b/src/components/uploadVideo.wpy
@@ -0,0 +1,248 @@
+
+
+
+
+
+ 拍摄
+ 从手机相册选择
+ 取消
+
+
+
+
+
diff --git a/src/mixins/base.js b/src/mixins/base.js
index 5970f1c..2d9f432 100644
--- a/src/mixins/base.js
+++ b/src/mixins/base.js
@@ -8,6 +8,10 @@ export default {
},
methods: {
+ // 跳转事件校验是否已经完善注册资料
+ $signInVerify() {
+ return wx.getStorageSync('userInfo')
+ },
$callPhone(mobile) {
wx.makePhoneCall({
phoneNumber: mobile,
diff --git a/src/mixins/https.js b/src/mixins/https.js
index dc6ec62..6817fbe 100644
--- a/src/mixins/https.js
+++ b/src/mixins/https.js
@@ -128,9 +128,9 @@ export default {
if (res.confirm) {
vm.errorOne = 1
wx.hideLoading()
- wx.navigateBack({
- delta: 1
- })
+ // wx.navigateBack({
+ // delta: 1
+ // })
}
}
})
diff --git a/src/pages/dynamic/dynamicDetail.wpy b/src/pages/dynamic/dynamicDetail.wpy
index 23cc3bf..94034a9 100644
--- a/src/pages/dynamic/dynamicDetail.wpy
+++ b/src/pages/dynamic/dynamicDetail.wpy
@@ -9,9 +9,9 @@ page {
-
+
-
+
@@ -390,5 +488,9 @@ wepy.page({
navigationBarTitleText: '编辑动态',
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
+usingComponents: {
+uploadPic: '~@/components/uploadPic',
+uploadVideo: '~@/components/uploadVideo',
+}
}
diff --git a/src/pages/dynamic/searchPopular.wpy b/src/pages/dynamic/searchPopular.wpy
index 69d8903..8e73db8 100644
--- a/src/pages/dynamic/searchPopular.wpy
+++ b/src/pages/dynamic/searchPopular.wpy
@@ -84,7 +84,7 @@ page {
-
+
想要隐身访问Ta?
@@ -696,62 +620,25 @@ page {
开启隐身访问
-
+
-
-
-
-
-
-
-
-
- 取消{{profile_courtship.sex == 1?'他':'她'}}为好友
-
-
- 对{{profile_courtship.sex == 1?'他':'她'}}不感兴趣
-
-
-
-
- 举报或者拉黑
-
-
-
+
+
+ 取消{{userInfo.base_profile.sex == 1?'他':'她'}}为好友
+
+
- 举报
+ 拉黑并屏蔽
+
+
+
+ 举报用户
-
-
-
-
- 推荐用户
-
-
-
-
-
- {{item.nickname}}
-
- {{item.profile.age}}岁
-
-
- {{item.profile.city}}
-
-
-
-
-
- 查看更多
-
-
+
@@ -759,9 +646,10 @@ page {
-
+
+
-
+
@@ -773,7 +661,7 @@ page {
-
+
@@ -788,11 +676,16 @@ page {
-
-
- 拉黑并屏蔽
- 举报用户
- 取消
+
+
+
+ 夸夸{{userInfo.base_profile.nickname}},引起Ta的注意吧
+ 最多选3个,每天只有1次夸夸Ta的机会
+
+ {{item.label}}
+
+ 确定
+ 换一批
@@ -801,23 +694,22 @@ page {
- {{userType != 'marriage' ? '打个招呼吧' : '添加单身'}}
+ 打个招呼吧
- 非会员每天只有3次打招呼
+ 非会员每天只有3次打招呼
-
- {{message}}
- {{message.length}} / 60
-
+
+ {{message.length}} / 60
+
换一个
-
+
取消
发送
- 还剩{{userData.surplus_num}}次,成为会员将不限制打招呼
+ 还剩{{userData.surplus_num}}次,成为会员将不限制打招呼
@@ -840,6 +732,7 @@ page {
+
@@ -854,12 +747,21 @@ wepy.page({
mixins: [https, base],
data: {
+ loginShow: false,
+ waitBullets: [],
+ showingBullets: [],
+ lines: 3,
+ currentLine: 1,
+ isInfinite: true,
+ timer: null,
+
token: '',
userId: '',
userType: '',
id: '',
message: '', // 打招呼信息
loading: false,
+ throttle: true,
modalName: '', // 弹框
pairedScore: 0,
userData: {}, // 自己的数据信息
@@ -870,6 +772,9 @@ wepy.page({
{name: '真人未认证', activeName: '真人已认证', activeIcon: 'https://image.fulllinkai.com/202407/30/8f2700a35614c24f578ac6b5bf6e74c6.png', active: false, icon: 'https://image.fulllinkai.com/202202/23/c8a7f144e6eb593a5c494e700a212dac.png'},
{name: '学历未认证', activeName: '学历已认证', activeIcon: 'https://image.fulllinkai.com/202407/30/8f2700a35614c24f578ac6b5bf6e74c6.png', active: false, icon: 'https://image.fulllinkai.com/202202/23/c6e970db876230df0411eddd49d9e58f.png'}
],
+ praiseList: [],
+ praisePage: 1,
+ selectPraise: [],
interestLabel: [],
showCondition: false,
conditionArr: [],
@@ -880,60 +785,166 @@ wepy.page({
posterConfig: null // 分享海报数据
},
methods: {
- getUserData () {
+ // 夸夸数据列表
+ getPraiseList () {
let vm = this
- vm.$post({url: `${service.host}/user/v3`}).then(({code, data}) => {
+ let list = []
+ vm.$get({url: `${service.host}/label/user/${vm.id}/list?page=${vm.praisePage}`}).then(({code, data}) => {
if (code == 0) {
- vm.userData = data
+ console.log(data, '夸夸列表')
+ if (data.data && data.data.length > 0) {
+ // 已选中的夸夸重新赋值到数组中
+ vm.selectPraise.forEach((j) => {
+ list.unshift(j)
+ })
+ data.data.forEach((item) => {
+ list.push({label: item.label, state: false})
+ })
+ let res = new Map()
+ vm.praiseList = JSON.parse(JSON.stringify(list.filter((list) => !res.has(list.label) && res.set(list.label, 1))))
+ }
+ if (data.data && data.data.length >= 9) {
+ vm.praisePage++
+ } else {
+ vm.praisePage = 1
+ }
}
wx.hideLoading()
}).catch(() => {
wx.hideLoading()
})
},
+ // 夸夸TA换一批
+ refresh() {
+ let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
+ vm.getPraiseList()
+ },
+ // 用户已有夸夸弹幕数据
+ getUserPraise () {
+ let vm = this
+ vm.$get({url: `${service.host}/label/user/${vm.id}/logs`}).then(({code, data}) => {
+ if (code == 0) {
+ console.log(data, '夸夸列表1')
+ if (data && data.length != 0) {
+ vm.waitBullets = []
+ data.forEach(item => {
+ let text = item.content.join(' ')
+ vm.waitBullets.push({
+ id: Math.random() + Math.random(),
+ name: text,
+ img: item.photo,
+ line: 0
+ })
+ })
+ }
+ }
+ wx.hideLoading()
+ }).catch(() => {
+ wx.hideLoading()
+ })
+ },
+ // 保存夸夸Ta
+ sendPraise() {
+ let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
+ let list = []
+ vm.selectPraise.forEach((item) => {
+ list.push(item.label)
+ })
+ if (list.length == 0) {
+ vm.$showToast('请选择至少1个夸夸Ta')
+ return
+ }
+ let data = {
+ labels: list
+ }
+ if (vm.throttle) {
+ vm.throttle = false
+ vm.$showLoading('')
+ vm.$post({url: `${service.host}/label/user/${vm.id}`, data}).then(({code, data}) => {
+ if (code == 0) {
+ vm.$showToast('夸夸Ta已发送')
+ vm.modalName = ''
+ }
+ vm.throttle = true
+ wx.hideLoading()
+ }).catch(() => {
+ vm.throttle = true
+ wx.hideLoading()
+ })
+ }
+ },
+ showNextBullet() {
+ let vm = this
+ if (vm.waitBullets && vm.waitBullets.length == 0) {
+ return
+ }
+ // 先确定弹道,跟上一个弹道错开即可
+ vm.currentLine = (vm.currentLine % vm.lines) + 1
+ // 从等待集合里取出第一个
+ let currentBullet = JSON.parse(JSON.stringify(vm.waitBullets.shift()))
+ // vm.isInfinite &&
+ vm.waitBullets.push({
+ id: Math.random() + Math.random(),
+ name: currentBullet.name,
+ img: currentBullet.img,
+ isWished: false,
+ line: 0
+ })
+ // 设置弹幕的弹道
+ currentBullet.line = vm.currentLine
+ // 弹幕放进显示集合里,弹幕开始滚动
+ vm.showingBullets.push(currentBullet)
+ },
getDetail() {
let vm = this
vm.$showLoading('加载中...')
- vm.$get({url: `${service.host}/users/119488/v2`}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/other/user/${vm.id}`}).then(({code, data}) => {
if (code === 0) {
wx.setNavigationBarTitle({
- title: data.nickname ? data.nickname : data.name
+ title: data.base_profile ? data.base_profile.nickname : '单身交友'
})
- if (data.profile_courtship) {
- data.profile_courtship.city = data.profile_courtship.city ? data.profile_courtship.city.replace('市', '') : ''
- data.profile_courtship.resident_city = data.profile_courtship.resident_city ? data.profile_courtship.resident_city.replace('市', '人') : ''
- if (data.profile_courtship.stature) {
- data.profile_courtship.stature = data.profile_courtship.stature == 139 ? '139cm以下' : data.profile_courtship.stature + 'cm'
+ if (data.base_profile) {
+ data.base_profile.city = data.base_profile.city ? data.base_profile.city.replace('市', '') : ''
+ data.base_profile.resident_city = data.base_profile.resident_city ? data.base_profile.resident_city.replace('市', '人') : ''
+ if (data.base_profile.stature) {
+ data.base_profile.stature = data.base_profile.stature == 139 ? '139cm以下' : data.base_profile.stature + 'cm'
}
- if (data.profile_courtship.weight) {
- data.profile_courtship.weight = data.profile_courtship.weight == 39 ? '39kg以下' : data.profile_courtship.weight + 'kg'
+ if (data.base_profile.weight) {
+ data.base_profile.weight = data.base_profile.weight == 39 ? '39kg以下' : data.base_profile.weight + 'kg'
}
- vm.profile_courtship = data.profile_courtship
- vm.profile_courtship.industry = data.industry
- vm.profile_courtship.industry_sub = data.industry_sub
- vm.interestLabel = data.profile_courtship.interest_label ? JSON.parse(data.profile_courtship.interest_label) : []
+ vm.interestLabel = data.other_profile.interest_label
}
- if (data.is_approved == '1') { // 实名
+ if (data.approve_profile.is_approved == '1') { // 实名
vm.approveList[0].active = true
}
- if (data.is_real_approved == '1') { // 真人
+ if (data.approve_profile.is_real_approved == '1') { // 真人
vm.approveList[1].active = true
}
- if (data.is_educate_approved == '1') { // 学历
+ if (data.approve_profile.is_educate_approved == '1') { // 学历
vm.approveList[2].active = true
- vm.approveList[2].activeName = data.profile_courtship.degree ? `${data.profile_courtship.degree}已认证` : '已认证'
+ vm.approveList[2].activeName = data.base_profile.degree ? `${data.base_profile.degree}已认证` : '已认证'
}
- if (data.profile_courtship.mate_conditon instanceof Array) {
- data.profile_courtship.mate_conditon.forEach(item => {
+ if (data.other_profile.mate_conditon instanceof Array) {
+ data.other_profile.mate_conditon.forEach(item => {
if (item.mate_condition) {
vm.conditionArr = item.mate_condition
}
})
} else {
- vm.conditionArr = Object.values(data.profile_courtship.mate_conditon)
+ // vm.conditionArr = Object.values(data.other_profile.mate_conditon)
// 插入期望ta多个城市
- if (data.profile_courtship.city_list_claim) {
- let city_list_claim_arr = data.profile_courtship.city_list_claim.split(',')
+ if (data.other_profile.city_list_claim) {
+ let city_list_claim_arr = data.other_profile.city_list_claim.split(',')
city_list_claim_arr.forEach((city) => {
vm.conditionArr.push(city)
})
@@ -943,6 +954,10 @@ wepy.page({
vm.showCondition = true
}
+ if (data.profile_photos && data.profile_photos.length == 0) {
+ data.profile_photos.push(data.base_profile.photo)
+ }
+
vm.userInfo = data
let num = 0
@@ -950,12 +965,12 @@ wepy.page({
if (data.self_is_real_approved == 1) { num = num + 50 }
vm.pairedScore = num
- if (data.photo || data.avatar) {
- let year = '', city = '', degree = '', industry_sub = data.industry_sub
- if (data.profile_courtship) {
- year = data.profile_courtship.birthday || ''
- city = data.profile_courtship.city || ''
- degree = data.profile_courtship.degree || ''
+ if (data.photo) {
+ let year = '', city = '', degree = '', industry_sub = data.base_profile.industry_sub
+ if (data.base_profile) {
+ year = data.base_profile.year || ''
+ city = data.base_profile.city || ''
+ degree = data.base_profile.degree || ''
}
vm.posterConfig = {
@@ -968,7 +983,7 @@ wepy.page({
{x: 20, y: 288 + 26, width: 200, lineHeight: 22, text: `${degree} | ${industry_sub}`, fontSize: 26, color: '#fff', zIndex: 99}
],
images: [
- {url: data.photo || data.avatar, width: 420, height: 336, y: 0, x: 0},
+ {url: data.base_profile.photo, width: 420, height: 336, y: 0, x: 0},
{url: 'https://image.fulllinkai.com/202206/20/be5b39dde1ad4720893b2e3c52b4480d.png', width: 420, height: 100, y: 236, x: 0},
{url: 'https://image.fulllinkai.com/202206/20/bd732960011f55fed0e5e7d623118494.png', width: 136, height: 40, y: 276, x: 264}
]
@@ -987,9 +1002,29 @@ wepy.page({
console.log(err)
})
},
+ // 选择夸夸选项
+ changePraise(e, index) {
+ let vm = this
+ if (!vm.praiseList[index].state) {
+ if (vm.selectPraise && vm.selectPraise.length >= 3) {
+ vm.$showToast('最多只能选择3个')
+ return
+ }
+ vm.praiseList[index].state = true
+ vm.selectPraise.push({label: e.label, state: true})
+ } else {
+ vm.praiseList[index].state = false
+ vm.selectPraise = vm.selectPraise.filter(item => { return item.label != e.label })
+ }
+ },
// 关注
attention() {
let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
vm.$showLoading('')
vm.$post({url: `${service.host}/follow/users/119488`}).then(({code, data}) => {
if (code == 0) {
@@ -1017,9 +1052,12 @@ wepy.page({
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
- vm.$post({url: `${service.host}/friend/users/${vm.id}`}).then(({code, data}) => {
+ vm.$delete({url: `${service.host}/friend/user/${vm.id}`}).then(({code, data}) => {
if (code == 0) {
vm.$showToast('好友已取消')
+ setTimeout(() => {
+ wx.navigateBack({delta: 1})
+ }, 1200)
}
wx.hideLoading()
}).catch(() => {
@@ -1034,6 +1072,11 @@ wepy.page({
// 对Ta不感兴趣
dislikeFn() {
let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
wx.showModal({
title: '温馨提示',
content: '是否对Ta不感兴趣?标记为不感兴趣,下次系统将不再为您推荐Ta.',
@@ -1058,17 +1101,22 @@ wepy.page({
// 加入黑名单并屏蔽
shield() {
let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
wx.showModal({
title: '加入黑名单',
content: '拉黑后,对方将无法访问、关注、发送好友请求,也无法给你发消息,可以在【设置-黑名单】中取消',
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
- vm.$post({url: `${service.host}/blacklist/friends/${vm.id}`}).then(({code, data}) => {
+ vm.$post({url: `${service.host}/user/${vm.id}/linking/blacklist`}).then(({code, data}) => {
if (code == 0) {
vm.$showToast(`已加入黑名单`)
setTimeout(() => {
- wx.switchTab({url: '/pages/tabBar/news'})
+ wx.navigateBack({delta: 1})
}, 1200)
}
wx.hideLoading()
@@ -1084,18 +1132,25 @@ wepy.page({
// 举报
report() {
let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
vm.reportShow = false
wx.navigateTo({url: `/pages/users/report?id=${vm.id}&type=details`})
},
// 隐身访问处理
hiddenChange() {
let vm = this
- vm.$post({url: `${service.host}/blacklist/friends/${vm.id}`}).then(({code, data}) => {
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
+ vm.$post({url: `${service.host}/other/user/${vm.id}/hidden`}).then(({code, data}) => {
if (code == 0) {
- vm.$showToast(`已加入黑名单`)
- setTimeout(() => {
- wx.switchTab({url: '/pages/tabBar/news'})
- }, 1200)
+ vm.$showToast(`已开启隐身访问`)
}
wx.hideLoading()
}).catch(() => {
@@ -1125,7 +1180,7 @@ wepy.page({
// 获取打招呼信息
getGreet(state) {
let vm = this
- vm.$get({url: `${service.host}/greet/log?status=${state}`}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/chat/greet/log?status=${state}`}).then(({code, data}) => {
if (code == 0) {
vm.message = data.name
}
@@ -1135,8 +1190,10 @@ wepy.page({
// 联系朋友
contactFriendFn() {
let vm = this
- if (vm.userType == 'marriage') {
- vm.message = '你好,我有认识的单身嘉宾想认识你,可以沟通一下吗?'
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
}
vm.getGreet(0)
},
@@ -1161,14 +1218,28 @@ wepy.page({
},
jumpPath(type) {
let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
if (type == 'chitchat') {
wx.navigateTo({url: `/pages/news/groupChitchat?id=${vm.userInfo.id}&name=${encodeURIComponent(vm.userInfo.nickname)}&pic=${vm.userInfo.photo}&type=${vm.userInfo.type}`})
} else if (type == 'vip' && !vm.isIos) {
wx.navigateTo({url: `/pages/users/upgradeVIP`})
}
vm.modalName = ''
+ },
+ hiddenLogin() {
+ let vm = this
+ vm.loginShow = false
}
},
+ onHide() {
+ let vm = this
+ clearTimeout(this.timer)
+ vm.waitBullets = []
+ },
onShow() {
let vm = this
const info = wx.getSystemInfoSync()
@@ -1181,10 +1252,17 @@ wepy.page({
},
onLoad(e) {
let vm = this
+ vm.userData = wx.getStorageSync('userInfo')
vm.userId = wx.getStorageSync('user_id')
vm.userType = wx.getStorageSync('type')
vm.id = e.id
vm.getDetail()
+ vm.getPraiseList()
+ vm.getUserPraise()
+ vm.showNextBullet()
+ vm.timer = setInterval(() => {
+ vm.showNextBullet()
+ }, 3000)
}
})
@@ -1192,10 +1270,12 @@ wepy.page({
{
navigationBarTitleText: '单身交友',
enablePullDownRefresh: false,
-backgroundColorTop: '#ffffff',
-backgroundColorBottom: '#ffffff',
+navigationBarBackgroundColor: '#f5f5f5',
+backgroundColorTop: '#f5f5f5',
+backgroundColorBottom: '#f5f5f5',
usingComponents: {
-'poster': 'plugin://FL-plugin/poster'
+'poster': 'plugin://FL-plugin/poster',
+loginDialog: '~@/components/loginDialog',
}
}
diff --git a/src/pages/home/searchCondition.wpy b/src/pages/home/searchCondition.wpy
index 81b8409..f834334 100644
--- a/src/pages/home/searchCondition.wpy
+++ b/src/pages/home/searchCondition.wpy
@@ -199,14 +199,14 @@ wepy.page({
degree: '', // 学历
degreeList: ['硕士以上', '本科以上', '专科以上', '不限'], // 学历
belief: ['不限', '基督教', '佛教', '伊斯兰教', '其他'],
- beliefIndex: -1,
+ beliefIndex: 0,
industry: '',
industry_sub: '',
Business: [],
multiIndex: [0, 0],
objectMultiArray: [],
incomeList: ['不限', '5w以下', '5~10w', '10~15w', '15~30w', '30~50w', '50~100w', '100~500w', '500w以上'],
- incomeIndex: -1,
+ incomeIndex: 1,
sexIndex: '',
ageIndex: '',
@@ -284,18 +284,18 @@ wepy.page({
let vm = this
let data = {
inputVal: vm.inputVal, // 上个页面搜索框内容
- is_approved: vm.realNameList[parseInt(vm.realNameIndex)], // 实名认证
+ is_approved: vm.realNameList[parseInt(vm.realNameIndex)] == '不限' ? '' : vm.realNameList[parseInt(vm.realNameIndex)], // 实名认证
realNameIndex: vm.realNameIndex, // 实名认证
- is_rank: vm.is_rank_list[parseInt(vm.vipIndex)], // vip会员
+ is_rank: vm.is_rank_list[parseInt(vm.vipIndex)] == '不限' ? '' : vm.is_rank_list[parseInt(vm.vipIndex)], // vip会员
vipIndex: vm.vipIndex, // vip会员下标
- degree: vm.degreeList[parseInt(vm.educateIndex)], // 学历
+ degree: vm.degreeList[parseInt(vm.educateIndex)] == '不限' ? '' : vm.degreeList[parseInt(vm.educateIndex)], // 学历
educateIndex: vm.educateIndex, // 学历下标
- belief: vm.belief[vm.beliefIndex], // 信仰
+ belief: vm.belief[vm.beliefIndex] == '不限' ? '' : vm.belief[vm.beliefIndex], // 信仰
beliefIndex: vm.beliefIndex, // 信仰下标
- industry: vm.industry, // 职业
- industry_sub: vm.industry_sub, // 副职业
+ industry: vm.industry == '不限' ? '' : vm.industry, // 职业
+ industry_sub: vm.industry_sub == '不限' ? '' : vm.industry_sub, // 副职业
multiIndex: vm.multiIndex, // 职业下标
- income: vm.incomeList[vm.incomeIndex], // 年收入
+ income: vm.incomeList[vm.incomeIndex] ? '' : vm.incomeList[vm.incomeIndex], // 年收入
incomeIndex: vm.incomeIndex, // 年收入下标
sexIndex: vm.sexIndex, // 性别下标
@@ -322,10 +322,10 @@ wepy.page({
vm.realNameIndex = params.realNameIndex
vm.vipIndex = params.vipIndex
vm.educateIndex = params.educateIndex
- vm.beliefIndex = params.beliefIndex ? parseInt(params.beliefIndex) : -1
- vm.industry = params.industry
+ vm.beliefIndex = params.beliefIndex ? parseInt(params.beliefIndex) : 0
+ vm.industry = params.industry || '不限'
vm.industry_sub = params.industry_sub
- vm.incomeIndex = params.incomeIndex ? parseInt(params.incomeIndex) : -1
+ vm.incomeIndex = params.incomeIndex ? parseInt(params.incomeIndex) : 0
vm.multiIndex = params.multiIndex
vm.sexIndex = params.sexIndex
diff --git a/src/pages/home/searchUsers.wpy b/src/pages/home/searchUsers.wpy
index 102c600..c271b21 100644
--- a/src/pages/home/searchUsers.wpy
+++ b/src/pages/home/searchUsers.wpy
@@ -151,11 +151,11 @@ page {
-
+
-
+
@@ -198,12 +198,12 @@ page {
-
+
{{item.nickname}}
-
+
@@ -249,31 +249,31 @@ wepy.page({
data: {
userInfo: {},
inputVal: '',
- sexIndex: 0,
+ sexIndex: 1,
sexList: [
- {title: '不限', value: '不限', active: true},
- {title: '只看男', value: 'single_man', active: false},
- {title: '只看女', value: 'single_woman', active: false}
+ {title: '不限', value: '', active: true},
+ {title: '只看男', value: '1', active: false},
+ {title: '只看女', value: '2', active: false}
],
approveList: [
- {title: '不限', value: '不限', active: true},
+ {title: '不限', value: '', active: true},
{title: '已认证', value: '已认证', active: false},
{title: '未认证', value: '未认证', active: false}
],
region: ['', '', ''],
region_id: ['', '', ''],
- ageIndex: 0,
+ ageIndex: [5, 9],
ageList: [],
sexText: '性别',
ageText: '年龄',
cityText: '城市',
searchList: [
- {title: '不限', value: '不限', active: true},
+ {title: '不限', value: '', active: true},
{title: '超级VIP', value: '超级VIP', active: false},
{title: '普通会员', value: '普通会员', active: false}
],
beliefList: [
- {title: '不限', value: '不限', active: true},
+ {title: '不限', value: '', active: true},
{title: '基督教', value: '基督教', active: false},
{title: '其他', value: '其他', active: false}
],
@@ -287,9 +287,10 @@ wepy.page({
realNameIndex: 2, // 实名认证
vipIndex: 2, // VIP会员
educateIndex: 3, // 学历
- beliefIndex: -1, // 信仰
- incomeIndex: -1, // 收入
+ beliefIndex: 0, // 信仰
+ incomeIndex: 0, // 收入
+ timer: null,
no_more: false,
loading: false,
page: 1,
@@ -300,35 +301,34 @@ wepy.page({
let vm = this
let data = {
page: vm.page,
- min_age: vm.ageIndex ? vm.ageList[0][vm.ageIndex[0]] : '不限',
- max_age: vm.ageIndex ? vm.ageList[1][vm.ageIndex[1]] : '不限',
- province: vm.region[1] ? vm.region[1] : '不限',
- city: vm.region[2] ? vm.region[2] : '不限',
+ min_age: vm.ageIndex ? vm.ageList[0][vm.ageIndex[0]] : '',
+ max_age: vm.ageIndex ? vm.ageList[1][vm.ageIndex[1]] : '',
+ province: vm.region[1] ? vm.region[1] : '',
+ city: vm.region[2] ? vm.region[2] : '',
sex: vm.sexList[vm.sexIndex].value,
- is_approved: vm.is_approved ? vm.is_approved : '不限',
- is_rank: vm.is_VIP ? vm.is_VIP : '不限',
- degree: vm.is_degree ? vm.is_degree : '不限',
- belief: vm.belief ? vm.belief : '不限',
- industry: vm.is_industry ? vm.is_industry : '不限',
- industry_sub: vm.is_industry_sub ? vm.is_industry_sub : '不限',
- income: vm.is_income ? vm.is_income : '不限'
+ is_approved: vm.is_approved ? vm.is_approved : '',
+ is_rank: vm.is_VIP ? vm.is_VIP : '',
+ degree: vm.is_degree ? vm.is_degree : '',
+ belief: vm.belief ? vm.belief : '',
+ industry: vm.is_industry ? vm.is_industry : '',
+ industry_sub: vm.is_industry_sub ? vm.is_industry_sub : '',
+ income: vm.is_income ? vm.is_income : ''
}
console.log(data, '*/**********')
vm.$showLoading('加载中...')
- vm.$get({url: `${service.host}/user/list?keyword=${vm.inputVal}`, data}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/other/user/list?keyword=${vm.inputVal}`, data}).then(({code, data}) => {
if (code === 0) {
- vm.userInfo = data.user
if (vm.list.length === 0 || vm.page === 1) {
- vm.list = data.users.data
+ vm.list = data.data
} else {
- data.users.data.map(function (item) {
+ data.data.map(function (item) {
vm.list.push(item)
})
}
- if (vm.list.length < 15 || data.users.data.length < 15) {
+ if (vm.list.length < 15 || data.data.length < 15) {
vm.no_more = true
}
- vm.record(data.users.data)
+ vm.record(data.data)
setTimeout(() => {
vm.loading = true
}, 500)
@@ -428,6 +428,17 @@ wepy.page({
wx.navigateTo({url: `/pages/home/information?id=${e.id}`})
}
},
+ watch: {
+ inputVal () {
+ let vm = this
+ clearTimeout(vm.timer)
+ vm.timer = setTimeout(() => {
+ vm.page = 1
+ vm.no_more = false
+ vm.getList()
+ }, 800)
+ }
+ },
// 上拉获取更多数据
onReachBottom() {
let vm = this
@@ -451,14 +462,18 @@ wepy.page({
},
onLoad(e) {
let vm = this
+ vm.userInfo = wx.getStorageSync('userInfo')
+ if (vm.userInfo.sex == 1) {
+ vm.sexIndex = 2
+ }
if (e.params) {
let params = JSON.parse(e.params)
- vm.inputVal = params.inputVal
- vm.belief = params.belief ? params.belief : '不限'
- vm.is_approved = params.is_approved ? params.is_approved : '不限'
- vm.is_VIP = params.is_rank ? params.is_rank : '不限'
- vm.is_degree = params.degree ? params.degree : '不限'
- vm.is_industry = params.industry ? params.industry : '不限'
+ vm.inputVal = params.inputVal || ''
+ vm.belief = params.belief ? params.belief : ''
+ vm.is_approved = params.is_approved ? params.is_approved : ''
+ vm.is_VIP = params.is_rank ? params.is_rank : ''
+ vm.is_degree = params.degree ? params.degree : ''
+ vm.is_industry = params.industry ? params.industry : ''
vm.is_industry_sub = params.industry_sub ? params.industry_sub : ''
vm.multiIndex = params.multiIndex
vm.ageIndex = params.ageIndex
diff --git a/src/pages/home/singleSquare.wpy b/src/pages/home/singleSquare.wpy
index 5eac957..73b71e1 100644
--- a/src/pages/home/singleSquare.wpy
+++ b/src/pages/home/singleSquare.wpy
@@ -105,7 +105,7 @@ page {
-
+
@@ -146,7 +146,7 @@ wepy.page({
page: 1,
list: [], // 列表数据
verify: {},
- recommendShow: true,
+ recommendShow: false,
intentionShow: false,
recommendData: {}
},
@@ -154,11 +154,10 @@ wepy.page({
getList() {
let vm = this
let data = {
- area_id: vm.id,
page: vm.page
}
vm.$showLoading('加载中...')
- vm.$get({url: `${service.host}/area/users/v2`, data}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/area/${vm.id}/users`, data}).then(({code, data}) => {
if (code === 0) {
if (vm.list.length === 0 || vm.page === 1) {
vm.list = data.data
@@ -237,6 +236,9 @@ wepy.page({
if (state) {
vm.verify.has_apply_area = state
}
+ },
+ jumpPath(url) {
+ wx.navigateTo({url: url})
}
},
// 上拉获取更多数据
diff --git a/src/pages/news/chitchat.wpy b/src/pages/news/chitchat.wpy
index 69b2b5e..8c598a2 100644
--- a/src/pages/news/chitchat.wpy
+++ b/src/pages/news/chitchat.wpy
@@ -781,9 +781,9 @@ wepy.page({
let vm = this
let timeData = new Date().getTime()
let data = {
- to_user_id: vm.otherUserId,
- content: vm.msg,
- type: 'text'
+ other_user_id: vm.otherUserId,
+ field_7: vm.msg,
+ field_6: 'text'
}
if (!vm.msg) {
vm.$showToast('请输入聊天内容')
@@ -852,9 +852,9 @@ wepy.page({
sendPictures(file) {
let vm = this
let data = {
- to_user_id: vm.otherUserId,
- content: vm.msg,
- type: 'picture'
+ other_user_id: vm.otherUserId,
+ field_7: vm.msg,
+ field_6: 'picture'
}
vm.openShow = false
vm.uploadState = true
diff --git a/src/pages/news/friendRequest.wpy b/src/pages/news/friendRequest.wpy
index 07c6b1a..068425b 100644
--- a/src/pages/news/friendRequest.wpy
+++ b/src/pages/news/friendRequest.wpy
@@ -369,25 +369,25 @@ page {
-
+
- {{tabBarIndex === 0 ? item.other_user.nickname :item.receive_user.nickname }}
+ {{item.user.nickname }}
-
+
- {{ item.created_at }}
-
-
+ {{ item.create_time }}
+
+
-
-
+
+
- 0
- {{ tabBarIndex === 0 ? item.other_user.age : item.receive_user.age }}
+ 0
+ {{ item.user.age }}
@@ -515,14 +515,20 @@ wepy.page({
methods: {
getList() {
let vm = this
+ let url = ``
+ if (vm.tabBarIndex == 0) {
+ url = `${service.host}/notice/receive/friend/request/list`
+ } else {
+ url = `${service.host}/notice/send/friend/request/list`
+ }
let data = {
page: vm.page
}
vm.$showLoading('加载中...')
- vm.$get({url: `${service.host}/friend/request/logs/v2?type=${vm.tabBarIndex === 0 ? 'receive' : 'send'}`, data}).then(({code, data}) => {
+ vm.$get({url: url, data}).then(({code, data}) => {
if (code === 0) {
data.data.forEach((item) => {
- item.created_at = item.created_at.split(' ', 1)
+ item.create_time = item.create_time.split(' ', 1)
})
if (vm.list.length === 0 || vm.page === 1) {
vm.list = data.data
@@ -572,12 +578,10 @@ wepy.page({
}
if (e) {
data = {
- id: vm.id,
status: 1
}
} else {
data = {
- id: vm.id,
status: -1,
reply: vm.rejectText,
refuse_tag: reject
@@ -594,7 +598,7 @@ wepy.page({
}
if (vm.throttle) {
vm.throttle = false
- vm.$post({url: `${service.host}/deal/friend/request/v2`, data}).then(({code, data}) => {
+ vm.$post({url: `${service.host}/notice/deal/friend/request/${vm.id}`, data}).then(({code, data}) => {
if (code == 0) {
if (e) {
vm.$showToast('已添加为好友')
@@ -654,12 +658,12 @@ wepy.page({
return
}
if ((vm.tabBarIndex == 0 && e.status != '0') || (vm.tabBarIndex == 1 && e.status != '-1')) {
- url = `/pages/home/information?id=${vm.tabBarIndex == 0 ? e.other_user.id : e.receive_user.id}`
+ url = `/pages/home/information?id=${e.user.id}`
wx.navigateTo({url: url})
return
}
// 好友申请是否已经真人认证
- if (e.other_user.is_real_approved != 1) {
+ if (e.user.is_real_approved != 1) {
vm.approveTips = true
vm.approveState = true
}
@@ -670,16 +674,15 @@ wepy.page({
// 好友申请获取申请用户数据
vm.msg = e.message
vm.id = e.id
- vm.name = e.other_user.nickname
- vm.sex = e.other_user.sex
- vm.userId = e.other_user.id
- vm.userType = e.other_user.type
- vm.pic = e.other_user.avatar || e.other_user.photo
+ vm.name = e.user.nickname
+ vm.sex = e.user.sex
+ vm.userId = e.user.id
+ vm.userType = e.user.type
+ vm.pic = e.user.photo
vm.applyForShow = true
},
jumpDetailPath(e) {
- let vm = this
- wx.navigateTo({url: `/pages/home/information?id=${vm.tabBarIndex == 0 ? e.other_user.id : e.receive_user.id}`})
+ wx.navigateTo({url: `/pages/home/information?id=${e.user.id}`})
}
},
// 上拉获取更多数据
diff --git a/src/pages/news/groupChitchat.wpy b/src/pages/news/groupChitchat.wpy
index aa0045c..4feb362 100644
--- a/src/pages/news/groupChitchat.wpy
+++ b/src/pages/news/groupChitchat.wpy
@@ -724,7 +724,7 @@ wepy.page({
// 获取群成员信息
getMembers() {
let vm = this
- vm.$post({url: `${service.host}/chat/group/detail?team_id=${vm.otherUserId}`}).then(({code, data}) => {
+ vm.$post({url: `${service.host}/team/${vm.otherUserId}/detail`}).then(({code, data}) => {
if (code === 0) {
// 第一次进入页面的时候才请求历史消息
if (!vm.membersData.id) {
diff --git a/src/pages/news/groupChitchatDetail.wpy b/src/pages/news/groupChitchatDetail.wpy
index be55d48..547d480 100644
--- a/src/pages/news/groupChitchatDetail.wpy
+++ b/src/pages/news/groupChitchatDetail.wpy
@@ -141,8 +141,8 @@ page {
-
- {{item.pivot.nick ? item.pivot.nick :item.nickname}}
+
+ {{item.nickname}}
@@ -163,24 +163,24 @@ page {
群聊头像
-
+
群聊名称
- {{ detail.tname }}
+ {{ detail.team.tname }}
我在本群的昵称
-
+
群聊简介
- {{ detail.intro }}
+ {{ detail.team.intro }}
@@ -237,7 +237,7 @@ wepy.page({
getDetail() {
let vm = this
vm.$showLoading('')
- vm.$post({url: `${service.host}/chat/group/detail?team_id=${vm.id}`}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/team/${vm.id}/detail`}).then(({code, data}) => {
if (code === 0) {
vm.detail = data
}
@@ -247,11 +247,12 @@ wepy.page({
console.log(err)
})
},
- // 修改群昵称
- changeGroupName() {
+ // 修改群信息
+ changeGroupData() {
let vm = this
let data = {
- team_id: vm.id,
+ show_other_nick: vm.detail.user_team.show_other_nick,
+ is_top: vm.detail.user_team.is_top,
nick: vm.detail.user_team.nick
}
if (!vm.detail.user_team.nick) {
@@ -261,10 +262,10 @@ wepy.page({
if (vm.throttle) {
vm.throttle = false
vm.$showLoading('更改中')
- vm.$post({url: `${service.host}/chat/group/update/nick`, data}).then(({code, data}) => {
+ vm.$put({url: `${service.host}/team/${vm.id}/update`, data}).then(({code, data}) => {
wx.hideLoading()
if (code == 0) {
- vm.$showToast(`群昵称已修改`)
+ vm.$showToast(`群信息已修改`)
}
vm.throttle = true
}).catch(() => {
@@ -273,27 +274,17 @@ wepy.page({
})
}
},
- // 是否展示成员昵称
+ // 监听群昵称是否显示
changeShowNick(e) {
let vm = this
- let data = {
- team_id: vm.id,
- show_other_nick: e.$wx.detail.value ? 1 : 0
- }
- if (vm.throttle) {
- vm.throttle = false
- vm.$showLoading('')
- vm.$post({url: `${service.host}/chat/group/update/show_other_nick`, data}).then(({code, data}) => {
- if (code == 0) {
- vm.detail.user_team.show_other_nick = e.detail.value ? 1 : 0
- }
- wx.hideLoading()
- vm.throttle = true
- }).catch(() => {
- wx.hideLoading()
- vm.throttle = true
- })
- }
+ vm.detail.user_team.show_other_nick = e.$wx.detail.value ? 1 : 0
+ vm.changeGroupData()
+ },
+ // 监听置顶
+ changeShowTop(e) {
+ let vm = this
+ vm.detail.user_team.is_top = e.$wx.detail.value ? 1 : 0
+ vm.changeGroupData()
},
// 消息免打扰设置
changeMutenotiType(e) {
@@ -343,7 +334,7 @@ wepy.page({
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
- vm.$post({url: `${service.host}/chat/group/out?team_id=${vm.id}`}).then(({code, data}) => {
+ vm.$post({url: `${service.host}/team/${vm.id}/leave`}).then(({code, data}) => {
if (code == 0) {
wx.switchTab({url: '/pages/tabBar/news'})
}
@@ -364,7 +355,7 @@ wepy.page({
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
- vm.$post({url: `${service.host}/chat/group/join?team_id=${vm.id}`}).then(({code, data}) => {
+ vm.$post({url: `${service.host}/team/${vm.id}/join`}).then(({code, data}) => {
if (code == 0) {
vm.getDetail()
}
diff --git a/src/pages/news/systemNews.wpy b/src/pages/news/systemNews.wpy
index 6407e93..f12bbcf 100644
--- a/src/pages/news/systemNews.wpy
+++ b/src/pages/news/systemNews.wpy
@@ -125,7 +125,7 @@ page {
- {{item.created_at}}
+ {{item.create_time}}
@@ -199,12 +199,12 @@ wepy.page({
page: vm.page
}
vm.$showLoading('加载中...')
- vm.$get({url: `${service.host}/notices`, data}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/notice/system/list`, data}).then(({code, data}) => {
if (code === 0) {
data.data.forEach((item) => {
- let endTime = item.created_at.replace(/-/g, '/')
+ let endTime = item.create_time.replace(/-/g, '/')
let recordTime = parseFloat(new Date(endTime).getTime()) / 1000
- item.created_at = getDiffTime(recordTime, false)
+ item.create_time = getDiffTime(recordTime, false)
})
if (vm.list.length === 0 || vm.page === 1) {
vm.list = data.data
@@ -277,7 +277,7 @@ wepy.page({
return
}
if (e.type == 'follow' || e.type == 'friend' || e.type == 'remind_profile') {
- url = `/pages/home/information?id=${e.other_user.id}`
+ url = `/pages/home/information?id=${e.user_id}`
} else if (e.type == 'temp') {
url = `/pages/users/tempMember`
} else if (e.type == 'moment' || e.type == 'change_moment_topic') {
diff --git a/src/pages/news/visitor.wpy b/src/pages/news/visitor.wpy
index 1604520..c0102eb 100644
--- a/src/pages/news/visitor.wpy
+++ b/src/pages/news/visitor.wpy
@@ -319,7 +319,7 @@ page {
-
+
{{item.nickname}}
@@ -403,7 +403,7 @@ wepy.page({
size: 15
}
vm.$showLoading('加载中...')
- vm.$get({url: `${service.host}/user/preview/histroies`, data}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/preview/list`, data}).then(({code, data}) => {
if (code === 0) {
data.data.forEach((item) => {
item.created_at = utils.commentTimeHandle(item.created_at)
@@ -438,7 +438,7 @@ wepy.page({
size: 15
}
vm.$showLoading('加载中...')
- vm.$get({url: `${service.host}/followers`, data}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/follow/fans/list`, data}).then(({code, data}) => {
if (code === 0) {
data.data.forEach((item) => {
item.nickname = `${item.nickname.substring(0, 1)}***`
diff --git a/src/pages/tabBar/dynamic.wpy b/src/pages/tabBar/dynamic.wpy
index 5179f46..9e94d07 100644
--- a/src/pages/tabBar/dynamic.wpy
+++ b/src/pages/tabBar/dynamic.wpy
@@ -126,15 +126,15 @@ page {
height: 124rpx;
width: 124rpx;
right: 30rpx;
- bottom: 180rpx;
+ bottom: 320rpx;
text-align: center;
z-index: 1000;
}
.m_returnTop {
position: fixed;
- right: 62rpx;
- bottom: 200rpx;
+ right: 46rpx;
+ bottom: 160rpx;
z-index: 99;
-webkit-transition: opacity 1s;
transition: opacity 1s;
@@ -181,7 +181,7 @@ page {
-
+
#{{ item.name }}
{{ item.moment_count }} 动态
@@ -194,7 +194,7 @@ page {
{{ item }}
-
+
@@ -207,7 +207,8 @@ page {
-
+
+
{
-navigationBarTitleText: '消息',
+navigationBarTitleText: '推荐',
navigationStyle: 'custom',
enablePullDownRefresh: true,
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: {
-cuCustom: '~@/components/cuCustom'
+cuCustom: '~@/components/cuCustom',
+loginDialog: '~@/components/loginDialog',
}
}
diff --git a/src/pages/tabBar/news.wpy b/src/pages/tabBar/news.wpy
index b334fac..2078bec 100644
--- a/src/pages/tabBar/news.wpy
+++ b/src/pages/tabBar/news.wpy
@@ -142,15 +142,15 @@ page {
- 退出
+ 退出
+ 删除
+
@@ -191,35 +193,38 @@ wepy.page({
mixins: [https, base],
data: {
+ loginShow: false,
menuList: [
{
icon: 'https://image.fulllinkai.com/202201/21/a2a7445a8b70694056dd7795ef5ecc4e.png',
title: '系统通知',
- path: '/pages/users/myNews',
+ path: '/pages/news/systemNews',
count: ''
},
{
icon: 'https://image.fulllinkai.com/202201/21/1d8c26aa4e48a965bab9eb000db8d054.png',
title: '好友申请',
- path: '/pages/users/friendRequest',
+ path: '/pages/news/friendRequest',
count: ''
},
{
icon: 'https://image.fulllinkai.com/202201/21/1715406efd38dfe258b23f632b9c16eb.png',
title: '访客/粉丝',
- path: '/pages/users/visitorFriendlist?type=fans',
+ path: '/pages/news/visitor?type=fans',
count: ''
},
{
icon: 'https://image.fulllinkai.com/202201/21/9571a0bdddf66ea097eecd5a4a601436.png',
title: '我看过谁',
- path: '/pages/users/review?type=review&title=我看过谁',
+ path: '/pages/news/review?type=review&title=我看过谁',
count: ''
}
],
index: null, // 滑动删除聊天消息下标
groupSessionsCount: [], // 群聊消息未读数
teamAtList: [], // 群聊@
+ page: 1,
+ no_more: false,
list: [] // 消息列表数据
},
methods: {
@@ -229,45 +234,41 @@ wepy.page({
page: vm.page
}
vm.$showLoading('加载中...')
- vm.$get({url: `${service.host}/message/sessionV2`, data}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/chat/linkmen`, data}).then(({code, data}) => {
if (code === 0) {
- vm.menuList[0].count = data.system_count
- vm.menuList[1].count = data.friend_count
- vm.menuList[2].count = data.follow_count + data.preview_count
- let {session} = data
+ vm.teamAtList = wx.getStorageSync('teamAtList') || []
+ vm.groupSessionsCount = wx.getStorageSync('teamsSessionsCount') || []
let arrList = []
- if (session.data && session.data.length > 0) {
- session.data.forEach((item) => {
+ if (data.data && data.data.length > 0) {
+ data.data.forEach((item) => {
if (item.chat_type == 'group_chat') {
arrList.push({
chat_type: item.chat_type,
- icon: item.team.icon,
- title: item.team.tname,
+ icon: item.other_photo,
+ title: item.other_nickname,
is_top: item.is_top,
- content: item.last_message ? item.last_message.body.msg ? item.last_message.other_user.nickname ? (item.last_message.other_user.nickname + ':' + item.last_message.body.msg) : (item.last_message.other_user.name + ':' + item.last_message.body.msg) : '' : '',
- last_time: item.last_message ? item.last_message.last_time : '',
- id: item.team_id,
+ content: item.last_user_nickname + ':' + item.content,
+ last_time: item.last_time_str,
+ id: item.join_to_id,
hidden_profile: 'NONE',
msgId: item.id,
isTouchMove: false,
- new_count: wx.getStorageSync('muteNotList') && wx.getStorageSync('muteNotList').length > 0 ? 0 : this.getGroupCount(item.team_id),
- path: `/pages/home/groupChitchat?id=${item.team_id}&name=` + encodeURIComponent(`${item.team.tname}`)
+ new_count: wx.getStorageSync('muteNotList') && wx.getStorageSync('muteNotList').length > 0 ? 0 : vm.getGroupCount(item.join_to_id)
})
} else {
- console.log(item.new_count, '///////****')
arrList.push({
chat_type: item.chat_type,
- icon: item.other_user ? item.other_user.avatar || item.other_user.circle_avatar : '',
- title: item.other_user ? item.other_user.nickname || item.other_user.name : '',
+ icon: item.other_photo,
+ title: item.other_nickname,
is_top: item.is_top,
- content: item.last_message ? item.last_message.content : '',
- last_time: item.last_message ? item.last_message.last_time : '',
- id: item.other_user ? item.other_user.id : '',
- hidden_profile: item.other_user ? item.other_user.hidden_profile : '',
- msgId: item.id,
+ content: item.content,
+ last_time: item.last_time_str,
+ id: item.join_to_id,
+ hidden_profile: '',
+ type: item.other_type,
+ msgId: item.last_id,
isTouchMove: false,
- new_count: item.new_count,
- path: item.other_user ? `/pages/home/chitchat?id=${item.other_user.id}&name=` + encodeURIComponent(`${item.other_user.nickname ? item.other_user.nickname : item.other_user.name}`) + `&type=${item.other_user.type}` : ''
+ new_count: item.new_count
})
}
})
@@ -283,7 +284,7 @@ wepy.page({
j.muteTeam = i.muteTeam
j.muteState = true
} else if (j.chat_type == 'group_chat') {
- j.new_count = this.getGroupCount(j.id)
+ j.new_count = vm.getGroupCount(j.id)
}
})
})
@@ -306,7 +307,7 @@ wepy.page({
getNewCount() {
let vm = this
- vm.$get({url: `${service.host}/new/message/count`}).then(({code, data}) => {
+ vm.$get({url: `${service.host}/notice/count`}).then(({code, data}) => {
if (code === 0) {
let {new_count} = data
let groupCountList = wx.getStorageSync('teamsSessionsCount') || []
@@ -332,6 +333,55 @@ wepy.page({
})
},
+ quitGroup (e, index) {
+ let vm = this
+ wx.showModal({
+ title: '温馨提示',
+ content: `是否确认退出${e.title}群聊?`,
+ success: function (res) {
+ if (res.confirm) {
+ vm.$showLoading('')
+ vm.$post({url: `${service.host}/team/${e.id}/leave`}).then(({code, data}) => {
+ if (code == 0) {
+ vm.$showToast(`已退出群聊`)
+ vm.list.splice(index, 1)
+ }
+ wx.hideLoading()
+ }).catch(() => {
+ wx.hideLoading()
+ })
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ },
+
+ // 删除联系人列表
+ deleteList (e, index) {
+ let vm = this
+ wx.showModal({
+ title: '温馨提示',
+ content: `是否确认退出${e.title}群聊?`,
+ success: function (res) {
+ if (res.confirm) {
+ vm.$showLoading('')
+ vm.$post({url: `${service.host}/team/${e.id}/leave`}).then(({code, data}) => {
+ if (code == 0) {
+ vm.$showToast(`已删除`)
+ vm.list.splice(index, 1)
+ }
+ wx.hideLoading()
+ }).catch(() => {
+ wx.hideLoading()
+ })
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ },
+
// 获取群未读数
getGroupCount(id) {
let newCount = this.groupSessionsCount.filter(item => {
@@ -375,40 +425,74 @@ wepy.page({
return 360 * Math.atan(_Y / _X) / (2 * Math.PI)
},
- close () {
- console.log('2222222')
- this.$app.$options.globalData.nim.team.updateMyMemberInfo({
- teamId: '23903306874',
- bitConfigMask: 1
- })
+ // 聊天对话
+ jumpChatPath(e) {
+ let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
+ let url = ``
+ if (e.chat_type === 'group_chat') {
+ url = `/pages/news/groupChitchat?id=${e.id}&name=${encodeURIComponent(e.title)}&pic=${e.icon}`
+ } else {
+ url = `/pages/news/chitchat?id=${e.id}&name=${encodeURIComponent(e.title)}&type=${e.type}&pic=${e.icon}`
+ }
+ wx.navigateTo({url: url})
},
-
- jumpPath(e) {
- console.log(e, '8888888888')
- wx.navigateTo({
- url: `${e.path}&pic=${e.icon}`
- })
- },
-
+ // 用户详情
jumpDetailPath(e) {
- wx.navigateTo({
- url: `${e.path}&pic=${e.icon}`
- })
+ let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
+ let url = ``
+ if (e.chat_type === 'group_chat') {
+ url = `/pages/news/groupChitchat?id=${e.id}&name=${encodeURIComponent(e.title)}&pic=${e.icon}`
+ } else {
+ url = `/pages/home/information?id=${e.id}`
+ }
+ wx.navigateTo({url: url})
+ },
+ jumpPath(e) {
+ let vm = this
+ // 校验是否完成注册资料
+ if (!vm.$signInVerify()) {
+ vm.loginShow = true
+ return
+ }
+ wx.navigateTo({url: e.path})
+ },
+ hiddenLogin() {
+ let vm = this
+ vm.loginShow = false
}
},
// 上拉获取更多数据
onReachBottom() {
+ let vm = this
+ if (!vm.no_more) {
+ vm.getList()
+ }
},
// 下拉刷新
onPullDownRefresh() {
+ let vm = this
+ vm.page = 1
+ vm.no_more = false
+ vm.getList()
},
onShow() {
- this.teamAtList = wx.getStorageSync('teamAtList') || []
- this.groupSessionsCount = wx.getStorageSync('teamsSessionsCount') || []
- this.getList()
- this.getNewCount()
+ let vm = this
+ vm.getNewCount()
},
- created() {}
+ onLoad() {
+ let vm = this
+ vm.getList()
+ }
})
@@ -419,7 +503,8 @@ enablePullDownRefresh: true,
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: {
-cuCustom: '~@/components/cuCustom'
+cuCustom: '~@/components/cuCustom',
+loginDialog: '~@/components/loginDialog',
}
}
diff --git a/src/pages/tabBar/welcome.wpy b/src/pages/tabBar/welcome.wpy
index 45487bf..4122326 100644
--- a/src/pages/tabBar/welcome.wpy
+++ b/src/pages/tabBar/welcome.wpy
@@ -12,8 +12,8 @@ page {
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
-import {wx_login} from '../../utils/util'
-import { IM } from '../../utils/im'
+// import {wx_login} from '../../utils/util'
+// import { IM } from '../../utils/im'
wepy.page({
config: {},
@@ -22,25 +22,29 @@ wepy.page({
data: {},
watch: {},
methods: {
- appLogin() {
- let vm = this
- let app = vm.$app.$options
- wx_login().then((e) => {
- wx.hideLoading()
- let {accid, token} = e.data.im_user
- app.globalData.nim = IM(accid, token)
- setTimeout(() => {
- wx.switchTab({url: `/pages/tabBar/home`})
- }, 100)
- }).catch(() => {
- })
- }
+ // appLogin() {
+ // let vm = this
+ // let app = vm.$app.$options
+ // wx_login().then((e) => {
+ // wx.hideLoading()
+ // let {accid, token} = e.data.im_user
+ // app.globalData.nim = IM(accid, token)
+ // setTimeout(() => {
+ // wx.switchTab({url: `/pages/tabBar/home`})
+ // }, 100)
+ // }).catch(() => {
+ // })
+ // }
},
onLoad() {
- let vm = this
- vm.appLogin()
+ // let vm = this
+ // vm.appLogin()
+ },
+ onShow() {
+ setTimeout(() => {
+ wx.switchTab({url: `/pages/tabBar/home`})
+ }, 100)
},
- onShow() {},
created() {
}
})
diff --git a/src/utils/util.js b/src/utils/util.js
index 1e87c87..a608c14 100644
--- a/src/utils/util.js
+++ b/src/utils/util.js
@@ -54,8 +54,10 @@ const wx_login = () => {
wx.setStorageSync('mobile', data.user.mobile) // 用户手机号
let userInfo = {
name: data.user.nickname,
- avatar: data.user.avatar || 'https://image.fulllinkai.com/202203/09/cc1c73eb1a4941fef25a15cd1ff2f9df.png',
+ avatar: data.user.photo || 'https://image.fulllinkai.com/202203/09/cc1c73eb1a4941fef25a15cd1ff2f9df.png',
showId: data.user.id,
+ rank_id: data.user.rank_id,
+ sex: data.user.sex,
id: data.user.id,
type: data.user.type
}