1 line
10 KiB
Plaintext
1 line
10 KiB
Plaintext
|
{"version":3,"file":"index.js","sources":["../../../../../../src/modules/mall/pay/index.vue","../../../../../../uniPage:/bW9kdWxlc1xtYWxsXHBheVxpbmRleC52dWU"],"sourcesContent":["<!-- 收银台 -->\r\n<template>\r\n <s-layout title=\"收银台\">\r\n <view class=\"bg-white ss-modal-box ss-flex-col\">\r\n <!-- 订单信息 -->\r\n <view class=\"modal-header ss-flex-col ss-col-center ss-row-center\">\r\n <view class=\"money-box ss-m-b-20\">\r\n <text class=\"money-text\">{{ fen2yuan(state.orderInfo.price) }}</text>\r\n </view>\r\n <view class=\"time-text\">\r\n <text>{{ payDescText }}</text>\r\n </view>\r\n </view>\r\n\r\n <!-- 支付方式 -->\r\n <view class=\"modal-content ss-flex-1\">\r\n <view class=\"pay-title ss-p-l-30 ss-m-y-30\">选择支付方式</view>\r\n <radio-group @change=\"onTapPay\">\r\n <label class=\"pay-type-item\" v-for=\"item in state.payMethods\" :key=\"item.title\">\r\n <view\r\n class=\"pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom\"\r\n :class=\"{ 'disabled-pay-item': item.disabled }\"\r\n >\r\n <view class=\"ss-flex ss-col-center\">\r\n <image\r\n class=\"pay-icon\"\r\n v-if=\"item.disabled\"\r\n :src=\"sheep.$url.static('/static/img/shop/pay/cod_disabled.png')\"\r\n mode=\"aspectFit\"\r\n />\r\n <image\r\n class=\"pay-icon\"\r\n v-else\r\n :src=\"sheep.$url.static(item.icon)\"\r\n mode=\"aspectFit\"\r\n />\r\n <text class=\"pay-title\">{{ item.title }}</text>\r\n </view>\r\n <view class=\"check-box ss-flex ss-col-center ss-p-l-10\">\r\n <view class=\"userInfo-money ss-m-r-10\" v-if=\"item.value === 'wallet'\">\r\n 余额: {{ fen2yuan(userWallet.balance) }}元\r\n </view>\r\n <radio\r\n :value=\"item.value\"\r\n color=\"var(--ui-BG-Main)\"\r\n style=\"transform: scale(0.8)\"\r\n :disabled=\"item.disabled\"\r\n :checked=\"state.payment === item.value\"\r\n />\r\n </view>\r\n </view>\r\n </label>\r\n </radio-group>\r\n </view>\r\n\r\n <!-- 工具 -->\r\n <view class=\"modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40\">\r\n <button v-if=\"state.payStatus === 0\" class=\"ss-reset-button past-due-btn\">\r\n 检测支付环境中\r\n </button>\r\n <button v-else-if=\"state.payStatus === -1\" class=\"ss-reset-button past-due-btn\" disabled>\r\n 支付已过期\r\n </button>\r\n <button\r\n v-else\r\n class=\"ss-reset-button save-btn\"\r\n @tap=\"onPay\"\r\n :disabled=\"state.payStatus !== 1\"\r\n :class=\"{ 'disabled-btn': state.payStatus !== 1 }\"\r\n >\r\n 立即支付\r\n </button>\r\n </view>\r\n </view>\r\n </s-layout>\r\n</template>\r\n<script setup>\r\nimport { computed, reactive } from 'vue'\r\nimport { onLoad } from '@dcloudio/uni-app'\r\nimport sheep from '@/sheep'\r\nimport { fen2yuan, useDurationTime } from '@/sheep/hooks/useGoods'\r\nimport PayOrderApi from '@/sheep/api/pay/order'\r\nimport PayChannelApi from '@/sheep/api/pay/channel'\r\nimport { getPayMethods } from '@/sheep/platform/pay'\r\n\r\nconst userWallet = computed(() => sheep.$store('user').userWallet)\r\n\r\n// 检测支付环境\r\nconst state = reactive({\r\n orderType: 'goods', // 订单类型; goods - 商品订单, recharge - 充值订单\r\n orderInfo: {}, // 支付单信息\r\n payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付\r\n payMethods: [], // 可选的支付方式\
|