Commit d094d9f2 by 李伟康

修复

1 parent 05cb31cd
...@@ -203,7 +203,7 @@ Page({ ...@@ -203,7 +203,7 @@ Page({
this.getSolitaireUserInfo(params) this.getSolitaireUserInfo(params)
this.getSolitaireAewardList(params) this.getSolitaireAewardList(params)
this.setData({ this.setData({
activityDetail: decodeURIComponent(res.description), activityDetail: decodeURIComponent(wx.p.format.encodeSearchKey(res.description)),
title: res.title, title: res.title,
array: generateOptionsArray(res.numLimit), array: generateOptionsArray(res.numLimit),
loading: true, loading: true,
......
...@@ -27,5 +27,5 @@ ...@@ -27,5 +27,5 @@
"ignore": [], "ignore": [],
"include": [] "include": []
}, },
"appid": "wx5d1208f9c8712943" "appid": "wxb818f6bc908c52fc"
} }
\ No newline at end of file \ No newline at end of file
...@@ -143,13 +143,39 @@ export function setPrice(price) { ...@@ -143,13 +143,39 @@ export function setPrice(price) {
if (!decimal) decimal = '00' if (!decimal) decimal = '00'
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + `.${decimal}` return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + `.${decimal}`
} }
/**decodeURIComponent 编码转换 */
export default{ export function encodeSearchKey(key) {
const encodeArr = [{
code: '%',
encode: '%25'
}, {
code: '?',
encode: '%3F'
}, {
code: '#',
encode: '%23'
}, {
code: '&',
encode: '%26'
}, {
code: '=',
encode: '%3D'
}];
return key.replace(/[%?#&=]/g, ($, index, str) => {
for (const k of encodeArr) {
if (k.code === $) {
return k.encode;
}
}
});
}
export default {
timeAgo, timeAgo,
commentTime, commentTime,
iosTimeFormat, iosTimeFormat,
getScopeTime, getScopeTime,
decimal, decimal,
centsToyuan, centsToyuan,
setPrice setPrice,
} encodeSearchKey
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!