<script>
new Vue({
el: '#app',
data: {
isShow1: true,
isShow2: false,
isShow3: false,
token: "{{csrf_token()}}",
start_time: 6,
end_time: 22,
notice_start_time: [
{
"indexId": 0,
"name": "00:00"
}, {
"indexId": 1,
"name": "01:00"
}, {
"indexId": 2,
"name": "02:00"
}, {
"indexId": 3,
"name": "03:00"
}, {
"indexId": 4,
"name": "04:00"
}, {
"indexId": 5,
"name": "05:00"
}, {
"indexId": 6,
"name": "06:00"
}, {
"indexId": 7,
"name": "07:00"
}, {
"indexId": 8,
"name": "08:00"
}, {
"indexId": 9,
"name": "09:00"
}, {
"indexId": 10,
"name": "10:00"
}, {
"indexId": 11,
"name": "11:00"
}, {
"indexId": 12,
"name": "12:00"
}, {
"indexId": 13,
"name": "13:00"
}, {
"indexId": 14,
"name": "14:00"
}, {
"indexId": 15,
"name": "15:00"
}, {
"indexId": 16,
"name": "16:00"
}, {
"indexId": 17,
"name": "17:00"
}, {
"indexId": 18,
"name": "18:00"
}, {
"indexId": 19,
"name": "19:00"
}, {
"indexId": 20,
"name": "20:00"
}, {
"indexId": 21,
"name": "21:00"
}, {
"indexId": 22,
"name": "22:00"
}, {
"indexId": 23,
"name": "23:00"
},],
notice_end_time: [
{
"indexId": 0,
"name": "00:00"
}, {
"indexId": 1,
"name": "01:00"
}, {
"indexId": 2,
"name": "02:00"
}, {
"indexId": 3,
"name": "03:00"
}, {
"indexId": 4,
"name": "04:00"
}, {
"indexId": 5,
"name": "05:00"
}, {
"indexId": 6,
"name": "06:00"
}, {
"indexId": 7,
"name": "07:00"
}, {
"indexId": 8,
"name": "08:00"
}, {
"indexId": 9,
"name": "09:00"
}, {
"indexId": 10,
"name": "10:00"
}, {
"indexId": 11,
"name": "11:00"
}, {
"indexId": 12,
"name": "12:00"
}, {
"indexId": 13,
"name": "13:00"
}, {
"indexId": 14,
"name": "14:00"
}, {
"indexId": 15,
"name": "15:00"
}, {
"indexId": 16,
"name": "16:00"
}, {
"indexId": 17,
"name": "17:00"
}, {
"indexId": 18,
"name": "18:00"
}, {
"indexId": 19,
"name": "19:00"
}, {
"indexId": 20,
"name": "20:00"
}, {
"indexId": 21,
"name": "21:00"
}, {
"indexId": 22,
"name": "22:00"
}, {
"indexId": 23,
"name": "23:00"
},],
is_send: 0,
order_time: 30,
order_end_time_id: 30,
order_end_time: [
{
"indexId": 0,
"name": "0分钟"
}, {
"indexId": 5,
"name": "5分钟"
}, {
"indexId": 15,
"name": "15分钟"
}, {
"indexId": 30,
"name": "30分钟"
}, {
"indexId": 60,
"name": "1小时"
}, {
"indexId": 120,
"name": "2小时"
}, {
"indexId": 180,
"name": "3小时"
}, {
"indexId": 240,
"name": "4小时"
}
],
message_list:[],
page:1,
message_statistics:[],
message_number:0,
page_list:[],
totle_page:0,
shop_name:""
},
created: function () {
this.get_shop_expediting();
//this.get_page_list();
},
methods: {
toggle1: function () {
this.isShow1 = true
this.isShow2 = false
this.isShow3 = false
},
toggle2: function () {
this.isShow1 = false
this.isShow2 = true
this.isShow3 = false
},
toggle3: function () {
this.isShow1 = false
this.isShow2 = false
this.isShow3 = true
},
get_shop_expediting: function () {
this.$http.post('/order/get_shop_expediting', {}, {emulateJSON: true})
.then(function (response) {
//alert(response.body.message);
let get_data = response.body.expediting;
//console.log(response.body);
this.start_time = get_data.notice_start_time
this.end_time = get_data.notice_end_time
this.is_send = get_data.is_send
this.order_end_time_id = get_data.order_time
this.message_list =response.body.message_data
this.message_statistics =response.body.message_statistics
this.message_number =response.body.message_number
this.get_page_list_number(this.message_number);
this.shop_name=response.body.shop_info.shop_name
console.log(this.message_statistics);
console.log(response.body);
});
},
get_page_list_number:function (number) {
if(number <= 10 ){
this.page_list =[{ "page":1 }];
}else{
for(let i =1 ;i<= Math.ceil(number/10) ;i++){
this.page_list[this.page_list.length]= {"page":i}
}
}
this.totle_page =this.page_list.length;
console.log( "========");
console.log( this.page_list);
},
get_page:function (page) {
this.$http.post('/order/index_data', {"page":page}, {emulateJSON: true})
.then(function (response) {
let get_data = response.body.message_data;
if(get_data.length>0 && page > this.page){
this.page =this.page+1 ;
}else{
this.page =this.page-1
}
this.message_list=get_data ;
});
},
//催付基本设置
base_edit_data: function () {
var postdata = {
token: this.token,
notice_start_time: this.start_time,
notice_end_time: this.end_time,
is_send: this.is_send,
order_time: this.order_end_time_id,
};
this.$http.post('/order/expediting_base_edit', postdata, {emulateJSON: true})
.then(function (response) {
//alert(response.body.message);
$("#changeSetUp").hide();
$("#basicSetUp").show();
});
},
//短信设置
message_edit_data: function () {
var postdata = {
_token: this.data.token,
message_content: null,
test_mobile: null,
};
this.$http.post('/order/expediting_message_edit', postdata, {emulateJSON: true})
.then(function (response) {
});
// $("#changeSetUp").hide();
//$("#basicSetUp").show();
},
//短信测试发送设置
message_send: function () {
var postdata = {
_token: this.data.token,
message_content: null,
test_mobile: null,
};
this.$http.post('/order/test_send_message', postdata, {emulateJSON: true})
.then(function (response) {
});
},
//状态更新
update_status_edit: function () {
var postdata = {
_token: this.data.token,
open_status: null, // 0 或者 1
};
this.$http.post('/order/expediting_update_status_edit', postdata, {emulateJSON: true})
.then(function (response) {
});
}
}
})
</script>