This commit is contained in:
peihaoyu 2020-09-17 20:01:50 +08:00
parent 5a245841ce
commit 0b5dd0ee26
12 changed files with 615 additions and 520 deletions

View File

@ -36,6 +36,11 @@ export default {
/* display: flex; */
font-size: 16px;
}
.page{
margin: 20rpx;
border-radius: 10rpx;
padding-bottom: 100rpx;
}
/* #ifdef MP-BAIDU */
page {

View File

@ -2,6 +2,7 @@ import Vue from 'vue';
import App from './App';
import '@/static/css/public.css';
import '@/static/js/public.js';
import '@/static/js/jquery-1.12.2.js';
import store from './store';
Vue.config.productionTip = false;

View File

@ -92,7 +92,47 @@
}
}
],
,{
"path" : "pages/tabbar/my/my-article/my-article",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "我的文章",//
"navigationBarBackgroundColor": "#333",//
"navigationBarTextStyle": "white" //whiteblack
}
}
,{
"path" : "pages/notice-edit/notice-edit",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "编辑文章",//
"navigationBarBackgroundColor": "#333",//
"navigationBarTextStyle": "white", //whiteblack
"app-plus": {
"bounce": "none", //
"titleNView": {
"buttons": [ //,
{
"type":"none",
"text":"删除 ",
"fontSize":"16px",
"float":"right"
}
]
}
}
}
}
,{
"path" : "pages/tabbar/message/chat-page",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "",//
"navigationBarBackgroundColor": "#333",//
"navigationBarTextStyle": "white" //whiteblack
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",

View File

@ -2,283 +2,112 @@
<view class="login">
<view class="login-main">
<view class="login-logo">
<image src="@/static/img/logo.png" mode=""></image>
</view>
<view class="login-list flex border-all">
<view class="iconfont icon-shoujihao flex"></view>
<picker @change="rolePickerChange" :value="roleIndex" :range="roleList">
<view class="picker">
{{roleIndex > -1 ? roleList[roleIndex] : ((this.role === '' || this.role === undefined) ? '请选择角色' : this.role)}}
</view>
</picker>
</view>
<view class="login-list flex border-all">
<view class="iconfont icon-shoujihao flex"></view>
<view class="login-input">
<input type="number" maxlength="11" placeholder="请输入手机号" class="is-input1 " v-model="phone" />
<input placeholder="请输入账号" class="is-input1 " v-model="username" />
</view>
</view>
<view class="login-list flex border-all">
<view class="iconfont icon-yanzhengma flex"></view>
<view class="login-input">
<input type="number" maxlength="6" placeholder="请输入验证码" class="is-input1 " v-model="code" />
</view>
<view class="code-sx"></view>
<view class="codeimg" @click.stop="getCode()">{{getCodeText}}</view>
</view>
<button class="cu-btn login-btn" @tap="doLogin"> / </button>
<view class="login-tip">点击登录表示同意
<navigator>软件许可及服务协议</navigator>
</view>
</view>
<view class="login-footer">
<view class="footer-tip flex">其他登录方式</view>
<view class="footer-other flex">
<view class="other-list">
<image src="../../static/ic-QQ@2x.png" mode="aspectFill" @tap="login_qq()"></image>
</view>
<view class="other-list">
<image src="../../static/ic-weixin@2x.png" mode="aspectFill" @tap="login_weixin()"></image>
<input type="password" placeholder="请输入密码" class="is-input1 " v-model="password" />
</view>
</view>
<button class="cu-btn login-btn" @tap="doLogin"> </button>
</view>
</view>
</template>
<script>
import request from '@/util/request.js';
export default {
data() {
return {
phone: "",
code: '',
key: '',
getCodeText: '获取验证码',
getCodeBtnColor: "#ffffff",
getCodeisWaiting: false,
//
roleList: ["教师","家长","学生"],
//
roleIndex: -1,
//
role: '',
//
username: '',
//
password: '',
}
},
onLoad() {
this.checkGuide();
this.role = uni.getStorageSync("userInfo").user_type;
this.username = uni.getStorageSync("userInfo").real_name;
this.password = uni.getStorageSync("userInfo").pass_word;
},
methods: {
checkGuide() {
//
const launchFlag = uni.getStorageSync('launchFlag');
if (launchFlag) {
this.isLogin();
} else {
uni.redirectTo({
url: '/pages/guide/list'
});
}
},
isLogin() {
//
try {
const value = uni.getStorageSync('access_token');
if (value) {
//
console.log("已登录用户:", value);
uni.switchTab({
url: '/pages/index/index'
});
}
} catch (e) {
}
},
Timer() {},
getCode() {
let _this = this;
uni.hideKeyboard()
if (_this.getCodeisWaiting) {
return;
}
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(_this.phone))) {
uni.showToast({
title: '请填写正确手机号码',
icon: "none"
});
return false;
}
_this.getCodeText = "发送中..."
_this.getCodeisWaiting = true;
_this.getCodeBtnColor = "rgba(255,255,255,0.5)"
uni.request({
url: _this.websiteUrl + '/sms/notification-sms/codes',
data: {
'phone': _this.phone
},
method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
//
},
success: (res) => {
_this.key = res.data.data.key;
//TODO
_this.code = res.data.data.code;
}
});
//
setTimeout(() => {
//uni.showToast({title: '',icon:"none"});
_this.setTimer();
}, 1000)
},
setTimer() {
let holdTime = 59,
_this = this;
_this.getCodeText = "重新获取(60)"
_this.Timer = setInterval(() => {
if (holdTime <= 0) {
_this.getCodeisWaiting = false;
_this.getCodeBtnColor = "#ffffff";
_this.getCodeText = "获取验证码"
clearInterval(_this.Timer);
return;
}
_this.getCodeText = "重新获取(" + holdTime + ")"
holdTime--;
}, 1000)
},
/**
* 登录
*/
doLogin() {
let _this = this;
uni.hideKeyboard()
//
// if(!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phone))){
// uni.showToast({title: '',icon:"none"});
// return false;
// }
uni.request({
url: _this.websiteUrl + '/token/sys/login-sms',
data: {
'key': _this.key,
'code': _this.code,
'phone': _this.phone
},
method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
},
success: (res) => {
if (res.data.code == 200) {
_this.login(true, res.data.data, function() {
_this.getRongyToken();
});
} else {
uni.showToast({
title: '验证码不正确',
icon: "none"
});
return false;
}
}
});
},
//QQ
login_qq() {
let _this = this;
uni.login({
provider: 'qq',
success: function(loginRes) {
//
uni.getUserInfo({
provider: 'qq',
success: function(infoRes) {
_this.other_login(loginRes, infoRes, 'qq')
if (this.role === '' || this.role === undefined) {
uni.showToast({
icon: 'none',
title: '请选择角色'
})
} else if(this.username === '' || this.username === undefined) {
uni.showToast({
icon: 'none',
title: '请输入账号'
})
} else if(this.password === '' || this.password === undefined) {
uni.showToast({
icon: 'none',
title: '请输入密码'
})
} else {
request.post('/hs/login',{
role:this.role,
username: this.username,
password:this.password
}).then(res => {
console.log("登录信息",res)
if (res.data === null) {
uni.showToast({
icon: 'none',
title: '账号或密码错误'
})
} else {
uni.setStorageSync("userInfo", res.data);
uni.switchTab({
url: '/pages/tabbar/homepage/homepage'
});
}
});
}
});
},
//
login_weixin() {
let _this = this;
uni.login({
provider: 'weixin',
success: function(loginRes) {
//
uni.getUserInfo({
provider: 'weixin',
success: function(infoRes) {
_this.other_login(loginRes, infoRes, 'wx');
}
});
}
});
},
//
other_login(loginRes, infoRes, type) {
let _this = this;
let url;
let pram = {};
// _this.loginRes=JSON.stringify(loginRes).toString();
// _this.infoRes=JSON.stringify(infoRes).toString();
switch (type) {
case 'qq':
url = '/token/sys/login-qq';
pram = {
'openid': loginRes.authResult.openid,
'nickname': infoRes.userInfo.nickname,
'gender': infoRes.userInfo.gender,
'province': infoRes.userInfo.province,
'city': infoRes.userInfo.city,
'figureurl': infoRes.userInfo.figureurl_qq
}
break;
case 'wx':
url = '/token/sys/login-wechat';
pram = {
'openid': loginRes.authResult.openid,
'nickname': infoRes.userInfo.nickName,
'sex': infoRes.userInfo.gender,
'province': infoRes.userInfo.province,
'city': infoRes.userInfo.city,
'country': infoRes.userInfo.country,
'headimgurl': infoRes.userInfo.avatarUrl,
'unionid': loginRes.authResult.unionid
}
break;
default:
},err => {
})
}
uni.request({
url: _this.websiteUrl + url,
data: pram,
method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
},
success: (res) => {
if (res.data.code == 200) {
//_this.testData=JSON.stringify(res.data.data).toString();;
_this.login(true, res.data.data, function() {
_this.getRongyToken();
});
}
}
});
},
async getRongyToken() {
let _this = this,
url = '/app/api/v1.0/rongy/getRongyToken',
param = {},
method = 'GET';
_this.sendRequest(url, param, method, (res) => {
let data = {
'appKey': 'xxxxxxx',
'token': res.token,
'targetIds': res.rongyUserId,
'targetName': res.userName,
'targetAvatar': res.portrait
}
uni.setStorage({
key: 'ryData',
data: data
});
});
/**
* 选择角色
* @param {Object} e
*/
rolePickerChange(e) {
this.roleIndex = e.detail.value;
if (this.roleIndex === -1) {
this.roleIndex = 0
}
this.role = this.roleList[this.roleIndex];
},
}
}
@ -291,6 +120,11 @@
background-color: #FFFFFF;
}
.picker{
font-size: 29rpx;
color: #6d6d6d;
padding-left: 20rpx;
}
.flex{
display: flex;
}
@ -311,8 +145,8 @@
padding: 0 70upx;
.login-logo {
width: 248upx;
height: 242upx;
width: 400upx;
height: 200upx;
padding-bottom: 50upx;
margin: 200upx auto 0 auto;
@ -387,7 +221,7 @@
margin-top: 70upx;
height: 96upx;
width: 100%;
background: linear-gradient(-90deg, rgba(80, 85, 168, 1), rgba(104, 110, 210, 1));
background: #797979;
border-radius: 47upx;
font-size: 34upx;
color: #ffffff;

View File

@ -15,7 +15,11 @@
</view>
</view>
<view class="content">
{{noticeInfo.content}}
<textarea placeholder="请输入文章内容"
v-model="noticeInfo.content"
auto-height="true"
disabled="true"
></textarea>
</view>
<view class="feedback">
<view class="reading-volume">
@ -27,7 +31,7 @@
<text>点赞 123</text>
</view>
</view>
<view class="no-message" v-if="noMessage === true">
<view class="no-message" v-if="noMessage === true" @tap="addMessage">
写留言
</view>
<view class="leave-message" v-if="noMessage === false">
@ -39,7 +43,7 @@
写留言
</view>
</view>
<view class="one-message" v-for="item in messageList">
<view class="one-message" v-for="(item,index) in messageList" :key="index">
<view class="left">
<view class="header-photo">
{{item.real_name.slice(0,1)}}
@ -60,13 +64,23 @@
</view>
</view>
</view>
<prompt :visible.sync="promptVisible"
placeholder="请输入留言"
defaultValue=""
@confirm="clickPromptConfirm"
mainColor="#1296DB">
<!-- 这里放入slot内容-->
</prompt>
</view>
</template>
<script>
import Prompt from '@/components/prompt/index.vue';
import request from '@/util/request.js';
export default {
components: {
Prompt: Prompt
},
data() {
let noticeInfo = uni.getStorageSync('notice');
noticeInfo.fabulous = true;
@ -77,7 +91,10 @@
//
noMessage: false,
//
messageList: []
messageList: [],
//
promptVisible: false,
}
},
onLoad() {
@ -87,26 +104,48 @@
this.getMessageList()
},
methods: {
//
/**
* 点击留言弹出输入框确定
*/
clickPromptConfirm(message) {
request.post('/hs/addMessage',{
noticeId: this.noticeInfo.id,
userId: uni.getStorageSync("userInfo").user_id,
content: message
}).then(res=>{
console.log("新增留言结果",res);
if (res.data === 1) {
this.promptVisible = false;
uni.showToast({
icon: 'loading',
title: '留言成功',
});
setTimeout(()=>{
this.getMessageList();
},1000)
}
},err=>{
console.log("err",err);
})
},
/**
* 获取留言
*/
getMessageList() {
request.post('/hs/getOneContent',{id: this.noticeInfo.id})
.then(res=>{
this.noMessage = res.data.data.message.length === 0 ? true : false;
this.messageList = res.data.data.message;
this.noMessage = res.data.message.length === 0 ? true : false;
this.messageList = res.data.message;
console.log("一条数据数据",res);
},err=>{
console.log("err",err);
})
},
/**
* 新增留言打开弹框
*/
addMessage() {
request.post('/hs/addMessage',{
noticeId: this.noticeInfo.id
// userId:
}).then(res=>{
console.log("新增留言结果",res);
},err=>{
console.log("err",err);
})
this.promptVisible = true;
}
}
@ -114,6 +153,14 @@
</script>
<style scoped>
.content textarea{
background-color: #F1F1F1;
padding: 20rpx;
width: 100%;
border-radius: 10rpx;
text-indent: 40rpx;
min-height: 140rpx;
}
.message-title .left{
color: #a7a7a7;
}
@ -197,10 +244,5 @@
padding: 20rpx;
font-size: 36rpx;
}
.page{
margin: 20rpx;
background-color: #FFFFFF;
border-radius: 10rpx;
}
</style>

