commit
This commit is contained in:
+14
-2
@@ -1,6 +1,10 @@
|
||||
package io.v.nutz.zhgh.memberCost.h5controller;
|
||||
|
||||
import com.ijpay.wxpay.model.v3.Amount;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.payment.wxpay.service.WxPayCommonService;
|
||||
import io.v.nutz.base.payment.wxpay.vo.WxPayNeedParamVo;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.memberCost.service.MemberPaymentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -25,6 +29,8 @@ public class MobileMemberCostListController {
|
||||
|
||||
@Inject
|
||||
private MemberPaymentService memberPaymentService;
|
||||
@Inject
|
||||
private WxPayCommonService wxPayCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/mobile/memberCost/memberCostList.html")
|
||||
@@ -41,7 +47,6 @@ public class MobileMemberCostListController {
|
||||
public void summary() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(Integer memberActive) {
|
||||
@@ -67,5 +72,12 @@ public class MobileMemberCostListController {
|
||||
return memberPaymentService.fetch(id);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
public Object pullWeChatPay(Integer money, String busId) {
|
||||
WxPayNeedParamVo wxPayNeedParamVo = new WxPayNeedParamVo();
|
||||
wxPayNeedParamVo.setDescription("会费缴纳");
|
||||
wxPayNeedParamVo.setMemberPaymentInfoId(busId);
|
||||
wxPayNeedParamVo.setAmount(new Amount().setTotal(money));
|
||||
return wxPayCommonService.jsApiPay(wxPayNeedParamVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1741597488639" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3556" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1007.00026 280.122039c-19.967068-135.446124-127.709596-243.188651-263.127276-263.15572A1592.10348 1592.10348 0 0 0 291.371434 15.373505a323.11381 323.11381 0 0 0-276.040452 276.040451 1594.549588 1594.549588 0 0 0 1.621258 452.444664c19.910182 135.446124 127.709596 243.217094 263.127276 263.155719a1591.705276 1591.705276 0 0 0 463.793468 0c135.389237-19.910182 243.188651-127.709596 263.098833-263.155719a1591.591504 1591.591504 0 0 0 0-463.736581" fill="#FFB123" p-id="3557"></path><path d="M668.413394 540.433446a156.437144 156.437144 0 1 1 0 312.874289 156.437144 156.437144 0 0 1 0-312.874289z m-56.089827 85.386238l-0.654192 0.398204-13.937127 15.131738c-0.369761 0.398204-0.511976 0.967066-0.36976 1.479042l0.36976 0.711078 37.061382 40.247011a1.621258 1.621258 0 0 1-0.170659 2.332335l-0.82485 0.284431h-24.517967c-0.568862 0-1.080838 1.877246-1.308384 3.157186l-0.113772 1.023953v21.389224c0 0.568862 0.284431 1.052395 0.711078 1.308383l0.711078 0.227545h46.44761a2.844312 2.844312 0 0 1 2.616767 1.848803l0.199101 1.194611v19.853295c0 0.568862-0.284431 1.052395-0.682634 1.336827l-0.711078 0.199102H609.25171a1.393713 1.393713 0 0 0-1.223054 0.767964l-0.199101 0.767964v21.389224c0 0.568862 0.284431 1.052395 0.711078 1.308383l0.711077 0.227545h47.869767c0.511976 0 0.967066 0.284431 1.223054 0.739521l0.170658 0.796408v30.946111c0 0.568862 0.284431 1.052395 0.711078 1.336827l0.711078 0.199101h19.71108c0.511976 0 0.967066-0.284431 1.223054-0.767964l0.170659-0.767964v-30.946111c0-0.568862 0.284431-1.052395 0.711078-1.336827l0.711078-0.199102h47.869766c0.511976 0 0.967066-0.312874 1.223054-0.767964l0.170659-0.767964v-21.389224c0-0.568862-0.284431-1.052395-0.682635-1.308383l-0.711078-0.227545h-47.869766a1.393713 1.393713 0 0 1-1.223054-0.767965l-0.199102-0.767964v-19.853295c0-1.251497 0.711078-2.360779 1.706587-2.815869l1.137725-0.227545h46.44761c0.511976 0 0.967066-0.312874 1.223054-0.767964l0.170659-0.767964v-21.389224a11.377247 11.377247 0 0 0-0.853294-3.669163l-0.568862-0.511976h-27.305393c-0.938623 0-1.535928-0.938623-1.393712-1.791916l0.398203-0.82485 37.061382-40.247011a1.649701 1.649701 0 0 0 0.398204-1.479042l-0.341318-0.711078-13.937127-15.131738a1.336827 1.336827 0 0 0-1.36527-0.398204l-0.625748 0.398204-50.799408 55.122761a5.318863 5.318863 0 0 1-6.513473 1.137724l-1.422156-1.137724-50.82785-55.122761c-0.369761-0.398204-0.853294-0.540419-1.336827-0.398204zM682.634953 256.002275a56.886234 56.886234 0 0 1 56.886234 56.886235v213.266492A184.880261 184.880261 0 0 0 497.726248 767.978383H312.87443a56.886234 56.886234 0 0 1-56.886234-56.886234V312.88851a56.886234 56.886234 0 0 1 56.886234-56.886235h369.760523z m-170.658703 199.10182h-142.215585a28.443117 28.443117 0 0 0-3.327845 56.687133L369.760665 511.990329h142.215585a28.443117 28.443117 0 0 0 0-56.886234z m113.772468-113.772468h-255.988053a28.443117 28.443117 0 0 0-3.327845 56.687132L369.760665 398.217861h255.988053a28.443117 28.443117 0 0 0 0-56.886234z" fill="#FFFFFF" p-id="3558"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -3,45 +3,70 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.module {
|
||||
margin: 10px 10px 14px 10px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
|
||||
.parent-card {
|
||||
margin: 14px;
|
||||
padding: 12px 12px;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
line-height: 22px;
|
||||
font-size: 13px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
row-gap: 10px;
|
||||
background-color: white;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
padding: 6px 0px;
|
||||
}
|
||||
|
||||
.menu_img {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.menu_img_yjf {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
width: 100px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.pay_img {
|
||||
margin-right: 5px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.member_cost .van-cell__title {
|
||||
.content-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.left-child-card {
|
||||
display: table;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.left-child-card img {
|
||||
display: table-cell;
|
||||
width: 40px;
|
||||
}
|
||||
.footer-card {
|
||||
text-align: right;
|
||||
}
|
||||
.footer-card .van-button {
|
||||
border-radius: 6px;
|
||||
height: 28px;
|
||||
}
|
||||
.pay-content {
|
||||
|
||||
}
|
||||
.pay-content .van-cell {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.pay-content .van-cell__title {
|
||||
color: #646566;
|
||||
}
|
||||
.pay_img {
|
||||
display: table;
|
||||
}
|
||||
.pay_img img {
|
||||
display: table-cell;
|
||||
}
|
||||
.costFormula {
|
||||
|
||||
}
|
||||
.costFormula .van-cell__title {
|
||||
max-width: 100px;
|
||||
}
|
||||
.van-action-sheet__content {
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
.van-dropdown-menu__bar {
|
||||
box-shadow: none;
|
||||
}
|
||||
.van-empty {
|
||||
position: relative;
|
||||
transform: none;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
@@ -49,255 +74,311 @@ layout("/mobile/platform.html"){
|
||||
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" left-arrow title="会费支付"></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<div>
|
||||
<van-tabs @change="pageData" v-model="memberActive">
|
||||
<van-tab title="未缴费"></van-tab>
|
||||
<van-tab title="已缴费"></van-tab>
|
||||
</van-tabs>
|
||||
<van-dropdown-menu active-color="#1989fa">
|
||||
<van-dropdown-item v-model="pageForm.year" @change="doSearch" :options="yearList"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.isPay" @change="doSearch" :options="payList"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
|
||||
<van-row class="module" v-for="p in payList">
|
||||
<div class="menu">
|
||||
<van-col :span="8" style="padding: 10px">
|
||||
<van-image height="6rem" round src="/assets/mobile/svg/memberPay/hf.svg" width="6rem"></van-image>
|
||||
</van-col>
|
||||
<van-col :span="16" style="position: relative">
|
||||
<div style="text-align: left">
|
||||
会费项目:
|
||||
<div style="font-weight: bold; font-size: 14px">{{p.projectName}}</div>
|
||||
</div>
|
||||
<div style="text-align: left">
|
||||
会费标准:
|
||||
<div v-if="p.selectMode==='1'" style="font-weight: bold; font-size: 14px">{{p.modeValue}}</div>
|
||||
<div v-if="p.selectMode==='2'" style="font-weight: bold; font-size: 14px">{{p.modeValueName}}</div>
|
||||
</div>
|
||||
<div style="text-align: left" v-if="p.paymentMoney&&p.isPayment">已缴费金额:{{p.paymentMoney}}</div>
|
||||
<div class="menu_img" v-if="!p.isPayment">
|
||||
<van-button @click.stop="openAlipay(p)" color="#1867b0" round size="mini" style="width: 75px; height: 30px" type="primary">
|
||||
我要缴费
|
||||
</van-button>
|
||||
</div>
|
||||
<div class="menu_img_yjf" v-if="p.isPayment">
|
||||
<van-image src="/assets/mobile/svg/memberPay/yjf.svg"></van-image>
|
||||
</div>
|
||||
</van-col>
|
||||
<el-col span="2"></el-col>
|
||||
</div>
|
||||
</van-row>
|
||||
|
||||
<van-action-sheet :close-on-click-overlay="false" :title="viewData.projectName" style="height: 60%" v-model="payShow">
|
||||
<div class="member_cost">
|
||||
<div v-if="viewData.selectMode==='2'">
|
||||
<van-cell :value="costFormula" title="会费计算公式"></van-cell>
|
||||
<van-cell-group>
|
||||
<van-field
|
||||
:label="o.name"
|
||||
:placeholder="'请输入'+o.name"
|
||||
@input="moneyInput"
|
||||
input-align="right"
|
||||
type="number"
|
||||
v-for="(o,index) in viewData.modeValueList"
|
||||
v-model="o.value"
|
||||
>
|
||||
<template #left-icon>
|
||||
<div class="pay_img">
|
||||
<van-image src="/assets/mobile/svg/memberPay/money.svg"></van-image>
|
||||
</div>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
<div class="parent-card">
|
||||
<div v-for="item in tableData">
|
||||
<div class="content-card">
|
||||
<div class="left-child-card">
|
||||
<img src="/assets/mobile/svg/memberPay/icon_xsgj.svg"/>
|
||||
</div>
|
||||
<div>
|
||||
<van-radio-group checked-color="#1867b0" v-model="moneyModel">
|
||||
<van-cell-group>
|
||||
<van-cell @click="moneyModel = 1" clickable title="支付宝">
|
||||
<template #icon>
|
||||
<div class="pay_img">
|
||||
<van-image src="/assets/mobile/svg/memberPay/zfb.svg"></van-image>
|
||||
</div>
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<van-radio :name="1"></van-radio>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell @click="moneyModel = 2" clickable title="微信">
|
||||
<template #icon>
|
||||
<div class="pay_img">
|
||||
<van-image src="/assets/mobile/svg/memberPay/wx.svg"></van-image>
|
||||
</div>
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<van-radio :name="2"></van-radio>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</van-radio-group>
|
||||
<div class="right-child-card">
|
||||
<div>
|
||||
<span>项目名称:</span>
|
||||
<span>{{item.projectName}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>所属时间:</span>
|
||||
<span>{{item.paymentStartMonth}} 至 {{item.paymentEndMonth}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>缴费时间:</span>
|
||||
<span>{{moment(item.startTime).format('MM-DD') + ' 至 ' + moment(item.endTime).format('MM-DD')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<van-submit-bar :loading="loading" :price="money" @submit="doAlipay" button-color="#1867b0" button-text="支付"></van-submit-bar>
|
||||
</van-action-sheet>
|
||||
|
||||
<van-popup :style="{ height: '100%', width: '100%'}" @close="imgClose" closeable position="right" v-model="zfImg">
|
||||
<van-image src="/assets/mobile/svg/memberPay/zf_img.png" style="margin-top: 40px; height: 95%; width: 100%"></van-image>
|
||||
</van-popup>
|
||||
|
||||
<div class="footer-card">
|
||||
<van-button v-if="!item.isPayment" @click.stop="openPay(item)" color="#1867b0" size="small" type="primary">
|
||||
我要缴费
|
||||
</van-button>
|
||||
<van-button v-if="item.isPayment" size="small" type="primary" :disabled="true">
|
||||
您已缴费
|
||||
</van-button>
|
||||
</div>
|
||||
</div>
|
||||
<van-empty
|
||||
class="custom-image"
|
||||
description="暂无缴费记录"
|
||||
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
|
||||
v-if="payList&&payList.length===0"
|
||||
v-if="tableData && tableData.length===0"
|
||||
></van-empty>
|
||||
</div>
|
||||
|
||||
<van-action-sheet :close-on-click-overlay="false" :title="payInfo.projectName" style="height: 60%" v-model="payVisible" @close="payVisibleClose">
|
||||
<div class="pay-content">
|
||||
<template>
|
||||
<van-cell class="costFormula" title="缴费所属时间">
|
||||
<template #right-icon>
|
||||
{{formData.paymentStartMonth}} 至 {{formData.paymentEndMonth}}
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell class="costFormula" title="缴费标准">
|
||||
<template #right-icon>
|
||||
<div style="color: red"
|
||||
v-if="formData.payModeValueList&&formData.payModeValueList.length>0">
|
||||
(
|
||||
<template v-for="(o,i) in formData.payModeValueList">
|
||||
{{o.name}}
|
||||
<template v-if="i != formData.payModeValueList.length - 1">+</template>
|
||||
</template>
|
||||
) * 0.5% * {{formData.paymentMonth}}个月
|
||||
</div>
|
||||
<div v-else>固定金额缴费</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-field
|
||||
:label="o.name"
|
||||
:placeholder="'请输入' + o.name"
|
||||
@input="moneyInput"
|
||||
input-align="right"
|
||||
type="number"
|
||||
v-for="(o,index) in formData.payModeValueList"
|
||||
v-model="o.value"
|
||||
>
|
||||
<template #left-icon>
|
||||
<div class="pay_img">
|
||||
<img src="/assets/mobile/svg/memberPay/money.svg"/>
|
||||
</div>
|
||||
</template>
|
||||
</van-field>
|
||||
</template>
|
||||
|
||||
<van-radio-group checked-color="#1867b0" v-model="moneyModel">
|
||||
<van-cell @click="moneyModel = 1" clickable title="支付宝">
|
||||
<template #icon>
|
||||
<div class="pay_img" style="margin-right: 4px">
|
||||
<img src="/assets/mobile/svg/memberPay/zfb.svg"/>
|
||||
</div>
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<van-radio :name="1"></van-radio>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell @click="moneyModel = 2" clickable title="微信">
|
||||
<template #icon>
|
||||
<div class="pay_img" style="margin-right: 4px">
|
||||
<img src="/assets/mobile/svg/memberPay/wx.svg"/>
|
||||
</div>
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<van-radio :name="2"></van-radio>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-radio-group>
|
||||
<van-submit-bar :loading="loading" :price="formData.paymentMoney" @submit="doPay" button-color="#1867b0" button-text="支付"></van-submit-bar>
|
||||
</div>
|
||||
|
||||
</van-action-sheet>
|
||||
|
||||
<van-popup :style="{ height: '100%', width: '100%'}" @close="imgClose" closeable position="right" v-model="payToOtherPage">
|
||||
<van-image src="/assets/mobile/svg/memberPay/zf_img.png" style="margin-top: 40px; height: 95%; width: 100%"></van-image>
|
||||
</van-popup>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="https://res2.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
|
||||
<script>
|
||||
function onBridgeReady(json) {
|
||||
// const data = JSON.parse(json)
|
||||
WeixinJSBridge.invoke("getBrandWCPayRequest", JSON.parse(json), function (res) {
|
||||
if (res.err_msg === "get_brand_wcpay_request:ok") {
|
||||
// 使用以上方式判断前端返回,微信团队郑重提示:
|
||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||
}
|
||||
})
|
||||
}
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
zfImg: false,
|
||||
payToOtherPage: false,
|
||||
costFormula: "",
|
||||
formData: {},
|
||||
payShow: false,
|
||||
payVisible: false,
|
||||
loading: false,
|
||||
moneyModel: "",
|
||||
money: 0,
|
||||
viewData: {},
|
||||
configData: {},
|
||||
payList: [],
|
||||
memberActive: 0,
|
||||
intervalTimer: null
|
||||
tableData: [],
|
||||
payList: [
|
||||
{text: '全部', value: null},
|
||||
{text: '已缴费', value: true},
|
||||
{text: '未缴费', value: false},
|
||||
],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear(),
|
||||
isPay: false
|
||||
},
|
||||
payInfo: {},
|
||||
formData: {},
|
||||
moneyModel: 2,
|
||||
intervalTimer: null,
|
||||
hasPayed: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
imgClose() {
|
||||
async payVisibleClose() {
|
||||
clearInterval(this.intervalTimer)
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.tableData = []
|
||||
this.finished = false
|
||||
this.pageData()
|
||||
},
|
||||
imgClose() {
|
||||
this.loading = false
|
||||
this.zfImg = false
|
||||
this.payToOtherPage = false
|
||||
},
|
||||
moneyInput() {
|
||||
const moneys = this.viewData.modeValueList.map((m) => Number(m.value))
|
||||
let money = 0
|
||||
moneys.forEach((m) => {
|
||||
money += m
|
||||
})
|
||||
if (money <= 10) {
|
||||
this.money = 1
|
||||
} else {
|
||||
money = money.toFixed(2)
|
||||
this.money = (Number(money.replace(".", "")) * 0.5) / 100
|
||||
}
|
||||
let paymentMoney = this.formData.payModeValueList.reduce((a, b) => {
|
||||
return a + b.value
|
||||
}, 0)
|
||||
const pr = parseFloat((paymentMoney * 0.005 * this.formData.paymentMonth).toFixed(2))
|
||||
this.$set(this.formData, "paymentMoney", pr * 100)
|
||||
},
|
||||
async doAlipay() {
|
||||
this.doIsPaySuccess()
|
||||
if (!this.money) {
|
||||
vant.Toast("请计算会费金额")
|
||||
async doPay() {
|
||||
if (!this.formData.paymentMoney) {
|
||||
this.$toast('请计算会费金额')
|
||||
return
|
||||
}
|
||||
if (!this.moneyModel) {
|
||||
vant.Toast("请选择支付方式")
|
||||
this.$toast('请选择支付方式')
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
var u = navigator.userAgent
|
||||
var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1 //android终端
|
||||
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) //ios终端
|
||||
let money = 0
|
||||
if (this.viewData.selectMode === "1") {
|
||||
money = this.viewData.modeValue
|
||||
} else if (this.viewData.selectMode === "2") {
|
||||
const moneys = this.viewData.modeValueList.map((m) => Number(m.value))
|
||||
moneys.forEach((m) => {
|
||||
money += m
|
||||
})
|
||||
money = (money * 0.5) / 100
|
||||
money = money.toFixed(2)
|
||||
if(this.moneyModel === 1) {
|
||||
this.$toast('暂未开通,敬请期待')
|
||||
return
|
||||
}
|
||||
|
||||
const u = navigator.userAgent
|
||||
const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) //ios终端
|
||||
let userAgent = window.navigator.userAgent.toLowerCase()
|
||||
if (this.moneyModel === 1) {
|
||||
let use = window.navigator.userAgent.toLowerCase()
|
||||
//是否微信浏览器
|
||||
if (use.match(/MicroMessenger/i) && use.match(/MicroMessenger/i)[0] === "micromessenger") {
|
||||
this.zfImg = true
|
||||
return
|
||||
if (userAgent.match(/MicroMessenger/i) && userAgent.match(/MicroMessenger/i)[0] === "micromessenger") {
|
||||
this.payToOtherPage = true
|
||||
} else {
|
||||
if (this.moneyModel === 1) {
|
||||
const resp = await $.get("/mobile/memberCost/AlipayClient/tradePagePay", {
|
||||
money: money,
|
||||
paymentProjectId: this.viewData.paymentProjectId
|
||||
})
|
||||
const div = document.createElement("div")
|
||||
div.innerHTML = resp // data就是接口返回的form 表单字符串
|
||||
document.body.appendChild(div)
|
||||
//如果是ios,不新开页面直接跳转
|
||||
if (isiOS) {
|
||||
document.forms[0].submit()
|
||||
} else {
|
||||
document.forms[0].setAttribute("target", "_blank") // 新开窗口跳转
|
||||
document.forms[0].submit()
|
||||
}
|
||||
const resp = await $.get("/mobile/memberCost/AlipayClient/tradePagePay", {
|
||||
money: paymentMoney,
|
||||
paymentProjectId: this.payInfo.id
|
||||
})
|
||||
const div = document.createElement("div")
|
||||
div.innerHTML = resp // data就是接口返回的form 表单字符串
|
||||
document.body.appendChild(div)
|
||||
//如果是ios,不新开页面直接跳转
|
||||
if (isiOS) {
|
||||
document.forms[0].submit()
|
||||
} else {
|
||||
document.forms[0].setAttribute("target", "_blank") // 新开窗口跳转
|
||||
document.forms[0].submit()
|
||||
}
|
||||
}
|
||||
} else if(this.moneyModel === 2) {
|
||||
if (userAgent.match(/MicroMessenger/i) && userAgent.match(/MicroMessenger/i)[0] === "micromessenger") {
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您确定要支付吗?',
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const loading = this.$toast.loading({
|
||||
message: '支付中...',
|
||||
forbidClick: true,
|
||||
})
|
||||
this.hasPayed = false
|
||||
await this.pullWeChatPay()
|
||||
await this.getIsPay(loading)
|
||||
}
|
||||
} else {
|
||||
this.$toast('微信支付只能在微信APP中使用,请切换支付方式')
|
||||
}
|
||||
}
|
||||
},
|
||||
//拉起微信支付
|
||||
async pullWeChatPay() {
|
||||
const resp = await $.post("/mobile/memberCost/list/pullWeChatPay", {
|
||||
money: this.formData.paymentMoney,
|
||||
busId: this.payInfo.id
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
if (typeof WeixinJSBridge == "undefined") {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("WeixinJSBridgeReady", onBridgeReady(resp.data))
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent("WeixinJSBridgeReady", onBridgeReady(resp.data))
|
||||
document.attachEvent("onWeixinJSBridgeReady", onBridgeReady(resp.data))
|
||||
}
|
||||
} else {
|
||||
onBridgeReady(resp.data)
|
||||
}
|
||||
}
|
||||
},
|
||||
async getIsPay(loading) {
|
||||
this.intervalTimer = setInterval(async () => {
|
||||
const resp = await $.get("/platform/member/payment/mine/getIsPay", { paymentInfoId: this.payInfo.id })
|
||||
if (resp.code === 0) {
|
||||
loading.close()
|
||||
if(resp.data > 0) {
|
||||
this.hasPayed = true
|
||||
}
|
||||
}
|
||||
}, 2000)
|
||||
},
|
||||
async openPay(row) {
|
||||
this.payInfo = row
|
||||
const payStandards = JSON.parse(row.payStandards)
|
||||
const payStandard = payStandards.find(p => p.payPersonnel === row.payPersonnel && p.personType === row.personType)
|
||||
this.$set(this.formData, "paymentMonth", row.paymentMonth)
|
||||
this.$set(this.formData, "paymentStartMonth", row.paymentStartMonth)
|
||||
this.$set(this.formData, "paymentEndMonth", row.paymentEndMonth)
|
||||
this.$set(this.formData, "paymentInfoId", row.id)
|
||||
if (payStandard.payModeValue) {
|
||||
this.$set(this.formData, "payModeValueList", [])
|
||||
this.$set(this.formData, "paymentMoney", payStandard.payModeValue)
|
||||
} else {
|
||||
this.$set(this.formData, "payModeValueList", payStandard.payModeValueList)
|
||||
this.$set(this.formData, "paymentMoney", 0)
|
||||
}
|
||||
},
|
||||
async getConfig() {
|
||||
const { data } = await $.get("/platform/member/payment/config/getPaymentConfig")
|
||||
this.configData = data
|
||||
},
|
||||
async openAlipay(p) {
|
||||
const data = clone(p)
|
||||
this.money = 0
|
||||
this.moneyModel = ""
|
||||
this.viewData = data
|
||||
|
||||
if (this.viewData.selectMode === "1") {
|
||||
this.money = Number(data.modeValue + "00")
|
||||
}
|
||||
if (this.viewData.selectMode === "2") {
|
||||
const names = this.viewData.modeValueList.map((m) => m.name)
|
||||
this.costFormula = "(" + names.join("+") + ")" + "×0.5%"
|
||||
}
|
||||
this.payShow = true
|
||||
this.payVisible = true
|
||||
},
|
||||
async pageData() {
|
||||
const resp = await $.post("/mobile/memberCost/list/pageData", { memberActive: this.memberActive })
|
||||
if (resp.code === 0) {
|
||||
const personType = "${@shiro.getPrincipalProperty('personType')}"
|
||||
const payStandards = this.configData.payStandards
|
||||
resp.data.forEach((r) => {
|
||||
payStandards.map((p) => {
|
||||
if (p.personType===personType) {
|
||||
r.selectMode = p.payMode
|
||||
if (p.c === "1") {
|
||||
r.modeValue = p.payModeValue
|
||||
} else {
|
||||
r.modeValueList = p.payModeValueList
|
||||
const names = r.modeValueList.map((m) => m.name)
|
||||
r.modeValueName = "(" + names.join("+") + ")" + "×0.5%"
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
this.payList = resp.data
|
||||
const res = await $.post("/platform/member/payment/mine/pageData", this.pageForm)
|
||||
if (res.code === 0) {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
this.finished = true
|
||||
} else {
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
}
|
||||
},
|
||||
doIsPaySuccess() {
|
||||
this.intervalTimer = setInterval(async () => {
|
||||
const resp = await $.get("/mobile/memberCost/list/getPayInfo", { id: this.viewData.id })
|
||||
if (resp.data.isPayment === true) {
|
||||
clearInterval(this.intervalTimer)
|
||||
this.doSearch()
|
||||
this.payShow = false
|
||||
this.loading = false
|
||||
this.zfImg = false
|
||||
}
|
||||
}, 4000)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getConfig()
|
||||
let nowYear = new Date().getFullYear()
|
||||
for (let i = nowYear; i >= nowYear - 9; i--) {
|
||||
this.yearList.push({ text: i, value: i })
|
||||
}
|
||||
await this.pageData()
|
||||
},
|
||||
watch: {
|
||||
"hasPayed"(val) {
|
||||
if(val === true) {
|
||||
clearInterval(this.intervalTimer)
|
||||
this.$dialog.alert({title: '温馨提示', message: '支付成功'})
|
||||
this.doSearch()
|
||||
this.payVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user