y595705120 3 years ago
parent
commit
92d195322b
3 changed files with 36 additions and 27 deletions
  1. 3 1
      app.json
  2. 13 4
      pages/tool/band/band.js
  3. 20 22
      pages/tool/band/band.wxml

+ 3 - 1
app.json

@@ -1,6 +1,8 @@
 {
   "pages": [
+    
     "pages/index/index",
+    "pages/tool/band/band",
     "pages/task/supply/index",
     
     "pages/login/login",
@@ -21,7 +23,7 @@
     
     "pages/task/confirm/index",
     "pages/task/finish/index",
-    "pages/tool/band/band",
+    
     "pages/account/index",
     "pages/log/log",
     "pages/tool/empty/index"

+ 13 - 4
pages/tool/band/band.js

@@ -9,15 +9,15 @@ Page({
     showcamara: false,
     type:'card',
     info:{
-      card_code:"",
-      name:""
+      band_code:"",
+      band_name:""
     }
   },
   onLoad: function (options) {
     let info = this.data.info;
     app.getMakerInfo(  res =>{
       Object.assign( info, res )
-      this.setData( {info })
+      this.setData( {info})
     })
   },
   onReady: function (res) {
@@ -51,11 +51,20 @@ Page({
     let showcamara= false
     util.http( method, {url}, (err,res)=>{
       if( err!= 0 ) return;
-      console.log("http",err, res)
       Object.assign( info, res)
       this.setData({info,showcamara})
     })
   },
+  saveBandInfo: function( e ){
+    let info = this.data.info;
+    let {band_code,band_name} = e.detail.value;
+    util.http( '/maker/addMakerBand', {band_code,band_name}, (err,res)=>{
+      if( err!= 0 ) return;
+      Object.assign( info, res);
+      app.setMakerInfo( info )
+      util.showSuccess("保存成功")
+    })
+  },
   chooseImg: function () {
     var that = this
     wx.chooseImage({

+ 20 - 22
pages/tool/band/band.wxml

@@ -28,7 +28,7 @@
 
   <view class='container' style="top: {{StatusBar}}px;">
     <view class="pt30">
-      <view class="fs36 ml20 tc">请上传银行卡号</view>
+      <view class="fs36 ml20 tc" bindtap="takeBand" >请上传银行卡号</view>
     </view>
 
     <view class="identify-box" style="heigth:300rpx;">
@@ -38,28 +38,26 @@
         <image  wx:else src="/img/card.png"  class="identify-img-1" bindtap="takeBand" />
       </view>
     </view>
-
-    <view class="cu-list menu" style="margin-top:40rpx;">
-      <view class="cu-item">
-        <view class="content">
-          <text class="cuIcon-card text-grey"></text>
-          <text class="text-grey">银行卡号:{{info.band_code}}</text>
+    <form bindsubmit="saveBandInfo">
+      <view class="cu-list menu" style="margin-top:40rpx;">
+        <view class="cu-item">
+          <view class="cu-form-group" >
+            <text class="cuIcon-card text-grey"></text>
+            <view class="title solids-right text-grey">银行卡号:</view>
+            <input class="ml20" value="{{info.band_code}}" name="band_code"></input>
+          </view>
         </view>
-      </view>
-      <view class="cu-item">
-        <view class="content">
-          <text class="cuIcon-info text-grey"></text>
-          <text class="text-grey">银行名字: {{info.band_name}} </text>
+        <view class="cu-item">
+          <view class="cu-form-group">
+            <text class="cuIcon-info text-grey"></text>
+            <view class="title solids-right text-grey">银行名称:</view>
+            <input class ="ml20" value="{{info.band_name}}" name="band_name"></input>
+          </view>
         </view>
-      </view>
-    </view>  
+      </view> 
+      <view class="padding flex flex-direction" >
+        <button class="cu-btn bg-green margin-tb-sm lg" form-type="submit">保存信息</button>
+      </view> 
+    </form>
   </view>
-
-  <view class="padding flex flex-direction" wx:if="info.band_img" >
-    <button class="cu-btn bg-green margin-tb-sm lg">已经认证</button>
-  </view>
-  <view class="padding flex flex-direction" wx:else>
-    <button class="cu-btn bg-green margin-tb-sm lg">确认</button>
-  </view>
-
 </scroll-view>