From 24ffce04303eddf015904fd90b7698ac80d57bf8 Mon Sep 17 00:00:00 2001 From: linju-json Date: Tue, 27 Apr 2021 22:58:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 6 +- baseapp.config.js | 9 +- common/appInit.js | 9 +- common/extiLogin.js | 25 -- components/auth-btn/auth-btn.vue | 136 ------- .../login-action-sheet/login-action-sheet.vue | 136 ------- components/null/null.vue | 35 ++ components/refreshBox/refreshBox.nvue | 71 ++++ .../u-parse/components/wxParseAudio.vue | 28 -- components/u-parse/components/wxParseImg.vue | 94 ----- .../u-parse/components/wxParseTable.vue | 55 --- .../u-parse/components/wxParseTemplate0.vue | 98 ----- .../u-parse/components/wxParseTemplate1.vue | 88 ----- .../u-parse/components/wxParseTemplate10.vue | 88 ----- .../u-parse/components/wxParseTemplate11.vue | 86 ----- .../u-parse/components/wxParseTemplate2.vue | 88 ----- .../u-parse/components/wxParseTemplate3.vue | 88 ----- .../u-parse/components/wxParseTemplate4.vue | 88 ----- .../u-parse/components/wxParseTemplate5.vue | 88 ----- .../u-parse/components/wxParseTemplate6.vue | 88 ----- .../u-parse/components/wxParseTemplate7.vue | 88 ----- .../u-parse/components/wxParseTemplate8.vue | 88 ----- .../u-parse/components/wxParseTemplate9.vue | 88 ----- .../u-parse/components/wxParseVideo.vue | 15 - components/u-parse/libs/html2json.js | 261 -------------- components/u-parse/libs/htmlparser.js | 156 -------- components/u-parse/libs/wxDiscode.js | 209 ----------- components/u-parse/parse.css | 258 -------------- components/u-parse/parse.vue | 228 ------------ main.js | 8 +- manifest.json | 6 +- pages.json | 46 ++- pages/grid/grid.vue | 11 - pages/list/--news-list.vue | 337 ------------------ pages/list/detail.vue | 152 ++++---- pages/list/list.nvue | 337 ++++++++++++------ pages/list/search/search.nvue | 4 +- pages/test/{test.vue => test copy.vue} | 0 pages/test/test.nvue | 32 ++ pages/ucenter/settings/settings.vue | 130 +++---- pages/ucenter/ucenter.vue | 34 +- static/{ => app-plus}/sharemenu/copyurl.png | Bin static/{ => app-plus}/sharemenu/more.png | Bin static/{ => app-plus}/sharemenu/mp_weixin.png | Bin static/{ => app-plus}/sharemenu/qq.png | Bin .../{ => app-plus}/sharemenu/wechatfriend.png | Bin .../sharemenu/wechatmoments.png | Bin static/{ => app-plus}/sharemenu/weibo.png | Bin static/getDataState/loading.png | Bin 0 -> 30470 bytes static/getDataState/nodata.png | Bin 0 -> 45738 bytes static/getDataState/nowifi.png | Bin 0 -> 98274 bytes static/logo.png | Bin 4023 -> 0 bytes static/text-icon.ttf | Bin 3512 -> 0 bytes static/uni.ttf | Bin 26164 -> 0 bytes uniCloud-aliyun/cloudfunctions/user/index.js | 82 ----- .../cloudfunctions/user/package-lock.json | 59 --- .../cloudfunctions/user/package.json | 16 - .../cloudfunctions/user/user.param.json | 8 - uniCloud-aliyun/database/db_init.json | 204 ++--------- .../database/opendb-mall-goods.schema.json | 123 ------- .../opendb-news-articles-detail.schema.json | 122 ------- .../database/opendb-news-articles.schema.json | 10 - .../database/opendb-feedback.schema.json | 2 +- .../components/uni-icons/uni-icons.vue | 1 - 64 files changed, 582 insertions(+), 3937 deletions(-) delete mode 100644 common/extiLogin.js delete mode 100644 components/auth-btn/auth-btn.vue delete mode 100644 components/login-action-sheet/login-action-sheet.vue create mode 100644 components/null/null.vue create mode 100644 components/refreshBox/refreshBox.nvue delete mode 100644 components/u-parse/components/wxParseAudio.vue delete mode 100644 components/u-parse/components/wxParseImg.vue delete mode 100644 components/u-parse/components/wxParseTable.vue delete mode 100644 components/u-parse/components/wxParseTemplate0.vue delete mode 100644 components/u-parse/components/wxParseTemplate1.vue delete mode 100644 components/u-parse/components/wxParseTemplate10.vue delete mode 100644 components/u-parse/components/wxParseTemplate11.vue delete mode 100644 components/u-parse/components/wxParseTemplate2.vue delete mode 100644 components/u-parse/components/wxParseTemplate3.vue delete mode 100644 components/u-parse/components/wxParseTemplate4.vue delete mode 100644 components/u-parse/components/wxParseTemplate5.vue delete mode 100644 components/u-parse/components/wxParseTemplate6.vue delete mode 100644 components/u-parse/components/wxParseTemplate7.vue delete mode 100644 components/u-parse/components/wxParseTemplate8.vue delete mode 100644 components/u-parse/components/wxParseTemplate9.vue delete mode 100644 components/u-parse/components/wxParseVideo.vue delete mode 100644 components/u-parse/libs/html2json.js delete mode 100644 components/u-parse/libs/htmlparser.js delete mode 100644 components/u-parse/libs/wxDiscode.js delete mode 100644 components/u-parse/parse.css delete mode 100644 components/u-parse/parse.vue delete mode 100644 pages/list/--news-list.vue rename pages/test/{test.vue => test copy.vue} (100%) create mode 100644 pages/test/test.nvue rename static/{ => app-plus}/sharemenu/copyurl.png (100%) rename static/{ => app-plus}/sharemenu/more.png (100%) rename static/{ => app-plus}/sharemenu/mp_weixin.png (100%) rename static/{ => app-plus}/sharemenu/qq.png (100%) rename static/{ => app-plus}/sharemenu/wechatfriend.png (100%) rename static/{ => app-plus}/sharemenu/wechatmoments.png (100%) rename static/{ => app-plus}/sharemenu/weibo.png (100%) create mode 100644 static/getDataState/loading.png create mode 100644 static/getDataState/nodata.png create mode 100644 static/getDataState/nowifi.png delete mode 100644 static/logo.png delete mode 100644 static/text-icon.ttf delete mode 100644 static/uni.ttf delete mode 100644 uniCloud-aliyun/cloudfunctions/user/index.js delete mode 100644 uniCloud-aliyun/cloudfunctions/user/package-lock.json delete mode 100644 uniCloud-aliyun/cloudfunctions/user/package.json delete mode 100644 uniCloud-aliyun/cloudfunctions/user/user.param.json delete mode 100644 uniCloud-aliyun/database/opendb-mall-goods.schema.json delete mode 100644 uniCloud-aliyun/database/opendb-news-articles-detail.schema.json diff --git a/App.vue b/App.vue index c03cf91..8ae266c 100644 --- a/App.vue +++ b/App.vue @@ -93,7 +93,7 @@ /* #endif */ } - /* #ifndef APP-NVUE */ + /* #ifndef APP-NVUE */ view, scroll-view, text, @@ -105,10 +105,8 @@ box-sizing: border-box; flex-direction: column; } - scroll-view { -webkit-overflow-scrolling: touch; } - - /* #endif */ + /* #endif */ diff --git a/baseapp.config.js b/baseapp.config.js index 43d6864..c7ec702 100644 --- a/baseapp.config.js +++ b/baseapp.config.js @@ -18,7 +18,14 @@ module.exports = { "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list", "/pages/ucenter/edit/uploadCutImageToUnicloud" ], - "login": [ "smsCode","univerify", "username", "weixin", "apple"] //默认就是短信验证码登陆 + "login": [ "smsCode","uniVerify", "username", "weixin", "apple"], + /* + 根据数组的第0项,决定登陆方式的第一优先级。 + 为完全列举到的或设备环境不支持的选项,将被隐藏。 + 快捷登陆按钮,在任意一页面都存在。 + 所以只有三种情况: + 一键登录(uniVerify)、账号(username)、验证码登陆(其他值为第一项都为验证码登陆) + */ }, "about": { "appName": "base-app", diff --git a/common/appInit.js b/common/appInit.js index 8da6967..0a80714 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -8,8 +8,7 @@ export default function() { initAppVersion(); // baseappConfig挂载到getApp(). - getApp({allowDefault: true}).config = baseappConfig; - + getApp({allowDefault: true}).config = baseappConfig; //自定义路由拦截 const { @@ -41,8 +40,8 @@ export default function() { } //控制登陆优先级 if (url == '/pages/ucenter/login-page/index/index') { - //一键登录(univerify)、密码登陆(username)、快捷登录&验证码登陆(!univerify&password) - if (login[0] == 'univerify') { + //一键登录(uniVerify)、账号(username)、验证码登陆(短信smsCode) + if (login[0] == 'uniVerify') { // console.log(e.url,url); if (e.url == url) { e.url += '?' @@ -67,7 +66,7 @@ export default function() { fail(e) { // 失败回调拦截 console.log(e); if ( - e.errCode === 11 && uni.getSystemInfoSync().platform == "android" || + e.errCode === 11 && uni.getSystemInfoSync().platform == "android" || e.errCode === 2 && uni.getSystemInfoSync().platform == "ios" ){ uni.showModal({ diff --git a/common/extiLogin.js b/common/extiLogin.js deleted file mode 100644 index 17ab4c3..0000000 --- a/common/extiLogin.js +++ /dev/null @@ -1,25 +0,0 @@ -export default function(result){ - uni.showToast({ - title: '登陆成功', - icon: 'none' - }); - console.log('登陆成功',result); - uni.setStorageSync('uni_id_uid', result.uid) - uni.setStorageSync('uni_id_token', result.token) - uni.setStorageSync('uni_id_token_expired', result.tokenExpired) - //delete result.userInfo.token - // this.setUserInfo(result.userInfo) - - var delta = 0//判断需要返回几层 - let pages = getCurrentPages(); - // console.log(pages); - pages.forEach((page,index)=>{ - // console.log(pages[pages.length-index-1].route.split('/')[2]); - pages[pages.length-index-1].route.split('/') - if(pages[pages.length-index-1].route.split('/')[2] == 'login-page'){ - delta ++ - } - }) - // console.log('判断需要返回几层',delta); - uni.navigateBack({delta}) -} \ No newline at end of file diff --git a/components/auth-btn/auth-btn.vue b/components/auth-btn/auth-btn.vue deleted file mode 100644 index 2047000..0000000 --- a/components/auth-btn/auth-btn.vue +++ /dev/null @@ -1,136 +0,0 @@ - - - - - diff --git a/components/login-action-sheet/login-action-sheet.vue b/components/login-action-sheet/login-action-sheet.vue deleted file mode 100644 index f734197..0000000 --- a/components/login-action-sheet/login-action-sheet.vue +++ /dev/null @@ -1,136 +0,0 @@ - - - - - diff --git a/components/null/null.vue b/components/null/null.vue new file mode 100644 index 0000000..7bf8b74 --- /dev/null +++ b/components/null/null.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/components/refreshBox/refreshBox.nvue b/components/refreshBox/refreshBox.nvue new file mode 100644 index 0000000..54ce6cc --- /dev/null +++ b/components/refreshBox/refreshBox.nvue @@ -0,0 +1,71 @@ + + + + diff --git a/components/u-parse/components/wxParseAudio.vue b/components/u-parse/components/wxParseAudio.vue deleted file mode 100644 index b277717..0000000 --- a/components/u-parse/components/wxParseAudio.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseImg.vue b/components/u-parse/components/wxParseImg.vue deleted file mode 100644 index de9978b..0000000 --- a/components/u-parse/components/wxParseImg.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTable.vue b/components/u-parse/components/wxParseTable.vue deleted file mode 100644 index e1e25bf..0000000 --- a/components/u-parse/components/wxParseTable.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - \ No newline at end of file diff --git a/components/u-parse/components/wxParseTemplate0.vue b/components/u-parse/components/wxParseTemplate0.vue deleted file mode 100644 index 01bf8e1..0000000 --- a/components/u-parse/components/wxParseTemplate0.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate1.vue b/components/u-parse/components/wxParseTemplate1.vue deleted file mode 100644 index 7054e35..0000000 --- a/components/u-parse/components/wxParseTemplate1.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate10.vue b/components/u-parse/components/wxParseTemplate10.vue deleted file mode 100644 index 11c252c..0000000 --- a/components/u-parse/components/wxParseTemplate10.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate11.vue b/components/u-parse/components/wxParseTemplate11.vue deleted file mode 100644 index 0d04e53..0000000 --- a/components/u-parse/components/wxParseTemplate11.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate2.vue b/components/u-parse/components/wxParseTemplate2.vue deleted file mode 100644 index f06782a..0000000 --- a/components/u-parse/components/wxParseTemplate2.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate3.vue b/components/u-parse/components/wxParseTemplate3.vue deleted file mode 100644 index b0943f8..0000000 --- a/components/u-parse/components/wxParseTemplate3.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate4.vue b/components/u-parse/components/wxParseTemplate4.vue deleted file mode 100644 index 8a43756..0000000 --- a/components/u-parse/components/wxParseTemplate4.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate5.vue b/components/u-parse/components/wxParseTemplate5.vue deleted file mode 100644 index 0c0993e..0000000 --- a/components/u-parse/components/wxParseTemplate5.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate6.vue b/components/u-parse/components/wxParseTemplate6.vue deleted file mode 100644 index 0dca28a..0000000 --- a/components/u-parse/components/wxParseTemplate6.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate7.vue b/components/u-parse/components/wxParseTemplate7.vue deleted file mode 100644 index b62acaf..0000000 --- a/components/u-parse/components/wxParseTemplate7.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate8.vue b/components/u-parse/components/wxParseTemplate8.vue deleted file mode 100644 index f6fa037..0000000 --- a/components/u-parse/components/wxParseTemplate8.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseTemplate9.vue b/components/u-parse/components/wxParseTemplate9.vue deleted file mode 100644 index 47ac81a..0000000 --- a/components/u-parse/components/wxParseTemplate9.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/components/u-parse/components/wxParseVideo.vue b/components/u-parse/components/wxParseVideo.vue deleted file mode 100644 index 7d05285..0000000 --- a/components/u-parse/components/wxParseVideo.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/components/u-parse/libs/html2json.js b/components/u-parse/libs/html2json.js deleted file mode 100644 index 0927382..0000000 --- a/components/u-parse/libs/html2json.js +++ /dev/null @@ -1,261 +0,0 @@ -/** - * html2Json 改造来自: https://github.com/Jxck/html2json - * - * - * author: Di (微信小程序开发工程师) - * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) - * 垂直微信小程序开发交流社区 - * - * github地址: https://github.com/icindy/wxParse - * - * for: 微信小程序富文本解析 - * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 - */ - -import wxDiscode from './wxDiscode'; -import HTMLParser from './htmlparser'; - -function makeMap(str) { - const obj = {}; - const items = str.split(','); - for (let i = 0; i < items.length; i += 1) obj[items[i]] = true; - return obj; -} - -// Block Elements - HTML 5 -const block = makeMap('br,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video'); - -// Inline Elements - HTML 5 -const inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'); - -// Elements that you can, intentionally, leave open -// (and which close themselves) -const closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); - -function removeDOCTYPE(html) { - const isDocument = /([^]*)<\/body>/.test(html); - return isDocument ? RegExp.$1 : html; -} - -function trimHtml(html) { - return html - .replace(//gi, '') - .replace(/\/\*.*?\*\//gi, '') - .replace(/[ ]+/gi, '') - .replace(//gi, ''); -} - -function getScreenInfo() { - const screen = {}; - wx.getSystemInfo({ - success: (res) => { - screen.width = res.windowWidth; - screen.height = res.windowHeight; - }, - }); - return screen; -} - -function html2json(html, customHandler, imageProp, host) { - // 处理字符串 - html = removeDOCTYPE(html); - html = trimHtml(html); - html = wxDiscode.strDiscode(html); - // 生成node节点 - const bufArray = []; - const results = { - nodes: [], - imageUrls: [], - }; - - const screen = getScreenInfo(); - function Node(tag) { - this.node = 'element'; - this.tag = tag; - - this.$screen = screen; - } - - HTMLParser(html, { - start(tag, attrs, unary) { - // node for this element - const node = new Node(tag); - - if (bufArray.length !== 0) { - const parent = bufArray[0]; - if (parent.nodes === undefined) { - parent.nodes = []; - } - } - - if (block[tag]) { - node.tagType = 'block'; - } else if (inline[tag]) { - node.tagType = 'inline'; - } else if (closeSelf[tag]) { - node.tagType = 'closeSelf'; - } - - node.attr = attrs.reduce((pre, attr) => { - const { name } = attr; - let { value } = attr; - if (name === 'class') { - node.classStr = value; - } - // has multi attibutes - // make it array of attribute - if (name === 'style') { - node.styleStr = value; - } - if (value.match(/ /)) { - value = value.split(' '); - } - - // if attr already exists - // merge it - if (pre[name]) { - if (Array.isArray(pre[name])) { - // already array, push to last - pre[name].push(value); - } else { - // single value, make it array - pre[name] = [pre[name], value]; - } - } else { - // not exist, put it - pre[name] = value; - } - - return pre; - }, {}); - - // 优化样式相关属性 - if (node.classStr) { - node.classStr += ` ${node.tag}`; - } else { - node.classStr = node.tag; - } - if (node.tagType === 'inline') { - node.classStr += ' inline'; - } - - // 对img添加额外数据 - if (node.tag === 'img') { - let imgUrl = node.attr.src; - imgUrl = wxDiscode.urlToHttpUrl(imgUrl, imageProp.domain); - Object.assign(node.attr, imageProp, { - src: imgUrl || '', - }); - if (imgUrl) { - results.imageUrls.push(imgUrl); - } - } - - // 处理a标签属性 - if (node.tag === 'a') { - node.attr.href = node.attr.href || ''; - } - - // 处理font标签样式属性 - if (node.tag === 'font') { - const fontSize = [ - 'x-small', - 'small', - 'medium', - 'large', - 'x-large', - 'xx-large', - '-webkit-xxx-large', - ]; - const styleAttrs = { - color: 'color', - face: 'font-family', - size: 'font-size', - }; - if (!node.styleStr) node.styleStr = ''; - Object.keys(styleAttrs).forEach((key) => { - if (node.attr[key]) { - const value = key === 'size' ? fontSize[node.attr[key] - 1] : node.attr[key]; - node.styleStr += `${styleAttrs[key]}: ${value};`; - } - }); - } - - // 临时记录source资源 - if (node.tag === 'source') { - results.source = node.attr.src; - } - - if (customHandler.start) { - customHandler.start(node, results); - } - - if (unary) { - // if this tag doesn't have end tag - // like - // add to parents - const parent = bufArray[0] || results; - if (parent.nodes === undefined) { - parent.nodes = []; - } - parent.nodes.push(node); - } else { - bufArray.unshift(node); - } - }, - end(tag) { - // merge into parent tag - const node = bufArray.shift(); - if (node.tag !== tag) { - console.error('invalid state: mismatch end tag'); - } - - // 当有缓存source资源时于于video补上src资源 - if (node.tag === 'video' && results.source) { - node.attr.src = results.source; - delete results.source; - } - - if (customHandler.end) { - customHandler.end(node, results); - } - - if (bufArray.length === 0) { - results.nodes.push(node); - } else { - const parent = bufArray[0]; - if (!parent.nodes) { - parent.nodes = []; - } - parent.nodes.push(node); - } - }, - chars(text) { - if (!text.trim()) return; - - const node = { - node: 'text', - text, - }; - - if (customHandler.chars) { - customHandler.chars(node, results); - } - - if (bufArray.length === 0) { - results.nodes.push(node); - } else { - const parent = bufArray[0]; - if (parent.nodes === undefined) { - parent.nodes = []; - } - parent.nodes.push(node); - } - }, - }); - - return results; -} - -export default html2json; diff --git a/components/u-parse/libs/htmlparser.js b/components/u-parse/libs/htmlparser.js deleted file mode 100644 index 2939da3..0000000 --- a/components/u-parse/libs/htmlparser.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * - * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser - * - * author: Di (微信小程序开发工程师) - * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) - * 垂直微信小程序开发交流社区 - * - * github地址: https://github.com/icindy/wxParse - * - * for: 微信小程序富文本解析 - * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 - */ -// Regular Expressions for parsing tags and attributes - -const startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z0-9_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/; -const endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/; -const attr = /([a-zA-Z0-9_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; - -function makeMap(str) { - const obj = {}; - const items = str.split(','); - for (let i = 0; i < items.length; i += 1) obj[items[i]] = true; - return obj; -} - -// Empty Elements - HTML 5 -const empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr'); - -// Block Elements - HTML 5 -const block = makeMap('address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video'); - -// Inline Elements - HTML 5 -const inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'); - -// Elements that you can, intentionally, leave open -// (and which close themselves) -const closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); - -// Attributes that have their values filled in disabled="disabled" -const fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'); - -function HTMLParser(html, handler) { - let index; - let chars; - let match; - let last = html; - const stack = []; - - stack.last = () => stack[stack.length - 1]; - - function parseEndTag(tag, tagName) { - // If no tag name is provided, clean shop - let pos; - if (!tagName) { - pos = 0; - } else { - // Find the closest opened tag of the same type - tagName = tagName.toLowerCase(); - for (pos = stack.length - 1; pos >= 0; pos -= 1) { - if (stack[pos] === tagName) break; - } - } - if (pos >= 0) { - // Close all the open elements, up the stack - for (let i = stack.length - 1; i >= pos; i -= 1) { - if (handler.end) handler.end(stack[i]); - } - - // Remove the open elements from the stack - stack.length = pos; - } - } - - function parseStartTag(tag, tagName, rest, unary) { - tagName = tagName.toLowerCase(); - - if (block[tagName]) { - while (stack.last() && inline[stack.last()]) { - parseEndTag('', stack.last()); - } - } - - if (closeSelf[tagName] && stack.last() === tagName) { - parseEndTag('', tagName); - } - - unary = empty[tagName] || !!unary; - - if (!unary) stack.push(tagName); - - if (handler.start) { - const attrs = []; - - rest.replace(attr, function genAttr(matches, name) { - const value = arguments[2] || arguments[3] || arguments[4] || (fillAttrs[name] ? name : ''); - - attrs.push({ - name, - value, - escaped: value.replace(/(^|[^\\])"/g, '$1\\"'), // " - }); - }); - - if (handler.start) { - handler.start(tagName, attrs, unary); - } - } - } - - while (html) { - chars = true; - - if (html.indexOf(' '); -// str = str.replace(/ | | /g, ' '); -// str = str.replace(/"|"|"/g, "\""); -// str = str.replace(/'|'|'/g, "'"); -// str = str.replace(/´|´|´/g, "´"); -// str = str.replace(/×|×|×/g, "×"); -// str = str.replace(/÷|÷|÷/g, "÷"); -// str = str.replace(/&|&|&/g, '&'); -// str = str.replace(/<|<|</g, '<'); -// str = str.replace(/>|>|>/g, '>'); - - - - -str = str.replace(/ | | /g, " "); -str = str.replace(/ | | /g, ''); -str = str.replace(/ | /g, ' '); -str = str.replace(/ | | /g, ''); -str = str.replace(/"|"|"/g, "\""); -str = str.replace(/"|'|'/g, "'"); -str = str.replace(/´|´|´/g, "´"); -str = str.replace(/×|×|×/g, "×"); -str = str.replace(/÷|÷|÷/g, "÷"); -str = str.replace(/&|&|&/g, '&'); -str = str.replace(/<|<|</g, '<'); -str = str.replace(/>|>|>/g, '>'); -return str; -} - -// HTML 支持的其他实体 -function strOtherDiscode(str) { -str = str.replace(/Œ|Œ|Œ/g, 'Œ'); -str = str.replace(/œ|œ|œ/g, 'œ'); -str = str.replace(/Š|Š|Š/g, 'Š'); -str = str.replace(/š|š|š/g, 'š'); -str = str.replace(/Ÿ|Ÿ|Ÿ/g, 'Ÿ'); -str = str.replace(/ƒ|ƒ|ƒ/g, 'ƒ'); -str = str.replace(/ˆ|ˆ|ˆ/g, 'ˆ'); -str = str.replace(/˜|˜|˜/g, '˜'); -str = str.replace(/ |$#8201;| /g, ''); -str = str.replace(/‌|‌|‌/g, ''); -str = str.replace(/‍|$#8205;|‍/g, ''); -str = str.replace(/‎|$#8206;|‎/g, ''); -str = str.replace(/‏|‏|‏/g, ''); -str = str.replace(/–|–|–/g, '–'); -str = str.replace(/—|—|—/g, '—'); -str = str.replace(/‘|‘|‘/g, '‘'); -str = str.replace(/’|’|’/g, '’'); -str = str.replace(/‚|‚|‚/g, '‚'); -str = str.replace(/“|“|“/g, '“'); -str = str.replace(/”|”|”/g, '”'); -str = str.replace(/„|„|„/g, '„'); -str = str.replace(/†|†|†/g, '†'); -str = str.replace(/‡|‡|‡/g, '‡'); -str = str.replace(/•|•|•/g, '•'); -str = str.replace(/…|…|…/g, '…'); -str = str.replace(/‰|‰|‰/g, '‰'); -str = str.replace(/′|′|′/g, '′'); -str = str.replace(/″|″|″/g, '″'); -str = str.replace(/‹|‹|‹/g, '‹'); -str = str.replace(/›|›|›/g, '›'); -str = str.replace(/‾|‾|‾/g, '‾'); -str = str.replace(/€|€|€/g, '€'); -str = str.replace(/™|™|™/g, '™'); -str = str.replace(/←|←|←/g, '←'); -str = str.replace(/↑|↑|↑/g, '↑'); -str = str.replace(/→|→|→/g, '→'); -str = str.replace(/↓|↓|↓/g, '↓'); -str = str.replace(/↔|↔|↔/g, '↔'); -str = str.replace(/↵|↵|↵/g, '↵'); -str = str.replace(/⌈|⌈|⌈/g, '⌈'); -str = str.replace(/⌉|⌉|⌉/g, '⌉'); -str = str.replace(/⌊|⌊|⌊/g, '⌊'); -str = str.replace(/⌋|⌋|⌋/g, '⌋'); -str = str.replace(/◊|◊|◊/g, '◊'); -str = str.replace(/♠|♠|♠/g, '♠'); -str = str.replace(/♣|♣|♣/g, '♣'); -str = str.replace(/♥|♥|♥/g, '♥'); -str = str.replace(/♦|♦|♦/g, '♦'); -return str; -} - -function strDiscode(str) { - str = strNumDiscode(str); - str = strGreeceDiscode(str); - str = strcharacterDiscode(str); - str = strOtherDiscode(str); - return str; -} - -function urlToHttpUrl(url, domain) { - if (/^\/\//.test(url)) { - return `https:${url}`; - } else if (/^\//.test(url)) { - return `https://${domain}${url}`; - } - return url; -} - -export default { - strDiscode, - urlToHttpUrl, -}; diff --git a/components/u-parse/parse.css b/components/u-parse/parse.css deleted file mode 100644 index 49c789c..0000000 --- a/components/u-parse/parse.css +++ /dev/null @@ -1,258 +0,0 @@ -/** - * author: Di (微信小程序开发工程师) - * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) - * 垂直微信小程序开发交流社区 - * - * github地址: https://github.com/icindy/wxParse - * - * for: 微信小程序富文本解析 - * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 - */ -/** - * 请在全局下引入该文件,@import '/static/wxParse.css'; - */ -.wxParse { - user-select:none; - width: 100%; - font-family: Helvetica, "PingFangSC", 'Microsoft Yahei', '微软雅黑', Arial, sans-serif; - color: #333; - line-height: 1.5; - font-size: 14px; - text-align:justify;/* //左右两端对齐 */ -} -.wxParse view ,.wxParse uni-view{ - word-break: break-word; -} -.wxParse .p { - padding-bottom: 0.5em; - clear: both; - /* letter-spacing: 0;//字间距 */ -} -.wxParse .inline { - display: inline; - margin: 0; - padding: 0; -} - -.wxParse .div { - margin: 0; - padding: 0; - display: block; -} - -.wxParse .h1{ - font-size: 2em; - line-height: 1.2em; - margin: 0.67em 0; -} -.wxParse .h2{ - font-size: 1.5em; - margin: 0.83em 0; -} -.wxParse .h3{ - font-size: 1.17em; - margin: 1em 0; -} -.wxParse .h4{ - margin: 1.33em 0; -} -.wxParse .h5{ - font-size: 0.83em; - margin: 1.67em 0; -} -.wxParse .h6{ - font-size: 0.83em; - margin: 1.67em 0; -} - -.wxParse .h1, -.wxParse .h2, -.wxParse .h3, -.wxParse .h4, -.wxParse .h5, -.wxParse .h6, -.wxParse .b, -.wxParse .strong{ - font-weight: bolder; -} - -.wxParse .i, -.wxParse .cite, -.wxParse .em, -.wxParse .var, -.wxParse .address { - font-style: italic; -} -.wxParse .spaceshow{ - white-space: pre; -} -.wxParse .pre, -.wxParse .tt, -.wxParse .code, -.wxParse .kbd, -.wxParse .samp { - font-family: monospace; -} -.wxParse .pre { - overflow: auto; - background: #f5f5f5; - padding: 16upx; - white-space: pre; - margin: 1em 0upx; - font-size: 24upx; -} -.wxParse .code { - overflow: auto; - padding: 16upx; - white-space: pre; - margin: 1em 0upx; - background: #f5f5f5; - font-size: 24upx; -} - -.wxParse .big { - font-size: 1.17em; -} - -.wxParse .small, -.wxParse .sub, -.wxParse .sup { - font-size: 0.83em; -} - -.wxParse .sub { - vertical-align: sub; -} -.wxParse .sup { - vertical-align: super; -} - -.wxParse .s, -.wxParse .strike, -.wxParse .del { - text-decoration: line-through; -} - -.wxParse .strong, -.wxParse .text, -.wxParse .span, -.wxParse .s { - display: inline; -} - -.wxParse .a { - color: deepskyblue; -} - -.wxParse .video { - text-align: center; - margin: 22upx 0; -} - -.wxParse .video-video { - width: 100%; -} -.wxParse .uni-image{ - max-width: 100%; -} -.wxParse .img { - display: block; - max-width: 100%; - margin-bottom: 0em;/* //与p标签底部padding同时修改 */ - overflow: hidden; -} - -.wxParse .blockquote { - margin: 10upx 0; - padding: 22upx 0 22upx 22upx; - font-family: Courier, Calibri, "宋体"; - background: #f5f5f5; - border-left: 6upx solid #dbdbdb; -} -.wxParse .blockquote .p { - margin: 0; -} -.wxParse .ul, .wxParse .ol { - display: block; - margin: 1em 0; - padding-left: 2em; -} -.wxParse .ol { - list-style-type: disc; -} -.wxParse .ol { - list-style-type: decimal; -} -.wxParse .ol>weixin-parse-template,.wxParse .ul>weixin-parse-template { - display: list-item; - align-items: baseline; - text-align: match-parent; -} - -.wxParse .ol>.li,.wxParse .ul>.li { - display: list-item; - align-items: baseline; - text-align: match-parent; -} -.wxParse .ul .ul, .wxParse .ol .ul { - list-style-type: circle; -} -.wxParse .ol .ol .ul, .wxParse .ol .ul .ul, .wxParse .ul .ol .ul, .wxParse .ul .ul .ul { - list-style-type: square; -} - -.wxParse .u { - text-decoration: underline; -} -.wxParse .hide { - display: none; -} -.wxParse .del { - display: inline; -} -.wxParse .figure { - overflow: hidden; -} -.wxParse .tablebox{ - overflow: auto; - background-color: #f5f5f5; - background: #f5f5f5; - font-size: 13px; - padding: 8px; -} -.wxParse .table .table,.wxParse .table{ - border-collapse:collapse; - box-sizing: border-box; - /* 内边框 */ - /* width: 100%; */ - overflow: auto; - white-space: pre; -} -.wxParse .tbody{ - border-collapse:collapse; - box-sizing: border-box; - /* 内边框 */ - border: 1px solid #dadada; -} -.wxParse .table .thead, .wxParse .table .tfoot, .wxParse .table .th{ - border-collapse:collapse; - box-sizing: border-box; - background: #ececec; - font-weight: 40; -} -.wxParse .table .tr { - border-collapse:collapse; - box-sizing: border-box; - /* border: 2px solid #F0AD4E; */ - overflow:auto; -} -.wxParse .table .th, -.wxParse .table .td{ - border-collapse:collapse; - box-sizing: border-box; - border: 2upx solid #dadada; - overflow:auto; -} -.wxParse .audio, .wxParse .uni-audio-default{ - display: block; -} \ No newline at end of file diff --git a/components/u-parse/parse.vue b/components/u-parse/parse.vue deleted file mode 100644 index f255166..0000000 --- a/components/u-parse/parse.vue +++ /dev/null @@ -1,228 +0,0 @@ - - - - - diff --git a/main.js b/main.js index 7c03a73..013f8b2 100644 --- a/main.js +++ b/main.js @@ -6,9 +6,15 @@ import request from './js_sdk/request.js'; Vue.config.productionTip = false Vue.prototype.request = request -openApp(); +//openApp(); App.mpType = 'app' +import nullComponents from '@/components/null/null.vue' +Vue.component('cell',nullComponents); +Vue.component('refresh',nullComponents); +Vue.component('refreshBox',nullComponents); + + const app = new Vue({ ...App, store diff --git a/manifest.json b/manifest.json index cab672e..f0b4b48 100644 --- a/manifest.json +++ b/manifest.json @@ -107,11 +107,13 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "", + "appid" : "wx07597007230e3702", "setting" : { - "urlCheck" : false + "urlCheck" : false, + "es6" : false }, "usingComponents" : true + // "betterScopedSlots" : true }, "mp-alipay" : { "usingComponents" : true diff --git a/pages.json b/pages.json index 6a04647..82b2fcd 100644 --- a/pages.json +++ b/pages.json @@ -1,11 +1,33 @@ { - "pages": [{ + "pages": [ + { "path": "pages/list/list", - "style": { - //#ifndef MP - "navigationStyle": "custom", - //#endif - "enablePullDownRefresh": true + "style": { + // #ifdef APP-NVUE + "enablePullDownRefresh": false, + // #endif + // #ifdef H5 + "navigationStyle":"custom", + // #endif + "app-plus":{ + // #ifdef APP-PLUS + "titleNView":{ /*排除了H5*/ + "searchInput":{ + "placeholder":"请输入搜索的内容", + "backgroundColor":"#efefef", + "disabled":true, + "borderRadius":"30px" + } + } + // #endif + } + } + }, + { + "path": "pages/test/test", + "style": { + "navigationBarTitleText": "测试页面", + "enablePullDownRefresh": false } }, { @@ -165,14 +187,7 @@ "navigationBarTitleText": "" } - }, { - "path": "pages/test/test", - "style": { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - }, { + },{ "path": "pages/common/webview/webview", "style": { "navigationBarTitleText": "", @@ -199,7 +214,8 @@ "navigationBarTextStyle": "black", "navigationBarTitleText": "base-app", "navigationBarBackgroundColor": "#FFFFFF", - "backgroundColor": "#F8F8F8" + "backgroundColor": "#F8F8F8", + "enablePullDownRefresh": false }, "condition": { "list": [{ diff --git a/pages/grid/grid.vue b/pages/grid/grid.vue index 8e59303..1a671a1 100644 --- a/pages/grid/grid.vue +++ b/pages/grid/grid.vue @@ -201,17 +201,6 @@ diff --git a/pages/list/detail.vue b/pages/list/detail.vue index f0b12e4..b622c24 100644 --- a/pages/list/detail.vue +++ b/pages/list/detail.vue @@ -6,25 +6,25 @@ unicloud-db 组件文档:https://uniapp.dcloud.net.cn/uniCloud/unicloud-db-component DB Schema 规范:https://uniapp.dcloud.net.cn/uniCloud/schema --> - - - - + + + + {{ title }} + foreignKey="opendb-news-articles.user_id" @load="loadData"> @@ -50,24 +49,22 @@ - diff --git a/pages/list/search/search.nvue b/pages/list/search/search.nvue index 1f59a0c..f150313 100644 --- a/pages/list/search/search.nvue +++ b/pages/list/search/search.nvue @@ -296,8 +296,8 @@ }, loadList(text = '') { getApp().globalData.searchText = text; - uni.navigateTo({ - url:'/pages/list/news-list' + uni.switchTab({ + url:'/pages/list/list' }) }, backPage(){ diff --git a/pages/test/test.vue b/pages/test/test copy.vue similarity index 100% rename from pages/test/test.vue rename to pages/test/test copy.vue diff --git a/pages/test/test.nvue b/pages/test/test.nvue new file mode 100644 index 0000000..8e80ba0 --- /dev/null +++ b/pages/test/test.nvue @@ -0,0 +1,32 @@ + + + + + diff --git a/pages/ucenter/settings/settings.vue b/pages/ucenter/settings/settings.vue index 553b37e..01591bf 100644 --- a/pages/ucenter/settings/settings.vue +++ b/pages/ucenter/settings/settings.vue @@ -1,14 +1,21 @@