Compare commits

..

3 Commits

Author SHA1 Message Date
唐明明
867ed59737 merge 2022-09-23 17:10:22 +08:00
唐明明
1191e30f21 调整会员开通,DT充值流程 2022-09-23 17:03:17 +08:00
唐明明
9002c868c4 河马支付 2022-09-23 17:02:55 +08:00
18 changed files with 9166 additions and 7279 deletions

View File

@@ -55,7 +55,28 @@ const collagePAY = (orderNo,password) => {
})
}
// 河马支付
const hmPay = (orderID) => {
return request({
url : 'user/transaction/recharge/payment/hema',
data : {
order_id: orderID
},
method : 'POST'
})
}
// 河马付支付结果查询
const hmState = (type, id) => {
return request({
url : 'hema/affirm',
method : 'POST',
data : {
type,
id
}
})
}
export {
wxPAY,
@@ -63,4 +84,6 @@ export {
dtPAY,
payIndex,
collagePAY,
hmPay,
hmState
}

View File

@@ -59,6 +59,12 @@ const shopVipWeChat = (id) => {
})
}
// 河马付
const vipHmPay = (orderId) => {
return request({
url: 'user/identities/pay/' + orderId + '/hema'
})
}
export {
vip,
@@ -67,5 +73,6 @@ export {
agreement,
shopVipInfo,
shopVipCreate,
shopVipWeChat
shopVipWeChat,
vipHmPay
}

View File

@@ -89,7 +89,7 @@
"payment" : {
"weixin" : {
"__platform__" : [ "android" ],
"appid" : "wx466a4663da346e09",
"appid" : "wx10517aabd260b79e",
"UniversalLinks" : ""
},
"alipay" : {
@@ -98,7 +98,7 @@
},
"share" : {
"weixin" : {
"appid" : "wx466a4663da346e09",
"appid" : "wx10517aabd260b79e",
"UniversalLinks" : ""
}
},
@@ -152,7 +152,22 @@
"androidStyle" : "common"
}
},
"nativePlugins" : {},
"nativePlugins" : {
"TestModule" : {
"__plugin_info__" : {
"name" : "河马支付",
"description" : "河马支付",
"platforms" : "Android",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {}
}
}
},
"uniStatistics" : {
"enable" : true
}

View File

@@ -0,0 +1,20 @@
{
"name": "河马支付",
"id": "TestModule",
"version": "1.0.0",
"description": "河马支付",
"_dp_type":"nativeplugin",
"_dp_nativeplugin":{
"android": {
"plugins": [
{
"type": "module",
"name": "TestModule",
"class": "io.dcloud.uniplugin.AppModule"
}
],
"integrateType": "aar"
}
}
}

