提现
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
"version" : "1.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"playground" : "standard",
|
||||
"customPlaygroundType" : "local",
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-android"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -107,6 +107,9 @@
|
||||
.text-fu{
|
||||
color:#666;
|
||||
}
|
||||
.text-fu1{
|
||||
color:#999;
|
||||
}
|
||||
.text-lu{
|
||||
color:#00A776;
|
||||
}
|
||||
@@ -134,6 +137,9 @@
|
||||
.text-24{
|
||||
font-size:24rpx;
|
||||
}
|
||||
.text-26{
|
||||
font-size:26rpx;
|
||||
}
|
||||
.text-28{
|
||||
font-size:28rpx;
|
||||
}
|
||||
@@ -149,6 +155,12 @@
|
||||
.text-38{
|
||||
font-size:38rpx;
|
||||
}
|
||||
.text-48{
|
||||
font-size:48rpx;
|
||||
}
|
||||
.text-52{
|
||||
font-size:52rpx;
|
||||
}
|
||||
.text-bold{
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
+46
-12
@@ -52,18 +52,6 @@ export function uploadImage(params) {
|
||||
export const uploadImg = "/common/upload/image";
|
||||
|
||||
|
||||
/**
|
||||
* 检查版本更新
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function checkAppVersion(data) {
|
||||
return request({
|
||||
url: "/common/checkAppVersion",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询分享海报
|
||||
@@ -100,3 +88,49 @@ export function getCarouselImage(data) {
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function getWithdraw(data) {
|
||||
return request({
|
||||
url: "/withdrawAccount/getWithdrawAccountsList",
|
||||
method: "get",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function bindWithdraw(data) {
|
||||
return request({
|
||||
url: "/withdrawAccount/bindWithdrawAccount",
|
||||
method: "post",
|
||||
data,
|
||||
cha:1
|
||||
});
|
||||
}
|
||||
|
||||
export function unbindWithdraw(data) {
|
||||
return request({
|
||||
url: "/withdrawAccount/unbindWithdrawAccount",
|
||||
method: "get",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function sendWithdraw(data) {
|
||||
return request({
|
||||
url: "/withdraw/withdraw",
|
||||
method: "post",
|
||||
data,
|
||||
cha:1
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查版本更新
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function checkAppVersion(data) {
|
||||
return request({
|
||||
url: "/common/checkAppVersion",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>WeChat</key>
|
||||
<dict>
|
||||
<key>appid</key>
|
||||
<string>wx7a5902cd556d9396</string>
|
||||
<key>universalLink</key>
|
||||
<string>https://app.tbmall.xin/uni-universallinks/__UNI__4910728/</string>
|
||||
</dict>
|
||||
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>WeChat</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>wx7a5902cd556d9396</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
+22
-22
@@ -88,33 +88,33 @@
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
"hdpi" : "static/logo.png",
|
||||
"xhdpi" : "static/logo.png",
|
||||
"xxhdpi" : "static/logo.png",
|
||||
"xxxhdpi" : "static/logo.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"appstore" : "",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
"app" : "static/logo.png",
|
||||
"app@2x" : "static/logo.png",
|
||||
"notification" : "static/logo.png",
|
||||
"notification@2x" : "static/logo.png",
|
||||
"proapp@2x" : "static/logo.png",
|
||||
"settings" : "static/logo.png",
|
||||
"settings@2x" : "static/logo.png",
|
||||
"spotlight" : "static/logo.png",
|
||||
"spotlight@2x" : "static/logo.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
"app@2x" : "static/logo.png",
|
||||
"app@3x" : "static/logo.png",
|
||||
"notification@2x" : "static/logo.png",
|
||||
"notification@3x" : "static/logo.png",
|
||||
"settings@2x" : "static/logo.png",
|
||||
"settings@3x" : "static/logo.png",
|
||||
"spotlight@2x" : "static/logo.png",
|
||||
"spotlight@3x" : "static/logo.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+21
@@ -272,6 +272,27 @@
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "account/bind",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "account/withdraw",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "account/success",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "setting/express",
|
||||
"style": {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="purse_warp">
|
||||
<header-component :leftTitle="$t('purse.title')" left-path-type="switchTab" left-path="/pages/mine/mine" />
|
||||
<view class="purse_content_warp">
|
||||
<view v-for="item in balanceList" :key="item.id" class="purse_warp_item" @click="jumpBonus(item)">
|
||||
<view v-for="(item,vIndex) in balanceList" :key="item.id" class="purse_warp_item" @click="jumpBonus(item)">
|
||||
<view class="purse_item_title">
|
||||
<view class="purse_item_title-left">
|
||||
<up-image :src="`https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/mine-purse/${item.categoty}.png`"
|
||||
@@ -13,6 +13,9 @@
|
||||
</view>
|
||||
|
||||
<view class="purse_item_title-right">
|
||||
<view class="button exchange_button" @click.stop="jumpInfo(item, 'withdraw')" style="margin-right:24rpx" v-if="vIndex == 4">
|
||||
提现
|
||||
</view>
|
||||
<view v-for="(btn, index) in getOperationButtons(item)" :key="index" :type="btn.type" class="button"
|
||||
:class="btn.type + '_button'" @click.stop="jumpInfo(item, btn.type)">{{ btn.text }}</view>
|
||||
</view>
|
||||
@@ -91,14 +94,22 @@ export default {
|
||||
jumpInfo(row, type) {
|
||||
console.log("row", row);
|
||||
if (type === "withdraw") {// 提现
|
||||
// uni.navigateTo({
|
||||
// url: "/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw?amount=" + row.curAmount + "&category=" + row.categoty,
|
||||
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw?amount=" + row.curAmount + "&category=" + row.categoty,
|
||||
url: "/pages/rwa_package/account/withdraw?type=0",
|
||||
|
||||
})
|
||||
} else if (type === "recharge") {// 充值
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine_package/mine_purse_recharge/mine_purse_recharge?amount=" + row.curAmount + "&category=" + row.categoty,
|
||||
url: "/pages/rwa_package/account/withdraw?type=1",
|
||||
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url: "/pages/mine_package/mine_purse_recharge/mine_purse_recharge?amount=" + row.curAmount + "&category=" + row.categoty,
|
||||
// })
|
||||
} else if (type === "exchange") {// 兑换
|
||||
// uni.navigateTo({
|
||||
// url: "/pages/mine_package/mine_purse_exchange/mine_purse_exchange?amount=" + row.curAmount + "&category=" + row.categoty,
|
||||
@@ -159,6 +170,9 @@ export default {
|
||||
}
|
||||
|
||||
.purse_item_title-right {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
.button {
|
||||
border-radius: 12rpx;
|
||||
width: 120rpx;
|
||||
@@ -173,7 +187,7 @@ export default {
|
||||
.exchange_button {
|
||||
background: #FFFFFF;
|
||||
color: #7934F6;
|
||||
border: 2rpx solid rgba(174, 57, 197, 1);
|
||||
border: 2rpx solid #7934F6;
|
||||
}
|
||||
|
||||
.recharge_button {
|
||||
|
||||
@@ -98,6 +98,7 @@ export default {
|
||||
},
|
||||
// 立即充值
|
||||
async rechargeOk() {
|
||||
console.log('aaaaa',this.form);
|
||||
const params = this.form;
|
||||
if (!params.amount) {
|
||||
this.$refs.uToastRef.show({
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<TopSafe bgColor="rgba(0,0,0,0)"></TopSafe>
|
||||
<Header :title="topText" bgColor="rgba(0,0,0,0)" />
|
||||
<view class="setting-view">
|
||||
<view class="mid-view">
|
||||
<text class="text-zu1 text-32" v-if="type == 1">注:请与当前登录微信信息一致</text>
|
||||
<text class="text-zu1 text-32 mt-24">{{type == 0 ? '支付宝账号' : '微信账号'}}</text>
|
||||
<view class="input-view">
|
||||
<up-input :placeholder="`请输入${type == 0 ? '支付宝' : '微信'}账号`" border="surround" v-model="account" :customStyle="inputCss"></up-input>
|
||||
</view>
|
||||
<text class="text-zu1 text-32 mt-48">{{type == 0 ? '支付宝姓名' : '微信姓名'}}</text>
|
||||
<view class="input-view">
|
||||
<up-input :placeholder="`请输入${type == 0 ? '支付宝' : '微信真实'}姓名`" border="surround" v-model="name" :customStyle="inputCss"></up-input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-btn">
|
||||
<MyBtn text="添加" @ok="onAdd"></MyBtn>
|
||||
</view>
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { bindWithdraw } from '@/api/common.js';
|
||||
import Header from '@/components/common/header.vue';
|
||||
import { clear } from '@/utils/auth.js';
|
||||
import TopSafe from '@/components/common/top-safe.nvue'
|
||||
import MyBtn from '@/components/common/my-btn.vue'
|
||||
import func from '@/utils/func.js';
|
||||
import AccountItem from './components/account-item.vue'
|
||||
|
||||
export default {
|
||||
components: { Header, TopSafe,MyBtn,AccountItem },
|
||||
data() {
|
||||
return {
|
||||
topText:'',
|
||||
type:0,
|
||||
account:'',
|
||||
name:'',
|
||||
wxCode:'',
|
||||
inputCss: {
|
||||
"height": '80rpx',
|
||||
"background": "#F3F3F3FF",
|
||||
"border-radius": "30rpx",
|
||||
"border": "0rpx",
|
||||
"padding-left": "12rpx",
|
||||
},
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option && option.type){
|
||||
this.type = Number(option.type);
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
if(this.type == 0 ){
|
||||
this.topText = '绑定支付宝账户';
|
||||
}else if(this.type == 1){
|
||||
this.topText = '绑定微信账户';
|
||||
}
|
||||
},
|
||||
setBindWithdraw(){
|
||||
if(!this.account){
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: '账户不可为空',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(!this.name){
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: '名字不可为空',
|
||||
});
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
platform:this.type + 1,
|
||||
accountNumber:this.account,
|
||||
accountName:this.name
|
||||
}
|
||||
if(this.type == 1){
|
||||
params['code'] = this.wxCode;
|
||||
}
|
||||
console.log('wxCode',params)
|
||||
bindWithdraw(params).then(res=>{
|
||||
if (res.bizcode === 100) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'success',
|
||||
message: '绑定成功',
|
||||
});
|
||||
this.account = '';
|
||||
this.name = '';
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack();
|
||||
},1000)
|
||||
} else {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: res.msg,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
})
|
||||
},
|
||||
onAdd(){
|
||||
if(this.type == 1){
|
||||
let _this = this;
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
onlyAuthorize:true,
|
||||
success: function (loginRes) {
|
||||
_this.wxCode = loginRes.code;
|
||||
console.log('aaaaa',loginRes.code)
|
||||
console.log('bbbb',loginRes)
|
||||
_this.setBindWithdraw();
|
||||
},
|
||||
fail:(err)=>{
|
||||
console.log('login',err);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.setBindWithdraw();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bottom-btn{
|
||||
width: 100%;
|
||||
margin-bottom:92rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
.setting-view {
|
||||
width: 100%;
|
||||
height: calc(100% - 88rpx - 92rpx - 88rpx - var(--status-bar-height));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
overflow-y: auto;
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
.mid-view{
|
||||
width:100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 48rpx 32rpx;
|
||||
margin-top:24rpx;
|
||||
.input-view{
|
||||
width:100%;
|
||||
height:100rpx;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 20rpx;
|
||||
margin-top:32rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<view class="shop-item-view" >
|
||||
<image :src="type == 0 ? '../../../static/new/zfb.png' : '../../../static/new/wx.png'" ></image>
|
||||
<view class="show-item-left">
|
||||
<text class="text-32 text-zu1">{{itemData.name}}</text>
|
||||
<text class="text-26 text-fu1">账号:{{itemData.account}}</text>
|
||||
</view>
|
||||
<view class="item-right-btn" @click="onBtn">
|
||||
<text class="text-zu1 text-24">解绑</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
props:{
|
||||
obj:{
|
||||
type:Object,
|
||||
default:null
|
||||
},
|
||||
type:{
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
itemData:{
|
||||
type:[Array,Object],
|
||||
default:()=>{}
|
||||
},
|
||||
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
methods: {
|
||||
onBtn(){
|
||||
this.$emit('ok',this.itemData);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.shop-item-view{
|
||||
width:100%;
|
||||
min-height:152rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 32rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border-radius: 24rpx;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
margin-top:24rpx;
|
||||
.show-item-left{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height:88rpx;
|
||||
min-height:88rpx;
|
||||
margin-left:24rpx;
|
||||
|
||||
}
|
||||
.item-right-btn{
|
||||
width:112rpx;
|
||||
height:48rpx;
|
||||
min-height:48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #f3f3f3;
|
||||
border-radius: 24rpx;
|
||||
position: absolute;
|
||||
right:28rpx;
|
||||
}
|
||||
image{
|
||||
width:88rpx;
|
||||
height:88rpx;
|
||||
border-radius: 44rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<u-popup :show="codeShow" mode="bottom" bgColor="transparent">
|
||||
<view class="select-item">
|
||||
<view class="select-head">
|
||||
<view></view>
|
||||
<text class="text-28 text-fu1">验证码</text>
|
||||
<u-icon name="close" color="#333" size="16" @click="onClose"></u-icon>
|
||||
</view>
|
||||
<view class="item-mid-view">
|
||||
<view class="input-view">
|
||||
<up-input placeholder="请输入验证码" border="surround" v-model="code"
|
||||
:customStyle="inputCss">
|
||||
<template #suffix style="margin-right: 10rpx;">
|
||||
<view v-if="countdown" class="code-warp">
|
||||
<up-count-down :time="60 * 1000" format="ss" @finish="countdown = false"></up-count-down>
|
||||
<text style="margin-left: 10rpx;">s</text>
|
||||
</view>
|
||||
<view v-else @click="getMobileCode" class="code_msg">
|
||||
获取验证码
|
||||
</view>
|
||||
</template>
|
||||
</up-input>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="item-bottom-btn">
|
||||
<MyBtn @ok="onOk" text="确定"></MyBtn>
|
||||
</view>
|
||||
</view>
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserList } from '@/api/common.js';
|
||||
|
||||
import MyBtn from '@/components/common/my-btn.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code:'',
|
||||
countdown:'',
|
||||
inputCss: {
|
||||
"background": "#fff",
|
||||
},
|
||||
}
|
||||
},
|
||||
components: { MyBtn },
|
||||
props:{
|
||||
codeShow:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
phone:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
methods: {
|
||||
onOk(){
|
||||
if(!this.code){
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: "验证码不可为空",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$emit('ti',this.code);
|
||||
this.code = '';
|
||||
},
|
||||
onClose(){
|
||||
this.$emit('close');
|
||||
this.countdown = false;
|
||||
},
|
||||
async getMobileCode() {
|
||||
if (!this.phone) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: "请输入手机号码",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.countdown = true;
|
||||
|
||||
const params = {
|
||||
mobile: this.phone,
|
||||
type: 'withdraw'
|
||||
}
|
||||
const response = await getUserList(params);
|
||||
if (response && response.bizcode === 100) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'success',
|
||||
message: response.msg,
|
||||
});
|
||||
} else {
|
||||
this.countdown = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.select-item{
|
||||
width:100%;
|
||||
min-height:418rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 32rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
.item-bottom-btn{
|
||||
width:100%;
|
||||
margin-top:24rpx;
|
||||
min-height:88rpx;
|
||||
display: flex;
|
||||
}
|
||||
.item-mid-view{
|
||||
width:100%;
|
||||
height:218rpx;
|
||||
min-height:218rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow-y: auto;
|
||||
.input-view{
|
||||
width:100%;
|
||||
height:88rpx;
|
||||
min-height:88rpx;
|
||||
}
|
||||
|
||||
}
|
||||
.select-head{
|
||||
width:100%;
|
||||
height:88rpx;
|
||||
min-height:88rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<u-popup :show="itemShow" mode="bottom" bgColor="transparent">
|
||||
<view class="select-item">
|
||||
<view class="select-head">
|
||||
<view></view>
|
||||
<text class="text-28 text-fu1">选择{{type == 0 ? '微信' : '支付宝'}}账户</text>
|
||||
<u-icon name="close" color="#333" size="16" @click="onClose"></u-icon>
|
||||
</view>
|
||||
<view class="item-mid-view">
|
||||
<view class="item-mid-list" v-for="(item,index) in data" :key="item.id">
|
||||
<image :src="type == 1 ? '../../../static/new/zfb.png' : '../../../static/new/wx.png'" ></image>
|
||||
<view class="show-item-left">
|
||||
<text class="text-32 text-zu1">{{item.name}}</text>
|
||||
<text class="text-26 text-fu1">账号:{{item.account}}</text>
|
||||
</view>
|
||||
<u-radio-group v-model="itemSelect" style="position: absolute;right:28rpx">
|
||||
<u-radio :name="item.id" activeColor="#7934F6"></u-radio>
|
||||
</u-radio-group>
|
||||
<!-- <view class="item-right-btn">
|
||||
<u-radio-group v-model="itemSelect">
|
||||
<u-radio :name="item.id" activeColor="#7934F6"></u-radio>
|
||||
</u-radio-group>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-bottom-btn">
|
||||
<MyBtn @ok="onOk" text="确定"></MyBtn>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import MyBtn from '@/components/common/my-btn.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
itemSelect:''
|
||||
}
|
||||
},
|
||||
components: { MyBtn },
|
||||
computed:{
|
||||
data(){
|
||||
let tmp = [];
|
||||
if(this.itemData.length){
|
||||
this.itemSelect = this.itemData[0].id;
|
||||
tmp = this.itemData;
|
||||
console.log('tmp',tmp)
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
},
|
||||
props:{
|
||||
itemShow:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
itemData:{
|
||||
type:[Array,Object],
|
||||
default:()=>{}
|
||||
},
|
||||
type:{
|
||||
type:[Number,String],
|
||||
default:'0'
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
methods: {
|
||||
onOk(){
|
||||
console.log('this',this.itemSelect);
|
||||
this.$emit('ok',this.itemSelect);
|
||||
},
|
||||
onClose(){
|
||||
this.$emit('close');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.select-item{
|
||||
width:100%;
|
||||
min-height:942rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 32rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
.item-bottom-btn{
|
||||
width:100%;
|
||||
margin-top:24rpx;
|
||||
min-height:88rpx;
|
||||
display: flex;
|
||||
}
|
||||
.item-mid-view{
|
||||
width:100%;
|
||||
height:742rpx;
|
||||
min-height:742rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
overflow-y: auto;
|
||||
.item-mid-list{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width:98%;
|
||||
height:152rpx;
|
||||
min-height:152rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-top:24rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 0px 16rpx 0px #F4F4F4;
|
||||
border-radius: 16px;
|
||||
border: 1px solid #E3E3E3;
|
||||
padding: 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
.show-item-left{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height:88rpx;
|
||||
min-height:88rpx;
|
||||
margin-left:24rpx;
|
||||
|
||||
}
|
||||
.item-right-btn{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #f3f3f3;
|
||||
border-radius: 24rpx;
|
||||
position: absolute;
|
||||
right:28rpx;
|
||||
}
|
||||
image{
|
||||
width:88rpx;
|
||||
height:88rpx;
|
||||
border-radius: 44rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.select-head{
|
||||
width:100%;
|
||||
height:88rpx;
|
||||
min-height:88rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,84 +1,102 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<TopSafe bgColor="rgba(0,0,0,0)"></TopSafe>
|
||||
<Header title="注销账号" bgColor="rgba(0,0,0,0)" />
|
||||
<Header title="账户管理" bgColor="rgba(0,0,0,0)" />
|
||||
<view class="setting-view">
|
||||
|
||||
|
||||
<view class="tab-view">
|
||||
<view class="tab-list" v-for="(item,index) in tabList" :key="index" @click="onTab(index)">
|
||||
<text class="text-fu text-28" :style="{color:type == index ? '#7934F6' :'#666' }">{{item}}</text>
|
||||
<view class="tab-line" v-if="type == index"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mid-view">
|
||||
<AccountItem :type="type" :itemData="item" @ok="onItemOk" v-for="(item,index) in dataList" :key="index"></AccountItem>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-btn">
|
||||
<MyBtn text="已清楚风险,确定注销" @ok="onZhu"></MyBtn>
|
||||
<MyBtn :text="type == 0 ? '添加支付宝账户' : '添加微信账户'" @ok="onJump"></MyBtn>
|
||||
</view>
|
||||
<u-modal :show="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm" :content='content'></u-modal>
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserInfo,updateName,deleteAccount } from '@/api/auth.js';
|
||||
import { getWithdraw,unbindWithdraw } from '@/api/common.js';
|
||||
import Header from '@/components/common/header.vue';
|
||||
import { clear } from '@/utils/auth.js';
|
||||
import TopSafe from '@/components/common/top-safe.nvue'
|
||||
import MyBtn from '@/components/common/my-btn.vue'
|
||||
import func from '@/utils/func.js';
|
||||
import AccountItem from './components/account-item.vue'
|
||||
|
||||
export default {
|
||||
components: { Header, TopSafe,MyBtn },
|
||||
components: { Header, TopSafe,MyBtn,AccountItem },
|
||||
data() {
|
||||
return {
|
||||
userInfo: null,
|
||||
inputText:'',
|
||||
tipsShow:false,
|
||||
content:'是否确定注销账号?'
|
||||
type:0,
|
||||
tabList:['支付宝账户','微信账户'],
|
||||
dataList:[]
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
onLoad() {
|
||||
this.init();
|
||||
// this.userinfo();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.userinfo()
|
||||
// this.userinfo()
|
||||
// #ifdef WEB
|
||||
this.tabList = ['支付宝账户'];
|
||||
// #endif
|
||||
this.getList();
|
||||
},
|
||||
onItemOk(item){
|
||||
let params = {
|
||||
bindId:item.id
|
||||
}
|
||||
unbindWithdraw(params).then(res=>{
|
||||
if (res.bizcode === 100) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'success',
|
||||
message:'解绑成功',
|
||||
});
|
||||
this.init();
|
||||
return null;
|
||||
} else {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: res.msg,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
})
|
||||
},
|
||||
getList(){
|
||||
getWithdraw({platform:this.type == 0?1:2}).then(res=>{
|
||||
if (res.bizcode === 100) {
|
||||
this.dataList = res.data;
|
||||
this.dataList.forEach(item=>{
|
||||
item.name = item.accountName;
|
||||
item.account = item.accountNumber;
|
||||
})
|
||||
} else {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: res.msg,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
})
|
||||
},
|
||||
onTab(index){
|
||||
if(index != this.type){
|
||||
this.type = index;
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
onJump(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/rwa_package/setting/out-agreement'
|
||||
})
|
||||
},
|
||||
onZhu(){
|
||||
this.tipsShow = true;
|
||||
},
|
||||
onConfirm(){
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/rwa_package/setting/out-code'
|
||||
// })
|
||||
this.onCancel();
|
||||
deleteAccount().then(res=>{
|
||||
if (res.bizcode == 100) {
|
||||
clear()
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'success',
|
||||
message: "注销成功",
|
||||
});
|
||||
setTimeout(()=>{
|
||||
uni.redirectTo({
|
||||
url:'/pages/login_package/login/login'
|
||||
})
|
||||
},2000)
|
||||
}
|
||||
})
|
||||
},
|
||||
onCancel(){
|
||||
this.tipsShow = false;
|
||||
},
|
||||
userinfo() {
|
||||
getUserInfo().then(res => {
|
||||
if (res.bizcode == 100) {
|
||||
this.userInfo = res.data;
|
||||
this.inputText = this.userInfo.nickname;
|
||||
}
|
||||
url:`/pages/rwa_package/account/bind?type=${this.type}`
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -107,43 +125,34 @@ export default {
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
.name-box{
|
||||
.mid-view{
|
||||
width:100%;
|
||||
border-radius: 16rpx;
|
||||
height:calc(100% - 88rpx);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
padding: 64rpx 32rpx;
|
||||
overflow-y: auto;
|
||||
padding-bottom: 24rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top:24rpx;
|
||||
.mid-view{
|
||||
width:100%;
|
||||
padding: 40rpx 32rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border:2rpx solid #eaeaea;
|
||||
border-radius: 16rpx;
|
||||
margin-top:48rpx;
|
||||
}
|
||||
.top-view{
|
||||
width:100%;
|
||||
}
|
||||
.tab-view{
|
||||
width:100%;
|
||||
height:88rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
// align-items: center;
|
||||
.tab-list{
|
||||
margin-right:32rpx;
|
||||
height:55rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.input-view{
|
||||
border-radius: 20rpx;
|
||||
margin-top:52rpx;
|
||||
width:100%;
|
||||
padding: 0 32rpx;
|
||||
min-height:104rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
background-color: #f5f5f5;
|
||||
box-sizing: border-box;
|
||||
|
||||
justify-content: space-between;
|
||||
.tab-line{
|
||||
width:50rpx;
|
||||
height:4rpx;
|
||||
min-height:4rpx;
|
||||
background-color: #7934F6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<TopSafe bgColor="rgba(0,0,0,0)"></TopSafe>
|
||||
<Header bgColor="rgba(0,0,0,0)" />
|
||||
<view class="setting-view">
|
||||
<u-icon size="54" name="checkmark-circle-fill" style="margin-top:84rpx" color="#7934F6" ></u-icon>
|
||||
<text class="text-zu text-32 mt-24">提现成功 ¥{{money || 0}}</text>
|
||||
<text class="text-fu1 text-28 mt-24" style="text-align: center;">由于第三方结算原因,提现成功后可能存在一定延迟请关注提现账户变动情况~</text>
|
||||
</view>
|
||||
<view class="bottom-btn">
|
||||
<MyBtn text="好的我知道了" @ok="onAdd"></MyBtn>
|
||||
</view>
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { bindWithdraw } from '@/api/common.js';
|
||||
import Header from '@/components/common/header.vue';
|
||||
import { clear } from '@/utils/auth.js';
|
||||
import TopSafe from '@/components/common/top-safe.nvue'
|
||||
import MyBtn from '@/components/common/my-btn.vue'
|
||||
import func from '@/utils/func.js';
|
||||
import AccountItem from './components/account-item.vue'
|
||||
|
||||
export default {
|
||||
components: { Header, TopSafe,MyBtn,AccountItem },
|
||||
data() {
|
||||
return {
|
||||
money:''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option && option.money){
|
||||
this.money = Number(option.money);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onAdd(){
|
||||
uni.navigateBack()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bottom-btn{
|
||||
width: 100%;
|
||||
margin-bottom:92rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
.setting-view {
|
||||
width: 100%;
|
||||
height: calc(100% - 88rpx - 92rpx - 88rpx - var(--status-bar-height));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
overflow-y: auto;
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
.mid-view{
|
||||
width:100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 48rpx 32rpx;
|
||||
margin-top:24rpx;
|
||||
.input-view{
|
||||
width:100%;
|
||||
height:100rpx;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 20rpx;
|
||||
margin-top:32rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,455 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<TopSafe bgColor="rgba(0,0,0,0)"></TopSafe>
|
||||
<Header :title="topText" bgColor="rgba(0,0,0,0)" />
|
||||
<view class="setting-view">
|
||||
<view class="top-view">
|
||||
<view class="top-left">
|
||||
<text class="text-bold text-52 text-white">
|
||||
{{amount}}
|
||||
</text>
|
||||
<text class="text-20 text-white" style="font-weight: 100;">可用余额</text>
|
||||
</view>
|
||||
<view class="top-right">
|
||||
<text class="text-bold text-36 text-white">
|
||||
0
|
||||
</text>
|
||||
<text class="text-20 text-white" style="font-weight: 100;">不可用余额</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mid-view">
|
||||
<text class="text-zu1 text-32">{{type == 0 ? '提现' : '充值'}}方式</text>
|
||||
<view class="item-view" @click="onSelect('0')">
|
||||
<image src="../../../static/new/wx.png"></image>
|
||||
<text class="text-zu1 text-32 " style="margin-left:20rpx;">微信</text>
|
||||
<view class="right-icon-view" v-if="type == 1">
|
||||
<u-radio-group v-model="curSelect">
|
||||
<u-radio name="0" activeColor="#7934F6"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<view class="right-icon-view" v-else>
|
||||
<text class="text-32 text-zu1" style="margin-right:12rpx"v-if="selectVal && curSelect == '0'">{{selectVal.name + '/' + selectVal.account}}</text>
|
||||
<u-icon size="14" name="arrow-right" color="#333" ></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-view" @click="onSelect('1')" style="border-width: 0;" >
|
||||
<image src="../../../static/new/zfb.png"></image>
|
||||
<text class="text-zu1 text-32 " style="margin-left:20rpx;">支付宝</text>
|
||||
<view class="right-icon-view" v-if="type == 1">
|
||||
<u-radio-group v-model="curSelect">
|
||||
<u-radio name="1" activeColor="#7934F6"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<view class="right-icon-view" v-else>
|
||||
<text class="text-32 text-zu1" style="margin-right:12rpx" v-if="selectVal && curSelect == '1'">{{selectVal.name + '/' + selectVal.account}}</text>
|
||||
<u-icon size="14" name="arrow-right" color="#333" ></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mid-view">
|
||||
<view class="flex-r-lr">
|
||||
<text class="text-zu1 text-32">{{type == 0 ? '提现' : '充值'}}金额</text>
|
||||
<text class="text-fu1 text-28" v-if="type == 0" style="font-weight:400">每日仅限提现1次</text>
|
||||
</view>
|
||||
|
||||
<view class="input-view">
|
||||
<text class="text-52 text-zu text-bold">¥</text>
|
||||
<input style="background: #fff;margin-top:10rpx;"
|
||||
:placeholder="type == 0 ? '请输入提现金额(0.3-2000)' : '输入充值金额'"
|
||||
placeholder-style="color:#999;font-weight:400"
|
||||
@input="onInput"
|
||||
border="0" v-model="money" :customStyle="inputCss"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zhu-view" v-if="selectVal">
|
||||
<u-icon size="12" style="margin-top:5rpx;margin-right:12rpx" name="error-circle" color="#7934F6"></u-icon>
|
||||
<text class="text-24 text-zi" style="font-weight: 400;">通过支付宝或微信提现时,将由支付宝/微信官方收取0.6%的费用,本平台不收取任何费用。</text>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="bottom-btn">
|
||||
<MyBtn :text="bottomText" @ok="onAdd"></MyBtn>
|
||||
</view>
|
||||
<SelectItem :itemData="dataList" @close="onClose" @ok="onOk"
|
||||
:type="curSelect" :itemShow="selectShow"></SelectItem>
|
||||
<CodeItem @ti="onTi" @close="onClose" :codeShow="codeShow" :phone="userInfo ? userInfo.mobile :''"></CodeItem>
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getWithdraw,sendWithdraw } from '@/api/common.js';
|
||||
import { getUserInfo,updateName,deleteAccount } from '@/api/auth.js';
|
||||
import Header from '@/components/common/header.vue';
|
||||
import { clear } from '@/utils/auth.js';
|
||||
import TopSafe from '@/components/common/top-safe.nvue'
|
||||
import MyBtn from '@/components/common/my-btn.vue'
|
||||
import func from '@/utils/func.js';
|
||||
import SelectItem from './components/select-item.vue'
|
||||
import CodeItem from './components/code-item.vue'
|
||||
|
||||
import { getRechargeSupportPay, recharge,getAcctBalance } from '@/api/finance.js';
|
||||
import { feedback } from '@/api/payment.js';
|
||||
import { appWxpayFun, zfbPayFun } from '@/utils/payUtils.js'
|
||||
|
||||
export default {
|
||||
components: { Header, TopSafe,MyBtn,SelectItem,CodeItem },
|
||||
data() {
|
||||
return {
|
||||
topText:'',
|
||||
type:0,
|
||||
amount:'',
|
||||
money:'',
|
||||
noAmount:'',
|
||||
account:'',
|
||||
bottomText:'',
|
||||
curSelect:'0',
|
||||
selectShow:false,
|
||||
codeShow:false,
|
||||
name:'',
|
||||
inputCss: {
|
||||
"height": '80rpx',
|
||||
"background": "#F3F3F3FF",
|
||||
"border-radius": "30rpx",
|
||||
"border": "0rpx",
|
||||
"padding-left": "12rpx",
|
||||
},
|
||||
dataList:[
|
||||
|
||||
],
|
||||
selectVal:null,
|
||||
userInfo:null,
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
if(option && option.type){
|
||||
this.type = Number(option.type);
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
userinfo() {
|
||||
getUserInfo().then(res => {
|
||||
if (res.bizcode == 100) {
|
||||
this.userInfo = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
onInput(e){
|
||||
this.$nextTick(() => {
|
||||
this.money = func.checkInputPrice(e.detail.value);
|
||||
})
|
||||
},
|
||||
onOk(val){
|
||||
this.selectVal = this.dataList.filter(i=>i.id == val)[0];
|
||||
this.onClose();
|
||||
},
|
||||
onClose(){
|
||||
this.selectShow = false;
|
||||
this.codeShow = false;
|
||||
},
|
||||
getList(val){
|
||||
let params = {
|
||||
platform:this.curSelect == 0 ? 2 : 1
|
||||
}
|
||||
getWithdraw(params).then(res=>{
|
||||
if (res.bizcode === 100) {
|
||||
this.dataList = res.data;
|
||||
this.dataList.forEach(item=>{
|
||||
item.name = item.accountName;
|
||||
item.account = item.accountNumber;
|
||||
})
|
||||
this.selectShow = true;
|
||||
} else {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: res.msg,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
})
|
||||
},
|
||||
onSelect(val){
|
||||
this.curSelect = val;
|
||||
if(this.type == 0){
|
||||
this.selectVal = null;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
async getAcctBalance() {
|
||||
this.balanceLoading = true;
|
||||
const resp = await getAcctBalance();
|
||||
let data = [];
|
||||
if (resp && resp.bizcode === 100) {
|
||||
data = resp.data || [];
|
||||
data.forEach(item=>{
|
||||
if("balance" == item.categoty){
|
||||
this.noAmount = item.lockAmount;
|
||||
this.amount = item.curAmount;
|
||||
}
|
||||
})
|
||||
}
|
||||
this.balanceList = data;
|
||||
this.balanceLoading = false;
|
||||
},
|
||||
init() {
|
||||
if(this.type == 0 ){
|
||||
this.topText = '现金余额提现';
|
||||
this.bottomText = '提现';
|
||||
}else if(this.type == 1){
|
||||
this.topText = '现金余额充值';
|
||||
this.bottomText = '充值';
|
||||
}
|
||||
this.userinfo();
|
||||
this.getAcctBalance();
|
||||
},
|
||||
onAdd(){
|
||||
if(this.type == 0){
|
||||
if(!this.money){
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "请输入金额",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(Number(this.money) < 0.3){
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "提现金额不能低于0.3元",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(Number(this.money) > 2000){
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "提现金额不能大于2000元",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(Number(this.money)> Number(this.amount)){
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "输入金额大于可用余额",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(this.type == 0 && !this.selectVal){
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "请选择提现方式",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.codeShow = true;
|
||||
}else{
|
||||
if(!this.money){
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "请输入金额",
|
||||
});
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
amount:this.money,
|
||||
category:'balance',
|
||||
payway:this.curSelect == '0' ? 'wechat' : 'alipay'
|
||||
}
|
||||
recharge(params).then(result=>{
|
||||
if (result && result.bizcode === 100) {
|
||||
const item = result.data;
|
||||
if (item.wechat && Object.keys(item.wechat).length !== 0) {
|
||||
this.appWxpay(item.wechat, item.orderId, item.orderNum);
|
||||
} else if (item.alipay && Object.keys(item.alipay).length !== 0 && item.alipay) {
|
||||
this.zfbPay(item.alipay, item.orderId, item.orderNum);
|
||||
} else {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: "充值失败",
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
async appWxpay(alipay, orderId, orderNum) {
|
||||
try {
|
||||
const result = await appWxpayFun(alipay, orderId, orderNum);
|
||||
console.log('支付成功', result);
|
||||
// 处理支付成功后的逻辑,如更新订单状态等
|
||||
} catch (error) {
|
||||
console.error('支付失败', error);
|
||||
// 处理支付失败后的逻辑,如提示用户等
|
||||
}
|
||||
},
|
||||
// 支付宝支付
|
||||
async zfbPay(alipay, orderId, orderNum) {
|
||||
try {
|
||||
const result = await zfbPayFun(alipay, orderId, orderNum);
|
||||
console.log('支付成功', result);
|
||||
// 处理支付成功后的逻辑,如更新订单状态等
|
||||
} catch (error) {
|
||||
console.error('支付失败', error);
|
||||
// 处理支付失败后的逻辑,如提示用户等
|
||||
}
|
||||
|
||||
},
|
||||
onTi(code){
|
||||
let params = {
|
||||
verificationCode:code,
|
||||
bindId:this.selectVal.id,
|
||||
amount:Number(this.money),
|
||||
accountType:this.curSelect == '0' ? 1 : 2
|
||||
}
|
||||
console.log('absc',params)
|
||||
sendWithdraw(params).then(res=>{
|
||||
console.log('absc',res)
|
||||
if (res && res.bizcode === 100) {
|
||||
console.log('absc',res)
|
||||
// data = resp.data || [];
|
||||
if(this.curSelect == '1'){
|
||||
uni.navigateTo({
|
||||
url:'/pages/rwa_package/account/success?money=' + params.amount
|
||||
})
|
||||
}else{
|
||||
uni.requestMerchantTransfer({
|
||||
"mchId": "mchId",
|
||||
"appId": "wx7a5902cd556d9396",
|
||||
"package": "package",
|
||||
success: (res) => {
|
||||
uni.navigateTo({
|
||||
url:'/pages/rwa_package/account/success?money=' + params.amount
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res.errMsg)
|
||||
},
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
this.money = '';
|
||||
this.curSelect = '0';
|
||||
this.selectVal = null;
|
||||
this.onClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bottom-btn{
|
||||
width: 100%;
|
||||
margin-bottom:92rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
.setting-view {
|
||||
width: 100%;
|
||||
height: calc(100% - 88rpx - 92rpx - 88rpx - var(--status-bar-height));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
overflow-y: auto;
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
.top-view{
|
||||
width:100%;
|
||||
margin-top:40rpx;
|
||||
height:188rpx;
|
||||
min-height:188rpx;
|
||||
display: flex;
|
||||
background:linear-gradient( 270deg, #B164FB 0%, #7934F6 100%);
|
||||
padding: 36rpx 32rpx;
|
||||
box-sizing: border-box;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-radius: 16rpx;
|
||||
.top-left{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height:108rpx;
|
||||
|
||||
|
||||
}
|
||||
.top-right{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
height:108rpx;
|
||||
}
|
||||
}
|
||||
.zhu-view{
|
||||
width:100%;
|
||||
display: flex;
|
||||
margin-top:32rpx;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
padding: 16rpx;
|
||||
box-sizing: border-box;
|
||||
background: rgba(121, 52, 246, 0.05);
|
||||
border-radius:8rpx ;
|
||||
}
|
||||
.mid-view{
|
||||
width:100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx;
|
||||
padding-bottom:0 ;
|
||||
margin-top:24rpx;
|
||||
.item-view{
|
||||
width:100%;
|
||||
heihgt:110rpx;
|
||||
min-height:110rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
border-bottom: 2rpx solid #ececec;
|
||||
.right-icon-view{
|
||||
position: absolute;
|
||||
right:0;
|
||||
display: flex;
|
||||
|
||||
|
||||
}
|
||||
|
||||
image{
|
||||
width:48rpx;
|
||||
height:48rpx;
|
||||
}
|
||||
}
|
||||
.input-view{
|
||||
width:100%;
|
||||
height:100rpx;
|
||||
border-radius: 20rpx;
|
||||
margin:32rpx 0 ;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
@@ -0,0 +1,2 @@
|
||||
## 1.0.2(2025-02-26)
|
||||
按照规范修改options参数类型(RequestMerchantTransferOption 更改为RequestMerchantTransferOptions)
|
||||
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"id": "uni-requestMerchantTransfer",
|
||||
"displayName": "uni-requestMerchantTransfer",
|
||||
"version": "1.0.2",
|
||||
"description": "商家转账用户确认模式下,拉起页面请求用户确认收款Transfer",
|
||||
"keywords": [
|
||||
"确认收款"
|
||||
],
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.6.8"
|
||||
},
|
||||
"dcloudext": {
|
||||
"type": "uts",
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "使用微信Open SDK,数据采集相关内容参考:微信Open SDK个人信息处理规则 https://support.weixin.qq.com/cgi-bin/mmsupportacctnodeweb-bin/pages/RYiYJkLOrQwu0nb8",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"uni-ext-api": {
|
||||
"uni": {
|
||||
"requestMerchantTransfer": {
|
||||
"name": "requestMerchantTransfer",
|
||||
"app": {
|
||||
"js": false,
|
||||
"kotlin": true,
|
||||
"swift": true,
|
||||
"arkts": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y",
|
||||
"alipay": "y"
|
||||
},
|
||||
"client": {
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
},
|
||||
"App": {
|
||||
"app-android": {
|
||||
"minVersion": "21"
|
||||
},
|
||||
"app-ios": {
|
||||
"minVersion": "12"
|
||||
},
|
||||
"app-harmony": "u"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "u",
|
||||
"Android Browser": "u",
|
||||
"微信浏览器(Android)": "u",
|
||||
"QQ浏览器(Android)": "u"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "u",
|
||||
"IE": "u",
|
||||
"Edge": "u",
|
||||
"Firefox": "u",
|
||||
"Safari": "u"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "u",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u",
|
||||
"钉钉": "u",
|
||||
"快手": "u",
|
||||
"飞书": "u",
|
||||
"京东": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
# uni-requestMerchantTransfer
|
||||
|
||||
微信小程序平台参考:[微信小程序API规范](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestMerchantTransfer.html)
|
||||
|
||||
## uni.requestMerchantTransfer(options: RequestMerchantTransferOption)
|
||||
|
||||
商家转账用户确认模式下,在移动端应用APP中集成开放SDK调起微信请求用户确认收款。
|
||||
|
||||
### RequestMerchantTransferOption参数:
|
||||
|
||||
| 名称 | 类型 | 必备 | 描述 |
|
||||
|-----------|:---------:|:---------:|--------------------------------------------------------------|
|
||||
| mchId | string | 是 | 商户号 |
|
||||
| subMchId | string | 否 | 子商户号,服务商模式下必填 |
|
||||
| package | string | 是 | 商家转账付款单跳转收款页 pkg 信息,商家转账付款单受理成功时返回给商户 |
|
||||
| appId | string | 否 | 商户 appId(微信平台appid),普通模式下必填,服务商模式下,appId 和 subAppId 二选一填写 |
|
||||
| subAppId | string | 否 | 子商户 appId(微信平台子appid),服务商模式下,appId 和 subAppId 二选一填写 |
|
||||
| openId | string | 否 | 收款用户 openId, 对应传入的商户 appId 下,某用户的 openId |
|
||||
| success | function | 否 | 接口调用成功的回调函数 |
|
||||
| fail | function | 否 | 接口调用失败的回调函数 |
|
||||
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
|
||||
|
||||
### 示例:
|
||||
|
||||
```javascript
|
||||
uni.requestMerchantTransfer({
|
||||
"mchId": "mchId",
|
||||
"appId": "微信开发者平台对应app的APPID",
|
||||
"package": "package",
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res.errMsg)
|
||||
},
|
||||
complete: (res) => {
|
||||
console.log(res.errMsg)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
iOS平台必须在项目根目录下的 [Info.plist](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-ios.html#infoplist) 文件中配置微信开发者平台的APPID和通用链接,配置后需提交云端打包生效。
|
||||
|
||||
1. 在 `WeChat` 节点下配置 `appid` 和 `universalLink`
|
||||
2. 在 `CFBundleURLTypes` 节点下配置 scheme 数据
|
||||
|
||||
示例如下:
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>WeChat</key>
|
||||
<dict>
|
||||
<key>appid</key>
|
||||
<string>请填写微信开发者平台对应app的APPID</string>
|
||||
<key>universalLink</key>
|
||||
<string>请填写能唤起当前应用的Universal Links路径</string>
|
||||
</dict>
|
||||
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>WeChat</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>请填写微信开发者平台对应app的APPID</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
> 如果同时使用了微信支付、微信登录、微信分享模块时,appid 和 universalLink 的值需与 manifest.json 中配置的值保持一致。
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"minSdkVersion": "21",
|
||||
"dependencies": [
|
||||
"com.tencent.mm.opensdk:wechat-sdk-android:6.8.0"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
import { RequestMerchantTransfer, RequestMerchantTransferOptions, RequestMerchantTransferGeneralCallbackResult } from '../interface.uts';
|
||||
import WXAPIFactory from 'com.tencent.mm.opensdk.openapi.WXAPIFactory'
|
||||
import URLEncoder from 'java.net.URLEncoder'
|
||||
import StandardCharsets from 'java.nio.charset.StandardCharsets'
|
||||
import WXOpenBusinessView from 'com.tencent.mm.opensdk.modelbiz.WXOpenBusinessView'
|
||||
import Build from 'com.tencent.mm.opensdk.constants.Build'
|
||||
export const requestMerchantTransfer : RequestMerchantTransfer = function (options : RequestMerchantTransferOptions) {
|
||||
var appId = options.appId
|
||||
var api = WXAPIFactory.createWXAPI(UTSAndroid.getAppContext(), appId, false)
|
||||
var wxSdkVersion = api.wxAppSupportAPI
|
||||
if (wxSdkVersion >= Build.OPEN_BUSINESS_VIEW_SDK_INT) {
|
||||
var req = WXOpenBusinessView.Req()
|
||||
req.businessType = "requestMerchantTransfer"
|
||||
|
||||
// 通过 URL 编码处理参数,确保特殊字符不会影响请求
|
||||
var query = ""
|
||||
query += 'mchId=' + encodeParams(options.mchId) + '&'
|
||||
query += 'package=' + encodeParams(options.package) + '&'
|
||||
if (appId != null) {
|
||||
query += 'appId=' + encodeParams(options.appId) + '&'
|
||||
}
|
||||
if (options.openId != null) {
|
||||
query += 'openId=' + encodeParams(options.openId) + '&'
|
||||
}
|
||||
if (options.subAppId != null) {
|
||||
query += 'subAppId=' + encodeParams(options.subAppId) + '&'
|
||||
}
|
||||
if (options.subMchId != null) {
|
||||
query += 'subMchId=' + encodeParams(options.subMchId) + '&'
|
||||
}
|
||||
query = query.substring(0, query.length - 1)
|
||||
req.query = query
|
||||
// 发送请求并检查返回值
|
||||
var ret = api.sendReq(req)
|
||||
if (ret) {
|
||||
var result : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: 'ok'
|
||||
}
|
||||
options.success?.(result)
|
||||
options.complete?.(result)
|
||||
}else{
|
||||
var result : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: 'fail'
|
||||
}
|
||||
options.fail?.(result)
|
||||
options.complete?.(result)
|
||||
}
|
||||
} else {
|
||||
var result : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: '当前微信版本过低,请升级微信以使用该功能'
|
||||
}
|
||||
options.fail?.(result)
|
||||
options.complete?.(result)
|
||||
}
|
||||
}
|
||||
function encodeParams(params : string | null) : string | null {
|
||||
return URLEncoder.encode(params, StandardCharsets.UTF_8.toString())
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
重要!
|
||||
SDK2.0.4
|
||||
1.增加privacy manifest文件
|
||||
2.修复跳微信时可能卡顿的问题
|
||||
|
||||
SDK2.0.2
|
||||
1. 优化XCFramework打包方式
|
||||
|
||||
SDK2.0.1
|
||||
1. SDK支持XCFramework
|
||||
|
||||
SDK2.0.0
|
||||
1. 分享能力支持内容防篡改校验
|
||||
|
||||
SDK1.9.9
|
||||
1. 授权登录支持关闭自动授权
|
||||
2. 分享支持添加签名,防止篡改
|
||||
|
||||
SDK1.9.7
|
||||
1. 适配CocoaPods
|
||||
|
||||
SDK1.9.6
|
||||
1. 适配iOS 16,减少读写剪切板
|
||||
|
||||
SDK1.9.4
|
||||
1. 修复授权登录取消/拒绝时state字段没有带回
|
||||
|
||||
SDK1.9.3
|
||||
1. 新增发起二维码支付能力
|
||||
|
||||
SDK1.9.2
|
||||
1. 新增发起企微客服会话能力
|
||||
|
||||
SDK1.9.1
|
||||
1. 音乐视频分享类型增加运营H5字段
|
||||
|
||||
SDK1.8.9
|
||||
1. 增加音乐视频分享类型
|
||||
|
||||
SDK1.8.8
|
||||
1. 增加游戏直播消息类型
|
||||
|
||||
SDK1.8.7.1
|
||||
1. 修复Xcode11以下编译不通过
|
||||
|
||||
SDK1.8.7
|
||||
1. 修复iPadOS,未安装微信的情况下,因为UA问题无法授权登录
|
||||
2. 修复未安装微信的情况下, 适配了UIScene的App因为UIAlertView Crash
|
||||
3. 增加Universal Link检测函数
|
||||
|
||||
SDK1.8.6.2
|
||||
1. 修改包含"UIWebView"字符的类名
|
||||
|
||||
SDK1.8.6.1
|
||||
1.短信授权登录使用的UIWebview切换成WKWebview
|
||||
|
||||
SDK1.8.6
|
||||
1. 支持Universal Link拉起微信以及返回App
|
||||
2. SDK移除MTA库
|
||||
|
||||
SDK1.8.5
|
||||
1. 更换MTA库:取消对剪切板的访问, 防止和其他SDK竞争导致crash
|
||||
2. NSMutableArray的MTA分类方法改名,减少命名冲突
|
||||
3. 不含支付功能版本移除非税支付和医保支付接口
|
||||
4. 分享音乐支持填写歌词和高清封面图
|
||||
|
||||
SDK1.8.4
|
||||
1. 调整分享图片大小限制
|
||||
2. 新增openBusinessView接口
|
||||
|
||||
SDK1.8.3
|
||||
1. SDK增加调起微信刷卡支付接口
|
||||
2. SDK增加小程序订阅消息接口
|
||||
3. 修复小程序订阅消息接口没有resp的问题
|
||||
|
||||
SDK1.8.2
|
||||
1. SDK增加开发票授权 WXInvoiceAuthInsert
|
||||
2. SDK增加非税接口 WXNontaxPay
|
||||
3. SDK增加医保接口 WXPayInsurance
|
||||
4. 更换MTA库
|
||||
|
||||
SDK1.8.1
|
||||
1. SDK打开小程序支持指定版本(体验,开发,正式版)
|
||||
2. SDK分享小程序支持指定版本(体验,开发,正式版)
|
||||
3. SDK支持输出log日志
|
||||
|
||||
SDK1.8.0
|
||||
1. SDK支持打开小程序
|
||||
2. SDK分享小程序支持shareTicket
|
||||
|
||||
SDK1.7.9
|
||||
1. SDK订阅一次性消息
|
||||
|
||||
SDK1.7.8
|
||||
1 SDK分享小程序支持大图
|
||||
|
||||
SDK1.7.7
|
||||
1 增加SDK分享小程序
|
||||
2 增加选择发票接口
|
||||
|
||||
SDK1.7.6
|
||||
1. 提高稳定性
|
||||
1 修复mta崩溃
|
||||
2 新增接口支持开发者关闭mta数据统计上报
|
||||
|
||||
SDK1.7.5
|
||||
1. 提高稳定性
|
||||
2. 加快registerApp接口启动速度
|
||||
|
||||
SDK1.7.4
|
||||
1. 更新支持iOS启用 ATS(App Transport Security)
|
||||
2. 需要在工程中链接CFNetwork.framework
|
||||
3. 在工程配置中的”Other Linker Flags”中加入”-Objc -all_load”
|
||||
|
||||
SDK1.7.3
|
||||
1. 增强稳定性,适配iOS10
|
||||
2. 修复小于32K的jpg格式缩略图设置失败的问题
|
||||
|
||||
SDK1.7.2
|
||||
1. 修复因CTTeleponyNetworkInfo引起的崩溃问题
|
||||
|
||||
SDK1.7.1
|
||||
1. 支持兼容ipv6(提升稳定性)
|
||||
2. xCode Version 7.3.1 (7D1014) 编译
|
||||
|
||||
SDK1.7
|
||||
1. 支持兼容ipv6
|
||||
2. 修复若干问题增强稳定性
|
||||
|
||||
SDK1.6.3
|
||||
1. xCode7.2 构建的sdk包。
|
||||
2. 请使用xCode7.2进行编译。
|
||||
3. 需要在Build Phases中Link Security.framework
|
||||
4. 修复若干小问题。
|
||||
|
||||
SDK1.6.2
|
||||
1、xCode7.1 构建的sdk包
|
||||
2、请使用xCode7.1进行编译
|
||||
|
||||
SDK1.6.1
|
||||
1、修复armv7s下,bitcode可能编译不过
|
||||
2、解决warning
|
||||
|
||||
SDK1.6
|
||||
1、iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。
|
||||
受此影响,当你的应用在iOS 9中需要使用微信SDK的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下代码:
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>weixin</string>
|
||||
</array>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
2、开发者需要在工程中链接上 CoreTelephony.framework
|
||||
3、解决bitcode编译不过问题
|
||||
|
||||
SDK1.5
|
||||
1、废弃safeSendReq:接口,使用sendReq:即可。
|
||||
2、新增+(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id<WXApiDelegate>) delegate;
|
||||
支持未安装微信情况下Auth,具体见WXApi.h接口描述
|
||||
3、微信开放平台新增了微信模块用户统计功能,便于开发者统计微信功能模块的用户使用和活跃情况。开发者需要在工程中链接上:SystemConfiguration.framework,libz.dylib,libsqlite3.0.dylib。
|
||||
@@ -0,0 +1,231 @@
|
||||
//
|
||||
// WXApi.h
|
||||
// 所有Api接口
|
||||
//
|
||||
// Created by Wechat on 12-2-28.
|
||||
// Copyright (c) 2012年 Tencent. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WXApiObject.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
typedef BOOL(^WXGrantReadPasteBoardPermissionCompletion)(void);
|
||||
|
||||
|
||||
#pragma mark - WXApiDelegate
|
||||
/*! @brief 接收并处理来自微信终端程序的事件消息
|
||||
*
|
||||
* 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。
|
||||
* WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。
|
||||
*/
|
||||
@protocol WXApiDelegate <NSObject>
|
||||
@optional
|
||||
|
||||
/*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果
|
||||
*
|
||||
* 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。
|
||||
* 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。
|
||||
* @param req 具体请求内容,是自动释放的
|
||||
*/
|
||||
- (void)onReq:(BaseReq*)req;
|
||||
|
||||
|
||||
|
||||
/*! @brief 发送一个sendReq后,收到微信的回应
|
||||
*
|
||||
* 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。
|
||||
* 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。
|
||||
* @param resp具体的回应内容,是自动释放的
|
||||
*/
|
||||
- (void)onResp:(BaseResp*)resp;
|
||||
|
||||
/* ! @brief 用于在iOS16以及以上系统上,控制OpenSDK是否读取剪切板中微信传递的数据以及读取的时机
|
||||
* 在iOS16以及以上系统,在SDK需要读取剪切板中微信写入的数据时,会回调该方法。没有实现默认会直接读取微信通过剪切板传递过来的数据
|
||||
* 注意:
|
||||
* 1. 只在iOS16以及以上的系统版本上回调;
|
||||
* 2. 不实现时,OpenSDK会直接调用读取剪切板接口,读取微信传递过来的数据;
|
||||
* 3. 若实现该方法:开发者需要通过调用completion(), 支持异步,通知SDK允许读取剪切板中微信传递的数据,
|
||||
* 不调用completion()则代表不授权OpenSDK读取剪切板,会导致收不到onReq:, onResp:回调,无法后续业务流程。请谨慎使用
|
||||
* 4. 不要长时间持有completion不释放,可能会导致内存泄漏。
|
||||
*/
|
||||
- (void)onNeedGrantReadPasteBoardPermissionWithURL:(nonnull NSURL *)openURL completion:(nonnull WXGrantReadPasteBoardPermissionCompletion)completion;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - WXApiLogDelegate
|
||||
|
||||
@protocol WXApiLogDelegate <NSObject>
|
||||
|
||||
- (void)onLog:(NSString*)log logLevel:(WXLogLevel)level;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark - WXApi
|
||||
|
||||
/*! @brief 微信Api接口函数类
|
||||
*
|
||||
* 该类封装了微信终端SDK的所有接口
|
||||
*/
|
||||
@interface WXApi : NSObject
|
||||
|
||||
/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
|
||||
*
|
||||
* 需要在每次启动第三方应用程序时调用。
|
||||
* @attention 请保证在主线程中调用此函数
|
||||
* @param appid 微信开发者ID
|
||||
* @param universalLink 微信开发者Universal Link
|
||||
* @return 成功返回YES,失败返回NO。
|
||||
*/
|
||||
+ (BOOL)registerApp:(NSString *)appid universalLink:(NSString *)universalLink;
|
||||
|
||||
|
||||
/*! @brief 处理旧版微信通过URL启动App时传递的数据
|
||||
*
|
||||
* 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。
|
||||
* @param url 微信启动第三方应用时传递过来的URL
|
||||
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。
|
||||
* @return 成功返回YES,失败返回NO。
|
||||
*/
|
||||
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(nullable id<WXApiDelegate>)delegate;
|
||||
|
||||
|
||||
/*! @brief 处理微信通过Universal Link启动App时传递的数据
|
||||
*
|
||||
* 需要在 application:continueUserActivity:restorationHandler:中调用。
|
||||
* @param userActivity 微信启动第三方应用时系统API传递过来的userActivity
|
||||
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。
|
||||
* @return 成功返回YES,失败返回NO。
|
||||
*/
|
||||
+ (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity delegate:(nullable id<WXApiDelegate>)delegate;
|
||||
|
||||
|
||||
/*! @brief 检查微信是否已被用户安装
|
||||
*
|
||||
* @return 微信已安装返回YES,未安装返回NO。
|
||||
*/
|
||||
+ (BOOL)isWXAppInstalled;
|
||||
|
||||
|
||||
|
||||
/*! @brief 判断当前微信的版本是否支持OpenApi
|
||||
*
|
||||
* @return 支持返回YES,不支持返回NO。
|
||||
*/
|
||||
+ (BOOL)isWXAppSupportApi;
|
||||
|
||||
|
||||
/*! @brief 判断当前微信的版本是否支持分享微信状态功能
|
||||
*
|
||||
* @attention 需在工程LSApplicationQueriesSchemes配置中添加weixinStateAPI
|
||||
* @return 支持返回YES,不支持返回NO。
|
||||
*/
|
||||
+ (BOOL)isWXAppSupportStateAPI;
|
||||
|
||||
|
||||
#ifndef BUILD_WITHOUT_PAY
|
||||
/*! @brief 判断当前微信的版本是否支持二维码拉起微信支付
|
||||
*
|
||||
* @attention 需在工程LSApplicationQueriesSchemes配置中添加weixinQRCodePayAPI
|
||||
* @return 支持返回YES,不支持返回NO。
|
||||
*/
|
||||
+ (BOOL)isWXAppSupportQRCodePayAPI;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*! @brief 获取微信的itunes安装地址
|
||||
*
|
||||
* @return 微信的安装地址字符串。
|
||||
*/
|
||||
+ (NSString *)getWXAppInstallUrl;
|
||||
|
||||
|
||||
|
||||
/*! @brief 获取当前微信SDK的版本号
|
||||
*
|
||||
* @return 返回当前微信SDK的版本号
|
||||
*/
|
||||
+ (NSString *)getApiVersion;
|
||||
|
||||
|
||||
|
||||
/*! @brief 打开微信
|
||||
*
|
||||
* @return 成功返回YES,失败返回NO。
|
||||
*/
|
||||
+ (BOOL)openWXApp;
|
||||
|
||||
|
||||
|
||||
/*! @brief 发送请求到微信,等待微信返回onResp
|
||||
*
|
||||
* 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型
|
||||
* SendAuthReq、SendMessageToWXReq、PayReq等。
|
||||
* @param req 具体的发送请求。
|
||||
* @param completion 调用结果回调block
|
||||
*/
|
||||
+ (void)sendReq:(BaseReq *)req completion:(void (^ __nullable)(BOOL success))completion;
|
||||
|
||||
/*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面
|
||||
*
|
||||
* 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有
|
||||
* GetMessageFromWXResp、ShowMessageFromWXResp等。
|
||||
* @param resp 具体的应答内容
|
||||
* @param completion 调用结果回调block
|
||||
*/
|
||||
+ (void)sendResp:(BaseResp*)resp completion:(void (^ __nullable)(BOOL success))completion;
|
||||
|
||||
|
||||
/*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp
|
||||
*
|
||||
* 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。
|
||||
* @param req 具体的发送请求。
|
||||
* @param viewController 当前界面对象。
|
||||
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。
|
||||
* @param completion 调用结果回调block
|
||||
*/
|
||||
+ (void)sendAuthReq:(SendAuthReq *)req viewController:(UIViewController*)viewController delegate:(nullable id<WXApiDelegate>)delegate completion:(void (^ __nullable)(BOOL success))completion;
|
||||
|
||||
|
||||
/*! @brief 测试函数,用于排查当前App通过Universal Link方式分享到微信的流程
|
||||
注意1: 调用自检函数之前必须要先调用registerApp:universalLink接口, 并确认调用成功
|
||||
注意2: 自检过程中会有Log产生,可以先调用startLogByLevel函数,根据Log排查问题
|
||||
注意3: 会多次回调block
|
||||
注意4: 仅用于新接入SDK时调试使用,请勿在正式环境的调用
|
||||
*
|
||||
* 当completion回调的step为WXULCheckStepFinal时,表示检测通过,Universal Link接入成功
|
||||
* @param completion 回调Block
|
||||
*/
|
||||
+ (void)checkUniversalLinkReady:(nonnull WXCheckULCompletion)completion;
|
||||
|
||||
|
||||
/*! @brief WXApi的成员函数,接受微信的log信息。byBlock
|
||||
注意1:SDK会强引用这个block,注意不要导致内存泄漏,注意不要导致内存泄漏
|
||||
注意2:调用过一次startLog by block之后,如果再调用一次任意方式的startLoad,会释放上一次logBlock,不再回调上一个logBlock
|
||||
*
|
||||
* @param level 打印log的级别
|
||||
* @param logBlock 打印log的回调block
|
||||
*/
|
||||
|
||||
+ (void)startLogByLevel:(WXLogLevel)level logBlock:(WXLogBolock)logBlock;
|
||||
|
||||
/*! @brief WXApi的成员函数,接受微信的log信息。byDelegate
|
||||
注意1:sdk会弱引用这个delegate,这里可加任意对象为代理,不需要与WXApiDelegate同一个对象
|
||||
注意2:调用过一次startLog by delegate之后,再调用一次任意方式的startLoad,不会再回调上一个logDelegate对象
|
||||
* @param level 打印log的级别
|
||||
* @param logDelegate 打印log的回调代理,
|
||||
*/
|
||||
+ (void)startLogByLevel:(WXLogLevel)level logDelegate:(id<WXApiLogDelegate>)logDelegate;
|
||||
|
||||
/*! @brief 停止打印log,会清理block或者delegate为空,释放block
|
||||
* @param
|
||||
*/
|
||||
+ (void)stopLog;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// WechatAuthSDK.h
|
||||
// WechatAuthSDK
|
||||
//
|
||||
// Created by 李凯 on 13-11-29.
|
||||
// Copyright (c) 2013年 Tencent. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
enum AuthErrCode {
|
||||
WechatAuth_Err_Ok = 0, //Auth成功
|
||||
WechatAuth_Err_NormalErr = -1, //普通错误
|
||||
WechatAuth_Err_NetworkErr = -2, //网络错误
|
||||
WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败
|
||||
WechatAuth_Err_Cancel = -4, //用户取消授权
|
||||
WechatAuth_Err_Timeout = -5, //超时
|
||||
};
|
||||
|
||||
@protocol WechatAuthAPIDelegate<NSObject>
|
||||
@optional
|
||||
|
||||
- (void)onAuthGotQrcode:(UIImage *)image; //得到二维码
|
||||
- (void)onQrcodeScanned; //二维码被扫描
|
||||
- (void)onAuthFinish:(int)errCode AuthCode:(nullable NSString *)authCode; //成功登录
|
||||
|
||||
@end
|
||||
|
||||
@interface WechatAuthSDK : NSObject{
|
||||
NSString *_sdkVersion;
|
||||
__weak id<WechatAuthAPIDelegate> _delegate;
|
||||
}
|
||||
|
||||
@property(nonatomic, weak, nullable) id<WechatAuthAPIDelegate> delegate;
|
||||
@property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号
|
||||
|
||||
/*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调
|
||||
*
|
||||
* @param appId 微信开发者ID
|
||||
* @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同
|
||||
* @param timeStamp 时间戳
|
||||
* @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔
|
||||
* @param signature 签名
|
||||
* @param schemeData 会在扫码后拼在scheme后
|
||||
* @return 成功返回YES,失败返回NO
|
||||
注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。
|
||||
*/
|
||||
|
||||
- (BOOL)Auth:(NSString *)appId
|
||||
nonceStr:(NSString *)nonceStr
|
||||
timeStamp:(NSString *)timeStamp
|
||||
scope:(NSString *)scope
|
||||
signature:(NSString *)signature
|
||||
schemeData:(nullable NSString *)schemeData;
|
||||
|
||||
|
||||
/*! @brief 暂停登录请求
|
||||
*
|
||||
* @return 成功返回YES,失败返回NO。
|
||||
*/
|
||||
- (BOOL)StopAuth;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>CA92.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.developer.associated-domains</key>
|
||||
<array/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"frameworks": [
|
||||
"CoreGraphics.framework",
|
||||
"WebKit.framework",
|
||||
"Security.framework"
|
||||
],
|
||||
"deploymentTarget": "12",
|
||||
"plists": {
|
||||
"LSApplicationQueriesSchemes": ["weixin", "weixinULAPI", "weixinURLParamsAPI"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
import { UIApplication } from "UIKit";
|
||||
import { URL, NSUserActivity, Bundle, URLComponents, URLQueryItem, Script } from "Foundation";
|
||||
import { RequestMerchantTransfer, RequestMerchantTransferOptions, RequestMerchantTransferGeneralCallbackResult } from '../interface.uts';
|
||||
|
||||
export const requestMerchantTransfer : RequestMerchantTransfer = function (options : RequestMerchantTransferOptions) {
|
||||
WxpayManager.requestMerchantTransfer(options)
|
||||
}
|
||||
|
||||
export class WxpayManagerHookProxy implements UTSiOSHookProxy {
|
||||
// 应用正常启动时 (不包括已在后台转到前台的情况)的回调函数。
|
||||
applicationDidFinishLaunchingWithOptions(application : UIApplication | null, launchOptions : Map<UIApplication.LaunchOptionsKey, any> | null = null) : boolean {
|
||||
WxpayManager.registerApp()
|
||||
return false
|
||||
}
|
||||
|
||||
// 通过 url scheme 方式唤起 app 时的回调函数。
|
||||
applicationOpenURLOptions(app : UIApplication | null, url : URL, options : Map<UIApplication.OpenURLOptionsKey, any> | null = null) : boolean {
|
||||
WxpayManager.handleOpen(url)
|
||||
return true
|
||||
}
|
||||
|
||||
// 当应用程序接收到与用户活动相关的数据时调用此方法,例如,当用户使用 Universal Link 唤起应用时。
|
||||
applicationContinueUserActivityRestorationHandler(application : UIApplication | null, userActivity : NSUserActivity | null, restorationHandler : ((res : [any] | null) => void) | null = null) : boolean {
|
||||
WxpayManager.handleOpenUniversalLink(userActivity)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
class WxpayManager implements WXApiDelegate {
|
||||
private static shared = new WxpayManager()
|
||||
private static options ?: RequestMerchantTransferOptions
|
||||
|
||||
@UTSiOS.keyword("fileprivate")
|
||||
static registerApp() {
|
||||
const scheme = WxpayManager.getApplicationScheme()
|
||||
const universalLink = WxpayManager.getApplicationUniversalLink()
|
||||
if (scheme != null && scheme != "" && universalLink != null && universalLink != "") {
|
||||
WXApi.registerApp(scheme!, universalLink = universalLink!)
|
||||
}
|
||||
}
|
||||
|
||||
@UTSiOS.keyword("fileprivate")
|
||||
static handleOpen(url : URL) {
|
||||
WXApi.handleOpen(url, delegate = shared)
|
||||
}
|
||||
|
||||
@UTSiOS.keyword("fileprivate")
|
||||
static handleOpenUniversalLink(userActivity : NSUserActivity | null) {
|
||||
if (userActivity != null) {
|
||||
WXApi.handleOpenUniversalLink(userActivity!, delegate = shared)
|
||||
}
|
||||
}
|
||||
|
||||
private static getApplicationScheme() : string | null {
|
||||
let scheme : string | null = null
|
||||
const infoDictionary = Bundle.main.infoDictionary
|
||||
if (infoDictionary != null) {
|
||||
const wechat = infoDictionary!['WeChat'] as Map<string, any> | null
|
||||
if (wechat != null) {
|
||||
scheme = wechat!['appid'] as string | null
|
||||
}
|
||||
}
|
||||
|
||||
return scheme
|
||||
}
|
||||
|
||||
private static getApplicationUniversalLink() : string | null {
|
||||
let universalLink : string | null = null
|
||||
const infoDictionary = Bundle.main.infoDictionary
|
||||
if (infoDictionary != null) {
|
||||
const wechat = infoDictionary!['WeChat'] as Map<string, any> | null
|
||||
if (wechat != null) {
|
||||
universalLink = wechat!['universalLink'] as string | null
|
||||
}
|
||||
}
|
||||
return universalLink
|
||||
}
|
||||
|
||||
//@brief 检查微信是否已被用户安装
|
||||
@UTSiOS.keyword("fileprivate")
|
||||
static isWXAppInstalled() : boolean {
|
||||
const url = URL(string = "weixin://")!
|
||||
if (UIApplication.shared.canOpenURL(url)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
static buildQueryString(parameters : Map<string, string>) : string | null {
|
||||
let components = URLComponents()
|
||||
let queryItems : [URLQueryItem] = []
|
||||
parameters.forEach((value, key) => {
|
||||
queryItems.append(URLQueryItem(name = key, value = value))
|
||||
})
|
||||
components.queryItems = queryItems
|
||||
return components.percentEncodedQuery
|
||||
}
|
||||
|
||||
static requestMerchantTransfer(options : RequestMerchantTransferOptions) {
|
||||
WxpayManager.options = options
|
||||
if (WxpayManager.isWXAppInstalled() == false) {
|
||||
var res : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: '微信没有安装'
|
||||
}
|
||||
options.fail?.(res)
|
||||
options.complete?.(res)
|
||||
}
|
||||
|
||||
if (WxpayManager.getApplicationScheme() == null || WxpayManager.getApplicationScheme() == "") {
|
||||
var res : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: '没有配置对应的URL Scheme'
|
||||
}
|
||||
options.fail?.(res)
|
||||
options.complete?.(res)
|
||||
return
|
||||
}
|
||||
|
||||
if (WxpayManager.getApplicationUniversalLink() == null || WxpayManager.getApplicationUniversalLink() == "") {
|
||||
var res : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: '没有配置对应的Universal Link'
|
||||
}
|
||||
options.fail?.(res)
|
||||
options.complete?.(res)
|
||||
return
|
||||
}
|
||||
|
||||
if (WxpayManager.options != null) {
|
||||
const parameters = new Map<string, string>()
|
||||
parameters.set('mchId', options.mchId)
|
||||
parameters.set('package', options.package)
|
||||
if (options.appId != null) {
|
||||
parameters.set('appId', options.appId!)
|
||||
}
|
||||
if (options.openId != null) {
|
||||
parameters.set('openId', options.openId!)
|
||||
}
|
||||
if (options.subAppId != null) {
|
||||
parameters.set('subAppId', options.subAppId!)
|
||||
}
|
||||
if (options.subMchId != null) {
|
||||
parameters.set('subMchId', options.subMchId!)
|
||||
}
|
||||
|
||||
let reg = new WXOpenBusinessViewReq();
|
||||
reg.businessType = "requestMerchantTransfer"
|
||||
|
||||
let query = WxpayManager.buildQueryString(parameters) ?? ""
|
||||
reg.query = query
|
||||
|
||||
//函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调onResp
|
||||
WXApi.send(reg)
|
||||
}
|
||||
}
|
||||
|
||||
//@brief 发送一个sendReq后,收到微信的回应
|
||||
onResp(resp : BaseResp) {
|
||||
if (resp instanceof WXOpenBusinessViewResp) {
|
||||
let resp = resp as WXOpenBusinessViewResp
|
||||
|
||||
if (resp.extMsg?.includes("cancel") == true) {
|
||||
var res : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: '用户取消'
|
||||
}
|
||||
WxpayManager.options?.fail?.(res)
|
||||
WxpayManager.options?.complete?.(res)
|
||||
}
|
||||
if (resp.extMsg?.includes("fail") == true) {
|
||||
var res : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: '展示页面失败'
|
||||
}
|
||||
WxpayManager.options?.fail?.(res)
|
||||
WxpayManager.options?.complete?.(res)
|
||||
}
|
||||
if (resp.extMsg?.includes("success") == true) {
|
||||
var res : RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg: '确认收款'
|
||||
}
|
||||
WxpayManager.options?.success?.(res)
|
||||
WxpayManager.options?.complete?.(res)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,710 @@
|
||||
export interface Uni {
|
||||
/**
|
||||
商家转账用户确认模式下,拉起页面请求用户确认收款
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
requestMerchantTransfer(options : RequestMerchantTransferOptions) : void;
|
||||
}
|
||||
|
||||
export type RequestMerchantTransfer = (options : RequestMerchantTransferOptions) => void;
|
||||
export type RequestMerchantTransferOptions = {
|
||||
/**
|
||||
商户号
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
mchId : string
|
||||
/**
|
||||
商家转账付款单跳转收款页 pkg 信息,商家转账付款单受理成功时返回给商户
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
package : string
|
||||
/**
|
||||
商户 appId(微信平台appid),普通模式下必填,服务商模式下,appId 和 subAppId 二选一填写
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
appId ?: string | null
|
||||
/**
|
||||
收款用户 openId, 对应传入的商户 appId 下,某用户的 openId
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
openId ?: string | null
|
||||
/**
|
||||
子商户 appId(微信平台子appid),服务商模式下,appId 和 subAppId 二选一填写
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
subAppId ?: string | null
|
||||
/**
|
||||
子商户号,服务商模式下必填
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
subMchId ?: string | null
|
||||
/**
|
||||
接口调用成功的回调函数
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
success ?: RequestMerchantTransferSuccessCallback | null
|
||||
/**
|
||||
接口调用失败的回调函数
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
fail ?: RequestMerchantTransferFailCallback | null
|
||||
/**
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
@uniPlatform {
|
||||
"app": {
|
||||
"android": {
|
||||
"osVer": "5.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"ios": {
|
||||
"osVer": "12.0",
|
||||
"uniVer": "4.54",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"harmony": {
|
||||
"osVer": "3.0",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"mp": {
|
||||
"weixin": {
|
||||
"hostVer": "√",
|
||||
"uniVer": "√",
|
||||
"unixVer": "4.54"
|
||||
},
|
||||
"alipay": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"baidu": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"toutiao": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"lark": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"qq": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"kuaishou": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
},
|
||||
"jd": {
|
||||
"hostVer": "x",
|
||||
"uniVer": "x",
|
||||
"unixVer": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
complete ?: RequestMerchantTransferCompleteCallback | null
|
||||
}
|
||||
export type RequestMerchantTransferCompleteCallback = (
|
||||
res : RequestMerchantTransferGeneralCallbackResult
|
||||
) => void
|
||||
/** 接口调用失败的回调函数 */
|
||||
export type RequestMerchantTransferFailCallback = (
|
||||
res : RequestMerchantTransferGeneralCallbackResult
|
||||
) => void
|
||||
/** 接口调用成功的回调函数 */
|
||||
export type RequestMerchantTransferSuccessCallback = (
|
||||
res : RequestMerchantTransferGeneralCallbackResult
|
||||
) => void
|
||||
export type RequestMerchantTransferGeneralCallbackResult = {
|
||||
errMsg : string
|
||||
}
|
||||
@@ -57,6 +57,21 @@ export default {
|
||||
typeof func === 'function' && func()
|
||||
}, wait)
|
||||
}
|
||||
},
|
||||
checkInputPrice(value,max = null) {
|
||||
if(max === 0){
|
||||
return '';
|
||||
}
|
||||
// value = value.replace(/^0*/g, ''); // 第一个数不能为0 ,若为0替换为空
|
||||
value = value.replace(/[^\d.]/g, ""); // 是否是数字 和小数点,若是除数字 和小数点之外的则替换为空
|
||||
value = value.replace(/^\./g, ""); // 确证第一个为数字而不是“.”
|
||||
value = value.replace(/\.{2,}/g, "."); // 只能输入一个“.”
|
||||
value = value.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); // 保证”.“只出现一次,而不能出现两次以上
|
||||
value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); // 只能输入两个小数
|
||||
if(max && value >= max){
|
||||
value = max;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user