Authored by 陈轩

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

<div class="order-wrapper" id="home-order-list">
<div id="home-order-list">
<Order></Order>
<input type="hidden" value="{{type}}" id="order-type">
</div>
... ...
<div class="order-wrapper return-goods" id="refund-order-list">
<div id="refund-order-list">
<refund-order></refund-order>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -157,7 +157,6 @@ const matchHeader = (path, qs, titleMap) => {
if (/\/me\/order\/detail$/.test(path)) {
header = titleMap[2];
header.title.des = '订单详情';
header.title.right.action = origin + '/me/service';
return header;
}
... ... @@ -271,6 +270,6 @@ const intercept = (url) => {
};
module.exports = {
defaultTitleMap: defaultTitleMap,
intercept: intercept
defaultTitleMap,
intercept
};
... ...
const yoho = require('yoho');
const getImgHost = function(url) {
let urlArr = url.split('/'),
num = urlArr[urlArr.length - 1].substr(1, 1),
... ... @@ -11,6 +13,16 @@ const getImgHost = function(url) {
}
};
const visibilitychange = function() {
document.addEventListener('visibilitychange', function() {
if (yoho.isApp && !document.hidden) {
yoho.showLoading(false);
}
});
}
module.exports = {
getImgHost: getImgHost
getImgHost,
visibilitychange
};
... ...
... ... @@ -17,6 +17,7 @@
const $ = require('jquery');
const yoho = require('yoho');
const Vue = require('vue');
const util = require('common/util');
const interceptClick = require('common/intercept-click');
const bus = require('common/vue-bus');
... ... @@ -25,6 +26,7 @@ Vue.mixin({
ready() {
if (this === this.$root && location.pathname !== '/sidebar') {
yoho.showLoading(false);
util.visibilitychange();
}
}
});
... ... @@ -34,6 +36,7 @@ $(() => {
if ($body.hasClass('no-local-js')) {
yoho.showLoading(false); // 隐藏 App 默认显示的 loading
util.visibilitychange();
}
$body.on('click', 'a[href]', function() {
... ...
var yoho = require('yoho');
var $ = require('jquery');
const util = require('common/util');
if (!yoho.isLogin) {
$('.auth').addClass('no-intercept');
$('.auth').on('click', function() {
... ... @@ -8,7 +8,7 @@ if (!yoho.isLogin) {
return false;
});
} else {
// 地址管理
// 地址管理
$('#address').on('click', function() {
yoho.goAddress({
type: '2'
... ... @@ -25,4 +25,5 @@ $('#setting').on('click', function() {
$(() => {
yoho.showLoading(false);
util.visibilitychange();
});
... ...
... ... @@ -222,7 +222,6 @@
.yoho-favorite-brand-page {
width: 100%;
height: auto;
margin-top: 20px;
.fav-content {
.fav-type {
... ... @@ -233,7 +232,6 @@
padding-left: 20px;
list-style: none;
overflow: hidden;
border-top: 1px solid #e0e0e0;
li {
position: relative;
... ...
... ... @@ -240,7 +240,6 @@
.yoho-favorite-page {
width: 100%;
height: auto;
margin-top: 20px;
.fav-content {
.fav-type {
... ... @@ -251,7 +250,6 @@
padding-left: 20px;
list-style: none;
overflow: hidden;
border-top: 1px solid #e0e0e0;
li {
position: relative;
... ...
... ... @@ -76,6 +76,11 @@
},
ready() {
this.getOrderData();
yohoAPI.addNativeMethod('goToService', () => {
interceptClick.intercept('/me/service');
return false;
});
},
methods: {
getOrderData() {
... ...
<template>
<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">
<p>订单号:{{order.orderCode}}</p>
<p>{{order.statusStr}}</p>
</div>
<div class="order-goods" >
<div class="goods-info" v-for="goods in order.orderGoods">
<div class="img-box">
<img v-bind:src="goods.goodsImage | resize 49 65">
<label v-if="goods.goodsType === 'gift'">赠品</label>
<label class="price-gift" v-if="goods.goodsType === 'price_gift'">加价购</label>
</div>
<div class="goods-detail">
<p class="name">{{goods.productName}}</p>
<p class="size">
<span>颜色:{{goods.colorName}}</span>
<span>尺码:{{goods.sizeName}}</span>
</p>
</div>
<div class="goods-price">
<p>&yen; {{goods.goodsPrice}}</p>
<p>×{{goods.buyNumber}}</p>
<div class="order-wrapper" v-if="orderList.length > 0">
<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">
<p>订单号:{{order.orderCode}}</p>
<p>{{order.statusStr}}</p>
</div>
<div class="order-goods" >
<div class="goods-info" v-for="goods in order.orderGoods">
<div class="img-box">
<img v-bind:src="goods.goodsImage | resize 49 65">
<label v-if="goods.goodsType === 'gift'">赠品</label>
<label class="price-gift" v-if="goods.goodsType === 'price_gift'">加价购</label>
</div>
<div class="goods-detail">
<p class="name">{{goods.productName}}</p>
<p class="size">
<span>颜色:{{goods.colorName}}</span>
<span>尺码:{{goods.sizeName}}</span>
</p>
</div>
<div class="goods-price">
<p>&yen; {{goods.goodsPrice}}</p>
<p>×{{goods.buyNumber}}</p>
</div>
<a href="/me/order/detail?orderCode={{order.orderCode}}"></a>
</div>
<a href="/me/order/detail?orderCode={{order.orderCode}}"></a>
</div>
</div>
<div class="order-option">
<div class="goods-total">合计: <b>&yen;{{order.amount}}</b></div>
<div class="options">
<button v-if="order.isCancel === 'Y'" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<template v-else>
<button v-if="order.status === 0" @click="cancelOrder(order.orderCode)">取消订单</button>
<button v-if="order.status === 0 " class="countdown" @click="goBuy(order.orderCode)">去支付
<span v-count-down v-bind:left-time="order.payLefttime" v-bind:callback="autoCancel(order.orderCode)"></span>
</button>
<a v-if="order.status === 4 || order.status === 5 "
href="/me/logistic?order_code={{order.orderCode}}">查看物流</a>
<button v-if="order.status === 4 || order.status === 5 " class="black" @click="confirmGoods(order.orderCode)">确认收货</button>
<button v-if="order.status === 6" @click="deleteOrder(order,index)" class="normal">删除订单</button>
</template>
<div class="order-option">
<div class="goods-total">合计: <b>&yen;{{order.amount}}</b></div>
<div class="options">
<button v-if="order.isCancel === 'Y'" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<template v-else>
<button v-if="order.status === 0" @click="cancelOrder(order.orderCode)">取消订单</button>
<button v-if="order.status === 0 " class="countdown" @click="goBuy(order.orderCode)">去支付
<span v-count-down v-bind:left-time="order.payLefttime" v-bind:callback="autoCancel(order.orderCode)"></span>
</button>
<a v-if="order.status === 4 || order.status === 5 "
href="/me/logistic?order_code={{order.orderCode}}">查看物流</a>
<button v-if="order.status === 4 || order.status === 5 " class="black" @click="confirmGoods(order.orderCode)">确认收货</button>
<button v-if="order.status === 6" @click="deleteOrder(order,index)" class="normal">删除订单</button>
</template>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="order-empty {{emptybox}}">
<p>您暂时还没有订单</p>
<p>Your do not have an order <br>for the time being</p>
... ...
<template>
<ul v-infinite-scroll="getRefundData()" 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">
<div class="code-time">
<p>订单号:{{order.orderCode}}</p>
<p>申请时间:{{order.orderCreateTime}}</p>
</div>
<p>{{order.statusName}}</p>
</div>
<div class="order-goods">
<div class="goods-info" v-for="product in order.goods">
<div class="img-box">
<img v-bind:src="product.goodsImage | resize 49 65">
<label v-if="product.goodsType === 'gift'">赠品</label>
<label class="price-gift" v-if="product.goodsType === 'price_gift'">加价购</label>
<div class="order-wrapper return-goods" v-if="orderList.length > 0">
<ul v-infinite-scroll="getRefundData()" 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">
<div class="code-time">
<p>订单号:{{order.orderCode}}</p>
<p>申请时间:{{order.orderCreateTime}}</p>
</div>
<div class="goods-detail">
<p class="name">{{product.productName}}</p>
<p class="size">
<span>颜色: {{product.colorName}}</span>
<span>尺码: {{product.sizeName}}</span>
</p>
</div>
<div class="goods-price">
<p>&yen;{{product.salesPrice}}</p>
<p>×1</p>
<p>{{order.statusName}}</p>
</div>
<div class="order-goods">
<div class="goods-info" v-for="product in order.goods">
<div class="img-box">
<img v-bind:src="product.goodsImage | resize 49 65">
<label v-if="product.goodsType === 'gift'">赠品</label>
<label class="price-gift" v-if="product.goodsType === 'price_gift'">加价购</label>
</div>
<div class="goods-detail">
<p class="name">{{product.productName}}</p>
<p class="size">
<span>颜色: {{product.colorName}}</span>
<span>尺码: {{product.sizeName}}</span>
</p>
</div>
<div class="goods-price">
<p>&yen;{{product.salesPrice}}</p>
<p>×1</p>
</div>
<a v-if="order.refundType === 1" href="/me/return/refund/detail/{{order.id}}"></a>
<a v-if="order.refundType === 2" href="/me/return/exchange/detail/{{order.id}}"></a>
</div>
<a v-if="order.refundType === 1" href="/me/return/refund/detail/{{order.id}}"></a>
<a v-if="order.refundType === 2" href="/me/return/exchange/detail/{{order.id}}"></a>
</div>
</div>
<div class="order-option" v-show="order.canCancel == 'Y'">
<div class="goods-total"></div>
<div class="options">
<button class="normal" @click="cancelApply(order.id, order.refundType)">取消申请</button>
<div class="order-option" v-show="order.canCancel == 'Y'">
<div class="goods-total"></div>
<div class="options">
<button class="normal" @click="cancelApply(order.id, order.refundType)">取消申请</button>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="order-empty {{emptybox}}">
<p>您暂时还没有订单</p>
<p>Your do not have an order <br>for the time being</p>
... ...