Browse Source

no message

featrue/v4.1
xpz2018 5 years ago
parent
commit
40b7ea9703
6 changed files with 18 additions and 32 deletions
  1. 13
      components/uploader/index.js
  2. 4
      pages/home/authory/index.js
  3. 2
      pages/home/authory/index.wxml
  4. 2
      pages/home/idcard/index.js
  5. 19
      pages/home/info/index.js
  6. 10
      pages/morder/detail/index.js

13
components/uploader/index.js

@ -1,3 +1,4 @@
import { zconfig } from'../../pages/api/ztb'
const math = require('../../utils/math') const math = require('../../utils/math')
const util = require('../../utils/util') const util = require('../../utils/util')
const app = getApp() const app = getApp()
@ -59,14 +60,12 @@ Component({
methods: { methods: {
uploadFile: function (index, path) { uploadFile: function (index, path) {
var _this = this var _this = this
var header = { ...zconfig.header, 'X-APP-ID': app.xAppId, appversion: app.version, 'Content-Type': 'multipart/form-data' }
const task = wx.uploadFile({ const task = wx.uploadFile({
url: app.httpUrl + '/saas-user/utils/uploadImage',
url: zconfig.baseUrl + '/recycle-user-center/file-uploading/upload/image',
filePath: path, filePath: path,
name: 'image', name: 'image',
header: {
'Content-Type': 'multipart/form-data',
'appversion': app.version
},
header,
success: function (result) { success: function (result) {
var resp = null var resp = null
if (!util.isEmpty(result.data)) { if (!util.isEmpty(result.data)) {
@ -90,9 +89,7 @@ Component({
_this.onChange() _this.onChange()
}, },
fail: function (res) { fail: function (res) {
_this.setData({
['fileList[' + index + '].status']: -1
})
_this.setData({ ['fileList[' + index + '].status']: -1 })
_this.onChange() _this.onChange()
if (_this.data.type == 'image') { if (_this.data.type == 'image') {
util.showToast('图片上传失败,请重新上传') util.showToast('图片上传失败,请重新上传')

4
pages/home/authory/index.js

@ -9,7 +9,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
form: { identityAuthToken: null },
form: { },
typeList: [{text: '身份证', value: 1}, {text: '身份证', value: 2}], typeList: [{text: '身份证', value: 1}, {text: '身份证', value: 2}],
disable: true, // 是否不可以编辑, false:可编辑;true:不可编辑 disable: true, // 是否不可以编辑, false:可编辑;true:不可编辑
auth: false auth: false
@ -46,9 +46,7 @@ Page({
this.data.form[e.target.id] = e.detail.value this.data.form[e.target.id] = e.detail.value
}, },
submitForm: function(){ submitForm: function(){
// /front/customer/personalAuth 个人会员认证
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
this.data.form.identityAuthToken = this.data.form.token
certificateIdentity(this.data.form).then(res => { certificateIdentity(this.data.form).then(res => {
wx.hideLoading() wx.hideLoading()
app.globalData.userInfo.isAuth = 1 app.globalData.userInfo.isAuth = 1

2
pages/home/authory/index.wxml

@ -20,7 +20,7 @@
<view class="cu-item"> <view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx"> <view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">身份证号码:</view> <view style="min-width:170rpx">身份证号码:</view>
<input disabled="{{disabled}}" value="{{form.idCardNo}}" style="width:65%" type="idcard" bindblur="inputBlur" placeholder="请输入身份证号码" bindinput="bindForm"></input>
<input disabled="{{disabled}}" value="{{form.certificateNo}}" style="width:65%" type="idcard" bindblur="inputBlur" placeholder="请输入身份证号码" bindinput="bindForm"></input>
</view> </view>
</view> </view>
</view> </view>

2
pages/home/idcard/index.js

@ -40,7 +40,7 @@ Page({
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
certificateImage(this.data.form).then(result => { certificateImage(this.data.form).then(result => {
wx.hideLoading() wx.hideLoading()
var tokenJson = JSON.stringify({token: result.data.identityAuthToken, idCardNo: result.data.idCardNo, realName: result.data.realName})
var tokenJson = JSON.stringify(result.data)
wx.setStorageSync('identityAuthToken', tokenJson) wx.setStorageSync('identityAuthToken', tokenJson)
wx.navigateTo({ url: '/pages/home/authory/index' }) wx.navigateTo({ url: '/pages/home/authory/index' })
}).catch(error => { }).catch(error => {

19
pages/home/info/index.js

@ -1,4 +1,4 @@
import { getBaseInfo, modifyMemberInfo } from '../../api/ztb'
import { zconfig, getBaseInfo, modifyMemberInfo } from '../../api/ztb'
const util = require('../../../utils/util') const util = require('../../../utils/util')
const app = getApp() const app = getApp()
@ -54,18 +54,13 @@ Page({
}, },
uploadFile: function (path) { uploadFile: function (path) {
var that = this var that = this
wx.showLoading({
title: '上传中',
mask: true
})
wx.showLoading({ title: '上传中', mask: true })
var header = { ...zconfig.header, 'X-APP-ID': app.xAppId, appversion: app.version }
this.task = wx.uploadFile({ this.task = wx.uploadFile({
url: app.httpUrl + '/saas-user/utils/uploadImage',
url: zconfig.baseUrl + '/recycle-user-center/file-uploading/upload/image',
filePath: path, filePath: path,
name: 'image', name: 'image',
header: {
'Content-Type': 'multipart/form-data',
'appversion': app.version
},
header,
success: function (result) { success: function (result) {
var resp = null var resp = null
if (!util.isEmpty(result.data)) { if (!util.isEmpty(result.data)) {
@ -119,9 +114,7 @@ Page({
}, },
toAuth: function(){ toAuth: function(){
if(this.data.userInfo && !this.data.userInfo.isAuth){ if(this.data.userInfo && !this.data.userInfo.isAuth){
wx.navigateTo({
url: '/pages/home/idcard/index'
})
wx.navigateTo({ url: '/pages/home/idcard/index' })
} }
}, },
//通过事件执行更换头像方法比如点击头像执行该方法 //通过事件执行更换头像方法比如点击头像执行该方法

10
pages/morder/detail/index.js

@ -1,5 +1,5 @@
// pages/morder/detail/index.js // pages/morder/detail/index.js
import { getStoreOrderInfo, getUserOrderInfo, uploadStoreOrder, payOffline, getCancelUserOrder, returnOrderTrade, confirmUserOrder, confirmStorerOrder, confirmOrderTrade, applyUserOrder } from "../../api/ztb"
import { zconfig, getStoreOrderInfo, getUserOrderInfo, uploadStoreOrder, payOffline, getCancelUserOrder, returnOrderTrade, confirmUserOrder, confirmStorerOrder, confirmOrderTrade, applyUserOrder } from "../../api/ztb"
const util = require('../../../utils/util') const util = require('../../../utils/util')
const math = require('../../../utils/math') const math = require('../../../utils/math')
const event = require('../../../utils/event') const event = require('../../../utils/event')
@ -636,14 +636,12 @@ Page({
}, },
uploadFile: function (index, path) { uploadFile: function (index, path) {
var _this = this var _this = this
var header = { ...zconfig.header, 'X-APP-ID': app.xAppId, appversion: app.version, 'Content-Type': 'multipart/form-data' }
const task = wx.uploadFile({ const task = wx.uploadFile({
url: app.httpUrl + '/saas-user/utils/uploadImage',
url: zconfig.baseUrl + '/recycle-user-center/file-uploading/upload/image',
filePath: path, filePath: path,
name: 'image', name: 'image',
header: {
'Content-Type': 'multipart/form-data',
'appversion': app.version
},
header,
success: function (result) { success: function (result) {
var resp = null var resp = null
if (!util.isEmpty(result.data)) { if (!util.isEmpty(result.data)) {

Loading…
Cancel
Save