Skip to content

Commit

Permalink
添加每次10人及以下抽奖排版适配
Browse files Browse the repository at this point in the history
  • Loading branch information
moshang-ax committed Jan 13, 2020
1 parent d37b213 commit db4661f
Show file tree
Hide file tree
Showing 19 changed files with 508 additions and 361 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#npm
node_modules/
dist/
dist/
temp.json
error.json
63 changes: 47 additions & 16 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,62 @@ Lottery
## 配置信息

1. 抽奖用户信息,按指定的格式填写在`server/data/user.xlsx`文件中,不能修改文件名
### 抽奖用户信息配置

2. 奖品的配置信息填写在`server/config.js`文件中,不能修改文件名
抽奖用户信息在**`server/data/user.xlsx`**文件中,按文件格式进行填充,不能修改文件名和列头

```js
### ### 奖品信息配置

奖品的配置信息填写在**server/config.js**文件中,不能修改文件名。

**其中奖品`prizes`的配置描述如下:**

| 参数 | 值类型 | 描述 |
| ----- | ------ | ------------------------------------------------------------ |
| type | Number | 奖品类型,唯一标识,0 是默认特别奖的占位符,其它奖品不可使用 |
| count | Number | 奖品数量 |
| text | String | 奖项名称 |
| title | String | 奖品描述 |
| img | String | 奖品的图片地址,图片在**img**目录下 |

````js
// 奖品信息,第一项为预留项不可修改,其他项可根据需要修改
let prizes = [{
type: 0,
count: 1000,
title: '特别奖',
img: ''
}, {
title: "",
text: "特别奖"
},
{
type: 1,
count: 1,
title: '华为Mate 20X',
img: '../img/huawei.png'
count: 2,
text: "特等奖",
title: "神秘大礼",
img: "../img/secrit.jpg"
},
{
type: 2,
count: 5,
text: "一等奖",
title: "Mac Pro",
img: "../img/mbp.jpg"
}
...
];

/**
* 一次抽取的奖品个数
* 顺序为:[特别奖,一等奖,二等奖,三等奖,四等奖,五等奖]
*/
const EACH_COUNT = [1, 1, 1, 1, 1, 5];
// 公司名称,用于显示在抽奖名单的title部分
const COMPANY = 'MoShang';
### 奖品每次抽取个数配置

**`EACH_COUNT`**用于配置每次的抽奖个数,与prizes奖品一一对应,例如上面的奖品配置对应的抽奖个数配置如下:
```js
const EACH_COUNT = [1, 1, 5];
````
如上配置,表示一次抽取的奖品个数顺序为:特别奖每次抽一个,特等奖每次抽一个,一等奖每次抽五个
### 企业标识配置
该标识用于显示在抽奖卡片上。
```js
const COMPANY = "MoShang";
```
1 change: 0 additions & 1 deletion product/error.json

This file was deleted.

Binary file removed product/src/img/baidu.jpg
Binary file not shown.
Binary file added product/src/img/edifier.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed product/src/img/huawei-m.png
Binary file not shown.
Binary file added product/src/img/ipad.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed product/src/img/lamy.png
Binary file not shown.
Binary file removed product/src/img/prize.png
Binary file not shown.
Binary file added product/src/img/secrit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion product/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<button id="lottery">抽奖</button>
<button id="reLottery">重新抽奖</button>
<button id="save">导出抽奖结果</button>
<button id="reset" style="margin-left: 40px;">重置</button>
<button id="reset" class="margin-l-40">重置</button>
</div>
</div>

Expand Down
Loading

0 comments on commit db4661f

Please sign in to comment.