Просмотр исходного кода

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

小莫唐尼 2 лет назад
Родитель
Сommit
66f4ccffc0

+ 4 - 0
.hbuilderx/launch.json

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

+ 4 - 3
config/halo.config.template.js

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

+ 216 - 161
manifest.json

@@ -1,162 +1,217 @@
 {
 {
-    "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
-        },
-        /* 模块配置 */
-        "modules" : {
-            "OAuth" : {},
-            "Share" : {}
-        },
-        /* 应用发布信息 */
-        "distribute" : {
-            /* android打包配置 */
-            "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\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.CAPTURE_VIDEO_OUTPUT\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-                ]
-            },
-            /* ios打包配置 */
-            "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" : {}
-                },
-                "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/"
-                    }
-                }
-            },
-            "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"
-                    },
-                    "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"
-                    }
-                }
-            }
-        }
-    },
-    /* 快应用特有相关 */
-    "quickapp" : {},
-    /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "wx1bb161867082c72f",
-        "setting" : {
-            "urlCheck" : false,
-            "minified" : true
-        },
-        "usingComponents" : true
-    },
-    "mp-alipay" : {
-        "usingComponents" : true
-    },
-    "mp-baidu" : {
-        "usingComponents" : true
-    },
-    "mp-toutiao" : {
-        "usingComponents" : true
-    },
-    "uniStatistics" : {
-        "enable" : false
-    },
-    "vueVersion" : "2",
-    "h5" : {
-        "title" : "uni-halo",
-        "devServer" : {
-            "disableHostCheck" : true,
-            "proxy" : {
-                "/api" : {
-                    "target" : "https://b.925i.cn",
-                    "changeOrigin" : true,
-                    "secure" : false,
-                    "pathRewrite" : {
-                        "^/api" : ""
-                    }
-                }
-            }
-        },
-        "optimization" : {
-            "preload" : true,
-            "treeShaking" : {
-                "enable" : true
-            }
-        }
-    },
-    "_spaceID" : "699a26a5-a6cd-4b54-b603-5155b312a5f5"
-}
+	"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
+		},
+		/* 模块配置 */
+		"modules": {
+			"OAuth": {},
+			"Share": {}
+		},
+		/* 应用发布信息 */
+		"distribute": {
+			/* android打包配置 */
+			"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\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
+					"<uses-permission android:name=\"android.permission.CAPTURE_VIDEO_OUTPUT\"/>",
+					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+					"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+					"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+					"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+				]
+			},
+			/* ios打包配置 */
+			"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": {}
+				},
+				"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/"
+					}
+				}
+			},
+			"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"
+					},
+					"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": {},
+	/* 小程序特有相关 */
+	"mp-weixin": {
+		"appid": "wx1bb161867082c72f",
+		"setting": {
+			"urlCheck": false,
+			"minified": true
+		},
+		"usingComponents": true,
+		"uniStatistics": {
+			"enable": true
+		}
+	},
+	"mp-alipay": {
+		"usingComponents": true,
+		"uniStatistics": {
+			"enable": true
+		}
+	},
+	"mp-baidu": {
+		"usingComponents": true,
+		"uniStatistics": {
+			"enable": true
+		}
+	},
+	"mp-toutiao": {
+		"usingComponents": true,
+		"uniStatistics": {
+			"enable": true
+		}
+	},
+	"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": "/api"
+					}
+				}
+			}
+		},
+		"optimization": {
+			"preload": true,
+			"treeShaking": {
+				"enable": true
+			}
+		},
+		"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
+		}
+	}
+}

+ 2 - 2
pages.json

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

+ 6 - 2
pages/tabbar/about/about.vue

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

+ 9 - 2
pagesA/article-detail/article-detail.vue

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

+ 119 - 129
pagesA/comment/comment.vue

@@ -3,19 +3,7 @@
 		<view class="content pt-24 pb-24 round-4">
 		<view class="content pt-24 pb-24 round-4">
 			<!-- 表单区域 -->
 			<!-- 表单区域 -->
 			<tm-form @submit="fnOnSubmit">
 			<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="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="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>
 				<tm-input name="authorUrl" align="right" title="我的网站" placeholder="请输入您的网址..." v-model="form.authorUrl"></tm-input>
