roose %!s(int64=4) %!d(string=hai) anos
pai
achega
9e8e5f755f

+ 61 - 5
pages/idCard/idCard.js

@@ -2,11 +2,67 @@ const app = require('../../utils/util.js');
 var util = require('../../utils/md5.js')
 Page({
   data: {
-   
+    imgPath: '',
+    isTrue: true,
   },
- 
-  onLoad: function () {
-   
- 
+  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',
+    })
   },
+  goPhoto() {
+    var that = this;
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['camera'],
+      success: function (res) {
+        var tempFilePaths = res.tempFilePaths
+        wx.uploadFile({
+          url: app.globalData.publicUrl + '/sys/user/upload',
+          filePath: tempFilePaths[0],
+          name: 'uploadFile',
+          formData: {
+            "user": "test",
+          },
+          header: {
+            appletsId: wx.getStorageSync('openId'),
+          },
+          success: function (res) {
+            console.log(JSON.parse(res.data), "45454545");
+            let datas = JSON.parse(res.data)
+            if (datas.code == 0) {
+              that.setData({
+                imgPath: datas.data,
+                isTrue: false
+              })
+            }
+          }
+        })
+      }
+    })
+
+  },
+  closeImage(e) {
+    this.setData({
+      isTrue: true,
+      imgPath: '',
+    })
+
+  },
+
+  onLoad: function () {},
 })

+ 1 - 1
pages/idCard/idCard.json

@@ -1,4 +1,4 @@
 {
-  "navigationBarTitleText":"身份卡",
+  "navigationBarTitleText":"上传照片",
   "usingComponents": {}
 }

+ 8 - 0
pages/idCard/idCard.wxml

@@ -0,0 +1,8 @@
+<view class="home">
+	<view class="title1">上传照片</view>
+	<view class="title2">生成专属身份卡</view>
+	<image wx:if="{{isTrue}}" src="/images/caream.png" style="width:350rpx;height:350rpx" bindtap="goPhoto"></image>
+	<image wx:else class="image" style="width:350rpx;height:350rpx" src="http://info.windd.cn:8080/test{{imgPath}}" mode='scaleToFill' bindtap="previewImg"></image>
+	<van-icon wx:if="{{!isTrue}}" size='23' name="clear" class="close" data-index="{{index}}" bindtap="closeImage" />
+	<view  class="btn" bindtap="goShenFen">立即生成</view>
+</view>

+ 34 - 0
pages/idCard/idCard.wxss

@@ -0,0 +1,34 @@
+.home {
+  text-align: center;
+  position: relative;
+}
+
+.title2 {
+  margin-bottom: 40rpx;
+  font-size: 30rpx;
+  color: #aeaeae;
+
+
+}
+
+.title1 {
+  margin-top: 100rpx;
+  font-size: 38rpx;
+}
+
+.btn {
+  background-color: #2087f7;
+  color: white;
+  width: 90%;
+  margin: 0 auto;
+  border-radius: 10rpx;
+  padding: 10rpx 0;
+  margin-top: 200rpx;
+}
+
+.close {
+  position: absolute;
+  top: 130rpx;
+  left: 500rpx;
+
+}

+ 40 - 28
pages/love/love.js

@@ -135,7 +135,6 @@ Page({
     console.log(params);
     console.log(this.data.visitPhoto, "照片");
     console.log(this.data.infoId);
-
     if (this.data.visitPhoto.length > 0) {
       let obj = {};
       obj = {
@@ -146,41 +145,54 @@ Page({
         lng: this.data.lng,
         visitLocation: this.data.visitLocation
       }
+
       wx.request({
-        url: app.globalData.publicUrl + '/visit/add',
+        url: app.globalData.publicUrl + '/visit/doFace3',
         method: "POST",
         header: {
           appletsId: wx.getStorageSync('openId')
         },
-        data: obj,
+        data: {
+          infoId: this.data.infoId,
+          visitPhoto: this.data.visitPhoto,
+        },
         success: (res) => {
-          console.log(res, "打印锕");
-          console.log(res.data.code, "打印锕000000");
-          if (res.data.code == 0) {
-            wx.showModal({
-              showCancel: false,
-              content: '提交成功',
-              success() {
-                wx.switchTab({
-                  url: '/pages/index/index',
-                })
-              }
-            })
-          } else if (res.data.code == 1) {
-            console.log("进来了啊");
-
-            wx.showModal({
-              showCancel: false,
-              content: res.data.message,
-              success() {
-                wx.switchTab({
-                  url: '/pages/index/index',
-                })
-              }
-            })
-          }
+          console.log(res);
         }
       })
+
+
+      // wx.request({
+      //   url: app.globalData.publicUrl + '/visit/add',
+      //   method: "POST",
+      //   header: {
+      //     appletsId: wx.getStorageSync('openId')
+      //   },
+      //   data: obj,
+      //   success: (res) => {
+      //     if (res.data.code == 0) {
+      //       wx.showModal({
+      //         showCancel: false,
+      //         content: '提交成功',
+      //         success() {
+      //           wx.switchTab({
+      //             url: '/pages/index/index',
+      //           })
+      //         }
+      //       })
+      //     } else if (res.data.code == 1) {
+      //       wx.showModal({
+      //         showCancel: false,
+      //         content: res.data.message,
+      //         success() {
+      //           wx.switchTab({
+      //             url: '/pages/index/index',
+      //           })
+      //         }
+      //       })
+      //     }
+      //   }
+      // })
     } else {
       wx.showToast({
         title: '请上传现场照片',

+ 1 - 1
pages/love/love.wxml

@@ -57,7 +57,7 @@
 		<view  style=" border: 1rpx solid #5398C8; color: #fff;  padding-left: 10rpx;background-color: #429EFF; font-size: 26rpx;width: 220rpx;margin-top: 40rpx; margin-bottom: 40rpx;" bindtap="zhaopian" wx:if='{{isTrue}}'>请上传含面部照片</view>
 		<view style="  display: flex;">
 			<view wx:for='{{imgPath}}' class="img-box">
-			<image class="image"  src="http://info.windd.cn:8080/test{{item}}"  mode='scaleToFill' bindtap="previewImg"></image>
+			<image class="image"  src="http://info.windd.cn:8080/test{{imgPath}}"  mode='scaleToFill' bindtap="previewImg"></image>
 			<van-icon size='23' name="clear" class="close" data-index="{{index}}" bindtap="closeImage"/>
 		</view>
 		</view>

+ 10 - 3
pages/personInfo/personInfo.js

@@ -9,9 +9,16 @@ Page({
     })
   },
   shenfen() {
-    wx.navigateTo({
-      url: '/pages/idCard/idCard',
-    })
+    if (this.data.info.headPicPath) {
+      wx.navigateTo({
+        url: '/pages/idCardDetail/idCardDetail',
+      })
+    } else {
+      wx.navigateTo({
+        url: '/pages/idCard/idCard',
+      })
+    }
+
   },
   xiugai() {
     wx.navigateTo({

+ 2 - 2
utils/util.js

@@ -1,8 +1,8 @@
 const globalData = {
   
-  //publicUrl: 'http://info.windd.cn:8080/test',
+  publicUrl: 'http://info.windd.cn:8080/test',
 
- publicUrl: 'http://10.16.4.8:7001',
+ //publicUrl: 'http://10.16.4.8:7001',
 };
 module.exports = {
   globalData: globalData,