From d6e8780fb1b2fe5d14186901f0a45bbc7abbf3eb Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期一, 24 二月 2025 15:26:48 +0800
Subject: [PATCH] fix: 对接
---
packages/components/src/views/electricBillRecharge/electricBillRecharge.vue | 8 +++
apps/taro/config/staging.js | 9 ++++
apps/taro/config/prod.js | 7 +++
apps/taro/src/utils/request/index.ts | 6 ++-
apps/taro/package.json | 1
packages/components/src/styles/orderCard.scss | 5 ++
packages/core/src/lifeRecharge.ts | 12 ++++--
apps/taro/tsconfig.json | 1
packages/components/src/styles/index.scss | 2
packages/components/src/views/SelectPayTypeView/SelectPayTypeView.vue | 11 ++++-
apps/taro/src/subpackages/recharge/selectPayType/InnerPage.vue | 3 +
apps/taro/src/logo-v.png | 0
apps/taro/config/index.js | 3 +
13 files changed, 55 insertions(+), 13 deletions(-)
diff --git a/apps/taro/config/index.js b/apps/taro/config/index.js
index fc3248b..c2239e3 100644
--- a/apps/taro/config/index.js
+++ b/apps/taro/config/index.js
@@ -223,6 +223,9 @@
},
},
},
+ // htmlPluginOption: {
+ // favicon: './logo-v.png',
+ // },
webpackChain(chain, webpack) {
chain.plugin('unplugin-auto-import').use(
AutoImport({
diff --git a/apps/taro/config/prod.js b/apps/taro/config/prod.js
index a026528..3099e80 100644
--- a/apps/taro/config/prod.js
+++ b/apps/taro/config/prod.js
@@ -1,8 +1,10 @@
+const path = require('path');
+
module.exports = {
env: {
NODE_ENV: '"production"',
BASE_URL: '"https://api.81812333.com"',
- BASE_URL_H5: '"/"',
+ BASE_URL_H5: '"https://api.81812333.com"',
BASE_URL_JX: '"https://api.jx818.com"',
OSS_URL: '"https://parkmanagement.oss-cn-hangzhou.aliyuncs.com"',
@@ -12,6 +14,9 @@
defineConstants: {},
mini: {},
h5: {
+ output: {
+ path: path.resolve(__dirname, '..', `dist/h5-prod`),
+ },
/**
* WebpackChain 鎻掍欢閰嶇疆
* @docs https://github.com/neutrinojs/webpack-chain
diff --git a/apps/taro/config/staging.js b/apps/taro/config/staging.js
index f741bc0..788fbe2 100644
--- a/apps/taro/config/staging.js
+++ b/apps/taro/config/staging.js
@@ -1,8 +1,10 @@
+const path = require('path');
+
module.exports = {
env: {
// BASE_URL: '"https://testrlywx.boleyuma.com"',
BASE_URL: '"https://api.81812333.com"',
- BASE_URL_H5: '"/"',
+ BASE_URL_H5: '"http://118.178.252.28:8743"',
BASE_URL_JX: '"https://api.jx818.com"',
OSS_URL: '"https://waterdroptest2.oss-cn-hangzhou.aliyuncs.com/"',
@@ -11,4 +13,9 @@
WEMAP_KEY: 'T2UBZ-N563J-ZCHFF-XDOXN-VCH7S-CJB2T',
},
+ h5: {
+ output: {
+ path: path.resolve(__dirname, '..', `dist/h5-staging`),
+ },
+ },
};
diff --git a/apps/taro/package.json b/apps/taro/package.json
index 1350942..fbffeee 100644
--- a/apps/taro/package.json
+++ b/apps/taro/package.json
@@ -17,6 +17,7 @@
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
+ "build:h5:staging": "cross-env APP_ENV=staging npm run build:h5 --",
"build:rn": "taro build --type rn",
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
diff --git a/apps/taro/src/logo-v.png b/apps/taro/src/logo-v.png
new file mode 100644
index 0000000..a77a764
--- /dev/null
+++ b/apps/taro/src/logo-v.png
Binary files differ
diff --git a/apps/taro/src/subpackages/recharge/selectPayType/InnerPage.vue b/apps/taro/src/subpackages/recharge/selectPayType/InnerPage.vue
index 4b61e71..2d6676d 100644
--- a/apps/taro/src/subpackages/recharge/selectPayType/InnerPage.vue
+++ b/apps/taro/src/subpackages/recharge/selectPayType/InnerPage.vue
@@ -5,6 +5,8 @@
:orderNo="orderNo"
:lifePayOrderType="lifePayOrderType"
@paySuccess="handePaySuccess"
+ :showAliPay="!isInWeChat"
+ :showWeixinPay="!isInAlipay"
/>
</ContentScrollView>
</template>
@@ -13,6 +15,7 @@
import { SelectPayTypeView } from '@life-payment/components';
import { LifeRechargeConstants } from '@life-payment/core-vue';
import Taro from '@tarojs/taro';
+import { isInAlipay, isInWeChat } from '@/utils/env';
defineOptions({
name: 'selectPayType',
diff --git a/apps/taro/src/utils/request/index.ts b/apps/taro/src/utils/request/index.ts
index 356eca8..4d74dc6 100644
--- a/apps/taro/src/utils/request/index.ts
+++ b/apps/taro/src/utils/request/index.ts
@@ -3,7 +3,7 @@
import qs from 'qs';
import Taro from '@tarojs/taro';
import { getToken, Message } from '@/utils';
-import { isWeb } from '@/utils/env';
+import { isWeb, isWeChat } from '@/utils/env';
import { tokenIsExpired, SensitiveManage } from '@life-payment/utils';
import { useUserStoreWithOut } from '@/stores/modules/user';
@@ -24,7 +24,9 @@
}
export function endLoading() {
- Taro.hideNavigationBarLoading();
+ if (isWeChat) {
+ Taro.hideNavigationBarLoading();
+ }
Taro.hideLoading();
}
diff --git a/apps/taro/tsconfig.json b/apps/taro/tsconfig.json
index 5a1edaa..586ee37 100644
--- a/apps/taro/tsconfig.json
+++ b/apps/taro/tsconfig.json
@@ -18,6 +18,7 @@
},
"include": [
"./src/**/*",
+ "./src/utils/universal-api/index.js",
"./types/**/*.d.ts",
"./components.d.ts",
"./auto-imports.d.ts",
diff --git a/packages/components/src/styles/index.scss b/packages/components/src/styles/index.scss
index a83adac..e01359e 100644
--- a/packages/components/src/styles/index.scss
+++ b/packages/components/src/styles/index.scss
@@ -1,12 +1,12 @@
@use 'sass:map';
@use './var.scss' as *;
@use './function.scss' as *;
+@use './orderCard.scss' as *;
@use './nut.scss' as *;
@use './layout.scss' as *;
@use './rechargeGrid.scss' as *;
@use './components.scss' as *;
@use './loading.scss' as *;
-@use './orderCard.scss' as *;
:root,
page {
diff --git a/packages/components/src/styles/orderCard.scss b/packages/components/src/styles/orderCard.scss
index e841a8e..e1a853c 100644
--- a/packages/components/src/styles/orderCard.scss
+++ b/packages/components/src/styles/orderCard.scss
@@ -2,6 +2,11 @@
border: 1px solid #e8e8e8;
border-radius: 12px;
padding: 20px;
+ margin-bottom: 20px;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
.order-card-title {
display: flex;
diff --git a/packages/components/src/views/SelectPayTypeView/SelectPayTypeView.vue b/packages/components/src/views/SelectPayTypeView/SelectPayTypeView.vue
index 7c942bf..93705f7 100644
--- a/packages/components/src/views/SelectPayTypeView/SelectPayTypeView.vue
+++ b/packages/components/src/views/SelectPayTypeView/SelectPayTypeView.vue
@@ -1,10 +1,10 @@
<template>
<div class="select-pay-type-view">
- <div class="select-pay-type-view-item" @click="handleAliPay">
+ <div class="select-pay-type-view-item" v-if="showAliPay" @click="handleAliPay">
<img class="select-pay-type-view-item-icon" :src="IconAliPay" />
<div class="select-pay-type-view-item-text">鏀粯瀹濇敮浠�</div>
</div>
- <div class="select-pay-type-view-item" @click="handleWeixinPay">
+ <div class="select-pay-type-view-item" v-if="showWeixinPay" @click="handleWeixinPay">
<img class="select-pay-type-view-item-icon" :src="IconWeixin" />
<div class="select-pay-type-view-item-text">寰俊鏀粯</div>
</div>
@@ -28,9 +28,14 @@
type Props = {
orderNo?: string;
lifePayOrderType?: LifeRechargeConstants.LifePayOrderTypeEnum;
+ showAliPay?: boolean;
+ showWeixinPay?: boolean;
};
-const props = withDefaults(defineProps<Props>(), {});
+const props = withDefaults(defineProps<Props>(), {
+ showAliPay: true,
+ showWeixinPay: true,
+});
const emit = defineEmits<{
(
diff --git a/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue b/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
index d7f4033..4dbf304 100644
--- a/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
+++ b/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
@@ -51,7 +51,13 @@
type="text"
/>
</FormItem>
- <FormItem label="閫夋嫨鍏呭�奸噾棰�" class="bole-form-item" prop="parValue" required>
+ <FormItem
+ v-if="!!form.province"
+ label="閫夋嫨鍏呭�奸噾棰�"
+ class="bole-form-item"
+ prop="parValue"
+ required
+ >
<RadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group">
<Radio
:label="Number(item)"
diff --git a/packages/core/src/lifeRecharge.ts b/packages/core/src/lifeRecharge.ts
index ca0de2e..a041d82 100644
--- a/packages/core/src/lifeRecharge.ts
+++ b/packages/core/src/lifeRecharge.ts
@@ -23,10 +23,14 @@
}
async login(body: PhoneMesssageCodeLoginInput, options?: RequestConfig) {
- let res = await this.services.lifePayPhoneMesssageCodeLogin(body, options);
- this.accountModel.setUserId(res);
- this.accountModel.setPhoneNumber(body.phoneNumber);
- return res;
+ try {
+ let res = await this.services.lifePayPhoneMesssageCodeLogin(body, options);
+ this.accountModel.setUserId(res);
+ this.accountModel.setPhoneNumber(body.phoneNumber);
+ return res;
+ } catch (error) {
+ throw new Error(error);
+ }
}
loginout() {
--
Gitblit v1.9.1