candidate update
This commit is contained in:
parent
2273e17895
commit
7949661044
|
@ -25,7 +25,8 @@
|
||||||
"pages/quota/quota",
|
"pages/quota/quota",
|
||||||
"pages/material/index",
|
"pages/material/index",
|
||||||
"pages/question/detail",
|
"pages/question/detail",
|
||||||
"pages/candidate/index"
|
"pages/candidate/index",
|
||||||
|
"pages/candidate/detail"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"backgroundTextStyle": "light",
|
"backgroundTextStyle": "light",
|
||||||
|
@ -73,7 +74,6 @@
|
||||||
"l-toast": "/miniprogram_npm/lin-ui/toast/index",
|
"l-toast": "/miniprogram_npm/lin-ui/toast/index",
|
||||||
"l-message": "/miniprogram_npm/lin-ui/message/index",
|
"l-message": "/miniprogram_npm/lin-ui/message/index",
|
||||||
"l-button": "/miniprogram_npm/lin-ui/button/index"
|
"l-button": "/miniprogram_npm/lin-ui/button/index"
|
||||||
|
|
||||||
},
|
},
|
||||||
"style": "v2",
|
"style": "v2",
|
||||||
"sitemapLocation": "sitemap.json"
|
"sitemapLocation": "sitemap.json"
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
// pages/candidate/detail.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
console.log(getApp().globalData.candidate_url)
|
||||||
|
this.setData({
|
||||||
|
url:getApp().globalData.candidate_url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!--pages/candidate/detail.wxml-->
|
||||||
|
<web-view src="{{url}}"></web-view>
|
|
@ -0,0 +1 @@
|
||||||
|
/* pages/candidate/detail.wxss */
|
|
@ -92,7 +92,7 @@ Page({
|
||||||
wx.hideLoading({
|
wx.hideLoading({
|
||||||
success: (res) => {},
|
success: (res) => {},
|
||||||
})
|
})
|
||||||
console.log(res.data.candidates)
|
// console.log(res.data.candidates)
|
||||||
this.setData({
|
this.setData({
|
||||||
candidates:res.data.candidates
|
candidates:res.data.candidates
|
||||||
})
|
})
|
||||||
|
@ -112,12 +112,12 @@ Page({
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
prImg: function (e) {
|
toDetail: function(e){
|
||||||
var current = e.target.dataset.src
|
var url = e.currentTarget.dataset.url
|
||||||
|
getApp().globalData.candidate_url = url
|
||||||
|
wx.navigateTo({
|
||||||
|
url: 'detail',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
wx.previewImage({
|
|
||||||
current: current,
|
|
||||||
urls: [current]
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
})
|
|
@ -20,18 +20,18 @@
|
||||||
<l-button bind:lintap="search">查询</l-button>
|
<l-button bind:lintap="search">查询</l-button>
|
||||||
</view>
|
</view>
|
||||||
<view class="weui-cells__title">查询结果</view>
|
<view class="weui-cells__title">查询结果</view>
|
||||||
<view wx:if="{{candidates}}">
|
<view wx:if="{{candidates.length}}">
|
||||||
<block wx:for="{{candidates}}" wx:key="unique">
|
<block wx:for="{{candidates}}" wx:key="unique">
|
||||||
<view class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
|
<view class="weui-cell" data-url="{{item.img}}">
|
||||||
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg" style="width:96px">
|
<view class="weui-cell__bd">
|
||||||
<image class="weui-media-box__thumb" src="{{item.img}}" bindtap="prImg" data-src="{{item.img}}"></image>
|
|
||||||
</view>
|
|
||||||
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
|
|
||||||
<view class="weui-media-box__title">
|
<view class="weui-media-box__title">
|
||||||
单号:{{item.report_number}}</view>
|
单号:{{item.report_number}}</view>
|
||||||
<view class="weui-media-box__desc">
|
<view class="weui-media-box__desc">
|
||||||
<span style="color:darkblue">发证日期:{{item.issue_date}}</span>
|
<view style="color:darkblue">发证日期:{{item.issue_date}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="weui-cell__ft">
|
||||||
|
<view style="color:green">通过考核</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
|
@ -18,15 +18,15 @@
|
||||||
"checkInvalidKey": true,
|
"checkInvalidKey": true,
|
||||||
"checkSiteMap": true,
|
"checkSiteMap": true,
|
||||||
"uploadWithSourceMap": true,
|
"uploadWithSourceMap": true,
|
||||||
|
"compileHotReLoad": false,
|
||||||
"babelSetting": {
|
"babelSetting": {
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"disablePlugins": [],
|
"disablePlugins": [],
|
||||||
"outputPath": ""
|
"outputPath": ""
|
||||||
},
|
},
|
||||||
"useIsolateContext": true,
|
"useIsolateContext": true,
|
||||||
"useCompilerModule": false,
|
"useCompilerModule": true,
|
||||||
"userConfirmedUseCompilerModuleSwitch": false,
|
"userConfirmedUseCompilerModuleSwitch": false
|
||||||
"compileHotReLoad": false
|
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "2.10.3",
|
"libVersion": "2.10.3",
|
||||||
|
|
|
@ -249,14 +249,21 @@ class ConsumerViewSet(ModelViewSet):
|
||||||
payload = {'IndexModel[name]': request.query_params['realname'], 'IndexModel[identityNumber]': request.query_params['ID_number'], 'IndexModel[certNumber]':'', 'IndexModel[candidateNumber]':''}
|
payload = {'IndexModel[name]': request.query_params['realname'], 'IndexModel[identityNumber]': request.query_params['ID_number'], 'IndexModel[certNumber]':'', 'IndexModel[candidateNumber]':''}
|
||||||
r = requests.post('https://fushe.chinansc.cn/open/candidate-list',data=payload)
|
r = requests.post('https://fushe.chinansc.cn/open/candidate-list',data=payload)
|
||||||
html = etree.HTML(r.text)
|
html = etree.HTML(r.text)
|
||||||
results = html.xpath('//td/text()')
|
results = html.xpath("//table[@class='cert-table']")
|
||||||
img = html.xpath('//a/@href')
|
|
||||||
candidates = []
|
candidates = []
|
||||||
try:
|
try:
|
||||||
|
for i in results:
|
||||||
|
img = i.xpath('tr/td/a/@href')
|
||||||
|
name = i.xpath('tr[1]/td[1]/text()')
|
||||||
|
ID_number = i.xpath('tr[1]/td[2]/text()')
|
||||||
|
report_number = i.xpath('tr[2]/td[1]/text()')
|
||||||
|
issue_date = i.xpath('tr[2]/td[2]/text()')
|
||||||
jsondata = {
|
jsondata = {
|
||||||
'report_number':results[4],
|
'name':name[0],
|
||||||
'issue_date':results[5],
|
'ID_number':ID_number[0],
|
||||||
'img':'https://fushe.chinansc.cn'+ img[1]
|
'report_number':report_number[0],
|
||||||
|
'issue_date':issue_date[0],
|
||||||
|
'img':'https://fushe.chinansc.cn'+ img[0]
|
||||||
}
|
}
|
||||||
candidates.append(jsondata)
|
candidates.append(jsondata)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in New Issue