打卡新写 配置文件更新

This commit is contained in:
@fawn-nine
2023-10-10 17:03:28 +08:00
parent 4288b2a892
commit 783f4ea806
8 changed files with 160 additions and 137 deletions

View File

@@ -63,6 +63,8 @@
</el-form-item>
<el-form-item label="打卡描述" prop="productDetails">
<el-upload class="avatar-uploader" :action="baseUrl + '/oss/fileoss'" accept=".jpeg,.jpg,.gif,.png" :show-file-list="false" :on-success="contentUploadSuccess" >
</el-upload>
<quill-editor v-model="dataForm.productDetails" ref="myQuillEditor" :options="editorOption"
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
@ready="onEditorReady($event)" class="shangpin_editor">
@@ -88,6 +90,22 @@
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
['blockquote', 'code-block'], //引用,代码块
[{ 'header': 1 }, { 'header': 2 }], // 几级标题
[{ 'list': 'ordered' }, { 'list': 'bullet' }], // 有序列表,无序列表
[{ 'script': 'sub' }, { 'script': 'super' }], // 下角标,上角标
[{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
[{ 'direction': 'rtl' }], // 文字输入方向
[{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],// 标题
[{ 'color': [] }, { 'background': [] }], // 颜色选择
[{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }],// 字体
[{ 'align': [] }], // 居中
['clean'], // 清除样式,
['link', 'image'], // 上传图片、上传视频
]
export default {
data() {
@@ -140,50 +158,19 @@
// 富文本编辑器配置
editorOption: {
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
['blockquote', 'code-block'], // 引用 代码块
[{
header: 1
}, {
header: 2
}], // 1、2 级标题
[{
list: 'ordered'
}, {
list: 'bullet'
}], // 有序、无序列表
[{
script: 'sub'
}, {
script: 'super'
}], // 上标/下标
[{
indent: '-1'
}, {
indent: '+1'
}], // 缩进
[{
direction: 'rtl'
}], // 文本方向
[{
size: ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36']
}], // 字体大小
[{
header: [1, 2, 3, 4, 5, 6]
}], // 标题
[{
color: []
}, {
background: []
}], // 字体颜色、字体背景颜色
// [{ font: ['songti'] }], // 字体种类
[{
align: []
}], // 对齐方式
['clean'], // 清除文本格式
['image', 'video'] // 链接、图片、视频
]
toolbar: {
container: toolbarOptions,
handlers: {
image: function (value) {
if (value) {
// 调用element的图片上传组件
document.querySelector('.avatar-uploader input').click()
} else {
this.quill.format('image', false)
}
}
}
},
},
placeholder: '请输入正文'
},
@@ -193,6 +180,23 @@
},
methods: {
contentUploadSuccess(res, file) {
// console.log(res)
let quill = this.$refs.myQuillEditor.quill
// 如果上传成功
if (res) {
// 获取光标所在位置
let length = quill.getSelection().index;
// 插入图片res为服务器返回的图片链接地址
quill.insertEmbed(length, 'image', res.url)
// 调整光标到最后
quill.setSelection(length + 1)
} else {
// 提示信息需引入Message
this.$message.error('图片插入失败!')
}
},
init(id,bookid) {
this.productPid = bookid
this.dataForm.shupingid = id || null
@@ -201,32 +205,34 @@
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.productId) {
if (id) {
this.$http({
url: this.$http.adornUrl(`/book/task/info/${id}`),
url: this.$http.adornUrl('/book/clock/getBookClockDetail'),
method: 'get',
params: this.$http.adornParams()
params: this.$http.adornParams({
'entryId': id
}),
}).then(({
data
}) => {
console.log(data,666)
if (data && data.code === 0) {
this.dataForm.title = data.bookTaskEntity.heading
this.dataForm.video = data.bookTaskEntity.video
this.dataForm.days = data.bookTaskEntity.days
this.dataForm.productImages = data.bookTaskEntity.images
this.dataForm.productDetails = data.bookTaskEntity.content
this.dataForm.title = data.entry.title
this.dataForm.video = data.entry.video
this.dataForm.days = data.entry.day
this.dataForm.productImages = data.entry.image
this.dataForm.productDetails = data.entry.content
// console.log(this.dataForm.video, 'this.dataForm.video')
if (this.dataForm.video != '') {
this.videoList.push({
name: data.bookTaskEntity.heading,
url: data.bookTaskEntity.video
name: data.entry.title,
url: data.entry.video
})
}
if (data.bookTaskEntity.images != "") {
if (data.entry.image != "") {
var img = {
name: '',
url: data.bookTaskEntity.images
url: data.entry.image
}
var attr = []
attr.push(img)
@@ -264,14 +270,15 @@
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/task/${!this.dataForm.shupingid ? 'save' : 'update'}`),
url: this.$http.adornUrl(`/book/clock/${!this.dataForm.shupingid ? 'addBookClock' : 'updateBookClock'}`),
method: 'post',
data: this.$http.adornData({
'bookid': this.productPid,
'heading': this.dataForm.title,
'images': this.dataForm.productImages,
'bookId': this.productPid,
'title': this.dataForm.title,
'image': this.dataForm.productImages,
'content': this.dataForm.productDetails,
'days': this.dataForm.days,
'day': this.dataForm.days,
'video': this.dataForm.video,
// 'video': "https://ehh-private-01.oss-cn-beijing.aliyuncs.com…3/08/28/91fd5a4c35c34763abca5d2929637164movie.mp4",
'id': this.dataForm.shupingid || undefined,

View File

@@ -4,7 +4,7 @@
<el-form-item>
<!-- <el-button @click="getDataList()">查询</el-button> -->
<el-button v-if="isAuth('book:bookchapter:save')" type="primary" @click="addOrUpdateHandle()">增加打卡任务</el-button>
<el-button v-if="isAuth('book:bookchapter:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
<!-- <el-button v-if="isAuth('book:bookchapter:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> -->
<!-- <router-link :to="{path: 'book-book' , query:{ upPageIndex } }">
<el-button type="primary">返回上一级</el-button>
</router-link> -->
@@ -35,12 +35,12 @@
</el-table-column>
-->
<el-table-column
prop="days"
prop="day"
align="center"
label="第N天">
</el-table-column>
<el-table-column
prop="heading"
prop="title"
label="主题">
</el-table-column>
@@ -52,12 +52,12 @@
label="内容">
</el-table-column>
<el-table-column
prop="images"
prop="image"
header-align="center"
align="center"
label="卡片">
<template slot-scope="scope">
<img v-if="scope.row.images != ''" :src="scope.row.images" width="100px" />
<img v-if="scope.row.image != ''" :src="scope.row.image" width="100px" />
</template>
</el-table-column>
<el-table-column
@@ -148,13 +148,13 @@
this.dataListLoading = true
this.$http({
// url: this.$http.adornUrl('/forum/articles/list'),
url: this.$http.adornUrl('/book/task/list'),
url: this.$http.adornUrl('/book/clock/getBookClocks'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
//'key': this.dataForm.key,
'bookid' : this.bookid
'bookId' : this.bookid
})
// data: {
// 'page': this.pageIndex,
@@ -164,8 +164,8 @@
// }
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
this.dataList = data.page.records
this.totalPage = data.page.pages
} else {
this.dataList = []
this.totalPage = 0
@@ -197,18 +197,23 @@
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
// var ids = id ? [id] : this.dataListSelections.map(item => {
// return item.id
// })
this.$confirm(`确定对[id=${id}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/task/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
url: this.$http.adornUrl('/book/clock/delBookClock'),
method: 'get',
params: this.$http.adornParams({
'entryId': id
}),
// data: this.$http.adornData({
// 'entryId': id
// })
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({

View File

@@ -178,8 +178,8 @@
<div></div>
<!-- <div>含快递费10.00优惠券{{ fitem.couponName }}积分抵扣-10.00</div> -->
<div></div>
<div v-if="fitem.paymentMethod == 2"><icon-svg name="weixin"></icon-svg> 微信支付</div>
<div v-if="fitem.paymentMethod == 1"><icon-svg name="zhifubao"></icon-svg> 支付宝支付</div>
<div v-if="fitem.paymentMethod == 1"><icon-svg name="weixin"></icon-svg> 微信支付</div>
<div v-if="fitem.paymentMethod == 2"><icon-svg name="zhifubao"></icon-svg> 支付宝支付</div>
<div v-if="fitem.paymentMethod == 4"><img src="../../../../static/img/oder_chong.png" width="22px" height="22px"> 疯币支付</div>
</div>
</div>

View File

@@ -136,6 +136,8 @@
</el-form-item>
</div>
<el-form-item label="商品详情" prop="productDetails">
<el-upload class="avatar-uploader" :action="baseUrl + '/oss/fileoss'" accept=".jpeg,.jpg,.gif,.png" :show-file-list="false" :on-success="contentUploadSuccess" >
</el-upload>
<quill-editor v-model="dataForm.productDetails" ref="myQuillEditor" :options="editorOption"
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
@ready="onEditorReady($event)" class="shangpin_editor">
@@ -161,6 +163,22 @@
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
['blockquote', 'code-block'], //引用,代码块
[{ 'header': 1 }, { 'header': 2 }], // 几级标题
[{ 'list': 'ordered' }, { 'list': 'bullet' }], // 有序列表,无序列表
[{ 'script': 'sub' }, { 'script': 'super' }], // 下角标,上角标
[{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
[{ 'direction': 'rtl' }], // 文字输入方向
[{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],// 标题
[{ 'color': [] }, { 'background': [] }], // 颜色选择
[{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }],// 字体
[{ 'align': [] }], // 居中
['clean'], // 清除样式,
['link', 'image'], // 上传图片、上传视频
]
export default {
data() {
@@ -267,50 +285,24 @@
// 富文本编辑器配置
editorOption: {
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
['blockquote', 'code-block'], // 引用 代码块
[{
header: 1
}, {
header: 2
}], // 1、2 级标题
[{
list: 'ordered'
}, {
list: 'bullet'
}], // 有序、无序列表
[{
script: 'sub'
}, {
script: 'super'
}], // 上标/下标
[{
indent: '-1'
}, {
indent: '+1'
}], // 缩进
[{
direction: 'rtl'
}], // 文本方向
[{
size: ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36']
}], // 字体大小
[{
header: [1, 2, 3, 4, 5, 6]
}], // 标题
[{
color: []
}, {
background: []
}], // 字体颜色、字体背景颜色
// [{ font: ['songti'] }], // 字体种类
[{
align: []
}], // 对齐方式
['clean'], // 清除文本格式
['image', 'video'] // 链接、图片、视频
]
history: {
delay: 1000,
maxStack: 50,
userOnly: false
},
toolbar: {
container: toolbarOptions,
handlers: {
image: function (value) {
if (value) {
// 调用element的图片上传组件
document.querySelector('.avatar-uploader input').click()
} else {
this.quill.format('image', false)
}
}
}
},
},
placeholder: '请输入正文',
@@ -323,6 +315,23 @@
this.getTags()
},
methods: {
contentUploadSuccess(res, file) {
// console.log(res)
let quill = this.$refs.myQuillEditor.quill
// 如果上传成功
if (res) {
// 获取光标所在位置
let length = quill.getSelection().index;
// 插入图片res为服务器返回的图片链接地址
quill.insertEmbed(length, 'image', res.url)
// 调整光标到最后
quill.setSelection(length + 1)
} else {
// 提示信息需引入Message
this.$message.error('图片插入失败!')
}
},
handleCheckedCitiesChange(value) {
console.log(value, 'value')
},

View File

@@ -82,7 +82,7 @@
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-dialog title="充/扣币明细" :close-on-click-modal="false" :visible.sync="memoryDetail" append-to-body width="30%">
<el-dialog title="充/扣天医币明细" :close-on-click-modal="false" :visible.sync="memoryDetail" append-to-body width="30%">
<el-form :model="mdetail" label-width="100px" ref="pointForm">
<el-form-item label="充/扣主题:">
@@ -94,8 +94,8 @@
<span>{{mdetail.createTime}}</span>
</el-form-item>
<el-form-item label="充值类型:">
<el-tag type="danger" v-if="mdetail.changeAmount > 0">充值</el-tag>
<el-tag type="success" v-else>扣除</el-tag>
<el-tag type="danger" v-if="mdetail.changeAmount > 0">充值天医</el-tag>
<el-tag type="success" v-else>扣除天医</el-tag>
</el-form-item>
<el-form-item label="金额:" >
<!-- <el-input-number v-model="mdetail.pointAmount" :placeholder="mdetail.peanutCoin+'可用'">

View File

@@ -63,7 +63,7 @@
align="center"
label="vip 有效期">
</el-table-column> -->
<el-table-column prop="peanutCoin" header-align="center" align="center" label="币">
<el-table-column prop="peanutCoin" header-align="center" align="center" label="天医币">
</el-table-column>
<!-- <el-table-column
prop="readTime"
@@ -85,9 +85,9 @@
</el-table-column> -->
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="ck(scope.row)">/</el-button>
<el-button type="text" size="small" @click="ck(scope.row)">/天医</el-button>
<router-link :to="{ path: 'user-point-memery', query: {'tel':scope.row.tel, 'id':scope.row.id} }">
<el-button type="text" size="small">/币记录</el-button>
<el-button type="text" size="small">/天医币记录</el-button>
</router-link>
<el-button type="text" size="small" @click="youhui(scope.row)">优惠券列表</el-button>
<br>
@@ -102,7 +102,7 @@
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-dialog title="充/扣币" :close-on-click-modal="false" :visible.sync="adc" append-to-body width="30%" :before-close="closeDia">
<el-dialog title="充/扣天医币" :close-on-click-modal="false" :visible.sync="adc" append-to-body width="30%" :before-close="closeDia">
<el-form :model="pointForm" label-width="100px" :rules="pointFormRules" ref="pointForm">
<el-form-item label="用户">
@@ -183,10 +183,10 @@
},
options: [{
value: 0,
label: '充币'
label: '充天医币'
}, {
value: 1,
label: '扣币'
label: '扣天医币'
}],
adc: false,
pointForm: {
@@ -316,7 +316,7 @@
})
})
},
// 充值扣款
// 充值扣款天医
ck(e) {
this.pointForm=e
this.adc = true

View File

@@ -5,7 +5,8 @@
window.SITE_CONFIG = {};
// api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9100/pb';
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9100/pb';
window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com';
// cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名

View File

@@ -7,7 +7,8 @@
// api接口请求地址
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';
window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.38:9200/pb';
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
// cdn地址 = 域名 + 版本号