Browse Source

企业认证

chen 5 years ago
parent
commit
367bd8e3a8
3 changed files with 109 additions and 23 deletions
  1. 1 1
      app.js
  2. 79 1
      pages/attestation/index.js
  3. 29 21
      pages/attestation/index.wxml

+ 1 - 1
app.js

@@ -21,7 +21,7 @@ App({
   globalData: {
     share: false,  // 分享默认为false
     height: 0,
-    publicUrl: 'http://127.0.0.1:7004/',
+    publicUrl: 'http://124.235.209.122:88/',
     imageUrl:'http://124.235.209.122:88',
   }
   

+ 79 - 1
pages/attestation/index.js

@@ -13,16 +13,94 @@ Page({
       // 此页面 页面内容距最顶部的距离
       height: app.globalData.height * 2 + 20,
     },
+    user:{},
   },
   // 认证信息提交
   formSubmit: function (e) {
     console.log('form发生了submit事件,携带数据为:', e.detail.value)
+    let user = wx.getStorageSync('user')
+    console.log('user',user._id)
+    if (user) {
+    e.detail.value.uid = user._id;
+    e.detail.value.business_license = '#';// 营业执照图片
+    e.detail.value.card_back = '#';//身份证反面图	
+    e.detail.value.card_front = '#';// 身份证正面图
+    e.detail.value.profession_one = '1';
+    e.detail.value.profession_two = '1';
+    e.detail.value.profession_three = '1';
+    e.detail.value.belong_addr_area = '1';
+    console.log('postDorm',e.detail.value)
+    wx.request({
+      method:"POST",
+      url: app.globalData.publicUrl + 'api/financial/companyidentify',
+      data: e.detail.value,
+      success:(e) => {
+        console.log('success',e);
+        if(e.data.errcode == 0){
+          wx.navigateTo({
+            url: '/pages/home/index'
+          })
+        } else {
+          wx.showToast({
+            title: e.data.details?e.data.details:e.data.errmsg,
+            icon: 'none',
+            duration: 1500
+        })
+        }
+      }
+    })
+    }else{
+      wx.showModal({
+                title: '警告',
+                content: '您当前没有登录,将无法进行认证,请重新登录!!!',
+                showCancel: false,
+                confirmText: '返回登录',
+                success: function (res) {
+                if (res.confirm) {
+                console.log('用户点击了“返回”')
+                wx.navigateTo({
+                  url: '/pages/login/index'
+                })
+                }
+              }
+            })
+    }
+  },
+
+  //数据回显
+  loadData: function () {
+    // console.log('form发生了submit事件,携带数据为:', e.detail.value)
+    let user = wx.getStorageSync('user')
+    console.log('user',user._id)
+    wx.request({
+      method:"get",
+      url: app.globalData.publicUrl + 'api/financial/companyidentify',
+      data: {uid:user._id},
+      success:(e) => {
+        console.log('success',e);
+        if(e.data.errcode == 0){
+          this.setData({
+            user:e.data.data[0]
+          })
+          // 认证按钮置灰
+
+          
+        } else {
+          wx.showToast({
+            title: e.data.details?e.data.details:e.data.errmsg,
+            icon: 'none',
+            duration: 1500
+        })
+        }
+      }
+    })
+    
   },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.loadData();
   },
 
   /**

+ 29 - 21
pages/attestation/index.wxml

@@ -3,77 +3,85 @@
 	<view class="main">
 		<view class="form">
 			<form bindsubmit="formSubmit" bindreset="formReset">
-				<view class='input-content'>
+				<view class='input-content' >
 					<view class="input-col">
 						<label>统一社会信用代码</label>
-						<input class="one" type='text' name="code" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="one" type='text' name="code" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.code}}"></input>
 					</view>
 					<view class="input-col">
 						<label>法人代表</label>
-						<input class="two" type='text' name="representative" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="two" type='text' name="representative" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.representative}}"></input>
+					</view>
+					<view class="input-col">
+						<label>法人证件号</label>
+						<input class="thirth" type='text' name="representative_id" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.representative_id}}"></input>
+					</view>
+					<view class="input-col">
+						<label>法人手机号</label>
+						<input class="thirth" type='text' name="representative_phone" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.representative_phone}}"></input>
 					</view>
 					<view class="input-col">
 						<label>成立日期</label>
-						<input class="three" type='text' name="establish_date" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="three" type='text' name="establish_date" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.establish_date}}"></input>
 					</view>
 					<view class="input-col">
 						<label>营业到期日期</label>
-						<input class="four" type='text' name="due_date" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="four" type='text' name="due_date" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.due_date}}"></input>
 					</view>
 					<view class="input-col">
 						<label>企业类型</label>
-						<input class="five" type='text' name="type" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="five" type='text' name="type" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.type}}"></input>
 					</view>
 					<view class="input-col">
 						<label>企业名称</label>
-						<input class="six" type='text' name="company_name" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="six" type='text' name="company_name" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.company_name}}"></input>
 					</view>
 					<view class="input-col">
 						<label>注册资本</label>
-						<input class="seven" type='text' name="registered_capital" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="seven" type='text' name="registered_capital" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.registered_capital}}"></input>
 					</view>
 					<view class="input-col">
 						<label>资产总额</label>
-						<input class="eight" type='text' name="total_assets" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="eight" type='text' name="total_assets" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.total_assets}}"></input>
 					</view>
 					<view class="input-col">
 						<label>营业收入</label>
-						<input class="nine" type='text' name="taking" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="nine" type='text' name="taking" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.taking}}"></input>
 					</view>
 					<view class="input-col">
 						<label>从业人员数量</label>
-						<input class="ten" type='text' name="number" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="ten" type='text' name="number" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.number}}"></input>
 					</view>
 					<view class="input-col">
 						<label>企业所属类型</label>
-						<input class="eleven" type='text' name="belong_type" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="eleven" type='text' name="belong_type" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.belong_type}}"></input>
 					</view>
-					<view class="input-col">
+					<!-- <view class="input-col">
 						<label>公司行业</label>
-						<input class="twelve" type='text' name="profession" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="twelve" type='text' name="profession_four" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.profession_four}}"></input>
 					</view>
 					<view class="input-col">
 						<label>企业所属地</label>
-						<input class="thirth" type='text' name="belong_addr" placeholder='请输入' placeholder-style="color:#888888;"></input>
-					</view>
+						<input class="thirth" type='text' name="belong_addr_city" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.belong_addr_city}}"></input>
+					</view> -->
 					<view class="input-col">
 						<label>经营地址</label>
-						<input class="fourth" type='text' name="business_addr" placeholder='请输入' placeholder-style="color:#888888;"></input>
+						<input class="fourth" type='text' name="business_addr" placeholder='请输入' placeholder-style="color:#888888;" value="{{user.business_addr}}"></input>
 					</view>
 					<view class="input-col">
 						<label class="textarea">注册地址</label>
-						<textarea bindblur="bindTextAreaBlur" class="sixth" name="registered_addr" maxlength="500" placeholder="500字以内" placeholder-style="color:#888888;" />
+						<textarea bindblur="bindTextAreaBlur" class="sixth" name="registered_addr" maxlength="500" placeholder="500字以内" placeholder-style="color:#888888;" value="{{user.registered_addr}}" />
 						</view>
 					<view class="input-col">
 						<label class="textarea">经营范围</label>
-						<textarea bindblur="bindTextAreaBlur" class="sixth" name="business_scope"  maxlength="500" placeholder="500字以内" placeholder-style="color:#888888;" />
+						<textarea bindblur="bindTextAreaBlur" class="sixth" name="business_scope"  maxlength="500" placeholder="500字以内" placeholder-style="color:#888888;" value="{{user.business_scope}}"/>
 					</view>
 					<view class="input-col">
 						<label class="textarea">企业简介</label>
-						<textarea required bindblur="bindTextAreaBlur" class="sixth" name="introduction" maxlength="500" placeholder="500字以内" placeholder-style="color:#888888;" />
+						<textarea required bindblur="bindTextAreaBlur" class="sixth" name="introduction" maxlength="500" placeholder="500字以内" placeholder-style="color:#888888;" value="{{user.introduction}}"/>
 						</view>
 				</view>
-				<view class="save">
+				<view class="save" wx:if='{{!user.code}}'>
 					<button class='save-btn' form-type="submit">认证</button>
 				</view>
 			</form>