Commit d094d9f2 by 李伟康

修复

1 parent 05cb31cd
......@@ -203,7 +203,7 @@ Page({
this.getSolitaireUserInfo(params)
this.getSolitaireAewardList(params)
this.setData({
activityDetail: decodeURIComponent(res.description),
activityDetail: decodeURIComponent(wx.p.format.encodeSearchKey(res.description)),
title: res.title,
array: generateOptionsArray(res.numLimit),
loading: true,
......
......@@ -27,5 +27,5 @@
"ignore": [],
"include": []
},
"appid": "wx5d1208f9c8712943"
"appid": "wxb818f6bc908c52fc"
}
\ No newline at end of file
......@@ -143,13 +143,39 @@ export function setPrice(price) {
if (!decimal) decimal = '00'
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + `.${decimal}`
}
export default{
/**decodeURIComponent 编码转换 */
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,
commentTime,
iosTimeFormat,
getScopeTime,
decimal,
centsToyuan,
setPrice
setPrice,
encodeSearchKey
}
\ 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!