- 框架初始化
 - 安装插件
 - 修复PHP8.4报错
This commit is contained in:
2025-04-19 17:21:20 +08:00
commit c6a4e1f5f6
5306 changed files with 967782 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
{include file="/shopro/common/script" /}
<style>
.desc {
font-size: 14px;
color: #999999;
margin-left: 12px;
}
.title {
margin: 0 0 18px 50px;
}
.price-title {
margin-right: 8px;
}
.price2-title {
margin: 0 8px 0 16px;
}
.el-form .sa-w-160 {
max-width: 160px;
width: 100%;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
</style>
<div id="addEdit" class="molive-form" v-cloak>
<el-container class="panel-block">
<el-main>
<el-scrollbar height="100%">
<el-form :model="form.model" :rules="form.rules" ref="formRef" label-width="120px">
<div class="sa-color--warning title">在小程序直播控制台添加的商品,不支持通过此系统操作。</div>
<el-form-item label="商品来源">
<el-radio-group v-model="form.model.type">
<el-radio :label="0">我的小程序</el-radio>
<el-radio :label="1">其他小程序</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="商品选择" prop="goods_id" v-if="form.model.type === 0">
<el-button type="primary" link @click="selectGoods" v-if="!form.model.goods_id">+ 添加商品
</el-button>
<div class="sa-template-wrap">
<template v-if="form.model.goods_id">
<div class="header">
<div class="key">商品信息</div>
<div class="oper">操作</div>
</div>
<div class="item">
<div class="goods-item key">
<sa-image class="goods-image" :url="goods.image" size="40">
</sa-image>
<div>
<div class="goods-title sa-table-line-1">{{ goods.title }}</div>
</div>
</div>
<div class="oper">
<el-button type="danger" link @click="deleteItems()">移除
</el-button>
</div>
</div>
</template>
</div>
</el-form-item>
<el-form-item label="商品封面">
<sa-uploader v-model="form.model.cover_img_url" fileType="image"></sa-uploader>
<div class="desc"> 图片尺寸最大300像素*300像素 </div>
</el-form-item>
<el-form-item label="商品名称" prop="name">
<el-input v-model="form.model.name" :maxlength="14" :minlength="3" show-word-limit
placeholder="请输入商品名称"></el-input>
</el-form-item>
<el-form-item label="价格形式" prop="price_type">
<el-radio-group v-model="form.model.price_type">
<el-radio :label="1">一口价</el-radio>
<el-radio :label="2">价格区间</el-radio>
<el-radio :label="3">显示折扣价</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="价格">
<div class="price-title" v-if="form.model.price_type !== 1">{{
form.model.price_type === 2 ? '最小价格' : '市场价'
}}</div>
<el-input v-model="form.model.price" placeholder="请输入价格" class="sa-w-160" type="number"
:step="0.01" :min="0" :precision="2">
<template #append></template>
</el-input>
<div class="price2-title" v-if="form.model.price_type !== 1">{{
form.model.price_type === 2 ? '最大价格' : '现价'
}}</div>
<el-input v-model="form.model.price2" placeholder="请输入价格" class="sa-w-160" type="number"
:step="0.01" :min="0" :precision="2" v-if="form.model.price_type !== 1">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="APPID" prop="third_party_appid" v-if="form.model.type === 1">
<el-input v-model="form.model.third_party_appid" placeholder="请输入该小程序APPID"></el-input>
</el-form-item>
<el-form-item label="商品路径" prop="url">
<div>
<el-input v-model="form.model.url" placeholder="请输入商品路径"></el-input>
<div class="desc">
请确保小程序页面路径可被访问。例如pages/goods/index?query=value
</div>
</div>
</el-form-item>
</el-form>
</el-scrollbar>
</el-main>
<el-footer class="sa-footer--submit sa-flex sa-row-right">
<el-button type="primary" @click="onConfirm">确定</el-button>
</el-footer>
</el-container>
</div>

View File

@@ -0,0 +1,252 @@
{include file="/shopro/common/script" /}
<style>
.price-title {
text-decoration: line-through;
margin-right: 8px;
color: var(--sa-subfont);
}
.live-qrcode {
width: 150px;
height: 150px;
}
.empty-data {
width: 210px;
height: 150px;
}
</style>
<div id="index" class="mplive-index panel panel-default panel-intro" v-cloak>
<el-container class="panel-block">
<el-header class="sa-header">
<el-tabs class="sa-tabs" v-model="dispatchType">
<el-tab-pane label="直播间管理" name="live"></el-tab-pane>
<el-tab-pane label="商品库管理" name="goods"></el-tab-pane>
</el-tabs>
<div class="sa-title sa-flex sa-row-between">
<div class="sa-title-left">
<div class="left-name">{{ dispatchType === 'live' ? '直播间管理' : '商品库管理' }}</div>
<sa-filter-condition v-model="state.filter" @filter-delete="onChangeFilter">
</sa-filter-condition>
</div>
<div v-if="dispatchType === 'live'">
<el-popover placement="bottom" :width="180" trigger="click">
<template #reference>
<el-button class="sa-button-refresh">主播端</el-button>
</template>
<img class="live-qrcode" src="/assets/addons/shopro/img/live-qrcode.png" />
</el-popover>
<!-- :loading="loading" -->
{if $auth->check('shopro/app/mplive/room/sync')}
<el-button class="sa-button-refresh" icon="RefreshRight" @click="sync">同步直播间</el-button>
{/if}
{if $auth->check('shopro/app/mplive/room/add')}
<el-button class="sa-button-refresh" type="primary" icon="Plus" @click="addRow">创建直播间</el-button>
{/if}
</div>
<div v-if="dispatchType === 'goods'">
<el-button class="sa-button-refresh" icon="RefreshRight" @click="getData()"></el-button>
<el-button class="sa-button-refresh" icon="Search" @click="openFilter"></el-button>
{if $auth->check('shopro/app/mplive/goods/add')}
<el-button class="sa-button-refresh" type="primary" icon="Plus" @click="addGoods">添加商品</el-button>
{/if}
</div>
</div>
</el-header>
<!-- v-loading="loading" -->
<el-main class="sa-p-0">
<el-table height="100%" class="sa-table" :data="live.data" stripe @sort-change="onChangeSort" v-if="dispatchType === 'live'">
<el-table-column label="房间ID" sortable="custom" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.roomid }}</div>
</template>
</el-table-column>
<el-table-column label="直播类型" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.type_text }}</div>
</template>
</el-table-column>
<el-table-column label="直播间标题" min-width="200" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.name }}</div>
</template>
</el-table-column>
<el-table-column label="主播昵称" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.anchor_name }}</div>
</template>
</el-table-column>
<el-table-column label="状态" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1" :class="
scope.row.status === 101
? 'sa-color--success'
: scope.row.status === 102
? 'sa-color--warning'
: scope.row.status === 105
? 'sa-color--info'
: 'sa-color--danger'
">{{ scope.row.status_text }}</div>
</template>
</el-table-column>
<el-table-column label="背景图" min-width="80" align="center">
<template #default="scope">
<div class="sa-flex sa-row-center">
<sa-image :url="scope.row.cover_img" size="30">
</sa-image>
</div>
</template>
</el-table-column>
<el-table-column label="分享图" min-width="80" align="center">
<template #default="scope">
<div class="sa-flex sa-row-center">
<sa-image :url="scope.row.share_img" size="30"></sa-image>
</div>
</template>
</el-table-column>
<el-table-column label="封面图" min-width="80" align="center">
<template #default="scope">
<div class="sa-flex sa-row-center">
<sa-image :url="scope.row.feeds_img" size="30"></sa-image>
</div>
</template>
</el-table-column>
<el-table-column label="开播时间" min-width="200" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{
Moment(scope.row.start_time * 1000).format('YYYY-MM-DD HH:mm')
}}</div>
</template>
</el-table-column>
<el-table-column label="结束时间" min-width="200" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{
Moment(scope.row.end_time * 1000).format('YYYY-MM-DD HH:mm')
}}</div>
</template>
</el-table-column>
<el-table-column label="操作" min-width="340" fixed="right" align="center">
<template #default="scope">
{if $auth->check('shopro/app/mplive/room/edit')}
<el-button link type="primary" @click="editRow(scope.row.roomid)">编辑</el-button>
{/if}
{if $auth->check('shopro/app/mplive/room/pushurl')}
<el-button link type="primary" @click="pushUrl(scope.row.roomid)"
v-if="scope.row.type === 1 && (scope.row.status === 101 || scope.row.status === 102)">推流地址</el-button>
{/if}
{if $auth->check('shopro/app/mplive/room/qrcode')}
<el-button link type="primary" @click="shareQrcode(scope.row.roomid)"
v-if="scope.row.status === 101 || scope.row.status === 102">分享二维码</el-button>
{/if}
{if $auth->check('shopro/app/mplive/room/playback')}
<el-button link type="primary" @click="playBack(scope.row.roomid)"
v-if="scope.row.status === 103">回放</el-button>
{/if}
<el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
title="确认删除这条记录?" @confirm="deleteApi(scope.row.roomid)">
<template #reference>
{if $auth->check('shopro/app/mplive/room/delete')}
<el-button link type="danger">
删除
</el-button>
{/if}
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<el-table height="100%" class="sa-table" :data="goods.data" stripe v-if="dispatchType === 'goods'">
<el-table-column prop="id" label="ID" min-width="80"></el-table-column>
<el-table-column label="商品来源" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.type_text }}</div>
</template>
</el-table-column>
<el-table-column label="商品封面" min-width="80" align="center">
<template #default="scope">
<div class="sa-flex sa-row-center">
<sa-image :url="scope.row.cover_img_url" size="30">
</sa-image>
</div>
</template>
</el-table-column>
<el-table-column label="商品名称" min-width="220" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.name }}</div>
</template>
</el-table-column>
<el-table-column label="价格形式" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.price_type_text }}</div>
</template>
</el-table-column>
<el-table-column label="价格" min-width="200" align="center">
<template #default="scope">
<div class="sa-table-line-1">
<div class="sa-flex sa-row-center">
<div :class="{ 'price-title': scope.row.price_type === 3 }">{{ scope.row.price }}元</div>
<div>
{{ formatPrice(scope.row.price2, scope.row.price_type) }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="商品路径" min-width="300" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.url }}</div>
</template>
</el-table-column>
<el-table-column label="审核状态" min-width="120" align="center" fixed="right">
<template #default="scope">
<div class="sa-flex sa-row-center">
<div class="sa-table-line-1" :class="
scope.row.audit_status === 2
? 'sa-color--success'
: scope.row.audit_status === 3
? 'sa-color--danger'
: scope.row.audit_status === 1 ? 'sa-color--warning' : 'sa-color--info'
">{{ scope.row.audit_status_text }}</div>
<el-button link icon="RefreshRight" @click="getStatus(scope.row.id)"></el-button>
</div>
</template>
</el-table-column>
<el-table-column label="操作" min-width="200" fixed="right">
<template #default="scope">
{if $auth->check('shopro/app/mplive/goods/edit')}
<el-button link type="primary" @click="editGoods(scope.row.id)">编辑</el-button>
{/if}
{if $auth->check('shopro/app/mplive/goods/audit')}
<el-button link type="primary" @click="check(scope.row.id, 'resubmit')"
v-if="scope.row.audit_status === 0 || scope.row.audit_status === 3">提交审核</el-button>
{/if}
{if $auth->check('shopro/app/mplive/goods/audit')}
<el-button link type="primary" v-if="scope.row.audit_status === 1"
@click="check(scope.row.id, 'reset')">撤回审核</el-button>
{/if}
<el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
title="确认删除这条记录?" @confirm="deleteGoods(scope.row.id)">
<template #reference>
{if $auth->check('shopro/app/mplive/goods/delete')}
<el-button link type="danger">删除</el-button>
{/if}
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</el-main>
<el-footer class="sa-footer sa-flex sa-row-between sa-flex-wrap" v-if="dispatchType === 'goods'">
<div class="sa-batch sa-flex">
</div>
<sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
</el-footer>
</el-container>
<sa-filter v-model="state.filter" @filter-change="onChangeFilter"></sa-filter>
</div>

View File

@@ -0,0 +1,134 @@
{include file="/shopro/common/script" /}
<style>
.desc {
font-size: 14px;
color: #999999;
margin-left: 12px;
}
.qrcode-img {
width: 150px;
height: 150px;
}
</style>
<div id="addEdit" class="molive-form" v-cloak>
<el-container class="panel-block">
<el-main>
<el-scrollbar height="100%">
<el-form :model="form.model" :rules="form.rules" ref="formRef" label-width="120px">
<el-form-item label="直播类型" prop="type">
<div>
<el-radio-group v-model="form.model.type">
<el-radio :label="0">手机直播</el-radio>
<el-radio :label="1">推流设备直播</el-radio>
</el-radio-group>
<div class="desc" v-if="form.model.type === 0">通过“小程序直播”小程序开播</div>
<div class="desc" v-if="form.model.type === 1">通过第三方推流设备发起直播,请自行定义画面宽高比</div>
</div>
</el-form-item>
<el-form-item label="直播间标题" prop="name">
<el-input v-model="form.model.name" placeholder="请输入直播间标题"></el-input>
</el-form-item>
<el-form-item label="背景图" prop="cover_img">
<sa-uploader v-model="form.model.cover_img" fileType="image"></sa-uploader>
<div class="desc"> 直播间背景图图片建议像素1080*1920大小不超过2M </div>
</el-form-item>
<el-form-item label="分享图" prop="share_img">
<sa-uploader v-model="form.model.share_img" fileType="image"></sa-uploader>
<div class="desc"> 直播间分享图图片建议像素800*640大小不超过1M </div>
</el-form-item>
<el-form-item label="封面图" prop="feeds_img">
<sa-uploader v-model="form.model.feeds_img" fileType="image"></sa-uploader>
<div class="desc">
购物直播频道封面图图片建议像素800*800大小不超过100KB
</div>
</el-form-item>
<el-form-item label="开播时间" prop="date_time">
<div>
<el-date-picker v-model="form.model.date_time" type="datetimerange"
value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
:default-time="defaultTime"
range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"
prefix-icon="Calendar" :editable="false" :disabled-date="disabledDate" />
</div>
<div class="desc">
开播时间需要在当前时间的30分钟后 并且 开始时间不能在 6 个月后<br />
开播时间和结束时间间隔不得短于30分钟不得超过72小时<br />
开播时间段仅供参考,不是实际直播间可以开播的时间。<br />
直播间在开始时间前也可以开播,并且到结束时间后不会强制结束。<br />
若到结束时间仍未开播,则直播间无法再开播。
</div>
</el-form-item>
<el-form-item label="主播昵称" prop="anchor_name">
<el-input v-model="form.model.anchor_name" placeholder="请输入主播昵称"></el-input>
</el-form-item>
<el-form-item label="主播微信账号" prop="anchor_wechat">
<div>
<el-input v-model="form.model.anchor_wechat" placeholder="请输入主播微信账号"></el-input>
<div class="desc">
每个直播间需要绑定一个用作核实主播身份,不会展示给观众。<br />
主播微信号,如果未实名认证,需要先前往“小程序直播”小程序进行实名验证。
</div>
<el-popover :width="180" trigger="click">
<template #reference>
<el-button class="is-link" type="primary">小程序认证</el-button>
</template>
<img class="qrcode-img" src="/assets/addons/shopro/img/live-qrcode.png" />
</el-popover>
</div>
</el-form-item>
<el-form-item label="主播副号" prop="sub_anchor_wechat">
<el-input v-model="form.model.sub_anchor_wechat" placeholder="请输入主播副号"></el-input>
</el-form-item>
<el-form-item label="官方收录">
<div>
<el-switch v-model="form.model.is_feeds_public" :active-value="1"
:inactive-value="0"></el-switch>
<div class="desc">
开启后本场直播将有可能被官方推荐。<br />
此项设置在直播间创建完成后可以在控制台内修改。
</div>
</div>
</el-form-item>
<el-form-item label="允许点赞">
<el-radio-group v-model="form.model.close_like">
<el-radio :label="0">开启</el-radio>
<el-radio :label="1">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="展示商品货架">
<el-radio-group v-model="form.model.close_goods">
<el-radio :label="0">开启</el-radio>
<el-radio :label="1">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="允许评论">
<el-radio-group v-model="form.model.close_comment">
<el-radio :label="0">开启</el-radio>
<el-radio :label="1">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="允许回放">
<el-radio-group v-model="form.model.close_replay">
<el-radio :label="0">开启</el-radio>
<el-radio :label="1">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="打开客服">
<el-radio-group v-model="form.model.close_kf">
<el-radio :label="0">开启</el-radio>
<el-radio :label="1">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</el-scrollbar>
</el-main>
<el-footer class="sa-footer--submit sa-flex sa-row-right">
<el-button type="primary" @click="onConfirm">确定</el-button>
</el-footer>
</el-container>
</div>

View File

@@ -0,0 +1,68 @@
{include file="/shopro/common/script" /}
<style>
.program {
width: 360px;
height: 260px;
background: #f5f5f5;
border-radius: 4px;
}
.path {
width: 360px;
height: 260px;
background: #f5f5f5;
border-radius: 4px;
}
.title {
font-size: 14px;
line-height: 20px;
color: var(--sa-subtitle);
}
.desc {
color: var(--sa-subfont);
font-size: 14px;
line-height: 20px;
word-break: break-all;
word-wrap: break-word;
}
</style>
<div id="playback" class="mplive-index panel panel-default panel-intro" v-cloak>
<el-container class="panel-block">
<!-- v-loading="loading" -->
<el-main class="sa-p-0">
<el-table :data="table.data" class="sa-table" stripe>
<template #empty>
<sa-empty />
</template>
<el-table-column label="回放片段" min-width="140">
<template #default="scope">
<div class="sa-table-line-1">{{ '片段' + scope.row.index || '-' }}</div>
</template>
</el-table-column>
<el-table-column label="创建时间" min-width="140">
<template #default="scope">
<div class="sa-table-line-1">{{
dayjs(scope.row.create_time).format('YYYY-MM-DD HH:mm:ss') || '-'
}}</div>
</template>
</el-table-column>
<el-table-column label="过期时间" min-width="140">
<template #default="scope">
<div class="sa-table-line-1">{{
dayjs(scope.row.expire_time).format('YYYY-MM-DD HH:mm:ss') || '-'
}}</div>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="120">
<template #default="scope">
<el-button class="is-link" type="primary" @click="play(scope.row.media_url)">播放</el-button>
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
</div>

View File

@@ -0,0 +1,61 @@
{include file="/shopro/common/script" /}
<style>
.title {
font-size: 16px;
line-height: 24px;
color: var(--sa-title);
margin-bottom: 16px;
}
.sa-m-b-4 {
margin-bottom: 4px;
}
.sa-m-r-4 {
margin-bottom: 4px;
}
.sa-m-b-16 {
margin-bottom: 16px;
}
.sa-m-b-40 {
margin-bottom: 40px;
}
.desc {
font-size: 14px;
line-height: 20px;
color: var(--sa-subtitle);
word-break: break-all;
word-wrap: break-word;
}
.subtitle {
color: var(--sa-subfont);
font-size: 14px;
line-height: 20px;
}
</style>
<div id="pushUrl" class="mplive-index panel panel-default panel-intro" v-cloak>
<el-container class="panel-block">
<!-- v-loading="loading" -->
<el-main class="sa-p-0">
<div class="title">推流地址</div>
<div class="sa-flex copy-box sa-m-b-4">
<div class="desc sa-m-r-4">在第三方推流应用中,以下地址进行推流</div>
<el-button class="is-link sa-m-b-4" type="primary" @click="onClipboard(state.pushUrl)">复制链接</el-button>
</div>
<div class="desc sa-m-b-16">{{ state.pushUrl }}</div>
<div class="subtitle sa-m-b-40">此地址为当前直播间唯一推流地址,不要泄露给第三方。</div>
<div class="title sa-m-b-16">备注</div>
<div class="desc sa-m-b-4">服务器地址:{{ state.serverAddress }}</div>
<div class="desc sa-m-b-16">串流密钥:{{ state.key }}</div>
<div class="sa-flex">
<div class="subtitle sa-m-r-4">推流直播操作详见</div>
<el-button class="is-link sa-m-b-4" type="primary" @click="onJump">指引</el-button>
</div>
</el-main>
</el-container>
</div>

View File

@@ -0,0 +1,64 @@
{include file="/shopro/common/script" /}
<style>
.program {
width: 360px;
height: 260px;
background: #f5f5f5;
border-radius: 4px;
padding: 16px;
margin-bottom: 30px;
}
.path {
width: 360px;
height: 260px;
background: #f5f5f5;
border-radius: 4px;
padding: 16px;
margin-bottom: 30px;
}
.title {
font-size: 14px;
line-height: 20px;
color: var(--sa-subtitle);
margin-bottom: 8px;
}
.desc {
color: var(--sa-subfont);
font-size: 14px;
line-height: 20px;
word-break: break-all;
word-wrap: break-word;
margin-bottom: 24px;
}
</style>
<div id="qrcode" class="mplive-index panel panel-default panel-intro" v-cloak>
<el-container class="panel-block">
<!-- v-loading="loading" -->
<el-main >
<div class="sa-flex sa-flex-wrap sa-row-between">
<div class="program sa-flex sa-col-top sa-row-between">
<div>
<div class="title">直播间小程序码</div>
<div class="desc ">小程序码不带参数</div>
<el-button type="primary" @click="saveImg">保存图片</el-button>
</div>
<sa-image class="" :url="state.cdnUrl" size="120"></sa-image>
</div>
<div class="path">
<div class="title">直播间页面路径</div>
<div class="desc ">{{ state.path }}</div>
<el-button type="primary" @click="onClipboard(state.path)">复制链接</el-button>
<div class="desc">链接是直播间原始页面路径,如需加入参数,详见<el-button class="is-link" type="primary"
@click="onJump">使用方法</el-button></div>
</div>
</div>
</el-main>
</el-container>
</div>

View File

@@ -0,0 +1,79 @@
{include file="/shopro/common/script" /}
<div id="select" class="room-select" v-cloak>
<el-container class="panel-block">
<el-main>
<el-table height="100%" class="sa-table" :data="state.data" stripe @selection-change="onSelectionChange">
<el-table-column type="selection" :selectable="isSelectable" width="48"></el-table-column>
<el-table-column label="房间ID" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.roomid }}</div>
</template>
</el-table-column>
<el-table-column label="直播类型" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.type_text }}</div>
</template>
</el-table-column>
<el-table-column label="直播间标题" min-width="200" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.name }}</div>
</template>
</el-table-column>
<el-table-column label="主播昵称" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.anchor_name }}</div>
</template>
</el-table-column>
<el-table-column label="状态" min-width="120" align="center">
<template #default="scope">
<div class="sa-table-line-1" :class="
scope.row.status === 101
? 'sa-color--success'
: scope.row.status === 102
? 'sa-color--warning'
: scope.row.status === 105
? 'sa-color--info'
: 'sa-color--danger'
">{{ scope.row.status_text }}</div>
</template>
</el-table-column>
<el-table-column label="背景图" min-width="80" align="center">
<template #default="scope">
<div class="sa-flex sa-row-center">
<sa-image :url="scope.row.cover_img" size="30">
</sa-image>
</div>
</template>
</el-table-column>
<el-table-column label="分享图" min-width="80" align="center">
<template #default="scope">
<div class="sa-flex sa-row-center">
<sa-image :url="scope.row.share_img" size="30"></sa-image>
</div>
</template>
</el-table-column>
<el-table-column label="封面图" min-width="80" align="center">
<template #default="scope">
<div class="sa-flex sa-row-center">
<sa-image :url="scope.row.feeds_img" size="30"></sa-image>
</div>
</template>
</el-table-column>
<el-table-column label="开播时间" width="172">
<template #default="scope">
{{Moment(scope.row.start_time * 1000).format('YYYY-MM-DD HH:mm')}}
</template>
</el-table-column>
<el-table-column label="结束时间" width="172">
<template #default="scope">
{{Moment(scope.row.end_time * 1000).format('YYYY-MM-DD HH:mm')}}
</template>
</el-table-column>
</el-table>
</el-main>
<el-footer class="sa-footer--submit sa-flex sa-row-right">
<el-button type="primary" @click="onConfirm">确 定</el-button>
</el-footer>
</el-container>
</div>

View File

@@ -0,0 +1,102 @@
{include file="/shopro/common/script" /}
<style>
.score-shop-form .title {
line-height: 22px;
font-size: 14px;
font-weight: 400;
color: var(--sa-subtitle);
}
.score-shop-form .sku-table-wrap {
width: 100%;
overflow: auto;
}
.score-shop-form .sku-table-wrap .sku-table {
font-size: 12px;
font-weight: 500;
}
.score-shop-form .sku-table-wrap .sku-table thead {
line-height: 40px;
background: var(--sa-table-header-bg);
color: var(--subtitle);
}
.score-shop-form .sku-table-wrap .sku-table tbody tr {
line-height: 48px;
color: var(--sa-font);
}
.score-shop-form .sku-table-wrap .sku-table tbody tr:nth-of-type(2n) {
background: var(--sa-table-striped);
}
.score-shop-form .sku-table-wrap .sku-table th,
.score-shop-form .sku-table-wrap .sku-table td {
padding: 0 16px;
text-align: left;
}
.score-shop-form .sku-table-wrap .sku-item {
min-width: 100px;
flex-shrink: 0;
}
</style>
<div id="addEdit" class="score-shop-form" v-cloak>
<el-container class="panel-block">
<el-main>
<el-scrollbar height="100%">
<div class="title mb-4">商品名称:{{ state.title }}</div>
<div class="sku-table-wrap">
<table class="sku-table" rules="none">
<thead>
<tr>
<th class="sku-item" v-for="ss in goods.skus" :key="ss">
{{ ss.name }}
</th>
<th class="sku-item">是否参与</th>
<th class="sku-item">商品价格</th>
<th class="sku-item">可兑换数量</th>
<th class="sku-item">兑换积分</th>
<th class="sku-item">兑换价格</th>
</tr>
</thead>
<tbody>
<tr v-for="(sp, spindex) in goods.sku_prices" :key="sp">
<td class="sku-item" v-for="st in sp.goods_sku_text" :key="st">
{{ st }}
</td>
<td class="sku-item">
<el-switch v-model="goods.score_sku_prices[spindex].status" active-value="up"
inactive-value="down" />
</td>
<td class="sku-item">{{ sp.price }}</td>
<th class="sku-item">
<el-input v-if="goods.score_sku_prices[spindex].status == 'up'" type="number"
v-model="goods.score_sku_prices[spindex].stock"></el-input>
</th>
<th class="sku-item">
<el-input v-if="goods.score_sku_prices[spindex].status == 'up'" type="number"
v-model="goods.score_sku_prices[spindex].score"></el-input>
</th>
<th class="sku-item">
<el-input v-if="goods.score_sku_prices[spindex].status == 'up'" type="number"
v-model="goods.score_sku_prices[spindex].price"></el-input>
</th>
</tr>
</tbody>
</table>
</div>
</el-scrollbar>
</el-main>
<el-footer class="sa-footer--submit sa-flex sa-row-right">
<el-button type="primary" @click="onConfirm">确定</el-button>
</el-footer>
</el-container>
</div>

View File

@@ -0,0 +1,159 @@
{include file="/shopro/common/script" /}
<style>
.score-shop-index .sa-table-wrap {
height: 100%;
margin-left: -48px;
overflow: hidden;
}
.score-shop-index .sa-table-wrap .sa-expand-table .el-table__header-wrapper {
display: none;
}
.score-shop-index .goods-item .sa-image {
margin-right: 12px;
}
.score-shop-index .goods-item .goods-title {
height: 20px;
line-height: 20px;
font-size: 14px;
font-weight: 500;
color: var(--sa-font);
}
.score-shop-index .goods-item .goods-subtitle {
height: 16px;
line-height: 16px;
font-size: 12px;
font-weight: 400;
color: var(--sa-subfont);
margin-bottom: 6px;
}
.score-shop-index .goods-item .goods-sku {
width: fit-content;
height: 20px;
background: var(--el-color-primary);
border-radius: 10px;
display: flex;
align-items: center;
padding: 0 8px;
font-size: 12px;
color: #fff;
cursor: pointer;
}
.score-shop-index .sku-text {
font-size: 12px;
color: var(--sa-font);
}
</style>
<div id="index" class="score-shop-index panel panel-default panel-intro" v-cloak>
<el-container class="panel-block">
<el-header class="sa-header">
<div class="sa-title sa-flex sa-row-between">
<div class="sa-title-left">
<div class="left-name">积分商城</div>
<sa-filter-condition v-model="state.filter" @filter-delete="onChangeFilter">
</sa-filter-condition>
</div>
<div class="sa-title-right">
<el-button class="sa-button-refresh" icon="RefreshRight" @click="getData"></el-button>
<el-button class="sa-button-refresh" icon="Search" @click="onOpenFilter"></el-button>
{if $auth->check('shopro/app/score_shop/add')}
<el-button icon="Plus" type="primary" @click="onAdd">添加</el-button>
{/if}
{if $auth->check('shopro/app/score_shop/recyclebin')}
<el-button type="danger" icon="Delete" plain @click="onRecyclebin">回收站</el-button>
{/if}
</div>
</div>
</el-header>
<el-main class="sa-main">
<div class="sa-table-wrap">
<el-table height="100%" class="sa-table" :data="state.data" :expand-row-keys="expandRowKeys"
row-key="id" stripe>
<el-table-column type="expand">
<template #default="props">
<el-table class="sa-table sa-expand-table" :data="skuPrices.data" stripe>
<el-table-column width="48"></el-table-column>
<el-table-column min-width="90"></el-table-column>
<el-table-column min-width="440">
<template #default="scope">
<div class="sa-flex">
<sa-image :url="scope.row.image || props.row.image" size="32">
</sa-image>
<div class="sku-text ml-2">
{{ scope.row.goods_sku_text?.join('/') }}
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="score_price" min-width="200"></el-table-column>
<el-table-column prop="sales" min-width="100"></el-table-column>
<el-table-column prop="stock" min-width="100"></el-table-column>
<el-table-column min-width="120"></el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column prop="id" label="ID" min-width="90"></el-table-column>
<el-table-column label="商品信息" min-width="440">
<template #default="scope">
<div class="goods-item sa-flex">
<sa-image :url="scope.row.image" size="64"></sa-image>
<div>
<div class="goods-title sa-table-line-1">{{scope.row.title}}</div>
<div class="goods-subtitle sa-table-line-1">{{scope.row.subtitle}}</div>
<div v-if="scope.row.is_sku" class="goods-sku"
@click.stop="expandRow(scope.row.id)">
多规格
<el-icon :class="[
'expand-arrow ml-1',
expandRowKeys.includes(scope.row.id) ? 'expand-arrow-up' : 'expand-arrow-down',
]">
<arrow-down />
</el-icon>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="积分现金" min-width="200">
<template #default="scope">
<div v-if="scope.row.score_price" class="sa-flex">
{{ scope.row.score_price.score }}积分
<div v-if="Number(scope.row.score_price.price)">+¥{{ scope.row.score_price.price }}
</div>
</div>
<div v-else>-</div>
</template>
</el-table-column>
<el-table-column prop="score_sales" label="销量" min-width="100"></el-table-column>
<el-table-column prop="score_stock" label="库存" min-width="100"></el-table-column>
<el-table-column label="操作" min-width="120" fixed="right">
<template #default="scope">
{if $auth->check('shopro/app/score_shop/edit')}
<el-button type="primary" link @click="onEdit(scope.row)">编辑</el-button>
{/if}
<el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
title="确认删除这条记录?" @confirm="onDelete(scope.row.id)">
<template #reference>
{if $auth->check('shopro/app/score_shop/delete')}
<el-button type="danger" link>删除</el-button>
{/if}
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</div>
</el-main>
<el-footer class="sa-footer sa-flex sa-row-right">
<sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
</el-footer>
</el-container>
<sa-filter v-model="state.filter" @filter-change="onChangeFilter"></sa-filter>
</div>

