import { savePoint } from '@/services/common'
import { addItemShareNum } from '@/services/item'
import { addActivityShareNum, addHelpShareNum, addGroupShareNum, addHFiveShareNum } from '@/services/activity'
import { addCardShareNum } from '@/services/card'
import {
    addIndexShareNum,
    addNewsShareNum,
    addHousePosterNum,
    addHouseShareNum,
    addLivePosterNum,
    addLiveShareNum,
} from '@/services/news'

/**
 * 积分提示
 * @param {*} options
 * @param {*} type
 */
export function share(options, type) {

    return new Promise((resolve, reject) => {
        switch (type) {
            case 'main':
                addIndexShareNum(options.targetId)
                savePoint(options)
                break;
            case 'project':
                addItemShareNum(options.targetId)
                savePoint(options)
                break;
            case 'activity':
                addActivityShareNum(options.targetId)
                savePoint(options)
                break;
            case 'consultant':
                addCardShareNum(options.targetId)
                savePoint(options)
                break;
            case 'news':
                addNewsShareNum(options.targetId)
                savePoint(options)
                break;
            case 'houseApp':
                addHouseShareNum(options.targetId)
                savePoint(options)
                break;
            case 'housePoster':
                addHousePosterNum(options.targetId)
                savePoint(options)
                break;
            case 'liveApp':
                addLiveShareNum(options.targetId)
                savePoint(options)
                break;
            case 'livePoster':
                addLivePosterNum(options.targetId)
                savePoint(options)
                break;
            case 'help':
                addHelpShareNum(options.targetId)
                savePoint(options)
                break;
            case 'group':
                addGroupShareNum(options.targetId)
                savePoint(options)
                break;
            case 'h5':
                addHFiveShareNum(options.targetId)
                savePoint(options)
                break;
            default:
                return
        }

    })

}
