作者 鲍奕龙

代码优化 提交

... ... @@ -38,17 +38,46 @@
</div>
</div>
<div class="but-url">
<span>默认跳转链接</span>
<span style="font-weight: 600;color: #1890ff;">默认行为</span>
<a-radio-group v-model="defaultBehavior">
<a-radio :value="0">跳转链接地址</a-radio>
<a-radio :value="1">弹窗提示信息</a-radio>
</a-radio-group>
<br/>
<a-input
v-if="url"
class="right-center"
type="text"
placeholder="url链接"
placeholder=""
v-model="item.url"
/>
</div>
<div class="but-renage">
<span style="font-weight: 600;">是否受活动时间影响</span>
<div class="ren">
<a-radio-group v-model="item.isOpenActivityPersonCount">
<a-radio :value="1">开启</a-radio>
<a-radio :value="0">关闭</a-radio>
</a-radio-group>
</div>
<p class="renage">
活动未开始:按钮失效,点击提示文字(活动暂未开始);活动已结束:按钮失效,点击提示文字(活动已经结束)
</p>
</div>
<div class="but-renage">
<span style="font-weight: 600;">是否受活动人数影响</span>
<div class="ren">
<a-radio-group v-model="item.isOpenActivityPersonCount">
<a-radio :value="1">开启</a-radio>
<a-radio :value="0">关闭</a-radio>
</a-radio-group>
</div>
<p class="renage">
开启后:达到人数上限后,按钮失效,点击提示文字(人数已达上线);关闭后:将不限制人数,执行默认行为
</p>
</div>
<div class="but-kaihu">
<span>是否受开户影响</span>
<span style="font-weight: 600;">是否受开户影响</span>
<div class="kaihu-right">
<a-radio-group v-model="item.isOpenAccount">
<a-radio :value="1">开启</a-radio>
... ... @@ -56,42 +85,52 @@
</a-radio-group>
<div class="kaihu-shifou">
<div>
<span>已开户</span>
<span>已开户(在本活动)</span>
<a-radio-group v-model="defaultBehaviorYZ">
<a-radio :value="0">跳转链接地址</a-radio>
<a-radio :value="1">弹窗提示信息</a-radio>
</a-radio-group>
<a-input
v-if="url"
class="right-center"
type="text"
placeholder="url链接"
placeholder=""
v-model="item.openAccountUrl"
/>
</div>
<div>
<span>已开户(非本活动)</span>
<a-radio-group v-model="defaultBehaviorYF">
<a-radio :value="0">跳转链接地址</a-radio>
<a-radio :value="1">弹窗提示信息</a-radio>
</a-radio-group>
<a-input
v-if="url"
class="right-center"
type="text"
placeholder=""
v-model="item.openAccountUrl"
/>
</div>
<div>
<span>未开户</span>
<a-radio-group v-model="defaultBehaviorWZ">
<a-radio :value="0">跳转链接地址</a-radio>
<a-radio :value="1">弹窗提示信息</a-radio>
</a-radio-group>
<a-input
v-if="url"
class="right-center"
type="text"
placeholder="url链接"
placeholder=""
v-model="item.notOpenAccountUrl"
/>
</div>
</div>
</div>
</div>
<div class="but-renage">
<span>是否受活动人数限制</span>
<div class="ren">
<a-radio-group v-model="item.isOpenActivityPersonCount">
<a-radio :value="1">开启</a-radio>
<a-radio :value="0">关闭</a-radio>
</a-radio-group>
</div>
<p class="renage">
开启后:达到人数上限后,按钮失效,点击提示文字(人数已达上线);关闭后:将不限制人数,执行默认链接跳转
</p>
</div>
<div class="but-show">
<span>显示当前参与人数</span>
<span style="font-weight: 600;">显示当前参与人数</span>
<div class="show">
<a-radio-group class="radio-w" v-model="item.isDisplayActivityPersonCount">
<a-radio :value="1">开启</a-radio>
... ... @@ -172,7 +211,7 @@ export default {
// 自定义按钮名
Button: {
type: String,
default: '自定义按钮配置'
default: ''
},
// 是否显示icon
icon: {
... ... @@ -189,7 +228,11 @@ export default {
4: '时光机规则按钮',
5: '点击时光机按钮',
6: '点击时光机按钮'
}
},
defaultBehavior: 0, // 自定义按钮的默认行为 0:跳转链接 1:弹窗提示
defaultBehaviorYZ: 0,
defaultBehaviorYF: 0,
defaultBehaviorWZ: 0
}
},
methods: {
... ... @@ -209,6 +252,7 @@ export default {
span {
margin-right: 10px;
width: 115px;
white-space: nowrap;
}
.custombutton-style {
position: relative;
... ... @@ -236,7 +280,8 @@ span {
}
.but-url {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.but-kaihu {
display: flex;
... ... @@ -248,8 +293,10 @@ span {
flex-direction: column;
div {
display: flex;
flex-wrap: wrap;
align-items: center;
span {
width: 70px;
width: 120px;
}
}
}
... ... @@ -257,6 +304,8 @@ span {
}
.but-renage {
display: flex;
align-items: center;
flex-wrap: wrap;
.ren {
margin-left: 14px;
width: 215px;
... ... @@ -289,4 +338,7 @@ span {
margin: 0 5px;
}
}
.ant-radio-group{
white-space: nowrap;
}
</style>
... ...
... ... @@ -4,14 +4,16 @@
<Imageprize words='上传奖品图不超过1m' picturesize='1m' v-model="formState.prizePicture"/>
</div>
<div class="form">
<input class="prizeinput" type="text" placeholder="奖项名称" v-model="formState.prizeName">
<a-form
:model="formState"
:label-col="labelCol"
:wrapper-col="wrapperCol"
:model="formState"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-item label="奖项名称">
<a-input class="prizeinput" type="text" placeholder="奖项名称" v-model="formState.prizeName"/>
</a-form-item>
<a-form-item label="奖项类型">
<a-radio-group v-model="formState.prizeType">
<a-radio-group v-model="formState.prizeType" @change="onChangeRadio">
<a-radio :value="1">实物</a-radio>
<a-radio :value="2">虚拟</a-radio>
<a-radio :value="3">财商币</a-radio>
... ... @@ -22,13 +24,13 @@
<InputNumberButton v-model="formState.prizeCount"/>
<div class="nuber-right">
<span class="span">中奖率:</span>
<a-input-number v-model="formState.winningRate" v-if="formState.isComfortPrize !== 0" :min="0" :max="100" placeholder="请输入中奖率"/>
<a-input-number v-model="formState.winningRate" v-if="formState.isComfortPrize !== 1" :min="0" :max="100" placeholder="请输入中奖率" style="width: 180px"/>
<a-input v-else :value="100" :disabled="true" placeholder="请输入中奖率"/>
</div>
</div>
</a-form-item>
<a-form-item label="兑换方式">
<a-radio-group v-model="formState.receiveType">
<a-radio-group v-model="formState.receiveType" disabled>
<a-radio :value="1">邮寄</a-radio>
<a-radio :value="2">卷码</a-radio>
</a-radio-group>
... ... @@ -115,6 +117,9 @@ export default {
// 清空
delallbox () {
this.formState.activityLuckDrawLotteryList = []
},
onChangeRadio (val) {
this.formState.receiveType = val.target.value
}
},
watch: {
... ... @@ -144,8 +149,9 @@ export default {
width: 100%;
// padding-left: 10px;
.prizeinput {
width: 100%;
border: 1px solid #ccc;
width: 50%;
// margin-left: 10px;
// border: 1px solid #ccc;
}
}
.prizebox {
... ... @@ -157,8 +163,9 @@ export default {
.nuber-right {
padding-left: 10px;
display: flex;
align-items: center;
.span {
width: 80px;
white-space: nowrap;
}
.ant-input {
... ...
... ... @@ -11,9 +11,9 @@
<a-radio-button value="Unpublished">
未发布
</a-radio-button>
<a-radio-button value="Notstarted">
<!-- <a-radio-button value="Notstarted">
未开始
</a-radio-button>
</a-radio-button> -->
<a-radio-button value="Finished">
已结束
</a-radio-button>
... ... @@ -25,11 +25,9 @@
<div class="bott">
<a-table
v-if="$store.state.user.allstatelist"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
:data-source="datalist"
bordered
>
<img slot="coverPreview" slot-scope="text, record" :src=record.coverPreview v-show="record.coverPreview" class="imghome"/>
<div slot="activityTime" slot-scope="text, record" >
... ... @@ -46,7 +44,7 @@
<div slot="operation" slot-scope="text, record" class="op-a">
<a href="#" v-if="record.state !== 2" @click.prevent="clickafn(record,0)">发布</a>
<a href="#" v-if="record.state === 2" @click.prevent="clickafn(record,4)">取消发布</a>
<a href="#" @click.prevent="clickafn(record,1)">编辑</a>
<a href="#" v-if="record.state !== 2" @click.prevent="clickafn(record,1)">编辑</a>
<a href="#" v-if="record.state !== 2" @click.prevent="clickafn(record,2)">删除</a>
<a href="#" @click.prevent="clickafn(record,3)">详情</a>
</div>
... ... @@ -79,6 +77,15 @@
import { ADDactivity, queryList, delidshuju, seteditActivitystate } from '@/api/parameterconfiguration'
const columns = [
{
title: '序号',
dataIndex: 'sort',
align: 'center',
width: 30,
customRender: function (row, data, index) {
return index + 1
}
},
{
title: '预览图',
dataIndex: 'coverPreview',
align: 'center',
... ...
... ... @@ -22,7 +22,7 @@
<!-- <div class="boxyanle" :class="box6 ? 'addstyle' : ''" @click="box6click">规则页面</div> -->
</div>
<div class="box-iframe">
<iframe frameborder="0" name="Iframe1" :src="`http://192.168.10.34:8081/#/pages/clock/index?id=${$route.query.id}`" width="100%" height="100%">
<iframe frameborder="0" name="Iframe1" :src="`http://192.168.10.34:8082/#/pages/clock/index?id=${$route.query.id}`" width="100%" height="100%">
您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。
</iframe>
<!-- <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Ffile04.16sucai.com%2Fd%2Ffile%2F2015%2F0504%2Fcf57eb1952ac4a98f150ed8b734ad6c2.jpg&refer=http%3A%2F%2Ffile04.16sucai.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1663981068&t=8492ab2c6a3092298e666e6473f1b2d3" alt=""> -->
... ...
... ... @@ -13,7 +13,7 @@
<el-input-number v-model="formState.activityLuckDraw.prizeCount" @change="changefh" :min="1" :max="6"></el-input-number>
<p>请填写相关参数及设置项(不开启奖项请将其对应)</p>
<div class="zhongj">
<span>是否开启中奖</span>
<span style="margin-right: 6px">是否开启中奖</span>
<a-radio-group v-model="formState.activityLuckDraw.isOpenLuckDraw">
<a-radio :value="1">开启</a-radio>
<a-radio :value="0">关闭</a-radio>
... ... @@ -95,7 +95,7 @@ export default {
}
},
created () {
const index = this.formState.activityPrizeList.findIndex(v => v.isComfortPrize === 0)
const index = this.formState.activityPrizeList.findIndex(v => v.isComfortPrize === 1)
this.anwei = this.formState.activityPrizeList.splice(index, 1)[0]
console.log(this.anwei, 'anwei')
this.navprizelist = []
... ... @@ -118,7 +118,7 @@ export default {
},
changefh (e) {
console.log(e)
const index = this.formState.activityPrizeList.findIndex(v => v.isComfortPrize === 0)
const index = this.formState.activityPrizeList.findIndex(v => v.isComfortPrize === 1)
this.anwei = this.formState.activityPrizeList.splice(index, 1)[0]
//
if (this.formState.activityPrizeList.length < e) {
... ... @@ -127,17 +127,16 @@ export default {
{
prizeCount: 10,
activityLuckDrawLotteryList: [],
prizeType: '',
receiveType: '',
winningRate: '',
prizeType: 1,
receiveType: 1,
winningRate: 0,
prizePicture: '',
prizeName: '',
isComfortPrize: 1,
isComfortPrize: 0,
prizeGrade: i + 1
}
)
}
console.log(this.formState.activityPrizeList, '奖项书刘昂')
} else {
this.formState.activityPrizeList.splice(e)
}
... ... @@ -160,7 +159,7 @@ export default {
deep: true,
// immediate: true,
handler: function (nowName) {
const index = this.formState.activityPrizeList.findIndex(v => v.isComfortPrize === 0)
const index = this.formState.activityPrizeList.findIndex(v => v.isComfortPrize === 1)
if (index >= 0) {
this.formState.activityPrizeList[index] = nowName
} else {
... ... @@ -181,14 +180,18 @@ export default {
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #ccc;
height: 50px;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
line-height: 44px;
flex: 1;
cursor: pointer;
}
.Severalprizes-1:nth-last-of-type(1) {
border-right: 1px solid #ccc;
}
}
// 点击几等奖样式
.addstyle {
border: 1px solid #ccc !important;
color: blue;
}
.ant-form-item {
... ...
... ... @@ -17,7 +17,7 @@
<div :class="box4 ? 'addstyle' : ''" @click="box4click">我的奖品</div>
</div>
<div class="box-iframe">
<iframe frameborder="0" name="Iframe1" :src="`http://192.168.10.34:8081/#/pages/lottery/index?id=${$route.query.id}`" width="100%" height="100%">
<iframe frameborder="0" name="Iframe1" :src="`http://192.168.10.34:8082/#/pages/lottery/index?id=${$route.query.id}`" width="100%" height="100%">
您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。
</iframe>
<!-- <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Ffile04.16sucai.com%2Fd%2Ffile%2F2015%2F0504%2Fcf57eb1952ac4a98f150ed8b734ad6c2.jpg&refer=http%3A%2F%2Ffile04.16sucai.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1663981068&t=8492ab2c6a3092298e666e6473f1b2d3" alt=""> -->
... ... @@ -179,10 +179,10 @@ export default {
],
prizeType: 1,
receiveType: 1,
winningRate: '',
winningRate: 0,
prizePicture: '',
prizeName: '',
isComfortPrize: 1,
isComfortPrize: 0, // 默认先加非安慰奖
prizeGrade: i + 1
}
)
... ... @@ -191,17 +191,17 @@ export default {
// 奖品等级
// 安慰奖
if (!this.formState.activityPrizeList.find(item => item.isComfortPrize === 0)) {
if (!this.formState.activityPrizeList.find(item => item.isComfortPrize === 1)) {
this.formState.activityPrizeList.push({
prizeCount: 10,
activityLuckDrawLotteryList: [
],
prizeType: 1,
receiveType: 1,
winningRate: '',
winningRate: 100,
prizePicture: '',
prizeName: '',
isComfortPrize: 0
isComfortPrize: 1
})
}
console.log(this.formState, '获取数据')
... ... @@ -257,12 +257,12 @@ export default {
this.isLoading = true
const res = await seteditActivityInfo(data)
this.$message.success('保存成功')
this.isLoading = false
// this.isLoading = true
console.log(res, '修改的数据')
// 刷新iframe页面
location.reload()
// location.reload()
// document.getElementById('Iframe1').contentWindow.location.reload(true)
// 获取数据
... ...
... ... @@ -37,7 +37,7 @@
</a-form-item>
<a-form-item label="活动人数限制">
<a-input-number v-model="formState.numberLimit" placeholder="请输入人数限制" />
<a-input-number v-model="formState.numberLimit" placeholder="人数" />
<!-- <div class="buttom-renshu">
<p>X轴位置:</p>
<a-input-Number placeholder="请输入数值" v-model="formState.xposition" ></a-input-Number>
... ... @@ -46,9 +46,9 @@
</div> -->
</a-form-item>
<a-form-item label="已开户后的跳转地址">
<!-- <a-form-item label="已开户后的跳转地址">
<a-input v-model="formState.isHandleLink" placeholder="请输入跳转地址" ></a-input>
</a-form-item>
</a-form-item> -->
<a-form-item label="自定义按钮">
<a-radio-group v-model="formState.customButtonState">
<a-radio :value="1">开启</a-radio>
... ...
... ... @@ -14,7 +14,7 @@
<!-- <div class="boxyanle" :class="box2 ? 'addstyle' : ''" @click="box2click" > 已开户页面</div> -->
</div>
<div class="box-iframe">
<iframe v-if="box1" frameborder="0" id="Iframe1" name="Iframe1" :src="`http://192.168.10.34:8081/#/pages/introduce/index?id=${$route.query.id}`" width="100%" height="100%">
<iframe v-if="box1" frameborder="0" id="Iframe1" name="Iframe1" :src="`http://192.168.10.34:8082/#/pages/introduce/index?id=${$route.query.id}`" width="100%" height="100%">
<!-- 您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。 -->
</iframe>
</div>
... ...