Merge branch 'gray'
Showing
14 changed files
with
182 additions
and
138 deletions
@@ -125,7 +125,8 @@ const orderSubmitAsync = (uid, cartType, addressId, deliveryTime, deliveryWay, p | @@ -125,7 +125,8 @@ const orderSubmitAsync = (uid, cartType, addressId, deliveryTime, deliveryWay, p | ||
125 | invoices_type: other.invoicesType, | 125 | invoices_type: other.invoicesType, |
126 | invoices_title: other.invoicesTitle, | 126 | invoices_title: other.invoicesTitle, |
127 | invoice_content: other.invoicesContent, | 127 | invoice_content: other.invoicesContent, |
128 | - receiverMobile: other.receiverMobile | 128 | + receiverMobile: other.receiverMobile, |
129 | + buyerTaxNumber: other.taxNumber | ||
129 | }); | 130 | }); |
130 | } | 131 | } |
131 | 132 |
@@ -70,6 +70,15 @@ const submit = (uid, cartType, p, remoteIp) => { | @@ -70,6 +70,15 @@ const submit = (uid, cartType, p, remoteIp) => { | ||
70 | p.addressId = crypto.decrypt('', `${p.addressId}`); | 70 | p.addressId = crypto.decrypt('', `${p.addressId}`); |
71 | } | 71 | } |
72 | 72 | ||
73 | + // 5.8.1 发票优化需求 | ||
74 | + // 只接受电子发票(1 纸质 2 电子),发票内容为明细(id 12:明细) | ||
75 | + if (p.invoicesType) { | ||
76 | + Object.assign(p, { | ||
77 | + invoicesType: 2, | ||
78 | + invoicesContent: 12 | ||
79 | + }); | ||
80 | + } | ||
81 | + | ||
73 | return ensureApi.orderSubmitAsync(uid, cartType, p.addressId, p.deliveryTime, | 82 | return ensureApi.orderSubmitAsync(uid, cartType, p.addressId, p.deliveryTime, |
74 | p.deliveryWay, p.paymentType, p.paymentId, p.printPrice, p, remoteIp).then(result => { | 83 | p.deliveryWay, p.paymentType, p.paymentId, p.printPrice, p, remoteIp).then(result => { |
75 | if (result.code === 200) { | 84 | if (result.code === 200) { |
@@ -77,21 +77,22 @@ | @@ -77,21 +77,22 @@ | ||
77 | <script id="invoice-chose-tpl" type="text/html"> | 77 | <script id="invoice-chose-tpl" type="text/html"> |
78 | <div class="invoice-close"><i class="iconfont"></i></div> | 78 | <div class="invoice-close"><i class="iconfont"></i></div> |
79 | <p class="invoice-header">发票信息</p> | 79 | <p class="invoice-header">发票信息</p> |
80 | - <ul class="invoice-type"> | ||
81 | - <li class="el-invoice focus">电子发票</li> | ||
82 | - <li class="pa-invoice">纸质发票</li> | ||
83 | - </ul> | ||
84 | <div class="invoice-content el-content"> | 80 | <div class="invoice-content el-content"> |
81 | + <p class="invoice-type-text"> | ||
82 | + <span class="row-title">发 票 类 型:</span> | ||
83 | + 电子发票 | ||
84 | + </p> | ||
85 | + | ||
85 | <p class="el-tip"> | 86 | <p class="el-tip"> |
86 | ※ 电子发票是税务局认可的有效凭证,其法律效力、基本用途及使用规定同纸质发票,如需纸质发票可自行下载打印。<br> | 87 | ※ 电子发票是税务局认可的有效凭证,其法律效力、基本用途及使用规定同纸质发票,如需纸质发票可自行下载打印。<br> |
87 | - <a href="/help/detail?id=33&contId=139" target="_blank">什么是电子发票?</a> | 88 | + <a href="/help/detail?id=33&contId=139" target="_blank">查看发票须知</a> |
88 | </p> | 89 | </p> |
89 | 90 | ||
90 | <ul> | 91 | <ul> |
91 | <li class="invoice-title invoice-row"> | 92 | <li class="invoice-title invoice-row"> |
92 | <span class="row-title"> | 93 | <span class="row-title"> |
93 | <em>*</em> | 94 | <em>*</em> |
94 | - 发票抬头 | 95 | + 发 票 抬 头: |
95 | </span> | 96 | </span> |
96 | <div class="row-content"> | 97 | <div class="row-content"> |
97 | <span class="radio-wrap"> | 98 | <span class="radio-wrap"> |
@@ -100,36 +101,41 @@ | @@ -100,36 +101,41 @@ | ||
100 | <span class="radio-wrap"> | 101 | <span class="radio-wrap"> |
101 | <label class="rbt-2 radio-btn" data-id="2"></label> 单位 | 102 | <label class="rbt-2 radio-btn" data-id="2"></label> 单位 |
102 | </span> | 103 | </span> |
103 | - | ||
104 | - <div class="company-row hide"> | ||
105 | - <input id="company-name" class="company-name" type="text" placeholder="请填写单位名称"> | ||
106 | - <span class="input-tip invoice-title-tip red hide"> | ||
107 | - <span class="iconfont"></span> | ||
108 | - 请填写发票抬头 | ||
109 | - </span> | ||
110 | - </div> | ||
111 | </div> | 104 | </div> |
112 | </li> | 105 | </li> |
113 | - <li class="invoice-goods-type invoice-row"> | 106 | + <li class="invoice-title-name invoice-row company-row hide"> |
107 | + <span class="row-title"> | ||
108 | + <em>*</em> | ||
109 | + 单 位 名 称: | ||
110 | + </span> | ||
111 | + <div class="row-content"> | ||
112 | + <input id="company-name" class="company-name" type="text" placeholder="请填写单位名称"> | ||
113 | + <span class="input-tip company-name-tip red hide"> | ||
114 | + <span class="iconfont"></span> | ||
115 | + <em>请填写发票抬头</em> | ||
116 | + </span> | ||
117 | + </div> | ||
118 | + </li> | ||
119 | + <li class="invoice-tax-num invoice-row company-row hide"> | ||
114 | <span class="row-title"> | 120 | <span class="row-title"> |
115 | <em>*</em> | 121 | <em>*</em> |
116 | - 发票内容: | 122 | + 税 号: |
117 | </span> | 123 | </span> |
118 | <div class="row-content"> | 124 | <div class="row-content"> |
119 | - {{#each invoices.invoiceContentList}} | ||
120 | - <span class="radio-wrap"> | ||
121 | - <label class="radio-btn rbc-{{invoices_type_id}}{{#if @first}} on{{/if}}" data-id="{{invoices_type_id}}" data-name="{{invoices_type_name}}"></label> {{invoices_type_name}} | ||
122 | - </span> | ||
123 | - {{/each}} | 125 | + <input id="company-tax-num" class="company-tax-num" type="text" placeholder="请输入正确的纳税人识别号"> |
126 | + <span class="input-tip company-tax-tip red hide"> | ||
127 | + <span class="iconfont"></span> | ||
128 | + <em>请填写纳税人识别号</em> | ||
129 | + </span> | ||
124 | </div> | 130 | </div> |
125 | </li> | 131 | </li> |
126 | <li class="receiver invoice-row" data-full="{{receiverMobile}}" data-hide="{{hideReceiverMobile}}"> | 132 | <li class="receiver invoice-row" data-full="{{receiverMobile}}" data-hide="{{hideReceiverMobile}}"> |
127 | <span class="row-title"> | 133 | <span class="row-title"> |
128 | <em>*</em> | 134 | <em>*</em> |
129 | - 手机号码: | 135 | + 手 机 号 码: |
130 | </span> | 136 | </span> |
131 | <div class="row-content"> | 137 | <div class="row-content"> |
132 | - <input id="receiver-phone" class="receiver-phone" type="text"> | 138 | + <input id="receiver-phone" class="receiver-phone" type="text" placeholder="可通过手机号码在发票服务平台查询"> |
133 | <span class="input-tip receiver-tip red hide"> | 139 | <span class="input-tip receiver-tip red hide"> |
134 | <span class="iconfont"></span> | 140 | <span class="iconfont"></span> |
135 | <em></em> | 141 | <em></em> |
@@ -11,7 +11,7 @@ module.exports = (url, width, height) => { | @@ -11,7 +11,7 @@ module.exports = (url, width, height) => { | ||
11 | <a href="javascript:;" class="video-close-btn"></a> | 11 | <a href="javascript:;" class="video-close-btn"></a> |
12 | <object id="video_0" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" | 12 | <object id="video_0" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" |
13 | classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> | 13 | classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> |
14 | - <param value="http://rescdn.yohoboys.com/res/new/boys/swf/util/VideoPlayerNew.swf?id=video_0&url=${url}&language=1&sharepic=http://img01.yohoboys.com/contentimg/2016/06/12/14/0183fabea5332c5902cdd1d0d7fb63df04.jpg?imageMogr2/thumbnail/738x424|watermark/1/image/aHR0cDovL3Jlc2Nkbi55b2hvYm95cy5jb20vcmVzL25ldy9ib3lzL2ltYWdlcy9iYW5uZXJwbGF5LnBuZw==/dissolve/100/gravity/Center/dx/10/dy/10&title1=Meet...Cody Sanderson &shareurl=http://www.yohoboys.com/channel/detail/index/id/10657/time/1478052894&coverpic=http://img01.yohoboys.com/contentimg/2016/06/12/14/0183fabea5332c5902cdd1d0d7fb63df04.jpg" | 14 | + <param value="//cdn.yoho.cn/tool/VideoPlayerNew.swf?id=video_0&url=${url}&language=1&sharepic=http://img01.yohoboys.com/contentimg/2016/06/12/14/0183fabea5332c5902cdd1d0d7fb63df04.jpg?imageMogr2/thumbnail/738x424|watermark/1/image/aHR0cDovL3Jlc2Nkbi55b2hvYm95cy5jb20vcmVzL25ldy9ib3lzL2ltYWdlcy9iYW5uZXJwbGF5LnBuZw==/dissolve/100/gravity/Center/dx/10/dy/10&title1=Meet...Cody Sanderson &shareurl=http://www.yohoboys.com/channel/detail/index/id/10657/time/1478052894&coverpic=http://img01.yohoboys.com/contentimg/2016/06/12/14/0183fabea5332c5902cdd1d0d7fb63df04.jpg" |
15 | name="movie"> | 15 | name="movie"> |
16 | <param value="high" name="quality"> | 16 | <param value="high" name="quality"> |
17 | <param value="#ffffff" name="bgcolor"> | 17 | <param value="#ffffff" name="bgcolor"> |
@@ -21,7 +21,7 @@ module.exports = (url, width, height) => { | @@ -21,7 +21,7 @@ module.exports = (url, width, height) => { | ||
21 | <embed style="width: ${width}px;height: ${height}px;" id="flash" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" | 21 | <embed style="width: ${width}px;height: ${height}px;" id="flash" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" |
22 | type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" loop="false" | 22 | type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" loop="false" |
23 | play="true" bgcolor="#ffffff" quality="high" wmode="transparent" name="vMessage" | 23 | play="true" bgcolor="#ffffff" quality="high" wmode="transparent" name="vMessage" |
24 | - src="http://rescdn.yohoboys.com/res/new/boys/swf/util/VideoPlayerNew.swf?id=video_0&url=${url}&language=1&sharepic=http://img01.yohoboys.com/contentimg/2016/06/12/14/0183fabea5332c5902cdd1d0d7fb63df04.jpg?imageMogr2/thumbnail/738x424|watermark/1/image/aHR0cDovL3Jlc2Nkbi55b2hvYm95cy5jb20vcmVzL25ldy9ib3lzL2ltYWdlcy9iYW5uZXJwbGF5LnBuZw==/dissolve/100/gravity/Center/dx/10/dy/10&title1=Meet...Cody Sanderson &shareurl=http://www.yohoboys.com/channel/detail/index/id/10657/time/1478052894&coverpic=${url}?vframe/jpg/offset/0"> | 24 | + src="//cdn.yoho.cn/tool/VideoPlayerNew.swf?id=video_0&url=${url}&language=1&sharepic=http://img01.yohoboys.com/contentimg/2016/06/12/14/0183fabea5332c5902cdd1d0d7fb63df04.jpg?imageMogr2/thumbnail/738x424|watermark/1/image/aHR0cDovL3Jlc2Nkbi55b2hvYm95cy5jb20vcmVzL25ldy9ib3lzL2ltYWdlcy9iYW5uZXJwbGF5LnBuZw==/dissolve/100/gravity/Center/dx/10/dy/10&title1=Meet...Cody Sanderson &shareurl=http://www.yohoboys.com/channel/detail/index/id/10657/time/1478052894&coverpic=${url}?vframe/jpg/offset/0"> |
25 | </object> | 25 | </object> |
26 | </div> `; | 26 | </div> `; |
27 | }; | 27 | }; |
@@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
7 | 7 | ||
8 | 'use strict'; | 8 | 'use strict'; |
9 | const aes = require('./aes-pwd'); | 9 | const aes = require('./aes-pwd'); |
10 | +const helpers = global.yoho.helpers; | ||
10 | const common = require('../../../config/common'); | 11 | const common = require('../../../config/common'); |
11 | const clientApi = require('../models/client-api'); | 12 | const clientApi = require('../models/client-api'); |
12 | const clientService = require('../models/client-service'); | 13 | const clientService = require('../models/client-service'); |
@@ -16,10 +17,11 @@ const clientService = require('../models/client-service'); | @@ -16,10 +17,11 @@ const clientService = require('../models/client-service'); | ||
16 | */ | 17 | */ |
17 | const index = (req, res, next) => { | 18 | const index = (req, res, next) => { |
18 | let type = 2; | 19 | let type = 2; |
20 | + let uid = req.user.uid; | ||
19 | let reg = /MSIE\s?[987]\.0/i; | 21 | let reg = /MSIE\s?[987]\.0/i; |
20 | let userAgent = req.headers['user-agent']; | 22 | let userAgent = req.headers['user-agent']; |
21 | let unSupport = reg.test(userAgent); | 23 | let unSupport = reg.test(userAgent); |
22 | - let encryptedUid = aes.encryptionUid(req.user.uid); | 24 | + let encryptedUid = aes.encryptionUid(uid); |
23 | let domains = common.domains; | 25 | let domains = common.domains; |
24 | let imCs = domains.imCs; | 26 | let imCs = domains.imCs; |
25 | let imSocket = domains.imSocket; | 27 | let imSocket = domains.imSocket; |
@@ -36,8 +38,11 @@ const index = (req, res, next) => { | @@ -36,8 +38,11 @@ const index = (req, res, next) => { | ||
36 | layout: false | 38 | layout: false |
37 | }); | 39 | }); |
38 | } else { | 40 | } else { |
39 | - clientService.getClientData(type, encryptedUid) | 41 | + clientService.getClientData(uid, type, encryptedUid) |
40 | .then(result => { | 42 | .then(result => { |
43 | + if (result.code === 401) { | ||
44 | + return res.redirect(helpers.urlFormat('/signin.html')); | ||
45 | + } | ||
41 | res.render('client', Object.assign(data, result)); | 46 | res.render('client', Object.assign(data, result)); |
42 | }).catch(next); | 47 | }).catch(next); |
43 | } | 48 | } |
@@ -58,10 +63,11 @@ const domains = (req, res) => { | @@ -58,10 +63,11 @@ const domains = (req, res) => { | ||
58 | * @param next | 63 | * @param next |
59 | */ | 64 | */ |
60 | const history = (req, res, next) => { | 65 | const history = (req, res, next) => { |
61 | - const encId = aes.encryptionUid(req.user.uid); | 66 | + const uid = req.user.uid; |
67 | + const encId = aes.encryptionUid(uid); | ||
62 | const endTime = req.body.endTime; | 68 | const endTime = req.body.endTime; |
63 | 69 | ||
64 | - clientApi.getMsgHistory(encId, endTime) | 70 | + clientApi.getMsgHistory(uid, encId, endTime) |
65 | .then(result => { | 71 | .then(result => { |
66 | res.json(result); | 72 | res.json(result); |
67 | }).catch(next); | 73 | }).catch(next); |
@@ -74,7 +80,10 @@ const history = (req, res, next) => { | @@ -74,7 +80,10 @@ const history = (req, res, next) => { | ||
74 | * @param next | 80 | * @param next |
75 | */ | 81 | */ |
76 | const saveEval = (req, res, next) => { | 82 | const saveEval = (req, res, next) => { |
77 | - const params = {}; | 83 | + const uid = req.user.uid; |
84 | + const params = { | ||
85 | + uid | ||
86 | + }; | ||
78 | 87 | ||
79 | params.stars = req.body.stars; | 88 | params.stars = req.body.stars; |
80 | params.promoter = req.body.promoter; | 89 | params.promoter = req.body.promoter; |
@@ -102,9 +111,12 @@ const saveEval = (req, res, next) => { | @@ -102,9 +111,12 @@ const saveEval = (req, res, next) => { | ||
102 | * @param next | 111 | * @param next |
103 | */ | 112 | */ |
104 | const queryReason = (req, res, next) => { | 113 | const queryReason = (req, res, next) => { |
114 | + const uid = req.user.uid; | ||
105 | const type = req.body.type; | 115 | const type = req.body.type; |
116 | + const encryptedUid = aes.encryptionUid(uid); | ||
117 | + | ||
106 | 118 | ||
107 | - clientApi.queryReason(type) | 119 | + clientApi.queryReason(uid, encryptedUid, type) |
108 | .then(result => { | 120 | .then(result => { |
109 | res.json(result); | 121 | res.json(result); |
110 | }).catch(next); | 122 | }).catch(next); |
@@ -117,11 +129,12 @@ const queryReason = (req, res, next) => { | @@ -117,11 +129,12 @@ const queryReason = (req, res, next) => { | ||
117 | * @param next | 129 | * @param next |
118 | */ | 130 | */ |
119 | const saveMessage = (req, res, next) => { | 131 | const saveMessage = (req, res, next) => { |
132 | + const uid = req.user.uid; | ||
120 | const content = req.body.content; | 133 | const content = req.body.content; |
121 | const encId = req.body.encryptedUid; | 134 | const encId = req.body.encryptedUid; |
122 | const cvId = req.body.conversationId; | 135 | const cvId = req.body.conversationId; |
123 | 136 | ||
124 | - clientApi.saveMessage(content, encId, cvId) | 137 | + clientApi.saveMessage(content, encId, cvId, uid) |
125 | .then(result => { | 138 | .then(result => { |
126 | res.json(result); | 139 | res.json(result); |
127 | }).catch(next); | 140 | }).catch(next); |
@@ -32,8 +32,9 @@ let urls = { | @@ -32,8 +32,9 @@ let urls = { | ||
32 | * @param { string } encryptedUid 用户ID | 32 | * @param { string } encryptedUid 用户ID |
33 | * @return { Object } 最近10条订单 | 33 | * @return { Object } 最近10条订单 |
34 | */ | 34 | */ |
35 | -const getLastTenOrders = (encryptedUid) => { | 35 | +const getLastTenOrders = (uid, encryptedUid) => { |
36 | return api.post(urls.lastTen, { | 36 | return api.post(urls.lastTen, { |
37 | + uid, | ||
37 | encryptedUid | 38 | encryptedUid |
38 | }); | 39 | }); |
39 | }; | 40 | }; |
@@ -43,8 +44,11 @@ const getLastTenOrders = (encryptedUid) => { | @@ -43,8 +44,11 @@ const getLastTenOrders = (encryptedUid) => { | ||
43 | * @function getQas | 44 | * @function getQas |
44 | * @return { Object } 问答列表 | 45 | * @return { Object } 问答列表 |
45 | */ | 46 | */ |
46 | -const getQas = () => { | ||
47 | - return api.post(urls.qas, {}); | 47 | +const getQas = (uid, encryptedUid) => { |
48 | + return api.post(urls.qas, { | ||
49 | + uid, | ||
50 | + encryptedUid | ||
51 | + }); | ||
48 | }; | 52 | }; |
49 | 53 | ||
50 | /** | 54 | /** |
@@ -65,8 +69,10 @@ const getCsSetting = (type) => { | @@ -65,8 +69,10 @@ const getCsSetting = (type) => { | ||
65 | * @param { string } endTime 截止时间 | 69 | * @param { string } endTime 截止时间 |
66 | * @return { Array } 历史聊天记录 | 70 | * @return { Array } 历史聊天记录 |
67 | */ | 71 | */ |
68 | -const getMsgHistory = (encryptedUid, endTime) => { | 72 | +const getMsgHistory = (uid, encryptedUid, endTime) => { |
73 | + | ||
69 | let params = { | 74 | let params = { |
75 | + uid, | ||
70 | encryptedUid | 76 | encryptedUid |
71 | }; | 77 | }; |
72 | 78 | ||
@@ -91,9 +97,11 @@ const saveEval = (params) => { | @@ -91,9 +97,11 @@ const saveEval = (params) => { | ||
91 | * @param cvId | 97 | * @param cvId |
92 | * @returns {*} | 98 | * @returns {*} |
93 | */ | 99 | */ |
94 | -const queryReason = (type) => { | 100 | +const queryReason = (uid, encryptedUid, type) => { |
95 | const params = { | 101 | const params = { |
96 | - type | 102 | + uid, |
103 | + type, | ||
104 | + encryptedUid | ||
97 | }; | 105 | }; |
98 | 106 | ||
99 | return api.post(urls.evalReason, params); | 107 | return api.post(urls.evalReason, params); |
@@ -106,8 +114,9 @@ const queryReason = (type) => { | @@ -106,8 +114,9 @@ const queryReason = (type) => { | ||
106 | * @param cvId 会话ID | 114 | * @param cvId 会话ID |
107 | * @returns {*} | 115 | * @returns {*} |
108 | */ | 116 | */ |
109 | -const saveMessage = (content, encId, cvId) => { | 117 | +const saveMessage = (content, encId, cvId, uid) => { |
110 | const params = { | 118 | const params = { |
119 | + uid, | ||
111 | content, | 120 | content, |
112 | encryptedUid: encId, | 121 | encryptedUid: encId, |
113 | conversationId: cvId | 122 | conversationId: cvId |
@@ -17,7 +17,7 @@ const clientAPI = require('./client-api'); | @@ -17,7 +17,7 @@ const clientAPI = require('./client-api'); | ||
17 | * @param { string } encryptedUid | 17 | * @param { string } encryptedUid |
18 | * @return { Object } 客服设置 | 18 | * @return { Object } 客服设置 |
19 | */ | 19 | */ |
20 | -const getClientData = (type, encryptedUid) => { | 20 | +const getClientData = (uid, type, encryptedUid) => { |
21 | const logoSize = '136x40'; | 21 | const logoSize = '136x40'; |
22 | const qcSize = '135x135'; | 22 | const qcSize = '135x135'; |
23 | const advSize = '160x335'; | 23 | const advSize = '160x335'; |
@@ -25,9 +25,9 @@ const getClientData = (type, encryptedUid) => { | @@ -25,9 +25,9 @@ const getClientData = (type, encryptedUid) => { | ||
25 | 25 | ||
26 | let apiMethod = [ | 26 | let apiMethod = [ |
27 | clientAPI.getCsSetting(type), | 27 | clientAPI.getCsSetting(type), |
28 | - clientAPI.getMsgHistory(encryptedUid), | ||
29 | - clientAPI.getLastTenOrders(encryptedUid), | ||
30 | - clientAPI.getQas() | 28 | + clientAPI.getMsgHistory(uid, encryptedUid), |
29 | + clientAPI.getLastTenOrders(uid, encryptedUid), | ||
30 | + clientAPI.getQas(uid, encryptedUid) | ||
31 | ]; | 31 | ]; |
32 | 32 | ||
33 | return Promise.all(apiMethod) | 33 | return Promise.all(apiMethod) |
@@ -38,6 +38,14 @@ const getClientData = (type, encryptedUid) => { | @@ -38,6 +38,14 @@ const getClientData = (type, encryptedUid) => { | ||
38 | let records = []; | 38 | let records = []; |
39 | let hasHistory = false; | 39 | let hasHistory = false; |
40 | 40 | ||
41 | + if (res[1].code === 401 || | ||
42 | + res[2].code === 401 || | ||
43 | + res[3].code === 401) { | ||
44 | + return { | ||
45 | + code: 401 | ||
46 | + }; | ||
47 | + } | ||
48 | + | ||
41 | if (res[0] && res[0].code === 200) { | 49 | if (res[0] && res[0].code === 200) { |
42 | if (res[0].data.config) { | 50 | if (res[0].data.config) { |
43 | csSetting = res[0].data.config; | 51 | csSetting = res[0].data.config; |
@@ -23,9 +23,18 @@ function validateInvoice($el, info) { | @@ -23,9 +23,18 @@ function validateInvoice($el, info) { | ||
23 | // 发票抬头 | 23 | // 发票抬头 |
24 | if (!info.titleName) { | 24 | if (!info.titleName) { |
25 | pass = false; | 25 | pass = false; |
26 | - $('.invoice-title-tip', $el).removeClass('hide'); | 26 | + $('.company-name-tip', $el).removeClass('hide'); |
27 | } else { | 27 | } else { |
28 | - $('.invoice-title-tip', $el).addClass('hide'); | 28 | + $('.company-name-tip', $el).addClass('hide'); |
29 | + } | ||
30 | + | ||
31 | + if (info.titleId === 2) { | ||
32 | + if (!info.taxNumber) { | ||
33 | + pass = false; | ||
34 | + $('.company-tax-tip', $el).removeClass('hide'); | ||
35 | + } else { | ||
36 | + $('.company-tax-tip', $el).addClass('hide'); | ||
37 | + } | ||
29 | } | 38 | } |
30 | 39 | ||
31 | // 收票人手机号 | 40 | // 收票人手机号 |
@@ -38,7 +47,7 @@ function validateInvoice($el, info) { | @@ -38,7 +47,7 @@ function validateInvoice($el, info) { | ||
38 | } else if (info.receiver === defaultReceiver.hide) { | 47 | } else if (info.receiver === defaultReceiver.hide) { |
39 | $receiverTip.addClass('hide'); | 48 | $receiverTip.addClass('hide'); |
40 | } else if (!/^[0-9]{11}$/.test(info.receiver)) { | 49 | } else if (!/^[0-9]{11}$/.test(info.receiver)) { |
41 | - $receiverTip.removeClass('hide').find('em').html('手机号码不正确'); | 50 | + $receiverTip.removeClass('hide').find('em').html('请输入正确手机号'); |
42 | pass = false; | 51 | pass = false; |
43 | } else { | 52 | } else { |
44 | $receiverTip.addClass('hide'); | 53 | $receiverTip.addClass('hide'); |
@@ -49,29 +58,9 @@ function validateInvoice($el, info) { | @@ -49,29 +58,9 @@ function validateInvoice($el, info) { | ||
49 | } | 58 | } |
50 | 59 | ||
51 | function bindInvoiceEvent($el) { | 60 | function bindInvoiceEvent($el) { |
52 | - var $invoiceTypeWrap = $('.invoice-type', $el), | ||
53 | - $titleWrap = $('.invoice-title', $el), | ||
54 | - $goodsTypeWrap = $('.invoice-goods-type', $el), | ||
55 | - $receiver = $('.receiver', $el), | 61 | + var $titleWrap = $('.invoice-title', $el), |
56 | $companyRow = $('.company-row', $el); | 62 | $companyRow = $('.company-row', $el); |
57 | 63 | ||
58 | - $invoiceTypeWrap.on('click', 'li', function() { | ||
59 | - var $this = $(this); | ||
60 | - | ||
61 | - if ($this.hasClass('focus')) { | ||
62 | - return; | ||
63 | - } | ||
64 | - | ||
65 | - if ($this.hasClass('el-invoice')) { | ||
66 | - $receiver.removeClass('hide'); | ||
67 | - } else { | ||
68 | - $receiver.addClass('hide'); | ||
69 | - } | ||
70 | - | ||
71 | - $this.siblings('.focus').removeClass('focus'); | ||
72 | - $this.addClass('focus'); | ||
73 | - }); | ||
74 | - | ||
75 | $titleWrap.on('click', '.radio-btn', function() { | 64 | $titleWrap.on('click', '.radio-btn', function() { |
76 | var $this = $(this), | 65 | var $this = $(this), |
77 | id = $this.data('id'); | 66 | id = $this.data('id'); |
@@ -90,17 +79,6 @@ function bindInvoiceEvent($el) { | @@ -90,17 +79,6 @@ function bindInvoiceEvent($el) { | ||
90 | $this.addClass('on'); | 79 | $this.addClass('on'); |
91 | }); | 80 | }); |
92 | 81 | ||
93 | - $goodsTypeWrap.on('click', '.radio-btn', function() { | ||
94 | - var $this = $(this); | ||
95 | - | ||
96 | - if ($this.hasClass('on')) { | ||
97 | - return; | ||
98 | - } | ||
99 | - | ||
100 | - $goodsTypeWrap.find('.on').removeClass('on'); | ||
101 | - $this.addClass('on'); | ||
102 | - }); | ||
103 | - | ||
104 | $el.on('click', '.invoice-close', function() { | 82 | $el.on('click', '.invoice-close', function() { |
105 | $('.btn-close', $el).trigger('click'); | 83 | $('.btn-close', $el).trigger('click'); |
106 | }); | 84 | }); |
@@ -109,48 +87,35 @@ function bindInvoiceEvent($el) { | @@ -109,48 +87,35 @@ function bindInvoiceEvent($el) { | ||
109 | function bindInvoiceInfo($el, info) { | 87 | function bindInvoiceInfo($el, info) { |
110 | info = info || {}; | 88 | info = info || {}; |
111 | 89 | ||
112 | - // 发票类型 | ||
113 | - if (info.invocesType === 1) { | ||
114 | - $('.pa-invoice', $el).trigger('click'); | ||
115 | - } | ||
116 | - | ||
117 | if (info.titleId) { | 90 | if (info.titleId) { |
118 | $('.rbt-' + info.titleId).trigger('click'); | 91 | $('.rbt-' + info.titleId).trigger('click'); |
119 | 92 | ||
120 | - if (info.titleId === 2 && info.titleName) { | ||
121 | - $('#company-name', $el).val(info.titleName); | 93 | + if (info.titleId === 2) { |
94 | + $('#company-name', $el).val(info.titleName || ''); | ||
95 | + $('#company-tax-num', $el).val(info.taxNumber || ''); | ||
122 | } | 96 | } |
123 | } | 97 | } |
124 | 98 | ||
125 | - if (info.contentId) { | ||
126 | - $('.rbc-' + info.contentId, $el).trigger('click'); | ||
127 | - } | ||
128 | - | ||
129 | $('#receiver-phone', $el).val(info.receiver || defaultReceiver.hide || ''); | 99 | $('#receiver-phone', $el).val(info.receiver || defaultReceiver.hide || ''); |
130 | } | 100 | } |
131 | 101 | ||
132 | function packInvoiceInfo($el) { | 102 | function packInvoiceInfo($el) { |
133 | - var $goodsType = $('.invoice-goods-type .on', $el); | ||
134 | - var resData = {}, | 103 | + var resData = { // 5.8.1需求,只支持电子发票(type: 2),发票内容只能开明细(id:12) |
104 | + invocesType: 2, | ||
105 | + contentId: 12, | ||
106 | + contentName: '明细' | ||
107 | + }, | ||
135 | receiver = $('#receiver-phone', $el).val(); | 108 | receiver = $('#receiver-phone', $el).val(); |
136 | 109 | ||
137 | - if ($('.pa-invoice', $el).hasClass('focus')) { | ||
138 | - resData.invocesType = 1; | ||
139 | - } else { | ||
140 | - resData.invocesType = 2; | ||
141 | - } | ||
142 | - | ||
143 | resData.titleId = $('.invoice-title .on', $el).data('id') || 1; | 110 | resData.titleId = $('.invoice-title .on', $el).data('id') || 1; |
144 | 111 | ||
145 | if (resData.titleId * 1 === 1) { | 112 | if (resData.titleId * 1 === 1) { |
146 | resData.titleName = '个人'; | 113 | resData.titleName = '个人'; |
147 | } else { | 114 | } else { |
148 | resData.titleName = $('#company-name', $el).val(); | 115 | resData.titleName = $('#company-name', $el).val(); |
116 | + resData.taxNumber = $('#company-tax-num', $el).val(); | ||
149 | } | 117 | } |
150 | 118 | ||
151 | - resData.contentId = $goodsType.data('id'); | ||
152 | - resData.contentName = $goodsType.data('name'); | ||
153 | - | ||
154 | if (receiver) { | 119 | if (receiver) { |
155 | resData.receiver = receiver; | 120 | resData.receiver = receiver; |
156 | } | 121 | } |
@@ -173,8 +138,7 @@ function setShowInvoiceInfo() { | @@ -173,8 +138,7 @@ function setShowInvoiceInfo() { | ||
173 | _h += '电子发票'; | 138 | _h += '电子发票'; |
174 | } | 139 | } |
175 | 140 | ||
176 | - _h += ' ' + invoiceInfo.titleName + | ||
177 | - ' ' + invoiceInfo.contentName; | 141 | + _h += ' ' + invoiceInfo.titleName; |
178 | 142 | ||
179 | $dom.removeClass('hide').find('span').html(_h); | 143 | $dom.removeClass('hide').find('span').html(_h); |
180 | } | 144 | } |
@@ -186,7 +150,7 @@ function invoiceEditDialog(baseInfo) { | @@ -186,7 +150,7 @@ function invoiceEditDialog(baseInfo) { | ||
186 | btns: [ | 150 | btns: [ |
187 | { | 151 | { |
188 | id: 'save-invoice', | 152 | id: 'save-invoice', |
189 | - name: '保存发票信息', | 153 | + name: '提交', |
190 | btnClass: ['save-invoice'], | 154 | btnClass: ['save-invoice'], |
191 | cb: function() { | 155 | cb: function() { |
192 | var info = packInvoiceInfo(invoice.$el); | 156 | var info = packInvoiceInfo(invoice.$el); |
@@ -258,6 +222,7 @@ exports.getInvoice = function() { | @@ -258,6 +222,7 @@ exports.getInvoice = function() { | ||
258 | invoicesType: invoiceInfo.invocesType, | 222 | invoicesType: invoiceInfo.invocesType, |
259 | invoicesTitle: invoiceInfo.titleName, | 223 | invoicesTitle: invoiceInfo.titleName, |
260 | invoicesContent: invoiceInfo.contentId, | 224 | invoicesContent: invoiceInfo.contentId, |
225 | + taxNumber: invoiceInfo.taxNumber || '', | ||
261 | receiver: invoiceInfo.receiver === defaultReceiver.hide ? defaultReceiver.full : invoiceInfo.receiver | 226 | receiver: invoiceInfo.receiver === defaultReceiver.hide ? defaultReceiver.full : invoiceInfo.receiver |
262 | }; | 227 | }; |
263 | }; | 228 | }; |
@@ -237,6 +237,7 @@ function _loadPage() { | @@ -237,6 +237,7 @@ function _loadPage() { | ||
237 | 237 | ||
238 | // 接入人工客服需要评价 | 238 | // 接入人工客服需要评价 |
239 | processInfo.manual = true; | 239 | processInfo.manual = true; |
240 | + processInfo.savedEval = false; | ||
240 | 241 | ||
241 | // 显示评价&隐藏人工 | 242 | // 显示评价&隐藏人工 |
242 | edit.setIcons({ | 243 | edit.setIcons({ |
@@ -607,6 +608,12 @@ function _loadPage() { | @@ -607,6 +608,12 @@ function _loadPage() { | ||
607 | 608 | ||
608 | serviceApi.history(data) | 609 | serviceApi.history(data) |
609 | .done(function(res) { | 610 | .done(function(res) { |
611 | + if (res && res.code === 401) { | ||
612 | + window.onbeforeunload = null; | ||
613 | + return location.href = '//www.yohobuy.com/signin.html?refer=' + // eslint-disable-line | ||
614 | + encodeURIComponent(location.href); | ||
615 | + } | ||
616 | + | ||
610 | if (res && res.code === 200) { | 617 | if (res && res.code === 200) { |
611 | if (processInfo.hasMore) { | 618 | if (processInfo.hasMore) { |
612 | msgList = res.data.records || []; | 619 | msgList = res.data.records || []; |
@@ -690,7 +697,13 @@ function _loadPage() { | @@ -690,7 +697,13 @@ function _loadPage() { | ||
690 | encryptedUid: encryptedUid, | 697 | encryptedUid: encryptedUid, |
691 | conversationId: socketConfCM.conversationId | 698 | conversationId: socketConfCM.conversationId |
692 | }) | 699 | }) |
693 | - .done(function() {}) | 700 | + .done(function(res) { |
701 | + if (res && res.code === 401) { | ||
702 | + window.onbeforeunload = null; | ||
703 | + return location.href = '//www.yohobuy.com/signin.html?refer=' + // eslint-disable-line | ||
704 | + encodeURIComponent(location.href); | ||
705 | + } | ||
706 | + }) | ||
694 | .always(function() { | 707 | .always(function() { |
695 | lMsg.modal('hide'); | 708 | lMsg.modal('hide'); |
696 | }); | 709 | }); |
@@ -36,6 +36,12 @@ var _fetchReason = (function() { | @@ -36,6 +36,12 @@ var _fetchReason = (function() { | ||
36 | type: YOHO_CS | 36 | type: YOHO_CS |
37 | }) | 37 | }) |
38 | .done(function(res) { | 38 | .done(function(res) { |
39 | + if (res && res.code === 401) { | ||
40 | + window.onbeforeunload = null; | ||
41 | + return location.href = '//www.yohobuy.com/signin.html?refer=' + // eslint-disable-line | ||
42 | + encodeURIComponent(location.href); | ||
43 | + } | ||
44 | + | ||
39 | if (res.code === 200) { | 45 | if (res.code === 200) { |
40 | cache = res.data; | 46 | cache = res.data; |
41 | render(cache); | 47 | render(cache); |
@@ -131,6 +137,12 @@ function _evalSubmit() { | @@ -131,6 +137,12 @@ function _evalSubmit() { | ||
131 | $btnEval.hide(); | 137 | $btnEval.hide(); |
132 | processSign.savedEval = true; | 138 | processSign.savedEval = true; |
133 | 139 | ||
140 | + if (res && res.code === 401) { | ||
141 | + window.onbeforeunload = null; | ||
142 | + return location.href = '//www.yohobuy.com/signin.html?refer=' + // eslint-disable-line | ||
143 | + encodeURIComponent(location.href); | ||
144 | + } | ||
145 | + | ||
134 | if (res && res.code === 200) { | 146 | if (res && res.code === 200) { |
135 | send.completeEval(); | 147 | send.completeEval(); |
136 | self.close(); | 148 | self.close(); |
@@ -771,6 +771,15 @@ | @@ -771,6 +771,15 @@ | ||
771 | padding-right: 20px; | 771 | padding-right: 20px; |
772 | font-size: 14px; | 772 | font-size: 14px; |
773 | 773 | ||
774 | + > span { | ||
775 | + display: inline-block; | ||
776 | + max-width: 300px; | ||
777 | + overflow: hidden; | ||
778 | + text-overflow: ellipsis; | ||
779 | + white-space: nowrap; | ||
780 | + vertical-align: middle; | ||
781 | + } | ||
782 | + | ||
774 | > label { | 783 | > label { |
775 | width: 80px; | 784 | width: 80px; |
776 | height: 24px; | 785 | height: 24px; |
@@ -1555,10 +1564,12 @@ | @@ -1555,10 +1564,12 @@ | ||
1555 | .ensure-invoice-dialog { | 1564 | .ensure-invoice-dialog { |
1556 | $red: #d0021b; | 1565 | $red: #d0021b; |
1557 | 1566 | ||
1558 | - width: 440px; | 1567 | + width: 690px; |
1568 | + padding: 20px 58px; | ||
1559 | font-size: 14px; | 1569 | font-size: 14px; |
1560 | color: #444; | 1570 | color: #444; |
1561 | background-color: #fff; | 1571 | background-color: #fff; |
1572 | + box-sizing: border-box; | ||
1562 | 1573 | ||
1563 | > .close { | 1574 | > .close { |
1564 | display: none; | 1575 | display: none; |
@@ -1601,31 +1612,17 @@ | @@ -1601,31 +1612,17 @@ | ||
1601 | } | 1612 | } |
1602 | 1613 | ||
1603 | .invoice-header { | 1614 | .invoice-header { |
1604 | - font-size: 18px; | ||
1605 | - padding-bottom: 10px; | 1615 | + font-size: 14px; |
1616 | + padding: 24px 0 20px; | ||
1606 | border-bottom: 1px solid #e8e8e8; | 1617 | border-bottom: 1px solid #e8e8e8; |
1607 | } | 1618 | } |
1608 | 1619 | ||
1609 | - .invoice-type { | ||
1610 | - padding: 20px 0; | ||
1611 | - | ||
1612 | - > li { | ||
1613 | - width: 98px; | ||
1614 | - height: 28px; | ||
1615 | - line-height: 28px; | ||
1616 | - text-align: center; | ||
1617 | - font-size: 14px; | ||
1618 | - margin-right: 17px; | ||
1619 | - border: 1px solid #505050; | ||
1620 | - color: #505050; | ||
1621 | - display: inline-block; | ||
1622 | - cursor: pointer; | ||
1623 | - } | 1620 | + .invoice-content { |
1621 | + font-weight: 300; | ||
1622 | + } | ||
1624 | 1623 | ||
1625 | - .focus { | ||
1626 | - border-color: #d0021b; | ||
1627 | - color: #d0021b; | ||
1628 | - } | 1624 | + .row-title { |
1625 | + font-weight: normal; | ||
1629 | } | 1626 | } |
1630 | 1627 | ||
1631 | .el-tip { | 1628 | .el-tip { |
@@ -1634,15 +1631,24 @@ | @@ -1634,15 +1631,24 @@ | ||
1634 | line-height: 1.5; | 1631 | line-height: 1.5; |
1635 | 1632 | ||
1636 | > a { | 1633 | > a { |
1637 | - color: $red; | ||
1638 | display: inline-block; | 1634 | display: inline-block; |
1639 | padding-top: 12px; | 1635 | padding-top: 12px; |
1636 | + font-weight: 500; | ||
1637 | + } | ||
1638 | + } | ||
1639 | + | ||
1640 | + .invoice-type-text { | ||
1641 | + line-height: 20px; | ||
1642 | + padding: 20px 10px; | ||
1643 | + | ||
1644 | + .row-title { | ||
1645 | + margin-right: 10px; | ||
1640 | } | 1646 | } |
1641 | } | 1647 | } |
1642 | 1648 | ||
1643 | .invoice-row { | 1649 | .invoice-row { |
1644 | padding-top: 16px; | 1650 | padding-top: 16px; |
1645 | - padding-left: 84px; | 1651 | + padding-left: 92px; |
1646 | overflow: hidden; | 1652 | overflow: hidden; |
1647 | 1653 | ||
1648 | .row-content { | 1654 | .row-content { |
@@ -1652,7 +1658,7 @@ | @@ -1652,7 +1658,7 @@ | ||
1652 | .row-title { | 1658 | .row-title { |
1653 | line-height: 30px; | 1659 | line-height: 30px; |
1654 | position: absolute; | 1660 | position: absolute; |
1655 | - margin-left: -84px; | 1661 | + margin-left: -92px; |
1656 | 1662 | ||
1657 | > em { | 1663 | > em { |
1658 | color: $red; | 1664 | color: $red; |
@@ -1669,9 +1675,11 @@ | @@ -1669,9 +1675,11 @@ | ||
1669 | } | 1675 | } |
1670 | 1676 | ||
1671 | input { | 1677 | input { |
1672 | - width: 194px; | ||
1673 | - height: 26px; | 1678 | + width: 220px; |
1679 | + height: 30px; | ||
1674 | padding: 0 10px; | 1680 | padding: 0 10px; |
1681 | + background: #f5f5f5; | ||
1682 | + border: 1px solid #e0e0e0; | ||
1675 | } | 1683 | } |
1676 | 1684 | ||
1677 | .red { | 1685 | .red { |
@@ -1684,15 +1692,17 @@ | @@ -1684,15 +1692,17 @@ | ||
1684 | padding-bottom: 10px; | 1692 | padding-bottom: 10px; |
1685 | 1693 | ||
1686 | .btn { | 1694 | .btn { |
1687 | - width: 130px; | ||
1688 | - height: 28px; | ||
1689 | - line-height: 28px; | 1695 | + width: 140px; |
1696 | + height: 40px; | ||
1697 | + line-height: 38px; | ||
1698 | + box-sizing: border-box; | ||
1690 | } | 1699 | } |
1691 | 1700 | ||
1692 | .save-invoice { | 1701 | .save-invoice { |
1693 | background-color: #000; | 1702 | background-color: #000; |
1694 | color: #fff; | 1703 | color: #fff; |
1695 | font-weight: 300; | 1704 | font-weight: 300; |
1705 | + margin-right: 30px; | ||
1696 | } | 1706 | } |
1697 | } | 1707 | } |
1698 | } | 1708 | } |
-
Please register or login to post a comment