Browse Source

合并

master
j1ack 3 years ago
parent
commit
2bebed2642
  1. 94
      pages/me/confirmInfo.vue
  2. 2
      utils/api.js
  3. 2
      utils/axios.js

94
pages/me/confirmInfo.vue

@ -18,7 +18,8 @@
<view class="title" v-if="bankInfo.auditStatus=='reject'">{{ i18n.Reasonforrejection }}</view> <view class="title" v-if="bankInfo.auditStatus=='reject'">{{ i18n.Reasonforrejection }}</view>
<view class="" style="word-break: break-all;margin-bottom: 20rpx;" v-if="bankInfo.auditStatus=='reject'"> <view class="" style="word-break: break-all;margin-bottom: 20rpx;"
v-if="bankInfo.auditStatus=='reject'">
{{bankInfo.auditReason}} {{bankInfo.auditReason}}
</view> </view>
@ -42,13 +43,14 @@
<view class="title" v-show="bankInfo.auditStatus!='agree'">{{ i18n.IDcard }}</view> <view class="title" v-show="bankInfo.auditStatus!='agree'">{{ i18n.IDcard }}</view>
<u-upload v-show="bankInfo.auditStatus!='agree'" :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple <u-upload v-show="bankInfo.auditStatus!='agree'" :fileList="fileList1" @afterRead="afterRead"
:maxCount="1"> @delete="deletePic" name="1" multiple :maxCount="1">
<image class="add" src="/static/home/id.png" mode="aspectFit" v-if="!bankInfo.certFrontImgPath"></image> <image class="add" src="/static/home/id.png" mode="aspectFit"
v-if="!bankInfo.certFrontImgPath"></image>
<image :src="baseURL+bankInfo.certFrontImgPath" <image :src="baseURL+bankInfo.certFrontImgPath" mode="" class="add"
mode="" class="add" v-if="bankInfo.certFrontImgPath"></image> v-if="bankInfo.certFrontImgPath"></image>
</u-upload> </u-upload>
@ -79,6 +81,8 @@
name: "withdrawalRecord", name: "withdrawalRecord",
data() { data() {
return { return {
language: '',
ticket: '',
hideButton: false, hideButton: false,
baseURL: '', baseURL: '',
fileList1: [], fileList1: [],
@ -120,6 +124,8 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.language = uni.getStorageSync("language") || 'en_US';
this.ticket = uni.getStorageSync('ticket')
this.getBank() this.getBank()
this.baseURL = constant.BASE_URL this.baseURL = constant.BASE_URL
}, },
@ -128,6 +134,7 @@
// //
deletePic(event) { deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1) this[`fileList${event.name}`].splice(event.index, 1)
this.bankInfo.certFrontImgPath = null;
}, },
// //
@ -138,7 +145,6 @@
}) })
// mutiple true , file // mutiple true , file
let lists = [].concat(event.file) let lists = [].concat(event.file)
console.log(event)
let fileListLen = this[`fileList${event.name}`].length let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => { lists.map((item) => {
this[`fileList${event.name}`].push({ this[`fileList${event.name}`].push({
@ -160,70 +166,31 @@
}, },
uploadFilePromise(url) { uploadFilePromise(url) {
// #ifdef APP-PLUS
console.log(url) console.log(url)
pathToBase64(url)
.then(path => {
console.log(path)
let res=path
res = res.split(',')[1]
console.log(res,'res')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
api.uploadImg({ let a = uni.uploadFile({
img: res url: this.baseURL + '/api/user/uploadImg1', //
}).then(res => { filePath: url,
name: 'file',
formData: {
ticket: this.ticket,
lang: this.language,
},
success: (res) => {
setTimeout(() => {
uni.hideLoading() uni.hideLoading()
this.bankInfo.certFrontImgPath=res let data = JSON.parse(res.data)
}) this.bankInfo.certFrontImgPath = data.data
}) }, 1000)
}) },
.catch(error => { failed(res) {
uni.hideLoading() uni.hideLoading()
console.error(error)
})
// #endif
// #ifdef H5
const image = new Image() // imgDOM)
//blob:http://localhost:8080/b878edea-e649-4f8d-b723-c3f25454141b
image.src = url;
image.onload = () => {
const canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
const context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height);
let imgUrl = canvas.toDataURL() //base64
imgUrl = imgUrl.split(',')[1]
return new Promise((resolve, reject) => {
api.uploadImg({
img: imgUrl
}).then(res => {
this.bankInfo.certFrontImgPath=res
console.log(res) console.log(res)
console.log(this.bankInfo.certFrontImgPath)
})
})
} }
// #endif });
},
getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => resolve(reader.result)
reader.onerror = (error) => reject(error)
}) })
}, },
// //
getBank() { getBank() {
api.certificationInfo().then(res => { api.certificationInfo().then(res => {
@ -261,12 +228,13 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .uicon-camera-fill { /deep/ .uicon-camera-fill {
display: none !important; display: none !important;
} }
/deep/ .u-upload { /deep/ .u-upload {
position: relative; position: relative;
.add { .add {
width: 620rpx !important; width: 620rpx !important;
height: 360rpx !important; height: 360rpx !important;

2
utils/api.js

@ -6,7 +6,7 @@ const api = {
rechargeAddress: (params) => Vue.prototype.$axios.post('/api/recharge/rechargeAddress',params),//获取对应数字币种的充值地址 rechargeAddress: (params) => Vue.prototype.$axios.post('/api/recharge/rechargeAddress',params),//获取对应数字币种的充值地址
recharge: (params) => Vue.prototype.$axios.post('/api/recharge/recharge',params),//法币在线充值下单 recharge: (params) => Vue.prototype.$axios.post('/api/recharge/recharge',params),//法币在线充值下单
rechargeList: (params) => Vue.prototype.$axios.post('/api/recharge/rechargeList',params),//充值记录 rechargeList: (params) => Vue.prototype.$axios.post('/api/recharge/rechargeList',params),//充值记录
uploadImg: (params) => Vue.prototype.$axios.post('/api/user/uploadImg',params),//充值记录 uploadImg: (params) => Vue.prototype.$axios.post('/api/user/uploadImg1',params),//充值记录
//--------------------------------- withdraw提现 --------------------------------- //--------------------------------- withdraw提现 ---------------------------------

2
utils/axios.js

@ -29,7 +29,7 @@ service.interceptors.request.use(
// mask: true // mask: true
// }) // })
} }
console.log(config.url) console.log(config.data)
if (config.url.indexOf("/api/index/register") !== -1 || if (config.url.indexOf("/api/index/register") !== -1 ||
config.url.indexOf("/api/user/login") !== -1 || config.url.indexOf("/api/user/login") !== -1 ||
config.url.indexOf("/api/user/forgotPassword") !== -1 || config.url.indexOf("/api/user/forgotPassword") !== -1 ||

Loading…
Cancel
Save