regSuccess.js 3.6 KB
// pages/regSuccess/regSuccess.js

const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    // regSuccess:res.data
    job_id:'',
    mobile:'',
    qq:'',
    qqlock: '',
    wxn:'',
    wx_gz:'',
    type:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log('999',options)

    if(options.id!=undefined){
      this.setData({
        job_id: options.id
      })
    }

    let data =options.data;
    data=JSON.parse(data);
    console.log('83428894398',data)
    this.setData({
      type: data.type
    })
    console.log('909090', this.data.job_id)
    
    this.getRegSuccess();
    
  },

  //

  getRegSuccess() {

    let that = this;
    let url = 'index/job/job';
    let params = {
      job_id :that.data.job_id
    }
    let header = {
      "XX-Token": wx.getStorageSync('token'),
      "XX-Device-Type": 'wxapp'
    }
    app.post(url, params, header).then((res) => {
      console.log(res);
      // 获取值
      that.setData({
        regSuccess: res.data,
        qq:res.data.qq,
        qqlock: res.data.qq_lock,
        wxn:res.data.wxn,
        wx_gz: res.data.wx_gz,
        mobile:res.data.mobile

      })





    }).catch((err) => {

    })
  },
//复制成功
  paste: function () {
    let that = this
    wx.showToast({
      title: '复制成功',
    })

    wx.setClipboardData({
      data: that.data.mobile,
      success: function (res) {
        wx.getClipboardData({

          success: function (res) {
            console.log(res.data) // data
          }
        })
      }
    })
  },

  //复制微信
  pastewx(){
    let that = this
    wx.showToast({
      title: '复制成功',
    })

    wx.setClipboardData({
      data: that.data.wxn,
      success: function (res) {
        wx.getClipboardData({

          success: function (res) {
            console.log(res.data) // data
          }
        })
      }
    })
  },

  //复制微信公众号
  pastewxgroup(){
    let that = this
    wx.showToast({
      title: '复制成功',
    })

    wx.setClipboardData({
      data: that.data.wx_gz,
      success: function (res) {
        wx.getClipboardData({

          success: function (res) {
            console.log(res.data) // data
          }
        })
      }
    })
  },
  pasteqq(){
    let that = this
    wx.showToast({
      title: '复制成功',
    })

    wx.setClipboardData({
      data: that.data.qq,
      success: function (res) {
        wx.getClipboardData({

          success: function (res) {
            console.log(res.data) // data
          }
        })
      }
    })
  },

  pasteqqlock() {
    let that = this
    wx.showToast({
      title: '复制成功',
    })

    wx.setClipboardData({
      data: that.data.qqlock,
      success: function (res) {
        wx.getClipboardData({

          success: function (res) {
            console.log(res.data) // data
          }
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})