Commit c27bf028 authored by linxin's avatar linxin

支付接口

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