管理员解答页面

This commit is contained in:
peihaoyu 2020-09-27 15:39:35 +08:00
parent beb2c10506
commit 5e44ebf4c6
27 changed files with 9972 additions and 1549 deletions

View File

@ -2,8 +2,8 @@
"name" : "HSLink", "name" : "HSLink",
"appid" : "__UNI__7C9492E", "appid" : "__UNI__7C9492E",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.4",
"versionCode" : "100", "versionCode" : 104,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"usingComponents" : true, "usingComponents" : true,

View File

@ -224,6 +224,46 @@
} }
} }
} }
,{
"path" : "pages/components/avatar/avatar",
"style" : {}
}
,{
"path" : "pages/tabbar/my/collection/collection",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "收藏列表",//
"navigationBarBackgroundColor": "#333",//
"navigationBarTextStyle": "white" //whiteblack
}
}
,{
"path" : "pages/tabbar/my/article-management/article-management",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "文章管理",//
"navigationBarBackgroundColor": "#333",//
"navigationBarTextStyle": "white" //whiteblack
}
}
,{
"path" : "pages/tabbar/my/people-management/people-management",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "人员管理",//
"navigationBarBackgroundColor": "#333",//
"navigationBarTextStyle": "white" //whiteblack
}
}
,{
"path" : "pages/tabbar/my/help-answer/help-answer",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "帮助答复",//
"navigationBarBackgroundColor": "#333",//
"navigationBarTextStyle": "white" //whiteblack
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",

View File

@ -38,7 +38,7 @@
data() { data() {
return { return {
// //
roleList: ["教师","家长","学生"], roleList: [],
// //
roleIndex: -1, roleIndex: -1,
// //
@ -96,9 +96,9 @@
}) })
} else { } else {
request.post('/hs/login',{ request.post('/hs/login',{
role:this.role, role: this.role,
username: this.username, username: this.username,
password:this.password password: this.password
}).then(res => { }).then(res => {
console.log("登录信息",res) console.log("登录信息",res)
if (res.data === null) { if (res.data === null) {
@ -106,6 +106,16 @@
icon: 'none', icon: 'none',
title: '账号或密码错误' title: '账号或密码错误'
}) })
} else if (res.data.frozen_state === "1") {
uni.showToast({
icon: 'none',
title: '该账号已冻结'
})
} else if (res.data.user_type !== this.role) {
uni.showToast({
icon: 'none',
title: '角色不匹配'
})
} else { } else {
uni.setStorageSync("userInfo", res.data); uni.setStorageSync("userInfo", res.data);
uni.switchTab({ uni.switchTab({

View File

@ -103,7 +103,7 @@
id: this.noticeInfo.id, id: this.noticeInfo.id,
label: this.noticeInfo.label, label: this.noticeInfo.label,
title: this.noticeInfo.title, title: this.noticeInfo.title,
content: this.noticeInfo.content content: this.noticeInfo.content,
}).then(res => { }).then(res => {
console.log("保存文章",res); console.log("保存文章",res);
if (res.data === 1) { if (res.data === 1) {
@ -135,11 +135,14 @@
.title{ .title{
padding-top: 0; padding-top: 0;
} }
.title textarea, .label textarea, .content textarea{ .title, .label, .content{
background-color: #F1F1F1; background-color: #F1F1F1;
padding: 20rpx;
width: 100%;
border-radius: 10rpx; border-radius: 10rpx;
padding: 20rpx;
margin: 20rpx;
}
.title textarea, .label textarea, .content textarea{
width: 100%;
} }
.title textarea{ .title textarea{
height: 128rpx; height: 128rpx;
@ -148,9 +151,6 @@
.label textarea{ .label textarea{
height: 80rpx; height: 80rpx;
} }
.content textarea{
text-indent: 40rpx;
}
.page{ .page{
background-color: #FFFFFF; background-color: #FFFFFF;
} }

View File

@ -2,30 +2,21 @@
<view class="page"> <view class="page">
<view class="top"> <view class="top">
<view class="left"> <view class="left">
<view class="header-photo"> <avatar :userName="userInfo.real_name" size="90"></avatar>
{{userInfo.headerPhoto}}
</view>
</view> </view>
<view class="user-info"> <view class="user-info">
<view class="info-top"> <view class="other-info">
<view class="info-left"> <view class="follow">
<view class="name"> <view class="one-top">{{userInfo.followNumber}}</view>
姓名{{userInfo.real_name}} <view class="one-bottom">关注</view>
</view>
<view class="grade">
等级<text class="l">博客</text><text class="r">{{Math.floor((userInfo.integral)/1000)+1}}</text>
</view>
<view class="score">
积分{{userInfo.integral}}
</view>
</view> </view>
<view class="info-right"> <view class="fans">
<view class="follow"> <view class="one-top">{{userInfo.fansNumber}}</view>
关注{{userInfo.followNumber}} <view class="one-bottom">粉丝</view>
</view> </view>
<view class="fans"> <view class="score">
粉丝{{userInfo.fansNumber}} <view class="one-top">{{userInfo.integral}}</view>
</view> <view class="one-bottom">积分</view>
</view> </view>
</view> </view>
<view class="info-bottom"> <view class="info-bottom">
@ -34,6 +25,15 @@
</view> </view>
</view> </view>
</view> </view>
<view class="middle">
<view class="cu-item content">
<textarea v-model="userInfo.signature"
auto-height="true"
maxlength=2000
disabled="false"
></textarea>
</view>
</view>
<view class="bottom"> <view class="bottom">
<view class="noData" v-if="noData === true"> <view class="noData" v-if="noData === true">
<noData :custom="true"><view class="title" @tap="update()">暂无数据,点击重新加载</view></noData> <noData :custom="true"><view class="title" @tap="update()">暂无数据,点击重新加载</view></noData>
@ -45,7 +45,7 @@
<view class="action"> <view class="action">
<view class="action"> <view class="action">
<view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view> <view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view>
<view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长意见'">{{item.type}}</view> <view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长建议'">{{item.type}}</view>
<view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view> <view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view>
<text class="text-black text-lg">{{item.title}}</text> <text class="text-black text-lg">{{item.title}}</text>
</view> </view>
@ -70,9 +70,11 @@
import request from '@/util/request.js'; import request from '@/util/request.js';
import noData from '@/components/noData/noData.vue'; import noData from '@/components/noData/noData.vue';
import { sortBy } from '@/static/js/public.js'; import { sortBy } from '@/static/js/public.js';
import avatar from "@/pages/components/avatar/avatar.vue";
export default { export default {
components: { components: {
noData noData,
avatar
}, },
data() { data() {
return { return {
@ -146,9 +148,8 @@
* @param {Object} item * @param {Object} item
*/ */
goToDetails(item) { goToDetails(item) {
uni.setStorageSync("notice",item);
uni.navigateTo({ uni.navigateTo({
url: '/pages/tabbar/homepage/data-details' url: '/pages/tabbar/homepage/data-details?noticeId='+item.id
}) })
}, },
/** /**
@ -165,6 +166,9 @@
this.userInfo.headerPhoto = this.userInfo.real_name.slice(0,1); this.userInfo.headerPhoto = this.userInfo.real_name.slice(0,1);
this.noticeList = res.data.personalList; this.noticeList = res.data.personalList;
this.noData = res.data.personalList.length === 0 ? true : false; this.noData = res.data.personalList.length === 0 ? true : false;
uni.setNavigationBarTitle({
title: this.userInfo.real_name
})
},err => { },err => {
console.log("err",err); console.log("err",err);
}) })
@ -174,13 +178,17 @@
</script> </script>
<style scoped> <style scoped>
.middle{
padding-bottom: 20rpx;
border-bottom: 1rpx solid rgba(18,150,219,0.5);
}
.cu-item{ .cu-item{
background-color: #cfcfcf!important; background-color: #cfcfcf!important;
margin: 16rpx 0!important; margin: 16rpx 0!important;
} }
.follow-button-ed{ .follow-button-ed{
width: 80%; width: 80%;
background-color: #FFFFFF; border: 1rpx solid #969696;
color: #8d8d8d; color: #8d8d8d;
text-align: center; text-align: center;
border-radius: 10rpx; border-radius: 10rpx;
@ -197,6 +205,7 @@
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.follow-button{ .follow-button{
color: #FFFFFF;
width: 80%; width: 80%;
background-color: #269FDE; background-color: #269FDE;
text-align: center; text-align: center;
@ -216,38 +225,43 @@
.user-info view{ .user-info view{
padding: 10rpx 10rpx; padding: 10rpx 10rpx;
} }
.other-info .one-top, .other-info .one-bottom{
text-align: center;
}
.other-info{
display: flex;
justify-content: space-between;
padding: 20rpx 40rpx;
color: #9a9a9a;
font-size: 30rpx;
}
.info-top{ .info-top{
display: flex; display: flex;
flex-flow: nowrap; flex-flow: nowrap;
color: #7f7f7f;
} }
.user-info{ .user-info{
color: #FFFFFF;
display: flex; display: flex;
flex-flow: column; flex-flow: column;
justify-content: center; justify-content: center;
border: 1rpx solid #b0b0b0;
border-radius: 10rpx; border-radius: 10rpx;
width: 70%; width: 70%;
font-size: 32rpx; font-size: 32rpx;
background-color: #ced8d8;
} }
.header-photo{ .content {
font-size: 80rpx; background-color: #F1F1F1;
font-family: 'Courier New', Courier, monospace; width: 100%;
color: #1296DB; padding: 20rpx;
border: 5rpx solid #1296DB; border-radius: 10rpx;
border-radius: 50%; }
width: 180rpx; textarea{
height: 180rpx; line-height: 1.5;
text-align: center; width: 100%;
line-height: 180rpx; height: 100%;
margin: 20rpx;
} }
.top{ .top{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding-bottom: 40rpx;
border-bottom: 1rpx solid rgba(18,150,219,0.5);
} }
.page{ .page{
padding: 20rpx; padding: 20rpx;

View File

@ -1,22 +1,208 @@
<template> <template>
<view> <view class="content">
<m-search
:show="false"
placeholder="搜索"
button="none"
backgroundColor="#efecec"
v-model="searchStr"
></m-search>
<view class="noData" v-if="noData === true">
<noData :custom="true"><view class="title" @tap="update()">暂无数据,点击重新加载</view></noData>
</view>
<view class="list cu-card article dynamic" v-else-if="noData === false">
<view class="cu-item one" style="padding:0" v-for="(item,index) in followList" :key="index" @tap="goToUserInfo(item)">
<view class="one-left-two">
<avatar :userName="item.real_name" size="50"></avatar>
<view class="one-right">
<view class="name">
{{item.real_name}}
</view>
<view class="other-info">
<view class="other-info-left">
关注:{{item.followNumber}}
</view>
<view class="other-info-middle">
粉丝:{{item.fansNumber}}
</view>
<view class="other-info-right">
积分:{{item.integral}}
</view>
</view>
</view>
</view>
<!-- <view class="follow-flag ed" @tap="cancelFollow(item)">
已关注
</view> -->
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import request from '@/util/request.js';
import mSearch from '@/components/mehaotian-search/mehaotian-search.vue';
import noData from '@/components/noData/noData.vue';
import { sortBy } from '@/static/js/public.js';
import avatar from "@/pages/components/avatar/avatar.vue";
export default { export default {
components: {
mSearch,
noData,
avatar
},
data() { data() {
return { return {
//
noData: false,
//
searchStr: '',
//
followList: [],
flag: true
} }
}, },
onPullDownRefresh () {
this.getFollowPeopleList();
},
onShow() {
this.getAllData();
},
mounted() {
this.getFollowPeopleList();
},
methods: { methods: {
/**
* 跳转个人主页页面
* @param {Object} item
*/
goToUserInfo(item) {
uni.navigateTo({
url: `/pages/person-info-page/person-info-page?userId=${item.user_id}`
})
},
/**
* 取消关注
* @param {Object} userInfo
*/
cancelFollow(userInfo) {
let _this = this;
uni.showModal({
title: "取消关注",
content: "确认取消关注?",
success(res) {
if (res.confirm) {
request.post("/hs/cancelFollow",{
userId: uni.getStorageSync("userInfo").user_id,
followId: userInfo.user_id
}).then(res => {
_this.getFollowPeopleList();
console.log("取消关注",res)
},err => {
console.log("err",err)
})
}
}
})
},
/**
* 获取粉丝列表
*/
getFollowPeopleList() {
request.post("/hs/getFansPeopleList",{
userId: uni.getStorageSync("userInfo").user_id
}).then(res => {
console.log("粉丝列表",res);
uni.startPullDownRefresh();
this.followList = res.data;
if (this.followList.length === 0) {
this.noData = true;
} else {
this.noData = false;
this.followList.forEach(item => {
item.headerPhoto = item.real_name.slice(0,1);
});
}
},err => {
console.log("err",err)
})
}
} }
} }
</script> </script>
<style> <style scoped>
.other-info-middle{
padding: 0 20rpx;
}
.other-info{
display: flex;
color: #9a9a9a;
font-size: 30rpx;
}
.one-right{
margin-left: 20rpx;
}
.one-left-two{
display: flex;
flex-flow: nowrap;
justify-content: center;
align-items: center;
}
.follow-flag{
border-radius: 10rpx;
background-color: #269FDE;
color: #FFFFFF;
font-size: 32rpx;
padding: 4rpx 10rpx;
}
.ed{
background-color: #FFFFFF;
border: 1rpx solid #b3b3b3;
color: #b3b3b3;
}
.one-right .grade{
font-size: 34rpx;
color: #909090;
}
.one-right .name{
padding-bottom: 12rpx;
font-weight: bold;
}
.one-right .grade-right{
margin-left: 16rpx;
}
.one-left{
font-size: 80rpx;
font-family: 'Courier New', Courier, monospace;
color: #1296DB;
border: 5rpx solid #1296DB;
border-radius: 50%;
width: 140rpx;
height: 140rpx;
text-align: center;
line-height: 140rpx;
margin: 20rpx;
}
.one{
padding-right: 24rpx!important;
}
.one, .grade{
display: flex!important;
flex-flow: nowrap;
align-items: center;
justify-content: space-between;
}
.grade .r, .grade .l{
font-size: 14rpx;
padding: 5rpx;
border-radius: 5rpx;
color: #FFFFFF;
}
.grade .l{
background-color: #9DC75F;
}
.grade .r{
background-color: #2D5315;
}
</style> </style>

View File

@ -13,20 +13,19 @@
<view class="list cu-card article dynamic" v-else-if="noData === false"> <view class="list cu-card article dynamic" v-else-if="noData === false">
<view class="cu-item one" style="padding:0" v-for="(item,index) in followList" :key="index" @tap="goToUserInfo(item)"> <view class="cu-item one" style="padding:0" v-for="(item,index) in followList" :key="index" @tap="goToUserInfo(item)">
<view class="one-left-two"> <view class="one-left-two">
<view class="one-left"> <avatar :userName="item.real_name" size="50"></avatar>
{{item.headerPhoto}}
</view>
<view class="one-right"> <view class="one-right">
<view class="name"> <view class="name">
{{item.real_name}} {{item.real_name}}
</view> </view>
<view class="grade"> <view class="other-info">
<view class="grade-left"> <view class="other-info-left">
<view class="grade"> 关注:{{item.followNumber}}
等级:<text class="l">天才</text><text class="r">{{Math.floor((item.integral)/1000)+1}}</text>
</view>
</view> </view>
<view class="grade-right"> <view class="other-info-middle">
粉丝:{{item.fansNumber}}
</view>
<view class="other-info-right">
积分:{{item.integral}} 积分:{{item.integral}}
</view> </view>
</view> </view>
@ -45,10 +44,12 @@
import mSearch from '@/components/mehaotian-search/mehaotian-search.vue'; import mSearch from '@/components/mehaotian-search/mehaotian-search.vue';
import noData from '@/components/noData/noData.vue'; import noData from '@/components/noData/noData.vue';
import { sortBy } from '@/static/js/public.js'; import { sortBy } from '@/static/js/public.js';
import avatar from "@/pages/components/avatar/avatar.vue";
export default { export default {
components: { components: {
mSearch, mSearch,
noData noData,
avatar
}, },
data() { data() {
return { return {
@ -131,6 +132,14 @@
</script> </script>
<style scoped> <style scoped>
.other-info-middle{
padding: 0 20rpx;
}
.other-info{
display: flex;
color: #9a9a9a;
font-size: 30rpx;
}
.one-right{ .one-right{
margin-left: 20rpx; margin-left: 20rpx;
} }
@ -145,7 +154,7 @@
background-color: #269FDE; background-color: #269FDE;
color: #FFFFFF; color: #FFFFFF;
font-size: 32rpx; font-size: 32rpx;
padding: 10rpx; padding: 4rpx 10rpx;
} }
.ed{ .ed{
background-color: #FFFFFF; background-color: #FFFFFF;

View File

@ -17,7 +17,7 @@
<view class="action"> <view class="action">
<view class="action"> <view class="action">
<view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view> <view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view>
<view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长意见'">{{item.type}}</view> <view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长建议'">{{item.type}}</view>
<view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view> <view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view>
<text class="text-black text-lg">{{item.title}}</text> <text class="text-black text-lg">{{item.title}}</text>
</view> </view>
@ -102,6 +102,7 @@ export default {
* @param {Object} item * @param {Object} item
*/ */
cancelFollow(item) { cancelFollow(item) {
let _this = this;
uni.showModal({ uni.showModal({
title: '取消关注', title: '取消关注',
content: '确认取消关注?', content: '确认取消关注?',
@ -113,7 +114,7 @@ export default {
}).then(res => { }).then(res => {
console.log("取消关注",res); console.log("取消关注",res);
if (res.data === 1) { if (res.data === 1) {
this.getAllData(); _this.getAllData();
} }
},err => { },err => {
console.log("err",err); console.log("err",err);
@ -129,13 +130,12 @@ export default {
* @param {Object} item * @param {Object} item
*/ */
goToDetails(item) { goToDetails(item) {
uni.setStorageSync("notice",item);
uni.navigateTo({ uni.navigateTo({
url: '/pages/tabbar/homepage/data-details' url: '/pages/tabbar/homepage/data-details?noticeId='+item.id
}) })
}, },
/** /**
* 获取首页数据 * 获取关注人员文章数据
*/ */
getAllData() { getAllData() {
request.post('/hs/getFollowList',{ request.post('/hs/getFollowList',{

View File

@ -9,10 +9,10 @@
</view> </view>
<view class="author-and-time"> <view class="author-and-time">
<view class="author" @tap="goToUserInfo(noticeInfo)" style="padding: 0;"> <view class="author" @tap="goToUserInfo(noticeInfo)" style="padding: 0;">
{{noticeInfo.real_name}} {{noticeInfo.author_name}}
</view> </view>
<view class="time"> <view class="time">
{{noticeInfo.release_time}} {{noticeInfo.create_time}}
</view> </view>
</view> </view>
<view class="content"> <view class="content">
@ -25,15 +25,16 @@
</view> </view>
<view class="feedback"> <view class="feedback">
<view class="reading-volume"> <view class="reading-volume">
阅读 245 阅读 {{noticeInfo.read_number}}
</view> </view>
<view class="fabulous"> <view class="fabulous">
<uni-fav :checked="checked" <uni-fav :checked="noticeInfo.isCollection === 0 ? false : true"
:class="noticeInfo.isCollection === 0 ? 'grey' : 'blue'"
class="favBtn" class="favBtn"
circle="true" circle="true"
bg-color="#FFFFFF" bg-color="#FFFFFF"
bg-color-checked="#1296DB" bg-color-checked="#1296DB"
@click="onClick"></uni-fav> @tap="collection(noticeInfo.isCollection)"></uni-fav>
</view> </view>
</view> </view>
<view class="no-message" v-if="noMessage === true" @tap="addMessage"> <view class="no-message" v-if="noMessage === true" @tap="addMessage">
@ -64,16 +65,21 @@
</view> </view>
</view> </view>
</view> </view>
<view class="cu-modal" :class="messageDialog ? 'show' : ''"> <view class="cu-modal" :class="messageDialog ? 'show' : ''" :style="[{'margin-top': -InputBottom/2+'px'}]">
<view class="cu-dialog"> <view class="cu-dialog">
<view class="cu-bar bg-white justify-end"> <view class="cu-bar bg-white justify-end">
<view class="content">留言</view> <view class="title-content">留言</view>
<view class="action" @tap="hideModal"> <view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text> <text class="cuIcon-close text-red"></text>
</view> </view>
</view> </view>
<view class="padding-xl"> <view class="padding-xl">
<input type="text" v-model="messageContent" placeholder="请输入留言"/> <input type="text" :adjust-position="false"
:focus="false"
v-model="messageContent"
@focus="InputFocus"
@blur="InputBlur"
placeholder="请输入留言"/>
</view> </view>
<view class="cu-bar bg-white justify-end"> <view class="cu-bar bg-white justify-end">
<view class="action"> <view class="action">
@ -94,14 +100,13 @@
uniFav uniFav
}, },
data() { data() {
let noticeInfo = uni.getStorageSync('notice');
noticeInfo.fabulous = true;
noticeInfo.messageFabulous = true;
return { return {
// //
checked: true, InputBottom: 0,
// //
noticeInfo: noticeInfo, noticeInfo: {},
//ID
noticeId: '',
// //
noMessage: false, noMessage: false,
// //
@ -112,16 +117,70 @@
messageContent: '', messageContent: '',
} }
}, },
onLoad() { onLoad(option) {
this.noticeId = option.noticeId;
},
onReady() {
}, },
mounted() { async mounted() {
this.getMessageList() await this.getMessageList();
await this.updateReadNumber();
}, },
onPullDownRefresh () { onPullDownRefresh () {
uni.startPullDownRefresh(); uni.startPullDownRefresh();
}, },
methods: { methods: {
/**
* 浏览量+1
*/
updateReadNumber() {
request.post("/hs/updateReadNumber",{
noticeId: this.noticeInfo.id,
number: Number(this.noticeInfo.read_number)+1
}).then(res=>{
console.log("浏览量+1",res);
if (res.data > 0) {
this.getMessageList()
} else {
uni.showToast({
icon: "none",
title: "服务器出了小差,请稍后再试"
})
}
},err => {
console.log("err",err)
})
},
/**
* 收藏
*/
collection(option) {
const URL = {
"0": "/hs/addCollection",
"1": "/hs/cancelCollection",
}
request.post(URL[option],{
noticeId: this.noticeInfo.id,
userId: uni.getStorageSync("userInfo").user_id,
}).then(res=>{
console.log("收藏/取消收藏",res);
if (res.data > 0) {
this.getMessageList()
}
},err => {
console.log("err",err)
})
},
/**
* 调整弹框高度
*/
InputFocus(e) {
this.InputBottom = e.detail.height
},
InputBlur(e) {
this.InputBottom = 0
},
/** /**
* 关闭留言窗口 * 关闭留言窗口
*/ */
@ -129,16 +188,17 @@
this.messageDialog = false; this.messageDialog = false;
}, },
/** /**
* 跳转人员页面
* @param {Object} item * @param {Object} item
*/ */
goToUserInfo(item) { goToUserInfo(item) {
if (item.user_id === uni.getStorageSync("userInfo").user_id) { if (item.author_id === uni.getStorageSync("userInfo").user_id) {
uni.switchTab({ uni.switchTab({
url: '/pages/tabbar/my/my' url: '/pages/tabbar/my/my'
}); });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/person-info-page/person-info-page?userId=${item.user_id}` url: `/pages/person-info-page/person-info-page?userId=${item.author_id}`
}) })
} }
}, },
@ -166,7 +226,7 @@
}); });
setTimeout(()=>{ setTimeout(()=>{
this.getMessageList(); this.getMessageList();
},1000) },1000);
} }
},err=>{ },err=>{
console.log("err",err); console.log("err",err);
@ -177,14 +237,17 @@
* 获取留言 * 获取留言
*/ */
getMessageList() { getMessageList() {
request.post('/hs/getOneContent',{id: this.noticeInfo.id}) return request.post('/hs/getOneContent',{
.then(res=>{ id: this.noticeId,
userId: uni.getStorageSync("userInfo").user_id
}).then(res=>{
this.noMessage = res.data.message.length === 0 ? true : false; this.noMessage = res.data.message.length === 0 ? true : false;
this.noticeInfo = res.data.content;
this.messageList = res.data.message; this.messageList = res.data.message;
console.log("一条数据数据",res); console.log("一条数据数据",res);
},err=>{ },err=>{
console.log("err",err); console.log("err",err);
}) });
}, },
/** /**
* 新增留言打开弹框 * 新增留言打开弹框
@ -198,6 +261,16 @@
</script> </script>
<style scoped> <style scoped>
.blue{
border: 1rpx solid #1296DB!important;
}
.grey{
border: 1rpx solid #989898!important;
}
.title-content{
width: calc(100% - 200rpx);
text-align: center;
}
.padding-xl input{ .padding-xl input{
background-color: #FFFFFF; background-color: #FFFFFF;
text-align: left; text-align: left;

View File

@ -17,7 +17,7 @@
<view class="action"> <view class="action">
<view class="action"> <view class="action">
<view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view> <view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view>
<view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长意见'">{{item.type}}</view> <view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长建议'">{{item.type}}</view>
<view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view> <view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view>
<text class="text-black text-lg">{{item.title}}</text> <text class="text-black text-lg">{{item.title}}</text>
</view> </view>
@ -101,9 +101,8 @@ export default {
* @param {Object} item * @param {Object} item
*/ */
goToDetails(item) { goToDetails(item) {
uni.setStorageSync("notice",item);
uni.navigateTo({ uni.navigateTo({
url: '/pages/tabbar/homepage/data-details' url: '/pages/tabbar/homepage/data-details?noticeId='+item.id
}) })
}, },
/** /**
@ -113,7 +112,7 @@ export default {
request.post('/hs/getAllContent',{}) request.post('/hs/getAllContent',{})
.then(res=>{ .then(res=>{
res.data.parentAdvice.forEach(item=>{ res.data.parentAdvice.forEach(item=>{
this.$set(item,'type','家长意见'); this.$set(item,'type','家长建议');
}); });
res.data.schoolNoticeList.forEach(item=>{ res.data.schoolNoticeList.forEach(item=>{
this.$set(item,'type','校园通知'); this.$set(item,'type','校园通知');

View File

@ -1,17 +1,17 @@
<template> <template>
<view class="pages"> <view class="pages">
<view class="cu-chat" id="chart-page"> <view class="cu-chat" id="chart-page" :style="[{'margin-bottom': 50+InputBottom+'px'}]">
<view class="cu-item" :class="isMy(item,'self')" v-for="(item,index) in letterList" :key="index"> <view class="cu-item" :class="isMy(item,'self')" v-for="(item,index) in letterList" :key="index">
<view class="header-photo cu-avatar radius" v-if="item.send_id !== userInfo.user_id" @tap="goToOther(item)"> <view class="cu-avatar radius" v-if="item.send_id !== userInfo.user_id" @tap="goToOther(item)">
{{otherInfo.real_name.slice(0,1)}} <avatar :userName="otherInfo.real_name" size="45"></avatar>
</view> </view>
<view class="main"> <view class="main">
<view class="content shadow" :class="isMy(item,'bg-green')"> <view class="content shadow" :class="isMy(item,'bg-green')">
<text>{{item.content}}</text> <text>{{item.content}}</text>
</view> </view>
</view> </view>
<view class="header-photo cu-avatar radius" v-if="item.send_id === userInfo.user_id" @tap="goToMy"> <view class="cu-avatar radius" v-if="item.send_id === userInfo.user_id" @tap="goToMy">
{{userInfo.real_name.slice(0,1)}} <avatar :userName="userInfo.real_name" size="45"></avatar>
</view> </view>
<view class="date">{{item.letter_create_time}}</view> <view class="date">{{item.letter_create_time}}</view>
</view> </view>
@ -35,8 +35,11 @@
<script> <script>
import request from '@/util/request.js'; import request from '@/util/request.js';
import $ from '@/static/js/jquery-1.12.2.js'; import $ from '@/static/js/jquery-1.12.2.js';
import avatar from "@/pages/components/avatar/avatar.vue";
export default { export default {
components: {
avatar
},
data() { data() {
return { return {
otherInfo: uni.getStorageSync("otherInfo"), otherInfo: uni.getStorageSync("otherInfo"),
@ -77,6 +80,20 @@
} }
}, },
methods: { methods: {
/**
* 调整弹框高度
*/
InputFocus(e) {
setTimeout(() => {
this.InputBottom = e.detail.height;
console.log(this.InputBottom)
},500)
},
InputBlur(e) {
setTimeout(() => {
this.InputBottom = 0
},500)
},
/** /**
* 跳转到其他人的主页 * 跳转到其他人的主页
* @param {Object} item * @param {Object} item
@ -160,23 +177,22 @@
isMy(item,classText) { isMy(item,classText) {
return item.send_id === uni.getStorageSync("userInfo").user_id ? classText : '' return item.send_id === uni.getStorageSync("userInfo").user_id ? classText : ''
}, },
InputFocus(e) {
this.InputBottom = e.detail.height
},
InputBlur(e) {
this.InputBottom = 0
}
} }
} }
</script> </script>
<style scoped> <style scoped>
.header-photo{ /* .cu-item .date{
text-align: center;
background-color: #1296DB;
color: #FFFFFF; color: #FFFFFF;
font-size: 40rpx; }
font-weight: bold; .pages{
background-image: url("@/static/img/chat-bg.jpg");
background-size: 100% 100%;
height: calc(100vh - 100rpx);
overflow: scroll;
} */
.cu-avatar{
background-color: rgba(0,0,0,0);
} }
.cu-chat{ .cu-chat{
margin-bottom: 100rpx; margin-bottom: 100rpx;

View File

@ -10,7 +10,7 @@
:data-target="'move-box-' + index" :data-target="'move-box-' + index"
@tap="goToMessage(item)"> @tap="goToMessage(item)">
<view class="header-photo"> <view class="header-photo">
{{item.userInfo.real_name.slice(0,1)}} <avatar :userName="item.userInfo.real_name" size="50"></avatar>
</view> </view>
<view class="content"> <view class="content">
<view class="text-grey">{{item.userInfo.real_name}}</view> <view class="text-grey">{{item.userInfo.real_name}}</view>
@ -32,7 +32,11 @@
<script> <script>
import request from '@/util/request.js'; import request from '@/util/request.js';
import avatar from "@/pages/components/avatar/avatar.vue";
export default { export default {
components: {
avatar
},
data() { data() {
return { return {
modalName: null, modalName: null,
@ -141,15 +145,6 @@
} }
.header-photo{ .header-photo{
position: absolute; position: absolute;
left: 20rpx; left: 0rpx;
width: 100rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-radius: 50%;
background-color: #1296DB;
color: #FFFFFF;
font-size: 40rpx;
font-weight: bold;
} }
</style> </style>

View File

@ -78,6 +78,11 @@
icon: "loading", icon: "loading",
title: "保存成功" title: "保存成功"
}); });
setTimeout(() => {
uni.switchTab({
url: '/pages/tabbar/my/my'
});
},1000);
updateUserInfo(); updateUserInfo();
console.log("用户信息",this.userInfo); console.log("用户信息",this.userInfo);
} }

View File

@ -16,9 +16,9 @@
<view class="cu-item arrow" style="min-height: 90rpx;padding-top: 10rpx;"> <view class="cu-item arrow" style="min-height: 90rpx;padding-top: 10rpx;">
<view class="action"> <view class="action">
<view class="action"> <view class="action">
<view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view> <view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.is_pass === '0'">未发布</view>
<view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长意见'">{{item.type}}</view> <view class='cu-tag radius bg-green light margin-right-xs' v-if="item.is_pass === '1'">已发布</view>
<view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view> <view class='cu-tag radius bg-red light margin-right-xs' v-if="item.is_pass === '2'">已驳回</view>
<text class="text-black text-lg">{{item.title}}</text> <text class="text-black text-lg">{{item.title}}</text>
</view> </view>
</view> </view>
@ -117,9 +117,8 @@ export default {
* @param {Object} item * @param {Object} item
*/ */
goToDetails(item) { goToDetails(item) {
uni.setStorageSync("notice",item);
uni.navigateTo({ uni.navigateTo({
url: '/pages/tabbar/homepage/data-details' url: '/pages/tabbar/homepage/data-details?noticeId='+item.id
}) })
}, },
/** /**
@ -128,7 +127,8 @@ export default {
getAllData() { getAllData() {
request.post('/hs/getListByAttribute',{ request.post('/hs/getListByAttribute',{
text: '', text: '',
releaseId: uni.getStorageSync("userInfo").user_id releaseId: uni.getStorageSync("userInfo").user_id,
isPass: "1"
}).then(res=>{ }).then(res=>{
console.log("我的文章",res); console.log("我的文章",res);
this.noticeList = res.data; this.noticeList = res.data;

View File

@ -2,49 +2,38 @@
<view class="page"> <view class="page">
<view class="top"> <view class="top">
<view class="header-photo"> <view class="header-photo">
{{userInfo.real_name.slice(0,1)}} <avatar :userName="userInfo.real_name" size="90"></avatar>
</view> </view>
<view class="user-info"> <view class="user-name">
<view class="info-left"> {{userInfo.real_name}}
<view class="name">
姓名{{userInfo.real_name}}
</view>
<view class="grade">
等级<text class="l">天才</text><text class="r">{{Math.floor((userInfo.integral)/1000)+1}}</text>
</view>
<view class="score">
积分{{userInfo.integral}}
</view>
</view>
<view class="info-right">
<view class="score" @tap="goPage('followList')">
关注{{userOtherInfo.followNumber}}
</view>
<view class="score" @tap="goPage('fansList')">
粉丝{{userOtherInfo.fansNumber}}
</view>
</view>
</view> </view>
</view> </view>
<view class="middle"> <view class="middle">
<view class="cu-item signature">
<view class="action">
<text class="text-black">个性签名</text>
</view>
</view>
<view class="cu-item content"> <view class="cu-item content">
<textarea v-model="userInfo.signature" <textarea v-model="userInfo.signature"
auto-height="true" auto-height="true"
maxlength=2000 maxlength=2000
disabled="false"
></textarea> ></textarea>
</view> </view>
<view class="other-info">
<view class="score" @tap="goPage('followList')">
关注{{userOtherInfo.followNumber}}
</view>
<view class="score" @tap="goPage('fansList')">
粉丝{{userOtherInfo.fansNumber}}
</view>
<view class="score">
积分{{userInfo.integral}}
</view>
</view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']"> <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
<view class="cu-item" <view class="cu-item"
v-for="(item,index) in cuIconList" v-for="(item,index) in cuIconList"
:key="index" :key="index"
v-if="index<gridCol*2" v-if="item.admin === 0"
@tap="goToPage(item)"> @tap="goToPage(item)">
<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]"> <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
</view> </view>
@ -58,7 +47,11 @@
<script> <script>
import request from '@/util/request.js'; import request from '@/util/request.js';
import { updateUserInfo } from "@/static/js/public.js"; import { updateUserInfo } from "@/static/js/public.js";
import avatar from "@/pages/components/avatar/avatar.vue";
export default { export default {
components: {
avatar
},
data() { data() {
return { return {
gridCol: 3, gridCol: 3,
@ -68,33 +61,59 @@
cuIcon: 'favor', cuIcon: 'favor',
color: 'orange', color: 'orange',
name: '收藏', name: '收藏',
admin: 0,
code: 'collection' code: 'collection'
}, },
{ {
cuIcon: 'list', cuIcon: 'list',
color: 'yellow', color: 'yellow',
name: '我的文章', name: '我的文章',
admin: 0,
code: 'myArticle' code: 'myArticle'
}, },
{ {
cuIcon: 'edit', cuIcon: 'edit',
color: 'red', color: 'red',
name: '编辑信息', name: '编辑信息',
admin: 0,
code: 'personInfo' code: 'personInfo'
}, },
{ {
cuIcon: 'settings', cuIcon: 'newshot',
color: 'olive', color: 'olive',
name: '文章管理',
admin: uni.getStorageSync("userInfo").user_type === "管理员" ? 0 : 1,
code: 'articleManagement'
},
{
cuIcon: 'peoplelist',
color: 'cyan',
name: '人员管理',
admin: uni.getStorageSync("userInfo").user_type === "管理员" ? 0 : 1,
code: 'peopleManagement'
},
{
cuIcon: 'comment',
color: 'brown',
name: '帮助答复',
admin: uni.getStorageSync("userInfo").user_type === "管理员" ? 0 : 1,
code: 'helpAnswer'
},
{
cuIcon: 'settings',
color: 'purple',
name: '设置', name: '设置',
admin: 0,
code: 'settings' code: 'settings'
}, },
{ {
cuIcon: 'questionfill', cuIcon: 'questionfill',
color: 'mauve', color: 'pink',
badge: 0,
name: '帮助', name: '帮助',
admin: uni.getStorageSync("userInfo").user_type === "管理员" ? 1 : 0,
code: 'help' code: 'help'
}, },
], ],
userInfo: {}, userInfo: {},
userOtherInfo: {} userOtherInfo: {}
@ -154,11 +173,14 @@
*/ */
goToPage(item) { goToPage(item) {
const FUNCTION_CODE = { const FUNCTION_CODE = {
'collection': '', "collection": "/pages/tabbar/my/collection/collection",
'myArticle': '/pages/tabbar/my/my-article/my-article', "myArticle": "/pages/tabbar/my/my-article/my-article",
'personInfo': '/pages/tabbar/my/edit-info/edit-info', "personInfo": "/pages/tabbar/my/edit-info/edit-info",
'settings': '/pages/tabbar/my/settings/settings', "settings": "/pages/tabbar/my/settings/settings",
'help': '/pages/tabbar/my/help/help' "help": "/pages/tabbar/my/help/help",
"articleManagement": "/pages/tabbar/my/article-management/article-management",
"peopleManagement": "/pages/tabbar/my/people-management/people-management",
"helpAnswer": "/pages/tabbar/my/help-answer/help-answer"
}; };
uni.navigateTo({ uni.navigateTo({
url: `${FUNCTION_CODE[item.code]}` url: `${FUNCTION_CODE[item.code]}`
@ -169,6 +191,10 @@
</script> </script>
<style scoped> <style scoped>
.max{
width: 180rpx;
height: 180rpx;
}
.signature{ .signature{
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
@ -215,26 +241,28 @@
background-color: #ced8d8; background-color: #ced8d8;
} }
.header-photo{ .header-photo{
font-size: 80rpx; display: flex;
font-family: 'Courier New', Courier, monospace; justify-content: center;
color: #1296DB; align-items: center;
border: 5rpx solid #1296DB; }
border-radius: 50%; .other-info{
width: 180rpx; display: flex;
height: 180rpx; justify-content: space-between;
text-align: center; padding: 20rpx 40rpx;
line-height: 180rpx; color: #9a9a9a;
margin: 20rpx; font-size: 30rpx;
} }
.middle{ .middle{
padding: 40rpx 20rpx; padding: 40rpx 20rpx 0;
border-top: 1rpx solid rgba(18,150,219,0.5); }
border-bottom: 1rpx solid rgba(18,150,219,0.5); .user-name{
padding-top: 20rpx;
text-align: center;
} }
.top{ .top{
display: flex; display: flex;
justify-content: space-between; flex-flow: column;
padding-bottom: 40rpx; justify-content: center;
} }
.page{ .page{
padding: 20rpx; padding: 20rpx;

View File

@ -52,7 +52,7 @@
}, },
} }
}, },
onLoad() { onShow() {
this.noticeInfo = { this.noticeInfo = {
title: '', title: '',
label: '', label: '',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__7C9492E","name":"HSLink","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.CALL_PHONE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"safearea":{"background":"#333","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"2.8.11","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"borderStyle":"rgba(0,0,0,0.4)","backgroundColor":"#333","color":"#FFFFFF","selectedColor":"#f33e54","list":[{"pagePath":"pages/tabbar/homepage/homepage","iconPath":"static/img/tabbar/home.png","selectedIconPath":"static/img/tabbar/homeactive.png","text":"首页"},{"pagePath":"pages/tabbar/follow/follow","iconPath":"static/img/tabbar/guanzhu.png","selectedIconPath":"static/img/tabbar/guanzhuactive.png","text":"关注"},{"pagePath":"pages/tabbar/release/release","iconPath":"static/img/tabbar/add.png","selectedIconPath":"static/img/tabbar/addactive.png"},{"pagePath":"pages/tabbar/message/message","iconPath":"static/img/tabbar/news.png","selectedIconPath":"static/img/tabbar/newsactive.png","text":"消息"},{"pagePath":"pages/tabbar/my/my","iconPath":"static/img/tabbar/me.png","selectedIconPath":"static/img/tabbar/meactive.png","text":"我"}],"height":"50px"},"launch_path":"__uniappview.html"}} {"@platforms":["android","iPhone","iPad"],"id":"__UNI__7C9492E","name":"HSLink","version":{"name":"1.0.4","code":104},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.CALL_PHONE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"safearea":{"background":"#333","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"2.8.11","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"borderStyle":"rgba(0,0,0,0.4)","backgroundColor":"#333","color":"#FFFFFF","selectedColor":"#f33e54","list":[{"pagePath":"pages/tabbar/homepage/homepage","iconPath":"static/img/tabbar/home.png","selectedIconPath":"static/img/tabbar/homeactive.png","text":"首页"},{"pagePath":"pages/tabbar/follow/follow","iconPath":"static/img/tabbar/guanzhu.png","selectedIconPath":"static/img/tabbar/guanzhuactive.png","text":"关注"},{"pagePath":"pages/tabbar/release/release","iconPath":"static/img/tabbar/add.png","selectedIconPath":"static/img/tabbar/addactive.png"},{"pagePath":"pages/tabbar/message/message","iconPath":"static/img/tabbar/news.png","selectedIconPath":"static/img/tabbar/newsactive.png","text":"消息"},{"pagePath":"pages/tabbar/my/my","iconPath":"static/img/tabbar/me.png","selectedIconPath":"static/img/tabbar/meactive.png","text":"我"}],"height":"50px"},"launch_path":"__uniappview.html"}}

View File

@ -2,8 +2,10 @@
import request from '@/util/request.js'; import request from '@/util/request.js';
//获取当前时间 /**
const getNowDate = function() { * 获取当前时间
*/
const getNowDate = () => {
const myDate = new Date(); const myDate = new Date();
let year = myDate.getFullYear(); let year = myDate.getFullYear();
let month = myDate.getMonth()+1 < 10 ? '0'+(myDate.getMonth()+1) : myDate.getMonth()+1; let month = myDate.getMonth()+1 < 10 ? '0'+(myDate.getMonth()+1) : myDate.getMonth()+1;
@ -12,8 +14,12 @@ const getNowDate = function() {
}; };
export { getNowDate } export { getNowDate }
//格式化时间方法 /**
const dateFormat = function (fmt, date) { * 格式化时间方法
* @param {Object} fmt 格式
* @param {Object} date 时间对象
*/
const dateFormat = (fmt, date) => {
let ret; let ret;
const opt = { const opt = {
"Y+": date.getFullYear().toString(), // 年 "Y+": date.getFullYear().toString(), // 年
@ -34,8 +40,12 @@ const dateFormat = function (fmt, date) {
}; };
export { dateFormat } export { dateFormat }
//排序方法 /**
const sortBy = function(attr,rev){ * 排序方法
* @param {Object} attr 数组
* @param {Object} rev 升序/降序
*/
const sortBy = (attr,rev) => {
//第二个参数没有传递 默认升序排列 //第二个参数没有传递 默认升序排列
if(rev === undefined){ if(rev === undefined){
rev = 1; rev = 1;
@ -55,3 +65,16 @@ const sortBy = function(attr,rev){
} }
}; };
export { sortBy } export { sortBy }
const updateUserInfo = () => {
request.post('/hs/login',{
role: uni.getStorageSync("userInfo").user_type,
username: uni.getStorageSync("userInfo").real_name,
password: uni.getStorageSync("userInfo").pass_word
}).then(res => {
console.log("刷新个人信息",res.data);
uni.setStorageSync("userInfo", res.data);
},err => {
})
}
export { updateUserInfo }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__7C9492E","name":"HSLink","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.CALL_PHONE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"safearea":{"background":"#333","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"2.8.11","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"borderStyle":"rgba(0,0,0,0.4)","backgroundColor":"#333","color":"#FFFFFF","selectedColor":"#f33e54","list":[{"pagePath":"pages/tabbar/homepage/homepage","iconPath":"static/img/tabbar/home.png","selectedIconPath":"static/img/tabbar/homeactive.png","text":"首页"},{"pagePath":"pages/tabbar/follow/follow","iconPath":"static/img/tabbar/guanzhu.png","selectedIconPath":"static/img/tabbar/guanzhuactive.png","text":"关注"},{"pagePath":"pages/tabbar/release/release","iconPath":"static/img/tabbar/add.png","selectedIconPath":"static/img/tabbar/addactive.png"},{"pagePath":"pages/tabbar/message/message","iconPath":"static/img/tabbar/news.png","selectedIconPath":"static/img/tabbar/newsactive.png","text":"消息"},{"pagePath":"pages/tabbar/my/my","iconPath":"static/img/tabbar/me.png","selectedIconPath":"static/img/tabbar/meactive.png","text":"我"}],"height":"50px"},"launch_path":"__uniappview.html"}} {"@platforms":["android","iPhone","iPad"],"id":"__UNI__7C9492E","name":"HSLink","version":{"name":"1.0.4","code":104},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.CALL_PHONE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"safearea":{"background":"#333","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"2.8.11","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"borderStyle":"rgba(0,0,0,0.4)","backgroundColor":"#333","color":"#FFFFFF","selectedColor":"#f33e54","list":[{"pagePath":"pages/tabbar/homepage/homepage","iconPath":"static/img/tabbar/home.png","selectedIconPath":"static/img/tabbar/homeactive.png","text":"首页"},{"pagePath":"pages/tabbar/follow/follow","iconPath":"static/img/tabbar/guanzhu.png","selectedIconPath":"static/img/tabbar/guanzhuactive.png","text":"关注"},{"pagePath":"pages/tabbar/release/release","iconPath":"static/img/tabbar/add.png","selectedIconPath":"static/img/tabbar/addactive.png"},{"pagePath":"pages/tabbar/message/message","iconPath":"static/img/tabbar/news.png","selectedIconPath":"static/img/tabbar/newsactive.png","text":"消息"},{"pagePath":"pages/tabbar/my/my","iconPath":"static/img/tabbar/me.png","selectedIconPath":"static/img/tabbar/meactive.png","text":"我"}],"height":"50px"},"launch_path":"__uniappview.html"}}

View File

@ -2,8 +2,10 @@
import request from '@/util/request.js'; import request from '@/util/request.js';
//获取当前时间 /**
const getNowDate = function() { * 获取当前时间
*/
const getNowDate = () => {
const myDate = new Date(); const myDate = new Date();
let year = myDate.getFullYear(); let year = myDate.getFullYear();
let month = myDate.getMonth()+1 < 10 ? '0'+(myDate.getMonth()+1) : myDate.getMonth()+1; let month = myDate.getMonth()+1 < 10 ? '0'+(myDate.getMonth()+1) : myDate.getMonth()+1;
@ -12,8 +14,12 @@ const getNowDate = function() {
}; };
export { getNowDate } export { getNowDate }
//格式化时间方法 /**
const dateFormat = function (fmt, date) { * 格式化时间方法
* @param {Object} fmt 格式
* @param {Object} date 时间对象
*/
const dateFormat = (fmt, date) => {
let ret; let ret;
const opt = { const opt = {
"Y+": date.getFullYear().toString(), // 年 "Y+": date.getFullYear().toString(), // 年
@ -34,8 +40,12 @@ const dateFormat = function (fmt, date) {
}; };
export { dateFormat } export { dateFormat }
//排序方法 /**
const sortBy = function(attr,rev){ * 排序方法
* @param {Object} attr 数组
* @param {Object} rev 升序/降序
*/
const sortBy = (attr,rev) => {
//第二个参数没有传递 默认升序排列 //第二个参数没有传递 默认升序排列
if(rev === undefined){ if(rev === undefined){
rev = 1; rev = 1;
@ -55,3 +65,16 @@ const sortBy = function(attr,rev){
} }
}; };
export { sortBy } export { sortBy }
const updateUserInfo = () => {
request.post('/hs/login',{
role: uni.getStorageSync("userInfo").user_type,
username: uni.getStorageSync("userInfo").real_name,
password: uni.getStorageSync("userInfo").pass_word
}).then(res => {
console.log("刷新个人信息",res.data);
uni.setStorageSync("userInfo", res.data);
},err => {
})
}
export { updateUserInfo }

View File

@ -1,6 +1,7 @@
// const baseUrl = 'http://106.53.113.158:8048'; //服务器地址 // const baseUrl = 'http://106.53.113.158:8048'; //服务器地址
const baseUrl = 'http://192.168.10.29:8048'; //服务器地址 const baseUrl = 'http://192.168.10.29:8048'; //服务器地址
// const baseUrl = 'http://127.0.0.1:8048'; //服务器地址
const get = (url, data) => { const get = (url, data) => {
let httpDefaultOpts = { let httpDefaultOpts = {
@ -27,7 +28,11 @@ const get = (url, data) => {
} }
).catch( ).catch(
(response) => { (response) => {
reject(response) reject(response);
uni.showToast({
icon: 'none',
title: '服务器出现异常'
});
} }
) )
}) })
@ -57,8 +62,9 @@ const post = (url, data) => {
} }
} else { } else {
resolve({ resolve({
message: "服务器出现异常" message: "服务器出现异常",
}) data: res[1].data
});
} }
} }
).catch( ).catch(