Browse Source

新增特约邀请码开关

master
Penny 3 years ago
parent
commit
1b9cf15173
  1. 1
      .gitignore
  2. 25
      src/api/img/inviteLog.js
  3. 4
      src/views/img/creatorProfit/index.vue
  4. 51
      src/views/img/inviteLog/index.vue
  5. 4
      src/views/img/profitVerifyOrder/index.vue
  6. 2
      vue.config.js

1
.gitignore

@ -9,6 +9,7 @@ yarn-error.log*
tests/**/coverage/ tests/**/coverage/
tests/e2e/reports tests/e2e/reports
selenium-debug.log selenium-debug.log
bnyer-system-page
# Editor directories and files # Editor directories and files
.idea .idea

25
src/api/img/inviteLog.js

@ -20,3 +20,28 @@ export function delInviteLog(ids) {
}) })
} }
// 开/关特约邀请码
export function changeStatus(data) {
return request({
url: `${serviceTitle}${prefix}/changeStatus`,
method: 'post',
data: data
})
}
// 获取特约邀请码状态
export function getStatus() {
return request({
url: `${serviceTitle}${prefix}/getStatus`,
method: 'get'
})
}
// 初始化特约邀请码状态
export function initStatus() {
return request({
url: `${serviceTitle}${prefix}/initStatus`,
method: 'get'
})
}

4
src/views/img/creatorProfit/index.vue

@ -131,7 +131,7 @@
</el-table-column> </el-table-column>
<el-table-column label="应用类型" align="center" key="appType" prop="appType" v-if="columns[7].visible" width="100"> <el-table-column label="应用类型" align="center" key="appType" prop="appType" v-if="columns[7].visible" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.appType == '0' ? "次元壁纸" :''}} {{scope.row.appType == '0' ? "次元意境" :''}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="收益类型" align="center" key="type" prop="type" v-if="columns[8].visible"> <el-table-column label="收益类型" align="center" key="type" prop="type" v-if="columns[8].visible">
@ -300,7 +300,7 @@ export default {
], ],
// //
appType: [ appType: [
{ value: '0', label: `次元壁纸`} { value: '0', label: `次元意境`}
], ],
// //
type: [ type: [

51
src/views/img/inviteLog/index.vue

@ -41,6 +41,17 @@
v-hasPermi="['img:inviteLog:delete']" v-hasPermi="['img:inviteLog:delete']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-switch
v-hasPermi="['img:inviteLog:edit']"
v-model="specialInviteCode"
active-value="1"
inactive-value="0"
@change="handleStatus(specialInviteCode)"
active-text="开启特约邀请码"
inactive-text="关闭特约邀请码">
</el-switch>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row> </el-row>
@ -98,7 +109,7 @@
</template> </template>
<script> <script>
import { listInviteLog, delInviteLog } from "@/api/img/inviteLog"; import { listInviteLog, delInviteLog, getStatus, changeStatus, initStatus } from "@/api/img/inviteLog";
export default { export default {
name: "InviteLog", name: "InviteLog",
@ -117,7 +128,9 @@ export default {
// //
total: 0, total: 0,
// //
inviteLog: null, inviteLogList: null,
//
specialInviteCode: "0",
// //
isShow: [ isShow: [
{ value: '0', label: '否'}, { value: '0', label: '否'},
@ -145,8 +158,27 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getStatus();
}, },
methods: { methods: {
/**初始化特约邀请码 */
initStatus(){
initStatus().then(res =>{
console.log('初始化特约邀请码成功!')
});
},
/**获取特约邀请码状态 */
getStatus(){
getStatus().then(res =>{
console.log('状态结果',res)
if(res.msg == null){
this.initStatus();
}else{
this.specialInviteCode = res.msg;
}
});
},
/** 查询类型列表 */ /** 查询类型列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -192,6 +224,21 @@ export default {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
},
/**切换特约邀请码状态 */
handleStatus(row){
let text = row === "1" ? "开启" : "关闭";
this.$modal.confirm('确认要' + text + '特约邀请码吗?').then(function() {
let data = {
status : row
}
return changeStatus(data);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row = row === "0" ? "1" : "0";
});
} }
} }
}; };

4
src/views/img/profitVerifyOrder/index.vue

@ -89,7 +89,7 @@
</el-table-column> </el-table-column>
<el-table-column label="应用" align="center" key="appType" prop="appType" v-if="columns[4].visible" width="120"> <el-table-column label="应用" align="center" key="appType" prop="appType" v-if="columns[4].visible" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.appType == '0' ? "次元壁纸" : ''}} {{scope.row.appType == '0' ? "次元意境" : ''}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="修改管理员id" align="center" key="updateAdminId" prop="updateAdminId" v-if="columns[5].visible" width="120"/> <el-table-column label="修改管理员id" align="center" key="updateAdminId" prop="updateAdminId" v-if="columns[5].visible" width="120"/>
@ -307,7 +307,7 @@ export default {
], ],
// //
appType: [ appType: [
{ value: '0', label: '次元壁纸'} { value: '0', label: '次元意境'}
], ],
// //
platform: [ platform: [

2
vue.config.js

@ -20,7 +20,7 @@ module.exports = {
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/", publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist', outputDir: 'bnyer-system-page',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static', assetsDir: 'static',
// 是否开启eslint保存检测,有效值:ture | false | 'error' // 是否开启eslint保存检测,有效值:ture | false | 'error'

Loading…
Cancel
Save