feat: 支付

This commit is contained in:
黄泽群
2026-07-23 14:00:22 +08:00
committed by charles
parent 15dd3d7b5b
commit 3629555911
8 changed files with 1098 additions and 1018 deletions
@@ -1,230 +1,233 @@
<template> <template>
<view class="mine_order_info_warp" :style="{ <view class="mine_order_info_warp">
height: height, <up-loading-page :loading="listLoading"></up-loading-page>
}"> <view class="order_info_header">
<up-loading-page :loading="listLoading"></up-loading-page> <up-image src="/static/common/left_b.png" width="20" height="19" bgColor="#f1f6ff00"
<view class="order_info_header"> @click="jumpLeft"></up-image>
<up-image src="/static/common/left_b.png" width="20" height="19" bgColor="#f1f6ff00" @click="jumpLeft"></up-image> <view class="header_status">
<view class="header_status"> <view style="margin-top: 10rpx">
<view style="margin-top: 10rpx"> <up-image src="/static/common/order_status_1.png" width="20" height="19"
<up-image src="/static/common/order_status_1.png" width="20" height="19" bgColor="#f1f6ff00"></up-image> bgColor="#f1f6ff00"></up-image>
</view> </view>
<text class="msg">{{ getValue(ORDER_STATUS, orderInfo.status) }}</text> <text class="msg">{{ getValue(ORDER_STATUS, orderInfo.status) }}</text>
</view> </view>
</view> </view>
<view class="order_info_content"> <view class="order_info_content">
<!-- 等待付款 --> <!-- 等待付款 -->
<view class="content_due" v-if="orderInfo.status === ORDER_TYPE.UNPAID"> <view class="content_due" v-if="orderInfo.status === ORDER_TYPE.UNPAID">
<view style=""> <view style="">
<text style="font-size: 28rpx; font-weight: bold">需付款:</text> <text style="font-size: 28rpx; font-weight: bold">需付款:</text>
<text style="font-size: 28rpx">¥</text> <text style="font-size: 28rpx">¥</text>
<text style="font-size: 36rpx; font-weight: bold">{{ <text style="font-size: 36rpx; font-weight: bold">{{
orderInfo.sumAmount orderInfo.sumAmount
}}</text> }}</text>
<text style="font-size: 20rpx; font-weight: bold; margin-left: 20rpx">订单</text> <text style="font-size: 20rpx; font-weight: bold; margin-left: 20rpx">订单</text>
<text style="font-size: 28rpx; font-weight: bold; margin-left: 10rpx">{{ formatDate1(orderInfo.expireTime) <text
}}</text> style="font-size: 28rpx; font-weight: bold; margin-left: 10rpx">{{ formatDate1(orderInfo.expireTime) }}</text>
<text style="font-size: 20rpx; font-weight: bold">&nbsp;自动取消</text> <text style="font-size: 20rpx; font-weight: bold">&nbsp;自动取消</text>
</view> </view>
</view> </view>
<view class="content_cancel" v-if="orderInfo.status === ORDER_TYPE.CANCELED">取消原因:超时未支付</view> <view class="content_cancel" v-if="orderInfo.status === ORDER_TYPE.CANCELED">取消原因:超时未支付</view>
<!-- 地址 --> <!-- 地址 -->
<view class="steps_warp"> <view class="steps_warp">
<!-- 物流单号 --> <!-- 物流单号 -->
<view class="address_info"> <view class="address_info">
<view class="address_data_warp"> <view class="address_data_warp">
<up-image src="/static/common/waybill.png" width="20" height="20" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/waybill.png" width="20" height="20"
<view class="address_info_name">订单编号:</view> bgColor="#f1f6ff00"></up-image>
<view class="address_info_mobile" style="margin-right: 20rpx">{{ <view class="address_info_name">订单编号:</view>
<view class="address_info_mobile" style="margin-right: 20rpx">{{
orderInfo.orderNum orderInfo.orderNum
}}</view> }}</view>
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" <up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00"
@click="copyData(orderInfo.orderNum)"></up-image> @click="copyData(orderInfo.orderNum)"></up-image>
</view> </view>
</view> </view>
<view class="address_info_right">&nbsp;</view> <view class="address_info_right">&nbsp;</view>
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="address_warp"> <view class="address_warp">
<view class="address_info"> <view class="address_info">
<view class="address_data_warp"> <view class="address_data_warp">
<up-image src="/static/common/address.png" width="20" height="20" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/address.png" width="20" height="20"
<view class="address_info_name">{{ orderInfo.name }}</view> bgColor="#f1f6ff00"></up-image>
<view class="address_info_mobile">{{ orderInfo.phone }}</view> <view class="address_info_name">{{ orderInfo.name }}</view>
</view> <view class="address_info_mobile">{{ orderInfo.phone }}</view>
<!-- <view class="address_but">修改地址</view> --> </view>
</view> <!-- <view class="address_but">修改地址</view> -->
<view class="address_content"> </view>
{{ assembleAddress(orderInfo).names }} {{ orderInfo.address }} <view class="address_content">
</view> {{ assembleAddress(orderInfo).names }} {{ orderInfo.address }}
</view> </view>
</view> </view>
</view>
<!-- 产品 --> <!-- 产品 -->
<view class="order_comm order_product_warp"> <view class="order_comm order_product_warp">
<!-- 头部 --> <!-- 头部 -->
<view class="order_product_header"> <view class="order_product_header">
<up-image :src="orderInfo.shopLogo" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image> <up-image :src="orderInfo.shopLogo" width="22" height="22" bgColor="#f1f6ff00"
<view class="order_product_title">{{ orderInfo.shopName }}</view> shape="circle"></up-image>
</view> <view class="order_product_title">{{ orderInfo.shopName }}</view>
<!-- 产品详情 --> </view>
<view class="order_item_content"> <!-- 产品详情 -->
<view v-for="pItem in orderInfo.items" :key="pItem.id"> <view class="order_item_content">
<view class="content_item"> <view v-for="pItem in orderInfo.items" :key="pItem.id">
<up-image :src="pItem.mainGraph" width="80" height="80" bgColor="#f1f6ff00"></up-image> <view class="content_item">
<view class="content_info"> <up-image :src="pItem.mainGraph" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="content_info_title">{{ pItem.title }}</view> <view class="content_info">
<view class="content_info_tag">{{ pItem.goodsSpece }}</view> <view class="content_info_title">{{ pItem.title }}</view>
<view> <view class="content_info_tag">{{ pItem.goodsSpece }}</view>
<text class="content_info_description" v-for="dItem in pItem.description" :key="dItem"> <view>
{{ dItem }} <text class="content_info_description" v-for="dItem in pItem.description"
</text> :key="dItem">
</view> {{ dItem }}
</view> </text>
<view class="content_right"> </view>
<view class="content_right_total">¥{{ pItem.goodsAmount }}</view> </view>
<view class="content_right_quantity">x{{ pItem.buyNum }}</view> <view class="content_right">
</view> <view class="content_right_total">¥{{ pItem.goodsAmount }}</view>
</view> <view class="content_right_quantity">x{{ pItem.buyNum }}</view>
<view class="content_other_item"> </view>
<view class="data_item data_item_yd" v-if="pItem.expressNo"> </view>
<view class="item_title">运单号:</view> <view class="content_other_item">
<view class="item_value"> <view class="data_item data_item_yd" v-if="pItem.expressNo">
<view>{{ pItem.expressNo }} </view> <view class="item_title">运单号:</view>
<view style="margin-left: 10rpx"> <view class="item_value">
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" <view>{{ pItem.expressNo }} </view>
@click="copyData(pItem.expressNo)"></up-image> <view style="margin-left: 10rpx">
</view> <up-image src="/static/common/copy.png" width="14" height="14"
</view> bgColor="#f1f6ff00" @click="copyData(pItem.expressNo)"></up-image>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
<!-- 金额等数据汇总 --> <!-- 金额等数据汇总 -->
<view class="order_comm order_data_warp"> <view class="order_comm order_data_warp">
<view class="data_item"> <view class="data_item">
<view class="item_title">商品总价</view> <view class="item_title">商品总价</view>
<view class="item_value" v-if="!orderInfo.buyDeductionValue">¥{{ orderInfo.sumAmount }}</view> <view class="item_value">¥{{ orderInfo.sumAmount }}</view>
<view class="item_value" v-else>数字积分{{ orderInfo.buyDeductionValue }} +¥{{ orderInfo.sumAmount }}</view> </view>
</view> <view class="data_item">
<view class="data_item"> <view class="item_title">快递运费</view>
<view class="item_title">快递运费</view> <view class="item_value">¥{{ orderInfo.postage }}</view>
<view class="item_value">¥{{ orderInfo.postage }}</view> </view>
</view> <view class="data_item">
<view class="item_title">平台优惠<text class="copy_order_coupon" v-if="orderInfo.coupon">优惠券</text>
</view>
<view class="item_value">-¥0.00</view>
</view>
<view class="data_item">
<view class="item_title">应付款</view>
<view class="item_value pay_amount">¥{{ orderInfo.sumAmount + orderInfo.postage }}</view>
</view>
<view class="order_data_but"></view>
<view class="data_item" v-if="orderInfo.buyDeductionValue"> <view class="data_item">
<view class="item_title">数字积分</view> <view class="item_title">买家留言</view>
<view class="item_value" style="color: #7934F6">{{ orderInfo.buyDeductionValue }}数字积分</view> <view class="item_value">{{ orderInfo.remark }}</view>
</view> </view>
<view class="data_item">
<view class="data_item"> <view class="item_title">配送方式</view>
<view class="item_title">平台优惠<text class="copy_order_coupon" v-if="orderInfo.coupon">优惠券</text></view> <view class="item_value">普通快递</view>
<view class="item_value">-¥0.00</view> </view>
</view> <!-- <view class="data_item">
<view class="data_item">
<view class="item_title">应付款</view>
<view class="item_value pay_amount">¥{{ orderInfo.sumAmount + orderInfo.postage }}</view>
</view>
<view class="order_data_but"></view>
<view class="data_item">
<view class="item_title">买家留言</view>
<view class="item_value">{{ orderInfo.remark }}</view>
</view>
<view class="data_item">
<view class="item_title">配送方式</view>
<view class="item_value">普通快递</view>
</view>
<!-- <view class="data_item">
<view class="item_title">支付方式</view> <view class="item_title">支付方式</view>
<view class="item_value">微信支付</view> <view class="item_value">微信支付</view>
</view> --> </view> -->
<view class="data_item"> <view class="data_item">
<view class="item_title">下单时间</view> <view class="item_title">下单时间</view>
<view class="item_value">{{ formatDate(orderInfo.ctdate) }}</view> <view class="item_value">{{ formatDate(orderInfo.ctdate) }}</view>
</view> </view>
</view> </view>
<view class="code_content" v-if="orderInfo.antChainHash"> <view class="code_content" v-if="orderInfo.antChainHash">
<view> <view>
<view style="font-size: 28rpx; color: #333; font-weight: bold">您的订单已接入蚂蚁链溯源</view> <view style="font-size: 28rpx; color: #333; font-weight: bold">您的订单已接入蚂蚁链溯源</view>
<view style="font-size: 20rpx; color: #999; margin-bottom: 18rpx">扫描二维码或复制下方链接查看溯源信息</view> <view style="font-size: 20rpx; color: #999; margin-bottom: 18rpx">扫描二维码或复制下方链接查看溯源信息</view>
<view class="code_content_item"> <view class="code_content_item">
<view class="code_content_item_text"> <view class="code_content_item_text">
{{ {{
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}` `https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`
}} }}
</view> </view>
<up-image style="margin-left: 8rpx" src="/static/rwa/copy.png" width="12" @click=" <up-image style="margin-left: 8rpx" src="/static/rwa/copy.png" width="12" @click="
copyData( copyData(
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`
)
" height="12" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<view @click.native="
previewQrcode(
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}` `https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`
) )
" height="12" bgColor="#f1f6ff00"></up-image> ">
</view> <up-qrcode
</view> :val="`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`"
<view> :size="63"></up-qrcode>
<up-qrcode </view>
:val="`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`" </view>
:size="63" <!-- 支付方式 -->
@click.stop="previewQrcode(`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`)"></up-qrcode>
</view>
</view>
<!-- 支付方式 -->
<view class="order_way_warp" @click="wayShowFun(true)" v-if="orderInfo.status === ORDER_TYPE.UNPAID">
<view>支付方式</view>
<view class="order_way_right">
{{ getValue(wayOption, wayForm.payway) }}
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
</view>
</view>
<view class="collect_operate order_but_warp" v-if="
[ORDER_TYPE.UNPAID, ORDER_TYPE.NOT_RECEIVE].includes(orderInfo.status)
">
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">取消订单</view> -->
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.UNPAID" @click="goPay">去付款</view>
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请退款</view> -->
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.NOT_RECEIVE"
@click="confirmReceiptOk(orderInfo)">确认收货</view>
<!-- <view class="operate_comm operate_but_3" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> -->
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请售后</view> -->
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.AFTER_SALE">查看售后</view> -->
<!-- <view class="operate_comm operate_but_1" v-if="[ORDER_TYPE.COMPLETED].includes(orderInfo.status)">删除记录</view> -->
<!-- <view class="operate_comm operate_but_3" v-if="[ORDER_TYPE.COMPLETED,ORDER_TYPE.CANCELED].includes(orderInfo.status)">再次购买</view> -->
</view>
<!-- 选择支付方式 --> <view class="order_way_warp" @click="wayShowFun(true)" v-if="orderInfo.status === ORDER_TYPE.UNPAID">
<up-popup v-model:show="wayShow" :round="10" :closeOnClickOverlay="false" :closeable="true" <view>支付方式</view>
:safeAreaInsetBottom="false"> <view class="order_way_right">
<view class="way_popup_warp"> {{ getValue(wayOption, wayForm.payway) }}
<view class="way_popup_title">支付方式</view> <up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<up-radio-group v-model="wayForm.payway" placement="column"> </view>
<view v-for="item in wayOption" :key="item.id" style="margin-bottom: 10rpx"> </view>
<view class="way_item"> </view>
<view class="way_item_"> <view class="collect_operate order_but_warp" v-if="
<!-- <view style="margin-top: 2rpx;"><up-image :src="item.path" width="20" height="20" bgColor="#f1f6ff00"></up-image></view> --> [ORDER_TYPE.UNPAID, ORDER_TYPE.NOT_RECEIVE].includes(orderInfo.status)
<view class="way_item_val">{{ item.name ">
}}<text v-if="item.balance">&nbsp;&nbsp;(¥{{ item.balance }})</text> <!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">取消订单</view> -->
</view> <view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.UNPAID" @click="goPay">去付款
</view> </view>
<up-radio :name="item.type" activeColor="#FF7C41"> </up-radio> <!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请退款</view> -->
</view> <view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.NOT_RECEIVE"
<view class="balance_comm_msg" v-if="item.type === 'balance' && isShowBalance">当前现金余额不足,如需支付请前往充值</view> @click="confirmReceiptOk(orderInfo)">确认收货</view>
</view> <!-- <view class="operate_comm operate_but_3" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> -->
</up-radio-group> <!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请售后</view> -->
<view class="popup_but" @click="wayShow = false"> 确认 </view> <!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.AFTER_SALE">查看售后</view> -->
</view> <!-- <view class="operate_comm operate_but_1" v-if="[ORDER_TYPE.COMPLETED].includes(orderInfo.status)">删除记录</view> -->
</up-popup> <!-- <view class="operate_comm operate_but_3" v-if="[ORDER_TYPE.COMPLETED,ORDER_TYPE.CANCELED].includes(orderInfo.status)">再次购买</view> -->
<up-toast ref="uToastRef"></up-toast> </view>
<QrcodePreview ref="qrcodePreview" :qrcodeVal="qrcodeVal" />
</view> <!-- 选择支付方式 -->
<up-popup v-model:show="wayShow" :round="10" :closeOnClickOverlay="false" :closeable="true"
:safeAreaInsetBottom="false">
<view class="way_popup_warp">
<view class="way_popup_title">支付方式</view>
<up-radio-group v-model="wayForm.payway" placement="column">
<view v-for="item in wayOption" :key="item.id" style="margin-bottom: 10rpx">
<view class="way_item">
<view class="way_item_">
<!-- <view style="margin-top: 2rpx;"><up-image :src="item.path" width="20" height="20" bgColor="#f1f6ff00"></up-image></view> -->
<view class="way_item_val">{{ item.name
}}<text v-if="item.balance">&nbsp;&nbsp;(¥{{ item.balance }})</text>
</view>
</view>
<up-radio :name="item.type" activeColor="#FF7C41"> </up-radio>
</view>
<view class="balance_comm_msg" v-if="item.type === 'balance' && isShowBalance">
当前现金余额不足,如需支付请前往充值</view>
</view>
</up-radio-group>
<view class="popup_but" @click="wayShow = false"> 确认 </view>
</view>
</up-popup>
<up-toast ref="uToastRef"></up-toast>
<QrcodePreview ref="qrcodePreviewRef" :qrcodeVal="qrcodeVal" />
</view>
</template> </template>
<script> <script>
import { ORDER_TYPE, ORDER_STATUS, getValue } from "@/utils/enumUtils.js"; import { ORDER_TYPE, ORDER_STATUS, getValue } from "@/utils/enumUtils.js";
import QrcodePreview from "@/pages/rwa_package/rwa_withdrawal_log/qrcode-preview.vue"; import QrcodePreview from "@/pages/rwa_package/component/qrcode-preview.vue";
import { import {
copyData, copyData,
assembleAddress, assembleAddress,
@@ -245,9 +248,6 @@ import {
} from "@/utils/payUtils.js"; } from "@/utils/payUtils.js";
export default { export default {
components: {
QrcodePreview,
},
computed: { computed: {
ORDER_TYPE() { ORDER_TYPE() {
return ORDER_TYPE; return ORDER_TYPE;
@@ -458,266 +458,270 @@ export default {
this.id, this.id,
}); });
}, },
previewQrcode(val) { previewQrcode(val) {
console.log("val--", val); console.log("val--", val);
this.qrcodeVal = val; this.qrcodeVal = val;
this.$refs.qrcodePreview.open(); this.$refs.qrcodePreviewRef.open();
}, },
}, },
components: {
QrcodePreview,
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.code_content { .code_content {
display: flex; display: flex;
background: #fff; background: #fff;
border-radius: 24rpx; border-radius: 24rpx;
padding: 32rpx; padding: 32rpx;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 48rpx; margin-bottom: 48rpx;
.code_content_item { .code_content_item {
font-size: 20rpx; font-size: 20rpx;
color: #7934f6; color: #7934f6;
display: flex; display: flex;
align-items: center; align-items: center;
.code_content_item_text { .code_content_item_text {
width: 350rpx; width: 350rpx;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
display: inline-block; display: inline-block;
word-break: keep-all; word-break: keep-all;
} }
} }
} }
.mine_order_info_warp { .mine_order_info_warp {
height: 100vh; // height: 100vh;
// height: calc(100vh - 180rpx); height: calc(100vh - 180rpx);
background-color: $app-bj; background-color: $app-bj;
position: relative; position: relative;
overflow-y: auto; overflow-y: auto;
} }
.order_info_header { .order_info_header {
background-color: $app-bt-bj; background-color: $app-bt-bj;
height: 288rpx; height: 288rpx;
display: flex; display: flex;
padding: 100rpx 30rpx 30rpx; padding: 100rpx 30rpx 30rpx;
.header_status { .header_status {
width: 90%; width: 90%;
text-align: center; text-align: center;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 58rpx; height: 58rpx;
align-items: center; align-items: center;
.msg { .msg {
margin-left: 20rpx; margin-left: 20rpx;
font-weight: bold; font-weight: bold;
font-size: 36rpx; font-size: 36rpx;
color: #ffffff; color: #ffffff;
} }
} }
} }
.order_info_content { .order_info_content {
position: absolute; position: absolute;
top: 184rpx; top: 184rpx;
width: calc(100% - 40rpx); width: calc(100% - 40rpx);
padding: 0 20rpx; padding: 0 20rpx;
.content_due { .content_due {
display: grid; display: grid;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
color: #ffffff; color: #ffffff;
.payment_but { .payment_but {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.but { .but {
background: #ffffff; background: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
text-align: center; text-align: center;
width: 200rpx; width: 200rpx;
padding: 10rpx 0; padding: 10rpx 0;
color: $app-bt-bj; color: $app-bt-bj;
font-weight: bold; font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
} }
.content_cancel { .content_cancel {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
color: #ffffff; color: #ffffff;
} }
.steps_warp { .steps_warp {
background: #ffffff; background: #ffffff;
border-radius: 24rpx; border-radius: 24rpx;
padding: 20rpx; padding: 20rpx;
width: calc(100% - 40rpx); width: calc(100% - 40rpx);
margin-top: 66rpx; margin-top: 66rpx;
.address_info_right { .address_info_right {
border-left: 1rpx dashed #99999959; border-left: 1rpx dashed #99999959;
height: 14rpx; height: 14rpx;
width: 10rpx; width: 10rpx;
margin: 10rpx 20rpx; margin: 10rpx 20rpx;
} }
.address_warp {} .address_warp {}
.address_info { .address_info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.address_data_warp { .address_data_warp {
font-weight: bold; font-weight: bold;
color: #1a1a1a; color: #1a1a1a;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.address_info_name { .address_info_name {
margin-left: 10rpx; margin-left: 10rpx;
font-size: 28rpx; font-size: 28rpx;
} }
.address_info_mobile { .address_info_mobile {
margin-left: 10rpx; margin-left: 10rpx;
font-size: 24rpx; font-size: 24rpx;
} }
.address_but { .address_but {
border-radius: 30rpx; border-radius: 30rpx;
border: 1px solid #9a9a9a; border: 1px solid #9a9a9a;
font-size: 20rpx; font-size: 20rpx;
color: #222222; color: #222222;
padding: 8rpx 20rpx; padding: 8rpx 20rpx;
} }
.address_content { .address_content {
font-weight: 500; font-weight: 500;
font-size: 26rpx; font-size: 26rpx;
color: #666666; color: #666666;
padding: 20rpx 10rpx 20rpx 44rpx; padding: 20rpx 10rpx 20rpx 44rpx;
} }
} }
} }
.order_comm { .order_comm {
background: #ffffff; background: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
padding: 30rpx; padding: 30rpx;
margin-top: 30rpx; margin-top: 30rpx;
width: calc(100% - 60rpx); width: calc(100% - 60rpx);
} }
.order_product_warp { .order_product_warp {
.order_product_header { .order_product_header {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.order_product_title { .order_product_title {
font-weight: bold; font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
color: #1a1a1a; color: #1a1a1a;
margin-left: 10rpx; margin-left: 10rpx;
} }
} }
.order_data_warp { .order_data_warp {
margin-bottom: 20rpx; margin-bottom: 20rpx;
.pay_amount { .pay_amount {
color: $app-bt-bj; color: $app-bt-bj;
} }
.copy_order_number { .copy_order_number {
background: #f2f2f2; background: #f2f2f2;
border-radius: 18rpx; border-radius: 18rpx;
font-weight: bold; font-weight: bold;
font-size: 22rpx; font-size: 22rpx;
color: #333333; color: #333333;
padding: 4rpx 14rpx; padding: 4rpx 14rpx;
margin-left: 10rpx; margin-left: 10rpx;
} }
.copy_order_coupon { .copy_order_coupon {
margin-left: 24rpx; margin-left: 24rpx;
border-radius: 6rpx; border-radius: 6rpx;
border: 1px solid $app-bt-bj; border: 1px solid $app-bt-bj;
padding: 4rpx 18rpx; padding: 4rpx 18rpx;
color: $app-bt-bj; color: $app-bt-bj;
} }
.order_data_but { .order_data_but {
border: 1rpx solid #f6f6f6; border: 1rpx solid #f6f6f6;
} }
} }
.order_but_warp { .order_but_warp {
position: fixed; position: fixed;
height: 140rpx; height: 140rpx;
bottom: 0; bottom: 0;
background-color: #ffffff; background-color: #ffffff;
right: 14rpx; right: 14rpx;
width: calc(100% - 40rpx); width: calc(100% - 40rpx);
background-color: #ffffff; background-color: #ffffff;
padding: 20rpx; padding: 20rpx;
.operate_comm { .operate_comm {
height: 34rpx; height: 34rpx;
} }
} }
.content_other_item { .content_other_item {
margin-top: 20rpx; margin-top: 20rpx;
} }
.data_item { .data_item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
line-height: 60rpx; line-height: 60rpx;
font-weight: bold; font-weight: bold;
font-size: 24rpx; font-size: 24rpx;
} }
.item_title { .item_title {
color: #808080; color: #808080;
} }
.item_value { .item_value {
color: #1a1a1a; color: #1a1a1a;
display: flex; display: flex;
} }
.order_way_warp { .order_way_warp {
margin-bottom: 60rpx; margin-bottom: 60rpx;
width: calc(100% - 96rpx); width: calc(100% - 96rpx);
} }
.content_info_title { .content_info_title {
width: 370rpx; width: 370rpx;
} }
.data_item_yd { .data_item_yd {
display: flex; display: flex;
justify-content: left; justify-content: left;
} }
</style> </style>
@@ -25,7 +25,8 @@
<view class="form_item"> <view class="form_item">
<view class="form_item_title">目标账户</view> <view class="form_item_title">目标账户</view>
<view class="recharge_way_warp"> <view class="recharge_way_warp">
<up-radio-group v-model="form.toCategory" placement="column" v-if="wayOption && wayOption.length !== 0"> <up-radio-group v-model="form.toCategory" placement="column"
v-if="wayOption && wayOption.length !== 0">
<view :class="index + 1 < wayOption.length ? 'way_item way_item_but' : 'way_item'" <view :class="index + 1 < wayOption.length ? 'way_item way_item_but' : 'way_item'"
v-for="(item, index) in wayOption" :key="item.id"> v-for="(item, index) in wayOption" :key="item.id">
<view class="way_item_"> <view class="way_item_">
@@ -53,87 +54,95 @@
</template> </template>
<script> <script>
import Header from '@/components/header.vue'; import Header from '@/components/header.vue';
import { getExchangeRule, exchange } from '@/api/finance.js'; import {
import { ACCOUNT_CATEGORY, getValue } from '@/utils/enumUtils.js'; getExchangeRule,
exchange
} from '@/api/finance.js';
import {
ACCOUNT_CATEGORY,
getValue
} from '@/utils/enumUtils.js';
export default { export default {
computed: { computed: {
ACCOUNT_CATEGORY() { ACCOUNT_CATEGORY() {
return ACCOUNT_CATEGORY; return ACCOUNT_CATEGORY;
},
},
components: { Header },
data() {
return {
form: {
amount: null,//充值金额
fromCategory: null,
toCategory: null,
}, },
wayOption: [], },
proAmount: 0,// 可兑换的金额 components: {
} Header
}, },
onLoad(option) { data() {
const category = option.category; return {
if (category && category !== 'null') { form: {
this.form.fromCategory = category; amount: null, //充值金额
} fromCategory: null,
const amount = option.amount; toCategory: null,
if (amount && amount !== 'null') { },
this.proAmount = amount; wayOption: [],
} proAmount: 0, // 可兑换的金额
},
mounted() {
this.getWayOption();
},
methods: {
getValue,
async getWayOption() {
const params = {
category: this.form.fromCategory,
}
const result = await getExchangeRule(params);
if (result && result.bizcode === 100) {
this.wayOption = result.data;
} }
}, },
// 立即提现 onLoad(option) {
async rechargeOk() { const category = option.category;
const params = this.form; if (category && category !== 'null') {
if (!params.amount) { this.form.fromCategory = category;
this.$refs.uToastRef.show({
type: 'error',
message: "请输入需要兑换金额",
});
return;
} }
if (!params.toCategory) { const amount = option.amount;
this.$refs.uToastRef.show({ if (amount && amount !== 'null') {
type: 'error', this.proAmount = amount;
message: "请选择目标账户",
});
return;
} }
console.log("params", params); },
const result = await exchange(params); mounted() {
console.log("result", result); this.getWayOption();
if (result && result.bizcode === 100) { },
this.$refs.uToastRef.show({ methods: {
type: 'success', getValue,
message: "已成功申请兑换", async getWayOption() {
}); const params = {
setTimeout(() => { category: this.form.fromCategory,
uni.navigateTo({ }
url: '/pages/mine_package/mine_purse/mine_purse' const result = await getExchangeRule(params);
if (result && result.bizcode === 100) {
this.wayOption = result.data;
}
},
// 立即提现
async rechargeOk() {
const params = this.form;
if (!params.amount) {
this.$refs.uToastRef.show({
type: 'error',
message: "请输入需要兑换金额",
}); });
}, 1500) return;
}
if (!params.toCategory) {
this.$refs.uToastRef.show({
type: 'error',
message: "请选择目标账户",
});
return;
}
console.log("params", params);
const result = await exchange(params);
console.log("result", result);
if (result && result.bizcode === 100) {
this.$refs.uToastRef.show({
type: 'success',
message: "已成功申请兑换",
});
setTimeout(() => {
uni.navigateTo({
url: '/pages/mine_package/mine_purse/mine_purse'
});
}, 1500)
}
} }
}
}
} }
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
@@ -46,191 +46,221 @@
</template> </template>
<script> <script>
import Header from '@/components/header.vue'; import Header from '@/components/header.vue';
import { getRechargeSupportPay, recharge } from '@/api/finance.js'; import {
import { feedback } from '@/api/payment.js'; getRechargeSupportPay,
import { appWxpayFun, zfbPayFun } from '@/utils/payUtils.js' recharge
} from '@/api/finance.js';
import {
feedback
} from '@/api/payment.js';
import {
appWxpayFun,
zfbPayFun
} from '@/utils/payUtils.js'
export default { export default {
components: { Header }, components: {
data() { Header
return { },
form: { data() {
category: null, return {
amount: null,//充值金额 form: {
payway: null,// 支付当时 category: null,
}, amount: null, //充值金额
wayOption: [], payway: null, // 支付当时
proAmount: 0, },
leftPath: '/pages/mine_package/mine_purse/mine_purse', wayOption: [],
} proAmount: 0,
}, leftPath: '/pages/mine_package/mine_purse/mine_purse',
onLoad(option) {
const category = option.category;
if (category && category !== 'null') {
this.form.category = category;
}
const amount = option.amount;
if (amount && amount !== 'null') {
this.proAmount = amount;
}
const back = option.back;
if (back && back !== 'null') {
if (back === "submit") {
const id = option.id;
this.leftPath = "/pages/order_package/order_submit/order_submit?payOpen=true&ids=" + id;
}
if (back === "orderInfo") {
const id = option.id;
this.leftPath = "/pages/mine_package/mine_order_info/mine_order_info?payOpen=true&id=" + id;
}
}
},
mounted() {
this.getWayOption();
},
methods: {
async getWayOption() {
const result = await getRechargeSupportPay();
if (result && result.bizcode === 100) {
this.wayOption = result.data;
} }
}, },
// 立即充值 onLoad(option) {
async rechargeOk() { const category = option.category;
console.log('aaaaa',this.form); if (category && category !== 'null') {
const params = this.form; this.form.category = category;
if (!params.amount) {
this.$refs.uToastRef.show({
type: 'error',
message: "请输入需要充值的金额",
});
return;
} }
if (!params.payway) { const amount = option.amount;
this.$refs.uToastRef.show({ if (amount && amount !== 'null') {
type: 'error', this.proAmount = amount;
message: "请选择支付方式",
});
return;
} }
console.log("params---", params); const back = option.back;
const result = await recharge(params); if (back && back !== 'null') {
console.log("result", result); if (back === "submit") {
if (result && result.bizcode === 100) { const id = option.id;
const item = result.data; this.leftPath = "/pages/order_package/order_submit/order_submit?payOpen=true&ids=" + id;
console.log("item", item); }
if (item.wechat && Object.keys(item.wechat).length !== 0) { if (back === "orderInfo") {
this.appWxpay(item.wechat, item.orderId, item.orderNum); const id = option.id;
} else if (item.alipay && Object.keys(item.alipay).length !== 0 && item.alipay) { this.leftPath = "/pages/mine_package/mine_order_info/mine_order_info?payOpen=true&id=" + id;
this.zfbPay(item.alipay, item.orderId, item.orderNum);
} else {
this.$refs.uToastRef.show({
type: 'error',
message: "充值失败",
});
} }
} }
}, },
// app 微信支付 mounted() {
async appWxpay(alipay, orderId, orderNum) { this.getWayOption();
try {
const result = await appWxpayFun(alipay, orderId, orderNum);
console.log('支付成功', result);
// 处理支付成功后的逻辑,如更新订单状态等
} catch (error) {
console.error('支付失败', error);
// 处理支付失败后的逻辑,如提示用户等
}
// const newThis = this;
// const orderInfo = {
// "appid": item.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
// "noncestr": item.nonceStr, // 随机字符串
// "package": "Sign=WXPay", // 固定值
// "partnerid": item.partnerId, // 微信支付商户号
// "prepayid": item.prepayId, // 统一下单订单号
// "timestamp": item.timeStamp, // 时间戳(单位:秒)
// "sign": item.sign // 签名,这里用的 MD5/RSA 签名
// };
// uni.requestPayment({
// provider:"wxpay",
// orderInfo: orderInfo,
// success: function(res) {
// console.log('success:' + res);
// newThis.payFeedbackFun(orderId,orderNum,1);
// newThis.jumpWayOk();
// },
// fail: function(err) {
// console.log('fail:',err);
// newThis.$refs.uToastRef.show({
// type: 'error',
// message: "充值失败",
// });
// setTimeout(()=>{
// newThis.jumpWayError()
// },2000)
// }
// });
}, },
// 支付宝支付 methods: {
async zfbPay(alipay, orderId, orderNum) { async getWayOption() {
try { const result = await getRechargeSupportPay();
const result = await zfbPayFun(alipay, orderId, orderNum); if (result && result.bizcode === 100) {
console.log('支付成功', result); this.wayOption = result.data;
// 处理支付成功后的逻辑,如更新订单状态等 }
} catch (error) { },
console.error('支付失败', error); // 立即充值
// 处理支付失败后的逻辑,如提示用户等 async rechargeOk() {
} console.log('aaaaa', this.form);
// const that = this; const params = this.form;
// uni.requestPayment({ if (!params.amount) {
// provider: 'alipay', this.$refs.uToastRef.show({
// orderInfo: item, type: 'error',
// success(res) { message: "请输入需要充值的金额",
// that.payFeedbackFun(orderId,orderNum,1); });
// that.jumpWayOk(); return;
// }, }
// //调用失败的回调 if (!params.payway) {
// fail(err) { this.$refs.uToastRef.show({
// that.$refs.uToastRef.show({ type: 'error',
// type: 'error', message: "请选择支付方式",
// message: "充值失败", });
// }); return;
// setTimeout(()=>{ }
// that.jumpWayError()
// },2000)
// }
// })
},
// 跳转到支付成功页面
jumpWayOk() {
this.$refs.uToastRef.show({
type: 'success',
message: "充值成功",
});
setTimeout(() => {
uni.navigateTo({
url: '/pages/mine_package/mine_purse/mine_purse'
});
}, 1500)
},
// 支付结果回调
async payFeedbackFun(orderId, orderNum, status) {
const params = {
orderId,
orderNum,
status,
}
const response = await feedback(params);
console.log("response", response);
if (response && response.bizcode !== 100) {
console.error("反馈结果", response);
}
}, if (params.payway == "wechat") {
// #ifdef MP-WEIXIN
params["payway"] = "wechatMiniProgram";
params["code"] = await new Promise((resolve) => {
uni.login({
provider: "weixin",
onlyAuthorize: true,
success: function(loginRes) {
resolve(loginRes.code);
},
fail: (err) => {
resolve(""); // 登录失败时返回空字符串,避免后续流程中断
},
});
});
// #endif
}
console.log("params---", params);
const result = await recharge(params);
console.log("result", result);
if (result && result.bizcode === 100) {
const item = result.data;
console.log("item", item);
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: "充值失败",
});
}
}
},
// app 微信支付
async appWxpay(alipay, orderId, orderNum) {
try {
const result = await appWxpayFun(alipay, orderId, orderNum);
console.log('支付成功', result);
// 处理支付成功后的逻辑,如更新订单状态等
} catch (error) {
console.error('支付失败', error);
// 处理支付失败后的逻辑,如提示用户等
}
// const newThis = this;
// const orderInfo = {
// "appid": item.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
// "noncestr": item.nonceStr, // 随机字符串
// "package": "Sign=WXPay", // 固定值
// "partnerid": item.partnerId, // 微信支付商户号
// "prepayid": item.prepayId, // 统一下单订单号
// "timestamp": item.timeStamp, // 时间戳(单位:秒)
// "sign": item.sign // 签名,这里用的 MD5/RSA 签名
// };
// uni.requestPayment({
// provider:"wxpay",
// orderInfo: orderInfo,
// success: function(res) {
// console.log('success:' + res);
// newThis.payFeedbackFun(orderId,orderNum,1);
// newThis.jumpWayOk();
// },
// fail: function(err) {
// console.log('fail:',err);
// newThis.$refs.uToastRef.show({
// type: 'error',
// message: "充值失败",
// });
// setTimeout(()=>{
// newThis.jumpWayError()
// },2000)
// }
// });
},
// 支付宝支付
async zfbPay(alipay, orderId, orderNum) {
try {
const result = await zfbPayFun(alipay, orderId, orderNum);
console.log('支付成功', result);
// 处理支付成功后的逻辑,如更新订单状态等
} catch (error) {
console.error('支付失败', error);
// 处理支付失败后的逻辑,如提示用户等
}
// const that = this;
// uni.requestPayment({
// provider: 'alipay',
// orderInfo: item,
// success(res) {
// that.payFeedbackFun(orderId,orderNum,1);
// that.jumpWayOk();
// },
// //调用失败的回调
// fail(err) {
// that.$refs.uToastRef.show({
// type: 'error',
// message: "充值失败",
// });
// setTimeout(()=>{
// that.jumpWayError()
// },2000)
// }
// })
},
// 跳转到支付成功页面
jumpWayOk() {
this.$refs.uToastRef.show({
type: 'success',
message: "充值成功",
});
setTimeout(() => {
uni.navigateTo({
url: '/pages/mine_package/mine_purse/mine_purse'
});
}, 1500)
},
// 支付结果回调
async payFeedbackFun(orderId, orderNum, status) {
const params = {
orderId,
orderNum,
status,
}
const response = await feedback(params);
console.log("response", response);
if (response && response.bizcode !== 100) {
console.error("反馈结果", response);
}
},
}
} }
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
@@ -3,7 +3,7 @@
<view class="result-modal" v-if="visible"> <view class="result-modal" v-if="visible">
<view class="modal-content"> <view class="modal-content">
<view class="modal-content-result"> <view class="modal-content-result">
<view v-for="item in prize" class="modal-content-result-item"> <view v-for="(item, index) in prize" :key="index" class="modal-content-result-item">
<view class="par-value"> <view class="par-value">
<text v-if="item.type === 'balance'" class="moeny">¥ </text>{{ item.parValue }} <text v-if="item.type === 'balance'" class="moeny">¥ </text>{{ item.parValue }}
</view> </view>
@@ -43,7 +43,7 @@ export default {
} }
</script> </script>
<style scoped> <style scoped lang="scss">
.result-modal { .result-modal {
position: fixed; position: fixed;
top: 0; top: 0;
+17
View File
@@ -275,6 +275,23 @@ export default {
category: 'balance', category: 'balance',
payway: this.curSelect == '0' ? 'wechat' : 'alipay' payway: this.curSelect == '0' ? 'wechat' : 'alipay'
} }
if (params.payway == "wechat") {
// #ifdef MP-WEIXIN
params["payway"] = "wechatMiniProgram";
params["code"] = await new Promise((resolve) => {
uni.login({
provider: "weixin",
onlyAuthorize: true,
success: function (loginRes) {
resolve(loginRes.code);
},
fail: (err) => {
resolve(""); // 登录失败时返回空字符串,避免后续流程中断
},
});
});
// #endif
}
recharge(params).then(result => { recharge(params).then(result => {
if (result && result.bizcode === 100) { if (result && result.bizcode === 100) {
const item = result.data; const item = result.data;
@@ -1,76 +1,46 @@
<template> <template>
<view class="rwa_withdrawal_log"> <view class="rwa_withdrawal_log">
<Header <Header leftTitle="行权记录" left-path-type="navigateTo" :leftPath="leftPath" />
leftTitle="行权记录" <view class="_log_content">
left-path-type="navigateTo" <view class="_log_content_title">
:leftPath="leftPath" <view>行权账户邮箱/时间</view>
/> <view>金额/状态</view>
<view class="_log_content"> </view>
<view class="_log_content_title"> <scroll-view scroll-y="true" @scrolltolower="loadMore" style="height: calc(100vh - 300rpx)">
<view>行权账户邮箱/时间</view> <view class="_content_item" v-for="item in logList" :key="item.id"
<view>金额/状态</view> v-if="logList && logList.length !== 0">
</view> <view class="_content_item_no _content_item_no_buto">NO.{{ item.tradeNo }}</view>
<scroll-view <!-- <view class="_content_item_no _content_item_no_buto" v-if="item.exchNo">股东流水号:{{item.exchNo}}</view> -->
scroll-y="true" <view class="_content_item_but">
@scrolltolower="loadMore" <view class="_content_item_left">
style="height: calc(100vh - 300rpx)" <up-image src="/static/rwa/account.png" width="40" height="40" bgColor="#f1f6ff00" />
> <view class="_content_item_left_">
<view <view class="_content_item_left_title">{{ item.name }}-{{ item.account }}</view>
class="_content_item" <view class="_content_item_left_val">{{
v-for="item in logList"
:key="item.id"
v-if="logList && logList.length !== 0"
>
<view class="_content_item_no _content_item_no_buto"
>NO.{{ item.tradeNo }}</view
>
<!-- <view class="_content_item_no _content_item_no_buto" v-if="item.exchNo">股东流水号:{{item.exchNo}}</view> -->
<view class="_content_item_but">
<view class="_content_item_left">
<up-image
src="/static/rwa/account.png"
width="40"
height="40"
bgColor="#f1f6ff00"
/>
<view class="_content_item_left_">
<view class="_content_item_left_title"
>{{ item.name }}-{{ item.account }}</view
>
<view class="_content_item_left_val">{{
formatDate(item.ctdate) formatDate(item.ctdate)
}}</view> }}</view>
</view> </view>
</view> </view>
<view class="_content_item_right"> <view class="_content_item_right">
<view class="_content_item_left_title _content_item_left_amount" <view class="_content_item_left_title _content_item_left_amount">{{ item.amount }}
>{{ item.amount }} {{ categotyObj.name || "USDT" }}</view {{ categotyObj.name || "USDT" }}</view>
> <view class="_content_item_left_status">{{
<view class="_content_item_left_status">{{
getValue(RWA_STATUS, item.status) getValue(RWA_STATUS, item.status)
}}</view> }}</view>
</view> </view>
</view> </view>
<view style="border-top: 1rpx solid #f5f5f5; margin: 28rpx 0"></view> <view style="border-top: 1rpx solid #f5f5f5; margin: 28rpx 0"></view>
<view class="code_content" v-if="item.antChainHash"> <view class="code_content" v-if="item.antChainHash">
<view> <view>
<view style="font-size: 28rpx; color: #333; font-weight: bold" <view style="font-size: 28rpx; color: #333; font-weight: bold">您的订单已接入蚂蚁链溯源</view>
>您的订单已接入蚂蚁链溯源</view <view style="font-size: 20rpx; color: #999; margin-bottom: 18rpx">扫描二维码或复制下方链接查看溯源信息</view>
> <view class="code_content_item">
<view style="font-size: 20rpx; color: #999; margin-bottom: 18rpx" <view class="code_content_item_text">
>扫描二维码或复制下方链接查看溯源信息</view {{
>
<view class="code_content_item">
<view class="code_content_item_text">
{{
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${item.antChainHash}` `https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${item.antChainHash}`
}} }}
</view> </view>
<up-image <up-image style="margin-left: 8rpx" src="/static/rwa/copy.png" width="12" @click="
style="margin-left: 8rpx"
src="/static/rwa/copy.png"
width="12"
@click="
copyData( copyData(
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${item.antChainHash}` `https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${item.antChainHash}`
) )
@@ -106,216 +76,233 @@
</template> </template>
<script> <script>
import Header from "@/components/header.vue"; import Header from "@/components/header.vue";
import { copyData } from "@/utils/index.js"; import {
import { getExchTransferRecord, getAcctBalance } from "@/api/finance.js"; copyData
import { formatDate } from "@/utils/index.js"; } from "@/utils/index.js";
import { RWA_STATUS, getValue } from "@/utils/enumUtils.js"; import {
import QrcodePreview from "@/pages/rwa_package/rwa_withdrawal_log/qrcode-preview.vue"; getExchTransferRecord,
export default { getAcctBalance
components: { Header, QrcodePreview }, } from "@/api/finance.js";
computed: { import {
RWA_STATUS() { formatDate
return RWA_STATUS; } from "@/utils/index.js";
}, import {
}, RWA_STATUS,
data() { getValue
return { } from "@/utils/enumUtils.js";
leftPath: "/pages/rwa_package/rwa_withdrawal/rwa_withdrawal", import QrcodePreview from "@/pages/rwa_package/component/qrcode-preview.vue";
logList: [], export default {
form: { components: {
page: 1, Header,
pageSize: 10, QrcodePreview
}, },
qrvalue: "", computed: {
loading: false, RWA_STATUS() {
categotyObj: {}, return RWA_STATUS;
qrcodeVal: '', },
}; },
}, data() {
onLoad(option) { return {
const back = option.back; leftPath: "/pages/rwa_package/rwa_withdrawal/rwa_withdrawal",
if (back === "rwa") { logList: [],
this.leftPath = "/pages/rwa_package/rwa/rwa"; form: {
} page: 1,
if (back === "withdrawal") { pageSize: 10,
this.leftPath = "/pages/rwa_package/rwa_withdrawal/rwa_withdrawal"; },
} qrvalue: "",
this.loadData(); loading: false,
this.getAcctBalance(); categotyObj: {},
}, qrcodeVal: '',
methods: { };
getValue, },
copyData, onLoad(option) {
formatDate, const back = option.back;
// 查询余额 if (back === "rwa") {
async getAcctBalance() { this.leftPath = "/pages/rwa_package/rwa/rwa";
const resp = await getAcctBalance(); }
let data = {}; if (back === "withdrawal") {
if (resp && resp.bizcode === 100) { this.leftPath = "/pages/rwa_package/rwa_withdrawal/rwa_withdrawal";
if (resp.data) { }
resp.data.map((item) => { this.loadData();
// 交易币 this.getAcctBalance();
if (item.categoty === "vcoin") { },
data = item; methods: {
} getValue,
}); copyData,
} formatDate,
} // 查询余额
this.categotyObj = data; async getAcctBalance() {
}, const resp = await getAcctBalance();
// 加载数据的方法 let data = {};
async loadData() { if (resp && resp.bizcode === 100) {
if (this.loading) return; // 如果正在加载,则不重复加载 if (resp.data) {
this.loading = true; // 设置加载状态为true resp.data.map((item) => {
try { // 交易币
// 模拟异步获取数据,实际应用中应该替换为你的数据获取逻辑,例如API调用 if (item.categoty === "vcoin") {
const newData = await this.fetchData( data = item;
this.form.page, }
this.form.pageSize });
); }
this.logList = [...this.logList, ...newData]; // 将新数据添加到列表中 }
this.logList.forEach((item) => { this.categotyObj = data;
if (item.name == "WALLET") { },
item.account = "******" + item.account.slice(-4); // 加载数据的方法
// item.account = func.addressTurn(item.account,6) async loadData() {
} if (this.loading) return; // 如果正在加载,则不重复加载
}); this.loading = true; // 设置加载状态为true
this.form.page++; // 页码加1 try {
} catch (error) { // 模拟异步获取数据,实际应用中应该替换为你的数据获取逻辑,例如API调用
console.error("加载数据失败:", error); const newData = await this.fetchData(
} finally { this.form.page,
this.loading = false; // 设置加载状态为false this.form.pageSize
} );
}, this.logList = [...this.logList, ...newData]; // 将新数据添加到列表中
// 模拟获取数据的方法,实际应用中应该替换为你的数据获取逻辑,例如从服务器获取数据 this.logList.forEach((item) => {
async fetchData(page, pageSize) { if (item.name == "WALLET") {
const params = { item.account = "******" + item.account.slice(-4);
page, // item.account = func.addressTurn(item.account,6)
pageSize, }
}; });
console.log("params", params); this.form.page++; // 页码加1
const resp = await getExchTransferRecord(params); } catch (error) {
console.log("resp", resp); console.error("加载数据失败:", error);
if (resp && resp.bizcode === 100) { } finally {
const data = (resp.data && resp.data.entitys) || []; this.loading = false; // 设置加载状态为false
return data; }
} else { },
return []; // 模拟获取数据的方法,实际应用中应该替换为你的数据获取逻辑,例如从服务器获取数据
} async fetchData(page, pageSize) {
}, const params = {
// 当滚动到底部时触发的方法 page,
loadMore() { pageSize,
this.loadData(); // 加载更多数据 };
}, console.log("params", params);
previewOrderQrcode(val) { const resp = await getExchTransferRecord(params);
console.log("val--", val); console.log("resp", resp);
this.qrcodeVal = val; if (resp && resp.bizcode === 100) {
this.$refs.qrcodePreviewRef.open(); const data = (resp.data && resp.data.entitys) || [];
}, return data;
}, } else {
}; return [];
}
},
// 当滚动到底部时触发的方法
loadMore() {
this.loadData(); // 加载更多数据
},
previewOrderQrcode(val) {
console.log("val--", val);
this.qrcodeVal = val;
this.$refs.qrcodePreviewRef.open();
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
.rwa_withdrawal_log { .rwa_withdrawal_log {
background: #f5f5f5; background: #f5f5f5;
height: calc(100vh - 0rpx); height: calc(100vh - 0rpx);
overflow: hidden; overflow: hidden;
._log_content { ._log_content {
height: calc(100vh - 216rpx); height: calc(100vh - 216rpx);
padding: 30rpx; padding: 30rpx;
._log_content_title { ._log_content_title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666666;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
._content_item { ._content_item {
margin-bottom: 20rpx; margin-bottom: 20rpx;
background: #ffffff; background: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
padding: 20rpx; padding: 20rpx;
._content_item_no { ._content_item_no {
padding: 0 0 20rpx 0; padding: 0 0 20rpx 0;
text-align: right; text-align: right;
font-size: 20rpx; font-size: 20rpx;
} }
._content_item_no_buto { ._content_item_no_buto {
border-bottom: 1rpx solid #eeeeee; border-bottom: 1rpx solid #eeeeee;
} }
.code_content {
display: flex;
justify-content: space-between;
align-items: center;
.code_content_item {
font-size: 20rpx;
color: #7934f6;
display: flex;
align-items: center;
.code_content_item_text {
width: 350rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
word-break: keep-all;
}
}
}
._content_item_but {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
}
._content_item_left { .code_content {
display: flex; display: flex;
align-items: center; justify-content: space-between;
} align-items: center;
._content_item_left_ { .code_content_item {
margin-left: 10rpx; font-size: 20rpx;
} color: #7934f6;
display: flex;
align-items: center;
._content_item_left_title { .code_content_item_text {
font-weight: bold; width: 350rpx;
font-size: 22rpx; overflow: hidden;
color: #000000; white-space: nowrap;
margin-bottom: 10rpx; text-overflow: ellipsis;
} display: inline-block;
word-break: keep-all;
}
}
}
._content_item_left_amount { ._content_item_but {
text-align: right; display: flex;
} justify-content: space-between;
align-items: center;
margin-top: 20rpx;
}
._content_item_left_exchNo { ._content_item_left {
font-size: 20rpx; display: flex;
color: #9e9e9e; align-items: center;
margin-bottom: 10rpx; }
}
._content_item_left_val { ._content_item_left_ {
font-weight: 400; margin-left: 10rpx;
font-size: 24rpx; }
color: #999999;
}
._content_item_left_status { ._content_item_left_title {
font-weight: 400; font-weight: bold;
font-size: 20rpx; font-size: 22rpx;
text-align: right; color: #000000;
} margin-bottom: 10rpx;
} }
}
} ._content_item_left_amount {
text-align: right;
}
._content_item_left_exchNo {
font-size: 20rpx;
color: #9e9e9e;
margin-bottom: 10rpx;
}
._content_item_left_val {
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
._content_item_left_status {
font-weight: 400;
font-size: 20rpx;
text-align: right;
}
}
}
}
</style> </style>
+110 -77
View File
@@ -1,5 +1,4 @@
import { feedback } from '@/api/payment.js'; import { feedback } from "@/api/payment.js";
/** /**
* 微信支付 * 微信支付
@@ -8,37 +7,66 @@ import { feedback } from '@/api/payment.js';
* @param {Object} orderNum 支付的订单编号 * @param {Object} orderNum 支付的订单编号
*/ */
export function appWxpayFun(alipay, orderId, orderNum) { export function appWxpayFun(alipay, orderId, orderNum) {
const type = alipay.type; const type = alipay.type;
const orderStr = alipay.orderStr; const orderStr = alipay.orderStr;
console.log("微信支付---",alipay) console.log("微信支付---", alipay,type);
if (type === "app") {// app if (type === "app") {
const orderInfo = { // app
"appid": alipay.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致 const orderInfo = {
"noncestr": alipay.nonceStr, // 随机字符串 appid: alipay.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
"package": "Sign=WXPay", // 固定值 noncestr: alipay.nonceStr, // 随机字符串
"partnerid": alipay.partnerId, // 微信支付商户号 package: "Sign=WXPay", // 固定值
"prepayid": alipay.prepayId, // 统一下单订单号 partnerid: alipay.partnerId, // 微信支付商户号
"timestamp": alipay.timeStamp, // 时间戳(单位:秒) prepayid: alipay.prepayId, // 统一下单订单号
"sign": alipay.sign // 签名,这里用的 MD5/RSA 签名 timestamp: alipay.timeStamp, // 时间戳(单位:秒)
}; sign: alipay.sign, // 签名,这里用的 MD5/RSA 签名
uni.requestPayment({ };
provider: "wxpay", uni.requestPayment({
orderInfo: orderInfo, provider: "wxpay",
success: function (res) { orderInfo: orderInfo,
console.log('success:' + res); success: function (res) {
payFeedbackFun(orderId, orderNum, 1); console.log("success:" + res);
jumpWayOk(); payFeedbackFun(orderId, orderNum, 1);
}, jumpWayOk();
fail: function (err) { },
console.log('fail:', err); fail: function (err) {
jumpWayError(); console.log("fail:", err);
} jumpWayError();
}); },
} else if (type === "h5") {// h5 });
uni.navigateTo({ } else if (type === "wechatMiniProgram") {
url: `/pages/other_package/payment_processing/payment_processing?link=${encodeURIComponent(orderStr)}&orderNum=` + orderNum // 假设有一个专门的支付页面来处理支付链接 const orderInfo = {
}); // "appid": alipay.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
}
nonceStr: alipay.nonceStr, // 微信支付商户号
package: alipay.packageValue, // 统一下单订单号
timeStamp: alipay.timeStamp, // 时间戳(单位:秒)
signType: "RSA",
paySign: alipay.sign, // 签名,这里用的 MD5/RSA 签名
};
console.log("微信小程序支付---", orderInfo);
uni.requestPayment({
...orderInfo,
success: function (res) {
console.log("success:" + res);
payFeedbackFun(orderId, orderNum, 1);
jumpWayOk();
},
fail: function (err) {
console.log("fail:", err);
jumpWayError();
},
});
} else if (type === "h5") {
// h5
uni.navigateTo({
url:
`/pages/other_package/payment_processing/payment_processing?link=${encodeURIComponent(
orderStr
)}&orderNum=` + orderNum, // 假设有一个专门的支付页面来处理支付链接
});
}
} }
/** /**
@@ -48,45 +76,50 @@ export function appWxpayFun(alipay, orderId, orderNum) {
* @param {Object} orderNum 支付的订单编号 * @param {Object} orderNum 支付的订单编号
*/ */
export function zfbPayFun(alipay, orderId, orderNum) { export function zfbPayFun(alipay, orderId, orderNum) {
console.log("alipay", alipay); console.log("alipay", alipay);
const type = alipay.type; const type = alipay.type;
const orderStr = alipay.orderStr; const orderStr = alipay.orderStr;
if (type === "h5") {// h5 if (type === "h5") {
uni.navigateTo({ // h5
url: `/pages/other_package/payment_processing/payment_processing?link=${encodeURIComponent(orderStr)}&orderNum=` + orderNum // 假设有一个专门的支付页面来处理支付链接 uni.navigateTo({
}); url:
} else if (type === "app") { // app `/pages/other_package/payment_processing/payment_processing?link=${encodeURIComponent(
uni.requestPayment({ orderStr
provider: 'alipay', )}&orderNum=` + orderNum, // 假设有一个专门的支付页面来处理支付链接
orderInfo: orderStr, });
success: function (res) { } else if (type === "app") {
console.log("zfbPayFun res", res); // app
payFeedbackFun(orderId, orderNum, 1); uni.requestPayment({
jumpWayOk(); provider: "alipay",
}, orderInfo: orderStr,
fail: function (err) { success: function (res) {
console.error("支付宝支付error", err); console.log("zfbPayFun res", res);
jumpWayError(); payFeedbackFun(orderId, orderNum, 1);
} jumpWayOk();
}); },
} fail: function (err) {
// return new Promise((resolve, reject) => { console.error("支付宝支付error", err);
// resolve(res); jumpWayError();
// // reject(err); },
// }); });
}; }
// return new Promise((resolve, reject) => {
// resolve(res);
// // reject(err);
// });
}
// 跳转到支付成功页面 // 跳转到支付成功页面
export function jumpWayOk() { export function jumpWayOk() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/order_package/order_submit_ok/order_submit_ok", url: "/pages/order_package/order_submit_ok/order_submit_ok",
}) });
} }
// 跳转到支付失败页面 // 跳转到支付失败页面
export function jumpWayError() { export function jumpWayError() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/order_package/order_submit_error/order_submit_error", url: "/pages/order_package/order_submit_error/order_submit_error",
}) });
} }
/** /**
* 支付结果回调 * 支付结果回调
@@ -95,15 +128,15 @@ export function jumpWayError() {
* @param {Object} status 反馈结果【0:失败,1:成功】 * @param {Object} status 反馈结果【0:失败,1:成功】
*/ */
async function payFeedbackFun(orderId, orderNum, status) { async function payFeedbackFun(orderId, orderNum, status) {
const params = { const params = {
orderId, orderId,
orderNum, orderNum,
status, status,
} };
console.log("params", params); console.log("params", params);
const response = await feedback(params); const response = await feedback(params);
console.log("payFeedbackFun response", response); console.log("payFeedbackFun response", response);
if (response && response.bizcode !== 100) { if (response && response.bizcode !== 100) {
console.error("反馈结果", response); console.error("反馈结果", response);
} }
} }