@ -0,0 +1,350 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Consumption { |
|||
|
|||
static function creditshop_adv_get($status = -1) { |
|||
global $_W; |
|||
$condition = " where uniacid = :uniacid"; |
|||
$params = array(":uniacid" => $_W["uniacid"]); |
|||
if ($status != -1) { |
|||
$condition .= " and status = " . $status; |
|||
} |
|||
$data = pdo_fetchall("select * from" . tablename("wlmerchant_consumption_adv") . " " . $condition . " order by displayorder desc", $params); |
|||
if (!empty($data)) { |
|||
foreach ($data as &$value) { |
|||
$value["thumb"] = tomedia($value["thumb"]); |
|||
} |
|||
} |
|||
return $data; |
|||
} |
|||
|
|||
static function creditshop_can_exchange_goods($idOrGoods, $uid = "") { |
|||
global $_W; |
|||
$goods = $idOrGoods; |
|||
if (!is_array($goods)) { |
|||
$goods = creditshop_goods_get($goods); |
|||
} |
|||
if (empty($goods)) { |
|||
return error(-1, "商品不存在!"); |
|||
} |
|||
if (empty($uid)) { |
|||
$uid = $_W["member"]["uid"]; |
|||
} |
|||
$records_num = pdo_fetchcolumn("select count(*) FROM " . tablename("wlmerchant_consumption_order") . " where uniacid = :uniacid and uid = :uid and goods_id = :goods_id ", array(":uniacid" => $_W["uniacid"], "uid" => $uid, ":goods_id" => $goods["id"])); |
|||
if ($goods["chance"] <= $records_num) { |
|||
return error(-2, "兑换已达最大次数!"); |
|||
} |
|||
return error(0, "可以兑换!"); |
|||
} |
|||
|
|||
static function creditshop_category_get($status = -1) { |
|||
global $_W; |
|||
$condition = " where uniacid = :uniacid"; |
|||
$params = array(":uniacid" => $_W["uniacid"]); |
|||
if ($status != -1) { |
|||
$condition .= " and status = " . $status; |
|||
} |
|||
$data = pdo_fetchall("select * from " . tablename("wlmerchant_consumption_category") . " " . $condition . " order by displayorder desc", $params); |
|||
if (!empty($data)) { |
|||
foreach ($data as &$value) { |
|||
$value["thumb"] = tomedia($value["thumb"]); |
|||
} |
|||
} |
|||
return $data; |
|||
} |
|||
|
|||
static function creditshop_goodsall_get($filter = array( )) { |
|||
global $_W; |
|||
global $_GPC; |
|||
if (empty($filter)) { |
|||
if (!empty($_GPC["type"])) { |
|||
$filter["type"] = trim($_GPC["type"]); |
|||
} |
|||
if (!empty($_GPC["title"])) { |
|||
$filter["title"] = trim($_GPC["title"]); |
|||
} |
|||
if (!empty($_GPC["category_id"])) { |
|||
$filter["category_id"] = intval($_GPC["category_id"]); |
|||
} |
|||
} |
|||
if (empty($filter["page"])) { |
|||
$filter["page"] = max(1, $_GPC["page"]); |
|||
} |
|||
if (empty($filter["psize"])) { |
|||
$filter["psize"] = (intval($_GPC["psize"]) ? intval($_GPC["psize"]) : 20); |
|||
} |
|||
$condition = " where uniacid = :uniacid and status = 1"; |
|||
$params = array(":uniacid" => $_W["uniacid"]); |
|||
if (!empty($filter["type"])) { |
|||
$condition .= " and type = :type"; |
|||
$params[":type"] = $filter["type"]; |
|||
} |
|||
if (!empty($filter["title"])) { |
|||
$condition .= " AND title LIKE '%" . $filter["title"] . "%'"; |
|||
} |
|||
if (!empty($filter["category_id"])) { |
|||
$condition .= " and category_id = :category_id"; |
|||
$params[":category_id"] = $filter["category_id"]; |
|||
} |
|||
//判断会员 |
|||
$halfmember = Member::checkhalfmember(); |
|||
|
|||
$data = pdo_fetchall("SELECT * FROM " . tablename("wlmerchant_consumption_goods") . " " . $condition . " ORDER BY displayorder DESC LIMIT " . ($filter["page"] - 1) * $filter["psize"] . ", " . $filter["psize"], $params); |
|||
if (!empty($data)) { |
|||
foreach ($data as &$value) { |
|||
$value["thumb"] = tomedia($value["thumb"]); |
|||
if ($value["type"] == "redpacket") { |
|||
$value["redpacket"] = iunserializer($value["redpacket"]); |
|||
} |
|||
if($halfmember && $value['vipstatus'] == 1){ |
|||
$value['use_credit1'] = $value['vipcredit1']; |
|||
$value['use_credit2'] = $value['vipcredit2']; |
|||
} |
|||
} |
|||
} |
|||
return $data; |
|||
} |
|||
|
|||
static function creditshop_goods_get($goods_id) { |
|||
global $_W; |
|||
if (empty($goods_id)) { |
|||
return error(-1, "请输入商品编号"); |
|||
} |
|||
$data = pdo_get("wlmerchant_consumption_goods", array("uniacid" => $_W["uniacid"], "id" => $goods_id)); |
|||
$data["records_num"] = pdo_fetchcolumn("select count(*) FROM " . tablename("wlmerchant_consumption_order") . " where uniacid = :uniacid and goods_id = :goods_id ", array(":uniacid" => $_W["uniacid"], ":goods_id" => $goods_id)); |
|||
if (!empty($data)) { |
|||
$data["thumb"] = tomedia($data["thumb"]); |
|||
} |
|||
return $data; |
|||
} |
|||
|
|||
static function creditshop_record_get($filter = array( )) { |
|||
global $_W; |
|||
global $_GPC; |
|||
if (empty($filter)) { |
|||
if (!empty($_GPC["id"])) { |
|||
$filter["goods_id"] = intval($_GPC["id"]); |
|||
} else { |
|||
return error(-1, "请输入商品编号"); |
|||
} |
|||
} |
|||
if (empty($filter["page"])) { |
|||
$filter["page"] = max(1, $_GPC["page"]); |
|||
} |
|||
if (empty($filter["psize"])) { |
|||
$filter["psize"] = (intval($_GPC["psize"]) ? intval($_GPC["psize"]) : 15); |
|||
} |
|||
$data = pdo_fetchall("select a.addtime, b.avatar, b.nickname FROM " . tablename("wlmerchant_consumption_order") . " as a left join " . tablename("tiny_wmall_members") . " as b on a.uid = b.uid where a.uniacid = :uniacid and a.goods_id = :goods_id limit " . ($filter["page"] - 1) * $filter["psize"] . ", " . $filter["psize"], array(":uniacid" => $_W["uniacid"], ":goods_id" => $filter["goods_id"])); |
|||
if (!empty($data)) { |
|||
foreach ($data as &$value) { |
|||
$value["addtime"] = date("Y/m/d H:i", $value["addtime"]); |
|||
} |
|||
} |
|||
return $data; |
|||
} |
|||
|
|||
static function creditshop_order_get($id) { |
|||
global $_W; |
|||
$data = pdo_get("wlmerchant_consumption_order", array("uniacid" => $_W["uniacid"], "id" => $id)); |
|||
if (!empty($data)) { |
|||
$data["data"] = iunserializer($data["data"]); |
|||
$data["addtime"] = date("Y/m/d H:i", $data["addtime"]); |
|||
$goods = creditshop_goods_get($data["goods_id"]); |
|||
$data["goods_info"] = $goods; |
|||
} |
|||
return $data; |
|||
} |
|||
|
|||
static function creditshop_orderall_get($filter = array( )) { |
|||
global $_W; |
|||
global $_GPC; |
|||
if (empty($filter["page"])) { |
|||
$filter["page"] = max(1, $_GPC["page"]); |
|||
} |
|||
if (empty($filter["psize"])) { |
|||
$filter["psize"] = (intval($_GPC["psize"]) ? intval($_GPC["psize"]) : 6); |
|||
} |
|||
$condition = " where a.uniacid = :uniacid and a.uid = :uid"; |
|||
$params = array(":uniacid" => $_W["uniacid"], ":uid" => $_W["member"]["uid"]); |
|||
$data = pdo_fetchall("select a.*, c.title, c.thumb from " . tablename("wlmerchant_consumption_order") . " as a left join " . tablename("wlmerchant_consumption_goods") . " as c on a.goods_id = c.id " . $condition . " order by a.id desc limit " . ($filter["page"] - 1) * $filter["psize"] . ", " . $filter["psize"], $params); |
|||
if (!empty($data)) { |
|||
foreach ($data as &$value) { |
|||
$value["addtime"] = date("Y/m/d H:i", $value["addtime"]); |
|||
$value["data"] = iunserializer($value["data"]); |
|||
$value["thumb"] = tomedia($value["thumb"]); |
|||
} |
|||
} |
|||
return $data; |
|||
} |
|||
|
|||
static function creditshop_order_update($orderOrId, $type, $extra = array( )) { |
|||
global $_W; |
|||
$order = $orderOrId; |
|||
if (!is_array($order)) { |
|||
$order = creditshop_order_get($order); |
|||
} |
|||
if (empty($order)) { |
|||
return error(-1, "商品不存在!"); |
|||
} |
|||
if ($type == "pay") { |
|||
$update = array("is_pay" => 1, "pay_type" => $extra["type"], "paytime" => TIMESTAMP); |
|||
pdo_update("wlmerchant_consumption_order", $update, array("id" => $order["id"])); |
|||
if ($order["goods_type"] == "redpacket") { |
|||
mload() -> model("redPacket"); |
|||
$redpacket = $order["data"]["redpacket"]; |
|||
$data = array("title" => $redpacket["name"], "channel" => "creditShop", "type" => "grant", "discount" => $redpacket["discount"], "days_limit" => $redpacket["use_days_limit"], "grant_days_effect" => $redpacket["grant_days_effect"], "condition" => $redpacket["condition"], "uid" => $order["uid"]); |
|||
$res = redPacket_grant($data); |
|||
if ($res) { |
|||
pdo_update("wlmerchant_consumption_order", array("grant_status" => 1), array("id" => $order["id"])); |
|||
return NULL; |
|||
} |
|||
} else { |
|||
if ($order["goods_type"] == "credit2") { |
|||
$res = member_credit_update($order["uid"], "credit2", $order["data"]["credit2"]); |
|||
if ($res) { |
|||
pdo_update("wlmerchant_consumption_order", array("grant_status" => 1), array("id" => $order["id"])); |
|||
return NULL; |
|||
} |
|||
} |
|||
} |
|||
} else { |
|||
if ($type == "handle") { |
|||
if ($order["status"] == 1) { |
|||
pdo_update("wlmerchant_consumption_order", array("status" => 2), array("id" => $order["id"])); |
|||
return NULL; |
|||
} |
|||
} else { |
|||
if ($type == "cancel" && $order["is_pay"] == 0 && $order["status"] == 1 && 0 < $order["use_credit1"] && $order["use_credit1_status"] == 1 && 0 < $order["use_credit2"]) { |
|||
$status = member_credit_update($order["uid"], "credit1", $order["use_credit1"]); |
|||
if (is_error($status)) { |
|||
imessage(-1, $status["message"], "", "ajax"); |
|||
} |
|||
pdo_update("wlmerchant_consumption_order", array("status" => 3), array("id" => $order["id"])); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 异步支付结果回调 ,处理业务逻辑 |
|||
* |
|||
* @access public |
|||
* @name |
|||
* @param mixed 参数一的说明 |
|||
* @return array |
|||
*/ |
|||
static function payconsumOrderNotify($params){ |
|||
global $_W; |
|||
Util::wl_log('payResult_notify',PATH_PLUGIN."bargain/data/", $params); //写入异步日志记录 |
|||
$order_out = pdo_fetch("select * from".tablename(PDO_NAME.'order')."where orderno='{$params['tid']}'"); |
|||
$activeInfo = self::creditshop_goods_get($order_out['fkid']); |
|||
$data = self::getPayData($params,$order_out); //得到支付参数,处理代付 |
|||
if($order_out['status'] == 0){ |
|||
$_W['aid'] = $order_out['aid']; |
|||
if($activeInfo['type'] == 'credit2' || $activeInfo['type'] == 'halfcard'){ |
|||
$data['status'] = 3; |
|||
$status = 3; |
|||
}else{ |
|||
$data['status'] = 8; |
|||
$status = 1; |
|||
} |
|||
//分销 分销 |
|||
if(p('distribution') && $activeInfo['isdistri']){ |
|||
$_W['aid'] = $order_out['aid']; |
|||
if($order_out['expressid']){ |
|||
$expressprice = pdo_getcolumn(PDO_NAME.'express',array('id'=>$order_out['expressid']),'expressprice'); |
|||
}else { |
|||
$expressprice = 0; |
|||
} |
|||
$dismoney = sprintf("%.2f",$order_out['price'] - $expressprice); |
|||
$disorderid = Distribution::disCore($order_out['mid'],$dismoney,$activeInfo['onedismoney'],$activeInfo['twodismoney'],0,$order_out['id'],'consumption',$activeInfo['dissettime']); |
|||
$data['disorderid'] = $disorderid; |
|||
} |
|||
//创建记录 |
|||
if($activeInfo['type'] == 'credit2'){ |
|||
$res = Member::credit_update_credit2($order_out['mid'],$activeInfo['credit2'],'兑换['.$activeInfo['title'].']获得余额'); |
|||
}else if($activeInfo['type'] == 'halfcard'){ |
|||
$res = self::conhalfcard($order_out['mid'],$activeInfo['halfcardid'],$order_out['name']); |
|||
}else{ |
|||
$res = 1; |
|||
} |
|||
if($res){ |
|||
$recorddata = array( |
|||
'uniacid' => $order_out['uniacid'], |
|||
'mid' => $order_out['mid'], |
|||
'goodsid' => $activeInfo['id'], |
|||
'orderid' => $order_out['id'], |
|||
'createtime' => time(), |
|||
'status' => $status, |
|||
'integral' => $activeInfo['use_credit1'], |
|||
'money' => $activeInfo['use_credit2'], |
|||
'expressid' => $order_out['expressid'] |
|||
); |
|||
$res3 = pdo_insert(PDO_NAME.'consumption_record',$recorddata); |
|||
} |
|||
pdo_update(PDO_NAME.'order',$data, array('orderno' => $params['tid'])); //更新订单状态 |
|||
$url = h5_url('pages/subPages/orderList/orderList'); |
|||
$jftext = $_W['wlsetting']['trade']['credittext']?$_W['wlsetting']['trade']['credittext']:'积分'; |
|||
$messagedata = array( |
|||
'first' => '恭喜您,一个商品兑换成功', |
|||
'type' => $jftext.'兑换',//业务类型 |
|||
'content' => '商品名:['.$activeInfo['title'].']' ,//业务内容 |
|||
'status' => '已完成' ,//处理结果 |
|||
'time' => date('Y-m-d H:i:s',time()),//操作时间 |
|||
'remark' => '点击查看兑换记录,如有问题请联系管理员' |
|||
); |
|||
TempModel::sendInit('service',$order_out['mid'],$messagedata,$_W['source'],$url); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
static function getPayData($params,$order_out){ |
|||
$data = array('status' => $params['result'] == 'success' ? 1 : 0); |
|||
if($params['is_usecard']==1){ |
|||
$fee = $params['card_fee']; |
|||
$data['is_usecard'] = 1; |
|||
}else{ |
|||
$fee = $params['fee']; |
|||
} |
|||
//$paytype = array('credit' => 1, 'wechat' => 2, 'alipay' => 3, 'delivery' => 4, 'wxapp' => 5); |
|||
$data['paytype'] = $params['type']; |
|||
if ($params['tag']['transaction_id']) $data['transid'] = $params['tag']['transaction_id']; |
|||
$data['paytime'] = TIMESTAMP; |
|||
$data['price'] = $fee; |
|||
$data['createtime'] = TIMESTAMP; |
|||
SingleMerchant::updateAmount($fee, $order_out['sid'],$order_out['id'],1,'订单支付成功'); |
|||
return $data; |
|||
} |
|||
|
|||
static function payconsumOrderReturn($params,$backurl=false){ |
|||
Util::wl_log('payResult_return',PATH_PLUGIN."bargain/data/", $params);//写入日志记录 |
|||
$order_out = pdo_get(PDO_NAME.'order',array('orderno'=>$params['tid']),array('id')); |
|||
wl_message('支付成功',h5_url('pages/mainPages/paySuccess/paySuccess',['id'=>$order_out['id'],'type'=>9]),'success'); |
|||
} |
|||
|
|||
static function conhalfcard($mid,$halfcardid,$username){ |
|||
global $_W; |
|||
$halfcard = pdo_get('wlmerchant_halfcard_type',array('id' => $halfcardid)); |
|||
$limittime = time() + $halfcard['days']*24*3600; |
|||
if($halfcard){ |
|||
if(empty($halfcard['aid'])){ |
|||
$halfcard['aid'] = $_W['aid']; |
|||
} |
|||
$halfcarddata = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => $halfcard['aid'], |
|||
'mid' => $mid, |
|||
'expiretime' => $limittime, |
|||
'username' => $username, |
|||
'levelid' => $halfcard['levelid'], |
|||
'createtime' => time() |
|||
); |
|||
$res = pdo_insert(PDO_NAME.'halfcardmember',$halfcarddata); |
|||
} |
|||
return $res; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[积分商城]]></name> |
|||
<identifie><![CDATA[consumption]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[interact]]></type> |
|||
<description><![CDATA[积分兑换商城,对接第三方,玩儿法活动模板更多]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="false" /> |
|||
<system embed="true" /> |
|||
</setting> |
|||
<agentmenu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="商品" font="fa-inbox"> |
|||
<entry title="商品列表" ac="goods" do="goods_list" /> |
|||
<entry title="商品分类" ac="category" do="cate_list" /> |
|||
<entry title="幻灯片" ac="adv" do="adv_list" /> |
|||
</menu> |
|||
<menu title="记录" font="fa-inbox"> |
|||
<entry title="兑换记录" ac="order" do="record" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="系统设置" ac="consumptionset" do="consumptionapi" iscover="true" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,63 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Adv_WeliamController { |
|||
|
|||
public function adv_list() { |
|||
global $_W, $_GPC; |
|||
if ($_W["ispost"]) { |
|||
if (!empty($_GPC["ids"])) { |
|||
foreach ($_GPC["ids"] as $k => $v) { |
|||
$data = array("advname" => trim($_GPC["advnames"][$k]), "displayorder" => intval($_GPC["displayorders"][$k]), "status" => !empty($_GPC["status"][$k]) ? 1 : 0); |
|||
pdo_update("wlmerchant_consumption_adv", $data, array("uniacid" => $_W["uniacid"], "id" => intval($v))); |
|||
} |
|||
} |
|||
show_json(1, array('message' => '编辑幻灯片成功', 'url' => web_url('consumption/adv/adv_list'))); |
|||
} |
|||
$slides = pdo_fetchall("select * from " . tablename("wlmerchant_consumption_adv") . " where uniacid = :uniacid order by displayorder desc", array(":uniacid" => $_W["uniacid"])); |
|||
include wl_template('consumption/adv'); |
|||
} |
|||
|
|||
public function adv_post() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC["id"]); |
|||
if (0 < $id) { |
|||
$slide = pdo_get("wlmerchant_consumption_adv", array("uniacid" => $_W["uniacid"], "id" => $id)); |
|||
if (empty($slide)) { |
|||
wl_message("幻灯片不存在或已删除", referer(), "error"); |
|||
} |
|||
} |
|||
if ($_W["ispost"]) { |
|||
$advname = (trim($_GPC["advname"]) ? trim($_GPC["advname"]) : imessage(error(-1, "标题不能为空"), "", "ajax")); |
|||
$data = array("uniacid" => $_W["uniacid"], "advname" => $advname, "thumb" => trim($_GPC["thumb"]), "link" => trim($_GPC["link"]), "displayorder" => intval($_GPC["displayorder"]), "status" => intval($_GPC["status"]), "wxapp_link" => trim($_GPC["wxapp_link"])); |
|||
if (!empty($slide)) { |
|||
pdo_update("wlmerchant_consumption_adv", $data, array("uniacid" => $_W["uniacid"], "id" => $id)); |
|||
} else { |
|||
pdo_insert("wlmerchant_consumption_adv", $data); |
|||
} |
|||
show_json(1, array('message' => '编辑幻灯片成功', 'url' => web_url('consumption/adv/adv_list'))); |
|||
} |
|||
include wl_template('consumption/adv'); |
|||
} |
|||
|
|||
public function adv_displayorder() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC["id"]); |
|||
$displayorder = intval($_GPC["displayorder"]); |
|||
pdo_update("wlmerchant_consumption_adv", array("displayorder" => $displayorder), array("uniacid" => $_W["uniacid"], "id" => $id)); |
|||
show_json(1); |
|||
} |
|||
|
|||
public function adv_del() { |
|||
global $_W, $_GPC; |
|||
$ids = $_GPC["id"]; |
|||
if (!is_array($ids)) { |
|||
$ids = array($ids); |
|||
} |
|||
foreach ($ids as $value) { |
|||
pdo_delete("wlmerchant_consumption_adv", array("uniacid" => $_W["uniacid"], "id" => $value)); |
|||
} |
|||
show_json(1, '删除成功'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Category_WeliamController { |
|||
|
|||
public function cate_list() { |
|||
global $_W, $_GPC; |
|||
if ($_W["ispost"]) { |
|||
if (!empty($_GPC["ids"])) { |
|||
foreach ($_GPC["ids"] as $k => $v) { |
|||
$data = array("name" => trim($_GPC["name"][$k]), "displayorder" => intval($_GPC["displayorders"][$k]),'status'=>0); |
|||
if($_GPC['status_'.$v] == 'on'){ |
|||
$data['status'] = 1; |
|||
} |
|||
pdo_update("wlmerchant_consumption_category", $data, array("uniacid" => $_W["uniacid"], "id" => intval($v))); |
|||
} |
|||
} |
|||
show_json(1, array('message' => '编辑商品分类成功', 'url' => web_url('consumption/category/cate_list'))); |
|||
} |
|||
$categorys = pdo_fetchall("select * from" . tablename("wlmerchant_consumption_category") . " where uniacid = :uniacid order by displayorder desc", array(":uniacid" => $_W["uniacid"])); |
|||
include wl_template('consumption/category'); |
|||
} |
|||
|
|||
public function cate_post() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC["id"]); |
|||
if (0 < $id) { |
|||
$category = pdo_get("wlmerchant_consumption_category", array("uniacid" => $_W["uniacid"], "id" => $id)); |
|||
if (empty($category)) { |
|||
wl_message("幻灯片不存在或已删除", referer(), "error"); |
|||
} |
|||
} |
|||
if ($_W["ispost"]) { |
|||
$name = (trim($_GPC["name"]) ? trim($_GPC["name"]) : imessage(error(-1, "分类名称不能为空"), "", "ajax")); |
|||
$data = array("uniacid" => $_W["uniacid"], "name" => $name, "thumb" => trim($_GPC["thumb"]), "displayorder" => intval($_GPC["displayorder"]), "status" => intval($_GPC["status"])); |
|||
if (!empty($category)) { |
|||
pdo_update("wlmerchant_consumption_category", $data, array("uniacid" => $_W["uniacid"], "id" => $id)); |
|||
} else { |
|||
pdo_insert("wlmerchant_consumption_category", $data); |
|||
} |
|||
show_json(1, array('message' => '编辑商品分类成功', 'url' => web_url('consumption/category/cate_list'))); |
|||
} |
|||
include wl_template('consumption/category'); |
|||
} |
|||
|
|||
public function cate_del() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC["id"]); |
|||
pdo_delete("wlmerchant_consumption_category", array("uniacid" => $_W["uniacid"], "id" => $id)); |
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Consumptionset_WeliamController { |
|||
|
|||
public function consumptionapi() { |
|||
global $_W, $_GPC; |
|||
if (checksubmit('submit')) { |
|||
$base = $_GPC['set']; |
|||
Setting::wlsetting_save($base, 'consumption'); |
|||
wl_message('保存设置成功!', referer(), 'success'); |
|||
} |
|||
//获取设置信息 |
|||
$settings = Setting::wlsetting_read('consumption'); |
|||
//获取社群信息 |
|||
$comList = pdo_getall(PDO_NAME."community",['uniacid'=>$_W['uniacid'],'aid'=>0]); |
|||
|
|||
include wl_template('consumption/consumptionapi'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,182 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Goods_WeliamController { |
|||
|
|||
public function goods_list() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$data = array(); |
|||
$data['uniacid'] = $_W["uniacid"]; |
|||
$type = trim($_GPC["type"]); |
|||
if (!empty($type)) { |
|||
$data['type'] = $type; |
|||
} |
|||
if (!empty($_GPC["keyword"])) { |
|||
$data['@title@'] = $_GPC['keyword']; |
|||
} |
|||
$lists = Util::getNumData('*','wlmerchant_consumption_goods',$data,'displayorder DESC,ID DESC', $pindex, $psize, 1); |
|||
$pager = $lists[1]; |
|||
$lists = $lists[0]; |
|||
foreach($lists as &$li){ |
|||
$li['salenum'] = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename(PDO_NAME . "order") . " WHERE plugin = 'consumption' AND fkid = {$li['id']} "); |
|||
} |
|||
|
|||
include wl_template('consumption/goods'); |
|||
} |
|||
|
|||
public function goods_post() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC["id"]); |
|||
if(p('distribution')){ |
|||
$distriset = Setting::wlsetting_read('distribution'); |
|||
}else{ |
|||
$distriset = 0; |
|||
} |
|||
if (0 < $id) { |
|||
$item = Consumption::creditshop_goods_get($id); |
|||
$item["redpacket"] = iunserializer($item["redpacket"]); |
|||
$advs = unserialize($item['advs']); |
|||
|
|||
if ($item['usedatestatus'] == 1) { |
|||
$item['week'] = unserialize($item['week']); |
|||
} |
|||
if ($item['usedatestatus'] == 2) { |
|||
$item['day'] = unserialize($item['day']); |
|||
} |
|||
$item['level'] = unserialize($item['level']); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
if ($_W["ispost"]) { |
|||
$data = array( |
|||
"uniacid" => $_W["uniacid"] , |
|||
"title" => trim($_GPC["title"]) , |
|||
"category_id" => intval($_GPC["creditshop_category_id"]) , |
|||
"type" => trim($_GPC["type"]) , |
|||
"credit2" => trim($_GPC["credit2"]) , |
|||
"old_price" => trim($_GPC["old_price"]) , |
|||
"status" => intval($_GPC["status"]) , |
|||
"thumb" => trim($_GPC["thumb"]) , |
|||
"chance" => intval($_GPC["chance"]) , |
|||
"use_credit1" => trim($_GPC["use_credit1"]) , |
|||
"use_credit2" => trim($_GPC["use_credit2"]) , |
|||
"description" => htmlspecialchars_decode($_GPC["description"]) , |
|||
"displayorder" => intval($_GPC["displayorder"]) , |
|||
"vipstatus" => intval($_GPC["vipstatus"]) , |
|||
"stock" => intval($_GPC["stock"]) , |
|||
"vipcredit1" => intval($_GPC["vipcredit1"]) , |
|||
"vipcredit2" => trim($_GPC["vipcredit2"]) , |
|||
"dissettime" => trim($_GPC["dissettime"]) , |
|||
"halfcardid" => trim($_GPC["halfcardid"]) , |
|||
"advs" => serialize($_GPC["advs"]) , |
|||
'community_id' => $_GPC['community_id'] , |
|||
'describe' => $_GPC['describe'] , |
|||
); |
|||
|
|||
if($data['vipstatus'] == 1 && $data['vipcredit1'] < 1){ |
|||
show_json(0, array('message' => '会员消耗积分必须大于0')); |
|||
} |
|||
if($data['type'] == 'halfcard' && empty($data['halfcardid'])){ |
|||
show_json(0, array('message' => '请选择一卡通会员类型')); |
|||
} |
|||
//一卡通等级 |
|||
$level = $_GPC['level']; |
|||
$data['level'] = serialize($level); |
|||
$hour = array(); |
|||
$category = array(); |
|||
if (!empty($_GPC["category_id"])) { |
|||
foreach ($_GPC["category_id"] as $key => $value) { |
|||
if (empty($value)) { |
|||
continue; |
|||
} |
|||
$category[] = array("id" => intval($value), "title" => trim($_GPC["category_title"][$key]), "src" => trim($_GPC["category_src"][$key])); |
|||
} |
|||
} |
|||
$redpacket = array("name" => trim($_GPC["name"]), "discount" => trim($_GPC["discount"]), "condition" => trim($_GPC["condition"]), "grant_days_effect" => intval($_GPC["grant_days_effect"]), "use_days_limit" => intval($_GPC["use_days_limit"]), "hour" => $hour, "category" => $category); |
|||
$data["redpacket"] = iserializer($redpacket); |
|||
//运费模板 |
|||
$data['expressid'] = $_GPC['expressid']; |
|||
//分销 |
|||
$data['isdistri'] = $_GPC['isdistri']; |
|||
if($data['isdistri']){ |
|||
$data['onedismoney'] = $_GPC['onedismoney']; |
|||
$data['twodismoney'] = $_GPC['twodismoney']; |
|||
} |
|||
//定时兑换 |
|||
$goods = $_GPC['goods'] ? : []; |
|||
if ($goods['usedatestatus'] == 1) { |
|||
$goods['week'] = serialize($goods['week']); |
|||
$goods['day'] = ''; |
|||
}else if ($goods['usedatestatus'] == 2) { |
|||
$goods['day'] = serialize($goods['day']); |
|||
$goods['week'] = ''; |
|||
}else{ |
|||
$goods['usedatestatus'] = 0; |
|||
$goods['day'] = ''; |
|||
$goods['week'] = ''; |
|||
} |
|||
$data = array_merge($data,$goods); |
|||
|
|||
if (0 < $id) { |
|||
pdo_update(PDO_NAME."consumption_goods", $data, ["uniacid" => $_W["uniacid"], "id" => $id]); |
|||
} else { |
|||
pdo_insert(PDO_NAME."consumption_goods", $data); |
|||
} |
|||
|
|||
|
|||
show_json(1, array('message' => '编辑商品成功', 'url' => web_url('consumption/goods/goods_list'))); |
|||
} |
|||
//分类信息 |
|||
$categorys = Consumption::creditshop_category_get(); |
|||
//获取运费模板 |
|||
$express = Store::getNumExpress('*',array('uniacid'=>$_W['uniacid']),'ID DESC',0,0,0); |
|||
$express = $express[0]; |
|||
//获取一卡通类型 |
|||
$halfcardlist = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_halfcard_type')."WHERE uniacid = {$_W['uniacid']} ORDER BY sort DESC"); |
|||
//获取社群信息 |
|||
$communitylist = pdo_getall('wlmerchant_community',['uniacid' => $_W['uniacid'],'aid'=>$_W['aid']],['id','communname']); |
|||
//一卡通等级 |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
|
|||
|
|||
|
|||
include wl_template('consumption/goods'); |
|||
} |
|||
|
|||
public function goods_del() { |
|||
global $_W, $_GPC; |
|||
$ids = $_GPC["id"]; |
|||
if (!is_array($ids)) { |
|||
$ids = array($ids); |
|||
} |
|||
foreach ($ids as $v) { |
|||
pdo_delete("wlmerchant_consumption_goods", array("uniacid" => $_W["uniacid"], "id" => $v)); |
|||
} |
|||
show_json(1, "删除商品成功"); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 商品快捷上下架 |
|||
* Author: zzw |
|||
*/ |
|||
public function isUpperShelf(){ |
|||
global $_W,$_GPC; |
|||
//获取信息内容 |
|||
$id = $_GPC['id']; |
|||
$status = $_GPC['status'];//1=上架中要修改为下架。0=下架中要修改为上架 |
|||
if($status == 1){ |
|||
$updata['status'] = 0; |
|||
}else{ |
|||
$updata['status'] = 1; |
|||
} |
|||
//修改商品的状态 |
|||
pdo_update(PDO_NAME."consumption_goods",$updata,array('id'=>$id)); |
|||
wl_json(1,'请求成功',$updata); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Order_WeliamController { |
|||
|
|||
public function record() { |
|||
global $_W, $_GPC; |
|||
$keytype = $_GPC['keywordtype']; |
|||
$keyword = $_GPC['keyword']; |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$pindex = max(1, $_GPC['page']); |
|||
|
|||
if($_GPC['keyword']){ |
|||
$keyword = $_GPC['keyword']; |
|||
if($_GPC['keywordtype'] == 2){ |
|||
$where['mid'] = $keyword; |
|||
}else if($_GPC['keywordtype'] == 3){ |
|||
$where['goodsid'] = $keyword; |
|||
}else if($_GPC['keywordtype'] == 4){ |
|||
$where['integral>'] = $keyword; |
|||
}else if($_GPC['keywordtype'] == 5){ |
|||
$where['integral<'] = $keyword; |
|||
}else if($_GPC['keywordtype'] == 1){ |
|||
$params[':name'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_member')." WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :name",$params); |
|||
if($members){ |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if($key == 0){ |
|||
$mids.= $v['id']; |
|||
}else{ |
|||
$mids.= ",".$v['id']; |
|||
} |
|||
} |
|||
$mids.= ")"; |
|||
$where['mid#'] = $mids; |
|||
}else{ |
|||
$where['mid'] = 0; |
|||
} |
|||
} |
|||
} |
|||
|
|||
if($_GPC['status']){ |
|||
$where['status'] = $_GPC['status']; |
|||
} |
|||
|
|||
if ($_GPC['time_limit']) { |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
$where['createtime>'] = $starttime; |
|||
$where['createtime<'] = ($endtime + 24 * 3600); |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
$listData = Util::getNumData("*",PDO_NAME.'consumption_record',$where,'createtime desc', $pindex, 10, 1); |
|||
$list = $listData[0]; |
|||
foreach ($list as $key => &$v) { |
|||
$member = pdo_get(PDO_NAME . 'member', array('id' => $v['mid']), array('nickname', 'avatar')); |
|||
$v['nickname'] = $member['nickname']; |
|||
$v['avatar'] = $member['avatar']; |
|||
$goods = pdo_get(PDO_NAME.'consumption_goods', array('id' => $v['goodsid']), array('thumb','title')); |
|||
$v['goodsthumb'] = $goods['thumb']; |
|||
$v['goodstitle'] = $goods['title']; |
|||
$express = pdo_get(PDO_NAME.'express', array('id' => $v['expressid']), array('sendtime','receivetime')); |
|||
$v['sendtime'] = $express['sendtime']; |
|||
$v['receivetime'] = $express['receivetime']; |
|||
} |
|||
$pager = $listData[1]; |
|||
include wl_template('consumption/order'); |
|||
} |
|||
} |
|||
@ -0,0 +1,137 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li {if $_W['method'] == 'adv_list'}class="active"{/if}><a href="{php echo web_url('consumption/adv/adv_list')}">幻灯片列表</a></li> |
|||
{if $_W['method'] == 'adv_post'} |
|||
<li class="active"><a href="{php echo web_url('consumption/adv/adv_post')}">编辑幻灯片</a></li> |
|||
{/if} |
|||
</ul> |
|||
{if $_W['method'] == 'adv_list'} |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('consumption/adv/adv_post')}" class="btn btn-primary">添加幻灯片</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
{if empty($slides)} |
|||
<div class="no-result"> |
|||
<p>还没有相关数据</p> |
|||
</div> |
|||
{else} |
|||
<form action="" class="form-table form form-validate" method="post"> |
|||
<div class="table-responsive js-table"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th> |
|||
<div class="checkbox checkbox-inline"> |
|||
<input type="checkbox" name="id[]"/> |
|||
<label></label> |
|||
</div> |
|||
</th> |
|||
<th>图片</th> |
|||
<th>排序</th> |
|||
<th>标题</th> |
|||
<th>状态</th> |
|||
<th class="text-right">操作</th> |
|||
</tr> |
|||
</thead> |
|||
{loop $slides $slide} |
|||
<tr> |
|||
<td> |
|||
<div class="checkbox checkbox-inline"> |
|||
<input type="checkbox" name="id[]" value="{$slide['id']}"/> |
|||
<label></label> |
|||
</div> |
|||
</td> |
|||
<input type="hidden" name="ids[]" value="{$slide['id']}"> |
|||
<td><img src="{php echo tomedia($slide['thumb']);}" width="50"></td> |
|||
<td> |
|||
<input name="displayorders[]" value="{$slide['displayorder']}" class="form-control width-100" required="true"> |
|||
</td> |
|||
<td> |
|||
<input name="advnames[]" value="{$slide['advname']}" type="text" class="form-control width-100" required="true"> |
|||
</td> |
|||
<td> |
|||
<input name="status[]" type="checkbox" class="js-switch" {if $slide['status'] == 1}checked{/if}> |
|||
</td> |
|||
<td class="text-right"> |
|||
<a href="{php echo web_url('consumption/adv/adv_post', array('id' => $slide['id']))}" class="btn btn-default btn-sm" title="编辑" data-toggle="tooltip" data-placement="top" ><i class="fa fa-edit"> </i> 编辑</a> |
|||
<a href="{php echo web_url('consumption/adv/adv_del', array('id' => $slide['id']))}" class="btn btn-default btn-sm" data-confirm="确定删除该幻灯片?" data-toggle="ajaxRemove"><i class="fa fa-times"> </i> 删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</table> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<input type="submit" class="btn btn-primary" name="submit" value="提交修改" /> |
|||
<a href="{php echo web_url('consumption/adv/adv_del')}" class="btn btn-danger" data-toggle="batch-remove" data-confirm="删除后将不可恢复,确定删除吗">批量删除</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
|
|||
{if $_W['method'] == 'adv_post'} |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form class="form-horizontal form form-validate" id="form1" action="" method="post" enctype="multipart/form-data"> |
|||
<div class="form-group-title">编辑幻灯片</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="advname" value="{$slide['advname']}" required="true"> |
|||
<span class="help-block">仅用于区分,不在前台显示</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('thumb', $slide['thumb']);} |
|||
<div class="help-block">建议图片尺寸:640*240</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">跳转链接</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group form-group" style="margin: 0;"> |
|||
<input type="text" value="{$slide['link']}" readonly="readonly" class="form-control valid" name="link" id="advlink"> |
|||
<span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" min="0" class="form-control" name="displayorder" value="{$slide['displayorder']}"> |
|||
<span class="help-block">数字越大越靠前</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否启用</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-inline"> |
|||
<input type="radio" name="status" value="1" id="status-1" {if $slide['status'] == 1}checked{/if}> |
|||
<label for="status-1">启用</label> |
|||
</div> |
|||
<div class="radio radio-inline"> |
|||
<input type="radio" name="status" value="0" id="status-0" {if !$slide['status']}checked{/if}> |
|||
<label for="status-0">不启用</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}"> |
|||
<input type="submit" value="提交" class="btn btn-primary min-width"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,118 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
{if $_W['method'] == 'cate_list'} |
|||
<li class="active"><a href="{php echo web_url('consumption/category/cate_list')}">商品分类</a></li> |
|||
{/if} |
|||
{if $_W['method'] == 'cate_post'} |
|||
<li class="active"><a href="{php echo web_url('consumption/category/cate_post')}">编辑分类</a></li> |
|||
{/if} |
|||
</ul> |
|||
{if $_W['method'] == 'cate_list'} |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('consumption/category/cate_post')}" class="btn btn-primary">添加分类</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
{if empty($categorys)} |
|||
<div class="no-result"> |
|||
<p>还没有相关数据</p> |
|||
</div> |
|||
{else} |
|||
<form action="" class="form-table form form-validate" method="post"> |
|||
<div class="table-responsive js-table"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th>图片</th> |
|||
<th>标题</th> |
|||
<th>显示顺序</th> |
|||
<th>状态</th> |
|||
<th class="text-right">操作</th> |
|||
</tr> |
|||
</thead> |
|||
{loop $categorys $category} |
|||
<tr> |
|||
<td> |
|||
<img src="{php echo tomedia($category['thumb']);}" width="50"> |
|||
</td> |
|||
<input type="hidden" name="ids[]" value="{$category[id]}"> |
|||
<td> |
|||
<input name="name[]" value="{$category['name']}" class="form-control width-100" required="true" > |
|||
</td> |
|||
<td> |
|||
<input name="displayorders[]" value="{$category['displayorder']}" class="form-control width-100" required="true" > |
|||
</td> |
|||
<td> |
|||
<input name="status_{$category['id']}" type="checkbox" class="js-switch" {if $category['status'] == 1}checked{/if}> |
|||
</td> |
|||
<td class="text-right"> |
|||
<a href="{php echo web_url('consumption/category/cate_post', array('id' => $category['id']))}" class="btn btn-default btn-sm" title="编辑" data-toggle="tooltip" data-placement="top" ><i class="fa fa-edit"> </i> 编辑</a> |
|||
<a href="{php echo web_url('consumption/category/cate_del', array('id' => $category['id']))}" class="btn btn-default btn-sm" data-confirm="确定删除该商品分类?" data-toggle="ajaxRemove"><i class="fa fa-times"> </i> 删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</table> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<input type="submit" class="btn btn-primary" name="submit" value="提交修改" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
|
|||
{if $_W['method'] == 'cate_post'} |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form class="form-horizontal form form-validate" id="form1" action="" method="post" enctype="multipart/form-data"> |
|||
<div class="form-group-title">编辑商品分类</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分类名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="name" value="{$category['name']}" required="true"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('thumb', $category['thumb']);} |
|||
<div class="help-block">建议图片尺寸:100*100,或正方形图片</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" min="0" class="form-control" name="displayorder" value="{$category['displayorder']}"> |
|||
<span class="help-block">数字越大越靠前</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否启用</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-inline"> |
|||
<input type="radio" name="status" value="1" id="status-1" {if $category['status'] == 1}checked{/if}> |
|||
<label for="status-1">启用</label> |
|||
</div> |
|||
<div class="radio radio-inline"> |
|||
<input type="radio" name="status" value="0" id="status-0" {if !$category['status']}checked{/if}> |
|||
<label for="status-0">禁用</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}"> |
|||
<input type="submit" value="提交" class="btn btn-primary min-width"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,131 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">系统设置</a></li> |
|||
<li><a href="#tab_listshare">列表分享</a></li> |
|||
<li><a href="#tab_goodshare">商品分享</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" id="setting-form" class="form-horizontal form form-validate"> |
|||
<div class="panel panel-default"> |
|||
<div class="form-group-title">系统设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开启积分商城</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio1" name="set[status]" value="1" {if intval($settings['status']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio1"> 开启 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio2" name="set[status]" value="0" {if intval($settings['status']) == 0 || empty($settings['status'])}checked="checked"{/if}> |
|||
<label for="inlineRadio2"> 关闭 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">积分商城类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" onclick="$('#otherurl').hide();"> |
|||
<input type="radio" id="inlineRadio3" name="set[type]" value="0" {if intval($settings['type']) == 0 || empty($settings['type'])}checked="checked"{/if}> |
|||
<label for="inlineRadio3"> 本系统 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" onclick="$('#otherurl').show();"> |
|||
<input type="radio" id="inlineRadio4" name="set[type]" value="1" {if intval($settings['type']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio4"> 其他 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="otherurl" {if empty($settings['type'])}style="display: none;"{/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">积分商城链接</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="set[otherurl]" class="form-control" value="{$settings['otherurl']}"/> |
|||
<span class="help-block">请输入其他积分商城链接</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-xs-7 col-sm-3 col-md-2 control-label">社群</label> |
|||
<div class="col-sm-7 col-xs-6"> |
|||
<select name="set[community]" class="form-control select2 col-sm-7 col-xs-6"> |
|||
<option value="-1" >不显示社群</option> |
|||
{loop $comList $item} |
|||
<option value="{$item['id']}" {if $item['id'] == $settings['community']} selected="selected" {/if}>{$item['communname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_listshare"> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [系统名称]</b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-8"> |
|||
<input type="text" name="set[share_title]" class="form-control" value="{$settings['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-8"> |
|||
{php echo attachment_select('set[share_image]', $settings['share_image']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-8"> |
|||
<input type="text" name="set[share_desc]" class="form-control" value="{$settings['share_desc']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_goodshare"> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[商品名称] [原价] [所需积分] [所需金额] [昵称] [时间] [系统名称]</b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-8"> |
|||
<input type="text" name="set[goods_title]" class="form-control" value="{$settings['goods_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-8"> |
|||
{php echo attachment_select('set[goods_image]', $settings['goods_image']);} |
|||
<span class="help-block">不上传默认使用商品图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-8"> |
|||
<input type="text" name="set[goods_desc]" class="form-control" value="{$settings['goods_desc']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" lay-submit value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,29 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">兑换入口</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="bs-callout bs-callout-danger" id="callout-glyphicons-empty-only"> |
|||
<h4>积分商城入口设置</h4> |
|||
<p>如果你有oAuth权限也可以直接设置自定义菜单到指定链接位置.</p> |
|||
</div> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">直接链接</label> |
|||
<div class="col-sm-9"> |
|||
<p class='form-control-static'><a href='javascript:;' class="js-clip" title='点击复制链接' data-url="{$set['url']}" >{$set['url']}</a></p> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">二维码</label> |
|||
<div class="col-sm-9"> |
|||
<div class="qrcode-block" style="margin-top:5px"> |
|||
<img src="{php echo web_url('utility/qrcode/getQrCode',array('url' => urlencode($set['url'])))}" width="150" height="150"></canvas> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,623 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li {if $_W['method'] == 'goods_list'}class="active"{/if}><a href="{php echo web_url('consumption/goods/goods_list')}">商品列表</a></li> |
|||
{if $_W['method'] == 'goods_post'} |
|||
<li class="active"><a href="{php echo web_url('consumption/goods/goods_post')}">编辑商品</a></li> |
|||
{/if} |
|||
</ul> |
|||
<div class="app-content"> |
|||
{if $_W['method'] == 'goods_post'} |
|||
<style> |
|||
.category-container .category-item {position: relative; height: 80px; border: 1px solid #eee; margin-bottom: 10px;} |
|||
.category-container .btn-del {height: 0; width: 100%; display: block; position: relative;} |
|||
.category-container .btn-del::before {content: "×"; position: absolute; height: 16px; width: 16px; text-align: center; line-height: 14px; color: rgb(255, 255, 255); cursor: pointer; top: -6px; right: -6px; z-index: 10; background: rgba(0, 0, 0, 0.3); border-radius: 16px;} |
|||
.category-container .category-item img {width: 100%; height: 80px;} |
|||
.category-container .category-item .title {position: absolute; height: 20px; left: 0; right: 0; bottom: -1px; background: rgba(0,0,0,0.5); color: #fff; text-align: center; font-size: 12px; line-height: 20px; cursor: pointer;} |
|||
</style> |
|||
<div class="app-form"> |
|||
<form class="form-horizontal form form-validate" id="form1" action="" method="post" enctype="multipart/form-data"> |
|||
<div class="form-group-title">编辑商品</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="displayorder" value="{$item['displayorder']}"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$item['title']}" required="true"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品缩略图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('thumb', $item['thumb']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品图集</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('advs',$advs);} |
|||
<span class="help-block">商品图集为商品详情幻灯片,建议750X560</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品分类</label> |
|||
<div class="col-sm-9"> |
|||
<select class="form-control" name="creditshop_category_id" > |
|||
{loop $categorys $category} |
|||
<option value="{$category['id']}" {if $category['id'] == $item['category_id']}selected{/if}>{$category['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-inline" onclick="changetype('goods')"> |
|||
<input type="radio" name="type" id="type-1" value="goods" {if !$item['type'] || $item['type'] == 'goods'}checked{/if} > |
|||
<label for="type-1" style="padding:0;">商品</label> |
|||
</div> |
|||
<div class="radio radio-inline" onclick="changetype('credit2')"> |
|||
<input type="radio" name="type" id="type-2" value="credit2" {if $item['type'] == 'credit2'}checked{/if}> |
|||
<label for="type-2" style="padding:0;">余额</label> |
|||
</div> |
|||
<div class="radio radio-inline" onclick="changetype('halfcard')"> |
|||
<input type="radio" name="type" id="type-4" value="halfcard" {if $item['type'] == 'halfcard'}checked{/if}> |
|||
<label for="type-4" style="padding:0;">一卡通会员</label> |
|||
</div> |
|||
<!--<div class="radio radio-inline" onclick="$('#credit').hide();$('#redpacket').show();"> |
|||
<input type="radio" name="type" id="type-3" value="redpacket" {if $item['type'] == 'redpacket'}checked{/if}> |
|||
<label for="type-3">红包</label> |
|||
</div>--> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="halfcard" {if $item['type'] == 'halfcard' || !$item['type']} style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label">一卡通类型</label> |
|||
<div class="col-sm-9"> |
|||
<select name="halfcardid" class="form-control select2 col-sm-7 col-xs-6" style="width: 100%;"> |
|||
<option value="">请选择适配的一卡通类型</option> |
|||
{loop $halfcardlist $half} |
|||
<option value="{$half['id']}" {if $item['halfcardid'] == $half['id']}selected="selected"{/if}>{$half['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="credit" {if $item['type'] != 'credit2' || !$item['type'] } style="display:none;" {/if} > |
|||
<label class="col-sm-2 control-label">设置余额</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">余额</div> |
|||
<input type="text" class="form-control" name="credit2" value="{$item['credit2']}"> |
|||
<div class="input-group-addon">元</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="expresstemplate" {if $item['type'] != 'goods' && !empty($item['type']) } style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label">运费模板</label> |
|||
<div class="col-sm-9"> |
|||
<select name ='expressid' class="form-control" > |
|||
<option value="">请选择运费模板</option> |
|||
{loop $express $vv} |
|||
<option value="{$vv['id']}" {if $item['expressid'] == $vv['id']}selected="selected"{/if}>{$vv['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<div class="help-block">不选择运费模板即为包邮。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品原价</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control" name="old_price" value="{$item['old_price']}"> |
|||
<div class="input-group-addon">元</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品库存</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control" name="stock" value="{$item['stock']}"> |
|||
<div class="input-group-addon">份</div> |
|||
</div> |
|||
<div class="help-block"> |
|||
填0或者不填则为无限库存的商品 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">兑换限制</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">每人共</div> |
|||
<input type="number" min="0" class="form-control" name="chance" value="{$item['chance']}" required="true"> |
|||
<div class="input-group-addon">次</div> |
|||
<!--<div class="input-group-addon">次,每天提供</div>--> |
|||
<!--<input type="number" class="form-control" name="totalday" value="{$item['totalday']}" required="true">--> |
|||
<!--<div class="input-group-addon">份</div>--> |
|||
</div> |
|||
<div class="help-block"> |
|||
不限制兑换次数请填入0 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动消耗</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">消耗</div> |
|||
<input type="text" class="form-control" name="use_credit1" value="{$item['use_credit1']}" required="true"> |
|||
<div class="input-group-addon">积分+金额</div> |
|||
<input type="text" class="form-control" name="use_credit2" value="{$item['use_credit2']}"> |
|||
<div class="input-group-addon">元</div> |
|||
</div> |
|||
<div class="help-block"> |
|||
可任意组合,可以单独积分兑换,积分必须是正整数,或者积分+现金形式兑换(积分必须大于0) |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员优惠</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#vipprice').hide();$('#viplevel').hide();" > |
|||
<input type="radio" value="0" name="vipstatus" {if $item['vipstatus']==0} checked {/if}>无 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#vipprice').show();$('#viplevel').hide();"> |
|||
<input type="radio" value="1" name="vipstatus" {if $item['vipstatus']==1} checked {/if}>会员特价 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#vipprice').hide();$('#viplevel').show();"> |
|||
<input type="radio" value="2" name="vipstatus" {if $item['vipstatus']==2} checked {/if}>会员特供 |
|||
</label> |
|||
<span class="help-block">会员特供即只有会员可以购买</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="vipprice" {if $item['vipstatus'] != 1} style="display: none;" {/if} > |
|||
<label class="col-sm-2 control-label">会员消耗</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">消耗</div> |
|||
<input type="text" class="form-control" name="vipcredit1" value="{$item['vipcredit1']}"> |
|||
<div class="input-group-addon">积分+金额</div> |
|||
<input type="text" class="form-control" name="vipcredit2" value="{$item['vipcredit2']}"> |
|||
<div class="input-group-addon">元</div> |
|||
</div> |
|||
<div class="help-block"> |
|||
可任意组合,可以单独积分兑换,积分必须是正整数,或者积分+现金形式兑换(积分必须大于0) |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="viplevel" {if $item['vipstatus'] != 2} style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label">适用会员等级</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="0" {if in_array(0,$item['level'])} checked {/if} name="level[]" />{$_W['wlsetting']['halflevel']['name']} |
|||
</label> |
|||
{loop $levels $level} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{$level['id']}" {if in_array($level['id'],$item['level'])} checked {/if} name="level[]" />{$level['name']} |
|||
</label> |
|||
{/loop} |
|||
<span class="help-block">如果全都不勾选则默认全等级可用</span> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">限制购买时间</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" id="wk" name="goods[usedatestatus]" {if $item['usedatestatus'] == 1} checked {/if}>按星期 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" id="dd" name="goods[usedatestatus]" {if $item['usedatestatus']==2} checked {/if}>按日期 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" id="cc" name="goods[usedatestatus]" {if $item['usedatestatus']==0 || empty($item['usedatestatus'])} checked {/if}>关闭 |
|||
</label> |
|||
<span class="help-block">开启后,商品只能在设置的时间才能下单兑换</span> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('#wk').click(function(){ |
|||
$('#weeke').show(); |
|||
$('#activediscount').show(); |
|||
$('#daily').hide(); |
|||
}); |
|||
$('#dd').click(function(){ |
|||
$('#weeke').hide(); |
|||
$('#activediscount').show(); |
|||
$('#daily').show(); |
|||
}); |
|||
$('#cc').click(function(){ |
|||
$('#weeke').hide(); |
|||
$('#activediscount').hide(); |
|||
$('#daily').hide(); |
|||
}); |
|||
</script> |
|||
<div class="form-group" {if $item['usedatestatus'] != 1} style="display: none;"{/if} id="weeke"> |
|||
<label class="col-sm-2 control-label">按星期</label> |
|||
<div class="col-sm-9"> |
|||
{if $item} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="1" name="goods[week][]" id="wk1" /> 星期一 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="2" name="goods[week][]" id="wk2" /> 星期二 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="3" name="goods[week][]" id="wk3" /> 星期三 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="4" name="goods[week][]" id="wk4" /> 星期四 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="5" name="goods[week][]" id="wk5" /> 星期五 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="6" name="goods[week][]" id="wk6" /> 星期六 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="7" name="goods[week][]" id="wk7" /> 星期日 |
|||
</label> |
|||
{loop $item['week'] $week} |
|||
<script type="text/javascript"> |
|||
if({php echo $week}==1){ |
|||
$('#wk1').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==2){ |
|||
$('#wk2').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==3){ |
|||
$('#wk3').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==4){ |
|||
$('#wk4').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==5){ |
|||
$('#wk5').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==6){ |
|||
$('#wk6').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==7){ |
|||
$('#wk7').attr('checked','true'); |
|||
} |
|||
|
|||
</script> |
|||
{/loop} |
|||
{else} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="1" name="goods[week][]" /> 星期一 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="2" name="goods[week][]" /> 星期二 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="3" name="goods[week][]" /> 星期三 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="4" name="goods[week][]" /> 星期四 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="5" name="goods[week][]" /> 星期五 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="6" name="goods[week][]" /> 星期六 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="7" name="goods[week][]" /> 星期日 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" {if $item['usedatestatus'] != 2} style="display: none;"{/if} id="daily"> |
|||
<label class="col-sm-2 control-label">按天数</label> |
|||
<div class="col-sm-9"> |
|||
{if $item['usedatestatus'] == 2} |
|||
<?php |
|||
for ($i=1;$i<32;$i++ ) { |
|||
if(in_array($i,$item['day'])){ |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" checked name="goods[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
}else{ |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" name="goods[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
}} |
|||
?> |
|||
{else} |
|||
<?php |
|||
for ($i=1;$i<32;$i++ ) { |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" name="goods[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
} |
|||
?> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
|
|||
{if $distriset['switch']} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否参与分销</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="isdistri" {if $item['isdistri'] == 1} checked {/if} onclick="distri(1)"/> 参与 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="isdistri" {if $item['isdistri'] == 0 || empty($item['isdistri'])} checked {/if} onclick="distri(0)" /> 不参与 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="distridiv" class="form-group row" {if empty($item['isdistri'])}style="display: none;"{/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">一级分销结算金额</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="onedismoney" class="form-control" value="{$item['onedismoney']}" /> |
|||
</div> |
|||
<span class="help-block">一级分销结算金额,0或不填则按默认比例,最多保留两位小数</span> |
|||
</div> |
|||
</div> |
|||
{if $distriset['ranknum']>1} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">二级分销结算金额</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="twodismoney" class="form-control" value="{$item['twodismoney']}" /> |
|||
</div> |
|||
<span class="help-block">二级分销结算金额,0或不填则按默认比例,最多保留两位小数</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $distriset['ranknum']>2} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">三级分销结算金额</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="threedismoney" class="form-control" value="{$item['threedismoney']}" /> |
|||
</div> |
|||
<span class="help-block">三级分销结算金额,0或不填则按默认比例,最多保留两位小数</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分销佣金结算时间</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="dissettime" {if $item['dissettime']==0 || empty($item['dissettime'])} checked {/if}>订单完成时结算 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="dissettime" {if $item['dissettime']==1 } checked {/if}>订单支付时结算 |
|||
</label> |
|||
<span class="help-block">注:若订单支付时结算,在订单退款时会扣除分销商对应的佣金,如果分销商可提现佣金不足,会扣至负数</span> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-inline"> |
|||
<input type="radio" name="status" id="status-1" value="1" {if $item['status'] == 1}checked{/if}> |
|||
<label for="status-1">开启</label> |
|||
</div> |
|||
<div class="radio radio-inline"> |
|||
<input type="radio" name="status" id="status-0" value="0" {if !$item['status']}checked{/if}> |
|||
<label for="status-0">关闭</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">社群服务</label> |
|||
<div class="col-sm-9"> |
|||
<select name="community_id" class="form-control chosen-select"> |
|||
<option value="-1" >请选择商品社群</option> |
|||
{loop $communitylist $key $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $item['community_id']}selected{/if}>{$val['communname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">描述</label> |
|||
<div class="col-sm-9"> |
|||
<textarea style="height: 250px;resize: none" name="describe" class="form-control">{$item['describe']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品详情</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('description', $item['description']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}"> |
|||
<input type="submit" value="提交" class="btn btn-primary min-width"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<script> |
|||
function distri(flag){ |
|||
if (flag == 1) { |
|||
$('#distridiv').show(); |
|||
} else{ |
|||
$('#distridiv').hide(); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
{elseif $_W['method'] == 'goods_list'} |
|||
<style> |
|||
.tooltip-inner{color: #fff!important;} |
|||
</style> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('consumption/goods/goods_post')}" class="btn btn-primary">添加商品</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="./index.php" class="form-horizontal form-filter"> |
|||
{php echo tpl_form_filter_hidden('consumption/goods/goods_list');} |
|||
<input type="hidden" name="ta" value="list"/> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a class="btn {if !$type}btn-primary{else}btn-default{/if}" href="{php echo web_url('consumption/goods/goods_list')}">不限</a> |
|||
<a class="btn {if $type == 'goods'}btn-primary{else}btn-default{/if}" href="{php echo web_url('consumption/goods/goods_list', array('type' => 'goods'))}">商品</a> |
|||
<a class="btn {if $type == 'credit2'}btn-primary{else}btn-default{/if}" href="{php echo web_url('consumption/goods/goods_list', array('type' => 'credit2'))}">余额</a> |
|||
<a class="btn {if $type == 'halfcard'}btn-primary{else}btn-default{/if}" href="{php echo web_url('consumption/goods/goods_list', array('type' => 'halfcard'))}">会员</a> |
|||
<!--<a class="btn {if $type == 'redpacket'}btn-primary{else}btn-default{/if}" href="{php echo web_url('consumption/goods/goods_list', array('type' => 'redpacket'))}">红包</a>--> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">筛选</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}" placeholder="商品名称"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
{if !empty($lists)} |
|||
<div class="table js-table"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th width="10%" class="text-center">排序</th> |
|||
<th width="10%" class="text-center">缩略图</th> |
|||
<th width="15%" class="text-center">兑换价格</th> |
|||
<th width="15%" class="text-center">商品名称</th> |
|||
<th width="10%" class="text-center">兑换量/库存</th> |
|||
<th width="15%" class="text-center">商品类型</th> |
|||
<th width="10%" class="text-center">是否上架(点击上/下架)</th> |
|||
<th width="15%" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $lists $item} |
|||
<input type="hidden" name="ids[]" value="{$item['id']}"> |
|||
<tr class="text-center"> |
|||
<td> |
|||
{$item['displayorder']} |
|||
</td> |
|||
<td><img src="{php echo tomedia($item['thumb']);}" width="38" style="border-radius: 3px;"></td> |
|||
<td> |
|||
{$item['use_credit1']}积分{if $item['use_credit2']>0}+¥{$item['use_credit2']}{/if} |
|||
</td> |
|||
<td> |
|||
{$item['title']} |
|||
</td> |
|||
<td> |
|||
<!--库存--> |
|||
{$item['salenum']}/{$item['stock']} |
|||
</td> |
|||
<td> |
|||
{if $item['type'] == 'goods'} |
|||
商品 |
|||
{else if $item['type'] == 'credit2'} |
|||
余额 |
|||
{else if $item['type'] == 'halfcard'} |
|||
一卡通会员 |
|||
{else} |
|||
红包 |
|||
{/if} |
|||
</td> |
|||
<td class="upperShelf" style="cursor: pointer;" > |
|||
{if $item['status'] == 1} |
|||
<span class="label label-primary isUpperShelf" data-status="{$item['status']}" data-id="{$item['id']}">上架</span> |
|||
{else} |
|||
<span class="label label-default isUpperShelf" data-status="{$item['status']}" data-id="{$item['id']}">下架</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<a href="{php echo web_url('consumption/goods/goods_post', array('id' => $item['id']))}" class="btn btn-default btn-sm" title="编辑" data-toggle="tooltip" data-placement="top"><i class="fa fa-edit"> </i></a> |
|||
<a href="{php echo web_url('consumption/goods/goods_del', array('id' => $item['id']))}" class="btn btn-default btn-sm" data-toggle='ajaxPost' title="删除" data-confirm="删除后将不可恢复,确定删除吗?"><i class="fa fa-times"> </i></a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{else} |
|||
<div class="no-result"> |
|||
<p>还没有相关数据</p> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
<script> |
|||
$(".upperShelf").on('click',function () { |
|||
var the = $(this); |
|||
var isUpperShelf = the.children(".isUpperShelf"); |
|||
var status = isUpperShelf.data("status");//1=上架中要修改为下架。0=下架中要修改为上架 |
|||
var id = isUpperShelf.data("id"); |
|||
var url = biz.url('consumption/goods/isUpperShelf'); |
|||
//请求后台 进行上下架操作 |
|||
$.post(url,{status:status,id:id},function (res) { |
|||
var result = res.data['status']; |
|||
isUpperShelf.data("status",result); |
|||
if(result == 1){ |
|||
the.html('<span class="label label-primary isUpperShelf" data-status="'+result+'" data-id="'+id+'">上架</span>'); |
|||
}else{ |
|||
the.html('<span class="label label-default isUpperShelf" data-status="'+result+'" data-id="'+id+'">下架</span>'); |
|||
} |
|||
},'json'); |
|||
}); |
|||
|
|||
function changetype(type){ |
|||
if(type == 'goods'){ |
|||
$('#credit').hide(); |
|||
$('#redpacket').hide(); |
|||
$('#expresstemplate').show(); |
|||
$('#halfcard').hide(); |
|||
}else if(type == 'credit2'){ |
|||
$('#credit').show(); |
|||
$('#redpacket').hide(); |
|||
$('#expresstemplate').hide(); |
|||
$('#halfcard').hide(); |
|||
}else if(type == 'halfcard'){ |
|||
$('#credit').hide(); |
|||
$('#redpacket').hide(); |
|||
$('#expresstemplate').hide(); |
|||
$('#halfcard').show(); |
|||
} |
|||
|
|||
} |
|||
|
|||
</script> |
|||
|
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,131 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="#">兑换记录</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="consumption" /> |
|||
<input type="hidden" name="ac" value="order" /> |
|||
<input type="hidden" name="do" value="record"/> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}"/> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">记录状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:');}" class="btn {if empty($_GPC['status'])}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == '1'}btn-primary{else}btn-default{/if}">待发货</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $_GPC['status'] == '2'}btn-primary{else}btn-default{/if}">待收货</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == '3'}btn-primary{else}btn-default{/if}">已完成</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">记录搜索</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="0" {if $_GPC['keywordtype']==0 || empty($_GPC['keywordtype'])}selected="selected"{/if}>关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>用户昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>用户id</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>商品id</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>消耗积分大于</option> |
|||
<option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>消耗积分小于</option> |
|||
</select> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">兑换时间</label> |
|||
<div class="col-md-2"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
<!--<button class="btn btn-default min-width" name="export" type="submit" value="export"><i class="fa fa-download"></i> 导出记录</button>--> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}) |
|||
</script> |
|||
|
|||
<div class="app-table-list"> |
|||
<div class="panel panel-default"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:40px;">ID</th> |
|||
<th class="text-center" style="width:150px;">用户信息</th> |
|||
<th class="text-center" style="width:150px;">商品信息</th> |
|||
<th class="text-center" style="width:70px;">消耗积分(金额)</th> |
|||
<th class="text-center" style="width:100px;">操作时间</th> |
|||
<th class="text-center" style="width:150px;">状态与操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center" > |
|||
<td>{$item['id']}</td> |
|||
<td> |
|||
<div class="img" style="text-align: left;padding-left: 2rem;"> |
|||
<img style="height: 2.5rem;width: 2.5rem;position: relative;top: -0.5rem;" class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['avatar'])}"> |
|||
<div style="display: inline-block;position: relative;top: .5rem;" > |
|||
<span> {$item['nickname']}</span><br/> |
|||
<span>ID:{$item['mid']}</span> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="img" style="text-align: left;padding-left: 2rem;"> |
|||
<img style="height: 2.5rem;width: 2.5rem;position: relative;top: -0.5rem;" class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['goodsthumb'])}"> |
|||
<div style="display: inline-block;position: relative;top: .5rem;" > |
|||
<span>{$item['goodstitle']}</span><br/> |
|||
<span>ID:{$item['goodsid']}</span> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{$item['integral']}{if $item['money']>0}+¥{$item['money']}{/if} |
|||
</td> |
|||
<td> |
|||
兑换:{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
{if $item['sendtime']}<br/>发货:{php echo date('Y-m-d H:i:s',$item['sendtime'])}{/if} |
|||
{if $item['receivetime']}<br/>收货:{php echo date('Y-m-d H:i:s',$item['receivetime'])}{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<label class='label label-warning'>待发货</label> |
|||
<a class="btn btn-primary btn-xs" data-toggle="ajaxModal" href="{php echo web_url('order/wlOrder/send',array('id' => $item['orderid'],'type' => 'a'))}">确认发货</a> |
|||
{else if $item['status'] == 2} |
|||
<label class='label label-default'>待收货</label> |
|||
<a class="text-primary" data-toggle="ajaxModal" href="{php echo web_url('order/wlOrder/send', array('id' => $item['orderid'],'type' => 'a','edit_flag'=>1))}">修改物流</a> |
|||
<a class="text-primary" data-toggle='ajaxPost' href="{php echo web_url('order/wlOrder/sendcancel', array('id' => $item['id'],'type' => 'consumption'))}" data-confirm="确认取消发货?">取消发货</a> |
|||
<a class="btn btn-primary btn-xs" data-toggle="ajaxPost" href="{php echo web_url('order/wlOrder/collect', array('id' => $item['id'],'type' => 'consumption'))}" data-confirm="确认买家收货?">确认收货</a> |
|||
{else} |
|||
<label class='label label-success'>已完成</label> |
|||
<a class="text-primary" data-toggle="ajaxModal" href="{php echo web_url('order/wlOrder/send', array('id' => $item['orderid'],'type' => 'a','edit_flag'=>1))}">修改物流</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
{$pager} |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,134 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class ConsumptionModuleUniapp extends Uniapp { |
|||
/** |
|||
* Comment: 积分商品信息列表 |
|||
* Author: zzw |
|||
* Date: 2019/8/7 14:28 |
|||
*/ |
|||
public function homeList(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? $_GPC['page'] : 1; |
|||
$type = $_GPC['type'] ? trim($_GPC['type']) : '';//goods=普通积分商品;credit2=余额积分商品;halfcard=会员卡积分商品 |
|||
$page_index = $_GPC['page_index'] ? $_GPC['page_index'] : 10; |
|||
$page_start = $page * $page_index - $page_index; |
|||
$cate_id = $_GPC['cate_id'] ? : ''; |
|||
$is_vip = $_GPC['is_vip'] ? : 0;//是否获取专属商品 |
|||
|
|||
$time = $_GPC['time'] ?: time();//时间筛选 |
|||
$week = date("w", $time);//当前时间的星期 |
|||
if ($week == 0) $week = 7;//星期天时值的转换 |
|||
$toDay = date("j", $time);//当前时间的日期 |
|||
|
|||
$search = trim($_GPC['search']); |
|||
|
|||
$set = Setting::agentsetting_read("pluginlist"); |
|||
$sort = $_GPC['sort'] ? : $set['jfsort']; |
|||
|
|||
#2、生成基本查询条件 |
|||
$where = " uniacid = {$_W['uniacid']} AND status = 1 "; |
|||
|
|||
$where .= " AND CASE usedatestatus |
|||
WHEN 1 THEN `week` LIKE '%\"{$week}\"%' |
|||
WHEN 2 THEN `day` LIKE '%\"{$toDay}\"%' |
|||
WHEN 0 THEN id > 0 |
|||
END "; |
|||
|
|||
if (!empty($type)) $where .= " AND type = '{$type}' "; |
|||
if ($cate_id > 0) $where .= " AND category_id = {$cate_id} "; |
|||
if ($is_vip == 1) $where .= " AND vipstatus IN (1,2) "; |
|||
if (!empty($search)) $where.= " AND title LIKE '%{$search}%'"; |
|||
#4、生成排序条件 |
|||
switch ($sort) { |
|||
case 1:$order = " ORDER BY id DESC ";break;//创建时间 |
|||
case 3:$order = " ORDER BY displayorder DESC ";break;//默认排序 |
|||
case 4:$order = " ORDER BY pv DESC ";break;//浏览人气 |
|||
} |
|||
#5、获取总页数 |
|||
$total = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename(PDO_NAME . "consumption_goods") . " WHERE {$where}"); |
|||
$info['total'] = ceil($total / $page_index); |
|||
#2、判断用户是否为会员 |
|||
$cardid = WeliamWeChat::VipVerification($_W['mid'],true); |
|||
#5、获取商品列表 |
|||
$sql = "SELECT id,thumb,title,old_price, |
|||
CASE WHEN {$cardid} > 0 AND vipstatus = 1 THEN vipcredit1 |
|||
ELSE use_credit1 |
|||
END as use_credit1, |
|||
CASE WHEN {$cardid} > 0 AND vipstatus = 1 THEN vipcredit2 |
|||
ELSE use_credit2 |
|||
END as use_credit2 FROM " . |
|||
tablename(PDO_NAME . "consumption_goods") . |
|||
" WHERE {$where}{$order}"." LIMIT {$page_start},{$page_index} "; |
|||
$info['list'] = pdo_fetchall($sql); |
|||
#6、循环处理信息 |
|||
foreach ($info['list'] as $key => &$val) { |
|||
$val['thumb'] = tomedia($val['thumb']); |
|||
$val['url'] = h5_url('pages/subPages/goods/index',array('goods_id' => $val['id'],'goodsType'=>'integral')); |
|||
} |
|||
|
|||
$this->renderSuccess('积分商品信息列表',$info); |
|||
} |
|||
/** |
|||
* Comment: 积分商城首页基本信息获取 |
|||
* Author: zzw |
|||
* Date: 2019/8/22 18:26 |
|||
*/ |
|||
public function homeInfo(){ |
|||
global $_W,$_GPC; |
|||
if($_W['wlsetting']['consumption']['status'] != 1) $this->renderError('未开启积分商城',['url'=>h5_url('pages/mainPages/userCenter/userCenter')]); |
|||
#1、获取幻灯片信息 |
|||
$adv = pdo_getall(PDO_NAME.'consumption_adv' ,['uniacid'=>$_W['uniacid'],'status'=>1] |
|||
,['link','thumb'],'',' displayorder DESC ',''); |
|||
foreach($adv as $imgK => &$imgV){ |
|||
$imgV['thumb'] = tomedia($imgV['thumb']); |
|||
} |
|||
#2、获取分类信息列表 |
|||
$classList = pdo_getall(PDO_NAME."consumption_category" ,['uniacid'=>$_W['uniacid'],'status'=>1] |
|||
,['id','name','thumb'],'',' displayorder DESC ',''); |
|||
foreach($classList as $classK => &$classV){ |
|||
$classV['thumb'] = tomedia($classV['thumb']); |
|||
} |
|||
#3、获取基本信息 |
|||
$info['integral'] = $_W['wlmember']['credit1'];//积分 |
|||
if($_W['wlsetting']['consumption']['community'] > 0){ |
|||
$info['community'] = Commons::getCommunity($_W['wlsetting']['consumption']['community']); |
|||
} |
|||
#4、信息拼装 |
|||
$info['adv'] = $adv; |
|||
$info['class'] = $classList; |
|||
|
|||
$this->renderSuccess('积分商城首页基本信息',$info); |
|||
} |
|||
/** |
|||
* Comment: 获取积分商品详情 |
|||
* Author: zzw |
|||
* Date: 2019/8/23 9:36 |
|||
*/ |
|||
public function detail(){ |
|||
global $_W,$_GPC; |
|||
#1、参数接收 |
|||
$id = $_GPC['id'] OR $this->renderError('缺少参数:id'); |
|||
$info = WeliamWeChat::getHomeGoods(8,$id); |
|||
$info['postertype'] = intval(10); |
|||
if($_W['wlsetting']['halfcard']['status'] > 0 && $info['vipstatus'] > 0){ |
|||
$info['is_open_vip'] = 1; |
|||
}else{ |
|||
$info['is_open_vip'] = 0; |
|||
} |
|||
$this->renderSuccess('积分商品详情',$info); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取积分商品分类列表 |
|||
* Author: wlf |
|||
* Date: 2020/09/21 14:39 |
|||
*/ |
|||
public function cateList(){ |
|||
global $_W , $_GPC; |
|||
$list = pdo_getall('wlmerchant_consumption_category',array('uniacid' => $_W['uniacid'],'status' => 1),array('id','name'), '' , 'displayorder DESC'); |
|||
$this->renderSuccess('积分分类',$list); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,704 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
|
|||
class Dating { |
|||
/** |
|||
* Comment: 默认标签列表 |
|||
* Author: zzw |
|||
* Date: 2021/2/25 15:12 |
|||
* @return string[] |
|||
*/ |
|||
public static function defaultLabelList(){ |
|||
return [ |
|||
'爱网球', |
|||
'爱羽毛球', |
|||
'爱篮球', |
|||
'爱养宠物', |
|||
'爱足球', |
|||
'背包客', |
|||
'玩游戏', |
|||
'爱摄影', |
|||
'爱滑板', |
|||
'二次元', |
|||
'手办发烧友', |
|||
'赛车', |
|||
'健身', |
|||
'文艺青年', |
|||
'游泳' |
|||
]; |
|||
} |
|||
/** |
|||
* Comment: 根据日期获取年龄 |
|||
* Author: zzw |
|||
* Date: 2021/2/25 18:25 |
|||
* @param string $birthday |
|||
* @return false|int|mixed|string |
|||
*/ |
|||
public static function getAge(string $birthday){ |
|||
[$year , $month , $day] = explode("-" , $birthday); |
|||
$year_diff = date("Y") - $year; |
|||
$month_diff = date("m") - $month; |
|||
$day_diff = date("d") - $day; |
|||
if ($day_diff < 0 && $month_diff < 0) $year_diff--; |
|||
return $year_diff; |
|||
} |
|||
/** |
|||
* Comment: 地区处理 |
|||
* Author: zzw |
|||
* Date: 2021/2/26 9:48 |
|||
* @param $provinceId |
|||
* @param $cityId |
|||
* @param $areaId |
|||
* @return mixed|string |
|||
*/ |
|||
public static function handleAreaInfo($provinceId,$cityId,$areaId){ |
|||
if ($provinceId) $province = pdo_getcolumn(PDO_NAME."area",['id' => $provinceId],'name'); |
|||
if ($cityId) $city = pdo_getcolumn(PDO_NAME."area",['id' => $cityId],'name'); |
|||
if ($areaId) $area = pdo_getcolumn(PDO_NAME."area",['id' => $areaId],'name'); |
|||
if($province && $city && $area) $address = $province.$city.$area; |
|||
else if($province && $city && !$area) $address = $province.$city; |
|||
else if(!$province && $city && $area) $address = $city.$area; |
|||
else if($province) $address = $province; |
|||
else if($city) $address = $city; |
|||
else if($area) $address = $area; |
|||
|
|||
return $address; |
|||
} |
|||
/** |
|||
* Comment: 判断当前用户是否收藏|浏览某个用户 |
|||
* Author: zzw |
|||
* Date: 2021/3/8 15:09 |
|||
* @param int|string $mid 当前用户id |
|||
* @param int|string $objectMid 收藏|浏览对象用户id |
|||
* @param int $type 1=收藏,2=浏览历史 |
|||
* @return int |
|||
*/ |
|||
public static function isCollectionOrBrowse($mid,$objectMid,$type = 1){ |
|||
global $_W; |
|||
$isHave = pdo_get(PDO_NAME."dating_record",['mid'=>$mid,'object_mid'=>$objectMid,'uniacid'=>$_W['uniacid'],'type'=>$type]); |
|||
if ($isHave) return 1; |
|||
else return 0; |
|||
} |
|||
/** |
|||
* Comment: 判断当前会员是否为会员 |
|||
* Author: zzw |
|||
* Date: 2021/3/8 16:40 |
|||
* @param $mid |
|||
* @return array |
|||
*/ |
|||
public static function isVip($mid){ |
|||
global $_W; |
|||
//获取用户开卡信息 |
|||
$info = pdo_get(PDO_NAME."dating_member_open",['mid'=>$mid]); |
|||
$data = [ |
|||
'status' => 1,//是否为会员 0=不是,1=是 |
|||
'num_time' => '0',//到期时间|剩余次数 |
|||
]; |
|||
if($info){ |
|||
//存在会员信息,进行处理 会员卡类型:1=时限卡,2=次数卡 |
|||
if($info['type'] == 1){ |
|||
$data['num_time'] = date("Y-m-d H:i",$info['end_time']);//到期时间 |
|||
if($info['end_time'] <= time()) $data['status'] = 0;//会员卡已到过期时间 已过期 |
|||
}else if($info['type'] == 2){ |
|||
$use = pdo_count(PDO_NAME."dating_member_use",['mid'=>$mid,'uniacid'=>$_W['uniacid']]); |
|||
$data['num_time'] = $info['frequency'] - $use;//剩余次数 |
|||
if($data['num_time'] <= 0) $data['status'] = 0;//会员卡次数已使用完毕 已过期 |
|||
} |
|||
}else{ |
|||
//无开卡信息 不是会员 |
|||
$data['status'] = 0; |
|||
} |
|||
|
|||
return [$data['status'] ,$data['num_time']]; |
|||
} |
|||
/** |
|||
* Comment: 获取会员详细信息 |
|||
* Author: zzw |
|||
* Date: 2021/4/1 14:17 |
|||
* @param $mid |
|||
* @return array |
|||
*/ |
|||
public static function getVipInfo($mid){ |
|||
$vip = pdo_get(PDO_NAME."dating_member_open",['mid'=>$mid],['type','end_time','frequency']); |
|||
if($vip){ |
|||
//到期时间 |
|||
$vip['end_time_text'] = date("Y-m-d H:i",$vip['end_time']); |
|||
//剩余次数 |
|||
$useTotal = pdo_count(PDO_NAME."dating_member_use",['mid' => $mid]); |
|||
$surplusNumber = $vip['frequency'] - $useTotal; |
|||
$vip['surplus_number'] = $surplusNumber > 0 ? $surplusNumber : 0; |
|||
$isVip = 1; |
|||
//判断是否已经过期或者失效 会员卡类型:1=时限卡,2=次数卡 |
|||
if($vip['type'] == 1 && $vip['end_time'] <= time()) { |
|||
$vip['type'] = '3';//已过期 |
|||
$isVip = 0; |
|||
} else if($vip['type'] == 2 && $surplusNumber <= 0) { |
|||
$vip['type'] = '4';//已失效 |
|||
$isVip = 0; |
|||
} |
|||
}else{ |
|||
//不存在会员卡 |
|||
$vip = []; |
|||
$isVip = 0; |
|||
} |
|||
|
|||
return [$vip,$isVip]; |
|||
} |
|||
/** |
|||
* Comment: 判断是否交换联系方式 |
|||
* Author: zzw |
|||
* Date: 2021/3/8 16:46 |
|||
* @param $midOne |
|||
* @param $midTwo |
|||
* @return int |
|||
*/ |
|||
public static function isExchange($midOne,$midTwo){ |
|||
global $_W; |
|||
$sql = "SELECT * FROM ".tablename(PDO_NAME."dating_exchange") |
|||
." WHERE (mid_one = {$midOne} AND mid_two = {$midTwo}) OR (mid_one = {$midTwo} AND mid_two = {$midOne})"; |
|||
$isHave = pdo_fetch($sql); |
|||
if($isHave) return 1; |
|||
else return 0; |
|||
} |
|||
/** |
|||
* Comment: 佣金变更记录 |
|||
* Author: zzw |
|||
* Date: 2021/3/15 16:10 |
|||
* @param int $mid 用户id |
|||
* @param float|int|string $money 金额 |
|||
* @param string $reason 备注 |
|||
* @param int $type 类型 |
|||
* @param int|string $orderId 订单id |
|||
* @return false|mixed |
|||
*/ |
|||
public static function commissionChangeRecord($mid,$money,$reason,$type = 1,$orderId = 0){ |
|||
global $_W; |
|||
$matchmakerId = pdo_getcolumn(PDO_NAME."dating_matchmaker",['mid' => $mid,'uniacid' => $_W['uniacid']],'id'); |
|||
$data = [ |
|||
'uniacid' => $_W['uniacid'], |
|||
'mid' => $mid, |
|||
'matchmaker_id' => $matchmakerId,//红娘id |
|||
'type' => $type,//类型:1=增加,2=减少 |
|||
'money' => $money,//金额 |
|||
'order_id' => $orderId, |
|||
'reason' => $reason, |
|||
'create_time' => time() |
|||
]; |
|||
return pdo_insert(PDO_NAME."dating_matchmaker_commission",$data); |
|||
} |
|||
/** |
|||
* Comment: 发送信息交换成功模板消息通知 |
|||
* Author: zzw |
|||
* Date: 2021/4/8 14:22 |
|||
* @param int $theMid 当前用户的mid |
|||
* @param int $mid 被推荐用户的mid |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
*/ |
|||
public static function sendExchangeInfo(int $theMid,int $mid){ |
|||
global $_W; |
|||
[$nickname,$avatar] = Dating::handleUserInfo($mid); |
|||
$memberId = pdo_getcolumn(PDO_NAME."dating_member",['mid'=>$mid],'id'); |
|||
$modelData = [ |
|||
'first' => '您的红娘为您推荐了一个朋友', |
|||
'type' => '信息交换', |
|||
'content' => "您的红娘将您的信息和{$nickname}的信息进行了交换,现在您可以查看该用户的详细信息了!", |
|||
'status' => '交换成功', |
|||
'time' => date("Y-m-d H:i:s",time()), |
|||
'remark' => "点击查看" |
|||
]; |
|||
$url = h5_url('pages/subPages2/blindDate/member/detail',['id'=>$memberId]); |
|||
TempModel::sendInit('service',$theMid,$modelData,$_W['source'],$url); |
|||
} |
|||
/** |
|||
* Comment: 发送信息通知取消交换信息 |
|||
* Author: zzw |
|||
* Date: 2021/4/8 14:33 |
|||
* @param int $theMid 当前用户的mid |
|||
* @param int $mid 被推荐用户的mid |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
*/ |
|||
public static function sendCancelExchangeInfo(int $theMid,int $mid){ |
|||
global $_W; |
|||
[$nickname,$avatar] = Dating::handleUserInfo($mid); |
|||
$modelData = [ |
|||
'first' => '您的红娘取消了一个信息交换', |
|||
'type' => '取消交换', |
|||
'content' => "您的红娘取消了您和{$nickname}的信息交换,您授权了查看该用户详细信息的权利!", |
|||
'status' => '取消成功', |
|||
'time' => date("Y-m-d H:i:s",time()), |
|||
'remark' => "" |
|||
]; |
|||
TempModel::sendInit('service',$theMid,$modelData,$_W['source']); |
|||
} |
|||
/** |
|||
* Comment: 发送 动态评论&评论回复 的通知模板消息 |
|||
* Author: zzw |
|||
* Date: 2021/4/13 14:24 |
|||
* @param $mid |
|||
* @param $replyId |
|||
* @param $dynamicId |
|||
* @param $content |
|||
* @param $source |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
*/ |
|||
public static function sendCommentModel($mid,$replyId,$dynamicId,$content,$source){ |
|||
[$nickname,$avatar] = self::handleUserInfo($mid); |
|||
//发送模板消息 |
|||
if($replyId > 0){ |
|||
//回复某条评论 发送给评论的用户 |
|||
$first = "您好,[{$nickname}]回复了您的评论"; |
|||
$type = "评论回复"; |
|||
$theMid = pdo_getcolumn(PDO_NAME."dating_dynamic_comment",['id'=>$replyId],'mid'); |
|||
}else{ |
|||
//对动态进行评论 发送给动态发布用户 |
|||
$first = "您好,[{$nickname}]进行了评论"; |
|||
$type = "动态评论"; |
|||
$theMid = pdo_getcolumn(PDO_NAME."dating_dynamic",['id'=>$dynamicId],'mid'); |
|||
} |
|||
if($theMid > 0){ |
|||
$modelData = [ |
|||
'first' => $first, |
|||
'type' => $type, |
|||
'content' => $content, |
|||
'status' => '待查看', |
|||
'time' => date("Y-m-d H:i:s",time()), |
|||
'remark' => "请尽快查看" |
|||
]; |
|||
$url = h5_url('pages/subPages2/blindDate/dynamics/detail',['id'=>$dynamicId]); |
|||
TempModel::sendInit('service',$theMid,$modelData,$source,$url); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 获取用户昵称和用户头像 先查看相亲交友会员表然后查看用户信息表 |
|||
* Author: zzw |
|||
* Date: 2021/3/9 10:58 |
|||
* @param $mid |
|||
* @return array |
|||
*/ |
|||
public static function handleUserInfo($mid){ |
|||
global $_W; |
|||
$user = pdo_get(PDO_NAME."member",['id'=>$mid],['nickname','avatar','realname']); |
|||
|
|||
return [$user['nickname'],tomedia($user['avatar']),$user['realname']]; |
|||
} |
|||
/** |
|||
* Comment: 会员基本信息处理 |
|||
* Author: zzw |
|||
* Date: 2021/2/26 15:54 |
|||
* @param $info |
|||
* @return mixed |
|||
*/ |
|||
public static function handleMemberInfo($info){ |
|||
//用户基本信息处理 |
|||
if($info['mid']){ |
|||
[$info['nickname'],$info['avatar'],$info['realname']] = self::handleUserInfo($info['mid']); |
|||
} |
|||
//出生日期&年龄 |
|||
if($info['birth']) { |
|||
$info['birth_text'] = date("Y-m-d",$info['birth']);//出生日期 |
|||
$info['age'] = self::getAge(date("Y-m-d",$info['birth']));//年龄 |
|||
} |
|||
//婚姻情况:1=未婚,2=离异(无子女),3=离异(有抚养权),4=离异(无抚养权),5=丧偶(无子女),6=丧偶(有子女) |
|||
if($info['marital_status']){ |
|||
switch ($info['marital_status']){ |
|||
case 1:$info['marital_status_text'] = '未婚';break; |
|||
case 2:$info['marital_status_text'] = '离异(无子女)';break; |
|||
case 3:$info['marital_status_text'] = '离异(有抚养权)';break; |
|||
case 4:$info['marital_status_text'] = '离异(无抚养权)';break; |
|||
case 5:$info['marital_status_text'] = '丧偶(无子女)';break; |
|||
case 6:$info['marital_status_text'] = '丧偶(有子女)';break; |
|||
} |
|||
} |
|||
//学历:1=小学,2=初中,3=高中/中专,4=专科,5=本科,6=硕士,7=博士 |
|||
if($info['education']){ |
|||
switch ($info['education']){ |
|||
case 1:$info['education_text'] = '小学';break; |
|||
case 2:$info['education_text'] = '初中';break; |
|||
case 3:$info['education_text'] = '高中/中专';break; |
|||
case 4:$info['education_text'] = '专科';break; |
|||
case 5:$info['education_text'] = '本科';break; |
|||
case 6:$info['education_text'] = '硕士';break; |
|||
case 7:$info['education_text'] = '博士';break; |
|||
} |
|||
} |
|||
//所在城市 |
|||
if ($info['current_province'] || $info['current_city'] || $info['current_area']) $info['current_address'] = self::handleAreaInfo($info['current_province'],$info['current_city'],$info['current_area']); |
|||
//户籍所在城市 |
|||
if ($info['hometown_province'] || $info['hometown_city'] || $info['hometown_area']) $info['hometown_address'] = self::handleAreaInfo($info['hometown_province'],$info['hometown_city'],$info['hometown_area']); |
|||
//户籍类型:1=农业户口,2=非农业户口 |
|||
if($info['registered_residence_type']) { |
|||
if ($info['registered_residence_type'] == 1) $info['registered_residence'] = '农业户口'; |
|||
else $info['registered_residence'] = '非农业户口'; |
|||
} |
|||
//居住情况:1=自购房(有贷款),2=自购房(无贷款),3=租房(合租),4=租房(整租),5=与父母同住,6=借住亲朋家,7=单位住房 |
|||
if($info['live']){ |
|||
switch ($info['live']){ |
|||
case 1:$info['live_text'] = '自购房(有贷款)';break; |
|||
case 2:$info['live_text'] = '自购房(无贷款)';break; |
|||
case 3:$info['live_text'] = '租房(合租)';break; |
|||
case 4:$info['live_text'] = '租房(整租)';break; |
|||
case 5:$info['live_text'] = '与父母同住';break; |
|||
case 6:$info['live_text'] = '借住亲朋家';break; |
|||
case 7:$info['live_text'] = '单位住房';break; |
|||
} |
|||
} |
|||
//出行情况:1=未购车,2=已购车 |
|||
if($info['travel']){ |
|||
if($info['travel'] == 1) $info['travel_text'] = '未购车'; |
|||
else $info['travel_text'] = '已购车'; |
|||
} |
|||
//择偶要求 - 婚姻情况:1=不限,2=未婚,3=离异,4=丧偶 |
|||
if($info['require_marital_status']){ |
|||
switch ($info['require_marital_status']){ |
|||
case 1:$info['require_marital'] = '不限';break; |
|||
case 2:$info['require_marital'] = '未婚';break; |
|||
case 3:$info['require_marital'] = '离异';break; |
|||
case 4:$info['require_marital'] = '丧偶';break; |
|||
} |
|||
} |
|||
//择偶要求 - 学历:1=不限,2=小学,3=初中,4=高中/中专,5=专科,6=本科,7=硕士,8=博士 |
|||
if($info['require_education']){ |
|||
switch ($info['require_education']){ |
|||
case 1:$info['require_education_text'] = '不限';break; |
|||
case 2:$info['require_education_text'] = '小学';break; |
|||
case 3:$info['require_education_text'] = '初中';break; |
|||
case 4:$info['require_education_text'] = '高中/中专';break; |
|||
case 5:$info['require_education_text'] = '专科';break; |
|||
case 6:$info['require_education_text'] = '本科';break; |
|||
case 7:$info['require_education_text'] = '硕士';break; |
|||
case 8:$info['require_education_text'] = '博士';break; |
|||
} |
|||
} |
|||
//个性标签 |
|||
if($info['label_id']){ |
|||
$labelId = explode(',',$info['label_id']); |
|||
$labelList = pdo_getall(PDO_NAME."dating_label",['id IN'=>$labelId],['title']); |
|||
$info['label_list'] = array_column($labelList,'title'); |
|||
} |
|||
//个人照片 |
|||
if($info['photo']){ |
|||
$photo = unserialize($info['photo']); |
|||
foreach($photo as &$img){ |
|||
$img = tomedia($img); |
|||
} |
|||
$info['photo_show'] = $photo; |
|||
} |
|||
//个人视频 |
|||
if($info['video']) $info['video_show'] = tomedia($info['video']); |
|||
//封面图 |
|||
if($info['cover']) $info['cover_show'] = tomedia($info['cover']); |
|||
//置顶结束时间 |
|||
if($info['top_end_time']) $info['top_end_time_text'] = date("Y-m-d H:i",$info['top_end_time']); |
|||
//创建时间 |
|||
if($info['create_time']) $info['create_time_text'] = date("Y-m-d H:i",$info['create_time']); |
|||
//距离处理 |
|||
if($info['distances']){ |
|||
if($info['distances'] < 1000){ |
|||
$info['distances_text'] = $info['distances'].'m'; |
|||
}else{ |
|||
$info['distances_text'] = sprintf("%.2f",$info['distances'] / 1000).'km'; |
|||
} |
|||
} |
|||
|
|||
return $info; |
|||
} |
|||
/** |
|||
* Comment: 动态基本信息处理 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 14:33 |
|||
* @param $info |
|||
* @return mixed |
|||
*/ |
|||
public static function handleDynamicInfo($info){ |
|||
global $_W; |
|||
//用户信息 是否为虚拟动态:1=不是,2=是 |
|||
if($info['is_fictitious'] == 1 && $info['mid'] > 0){ |
|||
//不是虚拟动态信息 获取对应的数据信息 |
|||
[$info['nickname'],$info['avatar']] = self::handleUserInfo($info['mid']); |
|||
$info['gneder'] = pdo_getcolumn(PDO_NAME."dating_member",['mid'=>$info['mid']],'gneder'); |
|||
}else if($info['is_fictitious'] == 2 && $info['fictitious_nickname'] && $info['fictitious_avatar']){ |
|||
$info['nickname'] = $info['fictitious_nickname']; |
|||
$info['avatar'] = tomedia($info['fictitious_avatar']); |
|||
if(empty($info['gender'])){ |
|||
$info['gneder'] = 2; |
|||
}else{ |
|||
$info['gneder'] = $info['gender']; |
|||
} |
|||
} |
|||
//图片信息 |
|||
if($info['photo']){ |
|||
$photo = unserialize($info['photo']); |
|||
foreach($photo as &$img){ |
|||
$img = tomedia($img); |
|||
} |
|||
$info['photo_show'] = $photo; |
|||
} |
|||
//视频信息处理 |
|||
if($info['video']){ |
|||
$info['video_show'] = tomedia($info['video']); |
|||
} |
|||
//发布时间 |
|||
if($info['create_time']){ |
|||
$info['create_time_text'] = date("Y-m-d H:i",$info['create_time']); |
|||
} |
|||
//点赞数量&评论数量 |
|||
if($info['id']){ |
|||
//点赞数量 |
|||
$info['fabulous'] = pdo_count(PDO_NAME."dating_dynamic_fabulous",['dynamic_id'=>$info['id']]); |
|||
//评论数量 |
|||
$commentCountWhere = " WHERE dynamic_id = {$info['id']} AND (status = 3 OR mid = {$_W['mid']}) "; |
|||
$commentCountSql = " SELECT count(*) FROM ".tablename(PDO_NAME."dating_dynamic_comment").$commentCountWhere;; |
|||
$info['comment'] = pdo_fetchcolumn($commentCountSql); |
|||
} |
|||
//距离处理 |
|||
if($info['distances']){ |
|||
if($info['distances'] < 1000){ |
|||
$info['distances_text'] = $info['distances'].'m'; |
|||
}else{ |
|||
$info['distances_text'] = sprintf("%.2f",$info['distances'] / 1000).'km'; |
|||
} |
|||
} |
|||
|
|||
return $info; |
|||
} |
|||
/** |
|||
* Comment: 红娘信息处理 |
|||
* Author: zzw |
|||
* Date: 2021/3/3 11:10 |
|||
* @param $info |
|||
* @return mixed |
|||
*/ |
|||
public static function handleMatchmakerInfo($info){ |
|||
//用户信息 |
|||
if ($info['mid']){ |
|||
[$nickname,$avatar] = self::handleUserInfo($info['mid']); |
|||
$info['nickname'] = $info['nickname'] ? : $nickname; |
|||
$info['avatar'] = $info['avatar'] ? tomedia($info['avatar']) : $avatar; |
|||
} |
|||
//二维码 |
|||
if($info['qrcode']) $info['qrcode'] = tomedia($info['qrcode']); |
|||
//状态:1=待付款,2=待审核,3=已通过,4=未通过 |
|||
if($info['status']){ |
|||
switch ($info['status']){ |
|||
case 1: $info['status_text'] = '待付款';break; |
|||
case 2: $info['status_text'] = '待审核';break; |
|||
case 3: $info['status_text'] = '已通过';break; |
|||
case 4: $info['status_text'] = '未通过';break; |
|||
} |
|||
} |
|||
//创建时间 |
|||
if($info['create_time']) $info['create_time_text'] = date('Y-m-d H:i',$info['create_time']); |
|||
//获取客户数量 |
|||
if($info['id']) $info['customer'] = pdo_count(PDO_NAME."dating_member",['matchmaker_id'=>$info['id']]); |
|||
|
|||
return $info; |
|||
} |
|||
/** |
|||
* Comment: 会员卡开通|续费操作处理 |
|||
* Author: zzw |
|||
* Date: 2021/3/15 17:26 |
|||
* @param int|string $vipId |
|||
* @param int|string $mid |
|||
* @param int|float|string $money |
|||
* @return false|mixed |
|||
*/ |
|||
public static function handleVipInfo($vipId,$mid,$money = 0){ |
|||
global $_W; |
|||
//参数信息获取 |
|||
$vip = pdo_get(PDO_NAME."dating_vip",['id' => $vipId]); |
|||
$info = pdo_get(PDO_NAME."dating_member_open",['mid' => $mid],[ |
|||
'type', |
|||
'end_time', |
|||
'frequency', |
|||
'create_time', |
|||
'update_time' |
|||
]); |
|||
$data['end_time'] = $info['end_time'] > 0 ? $info['end_time'] : time(); |
|||
$data['frequency'] = $info['frequency'] > 0 ? $info['frequency'] : 0; |
|||
$data['create_time'] = $info['create_time'] > 0 ? $info['create_time'] : time(); |
|||
$data['update_time'] = time(); |
|||
//根据会员卡类型进行对应的操作 会员卡类型:1=时限卡,2=次数卡 |
|||
if($vip['type'] == 1) { |
|||
$nowTime = time(); |
|||
$time = $data['end_time'] > $nowTime ? $data['end_time'] : $nowTime; |
|||
$data['end_time'] = $time + ($vip['day'] * 86400);//修改过期时间 |
|||
} else if($vip['type'] == 2) { |
|||
$data['frequency'] = $data['frequency'] + $vip['second'];//修改最大次数 |
|||
} |
|||
//修改信息 |
|||
$data['type'] = $vip['type']; |
|||
if($info){ |
|||
//修改信息 |
|||
$res = pdo_update(PDO_NAME."dating_member_open",$data,['mid'=>$mid]); |
|||
}else{ |
|||
//添加信息 |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['mid'] = $mid; |
|||
$data['create_time'] = time(); |
|||
|
|||
$res = pdo_insert(PDO_NAME."dating_member_open",$data); |
|||
} |
|||
if($res){ |
|||
//记录变更信息 |
|||
$record = [ |
|||
'create_time' => time(), |
|||
'title' => $vip['title'], |
|||
'type' => $vip['type'], |
|||
'day' => $vip['day'], |
|||
'frequency' => $vip['second'], |
|||
'money' => sprintf("%.2f",$money), |
|||
'mid' => $mid, |
|||
]; |
|||
return pdo_insert(PDO_NAME."dating_vip_record",$record); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 红娘佣金信息处理 |
|||
* Author: zzw |
|||
* Date: 2021/4/1 15:54 |
|||
* @param $matchmakerId |
|||
* @param $money |
|||
* @param string $reason |
|||
* @param string $orderId |
|||
*/ |
|||
public static function handleMatchmakerCommissionInfo($matchmakerId,$money,$reason = '',$orderId = ''){ |
|||
global $_W; |
|||
//获取红娘信息 |
|||
$matchmaker = pdo_get(PDO_NAME."dating_matchmaker",['id' => $matchmakerId] |
|||
,['mid','status','total_commission','commission']); |
|||
if($matchmaker['status'] == 3){ |
|||
//已通过红娘才能获取佣金 |
|||
$set = Setting::wlsetting_read('dating_set'); |
|||
$commission = $money * ($set['commission'] / 100);//佣金 |
|||
//佣金修改 |
|||
$updateDate = [ |
|||
'total_commission' => $matchmaker['total_commission'] + $commission, |
|||
'commission' => $matchmaker['commission'] + $commission, |
|||
]; |
|||
pdo_update(PDO_NAME."dating_matchmaker",$updateDate,['id'=>$matchmakerId]); |
|||
//记录佣金变更记录 type:类型:1=增加,2=减少 |
|||
self::commissionChangeRecord($matchmaker['mid'],$commission,$reason,1,$orderId); |
|||
//发送模板消息 |
|||
$modelData = [ |
|||
'first' => $reason, |
|||
'type' => '佣金到账通知', |
|||
'content' => "到账佣金:{$commission}", |
|||
'status' => '已到账', |
|||
'time' => date("Y-m-d H:i:s",time()), |
|||
]; |
|||
TempModel::sendInit('service',$matchmaker['mid'],$modelData,$_W['source']); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 置顶支付回调 |
|||
* Author: zzw |
|||
* Date: 2021/4/1 15:55 |
|||
* @param $params |
|||
*/ |
|||
public static function payDatingTopNotify($params) { |
|||
global $_W; |
|||
$order = pdo_get(PDO_NAME."order",['orderno' => $params['tid']],['plugin','id','fkid','fightstatus','num']); |
|||
//更新订单 |
|||
$data = ['status' => $params['result'] == 'success' ? 3 : 0]; |
|||
$data['paytype'] = $params['type']; |
|||
if ($params['tag']['transaction_id']) $data['transid'] = $params['tag']['transaction_id']; |
|||
$data['paytime'] = TIMESTAMP; |
|||
pdo_update(PDO_NAME.'order',$data,['id' => $order['id']]); |
|||
//用户信息置顶/置顶续费 操作 |
|||
$memberInfo = pdo_get(PDO_NAME."dating_member",['id'=>$order['fkid']],['is_top','mid','top_end_time','matchmaker_id']); |
|||
$nowTime = time(); |
|||
$endTime = $memberInfo['top_end_time'] > $nowTime ? $memberInfo['top_end_time'] : $nowTime;//当前时间 过期时间和当前时间取最大值 |
|||
$updateData['is_top'] = 2;//是否置顶:1=未置顶,2=置顶中 |
|||
$updateData['top_end_time'] = $endTime + ($order['num'] * 86400);//过期时间 |
|||
pdo_update(PDO_NAME."dating_member",$updateData,['id'=>$order['fkid']]); |
|||
//红娘佣金生成 |
|||
if($memberInfo['matchmaker_id'] > 0) { |
|||
[$nickname,$avatar] = self::handleUserInfo($memberInfo['mid']); |
|||
self::handleMatchmakerCommissionInfo($memberInfo['matchmaker_id'],$params['fee'],"用户[{$nickname}]信息置顶佣金",$params['tid']); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 红娘入驻支付回调 |
|||
* Author: zzw |
|||
* Date: 2021/4/1 16:03 |
|||
* @param $params |
|||
*/ |
|||
public static function payDatingMatchmakerNotify($params) { |
|||
global $_W; |
|||
$order = pdo_get(PDO_NAME."order",['orderno' => $params['tid']],['plugin','id','fkid','fightstatus','num']); |
|||
//更新订单 |
|||
$data = ['status' => $params['result'] == 'success' ? 3 : 0]; |
|||
$data['paytype'] = $params['type']; |
|||
if ($params['tag']['transaction_id']) $data['transid'] = $params['tag']['transaction_id']; |
|||
$data['paytime'] = TIMESTAMP; |
|||
pdo_update(PDO_NAME.'order',$data,['id' => $order['id']]); |
|||
//红娘入驻支付回调 |
|||
$matchmaker = pdo_get(PDO_NAME."dating_matchmaker",['id'=>$order['fkid']]); |
|||
if($matchmaker){ |
|||
$set = Setting::wlsetting_read('dating_set'); |
|||
//根据设置判断状态 |
|||
if($set['matchmaker_examine'] == 1) $updateData['status'] = 2;//需要审核 待审核 |
|||
else $updateData['status'] = 3;//不用审核审核 已通过 |
|||
|
|||
$res = pdo_update(PDO_NAME."dating_matchmaker",$updateData,['id'=>$order['fkid']]); |
|||
//需要审核 支付成功后通知管理员进行审核操作 |
|||
if($res && $updateData['status'] == 2){ |
|||
[$nickname,$avatar] = Dating::handleUserInfo($matchmaker['mid']); |
|||
$first = '有新的红娘需要进行审核!';//消息头部 |
|||
$content = '您好,用户['.$nickname.']申请成为红娘,请尽快进行审核!';//业务内容 |
|||
$type = "红娘审核";//业务类型 |
|||
$status = "待审核";//处理结果 |
|||
$remark = "请尽快处理!";//备注信息 |
|||
$time = time();//操作时间 |
|||
|
|||
News::noticeAgent('dating_matchmaker_examine',-1,$first,$type,$content,$status,$remark,$time); |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
/** |
|||
* Comment: 开通会员支付回调 |
|||
* Author: zzw |
|||
* Date: 2021/4/1 16:28 |
|||
* @param $params |
|||
*/ |
|||
public static function payDatingVipNotify($params) { |
|||
global $_W; |
|||
$order = pdo_get(PDO_NAME."order",['orderno' => $params['tid']],['plugin','id','fkid','fightstatus','num','mid']); |
|||
//更新订单 |
|||
$data = ['status' => $params['result'] == 'success' ? 3 : 0]; |
|||
$data['paytype'] = $params['type']; |
|||
if ($params['tag']['transaction_id']) $data['transid'] = $params['tag']['transaction_id']; |
|||
$data['paytime'] = TIMESTAMP; |
|||
pdo_update(PDO_NAME.'order',$data,['id' => $order['id']]); |
|||
//用户信息置顶/置顶续费 操作 |
|||
self::handleVipInfo($order['fkid'],$order['mid'],$params['fee']); |
|||
$matchmakerId = pdo_getcolumn(PDO_NAME."dating_member",['mid'=>$order['mid']],'matchmaker_id'); |
|||
//红娘佣金生成 |
|||
if($matchmakerId > 0) { |
|||
[$nickname,$avatar] = self::handleUserInfo($order['mid']); |
|||
self::handleMatchmakerCommissionInfo($matchmakerId,$params['fee'],"用户[{$nickname}]开通会员卡佣金",$params['tid']); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 计划任务 |
|||
* Author: zzw |
|||
* Date: 2021/4/1 16:37 |
|||
*/ |
|||
public function doTask() { |
|||
global $_W; |
|||
//修改所有已过期的置顶 |
|||
pdo_update(PDO_NAME."dating_member",['is_top'=>1],['top_end_time <='=>time()]); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[相亲交友]]></name> |
|||
<identifie><![CDATA[dating]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[expand]]></type> |
|||
<description><![CDATA[相亲交友]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="true" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="会员管理" font="fa-inbox"> |
|||
<entry title="用户列表" ac="member" do="memberList" actions='["do",["memberList","memberSee"]]' iscover="true" /> |
|||
<entry title="会员动态" ac="member" do="dynamicList" actions='["do",["dynamicList","dynamicEdit"]]'/> |
|||
<entry title="动态评论" ac="member" do="commentList" actions='["do",["commentList"]]'/> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="会员管理" font="fa-inbox"> |
|||
<entry title="用户列表" ac="member" do="memberList" actions='["do",["memberList","memberSee"]]' iscover="true" /> |
|||
<entry title="个性标签" ac="member" do="labelList" actions='["do",["labelList","labelEdit"]]'/> |
|||
<entry title="会员动态" ac="member" do="dynamicList" actions='["do",["dynamicList","dynamicEdit"]]'/> |
|||
<entry title="动态评论" ac="member" do="commentList" actions='["do",["commentList"]]'/> |
|||
</menu> |
|||
<menu title="VIP卡管理" font="fa-inbox"> |
|||
<entry title="VIP卡" ac="vip" do="vipList" actions='["do",["vipList","vipEdit"]]'/> |
|||
<entry title="会员列表" ac="vip" do="userList" actions='["do",["userList"]]'/> |
|||
<entry title="开卡记录" ac="vip" do="recordList" actions='["do",["recordList"]]'/> |
|||
</menu> |
|||
<menu title="红娘管理" font="fa-inbox"> |
|||
<entry title="红娘列表" ac="matchmaker" do="matchmakerList" actions='["do",["matchmakerList","matchmakerEdit"]]'/> |
|||
<entry title="佣金明细" ac="matchmaker" do="commissionList" actions='["do",["commissionList"]]'/> |
|||
<entry title="订单管理" ac="matchmaker" do="orderList" actions='["do",["orderList"]]'/> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基本设置" ac="member" do="setEdit" actions='["do",["setEdit"]]'/> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,388 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
|
|||
class Matchmaker_WeliamController{ |
|||
/** |
|||
* Comment: 红娘列表 |
|||
* Author: zzw |
|||
* Date: 2021/3/3 11:26 |
|||
*/ |
|||
public function matchmakerList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$nickname = $_GPC['nickname'] ? : ''; |
|||
$status = $_GPC['status'] ? : 0; |
|||
$createSource = $_GPC['create_source'] ? : 0; |
|||
//条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} "; |
|||
if($nickname) $where .= " AND (a.nickname LIKE '%{$nickname}%' OR b.nickname LIKE '%{$nickname}%') "; |
|||
if($status > 0) $where .= " AND a.status = {$status} "; |
|||
if($createSource > 0) $where .= " AND a.create_source = {$createSource} "; |
|||
//sql语句生成 |
|||
$field = "a.id,a.mid,a.nickname,a.avatar,a.phone,a.wechat_number,a.qq_unmber,a.`describe`,a.status, |
|||
a.total_commission,a.commission,a.create_time,a.create_source"; |
|||
$order = " ORDER BY a.create_time DESC,a.id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."dating_matchmaker") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id "; |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
$val = Dating::handleMatchmakerInfo($val); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('matchmaker/index'); |
|||
} |
|||
/** |
|||
* Comment: 红娘信息编辑 |
|||
* Author: zzw |
|||
* Date: 2021/3/3 10:40 |
|||
*/ |
|||
public function matchmakerEdit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
//接收信息 并且进行对应的处理 |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
//判断信息是否完整 |
|||
if(!$data['mid']) wl_message('请选择用户!',referer(),'error'); |
|||
if(!$data['phone']) wl_message('请输入联系方式!',referer(),'error'); |
|||
if(!$data['qrcode']) wl_message('请上传二维码!',referer(),'error'); |
|||
//根据是否存在id 判断是添加操作还是修改操作 |
|||
if($id){ |
|||
pdo_update(PDO_NAME."dating_matchmaker",$data,['id'=>$id]); |
|||
|
|||
wl_message('修改成功',web_url('dating/matchmaker/matchmakerList'),'success'); |
|||
}else{ |
|||
//判断当前用户是否已经成为红娘 |
|||
$isHave = pdo_get(PDO_NAME."dating_matchmaker",['uniacid'=>$_W['uniacid'],'mid'=>$data['mid']]); |
|||
if($isHave) wl_message('添加失败,该用户已是红娘!',referer(),'error'); |
|||
//信息补充 并且进行添加操作 |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['create_time'] = time(); |
|||
$data['create_source'] = 2;//创建来源:1=用户申请,2=后台创建 |
|||
$data['status'] = 3;//状态:1=待付款,2=待审核,3=已通过,4=未通过 |
|||
pdo_insert(PDO_NAME."dating_matchmaker",$data); |
|||
|
|||
wl_message('添加成功',web_url('dating/matchmaker/matchmakerList'),'success'); |
|||
} |
|||
} |
|||
//准备信息 |
|||
if($id){ |
|||
//修改信息准备 |
|||
$info = pdo_get(PDO_NAME."dating_matchmaker",['id'=>$id]); |
|||
} |
|||
|
|||
include wl_template('matchmaker/edit'); |
|||
} |
|||
/** |
|||
* Comment: 红娘审核操作 |
|||
* Author: zzw |
|||
* Date: 2021/3/3 11:39 |
|||
*/ |
|||
public function matchmakerExamine(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR show_json(0, "参数错误,请刷新重试!"); |
|||
$status = $_GPC['status'] ? : 3;//状态:1=待付款,2=待审核,3=已通过,4=未通过 |
|||
$reason = $_GPC['reason'] ? : ''; |
|||
if($status == 4 && !$reason) show_json(0, "请输入驳回原因"); |
|||
//修改状态 |
|||
$data = [ |
|||
'status' => $status, |
|||
'reason' => $reason |
|||
]; |
|||
pdo_update(PDO_NAME."dating_matchmaker",$data,['id'=>$id]); |
|||
//发送模板消息通知用户审核结果 |
|||
if($status == 4) { |
|||
$resultText = '未通过'; |
|||
$contentText = "驳回原因:{$reason}"; |
|||
$link = "pages/subPages2/blindDate/form/matchmakerApply"; |
|||
} else if($status == 3) { |
|||
$resultText = '已通过'; |
|||
$contentText = "恭喜您,红娘信息审核已通过!"; |
|||
$link = "pages/subPages2/blindDate/form/matchmakerApply"; |
|||
} |
|||
$member = pdo_get(PDO_NAME."dating_matchmaker",['id'=>$id]); |
|||
$modelData = [ |
|||
'first' => '', |
|||
'type' => '审核结果', |
|||
'content' => $contentText, |
|||
'status' => $resultText, |
|||
'time' => date("Y-m-d H:i:s",time()), |
|||
'remark' => "点击查看" |
|||
]; |
|||
TempModel::sendInit('service',$member['mid'],$modelData,$_W['source'],h5_url($link)); |
|||
|
|||
|
|||
show_json(1, "操作成功"); |
|||
} |
|||
/** |
|||
* Comment: 删除红娘信息 |
|||
* Author: zzw |
|||
* Date: 2021/3/3 11:39 |
|||
*/ |
|||
public function matchmakerDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."dating_matchmaker",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
/** |
|||
* Comment: 获取红娘名下的用户列表 |
|||
* Author: zzw |
|||
* Date: 2021/3/3 14:56 |
|||
*/ |
|||
public function matchmakerMember(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$id = $_GPC['id'] OR wl_message('参数错误,请刷新重试',web_url('dating/matchmaker/matchmakerList'),'error'); |
|||
$nickname = $_GPC['nickname'] ? : ''; |
|||
//条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.matchmaker_id = {$id} "; |
|||
if($nickname) $where .= " AND b.nickname LIKE '%{$nickname}%' "; |
|||
//sql语句生成 |
|||
$field = "a.id,a.mid,a.gneder,a.birth,a.height,a.weight,a.nation,a.marital_status,a.education, |
|||
a.current_province,a.current_city,a.current_area"; |
|||
$order = " ORDER BY sort DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."dating_member") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id "; |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
$val = Dating::handleMemberInfo($val); |
|||
} |
|||
|
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('matchmaker/member'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 佣金明细列表 |
|||
* Author: zzw |
|||
* Date: 2021/3/16 11:07 |
|||
*/ |
|||
public function commissionList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1,intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$mid = $_GPC['mid'] ? : ''; |
|||
$type = $_GPC['type'] ? : ''; |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} "; |
|||
if($mid) $where .= " AND mid = {$mid} "; |
|||
if($type) $where .= " AND type = {$type} "; |
|||
//sql语句生成 |
|||
$field = "id,mid,type,money,order_id,reason,create_time"; |
|||
$order = " ORDER BY create_time DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."dating_matchmaker_commission"); |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
//获取用户信息 |
|||
[$val['nickname'],$val['avatar']] = Dating::handleUserInfo($val['mid']); |
|||
//获取订单号 |
|||
if($val['order_id']) $val['orderno'] = pdo_getcolumn(PDO_NAME."order",['id'=>$val['order_id']],'orderno'); |
|||
//时间处理 |
|||
$val['create_time'] = date("Y-m-d H:i:s",$val['create_time']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('commission/index'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 订单列表 |
|||
* Author: zzw |
|||
* Date: 2021/3/16 11:08 |
|||
*/ |
|||
public function orderList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1,intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND plugin = 'dating' "; |
|||
if(!empty($_GPC['payfor'])){ |
|||
if($_GPC['payfor'] == 1){ |
|||
$where .= "AND payfor = 'datingTop' "; |
|||
}else if($_GPC['payfor'] == 2){ |
|||
$where .= "AND payfor = 'datingMatchmaker' "; |
|||
}else if($_GPC['payfor'] == 3){ |
|||
$where .= "AND payfor = 'datingVip' "; |
|||
} |
|||
} |
|||
if($_GPC['keyword']){ |
|||
$keyword = $_GPC['keyword']; |
|||
if($_GPC['keywordtype'] == 1){ |
|||
$params[':name'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_member')." WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :name",$params); |
|||
if($members){ |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if($key == 0){ |
|||
$mids.= $v['id']; |
|||
}else{ |
|||
$mids.= ",".$v['id']; |
|||
} |
|||
} |
|||
$mids.= ")"; |
|||
$where .= "AND mid IN {$mids} "; |
|||
}else{ |
|||
$where .= "AND mid = 0 "; |
|||
} |
|||
}else if($_GPC['keywordtype'] == 2){ |
|||
$where .= "AND orderno LIKE '%{$keyword}%' "; |
|||
} |
|||
} |
|||
if($_GPC['time_limit']){ |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']) + 86400; |
|||
$where .= "AND paytime > {$starttime} "; |
|||
$where .= "AND paytime < {$endtime} "; |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 years'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
if(!empty($_GPC['export'])){ |
|||
$this -> export($where); |
|||
} |
|||
//sql语句生成 |
|||
$field = "id,orderno,status,paytype,paytime,payfor,price,mid,fkid,num,createtime"; |
|||
$order = " ORDER BY createtime DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."order"); |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
//获取用户信息 |
|||
[$val['nickname'],$val['avatar']] = Dating::handleUserInfo($val['mid']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('order/datorderindex'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 订单导出 |
|||
* Author: wlf |
|||
* Date: 2021/11/23 11:28 |
|||
*/ |
|||
public function export($where){ |
|||
global $_W,$_GPC; |
|||
//sql语句生成 |
|||
$field = "id,orderno,status,paytype,paytime,payfor,price,mid,fkid,num,createtime"; |
|||
$order = " ORDER BY createtime DESC,id DESC "; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."order"); |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order); |
|||
foreach($list as $key => &$val){ |
|||
//获取用户信息 |
|||
[$val['nickname'],$val['avatar']] = Dating::handleUserInfo($val['mid']); |
|||
$val['createtime'] = date("Y-m-d H:i",$val['createtime']); |
|||
$val['paytime'] = date("Y-m-d H:i",$val['paytime']); |
|||
$val['orderno'] = "\t".$val['orderno']."\t"; |
|||
|
|||
} |
|||
|
|||
$filter = array( |
|||
'orderno' => '订单编号', |
|||
'nickname' => '用户昵称', |
|||
'createtime' => '下单时间', |
|||
'payfor' => '付费类型', |
|||
'price' => '订单金额', |
|||
'paytype' => '支付方式', |
|||
'paytime' => '支付时间' |
|||
); |
|||
|
|||
$data = array(); |
|||
for ($i=0; $i < count($list) ; $i++) { |
|||
foreach ($filter as $key => $title) { |
|||
if($key == 'payfor') { |
|||
switch ($list[$i][$key]) { |
|||
case 'datingTop': |
|||
$data[$i][$key] = '置顶'; |
|||
break; |
|||
case 'datingMatchmaker': |
|||
$data[$i][$key] = '红娘入驻'; |
|||
break; |
|||
case 'datingVip': |
|||
$data[$i][$key] = '开通会员'; |
|||
break; |
|||
} |
|||
}else if($key == 'paytype'){ |
|||
switch ($list[$i][$key]) { |
|||
case '1': |
|||
$data[$i][$key] = '余额支付'; |
|||
break; |
|||
case '2': |
|||
$data[$i][$key] = '微信支付'; |
|||
break; |
|||
case '3': |
|||
$data[$i][$key] = '支付宝支付'; |
|||
break; |
|||
case '4': |
|||
$data[$i][$key] = '货到付款'; |
|||
break; |
|||
case '5': |
|||
$data[$i][$key] = '小程序支付'; |
|||
break; |
|||
case '6': |
|||
$data[$i][$key] = '0元购'; |
|||
break; |
|||
case '7': |
|||
$data[$i][$key] = '混合支付'; |
|||
break; |
|||
default: |
|||
$data[$i][$key] = '其他或未支付'; |
|||
break; |
|||
} |
|||
}else { |
|||
$data[$i][$key] = $list[$i][$key]; |
|||
} |
|||
} |
|||
} |
|||
util_csv::export_csv_2($data, $filter, '相亲交友订单表.csv'); |
|||
exit(); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,560 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
|
|||
class Member_WeliamController{ |
|||
/** |
|||
* Comment: 会员列表 |
|||
* Author: zzw |
|||
* Date: 2021/2/25 17:42 |
|||
*/ |
|||
public function memberList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$nickname = $_GPC['nickname'] ? : ''; |
|||
$examine = $_GPC['examine'] ? : ''; |
|||
//条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} "; |
|||
if($_W['aid'] > 0) $where .= " AND a.aid = {$_W['aid']} "; |
|||
if($nickname) $where .= " AND b.nickname LIKE '%{$nickname}%' "; |
|||
if($examine > 0) $where .= " AND a.examine = {$examine} "; |
|||
//sql语句生成 |
|||
$field = "a.id,a.aid,a.mid,a.gneder,a.birth,a.height,a.weight,a.nation,a.marital_status,a.education, |
|||
a.current_province,a.current_city,a.current_area,a.examine,a.is_top,a.top_end_time,a.create_time, |
|||
a.sort,b.nickname,b.avatar,a.matchmaker_id"; |
|||
$order = " ORDER BY a.sort DESC,a.id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."dating_member") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id "; |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
//头像处理 |
|||
$val['avatar'] = tomedia($val['avatar']); |
|||
//地区获取 |
|||
$val['province'] = pdo_getcolumn(PDO_NAME."area",['id' => $val['current_province']],'name'); |
|||
$val['city'] = pdo_getcolumn(PDO_NAME."area",['id' => $val['current_city']],'name'); |
|||
$val['area'] = pdo_getcolumn(PDO_NAME."area",['id' => $val['current_area']],'name'); |
|||
//出生日期 |
|||
$val['birth'] = date("Y-m-d",$val['birth']); |
|||
//获取红娘昵称 |
|||
if($val['matchmaker_id'] > 0) $val['matchmaker_name'] = pdo_getcolumn(PDO_NAME."dating_matchmaker",['id'=>$val['matchmaker_id']],'nickname'); |
|||
//所属代理 |
|||
if($val['aid'] > 0) $val['agent_name'] = pdo_getcolumn(PDO_NAME."agentusers",['id'=>$val['aid']],'agentname'); |
|||
else $val['agent_name'] = '平台'; |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('member/index'); |
|||
} |
|||
/** |
|||
* Comment: 查看会员详细信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/26 15:19 |
|||
*/ |
|||
public function memberSee(){ |
|||
global $_W,$_GPC; |
|||
//参数消息获取 |
|||
$id = $_GPC['id'] OR wl_message('不存在的会员信息',web_url('dating/member/memberList')); |
|||
//获取信息 |
|||
$info = pdo_get(PDO_NAME."dating_member",['id'=>$id]); |
|||
//信息处理 |
|||
$info = Dating::handleMemberInfo($info); |
|||
|
|||
include wl_template('member/see'); |
|||
} |
|||
/** |
|||
* Comment: 审核会员信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/26 15:54 |
|||
*/ |
|||
public function memberExamine(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR show_json(0, "参数错误,请刷新重试!"); |
|||
$status = $_GPC['status'] ? : 3;//审核状态:1=待审核,2=未通过,3=已通过/显示中 |
|||
$reason = $_GPC['reason'] ? : ''; |
|||
if($status == 2 && !$reason) show_json(0, "请输入驳回原因"); |
|||
//修改状态 |
|||
$data = [ |
|||
'examine' => $status, |
|||
'reason' => $reason |
|||
]; |
|||
pdo_update(PDO_NAME."dating_member",$data,['id'=>$id]); |
|||
//发送模板消息通知用户审核结果 |
|||
if($status == 2) { |
|||
$resultText = '未通过'; |
|||
$contentText = "个人资料被驳回:{$reason}"; |
|||
$link = "pages/subPages2/blindDate/form/userInfo"; |
|||
} else if($status == 3) { |
|||
$resultText = '已通过'; |
|||
$contentText = "恭喜您,会员信息审核已通过!"; |
|||
$link = "pages/subPages2/blindDate/member/detail?id={$id}"; |
|||
} |
|||
$member = pdo_get(PDO_NAME."dating_member",['id'=>$id]); |
|||
$modelData = [ |
|||
'first' => '您好,您的资料已审核完毕', |
|||
'type' => '审核结果', |
|||
'content' => $contentText, |
|||
'status' => $resultText, |
|||
'time' => date("Y-m-d H:i:s",time()), |
|||
'remark' => "点击查看" |
|||
]; |
|||
TempModel::sendInit('service',$member['mid'],$modelData,$_W['source'],h5_url($link)); |
|||
|
|||
show_json(1, "操作成功"); |
|||
} |
|||
/** |
|||
* Comment: 切换红娘 |
|||
* Author: zzw |
|||
* Date: 2021/4/12 15:52 |
|||
*/ |
|||
public function changeMatchmaker(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = $_GPC['page_index'] ? : 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$type = $_GPC['type'] ? : 'get';//get=获取信息,post=修改信息 |
|||
$id = $_GPC['id'] ? : '';//红娘id get=当前红娘id,post=新的红娘的id |
|||
$mid = $_GPC['mid'] ? : ''; |
|||
$memberId = $_GPC['member_id'] ? : ''; |
|||
$status = $_GPC['status'] ? : 3; |
|||
$nickname = $_GPC['nickname'] ? : ''; |
|||
//根据type进行对应的操作 |
|||
if($type == 'post'){ |
|||
//修改信息 |
|||
pdo_update(PDO_NAME."dating_member",['matchmaker_id'=>$id],['id'=>$memberId]); |
|||
//取消推荐关系 |
|||
$sql = " DELETE FROM ".tablename(PDO_NAME."dating_exchange")." WHERE mid_one = {$mid} OR mid_two = {$mid} "; |
|||
pdo_query($sql); |
|||
|
|||
show_json(1, ['message'=>'操作成功','url'=>web_url('dating/member/memberList')]); |
|||
}else{ |
|||
//获取红娘信息 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND mid <> {$mid} "; |
|||
if($status != 5){ |
|||
$where .= " AND status = {$status} "; |
|||
} |
|||
if($nickname) $where .= " AND nickname LIKE '%{$nickname}%' "; |
|||
$field = " id,nickname,avatar,status "; |
|||
$order = " ORDER BY create_time DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."dating_matchmaker"); |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as &$mVal){ |
|||
$mVal['avatar'] = tomedia($mVal['avatar']); |
|||
} |
|||
|
|||
//分页操作 |
|||
$total = pdo_fetchall($sql.$where); |
|||
$total = count($total); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('member/matchmaker'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 删除会员信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/25 17:43 |
|||
*/ |
|||
public function memberDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."dating_member",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 个性标签列表 |
|||
* Author: zzw |
|||
* Date: 2021/2/25 15:01 |
|||
*/ |
|||
public function labelList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$title = $_GPC['title'] ? : '';//名称 |
|||
//条件生成 |
|||
$where = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] |
|||
]; |
|||
if($title) $where['title LIKE'] = "%{$title}%"; |
|||
//列表获取 |
|||
$field = ['id','title','create_time','sort']; |
|||
$order = 'sort DESC,id DESC'; |
|||
$list = pdo_getall(PDO_NAME."dating_label",$where,$field,'',$order,[$page,$pageIndex]); |
|||
//分页操作 |
|||
$total = pdo_count(PDO_NAME."dating_label",$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('label/index'); |
|||
} |
|||
/** |
|||
* Comment: 标签添加/编辑 |
|||
* Author: zzw |
|||
* Date: 2021/2/25 15:05 |
|||
*/ |
|||
public function labelEdit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
//接收信息 并且进行对应的处理 |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
//判断是否已经存在当前标签 |
|||
$where = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'title' => $data['title'] |
|||
]; |
|||
if($id > 0) $where['id <>'] = $id; |
|||
$isHave = pdo_get(PDO_NAME."dating_label",$where); |
|||
if($isHave) wl_message('标签已经存在',referer(),'error'); |
|||
//根据是否存在id 判断是添加操作还是修改操作 |
|||
if($id){ |
|||
pdo_update(PDO_NAME."dating_label",$data,['id'=>$id]); |
|||
|
|||
wl_message('修改成功',web_url('dating/member/labelList'),'success'); |
|||
}else{ |
|||
//信息补充 并且进行添加操作 |
|||
$data['uniacid'] = $where['uniacid']; |
|||
$data['aid'] = $where['aid']; |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."dating_label",$data); |
|||
|
|||
wl_message('添加成功',web_url('dating/member/labelList'),'success'); |
|||
} |
|||
} |
|||
//准备信息 |
|||
if($id){ |
|||
//修改信息准备 |
|||
$info = pdo_get(PDO_NAME."dating_label",['id'=>$id],['title','sort']); |
|||
}else{ |
|||
//添加信息准备 |
|||
$sort = pdo_fetchcolumn("SELECT MAX(id) FROM ".tablename(PDO_NAME."dating_label")); |
|||
$info['sort'] = $sort ? : 1; |
|||
} |
|||
|
|||
include wl_template('label/edit'); |
|||
} |
|||
/** |
|||
* Comment: 生成默认的标签信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/25 15:05 |
|||
*/ |
|||
public function labelDefaultInfo(){ |
|||
global $_W,$_GPC; |
|||
//获取默认标签 |
|||
$list = Dating::defaultLabelList(); |
|||
foreach($list as $val){ |
|||
//判断是否已经存在当前标签 |
|||
$data['title'] = $val; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$isHave = pdo_get(PDO_NAME."dating_label",$data); |
|||
if(!$isHave){ |
|||
//不存在 添加标签信息 |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."dating_label",$data); |
|||
} |
|||
} |
|||
//修改所有默认信息的排序信息 |
|||
pdo_fetchall("update ".tablename(PDO_NAME."dating_label")." set `sort` = `id` WHERE `sort` is null "); |
|||
|
|||
wl_json(1,'生成成功'); |
|||
} |
|||
/** |
|||
* Comment: 删除标签信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/25 15:14 |
|||
*/ |
|||
public function labelDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."dating_label",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 动态列表 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 14:11 |
|||
*/ |
|||
public function dynamicList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$content = $_GPC['content'] ? : ''; |
|||
$isFictitious = $_GPC['is_fictitious'] ? : 0; |
|||
$examine = $_GPC['examine'] ? : 0; |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if($content) $where .= " AND content LIKE '%{$content}%' "; |
|||
if($isFictitious > 0) $where .= " AND is_fictitious = {$isFictitious} "; |
|||
if($examine > 0) $where .= " AND status = {$examine} "; |
|||
//sql语句生成 |
|||
$field = "id,mid,content,create_time,pv,status,is_fictitious,fictitious_nickname,fictitious_avatar"; |
|||
$order = " ORDER BY create_time DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."dating_dynamic"); |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
//是否为虚拟动态:1=不是,2=是 |
|||
if($val['is_fictitious'] == 1){ |
|||
//不是虚拟动态信息 获取对应的数据信息 |
|||
[$val['nickname'],$val['avatar']] = Dating::handleUserInfo($val['mid']); |
|||
}else{ |
|||
//虚拟动态信息 |
|||
$val['nickname'] = $val['fictitious_nickname']; |
|||
$val['avatar'] = tomedia($val['fictitious_avatar']); |
|||
} |
|||
//发布时间 |
|||
$val['create_time'] = date("Y-m-d H:i",$val['create_time'] ); |
|||
//删除多余的信息 |
|||
unset($val['fictitious_nickname'],$val['fictitious_avatar']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('dynamic/index'); |
|||
} |
|||
/** |
|||
* Comment: 查看动态信息 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 14:47 |
|||
*/ |
|||
public function dynamicSee(){ |
|||
global $_W,$_GPC; |
|||
//参数消息获取 |
|||
$id = $_GPC['id'] OR wl_message('不存在的动态信息',web_url('dating/member/dynamicList')); |
|||
//获取信息 |
|||
$info = pdo_get(PDO_NAME."dating_dynamic",['id'=>$id]); |
|||
//信息处理 |
|||
$info = Dating::handleDynamicInfo($info); |
|||
|
|||
|
|||
include wl_template('dynamic/see'); |
|||
} |
|||
/** |
|||
* Comment: 添加、编辑动态信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/26 18:24 |
|||
*/ |
|||
public function dynamicEdit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
//接收信息 并且进行对应的处理 |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
//判断信息是否完整 |
|||
if(!$data['fictitious_nickname']) wl_message('请输入昵称!',referer(),'success'); |
|||
if(!$data['fictitious_avatar']) wl_message('请选择头像!',referer(),'success'); |
|||
if(!$data['content'] && !$data['photo'] && !$data['video']) wl_message('动态、图片、视频至少需要存在一项!',referer(),'success'); |
|||
if(!$data['address']) wl_message('请选择地址!',referer(),'success'); |
|||
//信息处理 |
|||
$data['photo'] = serialize($data['photo']); |
|||
//根据是否存在id 判断是添加操作还是修改操作 |
|||
if($id){ |
|||
pdo_update(PDO_NAME."dating_dynamic",$data,['id'=>$id]); |
|||
|
|||
wl_message('修改成功',web_url('dating/member/dynamicList'),'success'); |
|||
}else{ |
|||
//信息补充 并且进行添加操作 |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['mid'] = 0; |
|||
$data['is_fictitious'] = 2; |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."dating_dynamic",$data); |
|||
|
|||
wl_message('添加成功',web_url('dating/member/dynamicList'),'success'); |
|||
} |
|||
} |
|||
//准备信息 |
|||
if($id){ |
|||
//修改信息准备 |
|||
$info = pdo_get(PDO_NAME."dating_dynamic",['id'=>$id]); |
|||
$info['photo'] = unserialize($info['photo']); |
|||
} |
|||
|
|||
include wl_template('dynamic/edit'); |
|||
} |
|||
/** |
|||
* Comment: 审核动态信息 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 14:21 |
|||
*/ |
|||
public function dynamicExamine(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR show_json(0, "参数错误,请刷新重试!"); |
|||
$status = $_GPC['status'] ? : 3;//审核状态:1=待审核,2=未通过,3=已通过/显示中 |
|||
$reason = $_GPC['reason'] ? : ''; |
|||
if($status == 2 && !$reason) show_json(0, "请输入驳回原因"); |
|||
//修改状态 |
|||
$data = [ |
|||
'status' => $status, |
|||
'reason' => $reason |
|||
]; |
|||
pdo_update(PDO_NAME."dating_dynamic",$data,['id'=>$id]); |
|||
//发送模板消息 |
|||
$dynamic = pdo_get(PDO_NAME."dating_dynamic",['id'=>$id]); |
|||
if($status == 2) $statusText = "未通过"; |
|||
else $statusText = "已通过"; |
|||
$modelData = [ |
|||
'first' => "您发布的动态已审核", |
|||
'type' => '动态审核', |
|||
'content' => '您于'.date("Y-m-d H:s",$dynamic['create_time']).'发布的动态已审核完毕!', |
|||
'status' => $statusText, |
|||
'time' => date("Y-m-d H:i:s",time()), |
|||
'remark' => "点击查看" |
|||
]; |
|||
$url = h5_url('pages/subPages2/blindDate/dynamics/detail',['id'=>$id]); |
|||
TempModel::sendInit('service',$dynamic['mid'],$modelData,$_W['source'],$url); |
|||
|
|||
show_json(1, "操作成功"); |
|||
} |
|||
/** |
|||
* Comment: 删除动态信息 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 11:37 |
|||
*/ |
|||
public function dynamicDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."dating_dynamic",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 动态评论列表 |
|||
* Author: zzw |
|||
* Date: 2021/3/12 14:47 |
|||
*/ |
|||
public function commentList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$status = $_GPC['status'] ? : ''; |
|||
$content = $_GPC['content'] ? : ''; |
|||
$dynamicId = $_GPC['dynamic_id'] ? : ''; |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if($status) $where .= " AND status = {$status} "; |
|||
if($content) $where .= " AND content LIKE '%{$content}%' "; |
|||
if($dynamicId > 0) $where .= " AND dynamic_id = {$dynamicId} "; |
|||
//sql语句生成 |
|||
$field = "id,mid,content,create_time,status"; |
|||
$order = " ORDER BY create_time DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."dating_dynamic_comment"); |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
[$val['nickname'],$val['avatar']] = Dating::handleUserInfo($val['mid']); |
|||
$val['create_time'] = date("Y-m-d H:i:s",$val['create_time']); |
|||
//删除多余的信息 |
|||
unset($val['mid']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('comment/index'); |
|||
} |
|||
/** |
|||
* Comment: 评论审核操作 |
|||
* Author: zzw |
|||
* Date: 2021/3/12 14:41 |
|||
*/ |
|||
public function commentExamine(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR show_json(0, "参数错误,请刷新重试!"); |
|||
$status = $_GPC['status'] ? : 3;//审核状态:1=待审核,2=未通过,3=已通过/显示中 |
|||
//修改状态 |
|||
pdo_update(PDO_NAME."dating_dynamic_comment",['status' => $status],['id'=>$id]); |
|||
//发送模板消息 |
|||
$dynamicComment = pdo_get(PDO_NAME."dating_dynamic_comment",['id'=>$id]); |
|||
if($status == 2) { |
|||
$statusText = "未通过"; |
|||
} else { |
|||
$statusText = "已通过"; |
|||
//通过审核 发布模板消息通知 |
|||
Dating::sendCommentModel($dynamicComment['mid'],$dynamicComment['reply_id'],$dynamicComment['dynamic_id'],$dynamicComment['content'],$dynamicComment['source']); |
|||
} |
|||
$modelData = [ |
|||
'first' => "您发布的评论已审核", |
|||
'type' => '评论审核', |
|||
'content' => '您于'.date("Y-m-d H:s",$dynamicComment['create_time']).'发布的评论已审核完毕!', |
|||
'status' => $statusText, |
|||
'time' => date("Y-m-d H:i:s",time()), |
|||
'remark' => "点击查看" |
|||
]; |
|||
$url = h5_url('pages/subPages2/blindDate/dynamics/detail',['id'=>$dynamicComment['dynamic_id']]); |
|||
TempModel::sendInit('service',$dynamicComment['mid'],$modelData,$_W['source'],$url); |
|||
|
|||
show_json(1, "操作成功"); |
|||
} |
|||
/** |
|||
* Comment: 删除评论 |
|||
* Author: zzw |
|||
* Date: 2021/3/12 14:47 |
|||
*/ |
|||
public function commentDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."dating_dynamic_comment",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 设置信息 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 17:38 |
|||
*/ |
|||
public function setEdit(){ |
|||
global $_W,$_GPC; |
|||
$name = 'dating_set'; |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
|
|||
Setting::wlsetting_save($data,$name); |
|||
wl_message('设置成功!' , web_url('dating/member/setEdit') , 'success'); |
|||
} |
|||
//获取已存在的设置信息 |
|||
$info = Setting::wlsetting_read($name); |
|||
|
|||
include wl_template('datingSet'); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,197 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
|
|||
class Vip_WeliamController{ |
|||
/** |
|||
* Comment: 会员卡列表 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 16:18 |
|||
*/ |
|||
public function vipList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$title = $_GPC['title'] ? : ''; |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} "; |
|||
if($title) $where .= " AND title LIKE '%{$title}%' "; |
|||
//sql语句生成 |
|||
$field = "id,title,type,day,second,sort,create_time"; |
|||
$order = " ORDER BY sort DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."dating_vip"); |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('vip/index'); |
|||
} |
|||
/** |
|||
* Comment: 会员卡编辑 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 16:23 |
|||
*/ |
|||
public function vipEdit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
//接收信息 并且进行对应的处理 |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
//判断是否已经存在当前会员卡 |
|||
$where = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'title' => $data['title'] |
|||
]; |
|||
if($id > 0) $where['id <>'] = $id; |
|||
$isHave = pdo_get(PDO_NAME."dating_vip",$where); |
|||
if($isHave) wl_message('会员卡已经存在',referer(),'error'); |
|||
//根据是否存在id 判断是添加操作还是修改操作 |
|||
if($id){ |
|||
pdo_update(PDO_NAME."dating_vip",$data,['id'=>$id]); |
|||
|
|||
wl_message('修改成功',web_url('dating/vip/vipList'),'success'); |
|||
}else{ |
|||
//信息补充 并且进行添加操作 |
|||
$data['uniacid'] = $where['uniacid']; |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."dating_vip",$data); |
|||
|
|||
wl_message('添加成功',web_url('dating/vip/vipList'),'success'); |
|||
} |
|||
} |
|||
//准备信息 |
|||
if($id){ |
|||
//修改信息准备 |
|||
$info = pdo_get(PDO_NAME."dating_vip",['id'=>$id]); |
|||
}else{ |
|||
//添加信息准备 |
|||
$sort = pdo_fetchcolumn("SELECT MAX(id) FROM ".tablename(PDO_NAME."dating_vip")); |
|||
$info['sort'] = $sort ? : 1; |
|||
} |
|||
|
|||
include wl_template('vip/edit'); |
|||
} |
|||
/** |
|||
* Comment: 会员卡删除 |
|||
* Author: zzw |
|||
* Date: 2021/3/1 16:24 |
|||
*/ |
|||
public function vipDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."dating_vip",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 会员卡开通记录列表 |
|||
* Author: zzw |
|||
* Date: 2021/3/12 15:23 |
|||
*/ |
|||
public function userList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$nickname = $_GPC['nickname'] ? : ''; |
|||
$timeType = $_GPC['time_type'] ? : 0;//时间类型:1=开卡时间,2=续费时间 |
|||
$timeLimit = $_GPC['time_limit']; |
|||
$timeStart = strtotime($timeLimit['start']) ? : time(); |
|||
$timeEnd = strtotime($timeLimit['end']) ? : time(); |
|||
//条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} "; |
|||
if($nickname) $where .= " AND b.nickname LIKE '%{$nickname}%' "; |
|||
if($timeType == 1) $where .= " AND a.create_time >= {$timeStart} AND a.create_time <= {$timeEnd} "; |
|||
else if($timeType == 2) $where .= " AND a.update_time >= {$timeStart} AND a.update_time <= {$timeEnd} "; |
|||
//sql语句生成 |
|||
$field = "a.id,a.mid,a.type,a.end_time,a.frequency,a.create_time,a.update_time,b.nickname,b.avatar"; |
|||
$order = " ORDER BY a.update_time DESC,a.create_time DESC,a.id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."dating_member_open") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id "; |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as &$value){ |
|||
//到期时间 |
|||
$value['end_time'] = date("Y-m-d H:i",$value['end_time']); |
|||
//剩余次数 |
|||
$useTotal = pdo_count(PDO_NAME."dating_member_use",['mid'=>$value['mid']]); |
|||
$value['surplus_number'] = $value['frequency'] - $useTotal; |
|||
//其他信息处理 |
|||
$value['avatar'] = tomedia($value['avatar']); |
|||
$value['create_time'] = date("Y-m-d H:i",$value['create_time']); |
|||
$value['update_time'] = date("Y-m-d H:i",$value['update_time']); |
|||
|
|||
unset($value['mid'],$value['frequency']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('user/index'); |
|||
} |
|||
/** |
|||
* Comment: 删除会员用户 |
|||
* Author: zzw |
|||
* Date: 2021/4/7 11:40 |
|||
*/ |
|||
public function userDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."dating_member_open",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
|
|||
public function recordList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$nickname = $_GPC['nickname'] ? : ''; |
|||
//条件生成 |
|||
$where = " WHERE b.uniacid = {$_W['uniacid']} "; |
|||
if($nickname) $where .= " AND b.nickname LIKE '%{$nickname}%' "; |
|||
//sql语句生成 |
|||
$field = "a.create_time,a.title,a.type,a.day,a.frequency,a.money,b.nickname,b.avatar"; |
|||
$order = " ORDER BY a.create_time DESC,a.id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."dating_vip_record") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id "; |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as &$value){ |
|||
//开通时间 |
|||
$value['create_time'] = date("Y-m-d H:i",$value['create_time']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('record/index'); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,147 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user{ |
|||
height: 60px; |
|||
min-width: 180px; |
|||
} |
|||
.user .img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
float: left; |
|||
position: relative; |
|||
} |
|||
.user .img img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
border-radius: 50%; |
|||
border: 1px solid #CCC; |
|||
} |
|||
.user .info{ |
|||
float: left; |
|||
height: 60px; |
|||
width: calc(100% - 60px); |
|||
padding-left: 10px; |
|||
padding-top: 10px; |
|||
font-size: 15px; |
|||
text-align: left; |
|||
line-height: 20px; |
|||
} |
|||
.dynamicContent{ |
|||
max-height: 80px; |
|||
overflow: auto; |
|||
text-align: left; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">评论列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="member" /> |
|||
<input type="hidden" name="do" value="commentList" /> |
|||
<input type="hidden" name="status" value="{$status}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">评论内容</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="content" value="{$content}" placeholder="请输入评论内容..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">动态ID</div> |
|||
<div class="col-sm-9"> |
|||
<input type="number" class="form-control" name="dynamic_id" value="{$dynamicId}"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if $status == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">未通过</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $status == 3}btn-primary{else}btn-default{/if}">显示中</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/member/commentList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"><input type="checkbox" /></th> |
|||
<th class="text-left">用户信息</th> |
|||
<th class="text-left">评论信息</th> |
|||
<th class="text-center">评论时间</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$item['id']}" /></td> |
|||
<td> |
|||
<div class="user"> |
|||
<div class="img"> |
|||
<img src="{$item['avatar']}"> |
|||
</div> |
|||
<div class="info"> |
|||
<div>{$item['nickname']}</div> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="dynamicContent">{$item['content']}</div> |
|||
</td> |
|||
<td>{$item['create_time']}</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<label class="label label-default">待审核</label> |
|||
{elseif $item['status'] == 2} |
|||
<label class="label label-danger">未通过</label> |
|||
{else} |
|||
<label class="label label-success">显示中</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<a href="{php echo web_url('dating/member/commentExamine',['id'=>$item['id'],'status'=>3])}" data-toggle="ajaxPost" class="btn btn-primary btn-sm">通过</a> |
|||
<a href="{php echo web_url('dating/member/commentExamine',['id'=>$item['id'],'status'=>2])}" data-toggle="ajaxPost" class="btn btn-success btn-sm">驳回</a> |
|||
{else} |
|||
<a href="{php echo web_url('dating/member/commentDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前评论信息?">删除</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选中的所有评论信息?" data-href="{php echo web_url('dating/member/commentDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,96 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">佣金明细</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="matchmaker" /> |
|||
<input type="hidden" name="do" value="commissionList" /> |
|||
<input type="hidden" name="type" value="{$type}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">用户MID</div> |
|||
<div class="col-sm-9"> |
|||
<input type="number" class="form-control" name="mid" value="{$mid}"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('type:0');}" class="btn {if $type == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('type:1');}" class="btn {if $type == 1}btn-primary{else}btn-default{/if}">收入</a> |
|||
<a href="{php echo wl_filter_url('type:2');}" class="btn {if $type == 2}btn-primary{else}btn-default{/if}">支出</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/matchmaker/commissionList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">MID</th> |
|||
<th class="text-center">用户昵称</th> |
|||
<th class="text-center">类型</th> |
|||
<th class="text-center">金额</th> |
|||
<th class="text-center">描述</th> |
|||
<th class="text-center">时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td>{$item['mid']}</td> |
|||
<td>{$item['nickname']}</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-success">收入</label> |
|||
{else} |
|||
<label class="label label-danger">支出</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-success">{$item['money']}</label> |
|||
{else} |
|||
<label class="label label-danger">{$item['money']}</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$item['reason']}</td> |
|||
<td>{$item['create_time']}</td> |
|||
<td> |
|||
{if $item['orderno']} |
|||
<a href="{php echo web_url('dating/matchmaker/orderList',['orderno'=>$item['orderno']])}" class="btn btn-primary btn-sm">查看</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,353 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#setBase">基本设置</a></li> |
|||
<li><a href="#setTop">置顶设置</a></li> |
|||
<li><a href="#setMatchmaker">红娘提现</a></li> |
|||
<li><a href="#setShare">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form-validate" id="setting-form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<!-- 基本设置 --> |
|||
<div class="tab-pane active" id="setBase"> |
|||
<div class="panel-heading">基本设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员是否需要审核</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_examine]" value="1" {if $info['member_examine'] == 1}checked="checked"{/if}> 需要审核 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_examine]" value="2" {if $info['member_examine'] != 1}checked="checked"{/if}> 免审核 |
|||
</label> |
|||
<div class="help-block">开启后用户添加、编辑会员资料后都会进行审核</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">动态是否需要审核</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[dynamic_examine]" value="1" {if $info['dynamic_examine'] == 1}checked="checked"{/if}> 需要审核 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[dynamic_examine]" value="2" {if $info['dynamic_examine'] != 1}checked="checked"{/if}> 免审核 |
|||
</label> |
|||
<div class="help-block">开启后会员发布动态需要审核</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">动态评论是否需要审核</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[comment_examine]" value="1" {if $info['comment_examine'] == 1}checked="checked"{/if}> 需要审核 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[comment_examine]" value="2" {if $info['comment_examine'] != 1}checked="checked"{/if}> 免审核 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红娘是否付费入驻</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[pay_settle]" onclick="$('#money').removeClass('hide');" value="1" {if $info['pay_settle'] == 1}checked="checked"{/if}> 付费 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[pay_settle]" onclick="$('#money').addClass('hide');" value="2" {if $info['pay_settle'] != 1}checked="checked"{/if}> 免费 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $info['pay_settle'] != 1}hide{/if}" id="money"> |
|||
<label class="col-sm-2 control-label">付费金额</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="data[money]" class="form-control" value="{$info['money']}"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红娘入驻是否需要审核</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[matchmaker_examine]" value="1" {if $info['matchmaker_examine'] == 1}checked="checked"{/if}> 需要审核 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[matchmaker_examine]" value="2" {if $info['matchmaker_examine'] != 1}checked="checked"{/if}> 免审核 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户主要资料显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_privacy]" value="1" {if $info['member_privacy'] == 1}checked="checked"{/if}> 强制公开 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_privacy]" value="2" {if $info['member_privacy'] == 2}checked="checked"{/if}> 强制隐藏 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_privacy]" value="0" {if empty($info['member_privacy'])}checked="checked"{/if}> 用户自行设置 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户照片显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_photo]" value="1" {if $info['member_photo'] == 1}checked="checked"{/if}> 强制公开 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_photo]" value="2" {if $info['member_photo'] == 2}checked="checked"{/if}> 强制隐藏 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_photo]" value="0" {if empty($info['member_photo'])}checked="checked"{/if}> 用户自行设置 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户联系方式显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_phone]" value="1" {if $info['member_phone'] == 1}checked="checked"{/if}> 强制公开 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_phone]" value="2" {if $info['member_phone'] == 2}checked="checked"{/if}> 强制隐藏 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[member_phone]" value="0" {if empty($info['member_phone'])}checked="checked"{/if}> 用户自行设置 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户自由切换红娘</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[change_matchmaker]" value="1" {if $info['change_matchmaker'] == 1}checked="checked"{/if}> 关闭 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[change_matchmaker]" value="0" {if empty($info['change_matchmaker'])}checked="checked"{/if}> 开启 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">虚拟浏览量</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[fictitious_pv]" class="form-control" value="{$info['fictitious_pv']}"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红娘邀请函话语</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[invitation_speech]" class="form-control" value="{$info['invitation_speech']}" maxlength="25"> |
|||
<div class="help-block">默认红娘海报中的邀请话语,不填则不显示邀请话语。长度限制:25</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">免责声明</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="data[disclaimers]" class="form-control" rows="10" style="resize: none;font-size: 15px;">{$info['disclaimers']}</textarea> |
|||
<div class="help-block">会员信息编辑页面显示的免责声明</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 置顶设置 --> |
|||
<div class="tab-pane" id="setTop"> |
|||
<div class="panel-heading">置顶设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">置顶数量</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0" name="data[top_number]" class="form-control" value="{php echo $info['top_number'] ? : 0;}"> |
|||
<span class="input-group-addon">条</span> |
|||
</div> |
|||
<span class="help-block">置顶的数量,不填或填0则无限制。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">置顶价格</label> |
|||
<div class="col-sm-9 priceList"> |
|||
<!-- 置顶价格信息列表 --> |
|||
{loop $info['top_rule'] $key $item} |
|||
<div class="input-group" style="margin-bottom: 10px;"> |
|||
<span class="input-group-addon">置顶时间(天)</span> |
|||
<input type="text" name="data[top_rule][{$key}][day]" digits="true" class="form-control day" value="{$item['day']}" required="required" min="1"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="data[top_rule][{$key}][price]" class="form-control price" value="{$item['price']}" required="required" min="0.01"> |
|||
<span class="input-group-addon btn btn-default deletePriceButton"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</span> |
|||
</div> |
|||
{/loop} |
|||
<!-- 提示信息 --> |
|||
<span class="help-block">时间请填入整数,价格保留两位小数。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a class="btn btn-info addPriceButton" href="javascript:;"> |
|||
<i class="fa fa-plus"></i>增加一种置顶规则 |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 红娘提现 --> |
|||
<div class="tab-pane" id="setMatchmaker"> |
|||
<div class="panel-heading">红娘提现</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红娘提现是否需要审核</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[matchmaker_withdrawal]" value="1" {if $info['matchmaker_withdrawal'] == 1}checked="checked"{/if}> 需要审核 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[matchmaker_withdrawal]" value="2" {if $info['matchmaker_withdrawal'] != 1}checked="checked"{/if}> 免审核 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红娘提现自动打款</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[automatic_payment]" value="1" {if $info['automatic_payment'] == 1}checked="checked"{/if}> 开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[automatic_payment]" value="2" {if $info['automatic_payment'] != 1}checked="checked"{/if}> 关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">佣金比例</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[commission]" class="form-control" value="{$info['commission']}"> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">打款方式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="data[matchmaker_type][alipay]" value="1" {if $info['matchmaker_type']['alipay'] == 1}checked="checked"{/if}> 支付宝 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="data[matchmaker_type][we_chat]" value="1" {if $info['matchmaker_type']['we_chat'] == 1}checked="checked"{/if}> 微信 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="data[matchmaker_type][bank_card]" value="1" {if $info['matchmaker_type']['bank_card'] == 1}checked="checked"{/if}> 银行卡 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="data[matchmaker_type][balance]" value="1" {if $info['matchmaker_type']['balance'] == 1}checked="checked"{/if}> 余额 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">提现金额限制</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">最小¥</span> |
|||
<input type="number" min="0" name="data[min_money]" class="form-control" value="{$info['min_money']}"> |
|||
<span class="input-group-addon">最大¥</span> |
|||
<input type="number" min="0" name="data[max_money]" class="form-control" value="{$info['max_money']}"> |
|||
</div> |
|||
<span class="help-block">最小值默认为1元,设置为0则无限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">提现频率</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0" digits="true" name="data[frequency]" class="form-control" value="{$info['frequency']}"> |
|||
<span class="input-group-addon">天一次</span> |
|||
</div> |
|||
<span class="help-block">不填或填0则默认无限制,填1则为一天一次,以此类推。只能填入正整数</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">提现手续费</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0" name="data[service_charge]" class="form-control" value="{$info['service_charge']}"> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">提现时给平台的手续费,不填或填0则没有手续费</span> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
</div> |
|||
<!-- 分享设置 --> |
|||
<div class="tab-pane" id="setShare"> |
|||
<div class="panel-heading">分享设置</div> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [系统名称]</b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[share_title]" class="form-control" value="{$info['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[share_image]', $info['share_image']);} |
|||
<span class="help-block">推荐图片尺寸500X500</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[share_desc]" class="form-control" value="{$info['share_desc']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//点击添加一条规则信息 |
|||
$(".addPriceButton").on('click',function () { |
|||
let html = '<div class="input-group" style="margin-bottom: 10px;">\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<span class="input-group-addon">置顶时间(天)</span>\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<input type="text" name="data[top_rule][0][day]" digits="true" class="form-control day" value="" required="required" min="1">\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<span class="input-group-addon">¥</span>\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<input type="text" name="data[top_rule][0][price]" class="form-control price" value="" required="required" min="0.01">\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<span class="input-group-addon btn btn-default deletePriceButton">\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-remove"></i> 删除\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t</span>\n' + |
|||
'\t\t\t\t\t\t\t\t\t</div>'; |
|||
$(".priceList").find('.help-block').before(html); |
|||
priceNameInit(); |
|||
}); |
|||
//点击删除当前规则信息 |
|||
$(".priceList").on('click','.deletePriceButton',function () { |
|||
$(this).parent('.input-group').remove(); |
|||
priceNameInit(); |
|||
}); |
|||
//价格规则信息name格式化 |
|||
function priceNameInit(){ |
|||
$(".priceList .input-group").each(function (k,v) { |
|||
//修改天的name |
|||
$(this).find('.day').attr('name',"data[top_rule]["+k+"][day]"); |
|||
//修改价格的name |
|||
$(this).find('.price').attr('name',"data[top_rule]["+k+"][price]"); |
|||
}); |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,93 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('dating/member/labelList')}">动态列表</a></li> |
|||
<li class="active"><a href="javascript:;">{if $id}编辑{else}发布{/if}虚拟动态</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户昵称<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[fictitious_nickname]" value="{$info['fictitious_nickname']}" maxlength="20"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户头像<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[fictitious_avatar]',$info['fictitious_avatar']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户性别</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[gender]" value="1" {if $info['gender'] != 2}checked="checked"{/if}> 男 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[gender]" value="2" {if $info['gender'] == 2}checked="checked"{/if}> 女 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">动态</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" name="data[content]" style="resize: none;height: 150px;">{$info['content']}</textarea> |
|||
<div class="help-block">动态、图片、视频至少需要存在一项</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('data[photo]',$info['photo']);} |
|||
<div class="help-block">动态、图片、视频至少需要存在一项</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">视频</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_video('data[video]',$info['video']);} |
|||
<div class="help-block">动态、图片、视频至少需要存在一项</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">浏览量</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" name="data[pv]" value="{$info['pv']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">地址<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_address('data[address]','data[lng]','data[lat]',$info['address'],$info['lng'],$info['lat'])} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="1" {if $info['status'] == 1}checked="checked"{/if}> 审核中 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="2" {if $info['status'] == 2}checked="checked"{/if}> 未通过 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="3" {if $info['status'] != 1 && $info['status'] != 2}checked="checked"{/if}> 显示中 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$id}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,188 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user{ |
|||
height: 60px; |
|||
min-width: 180px; |
|||
} |
|||
.user .img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
float: left; |
|||
position: relative; |
|||
} |
|||
.user .img img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
border-radius: 50%; |
|||
border: 1px solid #CCC; |
|||
} |
|||
.user .info{ |
|||
float: left; |
|||
height: 60px; |
|||
width: calc(100% - 60px); |
|||
padding-left: 10px; |
|||
padding-top: 10px; |
|||
font-size: 15px; |
|||
text-align: left; |
|||
line-height: 20px; |
|||
} |
|||
.dynamicContent{ |
|||
max-height: 80px; |
|||
overflow: auto; |
|||
text-align: left; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">动态列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('dating/member/dynamicEdit')}" class="btn btn-primary">发布虚拟动态</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="member" /> |
|||
<input type="hidden" name="do" value="dynamicList" /> |
|||
<input type="hidden" name="is_fictitious" value="{$isFictitious}" /> |
|||
<input type="hidden" name="examine" value="{$examine}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">动态内容</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="content" value="{$content}" placeholder="请输入动态内容..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">动态类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('is_fictitious:0');}" class="btn {if $isFictitious == 0}btn-primary{else}btn-default{/if}">全部动态</a> |
|||
<a href="{php echo wl_filter_url('is_fictitious:1');}" class="btn {if $isFictitious == 1}btn-primary{else}btn-default{/if}">真实动态</a> |
|||
<a href="{php echo wl_filter_url('is_fictitious:2');}" class="btn {if $isFictitious == 2}btn-primary{else}btn-default{/if}">虚拟动态</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('examine:0');}" class="btn {if $examine == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('examine:1');}" class="btn {if $examine == 1}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo wl_filter_url('examine:2');}" class="btn {if $examine == 2}btn-primary{else}btn-default{/if}">未通过</a> |
|||
<a href="{php echo wl_filter_url('examine:3');}" class="btn {if $examine == 3}btn-primary{else}btn-default{/if}">显示中</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/member/labelList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" width="5%"><input type="checkbox" /></th> |
|||
<th class="text-left" width="5%">ID</th> |
|||
<th class="text-left" width="10%">用户信息</th> |
|||
<th class="text-left" width="35%">动态信息</th> |
|||
<th class="text-center" width="10%">发布时间</th> |
|||
<th class="text-center" width="5%">浏览量</th> |
|||
<th class="text-center" width="5%">状态</th> |
|||
<th class="text-center" width="5%">是否为虚拟动态</th> |
|||
<th class="text-center" width="20%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$item['id']}" /></td> |
|||
<td>{$item['id']}</td> |
|||
<td> |
|||
<div class="user"> |
|||
<div class="img"> |
|||
<img src="{$item['avatar']}"> |
|||
</div> |
|||
<div class="info"> |
|||
<div>{$item['nickname']}</div> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="dynamicContent">{$item['content']}</div> |
|||
</td> |
|||
<td>{$item['create_time']}</td> |
|||
<td>{$item['pv']}</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<label class="label label-default">审核中</label> |
|||
{elseif $item['status'] == 2} |
|||
<label class="label label-danger">未通过</label> |
|||
{else} |
|||
<label class="label label-success">显示中</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['is_fictitious'] == 1} |
|||
<label class="label label-success">不是</label> |
|||
{else} |
|||
<label class="label label-danger">是</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['is_fictitious'] == 1} |
|||
<a href="{php echo web_url('dating/member/dynamicSee',['id'=>$item['id']])}" class="btn btn-info btn-sm">查看</a> |
|||
{if $item['status'] == 1} |
|||
<a href="{php echo web_url('dating/member/dynamicExamine',['id'=>$item['id'],'status'=>3])}" data-toggle="ajaxPost" class="btn btn-primary btn-sm">通过</a> |
|||
<a href="javascript:;" class="btn btn-success btn-sm btn-reject" data-id="{$item['id']}">驳回</a> |
|||
{/if} |
|||
{else} |
|||
<a href="{php echo web_url('dating/member/dynamicEdit',['id'=>$item['id']])}" class="btn btn-warning btn-sm">编辑</a> |
|||
{/if} |
|||
<a href="{php echo web_url('dating/member/dynamicDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前动态信息?">删除</a> |
|||
<a href="{php echo web_url('dating/member/commentList',['dynamic_id'=>$item['id']])}" class="btn btn-success btn-sm">评论</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选中的所有动态信息?" data-href="{php echo web_url('dating/member/dynamicDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//点击驳回 |
|||
$(document).on('click','.btn-reject',function (){ |
|||
let id = $(this).data('id'), |
|||
url = "{php echo web_url('dating/member/dynamicExamine')}"; |
|||
tip.prompt('请输入驳回原因!', { |
|||
maxlength: 230, |
|||
callback: function (reason) { |
|||
$.post(url,{id:id,status:2,reason:reason},function (res){ |
|||
if(res.status == 0) tip.msgbox.err(res.result.message); |
|||
else tip.msgbox.suc(res.result.message,res.result.url); |
|||
},'json'); |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,133 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
#memberInfo .form-group{ |
|||
margin-bottom: 10px!important; |
|||
} |
|||
#memberInfo .img-photo{ |
|||
max-width: 150px; |
|||
max-height: 150px; |
|||
float:left; |
|||
margin:2px; |
|||
} |
|||
#memberInfo video{ |
|||
height: 300px!important; |
|||
width: auto!important; |
|||
border: 1px solid #ddd; |
|||
padding: 5px; |
|||
} |
|||
.margin-r-5{ |
|||
margin-right: 5px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('dating/member/dynamicList')}">动态列表</a></li> |
|||
<li class="active"><a href="javascript:;">动态信息</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form" id="memberInfo"> |
|||
<form class="form-horizontal form form-validate" method="post"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户信息</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['nickname']}"> |
|||
<div class="input-group" style="margin-top:2px;"> |
|||
<img src="{$info['avatar']}" class="img-responsive img-thumbnail" width="132"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">其他要求</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" disabled="disabled" style="height: 150px;resize: none;">{$info['content']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">图片信息</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if is_array($info['photo_show'])} |
|||
{loop $info['photo_show'] $img} |
|||
<img src="{$img}" class="img-responsive img-thumbnail img-photo"> |
|||
{/loop} |
|||
{else} |
|||
<label class="label label-default label-danger">未上传照片</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">视频信息</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if $info['video']} |
|||
<video src="{$info['video_show']}" controls="controls" loop="loop"> |
|||
您的浏览器不支持 video 标签。请更新或者更换浏览器 |
|||
</video> |
|||
{else} |
|||
<label class="label label-default label-danger">未上传视频</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">发布时间</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['create_time_text']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">浏览量</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['pv']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">地址</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['address']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">审核状态</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if $info['status'] == 1} |
|||
<label class="label label-default label-info">审核中</label> |
|||
{elseif $info['status'] == 2} |
|||
<label class="label label-default label-danger">未通过</label> |
|||
{else} |
|||
<label class="label label-default label-success">显示中</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $info['status'] != 2}hide{/if}"> |
|||
<label class="col-sm-2 control-label">未通过原因</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" disabled="disabled" style="height: 150px;resize: none;">{$info['reason']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a href="{php echo web_url('dating/member/dynamicList')}" class="btn btn-danger min-width margin-r-5">返回</a> |
|||
{if $info['status'] == 1} |
|||
<a href="{php echo web_url('dating/member/dynamicExamine',['id'=>$info['id'],'status'=>3])}" data-toggle="ajaxPost" data-confirm="确定通过审核?" class="btn btn-primary min-width margin-r-5">通过</a> |
|||
<a href="javascript:;" class="btn btn-success btn-reject min-width margin-r-5" data-id="{$info['id']}">驳回</a> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//点击驳回 |
|||
$(document).on('click','.btn-reject',function (){ |
|||
let id = $(this).data('id'), |
|||
url = "{php echo web_url('dating/member/dynamicExamine')}"; |
|||
tip.prompt('请输入驳回原因!', { |
|||
maxlength: 230, |
|||
callback: function (reason) { |
|||
$.post(url,{id:id,status:2,reason:reason},function (res){ |
|||
if(res.status == 0) tip.msgbox.err(res.result.message); |
|||
else tip.msgbox.suc(res.result.message,res.result.url); |
|||
},'json'); |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,34 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('dating/member/labelList')}">标签列表</a></li> |
|||
<li class="active"><a href="javascript:;">{if $id}编辑{else}添加{/if}标签</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标签名称</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[title]" value="{$info['title']}" maxlength="20"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" name="data[sort]" value="{$info['sort']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$id}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,93 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">标签列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('dating/member/labelEdit')}" class="btn btn-primary">添加标签</a> |
|||
<a href="javascript:;" class="btn btn-info" id="createButton" title="一键生成默认标签信息">一键生成</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="member" /> |
|||
<input type="hidden" name="do" value="labelList" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">标签名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入标签名称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/member/labelList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"><input type="checkbox" /></th> |
|||
<th class="text-center">标签标题</th> |
|||
<th class="text-center">排序</th> |
|||
<th class="text-center">创建时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$item['id']}" /></td> |
|||
<td>{$item['title']}</td> |
|||
<td>{$item['sort']}</td> |
|||
<td>{php echo date("Y-m-d H:i:s",$item['create_time']);}</td> |
|||
<td> |
|||
<a href="{php echo web_url('dating/member/labelEdit',['id'=>$item['id']])}" class="btn btn-warning btn-sm">编辑</a> |
|||
<a href="{php echo web_url('dating/member/labelDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前标签信息?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选中的所有标签信息?" data-href="{php echo web_url('dating/member/labelDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 默认标签信息生成 |
|||
*/ |
|||
$("#createButton").on('click',function () { |
|||
tip.confirm('是否确认生成默认的标签信息?',function () { |
|||
//显示加载动画 |
|||
$("#page-loading").show(); |
|||
//请求生成 |
|||
let link = "{php echo web_url('dating/member/labelDefaultInfo');}"; |
|||
$.post(link,function (res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
},'json'); |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,73 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('dating/matchmaker/matchmakerList')}">红娘列表</a></li> |
|||
<li class="active"><a href="javascript:;">{if $id}编辑{else}添加{/if}红娘</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择用户<span style='color:red'>*</span></label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_user('data[mid]', $info['mid']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红娘昵称</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[nickname]" value="{$info['nickname']}"/> |
|||
<div class="help-block">不填则使用用户昵称</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红娘头像</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[avatar]',$info['avatar']);} |
|||
<div class="help-block">不填则使用用户头像</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">联系方式<span style='color:red'>*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[phone]" value="{$info['phone']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">微信号</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" ame="data[wechat_number]" value="{$info['wechat_number']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">QQ号</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[qq_unmber]" value="{$info['qq_unmber']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">描述信息</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" name="data[describe]" style="resize: none;height: 150px;">{$info['describe']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">二维码<span style='color:red'>*</span></label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[qrcode]',$info['qrcode']);} |
|||
<div class="help-block">微信二维码或者QQ二维码图片,推荐比例150*150</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$id}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,215 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user{ |
|||
height: 60px; |
|||
min-width: 180px; |
|||
} |
|||
.user .img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
float: left; |
|||
position: relative; |
|||
} |
|||
.user .img img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
border-radius: 50%; |
|||
} |
|||
.user .info{ |
|||
float: left; |
|||
height: 60px; |
|||
width: calc(100% - 60px); |
|||
padding-left: 10px; |
|||
padding-top: 10px; |
|||
font-size: 15px; |
|||
text-align: left; |
|||
line-height: 20px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">红娘列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerEdit')}" class="btn btn-primary">添加红娘</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="matchmaker" /> |
|||
<input type="hidden" name="do" value="matchmakerList" /> |
|||
<input type="hidden" name="status" value="{$status}" /> |
|||
<input type="hidden" name="create_source" value="{$createSource}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入用户昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if $status == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">待付款</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $status == 3}btn-primary{else}btn-default{/if}">已通过</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $status == 4}btn-primary{else}btn-default{/if}">未通过</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">来源</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('create_source:0');}" class="btn {if $createSource == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('create_source:1');}" class="btn {if $createSource == 1}btn-primary{else}btn-default{/if}">用户申请</a> |
|||
<a href="{php echo wl_filter_url('create_source:2');}" class="btn {if $createSource == 2}btn-primary{else}btn-default{/if}">后台创建</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"><input type="checkbox" /></th> |
|||
<th class="text-left">用户信息</th> |
|||
<th class="text-center">描述信息</th> |
|||
<th class="text-center">微信号</th> |
|||
<th class="text-center">qq号</th> |
|||
<th class="text-center">累计佣金<br />余额</th> |
|||
<th class="text-center">创建时间</th> |
|||
<th class="text-center">来源</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">客户(点击查看)</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$item['id']}" /></td> |
|||
<td> |
|||
<div class="user"> |
|||
<div class="img"> |
|||
<img src="{$item['avatar']}"> |
|||
</div> |
|||
<div class="info"> |
|||
<div>{$item['nickname']}</div> |
|||
<div>{$item['phone']}</div> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div style="max-height: 80px;overflow: auto;text-align: left;"> |
|||
{$item['describe']} |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{if $item['wechat_number']} |
|||
<label class="label label-primary">{$item['wechat_number']}</label> |
|||
{else} |
|||
-- |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['qq_unmber']} |
|||
<label class="label label-primary">{$item['qq_unmber']}</label> |
|||
{else} |
|||
-- |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<label class="label label-success">¥{$item['total_commission']}</label><br /> |
|||
<label class="label label-info" style="margin-top: 5px;display: inline-block;">¥{$item['commission']}</label> |
|||
</td> |
|||
<td>{$item['create_time_text']}</td> |
|||
<td> |
|||
{if $item['create_source'] == 1} |
|||
<label class="label label-success">用户申请</label> |
|||
{else} |
|||
<label class="label label-info">后台创建</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<label class="label label-inverse">待付款</label> |
|||
{elseif $item['status'] == 2} |
|||
<label class="label label-info">待审核</label> |
|||
{elseif $item['status'] == 3} |
|||
<label class="label label-primary">已通过</label> |
|||
{elseif $item['status'] == 4} |
|||
<label class="label label-danger">未通过</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerMember',['id'=>$item['id']])}" class="btn btn-info btn-sm" title="点击查看">{$item['customer']}人</a> |
|||
</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<!--待付款--> |
|||
|
|||
{elseif $item['status'] == 2} |
|||
<!--待审核--> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerExamine',['id'=>$item['id'],'status'=>3])}" data-toggle="ajaxPost" class="btn btn-primary btn-sm">通过</a> |
|||
<a href="javascript:;" class="btn btn-success btn-sm btn-reject" data-id="{$item['id']}">驳回</a> |
|||
{elseif $item['status'] == 3} |
|||
<!--已通过--> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerEdit',['id'=>$item['id']])}" class="btn btn-primary btn-sm">编辑</a> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前红娘?">删除</a> |
|||
{elseif $item['status'] == 4} |
|||
<!--未通过--> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerEdit',['id'=>$item['id']])}" class="btn btn-primary btn-sm">编辑</a> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前标签信息?">删除</a> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerExamine',['id'=>$item['id'],'status'=>3])}" data-toggle="ajaxPost" class="btn btn-primary btn-sm">通过</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选中的所有红娘?" data-href="{php echo web_url('dating/matchmaker/matchmakerDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//点击驳回 |
|||
$(document).on('click','.btn-reject',function (){ |
|||
let id = $(this).data('id'), |
|||
url = "{php echo web_url('dating/matchmaker/matchmakerExamine')}"; |
|||
tip.prompt('请输入驳回原因!', { |
|||
maxlength: 230, |
|||
callback: function (reason) { |
|||
$.post(url,{id:id,status:4,reason:reason},function (res){ |
|||
if(res.status == 0) tip.msgbox.err(res.result.message); |
|||
else tip.msgbox.suc(res.result.message,res.result.url); |
|||
},'json'); |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,152 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user{ |
|||
height: 60px; |
|||
min-width: 180px; |
|||
} |
|||
.user .img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
float: left; |
|||
position: relative; |
|||
} |
|||
.user .img img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
border-radius: 50%; |
|||
} |
|||
.user .img i{ |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0px; |
|||
color: #FFF; |
|||
opacity: .7; |
|||
font-size: 13px; |
|||
border-radius: 50%; |
|||
width: 20px; |
|||
height: 20px; |
|||
line-height: 20px; |
|||
text-align: center; |
|||
} |
|||
.user .img i.icon-male{ |
|||
background: #0d8ddb; |
|||
} |
|||
.user .img i.icon-female{ |
|||
background: #ed5565; |
|||
transform: rotate( 30deg) skew( 0deg); |
|||
} |
|||
.user .info{ |
|||
float: left; |
|||
height: 60px; |
|||
width: calc(100% - 60px); |
|||
padding-left: 10px; |
|||
padding-top: 10px; |
|||
font-size: 15px; |
|||
text-align: left; |
|||
line-height: 20px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('dating/matchmaker/matchmakerList')}">红娘列表</a></li> |
|||
<li class="active"><a href="javascript:;">客户列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="matchmaker" /> |
|||
<input type="hidden" name="do" value="matchmakerMember" /> |
|||
<input type="hidden" name="id" value="{$id}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">会员昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入会员昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/matchmaker/matchmakerMember',['id'=>$id])}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"><input type="checkbox" /></th> |
|||
<th class="text-left">用户信息</th> |
|||
<th class="text-center">年龄</th> |
|||
<th class="text-center">身高(cm)/体重(kg)</th> |
|||
<th class="text-center">婚姻情况</th> |
|||
<th class="text-center">学历</th> |
|||
<th class="text-center">所在城市</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$item['id']}" /></td> |
|||
<td> |
|||
<div class="user"> |
|||
<div class="img"> |
|||
<img src="{$item['avatar']}"> |
|||
{if $item['gneder'] == 1} |
|||
<i class="icon icon-male"></i> |
|||
{else} |
|||
<i class="icon icon-female"></i> |
|||
{/if} |
|||
</div> |
|||
<div class="info"> |
|||
<div>{$item['nickname']}</div> |
|||
<div>{$item['birth']}</div> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td>{$item['age']}</td> |
|||
<td>{$item['height']}cm/{$item['weight']}kg</td> |
|||
<td>{$item['marital_status_text']}</td> |
|||
<td>{$item['education_text']}</td> |
|||
<td>{$item['current_address']}</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选中的所有标签信息?" data-href="{php echo web_url('dating/member/memberDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//点击驳回 |
|||
$(document).on('click','.btn-reject',function (){ |
|||
let id = $(this).data('id'), |
|||
url = "{php echo web_url('dating/member/memberExamine')}"; |
|||
tip.prompt('请输入驳回原因!', { |
|||
maxlength: 230, |
|||
callback: function (reason) { |
|||
$.post(url,{id:id,status:2,reason:reason},function (res){ |
|||
if(res.status == 0) tip.msgbox.err(res.result.message); |
|||
else tip.msgbox.suc(res.result.message,res.result.url); |
|||
},'json'); |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,237 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user{ |
|||
height: 60px; |
|||
min-width: 180px; |
|||
} |
|||
.user .img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
float: left; |
|||
position: relative; |
|||
} |
|||
.user .img img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
border-radius: 50%; |
|||
} |
|||
.user .img i{ |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0px; |
|||
color: #FFF; |
|||
opacity: .7; |
|||
font-size: 13px; |
|||
border-radius: 50%; |
|||
width: 20px; |
|||
height: 20px; |
|||
line-height: 20px; |
|||
text-align: center; |
|||
} |
|||
.user .img i.icon-male{ |
|||
background: #0d8ddb; |
|||
} |
|||
.user .img i.icon-female{ |
|||
background: #ed5565; |
|||
transform: rotate( 30deg) skew( 0deg); |
|||
} |
|||
.user .info{ |
|||
float: left; |
|||
height: 60px; |
|||
width: calc(100% - 60px); |
|||
padding-left: 10px; |
|||
font-size: 15px; |
|||
text-align: left; |
|||
line-height: 20px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">会员列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="member" /> |
|||
<input type="hidden" name="do" value="memberList" /> |
|||
<input type="hidden" name="examine" value="{$examine}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">会员昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入会员昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('examine:0');}" class="btn {if $examine == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('examine:1');}" class="btn {if $examine == 1}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo wl_filter_url('examine:2');}" class="btn {if $examine == 2}btn-primary{else}btn-default{/if}">未通过</a> |
|||
<a href="{php echo wl_filter_url('examine:3');}" class="btn {if $examine == 3}btn-primary{else}btn-default{/if}">显示中</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/member/memberList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"><input type="checkbox" /></th> |
|||
<th class="text-center">ID</th> |
|||
<th class="text-left">用户信息</th> |
|||
{if $_W['aid'] == 0} |
|||
<th class="text-center">所属代理</th> |
|||
<th class="text-center">所属红娘</th> |
|||
{/if} |
|||
<th class="text-center">身高(cm)/体重(kg)</th> |
|||
<th class="text-center">婚姻情况</th> |
|||
<th class="text-center">学历</th> |
|||
<th class="text-center">所在城市</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">是否置顶</th> |
|||
<th class="text-center">创建时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$item['id']}" /></td> |
|||
<td>{$item['id']}</td> |
|||
<td> |
|||
<div class="user"> |
|||
<div class="img"> |
|||
<img src="{$item['avatar']}"> |
|||
{if $item['gneder'] == 1} |
|||
<i class="icon icon-male"></i> |
|||
{else} |
|||
<i class="icon icon-female"></i> |
|||
{/if} |
|||
</div> |
|||
<div class="info"> |
|||
<div>{$item['nickname']}</div> |
|||
<div>{$item['birth']}</div> |
|||
<div>MID:{$item['mid']}</div> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
{if $_W['aid'] == 0} |
|||
<td><label class="label label-success">{$item['agent_name']}</label></td> |
|||
<td> |
|||
<a href="{php echo web_url('dating/member/changeMatchmaker',['type'=>'get','id'=>$item['matchmaker_id'],'mid'=>$item['mid'],'member_id'=>$item['id']])}"> |
|||
{if $item['matchmaker_id'] > 0} |
|||
{$item['matchmaker_name']}(切换) |
|||
{else} |
|||
点击添加 |
|||
{/if} |
|||
</a> |
|||
</td> |
|||
{/if} |
|||
<td>{$item['height']}cm/{$item['weight']}kg</td> |
|||
<td> |
|||
{if $item['marital_status'] == 1} |
|||
<label class="label label-success">未婚</label> |
|||
{elseif $item['marital_status'] == 2} |
|||
<label class="label label-danger">离异(无子女)</label> |
|||
{elseif $item['marital_status'] == 3} |
|||
<label class="label label-danger">离异(有抚养权)</label> |
|||
{elseif $item['marital_status'] == 4} |
|||
<label class="label label-danger">离异(无抚养权)</label> |
|||
{elseif $item['marital_status'] == 5} |
|||
<label class="label label-inverse">丧偶(无子女)</label> |
|||
{elseif $item['marital_status'] == 6} |
|||
<label class="label label-inverse">丧偶(有子女)</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['education'] == 1} |
|||
<label class="label label-default">小学</label> |
|||
{elseif $item['education'] == 2} |
|||
<label class="label label-default">初中</label> |
|||
{elseif $item['education'] == 3} |
|||
<label class="label label-default">高中/中专</label> |
|||
{elseif $item['education'] == 4} |
|||
<label class="label label-default">专科</label> |
|||
{elseif $item['education'] == 5} |
|||
<label class="label label-default">本科</label> |
|||
{elseif $item['education'] == 6} |
|||
<label class="label label-default">硕士</label> |
|||
{elseif $item['education'] == 7} |
|||
<label class="label label-default">博士</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$item['province']}-{$item['city']}-{$item['area']}</td> |
|||
<td> |
|||
{if $item['examine'] == 1} |
|||
<label class="label label-default">待审核</label> |
|||
{elseif $item['examine'] == 2} |
|||
<label class="label label-danger">未通过</label> |
|||
{elseif $item['examine'] == 3} |
|||
<label class="label label-primary">显示中</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['is_top'] == 1} |
|||
<label class="label label-default">未置顶</label> |
|||
{else} |
|||
<label class="label label-inverse">置顶中</label> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date('Y-m-d H:i',$item['create_time']);}</td> |
|||
<td> |
|||
<a href="{php echo web_url('dating/member/memberSee',['id'=>$item['id']])}" class="btn btn-info btn-sm">查看</a> |
|||
<a href="{php echo web_url('dating/member/memberDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前标签信息?">删除</a> |
|||
{if $item['examine'] == 1} |
|||
<a href="{php echo web_url('dating/member/memberExamine',['id'=>$item['id'],'status'=>3])}" data-toggle="ajaxPost" class="btn btn-primary btn-sm">通过</a> |
|||
<a href="javascript:;" class="btn btn-success btn-sm btn-reject" data-id="{$item['id']}">驳回</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选中的所有标签信息?" data-href="{php echo web_url('dating/member/memberDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//点击驳回 |
|||
$(document).on('click','.btn-reject',function (){ |
|||
let id = $(this).data('id'), |
|||
url = "{php echo web_url('dating/member/memberExamine')}"; |
|||
tip.prompt('请输入驳回原因!', { |
|||
maxlength: 230, |
|||
callback: function (reason) { |
|||
$.post(url,{id:id,status:2,reason:reason},function (res){ |
|||
if(res.status == 0) tip.msgbox.err(res.result.message); |
|||
else tip.msgbox.suc(res.result.message,res.result.url); |
|||
},'json'); |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,101 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">红娘列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="weliam_smartcity" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="member" /> |
|||
<input type="hidden" name="do" value="changeMatchmaker" /> |
|||
<input type="hidden" name="type" value="get" /> |
|||
<input type="hidden" name="id" value="{$id}" /> |
|||
<input type="hidden" name="mid" value="{$mid}" /> |
|||
<input type="hidden" name="status" value="{$status}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入会员昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:5');}" class="btn {if $status == 5}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">待付款</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $status == 3}btn-primary{else}btn-default{/if}">已通过</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $status == 4}btn-primary{else}btn-default{/if}">未通过</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/member/changeMatchmaker',['type'=>'get','id'=>$id,'mid'=>$mid])}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">ID</th> |
|||
<th class="text-center">头像</th> |
|||
<th class="text-center">昵称</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td>{$item['id']}</td> |
|||
<td> |
|||
<img src="{$item['avatar']}" style="width: 80px;height: 80px;border-radius: 50%;"> |
|||
</td> |
|||
<td>{$item['nickname']}</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<label class="label label-inverse">待付款</label> |
|||
{elseif $item['status'] == 2} |
|||
<label class="label label-info">待审核</label> |
|||
{elseif $item['status'] == 3} |
|||
<label class="label label-primary">已通过</label> |
|||
{elseif $item['status'] == 4} |
|||
<label class="label label-danger">未通过</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['id'] == $id} |
|||
|
|||
{else} |
|||
<a href="{php echo web_url('dating/member/changeMatchmaker',['type'=>'post','id'=>$item['id'],'mid'=>$mid,'member_id'=>$memberId])}" |
|||
class="btn btn-info btn-sm" data-toggle="ajaxPost" data-confirm="确定设置为当前红娘?修改后所有推荐关系将被取消!">切换</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,353 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
#memberInfo .form-group{ |
|||
margin-bottom: 10px!important; |
|||
} |
|||
#memberInfo .img-photo{ |
|||
max-width: 150px; |
|||
max-height: 150px; |
|||
float:left; |
|||
margin:2px; |
|||
} |
|||
#memberInfo video{ |
|||
height: 300px!important; |
|||
width: auto!important; |
|||
border: 1px solid #ddd; |
|||
padding: 5px; |
|||
} |
|||
.margin-r-5{ |
|||
margin-right: 5px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基础信息</a></li> |
|||
<li><a href="#tab_contact">联系方式</a></li> |
|||
<li><a href="#tab_requirement">择偶要求</a></li> |
|||
<li><a href="#tab_personality">个性信息</a></li> |
|||
<li><a href="#tab_other">其他信息</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form" id="memberInfo"> |
|||
<form class="form-horizontal form form-validate" method="post"> |
|||
<div class="tab-content"> |
|||
<!-- 基本信息 --> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">基本信息</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户信息</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">昵称</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['nickname']}"> |
|||
<span class="input-group-addon">姓名</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['realname']}"> |
|||
<span class="input-group-addon">年龄</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['age']}"> |
|||
<span class="input-group-addon">性别</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{if $info['gneder'] == 1}男{else}女{/if}"> |
|||
</div> |
|||
<div class="input-group margin-t-5"> |
|||
<span class="input-group-addon">身高</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['height']}cm"> |
|||
<span class="input-group-addon">体重</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['weight']}kg"> |
|||
<span class="input-group-addon">民族</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['nation']}"> |
|||
<span class="input-group-addon">生日</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['birth_text']}"> |
|||
</div> |
|||
<div class="input-group" style="margin-top:2px;"> |
|||
<img src="{php echo tomedia($info['cover'])}" class="img-responsive img-thumbnail" width="132"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">婚姻情况</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['marital_status_text']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">工作职务</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['work']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">学历</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['education_text']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">当前所在城市</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['current_address']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">户籍所在城市</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['hometown_address']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">户籍类型</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['registered_residence']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">月收入(元)</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['income']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">居住情况</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['live_text']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">出行情况</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['travel_text']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $info['travel'] == 1}hide{/if}"> |
|||
<label class="col-sm-2 control-label">车型号</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['vehicle']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">创建时间</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['create_time_text']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['sort']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 联系方式 --> |
|||
<div class="tab-pane" id="tab_contact"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">联系方式</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">手机</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['phone']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">微信号</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['wechat_number']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">QQ号</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['qq_number']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 择偶要求 --> |
|||
<div class="tab-pane" id="tab_requirement"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">择偶要求</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">年龄要求</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{if $info['max_age'] > 0}{$info['min_age']}~{$info['max_age']}岁{else}不限{/if}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">身高要求</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{if $info['max_height'] > 0}{$info['min_height']}~{$info['max_height']}cm{else}不限{/if}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">婚姻要求</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['require_marital']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">学历要求</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['require_education_text']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">其他要求</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" disabled="disabled" style="height: 150px;resize: none;">{$info['require']}</textarea> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 个性信息 --> |
|||
<div class="tab-pane" id="tab_personality"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">个性信息</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">自我介绍</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" disabled="disabled" style="height: 150px;resize: none;">{$info['introduce']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">个性标签</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{loop $info['label_list'] $label} |
|||
<label class="label label-default label-info">{$label}</label> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">个人照片</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if is_array($info['photo_show'])} |
|||
{loop $info['photo_show'] $img} |
|||
<img src="{$img}" class="img-responsive img-thumbnail img-photo"> |
|||
{/loop} |
|||
{else} |
|||
<label class="label label-default label-danger">未上传照片</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">个人视频</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if $info['video']} |
|||
<video src="{$info['video_show']}" controls="controls" loop="loop"> |
|||
您的浏览器不支持 video 标签。请更新或者更换浏览器 |
|||
</video> |
|||
{else} |
|||
<label class="label label-default label-danger">未上传视频</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 其他信息 --> |
|||
<div class="tab-pane" id="tab_other"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">其他信息</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否公开基本信息</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if $info['is_open_base'] == 1} |
|||
<label class="label label-default label-primary">不公开</label> |
|||
{else} |
|||
<label class="label label-default label-info">公开</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否公开联系方式</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if $info['is_open_contact'] == 1} |
|||
<label class="label label-default label-primary">不公开</label> |
|||
{else} |
|||
<label class="label label-default label-info">公开</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否公开联系方式</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if $info['is_open_photo'] == 1} |
|||
<label class="label label-default label-primary">不允许</label> |
|||
{else} |
|||
<label class="label label-default label-info">允许</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">审核状态</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if $info['examine'] == 1} |
|||
<label class="label label-default label-info">待审核</label> |
|||
{elseif $info['examine'] == 2} |
|||
<label class="label label-default label-danger">未通过</label> |
|||
{else} |
|||
<label class="label label-default label-success">已通过/显示中</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $info['examine'] != 2}hide{/if}"> |
|||
<label class="col-sm-2 control-label">未通过原因</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" disabled="disabled" style="height: 150px;resize: none;">{$info['reason']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否置顶</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{if $info['examine'] == 2} |
|||
<label class="label label-default label-success">置顶中</label> |
|||
{else} |
|||
<label class="label label-default label-info">未置顶</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $info['examine'] != 2}hide{/if}"> |
|||
<label class="col-sm-2 control-label">置顶结束时间</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" value="{$info['top_end_time_text']}" disabled="disabled"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a href="{php echo web_url('dating/member/memberList')}" class="btn btn-danger min-width margin-r-5">返回</a> |
|||
{if $info['examine'] == 1} |
|||
<a href="{php echo web_url('dating/member/memberExamine',['id'=>$info['id'],'status'=>3])}" data-toggle="ajaxPost" data-confirm="确定通过审核?" class="btn btn-primary min-width margin-r-5">通过</a> |
|||
<a href="javascript:;" class="btn btn-success btn-reject min-width margin-r-5" data-id="{$info['id']}">驳回</a> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//点击驳回 |
|||
$(document).on('click','.btn-reject',function (){ |
|||
let id = $(this).data('id'), |
|||
url = "{php echo web_url('dating/member/memberExamine')}"; |
|||
tip.prompt('请输入驳回原因!', { |
|||
maxlength: 230, |
|||
callback: function (reason) { |
|||
$.post(url,{id:id,status:2,reason:reason},function (res){ |
|||
if(res.status == 0) tip.msgbox.err(res.result.message); |
|||
else tip.msgbox.suc(res.result.message,res.result.url); |
|||
},'json'); |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,124 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">订单列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="matchmaker" /> |
|||
<input type="hidden" name="do" value="orderList" /> |
|||
<input type="hidden" name="status" value="{$_GPC['payfor']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">付费类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('payfor:0');}" class="btn {if intval($_GPC['payfor']) == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('payfor:1');}" class="btn {if $_GPC['payfor'] == 1}btn-primary{else}btn-default{/if}">置顶</a> |
|||
<a href="{php echo wl_filter_url('payfor:2');}" class="btn {if $_GPC['payfor'] == 2}btn-primary{else}btn-default{/if}">红娘入驻</a> |
|||
<a href="{php echo wl_filter_url('payfor:3');}" class="btn {if $_GPC['payfor'] == 3}btn-primary{else}btn-default{/if}">开通会员</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">筛选</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>用户昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>订单号</option> |
|||
</select> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">支付时间</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/matchmaker/orderList')}" class="btn btn-danger">清除</a> |
|||
<button class="btn btn-default min-width" name="export" type="submit" value="export"><i class="fa fa-download"></i>导出</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">订单号</th> |
|||
<th class="text-center">用户信息</th> |
|||
<th class="text-center">下单时间</th> |
|||
<th class="text-center">付费类型</th> |
|||
<th class="text-center">订单金额</th> |
|||
<th class="text-center">支付方式</th> |
|||
<th class="text-center">支付时间</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $val} |
|||
<tr class="text-center"> |
|||
<td>{$val['orderno']}</td> |
|||
<td> |
|||
<div style="height: 50px;float: left"> |
|||
<div style="width: 50px;height: 50px;float: left;border-radius: 50%;overflow: hidden;"> |
|||
<img src="{$val['avatar']}" style="width: 100%;height: 100%"/> |
|||
</div> |
|||
<div style="float:left;height: 50px;line-height: 50px;margin-left: 5px"> |
|||
{$val['nickname']} |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td>{php echo date("Y-m-d H:i",$val['createtime']);}</td> |
|||
<td> |
|||
<!-- datingTop=置顶,datingMatchmaker=红娘入驻,datingVip=开通会员--> |
|||
{if $val['payfor'] == 'datingTop'} |
|||
<label class="label label-primary">置顶</label> |
|||
{elseif $val['payfor'] == 'datingMatchmaker'} |
|||
<label class="label label-inverse">红娘入驻</label> |
|||
{elseif $val['payfor'] == 'datingVip'} |
|||
<label class="label label-danger">开通会员</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$val['price']}</td> |
|||
<td> |
|||
{if $val['status'] > 0 && $val['status'] != 5} |
|||
{if $val['paytype']==1} |
|||
<span> <i class="icow icow-yue text-warning" style="font-size: 17px;"></i><span>余额支付</span></span> |
|||
{elseif $val['paytype']==2} |
|||
<span> <i class="icow icow-weixinzhifu text-success" style="font-size: 17px"></i>微信支付</span> |
|||
{elseif $val['paytype']==3} |
|||
<span><i class="icow icow-zhifubaozhifu text-primary" style="font-size: 17px"></i>支付宝支付</span> |
|||
{else} |
|||
<label class='label label-danger'>未知方式</label> |
|||
{/if} |
|||
{else} |
|||
<label class='label label-default'>未支付</label> |
|||
{/if} |
|||
</td> |
|||
<td>{if $val['paytime'] > 0}{php echo date("Y-m-d H:i",$val['paytime']);}{/if}</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,119 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user{ |
|||
height: 60px; |
|||
min-width: 180px; |
|||
} |
|||
.user .img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
float: left; |
|||
position: relative; |
|||
} |
|||
.user .img img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
border-radius: 50%; |
|||
border: 1px solid #CCC; |
|||
} |
|||
.user .info{ |
|||
float: left; |
|||
height: 60px; |
|||
width: calc(100% - 60px); |
|||
padding-left: 10px; |
|||
padding-top: 10px; |
|||
font-size: 15px; |
|||
text-align: left; |
|||
line-height: 20px; |
|||
} |
|||
.dynamicContent{ |
|||
max-height: 80px; |
|||
overflow: auto; |
|||
text-align: left; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">开卡记录</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="vip" /> |
|||
<input type="hidden" name="do" value="recordList" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">用户昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入用户昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/vip/recordList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-left">用户信息</th> |
|||
<th class="text-center">类型</th> |
|||
<th class="text-center">时间/次数</th> |
|||
<th class="text-center">开卡时间</th> |
|||
<th class="text-center">订单金额</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<div class="user"> |
|||
<div class="img"> |
|||
<img src="{$item['avatar']}"> |
|||
</div> |
|||
<div class="info"> |
|||
<div>{$item['nickname']}</div> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-success">时限卡</label> |
|||
{else} |
|||
<label class="label label-info">次数卡</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-success">{$item['day']}天</label> |
|||
{else} |
|||
<label class="label label-info">{$item['frequency']}次</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$item['create_time']}</td> |
|||
<td>{$item['money']}</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,136 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user{ |
|||
height: 60px; |
|||
min-width: 180px; |
|||
} |
|||
.user .img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
float: left; |
|||
position: relative; |
|||
} |
|||
.user .img img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
border-radius: 50%; |
|||
border: 1px solid #CCC; |
|||
} |
|||
.user .info{ |
|||
float: left; |
|||
height: 60px; |
|||
width: calc(100% - 60px); |
|||
padding-left: 10px; |
|||
padding-top: 10px; |
|||
font-size: 15px; |
|||
text-align: left; |
|||
line-height: 20px; |
|||
} |
|||
.dynamicContent{ |
|||
max-height: 80px; |
|||
overflow: auto; |
|||
text-align: left; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">开卡记录</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="vip" /> |
|||
<input type="hidden" name="do" value="userList" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">用户昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入用户昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时间筛选</label> |
|||
<div class="col-md-3"> |
|||
<select name="time_type" class="form-control"> |
|||
<option value="">请选择时间类型</option> |
|||
<option value="1" {if $timeType==1}selected="selected"{/if}>开卡时间</option> |
|||
<option value="2" {if $timeType==2}selected="selected"{/if}>最近续费时间</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d H:i',$timeStart), 'endtime' => date('Y-m-d H:i', $timeEnd)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/vip/userList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-left">用户信息</th> |
|||
<th class="text-center">类型</th> |
|||
<th class="text-center">到期时间/剩余次数</th> |
|||
<th class="text-center">开卡时间</th> |
|||
<th class="text-center">最近续费时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<div class="user"> |
|||
<div class="img"> |
|||
<img src="{$item['avatar']}"> |
|||
</div> |
|||
<div class="info"> |
|||
<div>{$item['nickname']}</div> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-success">时限卡</label> |
|||
{else} |
|||
<label class="label label-info">次数卡</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-success">到期时间:{$item['end_time']}</label> |
|||
{else} |
|||
<label class="label label-info">剩余次数:{$item['surplus_number']}</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$item['create_time']}</td> |
|||
<td>{$item['update_time']}</td> |
|||
<td> |
|||
<a href="{php echo web_url('dating/vip/userDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前会员?该操作不可逆!">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,89 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('dating/vip/vipList')}">会员卡列表</a></li> |
|||
<li class="active"><a href="javascript:;">{if $id}编辑{else}添加{/if}会员卡</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员卡标题<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[title]" value="{$info['title']}" maxlength="20"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">价格<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" required name="data[money]" value="{$info['money']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="1" {if $info['type'] != 2}checked="checked"{/if}> 时限卡 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="2" {if $info['type'] == 2}checked="checked"{/if}> 次数卡 |
|||
</label> |
|||
<div class="help-block">在有效时间内可以查看任意用户的信息,时限结束后不可再次查看。达到时间限制则会员卡过期</div> |
|||
<div class="help-block">消耗次数查看任意用户的信息,无时间限制,消耗次数后可永久查看该用户信息。次数消耗完毕则会员卡过期</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $info['type'] == 2}hide{/if}" id="day"> |
|||
<label class="col-sm-2 control-label">有效时间<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input class="form-control" type="number" required name="data[day]" value="{$info['day']}"/> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
<div class="help-block">为0则不限制</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $info['type'] != 2}hide{/if}" id="second"> |
|||
<label class="col-sm-2 control-label">次数<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input class="form-control" type="number" required name="data[second]" value="{$info['second']}"/> |
|||
<span class="input-group-addon">次</span> |
|||
</div> |
|||
<div class="help-block">为0则不限制</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" required name="data[sort]" value="{$info['sort']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$id}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 修改会员卡类型 |
|||
*/ |
|||
$(document).on("change","[name='data[type]']",function (){ |
|||
let type = $("[name='data[type]']:checked").val(); |
|||
//会员卡类型:1=时限卡,2=次数卡 |
|||
if(type == 1) { |
|||
$("#day").removeClass("hide"); |
|||
$("#second").addClass('hide'); |
|||
}else{ |
|||
$("#day").addClass("hide"); |
|||
$("#second").removeClass('hide'); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,97 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">会员卡列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--顶部操作--> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('dating/vip/vipEdit')}" class="btn btn-primary">添加会员卡</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="dating" /> |
|||
<input type="hidden" name="ac" value="vip" /> |
|||
<input type="hidden" name="do" value="vipList" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">会员卡标题</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入会员昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('dating/vip/vipList')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--表格信息--> |
|||
<div class="app-table-list"> |
|||
<!--列表信息--> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">标题</th> |
|||
<th class="text-center">类型</th> |
|||
<th class="text-center">有效时间/使用次数</th> |
|||
<th class="text-center">排序</th> |
|||
<th class="text-center">添加时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td>{$item['title']}</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-success">时限卡</label> |
|||
{else} |
|||
<label class="label label-info">次数卡</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-success"> |
|||
{if $item['day'] > 0} |
|||
{$item['day']}天 |
|||
{else} |
|||
无限制 |
|||
{/if} |
|||
</label> |
|||
{else} |
|||
<label class="label label-info"> |
|||
{if $item['second'] > 0} |
|||
{$item['second']}次 |
|||
{else} |
|||
无限制 |
|||
{/if} |
|||
</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$item['sort']}</td> |
|||
<td>{php echo date('Y-m-d H:i',$item['create_time']);}</td> |
|||
<td> |
|||
<a href="{php echo web_url('dating/vip/vipEdit',['id'=>$item['id']])}" class="btn btn-primary btn-sm">编辑</a> |
|||
<a href="{php echo web_url('dating/vip/vipDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前会员卡信息?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,33 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[分销合伙人]]></name> |
|||
<identifie><![CDATA[distribution]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[expand]]></type> |
|||
<description><![CDATA[强大的营销渠道,将市场的开括交给用户,这是前所未有的销售体验!]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="false" /> |
|||
<system embed="true" /> |
|||
<task embed="true" /> |
|||
</setting> |
|||
<agentmenu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="分销商" font="fa-inbox"> |
|||
<entry title="分销商列表" ac="dissysbase" do="distributorlist" actions='["do",["distributorlist","loworder"]]' iscover="true"/> |
|||
<entry title="申请列表" ac="dissysbase" do="adddistributor" /> |
|||
<entry title="分销商等级" ac="dissysbase" do="dislevel"/> |
|||
</menu> |
|||
<menu title="财务" font="fa-inbox"> |
|||
<entry title="佣金明细" ac="dissysbase" do="disdetail"/> |
|||
<entry title="提现列表" ac="dissysbase" do="applist"/> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="分销设置" ac="dissysbase" do="disbaseset"/> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 5.0 KiB |
@ -0,0 +1,347 @@ |
|||
{php include wl_template('common/header');} |
|||
{if $memid} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li {if $todo == 'base'} class="active" {/if} ><a href="{php echo web_url('distribution/dissysbase/adddistributor', array('todo'=>'base','memid'=>$memid));}">基本信息</a></li> |
|||
<li {if $todo == 'lowpeople'} class="active" {/if}><a href="{php echo web_url('distribution/dissysbase/adddistributor', array('todo'=>'lowpeople','memid'=>$memid));}">下级客户</a></li> |
|||
<li {if $todo == 'loworder'} class="active" {/if}><a href="{php echo web_url('distribution/dissysbase/adddistributor', array('todo'=>'loworder','memid'=>$memid));}">客户订单</a></li> |
|||
<li {if $todo == 'applylist'} class="active" {/if}><a href="{php echo web_url('distribution/dissysbase/adddistributor', array('todo'=>'applylist','memid'=>$memid));}">提现申请</a></li> |
|||
</ul> |
|||
{else} |
|||
<ul class="nav nav-tabs" > |
|||
<li {if $todo == 'appdislist'} class="active" {/if} ><a href="{php echo web_url('distribution/dissysbase/adddistributor');}">申请列表</a></li> |
|||
{if $base['appdis'] == 3} |
|||
<li {if $todo == 'payrecord'} class="active" {/if} ><a href="{php echo web_url('distribution/dissysbase/adddistributor', array('todo'=>'payrecord'));}">支付记录</a></li> |
|||
{/if} |
|||
</ul> |
|||
{/if} |
|||
|
|||
<div class="app-content"> |
|||
<div class="main" style="margin-top: 0;"> |
|||
{if $todo == 'base'} |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form" id="form"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">基本信息</div> |
|||
<div class="panel-body"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:40px;">MID</th> |
|||
<th class="text-center" style="width:60px;">头像<br />昵称</th> |
|||
<th class="text-center" style="width:60px;">姓名<br />电话</th> |
|||
<th class="text-center" style="width:50px;">团队消费金额</th> |
|||
<th class="text-center" style="width:50px;">申请中佣金</th> |
|||
<th class="text-center" style="width:60px;">待打款佣金</th> |
|||
<th class="text-center" style="width:60px;">已提现佣金</th> |
|||
<th class="text-center" style="width:60px;">现有佣金</th> |
|||
<th class="text-center" style="width:60px;">累计佣金</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr data-toggle="popover" data-trigger="hover" data-placement="left" class="js-goods-img"> |
|||
<td class="text-center"> |
|||
{$memid} |
|||
</td> |
|||
<td class="text-center"> |
|||
<img class="scrollLoading" src="{php echo tomedia($messagesaler['avatar'])}" data-url="{php echo tomedia($messagesaler['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
<br />{php echo cutstr($messagesaler['nickname'], 30, true);} |
|||
</td> |
|||
<td class="text-center"> |
|||
{php echo cutstr($messagesaler['realname'], 30, true);}<br /> |
|||
{$messagesaler['mobile']} |
|||
</td> |
|||
<td class="text-center"> |
|||
<span id="statistics" disid = "{$messagesaler['distributorid']}" class="label label-success">点击统计</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span class="label label-info">¥{$applymoney}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span class="label label-default">¥{$cashmoney}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span class="label label-success">¥{$successmoney}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span class="label label-warning">¥{$messagesaler['nowmoney']}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span class="label label-danger">¥{$messagesaler['dismoney']}</span> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
{/if} |
|||
{if $todo == 'applylist'} |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:150px;text-align: center;">申请人信息</th> |
|||
<th style="width:65px;text-align: center;">申请金额</th> |
|||
<th style="width:65px;text-align: center;">申请状态</th> |
|||
<th style="width:110px;text-align: center;">申请时间</th> |
|||
<th style="width:100px;text-align: center;">操作时间</th> |
|||
<th style="width:120px;text-align: center;" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $applylist $li} |
|||
<tr id="{$li['id']}"> |
|||
<td style="text-align: center;"> |
|||
<img style="height: 50px;width: 50px;" src="{php echo tomedia($li['avatar'])}" > |
|||
<div style="display: inline-block;position: relative;top: .7rem;"> |
|||
{$li['nickname']}<br /> |
|||
{$li['mobile']} |
|||
</div> |
|||
</td> |
|||
<td style="text-align: center;"><span class="label label-warning">¥{$li['sapplymoney']}</span></td> |
|||
<td style="text-align: center;"> |
|||
{if $li['status'] == 6} |
|||
<span class="label label-info">审核中</span> |
|||
{else if $li['status']==7} |
|||
<span class="label label-info">审核中</span> |
|||
{else if $li['status']==8} |
|||
<span class="label label-info">已审核</span> |
|||
{else if $li['status'] ==9 && $li['settletype'] == 1} |
|||
<span class="label label-success">手动完成</span> |
|||
{else if $li['status'] ==9 && $li['settletype'] == 3} |
|||
<span class="label label-success">已打款</span> |
|||
{else if $li['status']==10} |
|||
<span class="label label-danger">已驳回</span> |
|||
{else if $li['status']==11} |
|||
<span class="label label-danger">已驳回</span> |
|||
{/if} |
|||
</td> |
|||
<td style="text-align: center;">{php echo date('Y-m-d H:i:s',$li['applytime'])}</td> |
|||
<td style="text-align: center;">{if $li['updatetime']}{php echo date('Y-m-d H:i:s',$li['updatetime'])}{else} <span class="label label-warning">未操作</span> {/if}</td> |
|||
<td class="text-center"> |
|||
<a href="{php echo web_url('distribution/dissysbase/adddistributor',array('memid' => $li['mid']))}">用户详情</a> |
|||
{if $li['status'] == 1}<a href="javascript:;" appid = "{$li['id']}" class="pass"> - 审核通过</a>{/if} |
|||
{if $li['status'] == 1}<a href="javascript:;" appid = "{$li['id']}" class="reject"> - 驳回</a>{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $todo == 'appdislist'} |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:50px;text-align: center;">MID</th> |
|||
<th style="width:115px;text-align: center;">头像/昵称</th> |
|||
<th style="width:65px;text-align: center;">真实姓名</th> |
|||
<th style="width:65px;text-align: center;">联系电话</th> |
|||
<th style="width:65px;text-align: center;">申请状态</th> |
|||
<th style="width:110px;text-align: center;">申请时间</th> |
|||
<th style="width:120px;text-align: center;" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $dislist $dis} |
|||
<tr id="{$dis['id']}"> |
|||
<td style="text-align: center;">{$dis['mid']}</td> |
|||
<td style="text-align: center;"> |
|||
<img style="height: 50px;width: 50px;" src="{php echo tomedia($dis['avatar'])}" > |
|||
<div style="display: inline-block;position: relative;top: .2rem;"> |
|||
{$dis['nickname']}<br /> |
|||
</div> |
|||
</td> |
|||
<td style="text-align: center;"><span class="label label-warning">{$dis['realname']}</span></td> |
|||
<td style="text-align: center;"><span class="label label-warning">{$dis['mobile']}</span></td> |
|||
<td style="text-align: center;">{if $dis['status'] == 0} <span class="label label-info">待审核</span>{else if $dis['status']==1}<span class="label label-success">已通过</span> {else if $dis['status']==2}<span class="label label-danger">已驳回</span>{/if}</td> |
|||
<td style="text-align: center;">{php echo date('Y-m-d H:i:s',$dis['createtime'])}</td> |
|||
<td class="text-center"> |
|||
{if $dis['status'] == 0} |
|||
<a href="javascript:;" appid = "{$dis['id']}" class="passdis">审核通过</a> |
|||
<a href="javascript:;" appid = "{$dis['id']}" class="rejectdis"> - 驳回</a> |
|||
{else} |
|||
<span class="label label-default">无操作项</span> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="modal-module-gift" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> |
|||
<h3>驳回理由</h3></div> |
|||
<div class="modal-body" style="padding: 0;"> |
|||
<div class="modal-body"> |
|||
<textarea id="remark" name="admin_remark" class="form-control" rows="5"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer" style="padding:15px;"> |
|||
<a class="btn btn-default js-cancel" aria-hidden="true" data-dismiss="modal">取消</a> |
|||
<a class="btn btn-primary js-order-remark-post" order-id="" data-dismiss="modal" aria-hidden="true">确定</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $todo == 'payrecord'} |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:40px;">MID</th> |
|||
<th style="width:60px;">头像</th> |
|||
<th style="width:90px;">昵称</th> |
|||
<th style="width:80px;">支付金额</th> |
|||
<th style="width:120px;">支付时间</th> |
|||
<th style="width:120px;" class="text-center">支付方式</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $payrecord $pay} |
|||
<tr> |
|||
<td>{$pay['mid']}</td> |
|||
<td><img style="height: 50px;width: 50px;" src="{php echo tomedia($pay['avatar'])}" ></td> |
|||
<td>{$pay['nickname']}</td> |
|||
<td>¥{$pay['price']}</td> |
|||
<td>{php echo date('Y-m-d H:i:s',$pay['paytime'])}</td> |
|||
<td class="text-center"> |
|||
{if $pay['paytype']==1}<span class="label label-info">余额支付</span>{/if} |
|||
{if $pay['paytype']==2}<span class="label label-success">微信支付</span>{/if} |
|||
{if $pay['paytype']==3}<span class="label label-warning">支付宝</span>{/if} |
|||
{if $pay['paytype']==4}<span class="label label-danger">货到付款</span>{/if} |
|||
{if $pay['paytype']==5}<span class="label label-danger">小程序支付</span>{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
|
|||
$('#statistics').click(function(){ |
|||
$('#statistics').text('请稍等...'); |
|||
var disid = $(this).attr('disid'); |
|||
$.post("{php echo web_url('distribution/dissysbase/statistics')}",{disid:disid},function(d){ |
|||
if(d.errno == 0){ |
|||
$('#statistics').text('¥'+d.message); |
|||
} |
|||
},"json"); |
|||
}); |
|||
|
|||
$("#submit2").click(function(){ |
|||
$('#form2')[0].submit(); |
|||
}); |
|||
$('.js-recharge2').click(function() { |
|||
$('#modal-message2').show(); |
|||
var topfx = $(this).attr('leadname'); |
|||
$('#topfx').text(topfx); |
|||
var leaduid = $(this).attr('leaduid'); |
|||
$('#leaduid').val(leaduid); |
|||
var leadmid = $(this).attr('leadmid'); |
|||
$('#leadmid').val(leadmid); |
|||
var memid = $(this).attr('memid'); |
|||
$('#memid').val(memid); |
|||
$('.panel').css("opacity","0.2");$('.nav').css("opacity","0.2");$('.pagination').css("opacity","0.2"); |
|||
}); |
|||
$('.close').click(function() { |
|||
$('#modal-message').hide(); |
|||
$('#modal-message2').hide(); |
|||
$('.panel').css("opacity","1");$('.nav').css("opacity","1");$('.pagination').css("opacity","1"); |
|||
}); |
|||
|
|||
$('.pass').click(function(e) { |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('appid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
location.href = "{php echo web_url('distribution/dissysbase/pass')}id="+id; |
|||
}, {html: "确认审核通过?"}); |
|||
}); |
|||
|
|||
$('.passdis').click(function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('appid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
location.href = "{php echo web_url('distribution/dissysbase/passdis')}id="+id; |
|||
}, {html: "确认审核通过?"}); |
|||
}); |
|||
|
|||
$('.reject').click(function(e) { |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('appid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
location.href = "{php echo web_url('distribution/dissysbase/reject')}id="+id; |
|||
}, {html: "确认驳回申请?"}); |
|||
}); |
|||
//驳回申请理由 |
|||
$('.rejectdis').click(function(){ |
|||
var appid = $(this).attr('appid'); |
|||
$('.js-order-remark-post').attr("order-id",appid); |
|||
popwin = $('#modal-module-gift').modal(); |
|||
}); |
|||
$('.js-cancel,.close').click(function() { |
|||
$('#order-remark-container').hide(); |
|||
$('.main').css("opacity","1");$('.nav').css("opacity","1");$('.big-menu').css("opacity","1"); |
|||
}); |
|||
$('.js-order-remark-post').click(function() { |
|||
var order_id = $(this).attr('order-id'); |
|||
var remark = $('#remark').val(); |
|||
$.post("{php echo web_url('distribution/dissysbase/rejectreason')}",{id:order_id,reason:remark},function(d){ |
|||
if(!d.errno){ |
|||
util.tips('驳回成功!'); |
|||
location.reload(); |
|||
} |
|||
},"json"); |
|||
$('#order-remark-container').hide(); |
|||
$('.main').css("opacity","1");$('.nav').css("opacity","1");$('.big-menu').css("opacity","1"); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,134 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li {if $status == '1'} class="active" {/if}><a href="{php echo web_url('distribution/dissysbase/applist', array('status'=>'1'));}">审核中</a></li> |
|||
<li {if $status == '2'} class="active" {/if}><a href="{php echo web_url('distribution/dissysbase/applist', array('status'=>'2'));}">已审核</a></li> |
|||
<li {if $status == '3'} class="active" {/if}><a href="{php echo web_url('distribution/dissysbase/applist', array('status'=>'3'));}">已驳回</a></li> |
|||
<li {if $status == '4'} class="active" {/if}><a href="{php echo web_url('distribution/dissysbase/applist', array('status'=>'4'));}">已打款</a></li> |
|||
</ul> |
|||
|
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<button id="export" class="btn btn-primary" ><i class="fa fa-download"></i> 导出记录</button> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th width="20%" class="text-center">申请人信息</th> |
|||
<th width="10%" class="text-center">申请金额</th> |
|||
<th width="10%" class="text-center">实获金额</th> |
|||
<th width="10%" class="text-center">提现方式</th> |
|||
<th width="10%" class="text-center">申请状态</th> |
|||
<th width="10%" class="text-center">申请时间</th> |
|||
<th width="10%" class="text-center">操作时间</th> |
|||
<th width="20%" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $applylist $li} |
|||
<tr id="{$li['id']}" class="text-center"> |
|||
<td> |
|||
<img style="height: 50px;width: 50px;" src="{php echo tomedia($li['avatar'])}" > |
|||
<div style="display: inline-block;position: relative;top: .7rem;"> |
|||
{$li['nickname']}<br /> |
|||
{$li['mobile']} |
|||
</div> |
|||
</td> |
|||
<td><span class="label label-warning">¥{$li['sapplymoney']}</span></td> |
|||
<td><span class="label label-success">¥{$li['sgetmoney']}</span></td> |
|||
<td> |
|||
{if $li['payment_type'] == 1} |
|||
<label class="label label-default label-warning">支付宝:{$li['alipay']}</label> |
|||
{elseif $li['payment_type'] == 2} |
|||
<label class="label label-default label-info">微信</label> |
|||
{elseif $li['payment_type'] == 3} |
|||
<label class="label label-default label-success">银行卡:{$li['card_number']}</label><br /> |
|||
<label class="label label-default label-success">开户行:{$li['bank_name']}</label> |
|||
{else} |
|||
<!--这里是未添加红包打款前的提现信息 默认为微信--> |
|||
<label class="label label-default label-info">微信</label> |
|||
<!--<label class="label label-default label-danger">未选择提现方式</label>--> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $li['status'] == 6} |
|||
<span class="label label-info">审核中</span> |
|||
{else if $li['status']==7} |
|||
<span class="label label-info">审核中</span> |
|||
{else if $li['status']==8} |
|||
<span class="label label-info">已审核</span> |
|||
{else if $li['status'] ==9 && $li['settletype'] == 1} |
|||
<span class="label label-success">手动完成</span> |
|||
{else if $li['status'] ==9 && $li['settletype'] == 3} |
|||
<span class="label label-success">已打款</span> |
|||
{else if $li['status']==10} |
|||
<span class="label label-danger">已驳回</span> |
|||
{else if $li['status']==11} |
|||
<span class="label label-danger">已驳回</span> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date('Y-m-d H:i:s',$li['applytime'])}</td> |
|||
<td>{if $li['updatetime']}{php echo date('Y-m-d H:i:s',$li['updatetime'])}{else} <span class="label label-warning">未操作</span> {/if}</td> |
|||
<td> |
|||
<a class="label label-default" href="{php echo web_url('distribution/dissysbase/distributordetail',array('todo'=>'base','memid'=>$li['mid']))}">用户详情</a> |
|||
{if $status == 1}<a href="javascript:;" appid = "{$li['id']}" class="pass label label-default label-success"> 通过审核</a>{/if} |
|||
{if $status == 1}<a href="javascript:;" appid = "{$li['id']}" class="reject label label-default label-danger"> 驳回</a>{/if} |
|||
{if $status == 2}<a href="javascript:;" appid = "{$li['id']}" class="tocash label label-default label-warning"> 打款</a>{/if} |
|||
{if $status == 2}<a href="javascript:;" appid = "{$li['id']}" class="tofinish label label-default label-info"> 标记完成</a>{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$('.tocash').click(function(e) { |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('appid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
location.href = "{php echo web_url('distribution/dissysbase/tocash')}id="+id; |
|||
}, {html: "确认打款?"}); |
|||
}); |
|||
$('.reject').click(function(e) { |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('appid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
location.href = "{php echo web_url('distribution/dissysbase/reject')}id="+id; |
|||
}, {html: "确认驳回申请?"}); |
|||
}); |
|||
$('.tofinish').click(function(e) { |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('appid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
location.href = "{php echo web_url('distribution/dissysbase/tofinish')}id="+id; |
|||
}, {html: "确认标记完成?"}); |
|||
}); |
|||
$('.pass').click(function(e) { |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('appid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
location.href = "{php echo web_url('distribution/dissysbase/pass')}id="+id; |
|||
}, {html: "确认审核通过?"}); |
|||
}); |
|||
$('#export').click(function(){ |
|||
location.href = "{php echo web_url('distribution/dissysbase/applist',array('status'=>$status,'export'=>1))}"; |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,859 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基础设置</a></li> |
|||
<li><a href="#tab_appdis">{if Customized::init('distributionText') > 0}股东{else}分销{/if}资格</a></li> |
|||
<li><a href="#tab_tixian">提现设置</a></li> |
|||
<li><a href="#tab_notice">模板通知</a></li> |
|||
<li><a href="#tab_qrcode">海报二维码</a></li> |
|||
<li><a href="#tab_share">分享与文本</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">{if Customized::init('distributionText') > 0}共享股东{else}分销{/if}设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开启{if Customized::init('distributionText') > 0}共享股东{else}分销{/if}</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[switch]" value="1" {if intval($base['switch']) == 1}checked{/if}>开启 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[switch]" value="0" {if intval($base['switch']) == 0 || empty($base['switch'])}checked{/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
{if Customized::init('customized336')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分销模式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[dis_model]" value="0" {if intval($base['dis_model']) != 1}checked{/if}>默认模式 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[dis_model]" value="1" {if intval($base['dis_model']) == 1}checked{/if}>全民分销 |
|||
</label> |
|||
<span class="help-block">确定一种分销模式以后请不要随意变更。选择全民分销后所有用户进入平台则自动成为分销商!</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">临时下级</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[temporary_sub]" value="0" {if intval($base['temporary_sub']) != 1}checked{/if}>关闭 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[temporary_sub]" value="1" {if intval($base['temporary_sub']) == 1}checked{/if}>开启 |
|||
</label> |
|||
<span class="help-block">开启后:所有下级不在固定绑定某个分销商,会在支付后取消绑定关系。可以通过邀请绑定新的分销关系</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">自动提现</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[auth_withdraw]" onclick="$('#authWithdrawMoney').addClass('hide');" value="0" {if intval($base['auth_withdraw']) != 1}checked{/if}>关闭 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[auth_withdraw]" onclick="$('#authWithdrawMoney').removeClass('hide');" value="1" {if intval($base['auth_withdraw']) == 1}checked{/if}>开启 |
|||
</label> |
|||
<span class="help-block">开启后:分销商可提现金额到达指定金额后会自动发起提现申请</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $base['auth_withdraw'] != 1}hide{/if}" id="authWithdrawMoney"> |
|||
<label class="col-sm-2 control-label">自动提现限制金额</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="1" name="base[auth_withdraw_money]" class="form-control" value="{$base['auth_withdraw_money']}" /> |
|||
<span class="input-group-addon">元</span> |
|||
</div> |
|||
<span class="help-block">在到达限制金额后系统会自动发起提现申请。限制金额必须大于1才能生效!</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-2 control-label">分销模式</label>--> |
|||
<!-- <div class="col-sm-9">--> |
|||
<!-- <label class="radio-inline" onclick="changemode(0)" >--> |
|||
<!-- <input type="radio" name="base[mode]" value="0" {if intval($base['mode']) == 0 || empty($base['mode'])}checked{/if}>全民分销--> |
|||
<!-- </label>--> |
|||
<!-- <label class="radio-inline" onclick="changemode(1)">--> |
|||
<!-- <input type="radio" name="base[mode]" value="1" {if intval($base['mode']) == 1}checked{/if}>渠道分销--> |
|||
<!-- </label>--> |
|||
<!-- <span class="help-block">确定一种分销模式以后请不要随意变更</span>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销{/if}层级</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[ranknum]" value="1" {if intval($base['ranknum']) == 1 || empty($base['ranknum']) }checked{/if}>一级分销 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[ranknum]" value="2" {if intval($base['ranknum']) == 2}checked{/if}>二级分销 |
|||
</label> |
|||
<!--<label class="radio-inline"> |
|||
<input type="radio" id="inlineRadio5" name="base[ranknum]" value="3" {if intval($base['ranknum']) == 3}checked{/if}> |
|||
<label for="inlineRadio5">三级分销 </label> |
|||
</div>--> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}等级显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[levelshow]" value="1" {if intval($base['levelshow']) == 1}checked{/if}>显示 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[levelshow]" value="0" {if intval($base['levelshow']) == 0 || empty($base['levelshow'])}checked{/if}>隐藏 |
|||
</label> |
|||
{if Customized::init('distributionText') > 0} |
|||
<span class="help-block">共享股东在股东中心可以看到自己的股东等级</span> |
|||
{else} |
|||
<span class="help-block">分销商在分销中心可以看到自己的分销商等级</span> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}排行榜</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[rankshow]" value="1" {if intval($base['rankshow']) == 1}checked{/if}>显示 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[rankshow]" value="0" {if intval($base['rankshow']) == 0 || empty($base['rankshow'])}checked{/if}>隐藏 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}助手</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[dishelp]" value="1" {if intval($base['dishelp']) == 1}checked{/if}>显示 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[dishelp]" value="0" {if intval($base['dishelp']) == 0 || empty($base['dishelp'])}checked{/if}>隐藏 |
|||
</label> |
|||
<span class="help-block">商品页面引导用户成为{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开通{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}自选上级</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[choselead]" value="1" {if intval($base['choselead']) == 1}checked{/if}>开启 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[choselead]" value="0" {if intval($base['choselead']) == 0 || empty($base['choselead'])}checked{/if}>关闭 |
|||
</label> |
|||
<span class="help-block">用户开通{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}时可以更改自身上级</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">过期订单结算方式</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[overstatus]" value="0" {if intval($base['overstatus']) == 0 || empty($base['overstatus'])}checked{/if}>按核销数结算 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[overstatus]" value="1" {if intval($base['overstatus']) == 1}checked{/if}>全部结算 |
|||
</label> |
|||
<span class="help-block">按核销数结算:一个订单核销了几份就结算几份的佣金; 全部结算:不管订单核销了多少,佣金满额结算</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">默认导师</label> |
|||
<div class="col-sm-9"> |
|||
<select name="base[communityid]" class="form-control chosen-select"> |
|||
<option value="" {if empty($base['communityid'])}selected="selected"{/if}>请选择默认导师</option> |
|||
{loop $community $comm} |
|||
<option value="{$comm['id']}" {if $base['communityid'] == $comm['id']}selected="selected"{/if}>{$comm['communname']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block">导师读取平台的社群信息,请选择一个作为默认导师</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">申请页滚动提现记录</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[rollstatus]" value="1" {if intval($base['rollstatus']) == 1}checked{/if}>真实数据 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[rollstatus]" value="2" {if intval($base['rollstatus']) == 2}checked{/if}>虚拟数据 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[rollstatus]" value="0" {if intval($base['rollstatus']) == 0 || empty($base['rollstatus'])}checked{/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">常见问题QA</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('base[distriqa]', $base['distriqa']);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_tixian"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">打款方式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[payment_type][alipay]" value="1" {if $base['payment_type']['alipay'] == 1}checked{/if}> 支付宝 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[payment_type][we_chat]" value="1" {if $base['payment_type']['we_chat'] == 1}checked{/if}> 微信 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[payment_type][bank_card]" value="1" {if $base['payment_type']['bank_card'] == 1}checked{/if}> 银行卡 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[payment_type][balance]" value="1" {if $base['payment_type']['balance'] == 1}checked{/if}> 余额 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">提现金额限制</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">最小¥</span> |
|||
<input type="number" min="0" name="base[lowestmoney]" class="form-control" value="{$base['lowestmoney']}" /> |
|||
<span class="input-group-addon">最大¥</span> |
|||
<input type="number" min="0" name="base[maxmoney]" class="form-control" value="{$base['maxmoney']}" /> |
|||
</div> |
|||
<span class="help-block">最小值默认为1元,设置为0则无限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">提现频率</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0" onkeyup="this.value=this.value.replace(/\D/g,'')" name="base[frequency]" class="form-control" value="{$base['frequency']}" /> |
|||
<span class="input-group-addon">天一次</span> |
|||
</div> |
|||
<span class="help-block">不填或填0则默认无限制,填1则为一天一次,只能填入正整数,以此类推。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">提现手续费</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0" name="base[withdrawcharge]" class="form-control" value="{$base['withdrawcharge']}" /> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">提现时给平台的手续费,不填或填0则没有手续费</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_appdis"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"> |
|||
<span class="modeflag" {if $base['mode'] != 1} style="display: none;" {/if}>一级</span><span class="modeflag2" {if $base['mode'] == 1} style="display: none;" {/if}>成为</span>{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}条件 |
|||
</label> |
|||
<div class="col-sm-9"> |
|||
<!--<label class="radio-inline" onclick="appdis(1)"> |
|||
<input type="radio" id="appdis1" name="base[appdis]" value="0" {if intval($base['appdis']) == 0 || empty($base['appdis'])}checked{/if}> |
|||
<label for="appdis1">无条件</label> |
|||
</div>--> |
|||
<label class="radio-inline" onclick="appdis(3)"> |
|||
<input type="radio" name="base[appdis]" value="0" {if intval($base['appdis']) == 0 || empty($base['appdis'])}checked{/if}>关闭 |
|||
</label> |
|||
<label class="radio-inline" onclick="appdis(1)"> |
|||
<input type="radio" name="base[appdis]" value="1" {if intval($base['appdis']) == 1}checked{/if}>申请 |
|||
</label> |
|||
<label class="radio-inline" onclick="appdis(4)"> |
|||
<input type="radio" name="base[appdis]" value="2" {if intval($base['appdis']) == 2}checked{/if}>开通一卡通 |
|||
</label> |
|||
<label class="radio-inline" onclick="appdis(2)"> |
|||
<input type="radio" name="base[appdis]" value="3" {if intval($base['appdis']) == 3}checked{/if}>付费 |
|||
</label> |
|||
{if file_exists(PATH_MODULE . 'jimaiwang.log')} |
|||
<label class="radio-inline" onclick="appdis(3)"> |
|||
<input type="radio" name="base[appdis]" value="4" {if intval($base['appdis']) == 4}checked{/if}>用户即分销 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="appdisdiv4" {if $base['appdis'] != 2} style="display: none;" {/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"> |
|||
同步开通{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if} |
|||
</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[together]" value="1" {if intval($base['together']) == 1}checked{/if}>开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[together]" value="0" {if intval($base['together']) == 0}checked{/if}>关闭 |
|||
</label> |
|||
<span class="help-block">开启后,激活一卡通会员的用户会立即成为{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="appdisdiv3" {if $base['appdis'] != 3} style="display: none;" {/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"> |
|||
付费金额 |
|||
</label> |
|||
<div class="col-md-3"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="base[applymoney]" class="form-control" value="{$base['applymoney']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">付费申请金额</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[seetstatus]" value="0" {if intval($base['seetstatus']) == 0 || empty($base['seetstatus'])}checked{/if}>结算给代理 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[seetstatus]" value="1" {if intval($base['seetstatus']) == 1}checked{/if}>结算给平台 |
|||
</label> |
|||
<span class="help-block">除开佣金的金额结算方向。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="appdisdiv3dis" {if $base['appdis'] != 3} style="display: none;" {/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">一级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}获得佣金</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group col-sm-2"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="base[modeonemoney]" class="form-control" value="{$base['modeonemoney']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">二级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}获得佣金</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group col-sm-2"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="base[modetwomoney]" class="form-control" value="{$base['modetwomoney']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="examineflag" {if intval($base['appdis']) == 0 || empty($base['appdis'])} style="display: none;" {/if} class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="modeflag" {if $base['mode'] != 1} style="display: none;" {/if}>一级</span>是否审核</label> |
|||
<div class="col-xs-2 col-sm-2"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[examine]" value="1" {if intval($base['examine']) == 1}checked{/if}>需要 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[examine]" value="0" {if intval($base['examine']) == 0 || empty($base['examine'])}checked{/if}>不需要 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}必须开通会员</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[bindvip]" value="0" {if intval($base['bindvip']) == 0 || empty($base['bindvip'])} checked {/if} > 关闭 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[bindvip]" value="1" {if intval($base['bindvip']) == 1} checked {/if}> 全体{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if} |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[bindvip]" value="2" {if intval($base['bindvip']) == 2} checked {/if}> 仅申请的{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if} |
|||
</label> |
|||
{if Customized::init('distributionText') > 0} |
|||
<span class="help-block">开启后,如果共享股东不是一卡通会员或会员过期会关闭共享股东的权限,在共享股东开通或续费会员后会重启共享股东的权限。仅申请的共享股东是指除了后台添加的所有共享股东。</span> |
|||
{else} |
|||
<span class="help-block">开启后,如果分销商不是一卡通会员或会员过期会关闭分销商的分销权限,在分销商开通或续费会员后会重启分销商的分销权限。仅申请的分销商是指除了后台添加的所有分销商。</span> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">绑定上下级关系条件</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#lockstatus').hide();"> |
|||
<input type="radio" name="base[lockstatus]" value="0" {if intval($base['lockstatus']) == 0 || empty($base['lockstatus'])} checked {/if} > 扫码或分享立即绑定 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#lockstatus').show();" > |
|||
<input type="radio" name="base[lockstatus]" value="1" {if intval($base['lockstatus']) == 1} checked {/if}> 第一次产生佣金订单支付后绑定 |
|||
</label> |
|||
|
|||
<label class="radio-inline" onclick="$('#lockstatus').hide();" > |
|||
<input type="radio" name="base[lockstatus]" value="2" {if intval($base['lockstatus']) == 2} checked {/if}> 动态上级 |
|||
</label> |
|||
|
|||
{if is_file(PATH_MODULE.'TnSrtWDJ.log')} |
|||
<label class="radio-inline" onclick="$('#lockstatus').show();" > |
|||
<input type="radio" name="base[lockstatus]" value="3" {if intval($base['lockstatus']) == 3} checked {/if}> 在线开通会员卡后绑定 |
|||
</label> |
|||
{/if} |
|||
{if Customized::init('distributionText') > 0} |
|||
<span class="help-block">扫码或分享立即绑定:在客户扫描共享股东二维码或点击共享股东的分享链接时立即绑定;<br/>第一次产生佣金订单支付后绑定:客户在扫描共享股东二维码或点击共享股东的分享链接后下单购买商品并支付以后绑定;<br/>动态上级:不是共享股东的用户不会有锁定的上级,会根据每次分享商品链接的共享股东不同而给对应的共享股东分佣。</span> |
|||
{else} |
|||
<span class="help-block">扫码或分享立即绑定:在客户扫描分销商二维码或点击分销商的分享链接时立即绑定;<br/>第一次产生分销订单支付后绑定:客户在扫描分销商二维码或点击分销商的分享链接后下单购买商品并支付以后绑定;<br/>动态上级:不是分销商的用户不会有锁定的上级,会根据每次分享商品链接的分销商不同而给对应的分销商分佣。</span> |
|||
{/if} |
|||
|
|||
</div> |
|||
</div> |
|||
{if is_file(PATH_MODULE.'TnSrtWDJ.log')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">二级升一级客户人数</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="base[twoupone]" class="form-control" value="{$base['twoupone']}" /> |
|||
<span class="input-group-addon">人</span> |
|||
</div> |
|||
<span class="help-block">二级升一级所需客户人数,不填或填0则不升级</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group" id="lockstatus" {if intval($base['lockstatus']) != 1} style="display: none" {/if} > |
|||
<label class="col-sm-2 control-label">是否显示未锁定下级</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[showlock]" value="0" {if intval($base['showlock']) == 0 || empty($base['showlock'])} checked {/if} > 隐藏 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[showlock]" value="1" {if intval($base['showlock']) == 1} checked {/if}> 显示 |
|||
</label> |
|||
<span class="help-block">是否在手机端显示还未锁定的下级</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}升级条件</label> |
|||
<div class="col-sm-9"> |
|||
<div style="background: #f5f7f9;width: 520px;padding: 10px;"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[levelupstatus][]" value="0" {if in_array(0,$levelupstatusArray)}checked{/if}>已结算佣金总金额 |
|||
</label><br /> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[levelupstatus][]" value="1" {if in_array(1,$levelupstatusArray)}checked{/if}>下线总人数 |
|||
</label><br /> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[levelupstatus][]" value="2" {if in_array(2,$levelupstatusArray)}checked{/if}>一级下线人数 |
|||
</label><br /> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[levelupstatus][]" value="3" {if in_array(3,$levelupstatusArray)}checked{/if}>下级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}总人数 |
|||
</label><br /> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[levelupstatus][]" value="4" {if in_array(4,$levelupstatusArray)}checked{/if}>一级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}人数 |
|||
</label><br /> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="base[levelupstatus][]" value="5" {if in_array(5,$levelupstatusArray)}checked{/if}>自购订单金额 |
|||
</label> |
|||
</div> |
|||
<span class="help-block">勾选多项条件后,达成一个条件即可升级。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">申请背景色</label> |
|||
<div class="col-sm-9"> |
|||
<input type="color" class="form-control" value="{php echo $base['apply_bgcolor'] ? : '#FF4444';}" name="base[apply_bgcolor]" /> |
|||
<span class="help-block">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}申请页面背景颜色</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">申请幻灯片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('base[apply_adv]',$base['apply_adv']);} |
|||
<span class="help-block">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}申请页面顶部的幻灯片,不设置则使用默认图片,建议大小750X380</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('base[appdetail]', $base['appdetail']);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_notice"> |
|||
<div class="alert alert-info"> |
|||
<b>注意:</b> |
|||
<p>需要在模板设置中设置[业务处理结果通知]模板</p> |
|||
</div> |
|||
<div class="panel-heading"> |
|||
成为{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}通知 |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[noticetitle1]" class="form-control" value="{$base['noticetitle1']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="base[noticecontent1]" style="width: 100%;height: 70px;" class="form-control">{$base['noticecontent1']}</textarea> |
|||
<span class="help-block">模板变量:[昵称] [时间]</span> |
|||
</div> |
|||
</div> |
|||
<div class="panel-heading"> |
|||
新增下级通知 |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[noticetitle2]" placeholder="默认:新增下级通知" class="form-control" value="{$base['noticetitle2']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">通知等级</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[noticerank2]" value="0" {if intval($base['noticerank2']) == 0 || empty($base['noticerank2'])}checked{/if}>一级(默认) |
|||
</label> |
|||
{if $base['ranknum']>1} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[noticerank2]" value="1" {if intval($base['noticerank2']) == 1}checked{/if}>一级+二级 |
|||
</label> |
|||
{/if} |
|||
{if $base['ranknum']>2} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[noticerank2]" value="2" {if intval($base['noticerank2']) == 2}checked{/if}>一级+二级+三级 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="base[noticecontent2]" style="width: 100%;height: 70px;" class="form-control">{$base['noticecontent2']}</textarea> |
|||
<span class="help-block">模板变量:[昵称] [下级昵称] [时间] [下线层级]</span> |
|||
</div> |
|||
</div> |
|||
<div class="panel-heading"> |
|||
下级付款通知 |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[noticetitle3]" placeholder="默认:下级付款通知" class="form-control" value="{$base['noticetitle3']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">通知等级</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[noticerank3]" value="0" {if intval($base['noticerank3']) == 0 || empty($base['noticerank3'])}checked{/if}>一级(默认) |
|||
</label> |
|||
{if $base['ranknum']>1} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[noticerank3]" value="1" {if intval($base['noticerank3']) == 1}checked{/if}>一级+二级 |
|||
</label> |
|||
{/if} |
|||
{if $base['ranknum']>2} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="base[noticerank3]" value="2" {if intval($base['noticerank3']) == 2}checked{/if}>一级+二级+三级 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="base[noticecontent3]" style="width: 100%;height: 70px;" class="form-control">{$base['noticecontent3']}</textarea> |
|||
<span class="help-block">模板变量 [昵称] [下级昵称] [订单编号] [订单金额] [订单类型] [商品名称] [佣金金额] [时间] [下线层级]</span> |
|||
<span class="help-block">注意: 此 [佣金金额] ,不代表上级用户会立即获得,为可能获得的佣金金额</span> |
|||
</div> |
|||
</div> |
|||
<div class="panel-heading"> |
|||
佣金到账通知 |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[noticetitle4]" placeholder="默认:佣金到账通知" class="form-control" value="{$base['noticetitle4']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="base[noticecontent4]" style="width: 100%;height: 70px;" class="form-control">{$base['noticecontent4']}</textarea> |
|||
<span class="help-block">模板变量:[昵称] [下级昵称] [订单编号] [订单金额] [订单类型] [商品名称] [佣金金额] [时间] [下线层级] [可提现佣金] [总获得佣金]</span> |
|||
</div> |
|||
</div> |
|||
<div class="panel-heading"> |
|||
提现申请提交通知 |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[noticetitle5]" placeholder="默认:提现申请提交通知" class="form-control" value="{$base['noticetitle5']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="base[noticecontent5]" style="width: 100%;height: 70px;" class="form-control">{$base['noticecontent5']}</textarea> |
|||
<span class="help-block">模板变量:[昵称] [金额] [时间]</span> |
|||
</div> |
|||
</div> |
|||
<div class="panel-heading"> |
|||
提现申请审核完成通知 |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[noticetitle6]" placeholder="默认:提现申请审核完成通知" class="form-control" value="{$base['noticetitle6']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="base[noticecontent6]" style="width: 100%;height: 70px;" class="form-control">{$base['noticecontent6']}</textarea> |
|||
<span class="help-block">模板变量:[昵称] [金额] [时间]</span> |
|||
</div> |
|||
</div> |
|||
<div class="panel-heading"> |
|||
佣金打款通知 |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[noticetitle7]" placeholder="默认:佣金打款通知" class="form-control" value="{$base['noticetitle7']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="base[noticecontent7]" style="width: 100%;height: 70px;" class="form-control">{$base['noticecontent7']}</textarea> |
|||
<span class="help-block">模板变量:[昵称] [打款方式] [金额] [时间]</span> |
|||
</div> |
|||
</div> |
|||
<div class="panel-heading"> |
|||
{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}等级升级通知 |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[noticetitle8]" placeholder="默认:等级升级通知" class="form-control" value="{$base['noticetitle8']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="base[noticecontent8]" style="width: 100%;height: 70px;" class="form-control">{$base['noticecontent8']}</textarea> |
|||
<span class="help-block">模板变量: [昵称] [旧等级] [旧一级分销比例] [旧二级分销比例] [旧三级分销比例] [新等级] [新一级分销比例] [新二级分销比例] [新三级分销比例] [时间]</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_qrcode"> |
|||
{if p('wxplatform')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海报二维码</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[posterqr]" value="0" onclick="$('.gzqrcode').hide();" {if intval($base['posterqr']) == 0 || empty($base['rollstatus'])}checked{/if}>普通二维码{if p('wxapp')}(小程序码){/if} |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[posterqr]" value="1" onclick="$('.gzqrcode').show();" {if intval($base['posterqr']) == 1}checked{/if}>关注二维码 |
|||
</label> |
|||
<span class="help-block">关注二维码:扫描海报以后会先关注公众号</span> |
|||
</div> |
|||
</div> |
|||
<div class="gzqrcode" {if intval($base['posterqr']) != 1}style="display: none"{/if}> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-2 control-label">二维码类型</label>--> |
|||
<!-- <div class="col-sm-9">--> |
|||
<!-- <label class="radio-inline" >--> |
|||
<!-- <input type="radio" name="base[posterType]" value="0" {if intval($base['posterType']) != 1}checked{/if}>永久二维码--> |
|||
<!-- </label>--> |
|||
<!-- <label class="radio-inline" >--> |
|||
<!-- <input type="radio" name="base[posterType]" value="1" {if intval($base['posterType']) == 1}checked{/if}>普通二维码--> |
|||
<!-- </label>--> |
|||
<!-- <span class="help-block">永久二维码:二维码长期有效,永不过期;普通二维码:有效期30天,过期以后生成新的</span>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关注回复类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[replytype]" value="0" {if intval($base['replytype']) != 1}checked{/if}>微信图文 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="base[replytype]" value="1" {if intval($base['replytype']) == 1}checked{/if}>小程序 |
|||
</label> |
|||
<span class="help-block">默认回复类型为微信图文</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关注回复标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[gztitle]" class="form-control" value="{$base['gztitle']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关注回复描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[gzdesc]" class="form-control" value="{$base['gzdesc']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关注回复图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('base[gzthumb]',$base['gzthumb']);} |
|||
<span class="help-block">图片推荐600像素 * 600像素</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海报跳转链接</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#qrcodeurl').hide();" > |
|||
<input type="radio" name="base[qrcodeurlstatus]" value="0" {if intval($base['qrcodeurlstatus']) == 0 || empty($base['qrcodeurlstatus'])}checked{/if}>{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}申请页 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#qrcodeurl').hide();"> |
|||
<input type="radio" name="base[qrcodeurlstatus]" value="1" {if intval($base['qrcodeurlstatus']) == 1}checked{/if}>平台首页 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [系统名称]</b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[share_title]" class="form-control" value="{$base['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('base[share_image]', $base['share_image']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[share_desc]" class="form-control" value="{$base['share_desc']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">文本替换</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">导师=</span> |
|||
<input type="text" name="base[dstext]" class="form-control valid" placeholder="导师" value="{$base['dstext']}" > |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">导师信息提示</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[dsinfotext]" class="form-control valid" placeholder="想赚取更多利益,获得更多优惠?快联系你的指导老师拜师学艺吧!" value="{$base['dsinfotext']}" > |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">个人信息提示</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[grinfotext]" class="form-control valid" placeholder="为了让你的社群成员能够更方便的找到你,请上传你的微信二维码" value="{$base['grinfotext']}" > |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
function rank(r){ |
|||
if(r == 1){ |
|||
$('#tworank').hide(); |
|||
$('#threerank').hide(); |
|||
}else if(r == 2){ |
|||
$('#tworank').show(); |
|||
$('#threerank').hide(); |
|||
}else if(r == 3){ |
|||
$('#tworank').show(); |
|||
$('#threerank').show(); |
|||
} |
|||
} |
|||
|
|||
function changehelp(flag){ |
|||
if(flag>0){ |
|||
$('#helpimg').show(); |
|||
}else{ |
|||
$('#helpimg').hide(); |
|||
} |
|||
} |
|||
|
|||
function appdis(a){ |
|||
if(a == 1){ |
|||
$('#appdisdiv3').hide(); |
|||
$('#appdisdiv3dis').hide(); |
|||
$('#examineflag').show(); |
|||
$('#appdisdiv4').hide(); |
|||
}else if(a == 3){ |
|||
$('#appdisdiv3').hide(); |
|||
$('#appdisdiv3dis').hide(); |
|||
$('#examineflag').hide(); |
|||
$('#appdisdiv4').hide(); |
|||
}else if(a == 4){ |
|||
$('#appdisdiv3').hide(); |
|||
$('#appdisdiv3dis').hide(); |
|||
$('#examineflag').show(); |
|||
$('#appdisdiv4').show(); |
|||
}else{ |
|||
$('#appdisdiv4').hide(); |
|||
$('#appdisdiv3').show(); |
|||
$('#examineflag').show(); |
|||
$('#appdisdiv3dis').show(); |
|||
} |
|||
} |
|||
function twoappdis(a){ |
|||
if(a == 1){ |
|||
$('#twoappdisdiv3').hide(); |
|||
$('#twoexamineflag').show(); |
|||
}else if(a == 3){ |
|||
$('#twoappdisdiv3').hide(); |
|||
$('#twoexamineflag').hide(); |
|||
}else{ |
|||
$('#twoappdisdiv3').show(); |
|||
$('#twoexamineflag').show(); |
|||
} |
|||
} |
|||
|
|||
function changemode(flag){ |
|||
if(flag){ |
|||
$('.modeflag').show(); |
|||
$('.modeflag2').hide(); |
|||
$('#twodis').show(); |
|||
$('#twocommunity').show(); |
|||
$('#appdisdiv3dis').hide(); |
|||
}else{ |
|||
$('.modeflag').hide(); |
|||
$('.modeflag2').show(); |
|||
$('#twodis').hide(); |
|||
$('#twocommunity').hide(); |
|||
if($('input[name="base[appdis]"]:checked').val() == 3){ |
|||
$('#appdisdiv3dis').show(); |
|||
}else{ |
|||
$('#appdisdiv3dis').hide(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,161 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li><a href="javascript:;">佣金明细</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="distribution" /> |
|||
<input type="hidden" name="ac" value="dissysbase" /> |
|||
<input type="hidden" name="do" value="disdetail" /> |
|||
<input type="hidden" name="ordertype" value="{$_GPC['ordertype']}" /> |
|||
<input type="hidden" name="orderstatus" value="{$_GPC['orderstatus']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo filter_url('orderstatus:0');}" class="btn {if $_GPC['orderstatus'] == '' || $_GPC['orderstatus'] == '0'}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo filter_url('orderstatus:1');}" class="btn {if $_GPC['orderstatus'] == '1'}btn-primary{else}btn-default{/if}">收入</a> |
|||
<a href="{php echo filter_url('orderstatus:2');}" class="btn {if $_GPC['orderstatus'] == '2'}btn-primary{else}btn-default{/if}">支出</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group max-with-all"> |
|||
<label class="col-sm-2 control-label">订单类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo filter_url('ordertype:');}" class="btn {if $_GPC['ordertype'] == ''}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo filter_url('ordertype:rush');}" class="btn {if $_GPC['ordertype'] == 'rush'}btn-primary{else}btn-default{/if}">抢购</a> |
|||
{if p('groupon')} |
|||
<a href="{php echo filter_url('ordertype:groupon');}" class="btn {if $_GPC['ordertype'] == 'groupon'}btn-primary{else}btn-default{/if}">团购</a> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<a href="{php echo filter_url('ordertype:fightgroup');}" class="btn {if $_GPC['ordertype'] == 'fightgroup'}btn-primary{else}btn-default{/if}">拼团</a> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<a href="{php echo filter_url('ordertype:coupon');}" class="btn {if $_GPC['ordertype'] == 'coupon'}btn-primary{else}btn-default{/if}">超级券</a> |
|||
{/if} |
|||
{if p('activity')} |
|||
<a href="{php echo filter_url('ordertype:activity');}" class="btn {if $_GPC['ordertype'] == 'activity'}btn-primary{else}btn-default{/if}">活动</a> |
|||
{/if} |
|||
{if p('bargain')} |
|||
<a href="{php echo filter_url('ordertype:bargain');}" class="btn {if $_GPC['ordertype'] == 'bargain'}btn-primary{else}btn-default{/if}">砍价</a> |
|||
{/if} |
|||
<a href="{php echo filter_url('ordertype:payonline');}" class="btn {if $_GPC['ordertype'] == 'payonline'}btn-primary{else}btn-default{/if}">在线买单</a> |
|||
{if p('pocket')} |
|||
<a href="{php echo filter_url('ordertype:pocket');}" class="btn {if $_GPC['ordertype'] == 'pocket'}btn-primary{else}btn-default{/if}">掌上信息</a> |
|||
{/if} |
|||
{if p('halfcard')} |
|||
<a href="{php echo filter_url('ordertype:halfcard');}" class="btn {if $_GPC['ordertype'] == 'halfcard'}btn-primary{else}btn-default{/if}">一卡通充值</a> |
|||
{/if} |
|||
<a href="{php echo filter_url('ordertype:charge');}" class="btn {if $_GPC['ordertype'] == 'charge'}btn-primary{else}btn-default{/if}">付费入驻</a> |
|||
<a href="{php echo filter_url('ordertype:distribution');}" class="btn {if $_GPC['ordertype'] == 'distribution'}btn-primary{else}btn-default{/if}">付费申请{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</a> |
|||
{if p('citycard')} |
|||
<a href="{php echo filter_url('ordertype:citycard');}" class="btn {if $_GPC['ordertype'] == 'citycard'}btn-primary{else}btn-default{/if}">同城名片</a> |
|||
{/if} |
|||
{if p('citydelivery')} |
|||
<a href="{php echo filter_url('ordertype:citydelivery');}" class="btn {if $_GPC['ordertype'] == 'citydelivery'}btn-primary{else}btn-default{/if}">同城配送</a> |
|||
{/if} |
|||
<a href="{php echo filter_url('ordertype:cash');}" class="btn {if $_GPC['ordertype'] == 'cash'}btn-primary{else}btn-default{/if}">提现申请</a> |
|||
<a href="{php echo filter_url('ordertype:system');}" class="btn {if $_GPC['ordertype'] == 'system'}btn-primary{else}btn-default{/if}">后台修改</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}MID</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}昵称</option> |
|||
<option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>买家MID</option> |
|||
<option value="6" {if $_GPC['keywordtype']==6}selected="selected"{/if}>买家昵称</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>金额大于</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>金额小于</option> |
|||
</select> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时间</label> |
|||
<div class="col-md-2"> |
|||
<select name="timetype" class="form-control"> |
|||
<option {if empty($_GPC['timetype'])} selected="selected" {/if} value="">关闭</option> |
|||
<option {if $_GPC['timetype'] > 0 } selected="selected" {/if} value="1">开启</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-3"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
<button class="btn btn-default" name="exportflag" type="submit" value="export"><i class="fa fa-download"></i> 导出</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:5%;">MID</th> |
|||
<th style="width:15%;">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}姓名</th> |
|||
<th style="width:10%;">收支</th> |
|||
<th style="width:10%;">金额</th> |
|||
<th style="width:10%;">来源</th> |
|||
<th style="width:15%;">描述</th> |
|||
<th style="width:25%;">时间</th> |
|||
<th style="width:10%;">订单</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $details $de} |
|||
<tr> |
|||
<td>{$de['leadid']}</td> |
|||
<td>{$de['leadname']}</td> |
|||
<td><span {if $de['type'] == 1} class="label label-success" {else} class="label label-danger" {/if} >{$de['typetext']}</span></td> |
|||
<td style="color: red;">{$de['price']}</td> |
|||
<td>{$de['buyname']}</td> |
|||
<td> |
|||
{$de['pluginname']} |
|||
{if $de['checkcode']} |
|||
<br/>核销码:{$de['checkcode']} |
|||
{/if} |
|||
</td> |
|||
<td>{$de['createtime']}</td> |
|||
<td>{if $de['orderurl']}<a class="btn btn-primary btn-sm" target="_blank" href="{$de['orderurl']}">查看</a>{/if}</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<style> |
|||
.change:hover{ |
|||
cursor:pointer; |
|||
} |
|||
</style> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,103 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type="text/css"> |
|||
.page-heading { |
|||
padding: 5px 0; |
|||
border-bottom: 1px solid #ccc; |
|||
margin-bottom: 20px; |
|||
position: relative; |
|||
margin-left: 15px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li><a href="javascript:;">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}等级</a></li> |
|||
</ul> |
|||
|
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a class="btn btn-primary" href="{php echo web_url('distribution/dissysbase/editlevel')}" data-toggle="ajaxModal">增加等级</a> |
|||
</div> |
|||
</div> |
|||
<div class="alert alert-info" style="margin-bottom: 1rem;"> |
|||
<b>注意:没有设置等级的{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}将按默认等级计算提成。商品指定的佣金金额的优先级仍是最高的,也就是说只要商品指定了佣金金额就按商品的佣金金额来计算,不受等级影响</b> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:100px;">等级名称</th> |
|||
<th class="text-center" style="width:100px;">一级佣金比例</th> |
|||
{if $base['ranknum']> 1} |
|||
<th class="text-center" style="width:100px;">二级佣金比例</th> |
|||
{/if} |
|||
{if $base['ranknum']> 2} |
|||
<th class="text-center" style="width:100px;">三级佣金比例</th> |
|||
{/if} |
|||
<th class="text-center" style="width:50px;">等级层级</th> |
|||
<!-- <th class="text-center" style="width:100px;">升级条件</th>--> |
|||
<th class="text-center" style="width:100px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $levels $item} |
|||
<tr class="text-center" > |
|||
<td> |
|||
{$item['name']}{if $item['isdefault'] == 1}[默认等级]{/if} |
|||
</td> |
|||
<td>{$item['onecommission']}%</td> |
|||
{if $base['ranknum']> 1} |
|||
<td>{$item['twocommission']}%</td> |
|||
{/if} |
|||
{if $base['ranknum']> 2} |
|||
<td>{$item['threecommission']}%</td> |
|||
{/if} |
|||
<td>{$item['levelclass']}</td> |
|||
<!-- <td>{if $item['isdefault'] == 1}--> |
|||
<!-- 默认等级--> |
|||
<!-- {else}--> |
|||
<!-- {if $item['upstandard'] }--> |
|||
<!-- {if $base['levelupstatus'] == 0 || empty($base['levelupstatus'])}--> |
|||
<!-- 已结算佣金总金额大于{$item['upstandard']}元--> |
|||
<!-- {/if}--> |
|||
<!-- {if $base['levelupstatus'] == 1}--> |
|||
<!-- 下线总人数满{$item['upstandard']}人--> |
|||
<!-- {/if}--> |
|||
<!-- {if $base['levelupstatus'] == 2}--> |
|||
<!-- 一级下线人数满{$item['upstandard']}人--> |
|||
<!-- {/if}--> |
|||
<!-- {if $base['levelupstatus'] == 3}--> |
|||
<!-- 下线{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}人数满{$item['upstandard']}人--> |
|||
<!-- {/if}--> |
|||
<!-- {if $base['levelupstatus'] == 4}--> |
|||
<!-- 一级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}人数满{$item['upstandard']}人--> |
|||
<!-- {/if}--> |
|||
<!-- {if $base['levelupstatus'] == 5}--> |
|||
<!-- 自购订单金额大于{$item['upstandard']}元--> |
|||
<!-- {/if}--> |
|||
<!-- {else}--> |
|||
<!-- 不自动升级--> |
|||
<!-- {/if}--> |
|||
<!-- {/if}--> |
|||
<!-- </td>--> |
|||
<td style="position:relative;"> |
|||
<a href="{php echo web_url('distribution/dissysbase/editlevel',array('id'=>$item['id']))}" data-toggle="ajaxModal">编辑 </a> |
|||
{if $item['isdefault'] != 1} - <a data-toggle="ajaxRemove" href="{php echo web_url('distribution/dissysbase/deletelevel',array('id'=>$item['id']));}" data-confirm='确认删除此等级?'>删除 </a>{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,220 @@ |
|||
<form action="{php echo web_url('distribution/dissysbase/editlevel')}" method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content" style="max-height: 850px;"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}等级</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;max-height: 700px;overflow-x: hidden;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">等级名称</label> |
|||
<div class="col-md-7"> |
|||
<input type="text" name="name" id="name" class="form-control" value="{$level['name']}"/> |
|||
</div> |
|||
</div> |
|||
{if $level['isdefault'] != 1} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">等级层级</label> |
|||
<div class="col-md-7"> |
|||
<input type="number" name="levelclass" class="form-control" value="{$level['levelclass']}"/> |
|||
<span class="help-block">层级唯一,表示该等级在分销商等级系统中所在层级,填入正整数。</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">一级佣金比例</label> |
|||
<div class="col-md-7"> |
|||
<div class="input-group"> |
|||
<input type="text" name="onecommission" class="form-control" value="{$level['onecommission']}"/> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if $base['ranknum']> 1} |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">二级佣金比例</label> |
|||
<div class="col-md-7"> |
|||
<div class="input-group"> |
|||
<input type="text" name="twocommission" class="form-control" value="{$level['twocommission']}"/> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $base['ranknum']> 2} |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">三级佣金比例</label> |
|||
<div class="col-md-7"> |
|||
<div class="input-group"> |
|||
<input type="text" name="threecommission" class="form-control" value="{$level['threecommission']}"/> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $level['isdefault'] != 1} |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">升级条件</label> |
|||
<div class="col-md-7"> |
|||
{if is_array($levelupstatusArray)} |
|||
{if in_array(0,$levelupstatusArray)} |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">已结算佣金总金额大于</span> |
|||
<input type="number" name="upstandard" class="form-control" value="{$level['upstandard']}"> |
|||
<span class="input-group-addon">元</span> |
|||
</div> |
|||
{/if} |
|||
{if in_array(1,$levelupstatusArray)} |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">下线总人数满</span> |
|||
<input type="number" name="upstandard1" class="form-control" value="{$level['upstandard1']}"> |
|||
<span class="input-group-addon">人</span> |
|||
</div> |
|||
{/if} |
|||
{if in_array(2,$levelupstatusArray)} |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">一级下线人数满</span> |
|||
<input type="number" name="upstandard2" class="form-control" value="{$level['upstandard2']}"> |
|||
<span class="input-group-addon">人</span> |
|||
</div> |
|||
{/if} |
|||
{if in_array(3,$levelupstatusArray)} |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">下线{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}人数满</span> |
|||
<input type="number" name="upstandard3" class="form-control" value="{$level['upstandard3']}"> |
|||
<span class="input-group-addon">人</span> |
|||
</div> |
|||
{/if} |
|||
{if in_array(4,$levelupstatusArray)} |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">一级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}人数满</span> |
|||
<input type="number" name="upstandard4" class="form-control" value="{$level['upstandard4']}"> |
|||
<span class="input-group-addon">人</span> |
|||
</div> |
|||
{/if} |
|||
{if in_array(5,$levelupstatusArray)} |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">自购订单金额大于</span> |
|||
<input type="number" name="upstandard5" class="form-control" value="{$level['upstandard5']}"> |
|||
<span class="input-group-addon">元</span> |
|||
</div> |
|||
{/if} |
|||
<span class="help-block">多个升级条件满足一项即可升级,参数填0时表示此等级不能通过该条件升级。</span> |
|||
{else} |
|||
<span class="help-block">请先在分销设置-分销资格中勾选可升级条件。</span> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">升级赠送积分</label> |
|||
<div class="col-md-7"> |
|||
<div class="input-group" style="width: 100%"> |
|||
<input type="number" name="giftintegral" class="form-control" value="{$level['giftintegral']}"> |
|||
</div> |
|||
<span class="help-block">最多保留两位小数。</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">自购返佣</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio-inline radio"> |
|||
<input type="radio" id="own1" name="ownstatus" {if $level['ownstatus'] == 1 } checked="checked" {/if} value="1" /><label style="padding-left: 0;" for="own1">启用</label> |
|||
</div> |
|||
<div class="radio-inline radio"> |
|||
<input type="radio" id="own2" name="ownstatus" {if $level['ownstatus'] == 0 || empty($level['ownstatus']) } checked="checked" {/if} value="0" /><label style="padding-left: 0;" for="own2">禁用</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">适用插件</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="checkbox checkbox-success checkbox-inline" style="margin-left: 10px;"> |
|||
<input id="plu1" type="checkbox" name="plugin[]" {if in_array("rush",$level['plugin'])} checked="checked" {/if} value="rush" /><label style="padding-left: 0;" for="plu1">抢购 </label> |
|||
</div> |
|||
{if p('groupon')} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plu9" type="checkbox" name="plugin[]" {if in_array("groupon",$level['plugin'])} checked="checked" {/if} value="groupon" /><label style="padding-left: 0;" for="plu9">团购</label> |
|||
</div> |
|||
{/if} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plu6" type="checkbox" name="plugin[]" {if in_array("coupon",$level['plugin'])} checked="checked" {/if} value="coupon" /><label style="padding-left: 0;" for="plu6">超级券</label> |
|||
</div> |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plu3" type="checkbox" name="plugin[]" {if in_array("fightgroup",$level['plugin'])} checked="checked" {/if} value="fightgroup" /><label style="padding-left: 0;" for="plu3">拼团</label> |
|||
</div> |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plu2" type="checkbox" name="plugin[]" {if in_array("halfcard",$level['plugin'])} checked="checked" {/if} value="halfcard" /><label style="padding-left: 0;" for="plu2">一卡通</label> |
|||
</div> |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plupay" type="checkbox" name="plugin[]" {if in_array("payonline",$level['plugin'])} checked="checked" {/if} value="payonline" /><label style="padding-left: 0;" for="plupay">在线买单</label> |
|||
</div> |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plu4" type="checkbox" name="plugin[]" {if in_array("pocket",$level['plugin'])} checked="checked" {/if} value="pocket" /><label style="padding-left: 0;" for="plu4">掌上信息</label> |
|||
</div> |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plu7" type="checkbox" name="plugin[]" {if in_array("charge",$level['plugin'])} checked="checked" {/if} value="charge" /><label style="padding-left: 0;" for="plu7">商户入驻</label> |
|||
</div> |
|||
{if p('activity')} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plu8" type="checkbox" name="plugin[]" {if in_array("activity",$level['plugin'])} checked="checked" {/if} value="activity" /><label style="padding-left: 0;" for="plu8">同城活动</label> |
|||
</div> |
|||
{/if} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plu5" type="checkbox" name="plugin[]" {if in_array("distribution",$level['plugin'])} checked="checked" {/if} value="distribution" /><label style="padding-left: 0;" for="plu5">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}申请</label> |
|||
</div> |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plucon" type="checkbox" name="plugin[]" {if in_array("consumption",$level['plugin'])} checked="checked" {/if} value="consumption" /><label style="padding-left: 0;" for="plucon">积分兑换</label> |
|||
</div> |
|||
{if p('bargain')} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plub" type="checkbox" name="plugin[]" {if in_array("bargain",$level['plugin'])} checked="checked" {/if} value="bargain" /><label style="padding-left: 0;" for="plub">砍价活动</label> |
|||
</div> |
|||
{/if} |
|||
{if p('citycard')} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plucard" type="checkbox" name="plugin[]" {if in_array("citycard",$level['plugin'])} checked="checked" {/if} value="citycard" /><label style="padding-left: 0;" for="plucard">同城名片</label> |
|||
</div> |
|||
{/if} |
|||
{if p('citydelivery')} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="pludelivery" type="checkbox" name="plugin[]" {if in_array("citydelivery",$level['plugin'])} checked="checked" {/if} value="citydelivery" /><label style="padding-left: 0;" for="pludelivery">同城配送</label> |
|||
</div> |
|||
{/if} |
|||
{if uniacid_p('mobilerecharge')} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input id="plumobilerecharge" type="checkbox" name="plugin[]" {if in_array("mobilerecharge",$level['plugin'])} checked="checked" {/if} value="mobilerecharge" /><label style="padding-left: 0;" for="plumobilerecharge">话费充值</label> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$level['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<script> |
|||
$(document).on('show.bs.modal', '.modal', function(event) { |
|||
$(this).appendTo($('body')); |
|||
}).on('shown.bs.modal', '.modal.in', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}).on('hidden.bs.modal', '.modal', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}); |
|||
|
|||
|
|||
function setModalsAndBackdropsOrder() { |
|||
var modalZIndex = 1040; |
|||
$('.modal.in').each(function(index) { |
|||
var $modal = $(this); |
|||
modalZIndex++; |
|||
$modal.css('zIndex', modalZIndex); |
|||
$modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1); |
|||
}); |
|||
$('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden'); |
|||
} |
|||
</script> |
|||
@ -0,0 +1,295 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
{if $todo == 'dislist'} |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('distribution/dissysbase/distributorlist',array('todo'=>'adddis'));}" class="btn btn-primary">添加{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="distribution" /> |
|||
<input type="hidden" name="ac" value="dissysbase" /> |
|||
<input type="hidden" name="do" value="distributorlist" /> |
|||
<input type="hidden" name="levelid" value="{$_GPC['levelid']}" /> |
|||
<input type="hidden" name="disflag" value="{$_GPC['disflag']}" /> |
|||
{if count($dislevels)>1} |
|||
<div class="form-group max-with-all"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}等级</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('levelid:0');}" class="btn {if intval($_GPC['levelid']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
{loop $dislevels $level} |
|||
<a href="{php echo wl_filter_url('wlf:0');}&levelid={$level['id']}" class="btn {if intval($_GPC['levelid']) == $level['id']}btn-primary{else}btn-default{/if}">{$level['name']}</a> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $base['bindvip']>0} |
|||
<div class="form-group max-with-all"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('disflag:0');}" class="btn {if intval($_GPC['disflag']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('disflag:1');}" class="btn {if intval($_GPC['disflag']) == 1}btn-primary{else}btn-default{/if}">生效中</a> |
|||
<a href="{php echo wl_filter_url('disflag:-1');}" class="btn {if intval($_GPC['disflag']) == -1}btn-primary{else}btn-default{/if}">已过期</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group form-inline"> |
|||
<label class="col-md-2 control-label">关键字</label> |
|||
<div class="col-sm-9"> |
|||
<select name="type" class="form-control"> |
|||
<option value="2" {if $_GPC['type'] == 2}selected{/if}>手机号</option> |
|||
<option value="4" {if $_GPC['type'] == 4}selected{/if}>真实姓名</option> |
|||
<option value="3" {if $_GPC['type'] == 3}selected{/if}>昵称</option> |
|||
<option value="5" {if $_GPC['type'] == 5}selected{/if}>MID</option> |
|||
</select> |
|||
<input type="text" class="form-control" name="keyword" id="keyword" value="{$_GPC['keyword']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">创建时间</label> |
|||
<div class="col-md-2"> |
|||
<select name="timetype" class="form-control"> |
|||
<option {if empty($_GPC['timetype'])} selected="selected" {/if} value="">关闭</option> |
|||
<option {if $_GPC['timetype'] > 0 } selected="selected" {/if} value="1">开启</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button> |
|||
<button class="btn btn-default" name="export" type="submit" value="export"><i class="fa fa-download"></i> 导出</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th style="width:50px;">头像</th> |
|||
<th style="width:50px;">昵称</th> |
|||
<th class="text-center" style="width:50px;">姓名<br/>电话</th> |
|||
<th class="text-center" style="width:100px;">更新时间<br/>创建时间</th> |
|||
{if p('wxplatform')} |
|||
<th class="text-center" style="width:100px;">二维码</th> |
|||
{/if} |
|||
<th class="text-center" style="width:120px;">累计佣金<br/>余额</th> |
|||
<th class="text-center" style="width:100px;">上级</th> |
|||
<th class="text-center" style="width:40px;">下级数量</th> |
|||
<th class="text-center" style="width:80px;">等级</th> |
|||
<th class="text-center" style="width:150px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $mem} |
|||
<tr data-toggle="popover" data-trigger="hover" data-placement="left" class="js-goods-img"> |
|||
<td><img class="scrollLoading" src="{php echo tomedia($mem['avatar'])}" data-url="{php echo tomedia($mem['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/></td> |
|||
<td class="line-feed"> |
|||
{$mem['nickname']}<br> |
|||
MID:{$mem['mid']} |
|||
</td> |
|||
<td class="text-center"> |
|||
<span class="">{$mem['realname']}</span><br /> |
|||
<span class="">{$mem['mobile']}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
{php echo date('Y-m-d H:i:s',$mem['updatetime'])}<br> |
|||
{php echo date('Y-m-d H:i:s',$mem['createtime'])} |
|||
</td> |
|||
{if p('wxplatform')} |
|||
<td class="text-center" style="position: relative;"> |
|||
<a href="javascript:void(0);" onclick="javascript:layer.open({type: 2,title: '关注二维码',shadeClose: true,shade: 0.8,area: ['440px', '475px'],content: '{$mem['qrcode']}'});">关注二维码</a> |
|||
</td> |
|||
{/if} |
|||
<td class="text-center" style="line-height:25px;"> |
|||
<span class="label label-success">¥{php echo number_format($mem['dismoney'], 2)}</span><br> |
|||
<span class="label label-info">¥{php echo number_format($mem['nowmoney'], 2)}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $mem['leadid']>0} |
|||
<span class="label label-success">{$mem['topname']}</span> |
|||
<br/><span>MID:{$mem['leadid']}</span> |
|||
{if !empty($mem['topmobile'])}<br/><span>{$mem['topmobile']}</span>{/if} |
|||
{else if $mem['leadid'] == -1} |
|||
<span class="label label-danger">系统直属</span> |
|||
{else} |
|||
<span class="label label-default">暂无上级</span> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
<span><a href="{php echo web_url('distribution/dissysbase/lowpeople',array('memid'=>$mem['mid']))}">{$mem['lownum']}({if Customized::init('distributionText') > 0}共享股东{else}分销商{/if} |
|||
{$mem['lowdisnum']}人)</a></span> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span class="label label-success">{$mem['rankname']}</span> |
|||
{if $mem['disflag'] == -1}<br /><br /><span class="label label-danger">已过期</span>{/if} |
|||
</td> |
|||
<td style="position:relative;text-align: center;"> |
|||
<!-- <a href="{php echo web_url('distribution/dissysbase/prohibit',['id'=>$mem['id']])}" data-toggle="ajaxPost">禁用 </a> - --> |
|||
<a href="{php echo web_url('distribution/dissysbase/editdistributor',array('id'=>$mem['id']))}" onclick="setTimeout(de,1500);" data-toggle="ajaxModal">编辑 </a> - |
|||
<a href="{php echo web_url('distribution/dissysbase/loworder',array('memid'=>$mem['mid']))}" >订单 </a> - |
|||
<a href="{php echo web_url('finace/finaceWithdrawalApply/cashApply',array('type'=>3,'disid'=>$mem['id']))}" target="_blank">提现 </a> - |
|||
<a href="javascript:;" class="canceldis" disid = "{$mem['id']}">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $todo == 'adddis'} |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form" id="form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">添加{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span style='color:red'>*</span>选择用户</label> |
|||
<div class="col-sm-9"> |
|||
<input type='hidden' id='memberid' name='memberid' value="" /> |
|||
<div class='input-group'> |
|||
<input type="text" name="messagesaler" maxlength="30" value="{if !empty($messagesaler)}{$messagesaler['nickname']}{/if}" id="messagesaler" class="form-control" readonly /> |
|||
<div class='input-group-btn'> |
|||
<button class="btn btn-default" type="button" onclick="popwin = $('#modal-module-menus2').modal();">选择用户</button> |
|||
</div> |
|||
</div> |
|||
<div class="input-group " style="margin-top:.5em;"> |
|||
<input type="hidden" value="{$merchant['id']}" name="goods[merchantid]" id="sidmerchant"> |
|||
<img src="{if empty($messagesaler['avatar'])}../web/resource/images/nopic-107.jpg{else}{php echo tomedia($messagesaler['avatar'])}{/if}" class="img-responsive img-thumbnail" width="150" id="imgmerchant" /> |
|||
<em class="close" style="position:absolute; top: 0px; right: -14px;" title="删除" onclick="remove_merchant(this)">×</em> |
|||
</div> |
|||
<div id="modal-module-menus2" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close two" type="button">×</button><h3>选择用户</h3></div> |
|||
<div class="modal-body" > |
|||
<div class="row"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control" name="keyword" value="" id="search-kwd2" placeholder="请输入粉丝昵称/uid/openid" /> |
|||
<span class='input-group-btn'><button type="button" class="btn btn-default" onclick="search_members();">搜索</button></span> |
|||
</div> |
|||
</div> |
|||
<div id="module-menus2" style="padding-top:5px;"></div> |
|||
</div> |
|||
<div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true" id="c2">关闭</a></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">上级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</label> |
|||
<div class="col-md-7"> |
|||
<select name="leadid" class="form-control select2 col-sm-7 col-xs-6" style="width: 100%;"> |
|||
<option value="-1" selected="selected">{if $_W['wlsetting']['distribution']['mode']}一级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}{else}代理直属{/if}</option> |
|||
{loop $leadlists $gift} |
|||
<option value="{$gift['mid']}">{$gift['nickname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
|
|||
<script> |
|||
$('.order-list').delegate('.canceldis', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('disid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('distribution/dissysbase/canceldis')}", { id : id }, function(data){ |
|||
if(!data.errno){ |
|||
$this.parent().parent().remove(); |
|||
util.tips("取消资格成功!"); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: "删除此{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if},<span style='color:red;'>该{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}所有{if Customized::init('distributionText') > 0}共享股东{else}分销{/if}资料将会被清除,所有下线将会成为无上线状态</span>,确认?"}); |
|||
}); |
|||
|
|||
function search_members(){ |
|||
if( $.trim($('#search-kwd2').val())==''){ |
|||
Tip.focus('#search-kwd2','请输入关键词'); |
|||
return; |
|||
} |
|||
$("#module-menus2").html("正在搜索....") |
|||
$.get("{php echo web_url('distribution/dissysbase/searchmember')}", { |
|||
keyword: $.trim($('#search-kwd2').val()) |
|||
}, function(dat){ |
|||
$('#module-menus2').html(dat); |
|||
}); |
|||
} |
|||
|
|||
function select_member(o,type) { |
|||
$("#memberid").val(o.id); |
|||
$("#messagesaler").val(o.nickname); |
|||
$("#imgmerchant").attr('src', o.avatar); |
|||
$(".two").click(); |
|||
} |
|||
|
|||
function remove_merchant(obj){ |
|||
$('#messageopenid').val(''); |
|||
$('#messagesaler').val(''); |
|||
$('#imgmerchant').attr("src",''); |
|||
} |
|||
|
|||
function de(){ |
|||
myrequire(['select2'], function() { |
|||
$('.chosen-select').select2({ |
|||
ajax: { |
|||
url: "{php echo web_url('distribution/dissysbase/getuser')}", |
|||
dataType: 'json', |
|||
data: function (params) { |
|||
var query = { //请求的参数, 关键字和搜索条件之类的 |
|||
search: params.term //select搜索框里面的value |
|||
} |
|||
// Query paramters will be ?search=[term]&page=[page] |
|||
return query; |
|||
}, |
|||
processResults: function (data) { |
|||
return { |
|||
results: data //必须赋值给results并且必须返回一个obj |
|||
}; |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,116 @@ |
|||
<form action="{php echo web_url('distribution/dissysbase/editdistributor')}" method="post" class="form-horizontal form form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content" style="max-height: 1000px;"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">编辑{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户昵称</label> |
|||
<div class="col-md-7"> |
|||
<input type="text" name="nickname" class="form-control" value="{$distri['nickname']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">真实姓名</label> |
|||
<div class="col-md-7"> |
|||
<input type="text" name="realname" class="form-control" value="{$distri['realname']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">联系方式</label> |
|||
<div class="col-md-7"> |
|||
<input type="text" name="mobile" class="form-control" value="{$distri['mobile']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">上级</label> |
|||
<div class="col-md-7"> |
|||
<select name="leadid" class="form-control col-sm-7 col-xs-6 chosen-select" style="width: 100%;"> |
|||
<option value="{$distri['leadid']}" selected="selected">{$distri['leadname']}</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">等级</label> |
|||
<div class="col-md-7"> |
|||
<select name="dislevel" class="form-control"> |
|||
{loop $levels $cate} |
|||
<option value="{$cate['id']}" {if $distri['dislevel'] == $cate['id']}selected="selected"{/if}>{$cate['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">余额</label> |
|||
<div class="col-md-7"> |
|||
<div class="form-control-static"> |
|||
¥{$distri['nowmoney']} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}来源</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="source" value="1" {if $distri['source']} checked {/if}>后台添加 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="source" value="0" {if $distri['source'] != 1} checked {/if}>用户申请 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">余额操作</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="moneytype" value="1" checked>增加 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="moneytype" value="2" >减少 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">操作余额</label> |
|||
<div class="col-md-7"> |
|||
<input type="text" name="money" class="form-control" value="" placeholder="请输入修改余额数字,最多保留两位小数" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">操作原因</label> |
|||
<div class="col-md-7"> |
|||
<input type="text" name="reason" class="form-control" value="" placeholder="请输入修改余额的原因" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$distri['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<script> |
|||
$(document).on('show.bs.modal', '.modal', function(event) { |
|||
$(this).appendTo($('body')); |
|||
}).on('shown.bs.modal', '.modal.in', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}).on('hidden.bs.modal', '.modal', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}); |
|||
|
|||
|
|||
function setModalsAndBackdropsOrder() { |
|||
var modalZIndex = 1040; |
|||
$('.modal.in').each(function(index) { |
|||
var $modal = $(this); |
|||
modalZIndex++; |
|||
$modal.css('zIndex', modalZIndex); |
|||
$modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1); |
|||
}); |
|||
$('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden'); |
|||
} |
|||
</script> |
|||
@ -0,0 +1,223 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">客户订单</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="distribution" /> |
|||
<input type="hidden" name="ac" value="dissysbase" /> |
|||
<input type="hidden" name="do" value="loworder" /> |
|||
<input type="hidden" name="memid" value="{$memid}" /> |
|||
<input type="hidden" name="buymid" value="{$buymid}" /> |
|||
<input type="hidden" name="ordertype" value="{$_GPC['ordertype']}" /> |
|||
<input type="hidden" name="ordertype" value="{$_GPC['ordertype']}" /> |
|||
|
|||
<div class="form-group max-with-all"> |
|||
<label class="col-sm-2 control-label">订单类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo filter_url('ordertype:');}" class="btn {if $_GPC['ordertype'] == ''}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo filter_url('ordertype:rush');}" class="btn {if $_GPC['ordertype'] == 'rush'}btn-primary{else}btn-default{/if}">抢购</a> |
|||
{if p('groupon')} |
|||
<a href="{php echo filter_url('ordertype:groupon');}" class="btn {if $_GPC['ordertype'] == 'groupon'}btn-primary{else}btn-default{/if}">团购</a> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<a href="{php echo filter_url('ordertype:fightgroup');}" class="btn {if $_GPC['ordertype'] == 'fightgroup'}btn-primary{else}btn-default{/if}">拼团</a> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<a href="{php echo filter_url('ordertype:coupon');}" class="btn {if $_GPC['ordertype'] == 'coupon'}btn-primary{else}btn-default{/if}">卡券</a> |
|||
{/if} |
|||
{if p('activity')} |
|||
<a href="{php echo filter_url('ordertype:activity');}" class="btn {if $_GPC['ordertype'] == 'activity'}btn-primary{else}btn-default{/if}">活动</a> |
|||
{/if} |
|||
<a href="{php echo filter_url('ordertype:payonline');}" class="btn {if $_GPC['ordertype'] == 'payonline'}btn-primary{else}btn-default{/if}">在线买单</a> |
|||
{if p('bargain')} |
|||
<a href="{php echo filter_url('ordertype:bargain');}" class="btn {if $_GPC['ordertype'] == 'bargain'}btn-primary{else}btn-default{/if}">砍价</a> |
|||
{/if} |
|||
{if p('pocket')} |
|||
<a href="{php echo filter_url('ordertype:pocket');}" class="btn {if $_GPC['ordertype'] == 'pocket'}btn-primary{else}btn-default{/if}">掌上信息</a> |
|||
{/if} |
|||
{if p('halfcard')} |
|||
<a href="{php echo filter_url('ordertype:halfcard');}" class="btn {if $_GPC['ordertype'] == 'halfcard'}btn-primary{else}btn-default{/if}">一卡通充值</a> |
|||
{/if} |
|||
<a href="{php echo filter_url('ordertype:charge');}" class="btn {if $_GPC['ordertype'] == 'charge'}btn-primary{else}btn-default{/if}">付费入驻</a> |
|||
<a href="{php echo filter_url('ordertype:distribution');}" class="btn {if $_GPC['ordertype'] == 'distribution'}btn-primary{else}btn-default{/if}">付费申请{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</a> |
|||
{if p('citycard')} |
|||
<a href="{php echo filter_url('ordertype:citycard');}" class="btn {if $_GPC['ordertype'] == 'citycard'}btn-primary{else}btn-default{/if}">同城名片</a> |
|||
{/if} |
|||
{if p('citydelivery')} |
|||
<a href="{php echo filter_url('ordertype:citydelivery');}" class="btn {if $_GPC['ordertype'] == 'citydelivery'}btn-primary{else}btn-default{/if}">同城配送</a> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">所属代理</label> |
|||
<div class="col-sm-9"> |
|||
<select name="agentid" class="form-control" style="width: 300px;"> |
|||
<option value="0" {if empty($_GPC['agentid'])}selected="selected"{/if}>所有代理</option> |
|||
<option value="-1" {if $_GPC['agentid']== -1 }selected="selected"{/if}>总后台</option> |
|||
{loop $agentlist $agent} |
|||
<option value="{$agent['id']}" {if $_GPC['agentid' ]== $agent['id'] }selected="selected"{/if}>{$agent['agentname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">下单时间</label> |
|||
<div class="col-md-3"> |
|||
<select name="timetype" class="form-control"> |
|||
<option value="" {if empty($_GPC['timetype'])}selected="selected"{/if}>关闭</option> |
|||
<option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>开启</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-5"> |
|||
<div class="input-group"> |
|||
{php echo tpl_select_time_info('time', array('starttime'=>date('Y-m-d H:i:s', $starttime),'endtime'=>date('Y-m-d H:i:s', $endtime)));} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary">筛选</button> |
|||
<button class="btn btn-default" name="export" type="submit" value="export"><i class="fa fa-download"></i> 导出</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive collapse in" id="order-template-item-4"> |
|||
<table class="table table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:25px">序号</th> |
|||
<th style="width:150px;">商品</th> |
|||
<th style="width:80px; text-align:center;">单价/数量</th> |
|||
<th style="width:80px; text-align:center;">所属商家</th> |
|||
<th style="width:80px; text-align:center;">所属代理</th> |
|||
<th style="width:100px; text-align:center;">买家</th> |
|||
<th style="width:80px; text-align:center;">订单状态</th> |
|||
<th style="width:150px; text-align:center;">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</th> |
|||
<th style="width:130px; text-align:center;">提成金额</th> |
|||
</tr> |
|||
</thead> |
|||
</table> |
|||
</div> |
|||
{loop $loworder $y $item} |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading clearfix" style="border: 1px solid #e5e5e5;border-bottom: 0;"> |
|||
<div class="pull-left"> |
|||
<b>订单号: {$item['orderno']}</b> |
|||
{if $item['plugin']=='rush'} |
|||
<span class="label label-danger">抢购</span> |
|||
{else if $item['plugin']=='groupon'} |
|||
<span class="label label-success">团购</span> |
|||
{else if $item['plugin']=='fightgroup'} |
|||
<span class="label label-info">拼团</span> |
|||
{else if $item['plugin']=='coupon'} |
|||
<span class="label label-success">卡券</span> |
|||
{else if $item['plugin']=='bargain'} |
|||
<span class="label label-primary">砍价</span> |
|||
{else if $item['plugin']=='activity'} |
|||
<span class="label label-primary">活动</span> |
|||
{else if $item['plugin']=='pocket'} |
|||
<span class="label label-warning">掌上信息</span> |
|||
{else if $item['plugin']=='halfcard'} |
|||
<span class="label label-default">一卡通充值</span> |
|||
{else if $item['plugin']=='charge'} |
|||
<span class="label label-primary">付费入驻</span> |
|||
{else if $item['plugin']=='distribution'} |
|||
<span class="label label-primary">付费申请{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</span> |
|||
{else if $item['plugin']=='payonline'} |
|||
<span class="label label-success">在线买单</span> |
|||
{else if $item['plugin']=='citycard'} |
|||
<span class="label label-primary">同城名片</span> |
|||
{else if $item['plugin']=='citydelivery'} |
|||
<span class="label label-success">同城配送</span> |
|||
{/if} |
|||
</div> |
|||
<div class="pull-right"> |
|||
下单时间:{php echo date('Y-m-d H:i:s',$item['createtime']);} |
|||
{if $item['plugin']=='groupon' || $item['plugin']=='citydelivery' || $item['plugin']=='rush' || $item['plugin']=='fightgroup' || $item['plugin']=='coupon' || $item['plugin']=='bargain' || $item['plugin']=='activity'} |
|||
- <a href="{php echo web_url('order/wlOrder/orderdetail',array('type'=>$item['ordertype'],'orderid'=>$item['orderid']))}">订单详情</a> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="table-responsive"> |
|||
<table class="table table-bordered"> |
|||
<tbody > |
|||
<tr> |
|||
<td style="width: 25px;" ><center>{php echo $y+1}</center></td> |
|||
<td class="goods-info line-feed" style="width:150px;padding-left: 10px;"> |
|||
<div class="img" style="display: inline-block;"> |
|||
<img width="50" height="50" class="oscrollLoading" src="{php echo tomedia($item['gimg'])}" data-url="{php echo tomedia($item['gimg'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" > |
|||
</div> |
|||
<div class="title" style="display: inline-block;"> |
|||
<span>{$item['gname']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:80px;"> |
|||
<p>¥{$item['goodsprice']}</p> |
|||
<p>({$item['gnum']} {$item['unit']})</p> |
|||
</td> |
|||
<td class="text-center" style="width:80px;">{$item['merchantname']}</td> |
|||
<td class="text-center" style="width:80px;">{$item['agentname']}</td> |
|||
<td class="goods-info line-feed" style="width:100px;padding-left: 10px;"> |
|||
<div class="img" style="display: inline-block;"><img width="50" height="50" class="oscrollLoading" src="{php echo tomedia($item['avatar'])}" data-url="{php echo tomedia($item['avatar'])}"></div> |
|||
<div class="title" style="display: inline-block;position: relative;top: 1rem;"> |
|||
<span>{$item['nickname']}</span><br /> |
|||
<span>{$item['mobile']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:80px;"> |
|||
<span class="label label-{$item['statusCss']}" style="margin-bottom: 10px;display: inline-block;">{$item['statusName']}</span> |
|||
{if $item['paytype']==1}<br/><span class="label label-danger">余额支付</span>{/if} |
|||
{if $item['paytype']==2}<br/><span class="label label-danger">微信支付</span>{/if} |
|||
{if $item['paytype']==3}<br/><span class="label label-danger">支付宝</span>{/if} |
|||
{if $item['paytype']==4}<br/><span class="label label-danger">货到付款</span>{/if} |
|||
{if $item['paytype']==5}<br/><span class="label label-danger">小程序</span>{/if} |
|||
</td> |
|||
<td style="width:150px;"> |
|||
一级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}:{$item['onename']} 佣金:{$item['onemoney']} |
|||
{if $_W['wlsetting']['distribution']['ranknum']>1} |
|||
<br/>二级{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}:{$item['twoname']} 佣金:{$item['twomoney']} |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="width:130px;"> |
|||
状态:{if $item['status'] == 0}<span class="text-primary">未结算</span>{else if $item['status'] == 1}<span class="text-warning">待结算</span>{else if $item['status'] == 2}<span class="text-info">已结算</span>{else if $item['status'] == 3}<span class="text-danger">已退款</span>{/if} |
|||
{if $item['status'] == 0} |
|||
<br/><a style="margin-bottom: 10px;display: inline-block;" href="{php echo web_url('distribution/dissysbase/cansett', array('id' => $item['id']))}" data-toggle="ajaxRemove" data-confirm="确定可结算此订单吗?">标记可结算</a> |
|||
{else if $item['status'] == 2} |
|||
<br/>结算时间:{php echo date('Y-m-d H:i:s',$item['setttime'])} |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="panel-footer js-remark" {if empty($item['remark'])}style="display: none;"{/if}> |
|||
买家备注:{$item['remark']} |
|||
</div> |
|||
<div class="panel-footer js-admin-remark{$item['id']} js-admin-remark" order-id="{$item['id']}" {if empty($item['adminremark'])}style="display: none;"{/if} style="background-color:lightgoldenrodyellow"> |
|||
卖家备注:<span id="js-admin-remark{$item['id']}" style="">{$item['adminremark']}</span> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,110 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">下级客户</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="main" style="margin-top: 0;"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="distribution" /> |
|||
<input type="hidden" name="ac" value="dissysbase" /> |
|||
<input type="hidden" name="do" value="lowpeople" /> |
|||
<input type="hidden" name="memid" value="{$memid}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字类型</label> |
|||
<div class="col-sm-9"> |
|||
<select name="type" class="form-control"> |
|||
<option value="2" {if $_GPC['type'] == 2}selected{/if}>手机号</option> |
|||
<option value="4" {if $_GPC['type'] == 4}selected{/if}>真实姓名</option> |
|||
<option value="3" {if $_GPC['type'] == 3}selected{/if}>昵称</option> |
|||
<option value="5" {if $_GPC['type'] == 5}selected{/if}>MID</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="keyword" id="keyword" value="{$_GPC['keyword']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:40px;">MID</th> |
|||
<th style="width:60px;">头像</th> |
|||
<th style="width:90px;">昵称</th> |
|||
<th style="width:100px;">手机</th> |
|||
<th style="width:100px;">真实姓名</th> |
|||
<th style="width:120px;" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $lowpeople $peoo} |
|||
<tr id="{$peoo['id']}"> |
|||
<td>{$peoo['mid']}</td> |
|||
<td><img style="height: 50px;width: 50px;" src="{php echo tomedia($peoo['avatar'])}" ></td> |
|||
<td>{$peoo['nickname']}</td> |
|||
<td>{$peoo['mobile']}</td> |
|||
<td>{$peoo['realname']}</td> |
|||
<td class="text-center"> |
|||
<a href="{php echo web_url('distribution/dissysbase/loworder', array('buymid' => $peoo['mid'],'memid'=>$memid))}">查看订单</a> |
|||
<a href="{php echo web_url('distribution/dissysbase/changeleadid',array('id'=>$peoo['mid']))}" onclick="setTimeout(de,1500);" data-toggle="ajaxModal"> - 修改上级</a> |
|||
<a href="{php echo web_url('distribution/dissysbase/unbind',array('id'=>$peoo['id']))}" data-toggle="ajaxRemove" data-confirm="此操作不可逆,会解除该用户与上级的绑定,确认吗?" title="解除上下级绑定"> - 解除绑定</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
function de(){ |
|||
myrequire(['select2'], function() { |
|||
console.log('111'); |
|||
$('.chosen-select').select2({ |
|||
ajax: { |
|||
url: "{php echo web_url('distribution/dissysbase/getuser')}", |
|||
dataType: 'json', |
|||
data: function (params) { |
|||
var query = { //请求的参数, 关键字和搜索条件之类的 |
|||
search: params.term //select搜索框里面的value |
|||
} |
|||
// Query paramters will be ?search=[term]&page=[page] |
|||
return query; |
|||
}, |
|||
processResults: function (data) { |
|||
return { |
|||
results: data //必须赋值给results并且必须返回一个obj |
|||
}; |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,46 @@ |
|||
<form action="{php echo web_url('distribution/dissysbase/changeleadid')}" method="post" class="form-horizontal form form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content" style="max-height: 1000px;"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">修改用户上级</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">上级</label> |
|||
<div class="col-md-7"> |
|||
<select name="leadid" class="form-control col-sm-7 col-xs-6 chosen-select" style="width: 100%;"> |
|||
<option value="{$distri['leadid']}" selected="selected">{$distri['leadname']}</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$id}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<script> |
|||
$(document).on('show.bs.modal', '.modal', function(event) { |
|||
$(this).appendTo($('body')); |
|||
}).on('shown.bs.modal', '.modal.in', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}).on('hidden.bs.modal', '.modal', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}); |
|||
|
|||
|
|||
function setModalsAndBackdropsOrder() { |
|||
var modalZIndex = 1040; |
|||
$('.modal.in').each(function(index) { |
|||
var $modal = $(this); |
|||
modalZIndex++; |
|||
$modal.css('zIndex', modalZIndex); |
|||
$modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1); |
|||
}); |
|||
$('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden'); |
|||
} |
|||
</script> |
|||
@ -0,0 +1,21 @@ |
|||
<div style='max-height:500px;overflow:auto;min-width:850px;'> |
|||
<table class="table table-hover" style="min-width:850px;"> |
|||
<thead> |
|||
<th>粉丝</th> |
|||
<th>操作</th> |
|||
</thead> |
|||
<tbody> |
|||
{loop $ds $row} |
|||
<tr> |
|||
<td><img src='{$row['avatar']}' style='width:30px;height:30px;padding1px;border:1px solid #ccc' /> {$row['nickname']}</td> |
|||
<td style="width:80px;"><a href="javascript:;" onclick='select_member({php echo json_encode($row);},"{$type}")'>选择</a></td> |
|||
</tr> |
|||
{/loop} |
|||
{if count($ds)<=0} |
|||
<tr> |
|||
<td colspan='4' align='center'>未找到</td> |
|||
</tr> |
|||
{/if} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
@ -0,0 +1,7 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Diypage{ |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[平台装修]]></name> |
|||
<identifie><![CDATA[diypage]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[help]]></type> |
|||
<description><![CDATA[平台全自定义页面装修,导航装修以及页面广告设置]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="装修" font="fa-inbox"> |
|||
<entry title="页面列表" ac="diy" do="pagelist" iscover="true" /> |
|||
<entry title="菜单管理" ac="diy" do="menulist"/> |
|||
<entry title="广告管理" ac="diy" do="advlist"/> |
|||
</menu> |
|||
<menu title="模板" font="fa-inbox"> |
|||
<entry title="模板列表" ac="diy" do="templist"/> |
|||
<entry title="模板分类" ac="diy" do="catelist"/> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="装修设置" ac="diyset" do="pageset" /> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="装修" font="fa-inbox"> |
|||
<entry title="页面列表" ac="diy" do="pagelist" iscover="true" /> |
|||
<entry title="菜单管理" ac="diy" do="menulist"/> |
|||
<entry title="广告管理" ac="diy" do="advlist"/> |
|||
</menu> |
|||
<menu title="模板" font="fa-inbox"> |
|||
<entry title="模板列表" ac="diy" do="templist"/> |
|||
<entry title="模板分类" ac="diy" do="catelist"/> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="装修设置" ac="diyset" do="pageset" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,137 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Diy_WeliamController { |
|||
/** |
|||
* Comment: 进入公众号页面列表 |
|||
* Author: zzw |
|||
*/ |
|||
public function pagelist() { |
|||
global $_W, $_GPC; |
|||
//判断是添加公众号页面 还是小程序页面 1=公众号页面 2=小程序页面 |
|||
$pageName = $_GPC['page_name']; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$data = Diy::pageList($pageName, $pindex); |
|||
|
|||
$backUrl = "diypage/diy/pagelist"; |
|||
//返回地址 |
|||
$modalUrl = 'pagelist'; |
|||
$list = $data['list']; |
|||
$pager = $data['pager']; |
|||
|
|||
include wl_template('diypage/info'); |
|||
} |
|||
/** |
|||
* Comment: 进入公众号菜单列表 |
|||
* Author: zzw |
|||
*/ |
|||
public function menulist() { |
|||
global $_W, $_GPC; |
|||
$menuClass = 1; |
|||
//1=公众号菜单 2=小程序菜单 |
|||
$name = $_GPC['name']; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$data = Diy::menuList($name, $pindex, $menuClass); |
|||
|
|||
$edit = "diypage/diy/menuEdit"; |
|||
//编辑的地址 |
|||
$modalUrl = 'menulist'; |
|||
$list = $data['list']; |
|||
$pager = $data['pager']; |
|||
|
|||
include wl_template('diypage/info'); |
|||
} |
|||
/** |
|||
* Comment: 进入公众号菜单编辑页面 |
|||
* Author: zzw |
|||
*/ |
|||
public function menuEdit() { |
|||
global $_W, $_GPC; |
|||
$backUrl = "diypage/diy/menulist"; |
|||
//返回地址 |
|||
$modalUrl = 'menuEdit'; |
|||
$menuClass = intval($_GPC['menu_class']); |
|||
$id = intval($_GPC['id']); |
|||
$menu = Diy::getMenu($id); |
|||
|
|||
include wl_template('diypage/info'); |
|||
} |
|||
/** |
|||
* Comment: 进入公众号广告列表 |
|||
* Author: zzw |
|||
*/ |
|||
public function advlist() { |
|||
global $_W, $_GPC; |
|||
$name = $_GPC['name']; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$advClass = 1; |
|||
//1=公众号广告 2=小程序广告 |
|||
$data = Diy::advList($name, $pindex, $advClass); |
|||
|
|||
$edit = "diypage/diy/advEdit"; |
|||
//编辑的地址 |
|||
$modalUrl = 'advlist'; |
|||
$list = $data['list']; |
|||
$pager = $data['pager']; |
|||
|
|||
include wl_template('diypage/info'); |
|||
} |
|||
/** |
|||
* Comment: 进入公众号广告编辑页面 |
|||
* Author: zzw |
|||
*/ |
|||
public function advEdit() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$advClass = $_GPC['adv_class']; |
|||
$backUrl = "diypage/diy/advlist"; |
|||
//返回地址 |
|||
$modalUrl = 'advEdit'; |
|||
if (!empty($id)) { |
|||
$advs = Diy::getAdv($id); |
|||
} |
|||
|
|||
include wl_template('diypage/info'); |
|||
} |
|||
/** |
|||
* Comment: 进入公众号模板列表 |
|||
* Author: zzw |
|||
*/ |
|||
public function templist() { |
|||
global $_W, $_GPC; |
|||
#1、获取参数信息 |
|||
$cate = $_GPC['cate']; |
|||
$tempName = $_GPC['temp_name']; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$backUrl = "diypage/diy/templist"; |
|||
//返回地址 |
|||
$modalUrl = 'templist'; |
|||
// 1=公众号模板 2=小程序模板 |
|||
$data = Diy::tempList($cate, $tempName, $pindex); |
|||
|
|||
$list = $data['list']; |
|||
$pager = $data['pager']; |
|||
$allpagetype = $data['allpagetype']; |
|||
$category = $data['category']; |
|||
|
|||
include wl_template('diypage/info'); |
|||
} |
|||
/** |
|||
* Comment: 进入公众号模板分类管理页面 |
|||
* Author: zzw |
|||
*/ |
|||
public function catelist() { |
|||
global $_W, $_GPC; |
|||
// 1=公众号模板分类 2=小程序模板分类 |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$keyword = trim($_GPC['keyword']); |
|||
$modalUrl = 'catelist'; |
|||
$data = Diy::cateList($pindex, $keyword); |
|||
|
|||
$list = $data['list']; |
|||
$pager = $data['pager']; |
|||
|
|||
include wl_template('diypage/info'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Diyset_WeliamController { |
|||
/** |
|||
* Comment: 页面设置 |
|||
* Author: zzw |
|||
*/ |
|||
public function pageset() { |
|||
global $_W, $_GPC; |
|||
//---提交内容的操作:储存提交的数据 |
|||
if (checksubmit('submit')) { |
|||
$base = Util::trimWithArray($_GPC['data']); |
|||
Setting::agentsetting_save($base, 'diypageset'); |
|||
wl_message('保存成功!', web_url('diypage/diyset/pageset'), 'success'); |
|||
} |
|||
//---进入页面的操作 |
|||
#1、获取页面信息。2=商城首页;3=抢购首页;4=团购首页;5=卡券首页;6=拼团首页;7=砍价首页;8=好店首页;l4=活动首页 |
|||
$table = tablename(PDO_NAME."diypage"); |
|||
$where = " WHERE (aid = {$_W['aid']} OR is_public = 1) AND uniacid = {$_W['uniacid']} "; |
|||
$select = "SELECT id,name FROM "; |
|||
//获取平台首页页面 |
|||
$indexpages = pdo_fetchall($select.$table.$where." AND type = 2"); |
|||
//获取抢购首页页面 |
|||
$rushpages = pdo_fetchall($select.$table.$where." AND type = 3"); |
|||
//获取团购首页页面 |
|||
$grouponpages = pdo_fetchall($select.$table.$where." AND type = 4"); |
|||
//获取卡券首页页面 |
|||
$wlcouponpages = pdo_fetchall($select.$table.$where." AND type = 5"); |
|||
//获取拼团首页页面 |
|||
$wlfightgrouppages = pdo_fetchall($select.$table.$where." AND type = 6"); |
|||
//获取砍价首页页面 |
|||
$bargainpages = pdo_fetchall($select.$table.$where." AND type = 7"); |
|||
//获取好店首页页面 |
|||
$shoppages = pdo_fetchall($select.$table.$where." AND type = 8"); |
|||
//获取活动首页页面 |
|||
$activitypages = pdo_fetchall($select.$table.$where." AND type = 14"); |
|||
//获取招聘首页页面 |
|||
$recruitpages = pdo_fetchall($select.$table.$where." AND type = 15"); |
|||
//获取相亲交友首页页面 |
|||
$datingpages = pdo_fetchall($select.$table.$where." AND type = 16"); |
|||
//获取家政服务首页页面 |
|||
$housekeeppages = pdo_fetchall($select.$table.$where." AND type = 18"); |
|||
#2、获取菜单&广告信息 |
|||
$menus = pdo_fetchall($select.tablename(PDO_NAME .'diypage_menu') ." WHERE (aid = {$_W['aid']} OR is_public = 1) AND uniacid = {$_W['uniacid']} AND menu_class = 1 "); |
|||
$advs = pdo_fetchall($select.tablename(PDO_NAME .'diypage_adv') ." WHERE (aid = {$_W['aid']} OR is_public = 1) AND uniacid = {$_W['uniacid']} AND adv_class = 1 "); |
|||
|
|||
#3、获取设置信息 |
|||
$settings = Setting::agentsetting_read('diypageset'); |
|||
|
|||
include wl_template('diypage/pageset'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 将页面/广告/菜单设置为公共的 |
|||
* Author: zzw |
|||
*/ |
|||
public function pageSetPublic(){ |
|||
global $_W,$_GPC; |
|||
$id = $_GPC['id'];//页面/广告/菜单的id |
|||
$type = $_GPC['type'];//1=页面,2=广告,3=菜单 |
|||
//获取表 |
|||
switch ($type){ |
|||
case 1:$table = PDO_NAME."diypage";break; |
|||
case 2:$table = PDO_NAME."diypage_adv";break; |
|||
case 3:$table = PDO_NAME."diypage_menu";break; |
|||
} |
|||
//获取当前页面的信息 |
|||
$is_public = pdo_getcolumn($table,array('id'=>$id),'is_public'); |
|||
if($is_public == 1){ |
|||
$data['is_public'] = 0;//设为私有 |
|||
}else{ |
|||
$data['is_public'] = 1;//设为公共 |
|||
} |
|||
//修改内容 |
|||
pdo_update($table,$data,array('id'=>$id)); |
|||
wl_json($is_public); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
{if $modalUrl == 'pagelist'} |
|||
{php include wl_template('diy/page_list');} |
|||
{elseif $modalUrl == 'menulist'} |
|||
{php include wl_template('diy/menu_list');} |
|||
{elseif $modalUrl == 'menuEdit'} |
|||
{php include wl_template('diy/menu_edit');} |
|||
{elseif $modalUrl == 'advlist'} |
|||
{php include wl_template('diy/adv_list');} |
|||
{elseif $modalUrl == 'advEdit'} |
|||
{php include wl_template('diy/adv_edit');} |
|||
{elseif $modalUrl == 'templist'} |
|||
{php include wl_template('diy/temp_list');} |
|||
{elseif $modalUrl == 'catelist'} |
|||
{php include wl_template('diy/temp_cate');} |
|||
{/if} |
|||
@ -0,0 +1,532 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" role="tablist"> |
|||
<li role="presentation" class="active"><a href="#" aria-controls="pageset" role="tab" data-toggle="tab">装修设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<!--------------------------- 页面设置内容 -----------------------------------> |
|||
<div class="form-group-title">页面设置</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">平台首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_index]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $indexpages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_index']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{if p('rush')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">抢购首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_rush]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $rushpages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_rush']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('groupon')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">团购首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_groupon]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $grouponpages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_groupon']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">卡券首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_wlcoupon]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $wlcouponpages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_wlcoupon']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">拼团首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_wlfightgroup]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $wlfightgrouppages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_wlfightgroup']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('bargain')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">砍价首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_bargain]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $bargainpages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_bargain']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">好店首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_shop]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $shoppages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_shop']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{if p('activity')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">活动首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_activity]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $activitypages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_activity']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('recruit')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">招聘首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_recruit]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $recruitpages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_recruit']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('dating')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">相亲首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_dating]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $datingpages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_dating']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('housekeep')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">家政首页</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[page_housekeep]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $housekeeppages $k $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $settings['page_housekeep']}selected{/if}>{$val['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<!--------------------------- 菜单设置内容 -----------------------------------> |
|||
<div class="form-group-title">菜单设置</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">平台菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_index]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_index']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">好店菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_storepage]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_storepage']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{if p('halfcard')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">一卡通菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_half]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_half']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('rush')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">抢购菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_rush]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_rush']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('groupon')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">团购菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_groupon]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_groupon']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">卡券菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_wlcoupon]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_wlcoupon']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">拼团菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_wlfightgroup]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_wlfightgroup']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('bargain')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">砍价菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_bargain]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_bargain']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('pocket')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">掌上信息菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_pocket]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_pocket']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('consumption')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">积分商城菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_consumption]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_consumption']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlsign')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">积分签到菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_wlsign]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_wlsign']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('headline')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">头条列表菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_headline]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_headline']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('citycard')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">名片首页菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_card]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_card']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('activity')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">活动首页菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_activity]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_activity']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('recruit')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">招聘首页菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_recruit]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_recruit']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('dating')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">相亲首页菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_dating]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_dating']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('housekeep')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">家政首页菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_housekeep]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_housekeep']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('yellowpage')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">黄页114菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_yellow]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $mk $mval} |
|||
<option value="{$mval['id']}" {if $mval['id'] == $settings['menu_yellow']}selected{/if}>{$mval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<!--------------------------- 广告设置内容 -----------------------------------> |
|||
<div class="form-group-title">广告设置</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">平台首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_index]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_index']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{if p('rush')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">抢购首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_rush]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_rush']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('groupon')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">团购首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_groupon]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_groupon']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">卡券首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_wlcoupon]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_wlcoupon']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">拼团首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_wlfightgroup]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_wlfightgroup']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('bargain')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">砍价首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_bargain]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_bargain']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('activity')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">活动首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_activity]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_activity']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('recruit')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">招聘首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_recruit]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_recruit']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('dating')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">相亲首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_dating]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_dating']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('housekeep')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">家政首页广告</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[adv_housekeep]" class="form-control select2"> |
|||
<option value="0">关闭广告</option> |
|||
{loop $advs $adk $adval} |
|||
<option value="{$adval['id']}" {if $adval['id'] == $settings['adv_housekeep']}selected{/if}>{$adval['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block"></span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<!--------------------------- 提交按钮 -----------------------------------> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,205 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Diyposter { |
|||
|
|||
static function getgzqrcode($gid, $type) { |
|||
global $_W; |
|||
//关注二维码上传 |
|||
$qrid = pdo_getcolumn(PDO_NAME . 'qrcode', array('uniacid' => $_W['uniacid'], 'sid' => $gid, 'type' => 2, 'remark' => $type,'status' => 1), 'qrid'); |
|||
if ($qrid) { |
|||
$qrurl = pdo_get('qrcode', array('id' => $qrid, 'uniacid' => $_W['uniacid']), array('url', 'ticket','expire','createtime')); |
|||
} |
|||
//判断是否存在二维码或者二维码是否已经过期 |
|||
if ($qrurl['expire'] > 0) { |
|||
$createTime = $qrurl['createtime'];//建立时间 秒 |
|||
$expireTime = $qrurl['expire'];//有效时间 秒 |
|||
$endTime = ($createTime + $expireTime) - time();//距离结束时间还有多少时间 小于1则已经过期 |
|||
} else { |
|||
$endTime = 1; |
|||
} |
|||
if (empty($qrid) || empty($qrurl) || $endTime < 1 ) { |
|||
if ($qrid > 0) { |
|||
pdo_update('qrcode', array('status' => 2), array('id' => $qrid)); |
|||
pdo_update(PDO_NAME . 'qrcode', array('status' => 2), array('qrid' => $qrid)); |
|||
} |
|||
Weixinqrcode::createkeywords('商品关注二维码:Diyposter', 'weliam_smartcity_diyposter'); |
|||
$result = Weixinqrcode::createqrcode('商品关注二维码:Diyposter', 'weliam_smartcity_diyposter', 2, 1, -1, $type); |
|||
if (!is_error($result)) { |
|||
$qrid = $result; |
|||
pdo_update(PDO_NAME . 'qrcode', array('sid' => $gid), array('uniacid' => $_W['uniacid'], 'qrid' => $qrid)); |
|||
} |
|||
} |
|||
if (empty($qrurl)) { |
|||
$qrurl = pdo_get('qrcode', array('id' => $qrid, 'uniacid' => $_W['uniacid']), array('url', 'ticket')); |
|||
} |
|||
return $qrurl; |
|||
} |
|||
|
|||
static function Processor($message) { |
|||
global $_W; |
|||
if (strtolower($message['msgtype']) == 'event') { |
|||
//获取数据 |
|||
$returnmess = array(); |
|||
$qrid = Weixinqrcode::get_qrid($message); |
|||
$qrinfo = self::geturlinfo($qrid); |
|||
|
|||
if(!empty($qrinfo['desc'])){ |
|||
$desc = $qrinfo['desc']; |
|||
}else{ |
|||
if(!$qrinfo['title']) $qrinfo['title'] = $_W['wlsetting']['base']['name']; |
|||
$desc = '欢迎使用'.$_W['wlsetting']['base']['name']; |
|||
if(!$qrinfo['imgurl']) $qrinfo['imgurl'] = $_W['wlsetting']['base']['logo']; |
|||
if(!$qrinfo['path']) $qrinfo['path'] = h5_url('pages/mainPages/index/index'); |
|||
} |
|||
//发送消息 |
|||
if ($_W['wlsetting']['diyposter']['replytype'] == 1) { |
|||
$returnmess = array('title' => urlencode($qrinfo['title']), 'appid' => $_W['wlsetting']['wxapp_config']['appid'], 'path' => tomedia($qrinfo['imgurl']), 'pagepath' => $qrinfo['path']); |
|||
Weixinqrcode::send_wxapp($returnmess, $message); |
|||
} else { |
|||
$returnmess = array(array('title' => urlencode($qrinfo['title']), 'description' => urlencode($desc), 'picurl' => tomedia($qrinfo['imgurl']), 'url' => $qrinfo['url'])); |
|||
Weixinqrcode::send_news($returnmess, $message); |
|||
} |
|||
} |
|||
} |
|||
|
|||
static function geturlinfo($qrid) { |
|||
global $_W; |
|||
$qrcode = pdo_get(PDO_NAME . 'qrcode', array('uniacid' => $_W['uniacid'], 'qrid' => $qrid,'model' => 1), array('sid', 'remark')); |
|||
$qrarray = explode(":", $qrcode['remark']); |
|||
if (p('distribution')) { |
|||
Distribution::addJunior($qrarray[0], $_W['wlmember']['id']); |
|||
} |
|||
//获取商品信息和链接 |
|||
if (strexists($qrcode['remark'], 'rush')) { |
|||
$rushgoods = Rush::getSingleActive($qrcode['sid'], 'name,thumb,aid'); |
|||
$title = $rushgoods['name']; |
|||
$imgurl = $rushgoods['thumb']; |
|||
$path = 'pages/subPages/goods/index?type=1&id=' . $qrcode['sid'] . "&head_id=" . $qrarray[0]; |
|||
$url = h5_url('pages/subPages/goods/index', ['type' => 1, 'id' => $qrcode['sid'], 'head_id' => $qrarray[0]]); |
|||
} |
|||
if (strexists($qrcode['remark'], 'wlcoupon')) { |
|||
$wlCoupon = wlCoupon::getSingleCoupons($qrcode['sid'], 'title,logo,aid'); |
|||
$title = $wlCoupon['title']; |
|||
$imgurl = $wlCoupon['logo']; |
|||
$path = 'pages/subPages/goods/index?type=5&id=' . $qrcode['sid'] . "&head_id=" . $qrarray[0]; |
|||
$url = h5_url('pages/subPages/goods/index', ['type' => 5, 'id' => $qrcode['sid'], 'head_id' => $qrarray[0]]); |
|||
} |
|||
if (strexists($qrcode['remark'], 'wlfightgroup')) { |
|||
$group = Wlfightgroup::getSingleGood($qrcode['sid'], 'name,logo,aid'); |
|||
$title = $group['name']; |
|||
$imgurl = $group['logo']; |
|||
$path = 'pages/subPages/goods/index?type=3&id=' . $qrcode['sid'] . "&head_id=" . $qrarray[0]; |
|||
$url = h5_url('pages/subPages/goods/index', ['type' => 3, 'id' => $qrcode['sid'], 'head_id' => $qrarray[0]]); |
|||
} |
|||
if (strexists($qrcode['remark'], 'groupon')) { |
|||
$groupon = pdo_get('wlmerchant_groupon_activity', array('id' => $qrcode['sid']), array('name', 'thumb', 'aid')); |
|||
$title = $groupon['name']; |
|||
$imgurl = $groupon['thumb']; |
|||
$path = 'pages/subPages/goods/index?type=2&id=' . $qrcode['sid'] . "&head_id=" . $qrarray[0]; |
|||
$url = h5_url('pages/subPages/goods/index', ['type' => 2, 'id' => $qrcode['sid'], 'head_id' => $qrarray[0]]); |
|||
} |
|||
if (strexists($qrcode['remark'], 'bargain')) { |
|||
$bargain = pdo_get('wlmerchant_bargain_activity', array('id' => $qrcode['sid']), array('name', 'thumb', 'aid')); |
|||
$title = $bargain['name']; |
|||
$imgurl = $bargain['thumb']; |
|||
$path = 'pages/subPages/goods/index?type=7&id=' . $qrcode['sid'] . "&head_id=" . $qrarray[0]; |
|||
$url = h5_url('pages/subPages/goods/index', ['type' => 7, 'id' => $qrcode['sid'], 'head_id' => $qrarray[0]]); |
|||
} |
|||
//名片关注二维码 |
|||
if (strexists($qrcode['remark'], 'citycard')) { |
|||
$bargain = pdo_get('wlmerchant_citycard_lists' , ['id' => $qrcode['sid']] , [ |
|||
'name' , |
|||
'logo' , |
|||
'company' , |
|||
'branch' , |
|||
'position' , |
|||
'desc' , |
|||
'one_class' , |
|||
'two_class', |
|||
'mid', |
|||
'uniacid', |
|||
'aid' |
|||
]); |
|||
$onelevelname = pdo_getcolumn(PDO_NAME . 'citycard_cates' , ['id' => $bargain['one_class']] , 'name'); |
|||
$twolevelname = pdo_getcolumn(PDO_NAME . 'citycard_cates' , ['id' => $bargain['two_class']] , 'name'); |
|||
$_W['aid'] = $bargain['aid']; |
|||
$_W['uniacid'] = $bargain['uniacid']; |
|||
$set = Setting::agentsetting_read('citycard'); |
|||
$title = $set['share_detail_title']; |
|||
$desc = $set['share_detail_desc']; |
|||
$imgurl = $set['share_detail_image']; |
|||
$nickname = pdo_getcolumn(PDO_NAME.'member',array('id'=>$bargain['mid']),'nickname'); |
|||
$time = date("Y-m-d H:i:s" , time()); |
|||
$sysname = $_W['wlsetting']['base']['name']; |
|||
if ($title) { |
|||
$title = str_replace('[昵称]' , $nickname , $title); |
|||
$title = str_replace('[时间]' , $time , $title); |
|||
$title = str_replace('[系统名称]' , $sysname , $title); |
|||
$title = str_replace('[名片名称]' , $bargain['name'] , $title); |
|||
$title = str_replace('[公司]' , $bargain['company'] , $title); |
|||
$title = str_replace('[部门]' , $bargain['branch'] , $title); |
|||
$title = str_replace('[职务]' , $bargain['position'] , $title); |
|||
$title = str_replace('[介绍]' , $bargain['desc'] , $title); |
|||
$title = str_replace('[一级分类]' , $onelevelname , $title); |
|||
$title = str_replace('[二级分类]' , $twolevelname , $title); |
|||
} |
|||
if ($desc) { |
|||
$desc = str_replace('[昵称]' , $nickname , $desc); |
|||
$desc = str_replace('[时间]' , $time , $desc); |
|||
$desc = str_replace('[系统名称]' , $sysname , $desc); |
|||
$desc = str_replace('[名片名称]' , $bargain['name'] , $desc); |
|||
$desc = str_replace('[公司]' , $bargain['company'] , $desc); |
|||
$desc = str_replace('[部门]' , $bargain['branch'] , $desc); |
|||
$desc = str_replace('[职务]' , $bargain['position'] , $desc); |
|||
$desc = str_replace('[介绍]' , $bargain['desc'] , $desc); |
|||
$desc = str_replace('[一级分类]' , $onelevelname , $desc); |
|||
$desc = str_replace('[二级分类]' , $twolevelname , $desc); |
|||
}else{ |
|||
$desc = '快来联系我吧~'; |
|||
} |
|||
$imgurl = $imgurl ? $imgurl : $bargain['logo']; |
|||
$path = 'pages/subPages/businesscard/carddetail/carddetail?cardid=' . $qrcode['sid'] . "&head_id=" . $qrarray[0]; |
|||
$url = h5_url($path); |
|||
} |
|||
if (strexists($qrcode['remark'], 'yellow')) { |
|||
$yellowpage = pdo_get('wlmerchant_yellowpage_lists',array('id' => $qrcode['sid']),array('name','logo','desc')); |
|||
$title = $yellowpage['name']; |
|||
$desc = $yellowpage['desc']; |
|||
$imgurl = tomedia($yellowpage['logo']); |
|||
$path = "pages/subPages2/phoneBook/logistics/logistics?id={$qrcode['sid']}";//基本路径,也是小程序路径 |
|||
$url = h5_url($path); |
|||
} |
|||
if (strexists($qrcode['remark'], 'draw')) { |
|||
$draw = pdo_get('wlmerchant_draw',array('id' => $qrcode['sid']),array('title','share_image')); |
|||
$title = $draw['title']; |
|||
$desc = '点击抽奖'; |
|||
$imgurl = tomedia($draw['share_image']); |
|||
$path = "pages/subPages2/drawGame/drawGame?id={$qrcode['sid']}";//基本路径,也是小程序路径 |
|||
$url = h5_url($path); |
|||
} |
|||
if (strexists($qrcode['remark'], 'activity')) { |
|||
$activity = pdo_get('wlmerchant_activitylist',array('id' => $qrcode['sid']),array('title','thumb')); |
|||
$title = $activity['title']; |
|||
$desc = '点击参与'; |
|||
$imgurl = tomedia($activity['thumb']); |
|||
$path = "pages/subPages2/coursegoods/coursegoods?id={$qrcode['sid']}";//基本路径,也是小程序路径 |
|||
$url = h5_url($path); |
|||
} |
|||
if (strexists($qrcode['remark'], 'dating')) { |
|||
$activity = pdo_get(PDO_NAME.'dating_matchmaker',['id' => $qrcode['sid']],[ |
|||
'nickname', |
|||
'avatar', |
|||
'describe', |
|||
'mid' |
|||
]); |
|||
$title = $activity['nickname']; |
|||
$desc = $activity['describe']; |
|||
$imgurl = tomedia($activity['avatar']); |
|||
$path = "pages/mainPages/index/diypage?type=16&head_id={$activity['mid']}";//基本路径,也是小程序路径 |
|||
$url = h5_url($path); |
|||
} |
|||
|
|||
return array('title' => $title,'desc'=>$desc,'imgurl' => $imgurl, 'url' => $url, 'qrcode' => $qrcode, 'path' => $path); |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[自定义海报]]></name> |
|||
<identifie><![CDATA[diyposter]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[help]]></type> |
|||
<description><![CDATA[自定义海报,可根据您的需要自定义拖拽设计海报。]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="海报管理" font="fa-inbox"> |
|||
<entry title="海报列表" ac="poster" do="lists" iscover="true" actions='["ac","poster"]'/> |
|||
<entry title="海报设置" ac="setting" do="base"></entry> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 3.0 KiB |
@ -0,0 +1,139 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Poster_WeliamController { |
|||
|
|||
public function lists() { |
|||
global $_W; |
|||
global $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$params = array(':uniacid' => $_W['uniacid']); |
|||
$condition = ' and uniacid=:uniacid '; |
|||
|
|||
if (!empty($_GPC['keyword'])) { |
|||
$_GPC['keyword'] = trim($_GPC['keyword']); |
|||
$condition .= ' AND `title` LIKE :title'; |
|||
$params[':title'] = '%' . trim($_GPC['keyword']) . '%'; |
|||
} |
|||
|
|||
if (!empty($_GPC['type'])) { |
|||
$condition .= ' AND `type` = :type'; |
|||
$params[':type'] = intval($_GPC['type']); |
|||
} |
|||
|
|||
$list = pdo_fetchall('SELECT * FROM ' . tablename(PDO_NAME . 'poster') . (' WHERE 1 ' . $condition . ' ORDER BY createtime desc LIMIT ') . ($pindex - 1) * $psize . ',' . $psize, $params); |
|||
$total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename(PDO_NAME . 'poster') . (' where 1 ' . $condition . ' '), $params); |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
|
|||
foreach ($list as &$value) { |
|||
if ($value['type'] == 1) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['storepid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 2) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['rushpid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 3) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['cardpid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 4) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['distpid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 5) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['grouponid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 6) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['fgrouppid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 7) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['bargainid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 8) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['salesmanid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 9) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['consumption_id'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 10) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['user_card_id'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 11) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['subposter_id'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 14) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['activityid'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 15) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['dating_id'] == $value['id'] ? 1 : 0; |
|||
} elseif ($value['type'] == 16) { |
|||
$value['status'] = $_W['wlsetting']['diyposter']['housekeepid'] == $value['id'] ? 1 : 0; |
|||
} |
|||
} |
|||
|
|||
include wl_template('poster/lists'); |
|||
} |
|||
|
|||
public function post() { |
|||
global $_W; |
|||
global $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$item = pdo_fetch('SELECT * FROM ' . tablename(PDO_NAME . 'poster') . ' WHERE id =:id and uniacid=:uniacid limit 1', array(':id' => $id, ':uniacid' => $_W['uniacid'])); |
|||
|
|||
if (!empty($item)) { |
|||
$data = json_decode(str_replace('"', '\'', $item['data']), true); |
|||
$item['otherbg'] = iunserializer($item['otherbg']); |
|||
} |
|||
|
|||
if (checksubmit()) { |
|||
$data = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'title' => trim($_GPC['title']), |
|||
'type' => intval($_GPC['type']), |
|||
'bg' => trim($_GPC['bg']), |
|||
'otherbg' => iserializer($_GPC['otherbg']), |
|||
'data' => htmlspecialchars_decode($_GPC['data']), |
|||
'createtime' => time() |
|||
); |
|||
|
|||
if (!empty($id)) { |
|||
pdo_update(PDO_NAME . 'poster', $data, array('id' => $id, 'uniacid' => $_W['uniacid'])); |
|||
} else { |
|||
pdo_insert(PDO_NAME . 'poster', $data); |
|||
$id = pdo_insertid(); |
|||
} |
|||
Tools::clearwxapp(); |
|||
Tools::clearposter(); |
|||
|
|||
show_json(1, array('message' => '海报保存成功', 'url' => web_url('diyposter/poster/post', array('id' => $id)))); |
|||
} |
|||
|
|||
$imgroot = $_W['attachurl']; |
|||
|
|||
if (empty($_W['setting']['remote'])) { |
|||
setting_load('remote'); |
|||
} |
|||
|
|||
if (!empty($_W['setting']['remote']['type'])) { |
|||
$imgroot = $_W['attachurl_remote']; |
|||
} |
|||
|
|||
$templist = Tools::getPosterTemp(); |
|||
|
|||
include wl_template('poster/post'); |
|||
} |
|||
|
|||
public function delete() { |
|||
global $_W; |
|||
global $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
|
|||
if (empty($id)) { |
|||
$id = is_array($_GPC['ids']) ? implode(',', $_GPC['ids']) : 0; |
|||
} |
|||
|
|||
$posters = pdo_fetchall('SELECT id,title FROM ' . tablename(PDO_NAME . 'poster') . (' WHERE id in ( ' . $id . ' ) and uniacid=') . $_W['uniacid']); |
|||
foreach ($posters as $poster) { |
|||
pdo_delete(PDO_NAME . 'poster', array('id' => $poster['id'], 'uniacid' => $_W['uniacid'])); |
|||
} |
|||
Tools::clearwxapp(); |
|||
Tools::clearposter(); |
|||
|
|||
show_json(1, array('url' => web_url('diyposter/poster/lists'))); |
|||
} |
|||
|
|||
public function clear() { |
|||
global $_W; |
|||
global $_GPC; |
|||
Tools::clearwxapp(); |
|||
Tools::clearposter(); |
|||
show_json(1, array('url' => web_url('diyposter/poster/lists'))); |
|||
} |
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Setting_WeliamController { |
|||
|
|||
public function base() { |
|||
global $_W, $_GPC; |
|||
if (checksubmit('submit')) { |
|||
$base = $_GPC['data'] ? : []; |
|||
|
|||
Setting::wlsetting_save($base, 'diyposter'); |
|||
Tools::clearwxapp(); |
|||
Tools::clearposter(); |
|||
wl_message('更新设置成功!', web_url('diyposter/setting/base')); |
|||
} |
|||
|
|||
$settings = Setting::wlsetting_read('diyposter'); |
|||
$allposter = pdo_getall(PDO_NAME . 'poster', array('uniacid' => $_W['uniacid']), array('title', 'type', 'id')); |
|||
$store = $rush = $card = $dist = array(); |
|||
foreach ($allposter as $key => $value) { |
|||
if ($value['type'] == 1) { |
|||
$store[] = $value; |
|||
} elseif ($value['type'] == 2) { |
|||
$rush[] = $value; |
|||
} elseif ($value['type'] == 3) { |
|||
$card[] = $value; |
|||
} elseif ($value['type'] == 4) { |
|||
$dist[] = $value; |
|||
} elseif ($value['type'] == 5) { |
|||
$groupon[] = $value; |
|||
} elseif ($value['type'] == 6) { |
|||
$fightgroup[] = $value; |
|||
} elseif ($value['type'] == 7) { |
|||
$bargain[] = $value; |
|||
} elseif ($value['type'] == 8) { |
|||
$salesman[] = $value; |
|||
} elseif ($value['type'] == 9) { |
|||
$consumption[] = $value; |
|||
} elseif ($value['type'] == 10) { |
|||
$userCard[] = $value; |
|||
} elseif ($value['type'] == 11) { |
|||
$subposters[] = $value; |
|||
} elseif ($value['type'] == 14) { |
|||
$activity[] = $value; |
|||
}elseif ($value['type'] == 15) { |
|||
$dating[] = $value; |
|||
}elseif ($value['type'] == 16) { |
|||
$housekeep[] = $value; |
|||
} |
|||
} |
|||
|
|||
include wl_template('poster/setting'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
#poster {width:322px;height:570px;border:1px solid #ccc;position:relative} |
|||
#poster .bg{ position:absolute;width:100%;z-index:0} |
|||
#poster .drag[type=img] img,#poster .drag[type=thumb] img,#poster .drag[type=shopThumb] img { width:100%;height:100%; } |
|||
#poster .drag {position: absolute; width:80px;height:80px;} |
|||
#poster .drag:before {content: '';border: 1px dashed #000;position: absolute;top: 0;left: 0;right: 0;bottom: 0;z-index: 1;} |
|||
#poster .drag.selected:before{border: 2px dashed #00aeff;} |
|||
#poster .drag[type=nickname],#poster .drag[type=time] { width:120px;height:40px; font-size:16px; font-family: 黑体;} |
|||
#poster .drag img {position:absolute;z-index:0;width:100%; } |
|||
#poster .drag.circle img {border-radius: 100%;} |
|||
#poster .drag.radius img {border-radius: 10px;} |
|||
#poster .rRightDown,.rLeftDown,.rLeftUp,.rRightUp,.rRight,.rLeft,.rUp,.rDown{position:absolute;width:7px;height:7px;z-index:1;font-size:0;} |
|||
#poster .rRightDown,.rLeftDown,.rLeftUp,.rRightUp,.rRight,.rLeft,.rUp,.rDown{background:#ff4a5d;display: none;border-radius: 100%;} |
|||
#poster .selected .rRightDown,.selected .rLeftDown,.selected .rLeftUp,.selected .rRightUp,.selected .rRight,.selected .rLeft,.selected .rUp,.selected .rDown{display: block;} |
|||
.rLeftDown,.rRightUp{cursor:ne-resize;} |
|||
.rRightDown,.rLeftUp{cursor:nw-resize;} |
|||
.rRight,.rLeft{cursor:e-resize;} |
|||
.rUp,.rDown{cursor:n-resize;} |
|||
.rLeftDown{left:-2px;bottom:-2px;} |
|||
.rRightUp{right:-2px;top:-2px;} |
|||
.rRightDown{right:-2px;bottom:-2px;} |
|||
.rRightDown{background-color:#00F;} |
|||
.rLeftUp{left:-2px;top:-2px;} |
|||
.rRight{right:-2px;top:50%;margin-top:-2px;} |
|||
.rLeft{left:-2px;top:50%;margin-top:-2px;} |
|||
.rUp{top:-2px;left:50%;margin-left:-2px;} |
|||
.rDown{bottom:-2px;left:50%;margin-left:-2px;} |
|||
.context-menu-layer { z-index:9999;} |
|||
.context-menu-list { z-index:9999;} |
|||
|
|||
.temp-list{height: auto;width: 100%;overflow: hidden;moz-user-select: -moz-none;-moz-user-select: none;-o-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;} |
|||
.temp-list .item{height: 60px;width: 60px;border: 1px solid #eee;padding: 3px;float: left;margin: 0 8px 8px 0;cursor: pointer;position: relative;} |
|||
.temp-list .item.selected:before{content: '';position: absolute;top: 3px;right: 3px;bottom: 3px;left: 3px;background: rgba(0, 0, 0, 0.5);z-index: 1;} |
|||
.temp-list .item.selected:after{position: absolute;z-index: 2;top: 0;left: 0;right: 0;bottom: 0;content: "\e601";font-family: "iconfont" !important;font-style: normal;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;color: #fff;font-size: 28px;text-align: center;line-height: 60px;} |
|||
.temp-list.temp-selected .item.selected:before{border: 2px solid #1ab394;background: none;top: -1px;left: -1px;right: -1px;bottom: -1px;} |
|||
.temp-list.temp-selected .item.selected:after{display: none;} |
|||
.temp-list .item.add:before{content: '';position: absolute;height: 4px;width: 36px;background: #eee;top: 50%;left: 50%;margin-top: -2px;margin-left: -18px;} |
|||
.temp-list .item.add:after{content: '';position: absolute;height: 36px;width: 4px;background: #eee;top: 50%;left: 50%;margin-top: -18px;margin-left: -2px;} |
|||
.temp-list .item img{height: 52px;width: 52px;} |
|||
.temp-list .item .icon-close{position: absolute;top: 0;right: 0;background: #000;color: #fff;height: 16px;width: 16px;line-height: 18px;text-align: center;font-size: 14px;display: none;} |
|||
.temp-list .item:hover .icon-close{display: block;} |
|||
.temp-list ~ .help-block{margin-bottom: 8px;} |
|||
.underline{border-bottom: 1px solid #666;} |
|||
.image-nail{height: 100px;} |
|||
.image-nail img, |
|||
.image-bg img{width: 92px;position: relative;z-index: 1;display: none;} |
|||
.image-nail img{height: 92px;} |
|||
.image-bg{height: 178px;} |
|||
.image-bg img{height: 170px;} |
|||
.image-nail, |
|||
.image-bg{width: 100px;border: 1px solid #eee;padding: 3px;position: relative;cursor: pointer;} |
|||
.image-nail:before, |
|||
.image-bg:before{content: '';position: absolute;height: 4px;width: 36px;background: #eee;top: 50%;left: 50%;margin-top: -2px;margin-left: -18px;} |
|||
.image-nail:after, |
|||
.image-bg:after{content: '';position: absolute;height: 36px;width: 4px;background: #eee;top: 50%;left: 50%;margin-top: -18px;margin-left: -2px;} |
|||
.image-nail .text, |
|||
.image-bg .text{position: absolute;left: 3px;right: 3px;bottom: 3px;height: 24px;background: rgba(0, 0, 0, 0.7);color: #fff;line-height: 24px;text-align: center;z-index: 2;display: none;} |
|||
.image-nail.selected .text, |
|||
.image-bg.selected .text{display: block;} |
|||
.image-nail.selected img, |
|||
.image-bg.selected .text{display: block;} |
|||
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 757 B |
@ -0,0 +1,568 @@ |
|||
var isIE = (document.all) ? true : false; |
|||
|
|||
var dobj = function (id) { |
|||
return "string" == typeof id ? document.getElementById(id) : id; |
|||
}; |
|||
|
|||
var Class = { |
|||
create: function() { |
|||
return function() { this.initialize.apply(this, arguments); } |
|||
} |
|||
} |
|||
|
|||
var Extend = function(destination, source) { |
|||
for (var property in source) { |
|||
destination[property] = source[property]; |
|||
} |
|||
} |
|||
|
|||
var Bind = function(object, fun) { |
|||
return function() { |
|||
return fun.apply(object, arguments); |
|||
} |
|||
} |
|||
var BindAsEventListener = function(object, fun) { |
|||
var args = Array.prototype.slice.call(arguments).slice(2); |
|||
return function(event) { |
|||
return fun.apply(object, [event || window.event].concat(args)); |
|||
} |
|||
} |
|||
|
|||
var CurrentStyle = function(element){ |
|||
return element.currentStyle || document.defaultView.getComputedStyle(element, null); |
|||
} |
|||
|
|||
function addEventHandler(oTarget, sEventType, fnHandler) { |
|||
if (oTarget.addEventListener) { |
|||
oTarget.addEventListener(sEventType, fnHandler, false); |
|||
} else if (oTarget.attachEvent) { |
|||
oTarget.attachEvent("on" + sEventType, fnHandler); |
|||
} else { |
|||
oTarget["on" + sEventType] = fnHandler; |
|||
} |
|||
}; |
|||
|
|||
function removeEventHandler(oTarget, sEventType, fnHandler) { |
|||
if (oTarget.removeEventListener) { |
|||
oTarget.removeEventListener(sEventType, fnHandler, false); |
|||
} else if (oTarget.detachEvent) { |
|||
oTarget.detachEvent("on" + sEventType, fnHandler); |
|||
} else { |
|||
oTarget["on" + sEventType] = null; |
|||
} |
|||
}; |
|||
//缩放程序
|
|||
var Resize = Class.create(); |
|||
Resize.prototype = { |
|||
//缩放对象
|
|||
initialize: function(obj, options) { |
|||
this._obj = obj.get(0);//缩放对象
|
|||
|
|||
this._styleWidth = this._styleHeight = this._styleLeft = this._styleTop = 0;//样式参数
|
|||
this._sideRight = this._sideDown = this._sideLeft = this._sideUp = 0;//坐标参数
|
|||
this._fixLeft = this._fixTop = 0;//定位参数
|
|||
this._scaleLeft = this._scaleTop = 0;//定位坐标
|
|||
|
|||
this._mxSet = function(){};//范围设置程序
|
|||
this._mxRightWidth = this._mxDownHeight = this._mxUpHeight = this._mxLeftWidth = 0;//范围参数
|
|||
this._mxScaleWidth = this._mxScaleHeight = 0;//比例范围参数
|
|||
|
|||
this._fun = function(){};//缩放执行程序
|
|||
|
|||
//获取边框宽度
|
|||
var _style = CurrentStyle(this._obj); |
|||
this._borderX = (parseInt(_style.borderLeftWidth) || 0) + (parseInt(_style.borderRightWidth) || 0); |
|||
this._borderY = (parseInt(_style.borderTopWidth) || 0) + (parseInt(_style.borderBottomWidth) || 0); |
|||
//事件对象(用于绑定移除事件)
|
|||
this._fR = BindAsEventListener(this, this.Resize); |
|||
this._fS = Bind(this, this.Stop); |
|||
|
|||
this.SetOptions(options); |
|||
//范围限制
|
|||
this.Max = !!this.options.Max; |
|||
this._mxContainer = $(this.options.mxContainer).get(0) || null; |
|||
this.mxLeft = Math.round(this.options.mxLeft); |
|||
this.mxRight = Math.round(this.options.mxRight); |
|||
this.mxTop = Math.round(this.options.mxTop); |
|||
this.mxBottom = Math.round(this.options.mxBottom); |
|||
//宽高限制
|
|||
this.Min = !!this.options.Min; |
|||
this.minWidth = Math.round(this.options.minWidth); |
|||
this.minHeight = Math.round(this.options.minHeight); |
|||
//按比例缩放
|
|||
this.Scale = !!this.options.Scale; |
|||
this.Ratio = Math.max(this.options.Ratio, 0); |
|||
|
|||
this.onResize = this.options.onResize; |
|||
|
|||
this._obj.style.position = "absolute"; |
|||
!this._mxContainer || CurrentStyle(this._mxContainer).position == "relative" || (this._mxContainer.style.position = "relative"); |
|||
}, |
|||
//设置默认属性
|
|||
SetOptions: function(options) { |
|||
this.options = {//默认值
|
|||
Max: false,//是否设置范围限制(为true时下面mx参数有用)
|
|||
mxContainer:"",//指定限制在容器内
|
|||
mxLeft: 0,//左边限制
|
|||
mxRight: 9999,//右边限制
|
|||
mxTop: 0,//上边限制
|
|||
mxBottom: 9999,//下边限制
|
|||
Min: false,//是否最小宽高限制(为true时下面min参数有用)
|
|||
minWidth: 50,//最小宽度
|
|||
minHeight: 50,//最小高度
|
|||
Scale: false,//是否按比例缩放
|
|||
Ratio: 0,//缩放比例(宽/高)
|
|||
onResize: function(){}//缩放时执行
|
|||
}; |
|||
Extend(this.options, options || {}); |
|||
}, |
|||
//设置触发对象
|
|||
Set: function(resize, side) { |
|||
var fun; |
|||
if(!resize) return; |
|||
//根据方向设置
|
|||
switch (side.toLowerCase()) { |
|||
case "up" : |
|||
fun = this.Up; |
|||
break; |
|||
case "down" : |
|||
fun = this.Down; |
|||
break; |
|||
case "left" : |
|||
fun = this.Left; |
|||
break; |
|||
case "right" : |
|||
fun = this.Right; |
|||
break; |
|||
case "left-up" : |
|||
fun = this.LeftUp; |
|||
break; |
|||
case "right-up" : |
|||
fun = this.RightUp; |
|||
break; |
|||
case "left-down" : |
|||
fun = this.LeftDown; |
|||
break; |
|||
case "right-down" : |
|||
default : |
|||
fun = this.RightDown; |
|||
}; |
|||
//设置触发对象
|
|||
addEventHandler(resize.get(0), "mousedown", BindAsEventListener(this, this.Start, fun)); |
|||
}, |
|||
//准备缩放
|
|||
Start: function(e, fun, touch) { |
|||
|
|||
//防止冒泡(跟拖放配合时设置)
|
|||
e.stopPropagation ? e.stopPropagation() : (e.cancelBubble = true); |
|||
//设置执行程序
|
|||
this._fun = fun; |
|||
//样式参数值
|
|||
this._styleWidth = this._obj.clientWidth; |
|||
this._styleHeight = this._obj.clientHeight; |
|||
this._styleLeft = this._obj.offsetLeft; |
|||
this._styleTop = this._obj.offsetTop; |
|||
//四条边定位坐标
|
|||
this._sideLeft = e.clientX - this._styleWidth; |
|||
this._sideRight = e.clientX + this._styleWidth; |
|||
this._sideUp = e.clientY - this._styleHeight; |
|||
this._sideDown = e.clientY + this._styleHeight; |
|||
//top和left定位参数
|
|||
this._fixLeft = this._styleLeft + this._styleWidth; |
|||
this._fixTop = this._styleTop + this._styleHeight; |
|||
//缩放比例
|
|||
if(this.Scale){ |
|||
//设置比例
|
|||
this.Ratio = Math.max(this.Ratio, 0) || this._styleWidth / this._styleHeight; |
|||
//left和top的定位坐标
|
|||
this._scaleLeft = this._styleLeft + this._styleWidth / 2; |
|||
this._scaleTop = this._styleTop + this._styleHeight / 2; |
|||
}; |
|||
//范围限制
|
|||
if(this.Max){ |
|||
//设置范围参数
|
|||
var mxLeft = this.mxLeft, mxRight = this.mxRight, mxTop = this.mxTop, mxBottom = this.mxBottom; |
|||
//如果设置了容器,再修正范围参数
|
|||
if(!!this._mxContainer){ |
|||
mxLeft = Math.max(mxLeft, 0); |
|||
mxTop = Math.max(mxTop, 0); |
|||
mxRight = Math.min(mxRight, this._mxContainer.clientWidth); |
|||
mxBottom = Math.min(mxBottom, this._mxContainer.clientHeight); |
|||
}; |
|||
//根据最小值再修正
|
|||
mxRight = Math.max(mxRight, mxLeft + (this.Min ? this.minWidth : 0) + this._borderX); |
|||
mxBottom = Math.max(mxBottom, mxTop + (this.Min ? this.minHeight : 0) + this._borderY); |
|||
//由于转向时要重新设置所以写成function形式
|
|||
this._mxSet = function(){ |
|||
this._mxRightWidth = mxRight - this._styleLeft - this._borderX; |
|||
this._mxDownHeight = mxBottom - this._styleTop - this._borderY; |
|||
this._mxUpHeight = Math.max(this._fixTop - mxTop, this.Min ? this.minHeight : 0); |
|||
this._mxLeftWidth = Math.max(this._fixLeft - mxLeft, this.Min ? this.minWidth : 0); |
|||
}; |
|||
this._mxSet(); |
|||
//有缩放比例下的范围限制
|
|||
if(this.Scale){ |
|||
this._mxScaleWidth = Math.min(this._scaleLeft - mxLeft, mxRight - this._scaleLeft - this._borderX) * 2; |
|||
this._mxScaleHeight = Math.min(this._scaleTop - mxTop, mxBottom - this._scaleTop - this._borderY) * 2; |
|||
}; |
|||
}; |
|||
//mousemove时缩放 mouseup时停止
|
|||
addEventHandler(document, "mousemove", this._fR); |
|||
addEventHandler(document, "mouseup", this._fS); |
|||
if(isIE){ |
|||
addEventHandler(this._obj, "losecapture", this._fS); |
|||
this._obj.setCapture(); |
|||
}else{ |
|||
addEventHandler(window, "blur", this._fS); |
|||
e.preventDefault(); |
|||
}; |
|||
}, |
|||
//缩放
|
|||
Resize: function(e) { |
|||
//清除选择
|
|||
window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty(); |
|||
//执行缩放程序
|
|||
this._fun(e); |
|||
//设置样式,变量必须大于等于0否则ie出错
|
|||
with(this._obj.style){ |
|||
width = this._styleWidth + "px"; height = this._styleHeight + "px"; |
|||
top = this._styleTop + "px"; left = this._styleLeft + "px"; |
|||
} |
|||
//附加程序
|
|||
this.onResize(); |
|||
}, |
|||
//缩放程序
|
|||
//上
|
|||
Up: function(e) { |
|||
this.RepairY(this._sideDown - e.clientY, this._mxUpHeight); |
|||
this.RepairTop(); |
|||
this.TurnDown(this.Down); |
|||
}, |
|||
//下
|
|||
Down: function(e) { |
|||
this.RepairY(e.clientY - this._sideUp, this._mxDownHeight); |
|||
this.TurnUp(this.Up); |
|||
}, |
|||
//右
|
|||
Right: function(e) { |
|||
this.RepairX(e.clientX - this._sideLeft, this._mxRightWidth); |
|||
this.TurnLeft(this.Left); |
|||
}, |
|||
//左
|
|||
Left: function(e) { |
|||
this.RepairX(this._sideRight - e.clientX, this._mxLeftWidth); |
|||
this.RepairLeft(); |
|||
this.TurnRight(this.Right); |
|||
}, |
|||
//右下
|
|||
RightDown: function(e) { |
|||
this.RepairAngle( |
|||
e.clientX - this._sideLeft, this._mxRightWidth, |
|||
e.clientY - this._sideUp, this._mxDownHeight |
|||
); |
|||
this.TurnLeft(this.LeftDown) || this.Scale || this.TurnUp(this.RightUp); |
|||
}, |
|||
//右上
|
|||
RightUp: function(e) { |
|||
this.RepairAngle( |
|||
e.clientX - this._sideLeft, this._mxRightWidth, |
|||
this._sideDown - e.clientY, this._mxUpHeight |
|||
); |
|||
this.RepairTop(); |
|||
this.TurnLeft(this.LeftUp) || this.Scale || this.TurnDown(this.RightDown); |
|||
}, |
|||
//左下
|
|||
LeftDown: function(e) { |
|||
this.RepairAngle( |
|||
this._sideRight - e.clientX, this._mxLeftWidth, |
|||
e.clientY - this._sideUp, this._mxDownHeight |
|||
); |
|||
this.RepairLeft(); |
|||
this.TurnRight(this.RightDown) || this.Scale || this.TurnUp(this.LeftUp); |
|||
}, |
|||
//左上
|
|||
LeftUp: function(e) { |
|||
this.RepairAngle( |
|||
this._sideRight - e.clientX, this._mxLeftWidth, |
|||
this._sideDown - e.clientY, this._mxUpHeight |
|||
); |
|||
this.RepairTop(); this.RepairLeft(); |
|||
this.TurnRight(this.RightUp) || this.Scale || this.TurnDown(this.LeftDown); |
|||
}, |
|||
//修正程序
|
|||
//水平方向
|
|||
RepairX: function(iWidth, mxWidth) { |
|||
iWidth = this.RepairWidth(iWidth, mxWidth); |
|||
if(this.Scale){ |
|||
var iHeight = this.RepairScaleHeight(iWidth); |
|||
if(this.Max && iHeight > this._mxScaleHeight){ |
|||
iHeight = this._mxScaleHeight; |
|||
iWidth = this.RepairScaleWidth(iHeight); |
|||
}else if(this.Min && iHeight < this.minHeight){ |
|||
var tWidth = this.RepairScaleWidth(this.minHeight); |
|||
if(tWidth < mxWidth){ iHeight = this.minHeight; iWidth = tWidth; } |
|||
} |
|||
this._styleHeight = iHeight; |
|||
this._styleTop = this._scaleTop - iHeight / 2; |
|||
} |
|||
this._styleWidth = iWidth; |
|||
}, |
|||
//垂直方向
|
|||
RepairY: function(iHeight, mxHeight) { |
|||
iHeight = this.RepairHeight(iHeight, mxHeight); |
|||
if(this.Scale){ |
|||
var iWidth = this.RepairScaleWidth(iHeight); |
|||
if(this.Max && iWidth > this._mxScaleWidth){ |
|||
iWidth = this._mxScaleWidth; |
|||
iHeight = this.RepairScaleHeight(iWidth); |
|||
}else if(this.Min && iWidth < this.minWidth){ |
|||
var tHeight = this.RepairScaleHeight(this.minWidth); |
|||
if(tHeight < mxHeight){ iWidth = this.minWidth; iHeight = tHeight; } |
|||
} |
|||
this._styleWidth = iWidth; |
|||
this._styleLeft = this._scaleLeft - iWidth / 2; |
|||
} |
|||
this._styleHeight = iHeight; |
|||
}, |
|||
//对角方向
|
|||
RepairAngle: function(iWidth, mxWidth, iHeight, mxHeight) { |
|||
iWidth = this.RepairWidth(iWidth, mxWidth); |
|||
if(this.Scale){ |
|||
iHeight = this.RepairScaleHeight(iWidth); |
|||
if(this.Max && iHeight > mxHeight){ |
|||
iHeight = mxHeight; |
|||
iWidth = this.RepairScaleWidth(iHeight); |
|||
}else if(this.Min && iHeight < this.minHeight){ |
|||
var tWidth = this.RepairScaleWidth(this.minHeight); |
|||
if(tWidth < mxWidth){ iHeight = this.minHeight; iWidth = tWidth; } |
|||
} |
|||
}else{ |
|||
iHeight = this.RepairHeight(iHeight, mxHeight); |
|||
} |
|||
this._styleWidth = iWidth; |
|||
this._styleHeight = iHeight; |
|||
}, |
|||
//top
|
|||
RepairTop: function() { |
|||
this._styleTop = this._fixTop - this._styleHeight; |
|||
}, |
|||
//left
|
|||
RepairLeft: function() { |
|||
this._styleLeft = this._fixLeft - this._styleWidth; |
|||
}, |
|||
//height
|
|||
RepairHeight: function(iHeight, mxHeight) { |
|||
iHeight = Math.min(this.Max ? mxHeight : iHeight, iHeight); |
|||
iHeight = Math.max(this.Min ? this.minHeight : iHeight, iHeight, 0); |
|||
return iHeight; |
|||
}, |
|||
//width
|
|||
RepairWidth: function(iWidth, mxWidth) { |
|||
iWidth = Math.min(this.Max ? mxWidth : iWidth, iWidth); |
|||
iWidth = Math.max(this.Min ? this.minWidth : iWidth, iWidth, 0); |
|||
return iWidth; |
|||
}, |
|||
//比例高度
|
|||
RepairScaleHeight: function(iWidth) { |
|||
return Math.max(Math.round((iWidth + this._borderX) / this.Ratio - this._borderY), 0); |
|||
}, |
|||
//比例宽度
|
|||
RepairScaleWidth: function(iHeight) { |
|||
return Math.max(Math.round((iHeight + this._borderY) * this.Ratio - this._borderX), 0); |
|||
}, |
|||
//转向程序
|
|||
//转右
|
|||
TurnRight: function(fun) { |
|||
if(!(this.Min || this._styleWidth)){ |
|||
this._fun = fun; |
|||
this._sideLeft = this._sideRight; |
|||
this.Max && this._mxSet(); |
|||
return true; |
|||
} |
|||
}, |
|||
//转左
|
|||
TurnLeft: function(fun) { |
|||
if(!(this.Min || this._styleWidth)){ |
|||
this._fun = fun; |
|||
this._sideRight = this._sideLeft; |
|||
this._fixLeft = this._styleLeft; |
|||
this.Max && this._mxSet(); |
|||
return true; |
|||
} |
|||
}, |
|||
//转上
|
|||
TurnUp: function(fun) { |
|||
if(!(this.Min || this._styleHeight)){ |
|||
this._fun = fun; |
|||
this._sideDown = this._sideUp; |
|||
this._fixTop = this._styleTop; |
|||
this.Max && this._mxSet(); |
|||
return true; |
|||
} |
|||
}, |
|||
//转下
|
|||
TurnDown: function(fun) { |
|||
if(!(this.Min || this._styleHeight)){ |
|||
this._fun = fun; |
|||
this._sideUp = this._sideDown; |
|||
this.Max && this._mxSet(); |
|||
return true; |
|||
} |
|||
}, |
|||
//停止缩放
|
|||
Stop: function() { |
|||
removeEventHandler(document, "mousemove", this._fR); |
|||
removeEventHandler(document, "mouseup", this._fS); |
|||
if(isIE){ |
|||
removeEventHandler(this._obj, "losecapture", this._fS); |
|||
this._obj.releaseCapture(); |
|||
}else{ |
|||
removeEventHandler(window, "blur", this._fS); |
|||
} |
|||
} |
|||
}; |
|||
|
|||
//拖放程序
|
|||
var Drag = Class.create(); |
|||
Drag.prototype = { |
|||
//拖放对象
|
|||
initialize: function(drag, options) { |
|||
this.Drag = drag.get(0);//拖放对象
|
|||
this._x = this._y = 0;//记录鼠标相对拖放对象的位置
|
|||
this._marginLeft = this._marginTop = 0;//记录margin
|
|||
//事件对象(用于绑定移除事件)
|
|||
this._fM = BindAsEventListener(this, this.Move); |
|||
this._fS = Bind(this, this.Stop); |
|||
|
|||
this.SetOptions(options); |
|||
|
|||
this.Limit = !!this.options.Limit; |
|||
this.mxLeft = parseInt(this.options.mxLeft); |
|||
this.mxRight = parseInt(this.options.mxRight); |
|||
this.mxTop = parseInt(this.options.mxTop); |
|||
this.mxBottom = parseInt(this.options.mxBottom); |
|||
|
|||
this.LockX = !!this.options.LockX; |
|||
this.LockY = !!this.options.LockY; |
|||
this.Lock = !!this.options.Lock; |
|||
|
|||
this.onStart = this.options.onStart; |
|||
this.onMove = this.options.onMove; |
|||
this.onStop = this.options.onStop; |
|||
|
|||
this._Handle = $(this.options.Handle).get(0) || this.Drag; |
|||
this._mxContainer = $(this.options.mxContainer).get(0) || null; |
|||
|
|||
this.Drag.style.position = "absolute"; |
|||
//透明
|
|||
if(isIE && !!this.options.Transparent){ |
|||
//填充拖放对象
|
|||
with(this._Handle.appendChild(document.createElement("div")).style){ |
|||
width = height = "100%"; backgroundColor = "#fff"; filter = "alpha(opacity:0)"; fontSize = 0; |
|||
} |
|||
} |
|||
//修正范围
|
|||
this.Repair(); |
|||
addEventHandler(this._Handle, "mousedown", BindAsEventListener(this, this.Start)); |
|||
}, |
|||
//设置默认属性
|
|||
SetOptions: function(options) { |
|||
this.options = {//默认值
|
|||
Handle: "",//设置触发对象(不设置则使用拖放对象)
|
|||
Limit: false,//是否设置范围限制(为true时下面参数有用,可以是负数)
|
|||
mxLeft: 0,//左边限制
|
|||
mxRight: 9999,//右边限制
|
|||
mxTop: 0,//上边限制
|
|||
mxBottom: 9999,//下边限制
|
|||
mxContainer: "",//指定限制在容器内
|
|||
LockX: false,//是否锁定水平方向拖放
|
|||
LockY: false,//是否锁定垂直方向拖放
|
|||
Lock: false,//是否锁定
|
|||
Transparent: false,//是否透明
|
|||
onStart: function(){},//开始移动时执行
|
|||
onMove: function(){},//移动时执行
|
|||
onStop: function(){}//结束移动时执行
|
|||
}; |
|||
Extend(this.options, options || {}); |
|||
}, |
|||
//准备拖动
|
|||
Start: function(oEvent) { |
|||
if(this.Lock){ return; } |
|||
this.Repair(); |
|||
//记录鼠标相对拖放对象的位置
|
|||
this._x = oEvent.clientX - this.Drag.offsetLeft; |
|||
this._y = oEvent.clientY - this.Drag.offsetTop; |
|||
//记录margin
|
|||
this._marginLeft = parseInt(CurrentStyle(this.Drag).marginLeft) || 0; |
|||
this._marginTop = parseInt(CurrentStyle(this.Drag).marginTop) || 0; |
|||
//mousemove时移动 mouseup时停止
|
|||
addEventHandler(document, "mousemove", this._fM); |
|||
addEventHandler(document, "mouseup", this._fS); |
|||
if(isIE){ |
|||
//焦点丢失
|
|||
addEventHandler(this._Handle, "losecapture", this._fS); |
|||
//设置鼠标捕获
|
|||
this._Handle.setCapture(); |
|||
}else{ |
|||
//焦点丢失
|
|||
addEventHandler(window, "blur", this._fS); |
|||
//阻止默认动作
|
|||
oEvent.preventDefault(); |
|||
}; |
|||
//附加程序
|
|||
this.onStart(); |
|||
}, |
|||
//修正范围
|
|||
Repair: function() { |
|||
if(this.Limit){ |
|||
//修正错误范围参数
|
|||
this.mxRight = Math.max(this.mxRight, this.mxLeft + this.Drag.offsetWidth); |
|||
this.mxBottom = Math.max(this.mxBottom, this.mxTop + this.Drag.offsetHeight); |
|||
//如果有容器必须设置position为relative或absolute来相对或绝对定位,并在获取offset之前设置
|
|||
!this._mxContainer || CurrentStyle(this._mxContainer).position == "relative" || CurrentStyle(this._mxContainer).position == "absolute" || (this._mxContainer.style.position = "relative"); |
|||
} |
|||
}, |
|||
//拖动
|
|||
Move: function(oEvent) { |
|||
//判断是否锁定
|
|||
if(this.Lock){ this.Stop(); return; }; |
|||
//清除选择
|
|||
window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty(); |
|||
//设置移动参数
|
|||
var iLeft = oEvent.clientX - this._x, iTop = oEvent.clientY - this._y; |
|||
//设置范围限制
|
|||
if(this.Limit){ |
|||
//设置范围参数
|
|||
var mxLeft = this.mxLeft, mxRight = this.mxRight, mxTop = this.mxTop, mxBottom = this.mxBottom; |
|||
//如果设置了容器,再修正范围参数
|
|||
if(!!this._mxContainer){ |
|||
mxLeft = Math.max(mxLeft, 0); |
|||
mxTop = Math.max(mxTop, 0); |
|||
mxRight = Math.min(mxRight, this._mxContainer.clientWidth); |
|||
mxBottom = Math.min(mxBottom, this._mxContainer.clientHeight); |
|||
}; |
|||
//修正移动参数
|
|||
iLeft = Math.max(Math.min(iLeft, mxRight - this.Drag.offsetWidth), mxLeft); |
|||
iTop = Math.max(Math.min(iTop, mxBottom - this.Drag.offsetHeight), mxTop); |
|||
} |
|||
//设置位置,并修正margin
|
|||
if(!this.LockX){ this.Drag.style.left = iLeft - this._marginLeft + "px"; } |
|||
if(!this.LockY){ this.Drag.style.top = iTop - this._marginTop + "px"; } |
|||
//附加程序
|
|||
this.onMove(); |
|||
}, |
|||
//停止拖动
|
|||
Stop: function() { |
|||
//移除事件
|
|||
removeEventHandler(document, "mousemove", this._fM); |
|||
removeEventHandler(document, "mouseup", this._fS); |
|||
if(isIE){ |
|||
removeEventHandler(this._Handle, "losecapture", this._fS); |
|||
this._Handle.releaseCapture(); |
|||
}else{ |
|||
removeEventHandler(window, "blur", this._fS); |
|||
}; |
|||
//附加程序
|
|||
this.onStop(); |
|||
} |
|||
}; |
|||
@ -0,0 +1,140 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">海报列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('diyposter/poster/post')}" class="btn btn-primary">添加海报</a> |
|||
<a href="{php echo web_url('diyposter/poster/clear')}" class="btn btn-default" data-toggle='ajaxPost'>清除海报缓存</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="./cityagent.php" method="get" class="form-horizontal" role="form"> |
|||
<input type="hidden" name="p" value="diyposter" /> |
|||
<input type="hidden" name="ac" value="poster" /> |
|||
<input type="hidden" name="do" value="lists" /> |
|||
<div class="form-group max-with-all"> |
|||
<label class="col-md-2 control-label">类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo filter_url('type:0');}" class="btn {if $_GPC['type'] == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo filter_url('type:1');}" class="btn {if $_GPC['type'] == 1}btn-primary{else}btn-default{/if}">商家海报</a> |
|||
{if p('rush')} |
|||
<a href="{php echo filter_url('type:2');}" class="btn {if $_GPC['type'] == 2}btn-primary{else}btn-default{/if}">抢购海报</a> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<a href="{php echo filter_url('type:3');}" class="btn {if $_GPC['type'] == 3}btn-primary{else}btn-default{/if}">卡券海报</a> |
|||
{/if} |
|||
{if p('distribution')} |
|||
<a href="{php echo filter_url('type:4');}" class="btn {if $_GPC['type'] == 4}btn-primary{else}btn-default{/if}">分销海报</a> |
|||
{/if} |
|||
{if p('groupon')} |
|||
<a href="{php echo filter_url('type:5');}" class="btn {if $_GPC['type'] == 5}btn-primary{else}btn-default{/if}">团购海报</a> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<a href="{php echo filter_url('type:6');}" class="btn {if $_GPC['type'] == 6}btn-primary{else}btn-default{/if}">拼团海报</a> |
|||
{/if} |
|||
{if p('bargain')} |
|||
<a href="{php echo filter_url('type:7');}" class="btn {if $_GPC['type'] == 7}btn-primary{else}btn-default{/if}">砍价海报</a> |
|||
{/if} |
|||
{if p('activity')} |
|||
<a href="{php echo filter_url('type:14');}" class="btn {if $_GPC['type'] == 14}btn-primary{else}btn-default{/if}">活动海报</a> |
|||
{/if} |
|||
<!-- <a href="{php echo filter_url('type:8');}" class="btn {if $_GPC['type'] == 8}btn-primary{else}btn-default{/if}">业务员海报</a>--> |
|||
{if p('consumption')} |
|||
<a href="{php echo filter_url('type:9');}" class="btn {if $_GPC['type'] == 9}btn-primary{else}btn-default{/if}">积分商城海报</a> |
|||
{/if} |
|||
<!-- <a href="{php echo filter_url('type:10');}" class="btn {if $_GPC['type'] == 10}btn-primary{else}btn-default{/if}">名片海报</a>--> |
|||
{if p('subposter')} |
|||
<a href="{php echo filter_url('type:11');}" class="btn {if $_GPC['type'] == 11}btn-primary{else}btn-default{/if}">倡议海报</a> |
|||
{/if} |
|||
{if p('dating')} |
|||
<a href="{php echo filter_url('type:15');}" class="btn {if $_GPC['type'] == 15}btn-primary{else}btn-default{/if}">红娘海报</a> |
|||
{/if} |
|||
{if p('housekeep')} |
|||
<a href="{php echo filter_url('type:16');}" class="btn {if $_GPC['type'] == 16}btn-primary{else}btn-default{/if}">家政海报</a> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-responsive"> |
|||
<thead> |
|||
<tr> |
|||
<th>海报名称</th> |
|||
<th>海报类型</th> |
|||
<th>状态</th> |
|||
<th>最近修改时间</th> |
|||
<th>操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $row} |
|||
<tr> |
|||
<td>{$row['title']}</td> |
|||
<td> |
|||
{if $row['type']==1} |
|||
<label class='label label-primary'>商家海报</label> |
|||
{elseif $row['type']==2} |
|||
<label class='label label-success'>抢购海报</label> |
|||
{elseif $row['type']==3} |
|||
<label class='label label-warning'>卡券海报</label> |
|||
{elseif $row['type']==4} |
|||
<label class='label label-danger'>分销海报</label> |
|||
{elseif $row['type']==5} |
|||
<label class='label label-info'>团购海报</label> |
|||
{elseif $row['type']==6} |
|||
<label class='label label-default'>拼团海报</label> |
|||
{elseif $row['type']==7} |
|||
<label class='label label-primary'>砍价海报</label> |
|||
{elseif $row['type']==8} |
|||
<label class='label label-success'>业务员海报</label> |
|||
{elseif $row['type']==9} |
|||
<label class='label label-success'>积分商城海报</label> |
|||
{elseif $row['type']==10} |
|||
<label class='label label-success'>名片海报</label> |
|||
{elseif $row['type']==11} |
|||
<label class='label label-primary'>倡议海报</label> |
|||
{elseif $row['type']==14} |
|||
<label class='label label-primary'>活动海报</label> |
|||
{elseif $row['type']==15} |
|||
<label class='label label-primary'>红娘海报</label> |
|||
{elseif $row['type']==16} |
|||
<label class='label label-success'>家政海报</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $row['status']==1} |
|||
<label class='label label-success'>使用中</label> |
|||
{else} |
|||
<label class='label label-default'>未使用</label> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date('Y-m-d H:i:s', $row['createtime'])}</td> |
|||
<td> |
|||
<a class='btn btn-primary btn-sm btn-op btn-operation' href="{php echo web_url('diyposter/poster/post', array('id' => $row['id']))}">编辑 |
|||
</a> |
|||
<a class='btn btn-danger btn-sm btn-op btn-operation' data-toggle='ajaxRemove' href="{php echo web_url('diyposter/poster/delete', array('id' => $row['id']))}" data-confirm="确认删除此海报吗?"> |
|||
删除 |
|||
</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,703 @@ |
|||
{php include wl_template('common/header');} |
|||
<link href="{URL_MODULE}plugin/diyposter/sys/resource/css/designer.css" rel="stylesheet" /> |
|||
<script language='javascript' src="{URL_MODULE}plugin/diyposter/sys/resource/js/designer.js"></script> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">编辑海报</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="setting-form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">编辑海报</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<div class="col-sm-12"> |
|||
<table style='width:100%;'> |
|||
<tr> |
|||
<td style='width:320px;padding:10px;' valign='top'> |
|||
<div id='poster' style="{if $item['type'] == 10}width: 345px;height: 361px;{/if}"> |
|||
{if !empty($item['bg'])} |
|||
<img src='{php echo tomedia($item['bg'])}' class='bg'/> |
|||
{/if} |
|||
{if !empty($data)} |
|||
{loop $data $key $d} |
|||
<div class="drag {$d['border']} {$d['align']}" type="{$d['type']}" index="{php echo $key+1}" style="zindex:{php echo $key+1};left:{$d['left']};top:{$d['top']};width:{$d['width']};height:{$d['height']}" |
|||
src="{$d['src']}" size="{$d['size']}" color="{$d['color']}" words="{$d['words']}" border="{$d['border']}" align="{$d['align']}" line="{$d['line']}"> |
|||
{if $d['type']=='qr'} |
|||
<img src="../addons/{MODULE_NAME}/plugin/diyposter/sys/resource/images/qr.png" /> |
|||
{elseif $d['type']=='head' || $d['type']=='logo'} |
|||
<img src="../addons/{MODULE_NAME}/plugin/diyposter/sys/resource/images/head.jpg" /> |
|||
{elseif $d['type']=='img' || $d['type']=='thumb' || $d['type'] == 'shopThumb'} |
|||
<img src="{php echo empty($d['src'])?'../addons/'.MODULE_NAME.'/plugin/diyposter/sys/resource/images/img.jpg':tomedia($d['src'])}" /> |
|||
{elseif ($d['type']=='vip_price' || $d['type']=='nickname' || $d['type']=='title' || $d['type']=='marketprice' || $d['type']=='productprice' || $d['type']=='sub_title' || $d['type']=='text' || $d['type']=='shopTitle' || $d['type']=='shopAddress' || $d['type']=='activityaddress' || $d['type']=='shopPhone' || $d['type']=='name' || $d['type']=='position' || $d['type']=='address' || $d['type']=='mobile' || $d['type']=='desc' || $d['type']=='wechat' || $d['type']=='company_branch' || $d['type']=='numbers')} |
|||
<div class=text style="font-size:{$d['size']};color:{$d['color']}">{php echo !empty($d['words']) ? $d['words'] : '未命名';}</div> |
|||
{/if} |
|||
<div class="rRightDown"> </div><div class="rLeftDown"> </div><div class="rRightUp"> </div><div class="rLeftUp"> </div><div class="rRight"> </div><div class="rLeft"> </div><div class="rUp"> </div><div class="rDown"></div> |
|||
</div> |
|||
{/loop} |
|||
{/if} |
|||
</div> |
|||
|
|||
</td> |
|||
<td valign='top' style='padding:10px;'> |
|||
<div class='panel panel-default'> |
|||
<div class='panel-body'> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海报名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="title" class="form-control valid" value="{$item['title']}" data-rule-required="true" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海报类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="1" {if $item['type']==1 || empty($item['type'])}checked{/if} /> 商家海报 |
|||
</label> |
|||
{if p('rush')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="2" {if $item['type']==2}checked{/if} /> 抢购海报 |
|||
</label> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="3" {if $item['type']==3}checked{/if} /> 卡券海报 |
|||
</label> |
|||
{/if} |
|||
{if p('distribution')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="4" {if $item['type']==4}checked{/if} /> 分销海报 |
|||
</label> |
|||
{/if} |
|||
{if p('groupon')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="5" {if $item['type']==5}checked{/if} /> 团购海报 |
|||
</label> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="6" {if $item['type']==6}checked{/if} /> 拼团海报 |
|||
</label> |
|||
{/if} |
|||
{if p('bargain')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="7" {if $item['type']==7}checked{/if} /> 砍价海报 |
|||
</label> |
|||
{/if} |
|||
{if p('activity')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="14" {if $item['type']==14}checked{/if} /> 活动海报 |
|||
</label> |
|||
{/if} |
|||
{if p('salesman')} |
|||
<!--<label class="radio-inline"> |
|||
<input type="radio" name="type" value="8" {if $item['type']==8}checked{/if} /> 业务员海报 |
|||
</label>--> |
|||
{/if} |
|||
{if p('consumption')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="9" {if $item['type']==9}checked{/if} /> 积分商城海报 |
|||
</label> |
|||
{/if} |
|||
{if p('citycard')} |
|||
<!--<label class="radio-inline"> |
|||
<input type="radio" name="type" value="10" {if $item['type']==10}checked{/if} /> 名片海报 |
|||
</label>--> |
|||
{/if} |
|||
{if p('subposter')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="11" {if $item['type']==11}checked{/if} /> 倡议关注海报 |
|||
</label> |
|||
{/if} |
|||
{if p('dating')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="15" {if $item['type']==15}checked{/if} /> 红娘海报 |
|||
</label> |
|||
{/if} |
|||
{if p('housekeep')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="type" value="16" {if $item['type']==16}checked{/if} /> 家政海报 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="bgset"> |
|||
<label class="col-sm-2 control-label">默认背景</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('bg',$item['bg'])} |
|||
<span class='help-block'>背景图片尺寸: 640 * 1136</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="otherbg"> |
|||
<label class="col-sm-2 control-label">背景图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('otherbg',$item['otherbg'])} |
|||
<span class='help-block'>选填,不需要切换背景图就不上传,背景图片尺寸: 640 * 1136</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海报元素</label> |
|||
<div class="col-sm-9"> |
|||
<button class='btn btn-default btn-com' type='button' data-type='vip_price' {if !in_array(intval($item['type']), array(2,5,3,7,9))}style="display:none"{/if}>会员价格</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='vip_discount' {if $item['type'] != 14}style="display:none"{/if}>会员减免</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='head' >头像</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='nickname' >昵称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='qr' >二维码</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='img' >图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='text' >文字</button> |
|||
<span id="storeparams" {if $item['type'] == 4 || $item['type'] == 9 || $item['type'] == 10 || $item['type'] == 11 || $item['type'] == 15}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='shopTitle'>店铺名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='shopThumb'>店铺图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='shopAddress'>店铺地址</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='shopPhone'>店铺电话</button> |
|||
</span> |
|||
<span id="rushparams" {if $item['type']!=2}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='title' >抢购名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='thumb' >抢购图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='marketprice' >抢购现价</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='productprice' >抢购原价</button> |
|||
</span> |
|||
<span id="grouponparams" {if $item['type']!=5}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='title' >团购名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='thumb' >团购图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='marketprice' >团购现价</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='productprice' >团购原价</button> |
|||
</span> |
|||
<span id="cardparams" {if $item['type']!=3}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='title' >卡券标题</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='sub_title' >卡券描述</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='thumb' >卡券图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='marketprice' >卡券价格</button> |
|||
</span> |
|||
<span id="fightgroupparams" {if $item['type']!=6}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='title' >拼团名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='thumb' >拼团图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='marketprice' >拼团价</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='productprice' >单买价</button> |
|||
</span> |
|||
<span id="bargainparams" {if $item['type']!=7}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='title' >砍价名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='thumb' >砍价图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='marketprice' >底价</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='productprice' >原价</button> |
|||
</span> |
|||
<span id="activityparams" {if $item['type']!=14}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='title' >活动名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='thumb' >活动图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='marketprice' >报名价</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='activityaddress' >活动地址</button> |
|||
</span> |
|||
<span {if $item['type']!=9}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='title' >商品名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='thumb' >商品图片</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='marketprice' >现价</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='productprice' >原价</button> |
|||
</span> |
|||
<span id="usercardparams" {if $item['type']!=10}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='name' >名片名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='position' >职位</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='company_branch' >公司|部门</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='logo' >名片头像</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='address' >地址</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='mobile' >电话</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='desc' >介绍</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='wechat' >微信号</button> |
|||
</span> |
|||
<span id="subposterparams" {if $item['type']!=11}style="display:none"{/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='numbers'>人数</button> |
|||
</span> |
|||
<span id="housekeepparams" {if $item['type'] != 16} style="display:none" {/if}> |
|||
<button class='btn btn-default btn-com' type='button' data-type='title'>服务名称</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='logo'>服务缩略图</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='thumb'>服务首图</button> |
|||
<button class='btn btn-default btn-com' type='button' data-type='marketprice'>服务价格</button> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
<div id='qrset' style='display:none'> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">二维码尺寸</label> |
|||
<div class="col-sm-9"> |
|||
<select id='qrsize' class='form-control'> |
|||
<option value='1'>1</option> |
|||
<option value='2'>2</option> |
|||
<option value='3'>3</option> |
|||
<option value='4'>4</option> |
|||
<option value='5'>5</option> |
|||
<option value='6'>6</option> |
|||
</select> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
<div id="headset" style='display:none'> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">头像样式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"><input type="radio" value="" name="style">正方形</label> |
|||
<label class="radio-inline"><input type="radio" value="radius" name="style"> 圆角</label> |
|||
<label class="radio-inline"><input type="radio" value="circle" name="style" checked=""> 圆形</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id='nameset' style='display:none'> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">文字颜色</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_form_field_color('color')} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">文字大小</label> |
|||
<div class="col-sm-9"> |
|||
<div class='input-group'> |
|||
<input type="text" id="namesize" class="form-control namesize" placeholder="例如: 14,16" /> |
|||
<div class='input-group-addon'>px</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group textwords" style='display:none'> |
|||
<label class="col-sm-2 control-label">文字内容</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" id="textwords" class="form-control" placeholder="请输入文字内容" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">文字对齐</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"><input type="radio" value="left" name="align"> 左对齐</label> |
|||
<label class="radio-inline"><input type="radio" value="center" name="align"> 居中</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">文字行数</label> |
|||
<div class="col-sm-9"> |
|||
<select id='textline' class='form-control'> |
|||
<option value='1'>1</option> |
|||
<option value='2'>2</option> |
|||
<option value='3'>3</option> |
|||
<option value='4'>4</option> |
|||
<option value='5'>5</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="imgset" style="display:none"> |
|||
<label class="col-sm-2 control-label">图片设置</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('img')} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">辅助对齐</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn btn-default btn-sm btn-align" data-align="left"><i class="fa fa-align-left"></i> 居左</div> |
|||
<div class="btn btn-default btn-sm btn-align" data-align="center"><i class="fa fa-align-center"></i> 居中</div> |
|||
<div class="btn btn-default btn-sm btn-align" data-align="right"><i class="fa fa-align-right"></i> 居右</div> |
|||
<div class="help-block">尝试使用键盘的上下左右键进行位置调整</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="data" value="" /> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
<script language='javascript'> |
|||
var _currentDom = null; |
|||
$('form').submit(function(){ |
|||
var data = []; |
|||
$('.drag').each(function(){ |
|||
var obj = $(this); |
|||
var type = obj.attr('type'); |
|||
var left = obj.css('left'),top = obj.css('top'); |
|||
var d= {left:left,top:top,type:obj.attr('type'),width:obj.css('width'),height:obj.css('height')}; |
|||
if( type=='nickname' || type=='title' || type=='marketprice' || type=='productprice' || type=='sub_title' || |
|||
type=='text' || type=='vip_price' || type=='vip_discount' || type=='shopTitle' || type=='shopAddress' || type=='activityaddress' || type=='shopPhone' || |
|||
type=='name' || type=='position' || type=='address' || type=='mobile' || type=='desc' || type=='wechat' || type=='company_branch' || type=='numbers'){ |
|||
d.line = obj.attr('line'); |
|||
d.size = obj.attr('size'); |
|||
d.color = obj.attr('color'); |
|||
d.words = obj.attr('words'); |
|||
d.align = obj.attr('align'); |
|||
} else if(type=='qr'){ |
|||
d.size = obj.attr('size'); |
|||
} else if(type=='img'){ |
|||
d.src = obj.attr('src'); |
|||
} else if(type=='head' || type=='logo'){ |
|||
d.border = obj.attr('border'); |
|||
} |
|||
data.push(d); |
|||
}); |
|||
$(':input[name=data]').val( JSON.stringify(data)); |
|||
$('form').removeAttr('stop'); |
|||
return true; |
|||
}); |
|||
|
|||
$('.btn-align').click(function () { |
|||
if(_currentDom==null){ |
|||
return; |
|||
} |
|||
|
|||
var width = _currentDom.width(); |
|||
var align = $(this).data('align'); |
|||
if(align=='left'){ |
|||
_currentDom.css("left", "0px"); |
|||
}else if(align=='right'){ |
|||
_currentDom.css("left", (320 - width) + "px"); |
|||
}else{ |
|||
_currentDom.css("left", (160 - width/2) + "px"); |
|||
} |
|||
}); |
|||
|
|||
function bindEvents(obj){ |
|||
var index = obj.attr('index'); |
|||
var rs = new Resize(obj, { Max: true, mxContainer: "#poster" }); |
|||
rs.Set($(".rRightDown",obj), "right-down"); |
|||
rs.Set($(".rLeftDown",obj), "left-down"); |
|||
rs.Set($(".rRightUp",obj), "right-up"); |
|||
rs.Set($(".rLeftUp",obj), "left-up"); |
|||
rs.Set($(".rRight",obj), "right"); |
|||
rs.Set($(".rLeft",obj), "left"); |
|||
rs.Set($(".rUp",obj), "up"); |
|||
rs.Set($(".rDown",obj), "down"); |
|||
rs.Scale = true; |
|||
var type = obj.attr('type'); |
|||
if(type=='vip_price' || type=='shopThumb' || type=='thumb' || type=='nickname' || type=='img' || type=='title' || type=='marketprice' || |
|||
type=='productprice' || type=='sub_title' || type=='text' || type=='shopTitle' || type=='shopAddress' || type=='activityaddress' || type=='shopPhone' || |
|||
type=='name' || type=='position' || type=='address' || type=='mobile' || type=='desc' || type=='wechat' || type=='company_branch' || type=='numbers'){ |
|||
rs.Scale = false; |
|||
} |
|||
new Drag(obj, { Limit: true, mxContainer: "#poster" }); |
|||
$('.drag .remove').unbind('click').click(function(){ |
|||
$(this).parent().remove(); |
|||
}) |
|||
myrequire(['jquery.contextMenu'],function(){ |
|||
$.contextMenu({ |
|||
selector: '.drag[index=' + index + ']', |
|||
callback: function(key, options) { |
|||
var index = parseInt($(this).attr('zindex')); |
|||
|
|||
if(key=='next'){ |
|||
var nextdiv = $(this).next('.drag'); |
|||
if(nextdiv.length>0 ){ |
|||
nextdiv.insertBefore($(this)); |
|||
} |
|||
} else if(key=='prev'){ |
|||
var prevdiv = $(this).prev('.drag'); |
|||
if(prevdiv.length>0 ){ |
|||
$(this).insertBefore(prevdiv); |
|||
} |
|||
} else if(key=='last'){ |
|||
var len = $('.drag').length; |
|||
if(index >=len-1){ |
|||
return; |
|||
} |
|||
var last = $('#poster .drag:last'); |
|||
if(last.length>0){ |
|||
$(this).insertAfter(last); |
|||
} |
|||
}else if(key=='first'){ |
|||
var index = $(this).index(); |
|||
if(index<=1){ |
|||
return; |
|||
} |
|||
var first = $('#poster .drag:first'); |
|||
if(first.length>0){ |
|||
$(this).insertBefore(first); |
|||
} |
|||
}else if(key=='delete'){ |
|||
$(this).remove(); |
|||
} |
|||
var n =1 ; |
|||
$('.drag').each(function(){ |
|||
$(this).css("z-index",n); |
|||
n++; |
|||
}) |
|||
}, |
|||
items: { |
|||
"next": {name: "调整到上层"}, |
|||
"prev": {name: "调整到下层"}, |
|||
"last": {name: "调整到最顶层"}, |
|||
"first": {name: "调整到最低层"}, |
|||
"delete": {name: "删除元素"} |
|||
} |
|||
}); |
|||
obj.unbind('click').click(function(){ |
|||
bind($(this)); |
|||
}) |
|||
}); |
|||
} |
|||
|
|||
var imgsettimer = 0 ; |
|||
var nametimer = 0; |
|||
var bgtimer = 0 ; |
|||
|
|||
function bindType(type){ |
|||
$("#storeparams").hide(); |
|||
$("#rushparams").hide(); |
|||
$("#grouponparams").hide(); |
|||
$("#cardparams").hide(); |
|||
$("#fightgroupparams").hide(); |
|||
$("#bargainparams").hide(); |
|||
$("#subposterparams").hide(); |
|||
$("#activityparams").hide(); |
|||
$("#housekeepparams").hide(); |
|||
$("[data-type='vip_price']").show(); |
|||
$("#storeparams").show(); |
|||
if(type=='1'){ |
|||
$("[data-type='vip_price']").hide(); |
|||
} else if(type=='2'){ |
|||
$("#rushparams").show(); |
|||
} else if(type=='3'){ |
|||
$("#cardparams").show(); |
|||
} else if(type=='5'){ |
|||
$("#grouponparams").show(); |
|||
} else if(type=='6'){ |
|||
$("[data-type='vip_price']").hide(); |
|||
$("#fightgroupparams").show(); |
|||
} else if(type=='7'){ |
|||
$("#bargainparams").show(); |
|||
} else if(type=='4' || type=='8'){ |
|||
$("#storeparams").hide(); |
|||
$("[data-type='vip_price']").hide(); |
|||
} else if(type == 10){ |
|||
$("#storeparams").hide(); |
|||
$("[data-type='vip_price']").hide(); |
|||
$("[data-type='head']").hide(); |
|||
$("[data-type='nickname']").hide(); |
|||
$("#usercardparams").show(); |
|||
$("#poster").css({ |
|||
"width":"345px", |
|||
"height":"361px", |
|||
}); |
|||
} else if(type == 11){ |
|||
$("#storeparams").hide(); |
|||
$("[data-type='vip_price']").hide(); |
|||
$("#subposterparams").show(); |
|||
} else if(type == 14){ |
|||
$("#activityparams").show(); |
|||
$("[data-type='vip_price']").hide(); |
|||
$("[data-type='vip_discount']").show(); |
|||
} else if(type == 15){ |
|||
$("#storeparams").hide(); |
|||
$("[data-type='vip_price']").hide(); |
|||
} else if(type == 16){ |
|||
$("#housekeepparams").show(); |
|||
$("[data-type='vip_price']").hide(); |
|||
} |
|||
} |
|||
|
|||
function clearTimers(){ |
|||
clearInterval(imgsettimer); |
|||
clearInterval(nametimer); |
|||
clearInterval(bgtimer); |
|||
} |
|||
|
|||
function getImgUrl(val){ |
|||
if(val.indexOf('http://')==-1 && val.indexOf('https://')==-1){ |
|||
val = "{$imgroot}" + val; |
|||
} |
|||
return val; |
|||
} |
|||
|
|||
function bind(obj){ |
|||
var index = obj.attr('index'); |
|||
obj.siblings('.drag').removeClass('selected'); |
|||
obj.addClass('selected'); |
|||
_currentDom = obj; |
|||
var imgset = $('#imgset'), nameset = $("#nameset"),qrset = $('#qrset'),textwords = $('.textwords'),headset = $('#headset'); |
|||
imgset.hide(),nameset.hide(),qrset.hide(),textwords.hide(),headset.hide(); |
|||
clearTimers(); |
|||
var type = obj.attr('type'); |
|||
if(type=='img'){ |
|||
imgset.show(); |
|||
var src = obj.attr('src'); |
|||
var input = imgset.find('input'); |
|||
var img = imgset.find('img'); |
|||
if(typeof(src)!='undefined' && src!=''){ |
|||
input.val(src); |
|||
img.attr('src',getImgUrl(src)); |
|||
} |
|||
imgsettimer = setInterval(function(){ |
|||
if(input.val()!=src && input.val()!=''){ |
|||
var url = getImgUrl(input.val()); |
|||
obj.attr('src',input.val()).find('img').attr('src',url); |
|||
} |
|||
},10); |
|||
} else if(type=='nickname' || type=='vip_price' || type=='title' || type=='marketprice' || type=='productprice' || |
|||
type=='sub_title' || type=='text' || type=='shopTitle' || type=='shopAddress' || type=='activityaddress' || type=='shopPhone' || |
|||
type=='name' || type=='position' || type=='address' || type=='mobile' || type=='desc' || type=='wechat' || type=='company_branch' || type=='numbers'){ |
|||
nameset.show(); |
|||
if(type=='text'){ |
|||
textwords.show(); |
|||
} |
|||
console.log(obj); |
|||
var color = obj.attr('color') || "#000"; |
|||
var size = obj.attr('size') || "16"; |
|||
var words = obj.attr('words') || "文字"; |
|||
var align = obj.attr('align') || 'left'; |
|||
var line = obj.attr('line') || '1'; |
|||
var input = nameset.find('input:first'); |
|||
var namesize = nameset.find('#namesize'); |
|||
var inputwords = nameset.find('#textwords'); |
|||
var picker = nameset.find('.sp-preview-inner'); |
|||
var textline = nameset.find('#textline'); |
|||
// console.log(line); |
|||
|
|||
input.val(color); |
|||
namesize.val(size.replace("px","")); |
|||
inputwords.val(words); |
|||
textline.val(line); |
|||
$(":radio[name='align'][value='" + align + "']").prop("checked", "checked"); |
|||
picker.css( {'background-color':color,'font-size':size}); |
|||
|
|||
nametimer = setInterval(function(){ |
|||
obj.attr('line',textline.val()); |
|||
obj.attr('color',input.val()).find('.text').css('color',input.val()); |
|||
obj.attr('size',namesize.val() +"px").find('.text').css('font-size',namesize.val() +"px"); |
|||
obj.attr('words',inputwords.val()).find('.text').html(inputwords.val()); |
|||
obj.removeClass('left center').addClass($("input[name='align']:checked").val()).attr('align', $("input[name='align']:checked").val()); |
|||
},10); |
|||
} else if(type=='qr'){ |
|||
qrset.show(); |
|||
var size = obj.attr('size') || "3"; |
|||
var sel = qrset.find('#qrsize'); |
|||
sel.val(size); |
|||
sel.unbind('change').change(function(){ |
|||
obj.attr('size',sel.val()) |
|||
}); |
|||
} else if(type=='head' || type=='logo'){ |
|||
headset.show(); |
|||
var border = obj.attr('border'); |
|||
$(":radio[name='style'][value='" + border + "']").prop("checked", "checked"); |
|||
$('#headset input[type="radio"]').change(function () { |
|||
obj.removeClass('circle radius').addClass($(this).val()); |
|||
obj.attr('border',$(this).val()); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
$(document).keydown(function(event){ |
|||
if (event.keyCode > 36 && event.keyCode < 41) { |
|||
var x = _currentDom.position().left;//水平方向位移 |
|||
var y = _currentDom.position().top;//垂直方向位移 |
|||
var w = _currentDom.width(); |
|||
var h = _currentDom.height(); |
|||
if(event.keyCode == 37){ |
|||
x = x > 0 ? x - 1 : 0 ; |
|||
_currentDom.css("left", x + "px"); |
|||
}else if(event.keyCode == 38){ |
|||
y = y > 0 ? y - 1 : 0 ; |
|||
_currentDom.css("top",y + "px"); |
|||
}else if(event.keyCode == 39){ |
|||
x = (w + x) < 320 ? x + 1 : 320 - w ; |
|||
_currentDom.css("left",x + "px"); |
|||
}else if(event.keyCode == 40){ |
|||
y = (h + y) < 568 ? y + 1 : 568 - h ; |
|||
_currentDom.css("top",y + "px"); |
|||
} |
|||
event.stopPropagation(); |
|||
event.preventDefault(); |
|||
} |
|||
}); |
|||
|
|||
$(function(){ |
|||
{if !empty($item['id'])} |
|||
$('.drag').each(function(){ |
|||
bindEvents($(this)); |
|||
}) |
|||
{/if} |
|||
|
|||
$(':radio[name=type]').click(function(){ |
|||
var type = $(this).val(); |
|||
bindType(type); |
|||
}) |
|||
|
|||
$(':radio[name=resptype]').click(function(){ |
|||
var type = $(this).val(); |
|||
if (type == 1) { |
|||
$(".resptype1").show(); |
|||
$(".resptype0").hide(); |
|||
} else { |
|||
$(".resptype0").show(); |
|||
$(".resptype1").hide(); |
|||
} |
|||
}) |
|||
//改变背景 |
|||
$('#bgset').find('button:first').click(function(){ |
|||
var oldbg = $(':input[name=bg]').val(); |
|||
bgtimer = setInterval(function(){ |
|||
var bg = $(':input[name=bg]').val(); |
|||
if(oldbg!=bg){ |
|||
bg = getImgUrl(bg); |
|||
$('#poster .bg').remove(); |
|||
var bgh = $("<img src='" + bg + "' class='bg' />"); |
|||
var first = $('#poster .drag:first'); |
|||
if(first.length>0){ |
|||
bgh.insertBefore(first); |
|||
} else { |
|||
$('#poster').append(bgh); |
|||
} |
|||
oldbg = bg; |
|||
} |
|||
},10); |
|||
}) |
|||
|
|||
$('.btn-com').click(function(){ |
|||
var imgset = $('#imgset'), nameset = $("#nameset"),qrset = $('#qrset'); |
|||
imgset.hide(),nameset.hide(),qrset.hide(); |
|||
clearTimers(); |
|||
|
|||
if($('#poster img').length<=0){ |
|||
tip.alert('请先上传海报背景图片!'); |
|||
return; |
|||
} |
|||
var type = $(this).data('type'); |
|||
var img = ""; |
|||
var textwords = ""; |
|||
|
|||
if(type=='qr'){ |
|||
img = '<img src="../addons/{MODULE_NAME}/plugin/diyposter/sys/resource/images/qr.png" />'; |
|||
}else if(type=='head' || type=='logo'){ |
|||
img = '<img src="../addons/{MODULE_NAME}/plugin/diyposter/sys/resource/images/head.jpg" />'; |
|||
}else if(type=='img' || type=='thumb' || type=='shopThumb'){ |
|||
img = '<img src="../addons/{MODULE_NAME}/plugin/diyposter/sys/resource/images/img.jpg" />'; |
|||
}else if(type=='vip_price' || type=='nickname' || type=='title' || type=='marketprice' || type=='productprice' || type=='sub_title' || |
|||
type=='text' || type=='shopTitle' || type=='shopAddress' || type=='activityaddress' || type=='shopPhone' || |
|||
type=='name' || type=='position' || type=='address' || type=='mobile' || type=='desc' || type=='wechat' || type=='company_branch' || type=='numbers'){ |
|||
var textname = $(this).html(); |
|||
textwords = 'words="'+ textname +'"'; |
|||
img = '<div class=text>'+ textname +'</div>'; |
|||
} |
|||
var index = $('#poster .drag').length+1; |
|||
var obj = $('<div class="drag" '+ textwords +' type="' + type +'" index="' + index +'" style="z-index:' + index+'">' + img+'<div class="rRightDown"> </div><div class="rLeftDown"> </div><div class="rRightUp"> </div><div class="rLeftUp"> </div><div class="rRight"> </div><div class="rLeft"> </div><div class="rUp"> </div><div class="rDown"></div></div>'); |
|||
|
|||
$('#poster').append(obj); |
|||
|
|||
bindEvents(obj); |
|||
|
|||
}); |
|||
|
|||
$('.drag').click(function(){ |
|||
bind($(this)); |
|||
}) |
|||
|
|||
}) |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,243 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基础设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" id="setting-form" class="form-horizontal form form-validate"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">基础设置</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商家海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[storepid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $store $row} |
|||
<option value="{$row['id']}" {if $settings['storepid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{if p('rush')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抢购海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[rushpid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $rush $row} |
|||
<option value="{$row['id']}" {if $settings['rushpid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">拼团海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[fgrouppid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $fightgroup $row} |
|||
<option value="{$row['id']}" {if $settings['fgrouppid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">卡券海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[cardpid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $card $row} |
|||
<option value="{$row['id']}" {if $settings['cardpid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('distribution')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分销海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[distpid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $dist $row} |
|||
<option value="{$row['id']}" {if $settings['distpid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('groupon')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">团购海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[grouponid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $groupon $row} |
|||
<option value="{$row['id']}" {if $settings['grouponid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('salesman')} |
|||
<!--<div class="form-group"> |
|||
<label class="col-sm-2 control-label">业务员海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[salesmanid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $salesman $row} |
|||
<option value="{$row['id']}" {if $settings['salesmanid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div>--> |
|||
{/if} |
|||
{if p('bargain')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">砍价海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[bargainid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $bargain $row} |
|||
<option value="{$row['id']}" {if $settings['bargainid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('activity')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[activityid]" class="form-control"> |
|||
<option value="">活动海报</option> |
|||
{loop $activity $row} |
|||
<option value="{$row['id']}" {if $settings['activityid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('consumption')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">积分商城海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[consumption_id]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $consumption $row} |
|||
<option value="{$row['id']}" {if $settings['consumption_id'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('citycard')} |
|||
<!--<div class="form-group"> |
|||
<label class="col-sm-2 control-label">个人名片海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[user_card_id]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $userCard $row} |
|||
<option value="{$row['id']}" {if $settings['user_card_id'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div>--> |
|||
{/if} |
|||
{if p('subposter')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">倡议关注海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[subposter_id]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $subposters $row} |
|||
<option value="{$row['id']}" {if $settings['subposter_id'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('dating')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红娘海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[dating_id]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $dating $row} |
|||
<option value="{$row['id']}" {if $settings['dating_id'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('dating')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">家政海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[housekeepid]" class="form-control"> |
|||
<option value="">默认海报</option> |
|||
{loop $housekeep $row} |
|||
<option value="{$row['id']}" {if $settings['housekeepid'] == $row['id']}selected="selected"{/if}>{$row['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wxplatform')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">H5微信海报</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[h5_poster]" value="0" {if $settings['h5_poster'] != 1} checked {/if}>普通二维码 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[h5_poster]" value="1" {if $settings['h5_poster'] == 1} checked {/if}>关注二维码 |
|||
</label> |
|||
<div class="help-block">普通二维码扫码为链接,关注二维码扫码关注公众号后自动推送图文链接</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if p('wxapp') && p('wxplatform')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">小程序海报</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[wxapp_poster]" value="0" {if $settings['wxapp_poster'] != 1} checked {/if}>小程序码 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[wxapp_poster]" value="1" {if $settings['wxapp_poster'] == 1} checked {/if}>关注二维码 |
|||
</label> |
|||
<div class="help-block">小程序码扫码直接打开小程序,关注二维码扫码关注公众号后自动推送回复信息。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">关注海报回复类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[replytype]" value="0" {if $settings['replytype'] != 1} checked {/if}>微信图文 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[replytype]" value="1" {if $settings['replytype'] == 1} checked {/if}>小程序 |
|||
</label> |
|||
<div class="help-block">默认回复类型为微信图文</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,761 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
|
|||
class Draw { |
|||
/** |
|||
* Comment: 获取商品信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/15 10:47 |
|||
* @param $id |
|||
* @return bool|mixed |
|||
*/ |
|||
public static function prizeInfo($id){ |
|||
//获取奖品信息 |
|||
$info = pdo_get(PDO_NAME."draw_goods",['id'=>$id]); |
|||
//处理奖品信息 奖品类型:1=现金红包,2=线上红包,3=积分,4=激活码,5=商品 |
|||
switch ($info['type']){ |
|||
case 1:break;//现金红包 |
|||
case 2: |
|||
$field = "id as red_pack_id,title as red_pack_name"; |
|||
$where = " id = {$info['goods_id']} "; |
|||
$redPack = self::getInfo($field,"redpacks",$where); |
|||
//赋值 |
|||
$info['red_pack_id'] = $redPack['red_pack_id']; |
|||
$info['red_pack_name'] = $redPack['red_pack_name']; |
|||
break;//线上红包 |
|||
case 3:break;//积分 |
|||
case 4:break;//激活码 rush groupon wlfightgroup coupon bargain |
|||
case 5: |
|||
//根据商品类型获取商品信息 |
|||
switch ($info['goods_plugin']) { |
|||
case 'rush': |
|||
$field = "name as goods_name"; |
|||
$where = " id = {$info['goods_id']} "; |
|||
$goods = self::getInfo($field,"rush_activity",$where); |
|||
break;//抢购 |
|||
case 'groupon': |
|||
$field = "name as goods_name"; |
|||
$where = " id = {$info['goods_id']} "; |
|||
$goods = self::getInfo($field,"groupon_activity",$where); |
|||
break;//团购 |
|||
case 'wlfightgroup': |
|||
$field = "name as goods_name"; |
|||
$where = " id = {$info['goods_id']} "; |
|||
$goods = self::getInfo($field,"fightgroup_goods",$where); |
|||
break;//拼团 |
|||
case 'coupon': |
|||
$field = "title as goods_name"; |
|||
$where = " id = {$info['goods_id']} "; |
|||
$goods = self::getInfo($field,"couponlist",$where); |
|||
break;//卡卷 |
|||
case 'bargain': |
|||
$field = "name as goods_name"; |
|||
$where = " id = {$info['goods_id']} "; |
|||
$goods = self::getInfo($field,"bargain_activity",$where); |
|||
break;//砍价 |
|||
} |
|||
//赋值 |
|||
$info['goods_name'] = $goods['goods_name']; |
|||
break;//商品 |
|||
} |
|||
|
|||
return $info; |
|||
} |
|||
/** |
|||
* Comment: 根据内容获取信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/15 10:41 |
|||
* @param $field |
|||
* @param $table |
|||
* @param $where |
|||
* @return array |
|||
*/ |
|||
protected static function getInfo($field,$table,$where){ |
|||
$info = pdo_fetch("SELECT {$field} FROM " .tablename(PDO_NAME.$table)." WHERE ".$where); |
|||
|
|||
return $info ? : []; |
|||
} |
|||
/** |
|||
* Comment: 获取某个抽奖活动相关的所有奖品信息列表 |
|||
* Author: zzw |
|||
* Date: 2020/9/16 17:10 |
|||
* @param $id |
|||
* @return array|bool|mixed |
|||
*/ |
|||
public static function drawJoinList($id){ |
|||
global $_W,$_GPC; |
|||
$field = "a.probability,a.serial_number, |
|||
CASE WHEN a.draw_goods_id > 0 THEN b.id |
|||
ELSE 0 |
|||
END as draw_goods_id, |
|||
CASE WHEN b.title != '' THEN b.title |
|||
ELSE '谢谢参与' |
|||
END as draw_goods_name, |
|||
CASE WHEN a.draw_goods_id > 0 THEN b.image |
|||
ELSE '' |
|||
END as draw_goods_image"; |
|||
$sql = " SELECT {$field} FROM ".tablename(PDO_NAME.'draw_join') |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."draw_goods") |
|||
." as b ON a.draw_goods_id = b.id AND a.draw_goods_id > 0 AND b.uniacid = {$_W['uniacid']} AND b.aid = {$_W['aid']}" |
|||
." WHERE a.draw_id = {$id} ORDER BY a.serial_number ASC "; |
|||
$list = pdo_fetchall($sql); |
|||
|
|||
foreach($list as $listKey => &$listVal){ |
|||
$listVal['draw_goods_image'] = $listVal['draw_goods_image'] ? tomedia($listVal['draw_goods_image']) : '../addons/weliam_smartcity/web/resource/images/not-prize.png'; |
|||
} |
|||
|
|||
return is_array($list) && $list ? $list : self::defaultDrawJoinList($id); |
|||
} |
|||
/** |
|||
* Comment: 生成默认的活动相关奖品信息列表 |
|||
* Author: zzw |
|||
* Date: 2020/9/16 17:14 |
|||
* @param $id |
|||
* @return array |
|||
*/ |
|||
public static function defaultDrawJoinList($id){ |
|||
//活动类型:1=9宫格,2=16宫格 |
|||
$type = pdo_getcolumn(PDO_NAME."draw",['id'=>$id],'type'); |
|||
if ($type == 1) $max = 9; |
|||
else $max = 16; |
|||
//生成默认列表 |
|||
$list = []; |
|||
for($i=1;$i<=$max;$i++){ |
|||
$list[$i] = [ |
|||
'draw_goods_id' => 0 , |
|||
'draw_goods_name' => '谢谢参与' , |
|||
'draw_goods_image' => '' , |
|||
'probability' => 10 , |
|||
'serial_number' => $i , |
|||
]; |
|||
} |
|||
|
|||
return $list; |
|||
} |
|||
/** |
|||
* Comment: 获取某个抽奖活动相关的活动信息、奖品信息、商户信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/17 14:01 |
|||
* @param $id |
|||
* @return array |
|||
*/ |
|||
public static function getDrawDetailedInfo($id){ |
|||
global $_W; |
|||
$set = Setting::agentsetting_read('draw_set'); |
|||
//活动信息获取 |
|||
$info = self::getDrawActivityInfo($id); |
|||
$info['rule'] = $info['rule'] ? : htmlspecialchars_decode($set['rule']) ; |
|||
$info['introduce'] = $info['introduce'] ? : htmlspecialchars_decode($set['introduce']) ; |
|||
//获取所有相关的奖品信息a.draw_goods_id, |
|||
$field = "a.id,a.probability,a.serial_number,b.type,b.sid,b.title,b.image,b.day_number,b.total_number,b.status,b.code_keyword, |
|||
CASE WHEN a.draw_goods_id > 0 AND b.id > 0 THEN a.draw_goods_id |
|||
ELSE 0 |
|||
END as draw_goods_id"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."draw_join") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."draw_goods") |
|||
." as b ON a.draw_goods_id = b.id " |
|||
." WHERE a.draw_id = {$id} ORDER BY a.serial_number ASC "; |
|||
$prize = pdo_fetchall($sql); |
|||
$startTime = strtotime(date("Y-m-d 00:00:00",time())); |
|||
$endTime = strtotime(date("Y-m-d 23:59:59",time())); |
|||
$shop = [];//商户信息列表 |
|||
foreach($prize as $pKey => &$pVal){ |
|||
//图片信息处理 |
|||
$pVal['image'] = tomedia($pVal['image']); |
|||
|
|||
|
|||
|
|||
/* //判断奖品是否启用 状态:1=开启,2=关闭 |
|||
if($pVal['status'] == 2){ |
|||
//未启用 改为谢谢参与,概率为公共概率 |
|||
$pVal['draw_goods_id'] = 0; |
|||
$pVal['title'] = '谢谢参与'; |
|||
//$pVal['probability'] = $set['not_probability']; |
|||
} |
|||
//判断奖品当日份数是否已经抽取完毕 |
|||
if($pVal['day_number'] > 0){ |
|||
$dayTotalSql = "SELECT count(*) FROM ".tablename(PDO_NAME."draw_record") |
|||
." WHERE draw_goods_id = {$pVal['draw_goods_id']} " |
|||
." AND create_time > {$startTime} AND create_time <= {$endTime} "; |
|||
$dayTotal = pdo_fetchcolumn($dayTotalSql); |
|||
if($dayTotal >= $pVal['day_number']){ |
|||
//今日份数已抽取完毕 改为谢谢参与,概率为公共概率 |
|||
$pVal['draw_goods_id'] = 0; |
|||
$pVal['title'] = '谢谢参与'; |
|||
//$pVal['probability'] = $set['not_probability']; |
|||
} |
|||
} |
|||
//判断奖品总份数是否已经抽取完毕 |
|||
if($pVal['total_number'] > 0){ |
|||
$totalSql = "SELECT count(*) FROM ".tablename(PDO_NAME."draw_record") |
|||
." WHERE draw_goods_id = {$pVal['draw_goods_id']}"; |
|||
$total = pdo_fetchcolumn($totalSql); |
|||
if($total >= $pVal['total_number']){ |
|||
//总份数已抽取完毕 改为谢谢参与,概率为公共概率 |
|||
$pVal['draw_goods_id'] = 0; |
|||
$pVal['title'] = '谢谢参与'; |
|||
//$pVal['probability'] = $set['not_probability']; |
|||
} |
|||
} |
|||
//商品为激活码 判断激活码序列是否已经全部送出 |
|||
if($pVal['type'] == 4){ |
|||
$codeWhere = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'status' => 0 , |
|||
'remark' => $pVal['code_keyword'] , |
|||
]; |
|||
$codeSurplus = pdo_count(PDO_NAME."token",$codeWhere); |
|||
if($codeSurplus <= 0){ |
|||
$pVal['draw_goods_id'] = 0; |
|||
$pVal['title'] = '谢谢参与'; |
|||
//$pVal['probability'] = $set['not_probability']; |
|||
} |
|||
}*/ |
|||
|
|||
|
|||
|
|||
|
|||
//判断是否存在商户信息 存在则获取对应的商户信息 |
|||
if($pVal['sid'] > 0 && $pVal['draw_goods_id'] > 0){ |
|||
$shop[$pKey] = pdo_get(PDO_NAME."merchantdata",['id'=>$pVal['sid']],['id','storename','logo']); |
|||
$shop[$pKey]['logo'] = tomedia($shop[$pKey]['logo']); |
|||
$shop[$pKey]['goods_logo'] = tomedia($pVal['image']); |
|||
$shop[$pKey]['goods_name'] = $pVal['title']; |
|||
} |
|||
} |
|||
|
|||
return [$info,$prize,array_values($shop)]; |
|||
} |
|||
/** |
|||
* Comment: 获取某个活动的基本信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/17 16:42 |
|||
* @param $id |
|||
* @return bool|mixed |
|||
*/ |
|||
public static function getDrawActivityInfo($id){ |
|||
global $_W,$_GPC; |
|||
//活动信息获取 |
|||
$info = pdo_get(PDO_NAME . "draw" , ['id' => $id]); |
|||
$info['prize_image'] = $info['prize_image'] ? tomedia($info['prize_image']) : ''; |
|||
$info['not_prize_image'] = $info['not_prize_image'] ? tomedia($info['not_prize_image']) : ''; |
|||
$info['background_image'] = $info['background_image'] ? tomedia($info['background_image']) : ''; |
|||
$info['background_music'] = $info['background_music'] ? tomedia($info['background_music']) : ''; |
|||
$info['start_image'] = $info['start_image'] ? tomedia($info['start_image']) : ''; |
|||
$info['use_music'] = $info['use_music'] ? tomedia($info['use_music']) : ''; |
|||
$info['button_more'] = $info['button_more'] ? tomedia($info['button_more']) : ''; |
|||
$info['button_draw'] = $info['button_draw'] ? tomedia($info['button_draw']) : ''; |
|||
$info['button_prize'] = $info['button_prize'] ? tomedia($info['button_prize']) : ''; |
|||
$info['rule'] = htmlspecialchars_decode($info['rule']); |
|||
$info['introduce'] = htmlspecialchars_decode($info['introduce']); |
|||
$info['pv'] = intval($info['fictitious_pv']) + intval($info['pv']); |
|||
//处理顶部幻灯片 |
|||
if(!empty($info['share_image'])){ |
|||
$flag = unserialize($info['share_image']); |
|||
if($flag){ |
|||
$info['share_image'] = $flag; |
|||
}else{ |
|||
$flag = $info['share_image']; |
|||
$info['share_image'] = []; |
|||
$info['share_image'][] = $flag; |
|||
} |
|||
foreach ($info['share_image'] as &$th) { |
|||
$th = tomedia($th); |
|||
} |
|||
}else{ |
|||
$info['share_image'] = ''; |
|||
} |
|||
//用户登录后 判断当前用户剩余参与次数、剩余中奖次数、当日剩余参与次数、当日剩余中奖次数 |
|||
$info['surplus_total_join_times'] = $info['total_join_times'] ? : 0;//剩余免费参与次数 |
|||
$info['surplus_total_draw_times'] = $info['total_draw_times'] ? : 0;//剩余中奖次数 |
|||
$info['surplus_total_parin_times'] = $info['total_parin_times'] ? : 0;//剩余总参与次数 |
|||
$info['surplus_day_join_times'] = $info['day_join_times'] ? : 0;//当日剩余免费参与次数 |
|||
$info['surplus_day_draw_times'] = $info['day_draw_times'] ? : 0;//当日剩余中奖次数 |
|||
$info['surplus_day_parin_times'] = $info['day_parin_times'] ? : 0;//当日剩余总共参与次数 |
|||
if($_W['mid'] > 0){ |
|||
$startTime = strtotime(date("Y-m-d 00:00:00",time())); |
|||
$endTime = strtotime(date("Y-m-d 23:59:59",time())); |
|||
//获取 剩余免费参与次数 |
|||
if($info['total_join_times'] > 0){ |
|||
$totalJoinTimes = pdo_count(PDO_NAME."draw_record",['draw_id'=>$id,'mid'=>$_W['mid'],'is_free'=>1]);//已免费参与次数 |
|||
$info['surplus_total_join_times'] = $info['total_join_times'] - $totalJoinTimes; |
|||
} |
|||
//获取 剩余参加次数 |
|||
if($info['total_parin_times'] > 0){ |
|||
$allJoinTimes = pdo_count(PDO_NAME."draw_record",['draw_id'=>$id,'mid'=>$_W['mid']]);//已参与次数 |
|||
$info['surplus_total_parin_times'] = $info['total_parin_times'] - $allJoinTimes; |
|||
} |
|||
//获取 剩余中奖次数 |
|||
if($info['total_draw_times'] > 0){ |
|||
$totalDrawTimes = pdo_count(PDO_NAME . "draw_record" , [ |
|||
'draw_id' => $id , |
|||
'mid' => $_W['mid'] , |
|||
'draw_goods_id >' => 0 |
|||
]);//已中奖次数 |
|||
$info['surplus_total_draw_times'] = $info['total_draw_times'] - $totalDrawTimes; |
|||
} |
|||
//获取 当日剩余免费参与次数 |
|||
$totalDayJoinTimes = pdo_count(PDO_NAME . "draw_record" , [ |
|||
'draw_id' => $id , |
|||
'mid' => $_W['mid'] , |
|||
'create_time >' => $startTime , |
|||
'create_time <=' => $endTime , |
|||
'is_free' => 1, |
|||
]);//当日已参与次数 |
|||
$info['surplus_day_join_times'] = $info['day_join_times'] - $totalDayJoinTimes; |
|||
//获取 当日剩余免费参与次数 |
|||
$allDayJoinTimes = pdo_count(PDO_NAME . "draw_record" , [ |
|||
'draw_id' => $id , |
|||
'mid' => $_W['mid'] , |
|||
'create_time >' => $startTime , |
|||
'create_time <=' => $endTime , |
|||
]);//当日已参与次数 |
|||
$info['surplus_day_parin_times'] = $info['day_parin_times'] - $allDayJoinTimes; |
|||
//获取 当日剩余中奖次数 |
|||
if($info['day_draw_times'] > 0){ |
|||
$totalDayDrawTimes = pdo_count(PDO_NAME . "draw_record" , [ |
|||
'draw_id' => $id , |
|||
'mid' => $_W['mid'] , |
|||
'create_time >' => $startTime , |
|||
'create_time <=' => $endTime , |
|||
'draw_goods_id >' => 0 |
|||
]);//当日已参与次数 |
|||
$info['surplus_day_draw_times'] = $info['day_draw_times'] - $totalDayDrawTimes; |
|||
} |
|||
} |
|||
//剩余信息处理一 |
|||
$info['surplus_total_join_times'] = $info['surplus_total_join_times'] > 0 ? $info['surplus_total_join_times'] : 0 ;//剩余参与次数(总免费) |
|||
$info['surplus_total_draw_times'] = $info['surplus_total_draw_times'] > 0 ? $info['surplus_total_draw_times'] : 0 ;//剩余中奖次数(总) |
|||
$info['surplus_day_join_times'] = $info['surplus_day_join_times'] > 0 ? $info['surplus_day_join_times'] : 0 ;//当日剩余参与次数(天免费) |
|||
$info['surplus_day_draw_times'] = $info['surplus_day_draw_times'] > 0 ? $info['surplus_day_draw_times'] : 0 ;//当日剩余中奖次数(天) |
|||
$info['surplus_total_parin_times'] = $info['surplus_total_parin_times'] > 0 ? $info['surplus_total_parin_times'] : 0 ;//剩余参与次数(总共) |
|||
$info['surplus_day_parin_times'] = $info['surplus_day_parin_times'] > 0 ? $info['surplus_day_parin_times'] : 0 ;//剩余参与次数(天免费) |
|||
|
|||
//剩余信息处理二 当天剩余信息不能大于总剩余信息 |
|||
if($info['total_join_times'] > 0) $info['surplus_day_join_times'] = $info['surplus_day_join_times'] > $info['surplus_total_join_times'] ? $info['surplus_total_join_times'] : $info['surplus_day_join_times'] ;//当日剩余参与次数(天免费) |
|||
if($info['total_draw_times'] > 0) $info['surplus_day_draw_times'] = $info['surplus_day_draw_times'] > $info['surplus_total_draw_times'] ? $info['surplus_total_draw_times'] : $info['surplus_day_draw_times'] ;//当日剩余中奖次数(天) |
|||
if($info['total_parin_times'] > 0) $info['surplus_day_parin_times'] = $info['surplus_day_parin_times'] > $info['surplus_total_parin_times'] ? $info['surplus_total_parin_times'] : $info['surplus_day_parin_times'] ;//当日剩余参与次数(天) |
|||
//获取统计信息 |
|||
$info['actual_visit'] = pdo_count(PDO_NAME."draw_record",['draw_id'=>$id]);//当前活动参加人数 |
|||
$info['actual_prize'] = pdo_count(PDO_NAME."draw_record",['draw_id'=>$id,'draw_goods_id >'=>0]);//已中奖人数 |
|||
//虚拟信息 + 实际信息 = 最后的统计信息 |
|||
$info['visit'] = intval($info['fictitious_visit']) + intval($info['actual_visit']);//参加人数 |
|||
$info['prize'] = intval($info['fictitious_prize']) + intval($info['actual_prize']);//中奖人数 |
|||
//状态判断 状态:1=未开启,2=使用中,【3=未开始,4=已过期】 |
|||
if($info['status'] == 2 && $info['start_time'] >= time()) $info['status'] = 3; |
|||
if($info['status'] == 2 && $info['end_time'] <= time()) $info['status'] = 4; |
|||
|
|||
return $info; |
|||
} |
|||
/** |
|||
* Comment: 获取某个活动最近的10条中奖信息 如果中奖信息小于3条则获取虚拟中奖信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/17 14:59 |
|||
* @param $id |
|||
* @param $fictitiousPrize |
|||
* @param $prize |
|||
* @return array|bool|mixed |
|||
*/ |
|||
public static function getDrawRecord($id,$fictitiousPrize,$prize){ |
|||
global $_W,$_GPC; |
|||
//信息列表获取 仅获取最近10条中奖信息 |
|||
$sql = "SELECT b.nickname,g.title FROM ".tablename(PDO_NAME."draw_record") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id LEFT JOIN ".tablename(PDO_NAME."draw_goods") |
|||
." as g ON a.draw_goods_id = g.id WHERE a.draw_id = {$id} AND a.draw_goods_id > 0 ORDER BY a.create_time DESC " ; |
|||
$list = pdo_fetchall($sql); |
|||
//当真实中奖人数小于3 并且存在虚拟中奖人数时,生成10条虚拟中奖人数 |
|||
if(count($list) < 3 && $fictitiousPrize > 0){ |
|||
//获取奖品信息列表 |
|||
$prizeList = []; |
|||
foreach($prize as $item){ |
|||
if($item['draw_goods_id'] > 0) $prizeList[] = $item; |
|||
} |
|||
//文本字符串定义 |
|||
$string = '半夜时分一个人躺在床上四处静谧无声有一种孤独的感觉如爬虫般悄悄爬上我的心头辗转反侧无法入眠轻轻'; |
|||
$string .= '无助有一种美丽叫孤独对耐不住寂寞的人来说孤独是可怕的是恐惧的而对我来说孤独是生命圆满的开始是一'; |
|||
$string .= '孤独的在下着大雪的江面上一叶小舟一个老渔翁独自在寒冷的江心垂钓天地之间是如此纯洁而寂静只剩下他'; |
|||
$string .= '失意郁闷和苦恼时隐居在山水之间寄托自己清高而孤傲情感的真实写照他的幽静过于孤独过于冷清不带一点'; |
|||
$string .= '多时候这孤独总会被周遭的喧嚣浮华所蒙蔽以致造成繁荣的假象殊不知不理会这种孤独在某种意义上而言我'; |
|||
$string .= '己的心跳和呼吸寻找到迷失的自我知不觉我也喜欢上了孤独我的孤独和风月无关和苦闷无关有着浓浓的烟火'; |
|||
$string .= '地做自己喜欢的事任身心徜徉暂时忘却柴米油盐酱醋茶的烦琐去体验琴棋书画诗酒花的高雅暂时抛开追名逐'; |
|||
$string .= '中的充实祥和于是体会孤独感受孤独不失为一种最佳的休闲身体可以在孤独中得到休养繁重的体力超负的劳'; |
|||
$string .= '不再为生活中尔虞我诈的争斗而烦恼不再为日常生活的重负而苦闷而在孤独中寻找适合调整心情的方式让心'; |
|||
$string .= '古今写写心声种种花草多一份孤独的快乐少一份无为的浪费让生命在富有创造精神的孤独中度过让生命时光'; |
|||
$string .= '于是你就会明白能够真正拥有孤独的人是世界上最幸福的人是的我就是这样享受孤独因为我只是万千世界中'; |
|||
$string .= '它折射出一个人潜藏的能量孤独是一味珍宝它蕴涵着高贵的情愫和追求孤独是一场燃烧它灿烂的火光给人温'; |
|||
//通过循环获取20组虚拟提现的数据 |
|||
$string = preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY); |
|||
$list = []; |
|||
for ($i = 0; $i < 10; $i++) { |
|||
shuffle($string); |
|||
$list[$i]['nickname'] = $string[0] .$string[1] .$string[2] .$string[3].$string[4]; |
|||
$list[$i]['title'] = $prizeList[array_rand($prizeList)]['title']; |
|||
} |
|||
} |
|||
//循环处理用户昵称 |
|||
foreach($list as &$prizeInfo){ |
|||
$nicknameArr = preg_split('//u', $prizeInfo['nickname'], -1, PREG_SPLIT_NO_EMPTY); |
|||
$prizeInfo['nickname'] = $nicknameArr[0].'***'.$nicknameArr[count($nicknameArr) - 1]; |
|||
} |
|||
|
|||
return $list; |
|||
} |
|||
/** |
|||
* Comment: 获取好友助力信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/17 15:49 |
|||
* @param int $type |
|||
* @return array |
|||
*/ |
|||
public static function getHelpList($type = 1,$drawid){ |
|||
global $_W,$_GPC; |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND mid = {$_W['mid']} AND type = {$type} AND activity_id = {$drawid} "; |
|||
//助力好友总数获取 |
|||
$data['total_friends'] = count(pdo_fetchall("SELECT count(*) FROM" .tablename(PDO_NAME."draw_help").$where." GROUP BY click_mid")); |
|||
//助力获取积分总数 |
|||
$data['total_integral'] = pdo_fetchcolumn("SELECT sum(integral) as integral FROM" .tablename(PDO_NAME."draw_help").$where); |
|||
//列表信息获取 |
|||
$sql = "SELECT b.nickname,b.avatar,SUM(integral) as total_integral FROM ".tablename(PDO_NAME."draw_help") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id WHERE a.activity_id = {$drawid} AND a.type = {$type} AND a.uniacid = {$_W['uniacid']}" |
|||
." GROUP BY a.mid ORDER BY total_integral DESC,a.create_time ASC LIMIT 10"; |
|||
$list = pdo_fetchall($sql); |
|||
$data['list'] = $list ? : []; |
|||
|
|||
return $data; |
|||
} |
|||
/** |
|||
* Comment: 抽奖操作 通过递归进行抽奖 直到抽中未知 |
|||
* Author: zzw |
|||
* Date: 2020/9/18 9:15 |
|||
* @param $prize |
|||
* @return mixed |
|||
*/ |
|||
public static function drawOperation($prize,$id){ |
|||
global $_W; |
|||
//概率数组的总概率精度 循环抽取奖品 |
|||
$proArr = array_column($prize, 'probability'); |
|||
$proSum = array_sum($proArr); |
|||
foreach ($proArr as $key => $proCur) { |
|||
$randNum = mt_rand(1, $proSum); |
|||
if($proCur > 0){ |
|||
if ($randNum <= $proCur) { |
|||
$info = $prize[$key]; |
|||
break; |
|||
} else { |
|||
$proSum -= $proCur; |
|||
} |
|||
} |
|||
} |
|||
|
|||
//处理奖品信息 |
|||
if($info['draw_goods_id'] > 0){ |
|||
$field = "a.id,a.probability,a.serial_number,b.type,b.sid,b.title,b.image,b.day_number,b.total_number,b.status,b.code_keyword, |
|||
CASE WHEN a.draw_goods_id > 0 AND b.id > 0 THEN a.draw_goods_id |
|||
ELSE 0 |
|||
END as draw_goods_id,b.goods_id,b.get_type,b.prize_number,b.day_prize,b.total_prize"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."draw_join") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."draw_goods") |
|||
." as b ON a.draw_goods_id = b.id " |
|||
." WHERE a.draw_goods_id = {$info['draw_goods_id']} AND a.draw_id = {$id} "; |
|||
$goods = pdo_fetch($sql); |
|||
$info = array_merge($info,$goods); |
|||
//判断是否抽中 |
|||
$startTime = strtotime(date("Y-m-d",time())." 00:00:00"); |
|||
$endTime = strtotime(date("Y-m-d",time())." 23:59:59"); |
|||
//判断今日该商品中奖次数是否到达限制 |
|||
if($info['day_prize'] > 0){ |
|||
$dayTotal = pdo_count(PDO_NAME . "draw_record" , [ |
|||
'mid' => $_W['mid'] , |
|||
'draw_id' => $id , |
|||
'draw_goods_id' => $info['draw_goods_id'] , |
|||
'create_time >=' => $startTime , |
|||
'create_time <=' => $endTime , |
|||
]); |
|||
if($info['day_prize'] <= $dayTotal) return self::returnNotPrize($prize); |
|||
} |
|||
//判断该商品总中奖次数是否到达限制 |
|||
if($info['total_prize'] > 0){ |
|||
$totalTotal = pdo_count(PDO_NAME . "draw_record" , [ |
|||
'mid' => $_W['mid'] , |
|||
'draw_id' => $id , |
|||
'draw_goods_id' => $info['draw_goods_id'] , |
|||
]); |
|||
if($info['total_prize'] <= $totalTotal) return self::returnNotPrize($prize); |
|||
} |
|||
//判断奖品是否启用 状态:1=开启,2=关闭 |
|||
if($info['status'] == 2) return self::returnNotPrize($prize); |
|||
//判断奖品当日份数是否已经抽取完毕 |
|||
if($info['day_number'] > 0){ |
|||
$dayTotalSql = "SELECT count(*) FROM ".tablename(PDO_NAME."draw_record") |
|||
." WHERE draw_goods_id = {$info['draw_goods_id']} " |
|||
." AND create_time >= {$startTime} AND create_time <= {$endTime} "; |
|||
$dayTotal = pdo_fetchcolumn($dayTotalSql); |
|||
//今日份数已抽取完毕 改为谢谢参与 |
|||
if($dayTotal >= $info['day_number']) return self::returnNotPrize($prize); |
|||
} |
|||
//判断奖品总份数是否已经抽取完毕 |
|||
if($info['total_number'] > 0){ |
|||
$totalSql = "SELECT count(*) FROM ".tablename(PDO_NAME."draw_record") |
|||
." WHERE draw_goods_id = {$info['draw_goods_id']}"; |
|||
$total = pdo_fetchcolumn($totalSql); |
|||
if($total >= $info['total_number']) return self::returnNotPrize($prize); |
|||
} |
|||
//商品为激活码 判断激活码序列是否已经全部送出 |
|||
if($info['type'] == 4){ |
|||
$codeWhere = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'status' => 0 , |
|||
'remark' => $info['code_keyword'] , |
|||
]; |
|||
$codeSurplus = pdo_count(PDO_NAME."token",$codeWhere); |
|||
if($codeSurplus <= 0) return self::returnNotPrize($prize); |
|||
} |
|||
} |
|||
|
|||
return $info; |
|||
} |
|||
/** |
|||
* Comment: 随机返回一个未中奖信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/19 18:31 |
|||
* @param $prize |
|||
* @return mixed |
|||
*/ |
|||
public static function returnNotPrize($prize){ |
|||
//循环获取谢谢参与信息 |
|||
$errorArr = []; |
|||
foreach($prize as $vo){ |
|||
if($vo['draw_goods_id'] == 0){ |
|||
$errorArr[] = $vo; |
|||
} |
|||
} |
|||
//随机获取一个谢谢参与返回 |
|||
return count($errorArr) > 0 ? $errorArr[array_rand($errorArr)] : []; |
|||
} |
|||
/** |
|||
* Comment: 抽中后奖品的处理 |
|||
* Author: zzw |
|||
* Date: 2020/9/21 15:12 |
|||
* @param $info |
|||
* @throws Exception |
|||
*/ |
|||
public static function prizeProcessing($info){ |
|||
global $_W; |
|||
//根据抽奖结果进行对应的操作 |
|||
if($info['draw_goods_id'] == 0){ |
|||
self::changeIsGetStatus($info['draw_record_id']); |
|||
}else{ |
|||
//抽中奖品 根据奖品类型进行对应的处理操作 奖品类型:1=现金红包,2=线上红包,3=积分,4=激活码,5=商品 |
|||
switch (intval($info['type'])){ |
|||
case 1: |
|||
//判断领取方式 领取方式:1=发送现金红包,2=增加到余额 |
|||
if($info['get_type'] == 1){ |
|||
//订单号生成 |
|||
if(!$info['order_no']){ |
|||
$info['order_no'] = 'DRAW'.date("YmdHis").random(10,true);//订单号生成 |
|||
pdo_update(PDO_NAME."draw_record" , ['order_no' => $info['order_no']] , ['id' => $info['draw_record_id']]); |
|||
} |
|||
//发送现金红包 |
|||
Payment::cashRedPack($info); |
|||
self::changeIsGetStatus($info['draw_record_id']); |
|||
}else{ |
|||
//增加到余额 |
|||
$remark = "活动【{$info['draw_title']}】奖品【{$info['title']}】"; |
|||
if (Member::credit_update_credit2($_W['mid'] , $info['prize_number'] , $remark)) self::changeIsGetStatus($info['draw_record_id']); |
|||
} |
|||
break;//现金红包 |
|||
case 2: |
|||
//线上红包领取 |
|||
$res = Redpack::pack_send($_W['mid'] , $info['goods_id'] , 'draw' , $info['source']); |
|||
if ($res['errno'] == 1) throw new Exception($res['message']); |
|||
else self::changeIsGetStatus($info['draw_record_id']); |
|||
break;//线上红包 |
|||
case 3: |
|||
$remark = "活动【{$info['draw_title']}】奖品【{$info['title']}】"; |
|||
if (Member::credit_update_credit1($_W['mid'] , $info['prize_number'] , $remark)) self::changeIsGetStatus($info['draw_record_id']); |
|||
break;//积分 |
|||
case 4: |
|||
//获取一个激活码 |
|||
$codeInfo = Halfcard::getActivationCode($info['code_keyword']); |
|||
if(!array_key_exists('errno',$codeInfo)){ |
|||
//记录激活码信息 |
|||
$params = [ |
|||
'token_id' => $codeInfo['id'] , |
|||
'is_get' => 2 ,//修改状态为已领取 但是激活码未使用 |
|||
]; |
|||
pdo_update(PDO_NAME."draw_record" , $params , ['id' => $info['draw_record_id']]); |
|||
}else{ |
|||
pdo_update(PDO_NAME."draw_record" , [ |
|||
'draw_goods_id' => 0 , //修改状态为 未中奖 |
|||
'is_get' => 2 ,//修改状态为已领取 |
|||
] , ['id' => $info['draw_record_id']]); |
|||
throw new Exception("手慢一步,激活码已被抽取完毕,请刷新重试!"); |
|||
} |
|||
break;//激活码 |
|||
case 5:break;//商品 |
|||
} |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 记录抽奖信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/21 9:49 |
|||
* @param $info |
|||
* @param int $isGet |
|||
* @return mixed |
|||
* @throws Exception |
|||
*/ |
|||
public static function drawResRecord($info,$isGet = 1){ |
|||
global $_W,$_GPC; |
|||
//参数信息生成 |
|||
$data = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'mid' => $_W['mid'] , |
|||
'draw_id' => $info['draw_id'] , |
|||
'draw_goods_id' => $info['draw_goods_id'] , |
|||
'create_time' => time() , |
|||
'is_get' => $isGet ,//是否领取奖品:1=未领取,2=已领取 |
|||
'is_free' => $info['is_free'],//当前抽奖是否为免费抽奖:1=免费,2=使用积分抽奖 |
|||
]; |
|||
//记录抽奖信息 |
|||
$res = pdo_insert(PDO_NAME."draw_record",$data); |
|||
if($res) return pdo_insertid(); |
|||
else throw new Exception('抽奖信息错误!'); |
|||
} |
|||
/** |
|||
* Comment: 修改抽奖 - 奖品领奖记录为已领取 |
|||
* Author: zzw |
|||
* Date: 2020/9/21 13:55 |
|||
* @param $id |
|||
*/ |
|||
public static function changeIsGetStatus($id){ |
|||
//修改领取状态为已领取 |
|||
pdo_update(PDO_NAME."draw_record" , ['is_get' => 2] , ['id' => $id]); |
|||
} |
|||
/** |
|||
* Comment: 获取抽奖统计信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/22 11:34 |
|||
* @return mixed |
|||
*/ |
|||
public static function getStatistics(){ |
|||
global $_W; |
|||
//基本参数信息 |
|||
$monthStart = strtotime(date("Y-m-1 00:00:00"));//当前月开始时间 |
|||
$monthEnd = strtotime("+1 month ",strtotime(date("Y-m-1 00:00:00")));//下月开始时间 |
|||
$dayStart = strtotime(date("Y-m-d 00:00:00"));//当天开始时间 |
|||
$dayEnd = strtotime("+1 day ",strtotime(date("Y-m-d 00:00:00")));//明天开始时间 |
|||
//总抽奖次数 |
|||
$data['total_draw'] = self::selectCount(); |
|||
//总中奖次数 |
|||
$data['total_prize'] = self::selectCount(['draw_goods_id >' => 0]); |
|||
//当前月总抽奖次数 |
|||
$data['month_total_draw'] = self::selectCount(['create_time >' => $monthStart , 'create_time <' => $monthEnd]); |
|||
//当前月总中奖次数 |
|||
$data['month_total_prize'] = self::selectCount(['draw_goods_id >' => 0,'create_time >' => $monthStart ,'create_time <' => $monthEnd]); |
|||
//当天总抽奖次数 |
|||
$data['day_total_draw'] = self::selectCount(['create_time >' => $dayStart , 'create_time <' => $dayEnd]); |
|||
//当天总中奖次数 |
|||
$data['day_total_prize'] = self::selectCount(['draw_goods_id >' => 0,'create_time >' => $dayStart ,'create_time <' => $dayEnd]); |
|||
|
|||
return $data; |
|||
} |
|||
/** |
|||
* Comment: 根据条件获取抽奖记录信息总数 |
|||
* Author: zzw |
|||
* Date: 2020/9/22 11:28 |
|||
* @param array $where |
|||
* @return int |
|||
*/ |
|||
public static function selectCount($where = []){ |
|||
global $_W; |
|||
//基本条件生成 |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
//统计总数获取 |
|||
return pdo_count(PDO_NAME."draw_record",$where); |
|||
} |
|||
/** |
|||
* Comment: 导出中奖信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/23 10:37 |
|||
* @param $sql |
|||
*/ |
|||
public static function exportInfoList($sql){ |
|||
//信息列表获取 |
|||
$list = pdo_fetchall($sql." LIMIT 20000"); |
|||
//循环处理内容 并且删除多余的内容 |
|||
foreach($list as &$item){ |
|||
//图片信息处理 |
|||
// $item['avatar'] = tomedia($item['avatar']); |
|||
// $item['image'] = tomedia($item['image']); |
|||
//时间处理 |
|||
$item['create_time'] = date("Y-m-d H:i:s",$item['create_time']); |
|||
//判断是否中 未中奖则将奖品标题修改为未中奖、奖品图片修改为空 |
|||
if($item['draw_goods_id'] <= 0){ |
|||
$item['title'] = '未中奖'; |
|||
$item['image'] = ''; |
|||
} |
|||
//判断是否已经领取 |
|||
if ($item['is_get'] == 1) $item['is_get'] = '未领取'; |
|||
else $item['is_get'] = '已领取'; |
|||
//删除多余的信息内容 |
|||
unset($item['id'],$item['draw_goods_id'],$item['avatar'],$item['image']); |
|||
} |
|||
|
|||
//标题列表数组 |
|||
$title = [ |
|||
'draw_title' => '活动名称' , |
|||
'nickname' => '用户昵称' , |
|||
//'avatar' => '用户头像' , |
|||
'create_time' => '抽奖时间' , |
|||
'title' => '奖品标题' , |
|||
//'image' => '奖品图片' , |
|||
'is_get' => '是否领取' , |
|||
]; |
|||
//导出信息 |
|||
util_csv::export_csv_2($list, $title, '抽奖记录信息.csv'); |
|||
exit(); |
|||
} |
|||
/** |
|||
* Comment: 导出参与抽奖用户信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/19 16:36 |
|||
* @param $sql |
|||
*/ |
|||
public static function exportUserList($sql){ |
|||
//信息列表获取 |
|||
$list = pdo_fetchall($sql." LIMIT 20000"); |
|||
//循环处理内容 并且删除多余的内容 |
|||
foreach($list as &$value){ |
|||
ksort($value); |
|||
//获取中奖次数 |
|||
$value['total_prize'] = Draw::selectCount(['mid'=>$value['mid'],'draw_goods_id >' => 0]); |
|||
//获取用户积分、余额 |
|||
$credit = pdo_get('mc_members' , ['uid' => $value['uid']] , ['credit1' , 'credit2']); |
|||
$value['credit1'] = $credit['credit1']; |
|||
$value['credit2'] = $credit['credit2']; |
|||
//删除多余信息 |
|||
unset($value['avatar']); |
|||
unset($value['mid']); |
|||
unset($value['uid']); |
|||
} |
|||
//标题列表数组 |
|||
$title = [ |
|||
'mobile' => '手机号' , |
|||
'nickname' => '用户昵称' , |
|||
'total_draw' => '抽奖次数' , |
|||
'total_prize' => '中奖次数' , |
|||
'credit1' => '积分' , |
|||
'credit2' => '余额' , |
|||
]; |
|||
//导出信息 |
|||
util_csv::export_csv_2($list, $title, '抽奖记录信息.csv'); |
|||
exit(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[幸运抽奖]]></name> |
|||
<identifie><![CDATA[draw]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[expand]]></type> |
|||
<description><![CDATA[幸运抽奖]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="活动管理" font="fa-inbox"> |
|||
<entry title="活动管理" ac="draw" do="index" actions='["do",["index","add","edit"]]' iscover="true" /> |
|||
<entry title="奖品管理" ac="goods" do="goodsIndex" actions='["do",["goodsIndex","goodsAdd","goodsEdit"]]'/> |
|||
</menu> |
|||
<menu title="中奖管理" font="fa-inbox"> |
|||
<entry title="中奖管理" ac="prize" do="prizeIndex" actions='["do",["prizeIndex"]]' /> |
|||
<entry title="用户管理" ac="user" do="userIndex" actions='["do",["userIndex"]]'/> |
|||
</menu> |
|||
<menu title="基本设置" font="fa-inbox"> |
|||
<entry title="基本设置" ac="draw" do="set" actions='["do",["set"]]'/> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="活动管理" font="fa-inbox"> |
|||
<entry title="活动管理" ac="draw" do="index" actions='["do",["index","add","edit"]]' iscover="true" /> |
|||
<entry title="奖品管理" ac="goods" do="goodsIndex" actions='["do",["goodsIndex","goodsAdd","goodsEdit"]]'/> |
|||
</menu> |
|||
<menu title="中奖管理" font="fa-inbox"> |
|||
<entry title="中奖管理" ac="prize" do="prizeIndex" actions='["do",["prizeIndex"]]' /> |
|||
<entry title="用户管理" ac="user" do="userIndex" actions='["do",["userIndex"]]'/> |
|||
</menu> |
|||
<menu title="基本设置" font="fa-inbox"> |
|||
<entry title="基本设置" ac="draw" do="set" actions='["do",["set"]]'/> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,376 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class DrawModuleUniapp extends Uniapp { |
|||
|
|||
public function __construct(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$drawId = $_GPC['draw_id'] ? : 0; |
|||
$head_id = $_GPC['head_id'] ? : 0; |
|||
//操作分享信息 记录分享信息 |
|||
if ($drawId > 0 && $head_id > 0 && $_W['mid'] > 0 && $_W['mid'] != $head_id) $this->recordHelpInfo($drawId , $head_id); |
|||
|
|||
} |
|||
/** |
|||
* Comment: 获取抽奖页面基本信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/17 17:07 |
|||
*/ |
|||
public function home(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR $this->renderError('不存在的抽奖活动!'); |
|||
//增加浏览信息 |
|||
pdo_query("update ".tablename(PDO_NAME.'draw')." set pv=pv+1 where id = {$id}"); |
|||
//活动相关基本信息获取 |
|||
list($info,$prize,$shop) = Draw::getDrawDetailedInfo($id); |
|||
$info['user_integral'] = $_W['wlmember']['credit1'];//用户当前积分 |
|||
$info['rule'] = htmlspecialchars_decode($info['rule']); |
|||
$info['introduce'] = htmlspecialchars_decode($info['introduce']); |
|||
$info['wheel_bg'] = unserialize($info['wheel_bg']); |
|||
//获取当前活动抽奖记录信息 |
|||
$record = Draw::getDrawRecord($id,$info['fictitious_prize'],$prize); |
|||
//获取好友助力信息 需要用户登录 |
|||
$help = []; |
|||
if($_W['mid'] > 0) $help = Draw::getHelpList(1,$id); |
|||
//删除多余的参数信息 |
|||
unset($info['id'] , $info['uniacid'] , $info['aid'] , $info['integral_give'] , $info['create_time'] , $info['total_join_times'] , $info['total_draw_times'] , $info['day_join_times'] , $info['day_draw_times'] , $info['fictitious_visit'] , $info['fictitious_prize'], $info['actual_visit'] , $info['actual_prize']); |
|||
foreach($prize as &$del){ |
|||
unset($del['id'],$del['type'],$del['sid'],$del['day_number'],$del['total_number'],$del['status']); |
|||
} |
|||
//获取装修菜单配置信息 |
|||
if($info['menu_id'] > 0 && p('diypage')) $menu = Diy::getMenu($info['menu_id']); |
|||
else $menu = DiyMenu::defaultBottomMenu(); |
|||
//信息拼装 并且输出 |
|||
$data = [ |
|||
'info' => $info ,//活动信息 |
|||
'prize' => $prize ,//奖品信息列表 |
|||
'shop' => $shop ,//商户信息列表 |
|||
'record' => $record ,//中奖记录信息列表 |
|||
'help' => $help ,//助力信息列表 |
|||
'menu' => $menu ,//底部菜单信息 |
|||
]; |
|||
|
|||
$this->renderSuccess('抽奖页面基本信息',$data); |
|||
} |
|||
/** |
|||
* Comment: 抽奖操作 |
|||
* Author: zzw |
|||
* Date: 2020/9/21 15:25 |
|||
*/ |
|||
public function draw(){ |
|||
global $_W,$_GPC; |
|||
//获取基本参数信息 |
|||
$id = $_GPC['id'] OR $this->renderError("参数错误,不存在的抽奖活动!"); |
|||
//获取活动信息、奖品信息、商户信息 |
|||
list($info,$prize,$shop) = Draw::getDrawDetailedInfo($id); |
|||
if($info['surplus_total_parin_times'] < 1 && $info['total_parin_times'] > 0){ |
|||
$this->renderError("您在此活动抽奖次数已用完"); |
|||
} |
|||
if($info['surplus_day_parin_times'] < 1 && $info['day_parin_times'] > 0){ |
|||
$this->renderError("您今天在此活动抽奖次数已用完,请明天再来"); |
|||
} |
|||
//状态判断 状态:1=未开启,2=使用中,【3=未开始,4=已过期】 |
|||
if($info['status'] == 1) $this->renderError('抽奖已关闭!'); |
|||
if($info['status'] == 3) $this->renderError('抽奖暂未开始!'); |
|||
if($info['status'] == 4) $this->renderError('活动时间已过!'); |
|||
//判断绑定手机号 |
|||
$mastmobile = unserialize($_W['wlsetting']['userset']['plugin']); |
|||
if (empty($_W['wlmember']['mobile']) && in_array('draw',$mastmobile)){ |
|||
$this->renderError('未绑定手机号'); |
|||
} |
|||
//判断是否存在免费抽奖次数 不存在则扣除对应的积分 |
|||
$isFree = 1;//当前抽奖是否为免费抽奖:1=免费,2=使用积分抽奖 |
|||
if (($info['surplus_total_join_times'] <= 0 || $info['surplus_day_join_times'] <= 0 ) && $info['integral_consume'] > 0) { |
|||
$isFree = 2; |
|||
$trade = Setting::wlsetting_read('trade'); |
|||
$text = $trade['credittext'] ? : '积分'; |
|||
//判断积分是否充足 |
|||
if($_W['wlmember']['credit1'] >= $info['integral_consume']) Member::credit_update_credit1($_W['mid'] , -$info['integral_consume'] , "抽奖【{$info['integral_consume']}】消耗{$text}}"); |
|||
else $this->renderError("{$text}不足!"); |
|||
}; |
|||
//判断是否可以中奖 |
|||
if($info['surplus_total_draw_times'] <= 0 && $info['total_draw_times'] > 0) $this->drawError($prize,$id,$isFree);//总中奖次数是否为0 |
|||
if($info['surplus_day_draw_times'] <= 0 && $info['day_draw_times'] > 0) $this->drawError($prize,$id,$isFree);//当天中奖次数是否为0 |
|||
//获取抽奖信息 |
|||
$drawRes = Draw::drawOperation($prize,$id); |
|||
try{ |
|||
if(!$drawRes) $this->renderError('非法请求,请联系管理员!'); |
|||
//其他信息获取 |
|||
$drawRes['draw_id'] = $id;//活动id |
|||
$drawRes['draw_title'] = $info['title'];//活动标题 |
|||
$drawRes['source'] = $_GPC['source'] ? : 1;//渠道信息:1=公众号(默认);2=h5;3=小程序 |
|||
$drawRes['is_free'] = $isFree; |
|||
//生成奖品领取信息 |
|||
$id = Draw::drawResRecord($drawRes); |
|||
$drawRes['draw_record_id'] = $id; |
|||
//奖品信息处理 |
|||
Draw::prizeProcessing($drawRes); |
|||
//给用户发送中奖模板消息 |
|||
if($drawRes['draw_goods_id'] > 0) { |
|||
$modelData = [ |
|||
'first' => '恭喜您,中奖了!' , |
|||
'type' => '抽奖结果' ,//业务类型 |
|||
'content' => "恭喜您,在抽奖活动【{$drawRes['draw_title']}】中抽中了奖品:{$drawRes['title']}" ,//业务内容 |
|||
'status' => '已中奖' ,//处理结果 |
|||
'time' => date("Y-m-d H:i:s" , time()) ,//操作时间 |
|||
'remark' => '' |
|||
]; |
|||
$link = h5_url('pages/subPages2/drawGame/myPrize'); |
|||
TempModel::sendInit('service' , $_W['mid'] , $modelData , $_W['source'] , $link); |
|||
} |
|||
//给商户发送用户中奖模板消息 |
|||
if($drawRes['sid'] > 0){ |
|||
$member = $_W['wlmember']; |
|||
$first = "中奖信息通知";//消息头部 |
|||
$type = "中奖信息";//业务类型 |
|||
$content = "用户【{$member['nickname']}】在抽奖活动【{$drawRes['draw_title']}】中抽中了奖品:{$drawRes['title']}";//业务内容 |
|||
$status = "已中奖";//处理结果 |
|||
$time = time();//操作时间 |
|||
News::noticeShopAdmin( $drawRes['sid'], $first , $type , $content , $status , '' , $time); |
|||
} |
|||
//返回抽奖结果 |
|||
$this->renderSuccess('抽奖结果',['serial_number' => $drawRes['serial_number']]); |
|||
}catch (Exception $e){ |
|||
$errorArr = [ |
|||
'data' => $drawRes , |
|||
'error' => $e->getMessage() |
|||
]; |
|||
Util::wl_log('getDraw', PATH_PLUGIN . "draw/",$errorArr,'抽奖错误信息'); //写入日志记录 |
|||
|
|||
$this->renderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 获取抽奖时报错信息 |
|||
* Describe:当用户当前抽奖必须为谢谢参与时返回信息使用,如果奖品列表中没有谢谢参与则进行错误抛出 |
|||
* Author: zzw |
|||
* Date: 2020/9/17 17:49 |
|||
* @param $prize |
|||
* @param $id |
|||
* @throws Exception |
|||
*/ |
|||
protected function drawError($prize,$id,$isFree){ |
|||
//随机获取一个谢谢参与 |
|||
$info = Draw::returnNotPrize($prize); |
|||
if($info){ |
|||
//记录抽奖信息 |
|||
$info['draw_id'] = $id; |
|||
$info['is_free'] = $isFree; |
|||
Draw::drawResRecord($info,2); |
|||
|
|||
$this->renderSuccess('抽奖结果',['serial_number' => $info['serial_number']]); |
|||
} |
|||
//当奖品列表不存在【谢谢参与】奖品时 强制错误抛出 |
|||
$this->renderError('非法请求,请联系管理员!'); |
|||
} |
|||
/** |
|||
* Comment: 我的奖品列表 |
|||
* Author: zzw |
|||
* Date: 2020/9/21 16:03 |
|||
*/ |
|||
public function prizeList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = $_GPC['page_index'] ? : 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
//条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} AND a.mid = {$_W['mid']} AND a.draw_goods_id > 0 "; |
|||
$order = " ORDER BY a.create_time DESC"; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$field = "a.id,a.create_time,a.is_get,a.token_id,b.title,b.image,b.goods_id,b.type,b.goods_plugin"; |
|||
//sql语句生成 |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."draw_record") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."draw_goods") |
|||
." as b ON a.draw_goods_id = b.id "; |
|||
//列表信息获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach ($list as $key => &$val) { |
|||
//基本信息处理 |
|||
$val['image'] = tomedia($val['image']); |
|||
$val['create_time'] = date("Y-m-d H:i:s", $val['create_time']); |
|||
//状态信息处理 is_get:1=未领取,2=已领取,3=未使用(激活码状态),4=已使用(激活码状态) |
|||
if ($val['type'] == 4) { |
|||
$token = pdo_get(PDO_NAME . "token" , ['id' => $val['token_id']] , ['status','number']); |
|||
$val['token_code'] = $token['number']; |
|||
if ($token['status'] == 1) $val['is_get'] = 4; |
|||
else if ($token['status'] == 2) $val['is_get'] = 3; |
|||
} |
|||
//获取订单信息 |
|||
if($val['type'] == 5 && $val['is_get'] == 2){ |
|||
if($val['goods_plugin'] == 'rush'){ |
|||
$val['order_id'] = pdo_getcolumn(PDO_NAME."rush_order",['drawid'=>$val['id']],'id'); |
|||
}else{ |
|||
$val['order_id'] = pdo_getcolumn(PDO_NAME."order",['drawid'=>$val['id']],'id'); |
|||
} |
|||
} |
|||
//删除多余内容 |
|||
unset($val['token_id']); |
|||
} |
|||
//总数信息获取 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
//信息拼装并且输出 |
|||
$set = Setting::agentsetting_read('draw_set'); |
|||
$data = [ |
|||
'color' => $set['prize_color'] ? : '', |
|||
'top' => $set['top'] ? tomedia($set['top']) : '', |
|||
'url' => $set['top_link'], |
|||
'total' => ceil($total / $pageIndex), |
|||
'list' => $list ? : [], |
|||
]; |
|||
|
|||
$this->renderSuccess('我的奖品列表',$data); |
|||
} |
|||
/** |
|||
* Comment: 领取奖品 |
|||
* Author: zzw |
|||
* Date: 2020/9/21 17:37 |
|||
*/ |
|||
public function getPrize(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR $this->renderError("不存在的中奖信息!"); |
|||
//获取基本信息 |
|||
$field = "a.is_get,a.draw_id,a.order_no,a.token_id,b.type,b.goods_id,b.goods_plugin,b.sid,b.get_type,b.prize_number, |
|||
b.code_keyword,b.type,b.type,b.type,b.type,b.type,b.type,b.type,b.title"; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."draw_record") |
|||
." AS a RIGHT JOIN ".tablename(PDO_NAME."draw_goods") |
|||
." AS b ON a.draw_goods_id = b.id WHERE a.id = {$id} AND mid = {$_W['mid']}" ; |
|||
$info = pdo_fetch($sql); |
|||
//判断是否已经领取 是否领取奖品:1=未领取,2=已领取 |
|||
if($info['is_get'] == 2) $this->renderError("已领取奖品,请勿重复领取!"); |
|||
//根据奖品类型,进行对应的领取操作 奖品类型:1=现金红包,2=线上红包,3=积分,4=激活码,5=商品 |
|||
//其他信息获取 |
|||
$info['draw_title'] = pdo_getcolumn(PDO_NAME."draw",['id'=>$info['draw_id']],'title');//活动标题 |
|||
$info['source'] = $_GPC['source'] ? : 1;//渠道信息:1=公众号(默认);2=h5;3=小程序 |
|||
$info['draw_record_id'] = $id; |
|||
//生成奖品领取信息 |
|||
try { |
|||
switch (intval($info['type'])) { |
|||
case 1: |
|||
//判断领取方式 领取方式:1=发送现金红包,2=增加到余额 |
|||
if ($info['get_type'] == 1) { |
|||
//订单号生成 |
|||
if (!$info['order_no']) { |
|||
$info['order_no'] = 'DRAW' . date("YmdHis") . random(10 , true);//订单号生成 |
|||
pdo_update(PDO_NAME . "draw_record" , ['order_no' => $info['order_no']] , ['id' => $id]); |
|||
} |
|||
//发送现金红包 |
|||
Payment::cashRedPack($info); |
|||
Draw::changeIsGetStatus($id); |
|||
$this->renderSuccess("领取成功"); |
|||
}else { |
|||
//增加到余额 |
|||
$remark = "活动【{$info['draw_title']}】奖品【{$info['title']}】"; |
|||
if (Member::credit_update_credit2($_W['mid'] , $info['prize_number'] , $remark)) { |
|||
Draw::changeIsGetStatus($id); |
|||
$this->renderSuccess("领取成功"); |
|||
} |
|||
} |
|||
break;//现金红包 |
|||
case 2: |
|||
//线上红包领取 |
|||
$res = Redpack::pack_send($_W['mid'] , $info['goods_id'] , 'draw' , $info['source']); |
|||
if ($res['errno'] == 1) { |
|||
throw new Exception($res['message']); |
|||
}else { |
|||
Draw::changeIsGetStatus($id); |
|||
$this->renderSuccess("领取成功"); |
|||
} |
|||
break;//线上红包 |
|||
case 3: |
|||
$remark = "活动【{$info['draw_title']}】奖品【{$info['title']}】"; |
|||
if (Member::credit_update_credit1($_W['mid'] , $info['prize_number'] , $remark)) { |
|||
Draw::changeIsGetStatus($id); |
|||
$this->renderSuccess("领取成功"); |
|||
} |
|||
break;//积分 |
|||
case 4: |
|||
//判断是否已经领取过激活码 |
|||
if ($info['token_id']) { |
|||
$code = pdo_getcolumn(PDO_NAME."token",['id'=>$info['token_id']],'number'); |
|||
|
|||
$this->renderSuccess("领取成功",['code'=>$code]); |
|||
}else { |
|||
//获取一个激活码 |
|||
$codeInfo = Halfcard::getActivationCode($info['code_keyword']); |
|||
if ($codeInfo['errno'] == 1) { |
|||
//记录激活码信息 |
|||
$params = [ |
|||
'token_id' => $codeInfo['id'] , |
|||
'is_get' => 2 ,//修改状态为已领取 但是激活码未使用 |
|||
]; |
|||
pdo_update(PDO_NAME . "draw_record" , $params , ['id' => $id]); |
|||
|
|||
$this->renderSuccess("领取成功",['code'=>$codeInfo['number']]); |
|||
}else { |
|||
throw new Exception($codeInfo['message']); |
|||
} |
|||
} |
|||
break;//激活码 |
|||
case 5: |
|||
//$info['goods_plugin'] 商品类型,英文 |
|||
//$info['goods_id'] 商品id |
|||
break;//商品 |
|||
} |
|||
}catch (Exception $e){ |
|||
$this->renderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 记录好友助力信息 并且获取对应的积分信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/24 9:38 |
|||
* @param $drawId |
|||
* @param $head_id |
|||
*/ |
|||
protected function recordHelpInfo($drawId,$head_id){ |
|||
global $_W,$_GPC; |
|||
//判断是否已经存在助力信息 |
|||
$where = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'type' => 1 , |
|||
'activity_id' => $drawId , |
|||
'mid' => $head_id , |
|||
'click_mid' => $_W['mid'] , |
|||
]; |
|||
$isHave = pdo_get(PDO_NAME."draw_help",$where); |
|||
if(!$isHave && $_W['mid'] != $head_id){ |
|||
//获取活动信息 |
|||
$integral = pdo_getcolumn(PDO_NAME."draw",['id'=>$drawId],'integral_give'); |
|||
if($integral > 0){ |
|||
$res = Member::credit_update_credit1($head_id , $integral , "好友助力获取"); |
|||
if(!is_error($res)){ |
|||
$data = array_merge($where,[ |
|||
'create_time' => time(), |
|||
'integral' => $integral, |
|||
]); |
|||
pdo_insert(PDO_NAME."draw_help",$data); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 获取分享页面基本设置信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/27 14:56 |
|||
*/ |
|||
public function shareSetInfo(){ |
|||
global $_W,$_GPC; |
|||
//设置信息获取 |
|||
$set = Setting::agentsetting_read('draw_set'); |
|||
//信息获取 |
|||
$data = [ |
|||
'image' => $set['share_top'] ? tomedia($set['share_top']) : '', |
|||
'color' => $set['bg_color'], |
|||
'url' => $set['share_top_link'], |
|||
]; |
|||
|
|||
$this->renderSuccess("分享页面基本设置",$data); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,241 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
/** |
|||
* Comment: 抽奖活动管理 |
|||
* Author: zzw |
|||
* Class Draw_WeliamController |
|||
*/ |
|||
class Draw_WeliamController { |
|||
/** |
|||
* Comment: 获取抽奖活动信息列表 |
|||
* Author: zzw |
|||
* Date: 2020/9/16 16:27 |
|||
*/ |
|||
public function index(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$title = $_GPC['title'] ? : '';//活动名称 |
|||
$type = intval($_GPC['type']) ? : 0;//活动类型:1=9宫格,2=16宫格 |
|||
$status = intval($_GPC['status']) ? : 0;//状态:1=未开启,2=使用中 |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if($title) $where .= " AND title LIKE '%{$title}%' "; |
|||
if($type > 0) $where .= " AND type = {$type} "; |
|||
if($status > 0) $where .= " AND status = {$status} "; |
|||
//sql语句生成 |
|||
$field = "id,title,type,status,create_time,start_time,end_time"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."draw"); |
|||
$order = " ORDER BY create_time DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
//列表信息获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
//时间信息处理 |
|||
$val['create_time'] = date("Y-m-d H:i:s" , $val['create_time']); |
|||
$val['start_time'] = date("Y-m-d H:i:s" , $val['start_time']); |
|||
$val['end_time'] = date("Y-m-d H:i:s" , $val['end_time']); |
|||
//获取奖品数量 |
|||
$val['prize'] = pdo_count(PDO_NAME."draw_join",['draw_id'=>$val['id'],'draw_goods_id >'=>0]); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('draw/index'); |
|||
} |
|||
/** |
|||
* Comment: 添加抽奖活动 |
|||
* Author: zzw |
|||
* Date: 2020/9/16 16:10 |
|||
*/ |
|||
public function add(){ |
|||
global $_W,$_GPC; |
|||
if($_W['ispost']){ |
|||
//基本参数信息获取 |
|||
$data = $_GPC['data']; |
|||
$prize = $_GPC['prize']; |
|||
$activityTime = $_GPC['activity_time']; |
|||
$mysqlFun = new MysqlFunction(); |
|||
//判断轮盘数量是否为偶数 |
|||
if($data['type'] == 3){ |
|||
if(count($prize) % 2 != 0) wl_message("轮盘数量不为偶数,请设置为偶数!" , referer() , 'error'); |
|||
$data['wheel_bg'] = serialize($data['wheel_bg']); |
|||
} |
|||
//判断抽奖概率是否合法 |
|||
$totalProbability = sprintf("%.0f",array_sum(array_column($prize,'probability'))); |
|||
if($totalProbability != sprintf("%.0f",100)) wl_message("中奖概率错误,概率之和不为100%!当前概率之和:{$totalProbability}%" , referer() , 'error'); |
|||
//判断活动是否存在 |
|||
$isHave = pdo_get(PDO_NAME."draw",['title'=>$data['title']]); |
|||
if($isHave) wl_message('已存在同名称活动!' , referer() , 'error'); |
|||
//判断限制 |
|||
if($data['total_join_times'] < $data['day_join_times']) wl_message('免费的总参加次数必须大于等于免费的每天参加次数!' , referer() , 'error'); |
|||
if($data['total_draw_times'] < $data['day_draw_times']) wl_message('总中奖次数必须大于等于每天中奖次数!' , referer() , 'error'); |
|||
if($data['total_parin_times'] < $data['day_parin_times']) wl_message('总参加次数必须大于等于每天参加次数!' , referer() , 'error'); |
|||
//生成活动信息 |
|||
$mysqlFun->startTrans(); |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['create_time'] = time(); |
|||
$data['start_time'] = strtotime($activityTime['start']); |
|||
$data['end_time'] = strtotime($activityTime['end']); |
|||
$data['share_image'] = serialize($data['share_image']); |
|||
$res = pdo_insert(PDO_NAME."draw",$data); |
|||
if($res){ |
|||
//处理奖品信息 |
|||
$drawId = pdo_insertid(); |
|||
foreach($prize as $pKey => $pVal){ |
|||
$joinData = [ |
|||
'draw_id' => $drawId ,//抽奖活动id |
|||
'draw_goods_id' => $pVal['draw_goods_id'] ? : 0 ,//奖品id |
|||
'probability' => $pVal['probability'] ,//中奖概率 |
|||
'serial_number' => $pVal['serial_number'] ,//序号(当前奖品在该活动中的顺序) |
|||
]; |
|||
$result = pdo_insert(PDO_NAME."draw_join",$joinData); |
|||
if(!$result){ |
|||
$mysqlFun->rollback(); |
|||
wl_message('添加失败,请刷新重试!' , referer() , 'error'); |
|||
} |
|||
} |
|||
|
|||
$mysqlFun->commit(); |
|||
wl_message('添加成功!' , web_url('draw/draw/index') , 'success'); |
|||
}else{ |
|||
$mysqlFun->rollback(); |
|||
wl_message('添加失败,请刷新重试!' , referer() , 'error'); |
|||
} |
|||
} |
|||
//获取自定义装修菜单信息 |
|||
if (p('diypage')) $menus = DiyMenu::getMenuList(); |
|||
|
|||
include wl_template('draw/add'); |
|||
} |
|||
/** |
|||
* Comment: 编辑抽奖活动 |
|||
* Author: zzw |
|||
* Date: 2020/9/16 17:36 |
|||
*/ |
|||
public function edit(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = intval($_GPC['id']) OR wl_message('参数错误,请刷新重试!' , referer() , 'error'); |
|||
if($_W['ispost']){ |
|||
//基本参数信息获取 |
|||
$data = $_GPC['data']; |
|||
$prize = $_GPC['prize']; |
|||
$activityTime = $_GPC['activity_time']; |
|||
$mysqlFun = new MysqlFunction(); |
|||
//判断轮盘数量是否为偶数 |
|||
if($data['type'] == 3){ |
|||
if(count($prize) % 2 != 0) wl_message("轮盘数量不为偶数,请设置为偶数!" , referer() , 'error'); |
|||
$data['wheel_bg'] = serialize($data['wheel_bg']); |
|||
} |
|||
//判断抽奖概率是否合法 |
|||
$totalProbability = sprintf("%.0f",array_sum(array_column($prize,'probability'))); |
|||
if($totalProbability != sprintf("%.0f",100)) wl_message("中奖概率错误,概率之和不为100%!当前概率之和:{$totalProbability}%" , referer() , 'error'); |
|||
//判断活动是否存在 |
|||
$isHave = pdo_get(PDO_NAME."draw",['title'=>$data['title'],'id <>'=>$id]); |
|||
if($isHave) wl_message('已存在同名称活动!' , referer() , 'error'); |
|||
//判断限制 |
|||
if($data['total_join_times'] < $data['day_join_times']) wl_message('免费的总参加次数必须大于等于免费的每天参加次数!' , referer() , 'error'); |
|||
if($data['total_draw_times'] < $data['day_draw_times']) wl_message('总中奖次数必须大于等于每天中奖次数!' , referer() , 'error'); |
|||
if($data['total_parin_times'] < $data['day_parin_times']) wl_message('总参加次数必须大于等于每天参加次数!' , referer() , 'error'); |
|||
//生成活动信息 |
|||
$mysqlFun->startTrans(); |
|||
$data['start_time'] = strtotime($activityTime['start']); |
|||
$data['end_time'] = strtotime($activityTime['end']); |
|||
$data['share_image'] = serialize($data['share_image']); |
|||
pdo_update(PDO_NAME."draw",$data,['id'=>$id]); |
|||
//删除所有的相关奖品信息 |
|||
pdo_delete(PDO_NAME."draw_join",['draw_id'=>$id]); |
|||
//处理奖品信息 |
|||
foreach($prize as $pKey => $pVal){ |
|||
//判断当前奖品是否存在 |
|||
$joinData = [ |
|||
'draw_id' => $id ,//抽奖活动id |
|||
'draw_goods_id' => $pVal['draw_goods_id'] ? : 0 ,//奖品id |
|||
'probability' => $pVal['probability'] ,//中奖概率 |
|||
'serial_number' => $pVal['serial_number'] ,//序号(当前奖品在该活动中的顺序) |
|||
]; |
|||
$result = pdo_insert(PDO_NAME."draw_join",$joinData); |
|||
if(!$result){ |
|||
$mysqlFun->rollback(); |
|||
wl_message('修改失败,请刷新重试!' , referer() , 'error'); |
|||
} |
|||
} |
|||
$mysqlFun->commit(); |
|||
wl_message('修改成功!' , web_url('draw/draw/index') , 'success'); |
|||
} |
|||
//进入编辑页面 获取当前活动基本参数信息 |
|||
$info = pdo_get(PDO_NAME."draw",['id'=>$id]); |
|||
$info['rule'] = htmlspecialchars_decode($info['rule']); |
|||
$info['introduce'] = htmlspecialchars_decode($info['introduce']); |
|||
$info['wheel_bg'] = unserialize($info['wheel_bg']); |
|||
$data['share_image'] = unserialize($data['share_image']); |
|||
//处理顶部幻灯片 |
|||
if(!empty($info['share_image'])){ |
|||
$flag = unserialize($info['share_image']); |
|||
if($flag){ |
|||
$info['share_image'] = $flag; |
|||
}else{ |
|||
$flag = $info['share_image']; |
|||
$info['share_image'] = []; |
|||
$info['share_image'][] = $flag; |
|||
} |
|||
} |
|||
//获取当前活动相关的奖品信息列表 |
|||
$parizeList = Draw::drawJoinList($id); |
|||
$orderWhere = array_column($parizeList, 'serial_number'); |
|||
array_multisort($orderWhere, SORT_ASC, $parizeList); |
|||
$parizeList = array_combine($orderWhere,$parizeList) ; |
|||
//获取自定义装修菜单信息 |
|||
if (p('diypage')) $menus = DiyMenu::getMenuList(); |
|||
|
|||
include wl_template('draw/edit'); |
|||
} |
|||
/** |
|||
* Comment: 删除一个抽奖活动信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/16 18:13 |
|||
*/ |
|||
public function delete(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR show_json(0, '参数错误,请刷新重试!'); |
|||
$mysqlFun = new MysqlFunction(); |
|||
//删除内容 |
|||
$mysqlFun->startTrans(); |
|||
$res = pdo_delete(PDO_NAME."draw",['id'=>$id]); |
|||
if($res && pdo_count(PDO_NAME."draw_join",['draw_id'=>$id]) > 0) $res = pdo_delete(PDO_NAME."draw_join",['draw_id'=>$id]); |
|||
if ($res) { |
|||
$mysqlFun->commit(); |
|||
show_json(1 , '删除成功'); |
|||
}else { |
|||
$mysqlFun->rollback(); |
|||
show_json(0 , '删除失败,请刷新重试'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 基本设置内容 |
|||
* Author: zzw |
|||
* Date: 2020/9/17 11:14 |
|||
*/ |
|||
public function set(){ |
|||
global $_W,$_GPC; |
|||
if($_W['ispost']){ |
|||
$set = $_GPC['set']; |
|||
|
|||
Setting::agentsetting_save($set,'draw_set'); |
|||
wl_message('设置成功!' , web_url('draw/draw/set') , 'success'); |
|||
} |
|||
//获取已存在的设置信息 |
|||
$set = Setting::agentsetting_read('draw_set'); |
|||
$set['rule'] = htmlspecialchars_decode($set['rule']); |
|||
$set['introduce'] = htmlspecialchars_decode($set['introduce']); |
|||
|
|||
include wl_template('draw/set'); |
|||
} |
|||
} |
|||
@ -0,0 +1,157 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
/** |
|||
* Comment: 奖品管理 |
|||
* Author: zzw |
|||
* Class Goods_WeliamController |
|||
*/ |
|||
class Goods_WeliamController { |
|||
/** |
|||
* Comment: 获取奖品信息列表 |
|||
* Author: zzw |
|||
* Date: 2020/9/15 9:45 |
|||
*/ |
|||
public function goodsIndex(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1, intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$title = $_GPC['title'] ? : '';//奖品名称 |
|||
$type = intval($_GPC['type']) ? : 0;//奖品类型:1=现金红包,2=线上红包,3=积分,4=激活码,5=商品 |
|||
$status = intval($_GPC['status']) ? : 0;//状态:1=开启,2=关闭 |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if($title) $where .= " AND title LIKE '%{$title}%' "; |
|||
if($type > 0) $where .= " AND type = {$type} "; |
|||
if($status > 0) $where .= " AND status = {$status} "; |
|||
//sql语句生成 |
|||
$field = "id,title,type,image,probability,status,create_time,day_number,total_number"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."draw_goods"); |
|||
$order = " ORDER BY create_time DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
//列表信息获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
$startTime = strtotime(date("Y-m-d",time())." 00:00:00"); |
|||
$endTime = strtotime(date("Y-m-d",time())." 23:59:59"); |
|||
foreach($list as $item => &$val){ |
|||
$sWhere = ['draw_goods_id'=>$val['id']]; |
|||
//总统计信息获取 sales = 已抽中,surplus = 剩余,number = 总数量 |
|||
$val['total_sales'] = pdo_count(PDO_NAME."draw_record",$sWhere); |
|||
if($val['total_number'] > 0) $val['total_surplus'] = $val['total_number'] - intval($val['total_sales']); |
|||
//当天统计信息获取 已抽中/剩余/总数量 |
|||
$sWhere['create_time >='] = $startTime; |
|||
$sWhere['create_time <='] = $endTime; |
|||
$val['day_sales'] = pdo_count(PDO_NAME."draw_record",$sWhere); |
|||
if($val['day_number'] > 0) $val['day_surplus'] = $val['day_number'] - intval($val['day_sales']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('goods/index'); |
|||
} |
|||
/** |
|||
* Comment: 添加奖品信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/14 17:20 |
|||
*/ |
|||
public function goodsAdd(){ |
|||
global $_W,$_GPC; |
|||
if ($_W['ispost']) { |
|||
//基本信息获取 并且进行处理 奖品类型:1=现金红包,2=线上红包,3=积分,4=激活码,5=商品 |
|||
$data = $_GPC['data']; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['create_time'] = time(); |
|||
//判断是否存在对应类型的必须条件 |
|||
if ($data['type'] == 1 && ($data['prize_number'] <= 0 || !$data['prize_number'])) wl_message('请填写红包金额!' , referer() , 'error'); |
|||
if ($data['type'] == 2 && !$data['red_pack_id']) wl_message('请选择红包!' , referer() , 'error'); |
|||
if ($data['type'] == 3 && ($data['prize_number'] <= 0 || !$data['prize_number'])) wl_message('请填写积分数量!' , referer() , 'error'); |
|||
if ($data['type'] == 4 && !$data['code_keyword']) wl_message('请选择一个激活码序列!' , referer() , 'error'); |
|||
if ($data['type'] == 5 && !$data['goods_id']) wl_message('请选择一个商品!' , referer() , 'error'); |
|||
//判断是否已经存在同名称的奖品 |
|||
$isHave = pdo_get(PDO_NAME . "draw_goods" , ['title' => $data['title'],'uniacid' => $_W['uniacid'],'aid' => $_W['aid']]); |
|||
if ($isHave) wl_message('已存在同名称奖品!' , referer() , 'error'); |
|||
//奖品类型为线上红包时 修改字段内容信息 |
|||
if ($data['type'] == 2) { |
|||
$data['goods_id'] = $data['red_pack_id']; |
|||
$data['goods_plugin'] = 'red_pack'; |
|||
} |
|||
//删除多余信息字段 |
|||
unset($data['red_pack_name']); |
|||
unset($data['red_pack_id']); |
|||
unset($data['goods_name']); |
|||
//添加内容 |
|||
$res = pdo_insert(PDO_NAME . "draw_goods" , $data); |
|||
if ($res) wl_message('添加成功' , web_url('draw/goods/goodsIndex') , 'success'); |
|||
else wl_message('添加失败,请刷新重试!' , referer() , 'error'); |
|||
} |
|||
//获取激活码分组信息 |
|||
$codeList = Halfcard::getGroupList(); |
|||
|
|||
include wl_template('goods/add'); |
|||
} |
|||
/** |
|||
* Comment: 编辑奖品信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/15 11:21 |
|||
*/ |
|||
public function goodsEdit(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = intval($_GPC['id']) OR wl_message('参数错误,请刷新重试!' , referer() , 'error');; |
|||
if($_W['ispost']){ |
|||
//处理修改后的信息 |
|||
$data = $_GPC['data']; |
|||
//判断是否存在对应类型的必须条件 |
|||
if ($data['type'] == 1 && ($data['prize_number'] <= 0 || !$data['prize_number'])) wl_message('请填写红包金额!' , referer() , 'error'); |
|||
if ($data['type'] == 2 && !$data['red_pack_id']) wl_message('请选择红包!' , referer() , 'error'); |
|||
if ($data['type'] == 3 && ($data['prize_number'] <= 0 || !$data['prize_number'])) wl_message('请填写积分数量!' , referer() , 'error'); |
|||
if ($data['type'] == 4 && !$data['code_keyword']) wl_message('请选择一个激活码序列!' , referer() , 'error'); |
|||
if ($data['type'] == 5 && !$data['goods_id']) wl_message('请选择一个商品!' , referer() , 'error'); |
|||
if (!$data['image']) wl_message('请上传奖品logo!' , referer() , 'error'); |
|||
//判断是否已经存在同名称的奖品 |
|||
$isHave = pdo_get(PDO_NAME . "draw_goods" , ['title' => $data['title'],'id <>'=>$id]); |
|||
if ($isHave) wl_message('已存在同名称奖品!' , referer() , 'error'); |
|||
//奖品类型为线上红包时 修改字段内容信息 |
|||
if ($data['type'] == 2) { |
|||
$data['goods_id'] = $data['red_pack_id']; |
|||
$data['goods_plugin'] = 'red_pack'; |
|||
} |
|||
//删除多余信息字段 |
|||
unset($data['red_pack_name']); |
|||
unset($data['red_pack_id']); |
|||
unset($data['goods_name']); |
|||
//添加内容 |
|||
$res = pdo_update(PDO_NAME . "draw_goods" , $data,['id'=>$id]); |
|||
if ($res) wl_message('修改成功' , web_url('draw/goods/goodsIndex') , 'success'); |
|||
else wl_message('修改失败,请刷新重试!' , referer() , 'error'); |
|||
} |
|||
//进入修改页面 获取当前奖品的基本信息 |
|||
$info = Draw::prizeInfo($id); |
|||
//获取激活码分组信息 |
|||
$codeList = Halfcard::getGroupList(); |
|||
|
|||
|
|||
include wl_template('goods/edit'); |
|||
} |
|||
/** |
|||
* Comment: 删除奖品信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/15 11:51 |
|||
*/ |
|||
public function delete(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$ids = $_GPC['ids'] OR show_json(0, '参数错误,请刷新重试!'); |
|||
//删除内容 |
|||
$res = pdo_delete(PDO_NAME."draw_goods",['id IN'=>$ids]); |
|||
if($res) show_json(1, '删除成功'); |
|||
else show_json(0, '删除失败,请刷新重试'); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
/** |
|||
* Comment: 中奖管理 |
|||
* Author: zzw |
|||
* Class Prize_WeliamController |
|||
*/ |
|||
class Prize_WeliamController { |
|||
/** |
|||
* Comment: 获取用户抽奖信息列表 |
|||
* Author: zzw |
|||
* Date: 2020/9/22 10:30 |
|||
*/ |
|||
public function prizeIndex(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$title = $_GPC['title'] ? : '';//奖品名称 |
|||
$type = intval($_GPC['type']) ? : 0;//0=全部;奖品类型:1=现金红包,2=线上红包,3=积分,4=激活码,5=商品 |
|||
$nickname = $_GPC['nickname'] ? : '';//用户昵称 |
|||
$isGet = intval($_GPC['is_get']) ? : 0;//0=全部;是否领取 是否领取奖品:1=未领取,2=已领取 |
|||
$name = $_GPC['name'] ? : '';//活动名称 |
|||
$times = $_GPC['draw_times'] ? : '';//抽奖时间 |
|||
$mid = $_GPC['mid'] ? : 0 ;//用户id |
|||
$export = $_GPC['export'] ? : 0 ;//是否导出 |
|||
if($times){ |
|||
$startTime = strtotime($times['start']); |
|||
$endTime = strtotime($times['end']); |
|||
}else{ |
|||
$startTime = strtotime(date("Y-m-1 00:00:00")); |
|||
$endTime = strtotime(" +1 month ",$startTime); |
|||
} |
|||
|
|||
//条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} "; |
|||
if ($title) $where .= " AND c.title LIKE '%{$title}%' "; |
|||
if ($type > 0) $where .= " AND c.type = {$type} "; |
|||
if ($nickname) $where .= " AND b.nickname LIKE '%{$nickname}%' "; |
|||
if ($isGet > 0) $where .= " AND a.is_get = {$isGet} "; |
|||
if($name) $where .= " AND d.title LIKE '%{$name}%' "; |
|||
if($startTime && $endTime){ |
|||
$where .= " AND a.create_time >= {$startTime} AND a.create_time < {$endTime} "; |
|||
} |
|||
if($mid > 0) $where .= " AND b.id = {$mid} "; |
|||
//sql语句生成 |
|||
$field = "a.id,d.title as draw_title,b.nickname,b.avatar,a.create_time,c.title,c.image,a.is_get,a.draw_goods_id"; |
|||
$sql = "SELECT {$field} FROM " |
|||
.tablename(PDO_NAME."draw_record")//抽奖记录表 |
|||
." as a LEFT JOIN " |
|||
.tablename(PDO_NAME."member")//用户信息表 |
|||
." as b ON a.mid = b.id LEFT JOIN " |
|||
.tablename(PDO_NAME."draw_goods")//奖品信息表 |
|||
." as c ON a.draw_goods_id = c.id and a.draw_goods_id > 0 LEFT JOIN " |
|||
.tablename(PDO_NAME."draw")//抽奖活动表 |
|||
." as d ON a.draw_id = d.id"; |
|||
$order = " ORDER BY a.create_time DESC,a.id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
//判断是否导出 如果是导出则执行导出操作 |
|||
if($export) Draw::exportInfoList($sql.$where.$order); |
|||
//列表信息获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as &$value){ |
|||
$value['avatar'] = tomedia($value['avatar']); |
|||
$value['image'] = tomedia($value['image']); |
|||
$value['create_time'] = date("Y-m-d H:i:s" , $value['create_time']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
//统计信息获取 |
|||
$statisticsInfo = Draw::getStatistics($startTime,$endTime); |
|||
|
|||
include wl_template('prize/index'); |
|||
} |
|||
/** |
|||
* Comment: 删除指定的抽奖记录 |
|||
* Author: zzw |
|||
* Date: 2020/9/22 13:52 |
|||
*/ |
|||
public function delete(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$ids = $_GPC['ids'] OR show_json(0, '参数错误,请刷新重试!'); |
|||
//删除记录 |
|||
$res = pdo_delete(PDO_NAME."draw_record",['id IN'=>$ids]); |
|||
if ($res) show_json(1 , '删除成功'); |
|||
else show_json(0 , '删除失败,请刷新重试'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
/** |
|||
* Comment: 参与抽奖用户管理 |
|||
* Author: zzw |
|||
* Class User_WeliamController |
|||
*/ |
|||
class User_WeliamController { |
|||
/** |
|||
* Comment: 获取参与抽奖的用户信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/22 14:36 |
|||
*/ |
|||
public function userIndex(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$nickname = $_GPC['nickname'] ? : '';//用户昵称 |
|||
$export = $_GPC['export'] ? : 0 ;//是否导出 |
|||
//条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} "; |
|||
if($nickname) $where .= " AND b.nickname LIKE '%{$nickname}%' "; |
|||
//sql语句生成 |
|||
$field = "a.mid,b.uid,b.nickname,b.avatar,count(*) as total_draw,b.mobile"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."draw_record") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id "; |
|||
$order = " ORDER BY a.create_time DESC,a.id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$group = " GROUP BY a.mid "; |
|||
//判断是否导出 如果是导出则执行导出操作 |
|||
if($export) Draw::exportUserList($sql.$where.$group.$order); |
|||
//列表信息获取 |
|||
$list = pdo_fetchall($sql.$where.$group.$order.$limit); |
|||
foreach($list as &$value){ |
|||
$value['avatar'] = tomedia($value['avatar']); |
|||
//获取中奖次数 |
|||
$value['total_prize'] = Draw::selectCount(['mid'=>$value['mid'],'draw_goods_id >' => 0]); |
|||
//获取用户积分、余额 |
|||
$credit = pdo_get('mc_members' , ['uid' => $value['uid']] , ['credit1' , 'credit2']); |
|||
$value['credit1'] = $credit['credit1']; |
|||
$value['credit2'] = $credit['credit2']; |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchall($totalSql.$where.$group); |
|||
$pager = wl_pagination(count($total), $page, $pageIndex); |
|||
|
|||
include wl_template('user/index'); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,809 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.app-content{ |
|||
float: left; |
|||
} |
|||
#drawContent .pull-left{ |
|||
width: 450px; |
|||
padding-right: 20px; |
|||
} |
|||
#drawContent .pull-left .effect{ |
|||
float: left; |
|||
} |
|||
#drawContent .pull-left .effect9{ |
|||
width: 300px; |
|||
margin: 0 calc((100% - 300px) / 2); |
|||
} |
|||
#drawContent .pull-left .effect16{ |
|||
margin: 0 15px; |
|||
} |
|||
#drawContent .pull-left .grid{ |
|||
width: 100px; |
|||
height: 100px; |
|||
border: 1px solid #CCC; |
|||
padding: 5px; |
|||
float: left; |
|||
margin: 0 0 -1px -1px; |
|||
position: relative; |
|||
text-align: center; |
|||
} |
|||
#drawContent .pull-left .grid img{ |
|||
height: 100%; |
|||
width: 100%; |
|||
cursor: pointer; |
|||
} |
|||
#drawContent .pull-left .grid .draw_goods_name{ |
|||
height: 20px; |
|||
line-height: 20px; |
|||
font-size: 13px; |
|||
width: calc(100% - 10px); |
|||
overflow: hidden; |
|||
position: absolute; |
|||
bottom: 5px; |
|||
background: rgba(0,0,0,.5); |
|||
color: #fff; |
|||
} |
|||
#drawContent .pull-left .grid .serial-number{ |
|||
position: absolute; |
|||
top: 5px; |
|||
right: 5px; |
|||
background: #f8ac59; |
|||
width: 15px; |
|||
height: 15px; |
|||
line-height: 15px; |
|||
font-size: 13px; |
|||
text-align: center; |
|||
border-radius: 50%; |
|||
color: #FFFFFF; |
|||
} |
|||
#drawContent .pull-left .grid .grid-block{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
#drawContent .pull-right{ |
|||
width: calc(100% - 450px); |
|||
} |
|||
.prize_list{ |
|||
float: left; |
|||
margin-top: 30px; |
|||
} |
|||
.prize_list .item{ |
|||
width: 100%; |
|||
height: 100px; |
|||
background: #fff; |
|||
padding: 10px; |
|||
margin-bottom: 10px; |
|||
border: 1px solid #e7eaec; |
|||
border-radius: 3px; |
|||
} |
|||
.prize_list .item .btn-del{ |
|||
height: 0; |
|||
width: 100%; |
|||
display: block; |
|||
position: relative; |
|||
} |
|||
.prize_list .item .btn-del:before { |
|||
content: "×"; |
|||
position: absolute; |
|||
height: 16px; |
|||
width: 16px; |
|||
text-align: center; |
|||
line-height: 14px; |
|||
color: #fff; |
|||
cursor: pointer; |
|||
background: rgba(0,0,0,0.3); |
|||
border-radius: 16px; |
|||
top: -6px; |
|||
right: -6px; |
|||
z-index: 10; |
|||
} |
|||
.prize_list .item .item-image{ |
|||
height: 70px; |
|||
width: 70px; |
|||
min-width: 40px; |
|||
max-width: 220px; |
|||
background: #eee; |
|||
float: left; |
|||
margin-right: 10px; |
|||
border: 1px solid #e7eaec; |
|||
position: relative; |
|||
} |
|||
.prize_list .item .item-image img{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
.prize_list .item .item-image span{ |
|||
position: absolute; |
|||
left: 0; |
|||
bottom: 0; |
|||
width: 100%; |
|||
text-align: center; |
|||
cursor: pointer; |
|||
height: 25px; |
|||
line-height: 25px; |
|||
background: rgba(0,0,0,.5); |
|||
color: #FFF; |
|||
} |
|||
#drawContent .form-group-title{ |
|||
float: left; |
|||
width: 100%; |
|||
} |
|||
.probabilityDiv{ |
|||
position: fixed; |
|||
top: 49px; |
|||
width: 450px; |
|||
padding: 10px; |
|||
background: #f8ac59; |
|||
z-index: 9999; |
|||
} |
|||
/*轮盘效果*/ |
|||
.wheel{ |
|||
position: relative; |
|||
overflow: hidden; |
|||
width: 400px; |
|||
height: 400px; |
|||
margin: 0px auto; |
|||
background-color: #ddd; |
|||
border-radius: 200px; |
|||
} |
|||
.wheel .leaf { |
|||
list-style: none; |
|||
position: absolute; |
|||
width: 450px; |
|||
height: 200px; |
|||
right: 50%; |
|||
top: 0; |
|||
-webkit-transform-origin: 100% 100%; |
|||
-moz-transform-origin: 100% 100%; |
|||
-ms-transform-origin: 100% 100%; |
|||
transform-origin: 100% 100%; |
|||
} |
|||
.wheel .leaf .leaf-block{ |
|||
position: absolute; |
|||
right: 0px; |
|||
bottom: 0px; |
|||
padding: 0px 30px 0px 0px; |
|||
text-align: center; |
|||
color: #FFF; |
|||
font-size: 13px; |
|||
} |
|||
.wheel .leaf:nth-child(1){background-color: #FFB6C1;} |
|||
.wheel .leaf:nth-child(2){background-color: #DC143C;} |
|||
.wheel .leaf:nth-child(3){background-color: #DA70D6;} |
|||
.wheel .leaf:nth-child(4){background-color: #8B008B;} |
|||
.wheel .leaf:nth-child(5){background-color: #9400D3;} |
|||
.wheel .leaf:nth-child(6){background-color: #7B68EE;} |
|||
.wheel .leaf:nth-child(7){background-color: #87CEFA;} |
|||
.wheel .leaf:nth-child(8){background-color: #FFA500;} |
|||
.wheel .leaf:nth-child(9){background-color: #00FF7F;} |
|||
.wheel .leaf:nth-child(10){background-color: #BDB76B;} |
|||
.wheel .leaf:nth-child(11){background-color: #FFD700;} |
|||
.wheel .leaf:nth-child(12){background-color: #FF8C00;} |
|||
.deleteGoodsButton{ |
|||
position: relative; |
|||
top: -9px; |
|||
z-index: 100; |
|||
height: 0; |
|||
width: 100%; |
|||
display: block; |
|||
} |
|||
.deleteGoodsButton:before { |
|||
content: "删除"; |
|||
position: absolute; |
|||
height: 16px; |
|||
width: 30px; |
|||
font-size: 12px; |
|||
text-align: center; |
|||
line-height: 16px; |
|||
color: #fff; |
|||
cursor: pointer; |
|||
background: #ec4758; |
|||
top: 3px; |
|||
right: 15px; |
|||
z-index: 10; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基本信息</a></li> |
|||
<li><a href="#tab_images">其他设置</a></li> |
|||
<li><a href="#tab_share">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form" id="drawContent"> |
|||
<!-- 顶部内容 --> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"></div> |
|||
<div class="filter-list"> |
|||
<div class="alert alert-warning"> |
|||
注意:<br /> |
|||
所有奖品抽中的概率之和必须等于100%<br /> |
|||
请点击上方其他设置进行样式信息配置<br /> |
|||
轮盘数量为4-12个,且轮盘扇叶数量必须为偶数<br /> |
|||
中奖信息中必须有一个谢谢参与内容 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 表单内容 --> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<!-- 左边的效果栏 --> |
|||
<div class="pull-left" id="effectBlock"> |
|||
<div class="form-group-title">奖品添加</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="type" name="data[type]" value="1" checked="checked"> 9宫格 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="type" name="data[type]" value="2"> 16宫格 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="type" name="data[type]" value="3"> 轮盘 |
|||
</label> |
|||
<span class="help-block" v-if="type == 3">由于背景色计算方式,轮盘数量必须为偶数</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" v-if="type == 3"> |
|||
<label class="col-sm-2 control-label">轮盘背景</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">颜色一</span> |
|||
<input type="color" class="form-control" v-model="wheel[0]" name="data[wheel_bg][]"> |
|||
<span class="input-group-addon">颜色二</span> |
|||
<input type="color" class="form-control" v-model="wheel[1]" name="data[wheel_bg][]"> |
|||
</div> |
|||
<span class="help-block">设置轮盘扇叶的背景颜色</span> |
|||
</div> |
|||
</div> |
|||
<div id="probabilityDivPosition"></div> |
|||
<div class="form-group" id="probabilityDiv"> |
|||
<label class="col-sm-2 control-label">当前总概率</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input class="form-control" disabled="disabled" :value="getTotalProbability()"> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">所有奖品抽中的概率之和必须等于100%</span> |
|||
</div> |
|||
</div> |
|||
<!-- 抽奖效果区 --> |
|||
<div :class="{effect9:(type == 1),effect16:(type == 2),wheel:(type == 3),'effect':true}"> |
|||
<div :class="{grid:(type == 1 || type == 2),leaf:(type == 3)}" v-for="index in number" :data-index="index"> |
|||
<div :class="{'grid-block':(type == 1 || type == 2),'leaf-block':(type == 3)}" > |
|||
<img v-if="type != 3" :src="prize[index].draw_goods_image" title="点击选择奖品" |
|||
data-toggle="selectDrawPrize" |
|||
:data-id="'#id-id_'+index" |
|||
:data-name="'#id-name_'+index" |
|||
:data-image="'#id-image_'+index" |
|||
:data-image-input="'#id-image-input_'+index" |
|||
:data-probability="'#id-probability_'+index" |
|||
/> |
|||
<span class="serial-number">{{index}}</span> |
|||
<div class="draw_goods_name">{{ prize[index].draw_goods_name }}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品选择区域 --> |
|||
<div class="prize_list"> |
|||
<!-- 奖品列表 --> |
|||
<div class="item" v-for="index in number"> |
|||
<span class="btn-del" title="点击清除奖品" @click="cancel(index)"></span> |
|||
<span v-if="Object.keys(prize).length > 4 && type == 3" class="deleteGoodsButton" title="点击删除奖品" @click="deleteGoods(index)"></span> |
|||
<div class="item-image"> |
|||
<img :src="prize[index].draw_goods_image" onerror="this.src='../addons/{MODULE_NAME}/web/resource/images/default.png';"> |
|||
<span data-toggle="selectDrawPrize" |
|||
:data-id="'#id-id_'+index" |
|||
:data-name="'#id-name_'+index" |
|||
:data-image="'#id-image_'+index" |
|||
:data-image-input="'#id-image-input_'+index" |
|||
:data-probability="'#id-probability_'+index" |
|||
>选择奖品</span> |
|||
</div> |
|||
<div class="item-form"> |
|||
<div class="input-group" style="margin-bottom:0;"> |
|||
<input class="hide draw_goods_info" v-model="prize[index].draw_goods_id" :index="index" fields="draw_goods_id" :name="'prize['+index+'][draw_goods_id]'" :id="'id-id_'+index"> |
|||
<input class="hide draw_goods_info" v-model="prize[index].draw_goods_name" :index="index" fields="draw_goods_name" :name="'prize['+index+'][draw_goods_name]'" :id="'id-name_'+index"> |
|||
<input class="hide draw_goods_info" v-model="prize[index].probability" :index="index" fields="probability" :name="'prize['+index+'][probability]'" :id="'id-probability_'+index" > |
|||
<input class="hide draw_goods_info" v-model="prize[index].draw_goods_image" :index="index" fields="draw_goods_image" :id="'id-image-input_'+index"> |
|||
<input class="hide" :name="'prize['+index+'][serial_number]'" :value="index"> |
|||
<span class="input-group-addon btn btn-default" @click="demo()">奖品</span> |
|||
<input type="text" v-model="prize[index].draw_goods_name" class="form-control" disabled="disabled"> |
|||
</div> |
|||
<div class="input-group" style="margin-top:10px;margin-bottom:0; "> |
|||
<span class="input-group-addon btn btn-default">序号</span> |
|||
<input type="text" class="form-control diy-bind" :value="index" disabled="disabled"> |
|||
<span class="input-group-addon btn btn-default">概率</span> |
|||
<input type="text" class="form-control diy-bind" v-model="prize[index].probability"> |
|||
<span class="input-group-addon btn btn-default">%</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品数量添加按钮 --> |
|||
<div class="form-group" v-if="Object.keys(prize).length < 12 && type == 3"> |
|||
<div class="col-sm-9"> |
|||
<a href="javascript:;" class="btn btn-sm btn-info" @click="addGoods()">添加奖品({{ Object.keys(prize).length }}/12)</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 右边的设置栏 --> |
|||
<div class="pull-right"> |
|||
<div class="tab-content"> |
|||
<!-- 基本设置 --> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group-title">基本设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">主题</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[title]" maxlength="25"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="1"> 关闭 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="2" checked="checked"> 开启 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">消耗积分</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[integral_consume]" value="0"/> |
|||
<div class="help-block">用户抽奖次数使用完后继续抽奖需要消耗的积分;0则不消耗积分。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">赠送积分</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[integral_give]" value="0"/> |
|||
<div class="help-block">用户分享后其他用户点击时获取的积分;0则不赠送积分。</div> |
|||
</div> |
|||
</div> |
|||
{if p('diypage')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">底部菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_id]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $vo} |
|||
<option value="{$vo['id']}">{$vo['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<div class="help-block">默认菜单使用平台首页的底部菜单!</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
{php echo tpl_select_time_info('activity_time',[ 'starttime' => date('Y-m-d H:i',time()), 'endtime' => date('Y-m-d H:i', strtotime('+1 month'))]);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">总次数</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">参加次数</span> |
|||
<input type="number" name="data[total_join_times]" digits="true" class="form-control" value="0"> |
|||
<span class="input-group-addon">中奖次数</span> |
|||
<input type="number" name="data[total_draw_times]" digits="true" class="form-control" value="0"> |
|||
</div> |
|||
<span class="help-block">每一个用户总共可以免费参加的次数和中奖的次数,为0则没有免费抽奖次数|不限制中奖次数</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">天次数</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">参加次数</span> |
|||
<input type="number" name="data[day_join_times]" digits="true" class="form-control" value="0"> |
|||
<span class="input-group-addon">中奖次数</span> |
|||
<input type="number" name="data[day_draw_times]" digits="true" class="form-control" value="0"> |
|||
</div> |
|||
<span class="help-block">每一个用户每天可以免费参加的次数和中奖的次数,为0则没有免费抽奖次数|不限制中奖次数</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">虚拟信息</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">参加人数</span> |
|||
<input type="number" name="data[fictitious_visit]" digits="true" class="form-control" value="0"> |
|||
<span class="input-group-addon">中奖人数</span> |
|||
<input type="number" name="data[fictitious_prize]" digits="true" class="form-control" value="0"> |
|||
<span class="input-group-addon">浏览人数</span> |
|||
<input type="number" name="data[fictitious_pv]" digits="true" class="form-control" value="0"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">规则说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('data[introduce]','');} |
|||
<span class="help-block">不填则使用设置中的默认规则</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 其他设置 --> |
|||
<div class="tab-pane" id="tab_images"> |
|||
<div class="form-group-title">其他设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">顶部图片轮播</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('data[share_image]','');} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">背景颜色</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">背景颜色</span> |
|||
<input type="color" class="form-control" name="data[bg_color]" value="#ff4444" > |
|||
<span class="input-group-addon">小按钮颜色</span> |
|||
<input type="color" class="form-control" name="data[button_color]" value="#FD7058" > |
|||
<span class="input-group-addon">小按钮阴影</span> |
|||
<input type="color" class="form-control" name="data[button_shadow]" value="#AF1010" > |
|||
</div> |
|||
<span class="help-block">规则说明,奖品,积分按钮背景色。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">背景图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[background_image]', '');} |
|||
<span class="help-block">推荐图片比例:345 * 600</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">获取更多抽奖次数按钮</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[button_more]', '');} |
|||
<span class="help-block">推荐图片比例:190 * 45</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖按钮</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[button_draw]', '');} |
|||
<span class="help-block">推荐图片比例:124 * 60</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">生成海报按钮</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[button_prize]', '');} |
|||
<span class="help-block">110 * 45</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海报背景图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[poster_bg]', '');} |
|||
<span class="help-block">推荐图片比例:300 * 520</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">背景音乐</label> |
|||
<div class="col-sm-6 col-xs-6"> |
|||
{php echo attachment_select_audio('data[background_music]','');} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开始抽奖图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[start_image]', '');} |
|||
<span class="help-block">推荐图片比例:300 * 300</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">中奖效果图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[prize_image]', '');} |
|||
<span class="help-block">推荐图片比例:320 * 435</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖音效</label> |
|||
<div class="col-sm-6 col-xs-6"> |
|||
{php echo attachment_select_audio('data[use_music]','');} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 分享设置 --> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="form-group-title">分享设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[share_title]" maxlength="25"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" name="data[share_desc]" rows="5" maxlength="200" style="resize: none;"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[share_img]', '');} |
|||
<span class="help-block">推荐图片比例:300 * 300</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
let prizeList = new Vue({ |
|||
el: "#effectBlock", |
|||
data: { |
|||
type: 1,//活动类型:1=9宫格,2=16宫格,3=转盘 |
|||
number: 9,//宫格数量 |
|||
prize: { |
|||
1: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
2: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
3: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
4: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
5: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
6: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
7: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
8: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
9: { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}, |
|||
}, |
|||
wheel:['#E6A53F','#E6DB74'] |
|||
}, |
|||
watch: { |
|||
'type'() { |
|||
//修改类型信息 |
|||
if (this.type == 1) this.number = 9; |
|||
else if (this.type == 2 ) this.number = 16; |
|||
else if (this.type == 3 && this.number > 12) this.number = 12; |
|||
//生成新的内容信息 |
|||
this.createList(); |
|||
}, |
|||
prize:{ |
|||
handler(newVal, oldVal){ |
|||
//内容改变 |
|||
let _this = this; |
|||
this.$nextTick(function(){ |
|||
_this.eachLeaf(); |
|||
}); |
|||
}, |
|||
deep:true |
|||
}, |
|||
wheel:{ |
|||
handler(newVal, oldVal){ |
|||
//内容改变 |
|||
let _this = this; |
|||
this.$nextTick(function(){ |
|||
_this.eachLeaf(); |
|||
}); |
|||
}, |
|||
deep:true |
|||
} |
|||
}, |
|||
methods: { |
|||
//生成信息列表 |
|||
createList(){ |
|||
let _this = this, |
|||
oldPrize = _this.prize, |
|||
prize = {}; |
|||
for(let i=1;i<=_this.number;i++){ |
|||
prize[i] = { |
|||
'draw_goods_id': oldPrize[i] ? oldPrize[i]['draw_goods_id'] : 0, |
|||
'draw_goods_name': oldPrize[i] ? oldPrize[i]['draw_goods_name'] : '谢谢参与', |
|||
'draw_goods_image': oldPrize[i] ? oldPrize[i]['draw_goods_image'] : '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': oldPrize[i] ? oldPrize[i]['probability'] : 10, |
|||
}; |
|||
} |
|||
_this.prize = prize; |
|||
}, |
|||
//点击清除奖品信息 |
|||
cancel(index){ |
|||
this.prize[index] = { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}; |
|||
}, |
|||
//获取总的中奖概率 |
|||
getTotalProbability(){ |
|||
let totalProbability = 0; |
|||
$.each(this.prize,function (k,v) { |
|||
totalProbability = parseFloat(totalProbability) + parseFloat(v['probability']); |
|||
totalProbability = totalProbability.toFixed(2); |
|||
}); |
|||
return totalProbability; |
|||
}, |
|||
//轮盘信息处理 |
|||
eachLeaf(){ |
|||
let _this = this; |
|||
//清除所有样式信息 |
|||
$(".grid").attr('style',''); |
|||
$(".effect").attr('style',''); |
|||
$(".leaf-block").attr('style',''); |
|||
$(".grid-block").attr('style',''); |
|||
//样式为轮盘 进行样式处理 |
|||
if(_this.type == 3){ |
|||
//let totalSize = _this.getTotalProbability();//当前总概率 |
|||
//循环处理每一个扇叶 |
|||
let _position = 0; |
|||
$(".leaf").each(function (index) { |
|||
if(index > 1) index = index % 2; |
|||
$(this).css("background-color", _this.wheel[index]); |
|||
//START 根据概率获取当前扇叶的宽度和位置 |
|||
// let _index = $(this).data("index"); |
|||
// let probability = _this.prize[_index].probability; |
|||
// let proportion = parseFloat(probability) / parseFloat(totalSize); |
|||
// proportion = proportion.toFixed(2); |
|||
// let width = parseFloat(360) * parseFloat(proportion); |
|||
// width = width.toFixed(2); |
|||
//let deg = parseFloat(180) + (parseFloat(90) - parseFloat(width)); |
|||
//if(probability >= 50) deg = 90;//当前扇页的概率大于等于一般则固定为90 |
|||
//END 根据概率获取当前扇叶的宽度和位置 |
|||
//START 等比例获取当前扇叶的宽度和位置 |
|||
let length = Object.keys(_this.prize).length; |
|||
let width =parseFloat(360) / parseInt(length); |
|||
let deg = parseFloat(180) + (parseFloat(90) - parseFloat(width)); |
|||
//END 等比例获取当前扇叶的宽度和位置 |
|||
$(this).css({ |
|||
'-webkit-transform':'rotate('+_position+'deg) skew('+deg+'deg)', |
|||
'-moz-transform':'rotate('+_position+'deg) skew('+deg+'deg)', |
|||
'-ms-transform':'rotate('+_position+'deg) skew('+deg+'deg)', |
|||
'transform':'rotate('+_position+'deg) skew('+deg+'deg)', |
|||
}); |
|||
//处理子类信息 |
|||
let serialNumberDeg = parseFloat(360) - parseFloat(deg); |
|||
serialNumberDeg = serialNumberDeg.toFixed(2); |
|||
$(this).children(".leaf-block").css({ |
|||
'-webkit-transform':'rotate(0deg) skew('+serialNumberDeg+'deg)', |
|||
'-moz-transform':'rotate(0deg) skew('+serialNumberDeg+'deg)', |
|||
'-ms-transform':'rotate(0deg) skew('+serialNumberDeg+'deg)', |
|||
'transform':'rotate(0deg) skew('+serialNumberDeg+'deg)', |
|||
});; |
|||
//_position增长 |
|||
_position = parseFloat(_position) + parseFloat(width); |
|||
}); |
|||
} |
|||
}, |
|||
//点击添加商品 最少4个,最多12个 |
|||
addGoods(){ |
|||
//判断数量是否到达限制 |
|||
let length = Object.keys(this.prize).length; |
|||
if(length >= 12){ |
|||
tip.alert("数量已达限制"); |
|||
return false; |
|||
} |
|||
//获取新的prize列表 |
|||
let prize = this.prize; |
|||
//添加一个内容 |
|||
let prizeType = typeof prize; |
|||
if(prizeType != 'array') prize = Object.values(prize); |
|||
prize.push({ |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/{MODULE_NAME}/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}); |
|||
prize = this.arrayKeyUpdate(Object.values(prize)); |
|||
prize = JSON.stringify(prize); |
|||
this.prize = JSON.parse(prize); |
|||
this.number++; |
|||
this.$forceUpdate(); |
|||
}, |
|||
//点击删除商品 最少4个,最多12个 |
|||
deleteGoods(index){ |
|||
let prize = this.prize; |
|||
//删除内容 |
|||
delete prize[index]; |
|||
//信息重组 |
|||
prize = this.arrayKeyUpdate(Object.values(prize)); |
|||
this.prize = prize; |
|||
this.number--; |
|||
this.$forceUpdate(); |
|||
}, |
|||
//由于数组初始化后键值从0开始 这里要修改为从1开始 |
|||
arrayKeyUpdate(prize){ |
|||
let newArray = {}; |
|||
$.each(prize,function (k,v) { |
|||
newArray[k+1] = v; |
|||
}); |
|||
return newArray; |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.createList(); |
|||
} |
|||
}); |
|||
/** |
|||
* 信息改变 同步改变信息 |
|||
*/ |
|||
$("#effectBlock").on("change",'.draw_goods_info',function () { |
|||
//基本信息获取 |
|||
let fields = $(this).attr("fields"), |
|||
index = $(this).attr("index"), |
|||
val = $(this).val(); |
|||
//替换信息 |
|||
prizeList.prize[index][fields] = val; |
|||
}); |
|||
/** |
|||
* 监听滚动操作 |
|||
*/ |
|||
$(window).scroll(function(event){ |
|||
let top = $("#probabilityDivPosition").offset().top-$(window).scrollTop(); |
|||
if(top > 50){ |
|||
//正常 因为顶部有50距离 所以偏离50px |
|||
$("#probabilityDiv").removeClass('probabilityDiv'); |
|||
}else{ |
|||
//超出 固定在顶部 |
|||
$("#probabilityDiv").addClass('probabilityDiv'); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,759 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.app-content{ |
|||
float: left; |
|||
} |
|||
#drawContent .pull-left{ |
|||
width: 450px; |
|||
padding-right: 20px; |
|||
} |
|||
#drawContent .pull-left .effect{ |
|||
float: left; |
|||
} |
|||
#drawContent .pull-left .effect9{ |
|||
width: 300px; |
|||
margin: 0 calc((100% - 300px) / 2); |
|||
} |
|||
#drawContent .pull-left .effect16{ |
|||
margin: 0 15px; |
|||
} |
|||
#drawContent .pull-left .grid{ |
|||
width: 100px; |
|||
height: 100px; |
|||
border: 1px solid #CCC; |
|||
padding: 5px; |
|||
float: left; |
|||
margin: 0 0 -1px -1px; |
|||
position: relative; |
|||
text-align: center; |
|||
} |
|||
#drawContent .pull-left .grid img{ |
|||
height: 100%; |
|||
width: 100%; |
|||
cursor: pointer; |
|||
} |
|||
#drawContent .pull-left .grid .draw_goods_name{ |
|||
height: 20px; |
|||
line-height: 20px; |
|||
font-size: 13px; |
|||
width: calc(100% - 10px); |
|||
overflow: hidden; |
|||
position: absolute; |
|||
bottom: 5px; |
|||
background: rgba(0,0,0,.5); |
|||
color: #fff; |
|||
} |
|||
#drawContent .pull-left .grid .serial-number{ |
|||
position: absolute; |
|||
top: 5px; |
|||
right: 5px; |
|||
background: #f8ac59; |
|||
width: 15px; |
|||
height: 15px; |
|||
line-height: 15px; |
|||
font-size: 13px; |
|||
text-align: center; |
|||
border-radius: 50%; |
|||
color: #FFFFFF; |
|||
} |
|||
#drawContent .pull-left .grid .grid-block{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
#drawContent .pull-right{ |
|||
width: calc(100% - 450px); |
|||
} |
|||
.prize_list{ |
|||
float: left; |
|||
margin-top: 30px; |
|||
} |
|||
.prize_list .item{ |
|||
width: 100%; |
|||
height: 100px; |
|||
background: #fff; |
|||
padding: 10px; |
|||
margin-bottom: 10px; |
|||
border: 1px solid #e7eaec; |
|||
border-radius: 3px; |
|||
} |
|||
.prize_list .item .btn-del{ |
|||
height: 0; |
|||
width: 100%; |
|||
display: block; |
|||
position: relative; |
|||
} |
|||
.prize_list .item .btn-del:before { |
|||
content: "×"; |
|||
position: absolute; |
|||
height: 16px; |
|||
width: 16px; |
|||
text-align: center; |
|||
line-height: 14px; |
|||
color: #fff; |
|||
cursor: pointer; |
|||
background: rgba(0,0,0,0.3); |
|||
border-radius: 16px; |
|||
top: -6px; |
|||
right: -6px; |
|||
z-index: 10; |
|||
} |
|||
.prize_list .item .item-image{ |
|||
height: 70px; |
|||
width: 70px; |
|||
min-width: 40px; |
|||
max-width: 220px; |
|||
background: #eee; |
|||
float: left; |
|||
margin-right: 10px; |
|||
border: 1px solid #e7eaec; |
|||
position: relative; |
|||
} |
|||
.prize_list .item .item-image img{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
.prize_list .item .item-image span{ |
|||
position: absolute; |
|||
left: 0; |
|||
bottom: 0; |
|||
width: 100%; |
|||
text-align: center; |
|||
cursor: pointer; |
|||
height: 25px; |
|||
line-height: 25px; |
|||
background: rgba(0,0,0,.5); |
|||
color: #FFF; |
|||
} |
|||
#drawContent .form-group-title{ |
|||
float: left; |
|||
width: 100%; |
|||
} |
|||
.probabilityDiv{ |
|||
position: fixed; |
|||
top: 49px; |
|||
width: 450px; |
|||
padding: 10px; |
|||
background: #f8ac59; |
|||
z-index: 9999; |
|||
} |
|||
/*轮盘效果*/ |
|||
.wheel{ |
|||
position: relative; |
|||
overflow: hidden; |
|||
width: 400px; |
|||
height: 400px; |
|||
margin: 0px auto; |
|||
background-color: #ddd; |
|||
border-radius: 200px; |
|||
} |
|||
.wheel .leaf { |
|||
list-style: none; |
|||
position: absolute; |
|||
width: 450px; |
|||
height: 200px; |
|||
right: 50%; |
|||
top: 0; |
|||
-webkit-transform-origin: 100% 100%; |
|||
-moz-transform-origin: 100% 100%; |
|||
-ms-transform-origin: 100% 100%; |
|||
transform-origin: 100% 100%; |
|||
} |
|||
.wheel .leaf .leaf-block{ |
|||
position: absolute; |
|||
right: 0px; |
|||
bottom: 0px; |
|||
padding: 0px 30px 0px 0px; |
|||
text-align: center; |
|||
color: #FFF; |
|||
font-size: 13px; |
|||
} |
|||
.deleteGoodsButton{ |
|||
position: relative; |
|||
top: -9px; |
|||
z-index: 100; |
|||
height: 0; |
|||
width: 100%; |
|||
display: block; |
|||
} |
|||
.deleteGoodsButton:before { |
|||
content: "删除"; |
|||
position: absolute; |
|||
height: 16px; |
|||
width: 30px; |
|||
font-size: 12px; |
|||
text-align: center; |
|||
line-height: 16px; |
|||
color: #fff; |
|||
cursor: pointer; |
|||
background: #ec4758; |
|||
top: 3px; |
|||
right: 15px; |
|||
z-index: 10; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基本信息</a></li> |
|||
<li><a href="#tab_images">其他设置</a></li> |
|||
<li><a href="#tab_share">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form" id="drawContent"> |
|||
<!-- 顶部内容 --> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"></div> |
|||
<div class="filter-list"> |
|||
<div class="alert alert-warning"> |
|||
注意:<br /> |
|||
所有奖品抽中的概率之和必须等于100%<br /> |
|||
请点击上方其他设置进行样式信息配置<br /> |
|||
轮盘数量为4-12个,且轮盘扇叶数量必须为偶数<br /> |
|||
中奖信息中必须有一个谢谢参与内容 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 表单内容 --> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<!-- 左边的效果栏 --> |
|||
<div class="pull-left" id="effectBlock"> |
|||
<div class="form-group-title">奖品编辑</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="type" name="data[type]" value="1"> 9宫格 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="type" name="data[type]" value="2"> 16宫格 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="type" name="data[type]" value="3"> 轮盘 |
|||
</label> |
|||
<span class="help-block" v-if="type == 3">由于背景色计算方式,轮盘数量必须为偶数</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" v-if="type == 3"> |
|||
<label class="col-sm-2 control-label">轮盘背景</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">颜色一</span> |
|||
<input type="color" class="form-control" v-model="wheel[0]" name="data[wheel_bg][]" value="" > |
|||
<span class="input-group-addon">颜色二</span> |
|||
<input type="color" class="form-control" v-model="wheel[1]" name="data[wheel_bg][]" value="" > |
|||
</div> |
|||
<span class="help-block">设置轮盘扇叶的背景颜色</span> |
|||
</div> |
|||
</div> |
|||
<div id="probabilityDivPosition"></div> |
|||
<div class="form-group" id="probabilityDiv"> |
|||
<label class="col-sm-2 control-label">当前总概率</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input class="form-control" disabled="disabled" :value="getTotalProbability()"> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">所有奖品抽中的概率之和必须等于100%</span> |
|||
</div> |
|||
</div> |
|||
<!-- 抽奖效果区 --> |
|||
<div :class="{effect9:(type == 1),effect16:(type == 2),wheel:(type == 3),'effect':true}"> |
|||
<div :class="{grid:(type == 1 || type == 2),leaf:(type == 3)}" v-for="index in number" :data-index="index"> |
|||
<div :class="{'grid-block':(type == 1 || type == 2),'leaf-block':(type == 3)}" > |
|||
<img v-if="type != 3" :src="prize[index].draw_goods_image" title="点击选择奖品" |
|||
data-toggle="selectDrawPrize" |
|||
:data-id="'#id-id_'+index" |
|||
:data-name="'#id-name_'+index" |
|||
:data-image="'#id-image_'+index" |
|||
:data-image-input="'#id-image-input_'+index" |
|||
:data-probability="'#id-probability_'+index" |
|||
/> |
|||
<span class="serial-number">{{index}}</span> |
|||
<div class="draw_goods_name">{{ prize[index].draw_goods_name }}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品选择区域 --> |
|||
<div class="prize_list"> |
|||
<!-- 奖品列表 --> |
|||
<div class="item" v-for="index in number"> |
|||
<span class="btn-del" title="点击清除奖品" @click="cancel(index)"></span> |
|||
<span v-if="Object.keys(prize).length > 4 && type == 3" class="deleteGoodsButton" title="点击删除奖品" @click="deleteGoods(index)"></span> |
|||
<div class="item-image"> |
|||
<img :src="prize[index].draw_goods_image" onerror="this.src='../addons/weliam_smartcity/web/resource/images/default.png';"> |
|||
<span data-toggle="selectDrawPrize" |
|||
:data-id="'#id-id_'+index" |
|||
:data-name="'#id-name_'+index" |
|||
:data-image="'#id-image_'+index" |
|||
:data-image-input="'#id-image-input_'+index" |
|||
:data-probability="'#id-probability_'+index" |
|||
>选择奖品</span> |
|||
</div> |
|||
<div class="item-form"> |
|||
<div class="input-group" style="margin-bottom:0;"> |
|||
<input class="hide draw_goods_info" v-model="prize[index].draw_goods_id" :index="index" fields="draw_goods_id" :name="'prize['+index+'][draw_goods_id]'" :id="'id-id_'+index"> |
|||
<input class="hide draw_goods_info" v-model="prize[index].draw_goods_name" :index="index" fields="draw_goods_name" :name="'prize['+index+'][draw_goods_name]'" :id="'id-name_'+index"> |
|||
<input class="hide draw_goods_info" v-model="prize[index].probability" :index="index" fields="probability" :name="'prize['+index+'][probability]'" :id="'id-probability_'+index" > |
|||
<input class="hide draw_goods_info" v-model="prize[index].draw_goods_image" :index="index" fields="draw_goods_image" :id="'id-image-input_'+index"> |
|||
<input class="hide" :name="'prize['+index+'][serial_number]'" :value="index"> |
|||
<span class="input-group-addon btn btn-default" @click="demo()">奖品</span> |
|||
<input type="text" v-model="prize[index].draw_goods_name" class="form-control" disabled="disabled"> |
|||
</div> |
|||
<div class="input-group" style="margin-top:10px;margin-bottom:0; "> |
|||
<span class="input-group-addon btn btn-default">序号</span> |
|||
<input type="text" class="form-control diy-bind" :value="index" disabled="disabled"> |
|||
<span class="input-group-addon btn btn-default">概率</span> |
|||
<input type="text" class="form-control diy-bind" v-model="prize[index].probability"> |
|||
<span class="input-group-addon btn btn-default">%</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品数量添加按钮 --> |
|||
<div class="form-group" v-if="Object.keys(prize).length < 12 && type == 3"> |
|||
<div class="col-sm-9"> |
|||
<a href="javascript:;" class="btn btn-sm btn-info" @click="addGoods()">添加奖品({{ Object.keys(prize).length }}/12)</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 右边的设置栏 --> |
|||
<div class="pull-right"> |
|||
<div class="tab-content"> |
|||
<!-- 基本设置 --> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group-title">基本设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">主题</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[title]" maxlength="25" value="{$info['title']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="1" {if $info['status'] == 1}checked="checked"{/if}> 关闭 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="2" {if $info['status'] != 1}checked="checked"{/if}> 开启 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">消耗积分</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[integral_consume]" value="{$info['integral_consume']}"/> |
|||
<div class="help-block">用户抽奖次数使用完后继续抽奖需要消耗的积分;0则不消耗积分。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">赠送积分</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[integral_give]" value="{$info['integral_give']}"/> |
|||
<div class="help-block">用户分享后其他用户点击时获取的积分;0则不赠送积分。</div> |
|||
</div> |
|||
</div> |
|||
{if p('diypage')} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">底部菜单</div> |
|||
<div class="col-sm-9"> |
|||
<select name="data[menu_id]" class="form-control select2"> |
|||
<option value="0">系统默认</option> |
|||
{loop $menus $vo} |
|||
<option value="{$vo['id']}" {if $info['menu_id'] == $vo['id']}selected{/if}>{$vo['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
<div class="help-block">默认菜单使用平台首页的底部菜单!</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
{php echo tpl_select_time_info('activity_time',[ 'starttime' => date('Y-m-d H:i',$info['start_time']), 'endtime' => date('Y-m-d H:i', $info['end_time'])])} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">总次数</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">免费次数</span> |
|||
<input type="number" name="data[total_join_times]" digits="true" class="form-control" value="{$info['total_join_times']}"> |
|||
<span class="input-group-addon">参与次数</span> |
|||
<input type="number" name="data[total_parin_times]" digits="true" class="form-control" value="{$info['total_parin_times']}"> |
|||
<span class="input-group-addon">中奖次数</span> |
|||
<input type="number" name="data[total_draw_times]" digits="true" class="form-control" value="{$info['total_draw_times']}"> |
|||
</div> |
|||
<span class="help-block">每一个用户总共可以免费参加的次数,参与总次数和中奖的次数,为0则不限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">天次数</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">免费次数</span> |
|||
<input type="number" name="data[day_join_times]" digits="true" class="form-control" value="{$info['day_join_times']}"> |
|||
<span class="input-group-addon">参与次数</span> |
|||
<input type="number" name="data[day_parin_times]" digits="true" class="form-control" value="{$info['day_parin_times']}"> |
|||
<span class="input-group-addon">中奖次数</span> |
|||
<input type="number" name="data[day_draw_times]" digits="true" class="form-control" value="{$info['day_draw_times']}"> |
|||
</div> |
|||
<span class="help-block">每一个用户每天可以免费参加的次数,参与次数和中奖的次数,为0则不限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">虚拟信息</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">参加人数</span> |
|||
<input type="number" name="data[fictitious_visit]" digits="true" class="form-control" value="{$info['fictitious_visit']}"> |
|||
<span class="input-group-addon">中奖人数</span> |
|||
<input type="number" name="data[fictitious_prize]" digits="true" class="form-control" value="{$info['fictitious_prize']}"> |
|||
<span class="input-group-addon">浏览人数</span> |
|||
<input type="number" name="data[fictitious_pv]" digits="true" class="form-control" value="{$info['fictitious_pv']}"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">规则说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('data[introduce]',$info['introduce']);} |
|||
<span class="help-block">不填则使用设置中的默认规则</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 其他设置 --> |
|||
<div class="tab-pane" id="tab_images"> |
|||
<div class="form-group-title">其他设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">顶部图片轮播</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('data[share_image]',$info['share_image']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">颜色设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">背景颜色</span> |
|||
<input type="color" class="form-control" name="data[bg_color]" value="{$info['bg_color']}" > |
|||
<span class="input-group-addon">小按钮颜色</span> |
|||
<input type="color" class="form-control" name="data[button_color]" value="{$info['button_color']}" > |
|||
<span class="input-group-addon">小按钮阴影</span> |
|||
<input type="color" class="form-control" name="data[button_shadow]" value="{$info['button_shadow']}" > |
|||
</div> |
|||
<span class="help-block">规则说明,奖品,积分按钮背景色。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">背景图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[background_image]', $info['background_image']);} |
|||
<span class="help-block">推荐图片比例:345 * 600</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">获取更多抽奖次数按钮</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[button_more]',$info['button_more']);} |
|||
<span class="help-block">推荐图片比例:190 * 45</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖按钮</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[button_draw]', $info['button_draw']);} |
|||
<span class="help-block">推荐图片比例:124 * 60</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">生成海报按钮</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[button_prize]',$info['button_prize']);} |
|||
<span class="help-block">110 * 45</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海报背景图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[poster_bg]', $info['poster_bg']);} |
|||
<span class="help-block">推荐图片比例:300 * 520</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">背景音乐</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_audio('data[background_music]',$info['background_music']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开始抽奖图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[start_image]',$info['start_image']);} |
|||
<span class="help-block">推荐图片比例:300 * 300</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">中奖效果图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[prize_image]', $info['prize_image']);} |
|||
<span class="help-block">推荐图片比例:320 * 435</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖音效</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_audio('data[use_music]',$info['use_music']);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 分享设置 --> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="form-group-title">分享设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[share_title]" maxlength="25" value="{$info['share_title']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" name="data[share_desc]" maxlength="200" rows="5" style="resize: none;">{$info['share_desc']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[share_img]', $info['share_img']);} |
|||
<span class="help-block">推荐图片比例:300 * 300</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$id}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
let prizeList = new Vue({ |
|||
el: "#effectBlock", |
|||
data: { |
|||
oldPrizeList: {php echo json_encode($parizeList)},//JSON.parse('{php echo json_encode($parizeList)}'), |
|||
type: "{$info['type']}",//活动类型:1=9宫格,2=16宫格,3=轮盘 |
|||
number: parseInt("{php if($info['type'] == 1) echo 9;else if($info['type'] == 2) echo 16;else echo count($parizeList);}"),//宫格数量 |
|||
prize: {php echo json_encode($parizeList)},//JSON.parse('{php echo json_encode($parizeList)}'), |
|||
wheel: JSON.parse('{php echo json_encode($info["wheel_bg"])}') ? JSON.parse('{php echo json_encode($info["wheel_bg"])}') : ['#E6A53F','#E6DB74'], |
|||
}, |
|||
watch: { |
|||
'type'() { |
|||
//修改类型信息 |
|||
if (this.type == 1) this.number = 9; |
|||
else if (this.type == 2 ) this.number = 16; |
|||
else if (this.type == 3 && this.number > 12) this.number = 12; |
|||
//生成新的内容信息 |
|||
this.createList(); |
|||
this.$forceUpdate(); |
|||
}, |
|||
prize:{ |
|||
handler(newVal, oldVal){ |
|||
//内容改变 |
|||
let _this = this; |
|||
this.$nextTick(function(){ |
|||
_this.eachLeaf(); |
|||
}); |
|||
}, |
|||
deep:true |
|||
}, |
|||
wheel:{ |
|||
handler(newVal, oldVal){ |
|||
//内容改变 |
|||
let _this = this; |
|||
this.$nextTick(function(){ |
|||
_this.eachLeaf(); |
|||
}); |
|||
}, |
|||
deep:true |
|||
} |
|||
}, |
|||
methods: { |
|||
//生成信息列表 |
|||
createList(){ |
|||
let _this = this, |
|||
oldPrize = _this.prize, |
|||
prize = {}; |
|||
for(let i=1;i<=_this.number;i++){ |
|||
if(!oldPrize[i]){ |
|||
prize[i] = { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/weliam_smartcity/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}; |
|||
}else{ |
|||
prize[i] = { |
|||
'draw_goods_id': oldPrize[i] ? oldPrize[i]['draw_goods_id'] : this.oldPrizeList[i]['draw_goods_id'] ? this.oldPrizeList[i]['draw_goods_id'] : 0, |
|||
'draw_goods_name': oldPrize[i] ? oldPrize[i]['draw_goods_name'] : this.oldPrizeList[i]['draw_goods_name'] ? this.oldPrizeList[i]['draw_goods_name'] : '谢谢参与', |
|||
'draw_goods_image': oldPrize[i] ? oldPrize[i]['draw_goods_image'] : this.oldPrizeList[i]['draw_goods_image'] ? this.oldPrizeList[i]['draw_goods_image'] : '../addons/weliam_smartcity/web/resource/images/not-prize.png', |
|||
'probability': oldPrize[i] ? oldPrize[i]['probability'] : this.oldPrizeList[i]['probability'] ? this.oldPrizeList[i]['probability'] : 10, |
|||
}; |
|||
} |
|||
} |
|||
|
|||
_this.prize = prize; |
|||
}, |
|||
//点击清除奖品信息 |
|||
cancel(index){ |
|||
this.prize[index] = { |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/weliam_smartcity/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}; |
|||
}, |
|||
//获取总的中奖概率 |
|||
getTotalProbability(){ |
|||
let totalProbability = 0; |
|||
$.each(this.prize,function (k,v) { |
|||
totalProbability = parseFloat(totalProbability) + parseFloat(v['probability']); |
|||
totalProbability = totalProbability.toFixed(2); |
|||
}); |
|||
return totalProbability; |
|||
}, |
|||
//轮盘信息处理 |
|||
eachLeaf(){ |
|||
let _this = this; |
|||
//清除所有样式信息 |
|||
$(".grid").attr('style',''); |
|||
$(".effect").attr('style',''); |
|||
$(".leaf-block").attr('style',''); |
|||
$(".grid-block").attr('style',''); |
|||
//样式为轮盘 进行样式处理 |
|||
if(_this.type == 3){ |
|||
//let totalSize = _this.getTotalProbability();//当前总概率 |
|||
//循环处理每一个扇叶 |
|||
let _position = 0; |
|||
$(".leaf").each(function (index) { |
|||
if(index > 1) index = index % 2; |
|||
$(this).css("background-color", _this.wheel[index]); |
|||
//START 根据概率获取当前扇叶的宽度和位置 |
|||
// let _index = $(this).data("index"); |
|||
// let probability = _this.prize[_index].probability; |
|||
// let proportion = parseFloat(probability) / parseFloat(totalSize); |
|||
// proportion = proportion.toFixed(2); |
|||
// let width = parseFloat(360) * parseFloat(proportion); |
|||
// width = width.toFixed(2); |
|||
//let deg = parseFloat(180) + (parseFloat(90) - parseFloat(width)); |
|||
//if(probability >= 50) deg = 90;//当前扇页的概率大于等于一般则固定为90 |
|||
//END 根据概率获取当前扇叶的宽度和位置 |
|||
//START 等比例获取当前扇叶的宽度和位置 |
|||
let length = Object.keys(_this.prize).length; |
|||
let width =parseFloat(360) / parseInt(length); |
|||
let deg = parseFloat(180) + (parseFloat(90) - parseFloat(width)); |
|||
//END 等比例获取当前扇叶的宽度和位置 |
|||
$(this).css({ |
|||
'-webkit-transform':'rotate('+_position+'deg) skew('+deg+'deg)', |
|||
'-moz-transform':'rotate('+_position+'deg) skew('+deg+'deg)', |
|||
'-ms-transform':'rotate('+_position+'deg) skew('+deg+'deg)', |
|||
'transform':'rotate('+_position+'deg) skew('+deg+'deg)', |
|||
}); |
|||
//处理子类信息 |
|||
let serialNumberDeg = parseFloat(360) - parseFloat(deg); |
|||
serialNumberDeg = serialNumberDeg.toFixed(2); |
|||
$(this).children(".leaf-block").css({ |
|||
'-webkit-transform':'rotate(0deg) skew('+serialNumberDeg+'deg)', |
|||
'-moz-transform':'rotate(0deg) skew('+serialNumberDeg+'deg)', |
|||
'-ms-transform':'rotate(0deg) skew('+serialNumberDeg+'deg)', |
|||
'transform':'rotate(0deg) skew('+serialNumberDeg+'deg)', |
|||
}); |
|||
//_position增长 |
|||
_position = parseFloat(_position) + parseFloat(width); |
|||
}); |
|||
} |
|||
}, |
|||
//点击添加商品 最少4个,最多12个 |
|||
addGoods(){ |
|||
//判断数量是否到达限制 |
|||
let length = Object.keys(this.prize).length; |
|||
if(length >= 12){ |
|||
tip.alert("数量已达限制"); |
|||
return false; |
|||
} |
|||
//获取新的prize列表 |
|||
let prize = this.prize; |
|||
//添加一个内容 |
|||
let prizeType = typeof prize; |
|||
if(prizeType != 'array') prize = Object.values(prize); |
|||
prize.push({ |
|||
'draw_goods_id': 0, |
|||
'draw_goods_name': '谢谢参与', |
|||
'draw_goods_image': '../addons/weliam_smartcity/web/resource/images/not-prize.png', |
|||
'probability': 10, |
|||
}); |
|||
prize = this.arrayKeyUpdate(Object.values(prize)); |
|||
prize = JSON.stringify(prize); |
|||
this.prize = JSON.parse(prize); |
|||
this.number++; |
|||
this.$forceUpdate(); |
|||
}, |
|||
//点击删除商品 最少4个,最多12个 |
|||
deleteGoods(index){ |
|||
let prize = this.prize; |
|||
//删除内容 |
|||
delete prize[index]; |
|||
//信息重组 |
|||
prize = this.arrayKeyUpdate(Object.values(prize)); |
|||
this.prize = prize; |
|||
this.number--; |
|||
this.$forceUpdate(); |
|||
}, |
|||
//由于数组初始化后键值从0开始 这里要修改为从1开始 |
|||
arrayKeyUpdate(prize){ |
|||
let newArray = {}; |
|||
$.each(prize,function (k,v) { |
|||
newArray[k+1] = v; |
|||
}); |
|||
return newArray; |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.eachLeaf(); |
|||
} |
|||
}); |
|||
/** |
|||
* 信息改变 同步改变信息 |
|||
*/ |
|||
$("#effectBlock").on("change",'.draw_goods_info',function () { |
|||
//基本信息获取 |
|||
let fields = $(this).attr("fields"), |
|||
index = $(this).attr("index"), |
|||
val = $(this).val(); |
|||
//替换信息 |
|||
prizeList.prize[index][fields] = val; |
|||
}); |
|||
/** |
|||
* 监听滚动操作 |
|||
*/ |
|||
$(window).scroll(function(event){ |
|||
let top = $("#probabilityDivPosition").offset().top-$(window).scrollTop(); |
|||
if(top > 50){ |
|||
//正常 因为顶部有50距离 所以偏离50px |
|||
$("#probabilityDiv").removeClass('probabilityDiv'); |
|||
}else{ |
|||
//超出 固定在顶部 |
|||
$("#probabilityDiv").addClass('probabilityDiv'); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,112 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">活动列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('draw/draw/add')}" class="btn btn-primary">添加活动</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="draw" /> |
|||
<input type="hidden" name="ac" value="draw" /> |
|||
<input type="hidden" name="do" value="index" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">活动名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入活动名称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动类型</label> |
|||
<div class="col-sm-9"> |
|||
<select name="type" class="form-control"> |
|||
<option value="0" {if $type == 0}selected{/if}>全部</option> |
|||
<option value="1" {if $type == 1}selected{/if}>9宫格</option> |
|||
<option value="2" {if $type == 2}selected{/if}>16宫格</option> |
|||
<option value="2" {if $type == 3}selected{/if}>轮盘</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<select name="status" class="form-control"> |
|||
<option value="0" {if $status == 0}selected{/if}>全部</option> |
|||
<option value="1" {if $status == 1}selected{/if}>未开启</option> |
|||
<option value="2" {if $status == 2}selected{/if}>使用中</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('draw/draw/index')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">活动主题</th> |
|||
<th class="text-center">活动类型</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">活动时间</th> |
|||
<th class="text-center">创建时间</th> |
|||
<th class="text-center">奖品数量</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<td>{$item['title']}</td> |
|||
<td> |
|||
{if $item['type'] == 1} |
|||
<label class="label label-info">9宫格</label> |
|||
{elseif $item['type'] == 2} |
|||
<label class="label label-warning">16宫格</label> |
|||
{else} |
|||
<label class="label label-danger">轮盘</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['status'] == 2} |
|||
<label class="label label-primary">使用中</label> |
|||
{else} |
|||
<label class="label label-danger">未开启</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
开始时间:{$item['start_time']}<br /> |
|||
结束时间:{$item['end_time']} |
|||
</td> |
|||
<td>{$item['create_time']}</td> |
|||
<td>{$item['prize']}</td> |
|||
<td> |
|||
<a class="btn btn-info btn-sm js-clip" data-url="{php echo h5_url('pages/subPages2/drawGame/drawGame',['id'=>$item['id']]);}" href="javascript:;">复制链接</a> |
|||
<a class="btn btn-sm btn-warning" href="{php echo web_url('draw/draw/edit',['id'=>$item['id']]);}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('draw/draw/delete',['id'=>$item['id']]);}" data-confirm="确认删除此抽奖活动?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,101 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">基本设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate form" method="post"> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-2 control-label">谢谢参与概率</label>--> |
|||
<!-- <div class="col-sm-9">--> |
|||
<!-- <input class="form-control" type="text" required name="set[not_probability]" min="0.01" max="100" value="{$set['not_probability']}"/>--> |
|||
<!-- <div class="help-block">请填写0-100的数据</div>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">我的奖品背景色</label> |
|||
<div class="col-sm-9"> |
|||
<input type="color" class="form-control" name="set[prize_color]" value="{$set['prize_color']}" style="width: 235px"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">我的奖品顶部图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('set[top]', $set['top']);} |
|||
<div class="help-block">推荐图片比例:750 * 300</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">我的奖品顶部图链接</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group" style="margin: 0;"> |
|||
<input type="text" name="set[top_link]" class="form-control" value="{$set['top_link']}" readonly="readonly" id="advlink" > |
|||
<span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
<span class="input-group-addon btn btn-default clearinput">X</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享页面背景色</label> |
|||
<div class="col-sm-9"> |
|||
<input type="color" class="form-control" name="set[bg_color]" value="{$set['bg_color']}" style="width: 235px"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享页面顶部图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('set[share_top]', $set['share_top']);} |
|||
<div class="help-block">推荐图片比例:750 * 300</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享页面顶部图链接</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group" style="margin: 0;"> |
|||
<input type="text" name="set[share_top_link]" class="form-control" value="{$set['share_top_link']}" readonly="readonly" id="advlink2" > |
|||
<span data-input="#advlink2" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
<span class="input-group-addon btn btn-default clearinput">X</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海报背景图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('set[poster_bg]', $set['poster_bg']);} |
|||
<div class="help-block">推荐图片比例:1380 * 1900</div> |
|||
</div> |
|||
</div> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-2 control-label">规则说明</label>--> |
|||
<!-- <div class="col-sm-9">--> |
|||
<!-- {php echo tpl_diy_editor_create('set[rule]',$set['rule']);}--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">规则说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('set[introduce]',$set['introduce']);} |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 点击删除图片或者链接 |
|||
*/ |
|||
$(".form").on('click','.clearinput',function () { |
|||
$(this).prev().prev().val(''); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,193 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
red{color: #ed5565;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('draw/goods/goodsIndex')}">奖品列表</a></li> |
|||
<li class="active"><a href="javascript:;">添加奖品</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group-title">奖品类型</div> |
|||
<!-- 奖品类型 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"><input type="radio" name="data[type]" value="1" checked="checked"> 现金红包</label> |
|||
{if p('redpack') && j('redpack')} |
|||
<label class="radio-inline"><input type="radio" name="data[type]" value="2"> 线上红包</label> |
|||
{/if} |
|||
<label class="radio-inline"><input type="radio" name="data[type]" value="3"> 积分</label> |
|||
<label class="radio-inline"><input type="radio" name="data[type]" value="4"> 激活码</label> |
|||
<label class="radio-inline"><input type="radio" name="data[type]" value="5"> 商品</label> |
|||
<div class="help-block"> |
|||
<span class="type-class type-red">中奖后将获得对应的<red>现金</red>奖励;请填写1-200之间的数据,否则红包会发送失败!</span> |
|||
<span class="type-class type-onlineRed hide">中奖后将获得一个对应的线上红包</span> |
|||
<span class="type-class type-integral hide">中奖后将获得对应的积分奖励</span> |
|||
<span class="type-class type-code hide">中奖后将获得对应序列的一个激活码</span> |
|||
<span class="type-class type-goods hide">中奖后将<red>免费</red>获得对应的商品</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为现金红包时 扩展内容 --> |
|||
<div class="type-class type-red"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">领取方式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"><input type="radio" name="data[get_type]" value="1" checked="checked"> 发送现金红包</label> |
|||
<label class="radio-inline"><input type="radio" name="data[get_type]" value="2"> 增加到余额</label> |
|||
<div class="help-block">注意:选择发送现金红包时;请保证微信商户中余额充足!设置为发送现金红包时金额必须大于等于1!</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红包金额</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" id="redPackageMoney" min="1" type="number" name="data[prize_number]"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为线上红包时 扩展内容 --> |
|||
<div class="type-class type-onlineRed hide"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择红包</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_redPack();} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为积分时 扩展内容 --> |
|||
<div class="type-class type-integral hide"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖励积分</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" name="data[prize_number]"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为激活码时 扩展内容 --> |
|||
<div class="type-class type-code hide"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码(组)</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[code_keyword]" class="form-control"> |
|||
<option value="" selected>请选择一个激活码序列</option> |
|||
{loop $codeList $vo} |
|||
<option value="{$vo['remark']}">{$vo['remark']}({$vo['total']}份)</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为商品时 扩展内容 --> |
|||
<div class="type-class type-goods hide"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择商品</label> |
|||
<div class="col-sm-9 selectGoodsParams" params='{"is_optionstatus":1}'> |
|||
{php echo tpl_select_goods($info);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 公共设置内容 --> |
|||
<div class="form-group-title">基本设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"><input type="radio" name="data[status]" value="1" checked="checked"> 上架</label> |
|||
<label class="radio-inline"><input type="radio" name="data[status]" value="2"> 下架</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品名称</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[title]" maxlength="25"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">中奖概率</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" required name="data[probability]" min="0.01" max="100"/> |
|||
<div class="help-block">请填写0-100的数据</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">总份数</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[total_number]" value="0"/> |
|||
<div class="help-block">为0则无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">每日份数</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[day_number]" value="0"/> |
|||
<div class="help-block">为0则无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">每人每天可中奖次数</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[day_prize]" value="0"/> |
|||
<div class="help-block">为0则无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">每人总共可中奖次数</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[total_prize]" value="0"/> |
|||
<div class="help-block">为0则无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品logo</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[image]', '');} |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 点击更换类型 |
|||
*/ |
|||
$("[name='data[type]']").on('click',function () { |
|||
//隐藏所有内容 |
|||
$(".type-class").addClass('hide'); |
|||
//根据type显示内容 |
|||
let type = parseInt($(this).val()); |
|||
switch (type) { |
|||
case 1:$(".type-red").removeClass('hide');break;//现金红包 |
|||
case 2:$(".type-onlineRed").removeClass('hide');break;//线上红包 |
|||
case 3:$(".type-integral").removeClass('hide');break;//积分奖励 |
|||
case 4:$(".type-code").removeClass('hide');break;//激活码 |
|||
case 5:$(".type-goods").removeClass('hide');break;//商品 |
|||
} |
|||
}); |
|||
/** |
|||
* 信息同步 |
|||
*/ |
|||
$("[name='data[prize_number]']").on('change',function () { |
|||
let val = $(this).val(); |
|||
$("[name='data[prize_number]']").val(val); |
|||
}); |
|||
/** |
|||
* 修改现金红包最小值 |
|||
*/ |
|||
$("[name='data[get_type]']").on('change',function () { |
|||
let val = $(this).val(); |
|||
if(val == 1) $("#redPackageMoney").attr('min',1); |
|||
else $("#redPackageMoney").attr('min',0.01); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,222 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
red{color: #ed5565;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('draw/goods/goodsIndex')}">奖品列表</a></li> |
|||
<li class="active"><a href="javascript:;">编辑奖品 - {$info['title']}</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group-title">奖品类型</div> |
|||
<!-- 奖品类型 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="1" {if $info['type'] == 1}checked="checked"{/if}> 现金红包 |
|||
</label> |
|||
{if p('redpack') && j('redpack')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="2" {if $info['type'] == 2}checked="checked"{/if}> 线上红包 |
|||
</label> |
|||
{/if} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="3" {if $info['type'] == 3}checked="checked"{/if}> 积分 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="4" {if $info['type'] == 4}checked="checked"{/if}> 激活码 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="5" {if $info['type'] == 5}checked="checked"{/if}> 商品 |
|||
</label> |
|||
<div class="help-block"> |
|||
<span class="type-class type-red {if $info['type'] != 1}hide{/if}">中奖后将获得对应的<red>现金</red>奖励;请填写1-200之间的数据,否则红包会发送失败!</span> |
|||
<span class="type-class type-onlineRed {if $info['type'] != 2}hide{/if}">中奖后将获得一个对应的线上红包</span> |
|||
<span class="type-class type-integral {if $info['type'] != 3}hide{/if}">中奖后将获得对应的积分奖励</span> |
|||
<span class="type-class type-code {if $info['type'] != 4}hide{/if}">中奖后将获得对应序列的一个激活码</span> |
|||
<span class="type-class type-goods {if $info['type'] != 5}hide{/if}">中奖后将<red>免费</red>获得对应的商品,多规格商品不能作为奖品。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为现金红包时 扩展内容 --> |
|||
<div class="type-class type-red {if $info['type'] != 1}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">领取方式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[get_type]" value="1" {if $info['get_type'] == 1}checked="checked"{/if}> 发送现金红包 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[get_type]" value="2" {if $info['get_type'] == 2}checked="checked"{/if}> 增加到余额 |
|||
</label> |
|||
<div class="help-block">注意:选择发送现金红包时;请保证微信商户中余额充足!</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红包金额</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" id="redPackageMoney" name="data[prize_number]" value="{$info['prize_number']}"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为线上红包时 扩展内容 --> |
|||
<div class="type-class type-onlineRed {if $info['type'] != 2}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择红包</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_redPack($info['red_pack_name'],$info['red_pack_id']);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为积分时 扩展内容 --> |
|||
<div class="type-class type-integral {if $info['type'] != 3}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖励积分</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" name="data[prize_number]" value="{$info['prize_number']}"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为激活码时 扩展内容 --> |
|||
<div class="type-class type-code {if $info['type'] != 4}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码(组)</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[code_keyword]" class="form-control"> |
|||
<option value="" selected>请选择一个激活码序列</option> |
|||
{loop $codeList $vo} |
|||
<option value="{$vo['remark']}" {if $info['code_keyword'] == $vo['remark']}selected{/if}>{$vo['remark']}({$vo['total']}份)</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为商品时 扩展内容 --> |
|||
<div class="type-class type-goods {if $info['type'] != 5}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择商品</label> |
|||
<div class="col-sm-9 selectGoodsParams" params='{"is_optionstatus":1}'> |
|||
{php echo tpl_select_goods($info);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 公共设置内容 --> |
|||
<div class="form-group-title">基本设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="1" {if $info['status'] == 1}checked="checked"{/if}> 上架 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="2" {if $info['status'] != 1}checked="checked"{/if}> 下架 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品名称</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[title]" value="{$info['title']}" maxlength="25"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">中奖概率</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" required name="data[probability]" value="{$info['probability']}" min="0.01" max="100"/> |
|||
<div class="help-block">请填写0-100的数据</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">总份数</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[total_number]" value="{$info['total_number']}"/> |
|||
<div class="help-block">为0则无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">每日份数</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[day_number]" value="{$info['day_number']}"/> |
|||
<div class="help-block">为0则无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">每人每天可中奖次数</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[day_prize]" value="{$info['day_prize']}"/> |
|||
<div class="help-block">为0则无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">每人总共可中奖次数</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" digits="true" required name="data[total_prize]" value="{$info['total_prize']}"/> |
|||
<div class="help-block">为0则无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品logo</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[image]', $info['image']);} |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$info['id']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 点击更换类型 |
|||
*/ |
|||
$("[name='data[type]']").on('click',function () { |
|||
//隐藏所有内容 |
|||
$(".type-class").addClass('hide'); |
|||
//清空所有已填写内容 |
|||
$("[name='data[get_type]']:eq(0)").click(); |
|||
$("[name='data[prize_number]']").val(0.00); |
|||
$("[name='data[red_pack_name]']").val(''); |
|||
$("[name='data[red_pack_id]']").val(''); |
|||
$("[name='data[code_keyword]']").val(''); |
|||
$("[name='data[goods_name]']").val(''); |
|||
$("[name='data[goods_id]']").val(''); |
|||
$("[name='data[goods_plugin]']").val(''); |
|||
$("[name='data[sid]']").val(''); |
|||
//根据type显示内容 |
|||
let type = parseInt($(this).val()); |
|||
switch (type) { |
|||
case 1:$(".type-red").removeClass('hide');break;//现金红包 |
|||
case 2:$(".type-onlineRed").removeClass('hide');break;//线上红包 |
|||
case 3:$(".type-integral").removeClass('hide');break;//积分奖励 |
|||
case 4:$(".type-code").removeClass('hide');break;//激活码 |
|||
case 5:$(".type-goods").removeClass('hide');break;//商品 |
|||
} |
|||
}); |
|||
/** |
|||
* 信息同步 |
|||
*/ |
|||
$("[name='data[prize_number]']").on('change',function () { |
|||
let val = $(this).val(); |
|||
$("[name='data[prize_number]']").val(val); |
|||
}); |
|||
/** |
|||
* 修改现金红包最小值 |
|||
*/ |
|||
$("[name='data[get_type]']").on('change',function () { |
|||
let val = $(this).val(); |
|||
if(val == 1) $("#redPackageMoney").attr('min',1); |
|||
else $("#redPackageMoney").attr('min',0.01); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,149 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">奖品列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<!-- 顶部按钮 --> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('draw/goods/goodsAdd');}" class="btn btn-primary">添加奖品</a> |
|||
</div> |
|||
<!-- 搜索内容 --> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="draw" /> |
|||
<input type="hidden" name="ac" value="goods" /> |
|||
<input type="hidden" name="do" value="goodsIndex" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">奖品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入奖品名称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>0,'status'=>$status,'title'=>$title])}" class="btn {if $type == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>1,'status'=>$status,'title'=>$title])}" class="btn {if $type == 1}btn-primary{else}btn-default{/if}">现金红包</a> |
|||
{if p('redpack') && j('redpack')} |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>2,'status'=>$status,'title'=>$title])}" class="btn {if $type == 2}btn-primary{else}btn-default{/if}">线上红包</a> |
|||
{/if} |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>3,'status'=>$status,'title'=>$title])}" class="btn {if $type == 3}btn-primary{else}btn-default{/if}">积分</a> |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>4,'status'=>$status,'title'=>$title])}" class="btn {if $type == 4}btn-primary{else}btn-default{/if}">激活码</a> |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>5,'status'=>$status,'title'=>$title])}" class="btn {if $type == 5}btn-primary{else}btn-default{/if}">商品</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>$type,'status'=>0,'title'=>$title])}" class="btn {if $status == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>$type,'status'=>1,'title'=>$title])}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">开启</a> |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>$type,'status'=>2,'title'=>$title])}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="hide" name="type" value="{$type}"> |
|||
<input type="text" class="hide" name="status" value="{$status}"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('draw/goods/goodsIndex',['type'=>0,'status'=>0,'title'=>''])}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!-- 表格内容 --> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"> |
|||
<input type="checkbox" name="checkall" value="" id="checkall" class="checkboxall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/> |
|||
</th> |
|||
<th class="text-center">奖品名称</th> |
|||
<th class="text-center">奖品类型</th> |
|||
<th class="text-center">奖品图片</th> |
|||
<th class="text-center">中奖概率</th> |
|||
<th class="text-center">奖品状态</th> |
|||
<th class="text-center">总库存(已抽中/剩余/总数量)</th> |
|||
<th class="text-center">今日(已抽中/剩余/总数量)</th> |
|||
<th class="text-center">添加时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $vo} |
|||
<tr class="text-center"> |
|||
<td><center><input type="checkbox" name="items[]" value="{$vo['id']}" class="checkbox" /></center></td> |
|||
<td>{$vo['title']}</td> |
|||
<td> |
|||
{if $vo['type'] == 1} |
|||
<label class="label label-primary">现金红包</label> |
|||
{elseif $vo['type'] == 2} |
|||
<label class="label label-info">线上红包</label> |
|||
{elseif $vo['type'] == 3} |
|||
<label class="label label-default">积分</label> |
|||
{elseif $vo['type'] == 4} |
|||
<label class="label label-danger">激活码</label> |
|||
{else} |
|||
<label class="label label-warning">商品</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{php echo tomedia($vo['image']);}" data-url="{php echo tomedia($mem['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td>{$vo['probability']}%</td> |
|||
<td> |
|||
{if $vo['status'] == 1} |
|||
<label class="label label-primary">上架</label> |
|||
{else} |
|||
<label class="label label-danger">下架</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<!-- sales = 已抽中,surplus = 剩余,number = 总数量; 已抽中/剩余/总数量--> |
|||
{$vo['total_sales']} |
|||
/ |
|||
{if $vo['total_number'] > 0} {$vo['total_surplus']} {else} - {/if} |
|||
/ |
|||
{if $vo['total_number'] > 0} {$vo['total_number']} {else} - {/if} |
|||
</td> |
|||
<td> |
|||
{$vo['day_sales']} |
|||
/ |
|||
{if $vo['day_number'] > 0} {$vo['day_surplus']} {else} - {/if} |
|||
/ |
|||
{if $vo['day_number'] > 0} {$vo['day_number']} {else} - {/if} |
|||
</td> |
|||
<td>{php echo date("Y-m-d H:i:s",$vo['create_time']);}</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-warning" href="{php echo web_url('draw/goods/goodsEdit',['id'=>$vo['id']]);}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('draw/goods/delete',['ids'=>$vo['id']]);}" data-confirm="确认删除此奖品?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default btn-sm" type="button" onclick="location.reload();"><i class="fa fa-refresh"></i></button> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' |
|||
data-confirm="确定删除当前选择的奖品?" |
|||
data-href="{php echo web_url('draw/goods/delete')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,187 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user .image{ |
|||
display: inline-block; |
|||
} |
|||
.user .image img{ |
|||
width: 50px; |
|||
height: 50px; |
|||
border-radius: 50%; |
|||
} |
|||
.user .title{ |
|||
display: inline-block; |
|||
} |
|||
.goods .image{ |
|||
display: inline-block; |
|||
float: left; |
|||
} |
|||
.goods .image img{ |
|||
width: 50px; |
|||
height: 50px; |
|||
} |
|||
.goods .title{ |
|||
display: inline-block; |
|||
width: calc(100% - 80px); |
|||
height: 50px; |
|||
line-height: 25px; |
|||
text-align: left; |
|||
} |
|||
.cored{ |
|||
color: orangered; |
|||
margin-right: 20px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">奖品列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<!-- 顶部搜索内容 --> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"></div> |
|||
<div class="filter-list"> |
|||
<div class="alert alert-warning"> |
|||
注意:默认获取当前月的信息列表,如需要其他时间段的信息请自行筛选!<br /> |
|||
注意:删除中奖信息后不退还已领取奖品,但是会减少已抽奖次数,如果存在免费抽奖次数则会增加对应的免费抽奖次数!<br /> |
|||
抽奖数(总):<span class="cored">{$statisticsInfo['total_draw']}</span> |
|||
中奖数(总):<span class="cored">{$statisticsInfo['total_prize']}</span> |
|||
抽奖数(当月):<span class="cored">{$statisticsInfo['month_total_draw']}</span> |
|||
中奖数(当月):<span class="cored">{$statisticsInfo['month_total_prize']}</span> |
|||
抽奖数(今天):<span class="cored">{$statisticsInfo['day_total_draw']}</span> |
|||
中奖数(今天):<span class="cored">{$statisticsInfo['day_total_prize']}</span> |
|||
</div> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="draw" /> |
|||
<input type="hidden" name="ac" value="prize" /> |
|||
<input type="hidden" name="do" value="prizeIndex" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">奖品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入奖品名称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">用户昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入用户昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">活动名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="name" value="{$name}" placeholder="请输入活动名称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品类型</label> |
|||
<div class="col-sm-9"> |
|||
<select name="type" class="form-control"> |
|||
<option value="0" {if $type == 0}selected{/if}>全部</option> |
|||
<option value="1" {if $type == 1}selected{/if}>现金红包</option> |
|||
<option value="2" {if $type == 2}selected{/if}>线上红包</option> |
|||
<option value="3" {if $type == 3}selected{/if}>积分</option> |
|||
<option value="4" {if $type == 4}selected{/if}>激活码</option> |
|||
<option value="5" {if $type == 5}selected{/if}>商品</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否领取</label> |
|||
<div class="col-sm-9"> |
|||
<select name="is_get" class="form-control"> |
|||
<option value="0" {if $isGet == 0}selected{/if}>全部</option> |
|||
<option value="1" {if $isGet == 1}selected{/if}>未领取</option> |
|||
<option value="2" {if $isGet == 2}selected{/if}>已领取</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖时间</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_time_info('draw_times', [ 'starttime' => date('Y-m-d H:i',$startTime), 'endtime' => date("Y-m-d H:i",$endTime)]);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<button class="btn btn-warning" type="submit" name="export" value="1">导出</button> |
|||
<a href="{php echo web_url('draw/prize/prizeIndex')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!-- 表格内容 --> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"> |
|||
<input type="checkbox" name="checkall" value="" id="checkall" class="checkboxall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/> |
|||
</th> |
|||
<th class="text-center">活动信息</th> |
|||
<th class="text-center">用户信息</th> |
|||
<th class="text-center">中奖信息</th> |
|||
<th class="text-center">抽奖时间</th> |
|||
<th class="text-center">是否领取</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $vo} |
|||
<tr class="text-center"> |
|||
<td><center><input type="checkbox" name="items[]" value="{$vo['id']}" class="checkbox" /></center></td> |
|||
<td>{$vo['draw_title']}</td> |
|||
<td class="user"> |
|||
<div class="image"> |
|||
<img src="{$vo['avatar']}" /> |
|||
</div> |
|||
<div class="title">{$vo['nickname']}</div> |
|||
</td> |
|||
<td class="goods"> |
|||
{if $vo['draw_goods_id'] > 0} |
|||
<div class="image"> |
|||
<img src="{$vo['image']}" /> |
|||
</div> |
|||
<div class="title">{$vo['title']}</div> |
|||
{else} |
|||
<label class="label label-danger">未中奖</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$vo['create_time']}</td> |
|||
<td> |
|||
{if $vo['is_get'] == 1} |
|||
<label class="label label-danger">未领取</label> |
|||
{else} |
|||
<label class="label label-primary">已领取</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-danger" |
|||
data-toggle="ajaxRemove" |
|||
href="{php echo web_url('draw/prize/delete',['ids'=>$vo['id']]);}" |
|||
data-confirm="确认删除当前抽奖记录?删除后用户中奖奖品可能出现错误。请与用户沟通后删除否则后果自负!" |
|||
>删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default btn-sm" type="button" onclick="location.reload();"><i class="fa fa-refresh"></i></button> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' |
|||
data-confirm="确定删除当前选择的奖品?" |
|||
data-href="{php echo web_url('draw/prize/delete')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,97 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user .image{ |
|||
display: inline-block; |
|||
} |
|||
.user .image img{ |
|||
width: 50px; |
|||
height: 50px; |
|||
border-radius: 50%; |
|||
} |
|||
.user .title{ |
|||
display: inline-block; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">用户列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<!-- 顶部搜索内容 --> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"></div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="draw" /> |
|||
<input type="hidden" name="ac" value="user" /> |
|||
<input type="hidden" name="do" value="userIndex" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">用户昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入用户昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<button class="btn btn-warning" type="submit" name="export" value="1">导出</button> |
|||
<a href="{php echo web_url('draw/user/userIndex')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!-- 表格内容 --> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">用户信息</th> |
|||
<th class="text-center">手机号</th> |
|||
<th class="text-center">积分/余额</th> |
|||
<th class="text-center">抽奖次数</th> |
|||
<th class="text-center">中奖次数</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $vo} |
|||
<tr class="text-center"> |
|||
<td class="user"> |
|||
<div class="image"> |
|||
<img src="{$vo['avatar']}" /> |
|||
</div> |
|||
<div class="title">{$vo['nickname']}</div> |
|||
</td> |
|||
<td>{if $vo['mobile']}{$vo['mobile']}{else}--{/if}</td> |
|||
<td> |
|||
<span class="label label-info"> |
|||
积分 {if $vo['credit1']}{$vo['credit1']}{else}0.00{/if} |
|||
</span> |
|||
<br> |
|||
<span class="label label-warning" style="display: inline-block;margin-top: 5px;"> |
|||
余额 {if $vo['credit2']}{$vo['credit2']}{else}0.00{/if} |
|||
</span> |
|||
</td> |
|||
<td>{$vo['total_draw']}</td> |
|||
<td>{$vo['total_prize']}</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-danger" href="{php echo web_url('draw/prize/prizeIndex',['mid'=>$vo['mid']]);}">查看详情</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||