Browse Source

微信活动

master
xuhuajiao 1 month ago
parent
commit
d75a1ba45f
  1. 4
      .env.development
  2. 2
      package.json
  3. 12
      src/api/weixin/index.js
  4. 82
      src/assets/iconfonts/light/iconfont.css
  5. 2
      src/assets/iconfonts/light/iconfont.js
  6. 133
      src/assets/iconfonts/light/iconfont.json
  7. BIN
      src/assets/iconfonts/light/iconfont.ttf
  8. BIN
      src/assets/iconfonts/light/iconfont.woff
  9. BIN
      src/assets/iconfonts/light/iconfont.woff2
  10. 174
      src/components/wangEditor/index.vue
  11. 276
      src/views/weChatMiniProgram/activity.vue
  12. 52
      src/views/weChatMiniProgram/activityLog.vue
  13. 61
      src/views/weChatMiniProgram/module/activityDetail.vue

4
.env.development

@ -4,8 +4,8 @@ ENV = 'development'
# 许镇-本地服地址
VUE_APP_BASE_API = 'http://192.168.99.63:14000'
# VUE_APP_BASE_API = 'http://192.168.99.86:12010'
#VUE_APP_BASE_API = 'http://27.19.205.234:17070'
# VUE_APP_BASE_API = 'https://wechatapi.aiyxlib.com'
VUE_APP_WECHAT_URL = 'https://wechatapi.aiyxlib.com'
# 是否启用 babel-plugin-dynamic-import-node插件

2
package.json

@ -34,6 +34,8 @@
"@tinymce/tinymce-vue": "^3.0.1",
"@vue-office/docx": "^1.6.0",
"@vue-office/excel": "^1.6.5",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^1.0.2",
"axios": "^0.21.1",
"chokidar": "^3.5.3",
"clipboard": "2.0.4",

12
src/api/weixin/index.js

@ -40,9 +40,19 @@ export function FetchCancelResumeActivity(data) {
})
}
// 删除活动
export function FetchDeleteActivity(data) {
return request({
url: 'api/weixin/deleteActivity',
method: 'post',
data
})
}
export default {
FetchReplyReaderMessage,
add,
edit,
FetchCancelResumeActivity
FetchCancelResumeActivity,
FetchDeleteActivity
}

