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

更改订单列表dom结构

... ... @@ -166,20 +166,20 @@ class OrderSalesmanController extends WeChatBaseController
}
public function send_all(){
$param = $this->request->param();
if(empty($param['start_time2']) || empty($param['end_time2']) || empty($param['indent_ids'])){
if(empty($param['start_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['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{
// $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');
... ...
... ... @@ -110,7 +110,7 @@
}
/*.dingdan_detail {*/
/*padding-top: 0.22rem;*/
/*padding-top: 0.22rem;*/
/*}*/
.dingdan_detail_hao {
... ... @@ -120,7 +120,7 @@
font-weight: 400;
color: rgba(102, 102, 102, 1);
opacity: 1;
margin-top:0.2rem;
margin-top: 0.2rem;
}
.right_dingdan {
... ... @@ -253,16 +253,17 @@
<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 class="log_psong tongyi_start_time2" style="color: #CCCCCC;">
请选择配送到达时间
</div>
<input type="hidden" id="start_time2" value="" placeholder="请输入开配送时间"/>
</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>
... ... @@ -375,9 +376,9 @@
<foreach name="$data" item="vo">
<if condition="$vo.state eq 2">
<php>$arr2[] = $vo;</php>
<elseif condition="$vo.state eq 5" />
<elseif condition="$vo.state eq 5"/>
<php>$arr5[] = $vo;</php>
<elseif condition="$vo.state eq 3" />
<elseif condition="$vo.state eq 3"/>
<php>$arr3[] = $vo;</php>
</if>
</foreach>
... ... @@ -920,51 +921,51 @@
// " <div class=\"log_three_center_three\"><span>¥</span>" + indent_goods_data[i3].price + "</div>\n" +
// " </div>\n" +
// " </div>";
if(result[i].is_courier == 2){
if (result[i].is_courier == 2) {
indent_goods_html += "<div class=\"dingdan_detail\">\n" +
" <div class=\"log_three_list_center\" style=\"display: flex;justify-content: flex-start;\">\n" +
" <div class=\"log_three_list_center_left\" style=\"width: 1.44rem;height:1.44rem\">\n" +
" <img src=\""+indent_goods_data[i3].thumbnail+"\" alt=\"\"\n" +
" <img src=\"" + indent_goods_data[i3].thumbnail + "\" alt=\"\"\n" +
" style=\"width: 100%;height: 100%;\"/>\n" +
" </div>\n" +
" <div class=\"right_dingdan\">\n" +
" <div class=\"right_dingdan_top\">\n" +
" <div class=\"right_dingdan_one\">"+indent_goods_data[i3].book_name+"</div>\n" +
" <div class=\"right_dingdan_two\">¥"+indent_goods_data[i3].price+"</div>\n" +
" <div class=\"right_dingdan_one\">" + indent_goods_data[i3].book_name + "</div>\n" +
" <div class=\"right_dingdan_two\">¥" + indent_goods_data[i3].price + "</div>\n" +
" </div>\n" +
" <div class=\"right_dingdan_center\">\n" +
" <div class=\"right_dindan_three right_dingdan_one\">x"+indent_goods_data[i3].number+"</div>\n" +
" <div class=\"right_dindan_three right_dingdan_one\">x" + indent_goods_data[i3].number + "</div>\n" +
" </div>\n" +
"\n" +
" <div class=\"right_dingdan_four right_dingdan_one\">地址:"+result[i].region+" "+result[i].detailed+"\n" +
" <div class=\"right_dingdan_four right_dingdan_one\">地址:" + result[i].region + " " + result[i].detailed + "\n" +
" </div>\n" +
" <div class=\"right_dingdan_four right_dingdan_one\" style=\"margin-top: -0.05rem;\">\n" +
" "+result[i].name+":"+result[i].phone+"\n" +
" " + result[i].name + ":" + result[i].phone + "\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" </div>";
}else{
} else {
indent_goods_html += "<div class=\"dingdan_detail\">\n" +
" <div class=\"log_three_list_center\" style=\"display: flex;justify-content: flex-start;\">\n" +
" <div class=\"log_three_list_center_left\" style=\"width: 1.44rem;height:1.44rem\">\n" +
" <img src=\""+indent_goods_data[i3].thumbnail+"\" alt=\"\"\n" +
" <img src=\"" + indent_goods_data[i3].thumbnail + "\" alt=\"\"\n" +
" style=\"width: 100%;height: 100%;\"/>\n" +
" </div>\n" +
" <div class=\"right_dingdan\">\n" +
" <div class=\"right_dingdan_top\">\n" +
" <div class=\"right_dingdan_one\">"+indent_goods_data[i3].book_name+"</div>\n" +
" <div class=\"right_dingdan_two\">¥"+indent_goods_data[i3].price+"</div>\n" +
" <div class=\"right_dingdan_one\">" + indent_goods_data[i3].book_name + "</div>\n" +
" <div class=\"right_dingdan_two\">¥" + indent_goods_data[i3].price + "</div>\n" +
" </div>\n" +
" <div class=\"right_dingdan_center\">\n" +
" <div class=\"right_dindan_three right_dingdan_one\">x"+indent_goods_data[i3].number+"</div>\n" +
" <div class=\"right_dindan_three right_dingdan_one\">x" + indent_goods_data[i3].number + "</div>\n" +
" </div>\n" +
"\n" +
" <div class=\"right_dingdan_four right_dingdan_one\">地址:"+result[i].school+" "+result[i].grade+"\n" +
" "+result[i].class+"\n" +
" <div class=\"right_dingdan_four right_dingdan_one\">地址:" + result[i].school + " " + result[i].grade + "\n" +
" " + result[i].class + "\n" +
" </div>\n" +
" <div class=\"right_dingdan_four right_dingdan_one\" style=\"margin-top: -0.05rem;\">\n" +
" "+result[i].name+":"+result[i].phone+"\n" +
" " + result[i].name + ":" + result[i].phone + "\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
... ... @@ -991,7 +992,7 @@
"\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 + "\"><div class=\"dingdan_detail_top\">\n" +
" <div class=\"dingdan_detail_hao\">订单号:"+result[i].order_number+"</div>\n" +
" <div class=\"dingdan_detail_hao\">订单号:" + result[i].order_number + "</div>\n" +
" </div>\n" + indent_goods_html + "</a>" +
"\t\t\t\t\t\t<div class=\"log_three_bottom_btn\">" + html_bottom + "</div></div>";
} else if (is_courier == 2) {
... ... @@ -1014,7 +1015,7 @@
"\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 + "\"><div class=\"dingdan_detail_top\">\n" +
" <div class=\"dingdan_detail_hao\">订单号:"+result[i].order_number+"</div>\n" +
" <div class=\"dingdan_detail_hao\">订单号:" + result[i].order_number + "</div>\n" +
" </div>\n" + indent_goods_html + "</a>" +
"\t\t\t\t\t\t<div class=\"log_three_bottom_btn\">" + html_bottom + "</div></div>";
}
... ... @@ -1175,22 +1176,36 @@
});
$('.confirm2').click(function () {
var start_time2 = $('#start_time2').val();
var end_time2 = $('#end_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 {
}
// 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},
data: {
'start_time2': start_time2,
// 'end_time2': end_time2,
'indent_ids': indent_ids},
success: function (res) {
console.log(indent_ids);
indent_ids=indent_ids.split(",");
console.log(indent_ids)
if (res.code == 1) {
alert('发货成功')
$.each(indent_ids,function(key,indent_id){
$('.order_' + indent_id).remove();
});
$(".tx_masktwo").css({
display: "none"
});
alert(res.msg)
} else {
alert(res.msg);
}
... ... @@ -1240,14 +1255,24 @@
labels: ['年', '月', '日', '时', '分', '秒'], //设置默认标签区域提示语
})
//统一配送选择时间
$(".tongyi_start_time").click(function() {
dtpicker.show(function(e) {
$(".tongyi_start_time").click(function () {
dtpicker.show(function (e) {
console.log(e);
$('.tongyi_start_time').text(e.text);
$('#start_time').val(e.text);
$('.tongyi_start_time').css('color', '#333333');
});
});
$(".tongyi_start_time2").click(function () {
dtpicker.show(function (e) {
console.log(e);
$('.tongyi_start_time2').text(e.text);
$('#start_time2').val(e.text);
$('.tongyi_start_time2').css('color', '#333333');
});
});
function zZFun(e) {
window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
}
... ...
... ... @@ -204,8 +204,8 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
/*$user = Db::name('user')->where('id',28)->find();
cmf_update_current_user($user);*/
$user = Db::name('user')->where('id',28)->find();
cmf_update_current_user($user);
$userId = cmf_get_current_user_id();
if (empty($userId)) {
$config = [
... ...