1
0
mirror of https://gitee.com/zoujingli/ThinkAdmin.git synced 2025-04-06 03:58:04 +08:00

修改微信抽奖活动

This commit is contained in:
Anyon 2020-10-12 11:33:10 +08:00
parent 8d101552b8
commit b67d70316f
12 changed files with 226 additions and 308 deletions
app/data
controller
data.sql
view
app/luckdraw
luckdraw_config
luckdraw_record
public/static/luckdraw
vendor

@ -18,7 +18,7 @@ class LuckdrawRecord extends Controller
protected $table = 'ActivityLuckdrawRecord';
/**
* 中奖管理
* 中奖记录管理
* @auth true
* @menu true
* @throws \think\Exception
@ -29,9 +29,15 @@ class LuckdrawRecord extends Controller
*/
public function index()
{
$this->title = '中奖管理';
$query = $this->_query($this->table)->like('username,prize_name,prize_level');
$query->equal('uncode_status,code')->dateBetween('create_at,uncode_datetime')->page();
$this->title = '中奖记录管理';
$query = $this->_query($this->table)->like('phone,username,prize_name,prize_level');
$query->equal('uncode_status,code')->dateBetween('create_at,uncode_datetime')->order('id desc');
if (input('output') === 'json') {
$result = $query->page(true, false);
$this->success('获取数据列表成功', $result);
} else {
$query->page();
}
}
/**

@ -151,6 +151,7 @@ class Luckdraw extends Controller
$_prize = $this->app->db->name('ActivityLuckdrawPrize')->where(['code' => $prize['prize_code']])->find();
$data = [
'mid' => $this->member['id'],
'phone' => $this->member['phone'],
'username' => $this->member['username'],
'code' => $this->code,
'prize_level' => $prize['prize_level'],
@ -180,4 +181,20 @@ class Luckdraw extends Controller
$result = $this->app->db->name('ActivityLuckdrawRecord')->where(['id' => $this->record['id']])->update($data);
$result !== false ? $this->success('奖品核销成功!') : $this->error('奖品核销失败,请稍候再试!');
}
/**
* 提交收货地址
* @throws \think\db\exception\DbException
*/
public function express()
{
$data = $this->_vali([
'express_province.require#province' => '收货省份不能为空!',
'express_city.require#city' => '收货城市不能为空!',
'express_area.require#area' => '收货区域不能为空!',
'express_address.require#address' => '详细地址不能为空!',
]);
$result = $this->app->db->name('ActivityLuckdrawRecord')->where(['id' => $this->record['id']])->update($data);
$result !== false ? $this->success('提交收货地址成功!') : $this->error('提交收货地址失败,请稍候再试!');
}
}

