...
|
...
|
@@ -46,8 +46,7 @@ |
|
|
|
|
|
const $ = require('yoho-jquery');
|
|
|
const tip = require('common/tip');
|
|
|
const modal = require('common/modal');
|
|
|
const overlay = require('common/overlay');
|
|
|
const Modal = require('common/modal');
|
|
|
|
|
|
module.exports = {
|
|
|
data() {
|
...
|
...
|
@@ -59,40 +58,40 @@ |
|
|
busy: false,
|
|
|
};
|
|
|
},
|
|
|
ready(){
|
|
|
|
|
|
ready() {
|
|
|
this.getOrderData();
|
|
|
},
|
|
|
methods:{
|
|
|
getOrderData(){
|
|
|
|
|
|
methods: {
|
|
|
getOrderData() {
|
|
|
let _that = this;
|
|
|
|
|
|
this.busy = true;
|
|
|
$.ajax({
|
|
|
url: '/home/get-orders',
|
|
|
data: {
|
|
|
page : ++ this.page,
|
|
|
limit : this.limit,
|
|
|
page: ++this.page,
|
|
|
limit: this.limit,
|
|
|
type: this.type
|
|
|
}
|
|
|
}).then(result => {
|
|
|
if(result.code === 200){
|
|
|
if (result.code === 200) {
|
|
|
if (result.isend) {
|
|
|
_that.busy = true;
|
|
|
} else {
|
|
|
_that.busy = false;
|
|
|
}
|
|
|
if(result.data.orderList.length > 0){
|
|
|
if (result.data.orderList.length > 0) {
|
|
|
this.$set('orderList', result.data.orderList);
|
|
|
//_that.orderList = result.data.orderList;
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}).fail(() => {
|
|
|
tip('网络错误');
|
|
|
});
|
|
|
},
|
|
|
cancelOrder(code){
|
|
|
$.modal.confirm('', '订单取消后不能恢复,确认取消订单吗?', function() {
|
|
|
cancelOrder(code) {
|
|
|
Modal.confirm('订单取消后不能恢复,确认取消订单吗?', '', function() {
|
|
|
$.ajax({
|
|
|
url: '/home/cancel-order',
|
|
|
type: 'post',
|
...
|
...
|
@@ -100,7 +99,7 @@ |
|
|
orderCode: code
|
|
|
}
|
|
|
}).then(result => {
|
|
|
if(result.code === 200 ){
|
|
|
if (result.code === 200) {
|
|
|
location.reload();
|
|
|
} else {
|
|
|
tip(result.message);
|
...
|
...
|
@@ -110,9 +109,10 @@ |
|
|
});
|
|
|
});
|
|
|
},
|
|
|
deleteOrder(order, index){
|
|
|
var that = this;
|
|
|
$.modal.confirm('', '确认删除订单?', function() {
|
|
|
deleteOrder(order, index) {
|
|
|
let that = this;
|
|
|
|
|
|
Modal.confirm('确认删除订单?', '', function() {
|
|
|
$.ajax({
|
|
|
url: '/home/delete-order',
|
|
|
type: 'post',
|
...
|
...
|
@@ -120,9 +120,8 @@ |
|
|
orderCode: order.orderCode
|
|
|
}
|
|
|
}).then(result => {
|
|
|
if(result.code === 200 ){
|
|
|
//location.reload();
|
|
|
that.$el.querySelectorAll('.order-item')[index].remove()
|
|
|
if (result.code === 200) {
|
|
|
that.$el.querySelectorAll('.order-item')[index].remove();
|
|
|
} else {
|
|
|
tip(result.message);
|
|
|
}
|
...
|
...
|
@@ -131,7 +130,7 @@ |
|
|
});
|
|
|
});
|
|
|
},
|
|
|
confirmGoods(code){
|
|
|
confirmGoods(code) {
|
|
|
$.ajax({
|
|
|
url: '/home/confirm-order',
|
|
|
type: 'post',
|
...
|
...
|
@@ -139,20 +138,20 @@ |
|
|
orderCode: code
|
|
|
}
|
|
|
}).then(result => {
|
|
|
if(result.code === 200 ){
|
|
|
if (result.code === 200) {
|
|
|
location.reload();
|
|
|
} else {
|
|
|
tip(result.message);
|
|
|
}
|
|
|
}).fail(() => {
|
|
|
tip('操作失敗');
|
|
|
tip('操作失敗');
|
|
|
});
|
|
|
},
|
|
|
goBuy(){
|
|
|
|
|
|
goBuy() {
|
|
|
location.href = '';
|
|
|
},
|
|
|
see(){
|
|
|
|
|
|
seeExpress() {
|
|
|
location.href = '';
|
|
|
}
|
|
|
}
|
|
|
};
|
...
|
...
|
@@ -160,15 +159,20 @@ |
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
html,body{height:100%;}
|
|
|
html,
|
|
|
body {
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
@import "../../scss/home/_order.css";
|
|
|
|
|
|
.order-wrapper {
|
|
|
height: 100%;
|
|
|
|
|
|
ul {
|
|
|
height: 100%;
|
|
|
overflow-y: auto;
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
}
|
|
|
}
|
|
|
@import "../../scss/home/_order.css";
|
|
|
</style> |
|
|
\ No newline at end of file |
...
|
...
|
|