diff --git a/README.md b/README.md index d89cea0..cc7ffa6 100644 Binary files a/README.md and b/README.md differ diff --git a/components/cu-editor/cu-editor.vue b/components/cu-editor/cu-editor.vue index 66fe963..8106e80 100644 --- a/components/cu-editor/cu-editor.vue +++ b/components/cu-editor/cu-editor.vue @@ -564,7 +564,7 @@ export default { templateConfig: [ { value: 0, - src: "https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/temp.jpg?expire_at=1741101642&er_sign=9c89032edb940439a476e2ca0ff1e0ba", + src: "/static/template/default.png", checked: true, }, ], @@ -1040,33 +1040,59 @@ export default { } }, // 去预览 + // 预览页(pages2/editCms/preview)读取的是 storage 里的 "cms" 对象, + // 因此这里必须写入同一份结构,否则预览是空白页。 toPreview() { - // uni.navigateTo({ - // url: "/pages/preview/preview", - // }); + const musicSrc = (this.musicConfig && this.musicConfig.src) || ''; + const templateSrc = this.templateConfig[this.currentTemplate] + ? this.templateConfig[this.currentTemplate].src + : ''; + + const finish = (html) => { + const cms = uni.getStorageSync("cms") || {}; + uni.setStorageSync("cms", { + ...cms, + music_url_id: musicSrc ? { src: musicSrc } : cms.music_url_id, + temptele_src: templateSrc, + cmsLst: [{ type: "text", html, text: "", delta: {} }], + }); + uni.navigateTo({ url: "/pages2/editCms/preview" }); + }; + + // 有音乐才需要落盘,没配音乐时直接进预览 + if (!musicSrc) { + this.editorCtx.getContents({ + success: (res) => finish(handleHtmlImage(res.html, true)), + fail: () => finish(""), + }); + return; + } + uni.getFileSystemManager().saveFile({ - tempFilePath: this.musicConfig.src, + tempFilePath: musicSrc, success: (saveRes) => { const savedFilePath = saveRes.savedFilePath; // 获取持久化存储的路径 - uni.setStorageSync("musicSrc", savedFilePath); - uni.setStorageSync( - "templateSrc", - this.templateConfig[this.currentTemplate].src - ); this.editorCtx.getContents({ success: (res) => { - console.log(res); - uni.setStorageSync("html", handleHtmlImage(res.html, true)); - }, - complete: (res) => { - uni.navigateTo({ - url: "/pages/preview/preview", + const cms = uni.getStorageSync("cms") || {}; + uni.setStorageSync("cms", { + ...cms, + music_url_id: { src: savedFilePath }, + temptele_src: templateSrc, + cmsLst: [{ type: "text", html: handleHtmlImage(res.html, true), text: "", delta: {} }], }); }, + complete: () => { + uni.navigateTo({ url: "/pages2/editCms/preview" }); + }, }); }, fail: (e) => { - console.log(e); + console.error('音乐文件保存失败,跳过音乐直接预览:', e); + this.editorCtx.getContents({ + success: (res) => finish(handleHtmlImage(res.html, true)), + fail: () => finish(""), + }); }, }); }, diff --git a/components/qk/qk-send-sms-code/qk-send-sms-code.vue b/components/qk/qk-send-sms-code/qk-send-sms-code.vue index 385d707..249e5ea 100644 --- a/components/qk/qk-send-sms-code/qk-send-sms-code.vue +++ b/components/qk/qk-send-sms-code/qk-send-sms-code.vue @@ -44,6 +44,24 @@ default(){ return 'login' } + }, + /** + * uni-id 短信场景,取值 login-by-sms / reset-pwd-by-sms / bind-mobile-by-sms / set-pwd-by-sms + */ + scene:{ + type: String, + default(){ + return 'login-by-sms' + } + }, + /** + * 图形验证码;服务端要求图形验证码校验时必传 + */ + captcha:{ + type: String, + default(){ + return '' + } } }, data() { @@ -68,32 +86,34 @@ this.sendMsg(); }) }, - sendMsg() { + async sendMsg() { let reg_phone = /^1\d{10}$/; if(!reg_phone.test(this.phone))return uni.showToast({ title: '手机号格式错误', icon: 'none' }); - uniCloud.callFunction({ - name:'uni-id-cf', - data:{ - action:'sendSmsCode', - params:{ - "mobile": this.phone, - "type": this.codeType - }, - }, - success: ({result}) => { - console.log(result); - uni.showToast({ - title: "短信验证码发送成功", - icon: 'none' - }); - this.reverseNumber = Number(this.count); - this.getCode(); - this.$emit('getCode'); - } - }) + try { + const uniIdCo = uniCloud.importObject('uni-id-co') + // scene 用 uni-id 的短信场景常量,与 codeType(login/register/bind)区分开 + await uniIdCo.sendSmsCode({ + mobile: String(this.phone), + scene: this.scene, + captcha: this.captcha + }); + uni.showToast({ + title: "短信验证码发送成功", + icon: 'none' + }); + this.reverseNumber = Number(this.count); + this.getCode(); + this.$emit('getCode'); + } catch (e) { + console.error('短信验证码发送失败:', e); + uni.showToast({ + title: e.errMsg || '发送失败,请稍后重试', + icon: 'none' + }); + } }, getCode() { if (this.reverseNumber == 0) { diff --git a/pages/articleContentDetail/articleContentDetail.vue b/pages/articleContentDetail/articleContentDetail.vue index 27234fb..8db2034 100644 --- a/pages/articleContentDetail/articleContentDetail.vue +++ b/pages/articleContentDetail/articleContentDetail.vue @@ -33,7 +33,7 @@ 住在大城市里,"军民鱼水情"只是句日常的用语,并没有真正切实的体会。 1952年的冬天,我团接到上级命令,前往朝鲜战场。这兴奋劲像个麻雀,跳跃不停。经过战前培训,我们坐着向北驰去的列车。一路上歌声不断,当列车到达山东济南时,站台上摆着热气腾腾的饭菜,我们狼吞虎咽地吃着可口的饭菜,这比在列车上吃饼干要好百倍了。经过一天多的劳累,在大年除夕的那天,我们到达了安东。快速转移到一个街坊后,多数人都安排好了住所,可我们班还剩六名战士没法安排,连长还在为难。 @@ -43,7 +43,7 @@ 我们住进小屋,六个人挤在一张床上睡觉,可怎么都睡不着。平时说的"军民鱼水情",今天真的出现了吗?老乡说:"志愿军出国作战,到了安东,哪能汽车16团汽车修理工叫他们在野外露营?我俩到我娘那里住一张建群宿就行。"这几句朴实无华的话,真是"鱼水情"的真实体验。 @@ -92,71 +92,71 @@ @@ -176,7 +176,7 @@ setup() { const hbComment = ref(null) const avatar = ref("") - const templateSrc = ref("https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/bg.jpg?expire_at=1741101988&er_sign=c9732cddaaead925cf110d9a11751231") + const templateSrc = ref("/static/template/default.png") const commentData = ref(null) const reqFlag = ref(false) @@ -195,7 +195,7 @@ success: function(res) { if (res.confirm) { uni.redirectTo({ - url: '/pages/login/login' + url: '/pages3/uni_modules/uni-id-pages/pages/login/login-withoutpwd' }) } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 467b147..fc37a52 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,6 +1,10 @@ @@ -11,6 +15,7 @@ setup() { onLoad(() => { setTimeout(() => { + // 首页是 tabBar 页面,必须用 switchTab uni.switchTab({ url: "/uni_modules/uni-cms-article/pages/list/list" }) @@ -22,8 +27,41 @@ diff --git a/pages/test/test.vue b/pages/test/test.vue index 50be127..b2a5e5c 100644 --- a/pages/test/test.vue +++ b/pages/test/test.vue @@ -1,118 +1,147 @@ diff --git a/pages2/editCms/editCms.vue b/pages2/editCms/editCms.vue index dc4f410..a98a404 100644 --- a/pages2/editCms/editCms.vue +++ b/pages2/editCms/editCms.vue @@ -120,7 +120,7 @@ mode="scaleToFill" width="100rpx" height="100rpx" - src="https://qnycdn.mymoyu.top/static/icon/stop.png"> + src="/static/editor-icons/stop.png"> @@ -190,7 +190,7 @@ diff --git a/uni_modules/uni-cms-article/pages/list/slist.vue b/uni_modules/uni-cms-article/pages/list/slist.vue new file mode 100644 index 0000000..05aca87 --- /dev/null +++ b/uni_modules/uni-cms-article/pages/list/slist.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/uni_modules/uni-cms-article/pages/search/search.vue b/uni_modules/uni-cms-article/pages/search/search.vue new file mode 100644 index 0000000..0edc2f5 --- /dev/null +++ b/uni_modules/uni-cms-article/pages/search/search.vue @@ -0,0 +1,652 @@ + + + + + + + diff --git a/uni_modules/zetank-personalpage/pages/personalpage/personalpage.vue b/uni_modules/zetank-personalpage/pages/personalpage/personalpage.vue index f995b17..fbc534c 100644 --- a/uni_modules/zetank-personalpage/pages/personalpage/personalpage.vue +++ b/uni_modules/zetank-personalpage/pages/personalpage/personalpage.vue @@ -404,7 +404,9 @@ if (res.code === 200 ) { this.userinfo = res.data; this.gender = res.data.gender; - this.userinfo.city = res.data.last_login_ip; + // last_login_ip 属于隐私字段,公开资料接口已不再返回。 + // 个人主页不展示登录地点,留空即可。 + this.userinfo.city = ''; this.userinfo.nickname = res.data.nickname; this.userinfo.avatar_file = res.data.avatar_file; this.userinfo._id = res.data._id; @@ -564,12 +566,13 @@ this.data_clear(); }, async getHistoryList() { - return uniCloud.importObject("cms-articles-log").getHistoryList({ + // 云对象方法返回 Promise,必须先 await 才能取到 { code, data } + const res = await uniCloud.importObject("cms-articles-log").getHistoryList({ user_id: this.userinfo._id - }).data.data; + }); + return (res && res.data) || []; }, async getHistory() { - console.log(this.userinfo._id); return uniCloud.importObject("cms-articles-log").getHistory(this.userinfo._id); }, // 滚动事件 (需在up配置onScroll:true才生效)