acdr-ui/dist/dev/mp-weixin/modules/mall/pay/recharge.js.map

1 line
8.5 KiB
Plaintext

{"version":3,"file":"recharge.js","sources":["../../../../../../src/modules/mall/pay/recharge.vue","../../../../../../uniPage:/bW9kdWxlc1xtYWxsXHBheVxyZWNoYXJnZS52dWU"],"sourcesContent":["<!-- 充值界面 -->\r\n<template>\r\n <s-layout title=\"充值\" class=\"withdraw-wrap\" navbar=\"inner\">\r\n <view\r\n class=\"wallet-num-box ss-flex ss-col-center ss-row-between\"\r\n :style=\"[\r\n {\r\n marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',\r\n paddingTop: Number(statusBarHeight + 108) + 'rpx',\r\n },\r\n ]\"\r\n >\r\n <view class=\"\">\r\n <view class=\"num-title\">当前余额(元)</view>\r\n <view class=\"wallet-num\">{{ fen2yuan(userWallet.balance) }}</view>\r\n </view>\r\n <button\r\n class=\"ss-reset-button log-btn\"\r\n @tap=\"sheep.$router.go('/modules/mall/pay/recharge-log')\"\r\n >\r\n 充值记录\r\n </button>\r\n </view>\r\n <view class=\"recharge-box\">\r\n <view class=\"recharge-card-box\">\r\n <view class=\"input-label ss-m-b-50\">充值金额</view>\r\n <view class=\"input-box ss-flex border-bottom ss-p-b-20\">\r\n <view class=\"unit\">¥</view>\r\n <uni-easyinput\r\n v-model=\"state.recharge_money\"\r\n type=\"digit\"\r\n placeholder=\"请输入充值金额\"\r\n :inputBorder=\"false\"\r\n />\r\n </view>\r\n <view class=\"face-value-box ss-flex ss-flex-wrap ss-m-y-40\">\r\n <button\r\n class=\"ss-reset-button face-value-btn\"\r\n v-for=\"item in state.packageList\"\r\n :key=\"item.money\"\r\n :class=\"[{ 'btn-active': state.recharge_money === fen2yuan(item.payPrice) }]\"\r\n @tap=\"onCard(item.payPrice)\"\r\n >\r\n <text class=\"face-value-title\">{{ fen2yuan(item.payPrice) }}</text>\r\n <view v-if=\"item.bonusPrice\" class=\"face-value-tag\">\r\n 送 {{ fen2yuan(item.bonusPrice) }} 元\r\n </view>\r\n </button>\r\n </view>\r\n <button\r\n class=\"ss-reset-button save-btn ui-BG-Main-Gradient ss-m-t-60 ui-Shadow-Main\"\r\n @tap=\"onConfirm\"\r\n >\r\n 确认充值\r\n </button>\r\n </view>\r\n </view>\r\n </s-layout>\r\n</template>\r\n\r\n<script setup>\r\nimport { computed, reactive } from 'vue'\r\nimport sheep from '@/sheep'\r\nimport { onLoad } from '@dcloudio/uni-app'\r\nimport { fen2yuan } from '@/sheep/hooks/useGoods'\r\nimport PayWalletApi from '@/sheep/api/pay/wallet'\r\nimport { WxaSubscribeTemplate } from '@/sheep/util/const'\r\n\r\nconst userWallet = computed(() => sheep.$store('user').userWallet)\r\nconst statusBarHeight = sheep.$platform.device.statusBarHeight * 2\r\nconst headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png')\r\n\r\nconst state = reactive({\r\n recharge_money: '', // 输入的充值金额\r\n packageList: [],\r\n})\r\n\r\n// 点击卡片,选择充值金额\r\nfunction onCard(e) {\r\n state.recharge_money = fen2yuan(e)\r\n}\r\n\r\n// 获得钱包充值套餐列表\r\nasync function getRechargeTabs() {\r\n const { code, data } = await PayWalletApi.getWalletRechargePackageList()\r\n if (code !== 0) {\r\n return\r\n }\r\n state.packageList = data\r\n}\r\n\r\n// 发起支付\r\nasync function onConfirm() {\r\n const { code, data } = await PayWalletApi.createWalletRecharge({\r\n packageId: state.packageList.find((item) => fen2yuan(item.payPrice) === state.recharge_money)\r\n ?.id,\r\n payPrice: state.recharge_money * 100,\r\n })\r\n if (code !== 0) {\r\n return\r\n }\r\n // #ifdef MP\r\n sheep.$platform\r\n .useProvider('wechat')\r\n .subscribeMessage(WxaSubscribeTemplate.PAY_WALLET_RECHARGER_SUCCESS)\r\n // #endif\r\n sheep.$router.go('/modules/mall/pay/index', {\r\n id: data.payOrderId,\r\n orderType: 'recharge',\r\n })\r\n}\r\n\r\nonLoad(() => {\r\n getRechargeTabs()\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n:deep() {\r\n .uni-input-input {\r\n font-family: OPPOSANS !important;\r\n }\r\n}\r\n\r\n.wallet-num-box {\r\n padding: 0 40rpx 80rpx;\r\n background: var(--ui-BG-Main) v-bind(headerBg) center/750rpx 100% no-repeat;\r\n border-radius: 0 0 5% 5%;\r\n\r\n .num-title {\r\n margin-bottom: 20rpx;\r\n font-size: 26rpx;\r\n font-weight: 500;\r\n color: $white;\r\n }\r\n\r\n .wallet-num {\r\n font-family: OPPOSANS;\r\n font-size: 60rpx;\r\n font-weight: 500;\r\n color: $white;\r\n }\r\n\r\n .log-btn {\r\n width: 170rpx;\r\n height: 60rpx;\r\n padding: 0;\r\n font-size: 26rpx;\r\n font-weight: 500;\r\n line-height: 60rpx;\r\n color: $white;\r\n border: 1rpx solid $white;\r\n border-radius: 30rpx;\r\n }\r\n}\r\n\r\n.recharge-box {\r\n position: relative;\r\n padding: 0 30rpx;\r\n margin-top: -60rpx;\r\n}\r\n\r\n.save-btn {\r\n width: 620rpx;\r\n height: 86rpx;\r\n font-size: 30rpx;\r\n border-radius: 44rpx;\r\n}\r\n\r\n.recharge-card-box {\r\n box-sizing: border-box;\r\n width: 690rpx;\r\n padding: 30rpx;\r\n background: var(--ui-BG);\r\n border-radius: 20rpx;\r\n\r\n .input-label {\r\n font-size: 30rpx;\r\n font-weight: 500;\r\n color: #333;\r\n }\r\n\r\n .unit {\r\n display: flex;\r\n align-items: center;\r\n font-size: 48rpx;\r\n font-weight: 500;\r\n }\r\n\r\n .uni-easyinput__placeholder-class {\r\n display: flex;\r\n align-items: center;\r\n height: 60rpx;\r\n font-size: 30rpx;\r\n }\r\n\r\n :deep(.uni-easyinput__content-input) {\r\n font-size: 48rpx;\r\n }\r\n\r\n .face-value-btn {\r\n position: relative;\r\n z-index: 1;\r\n width: 200rpx;\r\n height: 144rpx;\r\n margin-right: 15rpx;\r\n margin-bottom: 15rpx;\r\n border: 1px solid var(--ui-BG-Main);\r\n border-radius: 10rpx;\r\n\r\n &:nth-of-type(3n) {\r\n margin-right: 0;\r\n }\r\n\r\n .face-value-title {\r\n font-family: OPPOSANS;\r\n font-size: 36rpx;\r\n font-weight: 500;\r\n color: var(--ui-BG-Main);\r\n\r\n &::after {\r\n margin-left: 6rpx;\r\n font-size: 24rpx;\r\n content: '元';\r\n }\r\n }\r\n\r\n .face-value-tag {\r\n position: absolute;\r\n top: 0;\r\n left: -2rpx;\r\n z-index: 2;\r\n height: 40rpx;\r\n padding: 0 16rpx;\r\n font-family: OPPOSANS;\r\n font-size: 22rpx;\r\n line-height: 40rpx;\r\n color: $white;\r\n background: var(--ui-BG-Main);\r\n border-radius: 10rpx 0 20rpx 0;\r\n opacity: 0.8;\r\n }\r\n\r\n &::before {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n z-index: 0;\r\n width: 100%;\r\n height: 100%;\r\n content: ' ';\r\n background: var(--ui-BG-Main);\r\n opacity: 0.1;\r\n }\r\n }\r\n\r\n .btn-active {\r\n z-index: 1;\r\n\r\n &::before {\r\n content: '';\r\n background: var(--ui-BG-Main);\r\n opacity: 1;\r\n }\r\n\r\n .face-value-title {\r\n position: relative;\r\n z-index: 1;\r\n font-family: OPPOSANS;\r\n color: $white;\r\n }\r\n\r\n .face-value-tag {\r\n font-family: OPPOSANS;\r\n color: var(--ui-BG-Main);\r\n background: $white;\r\n }\r\n }\r\n}\r\n</style>\r\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/modules/mall/pay/recharge.vue'\nwx.createPage(MiniProgramPage)"],"names":["computed","sheep","reactive","fen2yuan","PayWalletApi","WxaSubscribeTemplate","onLoad"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,UAAA,aAAAA,cAAA,SAAA,MAAAC,YAAAA,MAAA,OAAA,MAAA,EAAA,UAAA;AACA,UAAA,kBAAAA,YAAAA,MAAA,UAAA,OAAA,kBAAA;AACA,UAAA,WAAAA,YAAA,MAAA,KAAA,IAAA,uCAAA;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