82
src/assets/iconfonts/light/iconfont.css

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3966148 */
src: url('iconfont.woff2?t=1760517327121') format('woff2'),
url('iconfont.woff?t=1760517327121') format('woff'),
url('iconfont.ttf?t=1760517327121') format('truetype');
src: url('iconfont.woff2?t=1786692606445') format('woff2'),
url('iconfont.woff?t=1786692606445') format('woff'),
url('iconfont.ttf?t=1786692606445') format('truetype');
}
.iconfont {
@ -13,6 +13,82 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-shanchu-:before {
content: "\e6aa";
}
.icon-huifu1:before {
content: "\e6ab";
}
.icon-tjg:before {
content: "\e6ac";
}
.icon-gb:before {
content: "\e6ad";
}
.icon-Group:before {
content: "\e6ae";
}
.icon-xiajia:before {
content: "\e7aa";
}
.icon-cangku:before {
content: "\e927";
}
.icon-baojingjilu:before {
content: "\e6a8";
}
.icon-yitiji:before {
content: "\e6a2";
}
.icon-kufangguanli:before {
content: "\e6a3";
}
.icon-renlianshibiejiqi:before {
content: "\e759";
}
.icon-wangluoshexiangtou:before {
content: "\e754";
}
.icon-Dkufang:before {
content: "\e6a4";
}
.icon-rfidduxieqi:before {
content: "\e879";
}
.icon-shouchipandianyi:before {
content: "\e6a5";
}
.icon-zhinengyitiji:before {
content: "\e6a6";
}
.icon-a-3D-xidingtanceqi:before {
content: "\e6b7";
}
.icon-saomiao:before {
content: "\e6a7";
}
.icon-mimachakan:before {
content: "\e6a1";
}
.icon-d:before {
content: "\e6a0";
}

2
src/assets/iconfonts/light/iconfont.js
File diff suppressed because it is too large
View File

133
src/assets/iconfonts/light/iconfont.json

@ -5,6 +5,139 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "1817720",
"name": "删除-3",
"font_class": "shanchu-",
"unicode": "e6aa",
"unicode_decimal": 59050
},
{
"icon_id": "1817721",
"name": "恢复",
"font_class": "huifu1",
"unicode": "e6ab",
"unicode_decimal": 59051
},
{
"icon_id": "1817730",
"name": "tjg",
"font_class": "tjg",
"unicode": "e6ac",
"unicode_decimal": 59052
},
{
"icon_id": "1817776",
"name": "gb",
"font_class": "gb",
"unicode": "e6ad",
"unicode_decimal": 59053
},
{
"icon_id": "1817794",
"name": "Group 2",
"font_class": "Group",
"unicode": "e6ae",
"unicode_decimal": 59054
},
{
"icon_id": "10599880",
"name": "icon-xiajiashenhe",
"font_class": "xiajia",
"unicode": "e7aa",
"unicode_decimal": 59306
},
{
"icon_id": "44433330",
"name": "仓库",
"font_class": "cangku",
"unicode": "e927",
"unicode_decimal": 59687
},
{
"icon_id": "30256923",
"name": "报警记录",
"font_class": "baojingjilu",
"unicode": "e6a8",
"unicode_decimal": 59048
},
{
"icon_id": "79099",
"name": "一体机",
"font_class": "yitiji",
"unicode": "e6a2",
"unicode_decimal": 59042
},
{
"icon_id": "6296998",
"name": "库房管理",
"font_class": "kufangguanli",
"unicode": "e6a3",
"unicode_decimal": 59043
},
{
"icon_id": "8434614",
"name": "人脸识别机器",
"font_class": "renlianshibiejiqi",
"unicode": "e759",
"unicode_decimal": 59225
},
{
"icon_id": "9437011",
"name": "网络摄像头",
"font_class": "wangluoshexiangtou",
"unicode": "e754",
"unicode_decimal": 59220
},
{
"icon_id": "11661938",
"name": "3D库房",
"font_class": "Dkufang",
"unicode": "e6a4",
"unicode_decimal": 59044
},
{
"icon_id": "19373677",
"name": "rfid读写器",
"font_class": "rfidduxieqi",
"unicode": "e879",
"unicode_decimal": 59513
},
{
"icon_id": "31422233",
"name": "手持盘点仪",
"font_class": "shouchipandianyi",
"unicode": "e6a5",
"unicode_decimal": 59045
},
{
"icon_id": "36973886",
"name": "智能一体机",
"font_class": "zhinengyitiji",
"unicode": "e6a6",
"unicode_decimal": 59046
},
{
"icon_id": "40950858",
"name": "3D-吸顶探测器",
"font_class": "a-3D-xidingtanceqi",
"unicode": "e6b7",
"unicode_decimal": 59063
},
{
"icon_id": "43488473",
"name": "吸顶式盘点设备",
"font_class": "saomiao",
"unicode": "e6a7",
"unicode_decimal": 59047
},
{
"icon_id": "26584955",
"name": "密码查看",
"font_class": "mimachakan",
"unicode": "e6a1",
"unicode_decimal": 59041
},
{
"icon_id": "13302910",
"name": "3d",

BIN
src/assets/iconfonts/light/iconfont.ttf

BIN
src/assets/iconfonts/light/iconfont.woff

BIN
src/assets/iconfonts/light/iconfont.woff2

174
src/components/wangEditor/index.vue

@ -0,0 +1,174 @@
<template>
<div class="wang-editor">
<Toolbar
:editor="editor"
:default-config="toolbarConfig"
/>
<Editor
v-model="html"
:default-config="editorConfig"
@onCreated="handleCreated"
@onChange="handleChange"
/>
</div>
</template>
<script>
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { upload } from '@/utils/upload'
export default {
name: 'WangEditor',
components: { Editor, Toolbar },
props: {
value: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '请输入内容...'
},
height: {
type: [String, Number],
default: '450px'
},
// props
maxImgSize: {
type: Number,
default: 2 * 1024 * 1024 // 2M
}
},
data() {
const linkSrc = process.env.NODE_ENV === 'production'
? window.g.ApiUrl
: process.env.VUE_APP_BASE_API
const imgHttpsUrl = process.env.NODE_ENV === 'production'
? window.g.ApiUrl
: process.env.VUE_APP_WECHAT_URL
return {
editor: null,
imgHttpsUrl,
html: this.value,
linkSrc,
toolbarConfig: {
excludeKeys: ['video', 'code', 'todo', 'fullscreen']
},
editorConfig: {
placeholder: this.placeholder,
zIndex: 9999,
MENU_CONF: {
uploadImage: {
customUpload: async(file, insertFn) => {
if (file.size > this.maxImgSize) {
const sizeMb = (this.maxImgSize / 1024 / 1024).toFixed(1)
this.$message.error(`图片不能超过${sizeMb}M`)
return
}
try {
const res = await upload(`${this.linkSrc}/api/fileRelevant/uploadHttpsImg`, file)
if (res.data.code === 200) {
const imageUrl = `${this.imgHttpsUrl}/files/${res.data.data}`
insertFn(imageUrl)
} else {
this.$message.error(res.data.msg || '图片上传失败')
}
} catch (err) {
console.error('图片上传失败:', err)
this.$message.error('图片上传失败')
}
},
maxFileSize: 2 * 1024 * 1024,
maxNumberOfFiles: 10
}
}
}
}
},
watch: {
value(newVal) {
if (newVal !== this.html && this.editor) {
this.editor.setHtml(newVal)
}
},
html(newVal) {
this.$emit('input', newVal)
this.$emit('contentData', newVal)
},
placeholder(newVal) {
if (this.editor) {
this.editorConfig.placeholder = newVal
}
}
},
beforeDestroy() {
if (this.editor) {
this.editor.destroy()
this.editor = null
}
},
methods: {
handleCreated(editor) {
this.editor = editor
editor.config.height = this.height
},
handleChange(editor) {
this.$emit('change', editor.getHtml())
},
getHtmlContent() {
return this.editor ? this.editor.getHtml() : ''
},
setHtmlContent(html) {
if (this.editor) {
this.editor.setHtml(html)
}
}
}
}
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>
<style scoped>
.wang-editor {
border: 1px solid #e4e7ed;
border-radius: 4px;
}
::v-deep .w-e-text-container {
height: calc(100% - 50px) !important;
}
::v-deep .w-e-text-container table {
width: 100% !important;
border-collapse: collapse;
margin: 10px 0;
}
::v-deep .w-e-text-container table td,
::v-deep .w-e-text-container table th {
border: 1px solid #dcdfe6;
padding: 8px 12px;
text-align: center;
font-size: 14px;
}
::v-deep .w-e-text-container table th {
background-color: #f5f7fa;
font-weight: 600;
color: #303133;
}
::v-deep .w-e-text-container table tr:nth-child(even) {
background-color: #fafafa;
}
::v-deep .w-e-text-container table tr:hover {
background-color: #f0f5ff;
}
::v-deep .w-e-text-container img {
max-width: 100%;
height: auto;
}
</style>

