Administrator
9 days ago f37e8e86783ac89e4b6fa98f714e6ab626367405
feat(socialCircle): 新增视频号内容支持

- 在社区活动功能中添加视频号内容支持
- 新增视频号类型选择和相关字段
- 实现视频号内容的展示和隐藏逻辑
- 更新列表页面,增加来源列显示内容类型
7 files modified
113 ■■■■■ changed files
src/main/java/cc/mrbird/febs/mall/entity/HappySocialCircle.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/IAdminHappySocialCircleServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/activity/ApiScInfoVo.java 6 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/HappySocialCircleMapper.xml 3 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/socialCircle/add.html 40 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/socialCircle/discountUpdate.html 40 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/socialCircle/list.html 12 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/entity/HappySocialCircle.java
@@ -19,6 +19,9 @@
     `state` int(11) DEFAULT '0' COMMENT '状态 0-未开启 1-已开启',
     `hot_state` int(11) DEFAULT '0' COMMENT '是否推荐到首页 0-不推荐 1-推荐',
     `order_cnt` int(11) DEFAULT '0' COMMENT '排序',
     `is_normal` int(11) DEFAULT '1' COMMENT '1:普通社区内容  2:视频号内容',
     `finder_user_name` varchar(128) DEFAULT NULL COMMENT '视频号 id,以“sph”开头的id,可在视频号助手获取',
     `feed_id` varchar(512) DEFAULT NULL COMMENT '视频 feedId',
     */
    private Long memberId;
    @TableField(exist = false)
@@ -33,4 +36,8 @@
    private Integer state;
    private Integer hotState;
    private Integer orderCnt;
    //1:普通社区内容  2:视频号内容
    private Integer isNormal;
    private String finderUserName;
    private String feedId;
}
src/main/java/cc/mrbird/febs/mall/service/impl/IAdminHappySocialCircleServiceImpl.java
@@ -210,6 +210,11 @@
        happySocialCircle.setContent(dto.getContent());
        happySocialCircle.setIndexFile(dto.getIndexFile());
        happySocialCircle.setOrderCnt(dto.getOrderCnt());
        happySocialCircle.setIsNormal(dto.getIsNormal());
        if("2".equals(dto.getIsNormal())){
            happySocialCircle.setFinderUserName(dto.getFinderUserName());
            happySocialCircle.setFeedId(dto.getFeedId());
        }
        this.baseMapper.updateById(happySocialCircle);
        return new FebsResponse().success().message("操作成功");
src/main/java/cc/mrbird/febs/mall/vo/activity/ApiScInfoVo.java
@@ -41,5 +41,11 @@
    @ApiModelProperty(value = "转发数")
    private Integer sendCnt;
    @ApiModelProperty(value = "1:普通社区内容  2:视频号内容")
    private Integer isNormal;
    @ApiModelProperty(value = "视频号finderUserName")
    private String finderUserName;
    @ApiModelProperty(value = "视频号feedId")
    private String feedId;
}
src/main/resources/mapper/modules/HappySocialCircleMapper.xml
@@ -5,6 +5,9 @@
    <select id="selectListInPage" resultType="cc.mrbird.febs.mall.vo.activity.ApiScInfoVo">
        select
            a.id,
            a.is_normal,
            a.finder_user_name,
            a.feed_id,
            b.avatar,
            b.name as memberName,
            a.name as name,
src/main/resources/templates/febs/views/modules/socialCircle/add.html
@@ -9,6 +9,34 @@
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <div class="layui-row layui-col-space10 layui-form-item">
                                    <div class="layui-col-lg6">
                                        <label class="layui-form-label febs-form-item-require">来源:</label>
                                        <div class="layui-input-block">
                                            <select name="isNormal" class="goods-type" lay-filter="goods-type-select">
                                                <option value="1">普通社区内容</option>
                                                <option value="2">视频号内容</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <blockquote class="layui-elem-quote blue-border febs-hide tc-set">视频号信息</blockquote>
                                <div class="layui-form-item febs-hide tc-set">
                                    <div class="layui-col-lg6">
                                        <label class="layui-form-label">视频号 id:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="finderUserName" placeholder="请输入" autocomplete="off" class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">视频号 id,以“sph”开头的id,可在视频号助手获取。</div>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg6">
                                        <label class="layui-form-label">视频 feedId:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="feedId" placeholder="请输入" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <blockquote class="layui-elem-quote blue-border">基础信息</blockquote>
                                <div class="layui-row layui-col-space10 layui-form-item">
                                    <div class="layui-col-lg6">
@@ -25,6 +53,8 @@
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-row layui-col-space10 layui-form-item">
                                    <div class="layui-col-lg6">
                                        <label class="layui-form-label febs-form-item-require">封面:</label>
@@ -245,5 +275,15 @@
            return false;
        });
        form.on('select(goods-type-select)', function(data){
            $('.tc-set').each(function() {
                if (data.value == 2) {
                    $(this).show();
                } else {
                    $(this).hide();
                }
            })
        });
    });
</script>
src/main/resources/templates/febs/views/modules/socialCircle/discountUpdate.html
@@ -9,6 +9,33 @@
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <div class="layui-row layui-col-space10 layui-form-item">
                                    <div class="layui-col-lg6">
                                        <label class="layui-form-label febs-form-item-require">来源:</label>
                                        <div class="layui-input-block">
                                            <select name="isNormal" class="goods-type" lay-filter="goods-type-select">
                                                <option value="1">普通社区内容</option>
                                                <option value="2">视频号内容</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <blockquote class="layui-elem-quote blue-border febs-hide tc-set">视频号信息</blockquote>
                                <div class="layui-form-item febs-hide tc-set">
                                    <div class="layui-col-lg6">
                                        <label class="layui-form-label">视频号 id:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="finderUserName" placeholder="请输入" autocomplete="off" class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">视频号 id,以“sph”开头的id,可在视频号助手获取。</div>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg6">
                                        <label class="layui-form-label">视频 feedId:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="feedId" placeholder="请输入" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <blockquote class="layui-elem-quote blue-border">基础信息</blockquote>
                                <!-- 隐藏的 ID 项 -->
                                <div class="layui-form-item febs-hide">
@@ -241,6 +268,9 @@
                "orderCnt": activity.orderCnt,
                "hotState": activity.hotState,
                "indexFile": activity.indexFile,
                "isNormal": activity.isNormal,
                "finderUserName": activity.finderUserName,
                "feedId": activity.feedId,
            });
            var arr = [];
            arr.push(activity.categoryId);
@@ -281,5 +311,15 @@
            })
            return false;
        });
        form.on('select(goods-type-select)', function(data){
            $('.tc-set').each(function() {
                if (data.value == 2) {
                    $(this).show();
                } else {
                    $(this).hide();
                }
            })
        });
    });
</script>
src/main/resources/templates/febs/views/modules/socialCircle/list.html
@@ -64,6 +64,15 @@
    <input type="checkbox" value={{d.id}} lay-text="展示|隐藏" lay-skin="switch" lay-filter="scStateSwitch">
    {{# } }}
</script>
<script type="text/html" id="socialTypeFormat">
    {{# if(d.isNormal == 1) { }}
    <span>普通社区内容</span>
    {{# }else if(d.isNormal == 2) { }}
    <span>视频号内容</span>
    {{# } else { }}
    <span>-</span>
    {{# } }}
</script>
<script type="text/html" id="scToolbar">
    <div class="layui-btn-container">
@@ -203,10 +212,11 @@
                    {type: 'numbers', title: '', width: 80},
                    {title: '操作', toolbar: '#activityOption', minWidth: 200, align: 'center'},
                    {templet:"#socialTypeFormat",  title: '来源', minWidth: 140,align:'left'},
                    {field: 'name', title: '标题', minWidth: 150,align:'left'},
                    {field: 'memberName', title: '发布人', minWidth: 150,align:'left'},
                    {field: 'categoryName', title: '分类', minWidth: 150,align:'left'},
                    {field: 'state', title: '状态', templet: '#scStateSwitch', minWidth: 130,align:'center'}
                    {field: 'state', title: '状态', templet: '#scStateSwitch', minWidth: 130,align:'center'},
                ]]
            });
        }