| | |
| | | <RechargeGrid |
| | | @phoneBillRecharge="goPhoneBillRecharge" |
| | | @electricityBillRecharge="goElectricityBillRecharge" |
| | | @gasBillRecharge="goGasBillRecharge" |
| | | /> |
| | | </ContentView> |
| | | </PageLayoutWithBg> |
| | |
| | | url: `${RouterPath.electricBillRecharge}`, |
| | | }); |
| | | }); |
| | | const goGasBillRecharge = useAccessLogin(() => { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.electricBillRecharge}`, |
| | | }); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | |
| | | <template> |
| | | <ContentScrollView :paddingH="false"> |
| | | <ContentScrollView :paddingH="false" style="background-color: #fff"> |
| | | <electricBillRecharge @goPay="goPay" :isDev="isDev" /> |
| | | </ContentScrollView> |
| | | </template> |
| | |
| | | <template> |
| | | <ContentScrollView :paddingH="false"> |
| | | <ContentScrollView :paddingH="false" style="background-color: #fff"> |
| | | <PhoneBillRecharge @goPay="goPay" :isDev="isDev" /> |
| | | </ContentScrollView> |
| | | </template> |
| | |
| | | |
| | | |
| | | ## [0.0.7](http://120.26.58.240:8888/r/LifePaymentFront/compare/components/v0.0.6...components/v0.0.7) (2025-03-10) |
| | | |
| | | |
| | | ### Bug Fixes |
| | | |
| | | * 对接 ([337c9f5](http://120.26.58.240:8888/r/LifePaymentFront/commits/337c9f5fe3956021fb32db5054dfb395c7801beb)) |
| | | * 对接 ([818d0f4](http://120.26.58.240:8888/r/LifePaymentFront/commits/818d0f406772f00c43c8d6d68e9b52e9b729f35a)) |
| | | * 二期需求 ([0787f6b](http://120.26.58.240:8888/r/LifePaymentFront/commits/0787f6b63b9332dde3e8007f4cec83fc66903028)) |
| | | |
| | | ## [0.0.6](http://120.26.58.240:8888/r/LifePaymentFront/compare/components/v0.0.5...components/v0.0.6) (2025-03-07) |
| | | |
| | | |
| | |
| | | "name": "@life-payment/components", |
| | | "main": "src/index.ts", |
| | | "module": "./src/index.ts", |
| | | "version": "0.0.6", |
| | | "source": "./src/index.ts", |
| | | "version": "0.0.7", |
| | | "scripts": { |
| | | "clean": "rimraf dist", |
| | | "build": "pnpm run clean && vite build", |
| | |
| | | ], |
| | | "exports": { |
| | | ".": { |
| | | "source": "./src/index.ts", |
| | | "import": "./src/index.ts", |
| | | "require": "./src/index.ts" |
| | | }, |
| | |
| | | } |
| | | |
| | | .common-content { |
| | | padding: 0 boleGetCssVar('size', 'body-padding-h2'); |
| | | padding: 0 boleGetCssVar('size', 'body-padding-h'); |
| | | } |
| | | |
| | | .parValue-radio-group { |
| | |
| | | <template> |
| | | <MainCell title="生活缴费"> |
| | | <Grid square :gutter="20" :column-num="2" class="recharge-grid-wrapper"> |
| | | <Grid square :gutter="20" :column-num="3" class="recharge-grid-wrapper"> |
| | | <GridItem class="recharge-grid-item" text="话费" @click="emit('phoneBillRecharge')"> |
| | | <img :src="IconFreePhone" class="recharge-grid-item-icon" /> |
| | | </GridItem> |
| | | <GridItem class="recharge-grid-item" text="电费" @click="emit('electricityBillRecharge')"> |
| | | <img :src="IconFreeDian" class="recharge-grid-item-icon" /> |
| | | </GridItem> |
| | | <GridItem class="recharge-grid-item" text="燃气" @click="emit('gasBillRecharge')"> |
| | | <img :src="IconFreeGas" class="recharge-grid-item-icon" /> |
| | | </GridItem> |
| | | </Grid> |
| | | </MainCell> |
| | |
| | | import { Grid, GridItem } from '@nutui/nutui-taro'; |
| | | import IconFreePhone from '../../assets/icon-free-phone.png'; |
| | | import IconFreeDian from '../../assets/icon-free-dian.png'; |
| | | import IconFreeGas from '../../assets/icon-free-gas.png'; |
| | | |
| | | defineOptions({ |
| | | name: 'RechargeGrid', |
| | |
| | | const emit = defineEmits<{ |
| | | (e: 'phoneBillRecharge'): void; |
| | | (e: 'electricityBillRecharge'): void; |
| | | (e: 'gasBillRecharge'): void; |
| | | }>(); |
| | | </script> |
| | |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { Toast as NutToast } from '@nutui/nutui-taro'; |
| | | import { onMounted, reactive, ref, computed } from 'vue'; |
| | | import Taro from '@tarojs/taro'; |
| | | |
| | | defineOptions({ |
| | | name: 'SelectPayTypeView', |
| | |
| | | attach: Date.now().toString(), |
| | | }; |
| | | let res = await blLifeRecharge.services.getPayOrderForJsAPI(params); |
| | | //@ts-ignore |
| | | if (res && WeixinJSBridge) { |
| | | |
| | | if (res) { |
| | | //@ts-ignore |
| | | WeixinJSBridge.invoke( |
| | | 'getBrandWCPayRequest', |
| | | { |
| | | appId: props.appId, //公众号ID,由商户传入 |
| | | timeStamp: res.timestamp, //时间戳,自1970年以来的秒数 |
| | | nonceStr: res.nonceStr, //随机串 |
| | | package: res.package, |
| | | signType: res.signType, //微信签名方式: |
| | | paySign: res.paySign, //微信签名 |
| | | }, |
| | | function (res) { |
| | | if (res.err_msg == 'get_brand_wcpay_request:ok') { |
| | | // 使用以上方式判断前端返回,微信团队郑重提示: |
| | | //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠,商户需进一步调用后端查单确认支付结果。 |
| | | } else if (res.err_msg == 'system:access_denied') { |
| | | state.msg = '请在手机微信中打开'; |
| | | state.show = true; |
| | | } else { |
| | | // state.msg = res.err_msg; |
| | | // state.show = true; |
| | | if (WeixinJSBridge) { |
| | | //@ts-ignore |
| | | WeixinJSBridge.invoke( |
| | | 'getBrandWCPayRequest', |
| | | { |
| | | appId: props.appId, //公众号ID,由商户传入 |
| | | timeStamp: res.timestamp, //时间戳,自1970年以来的秒数 |
| | | nonceStr: res.nonceStr, //随机串 |
| | | package: res.package, |
| | | signType: res.signType, //微信签名方式: |
| | | paySign: res.paySign, //微信签名 |
| | | }, |
| | | function (res) { |
| | | if (res.err_msg == 'get_brand_wcpay_request:ok') { |
| | | // 使用以上方式判断前端返回,微信团队郑重提示: |
| | | //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠,商户需进一步调用后端查单确认支付结果。 |
| | | } else if (res.err_msg == 'system:access_denied') { |
| | | state.msg = '请在手机微信中打开'; |
| | | state.show = true; |
| | | } else { |
| | | // state.msg = res.err_msg; |
| | | // state.show = true; |
| | | } |
| | | } |
| | | } |
| | | ); |
| | | ); |
| | | } else if (Taro.getEnv() === Taro.ENV_TYPE.WEAPP) { |
| | | Taro.requestPayment({ |
| | | timeStamp: res.timestamp, |
| | | nonceStr: res.nonceStr, |
| | | package: res.package, |
| | | signType: res.signType as any, |
| | | paySign: res.paySign, |
| | | success: function (res) { |
| | | console.log('res: ', res); |
| | | // if(res.errMsg) |
| | | }, |
| | | fail: function (res) {}, |
| | | }); |
| | | } |
| | | } |
| | | } catch (error) {} |
| | | } |
| | |
| | | "rootDir": "src", |
| | | "ignoreDeprecations": "5.0", |
| | | "paths": { |
| | | "@life-payment/*": ["../../packages/*"] |
| | | "@life-payment/*": ["../*"] |
| | | }, |
| | | "composite": true, |
| | | "types": [ |
| | |
| | | ], |
| | | }), |
| | | |
| | | dts({ |
| | | tsconfigPath: './tsconfig.json', |
| | | }), |
| | | dts(), |
| | | ], |
| | | }); |
| | |
| | | "main": "src/index.ts", |
| | | "module": "./src/index.ts", |
| | | "types": "./dist/types/index.d.ts", |
| | | "source": "./src/index.ts", |
| | | "version": "0.0.3", |
| | | "scripts": { |
| | | "dev": "modern dev", |
| | |
| | | "main": "src/index.ts", |
| | | "module": "./src/index.ts", |
| | | "types": "./dist/types/index.d.ts", |
| | | "source": "./src/index.ts", |
| | | "version": "0.0.2", |
| | | "scripts": { |
| | | "dev": "modern dev", |