修改:简单兼容QQ小程序(未测试)

This commit is contained in:
小莫唐尼 2023-05-14 11:08:20 +08:00
parent 9720743c80
commit 66f4ccffc0
10 changed files with 372 additions and 307 deletions

View File

@ -14,6 +14,10 @@
{
"launchtype" : "local"
},
"mp-qq" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"

View File

@ -18,7 +18,8 @@ export default {
apiAuthorization: '', // Api认证key [必填] Halo中-系统-博客设置-切换到高级选项-API设置-Access key
title: '', // 博客标题 [建议必填]:在某些页面没有设置具体的页面名称时候,使用该值显示
miniCodeImageUrl: '', // 小程序的太阳码/二维码的图片地址 [建议必填]:主要用于文章详情页面的生成海报的功能
miniCodeImageUrl: '', // 小程序的太阳码/二维码的图片地址 [建议必填]
aboutProfileImageUrl: '', // 关于页面中的资料卡背景图 [建议必填]
// 启动页面的配置(页面地址`/pagesA/start/start`
@ -80,8 +81,8 @@ export default {
list: [],
},
quickNav: { // 快捷导航配置
use: true,
quickNav: { // 快捷导航配置如不需要恋爱日记请注释或删除94-101行的代码
use: true, // 是否在个人中心显示以下页面的入口
list: [{
icon: 'halocoloricon-classify',
text: '文章归档',

View File

@ -1,31 +1,31 @@
{
"name" : "uni-halo",
"appid" : "__UNI__5748B6E",
"description" : "uni-halo博客基于halo开源博客系统API开发的多端博客。",
"versionName" : "1.0.0",
"versionCode" : 100,
"transformPx" : false,
"name": "uni-halo",
"appid": "__UNI__5748B6E",
"description": "uni-halo博客基于halo开源博客系统API开发的多端博客。",
"versionName": "1.0.0",
"versionCode": 100,
"transformPx": false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* */
"modules" : {
"OAuth" : {},
"Share" : {}
"modules": {
"OAuth": {},
"Share": {}
},
/* */
"distribute" : {
"distribute": {
/* android */
"android" : {
"permissions" : [
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
@ -46,117 +46,172 @@
]
},
/* ios */
"ios" : {
"dSYMs" : false,
"capabilities" : {
"entitlements" : {
"com.apple.developer.associated-domains" : [ "applinks:static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com" ]
"ios": {
"dSYMs": false,
"capabilities": {
"entitlements": {
"com.apple.developer.associated-domains": ["applinks:static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com"]
}
}
},
/* SDK */
"sdkConfigs" : {
"ad" : {
"gdt" : {},
"csj" : {},
"360" : {},
"ks" : {},
"sigmob" : {},
"hw" : {},
"bd" : {}
"sdkConfigs": {
"ad": {
"gdt": {},
"csj": {},
"360": {},
"ks": {},
"sigmob": {},
"hw": {},
"bd": {}
},
"oauth" : {
"weixin" : {
"appid" : "wxd971954762ec4744",
"UniversalLinks" : "https://static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com/uni-universallinks/__UNI__5748B6E/"
"oauth": {
"weixin": {
"appid": "wxd971954762ec4744",
"UniversalLinks": "https://static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com/uni-universallinks/__UNI__5748B6E/"
}
},
"share" : {
"weixin" : {
"appid" : "wxd971954762ec4744",
"UniversalLinks" : "https://static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com/uni-universallinks/__UNI__5748B6E/"
"share": {
"weixin": {
"appid": "wxd971954762ec4744",
"UniversalLinks": "https://static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com/uni-universallinks/__UNI__5748B6E/"
}
}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
"icons": {
"android": {
"hdpi": "unpackage/res/icons/72x72.png",
"xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi": "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
"ios": {
"appstore": "unpackage/res/icons/1024x1024.png",
"ipad": {
"app": "unpackage/res/icons/76x76.png",
"app@2x": "unpackage/res/icons/152x152.png",
"notification": "unpackage/res/icons/20x20.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x": "unpackage/res/icons/167x167.png",
"settings": "unpackage/res/icons/29x29.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
"iphone": {
"app@2x": "unpackage/res/icons/120x120.png",
"app@3x": "unpackage/res/icons/180x180.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x": "unpackage/res/icons/120x120.png"
}
}
}
},
"uniStatistics": {
"enable": true
}
},
/* */
"quickapp" : {},
"quickapp": {},
/* */
"mp-weixin" : {
"appid" : "wx1bb161867082c72f",
"setting" : {
"urlCheck" : false,
"minified" : true
"mp-weixin": {
"appid": "wx1bb161867082c72f",
"setting": {
"urlCheck": false,
"minified": true
},
"usingComponents" : true
"usingComponents": true,
"uniStatistics": {
"enable": true
}
},
"mp-alipay" : {
"usingComponents" : true
"mp-alipay": {
"usingComponents": true,
"uniStatistics": {
"enable": true
}
},
"mp-baidu" : {
"usingComponents" : true
"mp-baidu": {
"usingComponents": true,
"uniStatistics": {
"enable": true
}
},
"mp-toutiao" : {
"usingComponents" : true
"mp-toutiao": {
"usingComponents": true,
"uniStatistics": {
"enable": true
}
},
"uniStatistics" : {
"enable" : false
"uniStatistics": {
"enable": true,
"version": "2"
},
"vueVersion" : "2",
"h5" : {
"title" : "uni-halo",
"devServer" : {
"disableHostCheck" : true,
"proxy" : {
"/api" : {
"target" : "https://b.925i.cn",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"^/api" : ""
"vueVersion": "2",
"h5": {
"title": "uni-halo",
"devServer": {
"disableHostCheck": true,
"proxy": {
"/api": {
"target": "https://b.925i.cn",
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/api": "/api"
}
}
}
},
"optimization" : {
"preload" : true,
"treeShaking" : {
"enable" : true
}
"optimization": {
"preload": true,
"treeShaking": {
"enable": true
}
},
"_spaceID" : "699a26a5-a6cd-4b54-b603-5155b312a5f5"
"uniStatistics": {
"enable": true
}
},
"_spaceID": "699a26a5-a6cd-4b54-b603-5155b312a5f5",
"mp-qq": {
"appid": "1112285420",
"setting": {
"minified": true,
"postcss": true,
"es6": true
},
"uniStatistics": {
"enable": true
}
},
"mp-jd": {
"uniStatistics": {
"enable": true
}
},
"mp-kuaishou": {
"uniStatistics": {
"enable": true
}
},
"mp-lark": {
"uniStatistics": {
"enable": true
}
},
"quickapp-webview-huawei": {
"uniStatistics": {
"enable": true
}
},
"quickapp-webview-union": {
"uniStatistics": {
"enable": true
}
}
}

View File

@ -549,8 +549,8 @@
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"backgroundColor": "white",
"borderStyle": "white",
"backgroundColor": "#fff",
"borderStyle": "#fff",
"color": "#303133",
"selectedColor": "#03a9f4",
"list": [{

View File

@ -277,6 +277,10 @@ export default {
},
fnGetNavList() {
const systemInfo = uni.getSystemInfoSync();
let _isWx = false;
// #ifdef MP-WEIXIN
_isWx = true;
// #endif
this.navList = [
{
key: 'disclaimers',
@ -310,7 +314,7 @@ export default {
isAdmin: false,
type: 'page',
openType: 'contact',
show: true
show: _isWx
},
{
key: 'feedback',
@ -322,7 +326,7 @@ export default {
isAdmin: false,
type: 'page',
openType: 'feedback',
show: true
show: _isWx
},
{
key: 'about',

View File

@ -73,7 +73,10 @@
</view>
</view>
<!-- 广告区域 -->
<view v-if="haloAdConfig.articleDetail.use" class="ad-wrap ma-24 mb-0">
<view
v-if="haloAdConfig.articleDetail.use && (haloAdConfig.unitId || haloAdConfig.adpid)"
class="ad-wrap ma-24 mb-0"
>
<!-- #ifdef MP-WEIXIN -->
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
<!-- #endif -->
@ -101,7 +104,10 @@
/>
<!-- 广告区域微信/decloud申请 -->
<view v-if="haloAdConfig.articleDetail.use" class="ad-wrap mt-24 mb-24 ">
<view
v-if="haloAdConfig.articleDetail.use && (haloAdConfig.unitId || haloAdConfig.adpid)"
class="ad-wrap mt-24 mb-24 "
>
<!-- #ifdef MP-WEIXIN -->
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
<!-- #endif -->
@ -657,6 +663,7 @@ export default {
},
fnSavePoster() {
this.$refs.rCanvas.saveImage(this.poster.res.tempFilePath);
uni.$tm.toast('保存成功');
},
fnShareTo() {
// #ifdef MP-WEIXIN

View File

@ -3,19 +3,7 @@
<view class="content pt-24 pb-24 round-4">
<!-- 表单区域 -->
<tm-form @submit="fnOnSubmit">
<tm-input
:auto-focus="true"
name="content"
:vertical="true"
required
:height="220"
input-type="textarea"
bg-color="grey-lighten-5"
:maxlength="200"
:borderBottom="false"
placeholder="请输入内容,不超过200字符..."
v-model="form.content"
></tm-input>
<tm-input :auto-focus="true" name="content" :vertical="true" required :height="220" input-type="textarea" bg-color="grey-lighten-5" :maxlength="200" :borderBottom="false" placeholder="请输入内容,不超过200字符..." v-model="form.content"></tm-input>
<tm-input name="author" align="right" required title="我的昵称" placeholder="请输入您的昵称..." v-model="form.author"></tm-input>
<tm-input name="email" align="right" title="邮箱地址" placeholder="请输入您的邮箱..." v-model="form.email"></tm-input>
<tm-input name="authorUrl" align="right" title="我的网站" placeholder="请输入您的网址..." v-model="form.authorUrl"></tm-input>
@ -30,12 +18,12 @@
</template>
<script>
import tmForm from '@/tm-vuetify/components/tm-form/tm-form.vue';
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
import tmSwitch from '@/tm-vuetify/components/tm-switch/tm-switch.vue';
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
import tmForm from '@/tm-vuetify/components/tm-form/tm-form.vue';
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
import tmSwitch from '@/tm-vuetify/components/tm-switch/tm-switch.vue';
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
export default {
export default {
components: {
tmForm,
tmInput,
@ -87,6 +75,7 @@ export default {
},
methods: {
fnOnSubmit(e) {
console.log('提交评论');
if (e === false) {
return uni.$tm.toast('请检查所有的必填项是否填写完整!');
}
@ -134,11 +123,11 @@ export default {
});
}
}
};
};
</script>
<style scoped lang="scss">
.app-page {
.app-page {
width: 100vw;
min-height: 100vh;
box-sizing: border-box;
@ -150,8 +139,9 @@ export default {
background-color: #fff;
// box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
}
}
.poup-content {
}
.poup-content {
width: 500rpx;
::v-deep {
@ -159,5 +149,5 @@ export default {
width: 100% !important;
}
}
}
}
</style>

View File

@ -4,14 +4,18 @@
<view class="profile flex flex-col flex-center pa-36">
<view class="avatar"><image class="avatar-img" :src="bloggerInfo.avatar" mode="aspectFill"></image></view>
<view class="nickname mt-24 text-weight-b text-size-g">{{ bloggerInfo.nickname }}</view>
<view class="desc mt-24 text-size-m text-grey-darken-3">{{ bloggerInfo.description || '这个博主很懒,竟然没写介绍~' }}</view>
<view class="desc mt-24 text-size-m text-grey-darken-3">
{{ bloggerInfo.description || '这个博主很懒,竟然没写介绍~' }}
</view>
<!-- 联系图标 -->
<view class="mt-24 contact-icons">
<!-- 放全部似乎显得有点拥挤 -->
<!-- <block v-for="(item, index) in result" :key="index"><text v-if="item.value" class="halocoloricon" :class="[item.icon, { 'ml-12': index != 0 }]"></text></block> -->
<!-- 考虑放几个常用的就行 -->
<text class="halocoloricon halocoloricon-qq"></text>
<!-- #ifndef MP-QQ -->
<text class="ml-12 halocoloricon halocoloricon-wechat"></text>
<!-- #endif -->
<text class="ml-12 halocoloricon halocoloricon-GitHub"></text>
<text class="ml-12 halocoloricon halocoloricon-gitee"></text>
<text class="ml-12 halocoloricon halocoloricon-ic_email_round"></text>

View File

@ -4,4 +4,4 @@
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("./dayjs.min")):"function"==typeof define&&define.amd?define(["./dayjs.min"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){switch(_){case"W":return e+"周";default:return e+"日"}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("./dayjs.min.js")):"function"==typeof define&&define.amd?define(require("./dayjs.min.js"),_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){switch(_){case"W":return e+"周";default:return e+"日"}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));

View File

@ -12,7 +12,7 @@ module.exports = {
changeOrigin: true,
secure: true,
pathRewrite: {
"^/api": ""
"^/api": "/api"
}
}
}