This commit is contained in:
2025-06-13 20:46:10 +08:00
parent a3e6a6d8b8
commit 898b816655
52 changed files with 2250 additions and 3785 deletions
-72
View File
@@ -1,72 +0,0 @@
<template>
<!-- 这块加个padding -->
<view style="padding-bottom: 100rpx;">
<uni-section class="mb-10" type="line" title="文章标题"></uni-section>
<uni-easyinput autoHeight v-model="value" placeholder="请输入内容"></uni-easyinput>
</uni-section>
<uni-section class="mb-10" type="line" title="文章封面"></uni-section>
<uni-file-picker limit="1" title="最多选择1张图片,作为文章封面"></uni-file-picker>
</uni-section>
<uni-section class="mb-10" type="line" title="文章简介"></uni-section>
<uni-easyinput autoHeight v-model="value" placeholder="请输入内容" type="textarea" style="margin: 30rpx;"></uni-easyinput>
</uni-section>
<uni-section class="mb-10 " type="line" title="文章内容"></uni-section>
<!-- 不要再编辑器上面写样式 ,在style里面写-->
<!-- /deep/.editor-container {
border: 3rpx solid #3555; border-radius: 20rpx;margin: 20rpx;
} -->
<cu-editor style=""></cu-editor>
</uni-section>
<!-- 要这个没用 -->
<!-- <view class="" style="margin-top:1000rpx;border: aliceblue solid 1rpx;">
</view> -->
</view>
</template>
<script>
import cuEditor from '@/components/cu-editor/cu-editor'
export default {
// 这块要注册组件
components: {
cuEditor
},
data() {
return {
}
},
methods: {
}
}
</script>
<style>
.example-body {
/* #ifndef APP-PLUS-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: flex-start;
/* align-items: flex-end; */
/* flex-wrap: wrap; */
padding: 10rpx;
}
.cu-editor-input:focus {
border-color: blue; /* 聚焦时的边框颜色 */
outline: none; /* 移除默认的聚焦轮廓 */
}
/deep/.editor-container {
border: 3rpx solid #3555; border-radius: 20rpx;margin: 20rpx;
}
</style>
+34
View File
@@ -83,6 +83,18 @@
arrow: true,
type: 'my_follow'
},
{
name: '新增文章',
icon: '/static/center/icon-follow.png',
arrow: true,
type: 'edit_cms'
},
{
name: '文章管理',
icon: '/static/center/icon-follow.png',
arrow: true,
type: 'cms_list'
},
{
name: '提现',
icon: '/static/center/withdraw.png',
@@ -218,6 +230,28 @@
url: "/pages2/replyCommentList/replyCommentList"
})
}
} else if (e.type === "cms_list") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/edit_list/edit_list"
})
}
} else if (e.type === "edit_cms") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/editCms/editCms"
})
}
} else if (e.type === "my_collect") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
-167
View File
@@ -1,167 +0,0 @@
<template>
<view class="v-preview">
<image :src="templateSrc" alt="" class="img" mode="widthFix" />
<view class="btn-area">
<view class="red-btn-area">
<button class="red-btn">老兵直播</button>
<button class="red-btn">老兵故事</button>
<button class="red-btn">在线注册</button>
</view>
<view class="red-btn-plain-area">
<view class="red-btn-plain" @click="toIndex()">新四军</view>
<view class="red-btn-plain">抗美援朝</view>
<view class="red-btn-plain">抗美援越</view>
<view class="red-btn-plain">对越自卫反击战</view>
<view class="red-btn-plain">和平时期退役兵</view>
</view>
</view>
<editor
id="editor"
class="cu-editor"
placeholder=""
read-only
:show-img-size="false"
:show-img-toolbar="false"
:show-img-resize="false"
@ready="onEditorReady"
@input="onEditorInput"
></editor>
</view>
</template>
<script>
export default {
data() {
return {
templateSrc: "",
musicSrc: "",
html: "",
};
},
methods: {
toIndex() {
uni.navigateTo({
url:"/pages/articleContentDetail/articleContentDetail"
})
},
onEditorReady() {
const that = this;
uni
.createSelectorQuery()
.in(this)
.select("#editor")
.context(function (res) {
that.editorCtx = res.context;
that.setValue();
})
.exec();
},
setValue() {
if (this.editorCtx) {
this.editorCtx.setContents({
html: this.html,
success: () => {},
});
}
},
// onEditorInput(e) {
// let { html, text } = e.detail;
// this.curLength = text.length - 1;
// },
},
onLoad(options) {
console.log(options); // 输出上一个页面传递的 id 参数
},
mounted() {
this.templateSrc = "https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/bg.jpg?expire_at=1741101988&er_sign=c9732cddaaead925cf110d9a11751231";
// this.templateSrc = uni.getStorageSync("templateSrc");
this.musicSrc = uni.getStorageSync("musicSrc");
this.html = uni.getStorageSync("html");
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.src = this.musicSrc;
innerAudioContext.autoplay = true; // 自动播放
innerAudioContext.play();
},
};
</script>
<style lang="scss" scoped>
.v-preview {
.img {
width: 100%;
}
.cu-editor {
box-sizing: border-box;
width: 100%;
height: 100%;
font-size: 28rpx;
line-height: 1.5;
overflow: auto;
padding: 40rpx 35rpx;
min-height: unset !important;
}
.btn-area {
position: relative;
top: -50rpx;
}
.red-btn-area {
display: flex;
justify-content: center;
padding: 10rpx 0;
margin: 0 40rpx 20rpx 40rpx;
font-size: 20rpx;
.red-btn {
position: relative;
color: #fff;
font-weight: 700;
font-size: 24rpx;
height: 40rpx;
line-height: 40rpx;
margin: 0;
background-image: linear-gradient(to bottom, #c11c1f, #5c0201);
+ .red-btn {
margin-left: 20rpx;
}
}
}
.red-btn-plain-area {
display: flex;
justify-content: center;
padding: 10rpx 0;
margin: 0 40rpx;
font-size: 21rpx;
border-top: 2px solid;
border-bottom: 2px solid;
border-image: linear-gradient(
to right,
#fff,
#f44336bf,
#b13636,
#f44336bf,
#fff
)
1;
.red-btn-plain {
position: relative;
color: #b13636;
font-weight: 700;
padding-left: 15rpx;
+ .red-btn-plain {
margin-left: 10rpx;
&::before {
// border-left: 2px solid #f44336;
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 2px;
height: 20rpx;
background-color: #b13636;
}
}
}
}
}
</style>