From 0fb283991393c3070917abdf55ffd6941a1a88c6 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 5 Feb 2021 11:07:05 +0800 Subject: [PATCH] no message --- app.json | 1 - pages/home/pauthory/index.js | 180 --------------------------------- pages/home/pauthory/index.json | 6 -- pages/home/pauthory/index.wxml | 61 ----------- pages/home/pauthory/index.wxss | 50 --------- pages/home/pindex/index.js | 4 +- 6 files changed, 2 insertions(+), 300 deletions(-) delete mode 100644 pages/home/pauthory/index.js delete mode 100644 pages/home/pauthory/index.json delete mode 100644 pages/home/pauthory/index.wxml delete mode 100644 pages/home/pauthory/index.wxss diff --git a/app.json b/app.json index 2db4308..565bd43 100644 --- a/app.json +++ b/app.json @@ -9,7 +9,6 @@ "pages/home/password/index", "pages/home/setting/index", "pages/home/authory/index", - "pages/home/pauthory/index", "pages/home/idcard/index", "pages/home/info/index", "pages/home/pinfo/index", diff --git a/pages/home/pauthory/index.js b/pages/home/pauthory/index.js deleted file mode 100644 index f0a885a..0000000 --- a/pages/home/pauthory/index.js +++ /dev/null @@ -1,180 +0,0 @@ -// pages/home/authory/index.js -import { personalAuth } from "../../api/saas" -const util = require('../../../utils/util') -const math = require('../../../utils/math') -const app = getApp() - -Page({ - - /** - * 页面的初始数据 - */ - data: { - form: { - authType: 0, - }, - typeList: [{text: '身份证', value: 1}, {text: '身份证', value: 2}], - flag: false, // 是否不可以编辑, false:可编辑;true:不可编辑 - imgList: [null, null], - loadingWidth: math.divide(690, 2) - 16, - pathList: new Array(), - taskArray: [], - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.pickerView = this.pickerView || this.selectComponent('#picker-view') - }, - - showPicker: function (e) { - if (this.data.flag) { - return - } - this.pickerView.showPicker(this.data.typeList, null, 1) - }, - onPickerChange: function (e) { - if (!e.detail) { - return - } - if (e.detail.type == 1) { - this.setData({ ['form.bankName']: e.detail.text, ['form.bankId']: Number(e.detail.value) }) - } - }, - bindForm: function (e) { - // var form_data = 'form.' + e.target.id - this.data.form[e.target.id] = e.detail.value - }, - submitForm: function(){ - if (util.isEmpty(this.data.form.userName)) { - util.showToast('请输入真实姓名') - return - } - if (util.isEmpty(this.data.form.idCard)) { - util.showToast('请输入身份证号码') - return - } - if (util.checkId(this.data.form.idCard).status == 0) { - util.showToast('身份证号码有误') - return - } - if (util.isEmpty(this.data.pathList[0]) || util.isEmpty(this.data.pathList[0].url)) { - util.showToast('请上传身份证正面照片') - return - } - this.data.form.cardFront = this.data.pathList[0].url - if (util.isEmpty(this.data.pathList[1]) || util.isEmpty(this.data.pathList[1].url)) { - util.showToast('请上传身份证背面照片') - return - } - this.data.form.cardReverse = this.data.pathList[1].url - // /front/customer/personalAuth 个人会员认证 - wx.showLoading({ title: '处理中', mask: true }) - personalAuth(this.data.form).then(res => { - wx.hideLoading() - app.globalData.userInfo.isAuth = 1 - util.showBackToast('上传成功') - }).catch(error => { - wx.hideLoading() - util.showToast(error) - }) - }, - /*******************************************************图片上传************************************************************/ - uploadImage: function (index, path) { - var _this = this - _this.setData({ - ['pathList[' + index + ']']: { status: 1, url: '' } - }) - // /utils/uploadImage 统一上传图片接口 - var task = wx.uploadFile({ - url: app.httpUrl + '/saas-user/utils/uploadImage', - filePath: path, - name: 'image', - header: { - "Content-Type": "multipart/form-data", - appversion: app.version - }, - success: function (result) { - var resp = JSON.parse(result.data) - if (resp.code === 0) { - _this.setData({ - ['pathList[' + index + '].status']: 8, - ['pathList[' + index + '].url']: resp.data - }) - if(_this.data.id > 0){ - var _index = Number(index) + 1 - _this.setData({ - ['form.fileUrl' + _index]: resp.msg - }) - } - } - }, - fail: function (res) { - _this.setData({ - ['pathList[' + index + '].status']: -1 - }) - }, - complete: function (res) { - for (let i = 0; i < _this.data.taskArray.length; i++) { - if (_this.data.taskArray[i].path === path) { - _this.data.taskArray.splice(i, 1); - break - } - } - _this.setData({ - taskArray: _this.data.taskArray - }) - }, - }) - _this.data.taskArray.push({ path: path, task: task }) - _this.setData({ - taskArray: _this.data.taskArray - }) - }, - chooseImage(e) { - if (this.data.flag) { - return - } - var index = e.currentTarget.dataset.index - wx.chooseImage({ - count: 1, //默认9 - sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 - sourceType: ['album', 'camera'], //从相册选择 - success: (res) => { - this.setData({ ['imgList[' + index + ']']: res.tempFilePaths[0] }) - for (let i = 0; i < res.tempFilePaths.length; i++) { - this.uploadImage(index, res.tempFilePaths[i]) - } - } - }); - }, - viewImage(e) { - var urlList = [] - for (var i = 0; i < this.data.imgList.length; i++) { - if (!util.isEmpty(this.data.imgList[i])) { - urlList.push(this.data.imgList[i]) - } - } - wx.previewImage({ urls: urlList, current: e.currentTarget.dataset.url }); - }, - deleteImg(e) { - var index = e.currentTarget.dataset.index - // 如果是正在上传的; - if (this.data.pathList[index] && this.data.pathList[index].status === 1) { - if (this.data.taskArray[index]) { - this.data.taskArray[index].abort() // 取消上传任务 - } - this.data.taskArray.splice(index, 1); - } - this.data.imgList[index] = null; - if (this.data.pathList.length > index){ - this.data.pathList.splice(index, 1); - } - this.setData({ - imgList: this.data.imgList, - pathList: this.data.pathList, - taskArray: this.data.taskArray - }) - } -}) \ No newline at end of file diff --git a/pages/home/pauthory/index.json b/pages/home/pauthory/index.json deleted file mode 100644 index 1682085..0000000 --- a/pages/home/pauthory/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "picker-view": "/components/picker-view/index", - "wux-button": "/components/button/index" - } -} \ No newline at end of file diff --git a/pages/home/pauthory/index.wxml b/pages/home/pauthory/index.wxml deleted file mode 100644 index 2eb41e3..0000000 --- a/pages/home/pauthory/index.wxml +++ /dev/null @@ -1,61 +0,0 @@ - - - 实名认证 - - - - - - 姓名: - - - - - - - 身份证号码: - - - - - - - 上传身份证 - 正反面共2张 - - - - - - 身份证正面 - - - - - - - - - - 身份证背面 - - - - - - - - - - - - 提交 - - - diff --git a/pages/home/pauthory/index.wxss b/pages/home/pauthory/index.wxss deleted file mode 100644 index 4bc4006..0000000 --- a/pages/home/pauthory/index.wxss +++ /dev/null @@ -1,50 +0,0 @@ -/* pages/home/authory/index.wxss */ - -.image-reader-item { - position: relative; - width: 49%; - height: 128px; - background-color: #f8f8f8; - box-sizing: border-box; - list-style: none; - background-size: cover; - border-radius: 6rpx; -} - -.image-reader-item .md-icon { - position: absolute; - top: 45%; - left: 50%; - transform: translate(-50%, -50%); - opacity: 0.5; -} - -.image-reader-item .md-load { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} - -.image-reader-item .md-hint { - position: absolute; - top: 50%; - left: 0; - width: 100%; - margin-top: 10px; - font-size: 12px; - color: #bababa; - text-align: center; -} - -.image-reader-item .delete { - position: absolute; - top: 0px; - right: 0px; - opacity: 0.8; - border-top-right-radius: 6rpx; - border-bottom-left-radius: 8rpx; - padding: 6rpx 12rpx; - height: auto; - background-color: rgba(0, 0, 0, 0.5); -} \ No newline at end of file diff --git a/pages/home/pindex/index.js b/pages/home/pindex/index.js index c9b5b72..03b10f0 100644 --- a/pages/home/pindex/index.js +++ b/pages/home/pindex/index.js @@ -71,7 +71,7 @@ Component({ return } if(app.globalData.userInfo.isAuth != 1 && app.globalData.userInfo.userType == 1){ - wx.navigateTo({ url: '/pages/home/pauthory/index' }) + wx.navigateTo({ url: '/pages/home/idcard/index' }) } else { wx.navigateTo({ url: '/pages/home/pinfo/index' }) } @@ -82,7 +82,7 @@ Component({ return } if(app.globalData.userInfo.isAuth != 1 && app.globalData.userInfo.userType == 1){ - wx.navigateTo({ url: '/pages/home/pauthory/index' }) + wx.navigateTo({ url: '/pages/home/idcard/index' }) } else { wx.navigateTo({ url: '/pages/home/pinfo/index' }) }