Compare commits
2 Commits
b969164351
...
858f41a675
| Author | SHA1 | Date |
|---|---|---|
|
|
858f41a675 | |
|
|
184cda87ee |
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
|
||||
namespace addon\cossms\admin\controller;
|
||||
|
||||
use app\admin\controller\BaseAdmin;
|
||||
use app\model\message\Message as MessageModel;
|
||||
|
||||
/**
|
||||
* 阿里云短信消息管理
|
||||
*/
|
||||
class Message extends BaseAdmin
|
||||
{
|
||||
/**
|
||||
* 编辑模板消息
|
||||
* @return array|mixed|string
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$message_model = new MessageModel();
|
||||
$keywords = input("keywords", "");
|
||||
$info_result = $message_model->getMessageInfo($this->site_id,$keywords);
|
||||
$info = $info_result["data"];
|
||||
if (request()->isAjax()) {
|
||||
if (empty($info))
|
||||
return error("", "不存在的模板信息!");
|
||||
$sms_json_array = $info["sms_json_array"];//短信配置
|
||||
$template_id = input("template_id", '');//短信模板id
|
||||
$smssign = input("smssign", '');//短信签名
|
||||
$content = input("content", '');//短信签名
|
||||
$sms_is_open = input("sms_is_open", 0);
|
||||
$sms_json_array['template_id'] = $template_id;//模板ID (备注:服务商提供的模板ID)
|
||||
$sms_json_array['content'] = $content;//模板内容 (备注:仅用于显示)
|
||||
$sms_json_array['smssign'] = $smssign;//短信签名 (备注:请填写短信签名(如果服务商是大于请填写审核成功的签名))
|
||||
$data = array(
|
||||
'sms_json' => json_encode($sms_json_array),
|
||||
"sms_is_open" => $sms_is_open,
|
||||
);
|
||||
$condition = array(
|
||||
[ "site_id", "=", $this->site_id ],
|
||||
[ "keywords", "=", $keywords ]
|
||||
);
|
||||
$res = $message_model->editMessage($data, $condition);
|
||||
return $res;
|
||||
} else {
|
||||
if (empty($info))
|
||||
$this->error("不存在的模板信息!");
|
||||
$sms_json_array = $info["sms_json_array"];//短信配置
|
||||
$this->assign("info", $sms_json_array);
|
||||
$this->assign("sms_is_open", $info["sms_is_open"]);
|
||||
$this->assign("keywords", $keywords);
|
||||
//模板变量
|
||||
$message_variable_list = $info["message_json_array"];
|
||||
$this->assign("message_variable_list", $message_variable_list);
|
||||
return $this->fetch('message/edit');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
|
||||
namespace addon\cossms\admin\controller;
|
||||
|
||||
use addon\cossms\model\Config as ConfigModel;
|
||||
use app\admin\controller\BaseAdmin;
|
||||
|
||||
/**
|
||||
* 阿里云短信 控制器
|
||||
*/
|
||||
class Sms extends BaseAdmin
|
||||
{
|
||||
|
||||
public function config()
|
||||
{
|
||||
$config_model = new ConfigModel();
|
||||
if (request()->isAjax()) {
|
||||
$access_key_id = input("access_key_id", "");//access_key_id
|
||||
$access_key_secret = input("access_key_secret", "");//access_key_secret
|
||||
$smssign = input("smssign", '');//短信签名
|
||||
$status = input("status", 0);//启用状态
|
||||
$data = array(
|
||||
"status" => $status,
|
||||
"access_key_id" => $access_key_id,
|
||||
"access_key_secret" => $access_key_secret,
|
||||
"smssign" => $smssign
|
||||
);
|
||||
$result = $config_model->setSmsConfig($data);
|
||||
return $result;
|
||||
} else {
|
||||
$info_result = $config_model->getSmsConfig();
|
||||
$info = $info_result["data"];
|
||||
$this->assign("info", $info);
|
||||
return $this->fetch("sms/config");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
{extend name="../app/admin/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.layui-btn-primary:hover {border-color: #C9C9C9;}
|
||||
.number-con {margin-right: 10px;}
|
||||
.ns-form {margin-top: 0;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form ns-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否开启:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="sms_is_open" value="1" {if $sms_is_open == 1}checked{/if} lay-skin="switch">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>模板ID:</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="template_id" type="text" value="{if !empty($info)}{$info.template_id}{/if}" lay-verify="required" placeholder="短信模板ID" class="layui-input ns-len-long">
|
||||
</div>
|
||||
<div class="ns-word-aux">必须与短信接口的模板ID一致,否则无效!</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">数据值:</label>
|
||||
<div class="layui-input-block">
|
||||
{foreach $message_variable_list as $message_variable_k => $message_variable_v}
|
||||
<button class="layui-btn layui-btn-primary number-con" onclick="clickBtn('{$message_variable_k}')">{$message_variable_v}</button>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">短信内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="text_area" name="content" class="layui-textarea ns-len-long">{if !empty($info)}{$info.content}{/if}</textarea>
|
||||
</div>
|
||||
<div class="ns-word-aux">变量只能使用上方的可用变量中的变量,否则不会被解析;如果要使用凌凯短信时,短信内容必须进行设置。</div>
|
||||
</div>
|
||||
|
||||
<div class="ns-form-row">
|
||||
<button class="layui-btn ns-bg-color" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
<input type="hidden" name="keywords" value="{$keywords}">
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use('form', function() {
|
||||
var form = layui.form;
|
||||
repeat_flag = false; //防重复标识
|
||||
|
||||
form.render();
|
||||
|
||||
/**
|
||||
* 监听提交
|
||||
*/
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
$.ajax({
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
url: ns.url("cossms://admin/message/edit"),
|
||||
data: data.field,
|
||||
success: function(res){
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.confirm('编辑成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续操作'],
|
||||
yes: function(){
|
||||
location.href = ns.url("admin/message/lists")
|
||||
},
|
||||
btn2: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function back(){
|
||||
location.href = ns.url("admin/message/lists");
|
||||
}
|
||||
|
||||
function clickBtn(con) {
|
||||
var txtArea = $("#text_area")[0];
|
||||
var content = txtArea.value; //文本域内容
|
||||
var start = txtArea.selectionStart; //光标的初始位置,selectionStart:选区开始位置;selectionEnd:选区结束位置。
|
||||
|
||||
txtArea.value = content.substring(0, txtArea.selectionStart) + '{' + con + '}' + content.substring(txtArea.selectionEnd, content.length);
|
||||
var position = start + con.length;
|
||||
$("#text_area").focus();
|
||||
txtArea.setSelectionRange(position+1, position+1); //setSelectionRange()方法用来设置<input>元素当前选中的文本的开始和结束位置
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
{extend name="../app/admin/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.ns-form {margin-top: 0;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form ns-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否开启:</label>
|
||||
<div class="layui-input-block" id="isOpen">
|
||||
<input type="checkbox" name="status" lay-filter="isOpen" value="1" lay-skin="switch" {if condition="$info.value && $info.value.status == 1"} checked {/if} />
|
||||
</div>
|
||||
<div class="ns-word-aux">当前使用腾讯云短信配置</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">APP_KEY:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="access_key_id" placeholder="请输入内容APP_KEY" {if $info.value } value="{$info.value.access_key_id}" {/if} autocomplete="off" class="layui-input ns-len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SECRET_KEY:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="access_key_secret" placeholder="请输入SECRET_KEY" {if $info.value } value="{$info.value.access_key_secret}" {/if} autocomplete="off" class="layui-input ns-len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">短信内容签名:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="smssign" placeholder="请输入短信内容签名" {if $info.value } value="{$info.value.smssign}" {/if} autocomplete="off" class="layui-input ns-len-long">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单操作 -->
|
||||
<div class="ns-form-row">
|
||||
<button class="layui-btn ns-bg-color" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use('form', function() {
|
||||
var form = layui.form,
|
||||
repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
$.ajax({
|
||||
url: ns.url("cossms://admin/sms/config"),
|
||||
data: data.field,
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.confirm('编辑成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续操作'],
|
||||
yes: function(){
|
||||
location.href = ns.url("admin/message/sms")
|
||||
},
|
||||
btn2: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function back() {
|
||||
location.href = ns.url("admin/message/sms");
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
return [
|
||||
|
||||
'diy' => [
|
||||
'view' => [
|
||||
],
|
||||
'util' => [
|
||||
],
|
||||
'link' => [
|
||||
],
|
||||
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
// 事件定义文件
|
||||
return [
|
||||
'bind' => [],
|
||||
'listen' => [
|
||||
//展示活动
|
||||
'ShowPromotion' => [
|
||||
'addon\cossms\event\ShowPromotion',
|
||||
],
|
||||
//短信方式
|
||||
'SmsType' => [
|
||||
'addon\cossms\event\SmsType'
|
||||
],
|
||||
'CloseSMS'=>[
|
||||
'addon\cossms\event\CloseSMS'
|
||||
],
|
||||
'DoEditSmsMessage' => [
|
||||
'addon\cossms\event\DoEditSmsMessage'
|
||||
],
|
||||
'SendSms' => [
|
||||
'addon\cossms\event\SendSms'
|
||||
],
|
||||
'SmsTemplateInfo' => [
|
||||
'addon\cossms\event\SmsTemplateInfo'
|
||||
]
|
||||
],
|
||||
'subscribe' => [],
|
||||
];
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
return [
|
||||
'name' => 'cossms',
|
||||
'title' => '腾讯云短信',
|
||||
'description' => '腾讯云短信 SMS短信服务',
|
||||
'status' => 1,
|
||||
'author' => '',
|
||||
'version' => '1.0',
|
||||
'content' => '',
|
||||
];
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 平台端菜单设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
[
|
||||
'name' => 'COS_SMS_CONFIG',
|
||||
'title' => '腾讯短信配置',
|
||||
'url' => 'cossms://admin/sms/config',
|
||||
'parent' => 'SMS_MANAGE',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_select' => '',
|
||||
'sort' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'MESSAGE_COSSMS_EDIT',
|
||||
'title' => '编辑短信模板',
|
||||
'url' => 'cossms://admin/message/edit',
|
||||
'parent' => 'MESSAGE_LISTS',
|
||||
'is_show' => 0,
|
||||
'picture' => '',
|
||||
'picture_select' => '',
|
||||
'sort' => 1,
|
||||
'child_list' => [],
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 平台端菜单设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
[
|
||||
'name' => 'COS_SMS_CONFIG',
|
||||
'title' => 'COS短信配置',
|
||||
'url' => 'cossms://shop/sms/config',
|
||||
'parent' => 'SMS_MANAGE',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_select' => '',
|
||||
'sort' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'MESSAGE_COSSMS_EDIT',
|
||||
'title' => '编辑短信模板',
|
||||
'url' => 'cossms://shop/message/edit',
|
||||
'parent' => 'MESSAGE_LISTS',
|
||||
'is_show' => 0,
|
||||
'picture' => '',
|
||||
'picture_select' => '',
|
||||
'sort' => 1,
|
||||
'child_list' => [],
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
|
||||
namespace addon\cossms\event;
|
||||
use addon\cossms\model\Config;
|
||||
class CloseSMS
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$site_id = 0;
|
||||
$app_module = 'shop';
|
||||
if ($param) {
|
||||
if (isset($param['site_id'])) $site_id = $param['site_id'];
|
||||
if (isset($param['app_module'])) $app_module = $param['app_module'];
|
||||
}
|
||||
if ($param[ 'sms_type' ] != 'alisms') {
|
||||
$config_model = new Config();
|
||||
$res = $config_model->modifyConfigIsUse(0, $site_id,$app_module);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\cossms\event;
|
||||
use addon\cossms\model\Config as ConfigModel;
|
||||
/**
|
||||
* 短信模板 (后台调用)
|
||||
*/
|
||||
class DoEditSmsMessage
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param=[])
|
||||
{
|
||||
$site_id=request()->siteid();
|
||||
$app_module='shop';
|
||||
if($param){
|
||||
if(isset($param['site_id'])) $site_id=$param['site_id'];
|
||||
if(isset($param['app_module'])) $app_module=$param['app_module'];
|
||||
}
|
||||
$config_model = new ConfigModel();
|
||||
$config_result = $config_model->getSmsConfig($site_id,$app_module);
|
||||
$config = $config_result["data"];
|
||||
if ($config["is_use"] == 1) {
|
||||
return [
|
||||
"edit_url" => "cossms://{$app_module}/message/edit",
|
||||
"shop_url" => "cossms://{$app_module}/message/edit",
|
||||
"admin_url" => "cossms://{$app_module}/message/edit"
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
namespace addon\cossms\event;
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
namespace addon\cossms\event;
|
||||
use addon\cossms\model\Sms;
|
||||
/**
|
||||
* 短信发送
|
||||
*/
|
||||
class SendSms
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
* @param $param
|
||||
* @return array|mixed
|
||||
* @throws \Overtrue\EasySms\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$sms = new Sms();
|
||||
$res = $sms->send($param);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
|
||||
namespace addon\cossms\event;
|
||||
|
||||
/**
|
||||
* 店铺活动
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*
|
||||
* @return multitype:number unknown
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$data = [
|
||||
'admin' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'cossms',
|
||||
//展示分类(根据平台端设置,admin(平台营销),shop:店铺营销,member:会员营销, tool:应用工具)
|
||||
'show_type' => 'tool',
|
||||
//展示主题
|
||||
'title' => '腾讯COS短信',
|
||||
//展示介绍
|
||||
'description' => '腾讯云短信管理',
|
||||
//展示图标
|
||||
'icon' => 'addon/cossms/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'cossms://admin/sms/config',
|
||||
]
|
||||
],
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'cossms',
|
||||
//展示分类(根据平台端设置,admin(平台营销),shop:店铺营销,member:会员营销, tool:应用工具)
|
||||
'show_type' => 'tool',
|
||||
//展示主题
|
||||
'title' => '腾讯COS短信',
|
||||
//展示介绍
|
||||
'description' => '腾讯云短信管理',
|
||||
//展示图标
|
||||
'icon' => 'addon/cossms/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'cossms://shop/sms/config',
|
||||
]
|
||||
]
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\cossms\event;
|
||||
use addon\cossms\model\Config;
|
||||
class SmsTemplateInfo
|
||||
{
|
||||
/**
|
||||
* 获取短信模板数据
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$site_id=0;
|
||||
$app_module='shop';
|
||||
if($param){
|
||||
if(isset($param['site_id'])) $site_id=$param['site_id'];
|
||||
if(isset($param['app_module'])) $app_module=$param['app_module'];
|
||||
}
|
||||
$config_model = new Config();
|
||||
$sms_config = $config_model->getSmsConfig($site_id, $app_module);
|
||||
$sms_config = $sms_config[ 'data' ];
|
||||
if ($sms_config['is_use']) {
|
||||
$template_info = model('message_template')->getInfo([ ['keywords', '=', $param['keywords'] ]]);
|
||||
if (!empty($template_info['sms_json'])) {
|
||||
return json_decode($template_info['sms_json'], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
namespace addon\cossms\event;
|
||||
use addon\cossms\model\Config;
|
||||
/**
|
||||
* 短信方式 (后台调用)
|
||||
*/
|
||||
class SmsType
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param=[])
|
||||
{
|
||||
$site_id=0;
|
||||
$app_module='shop';
|
||||
if($param){
|
||||
if(isset($param['site_id'])) $site_id=$param['site_id'];
|
||||
if(isset($param['app_module'])) $app_module=$param['app_module'];
|
||||
}
|
||||
$config_model = new Config();
|
||||
$config = $config_model->getSmsConfig($site_id,$app_module)['data'];
|
||||
$info = array(
|
||||
"sms_type" => "cossms",
|
||||
"sms_type_name" => "腾讯云短信",
|
||||
"status" => $config['is_use']??0,
|
||||
"admin_url" => "cossms://{$app_module}/sms/config",
|
||||
"edit_url" => "cossms://{$app_module}/sms/config",
|
||||
"shop_url" => "cossms://{$app_module}/sms/config",
|
||||
"desc" => "腾讯云短信(Short Message Service,SMS)沉淀腾讯十多年短信服务技术和经验,为 QQ、微信等亿级平台和10万+客户提供国内短信和国际/港澳台短信服务。国内短信验证秒级触达,99%到达率;国际/港澳台短信覆盖全球200+国家/地区,稳定可靠。腾讯云短信旨在帮助广大开发者快速灵活接入高质量的国内、国际/港澳台短信服务。"
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace addon\cossms\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\cossms\model;
|
||||
use app\model\system\Config as ConfigModel;
|
||||
use app\model\BaseModel;
|
||||
/**
|
||||
* 支付宝支付配置
|
||||
*/
|
||||
class Config extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 设置短信配置
|
||||
* array $data
|
||||
*/
|
||||
public function setSmsConfig($data,$is_use,$site_id=0,$app_module='shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
if($is_use){
|
||||
event('CloseSMS', ['sms_type' => 'cossms', 'is_use' => $is_use, 'site_id' => $site_id ,'app_module'=>$app_module]);
|
||||
}
|
||||
$res = $config->setConfig($data,'腾讯云短信配置',$is_use,[[ 'site_id', '=', $site_id ],[ 'app_module', '=',$app_module ], [ 'config_key', '=', 'COS_SMS_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取短信配置
|
||||
*/
|
||||
public function getSmsConfig($site_id=0,$app_module='shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'COS_SMS_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置开关
|
||||
*/
|
||||
public function modifyConfigIsUse($is_use, $site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
if($is_use){
|
||||
event('CloseSMS', ['sms_type' => 'cossms', 'is_use' => $is_use, 'site_id' => $site_id ,'app_module'=>$app_module]);
|
||||
}
|
||||
$config = new ConfigModel();
|
||||
$res = $config->modifyConfigIsUse($is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'COS_SMS_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\cossms\model;
|
||||
use app\model\BaseModel;
|
||||
use Overtrue\EasySms\EasySms;
|
||||
use Overtrue\EasySms\Exceptions\InvalidArgumentException;
|
||||
use Overtrue\EasySms\Exceptions\NoGatewayAvailableException;
|
||||
use Overtrue\EasySms\Strategies\OrderStrategy;
|
||||
/**
|
||||
* 腾讯云短信
|
||||
*/
|
||||
class Sms extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 短信发送
|
||||
* @param array $param
|
||||
* @return array|mixed
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function send($param = [])
|
||||
{
|
||||
$config_model = new Config();
|
||||
$site_id=$param['site_id']??0;
|
||||
$app_module=$param['app_module']??'shop';
|
||||
$config_result = $config_model->getSmsConfig($site_id,$app_module);
|
||||
if ($config_result["data"]["is_use"]) {
|
||||
$config = $config_result["data"]["value"];
|
||||
$sms_info = $param["message_info"]["sms_json_array"];//消息类型模板 短信模板信息
|
||||
if (empty($sms_info)) return $this->error([], "消息模板尚未配置");
|
||||
$sms_info = $sms_info[ "cossms" ];
|
||||
$var_parse = $param["var_parse"];//变量解析
|
||||
$account = $param["sms_account"]??$param['mobile'];//发送手机号
|
||||
$template = $sms_info["template_id"]??'';//发送模板ID
|
||||
//加入腾讯云短信配置
|
||||
$sms_config = [
|
||||
// HTTP 请求的超时时间(秒)
|
||||
'timeout' => 5.0,
|
||||
// 默认发送配置
|
||||
'default' => [
|
||||
// 网关调用策略,默认:顺序调用
|
||||
'strategy' => OrderStrategy::class,
|
||||
// 默认可用的发送网关
|
||||
'gateways' => ['qcloud'],
|
||||
],
|
||||
// 可用的网关配置
|
||||
'gateways' => [
|
||||
'qcloud' => [
|
||||
'sdk_app_id' => $config["sdk_app_id"], // SDK APP ID
|
||||
'app_key' => $config["sdk_app_key"],// APP KEY
|
||||
'secret_id' =>$config['secret_id'], //'AKIDARZRAj9KGySjmaBalgbT8oaCau21nLgo', // SECRET ID
|
||||
'secret_key' =>$config['secret_key'], //'8DGOXYRBsS3b2Mdp15xb2W3RluqhNnzw', // SECRET KEY
|
||||
'sign_name' =>$config['smssign'] //'恒泰茶缘网络', // 短信签名
|
||||
]
|
||||
],
|
||||
];
|
||||
try {
|
||||
unset($var_parse['site_name']);
|
||||
$easySms = new EasySms($sms_config);
|
||||
$easySms->send($account, [
|
||||
'template' => $template, // 模板ID
|
||||
'content' =>$sms_info["content"], // 模板内容
|
||||
'data' => $var_parse
|
||||
]);
|
||||
return $this->success([ "addon" => "cossms", "addon_name" => "腾讯云短信", "content" => $sms_info["content"] ]);
|
||||
} catch (NoGatewayAvailableException $exception) {
|
||||
$message = $exception->getException('qcloud')->getMessage();
|
||||
return $this->error([ "content" => $sms_info["content"] ], $message ? : '短信发送异常');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\cossms\shop\controller;
|
||||
use app\model\message\Message as MessageModel;
|
||||
use app\model\message\MessageTemplate as MessageTemplateModel;
|
||||
use app\shop\controller\BaseShop;
|
||||
/**
|
||||
* 阿里云短信消息管理
|
||||
*/
|
||||
class Message extends BaseShop
|
||||
{
|
||||
/**
|
||||
* 编辑模板消息
|
||||
* @return array|mixed|string
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$message_model = new MessageModel();
|
||||
$keywords = input("keywords", "");
|
||||
$info_result = $message_model->getMessageInfo($this->site_id, $keywords);
|
||||
$info = $info_result["data"];
|
||||
if (request()->isAjax()) {
|
||||
if (empty($info))
|
||||
return error("", "不存在的模板信息!");
|
||||
$sms_is_open = input('sms_is_open', 0);
|
||||
$sms_json_array = !empty($info["sms_json_array"]) ? $info["sms_json_array"] : [];//短信配置
|
||||
$template_id = input("template_id", '');//短信模板id
|
||||
$smssign = input("smssign", '');//短信签名
|
||||
$content = input("content", '');//短信签名
|
||||
|
||||
$cossms_array = [];
|
||||
if (!empty($sms_json_array["cossms"])) {
|
||||
$cossms_array = $sms_json_array["cossms"];
|
||||
}
|
||||
$cossms_array['template_id'] = $template_id;//模板ID (备注:服务商提供的模板ID)
|
||||
$cossms_array['content'] = $content;//模板内容 (备注:仅用于显示)
|
||||
$cossms_array['smssign'] = $smssign;//短信签名 (备注:请填写短信签名(如果服务商是大于请填写审核成功的签名))
|
||||
$sms_json_array["cossms"] = $cossms_array;
|
||||
$data = array(
|
||||
'sms_json' => json_encode($sms_json_array),
|
||||
);
|
||||
$condition = array(
|
||||
["keywords", "=", $keywords]
|
||||
);
|
||||
$template_model = new MessageTemplateModel();
|
||||
$res = $template_model->editMessageTemplate($data, $condition);
|
||||
if ($res['code'] == 0) {
|
||||
$res = $message_model->editMessage(['sms_is_open' => $sms_is_open, 'site_id' => $this->site_id, 'keywords' => $keywords], [
|
||||
["keywords", "=", $keywords],
|
||||
['site_id', '=', $this->site_id],
|
||||
]);
|
||||
}
|
||||
return $res;
|
||||
} else {
|
||||
if (empty($info))
|
||||
$this->error("不存在的模板信息!");
|
||||
|
||||
$sms_json_array = $info["sms_json_array"];//短信配置
|
||||
$cossms_array = [];
|
||||
if (!empty($sms_json_array["cossms"])) {
|
||||
$cossms_array = $sms_json_array["cossms"];
|
||||
}
|
||||
|
||||
$this->assign("info", $cossms_array);
|
||||
$this->assign("keywords", $keywords);
|
||||
|
||||
//模板变量
|
||||
$message_variable_list = $info["message_json_array"];
|
||||
$this->assign("message_variable_list", $message_variable_list);
|
||||
|
||||
$this->assign('sms_is_open', $info['sms_is_open']);
|
||||
return $this->fetch('message/edit');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\cossms\shop\controller;
|
||||
use addon\cossms\model\Config as ConfigModel;
|
||||
use app\shop\controller\BaseShop;
|
||||
/**
|
||||
* 短信 控制器
|
||||
*/
|
||||
class Sms extends BaseShop
|
||||
{
|
||||
public function config()
|
||||
{
|
||||
$config_model = new ConfigModel();
|
||||
if (request()->isAjax()) {
|
||||
$sdk_app_id = input("sdk_app_id", "");//sdk_app_id
|
||||
$sdk_app_key = input("sdk_app_key", "");//sdk_app_key
|
||||
$secret_id = input("secret_id", "");//secret_id
|
||||
$secret_key = input("secret_key", "");//secret_key
|
||||
$smssign = input("smssign", '');//短信签名
|
||||
$status = input("status", 0);//启用状态
|
||||
$data = array (
|
||||
"sdk_app_id" => $sdk_app_id,
|
||||
"sdk_app_key" => $sdk_app_key,
|
||||
"secret_id" => $secret_id,
|
||||
"secret_key" => $secret_key,
|
||||
"smssign" => $smssign
|
||||
);
|
||||
$result = $config_model->setSmsConfig($data, $status, $this->site_id, $this->app_module);
|
||||
return $result;
|
||||
} else {
|
||||
$info_result = $config_model->getSmsConfig($this->site_id, $this->app_module);
|
||||
$info = $info_result[ "data" ];
|
||||
$this->assign("info", $info);
|
||||
return $this->fetch("sms/config");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.layui-btn-primary:hover {border-color: #C9C9C9;}
|
||||
.number-con {margin-right: 10px;}
|
||||
.ns-form {margin-top: 0;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form ns-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否开启:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="sms_is_open" value="1" {if $sms_is_open == 1}checked{/if} lay-skin="switch">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>模板ID:</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="template_id" type="text" value="{if !empty($info)}{$info.template_id}{/if}" lay-verify="required" placeholder="短信模板ID" class="layui-input len-long">
|
||||
</div>
|
||||
<div class="word-aux">必须与短信接口的模板ID一致,否则无效!</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">数据值:</label>
|
||||
<div class="layui-input-block">
|
||||
{foreach $message_variable_list as $message_variable_k => $message_variable_v}
|
||||
<button class="layui-btn layui-btn-primary number-con" onclick="clickBtn('{$message_variable_k}')">{$message_variable_v}</button>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">短信内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="text_area" name="content" class="layui-textarea ns-len-long">{if !empty($info)}{$info.content}{/if}</textarea>
|
||||
</div>
|
||||
<div class="word-aux">变量只能使用上方的可用变量中的变量,否则不会被解析;如果要使用凌凯短信时,短信内容必须进行设置。</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn bg-color" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
<input type="hidden" name="keywords" value="{$keywords}">
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use('form', function() {
|
||||
var form = layui.form;
|
||||
repeat_flag = false; //防重复标识
|
||||
|
||||
form.render();
|
||||
|
||||
/**
|
||||
* 监听提交
|
||||
*/
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
$.ajax({
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
url: ns.url("cossms://shop/message/edit"),
|
||||
data: data.field,
|
||||
success: function(res){
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.confirm('编辑成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续操作'],
|
||||
yes: function(){
|
||||
location.href = ns.url("shop/message/lists")
|
||||
},
|
||||
btn2: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function back(){
|
||||
location.href = ns.url("shop/message/lists");
|
||||
}
|
||||
function clickBtn(con) {
|
||||
var txtArea = $("#text_area")[0];
|
||||
var content = txtArea.value; //文本域内容
|
||||
var start = txtArea.selectionStart; //光标的初始位置,selectionStart:选区开始位置;selectionEnd:选区结束位置。
|
||||
txtArea.value = content.substring(0, txtArea.selectionStart) + '{' + con + '}' + content.substring(txtArea.selectionEnd, content.length);
|
||||
var position = start + con.length;
|
||||
$("#text_area").focus();
|
||||
txtArea.setSelectionRange(position+1, position+1); //setSelectionRange()方法用来设置<input>元素当前选中的文本的开始和结束位置
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.ns-form {margin-top: 0;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form ns-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否开启:</label>
|
||||
<div class="layui-input-block" id="isOpen">
|
||||
<input type="checkbox" name="status" lay-filter="isOpen" value="1" lay-skin="switch" {if condition="$info.is_use == 1"} checked {/if} />
|
||||
</div>
|
||||
<div class="word-aux">当前使用腾讯云短信配置</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SDKAppID:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="sdk_app_id" placeholder="请输入内容APP_KEY" {if $info.value } value="{$info.value.sdk_app_id??''}" {/if} autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">APP_KEY:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="sdk_app_key" placeholder="请输入内容APP_KEY" {if $info.value } value="{$info.value.sdk_app_key??''}" {/if} autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">secret_id:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="secret_id" placeholder="请输入secret_id" {if $info.value } value="{$info.value.secret_id??''}" {/if} autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SECRET_KEY:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="secret_key" placeholder="请输入SECRET_KEY" {if $info.value } value="{$info.value.secret_key??''}" {/if} autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">短信内容签名:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="smssign" placeholder="请输入短信内容签名" {if $info.value } value="{$info.value.smssign}" {/if} autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单操作 -->
|
||||
<div class="form-row">
|
||||
<button class="layui-btn color" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use('form', function() {
|
||||
var form = layui.form,
|
||||
repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
url: ns.url("cossms://shop/sms/config"),
|
||||
data: data.field,
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.confirm('编辑成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续操作'],
|
||||
yes: function(){
|
||||
location.href = ns.url("shop/message/sms")
|
||||
},
|
||||
btn2: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function back() {
|
||||
location.href = ns.url("shop/message/sms");
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -89,6 +89,7 @@ class Futures extends BaseApi{
|
|||
if($search_text != ''){
|
||||
$condition[] = ['o.order_no','like','%'.$search_text.'%'];
|
||||
}
|
||||
// $this->member_id=108;
|
||||
//(1=库存,2=已上架,3=已售出,4=提货中,5=提货完成,6=待支付,7=捡漏,8=拆单)
|
||||
switch($status){
|
||||
case 6: //买家未付款
|
||||
|
|
@ -130,7 +131,7 @@ class Futures extends BaseApi{
|
|||
$field = [
|
||||
'seller.username as seller_username',
|
||||
'seller.nickname as seller_nickname',
|
||||
'seller.headimg as seller_headimg',
|
||||
'seller.headimg as seller_headimg',
|
||||
'g.goods_name',
|
||||
'g.goods_image',
|
||||
'g.market_price',
|
||||
|
|
@ -148,6 +149,7 @@ class Futures extends BaseApi{
|
|||
'o.adjust_money',
|
||||
'o.pay_money',
|
||||
'o.order_id',
|
||||
'o.name as buyer_name',
|
||||
];
|
||||
// 表关联
|
||||
$join = [
|
||||
|
|
@ -174,20 +176,22 @@ class Futures extends BaseApi{
|
|||
$id = input('id', 0);
|
||||
$price = input('price', 0);
|
||||
$agree_split_order = input('agree_split_order', 0);
|
||||
|
||||
$date = model('futures')->getInfo([['id', '=', $id],['seller_uid', '=', $this->member_id]]);
|
||||
if(empty($date)){
|
||||
return $this->response($this->error('','发布失败'));
|
||||
}
|
||||
|
||||
$futuresModel = new FuturesModel;
|
||||
$basicsConfig = $futuresModel->getBasicsConfig($this->site_id)['data']['value'];
|
||||
if(!($price > sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['min'] / 100)) && $price <= sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['max'] / 100)))){// 后台配置范围
|
||||
return $this->response($this->error('','发布失败,价格不在允许范围内'.sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['min'] / 100)).'-'.sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['max'] / 100))));
|
||||
|
||||
|
||||
// if(!($price > sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['min'] / 100)) && $price <= sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['max'] / 100)))){// 后台配置范围
|
||||
// return $this->response($this->error('','发布失败,价格不在允许范围内'.sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['min'] / 100)).'-'.sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['max'] / 100))));
|
||||
// }
|
||||
|
||||
if(!($price <= sprintf('%.2f',$date['unit_price'] * (1 + $basicsConfig['price_range']['max'] / 100)))){// 后台配置范围
|
||||
return $this->response($this->error('','发布失败,价格不得高于市场价格'));
|
||||
}
|
||||
|
||||
// 限制发布时间
|
||||
|
||||
return $this->response($futuresModel->release($id, $price, $agree_split_order));
|
||||
}
|
||||
|
||||
|
|
@ -198,17 +202,15 @@ class Futures extends BaseApi{
|
|||
public function stock(){
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
|
||||
$id = input('id', 0);
|
||||
|
||||
$date = model('futures')->getInfo([['id', '=', $id],['seller_uid', '=', $this->member_id]]);
|
||||
if(empty($date)){
|
||||
return $this->response($this->error('','下架失败'));
|
||||
}
|
||||
|
||||
$futuresModel = new FuturesModel;
|
||||
return $this->response($futuresModel->stock($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提货
|
||||
* @return false|string
|
||||
|
|
@ -217,28 +219,23 @@ class Futures extends BaseApi{
|
|||
public function pickUp(){
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
|
||||
$id = input('id', 0);
|
||||
|
||||
$date = model('futures')->getInfo([['id', '=', $id],['seller_uid', '=', $this->member_id]]);
|
||||
if(empty($date)){
|
||||
return $this->response($this->error('','提货失败'));
|
||||
}
|
||||
|
||||
$futuresModel = new FuturesModel;
|
||||
return $this->response($futuresModel->pickUp($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @return false|string
|
||||
*/
|
||||
public function detail(){
|
||||
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
|
||||
$id = input('id', 0);
|
||||
|
||||
$futuresModel = new FuturesModel;
|
||||
$detail = $futuresModel->detail($id, $this->site_id);
|
||||
$times = $futuresModel->checkTimes($this->site_id, $this->member_id, $detail['data']['status']);
|
||||
|
|
@ -260,20 +257,20 @@ class Futures extends BaseApi{
|
|||
$res = [
|
||||
'price_range' => $basicsConfig['price_range'],
|
||||
'service_price' => $basicsConfig['service_price'],
|
||||
'proposed_range' => $basicsConfig['proposed_range'],
|
||||
'technical_range' => $basicsConfig['technical_range'],
|
||||
];
|
||||
return $this->response($this->success($res));
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @return false|string
|
||||
*/
|
||||
public function myDetail(){
|
||||
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
|
||||
$id = input('id', 0);
|
||||
|
||||
$futuresModel = new FuturesModel;
|
||||
$detail = $futuresModel->detail($id, $this->site_id);
|
||||
if($detail['code'] < 0 || empty($detail['data']) || !($detail['data']['seller_uid'] == $this->member_id || $detail['data']['member_id'] == $this->member_id)){
|
||||
|
|
@ -292,7 +289,4 @@ class Futures extends BaseApi{
|
|||
return $this->response($info);
|
||||
}
|
||||
|
||||
// public function testBuyBack(){
|
||||
// return $this->response(event('BuyBack'));
|
||||
// }
|
||||
}
|
||||
|
|
@ -14,12 +14,9 @@
|
|||
namespace addon\futures\api\controller;
|
||||
use app\api\controller\BaseApi;
|
||||
use addon\futures\model\order\FuturesOrderCreate as OrderCreateModel;
|
||||
use app\model\system\Pay;
|
||||
|
||||
/**
|
||||
* 订单创建
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
class Ordercreate extends BaseApi
|
||||
{
|
||||
|
|
@ -45,8 +42,10 @@ class Ordercreate extends BaseApi
|
|||
|
||||
'latitude' => $this->params[ 'latitude' ] ?? '',
|
||||
'longitude' => $this->params[ 'longitude' ] ?? '',
|
||||
|
||||
'is_invoice' => $this->params[ 'is_invoice' ] ?? 0,
|
||||
|
||||
'pay_password' => $this->params[ 'payPassword' ] ?? '',
|
||||
|
||||
'invoice_type' => $this->params[ 'invoice_type' ] ?? 0,
|
||||
'invoice_title' => $this->params[ 'invoice_title' ] ?? '',
|
||||
'taxpayer_number' => $this->params[ 'taxpayer_number' ] ?? '',
|
||||
|
|
@ -60,13 +59,9 @@ class Ordercreate extends BaseApi
|
|||
'goods_sku_list' => !empty($this->params['goods_sku_list']) ? json_decode($this->params['goods_sku_list'], true) : [],
|
||||
'sku_id' => isset($this->params['sku_id']) ? $this->params['sku_id'] : '',
|
||||
];
|
||||
var_dump($data);die;
|
||||
if ($data[ 'futures_id' ] == 0) {
|
||||
return $this->response($this->error('', '缺少必填参数商品数据'));
|
||||
}
|
||||
$pay = new Pay();
|
||||
$out_trade_no = $pay->createOutTradeNo($data[ 'member_id' ]);
|
||||
return $this->success($out_trade_no);
|
||||
if ($data[ 'futures_id' ] == 0) {
|
||||
return $this->response($this->error('', '缺少必填参数商品数据'));
|
||||
}
|
||||
$res = $order_create->create($data);
|
||||
return $this->response($res);
|
||||
}
|
||||
|
|
@ -139,18 +134,8 @@ class Ordercreate extends BaseApi
|
|||
if ($data[ 'futures_id' ] == 0) {
|
||||
return $this->response($this->error('', '缺少必填参数商品数据'));
|
||||
}
|
||||
|
||||
$res = $order_create->orderPayment($data);
|
||||
return $this->response($res);
|
||||
}
|
||||
|
||||
public function memberAddress(){
|
||||
$token = $this->checkToken();
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
$order_create = new OrderCreateModel();
|
||||
$data['member_id'] = $this->member_id;
|
||||
$res = $order_create->initMemberAddress($data);
|
||||
return $this->response($res);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace addon\futures\api\controller;
|
||||
use app\api\controller\BaseApi;
|
||||
|
||||
class User extends BaseApi{
|
||||
|
||||
public function info(){
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
|
||||
$info = model('futures_user')->getInfo([['member_id', '=', $this->member_id]]);
|
||||
|
||||
if(empty($info)){
|
||||
$data['member_id'] = $this->member_id;
|
||||
$data['site_id'] = $this->site_id;
|
||||
|
|
@ -17,7 +14,6 @@ class User extends BaseApi{
|
|||
model('futures_user')->add($data);
|
||||
$info = model('futures_user')->getInfo([['member_id', '=', $this->member_id]]);
|
||||
}
|
||||
|
||||
return $this->response($this->success($info));
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ return [
|
|||
'name' => 'TRADING_MARKET',
|
||||
'title' => '交易市场',
|
||||
'url' => 'futures://shop/futures/index',
|
||||
'parent' => 'CHANNEL_ROOT',
|
||||
'parent' => 'PROMOTION_CENTER',
|
||||
'is_show' => 1,
|
||||
'sort' => 1,
|
||||
'picture' => 'addon/futures/shop/view/public/img/futures_new.png', // 图标
|
||||
|
|
@ -15,7 +15,7 @@ return [
|
|||
'child_list' => [
|
||||
[
|
||||
'name' => 'TRADING_MARKET_HOME',
|
||||
'title' => '交易市场',
|
||||
'title' => '交易订单',
|
||||
'url' => 'futures://shop/futures/index',
|
||||
'is_show' => 1,
|
||||
'sort' => 1,
|
||||
|
|
@ -33,12 +33,7 @@ return [
|
|||
'url' => 'futures://shop/config/basics',
|
||||
'is_show' => 1,
|
||||
'sort' => 2,
|
||||
],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
]
|
||||
]
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -8,29 +8,32 @@
|
|||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\futures\event;
|
||||
|
||||
use addon\futures\model\Futures as FuturesModel;
|
||||
use app\model\member\MemberAccount;
|
||||
use think\facade\Db;
|
||||
|
||||
class MemberRegister
|
||||
{
|
||||
|
||||
// 会员注册
|
||||
public function handle($param){
|
||||
// 获取用户id
|
||||
$memberId = $param['member_id'] ?? 0;
|
||||
if($memberId > 0){
|
||||
$futuresModel = new FuturesModel;
|
||||
$memberInfo = Db::name('member')
|
||||
->field('member_id,site_id')
|
||||
->where('member_id',$memberId)
|
||||
->find();
|
||||
$basics = $futuresModel->getBasicsConfig($memberInfo['site_id'])['data']['value'];
|
||||
if($basics['newuser_points']){
|
||||
$member_account = new MemberAccount();
|
||||
$member_account->addMemberAccount($memberInfo['site_id'], $memberInfo['member_id'], 'diamond', $basics['newuser_points'], 'diamond', '赠送猕猴桃', '新用户注册赠送猕猴桃');
|
||||
}
|
||||
$data = [
|
||||
'site_id' => $memberInfo['site_id'],
|
||||
'member_id' => $memberInfo['member_id'],
|
||||
'created_time' => time()
|
||||
];
|
||||
|
||||
Db::name('futures_user')->insert($data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ class OrderPay
|
|||
public function handle($param){
|
||||
if($param['promotion_type'] == 'futures'){
|
||||
$futures_model = new Futures();
|
||||
// $result = $futures_model->orderComplete($param['promotion_id'],$param['order_id']);
|
||||
(new Forder())->calculate($param);
|
||||
$result = $futures_model->orderComplete($param['promotion_id'],$param['order_id']);
|
||||
(new Forder())->calculate($param); //计算订单佣金
|
||||
}else{
|
||||
$goods_ids = model("order_goods")->getList([[ 'order_id', '=', $param[ 'order_id' ] ] ], 'goods_id');
|
||||
$diamond = model("goods")->getSum([['goods_id', 'in', array_column($goods_ids,'goods_id')]], 'give_diamond');
|
||||
|
|
@ -29,7 +29,7 @@ class OrderPay
|
|||
$site_id=$param['site_id'];
|
||||
$member_id=$param['member_id'];
|
||||
$member_account = new MemberAccount();
|
||||
$member_account->addMemberAccount($site_id, $member_id, 'diamond', $diamond, 'diamond', '赠送钻石', '会员购物赠送钻石',$param[ 'order_id' ]);
|
||||
$member_account->addMemberAccount($site_id, $member_id, 'diamond', $diamond, 'diamond', '赠送猕猴桃', '会员购物赠送猕猴桃',$param[ 'order_id' ]);
|
||||
}
|
||||
}
|
||||
return success();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\futures\model;
|
||||
use addon\futures\model\Futures as FuturesModel;
|
||||
use addon\fenxiao\model\FenxiaoOrder;
|
||||
use app\model\BaseModel;
|
||||
class Forder extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 分销订单计算
|
||||
* @param unknown $order
|
||||
*/
|
||||
public function calculate($order)
|
||||
{
|
||||
$site_id=$order['site_id'];
|
||||
$futuresModel = new FuturesModel;
|
||||
$basics = $futuresModel->getBasicsConfig($site_id)['data']['value'];
|
||||
if(!empty(model("fenxiao_order")->getValue(['order_id'=>$order[ 'order_id' ]],'fenxiao_order_id'))){
|
||||
return $this->success();
|
||||
}
|
||||
//检测分销商上级关系
|
||||
$member_info = model("member")->getInfo([ [ 'member_id', '=', $order[ 'member_id' ] ] ], 'fenxiao_id,is_fenxiao');
|
||||
//如果没有分销商直接返回不计算,没有考虑首次付款上下级绑定
|
||||
if(empty($member_info)){
|
||||
return $this->success();
|
||||
}
|
||||
if ($member_info[ 'fenxiao_id' ] == 0) {
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
$fenxiao_id = $member_info[ 'fenxiao_id' ];
|
||||
$fenxiao_info = model("fenxiao")->getInfo([ [ 'fenxiao_id', '=', $fenxiao_id ], [ 'is_delete', '=', 0 ] ]);
|
||||
if (empty($fenxiao_info)) {
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
$parent_fenxiao_info = model('fenxiao')->getInfo([ [ 'fenxiao_id', '=', $fenxiao_info[ 'parent' ] ], [ 'is_delete', '=', 0 ] ], 'fenxiao_id, fenxiao_name, status, parent');
|
||||
|
||||
$direct_push=$basics['direct_push'];//直推
|
||||
$indirect_push=$basics['indirect_push'];//间推
|
||||
$is_range=$basics['is_range'];
|
||||
if($is_range && $parent_fenxiao_info){ //减去极差奖励
|
||||
$direct_push -=$indirect_push;
|
||||
}
|
||||
$order_goods = model("order_goods")->getInfo(['order_id'=>$order[ 'order_id' ]]);
|
||||
$commission_rate=$direct_push+$indirect_push; //总佣金比例
|
||||
$service_charge=$order['order_money']*$basics['service_price']/100;//总服务费
|
||||
$commission=$commission_rate*$service_charge/100;//总佣金
|
||||
$order_fenxiao_data = [
|
||||
'one_rate' => $direct_push,
|
||||
'one_commission' =>$direct_push*$service_charge/100,
|
||||
'two_rate' => $indirect_push,
|
||||
'two_commission' => $indirect_push*$service_charge/100,
|
||||
'three_rate' => 0,
|
||||
];
|
||||
//启动分销
|
||||
$data = [
|
||||
'order_id' => $order[ 'order_id' ],
|
||||
'order_no' => $order[ 'order_no' ],
|
||||
'order_goods_id' => $order_goods[ 'order_goods_id' ],
|
||||
'site_id' => $order[ 'site_id' ],
|
||||
'site_name' => $order[ 'site_name' ],
|
||||
'goods_id' => $order_goods[ 'goods_id' ],
|
||||
'sku_id' => $order_goods[ 'sku_id' ],
|
||||
'sku_name' => $order_goods[ 'sku_name' ],
|
||||
'sku_image' => $order_goods[ 'sku_image' ],
|
||||
'price' => $order[ 'order_money' ],
|
||||
'num' => $order_goods[ 'num' ],
|
||||
'real_goods_money' =>$order[ 'order_money' ],
|
||||
'member_id' => $order[ 'member_id' ],
|
||||
'member_name' => $order[ 'name' ],
|
||||
'member_mobile' => $order[ 'mobile' ],
|
||||
'full_address' => $order[ 'full_address' ] . $order[ 'address' ],
|
||||
|
||||
'commission' => $commission,
|
||||
'commission_rate' => $commission_rate,
|
||||
|
||||
'one_fenxiao_id' => empty($fenxiao_info) ? 0 : $fenxiao_info[ 'fenxiao_id' ],
|
||||
'one_rate' => empty($order_fenxiao_data[ 'one_rate' ]) ? 0 : $order_fenxiao_data[ 'one_rate' ],
|
||||
'one_commission' => empty($order_fenxiao_data[ 'one_commission' ]) ? 0 : $order_fenxiao_data[ 'one_commission' ],
|
||||
'one_fenxiao_name' => empty($fenxiao_info) ? '' : $fenxiao_info[ 'fenxiao_name' ],
|
||||
|
||||
|
||||
'two_fenxiao_id' => empty($parent_fenxiao_info) ? 0 : $parent_fenxiao_info[ 'fenxiao_id' ],
|
||||
'two_rate' => empty($order_fenxiao_data[ 'two_rate' ]) ? 0 : $order_fenxiao_data[ 'two_rate' ],
|
||||
'two_commission' => empty($order_fenxiao_data[ 'two_commission' ]) ? 0 : $order_fenxiao_data[ 'two_commission' ],
|
||||
'two_fenxiao_name' => empty($parent_fenxiao_info) ? '' : $parent_fenxiao_info[ 'fenxiao_name' ],
|
||||
'create_time' => time()
|
||||
];
|
||||
model("fenxiao_order")->add($data);
|
||||
$fenxiao_order_model = new FenxiaoOrder();
|
||||
$fenxiao_order_model->settlement($data['order_id']);
|
||||
$res = $fenxiao_order_model->calculateOrder($data['order_id']);
|
||||
return $this->success();
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace addon\futures\model;
|
||||
use addon\fenxiao\model\FenxiaoAccount;
|
||||
use addon\futures\model\Futures as FuturesModel;
|
||||
use addon\message\model\Message;
|
||||
use app\model\member\MemberAccount;
|
||||
use app\model\system\Config as ConfigModel;
|
||||
|
|
@ -93,6 +94,7 @@ class Futures extends BaseModel{
|
|||
Cache::store('redis_concurrent')->set('addon_futures_stock_'.$id,'1');
|
||||
return $this->success($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布
|
||||
* @param $id
|
||||
|
|
@ -141,14 +143,22 @@ class Futures extends BaseModel{
|
|||
}
|
||||
}
|
||||
$service_price = $price * $basics['service_price'] / 100;
|
||||
$technical_range=$service_price*$basics['technical_range']/100;
|
||||
if(model('member')->getValue(['member_id'=>$date['seller_uid']],'balance_money')<$service_price){
|
||||
return error(-800, '您余额不足!');
|
||||
}
|
||||
model('futures')->update([
|
||||
'status' => $futuresInfo['status'],
|
||||
'release_time' => time() + $basics['release_wait'] * 24 * 60 * 60,// 配置上线延迟时间
|
||||
'price' => $price,
|
||||
'total' => $futuresInfo['total'],
|
||||
'service_price' => $service_price,
|
||||
'real_income' => $price - $service_price,
|
||||
'real_income' => $price,
|
||||
],[['id','=',$id]]);
|
||||
//扣除服务费
|
||||
$memberAccountModel = new MemberAccount();
|
||||
$memberAccountModel->addMemberAccount($date['site_id'], $date['seller_uid'], 'balance_money', -$technical_range, 'service_price', $date['id'], '服务费', $date['id']);
|
||||
$memberAccountModel->addMemberAccount($date['site_id'], $date['seller_uid'], 'balance_money', -$service_price-$technical_range, 'service_price', $date['id'], '商家分账', $date['id']);
|
||||
model('futures')->commit();
|
||||
Cache::store('redis_concurrent')->set('addon_futures_'.$id,'1');
|
||||
return $this->success();
|
||||
|
|
@ -174,6 +184,10 @@ class Futures extends BaseModel{
|
|||
model('futures')->update([
|
||||
'status' => 1,
|
||||
], [['id', '=', $id]]);
|
||||
//扣除服务费
|
||||
$memberAccountModel = new MemberAccount();
|
||||
$memberAccountModel->addMemberAccount($date['site_id'], $date['seller_uid'], 'balance_money', $date['service_price'], 'service_price', $date['id'], '退回服务费与商家分账', $date['id']);
|
||||
Cache::store('redis_concurrent')->set('addon_futures_stock_'.$id,'1');
|
||||
return $this->success();
|
||||
}
|
||||
/**
|
||||
|
|
@ -187,43 +201,18 @@ class Futures extends BaseModel{
|
|||
if(empty($date) || $date['status'] !== 1){
|
||||
return $this->error($date,'提货失败');
|
||||
}
|
||||
$member_address = input( 'member_address', []);
|
||||
$member_address = isset($member_address) && !empty($member_address) ? json_decode($member_address, true) : [];
|
||||
if(empty($member_address)){
|
||||
return $this->error($date,'提货失败-无收获地址');
|
||||
}
|
||||
if(!Cache::store('redis_concurrent')->delete('addon_futures_stock_'.$id)){
|
||||
return $this->error('','提货失败');
|
||||
}
|
||||
|
||||
model('futures')->update([
|
||||
'status' => 5,
|
||||
], [['id', '=', $id]]);
|
||||
|
||||
|
||||
$order_info = [
|
||||
'name' => $member_address[ 'name' ] ?? '',
|
||||
'mobile' => $member_address[ 'mobile' ] ?? '',
|
||||
'telephone' => $member_address[ 'telephone' ] ?? '',
|
||||
'province_id' => $member_address[ 'province_id' ] ?? '',
|
||||
'city_id' => $member_address[ 'city_id' ] ?? '',
|
||||
'district_id' => $member_address[ 'district_id' ] ?? '',
|
||||
'community_id' => $member_address[ 'community_id' ] ?? '',
|
||||
'address' => $member_address[ 'address' ] ?? '',
|
||||
'full_address' => $member_address[ 'full_address' ] ?? '',
|
||||
'longitude' => $member_address[ 'longitude' ] ?? '',
|
||||
'latitude' => $member_address[ 'latitude' ] ?? '',
|
||||
'promotion_type' => 'futures_tihuo',
|
||||
];
|
||||
|
||||
model('order')->update($order_info,[['order_id', '=', $date['order_id']]]);
|
||||
|
||||
$basics = $this->getBasicsConfig($date['site_id'])[ 'data' ][ 'value' ];
|
||||
// 提货用来减少用户买入限制
|
||||
Db::name('futures_user')
|
||||
->where('member_id',$date['member_id'])
|
||||
->where('member_id', $date['member_id'])
|
||||
->update([
|
||||
'business_num' => Db::raw('business_num-'.$basics['order_restrictions_num']),
|
||||
'business_num' => Db::raw('business_num-' . $basics['order_restrictions_num']),
|
||||
]);
|
||||
return $this->success();
|
||||
}
|
||||
|
|
@ -233,26 +222,28 @@ class Futures extends BaseModel{
|
|||
* @return array
|
||||
*/
|
||||
public function orderCreate($id, $order_id, $member_id){
|
||||
|
||||
$date = model('futures')->getInfo([['id', '=', $id]]);
|
||||
if(empty($date) || ($date['status'] !== 2 && $date['status'] !== 7)){
|
||||
return $this->error($date,'下单失败-1001');
|
||||
}
|
||||
if(!Cache::store('redis_concurrent')->delete('addon_futures_'.$id)){
|
||||
return $this->error('','下单失败-1002');
|
||||
}
|
||||
model('futures')->update([
|
||||
// if(!Cache::store('redis_concurrent')->delete('addon_futures_'.$id)){
|
||||
// return $this->error('','下单失败-1002');
|
||||
// }
|
||||
model('futures')->update(
|
||||
[
|
||||
'status' => 6,
|
||||
'created_time' => time(),
|
||||
'member_id' => $member_id,
|
||||
'order_id' => $order_id,
|
||||
], [['id', '=', $id]]);
|
||||
|
||||
],
|
||||
[['id', '=', $id]]);
|
||||
// 增加用户已下单次数
|
||||
Db::name('futures_user')
|
||||
->where('member_id',$date['member_id'])
|
||||
$res=Db::name('futures_user')
|
||||
->where('member_id',$member_id)
|
||||
->update([
|
||||
'business_num' => Db::raw('business_num+1'),
|
||||
'total_business_num' => Db::raw('total_business_num+1'),
|
||||
'business_num' => Db::raw('business_num +1'),
|
||||
'total_business_num' => Db::raw('total_business_num +1'),
|
||||
]);
|
||||
(new Message())->addMessage($date['site_id'],'订单创建',1,$member_id,$id);
|
||||
Cache::store('redis_concurrent')->set('addon_futures_pay_'.$id,'1');
|
||||
|
|
@ -294,9 +285,16 @@ class Futures extends BaseModel{
|
|||
// 给用户增加余额
|
||||
$memberAccountModel = new MemberAccount();
|
||||
$memberAccountModel->addMemberAccount($date['site_id'], $date['seller_uid'], 'balance_money', $date['price'], 'sell', $date['id'], '售卖产品', $date['id']);
|
||||
$memberAccountModel->addMemberAccount($date['site_id'], $date['seller_uid'], 'balance_money', -$date['service_price'], 'service_price', $date['id'], '服务费', $date['id']);
|
||||
$futuresModel = new FuturesModel;
|
||||
$basics = $futuresModel->getBasicsConfig($date['site_id'])['data']['value'];
|
||||
if ($basics['give_integral'] > 0) { //首单赠送积分
|
||||
if (model('futures')->getCount(['seller_uid'=>$date['member_id']])==1) {
|
||||
$memberAccountModel->addMemberAccount($date['site_id'], $date['member_id'], 'point', $basics['give_integral'], 'sell', $date['id'], '秒杀首单赠送积分', $date['id']);
|
||||
}
|
||||
}
|
||||
$point=$date['price']*$basics['order_give_points_ratio']/100;
|
||||
//赠送积分
|
||||
$memberAccountModel->addMemberAccount($date['site_id'], $date['member_id'], 'point', $date['price'], 'sell', $date['id'], '秒杀赠送积分', $date['id']);
|
||||
$memberAccountModel->addMemberAccount($date['site_id'], $date['member_id'], 'point', intval($point), 'sell', $date['id'], '秒杀赠送积分', $date['id']);
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,12 +13,14 @@ namespace addon\futures\model\order;
|
|||
use addon\fenxiao\model\FenxiaoAccount;
|
||||
use addon\futures\model\Futures;
|
||||
use addon\futures\model\Futures as FuturesModel;
|
||||
use addon\member\model\Member;
|
||||
use app\model\member\MemberAccount;
|
||||
use app\model\order\Config;
|
||||
use app\model\order\OrderCreate;
|
||||
use app\model\goods\GoodsStock;
|
||||
use app\model\store\Store;
|
||||
use app\model\express\Express;
|
||||
use app\model\system\Cron;
|
||||
use app\model\system\Pay;
|
||||
use app\model\express\Config as ExpressConfig;
|
||||
use app\model\express\Local;
|
||||
|
|
@ -95,6 +97,8 @@ class FuturesOrderCreate extends OrderCreate
|
|||
$order_type = $this->orderType($shop_goods_list, $calculate_data);
|
||||
$order_no = $this->createOrderNo($shop_goods_list[ 'site_id' ], $data[ 'member_id' ]);
|
||||
$member_address = $calculate_data[ 'member_address' ];
|
||||
$member_info= $calculate_data[ 'member_account' ];
|
||||
$times= $calculate_data[ 'times' ]['original'];
|
||||
$data_order = [
|
||||
'order_no' => $order_no,
|
||||
'site_id' => $site_id,
|
||||
|
|
@ -119,6 +123,7 @@ class FuturesOrderCreate extends OrderCreate
|
|||
'longitude' => $member_address[ 'longitude' ] ?? '',
|
||||
'latitude' => $member_address[ 'latitude' ] ?? '',
|
||||
'buyer_ip' => request()->ip(),
|
||||
'buyer_nickname' => $member_info['nickname'],
|
||||
'goods_money' => $shop_goods_list[ 'goods_money' ],
|
||||
'delivery_money' => $shop_goods_list[ 'delivery_money' ],
|
||||
'coupon_id' => $shop_goods_list[ 'coupon_id' ] ?? 0,
|
||||
|
|
@ -160,7 +165,6 @@ class FuturesOrderCreate extends OrderCreate
|
|||
$order_id = model('order')->add($data_order);
|
||||
$pay_money += $shop_goods_list[ 'pay_money' ];
|
||||
//订单项目表
|
||||
|
||||
foreach ($shop_goods_list[ 'goods_list' ] as $k_order_goods => $order_goods) {
|
||||
$data_order_goods = array (
|
||||
'order_id' => $order_id,
|
||||
|
|
@ -192,18 +196,19 @@ class FuturesOrderCreate extends OrderCreate
|
|||
$order_goods_id = model('order_goods')->add($data_order_goods);
|
||||
$calculate_data[ 'shop_goods_list' ][ 'goods_list' ][ $k_order_goods ][ 'order_goods_id' ] = $order_goods_id;
|
||||
}
|
||||
|
||||
$futures_model = new Futures;
|
||||
$futures_info = $futures_model->orderCreate($data['futures_id'],$order_id,$data['member_id']);
|
||||
if ($futures_info[ 'code' ] != 0) {
|
||||
model('order')->rollback();
|
||||
return $futures_info;
|
||||
}
|
||||
|
||||
// 提前秒杀扣除钻石
|
||||
if($calculate_data['times']['is_early']){
|
||||
$member_account = new MemberAccount();
|
||||
$member_account->addMemberAccount($site_id, $data['member_id'], 'balance', -1, 'diamond', '秒杀抵扣钻石', '会员抢购抵扣钻石',$order_id);
|
||||
$member_account->addMemberAccount($site_id, $data['member_id'], 'diamond', -1, 'diamond', '秒杀抵扣猕猴桃', '会员抢购抵猕猴桃',$order_id);
|
||||
}
|
||||
|
||||
$result_list = event('OrderCreate', [ 'order_id' => $order_id, 'site_id' => $shop_goods_list[ 'site_id' ],'create_data' => $calculate_data ]);
|
||||
if (!empty($result_list)) {
|
||||
foreach ($result_list as $k => $v) {
|
||||
|
|
@ -214,8 +219,15 @@ class FuturesOrderCreate extends OrderCreate
|
|||
}
|
||||
}
|
||||
//生成整体支付单据
|
||||
$pay->addPay($shop_goods_list[ 'site_id' ], $out_trade_no, $this->pay_type, $this->order_name, $this->order_name, $this->pay_money, '', 'OrderPayNotify', '/pages_rush/futures/order?status=stock');//'/pages_rush/order/detail?order_id=' . $order_id
|
||||
$this->addOrderCronClose($order_id, $shop_goods_list[ 'site_id' ]);//增加关闭订单自动事件
|
||||
// $pay->addPay($shop_goods_list[ 'site_id' ], $out_trade_no, $this->pay_type, $this->order_name, $this->order_name, $this->pay_money, '', 'OrderPayNotify', '/pages_rush/futures/order?status=stock');//'/pages_rush/order/detail?order_id=' . $order_id
|
||||
$execute_time = $times['miaosha_end_time'] ?? '';
|
||||
if ($execute_time) {
|
||||
$cron_model = new Cron();
|
||||
$execute_time +=strtotime(date('Ymd'));
|
||||
$cron_model->addCron(1, 0, "订单自动关闭", "CronOrderClose", $execute_time, $order_id);
|
||||
} else {
|
||||
$this->addOrderCronClose($order_id, $shop_goods_list['site_id']);//增加关闭订单自动事件
|
||||
}
|
||||
model('order')->commit();
|
||||
return $this->success($out_trade_no);
|
||||
} catch (\Exception $e) {
|
||||
|
|
@ -236,6 +248,11 @@ class FuturesOrderCreate extends OrderCreate
|
|||
if ($data[ 'is_balance' ] > 0) {
|
||||
$this->member_balance_money = $data[ 'member_account' ][ 'balance_total' ] ?? 0;
|
||||
}
|
||||
$member_model = new Member();
|
||||
$result = $member_model->checkPayPassword($data["member_id"], $data["pay_password"]);
|
||||
if ($result["code"] < 0) {
|
||||
return error(-1,'支付密码不正确');
|
||||
}
|
||||
$member_id = $data['member_id'];
|
||||
$futures_id = $data['futures_id'];
|
||||
$site_id = $data['site_id'];
|
||||
|
|
@ -245,23 +262,24 @@ class FuturesOrderCreate extends OrderCreate
|
|||
['status', 'in', [2,7]],
|
||||
['release_time', '<', time()],
|
||||
);
|
||||
|
||||
$futures_info = model('futures')->getInfo($condition) ?? [];
|
||||
if(empty($futures_info)) return $this->error([], '该秒杀不存在!');
|
||||
|
||||
$futuresModel = new FuturesModel;
|
||||
$data['times'] = $futuresModel->checkTimes($site_id, $member_id, $futures_info['status']);
|
||||
if($data['times']['code'] != 0){
|
||||
return $data['times'];
|
||||
}
|
||||
$data['times'] = $data['times']['data'];
|
||||
$data['fenxiao_info'] = model('fenxiao')->getInfo([['member_id','=',$data['member_id']]]);
|
||||
// $data['fenxiao_info'] = model('fenxiao')->getInfo([['member_id','=',$data['member_id']]]);
|
||||
|
||||
$basics = $futuresModel->getBasicsConfig($site_id)['data']['value'];
|
||||
$data['futures_user_info'] = model('futures_user')->getInfo([['member_id','=',$data['member_id']]]);
|
||||
|
||||
|
||||
//检查钻石数量
|
||||
if($data['times']['is_early'] && $data['futures_user_info']['is_special'] == 0){
|
||||
if($data['fenxiao_info']['diamond'] <= 0){
|
||||
if($data['member_account']['diamond'] <= 0){
|
||||
return error(-1,'钻石不足,不可提前秒杀');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,12 +56,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>秒杀时间段设置:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item js-new-attr-list">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class="layui-input-block">
|
||||
|
|
@ -126,6 +124,42 @@
|
|||
<div class="word-aux ">达到订单数限制后,进行提货恢复限制数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">首单送积分:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="give_integral" class="layui-input ns-len-mid" value="{$info.give_integral ?? 0}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="word-aux ">用户抢购首单送积分</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">新用户赠送钻石:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="newuser_points" class="layui-input ns-len-mid" value="{$info.newuser_points??0}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="word-aux ">新用户赠送积分</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">下单赠送积分:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="order_give_points_ratio" class="layui-input ns-len-mid" value="{$info.order_give_points_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">下单赠送积分,得消费额百分比,系统自动取整</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item time-type-view-all" >
|
||||
<label class="layui-form-label">价格涨幅区间设置:</label>
|
||||
|
|
@ -139,6 +173,14 @@
|
|||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">%</div>
|
||||
</div>
|
||||
<div class="layui-form-item time-type-view-all" >
|
||||
<label class="layui-form-label">建议出售价格比例:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" class="layui-input" name="proposed_range" value="<?= empty($info['proposed_range']) ? '' :$info['proposed_range'] ?>">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">建议出售价格比例</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
|
|
@ -149,6 +191,15 @@
|
|||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">商家出售商品担保交易费用,包含计算服务费商家佣金</div>
|
||||
<div class="layui-form-item time-type-view-all" >
|
||||
<label class="layui-form-label">技术服务费:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" class="layui-input" name="technical_range" placeholder="" value="<?= !isset($info['technical_range']) ? '' :$info['technical_range'] ?>">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">服务费拆分,用于区分服务费费用名目</div>
|
||||
<div class="layui-form-item time-type-view-all" >
|
||||
<label class="layui-form-label">订单商品数量最大翻倍次数:</label>
|
||||
<div class="layui-input-inline">
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class Member extends BaseModel
|
|||
*/
|
||||
public function getMemberDetail($member_id, $site_id)
|
||||
{
|
||||
$field = 'member_id,source_member,username,nickname,mobile,email,status,headimg,member_level,member_level_name,member_label,member_label_name,qq,realname,sex,location,birthday,reg_time,point,balance,growth,balance_money,account5,pay_password,member_level_type';
|
||||
$field = 'member_id,source_member,username,nickname,mobile,email,status,headimg,member_level,member_level_name,member_label,member_label_name,qq,realname,sex,location,birthday,reg_time,point,balance,diamond,growth,balance_money,account5,pay_password,member_level_type';
|
||||
$member_info = model('member')->getInfo([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $site_id ] ], $field);
|
||||
if (!empty($member_info)) {
|
||||
$member_info[ 'balance_total' ] = $member_info[ 'balance' ] + $member_info[ 'balance_money' ];
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ class Memberrecharge extends BaseApi
|
|||
$field = 'recharge_id,recharge_name,cover_img,face_value,buy_price,point,growth,coupon_id,sale_num';
|
||||
$member_recharge_model = new MemberRechargeModel();
|
||||
$list = $member_recharge_model->getMemberRechargePageList([ [ 'status', '=', 1 ], [ 'site_id', '=', $this->site_id ] ], $page, $page_size, 'create_time desc', $field);
|
||||
|
||||
$list['explain']='充值任意金额后,会存到您的账户余额中';
|
||||
return $this->response($list);
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +38,6 @@ class MemberrechargeOrderCreate extends OrderCreate
|
|||
$member_info = $member['data'];
|
||||
//获取套餐信息
|
||||
$recharge_model = new Memberrecharge();
|
||||
|
||||
if ($data['recharge_id'] > 0) {
|
||||
//套餐字段
|
||||
$field = 'recharge_id,recharge_name,cover_img,face_value,buy_price,point,growth,coupon_id';
|
||||
|
|
@ -59,12 +58,10 @@ class MemberrechargeOrderCreate extends OrderCreate
|
|||
"coupon_id" => 0,
|
||||
);
|
||||
}
|
||||
|
||||
//创建或加入
|
||||
$pay = new Pay();
|
||||
$out_trade_no = $pay->createOutTradeNo($data['member_id']);
|
||||
$order_no = $this->createOrderNo($data['site_id'], $data['member_id']);
|
||||
|
||||
$order_data = [
|
||||
'recharge_id' => $data['recharge_id'],
|
||||
'order_no' => $order_no,
|
||||
|
|
@ -90,15 +87,12 @@ class MemberrechargeOrderCreate extends OrderCreate
|
|||
'relate_id' => $data['relate_id'] ?? 0,
|
||||
'relate_type' => $data['relate_type'] ?? '',
|
||||
];
|
||||
|
||||
model("member_recharge_order")->startTrans();
|
||||
//循环生成多个订单
|
||||
try {
|
||||
|
||||
$order_id = model("member_recharge_order")->add($order_data);
|
||||
//生成整体支付单据
|
||||
$pay->addPay($data['site_id'], $out_trade_no, "", "会员充值套餐,面额:" . $recharge_info['face_value'], "会员充值套餐,面额:" . $recharge_info['face_value'], $recharge_info['buy_price'], '', 'MemberrechargeOrderPayNotify', '');
|
||||
|
||||
//计算订单自动关闭时间
|
||||
$config_model = new Config();
|
||||
$order_config_result = $config_model->getOrderEventTimeConfig($data['site_id']);
|
||||
|
|
@ -111,16 +105,12 @@ class MemberrechargeOrderCreate extends OrderCreate
|
|||
}
|
||||
$cron_model = new Cron();
|
||||
$cron_model->addCron(1, 0, "订单自动关闭", "MemberrechargeOrderClose", $execute_time, $order_id);
|
||||
|
||||
event("MemberRechargeOrderCreate", ['order_id' => $order_id]);
|
||||
model("member_recharge_order")->commit();
|
||||
return $this->success($out_trade_no);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
model("member_recharge_order")->rollback();
|
||||
return $this->error('', $e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -31,13 +31,10 @@ class Memberrecharge extends BaseShop
|
|||
}
|
||||
//套餐字段
|
||||
protected $field = 'recharge_id,recharge_name,cover_img,face_value,buy_price,point,growth,coupon_id,sale_num,create_time,status';
|
||||
|
||||
//开卡字段
|
||||
protected $card_field = 'card_id,recharge_id,card_account,cover_img,face_value,point,growth,coupon_id,buy_price,member_img,nickname,order_id,order_no,from_type,use_status,create_time,use_time';
|
||||
|
||||
//订单字段
|
||||
protected $order_field = 'order_id,recharge_name,recharge_id,order_no,out_trade_no,member_id,cover_img,face_value,buy_price,point,growth,coupon_id,price,pay_type,pay_type_name,status,create_time,pay_time,member_img,nickname,order_from_name,order_from';
|
||||
|
||||
//优惠券字段
|
||||
protected $coupon_field = 'coupon_type_id,coupon_name,money,count,lead_count,max_fetch,at_least,end_time,image,validity_type,fixed_term';
|
||||
|
||||
|
|
@ -81,7 +78,6 @@ class Memberrecharge extends BaseShop
|
|||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$data = [
|
||||
'site_id' => $this->site_id,
|
||||
'recharge_name' => input('recharge_name', ''),//套餐名称
|
||||
|
|
@ -92,10 +88,8 @@ class Memberrecharge extends BaseShop
|
|||
'growth' => input('growth', ''),//赠送成长值
|
||||
'coupon_id' => input('coupon_id', '')//优惠券id
|
||||
];
|
||||
|
||||
$model = new MemberRechargeModel();
|
||||
return $model->addMemberRecharge($data);
|
||||
|
||||
} else {
|
||||
return $this->fetch('memberrecharge/add');
|
||||
}
|
||||
|
|
@ -108,10 +102,8 @@ class Memberrecharge extends BaseShop
|
|||
public function edit()
|
||||
{
|
||||
$rechargeModel = new MemberRechargeModel();
|
||||
|
||||
$recharge_id = input('recharge_id', '');
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$data = [
|
||||
'recharge_name' => input('recharge_name', ''),//套餐名称
|
||||
'cover_img' => input('cover_img', ''),//封面
|
||||
|
|
@ -121,7 +113,6 @@ class Memberrecharge extends BaseShop
|
|||
'growth' => input('growth', ''),//赠送成长值
|
||||
'coupon_id' => input('coupon_id', '')//优惠券id
|
||||
];
|
||||
|
||||
return $rechargeModel->editMemberRecharge(
|
||||
[
|
||||
[ 'recharge_id', '=', $recharge_id ],
|
||||
|
|
@ -129,7 +120,6 @@ class Memberrecharge extends BaseShop
|
|||
]
|
||||
, $data
|
||||
);
|
||||
|
||||
} else {
|
||||
//获取套餐详情
|
||||
$recharge = $rechargeModel->getMemberRechargeInfo(
|
||||
|
|
@ -143,7 +133,6 @@ class Memberrecharge extends BaseShop
|
|||
$this->assign('recharge', $recharge);
|
||||
return $this->fetch('memberrecharge/edit');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -153,9 +142,7 @@ class Memberrecharge extends BaseShop
|
|||
public function detail()
|
||||
{
|
||||
$recharge_model = new MemberRechargeModel();
|
||||
|
||||
$recharge_id = input('recharge_id', '');
|
||||
|
||||
//获取套餐详情
|
||||
$info = $recharge_model->getMemberRechargeInfo(
|
||||
[
|
||||
|
|
@ -166,7 +153,6 @@ class Memberrecharge extends BaseShop
|
|||
)[ 'data' ] ?? [];
|
||||
if (empty($info)) $this->error('未获取到套餐数据', addon_url('memberrecharge://shop/memberrecharge/lists'));
|
||||
$this->assign('info', $info);
|
||||
|
||||
return $this->fetch('memberrecharge/detail');
|
||||
}
|
||||
|
||||
|
|
@ -177,12 +163,9 @@ class Memberrecharge extends BaseShop
|
|||
public function invalid()
|
||||
{
|
||||
$model = new MemberRechargeModel();
|
||||
|
||||
$recharge_id = input('recharge_id', '');
|
||||
|
||||
$data = [ 'status' => 2 ];
|
||||
$condition = [ [ 'recharge_id', '=', $recharge_id ] ];
|
||||
|
||||
$res = $model->editMemberRecharge($condition, $data);
|
||||
return $res;
|
||||
}
|
||||
|
|
@ -194,12 +177,9 @@ class Memberrecharge extends BaseShop
|
|||
public function open()
|
||||
{
|
||||
$model = new MemberRechargeModel();
|
||||
|
||||
$recharge_id = input('recharge_id', '');
|
||||
|
||||
$data = [ 'status' => 1 ];
|
||||
$condition = [ [ 'recharge_id', '=', $recharge_id ] ];
|
||||
|
||||
$res = $model->editMemberRecharge($condition, $data);
|
||||
return $res;
|
||||
}
|
||||
|
|
@ -211,9 +191,7 @@ class Memberrecharge extends BaseShop
|
|||
public function delete()
|
||||
{
|
||||
$model = new MemberRechargeModel();
|
||||
|
||||
$recharge_id = input('recharge_id', '');
|
||||
|
||||
return $model->deleteMemberRecharge([ [ 'recharge_id', '=', $recharge_id ] ]);
|
||||
}
|
||||
|
||||
|
|
@ -225,7 +203,6 @@ class Memberrecharge extends BaseShop
|
|||
{
|
||||
$recharge_id = input('recharge_id', '');
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
|
||||
$model = new MemberRechargeCardModel();
|
||||
$condition[] = [ 'site_id', '=', $this->site_id ];
|
||||
$condition[] = [ 'recharge_id', '=', $recharge_id ];
|
||||
|
|
@ -235,21 +212,16 @@ class Memberrecharge extends BaseShop
|
|||
if ($status) {
|
||||
$condition[] = [ 'use_status', '=', $status ];
|
||||
}
|
||||
|
||||
$page = input('page', 1);
|
||||
$list = $model->getMemberRechargeCardPageList($condition, $page, $page_size, 'card_id desc', $this->card_field);
|
||||
return $list;
|
||||
} else {
|
||||
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
|
||||
$list = $model->getMemberRechargeCardPageList($condition, 1, $page_size, 'card_id desc', $this->card_field);
|
||||
$this->assign('list', $list);
|
||||
|
||||
$this->assign('recharge_id', $recharge_id);
|
||||
return $this->fetch('memberrecharge/card_lists');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -259,16 +231,13 @@ class Memberrecharge extends BaseShop
|
|||
public function cardDetail()
|
||||
{
|
||||
$model = new MemberRechargeCardModel();
|
||||
|
||||
$card_id = input('card_id', '');
|
||||
|
||||
//获取详情
|
||||
$info = $model->getMemberRechargeCardInfo(
|
||||
[ [ 'card_id', '=', $card_id ] ],
|
||||
$this->card_field
|
||||
)[ 'data' ] ?? [];
|
||||
$this->assign('info', $info);
|
||||
|
||||
return $this->fetch('memberrecharge/card_detail');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class Memberbankaccount extends BaseApi
|
|||
$withdraw_type = isset($this->params[ 'withdraw_type' ]) ? $this->params[ 'withdraw_type' ] : '';// '账户类型 alipay 支付宝 bank 银行卡
|
||||
$branch_bank_name = isset($this->params[ 'branch_bank_name' ]) ? $this->params[ 'branch_bank_name' ] : '';// 银行支行信息
|
||||
$bank_account = isset($this->params[ 'bank_account' ]) ? $this->params[ 'bank_account' ] : '';// 银行账号
|
||||
$bank_address = isset($this->params[ 'bank_address' ]) ? $this->params[ 'bank_address' ] : '';// 银行地址
|
||||
if (empty($realname)) {
|
||||
return $this->response($this->error('', 'REQUEST_REAL_NAME'));
|
||||
}
|
||||
|
|
@ -62,6 +63,7 @@ class Memberbankaccount extends BaseApi
|
|||
'withdraw_type' => $withdraw_type,
|
||||
'branch_bank_name' => $branch_bank_name,
|
||||
'bank_account' => $bank_account,
|
||||
'bank_address' => $bank_address,
|
||||
'is_default' => 1
|
||||
];
|
||||
$res = $member_bank_account_model->addMemberBankAccount($data);
|
||||
|
|
@ -76,13 +78,13 @@ class Memberbankaccount extends BaseApi
|
|||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
$id = isset($this->params[ 'id' ]) ? $this->params[ 'id' ] : 0;
|
||||
$realname = isset($this->params[ 'realname' ]) ? $this->params[ 'realname' ] : '';
|
||||
$mobile = isset($this->params[ 'mobile' ]) ? $this->params[ 'mobile' ] : '';
|
||||
$withdraw_type = isset($this->params[ 'withdraw_type' ]) ? $this->params[ 'withdraw_type' ] : '';// '账户类型 alipay 支付宝 bank 银行卡
|
||||
$branch_bank_name = isset($this->params[ 'branch_bank_name' ]) ? $this->params[ 'branch_bank_name' ] : '';// 银行支行信息
|
||||
$bank_account = isset($this->params[ 'bank_account' ]) ? $this->params[ 'bank_account' ] : '';// 银行账号
|
||||
$bank_address = isset($this->params[ 'bank_address' ]) ? $this->params[ 'bank_address' ] : '';// 银行地址
|
||||
if (empty($id)) {
|
||||
return $this->response($this->error('', 'REQUEST_ID'));
|
||||
}
|
||||
|
|
@ -113,6 +115,7 @@ class Memberbankaccount extends BaseApi
|
|||
'withdraw_type' => $withdraw_type,
|
||||
'branch_bank_name' => $branch_bank_name,
|
||||
'bank_account' => $bank_account,
|
||||
'bank_address' => $bank_address,
|
||||
'is_default' => 1
|
||||
];
|
||||
$res = $member_bank_account_model->editMemberBankAccount($data);
|
||||
|
|
@ -166,7 +169,7 @@ class Memberbankaccount extends BaseApi
|
|||
return $this->response($this->error('', 'REQUEST_ID'));
|
||||
}
|
||||
$member_bank_account_model = new MemberBankAccountModel();
|
||||
$info = $member_bank_account_model->getMemberBankAccountInfo([ [ 'member_id', '=', $this->member_id ], [ 'id', '=', $id ] ], 'id,member_id,realname,mobile,withdraw_type,branch_bank_name,bank_account,is_default');
|
||||
$info = $member_bank_account_model->getMemberBankAccountInfo([ [ 'member_id', '=', $this->member_id ], [ 'id', '=', $id ] ], 'id,member_id,realname,mobile,withdraw_type,branch_bank_name,bank_account,is_default,bank_address');
|
||||
if (!empty($info[ 'data' ])) {
|
||||
$info[ 'data' ][ 'withdraw_type_name' ] = $member_bank_account_model->getWithdrawType()[ $info[ 'data' ][ 'withdraw_type' ] ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ class Memberwithdraw extends BaseApi
|
|||
"account_number" => $account_number,
|
||||
"apply_money" => $apply_money,
|
||||
"mobile" => $mobile,
|
||||
"identity" => $mobile,
|
||||
"app_type" => $app_type
|
||||
);
|
||||
$result = $withdraw_model->apply($data, $member_info[ 'data' ][ 'site_id' ], 'shop');
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ class MemberAccount extends BaseModel
|
|||
|
||||
|
||||
$from_type[ 'balance' ][ 'transfer' ] = [ 'type_name' => '转账', 'type_url' => '' ];
|
||||
$from_type[ 'diamond' ]['diamond'] = [ 'type_name' => '赠送钻石', 'type_url' => '' ];
|
||||
$from_type[ 'balance' ]['diamond'] = [ 'type_name' => '赠送钻石', 'type_url' => '' ];
|
||||
$from_type[ 'diamond' ]['diamond'] = [ 'type_name' => '赠送猕猴桃', 'type_url' => '' ];
|
||||
$from_type[ 'balance' ]['diamond'] = [ 'type_name' => '赠送猕猴桃', 'type_url' => '' ];
|
||||
$this->from_type = $from_type;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,9 +92,7 @@ class MemberBankAccount extends BaseModel
|
|||
$config_model = new Withdraw();
|
||||
$config_result = $config_model->getConfig(1, 'shop');
|
||||
$config = $config_result['data']['value'];
|
||||
|
||||
if (!empty($config)) {
|
||||
|
||||
//提现方式为微信的时候 判断用户是否已关注公众号
|
||||
if ($data['withdraw_type'] == 'wechatpay') {
|
||||
//获取会员信息
|
||||
|
|
@ -103,26 +101,20 @@ class MemberBankAccount extends BaseModel
|
|||
return $this->error('', '请先绑定微信');
|
||||
}
|
||||
}
|
||||
|
||||
model('member_bank_account')->startTrans();
|
||||
try {
|
||||
|
||||
if ($data['is_default'] == 1) {
|
||||
model('member_bank_account')->update(['is_default' => 0], ['member_id' => $data['member_id']]);
|
||||
}
|
||||
$data['modify_time'] = time();
|
||||
$res = model('member_bank_account')->update($data, ['id' => $data['id']]);
|
||||
Cache::tag("member_bank_account_" . $data['member_id'])->clear();
|
||||
|
||||
model('member_bank_account')->commit();
|
||||
return $this->success($res);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
model('member_bank_account')->rollback();
|
||||
return $this->error('', $e->getMessage());
|
||||
}
|
||||
|
||||
} else {
|
||||
return $this->error('', '平台未开启会员提现');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class Withdraw extends BaseModel
|
|||
return $this->error([], "提现金额为{$config["money_multiple"]}倍数");
|
||||
}
|
||||
$member_id = $data["member_id"];
|
||||
$identity = $data["identity"];
|
||||
$identity = $data["identity"]??'';
|
||||
$member_model = new Member();
|
||||
$member_info_result = $member_model->getMemberInfo([["member_id", "=", $member_id]], "balance_money,headimg,wx_openid,username,mobile,weapp_openid,nickname");
|
||||
$member_info = $member_info_result["data"];
|
||||
|
|
@ -169,7 +169,7 @@ class Withdraw extends BaseModel
|
|||
"realname" => $data["realname"],
|
||||
"bank_name" => $bank_name,
|
||||
"account_number" => $account_number,
|
||||
"identity" => $identity,
|
||||
// "identity" => $identity,
|
||||
"mobile" => $data["mobile"],
|
||||
"applet_type" => $applet_type
|
||||
);
|
||||
|
|
|
|||
|
|
@ -29,9 +29,11 @@ class Test extends Controller
|
|||
}
|
||||
|
||||
public function s(){
|
||||
$paydata='{"item_code":"AM010201000000117823","charset":"UTF-8","notify_time":"2023-02-02 10:41:48","commodity_order_id":"202302020000000008847076","quantity":"1","total_price":"0.00","method":"alipay.open.servicemarket.order.notify","sign":"PrqlBU8y1sIIS962JrLmAuggPH89kSTy1cPLur9z0ynHI0YurAVVahaxxt9iWErUMOQGNKehyilyMtCeZdRh84hSdHKktSTHpDvy423sX9xVLYvPBii05joMBJUZ3PM4y7BbizyPamie3yPqdomDuGQ539AYTA\/9YtmwUoh62zjloIoq4UefDOihwuESGFmB5B3HYbw6HpSiVbe8lHEGNSKOGBTCi2OowaSk1sGaT9\/5dQgBCARDGb+amg4pKGMkw105ERlD2EEW9qoGQNwQVP7o9R5UP+7KqgOhg+X95kW5qcIjltjF6rRPa2cH\/j1WQ1RSeTfTuuRBOMLAOr3xuw==","order_time":"2023-02-02 10:38:00","title":"客单豹","specifications":"客单豹","version":"1.0","notify_id":"2023020200222103800094771410174673","merchant_pid":"2088402283167085","package_count":"0","notify_type":"servicemarket_order_notify","period_day":"-1","phone":"18980669271","name":"*敏","order_item_num":"1","contactor":"柏鸿凯","app_id":"2021003167617037","sign_type":"RSA2","timestamp":"2023-02-02 10:41:48"}';
|
||||
$res= event('AliAuthNotify',json_decode($paydata,true));
|
||||
var_dump($res);
|
||||
|
||||
var_dump(329*1/100);
|
||||
// $paydata='{"item_code":"AM010201000000117823","charset":"UTF-8","notify_time":"2023-02-02 10:41:48","commodity_order_id":"202302020000000008847076","quantity":"1","total_price":"0.00","method":"alipay.open.servicemarket.order.notify","sign":"PrqlBU8y1sIIS962JrLmAuggPH89kSTy1cPLur9z0ynHI0YurAVVahaxxt9iWErUMOQGNKehyilyMtCeZdRh84hSdHKktSTHpDvy423sX9xVLYvPBii05joMBJUZ3PM4y7BbizyPamie3yPqdomDuGQ539AYTA\/9YtmwUoh62zjloIoq4UefDOihwuESGFmB5B3HYbw6HpSiVbe8lHEGNSKOGBTCi2OowaSk1sGaT9\/5dQgBCARDGb+amg4pKGMkw105ERlD2EEW9qoGQNwQVP7o9R5UP+7KqgOhg+X95kW5qcIjltjF6rRPa2cH\/j1WQ1RSeTfTuuRBOMLAOr3xuw==","order_time":"2023-02-02 10:38:00","title":"客单豹","specifications":"客单豹","version":"1.0","notify_id":"2023020200222103800094771410174673","merchant_pid":"2088402283167085","package_count":"0","notify_type":"servicemarket_order_notify","period_day":"-1","phone":"18980669271","name":"*敏","order_item_num":"1","contactor":"柏鸿凯","app_id":"2021003167617037","sign_type":"RSA2","timestamp":"2023-02-02 10:41:48"}';
|
||||
// $res= event('AliAuthNotify',json_decode($paydata,true));
|
||||
// var_dump($res);
|
||||
}
|
||||
|
||||
// public function e(){
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@
|
|||
{block name="resources"}
|
||||
<link rel="stylesheet" href="SHOP_CSS/index.css">
|
||||
{/block}
|
||||
|
||||
{block name="main"}
|
||||
|
||||
|
||||
{if !$guide_close}
|
||||
<div class="common-wrap guide">
|
||||
<div class="head">
|
||||
|
|
@ -117,7 +114,6 @@
|
|||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="common-wrap">
|
||||
<div class="head">
|
||||
<div class="title">实时概况</div>
|
||||
|
|
@ -164,7 +160,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="common-wrap">
|
||||
<div class="head">
|
||||
<div class="title">待办事项</div>
|
||||
|
|
@ -220,7 +215,6 @@
|
|||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="echart-wrap">
|
||||
<div class="common-wrap">
|
||||
<div class="head">
|
||||
|
|
@ -239,7 +233,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="common-wrap">
|
||||
<div class="head">
|
||||
<div class="title">常用功能</div>
|
||||
|
|
@ -281,7 +274,6 @@
|
|||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="promotion-wrap">
|
||||
<div class="common-wrap">
|
||||
<div class="head">
|
||||
|
|
@ -336,16 +328,12 @@
|
|||
{block name="script"}
|
||||
<script src="SHOP_JS/echarts.min.js"></script>
|
||||
<script>
|
||||
|
||||
// 今日昨日统计
|
||||
getDayCount();
|
||||
|
||||
// 综合统计
|
||||
getSumCount();
|
||||
|
||||
// 图形统计
|
||||
getChartCount();
|
||||
|
||||
function getDay(day){
|
||||
var today = new Date();
|
||||
var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -0,0 +1,288 @@
|
|||
.mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
.box {
|
||||
width: 100vw;
|
||||
height: 50vh;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin: auto;
|
||||
z-index: 101;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.center {
|
||||
position: absolute;
|
||||
}
|
||||
.bottom {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
.tle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 3%;
|
||||
.tle_lft {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image {
|
||||
width:60rpx;
|
||||
height:60rpx;
|
||||
}
|
||||
.tle_1 {
|
||||
font-size: 30rpx;
|
||||
color: #444;
|
||||
font-weight: bold;
|
||||
letter-spacing: 3rpx;
|
||||
padding-left: 8rpx;
|
||||
}
|
||||
.tle_2 {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
letter-spacing: 3rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
}
|
||||
.tle_rgt {
|
||||
padding: 0 20rpx;
|
||||
image {
|
||||
width: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.pwd_info {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: red;
|
||||
margin: 10px;
|
||||
height: 100rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.bg {
|
||||
opacity: 0.5;
|
||||
position: absolute;
|
||||
top: 85rpx;
|
||||
// left: 0;
|
||||
right: 0;
|
||||
image {
|
||||
width: 250rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pwd_box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
padding: 20rpx 0 0 0;
|
||||
|
||||
.pwd-text {
|
||||
position: relative;
|
||||
line-height: 60rpx;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
font-size: 46rpx;
|
||||
color: #0fb361;
|
||||
font-weight: bold;
|
||||
width: 60rpx;
|
||||
height: 70rpx;
|
||||
margin-right: 20rpx;
|
||||
display: inline-block;
|
||||
border-bottom: solid 1px #666;
|
||||
}
|
||||
|
||||
.pwd-text.active:after {
|
||||
-webkit-animation: twinkle 1s infinite;
|
||||
animation: twinkle 1s infinite;
|
||||
height: 40rpx;
|
||||
width: 5rpx;
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: #007aff;
|
||||
}
|
||||
|
||||
@-webkit-keyframes twinkle {
|
||||
from {
|
||||
background-color: #007aff;
|
||||
}
|
||||
|
||||
to {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.solt {
|
||||
width: 96vw;
|
||||
background: #f5f5f5;
|
||||
padding: 10rpx 2vw;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top: 1px solid #ccc;
|
||||
|
||||
// border-radius: 30rpx 30rpx 0 0;
|
||||
.s_lft {
|
||||
width: 78vw;
|
||||
padding-right: 10rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.s_li {
|
||||
width: 31%;
|
||||
margin-bottom: 20rpx;
|
||||
background: #fff;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
font-size: 40rpx;
|
||||
color: #444;
|
||||
font-weight: bold;
|
||||
border: 1px solid #fff;
|
||||
margin: 10px 5px 5px 0;
|
||||
}
|
||||
|
||||
.s_o {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.button-hover {
|
||||
background: #eee !important;
|
||||
}
|
||||
|
||||
.s_sq {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.s_rgt {
|
||||
width: 20vw;
|
||||
height: 100%;
|
||||
|
||||
.s_li {
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
background: #fff;
|
||||
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
.s_s {
|
||||
height: 200rpx;
|
||||
line-height: 200rpx;
|
||||
color: #fff;
|
||||
margin: 0 0 -5px;
|
||||
background: #0fb361;
|
||||
}
|
||||
|
||||
.s_x {
|
||||
height: 200rpx;
|
||||
line-height: 200rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 0 5px;
|
||||
image {
|
||||
width: 50rpx;
|
||||
}
|
||||
}
|
||||
.s_cx {
|
||||
.button-hover {
|
||||
background: #eee !important;
|
||||
}
|
||||
}
|
||||
|
||||
.s_qd {
|
||||
.button-hover {
|
||||
background: #2aa515 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 弹入-从下 */
|
||||
.a-bounceinB {
|
||||
-webkit-animation: 0.3s ease-out backwards;
|
||||
-moz-animation: 0.3s ease-out backwards;
|
||||
-ms-animation: 0.3s ease-out backwards;
|
||||
-moz-transform: translate3d(0, 0, 0);
|
||||
-ms-transform: translate3d(0, 0, 0);
|
||||
-o-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
-webkit-animation-name: bounceinB;
|
||||
-moz-animation-name: bounceinB;
|
||||
-ms-animation-name: bounceinB;
|
||||
animation-name: bounceinB;
|
||||
}
|
||||
|
||||
/* 弹入-从下 */
|
||||
@keyframes bounceinB {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(100%);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 弹出-向下 */
|
||||
.a-bounceoutB {
|
||||
-webkit-animation: 0.3s ease-in forwards;
|
||||
-moz-animation: 0.3s ease-in forwards;
|
||||
-ms-animation: 0.3s ease-in forwards;
|
||||
animation: 0.3s ease-in forwards;
|
||||
-moz-transform: translate3d(0, 0, 0);
|
||||
-ms-transform: translate3d(0, 0, 0);
|
||||
-o-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
-webkit-animation-name: bounceoutB;
|
||||
-moz-animation-name: bounceoutB;
|
||||
-ms-animation-name: bounceoutB;
|
||||
animation-name: bounceoutB;
|
||||
}
|
||||
|
||||
/* 弹出-向下 */
|
||||
@keyframes bounceoutB {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: translateY(100%);
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.9 KiB |