13 changed files with 809 additions and 32 deletions
@ -0,0 +1,79 @@ |
|||
<template> |
|||
<view> |
|||
<view class="nav_area"></view> |
|||
<view class="wrapper"> |
|||
<view class="title">{{title}}</view> |
|||
<view class="time">{{create_time}}</view> |
|||
<view class="content"> |
|||
<text v-html="content"></text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import API from '@/common/js/api.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
title: '关于中奖概率调整问题', |
|||
create_time: '发布时间:2023.08.10 23:00:00', |
|||
content: `关于中奖概率调整问题关于中奖概率调整问题关于中奖概率调整问题关于中奖概率调整问题关于中奖概率 |
|||
调整问题关于中奖概率调整问题` |
|||
} |
|||
}, |
|||
onLoad(e) { |
|||
this.id = e.id; |
|||
this.getDetail(); |
|||
}, |
|||
methods: { |
|||
getDetail(){ |
|||
API.request('/index/getNoticeInfo', {id: this.id}, res=>{ |
|||
this.title = res.data.title; |
|||
this.create_time = res.data.create_time; |
|||
this.content = res.data.content; |
|||
}) |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.nav_area { |
|||
position: fixed; |
|||
top: 0px; |
|||
left: 0px; |
|||
z-index: 99; |
|||
background-color: #fff; |
|||
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.05); |
|||
width: 700rpx; |
|||
height: 88rpx; |
|||
padding: 0px 25rpx; |
|||
padding-top: var(--status-bar-height); |
|||
box-sizing: content-box; |
|||
color: #b0b0b0; |
|||
font-size: 14px; |
|||
|
|||
} |
|||
.wrapper{ |
|||
text-align: center; |
|||
padding: 10px 20px; |
|||
|
|||
.title{ |
|||
font-size: 16px; |
|||
line-height: 50px; |
|||
} |
|||
.time{ |
|||
font-size: 12px; |
|||
color: #999; |
|||
} |
|||
.content{ |
|||
font-size: 14px; |
|||
text-align: justify; |
|||
text-indent: 30px; |
|||
line-height: 24px; |
|||
margin: 20px 0px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,165 @@ |
|||
<template> |
|||
<view> |
|||
<view class="nav_area"></view> |
|||
<view class="setPage"> |
|||
<view class=""> |
|||
<view class="banner_area"> |
|||
<!-- <swiper class="" v-if="editInfo.banner.length>0" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"> |
|||
<swiper-item v-for="(item, index) in editInfo.banner"> |
|||
<image class="swiper-item" :src="item.url"></image> |
|||
</swiper-item> |
|||
</swiper> --> |
|||
<view class="" v-if="editInfo.image"> |
|||
<image class="" :src="editInfo.image"></image> |
|||
</view> |
|||
<text v-else @click="addImg">点击添加轮播图</text> |
|||
</view> |
|||
<view style="" class=""> |
|||
<view class="input_box"> |
|||
<text>名称:</text> |
|||
<input type="text" v-model="editInfo.title" placeholder="请输入轮播名称" placeholder-style="color: #999;"> |
|||
</view> |
|||
<view class="input_box"> |
|||
<text>排序:</text> |
|||
<input type="text" v-model="editInfo.sort" placeholder="请输入轮播排序,数字越小,位置越前" placeholder-style="color: #999;"> |
|||
</view> |
|||
</view> |
|||
<view class="submit" @click="confirm()"> |
|||
确定发布 |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import API from '@/common/js/api.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
id: '', |
|||
editInfo: {title:'',sort:'', image: ''}, |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
addImg(){ |
|||
uni.chooseImage({ |
|||
count: 1, |
|||
success: (chooseImageRes) => { |
|||
const tempFilePaths = chooseImageRes.tempFilePaths; |
|||
uni.uploadFile({ |
|||
url: 'http://192.168.66.221:8000'+'/rotationChart/upload', |
|||
filePath: tempFilePaths[0], |
|||
name: 'file', |
|||
header: { |
|||
token: uni.getStorageSync('user_token') |
|||
}, |
|||
formData: { |
|||
'image': tempFilePaths[0] |
|||
}, |
|||
success: (uploadFileRes) => { |
|||
console.log(uploadFileRes.data); |
|||
// this.editInfo.image |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
confirm(){ |
|||
let data = { |
|||
id: this.id||'', |
|||
title: this.editInfo.title, |
|||
sort: this.editInfo.sort, |
|||
image: this.editInfo.image |
|||
}; |
|||
API.request('/rotationChart/save', data, res=>{ |
|||
uni.showToast({ |
|||
title: res.msg |
|||
}) |
|||
setTimeout(()=>{ |
|||
uni.navigateBack({ |
|||
delta: 1 |
|||
}) |
|||
}, 1500) |
|||
|
|||
}) |
|||
}, |
|||
}, |
|||
onLoad(e) { |
|||
if(e){ |
|||
this.id = e.id; |
|||
this.editInfo.title = e.title; |
|||
this.editInfo.image = e.image; |
|||
this.editInfo.sort = e.sort; |
|||
} |
|||
|
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.nav_area { |
|||
position: fixed; |
|||
top: 0px; |
|||
left: 0px; |
|||
z-index: 99; |
|||
background-color: #fff; |
|||
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.05); |
|||
width: 700rpx; |
|||
height: 88rpx; |
|||
padding: 0px 25rpx; |
|||
padding-top: var(--status-bar-height); |
|||
box-sizing: content-box; |
|||
color: #b0b0b0; |
|||
font-size: 14px; |
|||
} |
|||
.setPage{ |
|||
padding: 40rpx; |
|||
font-size: 14px; |
|||
color: #999; |
|||
} |
|||
.banner_area{ |
|||
width: 670rpx; |
|||
height: 248rpx; |
|||
border: 1px solid #eee; |
|||
border-radius: 5px; |
|||
text-align: center; |
|||
line-height: 248rpx; |
|||
overflow: hidden; |
|||
|
|||
image{ |
|||
width: 670rpx; |
|||
height: 248rpx; |
|||
} |
|||
} |
|||
.input_box{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
margin-top: 40rpx; |
|||
|
|||
input{ |
|||
width: 572rpx; |
|||
height: 80rpx; |
|||
border: 1px solid #eee; |
|||
border-radius: 5px; |
|||
padding: 0px 10px; |
|||
box-sizing: border-box; |
|||
color: #444; |
|||
} |
|||
} |
|||
.submit{ |
|||
width: 670rpx; |
|||
height: 88rpx; |
|||
border-radius: 10px; |
|||
font-size: 14px; |
|||
text-align: center; |
|||
line-height: 88rpx; |
|||
color: #fff; |
|||
background-color: #e33837; |
|||
position: fixed; |
|||
bottom: 40rpx; |
|||
} |
|||
|
|||
</style> |
|||
@ -0,0 +1,130 @@ |
|||
<template> |
|||
<view> |
|||
<view class="nav_area"></view> |
|||
<view class="setPage"> |
|||
<view v-for="(item,index) in setList" :key="index" class="set_item"> |
|||
<view class="icon_new"><image :src="item.image" mode=""></image></view> |
|||
<view style="flex:1;" class="flex-col"> |
|||
<view class="box3"><text>轮播名称:</text>{{item.title}}</view> |
|||
<view class=""><text>排序:</text>{{item.sort}}%</view> |
|||
</view> |
|||
<view style="" class="flex-col"> |
|||
<view class="red" @click="edit(item,index)">编辑</view> |
|||
<text class="" @click="remove(item,index)">删除</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import API from '@/common/js/api.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
setList: [ |
|||
{title:'诚邀你一起中百胜多负少的',sort:'1'}, |
|||
{title:'0万元',sort:'2'}, |
|||
{title:'10万元',sort:'3'}, |
|||
{title:'20000万元',sort:'4'} |
|||
|
|||
], |
|||
page: 1 |
|||
} |
|||
}, |
|||
methods: { |
|||
edit(val, i){ |
|||
uni.navigateTo({ |
|||
url: './addBanner?id='+val.id+'&image='+val.image+'&title='+val.title+'&sort='+val.sort |
|||
}) |
|||
}, |
|||
remove(val, i){ |
|||
let _this = this; |
|||
uni.showModal({ |
|||
title:'温馨提示', |
|||
content:"确定是否删除该信息", |
|||
success() { |
|||
API.request('/rotationChart/delete', {id: val.id}, res=>{ |
|||
uni.showToast({ |
|||
title: res.msg |
|||
}) |
|||
_this.setList.splice(i, 1); |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
getList(){ |
|||
API.request('/rotationChart/list', {page:this.page, limit: 10}, res=>{ |
|||
this.setList = res.data.list; |
|||
}) |
|||
|
|||
} |
|||
}, |
|||
onLoad(e) { |
|||
this.getList(); |
|||
}, |
|||
onNavigationBarButtonTap() { |
|||
uni.navigateTo({ |
|||
url: './addBanner' |
|||
}) |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.nav_area { |
|||
position: fixed; |
|||
top: 0px; |
|||
left: 0px; |
|||
z-index: 99; |
|||
background-color: #fff; |
|||
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.05); |
|||
width: 700rpx; |
|||
height: 88rpx; |
|||
padding: 0px 25rpx; |
|||
padding-top: var(--status-bar-height); |
|||
box-sizing: content-box; |
|||
color: #b0b0b0; |
|||
font-size: 14px; |
|||
} |
|||
.setPage{ |
|||
padding: 0px 40rpx; |
|||
font-size: 14px; |
|||
color: #444; |
|||
} |
|||
.set_item{ |
|||
height: 96rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
padding: 20px 0px; |
|||
// border-bottom: 1px solid #ebebeb; |
|||
|
|||
.icon_new{ |
|||
width: 220rpx; |
|||
height: 96rpx; |
|||
margin-right: 18rpx; |
|||
image{ |
|||
width: 220rpx; |
|||
height: 96rpx; |
|||
border-radius: 10px; |
|||
background-color: #000; |
|||
} |
|||
} |
|||
text{ |
|||
color: #999; |
|||
} |
|||
.box3{ |
|||
display: -webkit-box;//将盒子转换为弹性盒子
-webkit-box-orient: vertical;//文本显示方式,默认水平
-webkit-line-clamp: 1;//设置显示多少行
overflow: hidden; |
|||
} |
|||
.flex-col{ |
|||
height: 100%; |
|||
display: flex;flex-direction: column; |
|||
justify-content: space-between; |
|||
} |
|||
.red{ |
|||
color: #E33837; |
|||
} |
|||
} |
|||
|
|||
</style> |
|||
@ -0,0 +1,135 @@ |
|||
<template> |
|||
<view> |
|||
<view class="nav_area"></view> |
|||
<view class="setPage"> |
|||
<view class=""> |
|||
<view style="" class=""> |
|||
<view class="input_box"> |
|||
<text>标题:</text> |
|||
<input type="text" v-model="editInfo.title" placeholder="请输入内容" placeholder-style="color: #999;"> |
|||
</view> |
|||
<!-- <view class="input_box"> |
|||
<text>排序:</text> |
|||
<input type="text" v-model="editInfo.sort" placeholder="请输入轮播排序,数字越小,位置越前" placeholder-style="color: #999;"> |
|||
</view> --> |
|||
<view class="input2_box"> |
|||
<text class="label">描述内容:</text> |
|||
<textarea name="" id="" cols="30" rows="10" placeholder="请输入描述内容" |
|||
placeholder-style="color: #999;" v-model="editInfo.content"></textarea> |
|||
</view> |
|||
</view> |
|||
<view class="submit" @click="confirm()"> |
|||
确定发布 |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import API from '@/common/js/api.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
id: '', |
|||
editInfo: {title:'',sort:'', content: ''}, |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
confirm(){ |
|||
let data = { |
|||
id: this.id||'', |
|||
title: this.editInfo.title, |
|||
sort: this.editInfo.sort, |
|||
content: this.editInfo.content |
|||
}; |
|||
API.request('/notice/save', data, res=>{ |
|||
uni.showToast({ |
|||
title: res.msg |
|||
}) |
|||
setTimeout(()=>{ |
|||
uni.navigateBack({ |
|||
delta: 1 |
|||
}) |
|||
}, 1500) |
|||
|
|||
}) |
|||
}, |
|||
}, |
|||
onLoad(e) { |
|||
if(e){ |
|||
this.id = e.id; |
|||
this.editInfo.title = e.title; |
|||
this.editInfo.content = e.content; |
|||
this.editInfo.sort = e.sort; |
|||
} |
|||
|
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.nav_area { |
|||
position: fixed; |
|||
top: 0px; |
|||
left: 0px; |
|||
z-index: 99; |
|||
background-color: #fff; |
|||
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.05); |
|||
width: 700rpx; |
|||
height: 88rpx; |
|||
padding: 0px 25rpx; |
|||
padding-top: var(--status-bar-height); |
|||
box-sizing: content-box; |
|||
color: #b0b0b0; |
|||
font-size: 14px; |
|||
} |
|||
.setPage{ |
|||
padding: 40rpx; |
|||
font-size: 14px; |
|||
color: #999; |
|||
} |
|||
.input_box{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
|
|||
input{ |
|||
width: 572rpx; |
|||
height: 80rpx; |
|||
border: 1px solid #eee; |
|||
border-radius: 5px; |
|||
padding: 0px 10px; |
|||
box-sizing: border-box; |
|||
color: #444; |
|||
} |
|||
} |
|||
.input2_box{ |
|||
.label{ |
|||
line-height: 40px; |
|||
} |
|||
textarea{ |
|||
width: 670rpx; |
|||
height: 560rpx; |
|||
border: 1px solid #eee; |
|||
border-radius: 5px; |
|||
padding: 10px 10px; |
|||
box-sizing: border-box; |
|||
color: #444; |
|||
} |
|||
} |
|||
.submit{ |
|||
width: 670rpx; |
|||
height: 88rpx; |
|||
border-radius: 10px; |
|||
font-size: 14px; |
|||
text-align: center; |
|||
line-height: 88rpx; |
|||
color: #fff; |
|||
background-color: #e33837; |
|||
position: fixed; |
|||
bottom: 40rpx; |
|||
} |
|||
|
|||
</style> |
|||
@ -0,0 +1,137 @@ |
|||
<template> |
|||
<view> |
|||
<view class="nav_area"></view> |
|||
<view class="setPage"> |
|||
<view v-for="(item,index) in setList" :key="index" class="set_item"> |
|||
<view style="" class="item_top"> |
|||
<view class="">标题:{{item.title}}</view> |
|||
<text class="text" style="font-size: 12px;">发布时间:{{item.time}}</text> |
|||
<view class=""><text class="box3" v-html="item.content"></text></view> |
|||
</view> |
|||
<view style="" class="flex-row"> |
|||
<view class="red" @click="edit(item,index)">编辑</view> |
|||
<text class="text" @click="remove(item,index)">删除</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import API from '@/common/js/api.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
setList: [ |
|||
{ |
|||
"id": 1, //公告id |
|||
"title": "测试", //公告标题 |
|||
"sort": 1, //排序 |
|||
"content": "尊敬的平台用户,关于调整中奖概率问题,平台为了中奖概率问题" |
|||
}, |
|||
{ |
|||
"id": 2, //公告id |
|||
"title": "测试2", //公告标题 |
|||
"sort": 2, //排序 |
|||
"content": "手动阀电风扇2" |
|||
} |
|||
|
|||
], |
|||
page: 1 |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
edit(val, i){ |
|||
uni.navigateTo({ |
|||
url: './addNotice?id='+val.id+'&content='+val.content+'&title='+val.title+'&sort='+val.sort |
|||
}) |
|||
}, |
|||
remove(val, i){ |
|||
let _this = this; |
|||
uni.showModal({ |
|||
title:'温馨提示', |
|||
content:"确定是否删除该信息", |
|||
success() { |
|||
API.request('/notice/delete', {id: val.id}, res=>{ |
|||
uni.showToast({ |
|||
title: res.msg |
|||
}) |
|||
_this.setList.splice(i, 1); |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
getList(){ |
|||
API.request('/notice/list', {page:this.page, limit: 10}, res=>{ |
|||
this.setList = res.data.list; |
|||
}) |
|||
|
|||
} |
|||
}, |
|||
onLoad(e) { |
|||
this.getList(); |
|||
}, |
|||
onNavigationBarButtonTap() { |
|||
uni.navigateTo({ |
|||
url: './addNotice' |
|||
}) |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.nav_area { |
|||
position: fixed; |
|||
top: 0px; |
|||
left: 0px; |
|||
z-index: 99; |
|||
background-color: #fff; |
|||
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.05); |
|||
width: 700rpx; |
|||
height: 88rpx; |
|||
padding: 0px 25rpx; |
|||
padding-top: var(--status-bar-height); |
|||
box-sizing: content-box; |
|||
color: #b0b0b0; |
|||
font-size: 14px; |
|||
} |
|||
.setPage{ |
|||
padding: 40rpx; |
|||
font-size: 14px; |
|||
color: #444; |
|||
} |
|||
.set_item{ |
|||
width: 670rpx; |
|||
height: 280rpx; |
|||
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.11); |
|||
margin-bottom: 40rpx; |
|||
border-radius: 10px; |
|||
|
|||
.item_top{ |
|||
padding: 30rpx 30rpx; |
|||
line-height: 24px; |
|||
} |
|||
.text{ |
|||
color: #999; |
|||
} |
|||
.box3{ |
|||
font-size: 12px; |
|||
display: -webkit-box;//将盒子转换为弹性盒子 |
|||
-webkit-box-orient: vertical;//文本显示方式,默认水平 |
|||
-webkit-line-clamp: 1;//设置显示多少行 |
|||
overflow: hidden; |
|||
} |
|||
.flex-row{ |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
padding: 0px 110rpx; |
|||
} |
|||
.red{ |
|||
color: #E33837; |
|||
} |
|||
} |
|||
|
|||
|
|||
</style> |
|||
|
After Width: | Height: | Size: 312 B |
|
After Width: | Height: | Size: 205 B |
Loading…
Reference in new issue