
import store from '../store/index'
export default {
    data() {
        return {
            share: {
                title: "供应端小程序",
                path: "/pages/index/login",
                imageUrl:
                    "https://oss.ixiaokejia.com/images/common/share_login.jpg",
            }
        }
    },
    onShareAppMessage(res) { //发送给朋友
        let query = ``;
        if(store.state.user.user && store.state.user.user.inviteCode){
            query+=`?inviteCode=${store.state.user.user.inviteCode}`
        }
        return {
            title: this.share.title,
            imageUrl: this.share.imageUrl,
            path: this.share.path+query,
        }
    },
    onShareTimeline(res) {//分享到朋友圈
        let query = ``;
        if(store.state.user.user && store.state.user.user.inviteCode){
            query+=`?inviteCode=${store.state.user.user.inviteCode}`
        }
        return {
            title: this.share.title,
            imageUrl: this.share.imageUrl,
            path: this.share.path+query,
        }
    },
}