|
|
@@ -0,0 +1,94 @@
|
|
|
+var _request = require('../../../../utils/request.js')
|
|
|
+Page({
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面的初始数据
|
|
|
+ */
|
|
|
+ data: {
|
|
|
+ isCertificate: 0,
|
|
|
+ certificateData: {},
|
|
|
+ user_no: '',
|
|
|
+ remark: '',
|
|
|
+ d5cData: {},
|
|
|
+ wxid:'',
|
|
|
+ showbindover:false
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ onLoad: function (options) {
|
|
|
+ console.log('options',options);
|
|
|
+ this.setData({
|
|
|
+ wxid:options.id
|
|
|
+ })
|
|
|
+ this.checkCertified()
|
|
|
+ },
|
|
|
+ userNo (e) {
|
|
|
+ console.log(e)
|
|
|
+ var that = this
|
|
|
+ that.setData({
|
|
|
+ user_no: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ remark (e) {
|
|
|
+ console.log(e)
|
|
|
+ var that = this
|
|
|
+ that.setData({
|
|
|
+ remark: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ checkCertified () {
|
|
|
+ var that = this
|
|
|
+ var url = 'v1/user/certificate'
|
|
|
+ var params = {
|
|
|
+ }
|
|
|
+ var success = function (res) {
|
|
|
+ that.setData({
|
|
|
+ certificateData: res.data,
|
|
|
+ isCertificate: res.data.is_certification
|
|
|
+ })
|
|
|
+ }
|
|
|
+ _request.$get(url, params, success)
|
|
|
+ },
|
|
|
+ confirmClick () {
|
|
|
+ var that = this
|
|
|
+ var url = 'v1/sys_user/'+that.data.wxid+'/bind'
|
|
|
+ var params = {
|
|
|
+ user_no: that.data.user_no,
|
|
|
+ remark: that.data.remark
|
|
|
+ }
|
|
|
+ var success = function (res) {
|
|
|
+ if (res.data) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '绑定成功~',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ that.setData({showbindover:true})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _request.$put(url, params, success)
|
|
|
+ },
|
|
|
+ d5cCertificate () {
|
|
|
+ var that = this
|
|
|
+ var url = 'v1/user/check_cert'
|
|
|
+ var params = {
|
|
|
+ }
|
|
|
+ var success = function (res) {
|
|
|
+ if (res.data) {
|
|
|
+ that.setData({
|
|
|
+ d5cData: res.data,
|
|
|
+ realname: res.data.real_name,
|
|
|
+ idno: res.data.icer_card
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _request.$get(url, params, success)
|
|
|
+ },
|
|
|
+ onShareAppMessage: function (val) {
|
|
|
+ return _request.share({
|
|
|
+ sc: 'xcx_user_identity'
|
|
|
+ })
|
|
|
+ }
|
|
|
+})
|