From b25f2e3a119bbf40b2bd374fe9102c65485cd049 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Wed, 30 Jul 2025 13:33:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E6=B7=B7=E5=85=A5=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=BA=94=E7=94=A8ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加configList混入以实现全局分享功能,包含发送给朋友和分享到朋友圈的配置 更新manifest.json中的appid为__UNI__5405C20 --- main.js | 2 ++ manifest.json | 2 +- mixins/configList.js | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 mixins/configList.js diff --git a/main.js b/main.js index f5cd3ba..485a530 100644 --- a/main.js +++ b/main.js @@ -11,6 +11,7 @@ App.mpType = 'app' import store from '@/store/store' import i18n from './locale/index.js' +import configList from '@/mixins/configList.js' import './config' import './utils/index.js' @@ -21,6 +22,7 @@ import changeLanguage from '@/components/base/changeLanguage.vue' Vue.component('configPopup',configPopup) Vue.component('changeLanguage',changeLanguage) +Vue.mixin(configList) const app = new Vue({ ...App, diff --git a/manifest.json b/manifest.json index 9c7bf8f..7376fa0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "unapp模板", - "appid" : "__UNI__F370613", + "appid" : "__UNI__5405C20", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", diff --git a/mixins/configList.js b/mixins/configList.js new file mode 100644 index 0000000..cbe4c83 --- /dev/null +++ b/mixins/configList.js @@ -0,0 +1,34 @@ + + +import { mapState } from 'vuex' +export default { + data() { + return { + // 默认的全局分享内容 + Gshare: { + title: '艺易修', + path: '/pages/repair/repair', // 全局分享的路径,比如 首页 + // imageUrl: '/static/image/login/logo.png', // 全局分享的图片(可本地可网络) + } + } + }, + computed: { + }, + // 定义全局分享 + // 1.发送给朋友 + onShareAppMessage(res) { + let o = { + ...this.Gshare, + } + return o + }, + //2.分享到朋友圈 + onShareTimeline(res) { + let o = { + ...this.Gshare, + } + return o + }, + methods: { + } +} \ No newline at end of file