管理员解答页面

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",
"appid" : "__UNI__7C9492E",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionName" : "1.0.4",
"versionCode" : 104,
"transformPx" : false,
"app-plus" : {
"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": {
"navigationBarTextStyle": "black",

View File

@ -38,7 +38,7 @@
data() {
return {
//
roleList: ["教师","家长","学生"],
roleList: [],
//
roleIndex: -1,
//
@ -96,9 +96,9 @@
})
} else {
request.post('/hs/login',{
role:this.role,
role: this.role,
username: this.username,
password:this.password
password: this.password
}).then(res => {
console.log("登录信息",res)
if (res.data === null) {
@ -106,6 +106,16 @@
icon: 'none',
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 {
uni.setStorageSync("userInfo", res.data);
uni.switchTab({

View File

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

View File

@ -2,30 +2,21 @@
<view class="page">
<view class="top">
<view class="left">
<view class="header-photo">
{{userInfo.headerPhoto}}
</view>
<avatar :userName="userInfo.real_name" size="90"></avatar>
</view>
<view class="user-info">
<view class="info-top">
<view class="info-left">
<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="other-info">
<view class="follow">
关注{{userInfo.followNumber}}
<view class="one-top">{{userInfo.followNumber}}</view>
<view class="one-bottom">关注</view>
</view>
<view class="fans">
粉丝{{userInfo.fansNumber}}
<view class="one-top">{{userInfo.fansNumber}}</view>
<view class="one-bottom">粉丝</view>
</view>
<view class="score">
<view class="one-top">{{userInfo.integral}}</view>
<view class="one-bottom">积分</view>
</view>
</view>
<view class="info-bottom">
@ -34,6 +25,15 @@
</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="noData" v-if="noData === true">
<noData :custom="true"><view class="title" @tap="update()">暂无数据,点击重新加载</view></noData>
@ -45,7 +45,7 @@
<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-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>
<text class="text-black text-lg">{{item.title}}</text>
</view>
@ -70,9 +70,11 @@
import request from '@/util/request.js';
import noData from '@/components/noData/noData.vue';
import { sortBy } from '@/static/js/public.js';
import avatar from "@/pages/components/avatar/avatar.vue";
export default {
components: {
noData
noData,
avatar
},
data() {
return {
@ -146,9 +148,8 @@
* @param {Object} item
*/
goToDetails(item) {
uni.setStorageSync("notice",item);
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.noticeList = res.data.personalList;
this.noData = res.data.personalList.length === 0 ? true : false;
uni.setNavigationBarTitle({
title: this.userInfo.real_name
})
},err => {
console.log("err",err);
})
@ -174,13 +178,17 @@
</script>
<style scoped>
.middle{
padding-bottom: 20rpx;
border-bottom: 1rpx solid rgba(18,150,219,0.5);
}
.cu-item{
background-color: #cfcfcf!important;
margin: 16rpx 0!important;
}
.follow-button-ed{
width: 80%;
background-color: #FFFFFF;
border: 1rpx solid #969696;
color: #8d8d8d;
text-align: center;
border-radius: 10rpx;
@ -197,6 +205,7 @@
margin-bottom: 10rpx;
}
.follow-button{
color: #FFFFFF;
width: 80%;
background-color: #269FDE;
text-align: center;
@ -216,38 +225,43 @@
.user-info view{
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{
display: flex;
flex-flow: nowrap;
color: #7f7f7f;
}
.user-info{
color: #FFFFFF;
display: flex;
flex-flow: column;
justify-content: center;
border: 1rpx solid #b0b0b0;
border-radius: 10rpx;
width: 70%;
font-size: 32rpx;
background-color: #ced8d8;
}
.header-photo{
font-size: 80rpx;
font-family: 'Courier New', Courier, monospace;
color: #1296DB;
border: 5rpx solid #1296DB;
border-radius: 50%;
width: 180rpx;
height: 180rpx;
text-align: center;
line-height: 180rpx;
margin: 20rpx;
.content {
background-color: #F1F1F1;
width: 100%;
padding: 20rpx;
border-radius: 10rpx;
}
textarea{
line-height: 1.5;
width: 100%;
height: 100%;
}
.top{
display: flex;
justify-content: space-between;
padding-bottom: 40rpx;
border-bottom: 1rpx solid rgba(18,150,219,0.5);
}
.page{
padding: 20rpx;

View File

@ -1,22 +1,208 @@
<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>
</template>
<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 {
components: {
mSearch,
noData,
avatar
},
data() {
return {
//
noData: false,
//
searchStr: '',
//
followList: [],
flag: true
}
},
onPullDownRefresh () {
this.getFollowPeopleList();
},
onShow() {
this.getAllData();
},
mounted() {
this.getFollowPeopleList();
},
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>
<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>

View File

@ -13,20 +13,19 @@
<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">
<view class="one-left">
{{item.headerPhoto}}
</view>
<avatar :userName="item.real_name" size="50"></avatar>
<view class="one-right">
<view class="name">
{{item.real_name}}
</view>
<view class="grade">
<view class="grade-left">
<view class="grade">
等级:<text class="l">天才</text><text class="r">{{Math.floor((item.integral)/1000)+1}}</text>
<view class="other-info">
<view class="other-info-left">
关注:{{item.followNumber}}
</view>
<view class="other-info-middle">
粉丝:{{item.fansNumber}}
</view>
<view class="grade-right">
<view class="other-info-right">
积分:{{item.integral}}
</view>
</view>
@ -45,10 +44,12 @@
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 {
components: {
mSearch,
noData
noData,
avatar
},
data() {
return {
@ -131,6 +132,14 @@
</script>
<style scoped>
.other-info-middle{
padding: 0 20rpx;
}
.other-info{
display: flex;
color: #9a9a9a;
font-size: 30rpx;
}
.one-right{
margin-left: 20rpx;
}
@ -145,7 +154,7 @@
background-color: #269FDE;
color: #FFFFFF;
font-size: 32rpx;
padding: 10rpx;
padding: 4rpx 10rpx;
}
.ed{
background-color: #FFFFFF;

View File

@ -17,7 +17,7 @@
<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-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>
<text class="text-black text-lg">{{item.title}}</text>
</view>
@ -102,6 +102,7 @@ export default {
* @param {Object} item
*/
cancelFollow(item) {
let _this = this;
uni.showModal({
title: '取消关注',
content: '确认取消关注?',
@ -113,7 +114,7 @@ export default {
}).then(res => {
console.log("取消关注",res);
if (res.data === 1) {
this.getAllData();
_this.getAllData();
}
},err => {
console.log("err",err);
@ -129,13 +130,12 @@ export default {
* @param {Object} item
*/
goToDetails(item) {
uni.setStorageSync("notice",item);
uni.navigateTo({
url: '/pages/tabbar/homepage/data-details'
url: '/pages/tabbar/homepage/data-details?noticeId='+item.id
})
},
/**
* 获取首页数据
* 获取关注人员文章数据
*/
getAllData() {
request.post('/hs/getFollowList',{

View File

@ -9,10 +9,10 @@
</view>
<view class="author-and-time">
<view class="author" @tap="goToUserInfo(noticeInfo)" style="padding: 0;">
{{noticeInfo.real_name}}
{{noticeInfo.author_name}}
</view>
<view class="time">
{{noticeInfo.release_time}}
{{noticeInfo.create_time}}
</view>
</view>
<view class="content">
@ -25,15 +25,16 @@
</view>
<view class="feedback">
<view class="reading-volume">
阅读 245
阅读 {{noticeInfo.read_number}}
</view>
<view class="fabulous">
<uni-fav :checked="checked"
<uni-fav :checked="noticeInfo.isCollection === 0 ? false : true"
:class="noticeInfo.isCollection === 0 ? 'grey' : 'blue'"
class="favBtn"
circle="true"
bg-color="#FFFFFF"
bg-color-checked="#1296DB"
@click="onClick"></uni-fav>
@tap="collection(noticeInfo.isCollection)"></uni-fav>
</view>
</view>
<view class="no-message" v-if="noMessage === true" @tap="addMessage">
@ -64,16 +65,21 @@
</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-bar bg-white justify-end">
<view class="content">留言</view>
<view class="title-content">留言</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<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 class="cu-bar bg-white justify-end">
<view class="action">
@ -94,14 +100,13 @@
uniFav
},
data() {
let noticeInfo = uni.getStorageSync('notice');
noticeInfo.fabulous = true;
noticeInfo.messageFabulous = true;
return {
//
checked: true,
//
InputBottom: 0,
//
noticeInfo: noticeInfo,
noticeInfo: {},
//ID
noticeId: '',
//
noMessage: false,
//
@ -112,16 +117,70 @@
messageContent: '',
}
},
onLoad() {
onLoad(option) {
this.noticeId = option.noticeId;
},
onReady() {
},
mounted() {
this.getMessageList()
async mounted() {
await this.getMessageList();
await this.updateReadNumber();
},
onPullDownRefresh () {
uni.startPullDownRefresh();
},
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;
},
/**
* 跳转人员页面
* @param {Object} item
*/
goToUserInfo(item) {
if (item.user_id === uni.getStorageSync("userInfo").user_id) {
if (item.author_id === uni.getStorageSync("userInfo").user_id) {
uni.switchTab({
url: '/pages/tabbar/my/my'
});
} else {
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(()=>{
this.getMessageList();
},1000)
},1000);
}
},err=>{
console.log("err",err);
@ -177,14 +237,17 @@
* 获取留言
*/
getMessageList() {
request.post('/hs/getOneContent',{id: this.noticeInfo.id})
.then(res=>{
return request.post('/hs/getOneContent',{
id: this.noticeId,
userId: uni.getStorageSync("userInfo").user_id
}).then(res=>{
this.noMessage = res.data.message.length === 0 ? true : false;
this.noticeInfo = res.data.content;
this.messageList = res.data.message;
console.log("一条数据数据",res);
},err=>{
console.log("err",err);
})
});
},
/**
* 新增留言打开弹框
@ -198,6 +261,16 @@
</script>
<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{
background-color: #FFFFFF;
text-align: left;

View File

@ -17,7 +17,7 @@
<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-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>
<text class="text-black text-lg">{{item.title}}</text>
</view>
@ -101,9 +101,8 @@ export default {
* @param {Object} item
*/
goToDetails(item) {
uni.setStorageSync("notice",item);
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',{})
.then(res=>{
res.data.parentAdvice.forEach(item=>{
this.$set(item,'type','家长意见');
this.$set(item,'type','家长建议');
});
res.data.schoolNoticeList.forEach(item=>{
this.$set(item,'type','校园通知');

View File

@ -1,17 +1,17 @@
<template>
<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="header-photo cu-avatar radius" v-if="item.send_id !== userInfo.user_id" @tap="goToOther(item)">
{{otherInfo.real_name.slice(0,1)}}
<view class="cu-avatar radius" v-if="item.send_id !== userInfo.user_id" @tap="goToOther(item)">
<avatar :userName="otherInfo.real_name" size="45"></avatar>
</view>
<view class="main">
<view class="content shadow" :class="isMy(item,'bg-green')">
<text>{{item.content}}</text>
</view>
</view>
<view class="header-photo cu-avatar radius" v-if="item.send_id === userInfo.user_id" @tap="goToMy">
{{userInfo.real_name.slice(0,1)}}
<view class="cu-avatar radius" v-if="item.send_id === userInfo.user_id" @tap="goToMy">
<avatar :userName="userInfo.real_name" size="45"></avatar>
</view>
<view class="date">{{item.letter_create_time}}</view>
</view>
@ -35,8 +35,11 @@
<script>
import request from '@/util/request.js';
import $ from '@/static/js/jquery-1.12.2.js';
import avatar from "@/pages/components/avatar/avatar.vue";
export default {
components: {
avatar
},
data() {
return {
otherInfo: uni.getStorageSync("otherInfo"),
@ -77,6 +80,20 @@
}
},
methods: {
/**
* 调整弹框高度
*/
InputFocus(e) {
setTimeout(() => {
this.InputBottom = e.detail.height;
console.log(this.InputBottom)
},500)
},
InputBlur(e) {
setTimeout(() => {
this.InputBottom = 0
},500)
},
/**
* 跳转到其他人的主页
* @param {Object} item
@ -160,23 +177,22 @@
isMy(item,classText) {
return item.send_id === uni.getStorageSync("userInfo").user_id ? classText : ''
},
InputFocus(e) {
this.InputBottom = e.detail.height
},
InputBlur(e) {
this.InputBottom = 0
}
}
}
</script>
<style scoped>
.header-photo{
text-align: center;
background-color: #1296DB;
/* .cu-item .date{
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{
margin-bottom: 100rpx;

View File

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

View File

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

View File

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

View File

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

View File

@ -52,7 +52,7 @@
},
}
},
onLoad() {
onShow() {
this.noticeInfo = {
title: '',
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';
//获取当前时间
const getNowDate = function() {
/**
* 获取当前时间
*/
const getNowDate = () => {
const myDate = new Date();
let year = myDate.getFullYear();
let month = myDate.getMonth()+1 < 10 ? '0'+(myDate.getMonth()+1) : myDate.getMonth()+1;
@ -12,8 +14,12 @@ const getNowDate = function() {
};
export { getNowDate }
//格式化时间方法
const dateFormat = function (fmt, date) {
/**
* 格式化时间方法
* @param {Object} fmt 格式
* @param {Object} date 时间对象
*/
const dateFormat = (fmt, date) => {
let ret;
const opt = {
"Y+": date.getFullYear().toString(), // 年
@ -34,8 +40,12 @@ const dateFormat = function (fmt, date) {
};
export { dateFormat }
//排序方法
const sortBy = function(attr,rev){
/**
* 排序方法
* @param {Object} attr 数组
* @param {Object} rev 升序/降序
*/
const sortBy = (attr,rev) => {
//第二个参数没有传递 默认升序排列
if(rev === undefined){
rev = 1;
@ -55,3 +65,16 @@ const sortBy = function(attr,rev){
}
};
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';
//获取当前时间
const getNowDate = function() {
/**
* 获取当前时间
*/
const getNowDate = () => {
const myDate = new Date();
let year = myDate.getFullYear();
let month = myDate.getMonth()+1 < 10 ? '0'+(myDate.getMonth()+1) : myDate.getMonth()+1;
@ -12,8 +14,12 @@ const getNowDate = function() {
};
export { getNowDate }
//格式化时间方法
const dateFormat = function (fmt, date) {
/**
* 格式化时间方法
* @param {Object} fmt 格式
* @param {Object} date 时间对象
*/
const dateFormat = (fmt, date) => {
let ret;
const opt = {
"Y+": date.getFullYear().toString(), // 年
@ -34,8 +40,12 @@ const dateFormat = function (fmt, date) {
};
export { dateFormat }
//排序方法
const sortBy = function(attr,rev){
/**
* 排序方法
* @param {Object} attr 数组
* @param {Object} rev 升序/降序
*/
const sortBy = (attr,rev) => {
//第二个参数没有传递 默认升序排列
if(rev === undefined){
rev = 1;
@ -55,3 +65,16 @@ const sortBy = function(attr,rev){
}
};
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://192.168.10.29:8048'; //服务器地址
// const baseUrl = 'http://127.0.0.1:8048'; //服务器地址
const get = (url, data) => {
let httpDefaultOpts = {
@ -27,7 +28,11 @@ const get = (url, data) => {
}
).catch(
(response) => {
reject(response)
reject(response);
uni.showToast({
icon: 'none',
title: '服务器出现异常'
});
}
)
})
@ -57,8 +62,9 @@ const post = (url, data) => {
}
} else {
resolve({
message: "服务器出现异常"
})
message: "服务器出现异常",
data: res[1].data
});
}
}
).catch(