Authored by 郭成尧

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

@@ -178,7 +178,9 @@ gulp.task('font', () => { @@ -178,7 +178,9 @@ gulp.task('font', () => {
178 gulp.task('postcss', ['assets'], () => { 178 gulp.task('postcss', ['assets'], () => {
179 return gulp.src('scss/index.css') 179 return gulp.src('scss/index.css')
180 .pipe(postcss(postcssPlugin(env.pro))) 180 .pipe(postcss(postcssPlugin(env.pro)))
181 - .pipe(cssnano()) 181 + .pipe(cssnano({
  182 + safe: true
  183 + }))
182 .pipe(gulp.dest(dist.css)); 184 .pipe(gulp.dest(dist.css));
183 }); 185 });
184 186
@@ -10,45 +10,47 @@ var $ = require('jquery'), @@ -10,45 +10,47 @@ var $ = require('jquery'),
10 interceptClick = require('common/intercept-click'); 10 interceptClick = require('common/intercept-click');
11 11
12 $(() => { 12 $(() => {
13 - yoho.addNativeMethod('saveFeedback', function() {  
14 - var suggestText = $('#suggest-textarea').val(),  
15 - textReg = /\S+/; 13 + setTimeout(() => {
  14 + yoho.addNativeMethod('saveFeedback', function() {
  15 + var suggestText = $('#suggest-textarea').val(),
  16 + textReg = /\S+/;
16 17
17 - if (!textReg.test(suggestText)) {  
18 - tip('意见不能为空');  
19 - return;  
20 - }  
21 -  
22 - $('#suggest-textarea').blur();  
23 - $.ajax({  
24 - type: 'post',  
25 - url: '/me/save-feedback',  
26 - data: {  
27 - content: suggestText,  
28 - }  
29 - }).then(function(data) {  
30 - if (data.code === 200) {  
31 - tip('提交成功');  
32 - setTimeout(() => {  
33 - yoho.goBack();  
34 - }, 2000);  
35 - } else {  
36 - tip('提交失败~'); 18 + if (!textReg.test(suggestText)) {
  19 + tip('意见不能为空');
  20 + return;
37 } 21 }
38 - }).fail(function() {  
39 - tip('网络错误~'); 22 +
  23 + $('#suggest-textarea').blur();
  24 + $.ajax({
  25 + type: 'post',
  26 + url: '/me/save-feedback',
  27 + data: {
  28 + content: suggestText,
  29 + }
  30 + }).then(function(data) {
  31 + if (data.code === 200) {
  32 + tip('提交成功');
  33 + setTimeout(() => {
  34 + yoho.goBack();
  35 + }, 2000);
  36 + } else {
  37 + tip('提交失败~');
  38 + }
  39 + }).fail(function() {
  40 + tip('网络错误~');
  41 + });
40 }); 42 });
41 - });  
42 43
43 - const header = $.extend({}, interceptClick.defaultTitleMap[3]); 44 + const header = $.extend({}, interceptClick.defaultTitleMap[3]);
44 45
45 - header.title.des = '意见反馈';  
46 - header.right = {  
47 - des: '提交',  
48 - action: 'saveFeedback'  
49 - };  
50 - yoho.updateNavigationBar({  
51 - header: header,  
52 - url: location.origin + '/me/feedback'  
53 - }); 46 + header.title.des = '意见反馈';
  47 + header.right = {
  48 + des: '提交',
  49 + action: 'saveFeedback'
  50 + };
  51 + yoho.updateNavigationBar({
  52 + header: header,
  53 + url: location.origin + '/me/feedback'
  54 + });
  55 + }, 200);
54 }); 56 });
@@ -2,29 +2,29 @@ var yoho = require('yoho'); @@ -2,29 +2,29 @@ var yoho = require('yoho');
2 var $ = require('jquery'); 2 var $ = require('jquery');
3 const util = require('common/util'); 3 const util = require('common/util');
4 4
5 -if (!yoho.isLogin) {  
6 - $('.auth').addClass('no-intercept');  
7 - $('.auth').on('click', function() {  
8 - yoho.goLogin();  
9 - return false;  
10 - });  
11 -} else {  
12 - // 地址管理  
13 - $('#address').on('click', function() {  
14 - yoho.goAddress({  
15 - type: '2' 5 +$(() => {
  6 + if (!yoho.isLogin) {
  7 + $('.auth').addClass('no-intercept');
  8 + $('.auth').on('click', function() {
  9 + yoho.goLogin();
  10 + return false;
  11 + });
  12 + } else {
  13 + // 地址管理
  14 + $('#address').on('click', function() {
  15 + yoho.goAddress({
  16 + type: '2'
  17 + });
  18 + return false;
16 }); 19 });
  20 + }
  21 +
  22 + // 系统设置
  23 + $('#setting').on('click', function() {
  24 + yoho.goSetting();
17 return false; 25 return false;
18 }); 26 });
19 -}  
20 -  
21 -// 系统设置  
22 -$('#setting').on('click', function() {  
23 - yoho.goSetting();  
24 - return false;  
25 -});  
26 27
27 -$(() => {  
28 yoho.showLoading(false); 28 yoho.showLoading(false);
29 util.visibilitychange(); 29 util.visibilitychange();
30 }); 30 });
@@ -95,6 +95,11 @@ body { @@ -95,6 +95,11 @@ body {
95 &:last-child { 95 &:last-child {
96 border-bottom: 0 none; 96 border-bottom: 0 none;
97 } 97 }
  98 +
  99 + a {
  100 + display: flex;
  101 + width: 100%;
  102 + }
98 } 103 }
99 104
100 .img-box { 105 .img-box {
@@ -15,22 +15,24 @@ @@ -15,22 +15,24 @@
15 <div class="order-goods"> 15 <div class="order-goods">
16 <ul> 16 <ul>
17 <li class="goods-info" v-for="product in order.orderGoods"> 17 <li class="goods-info" v-for="product in order.orderGoods">
18 - <div class="img-box">  
19 - <img v-bind:src="product.goodsImage | resize 49 65">  
20 - <label v-if="product.goodsType === 'gift'">赠品</label>  
21 - <label class="price-gift" v-if="product.goodsType === 'price_gift'">加价购</label>  
22 - </div>  
23 - <div class="goods-detail">  
24 - <p class="name">{{product.productName}}</p>  
25 - <p class="size">  
26 - <span>颜色:{{product.colorName}}</span>  
27 - <span>尺码:{{product.sizeName}}</span>  
28 - </p>  
29 - </div>  
30 - <div class="goods-price">  
31 - <p>&yen;{{product.goodsPrice}}</p>  
32 - <p>×{{product.buyNumber}}</p>  
33 - </div> 18 + <a :href="product | goodsUrl 'collection'">
  19 + <div class="img-box">
  20 + <img v-bind:src="product.goodsImage | resize 49 65">
  21 + <label v-if="product.goodsType === 'gift'">赠品</label>
  22 + <label class="price-gift" v-if="product.goodsType === 'price_gift'">加价购</label>
  23 + </div>
  24 + <div class="goods-detail">
  25 + <p class="name">{{product.productName}}</p>
  26 + <p class="size">
  27 + <span>颜色:{{product.colorName}}</span>
  28 + <span>尺码:{{product.sizeName}}</span>
  29 + </p>
  30 + </div>
  31 + <div class="goods-price">
  32 + <p>&yen;{{product.goodsPrice}}</p>
  33 + <p>×{{product.buyNumber}}</p>
  34 + </div>
  35 + </a>
34 </li> 36 </li>
35 </ul> 37 </ul>
36 </div> 38 </div>
@@ -209,20 +211,23 @@ @@ -209,20 +211,23 @@
209 }); 211 });
210 }, 212 },
211 confirmGoods(code) { 213 confirmGoods(code) {
212 - $.ajax({  
213 - url: '/me/confirmReceive',  
214 - type: 'post',  
215 - data: {  
216 - orderCode: code  
217 - }  
218 - }).then(result => {  
219 - if (result.code === 200) {  
220 - location.reload();  
221 - } else if (result.code !== 500) {  
222 - tip(result.message);  
223 - }  
224 - }).fail(() => {  
225 - tip('操作失败'); 214 + Modal.confirm('', '确认删除订单?', function() {
  215 + this.hide();
  216 + $.ajax({
  217 + url: '/me/confirmReceive',
  218 + type: 'post',
  219 + data: {
  220 + orderCode: code
  221 + }
  222 + }).then(result => {
  223 + if (result.code === 200) {
  224 + location.reload();
  225 + } else if (result.code !== 500) {
  226 + tip(result.message);
  227 + }
  228 + }).fail(() => {
  229 + tip('操作失败');
  230 + });
226 }); 231 });
227 }, 232 },
228 goBuy(order) { 233 goBuy(order) {
@@ -206,20 +206,23 @@ @@ -206,20 +206,23 @@
206 }); 206 });
207 }, 207 },
208 confirmGoods(code) { 208 confirmGoods(code) {
209 - $.ajax({  
210 - url: '/me/confirmReceive',  
211 - type: 'post',  
212 - data: {  
213 - orderCode: code  
214 - }  
215 - }).then(result => {  
216 - if (result.code === 200) {  
217 - location.reload();  
218 - } else if (result.code !== 500) {  
219 - tip(result.message);  
220 - }  
221 - }).fail(() => {  
222 - tip('操作失败'); 209 + Modal.confirm('', '确认收货?', function() {
  210 + this.hide();
  211 + $.ajax({
  212 + url: '/me/confirmReceive',
  213 + type: 'post',
  214 + data: {
  215 + orderCode: code
  216 + }
  217 + }).then(result => {
  218 + if (result.code === 200) {
  219 + location.reload();
  220 + } else if (result.code !== 500) {
  221 + tip(result.message);
  222 + }
  223 + }).fail(() => {
  224 + tip('操作失败');
  225 + });
223 }); 226 });
224 }, 227 },
225 goBuy(order) { 228 goBuy(order) {