276
src/views/weChatMiniProgram/activity.vue

@ -2,13 +2,22 @@
<div class="app-container row-container" style="height: calc(100vh - 140px);">
<!--工具栏-->
<div class="head-container">
<div class="head-search">
<el-select v-model="query.status" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="crud.toQuery">
<i slot="prefix" class="iconfont icon-zhuangtai" />
<el-option v-for="item in statusOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<date-range-picker v-model="blurryTime" class="date-item" />
<el-input v-model="query.query" clearable size="small" placeholder="输入关键字搜索" prefix-icon="el-icon-search" style="width: 220px;" class="filter-item" @clear="crud.toQuery" @keyup.enter.native="crud.toQuery" />
<rrOperation />
</div>
<crudOperation :permission="permission">
<template v-slot:middle>
<!-- <template v-slot:middle>
<el-button slot="reference" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" />
删除
</el-button>
</template>
</template> -->
</crudOperation>
</div>
<!--表单渲染-->
@ -71,7 +80,7 @@
</div>
<el-upload
class="upload-btn-box"
:action="baseApi + '/api/fileRelevant/uploadBookImg'"
:action="baseApi + '/api/fileRelevant/uploadHttpsImg'"
:show-file-list="false"
:on-success="handleImgUploadSuccess"
:before-upload="beforeImgUpload"
@ -85,9 +94,9 @@
</el-form-item>
</el-row>
</div>
<quill-editor
<WangEditor
v-model="editorContent"
style="width: 800px;"
style="width: 740px;"
:editor-content="editorContent"
:editor-ref="editorRef"
@contentData="contentData"
@ -152,7 +161,6 @@
>
</template>
</el-table-column>
<!-- width="260" :show-overflow-tooltip="true" -->
<el-table-column prop="title" label="活动名称" />
<el-table-column prop="startTime" label="开始时间" />
<el-table-column prop="endTime" label="结束时间" />
@ -161,43 +169,59 @@
{{ scope.row.activityPeople || '不限制' }}
</template>
</el-table-column>
<el-table-column prop="gridName" label="实约人数">
<el-table-column prop="signNum" label="实约人数">
<template slot-scope="scope">
{{ scope.row.gridName || '-' }}
{{ scope.row.signNum || '-' }}
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center">
<template slot-scope="scope">
<span :class="getStatusClass(scope.row.status)">{{ scope.row.status }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="160" align="center">
<el-table-column label="操作" width="120" align="left">
<template slot-scope="scope">
<!-- <el-button
type="text"
icon="el-icon-edit"
@click="handleEdit(scope.row)"
>编辑</el-button> -->
<el-button
v-if="scope.row.status === '未开始' || scope.row.status === '进行中'"
type="text"
icon="el-icon-circle-close"
@click="showCancelDialog(scope.row)"
>取消</el-button>
<el-button
v-else-if="scope.row.status === '已取消' && canRestore(scope.row)"
type="text"
icon="el-icon-refresh"
@click="restoreActivity(scope.row)"
>恢复</el-button>
<div class="op-btn-wrap">
<el-tooltip v-if="scope.row.status === '未开始'" class="item" effect="dark" content="取消活动" placement="top">
<el-button
type="text"
class="btn-cancel"
@click="showCancelDialog(scope.row)"
><i class="iconfont icon-gb" /></el-button>
</el-tooltip>
<el-tooltip v-if="scope.row.status === '未开始'" class="item" effect="dark" content="编辑活动" placement="top">
<el-button
type="text"
class="btn-edit"
@click="handleEdit(scope.row)"
><i class="iconfont icon-Group" /></el-button>
</el-tooltip>
<!--单条删除仅未开始+实约人数0才显示-->
<el-tooltip v-if="scope.row.status === '未开始' && Number(scope.row.signNum||0)===0" class="item" effect="dark" content="删除活动" placement="top">
<el-button
type="text"
class="btn-del-row"
@click="singleDelete(scope.row)"
><i class="iconfont icon-shanchu-" /></el-button>
</el-tooltip>
<el-tooltip v-else-if="scope.row.status === '已取消' && canRestore(scope.row)" class="item" effect="dark" content="恢复活动" placement="top">
<el-button
type="text"
class="btn-restore"
@click="restoreActivity(scope.row)"
><i class="iconfont icon-huifu1" /></el-button>
</el-tooltip>
<el-tooltip v-if="(scope.row.status === '已取消' && !canRestore(scope.row)) || scope.row.status === '已结束'" class="item" effect="dark" content="重新发布" placement="top">
<el-button
type="text"
class="btn-republish"
@click="handleRepublish(scope.row)"
><i class="iconfont icon-tjg" /></el-button>
</el-tooltip>
</div>
</template>
</el-table-column>
<!-- <el-table-column prop="create_time" label="创建日期" width="160">
<template slot-scope="scope">
<div>{{ scope.row.create_time | parseTime }}</div>
</template>
</el-table-column> -->
</el-table>
<!--分页组件-->
<pagination v-if="crud.data.length!==0" />
@ -210,21 +234,23 @@ import crudWeChat from '@/api/weixin/index'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import { mapGetters } from 'vuex'
import QuillEditor from '@/components/quillEditor/index.vue'
import WangEditor from '@/components/wangEditor/index.vue'
import { getToken } from '@/utils/auth'
import DateRangePicker from '@/components/DateRangePicker'
import ActivityDetail from './module/activityDetail.vue'
const defaultForm = { id: null, title: null, startTime: null, endTime: null, activityPeople: null, numberLimit: 1, activityLocation: null, coverImage: null }
const defaultForm = { id: null, libcode: null, title: null, startTime: null, endTime: null, activityPeople: null, numberLimit: 1, activityLocation: null, coverImage: null }
export default {
name: 'Activity',
components: { crudOperation, pagination, QuillEditor, ActivityDetail },
components: { crudOperation, rrOperation, pagination, DateRangePicker, WangEditor, ActivityDetail },
cruds() {
return CRUD({ title: '活动', url: 'api/weixin/initActivityInfo', crudMethod: { ...crudWeChat },
optShow: {
add: true,
edit: true,
edit: false,
del: false,
download: false,
group: false,
@ -235,7 +261,14 @@ export default {
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
return {
blurryTime: null,
permission: { add: [], edit: [], del: [] },
statusOptions: [
{ key: 0, display_name: '未开始' },
{ key: 1, display_name: '进行中' },
{ key: 2, display_name: '已结束' },
{ key: -1, display_name: '已取消' }
],
imageUrl: require('@/assets/images/system/default-img.jpg'),
editorRef: 'test',
editorContent: '',
@ -312,17 +345,37 @@ export default {
]),
uploadHeaders() {
return { Authorization: getToken() }
},
imgHttpsUrl() {
if (process.env.NODE_ENV === 'production') {
return (window.g && window.g.ApiUrl) || ''
} else {
return process.env.VUE_APP_WECHAT_URL
}
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.params.libcode = this.user.fonds.fondsNo
if (this.blurryTime) {
this.crud.query.startTime = this.blurryTime[0]
this.crud.query.endTime = this.blurryTime[1]
} else {
this.crud.query.startTime = null
this.crud.query.endTime = null
}
if (this.query.status != null) {
this.crud.params.status = [this.query.status]
} else {
this.crud.params.status = [0, 1, 2, -1]
}
},
//
[CRUD.HOOK.afterToCU](crud, form) {
},
//
[CRUD.HOOK.beforeToAdd]() {
this.editorContent = ''
},
//
[CRUD.HOOK.beforeToEdit](crud, form) {
@ -340,9 +393,11 @@ export default {
crud.form.activityPeople = 0
}
delete crud.form.numberLimit
crud.form.libcode = this.user.fonds.fondsNo
console.log('crud.form', crud.form)
return true
},
validateNumber() {
this.$refs.form.validateField('activityPeople')
},
@ -415,6 +470,22 @@ export default {
}
}).catch(() => {})
},
handleRepublish(row) {
//
const copyRow = { ...row }
//
copyRow.startTime = null
copyRow.endTime = null
// idcrud
delete copyRow.id
// toAddform
this.crud.toAdd()
Object.assign(this.form, copyRow)
//
this.editorContent = copyRow.activityContent || ''
},
showCancelDialog(row) {
this.cancelForm.title = row.title
this.cancelForm.reason = ''
@ -438,27 +509,56 @@ export default {
}
})
},
toDelete(datas) {
this.$confirm('此操作将删除当前所选活动<span>你是否还要继续?</span>', '提示', {
//
singleDelete(row) {
this.$confirm(`确定删除活动【${row.title}】?`, '删除提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
const res = await crudWeChat.FetchDeleteActivity({ id: row.id })
if (res.code !== 500) {
this.$message({ message: '删除成功', type: 'success', offset: 8 })
this.crud.refresh()
} else {
this.$message({ message: res.message || '删除失败', type: 'error', offset: 8 })
}
}).catch(() => {})
},
//
async toDelete(datas) {
// && =0
const validList = datas.filter(item => {
return item.status === '未开始' && Number(item.gridName || 0) === 0
})
const invalidCount = datas.length - validList.length
if (validList.length === 0) {
this.$message({ message: '选中的数据没有可删除项,仅可删除未开始且无人参与的活动', type: 'warning', offset: 8 })
return
}
if (invalidCount > 0) {
this.$message({ message: `共选中${datas.length}条,其中${invalidCount}条不符合删除条件已跳过`, type: 'warning', offset: 8 })
}
this.$confirm(`确认删除选中${validList.length}条符合条件的活动?`, '批量删除提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
type: 'warning'
}).then(async() => {
this.crud.delAllLoading = true
const ids = []
datas.forEach(val => {
ids.push(val.id)
})
// crudCollBook.del(ids).then(() => {
// this.$message({ message: '', type: 'success', offset: 8 })
// this.crud.delAllLoading = false
// this.crud.refresh()
// }).catch(err => {
// this.crud.delAllLoading = false
// console.log(err)
// })
try {
// idids {ids:[...]}
for (const item of validList) {
await crudWeChat.FetchDeleteActivity({ id: item.id })
}
this.$message({ message: '批量删除完成', type: 'success', offset: 8 })
this.crud.refresh()
} catch (e) {
this.$message({ message: '部分删除失败', type: 'error', offset: 8 })
} finally {
this.crud.delAllLoading = false
}
}).catch(() => {
this.crud.delAllLoading = false
})
},
clickRowHandler(row) {
@ -472,6 +572,7 @@ export default {
this.detailActivity = row
this.detailVisible = true
}
}
}
</script>
@ -497,9 +598,6 @@ export default {
}
}
}
.ql-container{
height: 480px !important;
}
.dialog-footer{
margin-top: 10px;
}
@ -516,7 +614,6 @@ export default {
height: 150px;
display: block;
object-fit: cover;
// border: 1px solid #e6e8ed;
border-radius: 4px;
}
.upload-preview-placeholder{
@ -526,7 +623,6 @@ export default {
align-items: center;
justify-content: center;
border-radius: 4px;
// background-color: #fafafa;
overflow: hidden;
.placeholder-img{
width: 100%;
@ -576,4 +672,68 @@ export default {
padding: 0 0 20px 0;
}
}
::v-deep .w-e-text-container{
height: 480px !important;
overflow: hidden;
overflow-y: auto;
}
.op-btn-wrap {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 4px;
.el-button {
padding: 6px !important;
margin: 0 !important;
.iconfont::before{
margin: 0 !important;
}
}
::v-deep{
.btn-cancel{
background-color: #f65163;
color: #fff;
border-color: #f65163;
&:hover{
background-color: #f65163;
}
.iconfont{
font-size: 14px;
}
}
.btn-edit{
background-color: #0348f3;
color: #fff;
border-color: #0348f3;
&:hover{
background-color: #0348f3;
}
}
.btn-restore{
background-color: #12C47A;
color: #fff;
border-color: #12C47A;
&:hover{
background-color: #12C47A;
}
}
.btn-republish{
background-color: #FF8329;
color: #fff;
border-color: #FF8329;
&:hover{
background-color: #FF8329;
}
}
.btn-del-row{
background-color:#909399;
color:#fff;
border-color:#909399;
&:hover{
background-color:#73767a;
}
}
}
}
</style>

52
src/views/weChatMiniProgram/activityLog.vue

@ -8,7 +8,7 @@
<i slot="prefix" class="iconfont icon-zhuangtai" />
<el-option v-for="item in statusOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-input v-model="query.search" clearable size="small" placeholder="输入检索条件检索" prefix-icon="el-icon-search" style="width: 220px;" class="filter-item" @clear="crud.toQuery" @keyup.enter.native="crud.toQuery" />
<el-input v-model="query.query" clearable size="small" placeholder="输入检索条件检索" prefix-icon="el-icon-search" style="width: 220px;" class="filter-item" @clear="crud.toQuery" @keyup.enter.native="crud.toQuery" />
<rrOperation />
</div>
<!-- <crudOperation :permission="permission" /> -->
@ -37,24 +37,22 @@
</template>
</el-table-column> -->
<!-- width="260" :show-overflow-tooltip="true" -->
<el-table-column label="活动标题" prop="title" />
<el-table-column label="活动标题" prop="title" min-width="260" :show-overflow-tooltip="true" />
<el-table-column prop="readCardNo" label="读者证号" />
<el-table-column prop="readName" label="读者昵称" />
<el-table-column prop="name" label="姓名" />
<el-table-column prop="contact" label="联系方式" />
<el-table-column prop="number" label="参加人数">
<template slot-scope="scope">
{{ scope.row.number || '不限制' }}
</template>
</el-table-column>
<el-table-column prop="signName" label="姓名" />
<el-table-column prop="signPhone" label="联系方式" />
<el-table-column prop="signNum" label="参加人数" />
<el-table-column prop="status" label="预约状态" width="100" align="center">
<template slot-scope="scope">
<span v-if="scope.row.status === 0" class="row-state row-lending state-active">已取消</span>
<!-- 是否取消 true取消 false正常 空全部 -->
<span v-if="scope.row.isCancel === true" class="row-state row-lending state-active">已取消</span>
<span v-else class="row-state row-binding state-active">已预约</span>
</template>
</el-table-column>
<el-table-column prop="create_time" label="预约日期" width="160">
<el-table-column prop="signTime" label="预约日期" width="160">
<template slot-scope="scope">
<div>{{ scope.row.create_time | parseTime }}</div>
<div>{{ scope.row.signTime | parseTime }}</div>
</template>
</el-table-column>
</el-table>
@ -78,7 +76,7 @@ export default {
name: 'ActivityLog',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '活动预约', url: 'api/screenSetting/initScreenBookRecommend2', crudMethod: { ...crudWeChat },
return CRUD({ title: '活动预约', url: 'api/weixin/mySignActivityInfo', crudMethod: { ...crudWeChat },
optShow: {
add: false,
edit: false,
@ -93,8 +91,10 @@ export default {
data() {
return {
statusOptions: [
{ key: 1, display_name: '进行中' },
{ key: 0, display_name: '已取消' }
{ key: 1, display_name: '已预约' },
{ key: 2, display_name: '进行中' },
{ key: 3, display_name: '已完成' },
{ key: -1, display_name: '已取消' }
],
permission: { add: [], edit: [], del: [] }
}
@ -108,28 +108,6 @@ export default {
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.params.libcode = this.user.fonds.fondsNo
const mockData = [
{
id: 1,
name: '张三',
contact: '13800000000',
title: '读书分享会',
number: 4,
status: 1,
create_time: '2026-01-10 10:00:00'
},
{
id: 2,
name: '李四',
contact: '13800000001',
title: '新书发布会',
number: 1,
status: 0,
create_time: '2026-01-12 14:30:00'
}
]
this.crud.data = mockData
this.crud.loading = false
},
//
[CRUD.HOOK.afterToCU](crud, form) {

61
src/views/weChatMiniProgram/module/activityDetail.vue

@ -1,7 +1,7 @@
<template>
<el-dialog
title="活动详情"
:visible.sync="visible"
:visible="dialogVisible"
width="375px"
class="activity-detail-dialog"
top="20px"
@ -11,7 +11,7 @@
>
<div class="mini-program-container">
<div class="content">
<img v-if="activity.coverImage" class="activity-img" :src="`${baseApi}/api/fileRelevant/getImg?imgType=2&imgId=${activity.coverImage}`">
<img v-if="activity.coverImage" class="activity-img" :src="`${imgHttpsUrl}/files/${activity.coverImage}`">
<div v-else class="activity-img-placeholder" />
<div class="activity-base">
@ -50,11 +50,29 @@ export default {
default: () => ({})
}
},
data() {
return {
dialogVisible: false
}
},
computed: {
...mapGetters(['baseApi'])
...mapGetters(['baseApi']),
imgHttpsUrl() {
if (process.env.NODE_ENV === 'production') {
return (window.g && window.g.ApiUrl) || ''
} else {
return process.env.VUE_APP_WECHAT_URL
}
}
},
watch: {
visible(val) {
this.dialogVisible = val
}
},
methods: {
handleClose() {
this.dialogVisible = false
this.$emit('update:activity', {})
this.$emit('update:visible', false)
}
@ -200,6 +218,7 @@ export default {
background-color: #01a4fe;
}
}
}
.content-html {
@ -208,6 +227,42 @@ export default {
width: 100%;
display: block;
}
::v-deep p{
line-height: 1.5;
margin: 15px 0;
}
::v-deep blockquote {
background-color: var(--w-e-textarea-slight-bg-color);
border-left: 8px solid var(--w-e-textarea-selected-border-color);
display: block;
font-size: 100%;
line-height: 1.5;
margin: 10px 0;
padding: 10px;
}
::v-deep .table-container {
border: 1px dashed #dcdfe6;
border-radius: 5px;
margin-top: 10px;
overflow-x: auto;
padding: 10px;
width: 100%;
}
::v-deep table {
width: 100% !important;
border-collapse: collapse;
margin: 10px 0;
}
::v-deep table tr:nth-child(even) {
background-color: #fafafa;
}
::v-deep table td, ::v-deep table th {
border: 1px solid #dcdfe6;
padding: 8px 12px;
text-align: center;
font-size: 14px;
}
}
// .detail-bottom {

Loading…
Cancel
Save