作者 王晓刚
1 个管道 的构建 通过 耗费 1 秒

合并分支 'wangxiaogang' 到 'master'

Wangxiaogang



查看合并请求 !72
... ... @@ -17,16 +17,20 @@ use think\Db;
class OrderSalesmanController extends WeChatBaseController
{
protected $user_id;
public function _initialize(){
protected $beforeActionList = [
'check' => ['except' => 'getGradeClass'],
];
protected function check() {
$user_id = cmf_get_current_user_id();
$this->user_id = $user_id;
$my_user = Db::name('my_user')->where(['uid'=>$user_id])->find();
if(empty($my_user)){
$this->error($user_id,'','','');
$this->error('查无此人','','','');
}
if($my_user['status'] != 2){
$this->error('您还不是业务员那','','','');
}
// if($my_user['status'] != 2){
// $this->error('您还不是业务员那','','','');
// }
}
public function get_all(){
$param = $this->request->param();
... ... @@ -135,7 +139,40 @@ class OrderSalesmanController extends WeChatBaseController
$arr['logistic_code'] = $param['logistic_code'];
}
$arr['state'] = 5;
$result = $indentModel->updateData($where,$arr);
// $result = $indentModel->updateData($where,$arr);
$this->success('发货成功');
}
public function send_all(){
$param = $this->request->param();
if(empty($param['start_time2']) || empty($param['end_time2']) || empty($param['indent_ids'])){
$this->error('缺少必要参数');
}
$indent_ids = explode(',',$param['indent_ids']);
$data['start_time'] = $param['start_time2'];
$data['end_time'] = $param['end_time2'];
$data['state'] = 5;
$indentModel = new IndentModel();
$result = $indentModel->updateData(['id'=>['in',$indent_ids]],$data);
if(empty($result)){
$this->error('更新失败');
}else{
$this->success('发货成功');
}
}
public function get_one(){
$id = $this->request->param('id',0,'intval');
if(empty($id)){
$this->error('缺少必参数','','','');
}
$indentModel = new IndentModel();
$indent = $indentModel->findData(['id'=>$id]);
if(empty($indent)){
$this->error('查询为空');
}
$indentGoodsModel = new IndentGoodsModel();
$indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent['id']]);
$indent['indent_goods'] = $indent_goods;
$this->assign('data',$indent);
return $this->fetch();
}
}
\ No newline at end of file
... ...
... ... @@ -10,7 +10,7 @@
// [ 入口文件 ]
// 调试模式开关
define("APP_DEBUG",true);
define("APP_DEBUG",false);
// 定义CMF根目录,可更改此目录
define('CMF_ROOT', __DIR__ . '/../');
... ...
... ... @@ -10,6 +10,16 @@
<link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css"/>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
<link rel="stylesheet" href="__TMPL__/public/assets/css/log.css"/>
<style>
.tx_masktwo {
display: none;
z-index: 2;
width: 100%;
height: 100%;
position: fixed;
background-color: rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body>
... ... @@ -81,42 +91,67 @@
</div>
<!-- 弹窗 -->
<!--<div class="tx_mask">-->
<!--<div class="tx_maskCon">-->
<!--<div class="tx_maskConImg">-->
<!--<img src="__TMPL__/public/assets/images/90.png" alt=""/>-->
<!--</div>-->
<!--<div class="tx_maskCon2">-->
<!--<div class="log_three_model">-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">配送时间</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入开始配送时间"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">配送时间</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入结束配送时间"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">快递公司</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入快递公司"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">快递单号</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入快递单号"/>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; 确定 &ndash;&gt;-->
<!--<div class="tx_maskOk confirm" data-id="">确定</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="tx_maskCon">-->
<!--<div class="tx_maskConImg">-->
<!--<img src="__TMPL__/public/assets/images/90.png" alt=""/>-->
<!--</div>-->
<!--<div class="tx_maskCon2">-->
<!--<div class="log_three_model">-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">配送时间</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入开始配送时间"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">配送时间</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入结束配送时间"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">快递公司</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入快递公司"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">快递单号</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入快递单号"/>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; 确定 &ndash;&gt;-->
<!--<div class="tx_maskOk confirm" data-id="">确定</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="tx_masktwo" style="display: none;">
<div class="tx_maskCon">
<div class="tx_maskConImg">
<img src="__TMPL__/public/assets/images/91.png" alt=""/>
</div>
<div class="tx_maskCon2">
<div class="log_three_model">
<div class="log_three_model_one time">
<div class="log_three_model_left">配送时间</div>
<div class="log_psong">
<input type="text" id="start_time2" value="" placeholder="请输入开始配送时间"/>
</div>
</div>
<div class="log_three_model_one time">
<div class="log_three_model_left">配送时间</div>
<div class="log_psong">
<input type="text" id="end_time2" value="" placeholder="请输入结束配送时间"/>
</div>
</div>
</div>
<!-- 确定 -->
<div class="tx_maskOk confirm2" data-is_courier="" data-id="" data-indent-id="">确定</div>
</div>
</div>
</div>
<div class="tx_maskone">
<div class="tx_maskCon">
<div class="tx_maskConImg">
... ... @@ -137,17 +172,17 @@
</div>
</div>
<!--<div class="log_three_model_one logistic" style="padding-bottom: 0;">-->
<!--<div class="log_three_model_left" style="margin-top: -0.3rem;">快递公司</div>-->
<!--<div class="log_three_model_right">-->
<!--<input type="text" id="logistic_name" placeholder="请输入快递公司"/>-->
<!--</div>-->
<!--<div class="log_three_model_left" style="margin-top: -0.3rem;">快递公司</div>-->
<!--<div class="log_three_model_right">-->
<!--<input type="text" id="logistic_name" placeholder="请输入快递公司"/>-->
<!--</div>-->
<!--</div>-->
<div class="log_three_model_one logistic">
<div class="log_three_model_left">选择快递</div>
<div class="log_psong log_psong_select">
<div class="log_ps_title">请选择</div>
<div class="log_ps_img">
<img src="__TMPL__/public/assets/images/29.png" />
<img src="__TMPL__/public/assets/images/29.png"/>
<input type="hidden" id="logistic_name" placeholder="请选择快递公司"/>
</div>
</div>
... ... @@ -215,7 +250,8 @@
<div class="log_three_list_top_left">
<if condition="$vo.is_courier eq 1">
<div class="log_three_list_top_lo">
<img src="__TMPL__/public/assets/images/fangkuang.png" alt=""/>
<img src="__TMPL__/public/assets/images/fangkuang.png"
data-indent-id="{$vo['id']}" alt=""/>
</div>
</if>
<div class="log_three_list_top_lt">
... ... @@ -237,24 +273,27 @@
</if>
</div>
</div>
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_center_one">
{$i_g.book_name}
<a href="{:url('get_one',array('id'=>$vo['id']))}">
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_center_one">
{$i_g.book_name}
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
</div>
</div>
</foreach>
</foreach>
</a>
<!-- 立即发货 -->
<div class="log_three_bottom_btn">
<if condition="$vo.state eq 2">
<div class="log_three_bottom send" data-indent-id="{$vo.id}" data-is_courier="{$vo.is_courier}">
<div class="log_three_bottom send" data-indent-id="{$vo.id}"
data-is_courier="{$vo.is_courier}">
立即发货
</div>
<elseif condition="$vo.state eq 5"/>
... ... @@ -284,7 +323,8 @@
<div class="log_three_list_top_left">
<if condition="$vo.is_courier eq 1">
<div class="log_three_list_top_lo">
<img src="__TMPL__/public/assets/images/fangkuang.png" alt=""/>
<img src="__TMPL__/public/assets/images/fangkuang.png"
data-indent-id="{$vo['id']}" alt=""/>
</div>
</if>
<div class="log_three_list_top_lt">
... ... @@ -306,20 +346,22 @@
</if>
</div>
</div>
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_center_one">
{$i_g.book_name}
<a href="{:url('get_one',array('id'=>$vo['id']))}">
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_center_one">
{$i_g.book_name}
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
</div>
</div>
</foreach>
</foreach>
</a>
<!-- 立即发货 -->
<div class="log_three_bottom_btn">
<if condition="$vo.state eq 2">
... ... @@ -341,10 +383,10 @@
</if>
</div>
</div>
</a>
</if>
</foreach>
</div>
<!--已完成-->
<div class="log_three_list_contant">
<foreach name="$data" item="vo">
... ... @@ -354,7 +396,8 @@
<div class="log_three_list_top_left">
<if condition="$vo.is_courier eq 1">
<div class="log_three_list_top_lo">
<img src="__TMPL__/public/assets/images/fangkuang.png" alt=""/>
<img src="__TMPL__/public/assets/images/fangkuang.png"
data-indent-id="{$vo['id']}" alt=""/>
</div>
</if>
<div class="log_three_list_top_lt">
... ... @@ -376,20 +419,22 @@
</if>
</div>
</div>
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_center_one">
{$i_g.book_name}
<a href="{:url('get_one',array('id'=>$vo['id']))}">
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_center_one">
{$i_g.book_name}
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
</div>
</div>
</foreach>
</foreach>
</a>
<!-- 立即发货 -->
<div class="log_three_bottom_btn">
<if condition="$vo.state eq 2">
... ... @@ -425,7 +470,7 @@
全选
</div>
</div>
<div class="log_three_fixed_right">
<div class="log_three_fixed_right unify_all">
统一发货
</div>
</div>
... ... @@ -452,7 +497,7 @@
$(this).addClass("three_model_school_hover").addClass("word_color").addClass('aaa').siblings().removeClass("three_model_school_hover").removeClass("word_color").removeClass("aaa");
});
$("body").on('click','.log_three_list_top_lo',function () {
$("body").on('click', '.log_three_list_top_lo', function () {
console.log($(this).find("img").attr("src"));
if ($(this).find("img").attr("src") == "__TMPL__/public/assets/images/fangkuang.png") {
$(this).find("img").attr("src", "__TMPL__/public/assets/images/xuanzhong (1).png");
... ... @@ -489,12 +534,12 @@
});
//统一配送
$(".log_three_select_tongyi").click(function(){
$(".log_three_select_tongyi").click(function () {
$(".tx_mask_tongyi").css({
display: "block"
});
})
$(".tx_mask_tongyi .three_model_school_name").click(function(){
$(".tx_mask_tongyi .three_model_school_name").click(function () {
var index = $(this).index();
$(this).addClass('there_unActive').siblings().removeClass('there_unActive');
$('.log_three_select_contant').text($(this).text()).css("color", "#333");
... ... @@ -503,13 +548,13 @@
$("#is_courier").val($(this).attr('data-id'))
})
//选择快递方式
$(".log_psong_select").click(function() {
$(".log_psong_select").click(function () {
console.log(213)
$(".tx_mask_kuaidi").css({
display: "block"
});
});
$(".tx_mask_kuaidi .three_model_school_name").click(function() {
$(".tx_mask_kuaidi .three_model_school_name").click(function () {
var index = $(this).index();
$(this).addClass('there_unActive').siblings().removeClass('there_unActive');
$('.log_ps_title').text($(this).text()).css("color", "#333");
... ... @@ -517,7 +562,7 @@
$('#logistic_name').val($(this).attr('data-name'))
});
var index = $(".log_three_bottom").index();
$("body").on('click','.log_three_bottom',function () {
$("body").on('click', '.log_three_bottom', function () {
console.log(index);
$(".tx_maskone").css({
display: "block"
... ... @@ -566,7 +611,8 @@
$('.tx_mask_school').hide()
}
});
function search(){
function search() {
var school = $('#school').val();
var grade = $('#grade').val();
var state = $('.log_three_tab_top .aaa').attr('data-state');
... ... @@ -577,120 +623,121 @@
// } else if (grade == '') {
// alert('请选择班级')
// } else {
console.log(school);
console.log(grade);
$.ajax({
'url': "{:url('order_salesman/getOrderSalesman')}",
'type': "GET",
'data': {'school': school, 'grade': grade, 'state': state, 'is_courier':is_courier},
'success': (function (data) {
var index = $('.log_three_tab_top div').index($('.aaa'));
if (data.code == 1) {
var result = data.data;
console.log(result)
var html = '';
for (var i = 0; i < result.length; i++) {
if (result[i]['state'] == 2) {
var state = '待发货';
if (result[i]['is_courier'] == 1) {
var html_bottom = "<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom send\" data-indent-id=\"" + result[i].id + "\" data-is_courier=\"" + result[i].is_courier + "\">\n" +
"\t\t\t\t\t\t\t\t\t\t立即发货\n" +
"\t\t\t\t\t\t\t\t\t</div></div>";
} else {
var html_bottom = "<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom send\" data-indent-id=\"" + result[i].id + "\" data-is_courier=\"" + result[i].is_courier + "\">\n" +
"\t\t\t\t\t\t\t\t\t\t立即发货\n" +
"\t\t\t\t\t\t\t\t\t</div></div>";
}
} else if (result[i]['state'] == 5) {
var state = '已发货';
if(result[i]['is_courier'] == 2){
var html_bottom = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/"+result[i].id+"\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom\" data-indent-id=\"" + result[i].id + "\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t\t查看物流\n" +
"\t\t\t\t\t\t\t\t\t\t\t</div></div>\n" +
"\t\t\t\t\t\t\t\t\t\t</a>";
}else{
var html_bottom = "";
}
console.log(school);
console.log(grade);
$.ajax({
'url': "{:url('order_salesman/getOrderSalesman')}",
'type': "GET",
'data': {'school': school, 'grade': grade, 'state': state, 'is_courier': is_courier},
'success': (function (data) {
var index = $('.log_three_tab_top div').index($('.aaa'));
if (data.code == 1) {
var result = data.data;
console.log(result)
var html = '';
for (var i = 0; i < result.length; i++) {
if (result[i]['state'] == 2) {
var state = '待发货';
if (result[i]['is_courier'] == 1) {
var html_bottom = "<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom send\" data-indent-id=\"" + result[i].id + "\" data-is_courier=\"" + result[i].is_courier + "\">\n" +
"\t\t\t\t\t\t\t\t\t\t立即发货\n" +
"\t\t\t\t\t\t\t\t\t</div></div>";
} else {
var state = '已完成';
var html_bottom = "<div class=\"log_three_bottom\" data-indent-id=\"\"+result[i].id+\"\">\n" +
"\t\t\t\t\t\t\t\t\t\t已完成啦\n" +
"\t\t\t\t\t\t\t\t\t</div>";
var html_bottom = "<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom send\" data-indent-id=\"" + result[i].id + "\" data-is_courier=\"" + result[i].is_courier + "\">\n" +
"\t\t\t\t\t\t\t\t\t\t立即发货\n" +
"\t\t\t\t\t\t\t\t\t</div></div>";
}
var indent_goods_data = result[i].indent_goods;
var indent_goods_html = '';
for(var i3=0;i3<indent_goods_data.length;i3++){
indent_goods_html += "<div class=\"log_three_list_center\">\n" +
" <div class=\"log_three_list_center_left\">\n" +
" <img src=\"{:cmf_get_image_url('')}"+indent_goods_data[i3].thumbnail+"\" alt=\"\"/>\n" +
" </div>\n" +
" <div class=\"log_three_list_center_right\">\n" +
" <div class=\"log_three_center_one\">\n" +
" "+indent_goods_data[i3].book_name+"\n" +
" </div>\n" +
" <div class=\"log_three_center_two\">×"+indent_goods_data[i3].number+"</div>\n" +
" <div class=\"log_three_center_three\"><span>¥</span>"+indent_goods_data[i3].price*indent_goods_data[i3].number+"</div>\n" +
" </div>\n" +
" </div>";
}
if(is_courier == 1){
html += "<div class=\"log_three_list order_"+result[i].id+"\">\n" +
"\t\t\t\t\t\t\t<div class=\"log_three_list_top\">\n" +
"\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_left\">\n" +
"\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lo\">\n" +
"\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/fangkuang.png\" alt=\"\" />\n" +
"\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lt\">\n" +
"\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_zhongbiao\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/52.png\" alt=\"\" />\n" +
"\t\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_shijian\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t" + result[i].pay_time + "\n" +
"\t\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_right\">\n" +
"\t\t\t\t\t\t\t\t\t\t" + state + "\n" +
"\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t</div>\n" +indent_goods_html+
"\t\t\t\t\t\t"+html_bottom+"</div>";
}else if(is_courier == 2){
html += "<div class=\"log_three_list order_"+result[i].id+"\">\n" +
"\t\t\t\t\t\t\t<div class=\"log_three_list_top\">\n" +
"\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_left\">\n" +
// "\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lo\">\n" +
// "\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/fangkuang.png\" alt=\"\" />\n" +
// "\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lt\">\n" +
"\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_zhongbiao\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/52.png\" alt=\"\" />\n" +
"\t\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_shijian\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t" + result[i].pay_time + "\n" +
"\t\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_right\">\n" +
"\t\t\t\t\t\t\t\t\t\t" + state + "\n" +
"\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t</div>\n" +indent_goods_html+
"\t\t\t\t\t\t"+html_bottom+"</div>";
} else if (result[i]['state'] == 5) {
var state = '已发货';
if (result[i]['is_courier'] == 2) {
var html_bottom = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/" + result[i].id + "\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom\" data-indent-id=\"" + result[i].id + "\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t\t查看物流\n" +
"\t\t\t\t\t\t\t\t\t\t\t</div></div>\n" +
"\t\t\t\t\t\t\t\t\t\t</a>";
} else {
var html_bottom = "";
}
} else {
var state = '已完成';
var html_bottom = "<div class=\"log_three_bottom\" data-indent-id=\"\"+result[i].id+\"\">\n" +
"\t\t\t\t\t\t\t\t\t\t已完成啦\n" +
"\t\t\t\t\t\t\t\t\t</div>";
}
var indent_goods_data = result[i].indent_goods;
var indent_goods_html = '';
for (var i3 = 0; i3 < indent_goods_data.length; i3++) {
indent_goods_html += "<div class=\"log_three_list_center\">\n" +
" <div class=\"log_three_list_center_left\">\n" +
" <img src=\"{:cmf_get_image_url('')}" + indent_goods_data[i3].thumbnail + "\" alt=\"\"/>\n" +
" </div>\n" +
" <div class=\"log_three_list_center_right\">\n" +
" <div class=\"log_three_center_one\">\n" +
" " + indent_goods_data[i3].book_name + "\n" +
" </div>\n" +
" <div class=\"log_three_center_two\">×" + indent_goods_data[i3].number + "</div>\n" +
" <div class=\"log_three_center_three\"><span>¥</span>" + indent_goods_data[i3].price * indent_goods_data[i3].number + "</div>\n" +
" </div>\n" +
" </div>";
}
if (is_courier == 1) {
html += "<div class=\"log_three_list order_" + result[i].id + "\">\n" +
"\t\t\t\t\t\t\t<div class=\"log_three_list_top\">\n" +
"\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_left\">\n" +
"\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lo\">\n" +
"\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/fangkuang.png\" alt=\"\" />\n" +
"\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lt\">\n" +
"\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_zhongbiao\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/52.png\" alt=\"\" />\n" +
"\t\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_shijian\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t" + result[i].pay_time + "\n" +
"\t\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_right\">\n" +
"\t\t\t\t\t\t\t\t\t\t" + state + "\n" +
"\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t</div><a href=\"{:url('get_one','',false,true)}/id/"+result[i].id+"\">\n" + indent_goods_html +"</a>"+
"\t\t\t\t\t\t" + html_bottom + "</div>";
} else if (is_courier == 2) {
html += "<div class=\"log_three_list order_" + result[i].id + "\">\n" +
"\t\t\t\t\t\t\t<div class=\"log_three_list_top\">\n" +
"\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_left\">\n" +
// "\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lo\">\n" +
// "\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/fangkuang.png\" alt=\"\" />\n" +
// "\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lt\">\n" +
"\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_zhongbiao\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/52.png\" alt=\"\" />\n" +
"\t\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_shijian\">\n" +
"\t\t\t\t\t\t\t\t\t\t\t" + result[i].pay_time + "\n" +
"\t\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_right\">\n" +
"\t\t\t\t\t\t\t\t\t\t" + state + "\n" +
"\t\t\t\t\t\t\t\t</div>\n" +
"\t\t\t\t\t\t\t</div><a href=\"{:url('get_one','',false,true)}/id/"+result[i].id+"\">\n" + indent_goods_html +"</a>"+
"\t\t\t\t\t\t" + html_bottom + "</div>";
}
$('.log_three_list_contant').eq(index).html(html);
update();
} else {
alert('未知错误');
}
}),
'error': (function () {
alert('与服务器断开连接');
})
$('.log_three_list_contant').eq(index).html(html);
update();
} else {
alert('未知错误');
}
}),
'error': (function () {
alert('与服务器断开连接');
})
})
// }
}
$(function () {
$('.school').click(function () {
var school_id = $(this).attr('data-id');
... ... @@ -723,58 +770,65 @@
search()
});
//发货
$("body").on('click','.send',function(){
$("body").on('click', '.send', function () {
var indent_id = $(this).attr('data-indent-id');
var is_courier = $(this).attr('data-is_courier');
if(is_courier == 1){
if (is_courier == 1) {
//统一配送
$('.time').show();
$('.logistic').hide();
}else if(is_courier == 2){
} else if (is_courier == 2) {
//快递
$('.time').hide();
$('.logistic').show();
}
$('.confirm').attr('data-is_courier',is_courier);
$('.confirm').attr('data-indent-id',indent_id);
$('.confirm').attr('data-is_courier',is_courier);
$('.confirm').attr('data-is_courier', is_courier);
$('.confirm').attr('data-indent-id', indent_id);
$('.confirm').attr('data-is_courier', is_courier);
})
//点击确认
$("body").on('click','.confirm',function(){
$("body").on('click', '.confirm', function () {
var is_courier = $(this).attr('data-is_courier');
var start_time = $('#start_time').val();
var end_time = $('#end_time').val();
var logistic_name = $('#logistic_name').val();
var logistic_code = $('#logistic_code').val();
var indent_id = $(this).attr('data-indent-id');
if(is_courier == 1){
if(start_time == ''){
alert('请填写配送时间')
if (is_courier == 1) {
if (start_time == '') {
alert('请填写配送时间');
return false;
}else if(end_time == ''){
alert('请填写配送时间')
} else if (end_time == '') {
alert('请填写配送时间');
return false;
}
}else if(is_courier == 2){
if(logistic_name == ''){
alert('请填写快递公司')
} else if (is_courier == 2) {
if (logistic_name == '') {
alert('请填写快递公司');
return false;
}else if(logistic_code == ''){
alert('请填写快递单号')
} else if (logistic_code == '') {
alert('请填写快递单号');
return false;
}
}else if(is_courier == ''){
alert('未知错误')
} else if (is_courier == '') {
alert('未知错误');
return false;
}
$.ajax({
url:"{:url('order_salesman/send')}",
type:"GET",
data:{'start_time':start_time,'end_time':end_time,'logistic_name':logistic_name,'logistic_code':logistic_code,'is_courier':is_courier,'indent_id':indent_id},
success:function(res){
url: "{:url('order_salesman/send')}",
type: "GET",
data: {
'start_time': start_time,
'end_time': end_time,
'logistic_name': logistic_name,
'logistic_code': logistic_code,
'is_courier': is_courier,
'indent_id': indent_id
},
success: function (res) {
console.log(res);
if(res.code == 1){
$('.order_'+indent_id).remove();
if (res.code == 1) {
$('.order_' + indent_id).remove();
$(".tx_maskone").css({
display: "none"
});
... ... @@ -784,21 +838,62 @@
}
alert(res.msg)
},
error:function(res){
error: function (res) {
alert('与服务器断开连接')
}
})
});
$('body').on('click', '.unify_all', function () {
var length = $('.log_three_list_top_lo img').length - 1;
var arr = [];
for (var i = 0; i <= length; i++) {
if ($('.log_three_list_top_lo img').attr('src') == "__TMPL__/public/assets/images/xuanzhong (1).png") {
arr.push($('.log_three_list_top_lo img').eq(i).attr('data-indent-id'));
}
}
$('.confirm2').attr('data-indent-id', arr.join(","));
if (arr.length != 0) {
$('.tx_masktwo').show();
} else {
alert('请至少选择一个订单');
}
});
$('.confirm2').click(function () {
var start_time2 = $('#start_time2').val();
var end_time2 = $('#end_time2').val();
var indent_ids = $(this).attr('data-indent-id');
if (indent_ids == '') {
alert('请至少选择一个订单');
} else if (start_time2 == '') {
alert('请选择配送时间')
} else if (end_time2 == '') {
alert('请选择配送时间')
} else {
$.ajax({
url: "{:url('order_salesman/send_all')}",
type: "GET",
data: {'start_time2': start_time2, 'end_time2': end_time2, 'indent_ids': indent_ids},
success: function (res) {
if (res.code == 1) {
alert('发货成功')
} else {
alert(res.msg);
}
}
})
}
});
update();
})
function update(){
function update() {
var is_courier = $('#is_courier').val();
var index = $('.log_three_tab_top div').index($('.aaa'));
console.log(is_courier);
if(is_courier == 1){
if (is_courier == 1 && index == 0) {
$('.log_three_list_fixed').show();
}else if(is_courier == 2){
} else if (is_courier == 2 || index != 0) {
$('.log_three_list_fixed').hide();
}
}
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<title>学考无忧-订单确认-选择地址信息</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/mui.min.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
<link rel="stylesheet" href="__TMPL__/public/assets/css/log.css"/>
<style type="text/css">
.mui-poppicker-header,
.mui-picker {
background-color: white;
}
.mui-btn-blue,
.mui-btn-primary,
input[type=submit] {
background-color: #FF7700;
border: 0;
}
.mui-pciker-list li.highlight {
color: #FF7700;
}
.log_four_input_one_left {
width: 2.14rem;
}
.log_four_input_one_center {
margin-left: 0;
}
.log_four_input_one_right {
margin-left: auto;
}
</style>
</head>
<body style="background-color: #F7F7F7;">
<div class="log_top_co" style="background-color: white;">
<!-- 顶部 -->
<div class=" order_top log_top_co">
<a href="">
<img src="__TMPL__/public/assets/images/left.png" alt=""/>
</a>
<p>订单确认</p>
</div>
</div>
<div class="tx_maskone">
<div class="tx_maskCon">
<div class="tx_maskConImg">
<img src="__TMPL__/public/assets/images/91.png" alt=""/>
</div>
<div class="tx_maskCon2">
<div class="log_three_model">
<div class="log_three_model_one time">
<div class="log_three_model_left">配送时间</div>
<div class="log_psong">
<input type="text" id="start_time" value="" placeholder="请输入开始配送时间"/>
</div>
</div>
<div class="log_three_model_one time">
<div class="log_three_model_left">配送时间</div>
<div class="log_psong">
<input type="text" id="end_time" value="" placeholder="请输入结束配送时间"/>
</div>
</div>
<div class="log_three_model_one logistic">
<div class="log_three_model_left">选择快递</div>
<div class="log_psong log_psong_select">
<div class="log_ps_title">请选择</div>
<div class="log_ps_img">
<img src="__TMPL__/public/assets/images/29.png"/>
<input type="hidden" id="logistic_name" placeholder="请选择快递公司"/>
</div>
</div>
</div>
<div class="log_three_model_one logistic" style="padding-bottom: 0;">
<div class="log_three_model_left" style="margin-top: -0.3rem;">快递单号</div>
<div class="log_three_model_right">
<input type="text" id="logistic_code" placeholder="请输入快递单号"/>
</div>
</div>
</div>
<!-- 确定 -->
<div class="tx_maskOk confirm" data-is_courier="" data-id="" data-indent-id="">确定</div>
</div>
</div>
</div>
<!--选择快递-->
<div class="tx_mask_kuaidi">
<div class="tx_maskCon_school">
<div class="three_model_school">
<div class="three_model_school_title">
选择快递
</div>
<div>
<div class="three_model_school_data" style="display: block;">
<div class="three_model_school_name" data-name="SF">顺丰快递</div>
<div class="three_model_school_name" data-name="YTO">圆通快递</div>
<div class="three_model_school_name" data-name="STO">中通快递</div>
<div class="three_model_school_name there_unActive" data-name="STO">申通快递</div>
<div class="three_model_school_name" data-name="YD">韵达快递</div>
<div class="three_model_school_name" data-name="HHTT">天天快递</div>
<div class="three_model_school_name" data-name="HTKY">百世快递</div>
<div class="three_model_school_name" data-name="YZPY">邮政快递包裹</div>
<div class="three_model_school_name" data-name="EMS">EMS</div>
<div class="three_model_school_name" data-name="DBL">德邦快递</div>
<div class="three_model_school_name" data-name="ZJS">宅急送</div>
<div class="three_model_school_name" data-name="TNT">TNT快递</div>
</div>
</div>
</div>
</div>
</div>
<!-- 地址信息 -->
<div class="log_four_input">
<div class="log_four_input_title" style="margin-bottom: 0.2rem;">
地址信息
</div>
<div class="log_four_input_one">
<div class="log_four_input_one_left">
地区
</div>
<div class="log_four_input_one_center">
<div id="city_text">{$data.region}</div>
</div>
<div class="log_four_input_one_right">
<img src="__TMPL__/public/assets/images/29.png" alt=""/>
</div>
</div>
<div class="log_four_input_one">
<div class="log_four_input_one_left">
学校
</div>
<div class="log_four_input_one_center">
<div id="city_text">{$data.school}</div>
</div>
<div class="log_four_input_one_right">
<img src="__TMPL__/public/assets/images/29.png" alt=""/>
</div>
</div>
<div class="log_four_input_one">
<div class="log_four_input_one_left">
班级
</div>
<div class="log_four_input_one_center">
<div id="city_text">{$data.grade}-{$data.class}</div>
</div>
<div class="log_four_input_one_right">
<img src="__TMPL__/public/assets/images/29.png" alt=""/>
</div>
</div>
<div class="log_four_input_one">
<div class="log_four_input_one_left">
姓名
</div>
<div class="log_four_input_one_center">
<div id="city_text">{$data.name}</div>
</div>
<div class="log_four_input_one_right">
<img src="__TMPL__/public/assets/images/29.png" alt=""/>
</div>
</div>
<div class="log_four_input_one">
<div class="log_four_input_one_left">
手机号
</div>
<div class="log_four_input_one_center">
<div id="city_text">{$data.phone}</div>
</div>
</div>
</div>
<!-- 订单信息 -->
<div class="log_four_order">
<div class="log_four_order_details">
<div class="log_four_input_title" style="padding-bottom: 0.34rem;">
订单信息
</div>
<div class="log_four_order_details_one">
<foreach name="$data.indent_goods" item="i_g">
<div class="log_four_order_one">
<div class="log_four_order_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="log_four_order_center">
<div class="log_four_order_center_one txt-cut" style="-webkit-line-clamp: 1">
{$i_g.book_name}
</div>
<div class="log_four_order_center_two">
×{$i_g.number}
</div>
</div>
<div class="log_four_order_right">
<span></span>{$i_g.price*$i_g.number}
</div>
</div>
</foreach>
</div>
</div>
</div>
<!-- 支付方式 -->
<div class="log_four_pash">
<div class="log_four_pash_bottom">
<div class="log_four_pash_top_one">
买家留言
</div>
<div class="log_four_pash_bottom_two" style="margin-top: 0.06rem">
<textarea name="" id="" cols="20" rows="3" placeholder="">{$data.leave_word}</textarea>
</div>
</div>
</div>
<!-- 底部按钮 -->
<div class="log_seven_btn log_seven_btn9" style="margin-top: 0.36rem;">
<if condition="$data.state eq 2">
<div class="log_seven_btn_contant send" data-is_courier="{$data.is_courier}" data-indent-id="{$data.id}" >
立即发货
</div>
<elseif condition="$data.state eq 5"/>
<a href="{:url('logistics/index',array('indent_id'=>$data['id']))}">
<div class="log_seven_btn_contant">
查看物流
</div>
</a>
</if>
</div>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/mui.min.js"></script>
<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
<script>
//选择快递方式
$(".log_psong_select").click(function () {
$(".tx_mask_kuaidi").css({
display: "block"
});
});
$(".tx_mask_kuaidi .three_model_school_name").click(function () {
var index = $(this).index();
$(this).addClass('there_unActive').siblings().removeClass('there_unActive');
$('.log_ps_title').text($(this).text()).css("color", "#333");
$(".tx_mask_kuaidi").hide();
$('#logistic_name').val($(this).attr('data-name'))
});
$(function(){
$('body').on('click','.send',function(){
var indent_id = $(this).attr('data-indent-id');
var is_courier = $(this).attr('data-is_courier');
console.log(indent_id);
console.log(is_courier);
if (is_courier == 1) {
//统一配送
$('.time').show();
$('.logistic').hide();
} else if (is_courier == 2) {
//快递
$('.time').hide();
$('.logistic').show();
}
$('.tx_maskone').show();
$('.confirm').attr('data-indent-id',indent_id);
$('.confirm').attr('data-is_courier',is_courier);
});
$('body').on('click','.confirm',function(){
var is_courier = $(this).attr('data-is_courier');
var indent_id = $(this).attr('data-indent-id');
var logistic_name = $('#logistic_name').val();
var logistic_code = $('#logistic_code').val();
var start_time = $('#start_time').val();
var end_time = $('#end_time').val();
if (is_courier == 1) {
if (start_time == '') {
alert('请填写配送时间');
return false;
} else if (end_time == '') {
alert('请填写配送时间');
return false;
}
} else if (is_courier == 2) {
if (logistic_name == '') {
alert('请填写快递公司');
return false;
} else if (logistic_code == '') {
alert('请填写快递单号');
return false;
}
} else if (is_courier == '') {
alert('未知错误');
return false;
}
$.ajax({
url:"{:url('send')}",
type:"GET",
data:{'indent_id':indent_id,'is_courier':is_courier,'logistic_name':logistic_name,'logistic_code':logistic_code,'start_time':start_time,'end_time':end_time},
success:function(res){
console.log(res);
if (res.code == 1) {
$('.order_' + indent_id).remove();
$(".tx_maskone").css({
display: "none"
});
$(".tx_mask").css({
display: "none"
});
$('.send').remove();
var html = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/"+indent_id+"\">\n" +
" <div class=\"log_seven_btn_contant\">\n" +
" 查看物流\n" +
" </div>\n" +
" </a>";
$('.log_seven_btn9').html(html)
}
alert(res.msg)
}
})
})
})
</script>
</body>
</html>
\ No newline at end of file
... ...