import { ApiModel } from "../../utils/api"; const _Http = new ApiModel; Component({ options: { addGlobalClass: true }, /** * 组件的属性列表 */ properties: { /* 直播账号状态 */ accountStatus: { type: Number }, /* 直播账号信息 */ accountMsg: { type: Object }, /* 是否私域 */ isSY: { type: Boolean, value: true } }, /** * 组件的初始数据 */ data: {}, /** * 组件的方法列表 */ methods: { /* 申请直播账号 */ applyForLive() { _Http.basic({ "accesstoken": wx.getStorageSync('userData').token, "classname": "customer.live.live", "method": "applySYLive", "content": {} }).then(res => { console.log(res) if (res.code == 1) { wx.showToast({ title: res.msg, icon: "none" }) this.setData({ accountStatus: 2 }) } else { if (res.data == '私域直播已申请') return wx.showModal({ title: "提示", content: "您的私域直播账号正在申请中" }) } }) }, /* 复制地址 */ copyTheAddress(e) { console.log(e) const { url } = e.target.dataset wx.setClipboardData({ data: url, success(res) { wx.getClipboardData({ success(res) { console.log('内容已复制') // data } }) } }) } }, })