初始化仓库

This commit is contained in:
wangxiaowei
2026-04-14 16:54:04 +08:00
commit 967c25b397
553 changed files with 106514 additions and 0 deletions

View File

@ -0,0 +1,67 @@
import wechath5 from '@/utils/wechath5'
import {
isWeixinClient
} from '@/utils/tools'
import {
baseURL,
basePath
} from '@/config/app'
const state = {
communityItem: {}
};
const mutations = {
setCommunity(state, data) {
state.communityItem = data
}
};
const actions = {
// 分享种草文章
communityShare({
state,
commit
}) {
const item = state.communityItem;
console.log(item)
// #ifdef H5
if (isWeixinClient()) {
const option = {
shareTitle: `${item.user.nickname}TA的内容超级棒`,
shareLink: `${baseURL}${basePath}/${item.url}?id=${item.id}`,
shareImage: item.image,
shareDesc: item.content
}
wechath5.share(option)
}
// #endif
// #ifdef APP-PLUS
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 0,
href: `${baseURL}${basePath}/${item.url}?id=${item.id}`,
title: `${item.user.nickname}TA的内容超级棒`,
summary: item.content,
imageUrl: item.image,
success: (res) => {
console.log('分享成功');
},
fail: (err) => {
console.log(err)
uni.showToast({
icon: 'none',
title: err.errMsg
})
}
});
// #endif
}
};
export default {
state,
mutations,
actions
};