roose %!s(int64=4) %!d(string=hai) anos
pai
achega
80cbf4d498

+ 163 - 0
pages/finishInfo/finishInfo.js

@@ -0,0 +1,163 @@
+const app = require('../../utils/util.js');
+var util = require('../../utils/md5.js')
+Page({
+  data: {
+    postindex: null,
+    incomeindex: null,
+    educationindex: null,
+    posttext: '请选择',
+    incometext: '请选择',
+    educationtext: '请选择',
+
+    postList: [{
+        name: '群众'
+      },
+      {
+        name: '团员'
+      },
+      {
+        name: '党员'
+      },
+    ],
+
+    incomeList: [{
+        name: '1000'
+      },
+      {
+        name: '2000'
+      },
+      {
+        name: '3000'
+      },
+    ],
+
+    educationList: [{
+        name: '小学'
+      },
+      {
+        name: '初中'
+      },
+      {
+        name: '高中'
+      },
+    ],
+
+
+
+  },
+  goOcr() {
+    wx.showLoading({
+      title: '加载中',
+    })
+    var _this = this;
+    wx.chooseImage({
+      count: 1, // 默认9
+      sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+      success: function (res) {
+        // console.log('拍照获取图片路径',res);
+        // 读取本地文件内容
+        wx.showLoading({
+          title: '加载中',
+        })
+        wx.getFileSystemManager().readFile({
+          filePath: res.tempFilePaths[0],
+          encoding: 'base64',
+          success: res => {
+            //返回临时文件路径
+            // console.log('读取本地文件basema ',res.data)
+            let img = 'data:image/png;base64,' + res.data
+            const bodys = {
+              "base64Str": img
+            };
+            const AppCode = '4638ef02c8e248e1b12d55b1170e4feb';
+            // console.log('读取本地文件basema ',res.data)
+            // console.log(JSON.stringify( {base64Str:res.data}))
+            wx.request({
+              url: 'https://zid.market.alicloudapi.com/thirdnode/ImageAI/idcardfrontrecongnition',
+              method: 'POST',
+              header: {
+                Authorization: 'APPCODE ' + AppCode,
+                'content-type': 'application/x-www-form-urlencoded'
+              },
+              data: {
+                base64Str: img
+              },
+              dataType: 'json',
+              success: (e) => {
+                // console.log('身份证ocr识别返回数据',e.data)
+                if (e.data.error_code == 0) {
+                  if (e.data.result) {
+                    const idcardno = e.data.result.idcardno
+                    const name = e.data.result.name
+                  }
+                } else {
+                  wx.hideLoading();
+                  _this.setData({
+                    show: false,
+                    buttonShow: false,
+                    idButtonShow: true
+                  });
+                  wx.showModal({
+                    title: '提示',
+                    content: '身份证OCR识别失败',
+                  })
+                }
+              },
+            })
+          },
+          // 错误信息
+          fail: console.error
+        })
+      },
+      fail: function () {
+        wx.hideLoading();
+      }
+
+    })
+
+  },
+  postListChange: function (e) {
+    this.setData({
+      postindex: e.detail.value,
+      posttext: '',
+    })
+  },
+
+  incomeListChange: function (e) {
+    this.setData({
+      incomeindex: e.detail.value,
+      incometext: '',
+    })
+  },
+
+  educationListChange: function (e) {
+    this.setData({
+      educationindex: e.detail.value,
+      educationtext: '',
+    })
+  },
+
+  
+
+
+  formSubmit(e) {
+    console.log(e.detail, "daying");
+    // wx.request({
+    //   url: app.globalData.publicUrl + '/applet/bing',
+    //   method: "GET",
+    //   data: {
+    //     name: e.detail.value.name,
+    //     pwd: util.hexMD5(password),
+    //     appletsId: wx.getStorageSync('openId')
+    //   },
+    //   success: (res) => {
+
+    //   }
+    // })
+    // wx.switchTab({
+    //   url: '/pages/index/index',
+    // })
+  },
+  onLoad: function () {},
+})