View File

@@ -0,0 +1,54 @@
{include file="/shopro/common/script" /}
<div id="recyclebin" class="score-shop-recyclebin" v-cloak>
<el-container class="panel-block">
<el-main>
<el-table height="100%" class="sa-table" :data="state.data" stripe @selection-change="onChangeSelection"
@sort-change="onChangeSort">
<el-table-column type="selection" width="48" align="center"></el-table-column>
<el-table-column prop="id" label="ID" min-width="90" sortable="custom"></el-table-column>
<el-table-column label="名称" min-width="100">
<template #default="scope">
<div class="sa-table-line-1">{{ scope.row.title || '-' }}</div>
</template>
</el-table-column>
<el-table-column prop="deletetime" label="删除时间" min-width="172" sortable="custom"></el-table-column>
<el-table-column fixed="right" label="操作" min-width="120">
<template #default="scope">
{if $auth->check('shopro/app/score_shop/restore')}
<el-button type="primary" link @click="onRestore(scope.row.id)">还原</el-button>
{/if}
<el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
title="确认销毁这条记录?" @confirm="onDestroy(scope.row.id)">
<template #reference>
{if $auth->check('shopro/app/score_shop/destroy')}
<el-button type="danger" link>销毁</el-button>
{/if}
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</el-main>
<el-footer class="sa-footer sa-flex sa-row-between sa-flex-wrap">
<div class="sa-batch sa-flex">
<div class="tip">
已选择 <span>{{batchHandle.data.length}}</span></div>
<div class="sa-flex">
{if $auth->check('shopro/app/score_shop/restore')}
<el-button type="primary" :disabled="!batchHandle.data.length" @click="onBatchHandle('restore')">还原
</el-button>
{/if}
{if $auth->check('shopro/app/score_shop/destroy')}
<el-button type="danger" :disabled="!batchHandle.data.length" @click="onBatchHandle('destroy')">销毁
</el-button>
{/if}
{if $auth->check('shopro/app/score_shop/destroy')}
<el-button type="danger" @click="onBatchHandle('all')">清空回收站</el-button>
{/if}
</div>
</div>
<sa-pagination class="is-ellipsis" v-model="pagination" @pagination-change="getData"></sa-pagination>
</el-footer>
</el-container>
</div>

View File

@@ -0,0 +1,68 @@
{include file="/shopro/common/script" /}
<style>
.score-shop-select .goods-item .goods-image {
margin-right: 12px;
}
.score-shop-select .goods-item .goods-title {
height: 20px;
line-height: 20px;
font-size: 14px;
font-weight: 500;
color: var(--sa-font);
}
.score-shop-select .goods-item .goods-subtitle {
height: 16px;
line-height: 16px;
font-size: 12px;
font-weight: 400;
color: var(--sa-subfont);
margin-bottom: 6px;
}
</style>
<div id="select" class="score-shop-select" v-cloak>
<el-container class="panel-block">
<el-main>
<el-table height="100%" class="sa-table" :data="state.data" stripe @selection-change="onChangeSelection">
<el-table-column v-if="state.multiple" type="selection" width="48"></el-table-column>
<el-table-column prop="id" label="ID" min-width="80"></el-table-column>
<el-table-column label="商品信息" min-width="440">
<template #default="scope">
<div class="goods-item sa-flex">
<sa-image :url="scope.row.image" size="64"></sa-image>
<div>
<div class="goods-title sa-table-line-1">{{scope.row.title}}</div>
<div class="goods-subtitle sa-table-line-1">{{scope.row.subtitle}}</div>
<div v-if="scope.row.is_sku">
多规格
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="积分现金" min-width="200">
<template #default="scope">
<div class="sa-flex">
{{ scope.row.score_price.score }}积分
<div v-if="Number(scope.row.score_price.price)">+¥{{ scope.row.score_price.price }}</div>
</div>
</template>
</el-table-column>
<el-table-column prop="score_sales" label="销量" min-width="100"></el-table-column>
<el-table-column prop="score_stock" label="库存" min-width="100"></el-table-column>
<el-table-column v-if="!state.multiple" label="操作" width="80">
<template #default="scope">
<el-button type="primary" link @click="onSelect(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-main>
<el-footer class="sa-footer--submit sa-flex" :class="state.multiple ? 'sa-row-between' : 'sa-row-right'">
<sa-pagination class="is-ellipsis" v-model="pagination" @pagination-change="getData"></sa-pagination>
<el-button v-if="state.multiple" type="primary" @click="onConfirm">确 定</el-button>
</el-footer>
</el-container>
</div>