| | |
| | | var help = { |
| | | import parse from 'mini-html-parser2'; |
| | | var help; |
| | | help = { |
| | | getEventParam(event, name) { |
| | | return event.target.dataset[name]; |
| | | }, |
| | | setPageNavBar(title) { |
| | | my.setNavigationBar({ |
| | | title: title, |
| | | var data = { |
| | | backgroundColor: getApp().themeColor, |
| | | borderBottomColor: getApp().themeColor |
| | | }); |
| | | } |
| | | if (title != null) { |
| | | data.title = title; |
| | | } |
| | | |
| | | my.setNavigationBar(data); |
| | | }, |
| | | isNullOrEmpty(str) { |
| | | if (str == undefined || str == null || str.length == 0) |
| | |
| | | html += "</div>"; |
| | | console.log(html); |
| | | return html; |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 通过html文件获取富文本 |
| | | * @param {*} html |
| | | * @param {*} callback |
| | | */ |
| | | loadRichTextNode(html, callback) { |
| | | parse(html, (err, nodes) => { |
| | | console.log(nodes); |
| | | if (!err) { |
| | | callback(nodes); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | //获取助力进度html |
| | |
| | | hh: h < 10 ? '0' + h : h, |
| | | } |
| | | }, |
| | | getUid() { |
| | | let data = my.getStorageSync({ |
| | | key: 'uid' |
| | | cacheConfig(params) { |
| | | my.setStorage({ |
| | | key: 'config', |
| | | data: params |
| | | }); |
| | | return data.data; |
| | | }, |
| | | |
| | | getCachedConfig(callback) { |
| | | let data = my.getStorage({ |
| | | key: 'config', |
| | | success: function (res) { |
| | | callback(res.data); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |