Browse Source

feat: 添加全局分享混入并更新应用ID

添加configList混入以实现全局分享功能,包含发送给朋友和分享到朋友圈的配置
更新manifest.json中的appid为__UNI__5405C20
master
前端-胡立永 6 days ago
parent
commit
b25f2e3a11
3 changed files with 37 additions and 1 deletions
  1. +2
    -0
      main.js
  2. +1
    -1
      manifest.json
  3. +34
    -0
      mixins/configList.js

+ 2
- 0
main.js View File

@ -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,


+ 1
- 1
manifest.json View File

@ -1,6 +1,6 @@
{
"name" : "unapp模板",
"appid" : "__UNI__F370613",
"appid" : "__UNI__5405C20",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",


+ 34
- 0
mixins/configList.js View File

@ -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: {
}
}

Loading…
Cancel
Save