소스 검색

feat:扫码记录

zhanghui 2 년 전
부모
커밋
b2940924cb
3개의 변경된 파일45개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      App.vue
  2. 17 0
      common/js/service.js
  3. 26 0
      pages/register/register.vue

+ 2 - 1
App.vue

@@ -70,9 +70,10 @@
                     })
                 }
 
+            }else {
+                uni.removeStorageSync('isRegister');
             }
             },1000)
-            uni.removeStorageSync('isRegister');
 			console.log('App Launch')
 
 		},

+ 17 - 0
common/js/service.js

@@ -3,6 +3,23 @@ import request from '../js/request.js';
 
 export default {
 
+    //添加拓客经理二维码被扫记录
+    addRecordForManager(data) {
+        return request({
+            url: '/expand/userScanRecord/addRecordForManager',
+            method: 'POST',
+            data: data
+        })
+    },
+
+    //将扫码记录修改为成功
+    updateScanRecordById(data) {
+        return request({
+            url: '/expand/userScanRecord/updateRecordById?id=' + data.recordId,
+            method: 'POST'
+        })
+    },
+
     //	协议查询
     aboutByType(data) {
         return request({

+ 26 - 0
pages/register/register.vue

@@ -70,6 +70,7 @@
 		data() {
 			return {
 
+				recordId:'',//拓客经理二维码被扫记录id
 				qrCodeInvalid:false,//二维码是否无效标识
 				requestStatus:false,
 				disabled1:false,
@@ -188,6 +189,7 @@
 			if (e.parentId){
 				this.form.parentId = e.parentId
 				console.log('获取到的name',e.parentId)
+				this.addRecordForManager()
 			}
 			if (e.timestamp){
 				console.log('获取到的时间戳',e.timestamp,new Date().getTime() > e.timestamp)
@@ -211,6 +213,28 @@
 			}
 		},
 		methods: {
+
+			addRecordForManager(){
+				console.log("+++++++++++++创建被扫码记录++++++++++++++")
+				console.log("+++++++++++++拓客经理id++++++++++++++",this.form.parentId)
+				console.log("+++++++++++++角色id++++++++++++++",this.form.roleId)
+				this.$api.service.addRecordForManager({
+					expandUserId:this.form.parentId,
+					roleId: this.form.roleId
+				}).then(res=>{
+					console.log("获取到的记录id",res.data.data)
+					this.recordId = res.data.data
+				})
+			},
+
+			updateScanRecordById(){
+				this.$api.service.updateScanRecordById({
+					recordId:this.recordId
+				}).then(res=>{
+					console.log("+++++++++++++创建被扫码记录为成功撞他++++++++++++++",res)
+				})
+			},
+
 			idCardAndName(){
 				return this.$api.service.idCardAndName({
 					name:this.form.name,
@@ -309,6 +333,8 @@
 							this.gologin()
 						},2000)
 
+						this.updateScanRecordById()
+
 					}).catch(err=>{
 						this.requestStatus=false
 					})