@ -1,17 +1,17 @@
/*
Navicat MySQL Data Transfer
Source Server : local.ctolog.com
Source Server : server.cuci.cc
Source Server Type : MySQL
Source Server Version : 50562
Source Host : 127.0.0.1:3306
Source Host : localhost:3306
Source Schema : admin_v6
Target Server Type : MySQL
Target Server Version : 50562
File Encoding : 65001
Date: 11/10/2020 18:49:38
Date: 12/10/2020 11:32:03
*/
SET NAMES utf8mb4;
@ -100,6 +100,7 @@ DROP TABLE IF EXISTS `activity_luckdraw_record`;
CREATE TABLE `activity_luckdraw_record` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`mid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '活动会员ID',
`phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '会员手机',
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '会员名称',
`code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '活动编号',
`prize_code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '奖品编号',
@ -112,6 +113,10 @@ CREATE TABLE `activity_luckdraw_record` (
`uncode_code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '奖品核销码',
`uncode_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '奖品核销状态',
`uncode_datetime` datetime NULL DEFAULT NULL COMMENT '奖品核销时间',
`express_province` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '配送省份',
`express_city` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '配送城市',
`express_area` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '配送区域',
`express_address` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '配送地址',
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '销售状态',
`sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重',
`deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
@ -121,7 +126,7 @@ CREATE TABLE `activity_luckdraw_record` (
INDEX `idx_activity_luckdraw_record_code`(`code`) USING BTREE,
INDEX `idx_activity_luckdraw_record_prize_code`(`prize_code`) USING BTREE,
INDEX `idx_activity_luckdraw_record_uncode_state`(`uncode_status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '活动-抽奖中奖记录' ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '活动-抽奖中奖记录' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for data_member
@ -160,7 +165,7 @@ CREATE TABLE `data_member` (
INDEX `idx_data_member_openid1`(`openid1`) USING BTREE,
INDEX `idx_data_member_openid2`(`openid2`) USING BTREE,
INDEX `idx_data_member_unionid`(`unionid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-会员' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-会员' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for data_member_address
@ -184,7 +189,7 @@ CREATE TABLE `data_member_address` (
INDEX `idx_data_member_address_type`(`type`) USING BTREE,
INDEX `idx_data_member_address_code`(`code`) USING BTREE,
INDEX `idx_data_member_address_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-会员-地址' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-会员-地址' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for data_member_coin_item
@ -249,7 +254,7 @@ CREATE TABLE `data_news_item` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_news_item_status`(`status`) USING BTREE,
INDEX `idx_data_news_item_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-文章-内容' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-文章-内容' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for data_news_mark
@ -266,7 +271,7 @@ CREATE TABLE `data_news_mark` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_news_mark_status`(`status`) USING BTREE,
INDEX `idx_data_news_mark_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-文章-标签' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-文章-标签' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for data_news_x_collect
@ -282,7 +287,7 @@ CREATE TABLE `data_news_x_collect` (
INDEX `idx_data_news_x_collect_cid`(`cid`) USING BTREE,
INDEX `idx_data_news_x_collect_mid`(`mid`) USING BTREE,
INDEX `idx_data_news_x_collect_type`(`type`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-文章-会员-收藏' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-文章-会员-收藏' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for data_news_x_comment
@ -311,7 +316,7 @@ CREATE TABLE `data_news_x_history` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_news_x_history_cid`(`cid`) USING BTREE,
INDEX `idx_data_news_x_history_mid`(`mid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-文章-会员-历史' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-文章-会员-历史' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for shop_goods
@ -345,7 +350,7 @@ CREATE TABLE `shop_goods` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_news_item_status`(`status`) USING BTREE,
INDEX `idx_data_news_item_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 38 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-商品-内容' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-商品-内容' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_goods_cate
@ -365,7 +370,7 @@ CREATE TABLE `shop_goods_cate` (
INDEX `idx_shop_goods_cate_sort`(`sort`) USING BTREE,
INDEX `idx_shop_goods_cate_status`(`status`) USING BTREE,
INDEX `idx_shop_goods_cate_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-商品-分类' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-商品-分类' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_goods_item
@ -388,7 +393,7 @@ CREATE TABLE `shop_goods_item` (
INDEX `index_store_goods_list_id`(`goods_code`) USING BTREE,
INDEX `index_store_goods_list_spec`(`goods_spec`) USING BTREE,
INDEX `index_store_goods_list_status`(`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 83 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城-商品-规格' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城-商品-规格' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for shop_goods_mark
@ -404,7 +409,7 @@ CREATE TABLE `shop_goods_mark` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_shop_goods_mark_sort`(`sort`) USING BTREE,
INDEX `idx_shop_goods_mark_status`(`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-商品-标签' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-商品-标签' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_goods_stock
@ -422,7 +427,7 @@ CREATE TABLE `shop_goods_stock` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_news_item_status`(`status`) USING BTREE,
INDEX `idx_data_news_item_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 37 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-商品-库存' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-商品-库存' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_order
@ -458,7 +463,7 @@ CREATE TABLE `shop_order` (
INDEX `idx_shop_order_orderno`(`order_no`) USING BTREE,
INDEX `idx_shop_order_cancel_status`(`cancel_status`) USING BTREE,
INDEX `idx_shop_order_payment_status`(`payment_status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-内容' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-内容' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_order_item
@ -490,7 +495,7 @@ CREATE TABLE `shop_order_item` (
INDEX `idx_shop_order_item_goods_sku`(`goods_sku`) USING BTREE,
INDEX `idx_shop_order_item_goods_code`(`goods_code`) USING BTREE,
INDEX `idx_shop_order_item_goods_spec`(`goods_spec`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-商品' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-商品' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_order_send
@ -525,7 +530,7 @@ CREATE TABLE `shop_order_send` (
INDEX `idx_shop_order_send_status`(`status`) USING BTREE,
INDEX `idx_shop_order_send_deleted`(`deleted`) USING BTREE,
INDEX `idx_shop_order_send_order_no`(`order_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-配送' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-配送' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_order_service
@ -549,7 +554,7 @@ CREATE TABLE `shop_order_service` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_news_item_status`(`status`) USING BTREE,
INDEX `idx_data_news_item_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-售后' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-售后' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_truck_company
@ -572,7 +577,7 @@ CREATE TABLE `shop_truck_company` (
INDEX `idx_shop_truck_company_code3`(`code_3`) USING BTREE,
INDEX `idx_shop_truck_company_status`(`status`) USING BTREE,
INDEX `idx_shop_truck_company_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城-快递-公司' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城-快递-公司' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_truck_province
@ -587,7 +592,7 @@ CREATE TABLE `shop_truck_province` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_store_express_province_title`(`name`) USING BTREE,
INDEX `idx_store_express_province_status`(`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3113 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-快递-省份' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-快递-省份' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for shop_truck_region
@ -608,7 +613,7 @@ CREATE TABLE `shop_truck_region` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_shop_truck_region_pid`(`pid`) USING BTREE,
INDEX `idx_shop_truck_region_name`(`name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 50001 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城-快递-区域' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 4019 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城-快递-区域' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for shop_truck_template
@ -625,6 +630,6 @@ CREATE TABLE `shop_truck_template` (
`deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 198 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-快递-费用' ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 195 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-快递-费用' ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;

@ -10,7 +10,7 @@
<script src="__ROOT__/static/plugs/jquery/jquery.min.js"></script>
<script src="__ROOT__/static/luckdraw/layer.mobile/layer.js"></script>
<script src="__ROOT__/static/luckdraw/lib/swiper/swiper.min.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
window.onresize = function () {
this.deviceWidth = document.documentElement.clientWidth;
@ -19,54 +19,57 @@
};
window.onresize();
var ApiFun = new function () {
let ApiFun = new function () {
this.doDraw = function () {
/* {if empty($member)} */
document.querySelector('#mask1').className = 'mask show';
document.querySelector('.info-dialog').className = 'info-dialog show';
/* {else} */
var index = layer.open({type: 2, content: '抽奖中...'});
$.post('{:url("@data/api.luckdraw/prize/code/".$vo.code)}', {}, function (ret) {
layer.close(index);
return location.reload();
if (ret.code > 0) return location.reload();
return layer.open({
content: ret.info, skin: 'msg', time: 2, end: function () {
location.reload();
}, shade: true
});
let index = layer.open({type: 2, content: '抽奖中...'});
$.post('{:url("@data/app.luckdraw/prize/code/".$vo.code)}', {}, function (ret) {
layer.close(index), location.reload();
});
/* {/if} */
};
/* 补充用户数据 */
/*! 补充用户数据 */
this.doInfo = function () {
var phone = $('#phone').val() || '', username = $('#username').val() || '';
let phone = $('#phone').val() || '', username = $('#username').val() || '';
if (!/.{1}/.test(username)) return layer.open({content: '请输入您的姓名!', skin: 'msg', time: 2, shade: true});
if (!/^1\d{10}$/.test(phone)) return layer.open({content: '请输入正确的手机号!', skin: 'msg', time: 2, shade: true});
var index = layer.open({type: 2, content: '提交中...', shade: true});
$.post('{:url("@data/api.luckdraw/info/code/".$vo.code)}', {phone: phone, username: username}, function (ret) {
let index = layer.open({type: 2, content: '提交中...', shade: true});
$.post('{:url("@data/app.luckdraw/info/code/".$vo.code)}', {phone: phone, username: username}, function (ret) {
layer.close(index);
if (ret.code > 0) return window.location.reload();
return layer.open({content: ret.info, skin: 'msg', time: 2, shade: true});
});
};
/*! 奖品核销码 */
this.doUsed = function () {
var uncode = $('#uncode').val() || '';
let uncode = $('#uncode').val() || '';
if (!uncode) return layer.open({content: '请输入核销码再操作!', skin: 'msg', time: 2, shade: true});
var index = layer.open({type: 2, content: '正在核销奖品...', shade: true});
$.post('{:url("@data/api.luckdraw/used/code/".$vo.code)}', {uncode: uncode}, function (ret) {
let index = layer.open({type: 2, content: '正在核销奖品...', shade: true});
$.post('{:url("@data/app.luckdraw/used/code/".$vo.code)}', {uncode: uncode}, function (ret) {
layer.close(index);
if (ret.code > 0) return location.reload();
return layer.open({content: ret.info, skin: 'msg', time: 2, shade: true});
});
}
/*! 填写收货地址 */
this.doExpress = function () {
let data = {
city: $('[name=city]').val() || '',
area: $('[name=area]').val() || '',
address: $('[name=address]').val() || '',
province: $('[name=province]').val() || '',
};
if (!data.address) return layer.open({content: '收货地址不能为空!', skin: 'msg', time: 2, shade: true});
let index = layer.open({type: 2, content: '正在提交收货地址...', shade: true});
$.post('{:url("@data/app.luckdraw/express/code/".$vo.code)}', data, function (ret) {
layer.close(index);
if (ret.code > 0) return location.reload();
return layer.open({content: ret.info, skin: 'msg', time: 2, shade: true});
});
};
};
(function () {
wx.config(JSON.parse('{$jsoptin|raw}'));
@ -79,9 +82,7 @@
})();
</script>
</head>
<body>
<div class="page index-page">
{if !empty($vo.status) and empty($vo.is_deleted)}
<img src="__ROOT__/static/luckdraw/images/bg2.jpg" alt="一尚美术">
@ -94,7 +95,6 @@
<!-- 已中奖的点击按钮变成 查看奖品 -->
<img class="btn" src="__ROOT__/static/luckdraw/images/yu1.png" alt="查看奖品" onclick="ApiFun.doDraw()">
{/empty}
<!-- 中奖明细 -->
<div class="detail">
<img class="title" src="__ROOT__/static/luckdraw/images/t1.png" alt="中奖明细">
@ -108,7 +108,7 @@
<span>{$vo.username|default=''}</span>
<span>{$vo.prize_level|default='特等奖'}</span>
</div>
<div class="ls-text">{$vo.prize_title|default=''}</div>
<div class="ls-text">{$vo.prize_name|default=''}</div>
</li>
{/foreach}
</ul>
@ -142,19 +142,47 @@
<div class="luck-mask show">
<img onclick="this.parentNode.className='luck-mask'" class="close" src="__ROOT__/static/luckdraw/images/close.png" alt="关闭">
<img src="__ROOT__/static/luckdraw/images/luck.png" alt="中奖了">
<script src="__ROOT__/static/plugs/jquery/pcasunzips.js"></script>
<div class="luck-dialog">
{if $record.prize_code neq ''}
<h1>{$record.prize_level|default='特等奖'}</h1>
<h3>{$record.prize_name|default='未中奖'}</h3>
{if empty($record.uncode_status)}
{if empty($record.uncode_status) && empty($record.express_province)}
<div>
<label>
<input id="uncode" type="text" placeholder="请输入核销码">
</label>
{if empty($record.prize_express)}
<label><input id="uncode" type="text" placeholder="请输入核销码"></label>
<div onclick="ApiFun.doUsed()" class="dialog-btn">确认核销</div>
{else}
<label>
<select name="province"></select>
<select name="city"></select>
<select name="area"></select>
<input name="address" value="{$record.express_address|default=''}" placeholder="请输入详情地址">
</label>
<script>new PCAS('province', 'city', 'area', '{$record.express_province|default=""}', '{$record.express_city|default=""}', '{$record.express_area|default=""}')</script>
<div onclick="ApiFun.doExpress()" class="dialog-btn">提交收货地址</div>
{/if}
</div>
{else}
<!--{if empty($record.prize_express)}-->
<div class="dialog-btn btn1">奖品已核销</div>
<!--{else}-->
<div>
<label>
<select disabled style="background:#ddd">
<option>{$record.express_province|default=''}</option>
</select>
<select disabled style="background:#ddd">
<option>{$record.express_city|default=''}</option>
</select>
<select disabled style="background:#ddd">
<option>{$record.express_area|default=''}</option>
</select>
<input disabled style="background:#ddd" value="{$record.express_address}" placeholder="请输入详情地址">
</label>
<div class="dialog-btn btn1">已提交收货地址</div>
</div>
<!--{/if}-->
{/if}
{else}
<div class="dialog-btn btn1">未中奖</div>
@ -168,10 +196,9 @@
<img onclick="this.parentNode.className='rule-mask'" class="close" src="__ROOT__/static/luckdraw/images/close.png" alt="关闭">
<div class="rule-dialog">
<h1 class="dialog-title">活动规则</h1>
<div class="rule-content">{foreach $rules as $r}<p>{$r}</p>{/foreach}</div>
<div class="rule-content">{foreach $rules as $rule}<p>{$rule}</p>{/foreach}</div>
</div>
</div>
{else}
<script>
alert('活动已经结束');
@ -181,63 +208,46 @@
</script>
{/if}
<!-- script -->
<script>
// 显示活动规则
/*! 显示活动规则 */
function showRule() {
document.querySelector('.rule-mask').className = 'rule-mask show';
};
}
// 显示填写信息弹窗
function draw() {
/*! 显示信息弹窗 */
function showDraw() {
document.querySelector('#mask1').className = 'mask show';
document.querySelector('.info-dialog').className = 'info-dialog show';
};
}
// 隐藏填写信息弹窗
/*! 隐藏信息弹窗 */
function hideDraw() {
document.querySelector('#mask1').className = 'mask';
document.querySelector('.info-dialog').className = 'info-dialog';
};
}
// 显示中奖
/*! 显示中奖弹窗 */
function showLuck() {
document.querySelector('.luck-mask').className = 'luck-mask show';
};
}
window.onload = function () {
var winH = document.body.clientHeight; // 可视区高度
var n = 4; // 列表默认个数
// 根据不同屏幕高度改变列表高度+数据个数
let number = 4; /* 列表默认个数 */
let winH = document.body.clientHeight || 720;
/*! 不同屏幕高度改变列表高度 + 数据个数 */
if (winH > 720) {
n = parseInt(winH / 130);
document.querySelector('.index-page .ls-box').style.height = (n * 0.82) + 'rem';
document.querySelector('.index-page .ls-box').style.height = (winH / 130 * 0.82).toFixed(2) + 'rem';
}
// 列表轮播默认参数,默认不自动轮播
var option = {
direction: 'vertical',
slidesPerView: n,
};
// 列表数据个数
var len = document.querySelectorAll('.ls-box li').length;
// 列表数量大于默认数量 循环+自动轮播
if (len > n) {
option.autoplay = {
delay: 1500,
disableOnInteraction: false,
}
/*! 列表轮播默认参数,默认不自动轮播 */
let option = {direction: 'vertical', slidesPerView: number};
/*! 列表数量大于默认数量 循环 + 自动轮播 */
if (document.querySelectorAll('.ls-box li').length > number) {
option.loop = true;
option.autoplay = {delay: 1500, disableOnInteraction: false}
}
// swiper 轮播实例化
/*! Swiper 轮播实例化 */
new Swiper('.swiper-container', option);
}
};
</script>
</body>
</html>

@ -7,7 +7,7 @@
<td class="padding-0">
<select name='prize_code[]' class="layui-select full-width border-0" lay-ignore>
{foreach $prizes as $prize}
<option value="{$prize.code}">{$prize.name}</option>
<option value="{$prize.code}">{$prize.code} {$prize.name}</option>
{/foreach}
</select>
</td>
@ -64,7 +64,7 @@
<thead>
<tr>
<th class="nowrap">奖品名称</th>
<th class="nowrap text-center" style="width:200px">奖项名称</th>
<th class="nowrap text-center" style="width:200px">奖项等级</th>
<th class="nowrap text-center" style="width:120px">奖品数量</th>
<th class="nowrap text-center" style="width:100px">中奖率(总概率100%)</th>
<th style="width:100px"></th>
@ -77,9 +77,9 @@
<select name='prize_code[]' class="layui-select full-width border-0" lay-ignore>
{foreach $prizes as $prize}
{if $pz.prize_code eq $prize.code}
<option selected value="{$prize.code}">{$prize.name}</option>
<option selected value="{$prize.code}">{$prize.code} {$prize.name}</option>
{else}
<option value="{$prize.code}">{$prize.name}</option>
<option value="{$prize.code}">{$prize.code} {$prize.name}</option>
{/if}{/foreach}
</select>
</td>

@ -15,7 +15,7 @@
<th class='text-left nowrap'>活动信息</th>
<th class='text-left nowrap'>奖品信息</th>
<th class='text-left nowrap'>中奖时间</th>
<th class='text-left nowrap'>核销时间</th>
<th class='text-left nowrap'>核销信息</th>
</tr>
</thead>
{/notempty}
@ -27,9 +27,7 @@
</td>
<td class='text-left nowrap'>
{$vo.username|default=''}
{notempty name='vo.member.phone'}
<span class="margin-left-5 layui-badge layui-bg-gray">{$vo.member.phone|default=''}</span>
{/notempty}
<span class="margin-left-5 layui-badge layui-bg-gray">{$vo.phone|default=''}</span>
</td>
<td class='text-left nowrap'>{$vo.info.name|default=''}</td>
<td class='text-left nowrap'>
@ -42,7 +40,12 @@
{$vo.create_at|format_datetime}
</td>
<td class='text-left nowrap'>
{if empty($vo.prize_express)}
{$vo.uncode_datetime|default='未核销'}
{else}
{$vo.express_province|default=''}{$vo.express_city|default=''}{$vo.express_area|default=''}
{$vo.express_address|default=''}
{/if}
</td>
</tr>
{/foreach}

@ -6,21 +6,28 @@
<div class="layui-form-item layui-inline">
<label class="layui-form-label">中奖姓名</label>
<div class="layui-input-inline">
<label class="layui-input-inline">
<input name="username" value="{:input('username','')}" placeholder="请输入中奖姓名" class="layui-input">
</div>
</label>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">中奖手机</label>
<label class="layui-input-inline">
<input name="phone" value="{:input('phone','')}" placeholder="请输入中奖手机" class="layui-input">
</label>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">中奖级别</label>
<div class="layui-input-inline">
<label class="layui-input-inline">
<input name="prize_level" value="{:input('prize_level','')}" placeholder="请输入中奖级别" class="layui-input">
</div>
</label>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">活动名称</label>
<div class="layui-input-inline">
<label class="layui-input-inline">
<select class="layui-select" name="code" lay-search>
<option value="">- 全部记录 -</option>
{foreach $prizes as $k => $v}
@ -30,12 +37,12 @@
<option value="{$v.code}">{$v.name}</option>
{/if}{/foreach}
</select>
</div>
</label>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">核销状态</label>
<div class="layui-input-inline">
<label class="layui-input-inline">
<select class="layui-select" name="uncode_status">
{foreach [''=>'-- 全部 --','0'=>'未核销的奖品','1'=>'已核销的奖品'] as $k=>$v}
{if input('uncode_status') eq $k.''}
@ -44,25 +51,28 @@
<option value="{$k}">{$v}</option>
{/if}{/foreach}
</select>
</div>
</label>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">中奖时间</label>
<div class="layui-input-inline">
<label class="layui-input-inline">
<input data-date-range name="create_at" value="{:input('create_at','')}" placeholder="请选择中奖时间" class="layui-input">
</div>
</label>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">核销时间</label>
<div class="layui-input-inline">
<label class="layui-input-inline">
<input data-date-range name="uncode_datetime" value="{:input('uncode_datetime','')}" placeholder="请选择核销时间" class="layui-input">
</div>
</label>
</div>
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
<button type="submit" class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
<button type="button" data-form-export="{:url('index')}" class="layui-btn layui-btn-primary">
<i class="layui-icon layui-icon-export"></i>
</button>
</div>
</form>
@ -70,4 +80,26 @@
<script>
window.form.render();
require(['excel'], function (excel) {
excel.bind(function (data) {
data.forEach(function (item, index) {
data[index] = [
item.username,
item.phone,
item.info.code || '',
item.info.name || '',
item.prize_code || '',
item.prize_name || '',
item.prize_level || '',
item.create_at,
item.prize_express ? '需要发货' : '不需要发货',
item.prize_express ?
(item.express_province || '') + (item.express_city || '') + (item.express_area || '') + (item.express_address || '') :
(item.uncode_status ? '已核销' : '未核销'),
];
});
data.unshift(['中奖姓名', '中奖手机', '活动编号', '活动名称', '奖品编号', '奖品名称', '奖品等级', '中奖时间', '是否需要发货', '收货地址']);
return data;
}, '中奖记录数据');
});
</script>

@ -442,35 +442,49 @@ body {
.luck-dialog h3 {
font-size: .36rem;
color: #ffe100;
margin-bottom: .8rem;
margin-bottom: .4rem;
}
.luck-dialog input {
font-size: .26rem;
display: block;
width: 4.7rem;
.luck-dialog label {
width: 6.5rem;
display: inline-block;
position: relative;
}
.luck-dialog input,
.luck-dialog select {
width: 78%;
height: .8rem;
display: block;
font-size: .26rem;
line-height: .4rem;
background: #fff;
border-radius: .8rem;
border-radius: .1rem;
margin: 0 auto .4rem;
text-align: left;
padding-left: .3rem;
}
.luck-dialog select {
width: 25.2%;
text-align: center;
margin-bottom: .1rem;
display: inline-block;
}
.luck-dialog .dialog-btn {
width: 4.7rem;
line-height: .8rem;
border-radius: .8rem;
margin: 0 auto;
font-size: .3rem;
line-height: .8rem;
border-radius: .8rem;
color: #dd0d1d;
background: #ffe100;
}
.luck-dialog .btn1 {
background: #fff0e8;
color: #dd0d1d;
background: #fff0e8;
}
.show.luck-mask,

@ -1,177 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>标题</title>
<link rel="stylesheet" href="./lib/swiper/swiper.min.css">
<link rel="stylesheet" href="./css/style.css">
<script>
fontsize();
window.onresize = function () {
fontsize();
};
function fontsize() {
var deviceWidth = document.documentElement.clientWidth;
if (deviceWidth > 640) deviceWidth = 640;
document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px'; // 750 设计稿
};
</script>
</head>
<body>
<div class="page index-page">
<img src="./images/bg2.jpg" alt="一尚美术">
<div class="page-body">
<img onclick="showRule()" class="rule" src="./images/rule.png" alt="活动规则">
<!-- 抽奖按钮 -->
<img class="btn" src="./images/yu.png" alt="点我抽奖" onclick="draw()">
<!-- 已中奖的点击按钮变成 查看奖品 -->
<!-- <img class="btn" src="./images/yu1.png" alt="查看奖品" > -->
<!-- 中奖明细 -->
<div class="detail">
<img class="title" src="./images/t1.png" alt="中奖明细">
<div>
<!-- <img class="icon1" src="./images/icon1.png" alt="一尚美术">
<img class="icon1 icon2" src="./images/icon1.png" alt="一尚美术"> -->
<div class="swiper-container ls-box">
<img class="icon1" src="./images/icon1.png" alt="一尚美术">
<img class="icon1 icon2" src="./images/icon1.png" alt="一尚美术">
<ul class="swiper-wrapper">
<li class="swiper-slide">
<div class="ls-title">
<span>林烨林</span>
<span>获得一等奖</span>
</div>
<div class="ls-text">多功能数据线1条</div>
</li>
<li class="swiper-slide">
<div class="ls-title">
<span>林烨林</span>
<span>获得一等奖</span>
</div>
<div class="ls-text">多功能数据线2条</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- 填写信息 -->
<div id="mask1" class="mask" onclick="hideDraw()"></div>
<div class="info-dialog">
<h2>填写信息即可参与抽奖哦~</h2>
<div class="form">
<label>
<span>您的姓名:</span>
<input type="text" maxlength="20">
</label>
<label>
<span>手机号码:</span>
<input type="tel" maxlength="11">
</label>
</div>
<div class="btns">
<span onclick="hideDraw()">取消</span>
<span onclick="showLuck()">确认</span>
</div>
</div>
<!-- 中奖弹窗 -->
<div class="luck-mask">
<img onclick="this.parentNode.className='luck-mask'" class="close" src="./images/close.png" alt="关闭">
<img src="./images/luck.png" alt="中奖了">
<div class="luck-dialog">
<h1>一等奖</h1>
<h3>蓝牙音箱一台</h3>
<div>
<input type="text" placeholder="请输入核销码">
<div class="dialog-btn">确认核销</div>
</div>
<!-- 奖品已核销 -->
<div class="dialog-btn btn1 hide">奖品已核销</div>
</div>
</div>
<!-- 规则说明 -->
<div class="rule-mask">
<img onclick="this.parentNode.className='rule-mask'" class="close" src="./images/close.png" alt="关闭">
<div class="rule-dialog">
<h1 class="dialog-title">活动规则</h1>
<div class="rule-content">
<p>这是内容这是内容这是内容这是内容这是内容这是内容</p>
</div>
</div>
</div>
<!-- script -->
<script src="./lib/swiper/swiper.min.js"></script>
<script>
// 显示活动规则
function showRule() {
document.querySelector('.rule-mask').className = 'rule-mask show';
};
// 显示填写信息弹窗
function draw() {
document.querySelector('#mask1').className = 'mask show';
document.querySelector('.info-dialog').className = 'info-dialog show';
};
// 隐藏填写信息弹窗
function hideDraw() {
document.querySelector('#mask1').className = 'mask';
document.querySelector('.info-dialog').className = 'info-dialog';
};
// 显示中奖
function showLuck() {
document.querySelector('.luck-mask').className = 'luck-mask show';
};
window.onload = function () {
var winH = document.body.clientHeight; // 可视区高度
var n = 5; // 列表默认5个数据
// 根据不同屏幕高度改变列表高度+数据个数
if (winH > 645) {
n = parseInt(winH / 100);
document.querySelector('.index-page .ls-box').style.height = (n * 0.92) + 'rem';
}
// 列表轮播默认参数,默认不自动轮播
var option = {
direction: 'vertical',
slidesPerView: n,
};
// 列表数据个数
var len = document.querySelectorAll('.ls-box li').length;
// 列表数量大于默认数量 循环+自动轮播
if (len > n) {
option.autoplay = {
delay: 5000,
disableOnInteraction: false,
}
option.loop = true;
}
// swiper 轮播实例化
new Swiper('.swiper-container', option);
}
</script>
</body>
</html>

@ -194,6 +194,9 @@ return array(
'app\\admin\\controller\\api\\Update' => $baseDir . '/app/admin/controller/api/Update.php',
'app\\admin\\controller\\api\\Upload' => $baseDir . '/app/admin/controller/api/Upload.php',
'app\\data\\controller\\Config' => $baseDir . '/app/data/controller/Config.php',
'app\\data\\controller\\LuckdrawConfig' => $baseDir . '/app/data/controller/LuckdrawConfig.php',
'app\\data\\controller\\LuckdrawPrize' => $baseDir . '/app/data/controller/LuckdrawPrize.php',
'app\\data\\controller\\LuckdrawRecord' => $baseDir . '/app/data/controller/LuckdrawRecord.php',
'app\\data\\controller\\Member' => $baseDir . '/app/data/controller/Member.php',
'app\\data\\controller\\NewsItem' => $baseDir . '/app/data/controller/NewsItem.php',
'app\\data\\controller\\NewsMark' => $baseDir . '/app/data/controller/NewsMark.php',
@ -217,6 +220,7 @@ return array(
'app\\data\\controller\\api\\auth\\Center' => $baseDir . '/app/data/controller/api/auth/Center.php',
'app\\data\\controller\\api\\auth\\News' => $baseDir . '/app/data/controller/api/auth/News.php',
'app\\data\\controller\\api\\auth\\Order' => $baseDir . '/app/data/controller/api/auth/Order.php',
'app\\data\\controller\\app\\Luckdraw' => $baseDir . '/app/data/controller/app/Luckdraw.php',
'app\\data\\service\\GoodsService' => $baseDir . '/app/data/service/GoodsService.php',
'app\\data\\service\\NewsService' => $baseDir . '/app/data/service/NewsService.php',
'app\\data\\service\\OrderService' => $baseDir . '/app/data/service/OrderService.php',

@ -317,6 +317,9 @@ class ComposerStaticInit33b66ed99ea8fcca84c95dfb0e7ed409
'app\\admin\\controller\\api\\Update' => __DIR__ . '/../..' . '/app/admin/controller/api/Update.php',
'app\\admin\\controller\\api\\Upload' => __DIR__ . '/../..' . '/app/admin/controller/api/Upload.php',
'app\\data\\controller\\Config' => __DIR__ . '/../..' . '/app/data/controller/Config.php',
'app\\data\\controller\\LuckdrawConfig' => __DIR__ . '/../..' . '/app/data/controller/LuckdrawConfig.php',
'app\\data\\controller\\LuckdrawPrize' => __DIR__ . '/../..' . '/app/data/controller/LuckdrawPrize.php',
'app\\data\\controller\\LuckdrawRecord' => __DIR__ . '/../..' . '/app/data/controller/LuckdrawRecord.php',
'app\\data\\controller\\Member' => __DIR__ . '/../..' . '/app/data/controller/Member.php',
'app\\data\\controller\\NewsItem' => __DIR__ . '/../..' . '/app/data/controller/NewsItem.php',
'app\\data\\controller\\NewsMark' => __DIR__ . '/../..' . '/app/data/controller/NewsMark.php',
@ -340,6 +343,7 @@ class ComposerStaticInit33b66ed99ea8fcca84c95dfb0e7ed409
'app\\data\\controller\\api\\auth\\Center' => __DIR__ . '/../..' . '/app/data/controller/api/auth/Center.php',
'app\\data\\controller\\api\\auth\\News' => __DIR__ . '/../..' . '/app/data/controller/api/auth/News.php',
'app\\data\\controller\\api\\auth\\Order' => __DIR__ . '/../..' . '/app/data/controller/api/auth/Order.php',
'app\\data\\controller\\app\\Luckdraw' => __DIR__ . '/../..' . '/app/data/controller/app/Luckdraw.php',
'app\\data\\service\\GoodsService' => __DIR__ . '/../..' . '/app/data/service/GoodsService.php',
'app\\data\\service\\NewsService' => __DIR__ . '/../..' . '/app/data/service/NewsService.php',
'app\\data\\service\\OrderService' => __DIR__ . '/../..' . '/app/data/service/OrderService.php',

2
vendor/services.php vendored

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2020-10-10 14:50:33
// This file is automatically generated at:2020-10-12 11:32:23
declare (strict_types = 1);
return array (
0 => 'think\\admin\\Library',