修复浏览器标题显示
This commit is contained in:
parent
acd7cdc432
commit
c9b4fd2a01
@ -1,6 +1,6 @@
|
||||
import defaultSettings from '@/settings'
|
||||
|
||||
const title = defaultSettings.title || 'Vue Admin Template'
|
||||
const title = defaultSettings.title || '金蚕运营平台'
|
||||
|
||||
export default function getPageTitle(pageTitle) {
|
||||
if (pageTitle) {
|
||||
|
@ -28,7 +28,11 @@
|
||||
<div class="form-box-bd">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="game_icon" class="uploader-box" label-width="0">
|
||||
<el-form-item
|
||||
prop="game_icon"
|
||||
class="uploader-box"
|
||||
label-width="0"
|
||||
>
|
||||
<el-upload
|
||||
class="uploader"
|
||||
action="/api/common/upload"
|
||||
@ -36,35 +40,60 @@
|
||||
authorization: 'Bearer ' + token
|
||||
}"
|
||||
:show-file-list="false"
|
||||
:on-success="(res, file, fileList)=> {return uploadSuccess(res, file, fileList, 'base')}"
|
||||
:on-success="
|
||||
(res, file, fileList) => {
|
||||
return uploadSuccess(res, file, fileList, 'base')
|
||||
}
|
||||
"
|
||||
:on-error="uploadErr"
|
||||
name="image-file"
|
||||
:data="{sub_path: '/game_icon/',file_type: 'game_icon'}"
|
||||
:data="{ sub_path: '/game_icon/', file_type: 'game_icon' }"
|
||||
>
|
||||
<img v-if="baseForm.game_icon" :src="baseForm.game_icon" class="uploader-img">
|
||||
<i v-else class="el-icon-plus uploader-icon"/>
|
||||
<img
|
||||
v-if="baseForm.game_icon"
|
||||
:src="baseForm.game_icon"
|
||||
class="uploader-img"
|
||||
/>
|
||||
<i v-else class="el-icon-plus uploader-icon" />
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="游戏名称" prop="game_name">
|
||||
<el-input v-model="baseForm.game_name"/>
|
||||
<el-input v-model="baseForm.game_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="游戏英文名" prop="game_name_en">
|
||||
<el-input v-model="baseForm.game_name_en"/>
|
||||
<el-input v-model="baseForm.game_name_en" />
|
||||
</el-form-item>
|
||||
<el-form-item label="游戏 ID" prop="game_id">
|
||||
<el-input v-model="baseForm.game_id"/>
|
||||
<el-input v-model="baseForm.game_id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="游戏类型" prop="game_type">
|
||||
<el-select v-model="baseForm.game_type" class="w100">
|
||||
<el-option v-for="(val, key) in gameTypes" :key="key" :label="val" :value="val"/>
|
||||
<el-option
|
||||
v-for="(val, key) in gameTypes"
|
||||
:key="key"
|
||||
:label="val"
|
||||
:value="val"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="permEdit">
|
||||
<el-button v-if="uid && uid !== 'new'" type="primary" @click="updateBaseForm">保存</el-button>
|
||||
<el-button v-if="uid && uid !== 'new'" type="danger" @click="delBaseForm">删除</el-button>
|
||||
<el-button v-else type="primary" @click="saveBaseForm">保存游戏</el-button>
|
||||
<el-button
|
||||
v-if="uid && uid !== 'new'"
|
||||
type="primary"
|
||||
@click="updateBaseForm"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="uid && uid !== 'new'"
|
||||
type="danger"
|
||||
@click="delBaseForm"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button v-else type="primary" @click="saveBaseForm"
|
||||
>保存游戏</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -82,50 +111,85 @@
|
||||
class="form-box"
|
||||
>
|
||||
<div class="form-box-hd">
|
||||
<span>{{ `${item.platform.name}(${item.platform.platform_id})` }}</span>
|
||||
<svg-icon icon-class="close" class="icon-close" @click="delPlatform(index)"/>
|
||||
<span>{{
|
||||
`${item.platform.name}(${item.platform.platform_id})`
|
||||
}}</span>
|
||||
<svg-icon
|
||||
icon-class="close"
|
||||
class="icon-close"
|
||||
@click="delPlatform(index)"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-box-bd">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="game_icon" class="uploader-box" label-width="0">
|
||||
<el-form-item
|
||||
prop="game_icon"
|
||||
class="uploader-box"
|
||||
label-width="0"
|
||||
>
|
||||
<el-upload
|
||||
class="uploader"
|
||||
action="/api/common/upload"
|
||||
:show-file-list="false"
|
||||
:on-success="(res, file, fileList)=> {return uploadSuccess(res, file, fileList, 'platform', index)}"
|
||||
:on-success="
|
||||
(res, file, fileList) => {
|
||||
return uploadSuccess(
|
||||
res,
|
||||
file,
|
||||
fileList,
|
||||
'platform',
|
||||
index
|
||||
)
|
||||
}
|
||||
"
|
||||
:on-error="uploadErr"
|
||||
:headers="{
|
||||
authorization: 'Bearer ' + token
|
||||
}"
|
||||
name="image-file"
|
||||
:data="{sub_path: '/game_icon/',file_type: 'game_icon'}"
|
||||
:data="{ sub_path: '/game_icon/', file_type: 'game_icon' }"
|
||||
>
|
||||
<img v-if="item.game_icon" :src="item.game_icon" class="uploader-img">
|
||||
<i v-else class="el-icon-plus uploader-icon"/>
|
||||
<img
|
||||
v-if="item.game_icon"
|
||||
:src="item.game_icon"
|
||||
class="uploader-img"
|
||||
/>
|
||||
<i v-else class="el-icon-plus uploader-icon" />
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="AppID" prop="app_id">
|
||||
<el-input v-model="item.app_id"/>
|
||||
<el-input v-model="item.app_id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="AppSecret" prop="app_secret">
|
||||
<el-input v-model="item.app_secret"/>
|
||||
<el-input v-model="item.app_secret" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="item.ftp && item.ftp.ftp_user" label="FTP 账号">
|
||||
<el-input v-model="item.ftp.ftp_user" disabled/>
|
||||
<el-form-item
|
||||
v-if="item.ftp && item.ftp.ftp_user"
|
||||
label="FTP 账号"
|
||||
>
|
||||
<el-input v-model="item.ftp.ftp_user" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="item.ftp && item.ftp.ftp_pass" label="FTP 密码">
|
||||
<el-input v-model="item.ftp.ftp_pass" disabled/>
|
||||
<el-form-item
|
||||
v-if="item.ftp && item.ftp.ftp_pass"
|
||||
label="FTP 密码"
|
||||
>
|
||||
<el-input v-model="item.ftp.ftp_pass" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="item.status" class="w100">
|
||||
<el-option v-for="(val, key) in status" :key="key" :label="val" :value="val"/>
|
||||
<el-option
|
||||
v-for="(val, key) in status"
|
||||
:key="key"
|
||||
:label="val"
|
||||
:value="val"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="点击数" prop="click_count">
|
||||
<el-input v-model="item.click_count"/>
|
||||
<el-input v-model="item.click_count" />
|
||||
</el-form-item>
|
||||
<el-form-item label="热度">
|
||||
<el-checkbox v-model="item.is_recommend">主推</el-checkbox>
|
||||
@ -133,35 +197,58 @@
|
||||
<el-checkbox v-model="item.is_hot">火爆</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="comment">
|
||||
<el-input v-model="item.comment" type="textarea"/>
|
||||
<el-input v-model="item.comment" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="permEdit">
|
||||
<el-button
|
||||
v-if="item.ftp && item.ftp.ftp_user"
|
||||
type="primary"
|
||||
@click="publishCfg(index)"
|
||||
>发布</el-button>
|
||||
>发布</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="item.ftp && item.ftp.ftp_user && permEdit"
|
||||
@click="goSettings(index)"
|
||||
>配置</el-button>
|
||||
>配置</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="!item.ftp || !item.ftp.ftp_user"
|
||||
type="primary"
|
||||
@click="createFtp(index)"
|
||||
>创建账号</el-button>
|
||||
>创建账号</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-button v-show="uid && uid !== 'new'" v-if="permEdit" class="w100" @click="openModal">添加新平台</el-button>
|
||||
<el-button
|
||||
v-show="uid && uid !== 'new'"
|
||||
v-if="permEdit"
|
||||
class="w100"
|
||||
@click="openModal"
|
||||
>添加新平台</el-button
|
||||
>
|
||||
</div>
|
||||
<!-- modal -->
|
||||
<el-dialog title="选择平台" :visible.sync="modalVisible" width="30%" :before-close="closeModal">
|
||||
<el-dialog
|
||||
title="选择平台"
|
||||
:visible.sync="modalVisible"
|
||||
width="30%"
|
||||
:before-close="closeModal"
|
||||
>
|
||||
<el-form ref="modalForm" :rules="modalFormRules" :model="modalForm">
|
||||
<el-select v-model="modalForm.platform" class="w100" value-key="platform_id">
|
||||
<el-option v-for="item in platforms" :key="item._id" :label="item.name" :value="item"/>
|
||||
<el-select
|
||||
v-model="modalForm.platform"
|
||||
class="w100"
|
||||
value-key="platform_id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in platforms"
|
||||
:key="item._id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
@ -186,6 +273,7 @@ import {
|
||||
import { mapGetters } from 'vuex'
|
||||
import { exists } from 'fs'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import getPageTitle from '@/utils/get-page-title'
|
||||
|
||||
export default {
|
||||
name: 'GameDetailsInfo',
|
||||
@ -287,6 +375,7 @@ export default {
|
||||
this.getGameInfo()
|
||||
} else {
|
||||
this.$route.meta.title = '新建游戏'
|
||||
document.title = getPageTitle('新建游戏')
|
||||
}
|
||||
getGameList()
|
||||
.then(res => {
|
||||
@ -310,6 +399,7 @@ export default {
|
||||
this.baseForm = this.gameInfo
|
||||
this.platformForm = this.gameInfo.platforms
|
||||
this.$route.meta.title = this.baseForm.game_name
|
||||
document.title = getPageTitle(this.baseForm.game_name)
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
|
@ -3,15 +3,27 @@
|
||||
<el-row>
|
||||
<el-col :span="14" class="p-r">
|
||||
<div class="al-c">
|
||||
<h3 class="fw-500">配置详情 - {{ type === 'normal' ? '普通配置' : '私有配置' }}</h3>
|
||||
<span class="dis-b al-c mgb-20" style="color: #E6A23C">{{ tip }}</span>
|
||||
<h3 class="fw-500">
|
||||
配置详情 - {{ type === 'normal' ? '普通配置' : '私有配置' }}
|
||||
</h3>
|
||||
<span class="dis-b al-c mgb-20" style="color: #E6A23C">{{
|
||||
tip
|
||||
}}</span>
|
||||
</div>
|
||||
<el-form ref="settingForm" label-width="120px" :model="settingsForm">
|
||||
<el-form-item label="游戏">
|
||||
<el-input v-model="gameInfo.game_name" style="width: 70%" disabled/>
|
||||
<el-input
|
||||
v-model="gameInfo.game_name"
|
||||
style="width: 70%"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="平台">
|
||||
<el-select v-model="platform_id" style="width: 70%" @change="changePlatform">
|
||||
<el-select
|
||||
v-model="platform_id"
|
||||
style="width: 70%"
|
||||
@change="changePlatform"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in platformsArr"
|
||||
:key="item.platform.platform_id"
|
||||
@ -25,7 +37,11 @@
|
||||
:key="index"
|
||||
:label="`${item.title}`"
|
||||
:prop="`settings[${index}].value`"
|
||||
:rules="{required: true, message: '配置内容不能为空', trigger: 'blur'}"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '配置内容不能为空',
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
<div v-if="item.type === 'bool'">
|
||||
<el-switch
|
||||
@ -36,23 +52,50 @@
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="item.type === 'string'">
|
||||
<el-input v-model="item.value" style="width: 70%" @change="changTip"/>
|
||||
<el-button type="primary" @click="openEditor(index)">json</el-button>
|
||||
<el-input
|
||||
v-model="item.value"
|
||||
style="width: 70%"
|
||||
@change="changTip"
|
||||
/>
|
||||
<el-button type="primary" @click="openEditor(index)"
|
||||
>json</el-button
|
||||
>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-input v-model="item.value" style="width: 70%" @change="changTip"/>
|
||||
<el-input
|
||||
v-model="item.value"
|
||||
style="width: 70%"
|
||||
@change="changTip"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<div v-if="settingsForm.settings.length === 0" class="al-c mgt-20 mgb-20">暂无配置项</div>
|
||||
<div
|
||||
v-if="settingsForm.settings.length === 0"
|
||||
class="al-c mgt-20 mgb-20"
|
||||
>
|
||||
暂无配置项
|
||||
</div>
|
||||
<el-form-item>
|
||||
<el-button v-if="permEdit && this.platform_id " type="warning" @click="save">保存</el-button>
|
||||
<el-button v-if="permPublish && this.platform_id " type="primary" @click="publish">发布</el-button>
|
||||
<el-button v-if="permEdit && this.platform_id " @click="reset">重置</el-button>
|
||||
<el-button
|
||||
v-if="permEdit && this.platform_id"
|
||||
type="warning"
|
||||
@click="save"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="permPublish && this.platform_id"
|
||||
type="primary"
|
||||
@click="publish"
|
||||
>发布</el-button
|
||||
>
|
||||
<el-button v-if="permEdit && this.platform_id" @click="reset"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="divider"/>
|
||||
<div class="divider" />
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<div class="al-c">
|
||||
@ -77,14 +120,21 @@
|
||||
/>
|
||||
</el-select>
|
||||
<div class="btn-group">
|
||||
<el-button type="success" size="small" @click="addSetting" v-if="permEdit">添加新的配置项</el-button>
|
||||
<el-button
|
||||
v-show="selectedSettings.length> 0"
|
||||
type="success"
|
||||
size="small"
|
||||
@click="addSetting"
|
||||
v-if="permEdit"
|
||||
>添加新的配置项</el-button
|
||||
>
|
||||
<el-button
|
||||
v-show="selectedSettings.length > 0"
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="clearSettings"
|
||||
v-if="permEdit"
|
||||
>清空</el-button>
|
||||
>清空</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -119,17 +169,21 @@
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="名称" prop="value.title">
|
||||
<el-input v-model="newSettingForm.value.title"/>
|
||||
<el-input v-model="newSettingForm.value.title" />
|
||||
</el-form-item>
|
||||
<el-form-item label="key" prop="key">
|
||||
<el-input v-model="newSettingForm.key"/>
|
||||
<el-input v-model="newSettingForm.key" />
|
||||
<span class="ipt-tip">该值写入redis并传入客户端,请谨慎填写</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="值类型" prop="value.type">
|
||||
<el-select v-model="newSettingForm.value.type" placeholder="请选择值类型" style="width: 100%">
|
||||
<el-option label="布尔值" value="bool"/>
|
||||
<el-option label="数值" value="num"/>
|
||||
<el-option label="字符串" value="string"/>
|
||||
<el-select
|
||||
v-model="newSettingForm.value.type"
|
||||
placeholder="请选择值类型"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="布尔值" value="bool" />
|
||||
<el-option label="数值" value="num" />
|
||||
<el-option label="字符串" value="string" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -154,6 +208,7 @@ import {
|
||||
publishGameSettings,
|
||||
saveSettingItem
|
||||
} from '@/api/settings'
|
||||
import getPageTitle from '@/utils/get-page-title'
|
||||
|
||||
export default {
|
||||
name: 'SettingPanel',
|
||||
@ -240,6 +295,7 @@ export default {
|
||||
this.gameInfo = data.gameInfo
|
||||
this.platformsArr = data.gameInfo.platforms
|
||||
this.$route.meta.title = this.gameInfo.game_name
|
||||
document.title = getPageTitle(this.gameInfo.game_name)
|
||||
if (this.$route.query.platform_id) {
|
||||
this.platform_id = this.$route.query.platform_id
|
||||
} else {
|
||||
|
@ -8,7 +8,7 @@
|
||||
style="width: 60%"
|
||||
>
|
||||
<el-form-item label="游戏名称" prop="name">
|
||||
<el-input v-model="gameInfo.game_name" disabled/>
|
||||
<el-input v-model="gameInfo.game_name" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="分享类型" prop="share_type">
|
||||
<el-select
|
||||
@ -18,32 +18,46 @@
|
||||
@change="changeShareType"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item,index) in shareTypes"
|
||||
v-for="(item, index) in shareTypes"
|
||||
:key="index"
|
||||
:label="`${item.value}(${item.key})`"
|
||||
:value="item.key"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button v-if="permEdit" size="mini" @click="modalShareTypeVisible = true">编辑分享类型</el-button>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
size="mini"
|
||||
@click="modalShareTypeVisible = true"
|
||||
>编辑分享类型</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item label="默认分享" prop="default_share">
|
||||
<el-switch v-model="shareForm.default_share"/>
|
||||
<span
|
||||
class="ipt-tip"
|
||||
>设为默认分享, 那么在遇到该分享类型下没有满足条件的分享图, 会使用该分享图, 一种分享类型下只能有一条默认分享记录. 将当前记录变成默认分享后, 将移除这个游戏同分享类型下其他分享图的默认分享属性。</span>
|
||||
<el-switch v-model="shareForm.default_share" />
|
||||
<span class="ipt-tip"
|
||||
>设为默认分享, 那么在遇到该分享类型下没有满足条件的分享图,
|
||||
会使用该分享图, 一种分享类型下只能有一条默认分享记录.
|
||||
将当前记录变成默认分享后,
|
||||
将移除这个游戏同分享类型下其他分享图的默认分享属性。</span
|
||||
>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="地域" prop="area">
|
||||
<el-select v-model="shareForm.area" placeholder="请选择地域" style="width: 100%">
|
||||
<el-select
|
||||
v-model="shareForm.area"
|
||||
placeholder="请选择地域"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="不指定地域" value>不指定地域</el-option>
|
||||
<el-option
|
||||
v-for="(item,index) in areas"
|
||||
v-for="(item, index) in areas"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item._id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button v-if="permEdit" size="mini" @click="modalAreaVisible = true">编辑地域</el-button>
|
||||
<el-button v-if="permEdit" size="mini" @click="modalAreaVisible = true"
|
||||
>编辑地域</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-radio-group v-model="shareForm.sex">
|
||||
@ -61,8 +75,10 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="分享次数" prop="share_count">
|
||||
<el-input v-model.number="shareForm.share_count"/>
|
||||
<span class="ipt-tip">分享首先的情况下, 分享n次后, 将切换成广告, 0代表不限次数。</span>
|
||||
<el-input v-model.number="shareForm.share_count" />
|
||||
<span class="ipt-tip"
|
||||
>分享首先的情况下, 分享n次后, 将切换成广告, 0代表不限次数。</span
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item label="分享组" prop="share_word">
|
||||
<el-row
|
||||
@ -75,7 +91,7 @@
|
||||
>
|
||||
<el-col :span="2">
|
||||
<div class="img-box">
|
||||
<img class="img img-fit" :src="item.share_image">
|
||||
<img class="img img-fit" :src="item.share_image" />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
@ -87,38 +103,62 @@
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="editShareGroup(item, index)"
|
||||
>编辑</el-button>
|
||||
<el-button v-if="permEdit" type="danger" size="mini" @click="delShareGroup(index)">删除</el-button>
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
type="danger"
|
||||
size="mini"
|
||||
@click="delShareGroup(index)"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-button v-if="permEdit" size="mini" @click="addShareGroup">添加分享语</el-button>
|
||||
<el-button v-if="permEdit" size="mini" @click="addShareGroup"
|
||||
>添加分享语</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<div v-if="!onlyShare">
|
||||
<el-form-item label="广告 ID" prop="ad_id">
|
||||
<el-input v-model="shareForm.ad_id"/>
|
||||
<el-input v-model="shareForm.ad_id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="广告次数" prop="ad_count">
|
||||
<el-input v-model.number="shareForm.ad_count"/>
|
||||
<span class="ipt-tip">广告首先的情况下, 最多播放广告n次后, 将切换成分享, 暂时无用。</span>
|
||||
<el-input v-model.number="shareForm.ad_count" />
|
||||
<span class="ipt-tip"
|
||||
>广告首先的情况下, 最多播放广告n次后, 将切换成分享, 暂时无用。</span
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item label="广告播放间隔" prop="ad_cd">
|
||||
<el-input v-model.number="shareForm.ad_cd"/>
|
||||
<el-input v-model.number="shareForm.ad_cd" />
|
||||
<span class="ipt-tip">点击广告的间隔时间, 暂时无用。</span>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="备注" prop="comment">
|
||||
<el-input v-model="shareForm.comment" type="textarea"/>
|
||||
<el-input v-model="shareForm.comment" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="permEdit" type="primary" @click="submitForm('shareForm')">保存</el-button>
|
||||
<el-button v-if="permEdit" @click="resetForm('shareForm')">重置</el-button>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
type="primary"
|
||||
@click="submitForm('shareForm')"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button v-if="permEdit" @click="resetForm('shareForm')"
|
||||
>重置</el-button
|
||||
>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- Modal - 编辑分享类型 -->
|
||||
<el-dialog title="分享类型列表" :visible.sync="modalShareTypeVisible" width="35%">
|
||||
<el-button v-if="permEdit" type="primary" @click="addShareType">新增</el-button>
|
||||
<el-dialog
|
||||
title="分享类型列表"
|
||||
:visible.sync="modalShareTypeVisible"
|
||||
width="35%"
|
||||
>
|
||||
<el-button v-if="permEdit" type="primary" @click="addShareType"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="shareTypes"
|
||||
style="width: 100%"
|
||||
@ -126,12 +166,40 @@
|
||||
height="350"
|
||||
size="mini"
|
||||
>
|
||||
<el-table-column prop="key" label="key" show-overflow-tooltip sortable/>
|
||||
<el-table-column prop="value" label="说明" show-overflow-tooltip sortable/>
|
||||
<el-table-column v-if="permEdit" prop="name" label="操作" fixed="right" width="126">
|
||||
<el-table-column
|
||||
prop="key"
|
||||
label="key"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
prop="value"
|
||||
label="说明"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="permEdit"
|
||||
prop="name"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="126"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="permEdit" type="text" size="small" @click="editShareType(scope.row)">编辑</el-button>
|
||||
<el-button v-if="permEdit" type="text" size="small" @click="delShareType(scope.row)">删除</el-button>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="editShareType(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="delShareType(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -154,20 +222,24 @@
|
||||
label-width="50px"
|
||||
>
|
||||
<el-form-item label="key" prop="key">
|
||||
<el-input v-model="shareTypeForm.key"/>
|
||||
<el-input v-model="shareTypeForm.key" />
|
||||
</el-form-item>
|
||||
<el-form-item label="说明" prop="value">
|
||||
<el-input v-model="shareTypeForm.value"/>
|
||||
<el-input v-model="shareTypeForm.value" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="closeShareTypeEditModal">取 消</el-button>
|
||||
<el-button v-if="permEdit" type="primary" @click="saveShareType">确 定</el-button>
|
||||
<el-button v-if="permEdit" type="primary" @click="saveShareType"
|
||||
>确 定</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- Modal - 编辑地域 -->
|
||||
<el-dialog title="地域列表" :visible.sync="modalAreaVisible" width="35%">
|
||||
<el-button v-if="permEdit" type="primary" @click="addArea">新增</el-button>
|
||||
<el-button v-if="permEdit" type="primary" @click="addArea"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="areas"
|
||||
style="width: 100%"
|
||||
@ -175,11 +247,34 @@
|
||||
size="mini"
|
||||
height="350"
|
||||
>
|
||||
<el-table-column prop="name" label="名称" show-overflow-tooltip sortable/>
|
||||
<el-table-column v-if="permEdit" prop="name" label="操作" fixed="right" width="126">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="permEdit"
|
||||
prop="name"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="126"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="permEdit" type="text" size="small" @click="editArea(scope.row)">编辑</el-button>
|
||||
<el-button v-if="permEdit" type="text" size="small" @click="delArea(scope.row)">删除</el-button>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="editArea(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="delArea(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -195,9 +290,14 @@
|
||||
:before-close="closeModalAreaEdit"
|
||||
width="35%"
|
||||
>
|
||||
<el-form ref="areaForm" :model="areaForm" :rules="areaFormRules" label-width="50px">
|
||||
<el-form
|
||||
ref="areaForm"
|
||||
:model="areaForm"
|
||||
:rules="areaFormRules"
|
||||
label-width="50px"
|
||||
>
|
||||
<el-form-item label="说明" prop="name">
|
||||
<el-input v-model="areaForm.name"/>
|
||||
<el-input v-model="areaForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地区">
|
||||
<el-scrollbar style="height: 350px;" class="scrollbar">
|
||||
@ -205,7 +305,7 @@
|
||||
ref="tree"
|
||||
:data="regions"
|
||||
show-checkbox
|
||||
:props="{label: 'text'}"
|
||||
:props="{ label: 'text' }"
|
||||
node-key="id"
|
||||
/>
|
||||
</el-scrollbar>
|
||||
@ -213,7 +313,9 @@
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="closeModalAreaEdit">取 消</el-button>
|
||||
<el-button v-if="permEdit" type="primary" @click="saveArea">确 定</el-button>
|
||||
<el-button v-if="permEdit" type="primary" @click="saveArea"
|
||||
>确 定</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- Modal - 分享语 -->
|
||||
@ -249,17 +351,19 @@
|
||||
v-if="shareGroupForm.share_image"
|
||||
:src="shareGroupForm.share_image"
|
||||
class="uploader-img"
|
||||
>
|
||||
<i v-else class="el-icon-plus uploader-icon"/>
|
||||
/>
|
||||
<i v-else class="el-icon-plus uploader-icon" />
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="分享语" prop="share_word">
|
||||
<el-input v-model="shareGroupForm.share_word"/>
|
||||
<el-input v-model="shareGroupForm.share_word" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="closeModalShareGroup">取 消</el-button>
|
||||
<el-button v-if="permEdit" type="primary" @click="saveShareGroup">确 定</el-button>
|
||||
<el-button v-if="permEdit" type="primary" @click="saveShareGroup"
|
||||
>确 定</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -279,6 +383,7 @@ import { getGame } from '@/api/games'
|
||||
import { getRegions, saveArea, getAreas, delArea } from '@/api/common'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { mapGetters } from 'vuex'
|
||||
import getPageTitle from '@/utils/get-page-title'
|
||||
|
||||
export default {
|
||||
name: 'GameDetailsShareEdit',
|
||||
@ -421,6 +526,7 @@ export default {
|
||||
this.gameInfo = data.gameInfo
|
||||
this.shareForm.game_id = this.gameInfo.game_id
|
||||
this.$route.meta.title = this.gameInfo.game_name
|
||||
document.title = getPageTitle(this.gameInfo.game_name)
|
||||
if (this.$route.query.id && this.$route.query.id !== 'new') {
|
||||
this.getShare()
|
||||
this.getShareList()
|
||||
|
@ -5,7 +5,7 @@
|
||||
<el-form-item label="分享类型" prop="shareType">
|
||||
<el-select v-model="filterForm.shareType" placeholder="请选择分享类型">
|
||||
<el-option
|
||||
v-for="(item,index) in shareTypes"
|
||||
v-for="(item, index) in shareTypes"
|
||||
:key="index"
|
||||
:label="`${item.value}(${item.key})`"
|
||||
:value="item.key"
|
||||
@ -14,10 +14,10 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="filterForm.type" placeholder="请选择类型">
|
||||
<el-option label="分享优先" :value="0"/>
|
||||
<el-option label="广告优先" :value="1"/>
|
||||
<el-option label="只分享" :value="2"/>
|
||||
<el-option label="只广告" :value="3"/>
|
||||
<el-option label="分享优先" :value="0" />
|
||||
<el-option label="广告优先" :value="1" />
|
||||
<el-option label="只分享" :value="2" />
|
||||
<el-option label="只广告" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -28,8 +28,12 @@
|
||||
<!-- toolbar -->
|
||||
<div class="toolbar clearfix">
|
||||
<div class="l fl">
|
||||
<el-button v-if="permEdit" type="primary" @click="addShare">新增</el-button>
|
||||
<el-button v-if="batch.show && permEdit" type="danger" @click="batchDel">批量删除</el-button>
|
||||
<el-button v-if="permEdit" type="primary" @click="addShare"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button v-if="batch.show && permEdit" type="danger" @click="batchDel"
|
||||
>批量删除</el-button
|
||||
>
|
||||
<el-button v-if="permEdit" @click="batchOpt">{{ batch.txt }}</el-button>
|
||||
</div>
|
||||
<div class="r fr">
|
||||
@ -45,9 +49,19 @@
|
||||
@selection-change="tableSelectionChange"
|
||||
@row-click="rowClick"
|
||||
>
|
||||
<el-table-column v-if="batch.show" type="selection" width="55"/>
|
||||
<el-table-column prop="gameName" label="游戏" show-overflow-tooltip sortable/>
|
||||
<el-table-column prop="typeName" label="分享类型" show-overflow-tooltip sortable/>
|
||||
<el-table-column v-if="batch.show" type="selection" width="55" />
|
||||
<el-table-column
|
||||
prop="gameName"
|
||||
label="游戏"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
prop="typeName"
|
||||
label="分享类型"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
label="类型"
|
||||
@ -55,13 +69,28 @@
|
||||
sortable
|
||||
:formatter="formatType"
|
||||
/>
|
||||
<el-table-column label="分享图" show-overflow-tooltip sortable width="260">
|
||||
<el-table-column
|
||||
label="分享图"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
width="260"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<img :src="scope.row.share_image" width="30" height="30" style="vertical-align: middle">
|
||||
<img
|
||||
:src="scope.row.share_image"
|
||||
width="30"
|
||||
height="30"
|
||||
style="vertical-align: middle"
|
||||
/>
|
||||
<span>{{ scope.row.share_word }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="ad_id" label="广告ID" show-overflow-tooltip sortable/>
|
||||
<el-table-column
|
||||
prop="ad_id"
|
||||
label="广告ID"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
prop="default_share"
|
||||
label="默认分享"
|
||||
@ -76,11 +105,29 @@
|
||||
sortable
|
||||
:formatter="formatArea"
|
||||
/>
|
||||
<el-table-column prop="sex" label="性别" show-overflow-tooltip sortable :formatter="formatSex"/>
|
||||
<el-table-column
|
||||
prop="sex"
|
||||
label="性别"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
:formatter="formatSex"
|
||||
/>
|
||||
<el-table-column prop="name" label="操作" fixed="right" width="126">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="permView" type="text" size="small" @click.stop="editShare(scope.row)">详情</el-button>
|
||||
<el-button v-if="permEdit" type="text" size="small" @click.stop="delShare(scope.row)">删除</el-button>
|
||||
<el-button
|
||||
v-if="permView"
|
||||
type="text"
|
||||
size="small"
|
||||
@click.stop="editShare(scope.row)"
|
||||
>详情</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
type="text"
|
||||
size="small"
|
||||
@click.stop="delShare(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -103,6 +150,7 @@
|
||||
import { getShareList, getShareTypes, delShares } from '@/api/share'
|
||||
import { getGame } from '@/api/games'
|
||||
import { mapGetters } from 'vuex'
|
||||
import getPageTitle from '@/utils/get-page-title'
|
||||
|
||||
export default {
|
||||
name: 'GameDetailShare',
|
||||
@ -164,6 +212,7 @@ export default {
|
||||
if (data.errcode === 0) {
|
||||
this.gameInfo = data.gameInfo
|
||||
this.$route.meta.title = this.gameInfo.game_name
|
||||
document.title = getPageTitle(this.gameInfo.game_name)
|
||||
if (cb && cb instanceof Function) cb()
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user