This commit is contained in:
ChuShiZ 2024-09-29 20:36:25 +08:00
parent fd481ef1bf
commit f2a2898a7e
4 changed files with 29 additions and 823 deletions

View File

@ -19,7 +19,7 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/M/M", "path": "pages/M/M",
"style": { "style": {
@ -222,13 +222,6 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "pages/detection/managelist",
"style": {
"navigationBarTitleText": "编辑列表",
"navigationStyle": "custom"
}
},
{ {
"path": "pages/detection/detelist", "path": "pages/detection/detelist",
"style": { "style": {
@ -243,13 +236,6 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "pages/detection/newsadd",
"style": {
"navigationBarTitleText": "发文",
"navigationStyle": "custom"
}
},
{ {
"path": "pages/detection/detedetails", "path": "pages/detection/detedetails",
@ -308,4 +294,4 @@
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"uniIdRouter": {} "uniIdRouter": {}
} }

View File

@ -33,7 +33,7 @@
<view class="t-zi" v-html="item.newsContent"></view> <view class="t-zi" v-html="item.newsContent"></view>
</view> </view>
</view> </view>
<view class="c-b-bom"> <view class="c-b-bom">
<view class="b-left">{{item.createTime.substring(0,item.createTime.length - 3)}}</view> <view class="b-left">{{item.createTime.substring(0,item.createTime.length - 3)}}</view>
<view class="b-right"> <view class="b-right">
@ -49,18 +49,18 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 悬浮按钮 --> <!--&lt;!&ndash; 悬浮按钮 &ndash;&gt;-->
<view class="fab-z1" v-if="fab == true"> <!--<view class="fab-z1" v-if="fab == true">-->
<image src="http://www.nuoyunr.com/lananRsc/detection/fw.png" @click="getnewadd()"></image> <!-- <image src="http://www.nuoyunr.com/lananRsc/detection/fw.png" @click="getnewadd()"></image>-->
</view> <!--</view>-->
<view class="fab-z2" v-if="fab == true"> <!--<view class="fab-z2" v-if="fab == true">-->
<image src="http://www.nuoyunr.com/lananRsc/detection/gl.png" @click="getguanli()"></image> <!-- <image src="http://www.nuoyunr.com/lananRsc/detection/gl.png" @click="getguanli()"></image>-->
</view> <!--</view>-->
<view class="q-fab" v-if="jcgfRole == true"> <!--<view class="q-fab">-->
<image src="http://www.nuoyunr.com/lananRsc/detection/fab.png" v-if="fab == false" @click="getfab()"></image> <!-- <image src="http://www.nuoyunr.com/lananRsc/detection/fab.png" v-if="fab == false" @click="getfab()"></image>-->
<image src="http://www.nuoyunr.com/lananRsc/detection/xz.png" v-if="fab == true" @click="getfab()"></image> <!-- <image src="http://www.nuoyunr.com/lananRsc/detection/xz.png" v-if="fab == true" @click="getfab()"></image>-->
</view> <!--</view>-->
<!-- 悬浮按钮 结束--> <!-- 悬浮按钮 结束-->
<!-- <tabBar></tabBar> --> <!-- <tabBar></tabBar> -->
</view> </view>
@ -123,7 +123,7 @@
title: '没有下一页数据', title: '没有下一页数据',
icon: 'none' icon: 'none'
}) })
} else { } else {
this.pageNum++ this.pageNum++
this.arrlist=[] this.arrlist=[]
@ -136,7 +136,7 @@
url: '/appInspection/news/listGfClass', url: '/appInspection/news/listGfClass',
method: 'get' method: 'get'
}) })
this.typeList = typeRes.data this.typeList = typeRes.data
}, },
getfab() { getfab() {
@ -151,7 +151,7 @@
getback(){ getback(){
uni.navigateBack({ uni.navigateBack({
delta:1, delta:1,
}) })
}, },
async getlistindex(){ async getlistindex(){
// //
@ -179,8 +179,8 @@
this.arrlist = res.rows this.arrlist = res.rows
} }
let total = res.total let total = res.total
this.totalPages = Math.ceil(total / this.pageSize); this.totalPages = Math.ceil(total / this.pageSize);
}, },
getdetails(id){ getdetails(id){
uni.navigateTo({ uni.navigateTo({
@ -204,9 +204,9 @@
url:'/pages/detection/managelist?type=hygg' url:'/pages/detection/managelist?type=hygg'
}) })
} }
} }
} }
</script> </script>
@ -314,7 +314,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.t-right{ .t-right{
width: 60%; width: 60%;
@ -323,7 +323,7 @@
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -334,10 +334,10 @@
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
color: #5e5e5e; color: #5e5e5e;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.t-zi{ .t-zi{
font-size: 14px; font-size: 14px;
@ -345,7 +345,7 @@
color: #666666; color: #666666;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
@ -418,6 +418,6 @@
border-style:solid; border-style:solid;
border-width:2px; border-width:2px;
font-size: 15px; font-size: 15px;
} }
</style> </style>

View File

@ -1,346 +0,0 @@
<!-- 默认复制 -->
<template>
<view class="content">
<view class="c-top">
<view class="" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<view class="c-title">编辑</view>
<view class=""></view>
</view>
<view class="cont">
<view class="c-box" v-for="(item,index) in arrlist" :key="index">
<!-- -->
<view class="c-b-top" @click="getdetails(item.id)">
<view class="t-left">
<image :src="imgs + item.newsCover" mode=""></image>
</view>
<view class="t-right">
<view class="t-tilte">{{item.newsTitle}}</view>
<!-- <view class="t-zi">{{item.newsContent}}</view> -->
<view class="t-zi" v-html="item.newsContent"></view>
</view>
</view>
<!-- -->
<view class="c-b-bom">
<view class="b-left">{{item.createTime}}</view>
<view class="b-right">
<view class="z-lv" @click="getdetails(item.id)">
<view class="">编辑</view>
</view>
<view class="y-hong" @click="dialogToggle(item.id)">
<view class="">删除</view>
</view>
</view>
</view>
</view>
</view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="同意" title="通知" content="确认删除" @confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog>
</uni-popup>
<uni-popup ref="message" type="message">
<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
</uni-popup>
<!-- 悬浮按钮 结束-->
<!-- <tabBar></tabBar> -->
</view>
</template>
<script>
import config from '@/config'
import request from '../../utils/request';
import tabBar from'../../components/detection/tabBar.vue'
export default{
data(){
return{
deleteid:'',
msgType: 'success',
isOpen: false,
fab:false,
imgs:'',
arrlist:[],
animationData: {},
isRote: false,
animation: null,
msgType: 'success',
messageText: '删除成功',
}
},
components:{
tabBar,
},
onLoad(option) {
this.type = option.type
},
mounted() {
this.getlistindex()
this.imgs = this.$baseUrl
},
methods:{
dialogToggle(id) {
this.deleteid = id
this.$refs.alertDialog.open()
},
dialogClose() {
console.log('点击关闭')
},
async dialogConfirm() {
console.log('点击确认')
let data ={
id : this.deleteid
}
let res = await request({
url:'/appInspection/news/del',
method: 'post',
params:data
})
if(res.code == 200){
this.$refs.message.open()
this.getlistindex()
}
},
getfab() {
this.fab = !this.fab
let rota = 0;
if (this.isRote) {
rota = 90;
this.isRote = false;
} else {
this.isRote = true;
}
this.animation = uni.createAnimation();
this.animation.rotate(rota).step()
this.animationData = this.animation.export()
},
getback(){
uni.navigateBack({
delta:1,
})
},
async getlistindex(){
//
let res = await request({
url: '/appInspection/news/ownList?type='+this.type,
method: 'get',
})
this.arrlist = res.rows
},
getnewadd(){
//
uni.navigateTo({
url:'/pages/detection/newsadd'
})
},
getdetails(id){
uni.navigateTo({
url:'/pages/detection/editadd?id='+id+'&type='+this.type
})
}
}
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 45px;
}
.q-fab{
position: fixed;
bottom: 50px;
right: 15px;
width: 55px;
height: 55px;
border-radius: 50%;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.fab-z1{
position: fixed;
bottom: 115px;
right: 15px;
width: 50px;
height: 50px;
border-radius: 50%;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.fab-z2{
position: fixed;
bottom: 50px;
right: 80px;
width: 50px;
height: 50px;
border-radius: 50%;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.top-icon{
margin-bottom: 45px;
}
.c-top{
width: 100%;
box-sizing: border-box;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
}
.c-title{
font-size: 18px;
font-weight: bold
}
.cont{
width: 100%;
padding: 15px;
box-sizing: border-box;
}
.c-box{
width: 100%;
box-sizing: border-box;
padding: 7px;
background-color: white;
margin-bottom: 10px;
border-radius: 10px;
}
.c-b-top{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.t-left{
width: 130px;
height: 75px;
border-radius: 7px;
// background: #DDDDDD;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.t-right{
width: 60%;
}
.t-tilte{
font-size: 16px;
font-weight: bold;
color: #333333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.t-zi{
font-size: 14px;
font-weight: 400;
color: #666666;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.c-b-bom{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
}
.b-left{
color: #0D2E8D;
font-size: 14px;
}
.b-right{
display: flex;
justify-content: space-between;
align-items: center;
}
.z-lv{
display: flex;
align-items: center;
color: #43A045;
font-size: 15px;
margin-right: 20px;
}
.y-hong{
display: flex;
align-items: center;
color: #FF7272;
font-size: 15px;
margin-right: 15px;
}
.z-img{
width: 20px;
height: 15px;
image{
width: 100%;
height: 100%;
}
margin-right: 2px;
}
// .asdis{
// position: fixed;
// right: 10px;
// bottom: 30px;
// .view{
// transform: rotate(90deg);
// .fab-z1 {
// position: absolute;
// bottom: 90px;
// right: 15px;
// width: 50px;
// height: 50px;
// border-radius: 50%;
// overflow: hidden;
// image {
// width: 100%;
// height: 100%;
// }
// }
// .fab-z2 {
// position: absolute;
// bottom: 15px;
// right: 80px;
// width: 50px;
// height: 50px;
// border-radius: 50%;
// overflow: hidden;
// image {
// width: 100%;
// height: 100%;
// }
// }
// }
// }
</style>

View File

@ -1,434 +0,0 @@
<!-- 发起订单 -->
<template>
<view class="content">
<view class="c-top">
<view class="" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<view class="c-title">发布</view>
<view class=""></view>
</view>
<view class="dil">
<!-- 填空 -->
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 标题</view>
<view class="you">
<input type="text" placeholder="请输入标题" v-model="newsTitle">
</view>
</view>
<!-- 填空 -->
<!-- <view class="tinput">
<view class="text1"> <text class="hong1">*</text> 发布单位</view>
<view class="you">
<input type="text" placeholder="请发布单位 "v-model="publishUnit" >
</view>
</view> -->
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 封面图</view>
<view class="you">
<text>请上传封面图片</text>
<!-- <input type="text" placeholder="请上传封面图片"> -->
</view>
</view>
<!-- 上传图片 -->
<u-upload
:fileList="fileList1"
@afterRead="afterRead"
@delete="deletePic"
name="1"
multiple
:previewFullImage="true"
:maxCount="1"
></u-upload>
<view class="xinput">
<Rboy-editor ref="RboyEditor" @uploadFile="uploadFile" :count="6"></Rboy-editor>
</view>
<view class="xinput" v-if="type == 'hygg'">
<view class="text1"> <text class="hong1">*</text> 分类</view>
<view class="xz">
<view :class="{'xlan':maneizhi == index}" class="kuang" v-for="(item,index) in taplist" :key="index" @click="getzhi2(index,item.dictValue)">
<view class="">{{item.dictLabel}}</view>
</view>
</view>
</view>
<view class="tinput">
<view class="text1"> 上传视频</view>
<view class="you">
<text>请上传视频</text>
<!-- <input type="text" placeholder="请上传视频"> -->
</view>
</view>
<!-- 上传视频 -->
<u-upload
:fileList="fileList2"
@afterRead="afterRead1"
@delete="deletePic1"
name="2"
multiple
:maxCount="1"
accept="video"
:previewFullImage="true"
></u-upload>
<view class="anniu" @click="getnewsadd()">
<text>发布文章</text>
</view>
<view style="width: 100%; height: 60px;"></view>
</view>
</view>
</template>
<script>
import RboyEditor from "@/components/Rboy-editor/Rboy-editor"
import request from '../../utils/request'
import config from '@/config'
import upload from '@/utils/upload.js'
export default{
data(){
return{
baseUrl:this.$baseUrl,
fileList1: [],
fileList2: [],
newsCover:'',
videoUrl:'',
newsTitle:'',
publishUnit:'',
newsContent:'',
dictValue:'',
type:'hmzc',
id:1,
carzhi:0,
maneizhi:0,
taplist:[],
}
},
onLoad(option) {
this.id = option.id
this.type = option.type
},
mounted() {
this.gettap()
console.log('????????',this.$baseUrl);
},
components:{
RboyEditor,
},
methods:{
async set_content() {
this.$refs.RboyEditor.editor_setContents(this.detail)
},
//
async get_content() {
this.newsContent = await this.$refs.RboyEditor.editor_getcontents()
console.log( this.newsContent)
},
//
async uploadFile(event) {
let that = this
console.log(event);
// event
for (var item in event.tempFilePaths) {
// uploadFileApi count1 使 await
upload({
url:'/common/upload',
filePath: event.tempFilePaths[item],
}).then((res)=>{
console.log(res)
that.$refs.RboyEditor.editor_insertImage({
src: this.baseUrl + res.fileName,
alt: "图像",
})
})
}
},
async gettap(){
//
let ress = await request({
url: '/appInspection/news/editType',
method: 'get',
})
console.log(ress);
this.taplist = ress.data
this.dictValue = ress.data[0].dictValue
},
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
console.log(url);
upload({
url:'/common/upload',
filePath: url,
}).then((res)=>{
this.newsCover = res.fileName
console.log(res);
})
},
deletePic1(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead1(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise1(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise1(url) {
console.log(url);
upload({
url:'/common/upload',
filePath: url,
}).then((res)=>{
this.videoUrl = res.fileName
console.log(this.videoUrl);
})
},
//
async getnewsadd(){
this.newsContent = await this.$refs.RboyEditor.editor_getcontents()
if(this.newsTitle==''||this.newsCover==''||this.newsContent==''){
uni.showToast({
title:'必填项不能有空!',
icon:'none'
})
return
}
let data={
newsTitle:this.newsTitle,
newsCover:this.newsCover,
newsContent:this.newsContent,
videoUrl:this.videoUrl,
category:this.dictValue,
type:this.type,
}
let res = await request({
url: '/appInspection/news/add',
method: 'post',
data:data
})
if(res.code == 200){
uni.showToast({
title:'发布成功,三秒后返回'
})
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 3000);
}
console.log(res);
},
getback(){
uni.navigateBack({
delta:1,
})
},
getzhi(index){
this.carzhi = index
},
getzhi2(index,dictValue){
this.dictValue =dictValue
this.maneizhi = index
},
}
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 45px;
}
.dil{
box-sizing: border-box;
background-color: #F6F6F6;
padding: 0px 12px;
}
.top-icon{
margin-bottom: 45px;
}
.c-top{
width: 100%;
box-sizing: border-box;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
}
.c-title{
font-size: 18px;
font-weight: bold
}
.top{
box-sizing: border-box;
padding: 0px 15px;
width: 100%;
background-color: white;
}
.top-box{
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 20px 0px;
}
.tb-left{
height: 100%;
width: 80%;
display: flex;
align-items: center;
}
.uicon{
width: 18px;
height: 18px;
border-radius: 4px;
color: white;
background: orangered;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
font-weight: bold;
margin-right: 6px;
}
.tb-right{
width: 20px;
height: 26px;
image{
width: 100%;
height: 100%;
}
}
.text1{
font-size: 16px;
font-weight: bold;
color: #363636;
}
.hong1{
margin-top: 5px;
font-size: 12px;
font-weight: 400;
color: #FF5453;
}
.hong2{
margin-top: 5px;
font-size: 12px;
font-weight: 400;
}
.tinput{
width: 100%;
display: flex;
background: white;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 16px;
margin-top: 14px;
margin-bottom: 14px;
}
.xinput{
width: 100%;
background: white;
box-sizing: border-box;
padding: 16px;
margin-top: 14px;
}
.you{
text-align: right;
}
.xz{
margin-top: 10px;
display: flex;
align-items: center;
}
.kuang{
width: 80px;
height: 23px;
background: #ECECEC;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
color: #666666;
font-size: 14px;
margin-right: 15px;
}
.xlan{
background: #CDE7FF !important;
color: #1D62FF !important;
border: 1px solid #2A96FE;
}
.anniu{
width: 100%;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);
border-radius: 50px ;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
color: #542F0E;
margin-top: 20px;
color: white;
}
</style>