Authored by 陈轩

Merge remote-tracking branch 'origin/feature/home' into develop

... ... @@ -127,4 +127,4 @@ const order = {
}
};
module.exports = order;
\ No newline at end of file
module.exports = order;
... ...
... ... @@ -45,7 +45,7 @@ exports.getFavProductData = (uid, page, limit) => {
title: d.product_name,
price: '¥' + Number(Math.max(d.market_price, 0)).toFixed(2),
discountPrice: discountPrice,
sellOut: d.storage < 0,
sellOut: d.storage <= 0,
invalidGoods: d.status === 0
});
});
... ...
... ... @@ -7,7 +7,7 @@
const api = global.yoho.API;
//const serviceAPI = global.yoho.ServiceAPI;
// const serviceAPI = global.yoho.ServiceAPI;
const camelCase = global.yoho.camelCase;
/**
... ...
... ... @@ -15,8 +15,8 @@ module.exports = {
port: 6004,
siteUrl: '//m.yohoblk.com',
domains: {
api: 'http://192.168.102.202:8080/gateway/',
service: 'http://192.168.102.202:8080/gateway/'
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/'
},
subDomains: {
host: '.m.yohoblk.com',
... ...
... ... @@ -109,4 +109,4 @@ Vue.filter('convertTime', (value) => {
let s = date.getSeconds();
return Y + M + D + h + m + s;
});
\ No newline at end of file
});
... ...
... ... @@ -18,4 +18,4 @@ new Vue({
components: {
OrderDetail
}
});
\ No newline at end of file
});
... ...
... ... @@ -43,6 +43,7 @@
border-bottom: 0 none;
}
}
.coin-source {
flex: 1;
... ...
... ... @@ -167,7 +167,7 @@
width: 35px;
height: 35px;
margin-right: 15px;
margin-top: 35px;
margin-top: 50px;
background: resolve("home/fav/fav-del.png");
background-size: 100%;
}
... ...
<template>
<div class="upload">
<form v-on:change="upload">
<form v-el:form v-on:change="upload">
<label class="label-input icon" for="{{inputId}}">
<input id="{{inputId}}" type="file" name="filename">
</label>
... ... @@ -18,7 +18,7 @@
},
methods: {
upload(e) {
const formData = new FormData(e.target.closest('form'));
const formData = new FormData(this.$els.form);
formData.append('bucket', this.bucket || '');
$.ajax({
... ...
... ... @@ -54,39 +54,34 @@
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() {
return {
order:{}
order: {}
};
},
ready(){
ready() {
this.getOrderData();
},
methods:{
getOrderData(){
// let _that = this;
methods: {
getOrderData() {
$.ajax({
url: '/home/get-order',
data: {
orderCode: this.$parent.$data.orderCode
}
}).then(result => {
if(result){
if (result) {
this.$set('order', result.data);
//_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',
... ... @@ -94,18 +89,18 @@
orderCode: code
}
}).then(result => {
if(result.code === 200 ){
if (result.code === 200) {
location.href = '/home/orders';
} else {
tip(result.message);
}
}).fail(() => {
tip('操作失敗');
tip('操作失敗');
});
});
},
deleteOrder(code){
$.modal.confirm('', '确认删除订单?', function() {
deleteOrder(code) {
Modal.confirm('确认删除订单?', '', function() {
$.ajax({
url: '/home/delete-order',
type: 'post',
... ... @@ -113,17 +108,17 @@
orderCode: code
}
}).then(result => {
if(result.code === 200 ){
if (result.code === 200) {
location.href = '/home/orders';
} else {
tip(result.message);
}
}).fail(() => {
tip('操作失敗');
tip('操作失敗');
});
});
},
confirmGoods(code){
confirmGoods(code) {
$.ajax({
url: '/home/confirm-order',
type: 'post',
... ... @@ -131,20 +126,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 = '';
}
}
};
... ...
... ... @@ -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
... ...