Commit 8469b91e authored by liwei's avatar liwei

修改了文件夹路径

parent d31815b6
......@@ -67,16 +67,16 @@
],
"subPackages": [
{
"root": "pagesAnnouncement",
"root": "pagesNotice",
"pages": [
{
"path": "announcement/list",
"path": "notice/list",
"style": {
"navigationBarTitleText": "园区公告"
}
},
{
"path": "announcement/detail",
"path": "notice/detail",
"style": {
"navigationBarTitleText": "公告详情"
}
......
<template>
<view :class="{ popUpShow: showLikePop }">
<view class="pageanima" v-if="isInit" :class="{ pagePop: showAnima }">
<view class="pageanima" :class="{ pagePop: showAnima }">
<view class="div" style="height: 100%;background: #F4F5F9;">
<!-- 左上角搜索-->
<u-navbar bgColor="white" :placeholder="true">
......@@ -19,7 +19,7 @@
</view>
</view>
<!-- 公告-->
<view class="notice" @click="gotopage('/pagesAnnouncement/announcement/list')">
<view class="notice" @click="gotopage('/pagesNotice/notice/list')">
<view>
<image src="/static/images/home/gonggao.png" class="notice-image"/>
</view>
......@@ -140,55 +140,6 @@
</view>
</view>
</view>
<!-- v-show="showAnima" -->
<image v-if="showAnima" :src="animUrl" mode="aspectFill" class="animate-middel-top"></image>
<image v-show="showArrowDown" src="../../static/images/home/arrow_down_sm.png" mode="aspectFill"
class="fixed_down"></image>
<!-- 相关喜欢的弹窗 -->
<u-popup :show="showLikePop" mode="center" round="12" :closeOnClickOverlay="false" @close="closeLikePop"
@open="openLikePop" :safeAreaInsetBottom="false">
<view class="mutual_like">
<image class="likepopbg" :src="img + '/img/likepopbg.png'" mode="aspectFill"></image>
<image class="trbg" src="../../static/images/like/likebg.png" mode="aspectFill"></image>
<view class="like-pop-content">
<view class="title">互相喜欢</view>
<view class="toname">
你已和
<text class="toname_to">{{ mutualInfo.otherNickName }}</text>
已互相喜欢
</view>
<view class="avatar_anmi">
<view class="avatar avat_left_anmi">
<image :src="mutualInfo.selfHeadPortrait" mode="aspectFill"></image>
</view>
<image class="liketo-icon" src="../../static/images/like/liketo.png" mode="aspectFill">
</image>
<view class="avatar avat_right_anmi">
<image :src="mutualInfo.otherHeadPortrait" mode="aspectFill"></image>
</view>
</view>
<view class="pt52">
相遇是最浪漫的事
<br />
相守是最感动的话
</view>
<view class="like-pop-btn qdzh" @click="goSedMsg">去打招呼</view>
<view class="like-pop-btn shzl" @click.stop="closeLikePop">稍后再聊</view>
</view>
</view>
</u-popup>
<login @change="getUserInfo" :isLoginPop="isLoginPop" class="my-select"></login>
</view>
<!-- 推荐结束 -->
<view v-else class="tuijian_over" @touchmove.stop.prevent="() => {}">
<view class="imgbg">
<image src="../../static/images/like/nowover.png" mode="aspectFill"></image>
<view class="over-content">
<view class="isover">本次推荐已结束</view>
<view class="overtime">下次推荐明天中午12点整</view>
<view class="nxet-tuijian" @click="goTips">下次推荐提醒我</view>
</view>
</view>
</view>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirma"></ELM>
</view>
......@@ -210,6 +161,15 @@
},
data() {
return {
userData: {
aboutMe:'关于我自己关于我自己关于我自己关于我自己',
interest:'兴趣爱好兴趣爱好兴趣爱好兴趣爱好兴趣爱好',
loveRequirement:'心仪的他心仪的他心仪的他心仪的他心仪的他',
userArticleViewResponse: {
articleContent: null,
articleImg: []
}
},
businessList: [
{
name:'测试1',
......@@ -236,7 +196,6 @@
showAnima: false,
showBtn: true,
showArrowDown: true,
isInit: true,
showTabbar: true,
scrollTop: 0,
unfold: false,
......@@ -244,12 +203,6 @@
age: uni.getStorageSync('itemobj').birthday,
gender: uni.getStorageSync('itemobj').gender,
city: uni.getStorageSync('itemobj').city,
userData: {
userArticleViewResponse: {
articleContent: null,
articleImg: []
}
},
img: this.$BASE_URL,
base_lsit: [
......@@ -264,48 +217,16 @@
};
},
onHide() {
if (!this.chooseimg) {
this.reConnect = true;
this.closeSocket();
clearInterval(this.timeoutObj); //销毁定时器
}
},
// 自定义此页面的转发给好友(已经有全局的分享方法,此处会覆盖全局)
onShareAppMessage(res) {
return {
title: this.userData.age + '岁 ' + this.userData.height + 'cm ' + this.userData.profession + ' ' + (this
.userData.city != null ? this.userData.city : this.city) + ' ' + this.userData.school,
path: '/pageslike/like/userInfo?share=true&id=' + this.userData.id,
imageUrl: this.userData.imgList[0]
}
},
// 自定义页面的分享到朋友圈
onShareTimeline(res) {
return {
title: this.userData.age + '岁 ' + this.userData.height + 'cm ' + this.userData.profession + ' ' + (this
.userData.city != null ? this.userData.city : this.city) + ' ' + this.userData.school,
path: '/pageslike/like/userInfo?share=true&id=' + this.userData.id,
imageUrl: this.userData.imgList[0]
}
},
onShow() {
this.chooseimg = false;
this.showAnima = false;
this.getRecUserInfo();
if (uni.getStorageSync('token')) {
this.getUnRead();
this.ownerId = uni.getStorageSync('info') != null ? uni.getStorageSync('info').id : null;
this.connectSocketInit();
}
},
onReachBottom(e) {
this.bottom_offset = true;
},
onPageScroll(e) {
if (!this.isInit) {
return;
}
const _this = this;
if (e.scrollTop <= 0) {
this.showArrowDown = true;
......@@ -371,80 +292,6 @@
url: '/pages2/explain/explain'
});
},
goSedMsg() {
const {
otherId,
otherHeadPortrait,
otherNickName
} = this.mutualInfo
uni.navigateTo({
url: `/pages2/sedMsg/sedMsg?sendUserId=${otherId}&nickName=${otherNickName}`
})
},
openLikePop() {
this.showLikePop = true;
},
closeLikePop() {
this.showLikePop = false;
this.getRecUserInfo();
},
async logion(id, type, url) {
this.animUrl = url;
const res = await this.$getId();
if (res == 11003) {
this.isLoginPop = true;
} else {
// 滑动到顶部
if (!this.showBtn) {
console.log('防止连续点击');
return;
}
uni.pageScrollTo({
scrollTop: 0,
duration: 1000
});
this.userIsLike(id, type);
}
},
//type 喜欢 true 还是 取消 false
userIsLike(userId, type) {
console.log("开始匹配:" + userId)
this.showBtn = false;
// 点击 取消 喜欢 根据返回结果展示
this.$myRequest({
url: 'nostalgia/usermatching/match',
data: {
otherUser: userId,
result: type
},
withToken: true,
method: 'POST'
}).then(res => {
console.log("匹配结束1:" + userId)
if (res.data.code == 200) {
this.showAnima = true;
setTimeout(() => {
this.showAnima = false;
}, 1000);
// 显示 相互 弹窗 this.showLikePop = true;
if (res.data.data && res.data.data.result) {
this.showLikePop = true;
this.mutualInfo = res.data.data;
} else {
console.log("匹配结束2:" + userId)
this.getRecUserInfo();
}
} else {
this.tipMsg = res.data.msg;
this.$refs.elm.showDialog();
this.showBtn = true;
}
})
},
async screen() {
const res = await this.$getId();
console.log(res);
......@@ -456,274 +303,6 @@
});
}
},
getUserInfo(e) {
if (e == 0) {
this.isLoginPop = false;
return;
}
// #ifdef MP-WEIXIN
try {
wx.getUserProfile({
desc: '用于完善会员资料',
success: resinfo => {
wx.login({
success: res => {
if (res.code) {
console.log(res.code, resinfo);
this.setCode(res.code, resinfo);
} else {}
},
fail: err => {
}
});
},
fail: errinfo => {
this.setCode(this.generateRandomString(10), 'null');
}
});
} catch {
wx.getUserInfo({
success: resinfo => {
wx.login({
success: res => {
if (res.code) {
console.log(res.code, resinfo);
this.setCode(res.code, resinfo);
} else {}
},
fail: err => {}
});
},
fail: errinfo => {}
});
}
// #endif
// #ifndef MP-WEIXIN
this.setCode("ip", 'null');
// #endif
},
async setCode(code, resinfo) {
const res = await this.$myRequest({
url: 'token/wxAppletLogin',
data: {
code: code
},
method: 'POST'
});
console.log(res, 'delshoucang');
var obj = {
code: code,
state: res.data.code,
nickName: resinfo != 'null' ? resinfo.userInfo.nickName : "匿名用户"
};
uni.setStorageSync('verification', obj);
if (res.data.code == 200) {
this.isLoginPop = false;
this.isConfirm = true;
this.tipMsg = "登录成功";
this.$refs.elm.showDialog();
var info = {
birthday: res.data.data.info.birthday,
city: res.data.data.info.city,
gender: res.data.data.info.gender,
headPortrait: res.data.data.info.headPortrait,
id: res.data.data.info.id,
nickName: res.data.data.info.nickName
};
uni.setStorageSync('info', info);
uni.setStorageSync('token', res.data.data.token);
} else if (res.data.code == 11002) {
this.isLoginPop = false;
uni.reLaunch({
url: '/pagesintroduction/selfIntroduction?code=' + code
});
} else {
this.tipMsg = res.data.msg;
this.$refs.elm.showDialog();
}
},
getRecUserInfo() {
console.log("开始获取用户信息")
// 获取推荐用户信息
let age = 20;
if (this.age) {
age = util.mymethod(uni.getStorageSync('itemobj').birthday);
}
let loginType;
uni.getStorageSync('token') ? (loginType = true) : (loginType = false);
this.$myRequest({
url: 'nostalgia/fruser/recommendUserInfo',
withToken: loginType,
data: {
age,
gender: this.gender == undefined ? "FEMALE" : this.gender
},
method: 'GET'
}).then(res => {
console.log("获取用户信息完成")
if (res.data.code == 200) {
if (res.data.data == null) {
this.showArrowDown = false;
this.isInit = false;
// this.data = [];
this.userData = {};
this.nextData = {};
uni.setTabBarBadge({
index: 0,
text: '0'
});
} else {
this.showArrowDown = true;
this.isInit = true;
this.userData = res.data.data;
if(this.userData.userArticleViewResponse.articleImg.length>3){
this.userData.userArticleViewResponse.articleImg = this.userData.userArticleViewResponse.articleImg.splice(0,3)
}
uni.setTabBarBadge({
index: 0,
text: `${res.data.data.surplusNum}`
});
this.showBtn = true;
console.log(
`console.log("获取用户信息完成") 用户id${res.data.data.id}****剩余次数${res.data.data.surplusNum}`
);
}
} else {
this.tipMsg = res.data.msg;
this.$refs.elm.showDialog();
}
})
},
connectSocketInit: function() {
let self = this;
if (self.reConnect) {
console.log("连接socket");
self.socketTask = uni.connectSocket({
url: WS,
success(data) {
console.log("连接socket成功");
},
fail(data) {
console.log("连接socket失败");
}
});
uni.onSocketOpen(function(res) {
//监听WebSocket连接打开事件
let msgData = {
messageType: "CONNECT",
info: self.ownerId
};
console.log("发送连接请求");
self.websocketSendMessage(msgData);
});
}
},
// 关闭websocket【离开这个页面的时候执行关闭】
closeSocket() {
let self = this;
uni.closeSocket({
success(res) {
console.log("关闭成功", res);
},
fail(err) {
console.log("关闭失败", err);
},
});
},
websocketSendMessage(msgData) {
let self = this;
uni.sendSocketMessage({
data: JSON.stringify(msgData),
success() {
if (msgData.messageType == 'CONNECT') {
console.log("建立连接成功 启动监听" + JSON.stringify(msgData));
self.websocketOnMessage();
} else {
console.log("消息发送成功" + JSON.stringify(msgData));
}
},
fail() {
console.log("发送失败,重新建立连接" + JSON.stringify(msgData));
setTimeout(() => {
self.websocketSendMessage(msgData);
}, 1000)
}
});
},
websocketOnMessage() {
let self = this;
uni.onSocketMessage((res) => {
console.log("监听到socket信息:", res);
if ("CONNECT_SUCCESS" == res.data) {
//建立连接成功后开始心跳
this.reset(); // 检测心跳reset,防止长时间连接导致连接关闭
} else {
//收到消息
let msgData = JSON.parse(res.data);
console.log("收到消息:", JSON.stringify(msgData));
//消息应答
this.answerMessage(msgData.msgNo);
this.getUnRead();
}
});
},
// 启动心跳 start
start() {
let self = this;
self.timeoutObj = setInterval(function() {
uni.sendSocketMessage({
data: '{"messageType":"ALIVE"}',
success() {
console.log("首页心跳");
self.reConnect = false;
},
fail() {
console.log("心跳失败重新连接");
setTimeout(() => {
self.reConnect = true;
self.connectSocketInit();
}, 1000)
}
});
}, 1000);
},
// 检测心跳reset
reset() {
clearInterval(this.timeoutObj);
this.start(); // 启动心跳
},
answerMessage(MsgNo) {
let self = this;
uni.sendSocketMessage({
data: '{"messageType":"ANSWER","info":"' + MsgNo + '"}',
success() {
console.log("消息应答:" + MsgNo);
},
fail() {
console.log("消息应答失败");
}
});
},
shareUser() {
uni.navigateTo({
url: '/pageslike/like/userInfo?share=true&id=' + this.userData.id
})
},
goDynamicState(){
this.tipMsg = "开源版暂未开放,敬请期待!如需旗舰版,可联系作者微信(MMRWXM)咨询";
this.$refs.elm.showDialog();
},
generateRandomString(length) {
let result = uni.getStorageSync('touristopenid');
if (result != null&&result!="") {
......
<template>
<view class="announcement">
<view v-if="nodata">
<view class="noData">
<view class="nodataImage">
<image class="nodataImageClass" src=""/>
<view class="card" v-for="item in noticeList" @click="gotopage(item)">
<view class="toptitle">{{item.title}}</view>
<view class="bottom">
<view class="time">{{item.pushTime}}</view>
<view style="display: flex;align-items: center;">
<image class="image" src=""/>
<view class="num" v-if="item.viewNum">{{item.viewNum}}次浏览</view>
<view class="num" v-else>0次浏览</view>
</view>
</view>
</view>
</view>
<view v-else>
<view class="card" v-for="item in announcementList" @click="gotopage(item)">
<view class="toptitle">{{item.title}}</view>
<view class="bottom">
<view class="time">{{item.pushTime}}</view>
<view style="display: flex;align-items: center;">
<image class="image" src=""/>
<view class="num" v-if="item.viewNum">{{item.viewNum}}次浏览</view>
<view class="num" v-else>0次浏览</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
import { noticeList } from "../../api/notice/index";
export default {
data() {
return {
nodata: false,
announcementList: [
queryParam:{
page: 1,
rows: 10
},
noticeList: [
{
businessId:'1',
title:'通知公告1通知公告1通知公告1通知公告1通知公告1通知公告1通知公告1',
......@@ -45,11 +41,42 @@
}
},
onShow() {
console.log('111111')
this.getList()
},
// 触底加载
onReachBottom() {
// console.log("触底加载")
// // 触底的时候请求数据,即为上拉加载更多
// var allTotal = this.queryParam.page * this.queryParam.rows
// //this.page为加载次数,this.pageSize为每一次加载的数据条数
// if(allTotal < this.total){
// //this.total为请求数据的总条数。只要现有条数小于总条数就就执行一下代码
// this.allListItem = false;
// this.queryParam.page ++;
// //加载次数递加
// this.getlsit() //请求更多数据列表
// }else{
// this.allListItem = true;
// console.log('已加载全部数据')
// }
},
methods: {
getannouncementList() {
getList() {
const res = this.$myRequest({
url: '/cmsbanner/queryCmsBanners',
data: {
page: this.queryParam.page,
rows: this.queryParam.rows
},
method: 'GET'
});
this.noticeList = res.rows
this.total = res.total
// noticeList(this.queryParam).then(res =>{
// this.noticeList = res.rows
// this.total = res.total
// })
},
gotopage(item){
uni.navigateTo({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment