roose 4 سال پیش
والد
کامیت
a98fc309c7
2فایلهای تغییر یافته به همراه32 افزوده شده و 22 حذف شده
  1. 25 16
      pages/idCard/idCard.js
  2. 7 6
      pages/love/love.js

+ 25 - 16
pages/idCard/idCard.js

@@ -6,22 +6,31 @@ Page({
     isTrue: true,
   },
   goShenFen() {
-    wx.request({
-      url: app.globalData.publicUrl + '/applet/suppleUserInfo',
-      method: "POST",
-      header: {
-        appletsId: wx.getStorageSync('openId')
-      },
-      data: {
-        headPicPath: this.data.imgPath
-      },
-      success: (res) => {
-        console.log(res, "000");
-      }
-    })
-    wx.navigateTo({
-      url: '/pages/idCardDetail/idCardDetail',
-    })
+    if (!this.data.isTrue) {
+      wx.request({
+        url: app.globalData.publicUrl + '/applet/suppleUserInfo',
+        method: "POST",
+        header: {
+          appletsId: wx.getStorageSync('openId')
+        },
+        data: {
+          headPicPath: this.data.imgPath
+        },
+        success: (res) => {
+          console.log(res, "000");
+        }
+      })
+      wx.redirectTo({
+        url: '/pages/idCardDetail/idCardDetail',
+      })
+    } else {
+      wx.showToast({
+        title: "请上传照片",
+        icon: 'none',
+        duration: 2000,
+      })
+    }
+
   },
   goPhoto() {
     var that = this;

+ 7 - 6
pages/love/love.js

@@ -9,9 +9,7 @@ Page({
     lat: '', // 纬度
     visitLocation: '',
     info: '', //老人锕
-    imgPath: [{
-    }, {
-    }],
+    imgPath: [{}, {}],
     isTrue: true,
     index: 0,
     visitPhoto: '',
@@ -128,6 +126,9 @@ Page({
     console.log(params);
     console.log(this.data.visitPhoto, "照片");
     console.log(this.data.infoId);
+    wx.showLoading({
+      title: '加载中',
+    })
     if (this.data.visitPhoto.length > 0) {
       let obj = {};
       obj = {
@@ -150,11 +151,10 @@ Page({
           visitPhoto: this.data.visitPhoto,
         },
         success: (res) => {
-          console.log(res.data.data, "分数是");
           // 如果上传不是人脸图片 则没有score
-          if (res.data.data.score) {
+          if (res.data && res.data.data && res.data.data.score ) {
             console.log(res.data.data.score, "分数是");
-            if (res.data.data.score > 60) {
+            if (res.data.data.score > 80) {
               console.log("比对成功了");
               //提交的接口 
               wx.request({
@@ -166,6 +166,7 @@ Page({
                 data: obj,
                 success: (res) => {
                   if (res.data.code == 0) {
+                    wx.hideLoading();
                     wx.showModal({
                       showCancel: false,
                       content: '提交成功',