Commit c27bf028 authored by linxin's avatar linxin

支付接口

parent 39c0fe31
......@@ -323,7 +323,7 @@ export default {
vm.user_bp_status = res.info.user_bp_status
vm.user_bp_class = res.info.user_bp_class
vm.bp_id = res.info.user_bp_id
window.sessionStorage.setItem('bp_id', 7850)
window.sessionStorage.setItem('bp_id', res.info.user_bp_id)
vm.user_bp_name = res.info.user_bp_name
vm.user_bp_type = res.info.user_bp_type
vm.user_phone = res.info.user_phone
......
......@@ -12,10 +12,7 @@
<div><span></span>{{ money |currency }}</div>
</div>
</div>
<h-content v-if="prj_lists.length===0" class="none">
<p>暂无记录</p>
</h-content>
<h-content v-if="prj_lists.length!==0" class="pay-content">
<h-content class="pay-content">
<section v-for="(item,index) in prj_lists" :key="index" class="contract-item">
<div class="header">
<img src="@/assets/payment/contract.png" alt="">
......@@ -35,7 +32,7 @@
</div>
</section>
</h-content>
<div v-if="prj_lists.length!==0" class="prompt">
<div class="prompt">
<div><img src="@/assets/payment/prompt.png" alt=""></div>
<div>
<p>温馨提示</p>
......@@ -43,7 +40,7 @@
<p>由于存在款项到账时差性,“已还金额”字段可能XXX,给您造成的不便,请谅解,谢谢!</p>
</div>
</div>
<bottom-tab v-if="prj_lists.length!==0" >
<bottom-tab >
<tab-button class="footer" @click.native="createDetail">
&nbsp;&nbsp;
</tab-button>
......@@ -380,10 +377,6 @@ export default {
height: 40px;
margin: 4px 2% 0 2%;
}
.none{
display:flex;
justify-content: center;
align-items: center;
}
}
</style>
......@@ -75,15 +75,17 @@ export default {
})
},
pay () {
let money = parseFloat(this.money)
let theDefault = parseFloat(this.default)
if (money > 0 && money <= theDefault) {
this.payProtocol()
} else if (money > theDefault) {
hlsPopup.showLongCenter('当前支付金额超出应还金额!')
} else if (money === 0) {
hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
}
// let money = parseFloat(this.money)
// let theDefault = parseFloat(this.default)
// if (money > 0 && money <= theDefault) {
// this.payProtocol()
// } else if (money > theDefault) {
// hlsPopup.showLongCenter('当前支付金额超出应还金额!')
// } else if (money === 0) {
// hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
// }
},
payProtocol () {
let vm = this
......
......@@ -27,26 +27,26 @@
<img v-show="select !== 'two'" src="@/assets/payment/unselect.png" alt="">
</section>
</item>
<item :proportion="[7,1,1]" @click.native="isSelect('three')">
<div slot="name" style="flex=3"> <img src="@/assets/payment/ly.png" alt="" class="icon"> 中国农业银行</div>
<item v-for="(item,index) in lists" :proportion="[7,1,1]" :key="index" @click.native="isSelect(`three${index}`)">
<div slot="name" style="flex=3"> <img src="@/assets/payment/ly.png" alt="" class="icon"> {{ item.bank_full_name }}({{ selectLast(item) }})</div>
<section slot="content">
<img v-show="select === 'three'" src="@/assets/payment/select.png" alt="">
<img v-show="select !== 'three'" src="@/assets/payment/unselect.png" alt="">
<img v-show="select === `three${index}`" src="@/assets/payment/select.png" alt="">
<img v-show="select !== `three${index}`" src="@/assets/payment/unselect.png" alt="">
</section>
</item>
<item :proportion="[7,1,1]" @click.native="isSelect('four')">
<!-- <item :proportion="[7,1,1]" @click.native="isSelect('four')">
<div slot="name"> <img src="@/assets/payment/js.png" alt="" class="icon"> 中国建设银行</div>
<section slot="content">
<img v-show="select === 'four'" src="@/assets/payment/select.png" alt="">
<img v-show="select !== 'four'" src="@/assets/payment/unselect.png" alt="">
</section>
</item>
</item> -->
</list-item>
</h-content>
<bottom-tab>
<tab-button class="footer">
<tab-button class="footer" @click.native="pay">
立即付款
</tab-button>
</bottom-tab>
......@@ -64,7 +64,7 @@ export default {
money: '',
select: 'one',
name: '',
lists: [],
}
},
computed: {},
......@@ -72,15 +72,42 @@ export default {
beforeRouteEnter (to, from, next) {
next(vm => {
vm.name = from.name
vm.getType()
})
},
activated () {
this.money = this.$route.params.money
},
methods: {
selectLast (item) {
let num = item.bank_account_num
return num.substring(num.length - 4)
},
isSelect (way) {
this.select = way
},
pay () {
let vm = this
setTimeout(() => {
vm.hlsPopup.showSuccess('支付成功!')
}, 1000)
},
getType () {
let vm = this
let url = process.env.basePath + 'payment_method_query'
let param = {
bp_id: window.sessionStorage.getItem('bp_id'),
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.lists = res.lists
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
},
}
</script>
......
......@@ -27,26 +27,26 @@
<img v-show="select !== 'two'" src="@/assets/payment/unselect.png" alt="">
</section>
</item>
<item :proportion="[7,1,1]" @click.native="isSelect('three')">
<div slot="name" style="flex=3"> <img src="@/assets/payment/ly.png" alt="" class="icon"> 中国农业银行</div>
<item v-for="(item,index) in lists" :proportion="[7,1,1]" :key="index" @click.native="isSelect(`three${index}`)">
<div slot="name" style="flex=3"> <img src="@/assets/payment/ly.png" alt="" class="icon"> {{ item.bank_full_name }}({{ selectLast(item) }})</div>
<section slot="content">
<img v-show="select === 'three'" src="@/assets/payment/select.png" alt="">
<img v-show="select !== 'three'" src="@/assets/payment/unselect.png" alt="">
<img v-show="select === `three${index}`" src="@/assets/payment/select.png" alt="">
<img v-show="select !== `three${index}`" src="@/assets/payment/unselect.png" alt="">
</section>
</item>
<item :proportion="[7,1,1]" @click.native="isSelect('four')">
<!-- <item :proportion="[7,1,1]" @click.native="isSelect('four')">
<div slot="name"> <img src="@/assets/payment/js.png" alt="" class="icon"> 中国建设银行</div>
<section slot="content">
<img v-show="select === 'four'" src="@/assets/payment/select.png" alt="">
<img v-show="select !== 'four'" src="@/assets/payment/unselect.png" alt="">
</section>
</item>
</item> -->
</list-item>
</h-content>
<bottom-tab>
<tab-button class="footer">
<tab-button class="footer" @click.native="pay">
立即付款
</tab-button>
</bottom-tab>
......@@ -63,7 +63,7 @@ export default {
return {
money: '',
select: 'one',
lists: [],
}
},
computed: {},
......@@ -75,12 +75,39 @@ export default {
} else if (from.name === 'PaymentContractRecord') {
vm.money = vm.$route.params.sumMoney
}
vm.getType()
})
},
methods: {
pay () {
let vm = this
setTimeout(() => {
vm.hlsPopup.showSuccess('支付成功!')
}, 1000)
},
selectLast (item) {
let num = item.bank_account_num
return num.substring(num.length - 4)
},
isSelect (way) {
this.select = way
},
getType () {
let vm = this
let url = process.env.basePath + 'payment_method_query'
let param = {
bp_id: window.sessionStorage.getItem('bp_id'),
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.lists = res.lists
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
changePage () {
this.$router.replace({
name: 'PaymentContractRecord',
......
......@@ -178,7 +178,7 @@ export default new Router({
{path: '/contract-record', component: ContractRecord, name: 'ContractRecord', meta: {keepAlive: true}},
// 款项支付
{path: '/payment-first-pay', component: PaymentFirstPay, name: 'PaymentFirstPay', meta: {keepAlive: true}},
{path: '/payment-pay-entry', component: PaymentPayEntry, name: 'PaymentPayEntry', meta: {keepAlive: true}},
{path: '/payment-pay-entry', component: PaymentPayEntry, name: 'PaymentPayEntry', meta: {keepAlive: false}},
{path: '/payment-contract-record', component: PaymentContractRecord, name: 'PaymentContractRecord', meta: {keepAlive: true}},
// 保证金支付
{path: '/margin-first-pay', component: MarginFirstPay, name: 'MarginFirstPay', meta: {keepAlive: true}},
......@@ -186,7 +186,7 @@ export default new Router({
// 产品查询
{path: '/query-home', component: QueryHome, name: 'QueryHome', meta: {keepAlive: true}},
{path: '/product-detailed', component: ProDetailed, name: 'ProDetailed', meta: {keepAlive: true}},
{path: '/product-list', component: ProductList, name: 'ProductList', meta: {keepAlive: true}},
{path: '/product-list', component: ProductList, name: 'ProductList', meta: {keepAlive: false}},
// 帮助与反馈
{path: '/help-list', component: HelpList, name: 'HelpList', meta: {keepAlive: true}},
{path: '/help-detail', component: HelpDetail, name: 'HelpDetail', meta: {keepAlive: true}},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment