Commit 010974be authored by 李硕's avatar 李硕

奖品概率和定义字段添加

parent 1254fc22
.probablity-prize-content { .probability-prize-content {
background: #FFFFFF; background: #FFFFFF;
max-height: 507px; max-height: 507px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.probablity-prize-content-imageUpload-wrap{ .probability-prize-content-imageUpload-wrap{
display:flex; display:flex;
padding-top:10px; padding-top:10px;
box-sizing:border-box; box-sizing:border-box;
} }
.probablity-prize-content-imageUpload-btn view{ .probability-prize-content-imageUpload-btn view{
margin-bottom:5px; margin-bottom:5px;
color:#666666 color:#666666
} }
.probablity-prize-content-formitem-choosePrize-tips-success{ .probability-prize-content-formitem-choosePrize-tips-success{
color:#71B204 !important; color:#71B204 !important;
padding-top:20px; padding-top:20px;
font-size:14px; font-size:14px;
} }
.probablity-prize-content-formitem-choosePrize-tips-fail{ .probability-prize-content-formitem-choosePrize-tips-fail{
color:#F23C3C !important; color:#F23C3C !important;
padding-top:20px; padding-top:20px;
font-size:14px; font-size:14px;
} }
.probablity-prize-content-formitem-choosePrize-wrap{ .probability-prize-content-formitem-choosePrize-wrap{
display:flex; display:flex;
} }
.probablity-prize-content-input.edit-probablity-input { .probability-prize-content-input.edit-probability-input {
width: 310px!important; width: 310px!important;
margin-right: 10px; margin-right: 10px;
} }
.probablity-prize-content-input.dialog-rank-input { .probability-prize-content-input.dialog-rank-input {
width: 310px!important; width: 310px!important;
} }
.probablity-prize-content-formitem-goequity{ .probability-prize-content-formitem-goequity{
width:80px; width:80px;
height:30px; height:30px;
border-radius:5px; border-radius:5px;
...@@ -49,27 +49,27 @@ ...@@ -49,27 +49,27 @@
text-align:center; text-align:center;
line-height:30px; line-height:30px;
} }
.probablity-prize-content-imageUpload-btn{ .probability-prize-content-imageUpload-btn{
display:flex; display:flex;
flex-direction:column; flex-direction:column;
justify-content:space-around; justify-content:space-around;
} }
.probablity-prize-content-imageUpload-btn text{ .probability-prize-content-imageUpload-btn text{
font-size:12px; font-size:12px;
margin-bottom:5px; margin-bottom:5px;
color:#666666; color:#666666;
} }
/* .probablity-prize-content-formItem { /* .probability-prize-content-formItem {
display: block; display: block;
} */ } */
.probablity-prize-content-formItem-nocoupon{ .probability-prize-content-formItem-nocoupon{
color:#000 !important; color:#000 !important;
margin-left:5px; margin-left:5px;
} }
.probablity-prize-content-btn { .probability-prize-content-btn {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.probablity-prize-content-btn_confirm { .probability-prize-content-btn_confirm {
margin-right: 10px; margin-right: 10px;
} }
\ No newline at end of file
...@@ -18,7 +18,7 @@ const INIT_DATA = { ...@@ -18,7 +18,7 @@ const INIT_DATA = {
type: 1, type: 1,
image: "", image: "",
credits: "", credits: "",
probablity: "", probability: "",
name: "", name: "",
switchStock: STOCK_NO_LIMIT, switchStock: STOCK_NO_LIMIT,
useStock: 0, useStock: 0,
...@@ -42,7 +42,7 @@ Component({ ...@@ -42,7 +42,7 @@ Component({
status: "success", status: "success",
content: "", content: "",
}, },
probablityTips: { probabilityTips: {
status: "success", status: "success",
content: "", content: "",
}, },
...@@ -70,7 +70,7 @@ Component({ ...@@ -70,7 +70,7 @@ Component({
type: 1, type: 1,
image: "", image: "",
credits: "", credits: "",
probablity: "", probability: "",
name: "", name: "",
switchStock: STOCK_NO_LIMIT, switchStock: STOCK_NO_LIMIT,
useStock: 0, useStock: 0,
...@@ -83,7 +83,7 @@ Component({ ...@@ -83,7 +83,7 @@ Component({
record: {} record: {}
}, },
maxRankLimit: '', // 限制最高排名 maxRankLimit: '', // 限制最高排名
type: 'probablity', // 奖品弹窗类型 probablity: 概率 rank: 排名 type: 'probability', // 奖品弹窗类型 probability: 概率 rank: 排名
imageLimit: [250, 250], imageLimit: [250, 250],
activityOutId: "", activityOutId: "",
isEdit: false, isEdit: false,
...@@ -190,7 +190,7 @@ Component({ ...@@ -190,7 +190,7 @@ Component({
type: +value, type: +value,
image: "", image: "",
credits: "", credits: "",
probablity: "", probability: "",
name: "", name: "",
switchStock: STOCK_NO_LIMIT switchStock: STOCK_NO_LIMIT
}; };
...@@ -309,7 +309,7 @@ Component({ ...@@ -309,7 +309,7 @@ Component({
image, image,
type, type,
startTime, startTime,
probablity, probability,
stock, stock,
credits, credits,
useStock, useStock,
...@@ -321,19 +321,19 @@ Component({ ...@@ -321,19 +321,19 @@ Component({
const { imageTips } = this.data; const { imageTips } = this.data;
const { type: dialogType, maxRankLimit } = this.props; const { type: dialogType, maxRankLimit } = this.props;
let probablityRexp = /^\d+(\.\d{1,2})?$/; let probabilityRexp = /^\d+(\.\d{1,2})?$/;
if (!probablityRexp.test(probablity) || probablity > 100) { if (!probabilityRexp.test(probability) || probability > 100) {
this.showItemTips( this.showItemTips(
"probablityTips", "probabilityTips",
"error", "error",
"奖品概率必须在0-100%之间且最多支持两位小数" "奖品概率必须在0-100%之间且最多支持两位小数"
); );
} else { } else {
this.showItemTips("probablityTips", "success", ""); this.showItemTips("probabilityTips", "success", "");
} }
if (dialogType !== 'probablity') { if (dialogType !== 'probability') {
this.showItemTips("probablityTips", "success", ""); this.showItemTips("probabilityTips", "success", "");
} }
const { const {
...@@ -421,7 +421,7 @@ Component({ ...@@ -421,7 +421,7 @@ Component({
return; return;
} }
} }
const { probablityTips, prizeNumberTips, creditsValueTips } = this.data; const { probabilityTips, prizeNumberTips, creditsValueTips } = this.data;
const isImagePass = image && imageTips.status !== "error"; const isImagePass = image && imageTips.status !== "error";
let stockPass = true; let stockPass = true;
...@@ -433,21 +433,21 @@ Component({ ...@@ -433,21 +433,21 @@ Component({
name.trim() && name.trim() &&
isImagePass && isImagePass &&
ename && ename &&
probablityTips.status !== "error" && probabilityTips.status !== "error" &&
prizeNumberTips.status !== "error"; prizeNumberTips.status !== "error";
const isObjectPass = const isObjectPass =
type == OBJECT_TYPE && type == OBJECT_TYPE &&
name.trim() && name.trim() &&
stockPass && stockPass &&
isImagePass && isImagePass &&
probablityTips.status !== "error" && probabilityTips.status !== "error" &&
prizeNumberTips.status !== "error" prizeNumberTips.status !== "error"
const isCreditsPass = const isCreditsPass =
type == CREDITS_TYPE && type == CREDITS_TYPE &&
name.trim() && name.trim() &&
credits && credits &&
isImagePass && isImagePass &&
probablityTips.status !== "error" && probabilityTips.status !== "error" &&
creditsValueTips.status !== "error"; creditsValueTips.status !== "error";
//限制库存时,限制库存一定要大于发放库存 //限制库存时,限制库存一定要大于发放库存
if (isEquietyPass || isObjectPass || isCreditsPass) { if (isEquietyPass || isObjectPass || isCreditsPass) {
...@@ -457,7 +457,7 @@ Component({ ...@@ -457,7 +457,7 @@ Component({
name, name,
ename, ename,
type, type,
probablity, probability,
stock, stock,
credits, credits,
rank, rank,
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<table-column title="奖品数量(件)" dataIndex="stock"> <table-column title="奖品数量(件)" dataIndex="stock">
<view slot-scope="x">{{x.value || '-'}}</view> <view slot-scope="x">{{x.value || '-'}}</view>
</table-column> </table-column>
<table-column title="中奖概率(%)" dataIndex="probablity"> <table-column title="中奖概率(%)" dataIndex="probability">
<view slot-scope="x">{{x.value}}</view> <view slot-scope="x">{{x.value}}</view>
</table-column> </table-column>
<table-column title="操作"> <table-column title="操作">
......
...@@ -211,7 +211,7 @@ Component({ ...@@ -211,7 +211,7 @@ Component({
// 补足谢谢参与类型 // 补足谢谢参与类型
formatPrizeList(prizeInfoList = []) { formatPrizeList(prizeInfoList = []) {
let totalPercent = prizeInfoList.reduce((total, next) => { let totalPercent = prizeInfoList.reduce((total, next) => {
return total = addFloat(total, +next.probablity) return total = addFloat(total, +next.probability)
}, 0) }, 0)
// 排名类型不含谢谢参与 // 排名类型不含谢谢参与
if (prizeInfoList[0].rank) return prizeInfoList; if (prizeInfoList[0].rank) return prizeInfoList;
...@@ -224,7 +224,7 @@ Component({ ...@@ -224,7 +224,7 @@ Component({
let thanksType = { let thanksType = {
type: THANKS_TYPE, type: THANKS_TYPE,
name: '谢谢参与', name: '谢谢参与',
probablity: 100 - totalPercent probability: 100 - totalPercent
} }
prizeInfoListCopy.push(thanksType) prizeInfoListCopy.push(thanksType)
} }
......
...@@ -427,7 +427,7 @@ Component({ ...@@ -427,7 +427,7 @@ Component({
// 补足谢谢参与类型 // 补足谢谢参与类型
formatPobalityPrizeList(prizeInfoList = []) { formatPobalityPrizeList(prizeInfoList = []) {
let totalPercent = prizeInfoList.reduce((total, next) => { let totalPercent = prizeInfoList.reduce((total, next) => {
return total = addFloat(total, +next.probablity) return total = addFloat(total, +next.probability)
}, 0) }, 0)
// 排名类型不含谢谢参与 // 排名类型不含谢谢参与
if(prizeInfoList[0].rank) return prizeInfoList; if(prizeInfoList[0].rank) return prizeInfoList;
...@@ -437,7 +437,7 @@ Component({ ...@@ -437,7 +437,7 @@ Component({
let thanksType = { let thanksType = {
type: THANKS_TYPE, type: THANKS_TYPE,
name: '谢谢参与', name: '谢谢参与',
probablity: 100 - totalPercent probability: 100 - totalPercent
} }
prizeInfoListCopy.push(thanksType) prizeInfoListCopy.push(thanksType)
} }
......
...@@ -4,6 +4,8 @@ const { ...@@ -4,6 +4,8 @@ const {
TASK_CHECK_TYPE, TASK_CHECK_TYPE,
TASK_TYPE_CHINA, TASK_TYPE_CHINA,
PRIZE_TYPE, PRIZE_TYPE,
STOCK_TYPE,
PRIZE_DATA_TYPR
} = require("../utils/constants"); } = require("../utils/constants");
const ResultsModel = require("../utils/results.model"); const ResultsModel = require("../utils/results.model");
let resultsModel = new ResultsModel(); let resultsModel = new ResultsModel();
...@@ -230,7 +232,6 @@ const saveActivityInfoByHasId = async function (context) { ...@@ -230,7 +232,6 @@ const saveActivityInfoByHasId = async function (context) {
); );
} }
} }
console.log(shopInfoResult, "shopInfo");
const baseData = { const baseData = {
title, title,
subtitle, subtitle,
......
...@@ -26,6 +26,12 @@ const DRAW_STATUS = { ...@@ -26,6 +26,12 @@ const DRAW_STATUS = {
// 重新领取 // 重新领取
RETRY: 6, RETRY: 6,
}; };
//库存类型
const STOCK_TYPE = {
LIMIT_STOCK: 1,
NO_LIMIT_STOCK: 2
}
// 日志类型: error,info // 日志类型: error,info
const LOGGER_TYPE = { const LOGGER_TYPE = {
...@@ -45,7 +51,12 @@ const PRIZE_TYPE = { ...@@ -45,7 +51,12 @@ const PRIZE_TYPE = {
OBJECT: 3, OBJECT: 3,
THANK: 5, THANK: 5,
}; };
//奖池类型
const PRIZE_DATA_TYPR = {
RANK_PRIZE: 1,
PRO_PRIZE: 2,
BUILD_PRIZE: 3
}
// code类型 // code类型
const CODE_TYPES = { const CODE_TYPES = {
PARAMS_ERROR: { PARAMS_ERROR: {
...@@ -158,5 +169,7 @@ module.exports = { ...@@ -158,5 +169,7 @@ module.exports = {
TASK_TYPE_CHINA, TASK_TYPE_CHINA,
APP_SUB_CODE, APP_SUB_CODE,
PRIZE_TYPE, PRIZE_TYPE,
SHIP_STATUS SHIP_STATUS,
STOCK_TYPE,
PRIZE_DATA_TYPR
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment