var app = getApp();
var that;
import 'dingtalk-jsapi/entry/mobile';
import openLink from 'dingtalk-jsapi/api/biz/util/openLink';
import { getRole } from '../../../utils/util'
import moment from 'moment' // 时间库
Page({
  data: {
    knowFrom: 'action',
    userData: {},
    isgetRole:getRole(1),
    expireTime:'',
  },
  onLoad() {
    that = this
    that.setData({
      userData: app.globalData.userData,
      expireTime:moment(Number(app.globalData.userData.site.expire_time+'000')).format('YYYY-MM-DD')
    })
    dd.setNavigationBar({ title: "服务台" });
  },
  openUrl2() {
    dd.navigateTo({
      url: '../addMoney/addMoney'
    })
  },
  openKf() {
    openLink({
      url: `https://page.dingtalk.com/wow/dingtalk/act/serviceconversation?wh_biz=tm&showmenu=false&goodsCode=DT_GOODS_881607043109331&corpId=${app.globalData.corpId}&token=5784a3e6b5e025ee891517ea814180f4`
    })
  },
  openUrl(e) {
    var index = e.target.dataset.index;
    dd.navigateTo({
      url: '../webView/webView?index=' + index
    })
  },
});
