shop_uniapp/mixins/app.js

67 lines
1.5 KiB
JavaScript
Raw Normal View History

2024-06-06 09:55:01 +08:00
import {
mapGetters,
mapMutations
} from 'vuex'
import wechath5 from '@/utils/wechath5'
import {isWeixinClient, currentPage, paramsToStr} from '@/utils/tools'
import Cache from "@/utils/cache"
import color from '@/config/color'
export default {
data() {
return {
2024-09-02 18:02:53 +08:00
colorConfig: color,
2024-11-15 16:09:39 +08:00
aliOSS: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/'
2024-06-06 09:55:01 +08:00
};
},
2024-11-15 16:09:39 +08:00
async onLoad() {},
methods: {},
2024-06-06 09:55:01 +08:00
computed: {
...mapGetters(['isLogin','inviteCode','appConfig'])
},
// 全局配置分享
onShareAppMessage() {
const { h5_share_image, share_intro, share_title, mnp_share_title, mnp_share_image } = this.appConfig.share
// #ifdef H5
const share = {
title: share_title,
path: `/pages/index/index?invite_code=${this.inviteCode}`,
imageUrl: h5_share_image
}
// #endif
// #ifdef MP-WEIXIN
const share = {
title: mnp_share_title,
path: `/pages/index/index?invite_code=${this.inviteCode}`,
imageUrl: mnp_share_image
}
// #endif
return share
},
onShareTimeline() {
const { h5_share_image, share_intro, share_title } = this.appConfig.share
// #ifdef H5
const share = {
title: share_title,
imageUrl: h5_share_image
}
// #endif
// #ifdef MP-WEIXIN
const share = {
title: mnp_share_title,
imageUrl: mnp_share_image
}
// #endif
return share
}
};