Browse Source

合并

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

150
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,14 +43,15 @@
<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>
@ -61,7 +63,7 @@
</u--form> </u--form>
<u-button class="button" color="#00E8A2" :throttleTime="500" @click="bank" v-if="!hideButton"> <u-button class="button" color="#00E8A2" :throttleTime="500" @click="bank" v-if="!hideButton">
{{ i18n.Confirm }} {{ i18n.Confirm }}
</u-button> </u-button>
</view> </view>
@ -79,7 +81,9 @@
name: "withdrawalRecord", name: "withdrawalRecord",
data() { data() {
return { return {
hideButton:false, language: '',
ticket: '',
hideButton: false,
baseURL: '', baseURL: '',
fileList1: [], fileList1: [],
rules: { rules: {
@ -100,7 +104,7 @@
bankInfo: { bankInfo: {
name: null, name: null,
certId: null, certId: null,
certFrontImgPath:null certFrontImgPath: null
}, },
pageState: 'addBank', // , pageState: 'addBank', // ,
@ -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,84 +166,45 @@
}, },
uploadFilePromise(url) { uploadFilePromise(url) {
// #ifdef APP-PLUS
console.log(url) console.log(url)
pathToBase64(url) return new Promise((resolve, reject) => {
.then(path => { let a = uni.uploadFile({
console.log(path) url: this.baseURL + '/api/user/uploadImg1', //
let res=path filePath: url,
res = res.split(',')[1] name: 'file',
console.log(res,'res') formData: {
return new Promise((resolve, reject) => { ticket: this.ticket,
api.uploadImg({ lang: this.language,
img: res },
}).then(res => { 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) console.log(res)
}) }
});
// #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(this.bankInfo.certFrontImgPath)
})
})
}
// #endif
}, },
//
getBank() {
api.certificationInfo().then(res => {
getBase64(file) { this.bankInfo = res;
return new Promise((resolve, reject) => { this.bankInfo.certFrontImgPath = res.certFrontImg
const reader = new FileReader() if (this.bankInfo.auditStatus == 'agree' || this.bankInfo.auditStatus == 'apply') {
reader.readAsDataURL(file) this.hideButton = true
reader.onload = () => resolve(reader.result) }
reader.onerror = (error) => reject(error)
}) })
}, },
//
getBank() {
api.certificationInfo().then(res => {
this.bankInfo = res;
this.bankInfo.certFrontImgPath=res.certFrontImg
if(this.bankInfo.auditStatus=='agree'||this.bankInfo.auditStatus=='apply'){
this.hideButton=true
}
})
},
// //
bank() { bank() {
if(!this.bankInfo.certFrontImgPath){ if (!this.bankInfo.certFrontImgPath) {
uni.$u.toast(this.$t("withdrawal").enterIdCard) uni.$u.toast(this.$t("withdrawal").enterIdCard)
return; return;
} }
@ -248,8 +215,8 @@
certFrontImgPath: this.bankInfo.certFrontImgPath certFrontImgPath: this.bankInfo.certFrontImgPath
} }
api.certification(bankInfo).then(res => { api.certification(bankInfo).then(res => {
uni.$u.toast(this.$t("me").addSuccessfully) uni.$u.toast(this.$t("me").addSuccessfully)
this.getBank() this.getBank()
}) })
}).catch(errors => { }).catch(errors => {
@ -261,20 +228,21 @@
</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{
position:relative; /deep/ .u-upload {
.add{ position: relative;
width: 620rpx !important;
height: 360rpx !important; .add {
width: 620rpx !important;
height: 360rpx !important;
} }
} }
/deep/ .u-upload__wrap__preview__image { /deep/ .u-upload__wrap__preview__image {
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