package com.ydl.webview

import com.ydl.ydlcommon.bean.ShareData


/**
 * h5页面js返回对象(新标准格式)
 * Created by hgw on 2017/4/15.
 */

class H5JsBean {

    var cmd: H5JsCmd? = null
    var url: String? = null//跳转网页还是原生

    class H5JsCmd {

        var params: Params? = null
        var action_name: String? = null

        class Params {

            var callBack: String = "" // 用于回调的js方法名

            var isShowTitleBar: Boolean = false //是否展示标题栏
            var selfPageType: Int = -1 //当前h5页面

            var user_url: String? = null // 修改预约时间用户网址
            var doc_url: String? = null // 修改预约时间专家网址
            var dsmId: Int = 0 // 修改预约时间参数
            var title: String? = null
            var share: ShareData? = null//分享参数
            var url: String? = null//网页地址
            var search_name = ""//搜索专家时的搜索关键词.

            var id: Int = 0
            var uid: Int = 0
            var toName: String? = null//聊天名字
            var toUid: Int = 0//云信聊天 对方的id
            var isFromQingShu = 0//是否是从专家倾述主页跳转私聊界面   0： 不是  1：是
            var docHead: String? = null//聊天头像
            var doctorId: Int = 0//医生id
            var confidedId: String? = null//医生id
            var listenerId: Int = 0
            var orderStatus: Int = 0
            var orderStatusDesc: String? = null

            var bottomfitViewColor: String? = null //底部适配布局的颜色

            var orderContent: String? = null//默认发送的第一天聊天
            var action_name: String? = null

            var login: String? = null //为1时跳转登录

            var orderid: String? = null

            var weixin: String? = null
            var phoneNumber: String? = null
            var type: String? = null
            var dot_flag: Boolean = false
            var switch = false // 是否允许下拉刷新
            var payId: String? = null
            var money: String? = null
            var orderId: String? = null
            var succ: String? = null
            var course_id: String? = null
            var courseType: String? = null//课程类型：0 音频  1 视屏
            var mediaType: String? = null//资料类型 1.音频 2.视频
            var coursePlayUrl: String? = null//课程播放地址

            var testResultId: Int? = 0
            var price: Float? = 0f

            //群聊id
            var tid: Int = 0

            //专家id
            var doctor_id: Int = 0

            //音频直播
            var open_long = 0
            var roomid: String? = null
            var roomname: String? = null
            var httpPullUrl: String? = null
            var hlsPushUrl: String? = null
            var live_cid: String? = null
            var host_uid = 0
            var host_head: String? = null
            var live_status = 0
            var replay_url: String? = null
            var start_time: String? = null
            var host_name: String? = null
            var live_online_counter = 0 //聊天室初始人数
            var liveType: String? = null;//audio音频直播 video视频直播

            //公共支付商品id
            var goodsId: String? = null

            //预约下单id
            var product_id: String? = null
            var schedule_id: String? = null //预约时间id
            var schedule_time: String? = null //预约时间字符串
            var cate_id = 0 //搜索主题id
            var imageBase64: String? = null//图片base64编码数据
            var sourceUrl: String? = null//登录完成后跳转地址
            var linkUrl: String? = null //专家主页地址

            override fun toString(): String {
                return "Params(url=$url, search_name='$search_name', id=$id, uid=$uid, toName=$toName, toUid=$toUid, docHead=$docHead, doctorId=$doctorId, listenerId=$listenerId, " +
                        "orderStatus=$orderStatus, orderStatusDesc=$orderStatusDesc, orderContent=$orderContent, action_name=$action_name, login=$login, orderid=$orderid, weixin=$weixin, " +
                        "phoneNumber=$phoneNumber, type=$type, dot_flag=$dot_flag, payId=$payId, money=$money, orderId=$orderId, succ=$succ, course_id=$course_id, tid=$tid, doctor_id=$doctor_id, " +
                        "open_long=$open_long, roomid=$roomid, roomname=$roomname, httpPullUrl=$httpPullUrl, hlsPushUrl=$hlsPushUrl, live_cid=$live_cid, host_uid=$host_uid, host_head=$host_head, " +
                        "live_status=$live_status, replay_url=$replay_url, start_time=$start_time, host_name=$host_name, live_online_counter=$live_online_counter, product_id=$product_id, " +
                        "schedule_id=$schedule_id, schedule_time=$schedule_time, cate_id=$cate_id,merchantType$merchantType)"
            }

            var test_items_id = 0

            //倾诉线路类型
            var confideType = 1 //1 axb 2双呼 3声网

            //倾诉支付参数
            var payTitle: String? = null

            //订单金额
            var orderPrice: Double? = null

            //优惠金额
            var coupnPrice: Double? = null

            //测评题 优惠券金额
            var couponMoney: String? = ""

            //可用余额
            var avliableMoney: Double? = null

            //倾诉支付成功跳转地址
            var confideUrl: String? = null

            //打开与关闭右上角菜单
            var toggleRightTopMenu: Int = 0 //0 关闭，1 打开

            //打开与关闭分享菜单
            var toggleShareMenu: Int = 0 //0 关闭，1 打开

            //标识首页第几个tab
            var selectTab: Int = 0

            //倾诉拨打电话使用参数
            var callType: String? = null

            var switchStatus = 1

            var closeReplaceChat = false

            var merchantType: String = ""

            var day: String = "" // 预约日期

            //            meditation start
//            {"meditationId":21,"mediaId":15,"meditionType":1,"status":0,
//            "coverImageUrl":"https://pic.ydlcdn.com/NsBRkaxNba.png",
//            "title":"创建冥想-标题-20",
//            "desc":"冥想测试数据基础入门1冥想测试数据基础入门1冥想测试数据基础入门1冥想测试数据基础入门1冥想测试数据基础入门1",
//            "duration":250.9845}
            var meditationId: Int? = null
            var mediaId: Int? = null
            var meditionType: Int? = null
            var status = 0
            var coverImageUrl: String? = null
            var desc: String? = null
            var mediaUrl: String? = null
            var duration: Double? = null
            var businessType: Int? = null

            var share_url: String? = null
            var cover: String? = null
            var isDarkMode = false

            var buried: String? = null

            val color: String? = null
            val alpha: String? = null

//            meditation  end


            var preview_type: Int = 0
            var preview_index: Int = 0

            val dataList: List<MediaInfo>? = null
            var info: DoctorInfo? = null
        }
    }

    class MediaInfo {
        var url: String? = null
        var sourcesType: Int = 0
        var cover: String? = null
    }

    class DoctorInfo {
        var doctorId: String? = null
        var toUid: Int = 0
        var utype: String? = null
    }
}
