Authored by 沈志敏

Merge branch 'feature/home' into develop

... ... @@ -9,6 +9,12 @@ Name | Path | Note
品牌店铺分享页面 | /product/shop-share?domain=colormad |
商品详情 | /product/{productId} |
资讯列表 | /news |
yoho币 | /home/mycurrency |
全部订单 | /home/orders?type=1 |
待付款 | /home/orders?type=2 |
待发货 | /home/orders?type=3 |
待收货 | /home/orders?type=4 |
订单详情 | /home/order-detail?orderCode=xxx |
退货申请 | /home/refund?orderId=160181661 |
新品抢先看 | /product/new |
... ...
... ... @@ -44,7 +44,6 @@ const order = {
let page = req.query.page;
let type = req.query.type;
let limit = req.query.limit;
let isEnd = true;
uid = testUid;
if (!uid && req.xhr) {
... ... @@ -62,10 +61,7 @@ const order = {
};
orderModel.getOrders(param).then(result => {
if (result && page < result.data.pageTotal) {
isEnd = false;
}
return res.json(Object.assign({isEnd: isEnd}, result));
return res.json(result);
});
},
getOrderDetailData: (req, res) => {
... ... @@ -86,9 +82,9 @@ const order = {
});
},
cancelOrder: (req, res) => {
let orderCode = req.query.orderCode;
let reasonId = req.query.reasonId;
let reason = req.query.reason;
let orderCode = req.body.orderCode;
let reasonId = req.body.reasonId;
let reason = req.body.reason;
orderModel.cancelOrder(orderCode, reasonId, reason).then(result => {
return res.json(result);
... ... @@ -96,14 +92,14 @@ const order = {
},
confirmOrder: (req, res) => {
let orderode = req.query.orderCode;
let orderode = req.body.orderCode;
orderModel.confirmOrder(orderode).then(result => {
return res.json(result);
});
},
deleteOrder: (req, res) => {
let orderCode = req.query.orderCode;
let orderCode = req.body.orderCode;
let uid = req.user.uid;
uid = testUid; // 测试uid
... ... @@ -125,7 +121,6 @@ const order = {
uid = testUid;
orderModel.getCoins(uid).then(result => {
// console.log(result)
res.render('coin', {
module: 'home',
page: 'coin',
... ... @@ -144,7 +139,6 @@ const order = {
let uid = req.user.id;
let page = req.query.page;
let limit = req.query.limit;
let isend = true;
uid = testUid;
if (!uid && req.xhr) {
... ... @@ -155,10 +149,7 @@ const order = {
}
orderModel.getCoinDetail(uid, page, limit).then(result => {
if (result && page < result.page_total) {
isend = false;
}
return res.json(Object.assign({isEnd: isend}, result));
return res.json(result);
});
},
... ...
... ... @@ -89,7 +89,7 @@ const refund = {
};
refundModel.getRefundOrders(param).then(result => {
if (result && page < result.page_total) {
if (result && page < result.pageTotal) {
isend = false;
}
return res.json(Object.assign({isend: isend}, result));
... ...
... ... @@ -44,7 +44,7 @@ const refund = {
getRefundOrders(param) {
param = Object.assign({method: 'app.refund.getList'}, param);
return api.get('16303b76a9aa7b9b.json', param, {
return api.get('', param, {
cache: true,
code: 200
}).then(global.yoho.camelCase);
... ...
<template>
<div class="coin-detail">
<p>明细列表</p>
<ul class="coin-detail-list">
<ul class="coin-detail-list" v-infinite-scroll="getCoinData()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
<li v-for="coin in coinList">
<div class="coin-source">
<p>{{coin.message}}</p>
... ... @@ -18,13 +18,12 @@
const $ = require('yoho-jquery');
const tip = require('common/tip');
// const Modal = require('common/modal');
module.exports = {
data() {
return {
page: 0,
limit: 15,
pageTotal: 0,
coinList: [],
busy: false,
};
... ... @@ -39,6 +38,9 @@
let _that = this;
this.busy = true;
if (this.page > this.pageTotal) {
return;
}
$.ajax({
url: '/home/coin-detail',
data: {
... ... @@ -47,13 +49,10 @@
}
}).then(result => {
if (result.code === 200) {
if (result.isend) {
_that.busy = true;
} else {
_that.busy = false;
}
_that.busy = false;
if (result.data.coinlist.length > 0) {
this.$set('coinList', result.data.coinlist);
this.$set('coinList', _that.coinList.concat(result.data.coinlist));
_that.pageTotal = result.data.pageTotal;
}
}
}).fail(() => {
... ...
<template>
<ul v-infinite-scroll="getOrderData()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
<ul id="order-list" v-infinite-scroll="getOrderData()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
<li class="order-item" v-for="(index, order) in orderList">
<div class="order-detail">
<div class="order-code">
... ... @@ -54,6 +54,7 @@
return {
page: 0,
limit: 10,
pageTotal: 0,
type: this.$parent.$data.type,
orderList: [],
busy: false,
... ... @@ -69,6 +70,9 @@
let _that = this;
this.busy = true;
if (this.page > this.pageTotal) {
return;
}
$.ajax({
url: '/home/get-orders',
data: {
... ... @@ -78,13 +82,10 @@
}
}).then(result => {
if (result.code === 200) {
if (result.isEnd) {
_that.busy = true;
} else {
_that.busy = false;
}
_that.busy = false;
if (result.data.orderList.length > 0) {
this.$set('orderList', result.data.orderList);
this.$set('orderList', _that.orderList.concat(result.data.orderList));
_that.pageTotal = result.data.pageTotal;
}
}
}).fail(() => {
... ... @@ -187,13 +188,5 @@ body {
@import "../../scss/home/_order.css";
.order-wrapper {
height: 100%;
ul {
height: 100%;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
</style>
\ No newline at end of file
... ...