@@ -30,134 +18,136 @@
 </template>
 </template>
 
 
 <script>
 <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 {
-	components: {
-		tmForm,
-		tmInput,
-		tmSwitch,
-		tmButton
-	},
-	data() {
-		return {
-			params: {
-				postId: '',
-				parentId: '',
-				title: '', // 被回复的标题 type=user =用户名  否则为文章标题
-				form: '',
-				formPage: '', // 来自哪个页面
-				type: 'post' // 来源文章/页面 还是用户  user=用户
-			},
-			form: {
-				allowNotification: true,
-				author: '', // 作者
-				avatar: '',
-				authorUrl: '', // 作者主页
-				content: '', // 评论内容
-				email: '', // 邮件
-				parentId: 0,
-				postId: 0
-			}
-		};
-	},
-	computed: {
-		// 评论游客信息
-		wxLoginVisitorUser() {
-			return uni.$tm.vx.getters().getWxLoginInfo;
-		}
-	},
-	onLoad() {
-		this.params = this.$Route.query;
-		this.form.postId = this.params.id;
-		if (this.params.type == 'user') {
-			this.form.parentId = this.params.parentId;
-			this.fnSetPageTitle('回复用户:' + this.params.title);
-		} else {
-			this.form.parentId = 0;
-			this.fnSetPageTitle(this.params.title);
-		}
-		this.form.author = this.wxLoginVisitorUser.nickName;
-		this.form.avatar = this.wxLoginVisitorUser.avatarUrl;
-		this.form.email = this.wxLoginVisitorUser.email;
-		this.form.authorUrl = this.wxLoginVisitorUser.url;
-	},
-	methods: {
-		fnOnSubmit(e) {
-			if (e === false) {
-				return uni.$tm.toast('请检查所有的必填项是否填写完整!');
-			}
-			if (this.form.allowNotification && !this.form.email) {
-				return uni.$tm.toast('未填写邮箱地址,将无法接收提醒!');
-			}
-			if (this.form.email && !uni.$tm.test.email(this.form.email)) {
-				return uni.$tm.toast('请填写正确的邮箱地址!');
+	export default {
+		components: {
+			tmForm,
+			tmInput,
+			tmSwitch,
+			tmButton
+		},
+		data() {
+			return {
+				params: {
+					postId: '',
+					parentId: '',
+					title: '', // 被回复的标题 type=user =用户名  否则为文章标题
+					form: '',
+					formPage: '', // 来自哪个页面
+					type: 'post' // 来源文章/页面 还是用户  user=用户
+				},
+				form: {
+					allowNotification: true,
+					author: '', // 作者
+					avatar: '',
+					authorUrl: '', // 作者主页
+					content: '', // 评论内容
+					email: '', // 邮件
+					parentId: 0,
+					postId: 0
+				}
+			};
+		},
+		computed: {
+			// 评论游客信息
+			wxLoginVisitorUser() {
+				return uni.$tm.vx.getters().getWxLoginInfo;
 			}
 			}
-			if (this.form.authorUrl && !uni.$tm.test.url(this.form.authorUrl)) {
-				return uni.$tm.toast('请输入正确的Url地址!');
+		},
+		onLoad() {
+			this.params = this.$Route.query;
+			this.form.postId = this.params.id;
+			if (this.params.type == 'user') {
+				this.form.parentId = this.params.parentId;
+				this.fnSetPageTitle('回复用户:' + this.params.title);
+			} else {
+				this.form.parentId = 0;
+				this.fnSetPageTitle(this.params.title);
 			}
 			}
-			this.fnHandle();
+			this.form.author = this.wxLoginVisitorUser.nickName;
+			this.form.avatar = this.wxLoginVisitorUser.avatarUrl;
+			this.form.email = this.wxLoginVisitorUser.email;
+			this.form.authorUrl = this.wxLoginVisitorUser.url;
 		},
 		},
+		methods: {
+			fnOnSubmit(e) {
+				console.log('提交评论');
+				if (e === false) {
+					return uni.$tm.toast('请检查所有的必填项是否填写完整!');
+				}
+				if (this.form.allowNotification && !this.form.email) {
+					return uni.$tm.toast('未填写邮箱地址,将无法接收提醒!');
+				}
+				if (this.form.email && !uni.$tm.test.email(this.form.email)) {
+					return uni.$tm.toast('请填写正确的邮箱地址!');
+				}
+				if (this.form.authorUrl && !uni.$tm.test.url(this.form.authorUrl)) {
+					return uni.$tm.toast('请输入正确的Url地址!');
+				}
+				this.fnHandle();
+			},
 
 
-		fnHandle() {
-			uni.showLoading({
-				title: '正在提交...'
-			});
-			const _api = {
-				sheets: this.$httpApi.postSheetsComments,
-				posts: this.$httpApi.postCommentPost
-			};
-			_api[this.params.from](this.form)
-				.then(res => {
-					if (res.status == 200) {
-						uni.$tm.toast('提交成功,待博主审核通过后即可展示!');
-						// 更新评论者信息
-						uni.$tm.vx.commit('user/setWxLoginInfo', {
-							avatarUrl: this.wxLoginVisitorUser.avatarUrl,
-							nickName: this.form.author,
-							email: this.form.email,
-							url: this.form.authorUrl
-						});
-						// 清空评论内容
-						this.form.content = '';
-						// 触发刷新评论(可能需要评论审核不会有改变)
-						// uni.$emit(this.params.formPage + '_refresh');
-					} else {
-						uni.$tm.toast('操作失败,请重试!');
-					}
-				})
-				.catch(err => {
-					uni.$tm.toast(err.message);
+			fnHandle() {
+				uni.showLoading({
+					title: '正在提交...'
 				});
 				});
+				const _api = {
+					sheets: this.$httpApi.postSheetsComments,
+					posts: this.$httpApi.postCommentPost
+				};
+				_api[this.params.from](this.form)
+					.then(res => {
+						if (res.status == 200) {
+							uni.$tm.toast('提交成功,待博主审核通过后即可展示!');
+							// 更新评论者信息
+							uni.$tm.vx.commit('user/setWxLoginInfo', {
+								avatarUrl: this.wxLoginVisitorUser.avatarUrl,
+								nickName: this.form.author,
+								email: this.form.email,
+								url: this.form.authorUrl
+							});
+							// 清空评论内容
+							this.form.content = '';
+							// 触发刷新评论(可能需要评论审核不会有改变)
+							// uni.$emit(this.params.formPage + '_refresh');
+						} else {
+							uni.$tm.toast('操作失败,请重试!');
+						}
+					})
+					.catch(err => {
+						uni.$tm.toast(err.message);
+					});
+			}
 		}
 		}
-	}
-};
+	};
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
-.app-page {
-	width: 100vw;
-	min-height: 100vh;
-	box-sizing: border-box;
-	// background-color: #fafafd;
-	background-color: #ffffff;
+	.app-page {
+		width: 100vw;
+		min-height: 100vh;
+		box-sizing: border-box;
+		// background-color: #fafafd;
+		background-color: #ffffff;
 
 
-	.content {
-		overflow: hidden;
-		background-color: #fff;
-		// box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
+		.content {
+			overflow: hidden;
+			background-color: #fff;
+			// box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
+		}
 	}
 	}
-}
-.poup-content {
-	width: 500rpx;
 
 
-	::v-deep {
-		.slider_id {
-			width: 100% !important;
+	.poup-content {
+		width: 500rpx;
+
+		::v-deep {
+			.slider_id {
+				width: 100% !important;
+			}
 		}
 		}
 	}
 	}
-}
-</style>
+</style>

+ 5 - 1
pagesA/contact/contact.vue

@@ -4,14 +4,18 @@
 		<view class="profile flex flex-col flex-center pa-36">
 		<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="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="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">
 			<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> -->
 				<!-- <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>
 				<text class="halocoloricon halocoloricon-qq"></text>
+				<!-- #ifndef MP-QQ -->
 				<text class="ml-12 halocoloricon halocoloricon-wechat"></text>
 				<text class="ml-12 halocoloricon halocoloricon-wechat"></text>
+				<!-- #endif -->
 				<text class="ml-12 halocoloricon halocoloricon-GitHub"></text>
 				<text class="ml-12 halocoloricon halocoloricon-GitHub"></text>
 				<text class="ml-12 halocoloricon halocoloricon-gitee"></text>
 				<text class="ml-12 halocoloricon halocoloricon-gitee"></text>
 				<text class="ml-12 halocoloricon halocoloricon-ic_email_round"></text>
 				<text class="ml-12 halocoloricon halocoloricon-ic_email_round"></text>

+ 1 - 1
tm-vuetify/tool/function/dayjs/zh-cn.min.js

@@ -4,4 +4,4 @@
  *
  *
  * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
  * 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}));

+ 2 - 2
vue.config.js

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