diff --git a/test_mini/app.js b/test_mini/app.js index 1079cc5..ad0d1c5 100644 --- a/test_mini/app.js +++ b/test_mini/app.js @@ -33,9 +33,12 @@ App({ } }).then(res=>{ api.request('/crm/consumer/process/', 'GET').then(res => { - for (var key in res.data) { + + for (var key in res.data.process) { try { - wx.setStorageSync(key, res.data.key) + if(res.data.process[key]){ + wx.setStorageSync(key.toString(), res.data.process[key]) + } } catch (e) { } } }) diff --git a/test_mini/app.json b/test_mini/app.json index 2648df4..0ea7fab 100644 --- a/test_mini/app.json +++ b/test_mini/app.json @@ -25,8 +25,7 @@ "pages/quota/quota", "pages/material/index", "pages/question/detail", - "pages/candidate/index", - "pages/candidate/form.js" + "pages/candidate/index" ], "window": { "backgroundTextStyle": "light", @@ -74,6 +73,7 @@ "l-toast": "/miniprogram_npm/lin-ui/toast/index", "l-message": "/miniprogram_npm/lin-ui/message/index", "l-button": "/miniprogram_npm/lin-ui/button/index" + }, "style": "v2", "sitemapLocation": "sitemap.json" diff --git a/test_mini/pages/candidate/form.js.js b/test_mini/pages/candidate/form.js.js deleted file mode 100644 index fea1ff8..0000000 --- a/test_mini/pages/candidate/form.js.js +++ /dev/null @@ -1,66 +0,0 @@ -// pages/candidate/form.js.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } -}) \ No newline at end of file diff --git a/test_mini/pages/candidate/form.js.json b/test_mini/pages/candidate/form.js.json deleted file mode 100644 index 8835af0..0000000 --- a/test_mini/pages/candidate/form.js.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} \ No newline at end of file diff --git a/test_mini/pages/candidate/form.js.wxml b/test_mini/pages/candidate/form.js.wxml deleted file mode 100644 index 7c13e38..0000000 --- a/test_mini/pages/candidate/form.js.wxml +++ /dev/null @@ -1,2 +0,0 @@ - -pages/candidate/form.js.wxml diff --git a/test_mini/pages/candidate/form.js.wxss b/test_mini/pages/candidate/form.js.wxss deleted file mode 100644 index 5a8cce2..0000000 --- a/test_mini/pages/candidate/form.js.wxss +++ /dev/null @@ -1 +0,0 @@ -/* pages/candidate/form.js.wxss */ \ No newline at end of file diff --git a/test_mini/pages/candidate/index.js b/test_mini/pages/candidate/index.js index a9d03b8..c0c7813 100644 --- a/test_mini/pages/candidate/index.js +++ b/test_mini/pages/candidate/index.js @@ -1,21 +1,27 @@ // pages/candidate/index.js +const api = require("../../utils/request.js"); Page({ /** * 页面的初始数据 */ data: { - form:{ - ID_number:null, - realname:null - } + ID_number:null, + realname:null, + candidates:[] }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + if(getApp().globalData.userinfo.ID_number && getApp().globalData.userinfo.realname){ + this.setData({ + ID_number:getApp().globalData.userinfo.ID_number, + realname:getApp().globalData.userinfo.realname, + }) + this.search() + } }, /** @@ -65,5 +71,53 @@ Page({ */ onShareAppMessage: function () { - } + }, + bindinput1: function(e){ + this.data.realname = e.detail.value + }, + bindinput2: function(e){ + this.data.ID_number = e.detail.value + }, + search: function() { + if(this.data.realname && this.data.ID_number){ + var data = { + realname:this.data.realname, + ID_number:this.data.ID_number + } + wx.showLoading({ + title: '查询中..', + mask:true + }) + api.request('/crm/consumer/candidate/', 'GET', data).then(res => { + wx.hideLoading({ + success: (res) => {}, + }) + console.log(res.data.candidates) + this.setData({ + candidates:res.data.candidates + }) + }).catch(e=>{ + wx.hideLoading({ + success: (res) => {}, + }) + }) + api.request('/crm/consumer/realinfo/', 'POST', data).then(res=>{ + }) + }else{ + wx.showToast({ + title: '请填写姓名和身份证号', + icon: 'none', + duration: 1500 + }) + } + + }, + prImg: function (e) { + var current = e.target.dataset.src + + wx.previewImage({ + current: current, + urls: [current] + }) + }, }) \ No newline at end of file diff --git a/test_mini/pages/candidate/index.wxml b/test_mini/pages/candidate/index.wxml index 6624cd2..5544c9e 100644 --- a/test_mini/pages/candidate/index.wxml +++ b/test_mini/pages/candidate/index.wxml @@ -1,2 +1,39 @@ - -pages/candidate/index.wxml + + 查询信息 + + + + + + + + + + + + + + + + 查询 + + 查询结果 + + + + + + + + + 单号:{{item.report_number}} + + 发证日期:{{item.issue_date}} + + + + + + 暂无证书信息 \ No newline at end of file diff --git a/test_mini/pages/lianxi/index.js b/test_mini/pages/lianxi/index.js index 043f891..51de548 100644 --- a/test_mini/pages/lianxi/index.js +++ b/test_mini/pages/lianxi/index.js @@ -88,11 +88,13 @@ Page({ try { const res = wx.getStorageInfoSync() const keys = res.keys - console.log(keys) for(var i=0;i