mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2025-05-23 03:50:14 +09:00
1. 优化密码访问,实现联动插件动态启用关闭;
2. 文章海报分享支持动态小程序码; 3. 支持扫描文章海报跳转指定文章详情;
This commit is contained in:
parent
ff31e0d8e8
commit
52d4b7927b
@ -200,5 +200,17 @@ export default {
|
|||||||
*/
|
*/
|
||||||
submitLink(form) {
|
submitLink(form) {
|
||||||
return HttpHandler.Post(`/apis/linksSubmit.muyin.site/v1alpha1/submit`, form, null)
|
return HttpHandler.Post(`/apis/linksSubmit.muyin.site/v1alpha1/submit`, form, null)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取二维码信息
|
||||||
|
*/
|
||||||
|
getQRCodeInfo: (key) => {
|
||||||
|
return HttpHandler.Get(`/apis/api.uni.uhalo.pro/v1alpha1/plugins/plugin-uni-halo/getQRCodeInfo/${key}`, null,)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取二维码图片
|
||||||
|
*/
|
||||||
|
getQRCodeImg: (postId) => {
|
||||||
|
return HttpHandler.Get(`/apis/api.uni.uhalo.pro/v1alpha1/plugins/plugin-uni-halo/getQRCodeImg/${postId}`, null,)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,27 @@
|
|||||||
<script>
|
<script>
|
||||||
const homePagePath = '/pages/tabbar/home/home'
|
const homePagePath = '/pages/tabbar/home/home'
|
||||||
const startPagePath = '/pagesA/start/start'
|
const startPagePath = '/pagesA/start/start'
|
||||||
|
const articleDetailPath = '/pagesA/article-detail/article-detail';
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
configs() {
|
configs() {
|
||||||
return this.$tm.vx.getters().getConfigs;
|
return this.$tm.vx.getters().getConfigs;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad: function (options) {
|
||||||
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
|
uni.$tm.vx.actions('config/fetchConfigs').then(async (res) => {
|
||||||
|
if (options.scene) {
|
||||||
|
if ('' !== options.scene) {
|
||||||
|
const postId = await this.getPostIdByQRCode(options.scene);
|
||||||
|
if (postId) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: articleDetailPath + `?name=${postId}`,
|
||||||
|
animationType: 'slide-in-right'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
// uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
||||||
// #endif
|
// #endif
|
||||||
@ -51,6 +64,15 @@ export default {
|
|||||||
url: startPagePath
|
url: startPagePath
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async getPostIdByQRCode(key) {
|
||||||
|
const response = await this.$httpApi.v2.getQRCodeInfo(key);
|
||||||
|
if (response) {
|
||||||
|
if(response && response.postId) {
|
||||||
|
return response.postId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -232,6 +232,7 @@ import commentModal from '@/components/comment-modal/comment-modal.vue';
|
|||||||
|
|
||||||
import rCanvas from '@/components/r-canvas/r-canvas.vue';
|
import rCanvas from '@/components/r-canvas/r-canvas.vue';
|
||||||
import barrage from '@/components/barrage/barrage.vue';
|
import barrage from '@/components/barrage/barrage.vue';
|
||||||
|
import {getAppConfigs} from '@/config/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -358,7 +359,9 @@ export default {
|
|||||||
}
|
}
|
||||||
const visitFlag = uni.getStorageSync('visit_' + this.result?.metadata?.name);
|
const visitFlag = uni.getStorageSync('visit_' + this.result?.metadata?.name);
|
||||||
|
|
||||||
if (!visitFlag) {
|
const toolsPluginEnabled = getAppConfigs().pluginConfig.toolsPlugin?.enabled;
|
||||||
|
|
||||||
|
if (toolsPluginEnabled && !visitFlag) {
|
||||||
const annotationsMap = res?.metadata?.annotations;
|
const annotationsMap = res?.metadata?.annotations;
|
||||||
if (('restrictReadEnable' in annotationsMap) && annotationsMap.restrictReadEnable ===
|
if (('restrictReadEnable' in annotationsMap) && annotationsMap.restrictReadEnable ===
|
||||||
'true') {
|
'true') {
|
||||||
@ -631,9 +634,10 @@ export default {
|
|||||||
|
|
||||||
this.drawDashedLine(this.$refs.rCanvas.ctx, 14, 356, 332, 0.5, [8, 5, 5, 5], '#999');
|
this.drawDashedLine(this.$refs.rCanvas.ctx, 14, 356, 332, 0.5, [8, 5, 5, 5], '#999');
|
||||||
// 小程序信息
|
// 小程序信息
|
||||||
|
const _qrCodeImageUrl = await this.qrCodeImageUrl();
|
||||||
await this.$refs.rCanvas
|
await this.$refs.rCanvas
|
||||||
.drawImage({
|
.drawImage({
|
||||||
url: this.$utils.checkImageUrl(this.haloConfigs?.appConfig?.appInfo?.qrCodeImageUrl),
|
url: this.$utils.checkImageUrl(_qrCodeImageUrl),
|
||||||
x: 20,
|
x: 20,
|
||||||
y: 360,
|
y: 360,
|
||||||
w: 80,
|
w: 80,
|
||||||
@ -924,6 +928,16 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async qrCodeImageUrl() {
|
||||||
|
const useDynamicQRCode = this.haloConfigs?.appConfig?.appInfo?.useDynamicQRCode;
|
||||||
|
if (useDynamicQRCode) {
|
||||||
|
const qrCodeImg = await this.$httpApi.v2.getQRCodeImg(this.result.metadata.name);
|
||||||
|
return qrCodeImg;
|
||||||
|
} else {
|
||||||
|
return this.haloConfigs?.appConfig?.appInfo?.qrCodeImageUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user