Authored by 郭成尧

Merge remote-tracking branch 'remotes/origin/develop' into feature/brand

... ... @@ -6,7 +6,7 @@
const refundModel = require('../models/refund');
const notLoginCode = 400;
const notLoginTip = '抱歉,您暂未登录!';
const testUid = 8050378;// 测试uid
const testUid = 8039837;// 测试uid
const isBLK = 1;
const refund = {
... ... @@ -72,7 +72,6 @@ const refund = {
let uid = req.query.id;
let page = req.query.page;
let limit = req.query.limit;
let isend = true;
uid = testUid;
if (!uid && req.xhr) {
... ... @@ -89,10 +88,7 @@ const refund = {
};
refundModel.getRefundOrders(param).then(result => {
if (result && page < result.pageTotal) {
isend = false;
}
return res.json(Object.assign({isend: isend}, result));
return res.json(result);
});
}
};
... ...
... ... @@ -3,6 +3,5 @@
<div class="suggest-sub-form">
<textarea name="" id="suggest-textarea" placeholder="请写下对于BLK的意见和建议,我们将及时根据您的意见作出改进"></textarea>
</div>
<input id="submit-button" type="button" value="提交" />
{{/ suggestSub}}
</div>
... ...
... ... @@ -35,7 +35,7 @@
<span class="num">{{send_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/orders?type=5">
<a class="type-item" href="/home/refund/orders">
<span class="icon icon-refund-exchange"></span>
<br>退换货
{{#if refund_exchange_num}}
... ...
... ... @@ -3,8 +3,9 @@
* @return {[type]}
*/
const yoho = require('yoho');
const parse = require('yoho-qs/parse'); // 提供解析函数
const origin = 'http://m.yohoblk.com';
const origin = location.origin;
/**
* 跳转 App 头部参数
... ... @@ -104,21 +105,97 @@ const matchHeader = (url) => {
return header;
}
if (/\/product\/new/.test(url)) {
if (/\/home\/mydetails$/.test(url)) {
header = titleMap[1];
header.title.des = '个人信息';
return header;
}
// header.xxx = '111';// 匹配到头类型以后,可修改里边的内容
if (/\/home\/orders/.test(url)) {
var des = '',
u = url.split('?')[1],
u = parse(u);
if (u.type === '1') {
des = '我的订单';
} else if (u.type === '2') {
des = '待付款';
} else if (u.type === '3') {
des = '待发货';
} else if (u.type === '4') {
des = '待收货';
}
header = titleMap[1];
header.title.des = des;
return header;
}
if (/\/home\/refund\/orders/.test(url)) {
header = titleMap[1];
header.title.des = '退/换货';
return header;
}
if (/\/home\/favorite/.test(url)) {
header = titleMap[5];
header.ltitle = {
des: '商品',
action: origin + '/home/favorite'
}
header.rtitle = {
des: '品牌',
action: origin + '/home/favorite?tab=brand'
}
header.right = {
des: '编辑',
action: 'editModel'
}
return header;
}
if (/\/home\/mycurrency/.test(url)) {
header = titleMap[1];
header.title.des = '有货币';
return header;
}
if (/\/home\/help$/.test(url)) {
header = titleMap[1];
header.title.des = '帮助中心';
return header;
}
if (/chat8.live800.com/.test(url)) {
header = titleMap[1];
header.title.des = 'Yoho!Blk在线客服';
return header;
}
if (/\/home\/feedback/.test(url)) {
header = titleMap[3];
header.title.des = '意见反馈';
header.right = {
des: '提交',
action: 'saveFeedback'
}
return header;
}
if (/\/home\/about/.test(url)) {
header = titleMap[1];
header.title.des = '关于';
return header;
}
return header;
};
module.exports = (url) => {
if (yoho.isApp) {
let data = {
header: matchHeader(url),
url: /^(https?:)?\/\//i.test(url) ? url : location.origin + url
url: /^(https?:)?\/\//i.test(url) ? url : origin + url
};
// console.log(data);
... ...
... ... @@ -5,11 +5,10 @@
*/
var $ = require('yoho-jquery'),
tip = require('../common/tip');
tip = require('../common/tip'),
yoho = require('yoho');
var submitButton = $('#submit-button');
submitButton.on('click', function() {
yoho.addNativeMethod('saveFeedback', function() {
var suggestText = $('#suggest-textarea').val(),
textReg = /\S+/;
... ...
... ... @@ -3,6 +3,7 @@ const app = require('product/detail/index.vue');
const loading = require('common/loading');
const lazyload = require('yoho-vue-lazyload');
require('common/vue-filter');
require('../common/overlay');
Vue.use(lazyload);
... ...
... ... @@ -33,6 +33,7 @@
right: 0;
left: 0;
z-index: 210;
padding-top: 60px;
padding-left: 30px;
padding-right: 30px;
width: 100%;
... ...
... ... @@ -23,7 +23,7 @@
return {
page: 0,
limit: 15,
pageTotal: 0,
pageTotal: 1,
coinList: [],
busy: false,
};
... ... @@ -38,7 +38,7 @@
let _that = this;
this.busy = true;
if (this.page > this.pageTotal) {
if (this.page >= this.pageTotal) {
return;
}
$.ajax({
... ...
... ... @@ -32,6 +32,7 @@
<script>
const $ = require('yoho-jquery');
const tip = require('common/tip');
const yoho = require('yoho');
module.exports = {
props: ['brandUrl'],
... ... @@ -73,12 +74,6 @@
tip('网络错误');
});
},
editModel(action) {
this.editmodel = action;
if (!action) {
this.hideDelBth();
}
},
showDelBtn(index) {
this.hideDelBth();
let delBtn = $('#del-' + index);
... ... @@ -116,6 +111,16 @@
tip('网络错误');
});
}
},
created: function() {
let _this = this;
yoho.addNativeMethod('editModel', function(action) {
_this.editmodel = action;
if (!action) {
_this.hideDelBth();
}
});
}
};
</script>
... ...
... ... @@ -79,12 +79,6 @@
tip('网络错误');
});
},
editModel(action) {
this.editmodel = action;
if (!action) {
this.hideDelBth();
}
},
showDelBtn(index) {
this.hideDelBth();
let delBtn = $('#del-' + index);
... ... @@ -122,6 +116,16 @@
tip('网络错误');
});
}
},
created: function() {
let _this = this;
yoho.addNativeMethod('editModel', function(action) {
_this.editmodel = action;
if (!action) {
_this.hideDelBth();
}
});
}
};
</script>
... ...
... ... @@ -54,7 +54,7 @@
return {
page: 0,
limit: 10,
pageTotal: 0,
pageTotal: 1,
type: this.$parent.$data.type,
orderList: [],
busy: false,
... ... @@ -70,7 +70,7 @@
let _that = this;
this.busy = true;
if (this.page > this.pageTotal) {
if (this.page >= this.pageTotal) {
return;
}
$.ajax({
... ...
... ... @@ -28,7 +28,7 @@
</div>
</div>
</div>
<div class="order-option">
<div class="order-option" v-show="order.canCancel == 'Y'">
<div class="goods-total"></div>
<div class="options" v-show="order.canCancel == 'Y'">
<button v-if="order.canCancel == 'Y'" class="normal">取消申请</button>
... ... @@ -51,6 +51,7 @@
return {
page: 0,
limit: 10,
pageTotal: 1,
orderList: [],
busy: false,
};
... ... @@ -65,6 +66,9 @@
let _that = this;
this.busy = true;
if (this.page >= this.pageTotal) {
return;
}
$.ajax({
url: '/home/refund/get-orders',
data: {
... ... @@ -72,13 +76,10 @@
limit: this.limit
}
}).then(result => {
if (result.isend) {
_that.busy = true;
} else {
_that.busy = false;
}
if (result.data.list.length > 0) {
this.$set('orderList', result.data.list);
this.$set('orderList', _that.orderList.concat(result.data.list));
_that.pageTotal = result.data.totalPage;
}
}).fail(() => {
tip('网络错误');
... ... @@ -112,13 +113,4 @@
@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
... ...
<template>
<top-nav></top-nav>
<div class="show-box no-padding first-box">
<div class="show-box no-padding first-box" :class="{'is-app': isApp}">
<div class="news-box">
<h1>{{article.articleTitle}}</h1>
<div class="status-bar">
... ... @@ -61,6 +61,10 @@
margin-top: 120px;
}
&.first-box.is-app {
margin-top: 180px;
}
background: $bgcolor;
margin-top: 30px;
border-bottom: 1px solid #eee;
... ... @@ -183,8 +187,9 @@
</style>
<script>
require('common/vue-filter');
const yoho = require('yoho');
require('common/vue-filter');
module.exports = {
components: {
'content-block': require('./content-block.vue'),
... ... @@ -193,6 +198,7 @@
},
data() {
return {
isApp: yoho.isApp,
article: {},
content: {},
brands: {},
... ...
<template>
<div class="top-nav">
<a class="left-button" href="javascript:alert('TODO');">
<navbar>
<a slot="left" href="javascript:alert('TODO');">
<span class="icon icon-left"></span>
</a>
<template slot="right">
<a class="right-button" href="javascript:alert('TODO');">
<span class="icon icon-share"></span>
<span class="icon icon-check"></span>
{{likeCount}}
</a>
<a class="right-button" href="javascript:alert('TODO');">
<span class="icon icon-love"></span>
</a>
<a class="right-button" href="javascript:alert('TODO');" :click="">
<span class="icon icon-check"></span>
{{likeCount}}
<a class="right-button" href="javascript:alert('TODO');">
<span class="icon icon-share"></span>
</a>
</template>
</navbar>
</div>
</template>
<style>
.top-nav {
position: fixed;
z-index: 10;
font-size: 40px;
padding: 30px;
width: 100%;
top: 0;
background: #fff;
.left-button {
float: left;
}
.right-button {
float: right;
margin-left: 30px;
}
}
</style>
<script>
const yoho = require('yoho');
require('common/vue-filter');
module.exports = {
components: {
navbar: require('component/header.vue')
},
data() {
return {
isApp: yoho.isApp,
likeCount: 9,
};
},
... ...
<template>
<div class="image-carousel">
<swipe :continuous="false" :auto="0" :show-indicators="goods && goods.length > 1">
<swipe :continuous="false" :auto="0" :show-indicators="goods && goods.length > 1" v-ref:swipe>
<swipe-item v-for="item in goods">
<a href="javascript:void(0);" title="{{item.title}}" @click.prevent="showcase()">
<img :src="item.colorImage | resize 750 1000" width="100%" alt="">
</a>
<img title="{{item.title}}"
:src="item.colorImage | resize 750 1000"
width="100%" alt=""
@click.prevent="showcase()">
</swipe-item>
</swipe>
</div>
... ... @@ -63,7 +64,7 @@
images: this.goods.map((item)=> {
return item.colorImage;
}),
index: 0 // TODO: 活动下标无法获取
index: this.$refs.swipe.index
};
yoho.goImageBrowser(opts);
... ...
<template>
<top-nav v-if="isApp" :title="entity.productName"></top-nav>
<top-nav v-if="isApp" :title="entity.productName" :img="firstImage | resize 300 300"></top-nav>
<show-box :is-first="true">
<image-carousel :goods="entity.goodsList"></image-carousel>
<div class="title-box">
... ... @@ -401,6 +401,7 @@
yoho: yoho,
isApp: yoho.isApp,
intro: {},
firstImage: '',
entity: {
brand: {
brandName: '',
... ... @@ -508,6 +509,13 @@
$.get(`/product/product_${pid}.json`).then((result) => {
// TODO: 异常处理
this.entity = result;
this.entity.goodsList.forEach((goods)=> {
if (!this.firstImage && goods.colorImage) {
this.firstImage = goods.colorImage;
}
});
return result;
}).then((result)=> {
loadIntroDeferred = () => {
... ...
<template>
<div class="top-nav">
<a class="left" href="javascript:void(0);" @click="yoho.goBack()">
<a class="left no-intercept" href="javascript:void(0);" @click="yoho.goBack()">
<span class="icon icon-left"></span>
</a>
<a class="right" href="javascript:void(0);" @click="yoho.goShare()">
<a class="right no-intercept" href="javascript:void(0);" @click="share()">
<span class="icon icon-share"></span>
</a>
</div>
... ... @@ -16,7 +16,6 @@
font-size: 40px;
padding: 30px;
width: 100%;
top: 60px;
.left {
float: left;
... ... @@ -25,14 +24,31 @@
.right {
float: right;
}
}
</style>
<script>
const yoho = require('yoho');
module.exports = {
data() {
return {
yoho: require('yoho')
yoho: yoho
};
},
props: {
title: String,
img: String
},
methods: {
share: function() {
yoho.goShare({
title: this.title || '',
des: '我在BLK发现了一个不错的商品,快来看看吧!',
img: this.img,
url: location.href
});
}
}
};
</script>
... ...