1355
pages.json

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@
</view>
<view class="num">{{frozenScore || '0.0000'}}</view>
</view>
<button class="transfer" size="mini" @click="dtShow = true">充值</button>
<button class="transfer" size="mini" @click="dtSelect">充值</button>
<button class="transfer" size="mini" @click="onTransfer('AccountTransfer')">转账</button>
</view>
<block v-if="logs.length > 0">
@@ -85,6 +85,9 @@
},
methods: {
dtSelect(type){
this.onTransfer('AccountRecharge');
return
// 充值选项
switch(type){
case 'wchat':
this.onTransfer('AccountRecharge');

145
pages/account/hmState.vue Normal file
View File

@@ -0,0 +1,145 @@
<template>
<view>
<view class="vertical results">
<block v-if="loding">
<u-loading-icon mode="circle" size="58" color="#34CE98"></u-loading-icon>
<view class="circle-toast">
<view class="sub-title">已等待{{time}}</view>
<view class="sub-title">查询支付结果中请耐心等待...</view>
</view>
</block>
<block v-else>
<view v-if="success">
<uni-icons type="checkbox-filled" size="88" color="#34CE98"></uni-icons>
<view class="title">支付成功</view>
<view class="sub-title">{{remove}}</view>
<button class="results-button" type="default" size="default" @click="navBack">返回</button>
</view>
<view v-else>
<uni-icons type="info-circle-fill" size="88" color="#34CE98"></uni-icons>
<view class="title">{{code === 0 ? '查询失败' : '订单不存在'}}</view>
<view class="sub-title">{{code === 0 ? '暂未查询到您的支付信息,如支付成功未到账请联系管理员': '暂未查询到您的订单信息'}}</view>
<button class="results-button" type="default" size="default" @click="navBack">返回</button>
</view>
</block>
</view>
</view>
</template>
<script>
import { hmState } from '@/apis/interfaces/pay.js'
var outTime;
export default {
data() {
return {
type : 'recharge',
hash : '',
time : 0,
loding : false,
success : false,
code : 0,
remove : '充值成功预计10秒内到账可在账户交易记录中查询以实际到账时间为准如充值失败金额将原路退还'
};
},
created() {
this.type = this.$Route.query.type
if(this.type === 'vip') this.remove = '恭喜您成功开通共力生态会员'
if(this.type === 'buy') this.remove = '订单支出成功,可在个人中心中订单中查询您购物的订单'
this.queryState()
},
methods:{
queryState(){
this.loding = true
let outTimeN = 0
outTime = setInterval(() => {
hmState(this.type, this.$Route.query.orderId).then(res => {
outTimeN += 1
this.time = outTimeN
if(res.code === 1){
clearInterval(outTime)
this.success = true
this.loding = false
}
if(res.code === 0 && outTimeN >= 10){
clearInterval(outTime)
this.code = 0
this.loding = false
}
if(res.code === 2){
clearInterval(outTime)
this.code = 2
this.loding = false
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}, 1000)
},
navBack(){
uni.navigateBack()
}
},
onUnload() {
clearInterval(outTime)
}
}
</script>
<style lang="scss" scoped>
.results{
height: 100vh;
box-sizing: border-box;
text-align: center;
padding-left: $padding * 3;
padding-right: $padding * 3;
padding-bottom: 20vh;
.title{
font-size: $title-size + 8;
color: $text-color;
font-weight: bold;
line-height: 80rpx;
padding: $padding 0;
}
.sub-title{
color: $text-gray;
line-height: 40rpx;
}
.hash{
background-color: white;
padding: $padding * 2;
border-radius: $radius-lg;
margin-top: $margin * 2;
font-size: $title-size;
color: $text-color;
.hash-title{
padding-bottom: $padding;
}
.hash-text{
word-break:break-all;
}
}
.results-button{
width: 100%;
margin-top: $margin * 3;
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
background-color: $main-color;
color: white;
font-size: $title-size;
font-weight: bold;
&::after{
display: none;
}
}
.circle-toast{
padding-top: 60rpx;
.sub-title{
line-height: 60rpx;
}
}
}
</style>

View File

@@ -24,20 +24,36 @@
</view>
<view class="recharge-btn">
<button :disabled="this.priceValue === ''" @click="onRecharge">充值</button>
<view class="recharge-text">提示暂时仅支持使用微信支付充值</view>
<view class="recharge-text">提示暂时仅支持使用支付宝支付充值</view>
</view>
</view>
</template>
<script>
var hmAppPay = uni.requireNativePlugin('TestModule');
import { hmPay } from '@/apis/interfaces/pay.js';
import { recharge, payment, paymentpre } from "@/apis/interfaces/account"
export default {
data() {
return {
priceValue: '',
paymentpre: []
orderId : '',
paymentpre: [],
hmPayState: false
};
},
onShow() {
if(this.hmPayState){
this.$Router.replace({
name : 'hmState',
params : {
type : 'recharge',
orderId : this.orderId
}
})
return
}
},
created() {
paymentpre().then(res => {
this.paymentpre = res
@@ -81,6 +97,21 @@
},
// 获取充值信息
getPayInfo(order_id){
if(plus.runtime.isApplicationExist({
pname : 'com.eg.android.AlipayGphone',
action : 'alipay://'
})){
uni.showLoading({
title: '获取支付信息'
})
this.getHmPayInfo(order_id)
}else{
uni.showToast({
title: '支付失败,请安装支付宝',
icon : 'none'
})
}
return
payment({order_id}).then(res => {
uni.requestPayment({
provider: 'wxpay',
@@ -107,8 +138,28 @@
icon : 'none'
})
})
},
// 河马支付
getHmPayInfo(order_id){
this.orderId = order_id
hmPay(order_id).then(res => {
try{
hmAppPay.gotoNativePage(JSON.stringify(res.params))
this.hmPayState = true
}catch(e){
uni.showToast({
title: e
})
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
// 充值记录
onNavigationBarButtonTap() {
this.$Router.push({name: 'AccountLog'})
}

View File

@@ -24,7 +24,7 @@
<view class="vip-content-title">距离<text>{{nextIdentity.identity_text}}</text>还需条件</view>
<view class="vip-up-conditions">
<view class="vip-up-conditions-item"><text>10/10</text>家庭会员</view>
<view class="vip-up-conditions-item"><text>9/100</text>邀请家族会员</view>
<view class="vip-up-conditions-item"><text>9/100</text>邀请家族会员</view>
<view class="vip-up-conditions-item"><text>10/10000</text>伙伴</view>
</view>
</block>
@@ -63,6 +63,8 @@
</template>
<script>
var hmAppPay = uni.requireNativePlugin('TestModule');
import { vipHmPay } from '@/apis/interfaces/vip.js';
import { vip, vipPay, payInfo } from '@/apis/interfaces/vip.js'
export default {
data() {
@@ -98,11 +100,24 @@
need : '-',
current: '-',
rate: 0
}
},
// 河马付
orderId : '',
hmPayState: false
};
},
onShow() {
this.getVipInfo()
if(this.hmPayState){
this.$Router.replace({
name : 'hmState',
params : {
type : 'vip',
orderId : this.orderId
}
})
return
}
},
methods: {
// 获取会员信息
@@ -136,6 +151,18 @@
uni.showLoading({
title: '获取支付信息'
})
if(plus.runtime.isApplicationExist({
pname : 'com.eg.android.AlipayGphone',
action : 'alipay://'
})){
this.getHmPayInfo(res.id)
}else{
uni.showToast({
title: '支付失败,请安装支付宝',
icon : 'none'
})
}
return
this.wxPay(res.id)
}
}).catch(err => {
@@ -145,6 +172,26 @@
})
})
},
// 河马支付
getHmPayInfo(order_id){
this.orderId = order_id
vipHmPay(order_id).then(res => {
try{
hmAppPay.gotoNativePage(JSON.stringify(res))
this.hmPayState = true
}catch(e){
uni.showToast({
title: e
})
}
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 微信支付
wxPay(orderId){
payInfo(orderId).then(orderInfo => {

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long