fix: user unlock
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-input v-model.trim="form.type" placeholder="请输入类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="解锁类型" prop="unlockType">
|
||||
<el-select v-model="form.unlockType" clearable placeholder="请选择解锁类型(可为空)" style="width: 100%">
|
||||
<el-option v-for="item in unlockTypeList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="挂饰图片" prop="imageUrl">
|
||||
<single-upload
|
||||
v-model="form.imageUrl"
|
||||
@@ -37,8 +42,16 @@
|
||||
form: {
|
||||
imageUrl: '',
|
||||
type: '',
|
||||
unlockType: '',
|
||||
isEnabled: true,
|
||||
},
|
||||
unlockTypeList: [
|
||||
{ value: 'sing3', label: '连续签到3天' },
|
||||
{ value: 'sing5', label: '连续签到5天' },
|
||||
{ value: 'sing7', label: '连续签到7天' },
|
||||
{ value: 'ad', label: '观看广告' },
|
||||
{ value: 'vip', label: '开通vip' },
|
||||
],
|
||||
rules: {
|
||||
imageUrl: [{ required: true, trigger: 'blur', message: '请上传挂饰图片' }],
|
||||
isEnabled: [{ required: true, trigger: 'blur', message: '请选择是否启用' }],
|
||||
@@ -65,6 +78,7 @@
|
||||
this.form = {
|
||||
imageUrl: row.imageUrl,
|
||||
type: row.type,
|
||||
unlockType: row.unlockType,
|
||||
isEnabled: row.isEnabled,
|
||||
}
|
||||
this.id = row.id
|
||||
|
||||
@@ -28,7 +28,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="排序" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="类型" prop="type" show-overflow-tooltip />
|
||||
|
||||
<el-table-column align="center" label="解锁类型" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ getUnlockTypeName(row.unlockType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="挂饰" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip class="item" :content="scope.row.id" effect="dark" placement="top">
|
||||
@@ -177,6 +181,16 @@
|
||||
this.$baseMessage('更新失败', 'error')
|
||||
}
|
||||
},
|
||||
getUnlockTypeName(type) {
|
||||
const map = {
|
||||
sing3: '连续签到3天',
|
||||
sing5: '连续签到5天',
|
||||
sing7: '连续签到7天',
|
||||
ad: '观看广告',
|
||||
vip: '开通vip',
|
||||
}
|
||||
return map[type] || type
|
||||
},
|
||||
async handleMoveUp(row) {
|
||||
try {
|
||||
const { msg } = await doMoveUp(row.id)
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-input v-model.trim="form.type" placeholder="请输入类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="解锁类型" prop="unlockType">
|
||||
<el-select v-model="form.unlockType" clearable placeholder="请选择解锁类型(可为空)" style="width: 100%">
|
||||
<el-option v-for="item in unlockTypeList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="头像框" prop="imageUrl">
|
||||
<single-upload
|
||||
v-model="form.imageUrl"
|
||||
@@ -37,8 +42,16 @@
|
||||
form: {
|
||||
imageUrl: '',
|
||||
type: '',
|
||||
unlockType: '',
|
||||
isEnabled: true,
|
||||
},
|
||||
unlockTypeList: [
|
||||
{ value: 'sing3', label: '连续签到3天' },
|
||||
{ value: 'sing5', label: '连续签到5天' },
|
||||
{ value: 'sing7', label: '连续签到7天' },
|
||||
{ value: 'ad', label: '观看广告' },
|
||||
{ value: 'vip', label: '开通vip' },
|
||||
],
|
||||
rules: {
|
||||
imageUrl: [{ required: true, trigger: 'blur', message: '请上传头像框图片' }],
|
||||
isEnabled: [{ required: true, trigger: 'blur', message: '请选择是否启用' }],
|
||||
@@ -65,6 +78,7 @@
|
||||
this.form = {
|
||||
imageUrl: row.imageUrl,
|
||||
type: row.type,
|
||||
unlockType: row.unlockType,
|
||||
isEnabled: row.isEnabled,
|
||||
}
|
||||
this.id = row.id
|
||||
|
||||
@@ -28,7 +28,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="排序" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="类型" prop="type" show-overflow-tooltip />
|
||||
|
||||
<el-table-column align="center" label="解锁类型" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ getUnlockTypeName(row.unlockType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="头像框" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip class="item" :content="scope.row.id" effect="dark" placement="top">
|
||||
@@ -207,6 +211,16 @@
|
||||
if (enabled.length === 0) return false
|
||||
return enabled[enabled.length - 1].id === row.id
|
||||
},
|
||||
getUnlockTypeName(type) {
|
||||
const map = {
|
||||
sing3: '连续签到3天',
|
||||
sing5: '连续签到5天',
|
||||
sing7: '连续签到7天',
|
||||
ad: '观看广告',
|
||||
vip: '开通vip',
|
||||
}
|
||||
return map[type] || type
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
<el-option v-for="item in sceneList" :key="item.scene" :label="item.sceneName" :value="item.scene" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="解锁类型" prop="unlockType">
|
||||
<el-select v-model="form.unlockType" clearable placeholder="请选择解锁类型(可为空)" style="width: 100%">
|
||||
<el-option v-for="item in unlockTypeList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="卡片图片" prop="imageUrl">
|
||||
<single-upload
|
||||
v-model="form.imageUrl"
|
||||
@@ -43,9 +48,17 @@
|
||||
form: {
|
||||
name: '',
|
||||
scene: '',
|
||||
unlockType: '',
|
||||
imageUrl: '',
|
||||
isEnabled: true,
|
||||
},
|
||||
unlockTypeList: [
|
||||
{ value: 'sing3', label: '连续签到3天' },
|
||||
{ value: 'sing5', label: '连续签到5天' },
|
||||
{ value: 'sing7', label: '连续签到7天' },
|
||||
{ value: 'ad', label: '观看广告' },
|
||||
{ value: 'vip', label: '开通vip' },
|
||||
],
|
||||
rules: {
|
||||
name: [{ required: true, trigger: 'blur', message: '请输入卡片名称' }],
|
||||
imageUrl: [{ required: true, trigger: 'blur', message: '请上传卡片图片' }],
|
||||
@@ -80,6 +93,7 @@
|
||||
this.form = {
|
||||
name: row.name,
|
||||
scene: row.scene,
|
||||
unlockType: row.unlockType,
|
||||
imageUrl: row.imageUrl,
|
||||
isEnabled: row.isEnabled,
|
||||
}
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
{{ getSceneName(row.scene) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="解锁类型" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ getUnlockTypeName(row.unlockType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="使用次数" prop="useCount" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="是否启用" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
@@ -187,6 +192,16 @@
|
||||
const found = this.sceneList.find((item) => item.scene === scene)
|
||||
return found ? found.sceneName : scene
|
||||
},
|
||||
getUnlockTypeName(type) {
|
||||
const map = {
|
||||
sing3: '连续签到3天',
|
||||
sing5: '连续签到5天',
|
||||
sing7: '连续签到7天',
|
||||
ad: '观看广告',
|
||||
vip: '开通vip',
|
||||
}
|
||||
return map[type] || type
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
<el-option v-for="item in sceneList" :key="item.scene" :label="item.sceneName" :value="item.scene" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="解锁类型" prop="unlockType">
|
||||
<el-select v-model="form.unlockType" clearable placeholder="请选择解锁类型(可为空)" style="width: 100%">
|
||||
<el-option v-for="item in unlockTypeList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="卡片图片" prop="imageUrl">
|
||||
<single-upload
|
||||
v-model="form.imageUrl"
|
||||
@@ -43,9 +48,17 @@
|
||||
form: {
|
||||
name: '',
|
||||
scene: '',
|
||||
unlockType: '',
|
||||
imageUrl: '',
|
||||
isEnabled: true,
|
||||
},
|
||||
unlockTypeList: [
|
||||
{ value: 'sing3', label: '连续签到3天' },
|
||||
{ value: 'sing5', label: '连续签到5天' },
|
||||
{ value: 'sing7', label: '连续签到7天' },
|
||||
{ value: 'ad', label: '观看广告' },
|
||||
{ value: 'vip', label: '开通vip' },
|
||||
],
|
||||
rules: {
|
||||
name: [{ required: true, trigger: 'blur', message: '请输入卡片名称' }],
|
||||
imageUrl: [{ required: true, trigger: 'blur', message: '请上传卡片图片' }],
|
||||
@@ -80,6 +93,7 @@
|
||||
this.form = {
|
||||
name: row.name,
|
||||
scene: row.scene,
|
||||
unlockType: row.unlockType,
|
||||
imageUrl: row.imageUrl,
|
||||
isEnabled: row.isEnabled,
|
||||
}
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
{{ getSceneName(row.scene) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="解锁类型" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ getUnlockTypeName(row.unlockType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="使用次数" prop="useCount" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="是否启用" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
@@ -187,6 +192,16 @@
|
||||
const found = this.sceneList.find((item) => item.scene === scene)
|
||||
return found ? found.sceneName : scene
|
||||
},
|
||||
getUnlockTypeName(type) {
|
||||
const map = {
|
||||
sing3: '连续签到3天',
|
||||
sing5: '连续签到5天',
|
||||
sing7: '连续签到7天',
|
||||
ad: '观看广告',
|
||||
vip: '开通vip',
|
||||
}
|
||||
return map[type] || type
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user