|
|
@@ -0,0 +1,245 @@
|
|
|
+<template>
|
|
|
+ <view class="container">
|
|
|
+ <view class="content">
|
|
|
+ <view class="moeny flex_r flex_ae"
|
|
|
+ >¥
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ :maxlength="12"
|
|
|
+ v-model="inputMoney"
|
|
|
+ placeholder="请输入转化金额"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ <view class="option flex_r flex_ac flex_jb">
|
|
|
+ <view class="balance flex_r flex_ac">
|
|
|
+ <!-- <span>账户余额:{{ available_money }}</span> -->
|
|
|
+ <span>可转化额度:{{ available_money }}</span>
|
|
|
+ </view>
|
|
|
+ <view class="option_text" @tap="getListPage">转化记录</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="btn flex_r flex_ac flex_jc" @tap="onSubForm">立即转化</view>
|
|
|
+ <view class="showlist" v-for="(item, index) in show" :key="index">{{
|
|
|
+ item
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { post } from "@/request/api.js";
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ show: [],
|
|
|
+ inputMoney: undefined,
|
|
|
+ imgs: "",
|
|
|
+ index: 0,
|
|
|
+ userinfo: undefined, // 获取用户信息
|
|
|
+ localInfo: undefined,
|
|
|
+
|
|
|
+ user_money: 0, //余额
|
|
|
+ available_money: 0, //数智生活可提金额
|
|
|
+ merchant_money: 0, //商家中心余额
|
|
|
+
|
|
|
+ islocal: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad(e) {
|
|
|
+ this.getLU();
|
|
|
+ this.getExolain();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getExolain() {
|
|
|
+ post("v1/merchant/convertDesc").then((res) => {
|
|
|
+ this.show = this.islocal ? res.data[0] : res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onSubForm() {
|
|
|
+ let that = this;
|
|
|
+ let url = "v1/merchant/convertMoney";
|
|
|
+ if (this.inputMoney == "") {
|
|
|
+ this.$toast("请输入金额");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.inputMoney <= 0) {
|
|
|
+ this.$toast("请输入正确的金额");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Number(this.inputMoney) > Number(this.available_money)) {
|
|
|
+ uni.showModal({
|
|
|
+ content: `当前可转化${that.available_money}`,
|
|
|
+ showCancel: false,
|
|
|
+ success(res) {},
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ uni.showModal({
|
|
|
+ content: "请确认“商户余额”转化为“个人余额”?",
|
|
|
+ confirmText: "确认转化",
|
|
|
+ cancelText: "取消",
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ });
|
|
|
+ let data = {
|
|
|
+ money: that.inputMoney,
|
|
|
+ };
|
|
|
+ post(url, data).then((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.code === 0) {
|
|
|
+ that.inputMoney = "";
|
|
|
+ uni.showModal({
|
|
|
+ content: res.msg,
|
|
|
+ confirmText: "知道了",
|
|
|
+ showCancel: false,
|
|
|
+ success(res) {
|
|
|
+ that.getListPage()
|
|
|
+ },
|
|
|
+ });
|
|
|
+ that.getLU();
|
|
|
+ } else {
|
|
|
+ that.$toast(res.msg || "");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ getListPage() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pagesB/my/shuZhiWallet",
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ async getLU() {
|
|
|
+ this.localInfo = await uni.Luserfun();
|
|
|
+ this.available_money = this.localInfo.merchant_money;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ isBank() {
|
|
|
+ if (this.islocal) return false;
|
|
|
+ else {
|
|
|
+ if (!this.inputMoney) return false;
|
|
|
+ else return this.inputMoney > 1000;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+// 页面配置
|
|
|
+.container {
|
|
|
+ border-top: 20rpx solid #f5f5f5;
|
|
|
+ padding: 43rpx 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+// 页面配置-end
|
|
|
+
|
|
|
+.title_select {
|
|
|
+ margin-left: 36rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.upload {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.balance {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #7c838d;
|
|
|
+ span {
|
|
|
+ margin-right: 22rpx;
|
|
|
+ &:last-child {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.option_text {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #18bb88;
|
|
|
+}
|
|
|
+
|
|
|
+.upload_con text {
|
|
|
+ color: #898989;
|
|
|
+ font-size: 40rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.hint {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #8f8f8f;
|
|
|
+ margin-top: 40rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.upload_img {
|
|
|
+ width: 200rpx;
|
|
|
+ height: 200rpx;
|
|
|
+ margin-top: 60rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.title {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #7c838d;
|
|
|
+ margin-bottom: 40rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.upload_text {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #898989;
|
|
|
+ margin-top: 20rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.showlist {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #7c838d;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.moeny input {
|
|
|
+ color: #121922;
|
|
|
+ font-size: 56rpx;
|
|
|
+ height: 56rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.upload_con {
|
|
|
+ width: 200rpx;
|
|
|
+ height: 200rpx;
|
|
|
+ border: 3rpx solid #898989;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ margin-top: 60rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.moeny {
|
|
|
+ font-size: 42rpx;
|
|
|
+ color: #121922;
|
|
|
+ line-height: 1;
|
|
|
+ height: 56rpx;
|
|
|
+ border-bottom: 3rpx solid #e4e4ee;
|
|
|
+ margin-bottom: 70rpx;
|
|
|
+ padding: 37rpx 0;
|
|
|
+}
|
|
|
+
|
|
|
+.content {
|
|
|
+ box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ padding: 40rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 20rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.btn {
|
|
|
+ width: 348rpx;
|
|
|
+ height: 80rpx;
|
|
|
+ background: #18bb88;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 40rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ box-shadow: 0px 8px 22px 2px rgba(24, 187, 136, 0.22);
|
|
|
+ margin: 64rpx auto;
|
|
|
+}
|
|
|
+</style>
|