View File

@ -16,7 +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'>{{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-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view>
<text class="text-black text-lg">{{item.title}}</text>
</view>
</view>
@ -43,6 +45,7 @@
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';
export default {
components: {
mSearch,
@ -75,27 +78,32 @@ export default {
this.getAllData();
},
methods: {
//
/**
* 跳转详情页面
* @param {Object} item
*/
goToDetails(item) {
uni.setStorageSync("notice",item);
uni.navigateTo({
url: '/pages/tabbar/homepage/data-details'
})
},
//
/**
* 获取首页数据
*/
getAllData() {
request.post('/hs/getAllContent',{})
.then(res=>{
res.data.data.parentAdvice.forEach(item=>{
res.data.parentAdvice.forEach(item=>{
this.$set(item,'type','家长意见');
});
res.data.data.schoolNoticeList.forEach(item=>{
res.data.schoolNoticeList.forEach(item=>{
this.$set(item,'type','校园通知');
});
res.data.data.studentThinking.forEach(item=>{
res.data.studentThinking.forEach(item=>{
this.$set(item,'type','学生想法');
})
this.noticeList = res.data.data.parentAdvice.concat(res.data.data.schoolNoticeList, res.data.data.studentThinking);
this.noticeList = (res.data.parentAdvice.concat(res.data.schoolNoticeList, res.data.studentThinking)).sort(sortBy("release_time",false));
this.noData = this.noticeList.length === 0 ? true : false;
console.log("首页数据",this.noticeList);
},err=>{
@ -109,6 +117,7 @@ export default {
<style scoped>
.content {
min-height: 85vh;
padding-bottom: 100rpx;
}
.text-gray{
display: inline-block;

View File

@ -1,29 +1,151 @@
<template>
<view class="content">
页面 - 4
<view class="page">
<view class="cu-list menu-avatar">
<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
v-for="(item,index) in message"
:key="index"
@touchstart="ListTouchStart"
@touchmove="ListTouchMove"
@touchend="ListTouchEnd"
:data-target="'move-box-' + index"
@tap="goToMessage(item)">
<view class="header-photo">
{{item.userInfo.real_name.slice(0,1)}}
</view>
<view class="content">
<view class="text-grey">{{item.userInfo.real_name}}</view>
<view class="text-gray text-sm width">
{{item.letterList[item.letterList.length-1].content}}
</view>
</view>
<view class="action">
<view class="text-grey text-xs">{{item.letterList[item.letterList.length-1].letter_create_time}}</view>
<view class="cu-tag round bg-grey sm">{{item.unreadNumber}}</view>
</view>
<view class="move">
<view class="bg-red" @tap="deleteMessage">删除</view>
</view>
</view>
</view>
</view>
</template>
<script>
import request from '@/util/request.js';
export default {
data() {
return {
title: 'Hello'
modalName: null,
message: [],
}
},
onLoad() {
onShow() {
this.getPersonalPrivateLetter();
},
methods: {
/**
* 跳转到消息页面
* @param {Object} item
*/
goToMessage(item) {
uni.setStorageSync("messageInfo",item);
uni.navigateTo({
url: "/pages/tabbar/message/chat-page"
})
},
/**
* 删除私信
*/
deleteMessage() {
uni.showToast({
icon: 'loading',
title: '不能删除哦'
})
},
/**
* 获取私信
*/
getPersonalPrivateLetter() {
request.post('/hs/getPersonalPrivateLetterApp',{
userId: uni.getStorageSync("userInfo").user_id,
}).then(res => {
this.message = res.data;
this.message.forEach((item,index) => {
let unreadNumber = 0;
item.letterList.forEach(i => {
if (i.already_read === '0' && i.receive_id === uni.getStorageSync("userInfo").user_id) {
unreadNumber++;
}
});
item.unreadNumber = unreadNumber;
});
this.message.forEach((item,index) => {
if (item.userInfo.user_id === uni.getStorageSync("userInfo").user_id) {
this.message.splice(index,1);
}
});
console.log("私信",res);
},err=>{
console.log("err",err);
})
},
/**
* ListTouch触摸开始
* @param {Object} e
*/
ListTouchStart(e) {
this.listTouchStart = e.touches[0].pageX
},
/**
* ListTouch计算方向
* @param {Object} e
*/
ListTouchMove(e) {
this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > 0 ? 'right' : 'left'
},
/**
* ListTouch计算滚动
* @param {Object} e
*/
ListTouchEnd(e) {
if (this.listTouchDirection == 'left') {
this.modalName = e.currentTarget.dataset.target
} else {
this.modalName = null
}
this.listTouchDirection = null
}
}
}
</script>
<style>
.content {
<style scoped>
.width{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.cu-list.menu-avatar>.cu-item{
margin: 20rpx 0;
border-radius: 10rpx;
}
.cu-list.menu-avatar>.cu-item .action{
width: 160rpx;
}
.header-photo{
position: absolute;
left: 20rpx;
width: 100rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
height: 400upx;
margin-top: 200upx;
border-radius: 50%;
background-color: #1296DB;
color: #FFFFFF;
font-size: 40rpx;
font-weight: bold;
}
</style>

View File

@ -1,6 +1,34 @@
<template>
<view class="content">
页面 - 5
<view class="page">
<view class="top">
<view class="header-photo">
</view>
<view class="user-info">
<view class="name">
姓名裴浩宇
</view>
<view class="grade">
等级<text class="l">博客</text><text class="r">{{Math.floor(1520/1000)+1}}</text>
</view>
<view class="score">
积分1520
</view>
</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"
@tap="goToPage(item)">
<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
</view>
<text>{{item.name}}</text>
</view>
</view>
</view>
</view>
</template>
@ -8,22 +36,119 @@
export default {
data() {
return {
title: 'Hello'
gridCol: 3,
gridBorder: false,
cuIconList: [
{
cuIcon: 'favor',
color: 'orange',
name: '收藏',
code: 'collection'
},
{
cuIcon: 'list',
color: 'yellow',
name: '我的文章',
code: 'myArticle'
},
{
cuIcon: 'edit',
color: 'red',
name: '编辑信息',
code: 'personInfo'
},
{
cuIcon: 'settings',
color: 'olive',
name: '设置',
code: 'settings'
},
{
cuIcon: 'questionfill',
color: 'mauve',
badge: 0,
name: '帮助',
code: 'help'
},
]
}
},
onLoad() {
},
methods: {
/**
* 跳转页面
* @param {Object} item
*/
goToPage(item) {
const FUNCTION_CODE = {
'collection': '',
'myArticle': '/pages/tabbar/my/my-article/my-article',
'personInfo': '',
'settings': '',
'help': ''
}
uni.navigateTo({
url: `${FUNCTION_CODE[item.code]}`
})
console.log(item)
}
}
}
</script>
<style>
.content {
<style scoped>
.bottom{
display: flex;
flex-flow: column;
}
.grade .r, .grade .l{
font-size: 14rpx;
padding: 5rpx;
border-radius: 5rpx;
}
.grade .l{
background-color: #9DC75F;
}
.grade .r{
background-color: #2D5315;
}
.user-info view{
padding: 10rpx 50rpx;
}
.user-info{
color: #FFFFFF;
display: flex;
flex-flow: column;
justify-content: center;
border: 1rpx solid #b0b0b0;
border-radius: 10rpx;
width: 60%;
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;
height: 400upx;
margin-top: 200upx;
line-height: 180rpx;
margin: 20rpx;
}
.top{
display: flex;
justify-content: space-between;
padding-bottom: 40rpx;
border-bottom: 1rpx solid rgba(18,150,219,0.5);
}
.page{
padding: 20rpx;
display: flex;
flex-flow: column;
background-color: #FFFFFF;
}
</style>

View File

@ -1,139 +1,133 @@
<template>
<view class="content" :class="{'active':active}">
<image class="logo" :class="{'active':active}" src="../../../static/logo.png" mode="aspectFit"></image>
<view class="tabbar-box-wrap">
<view class="tabbar-box">
<view class="tabbar-box-item" @click="goToPage('/pages/release-detial/release-release/release-release')">
<image class="box-image" src="../../../static/img/release.png" mode="aspectFit"></image>
<text class="explain">发图文</text>
</view>
<view class="tabbar-box-item" @click="goToPage('/pages/release-detial/release-release/release-video')">
<image class="box-image" src="../../../static/img/video.png" mode="aspectFit"></image>
<text class="explain">发视频</text>
</view>
<view class="tabbar-box-item" @click="goToPage('/pages/release-detial/release-release/release-qa')">
<image class="box-image" src="../../../static/img/qa.png" mode="aspectFit"></image>
<text class="explain">提问</text>
</view>
<view class="page">
<view class="cu-item height">
<view class="action">
<text class="text-black">文章名称</text>
</view>
</view>
<view class="cu-item title">
<textarea placeholder="请输入文章名称"
v-model="noticeInfo.title"
maxlength=50
></textarea>
</view>
<view class="cu-item height">
<view class="action">
<text class="text-black">文章标签</text>
</view>
</view>
<view class="cu-item label">
<textarea placeholder="请输入文章标签"
v-model="noticeInfo.label"
maxlength=4
></textarea>
</view>
<view class="cu-item">
<view class="action">
<text class="text-black">文章内容</text>
</view>
</view>
<view class="cu-item content">
<textarea placeholder="请输入文章内容"
v-model="noticeInfo.content"
auto-height="true"
maxlength=2000
></textarea>
</view>
<view class="button">
<button type="default" @tap="preservation">发表</button>
</view>
</view>
</template>
</template>
<script>
export default {
data() {
return {
active: false
};
},
onLoad() {},
onShow() {
// setTimeout(() => {
this.active = true;
// }, 500);
},
onHide() {
this.active = false;
},
methods: {
goToPage(url) {
if (!url) return;
uni.navigateTo({
url
});
}
}
};
</script>
<style lang="scss" scoped>
.content {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
/* #ifdef H5 */
height: calc(100vh - var(--window-bottom) - var(--window-top));
/* #endif */
/* #ifndef H5 */
height: 100vh;
/* #endif */
transition: opacity 0.3s;
background: #999;
opacity: 0;
&.active {
opacity: 1;
}
.logo {
position: relative;
margin-top: -400upx;
width: 200upx;
height: 200upx;
// z-index: -1;
opacity: 0;
transition: opacity 0.3s;
&.active {
opacity: 1;
}
}
}
.tabbar-box-wrap {
position: absolute;
width: 100%;
padding: 50upx;
box-sizing: border-box;
bottom: 0;
left: 0;
.tabbar-box {
position: relative;
display: flex;
width: 100%;
background: #fff;
border-radius: 20upx;
padding: 15upx 20upx;
box-sizing: border-box;
z-index: 2;
box-shadow: 0px 2px 5px 2px rgba(0, 0, 0, 0.1);
&:after {
content: '';
position: absolute;
bottom: -16upx;
left: 0;
right: 0;
margin: auto;
width: 50upx;
height: 50upx;
transform: rotate(45deg);
background: #fff;
z-index: 1;
box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, 0.1);
border-radius: 2px;
}
&:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #ffffff;
border-radius: 20upx;
z-index: 2;
}
.tabbar-box-item {
// position: relative;
width: 100%;
z-index: 3;
margin: 10upx;
color: $uni-color-subtitle;
text-align: center;
font-size: $uni-font-size-base;
.box-image {
width: 100%;
height: $uni-img-size-lg;
import request from '@/util/request.js';
export default {
components: {
},
data() {
return {
//
noticeInfo: {
title: '',
label: '',
content: ''
},
}
},
onShow() {
this.noticeInfo = {
title: '',
label: '',
content: ''
}
},
mounted() {
},
methods: {
/**
* 发表
*/
preservation() {
const NOTICE_TYPE = {
"学生": "学生想法",
"家长": "家长建议",
"教师": "校园通知"
}
request.post('/hs/addArticle',{
id: this.noticeInfo.id,
label: this.noticeInfo.label,
title: this.noticeInfo.title,
content: this.noticeInfo.content,
release_id: uni.getStorageSync("userInfo").user_id,
type: NOTICE_TYPE[uni.getStorageSync("userInfo").user_type]
}).then(res => {
console.log("发表文章",res);
if (res.data === 1) {
uni.showToast({
icon: 'loading',
title: '发表成功'
});
setTimeout(() => {
uni.switchTab({
url: '/pages/tabbar/homepage/homepage'
});
},1000)
}
},err=>{
console.log("err",err);
})
}
}
}
}
</script>
<style scoped>
.button{
padding: 40rpx 100rpx 80rpx;
}
.cu-item{
padding: 20rpx;
}
.title{
padding-top: 0;
}
.title textarea, .label textarea, .content textarea{
background-color: #F1F1F1;
padding: 20rpx;
width: 100%;
border-radius: 10rpx;
}
.title textarea{
height: 128rpx;
font-weight: bold;
}
.label textarea{
height: 80rpx;
}
.content textarea{
min-height: 400rpx;
text-indent: 40rpx;
}
</style>

View File

@ -1,81 +0,0 @@
.uni-list-item__content-title{
/* padding-bottom: 20rpx; */
/* border-bottom: 1rpx solid #F6F6F6; */
font-size: 30rpx!important;
}
.uni-list-item__content-note{
font-size: 30rpx!important;
}
.uni-list-item__container:after{
background-color: rgba(0,0,0,0)!important;
}
.uni-btn-icon{
color: #FFFFFF!important;
}
uni-page-body .content{
padding: 0!important;
}
uni-page-body .content .list{
background-color: #F1F1F1!important;
padding-top: 1rpx;
}
uni-page-body .content .list .one{
margin: 20rpx;
border-radius: 10rpx;
}
.uni-list-item{
padding: 20rpx!important;
margin: 20rpx!important;
background: #FFFFFF!important;
border-radius: 10rpx;
}
.uni-list{
background-color: #F1F1F1!important;
}
.content-top{
margin-top: 10rpx;
}
.green-button{
background-color: #1D9081!important;
color: #FFFFFF;
}
.uni-radio-input-checked{
background-color: rgb(113,217,177)!important;
border-color: rgb(113,217,177)!important;
}
.uni-checkbox-input{
border-color: rgb(165, 165, 165)!important;
}
uni-checkbox.checked .uni-checkbox-input{
background-color: rgb(113,217,177)!important;
border-color: rgb(113,217,177)!important;
}
.search{
z-index: 999;
padding: 20rpx 20rpx 68rpx 20rpx!important;
border-bottom: 0!important; }
.search .content .uni-input-input{
text-align: left!important;
}
.search .content{
padding-bottom: 0;
position: fixed;
z-index: 999;
width: 96%!important;
}
.uni-picker-container .uni-picker-action.uni-picker-action-confirm{
color: #1D9081;
}
.cu-list .cu-item .text-black{
position: absolute;
display: inline-block;
width: 450rpx!important;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.uni-input-input{
text-align: right!important;
}

View File

@ -54,11 +54,4 @@ const sortBy = function(attr,rev){
return 0;
}
};
export { sortBy }
//获取专业列表
const getMajorList = function() {
let majorList = request.get('/rest/v2/services/saftyedutrain_AppOnlineQAService/getMajor')
return majorList;
};
export { getMajorList }
export { sortBy }

View File

@ -14,9 +14,15 @@ const get = (url, data) => {
dataType: 'json',
}
let promise = new Promise(function(resolve, reject) {
uni.request(httpDefaultOpts).then(
(res) => {
resolve(res[1])
uni.request(httpDefaultOpts).then((res) => {
if (res[1].data.success === true && res[1].data.data !== null) {
resolve(res[1].data)
} else {
uni.showToast({
icon: 'none',
title: '服务器出现异常'
});
}
}
).catch(
(response) => {
@ -38,9 +44,14 @@ const post = (url, data) => {
dataType: 'json',
}
let promise = new Promise(function(resolve, reject) {
uni.request(httpDefaultOpts).then(
(res) => {
resolve(res[1])
uni.request(httpDefaultOpts).then((res) => {
if (res[1].data.success === true && res[1].data.data !== null) {
resolve(res[1].data)
} else {
resolve({
message: "服务器出现异常"
})
}
}
).catch(
(response) => {