Authored by 郭成尧

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -178,7 +178,9 @@ gulp.task('font', () => {
gulp.task('postcss', ['assets'], () => {
return gulp.src('scss/index.css')
.pipe(postcss(postcssPlugin(env.pro)))
.pipe(cssnano())
.pipe(cssnano({
safe: true
}))
.pipe(gulp.dest(dist.css));
});
... ...
... ... @@ -10,45 +10,47 @@ var $ = require('jquery'),
interceptClick = require('common/intercept-click');
$(() => {
yoho.addNativeMethod('saveFeedback', function() {
var suggestText = $('#suggest-textarea').val(),
textReg = /\S+/;
setTimeout(() => {
yoho.addNativeMethod('saveFeedback', function() {
var suggestText = $('#suggest-textarea').val(),
textReg = /\S+/;
if (!textReg.test(suggestText)) {
tip('意见不能为空');
return;
}
$('#suggest-textarea').blur();
$.ajax({
type: 'post',
url: '/me/save-feedback',
data: {
content: suggestText,
}
}).then(function(data) {
if (data.code === 200) {
tip('提交成功');
setTimeout(() => {
yoho.goBack();
}, 2000);
} else {
tip('提交失败~');
if (!textReg.test(suggestText)) {
tip('意见不能为空');
return;
}
}).fail(function() {
tip('网络错误~');
$('#suggest-textarea').blur();
$.ajax({
type: 'post',
url: '/me/save-feedback',
data: {
content: suggestText,
}
}).then(function(data) {
if (data.code === 200) {
tip('提交成功');
setTimeout(() => {
yoho.goBack();
}, 2000);
} else {
tip('提交失败~');
}
}).fail(function() {
tip('网络错误~');
});
});
});
const header = $.extend({}, interceptClick.defaultTitleMap[3]);
const header = $.extend({}, interceptClick.defaultTitleMap[3]);
header.title.des = '意见反馈';
header.right = {
des: '提交',
action: 'saveFeedback'
};
yoho.updateNavigationBar({
header: header,
url: location.origin + '/me/feedback'
});
header.title.des = '意见反馈';
header.right = {
des: '提交',
action: 'saveFeedback'
};
yoho.updateNavigationBar({
header: header,
url: location.origin + '/me/feedback'
});
}, 200);
});
... ...
... ... @@ -2,29 +2,29 @@ var yoho = require('yoho');
var $ = require('jquery');
const util = require('common/util');
if (!yoho.isLogin) {
$('.auth').addClass('no-intercept');
$('.auth').on('click', function() {
yoho.goLogin();
return false;
});
} else {
// 地址管理
$('#address').on('click', function() {
yoho.goAddress({
type: '2'
$(() => {
if (!yoho.isLogin) {
$('.auth').addClass('no-intercept');
$('.auth').on('click', function() {
yoho.goLogin();
return false;
});
} else {
// 地址管理
$('#address').on('click', function() {
yoho.goAddress({
type: '2'
});
return false;
});
}
// 系统设置
$('#setting').on('click', function() {
yoho.goSetting();
return false;
});
}
// 系统设置
$('#setting').on('click', function() {
yoho.goSetting();
return false;
});
$(() => {
yoho.showLoading(false);
util.visibilitychange();
});
... ...
... ... @@ -95,6 +95,11 @@ body {
&:last-child {
border-bottom: 0 none;
}
a {
display: flex;
width: 100%;
}
}
.img-box {
... ...
... ... @@ -15,22 +15,24 @@
<div class="order-goods">
<ul>
<li class="goods-info" v-for="product in order.orderGoods">
<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.goodsPrice}}</p>
<p>×{{product.buyNumber}}</p>
</div>
<a :href="product | goodsUrl 'collection'">
<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.goodsPrice}}</p>
<p>×{{product.buyNumber}}</p>
</div>
</a>
</li>
</ul>
</div>
... ... @@ -209,20 +211,23 @@
});
},
confirmGoods(code) {
$.ajax({
url: '/me/confirmReceive',
type: 'post',
data: {
orderCode: code
}
}).then(result => {
if (result.code === 200) {
location.reload();
} else if (result.code !== 500) {
tip(result.message);
}
}).fail(() => {
tip('操作失败');
Modal.confirm('', '确认删除订单?', function() {
this.hide();
$.ajax({
url: '/me/confirmReceive',
type: 'post',
data: {
orderCode: code
}
}).then(result => {
if (result.code === 200) {
location.reload();
} else if (result.code !== 500) {
tip(result.message);
}
}).fail(() => {
tip('操作失败');
});
});
},
goBuy(order) {
... ...
... ... @@ -206,20 +206,23 @@
});
},
confirmGoods(code) {
$.ajax({
url: '/me/confirmReceive',
type: 'post',
data: {
orderCode: code
}
}).then(result => {
if (result.code === 200) {
location.reload();
} else if (result.code !== 500) {
tip(result.message);
}
}).fail(() => {
tip('操作失败');
Modal.confirm('', '确认收货?', function() {
this.hide();
$.ajax({
url: '/me/confirmReceive',
type: 'post',
data: {
orderCode: code
}
}).then(result => {
if (result.code === 200) {
location.reload();
} else if (result.code !== 500) {
tip(result.message);
}
}).fail(() => {
tip('操作失败');
});
});
},
goBuy(order) {
... ...