123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <template>
-
- <view>
- <u-modal v-model="payWayPop" :title-style="{color: '#404040'}" title="缴费方式" :show-confirm-button="false"
- :show-cancel-button="false">
- <view class="slot-content">
- <view class="pay-way-new">
- <view class="pay-way-item pay-way-item-hy" @click="gyBankPay">
- <image src="../../static/img/guiyang-bank-icon.png" mode=""></image>
- <view class="title">贵州银行</view>
- <view class="subtitle">前三个月每天首次一分钱<br />长期八折优惠</view>
- </view>
- <view class="pay-way-item pay-way-item-jh" @click="wechatPay">
- <image src="../../static/img/juhe-icon.png" mode=""></image>
- <view class="title">微信/支付宝</view>
- </view>
- </view>
- <button class="pay-way-close-btn" @click="closePaymentMethod">关闭</button>
- </view>
- </u-modal>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- export default {
- props: {
-
- payWayPop: {
- type: Boolean,
- default: false
- },
-
- curOrderList: {
- type: Array,
- default: null
- },
-
- deviceNo: {
- type: String,
- default: null
- },
-
- payeeId: {
- type: String,
- default: undefined
- },
-
- payeeName: {
- type: String,
- default: undefined
- },
-
- sanPay: {
- type: Boolean,
- default: false
- },
-
- pursueType: {
- type: String,
- default: undefined
- },
-
- jumpUrl: {
- type: String,
- default: null
- },
-
- exportFlag: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {}
- },
- methods: {
-
- gyBankPay() {
- uni.showLoading({
- title: '加载中'
- });
- const params = {
- orderList: this.curOrderList,
- deviceNo: this.deviceNo,
- jumpUrl: this.jumpUrl,
- payeeId: this.payeeId,
- payeeName: this.payeeName,
- pursueType: this.pursueType,
- sanPay: this.sanPay
- };
- console.log(params)
- if (this.exportFlag == true) {
- this.$u.api.quickPayExportApi(params).then(res => {
- if (res.data.needPay) {
- let payUrl = res.data.url;
- location.href = payUrl;
- } else {
- this.$refs.uToast.show({
- title: '无需支付',
- type: 'info',
- });
- setTimeout(() => {
- uni.hideLoading();
- location.reload()
- }, 1000)
- }
- }).catch(err => {
- this.$refs.uToast.show({
- title: err.msg,
- type: 'error',
- });
- });
- } else {
- this.$u.api.payGzbank(params).then(res => {
- if (res.data.needPay) {
- let payUrl = res.data.url;
- location.href = payUrl;
- } else {
- this.$refs.uToast.show({
- title: '无需支付',
- type: 'info',
- });
- setTimeout(() => {
- uni.hideLoading();
- location.reload()
- }, 1000)
- }
- }).catch(err => {
- this.$refs.uToast.show({
- title: err.msg,
- type: 'error',
- });
- });
- }
- },
-
- wechatPay() {
- uni.showLoading({
- title: '加载中'
- });
- this.getWXPayByJava(this.curOrderList, this.deviceNo)
- },
-
- getWXPayByJava(orderList, deviceNo) {
- let params = {
- orderList: orderList,
- openid: '',
- jumpUrl: this.jumpUrl,
- deviceNo: deviceNo ? deviceNo : null,
- payeeId: this.payeeId,
- payeeName: this.payeeName,
- pursueType: this.pursueType,
- sanPay: this.sanPay
- };
- if (this.exportFlag) {
- this.$u.api.polyPayExportApi(params)
- .then(res => {
- if (res.code === 200) {
- localStorage.setItem('jumpUrl', this.jumpUrl)
- location.href = res.data.qrCodeUrl
- } else {
- uni.hideLoading();
- }
- })
- .catch(err => {
- this.$refs.uToast.show({
- title: '无法调起微信支付!',
- type: 'error',
- });
- })
- } else {
- this.$u.api.ordinaryWxPay(params)
- .then(res => {
- if (res.code === 200) {
- localStorage.setItem('jumpUrl', this.jumpUrl)
- location.href = res.data.qrCodeUrl
- } else {
- uni.hideLoading();
- }
- })
- .catch(err => {
- this.$refs.uToast.show({
- title: '无法调起微信支付!',
- type: 'error',
- });
- })
- }
- },
-
- closePaymentMethod() {
- this.$emit('closePaymentMethod')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import './paymentMethod.scss'
- </style>
|