|
|
@@ -11,25 +11,6 @@
|
|
|
@click="(table.where.type = 2) && $refs.table.reload()">出售
|
|
|
</el-button>
|
|
|
</el-button-group>
|
|
|
-
|
|
|
- <span>
|
|
|
- 广告大厅上线
|
|
|
- <el-switch
|
|
|
- v-model="setting.advert_online"
|
|
|
- active-color="#33CC99"
|
|
|
- inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="changeAdvert">
|
|
|
- </el-switch>
|
|
|
- <span style="margin:0 10px;color: #666;" class="time" v-text="setting.advert_online_time_text">00:00</span>后关闭
|
|
|
- </span>
|
|
|
- </el-col>
|
|
|
- <el-col :md="6" :sm="8">
|
|
|
- <!-- 操作按钮 -->
|
|
|
- <div class="ele-table-tool">
|
|
|
- <el-link href="#/system/advert/hall">广告大厅</el-link>
|
|
|
- <el-button @click="showEdit=true" type="primary" class="ele-btn-icon" size="small"
|
|
|
- v-if="permission.includes('sys:advert:add')">发布广告
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
@@ -38,6 +19,7 @@
|
|
|
highlight-current-row>
|
|
|
<template slot-scope="{index}">
|
|
|
<el-table-column type="selection" width="45" align="center" fixed="left"/>
|
|
|
+ <el-table-column prop="username_hidden" label="交易员" show-overflow-tooltip min-width="150"/>
|
|
|
<el-table-column prop="type" label="广告类型" show-overflow-tooltip min-width="100">
|
|
|
<template slot-scope="{row}">
|
|
|
<span v-if="row.type == 1">购买广告</span>
|
|
|
@@ -51,23 +33,27 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="limit" label="单笔限额(USDT)" show-overflow-tooltip min-width="150">
|
|
|
<template slot-scope="{row}">
|
|
|
- <span>{{(row.limit_mix>0? row.limit_mix :0)}}~{{row.limit_max}}</span>
|
|
|
+ <span>{{ (row.limit_mix > 0 ? row.limit_mix : 0) }}~{{ row.limit_max }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="real_price" label="价格(CNY)" show-overflow-tooltip min-width="150"/>
|
|
|
<el-table-column prop="pay_type" label="付款方式" show-overflow-tooltip min-width="150">
|
|
|
<template slot-scope="{row}">
|
|
|
<template v-for="(v,k) in row.pay_type">
|
|
|
- <span v-if="v == 1" class="ele-text-warning" style="margin-right:10px; border-radius: 2px; padding: 2px; background-color: #fde3cf; ">银行卡</span>
|
|
|
- <span v-if="v == 2" class="ele-text-success" style="margin-right:10px;border-radius: 2px; padding: 2px;background-color: #5cd6ad;">微信</span>
|
|
|
- <span v-if="v == 3" class="ele-text-primary" style="border-radius: 2px; padding: 2px;background-color: #a0cfff;">支付宝</span>
|
|
|
+ <span v-if="v == 1" class="ele-text-warning"
|
|
|
+ style="margin-right:10px; border-radius: 2px; padding: 2px; background-color: #fde3cf; ">银行卡</span>
|
|
|
+ <span v-if="v == 2" class="ele-text-success"
|
|
|
+ style="margin-right:10px;border-radius: 2px; padding: 2px;background-color: #5cd6ad;">微信</span>
|
|
|
+ <span v-if="v == 3" class="ele-text-primary"
|
|
|
+ style="border-radius: 2px; padding: 2px;background-color: #a0cfff;">支付宝</span>
|
|
|
</template>
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="status" label="状态" sortable="custom" :resizable="false" min-width="120">
|
|
|
<template slot-scope="{row}">
|
|
|
- <span v-if="row.status == 1" class="ele-text-success">已发布</span>
|
|
|
+ <span v-if="row.status == 0" class="ele-text-success">待审核</span>
|
|
|
+ <span v-else-if="row.status == 1" class="ele-text-success">已发布</span>
|
|
|
<span v-else class="ele-text-danger">已下架</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -79,9 +65,9 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="130px" align="center" :resizable="false" fixed="right">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-link @click="editStatus(row)" icon="el-icon-edit" type="primary" :underline="false"
|
|
|
- v-if="row.status == 1 && permission.includes('sys:advert:edit')">下架
|
|
|
- </el-link>
|
|
|
+<!-- <el-link @click="editStatus(row)" icon="el-icon-edit" type="primary" :underline="false"-->
|
|
|
+<!-- v-if="row.status == 1 && permission.includes('sys:advert:edit')">下架-->
|
|
|
+<!-- </el-link>-->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</template>
|
|
|
@@ -89,53 +75,125 @@
|
|
|
</el-card>
|
|
|
<!-- 编辑弹窗 -->
|
|
|
<el-dialog :title="'发布挂单广告'" :visible.sync="showEdit" width="600px"
|
|
|
- @closed="editForm={}" :destroy-on-close="true" custom-class="ele-dialog-form" :lock-scroll="false">
|
|
|
- <el-form :model="editForm" ref="editForm" :rules="editRules" label-width="82px">
|
|
|
+ @closed="editForm={type:1,price_type:1,price:0.00,coin_type:'1'}" :destroy-on-close="true" custom-class="ele-dialog-form"
|
|
|
+ :lock-scroll="false">
|
|
|
+ <el-form :model="editForm" ref="editForm" :rules="editRules" label-width="100px">
|
|
|
<el-row :gutter="15">
|
|
|
- <el-col :sm="16">
|
|
|
- <el-form-item label="广告名称:" prop="title">
|
|
|
- <el-input v-model="editForm.title" placeholder="请输入广告名称" clearable/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态:">
|
|
|
- <el-radio-group v-model="editForm.status">
|
|
|
- <el-radio :label="1">正常</el-radio>
|
|
|
- <el-radio :label="2">禁用</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
+ <el-col :sm="24">
|
|
|
+ <div class="head" style="margin-bottom: 15px">
|
|
|
+ <el-button-group class="el-types">
|
|
|
+ <el-button :type="editForm.type == 1? 'primary':'default'"
|
|
|
+ @click="(editForm.type = 1)">购买广告
|
|
|
+ </el-button>
|
|
|
+ <el-button :type="editForm.type == 2? 'primary':'default'"
|
|
|
+ @click="(editForm.type = 2)">出售广告
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+ </div>
|
|
|
+ <el-col :sm="12">
|
|
|
+ <el-form-item label="币种:" prop="coin_type">
|
|
|
+ <el-select v-model="editForm.coin_type" placeholder="请选择" class="ele-fluid">
|
|
|
+ <el-option label="USDT" value="1"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :sm="24">
|
|
|
+ <el-form-item label="单日限额:" prop="limit">
|
|
|
+ <el-col :sm="12">
|
|
|
+ <el-input placeholder="最小限额"
|
|
|
+ v-model="editForm.limit_min">
|
|
|
+ <template slot="append">USDT</template>
|
|
|
+ </el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :sm="12">
|
|
|
+ <el-input placeholder="最大限额"
|
|
|
+ v-model="editForm.limit_max">
|
|
|
+ <template slot="append">USDT</template>
|
|
|
+ </el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :sm="16">
|
|
|
+ <el-form-item label="报价类型:" prop="price_type">
|
|
|
+ <el-radio-group v-model="editForm.price_type">
|
|
|
+ <el-radio :label="1">固定价格</el-radio>
|
|
|
+ <el-radio :label="2">浮动价格</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单价(CNY):" prop="price">
|
|
|
+ <el-input-number v-if="editForm.price_type==1" v-model="editForm.price" :precision="2" :min="0.00" :step="0.1" :max="100"></el-input-number>
|
|
|
+ <el-input-number v-else v-model="editForm.price" :precision="2" :step="0.1" :min="-100" :max="100"></el-input-number>
|
|
|
+ <div class="tip">
|
|
|
+ <span v-if="editForm.type == 1">市场价:¥{{trade.usdt_buy_price}}</span>
|
|
|
+ <span v-else-if="editForm.type == 2">市场价:¥{{trade.usdt_sell_price}}</span>
|
|
|
+ <span style="margin-left: 20px" class="price" v-if="editForm.price_type==1">当前单价:{{'¥'+countPrice()}}</span>
|
|
|
+ <span style="margin-left: 20px" class="price" v-else-if="editForm.price_type==2">浮动单价:{{'¥'+countPrice()}}</span>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item label="是否置顶:">
|
|
|
- <el-radio-group v-model="editForm.is_top">
|
|
|
- <el-radio :label="1">置顶</el-radio>
|
|
|
- <el-radio :label="2">不置顶</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="截止日期:" prop="expired_at">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="editForm.expired_at"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择截止日期"
|
|
|
+ size="small"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ format="yyyy-MM-dd">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="收款方式:" prop="pay_type">
|
|
|
+ <el-select v-model="editForm.pay_type" multiple placeholder="请选择收款方式">
|
|
|
+ <el-option label="银行卡" value="1"></el-option>
|
|
|
+ <el-option label="微信" value="2"></el-option>
|
|
|
+ <el-option label="支付宝" value="3"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="其他要求:" prop="remark">
|
|
|
+ <el-input placeholder="其他要求" v-model="editForm.remark" maxlength="150"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="交易密码:" prop="trade_password">
|
|
|
+ <el-input type="password" placeholder="交易密码" v-model="editForm.trade_password" maxlength="50"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer">
|
|
|
<el-button @click="showEdit=false">取消</el-button>
|
|
|
- <el-button type="primary" @click="save">确定发布</el-button>
|
|
|
+ <el-button type="primary" @click="save">确定提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import TinymceEditor from '@/components/TinymceEditor'
|
|
|
import {mapGetters} from "vuex";
|
|
|
|
|
|
export default {
|
|
|
name: "SysNotice",
|
|
|
- components: {TinymceEditor},
|
|
|
+ components: {},
|
|
|
data() {
|
|
|
+ let limitQuota = (rule, value, callback) => {
|
|
|
+ if (this.editForm.limit_min<0) {
|
|
|
+ callback(new Error('请输入最小限额'));
|
|
|
+ } else if (this.editForm.limit_max<0 || this.editForm.limit_max <= this.editForm.limit_min) {
|
|
|
+ callback(new Error('请输入有效的最大限额'));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
- table: {url: '/advert/index', where: {type: 1},page: {limit: 30}}, // 表格配置
|
|
|
+ table: {url: '/advert/index', where: {type: 1}, page: {limit: 30}}, // 表格配置
|
|
|
choose: [], // 表格选中数据
|
|
|
times: {
|
|
|
advert: null,
|
|
|
buy: null,
|
|
|
sell: null,
|
|
|
},
|
|
|
+ trade:{
|
|
|
+ usdt_buy_price: 0.00,
|
|
|
+ usdt_sell_price: 0.00,
|
|
|
+ },
|
|
|
setting: {
|
|
|
advert_online: true,
|
|
|
buy_online: true,
|
|
|
@@ -147,40 +205,31 @@ export default {
|
|
|
sell_online_time: 0,
|
|
|
sell_online_time_text: '00:00:00',
|
|
|
},
|
|
|
- timer: {buy: null, sell:null},
|
|
|
+ timer: {buy: null, sell: null},
|
|
|
showEdit: false, // 是否显示表单弹窗
|
|
|
- editForm: {source: 1, status: 1, is_top: 2}, // 表单数据
|
|
|
+ editForm: {type: 1,price_type:1,price: 0.00, coin_type:'1', status: 1}, // 表单数据
|
|
|
editRules: { // 表单验证规则
|
|
|
- title: [
|
|
|
- {required: true, message: '请输入通知标题', trigger: 'blur'}
|
|
|
+ coin_type: [
|
|
|
+ {required: true, message: '请选择币种', trigger: 'blur'}
|
|
|
],
|
|
|
- status: [
|
|
|
- {required: true, message: '请输入选择通知状态', trigger: 'blur'}
|
|
|
+ pay_type: [
|
|
|
+ {required: true, message: '请选择付款方式', trigger: 'blur'}
|
|
|
],
|
|
|
- is_top: [
|
|
|
- {required: true, message: '请输入选择是否置顶', trigger: 'blur'}
|
|
|
+ limit: [
|
|
|
+ {validator: limitQuota, trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ price_type: [
|
|
|
+ {required: true, message: '请选择价格类型', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ price: [
|
|
|
+ {required: true, message: '请输入价格', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ expired_at: [
|
|
|
+ {required: true, message: '请选择截止日期', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ trade_password: [
|
|
|
+ {required: true, message: '请输入交易密码', trigger: 'blur'}
|
|
|
],
|
|
|
- },
|
|
|
- // 自定义文件上传(这里使用把选择的文件转成blob演示)
|
|
|
- file_picker_callback: (callback, value, meta) => {
|
|
|
- let input = document.createElement('input');
|
|
|
- input.setAttribute('type', 'file');
|
|
|
- // 设定文件可选类型
|
|
|
- if (meta.filetype === 'image') {
|
|
|
- input.setAttribute('accept', 'image/*');
|
|
|
- } else if (meta.filetype === 'media') {
|
|
|
- input.setAttribute('accept', 'video/*');
|
|
|
- }
|
|
|
- input.onchange = () => {
|
|
|
- let file = input.files[0];
|
|
|
- let reader = new FileReader();
|
|
|
- reader.onload = (e) => {
|
|
|
- let blob = new Blob([e.target.result], {type: file.type});
|
|
|
- callback(URL.createObjectURL(blob));
|
|
|
- };
|
|
|
- reader.readAsArrayBuffer(file);
|
|
|
- }
|
|
|
- input.click();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -188,15 +237,28 @@ export default {
|
|
|
...mapGetters(["permission"]),
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getData();
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
- timeLock(){
|
|
|
+ countPrice(){
|
|
|
+ let type = this.editForm.type
|
|
|
+ let price_type = this.editForm.price_type
|
|
|
+
|
|
|
+ if(type == 1){
|
|
|
+ let price = typeof(this.editForm.price) != 'undefined' && this.editForm.price !=''? parseFloat(this.editForm.price) : 0.00;
|
|
|
+ return price_type==1? price : (parseFloat(this.trade.usdt_buy_price)+price).toFixed(2);
|
|
|
+ }else{
|
|
|
+ let price = typeof(this.editForm.price) != 'undefined' && this.editForm.price !=''? parseFloat(this.editForm.price) : 0.00;
|
|
|
+ return price_type==1? price: (parseFloat(this.trade.usdt_sell_price)+price).toFixed(2);
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ timeLock() {
|
|
|
let _this = this;
|
|
|
clearInterval(this.times.advert);
|
|
|
- if(this.setting.advert_online_time>0){
|
|
|
- this.times.advert = setInterval(function(){
|
|
|
- if(_this.setting.advert_online_time<=0){
|
|
|
+ if (this.setting.advert_online_time > 0) {
|
|
|
+ this.times.advert = setInterval(function () {
|
|
|
+ if (_this.setting.advert_online_time <= 0) {
|
|
|
_this.setting.advert_online_time_text = '00:00:00';
|
|
|
_this.setting.advert_online = false;
|
|
|
_this.settingSubmit({advert_online: false});
|
|
|
@@ -204,11 +266,11 @@ export default {
|
|
|
}
|
|
|
|
|
|
_this.setting.advert_online_time--;
|
|
|
- var hour = parseInt(_this.setting.advert_online_time/3600);
|
|
|
- var minute = parseInt(_this.setting.advert_online_time%3600/60);
|
|
|
- var second = parseInt(_this.setting.advert_online_time%3600%60);
|
|
|
+ var hour = parseInt(_this.setting.advert_online_time / 3600);
|
|
|
+ var minute = parseInt(_this.setting.advert_online_time % 3600 / 60);
|
|
|
+ var second = parseInt(_this.setting.advert_online_time % 3600 % 60);
|
|
|
|
|
|
- _this.setting.advert_online_time_text = (hour<10? '0'+hour:hour)+':'+(minute<10?'0'+minute:minute)+':'+(second<10? '0'+second:second);
|
|
|
+ _this.setting.advert_online_time_text = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute) + ':' + (second < 10 ? '0' + second : second);
|
|
|
}, 1000);
|
|
|
}
|
|
|
},
|
|
|
@@ -232,22 +294,7 @@ export default {
|
|
|
this.$message.error(e.message);
|
|
|
});
|
|
|
},
|
|
|
- // 获取配置数据
|
|
|
- getData() {
|
|
|
- const loading = this.$loading({lock: true});
|
|
|
- this.$http.post('/setting/business').then(res => {
|
|
|
- loading.close();
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.setting = res.data.data ? res.data.data : this.setting;
|
|
|
- this.timeLock()
|
|
|
- } else {
|
|
|
- this.$message.error(res.data.msg);
|
|
|
- }
|
|
|
- }).catch(e => {
|
|
|
- loading.close();
|
|
|
- this.$message.error(e.message);
|
|
|
- });
|
|
|
- },
|
|
|
+
|
|
|
/* 显示编辑 */
|
|
|
edit(row) {
|
|
|
this.editForm = Object.assign({}, row);
|