diff --git a/config/dev.js b/config/dev.js index d3e1af0..2f809db 100644 --- a/config/dev.js +++ b/config/dev.js @@ -8,6 +8,7 @@ module.exports = { CURRENT_BASE_URL: '"https://test.zzfzyc.com/lymarket"', CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://test.zzfzyc.com"', CURRENT_PAY_H5_CODE_URL: '"https://test.zzfzyc.com/cashier"', + CURRENT_PAY_Bank_APPID: '"wx0fb358ee24237c71"', }, mini: { // optimizeMainPackage: { diff --git a/config/pre.js b/config/pre.js index 0ec1843..688d394 100644 --- a/config/pre.js +++ b/config/pre.js @@ -8,6 +8,7 @@ module.exports = { CURRENT_BASE_URL: '"https://pre.zzfzyc.com/lymarket"', CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://pre.zzfzyc.com"', CURRENT_PAY_H5_CODE_URL: '"https://pre.zzfzyc.com/cashier"', + CURRENT_PAY_Bank_APPID: '"wx65934ee32a88d726"', }, mini: { optimizeMainPackage: { diff --git a/config/prod.js b/config/prod.js index 774e412..979eb0f 100644 --- a/config/prod.js +++ b/config/prod.js @@ -8,6 +8,7 @@ module.exports = { CURRENT_BASE_URL: '"https://www.zzfzyc.com/lymarket"', CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://www.zzfzyc.com"', CURRENT_PAY_H5_CODE_URL: '"https://www.zzfzyc.com/cashier"', + CURRENT_PAY_Bank_APPID: '"wx65934ee32a88d726"', }, mini: { // optimizeMainPackage: { diff --git a/global.d.ts b/global.d.ts index 38be54d..045a344 100644 --- a/global.d.ts +++ b/global.d.ts @@ -23,3 +23,4 @@ declare const CURRENT_ENV: string declare const CURRENT_BASE_URL: string declare const CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: string declare const CURRENT_PAY_H5_CODE_URL: string +declare const CURRENT_PAY_Bank_APPID: string diff --git a/iconfont.json b/iconfont.json index 2ef9342..140de0f 100644 --- a/iconfont.json +++ b/iconfont.json @@ -1,5 +1,5 @@ { - "symbol_url": "https://at.alicdn.com/t/c/font_3786318_yrquaqja59.js", + "symbol_url": "//at.alicdn.com/t/c/font_3786318_rr5yneq8o0a.js", "save_dir": "./src/components/iconfont", "use_typescript": false, "platforms": "*", diff --git a/src/api/orderPay.ts b/src/api/orderPay.ts index d7bef93..e626163 100644 --- a/src/api/orderPay.ts +++ b/src/api/orderPay.ts @@ -39,3 +39,13 @@ export const SubmitPrepayOrderPayApi = () => { method: 'put', }) } + +/** + * 查询支付成功接口 + */ +export const SubmitTradeOrderPayApi = () => { + return useRequest({ + url: '/lymarket/v1/mall/trade', + method: 'put', + }) +} diff --git a/src/common/constant.ts b/src/common/constant.ts index 63b09c0..e8850b0 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -1,4 +1,4 @@ -export const BASE_URL = CURRENT_BASE_URL +// export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` diff --git a/src/components/iconfont/alipay/alipay.axml b/src/components/iconfont/alipay/alipay.axml new file mode 100644 index 0000000..0421013 --- /dev/null +++ b/src/components/iconfont/alipay/alipay.axml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/iconfont/alipay/alipay.js b/src/components/iconfont/alipay/alipay.js new file mode 100644 index 0000000..ab10e17 --- /dev/null +++ b/src/components/iconfont/alipay/alipay.js @@ -0,0 +1,77 @@ +Component({ + props: { + // weixin | riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 + name: null, + // string | string[] + color: '', + size: 18, + }, + data: { + colors: '', + quot: '"', + svgSize: 18, + isStr: true, + }, + didMount() { + const size = this.props.size; + const color = this.props.color; + + this.setData({ + colors: this.fixColor(color), + isStr: typeof color === 'string', + }); + + if (size !== this.data.svgSize) { + this.setData({ + svgSize: size / 750 * my.getSystemInfoSync().windowWidth, + }); + } + }, + disUpdate(prevProps) { + const size = this.props.size; + const color = this.props.color; + + if (color !== prevProps.color) { + this.setData({ + colors: this.fixColor(color), + isStr: typeof color === 'string', + }); + } + + if (size !== prevProps.size) { + this.setData({ + svgSize: size / 750 * my.getSystemInfoSync().windowWidth, + }); + } + }, + methods: { + fixColor: function() { + var color = this.props.color; + var hex2rgb = this.hex2rgb; + + if (typeof color === 'string') { + return color.indexOf('#') === 0 ? hex2rgb(color) : color; + } + + return color.map(function (item) { + return item.indexOf('#') === 0 ? hex2rgb(item) : item; + }); + }, + hex2rgb: function(hex) { + var rgb = []; + + hex = hex.substr(1); + + if (hex.length === 3) { + hex = hex.replace(/(.)/g, '$1$1'); + } + + hex.replace(/../g, function(color) { + rgb.push(parseInt(color, 0x10)); + return color; + }); + + return 'rgb(' + rgb.join(',') + ')'; + } + } +}); diff --git a/src/components/iconfont/h5/IconWeixin.js b/src/components/iconfont/h5/IconWeixin.js new file mode 100644 index 0000000..557e47a --- /dev/null +++ b/src/components/iconfont/h5/IconWeixin.js @@ -0,0 +1,31 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconWeixin = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconWeixin.defaultProps = { + size: 18, +}; + +export default IconWeixin; diff --git a/src/components/iconfont/h5/index.js b/src/components/iconfont/h5/index.js new file mode 100644 index 0000000..59a7231 --- /dev/null +++ b/src/components/iconfont/h5/index.js @@ -0,0 +1,165 @@ +/* eslint-disable */ + +import React from 'react'; +import IconWeixin from './IconWeixin'; +import IconRiqi from './IconRiqi'; +import IconShuru from './IconShuru'; +import IconA0Tianzhangqi from './IconA0Tianzhangqi'; +import IconHuodaofukuan from './IconHuodaofukuan'; +import IconHuozhuziti from './IconHuozhuziti'; +import IconSaomazhifu from './IconSaomazhifu'; +import IconXianxiahuikuan from './IconXianxiahuikuan'; +import IconYufukuan from './IconYufukuan'; +import IconXinzengshoucangjia from './IconXinzengshoucangjia'; +import IconQingchusousuo from './IconQingchusousuo'; +import IconXuanzechenggong from './IconXuanzechenggong'; +import IconGongnengtubiaoSaomiao from './IconGongnengtubiaoSaomiao'; +import IconBianjizidingyimadan from './IconBianjizidingyimadan'; +import IconZidingyimadanyulan from './IconZidingyimadanyulan'; +import IconYuanshimadanyulan from './IconYuanshimadanyulan'; +import IconXiala from './IconXiala'; +import IconShangla from './IconShangla'; +import IconQingchuxinxi from './IconQingchuxinxi'; +import IconSousuo from './IconSousuo'; +import IconGuanli from './IconGuanli'; +import IconBianji from './IconBianji'; +import IconShoucangjia from './IconShoucangjia'; +import IconShezhi from './IconShezhi'; +import IconTishi from './IconTishi'; +import IconErweima from './IconErweima'; +import IconDianjishoucang from './IconDianjishoucang'; +import IconGouwuche from './IconGouwuche'; +import IconShoucangchenggong from './IconShoucangchenggong'; +import IconFenxiangshangpin from './IconFenxiangshangpin'; +import IconKefu from './IconKefu'; +import IconXinzenganniu from './IconXinzenganniu'; +import IconJianshaoanniu from './IconJianshaoanniu'; +import IconDaifahuo2 from './IconDaifahuo2'; +import IconDaishouhuo2 from './IconDaishouhuo2'; +import IconTuikuanShouhou from './IconTuikuanShouhou'; +import IconDaipeibu2 from './IconDaipeibu2'; +import IconDaifukuan2 from './IconDaifukuan2'; +export { default as IconWeixin } from './IconWeixin'; +export { default as IconRiqi } from './IconRiqi'; +export { default as IconShuru } from './IconShuru'; +export { default as IconA0Tianzhangqi } from './IconA0Tianzhangqi'; +export { default as IconHuodaofukuan } from './IconHuodaofukuan'; +export { default as IconHuozhuziti } from './IconHuozhuziti'; +export { default as IconSaomazhifu } from './IconSaomazhifu'; +export { default as IconXianxiahuikuan } from './IconXianxiahuikuan'; +export { default as IconYufukuan } from './IconYufukuan'; +export { default as IconXinzengshoucangjia } from './IconXinzengshoucangjia'; +export { default as IconQingchusousuo } from './IconQingchusousuo'; +export { default as IconXuanzechenggong } from './IconXuanzechenggong'; +export { default as IconGongnengtubiaoSaomiao } from './IconGongnengtubiaoSaomiao'; +export { default as IconBianjizidingyimadan } from './IconBianjizidingyimadan'; +export { default as IconZidingyimadanyulan } from './IconZidingyimadanyulan'; +export { default as IconYuanshimadanyulan } from './IconYuanshimadanyulan'; +export { default as IconXiala } from './IconXiala'; +export { default as IconShangla } from './IconShangla'; +export { default as IconQingchuxinxi } from './IconQingchuxinxi'; +export { default as IconSousuo } from './IconSousuo'; +export { default as IconGuanli } from './IconGuanli'; +export { default as IconBianji } from './IconBianji'; +export { default as IconShoucangjia } from './IconShoucangjia'; +export { default as IconShezhi } from './IconShezhi'; +export { default as IconTishi } from './IconTishi'; +export { default as IconErweima } from './IconErweima'; +export { default as IconDianjishoucang } from './IconDianjishoucang'; +export { default as IconGouwuche } from './IconGouwuche'; +export { default as IconShoucangchenggong } from './IconShoucangchenggong'; +export { default as IconFenxiangshangpin } from './IconFenxiangshangpin'; +export { default as IconKefu } from './IconKefu'; +export { default as IconXinzenganniu } from './IconXinzenganniu'; +export { default as IconJianshaoanniu } from './IconJianshaoanniu'; +export { default as IconDaifahuo2 } from './IconDaifahuo2'; +export { default as IconDaishouhuo2 } from './IconDaishouhuo2'; +export { default as IconTuikuanShouhou } from './IconTuikuanShouhou'; +export { default as IconDaipeibu2 } from './IconDaipeibu2'; +export { default as IconDaifukuan2 } from './IconDaifukuan2'; + +const IconFont = ({ name, ...rest }) => { + switch (name) { + case 'weixin': + return ; + case 'riqi': + return ; + case 'shuru': + return ; + case 'a-0tianzhangqi': + return ; + case 'huodaofukuan': + return ; + case 'huozhuziti': + return ; + case 'saomazhifu': + return ; + case 'xianxiahuikuan': + return ; + case 'yufukuan': + return ; + case 'xinzengshoucangjia': + return ; + case 'qingchusousuo': + return ; + case 'xuanzechenggong': + return ; + case 'gongnengtubiao-saomiao': + return ; + case 'bianjizidingyimadan': + return ; + case 'zidingyimadanyulan': + return ; + case 'yuanshimadanyulan': + return ; + case 'xiala': + return ; + case 'shangla': + return ; + case 'qingchuxinxi': + return ; + case 'sousuo': + return ; + case 'guanli': + return ; + case 'bianji': + return ; + case 'shoucangjia': + return ; + case 'shezhi': + return ; + case 'tishi': + return ; + case 'erweima': + return ; + case 'dianjishoucang': + return ; + case 'gouwuche': + return ; + case 'shoucangchenggong': + return ; + case 'fenxiangshangpin': + return ; + case 'kefu': + return ; + case 'xinzenganniu': + return ; + case 'jianshaoanniu': + return ; + case 'daifahuo2': + return ; + case 'daishouhuo2': + return ; + case 'tuikuan-shouhou': + return ; + case 'daipeibu2': + return ; + case 'daifukuan2': + return ; + + } + + return null; +}; + +export default IconFont; diff --git a/src/components/iconfont/index.d.ts b/src/components/iconfont/index.d.ts new file mode 100644 index 0000000..deab643 --- /dev/null +++ b/src/components/iconfont/index.d.ts @@ -0,0 +1,13 @@ +/* eslint-disable */ +import React, { FunctionComponent } from 'react'; + +interface Props { + name: 'weixin' | 'riqi' | 'shuru' | 'a-0tianzhangqi' | 'huodaofukuan' | 'huozhuziti' | 'saomazhifu' | 'xianxiahuikuan' | 'yufukuan' | 'xinzengshoucangjia' | 'qingchusousuo' | 'xuanzechenggong' | 'gongnengtubiao-saomiao' | 'bianjizidingyimadan' | 'zidingyimadanyulan' | 'yuanshimadanyulan' | 'xiala' | 'shangla' | 'qingchuxinxi' | 'sousuo' | 'guanli' | 'bianji' | 'shoucangjia' | 'shezhi' | 'tishi' | 'erweima' | 'dianjishoucang' | 'gouwuche' | 'shoucangchenggong' | 'fenxiangshangpin' | 'kefu' | 'xinzenganniu' | 'jianshaoanniu' | 'daifahuo2' | 'daishouhuo2' | 'tuikuan-shouhou' | 'daipeibu2' | 'daifukuan2'; + size?: number; + color?: string | string[]; + style?: React.CSSProperties; +} + +declare const IconFont: FunctionComponent; + +export default IconFont; diff --git a/src/components/iconfont/qq/qq.js b/src/components/iconfont/qq/qq.js new file mode 100644 index 0000000..96c73a1 --- /dev/null +++ b/src/components/iconfont/qq/qq.js @@ -0,0 +1,31 @@ +Component({ + properties: { + // weixin | riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 + name: { + type: String, + }, + // string | string[] + color: { + type: null, + observer: function(color) { + this.setData({ + isStr: typeof color === 'string', + }); + } + }, + size: { + type: Number, + value: 18, + observer: function(size) { + this.setData({ + svgSize: size / 750 * qq.getSystemInfoSync().windowWidth, + }); + }, + }, + }, + data: { + svgSize: 18 / 750 * qq.getSystemInfoSync().windowWidth, + quot: '"', + isStr: true, + }, +}); diff --git a/src/components/iconfont/qq/qq.qml b/src/components/iconfont/qq/qq.qml new file mode 100644 index 0000000..f20c100 --- /dev/null +++ b/src/components/iconfont/qq/qq.qml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/iconfont/rn/IconWeixin.js b/src/components/iconfont/rn/IconWeixin.js new file mode 100644 index 0000000..e85db9c --- /dev/null +++ b/src/components/iconfont/rn/IconWeixin.js @@ -0,0 +1,28 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconWeixin = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconWeixin.defaultProps = { + size: 18, +}; + +IconWeixin = React.memo ? React.memo(IconWeixin) : IconWeixin; + +export default IconWeixin; diff --git a/src/components/iconfont/rn/index.js b/src/components/iconfont/rn/index.js new file mode 100644 index 0000000..9e9e1e5 --- /dev/null +++ b/src/components/iconfont/rn/index.js @@ -0,0 +1,167 @@ +/* eslint-disable */ + +import React from 'react'; + +import IconWeixin from './IconWeixin'; +import IconRiqi from './IconRiqi'; +import IconShuru from './IconShuru'; +import IconA0Tianzhangqi from './IconA0Tianzhangqi'; +import IconHuodaofukuan from './IconHuodaofukuan'; +import IconHuozhuziti from './IconHuozhuziti'; +import IconSaomazhifu from './IconSaomazhifu'; +import IconXianxiahuikuan from './IconXianxiahuikuan'; +import IconYufukuan from './IconYufukuan'; +import IconXinzengshoucangjia from './IconXinzengshoucangjia'; +import IconQingchusousuo from './IconQingchusousuo'; +import IconXuanzechenggong from './IconXuanzechenggong'; +import IconGongnengtubiaoSaomiao from './IconGongnengtubiaoSaomiao'; +import IconBianjizidingyimadan from './IconBianjizidingyimadan'; +import IconZidingyimadanyulan from './IconZidingyimadanyulan'; +import IconYuanshimadanyulan from './IconYuanshimadanyulan'; +import IconXiala from './IconXiala'; +import IconShangla from './IconShangla'; +import IconQingchuxinxi from './IconQingchuxinxi'; +import IconSousuo from './IconSousuo'; +import IconGuanli from './IconGuanli'; +import IconBianji from './IconBianji'; +import IconShoucangjia from './IconShoucangjia'; +import IconShezhi from './IconShezhi'; +import IconTishi from './IconTishi'; +import IconErweima from './IconErweima'; +import IconDianjishoucang from './IconDianjishoucang'; +import IconGouwuche from './IconGouwuche'; +import IconShoucangchenggong from './IconShoucangchenggong'; +import IconFenxiangshangpin from './IconFenxiangshangpin'; +import IconKefu from './IconKefu'; +import IconXinzenganniu from './IconXinzenganniu'; +import IconJianshaoanniu from './IconJianshaoanniu'; +import IconDaifahuo2 from './IconDaifahuo2'; +import IconDaishouhuo2 from './IconDaishouhuo2'; +import IconTuikuanShouhou from './IconTuikuanShouhou'; +import IconDaipeibu2 from './IconDaipeibu2'; +import IconDaifukuan2 from './IconDaifukuan2'; +export { default as IconWeixin } from './IconWeixin'; +export { default as IconRiqi } from './IconRiqi'; +export { default as IconShuru } from './IconShuru'; +export { default as IconA0Tianzhangqi } from './IconA0Tianzhangqi'; +export { default as IconHuodaofukuan } from './IconHuodaofukuan'; +export { default as IconHuozhuziti } from './IconHuozhuziti'; +export { default as IconSaomazhifu } from './IconSaomazhifu'; +export { default as IconXianxiahuikuan } from './IconXianxiahuikuan'; +export { default as IconYufukuan } from './IconYufukuan'; +export { default as IconXinzengshoucangjia } from './IconXinzengshoucangjia'; +export { default as IconQingchusousuo } from './IconQingchusousuo'; +export { default as IconXuanzechenggong } from './IconXuanzechenggong'; +export { default as IconGongnengtubiaoSaomiao } from './IconGongnengtubiaoSaomiao'; +export { default as IconBianjizidingyimadan } from './IconBianjizidingyimadan'; +export { default as IconZidingyimadanyulan } from './IconZidingyimadanyulan'; +export { default as IconYuanshimadanyulan } from './IconYuanshimadanyulan'; +export { default as IconXiala } from './IconXiala'; +export { default as IconShangla } from './IconShangla'; +export { default as IconQingchuxinxi } from './IconQingchuxinxi'; +export { default as IconSousuo } from './IconSousuo'; +export { default as IconGuanli } from './IconGuanli'; +export { default as IconBianji } from './IconBianji'; +export { default as IconShoucangjia } from './IconShoucangjia'; +export { default as IconShezhi } from './IconShezhi'; +export { default as IconTishi } from './IconTishi'; +export { default as IconErweima } from './IconErweima'; +export { default as IconDianjishoucang } from './IconDianjishoucang'; +export { default as IconGouwuche } from './IconGouwuche'; +export { default as IconShoucangchenggong } from './IconShoucangchenggong'; +export { default as IconFenxiangshangpin } from './IconFenxiangshangpin'; +export { default as IconKefu } from './IconKefu'; +export { default as IconXinzenganniu } from './IconXinzenganniu'; +export { default as IconJianshaoanniu } from './IconJianshaoanniu'; +export { default as IconDaifahuo2 } from './IconDaifahuo2'; +export { default as IconDaishouhuo2 } from './IconDaishouhuo2'; +export { default as IconTuikuanShouhou } from './IconTuikuanShouhou'; +export { default as IconDaipeibu2 } from './IconDaipeibu2'; +export { default as IconDaifukuan2 } from './IconDaifukuan2'; + +let IconFont = ({ name, ...rest }) => { + switch (name) { + case 'weixin': + return ; + case 'riqi': + return ; + case 'shuru': + return ; + case 'a-0tianzhangqi': + return ; + case 'huodaofukuan': + return ; + case 'huozhuziti': + return ; + case 'saomazhifu': + return ; + case 'xianxiahuikuan': + return ; + case 'yufukuan': + return ; + case 'xinzengshoucangjia': + return ; + case 'qingchusousuo': + return ; + case 'xuanzechenggong': + return ; + case 'gongnengtubiao-saomiao': + return ; + case 'bianjizidingyimadan': + return ; + case 'zidingyimadanyulan': + return ; + case 'yuanshimadanyulan': + return ; + case 'xiala': + return ; + case 'shangla': + return ; + case 'qingchuxinxi': + return ; + case 'sousuo': + return ; + case 'guanli': + return ; + case 'bianji': + return ; + case 'shoucangjia': + return ; + case 'shezhi': + return ; + case 'tishi': + return ; + case 'erweima': + return ; + case 'dianjishoucang': + return ; + case 'gouwuche': + return ; + case 'shoucangchenggong': + return ; + case 'fenxiangshangpin': + return ; + case 'kefu': + return ; + case 'xinzenganniu': + return ; + case 'jianshaoanniu': + return ; + case 'daifahuo2': + return ; + case 'daishouhuo2': + return ; + case 'tuikuan-shouhou': + return ; + case 'daipeibu2': + return ; + case 'daifukuan2': + return ; + } + + return null; +}; + +IconFont = React.memo ? React.memo(IconFont) : IconFont; + +export default IconFont; diff --git a/src/components/iconfont/swan/swan.js b/src/components/iconfont/swan/swan.js new file mode 100644 index 0000000..f88cca8 --- /dev/null +++ b/src/components/iconfont/swan/swan.js @@ -0,0 +1,64 @@ +Component({ + properties: { + // weixin | riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 + name: { + type: String, + }, + // string | string[] + color: { + type: null, + value: '', + observer: function(color) { + this.setData({ + colors: this.fixColor(color), + isStr: typeof color === 'string', + }); + } + }, + size: { + type: Number, + value: 18, + observer: function(size) { + this.setData({ + svgSize: size / 750 * swan.getSystemInfoSync().windowWidth, + }); + }, + }, + }, + data: { + colors: '', + svgSize: 18 / 750 * swan.getSystemInfoSync().windowWidth, + quot: '"', + isStr: true, + }, + methods: { + fixColor: function() { + var color = this.data.color; + var hex2rgb = this.hex2rgb; + + if (typeof color === 'string') { + return color.indexOf('#') === 0 ? hex2rgb(color) : color; + } + + return color.map(function (item) { + return item.indexOf('#') === 0 ? hex2rgb(item) : item; + }); + }, + hex2rgb: function(hex) { + var rgb = []; + + hex = hex.substr(1); + + if (hex.length === 3) { + hex = hex.replace(/(.)/g, '$1$1'); + } + + hex.replace(/../g, function(color) { + rgb.push(parseInt(color, 0x10)); + return color; + }); + + return 'rgb(' + rgb.join(',') + ')'; + } + } +}); diff --git a/src/components/iconfont/swan/swan.swan b/src/components/iconfont/swan/swan.swan new file mode 100644 index 0000000..00e8237 --- /dev/null +++ b/src/components/iconfont/swan/swan.swan @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/iconfont/tt/tt.js b/src/components/iconfont/tt/tt.js new file mode 100644 index 0000000..aca1b52 --- /dev/null +++ b/src/components/iconfont/tt/tt.js @@ -0,0 +1,64 @@ +Component({ + properties: { + // weixin | riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 + name: { + type: String, + }, + // string | string[] + color: { + type: null, + value: '', + observer: function(color) { + this.setData({ + colors: this.fixColor(), + isStr: typeof color === 'string', + }); + } + }, + size: { + type: Number, + value: 18, + observer: function(size) { + this.setData({ + svgSize: size / 750 * tt.getSystemInfoSync().windowWidth, + }); + }, + }, + }, + data: { + colors: '', + svgSize: 18 / 750 * tt.getSystemInfoSync().windowWidth, + quot: '"', + isStr: true, + }, + methods: { + fixColor: function() { + var color = this.data.color; + var hex2rgb = this.hex2rgb; + + if (typeof color === 'string') { + return color.indexOf('#') === 0 ? hex2rgb(color) : color; + } + + return color.map(function (item) { + return item.indexOf('#') === 0 ? hex2rgb(item) : item; + }); + }, + hex2rgb: function(hex) { + var rgb = []; + + hex = hex.substr(1); + + if (hex.length === 3) { + hex = hex.replace(/(.)/g, '$1$1'); + } + + hex.replace(/../g, function(color) { + rgb.push(parseInt(color, 0x10)); + return color; + }); + + return 'rgb(' + rgb.join(',') + ')'; + } + } +}); diff --git a/src/components/iconfont/tt/tt.ttml b/src/components/iconfont/tt/tt.ttml new file mode 100644 index 0000000..7d47cf0 --- /dev/null +++ b/src/components/iconfont/tt/tt.ttml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/iconfont/weapp/weapp.js b/src/components/iconfont/weapp/weapp.js new file mode 100644 index 0000000..1a55983 --- /dev/null +++ b/src/components/iconfont/weapp/weapp.js @@ -0,0 +1,63 @@ +Component({ + properties: { + // weixin | riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 + name: { + type: String, + }, + // string | string[] + color: { + type: null, + observer: function(color) { + this.setData({ + colors: this.fixColor(), + isStr: typeof color === 'string', + }); + } + }, + size: { + type: Number, + value: 18, + observer: function(size) { + this.setData({ + svgSize: size / 750 * wx.getSystemInfoSync().windowWidth, + }); + }, + }, + }, + data: { + colors: '', + svgSize: 18 / 750 * wx.getSystemInfoSync().windowWidth, + quot: '"', + isStr: true, + }, + methods: { + fixColor: function() { + var color = this.data.color; + var hex2rgb = this.hex2rgb; + + if (typeof color === 'string') { + return color.indexOf('#') === 0 ? hex2rgb(color) : color; + } + + return color.map(function (item) { + return item.indexOf('#') === 0 ? hex2rgb(item) : item; + }); + }, + hex2rgb: function(hex) { + var rgb = []; + + hex = hex.substr(1); + + if (hex.length === 3) { + hex = hex.replace(/(.)/g, '$1$1'); + } + + hex.replace(/../g, function(color) { + rgb.push(parseInt(color, 0x10)); + return color; + }); + + return 'rgb(' + rgb.join(',') + ')'; + } + } +}); diff --git a/src/components/iconfont/weapp/weapp.wxml b/src/components/iconfont/weapp/weapp.wxml new file mode 100644 index 0000000..1f97f3c --- /dev/null +++ b/src/components/iconfont/weapp/weapp.wxml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/pages/order/components/payment/index.module.scss b/src/pages/order/components/payment/index.module.scss index 1553dea..b631078 100644 --- a/src/pages/order/components/payment/index.module.scss +++ b/src/pages/order/components/payment/index.module.scss @@ -92,16 +92,16 @@ $top: 190px; } .payment_list_item_left { display: flex; - flex-direction: column; font-size: $font_size; + align-items: center; .payment_list_item_left_name { display: flex; - align-items: center; + flex-direction: column; } .miconfont { font-size: 30px; color: #007aff; - padding-right: 10px; + padding-right: 30px; } .advance_payment { color: #ffc300; @@ -112,7 +112,6 @@ $top: 190px; .payment_list_item_left_price { font-size: $font_size_min; color: $color_font_two; - padding-left: 35px; padding-top: 5px; } } diff --git a/src/pages/order/components/payment/index.tsx b/src/pages/order/components/payment/index.tsx index eb7044d..5a6a666 100644 --- a/src/pages/order/components/payment/index.tsx +++ b/src/pages/order/components/payment/index.tsx @@ -13,6 +13,8 @@ import { alert } from '@/common/common' import { ORDER_STATUS, PAYMENT_METHOD, SUBSCRIPTION_MESSAGE_SCENE } from '@/common/enum' import { UseSubscriptionMessage } from '@/use/useCommon' import { throttle } from '@/common/util' +import IconFont from '@/components/iconfont' +import usePayBank from '@/use/usePayBank' interface Param { show?: true | false @@ -177,6 +179,11 @@ const Payment = ({ show = false, onClose, orderInfo, onSubmitSuccess }: Param) = return { ...orderInfo, ...payInfo } }, [orderInfo, payInfo]) + // 直接微信支付事件 + const { pullBank, payStatus } = usePayBank() + const onBankPay = useCallback(() => { + pullBank({ merchId: payInfo.merch_id, custMerchId: payInfo.pay_no }) + }, [payInfo]) return ( @@ -205,11 +212,11 @@ const Payment = ({ show = false, onClose, orderInfo, onSubmitSuccess }: Param) = + - 预存款 + {advance_payment} - {advance_payment} advanceSelectData(null)} /> + + + + + 微信支付 + + + + {show_account_payment && ( + - {payInfo?.account_period}天账期 {account_peyment} @@ -237,8 +253,8 @@ const Payment = ({ show = false, onClose, orderInfo, onSubmitSuccess }: Param) = )} + - 线下汇款 @@ -246,9 +262,9 @@ const Payment = ({ show = false, onClose, orderInfo, onSubmitSuccess }: Param) = + - - 扫码支付 + 保存码单支付 diff --git a/src/use/usePayBank.ts b/src/use/usePayBank.ts new file mode 100644 index 0000000..ad0ca89 --- /dev/null +++ b/src/use/usePayBank.ts @@ -0,0 +1,43 @@ +import { Button, View } from '@tarojs/components' +import Taro, { useDidShow, useRouter } from '@tarojs/taro' +import { useEffect, useState } from 'react' + +interface Param { + merchId: string + custMerchId: string + needCashier?: '1'|'0' +} +export default () => { + const [payStatus, setPayStatus] = useState(false) + Taro.onAppShow((res) => { + if (res?.referrerInfo?.appId == 'wx65934ee32a88d726') { + const tf = res?.referrerInfo?.extraData?.payStatus == 'success' + setPayStatus(() => tf) + } + }) + const pullBank = ({ merchId = '', custMerchId = '', needCashier = '1' }: Param) => { + Taro.navigateToMiniProgram({ + appId: CURRENT_PAY_Bank_APPID, // 生产环境Id【UAT测试环境appId:wx0fb358ee24237c71】 + // appId: 'wx0fb358ee24237c71', // 生产环境Id【UAT测试环境appId:wx0fb358ee24237c71】 + path: 'pages/index/index', + extraData: { + merchId, // 传商户号(必填,此处传JE开头的商户号) + custMerchId, // 传缴费号(必填,对接下单接口的payNo) + needCashier, // 0-展示支付方式选择页,1-跳过支付方式选择页,直接用微信支付(当配置了多种支付方式时,传1也不会跳过支付方式选择页) + }, + success(res) { // 打开成功的回调函数 + console.log('打开成功::', res) + }, + fail(res) { + console.log('打开失败::', res) + }, + complete(res) { + console.log('打开结果::', res) + }, + }) + } + return { + pullBank, + payStatus, + } +}