+ 4 - 0
pages/finishInfo/finishInfo.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText":"完善信息",
+  "usingComponents": {}
+}

+ 63 - 0
pages/finishInfo/finishInfo.wxml

@@ -0,0 +1,63 @@
+<view>
+	<view class="title" bindtap="goOcr">
+		<image src="/images/saoma.png" style="width: 40rpx; height: 40rpx;"></image>
+		<view class="saoma">
+			扫描身份证上传基本信息
+		</view>
+	</view>
+	<form bindsubmit="formSubmit">
+		<view class="box">
+			<view class="flex-box">
+				<view class="small-box">姓名</view>
+				<input name='name' class="weui-input" placeholder="请输入" />
+			</view>
+			<view class="flex-box">
+				<view class="small-box">性别</view>
+				<!-- <van-radio-group name="sex">
+					<van-radio >男</van-radio>
+					<van-radio value="女">女</van-radio>
+				</van-radio-group> -->
+				<radio-group name="sex" >
+					<radio color='#009FE9' value='男'>男</radio>
+					<radio color='#009FE9' value='女'>女</radio>
+				</radio-group>
+			</view>
+			<view class="flex-box">
+				<view class="small-box">身份证号</view>
+				<input name='card' class="weui-input" placeholder="请输入" />
+			</view>
+			<view class="flex-box">
+				<view class="small-box">年龄</view>
+				<input name='age' class="weui-input" placeholder="请输入" />
+			</view>
+			<view class="flex-box">
+				<view class="small-box">职务</view>
+				<picker bindchange="postListChange" name="ensure_id" value="{{postList[postindex].name}}" range-key="{{'name'}}" range="{{postList}}">
+					<view class="picker">
+						{{postList[postindex].name}} <text >{{posttext}}</text>
+					</view>
+				</picker>
+			</view>
+			<view class="flex-box">
+				<view class="small-box">收入</view>
+				<picker bindchange="incomeListChange" name="ensure_id" value="{{incomeList[incomeindex].name}}" range-key="{{'name'}}" range="{{incomeList}}">
+					<view class="picker">
+						{{incomeList[incomeindex].name}} <text >{{incometext}}</text>
+					</view>
+				</picker>
+			</view>
+
+			<view class="flex-box">
+				<view class="small-box">学历</view>
+				<picker bindchange="educationListChange" name="ensure_id" value="{{educationList[educationindex].name}}" range-key="{{'name'}}" range="{{educationList}}">
+					<view class="picker">
+						{{educationList[educationindex].name}} <text >{{educationtext}}</text>
+					</view>
+				</picker>
+			</view>
+			<view class="register">
+				<button formType="submit">提交</button>
+			</view>
+		</view>
+	</form>
+</view>

+ 60 - 0
pages/finishInfo/finishInfo.wxss

@@ -0,0 +1,60 @@
+.title {
+  width: 90%;
+  height: 55rpx;
+  background: rgba(31, 135, 247, 0.2);
+  border: 1px solid rgba(31, 135, 247, 1);
+  border-radius: 5px;
+  margin: 0 auto;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: rgba(31, 135, 247, 1);
+  font-size: 28rpx;
+}
+
+.saoma {
+  margin-left: 20rpx;
+}
+
+.box {
+  width: 90%;
+  margin: 0 auto;
+  margin-top: 50rpx;
+}
+
+.flex-box {
+  display: flex;
+  margin-top: 40rpx;
+}
+
+.small-box {
+  width: 180rpx;
+}
+
+input {
+  border: 1px solid rgba(227, 229, 235, 1);
+  border-radius: 5px;
+  width: 500rpx;
+}
+
+button:not([size='mini']) {
+  width: 100% !important;
+  margin-left: auto;
+  margin-right: auto;
+  color: white;
+  background: #1989FA;
+  font-size: 28rpx;
+}
+
+.register {
+  margin-top: 100rpx;
+}
+
+.picker {
+  border: 1px solid rgba(227, 229, 235, 1);
+  border-radius: 5px;
+  width: 500rpx;
+}
+radio:last-child {
+  margin-left: 20rpx;
+}