package com.yidian.shenghuoquan.border.viewmodel

import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import com.yidian.bcommon.app.YdBaseApplication
import com.yidian.bcommon.mvvm.BaseViewModel
import com.yidian.bcommon.utils.ToastUtils

/**
 * author: yinjiacheng
 * date: 2021/8/23 10:45
 * description: 订单信息
 */
class OrderInfoViewModel : BaseViewModel() {

  /**
   * 复制订单id
   */
  fun copyOrderId(orderId: String) {
    val clipboard = YdBaseApplication.context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
    val data = ClipData.newPlainText("copyOrderId", orderId)
    clipboard.setPrimaryClip(data)
    ToastUtils.showShortSafe("已复制")
  }
}
