..
This commit is contained in:
+50
@@ -0,0 +1,50 @@
|
||||
package com.budwk.app.zhgh.dayofficework.message.example;
|
||||
|
||||
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 全局消息发送使用示例
|
||||
* 展示如何使用简化的API发送消息
|
||||
*/
|
||||
@IocBean
|
||||
@Slf4j
|
||||
public class MessageSendExample {
|
||||
|
||||
@Inject
|
||||
private GlobalMessageSendService globalMessageSendService;
|
||||
|
||||
/**
|
||||
* 示例1:发送简单的系统通知(自动发送到所有启用的渠道)
|
||||
*/
|
||||
public void sendSimpleNotification() {
|
||||
String title = "系统维护通知";
|
||||
String content = "系统将于今晚22:00-24:00进行维护,请提前保存工作内容。";
|
||||
List<String> receiverIds = Arrays.asList("user1", "user2", "user3");
|
||||
|
||||
// 最简单的调用方式,自动发送到所有启用的渠道
|
||||
globalMessageSendService.sendMessage(title, content, receiverIds);
|
||||
|
||||
log.info("简单系统通知发送完成");
|
||||
}
|
||||
|
||||
/**
|
||||
* 示例2:发送待办通知(自动发送到所有启用的渠道)
|
||||
*/
|
||||
public void sendTodoNotification() {
|
||||
String title = "审批待办";
|
||||
String content = "您有一个新的审批任务需要处理,请及时登录系统查看。";
|
||||
List<String> receiverIds = Arrays.asList("manager1", "manager2");
|
||||
|
||||
// 自动发送到所有启用的渠道
|
||||
globalMessageSendService.sendMessage(title, content, 2, receiverIds, null);
|
||||
|
||||
log.info("待办通知发送完成");
|
||||
}
|
||||
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.h5Controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionApply;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName H5ContributionListController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/18 11:12
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "移动端-慈善捐助项目")
|
||||
@At("/platform/contribution/list/h5")
|
||||
public class H5ContributionListController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("h5.contribution.list")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/contribution/list/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("h5.contribution.list")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
con.*,
|
||||
con.id as contributionId,
|
||||
type.id as typeId,
|
||||
type.typeName
|
||||
FROM
|
||||
`contribution_project` con
|
||||
LEFT JOIN contribution_type type ON type.typeCode = con.contributionTypeCode
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("con.contributionTypeCode", "=", type);
|
||||
cnd.andEX("year(contributionCreationDate)", "=", year);
|
||||
cnd.and("isContributionEnable", "=", true);
|
||||
cnd.desc("contributionCreationDate");
|
||||
cnd.asc("contributionMode");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
@At
|
||||
@ApiOperation("移动端-慈善捐助")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("h5.contribution.list")
|
||||
@SLog(tag = "慈善捐助-捐助", msg = "慈善捐助")
|
||||
public Object submit(ContributionApply apply) {
|
||||
if(StrUtil.isBlank(apply.getId())) {
|
||||
apply.setContributionTime(DateUtil.now());
|
||||
}
|
||||
dao.insertOrUpdate(apply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个慈善捐助专题")
|
||||
@SaCheckPermission("contribution")
|
||||
public Result fetchOne(String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
con.*,
|
||||
( SELECT SUM( money ) FROM contribution_apply apply WHERE apply.contributionId = con.id ) totalMoney,
|
||||
( SELECT COUNT( 1 ) FROM contribution_apply apply WHERE apply.contributionId = con.id ) peopleCount
|
||||
FROM
|
||||
`contribution_project` con
|
||||
WHERE con.id = @id
|
||||
""");
|
||||
sql.setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
NutMap nutMap = (NutMap) sql.getResult();
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.h5Controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingTimePeriod;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingTimePeriodUser;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionApply;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @ClassName H5ContributionMineController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/18 15:17
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "移动端-我的慈善捐助")
|
||||
@At("/platform/contribution/mine/h5")
|
||||
public class H5ContributionMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("h5.contribution.mine")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/contribution/mine/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("h5.contribution.mine")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ca.*,
|
||||
ca.id as applyId,
|
||||
cp.contributionName AS projectName,
|
||||
cp.contributionTypeCode,
|
||||
cp.contributionStartTime,
|
||||
cp.contributionEndTime,
|
||||
ct.id as typeId
|
||||
FROM
|
||||
contribution_apply ca
|
||||
LEFT JOIN contribution_project cp ON ca.contributionId = cp.id
|
||||
LEFT JOIN contribution_type ct ON cp.contributionTypeCode = ct.typeCode
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year(ca.contributionTime)", "=", year);
|
||||
cnd.andEX("cp.contributionTypeCode", "=", type);
|
||||
cnd.desc("ca.contributionTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除慈善捐助")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("h5.contribution.mine")
|
||||
@SLog(tag = "慈善捐助-删除慈善捐助", msg = "删除慈善捐助")
|
||||
public Object delete(String id) {
|
||||
dao.delete(ContributionApply.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
const applyForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<van-action-sheet :close-on-click-overlay="false" title="捐助信息" v-model="visible">
|
||||
<van-form ref="formRef" class="form-container">
|
||||
<van-cell-group title="基本信息" class="form-section">
|
||||
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
|
||||
<van-field label="单位" readonly v-model="formData.unitName"></van-field>
|
||||
<van-field label="工会" readonly v-model="formData.unionName"></van-field>
|
||||
<van-field label="电话" v-model="formData.mobile" placeholder="请输入电话" type="number"
|
||||
required :rules="[{ required: true }]" name="digit">
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="支付信息" class="form-section">
|
||||
<van-field v-model="formData.money" label="捐助金额" type="number" placeholder="请输入捐助金额"
|
||||
required :rules="[{ required: true }]" name="money">
|
||||
<template #button>
|
||||
元
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field label="捐助方式" required :rules="[{ required: true }]" name="payMode" >
|
||||
<template #input>
|
||||
<van-radio-group v-model="formData.payMode" direction="horizontal">
|
||||
<van-radio name="WeChat">
|
||||
<van-icon size="18" name="wechat-pay"></van-icon>
|
||||
微信
|
||||
</van-radio>
|
||||
<van-radio name="Alipay">
|
||||
<van-icon size="18" name="alipay"></van-icon>
|
||||
支付宝
|
||||
</van-radio>
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="捐助凭证" class="form-section">
|
||||
<van-field name="contributionFiles" label="捐助凭证" required :rules="[{ required: true }]">
|
||||
<template #input>
|
||||
<h5-file-upload
|
||||
slot="input"
|
||||
:value.sync="formData.contributionFiles"
|
||||
:upload_number="5"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
></h5-file-upload>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<div class="form-actions">
|
||||
<van-button @click="onSubmit" round type="info">提交</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
visible:false,
|
||||
row: {},
|
||||
formData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
this.row = row
|
||||
if(row && row.applyId) {
|
||||
this.formData = clone(row)
|
||||
} else {
|
||||
this.init()
|
||||
}
|
||||
this.visible = true
|
||||
},
|
||||
init() {
|
||||
this.$set(this.formData, 'contributionId', this.row.id)
|
||||
this.$set(this.formData, 'contributionName', this.row.contributionName)
|
||||
this.$set(this.formData, 'userId', this.$store.state.user.id)
|
||||
this.$set(this.formData, 'sex', this.$store.state.user.sex)
|
||||
this.$set(this.formData, 'userName', this.$store.state.user.username)
|
||||
this.$set(this.formData, 'loginName', this.$store.state.user.loginname)
|
||||
this.$set(this.formData, 'unitId', this.$store.state.user?.unit?.id)
|
||||
this.$set(this.formData, 'unitName', this.$store.state.user?.unit?.name)
|
||||
this.$set(this.formData, "unionId", this.$store.state.user?.union?.id)
|
||||
this.$set(this.formData, "unionName", this.$store.state.user?.union?.name)
|
||||
this.$set(this.formData, 'mobile', this.$store.state.user.mobile)
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
const formData = clone(this.formData)
|
||||
formData.contributionFiles = JSON.stringify(formData.contributionFiles)
|
||||
this.$axios.post("/platform/contribution/list/h5/submit", formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$toast(res.msg)
|
||||
this.visible = false
|
||||
this.$pjaxReplace("/platform/contribution/mine/h5")
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/deep/ .van-radio__label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
`
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
const projectInfo = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<van-action-sheet v-model="visible" title="项目信息" cancel-text="取消">
|
||||
<div class="detail-container">
|
||||
<van-image class="info-img" height="186" width="100%" :src="viewData.contributionFiles"></van-image>
|
||||
|
||||
<div class="info-middle">
|
||||
<div>已筹总额:{{ viewData.totalMoney || 0 }}元</div>
|
||||
<div>捐助人次:{{ viewData.peopleCount || 0 }}人</div>
|
||||
</div>
|
||||
|
||||
<div class="info-title">{{viewData.contributionName}}</div>
|
||||
<div class="info-content" v-html="viewData.contributionIntroduce"></div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
visible:false,
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
this.$axios.post('/platform/contribution/list/h5/fetchOne', {id: row.contributionId})
|
||||
.then((res) => {
|
||||
this.viewData = res.data
|
||||
})
|
||||
this.visible = true
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/deep/ .info-middle {
|
||||
background-color: #F5F7FA;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
color: #666666;
|
||||
font-size: 14px;
|
||||
}
|
||||
/deep/ .info-title {
|
||||
font-weight: bold;
|
||||
background-color: white;
|
||||
padding: 13px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
text-align: center !important;
|
||||
margin-top: 10px;
|
||||
}
|
||||
/deep/ .info-content {
|
||||
padding: 10px;
|
||||
background-color: white;
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
const typeInfo = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<van-action-sheet v-model="visible" title="专题信息" cancel-text="取消">
|
||||
<div class="detail-container">
|
||||
<van-image class="info-img" height="186" width="100%" :src="viewData.contributionTypeFiles"></van-image>
|
||||
|
||||
<div class="info-middle">
|
||||
<div>子项目数:{{ viewData.projectCount || 0 }}个</div>
|
||||
<div>已筹总额:{{ viewData.totalMoney || 0 }}元</div>
|
||||
<div>捐助人次:{{ viewData.peopleCount || 0 }}人</div>
|
||||
</div>
|
||||
|
||||
<div class="info-title">{{viewData.typeName}}</div>
|
||||
<div class="info-content">{{viewData.contributionTypeIntroduce}}</div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
visible:false,
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
this.$axios.post('/platform/contribution/type/fetchOne', {id: row.typeId})
|
||||
.then((res) => {
|
||||
this.viewData = res.data
|
||||
})
|
||||
this.visible = true
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/deep/ .info-middle {
|
||||
background-color: #F5F7FA;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
color: #666666;
|
||||
font-size: 14px;
|
||||
}
|
||||
/deep/ .info-title {
|
||||
font-weight: bold;
|
||||
background-color: white;
|
||||
padding: 13px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
text-align: center !important;
|
||||
margin-top: 10px;
|
||||
}
|
||||
/deep/ .info-content {
|
||||
padding: 10px;
|
||||
background-color: white;
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app">
|
||||
<van-nav-bar title="慈善捐助项目" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
|
||||
|
||||
<van-sticky offset-top="46px">
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.type" :options="typeOptions" :multiple="false"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<table-list api="/platform/contribution/list/h5/pageData"
|
||||
:page_form.sync="pageForm"
|
||||
ref="tableListRef"
|
||||
img="contributionFiles"
|
||||
@ready="onReady">
|
||||
<template #header="{index,row}">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ row.contributionName }}</div>
|
||||
<van-tag type="primary">{{ row.contributionTypeCode ? '专题' : '' }}</van-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="捐助模式">{{ row.contributionMode === 1 ? '水滴筹' : '一日捐' }}</table-column>
|
||||
<table-column label="开始时间">{{row.contributionStartTime}}</table-column>
|
||||
<table-column label="结束时间">{{row.contributionEndTime}}</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div v-if="row.contributionTypeCode" class="action-btn" @click="onTypeView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>专题介绍</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>项目介绍</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="onApply(row)">
|
||||
<i class="fa fa-cny"></i>
|
||||
<span>捐助</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<type-info ref="typeInfoRef"></type-info>
|
||||
<project-info ref="projectInfoRef"></project-info>
|
||||
<apply-form ref="applyFormRef"></apply-form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../common/typeInfo.js'){}#-->
|
||||
<!--#include('../common/projectInfo.js'){}#-->
|
||||
<!--#include('../common/applyForm.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
components: {
|
||||
'type-info': typeInfo,
|
||||
'project-info': projectInfo,
|
||||
'apply-form': applyForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
year: new Date().getFullYear(),
|
||||
type: null,
|
||||
},
|
||||
typeOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onReady() {
|
||||
const typeList = await this.queryType()
|
||||
this.typeOptions = [
|
||||
{
|
||||
text: "全部类型",
|
||||
value: null
|
||||
}
|
||||
].concat(typeList.map((v) => ({ text: v.typeName, value: v.typeCode })))
|
||||
if (this.typeOptions.length > 0) {
|
||||
this.pageForm.type = this.typeOptions[0].value
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
onApply(row) {
|
||||
if(row.contributionMode === 1) {
|
||||
location.href = row.contributionUrl
|
||||
} else {
|
||||
delete row.contributionFiles
|
||||
this.$refs.applyFormRef.onOpen(row)
|
||||
}
|
||||
},
|
||||
onTypeView(row) {
|
||||
this.$refs.typeInfoRef.onOpen(row)
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.projectInfoRef.onOpen(row)
|
||||
},
|
||||
async queryType() {
|
||||
const res = await this.$axios.post('/platform/contribution/type/queryContributionType')
|
||||
return res.data
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,143 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app">
|
||||
<van-nav-bar title="我的慈善捐助" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
|
||||
|
||||
<van-sticky offset-top="46px">
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.type" :options="typeOptions" :multiple="false"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<table-list api="/platform/contribution/mine/h5/pageData"
|
||||
:page_form.sync="pageForm"
|
||||
ref="tableListRef"
|
||||
@ready="onReady">
|
||||
<template #header="{index,row}">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ row.projectName }}</div>
|
||||
<van-tag type="primary">{{ row.contributionTypeCode ? '专题' : '' }}</van-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="捐助方式">{{ row.payMode === 'WeChat' ? '微信' : '支付宝' }}</table-column>
|
||||
<table-column label="捐助金额">{{row.money}}</table-column>
|
||||
<table-column label="捐助时间">{{row.contributionTime}}</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div v-if="row.contributionTypeCode" class="action-btn" @click="onTypeView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>专题介绍</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>项目介绍</span>
|
||||
</div>
|
||||
<div v-if="$moment().isBefore($moment(row.contributionStartTime))"
|
||||
class="action-btn" @click="onEdit(row)">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
<div v-if="$moment().isBefore($moment(row.contributionStartTime))"
|
||||
class="action-btn delete" @click="onDelete(row)">
|
||||
<i class="fa fa-trash"></i>
|
||||
<span>删除</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<type-info ref="typeInfoRef"></type-info>
|
||||
<project-info ref="projectInfoRef"></project-info>
|
||||
<apply-form ref="applyFormRef"></apply-form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../common/typeInfo.js'){}#-->
|
||||
<!--#include('../common/projectInfo.js'){}#-->
|
||||
<!--#include('../common/applyForm.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
components: {
|
||||
'type-info': typeInfo,
|
||||
'project-info': projectInfo,
|
||||
'apply-form': applyForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
year: new Date().getFullYear(),
|
||||
type: null,
|
||||
},
|
||||
typeOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onReady() {
|
||||
const typeList = await this.queryType()
|
||||
this.typeOptions = [
|
||||
{
|
||||
text: "全部类型",
|
||||
value: null
|
||||
}
|
||||
].concat(typeList.map((v) => ({ text: v.typeName, value: v.typeCode })))
|
||||
if (this.typeOptions.length > 0) {
|
||||
this.pageForm.type = this.typeOptions[0].value
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
onEdit(row) {
|
||||
this.$refs.applyFormRef.onOpen(row)
|
||||
},
|
||||
onTypeView(row) {
|
||||
this.$refs.typeInfoRef.onOpen(row)
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.projectInfoRef.onOpen(row)
|
||||
},
|
||||
onDelete(row) {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要删除吗?"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/contribution/mine/h5/delete", { id: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$toast.fail(res.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
async queryType() {
|
||||
const res = await this.$axios.post('/platform/contribution/type/queryContributionType')
|
||||
return res.data
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user