diff --git a/src/api/deposit.ts b/src/api/deposit.ts new file mode 100644 index 0000000..23b47ee --- /dev/null +++ b/src/api/deposit.ts @@ -0,0 +1,34 @@ +import { useRequest } from "@/use/useHttp" + +/** + * 预存款信息获取 + * @returns + */ + export const depositInfoApi = () => { + return useRequest({ + url: `/v1/mall/rechargeApplication`, + method: "get", + }) +} + +/** + * 预存款收支明细 + * @returns + */ + export const depositListApi = () => { + return useRequest({ + url: `/v1/mall/rechargeApplication/list`, + method: "get", + }) +} + +/** + * 预存款收支明细详情 + * @returns + */ + export const depositDetailApi = () => { + return useRequest({ + url: `/v1/mall/rechargeApplication/order`, + method: "get", + }) +} diff --git a/src/common/constant.js b/src/common/constant.js index cde84ce..0a47de3 100644 --- a/src/common/constant.js +++ b/src/common/constant.js @@ -8,8 +8,8 @@ // export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发 // export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境 // export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境 -// export const BASE_URL = `http://192.168.1.4:40001/lymarket` // 王霞 -export const BASE_URL = `http://192.168.1.224:50001/lymarket` // 添 +export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞 +// export const BASE_URL = `http://192.168.1.224:50001/lymarket` // 添 // export const BASE_URL = `http://192.168.1.15:50001/lymarket` // 添 // CDN diff --git a/src/pages/addressAdd/index.config.ts b/src/pages/addressAdd/index.config.ts index 969ece3..8e50c58 100644 --- a/src/pages/addressAdd/index.config.ts +++ b/src/pages/addressAdd/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '' + navigationBarTitleText: '', + enableShareAppMessage: true, } diff --git a/src/pages/addressManager/index.config.ts b/src/pages/addressManager/index.config.ts index 6ee4e10..9d26929 100644 --- a/src/pages/addressManager/index.config.ts +++ b/src/pages/addressManager/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '地址管理' + navigationBarTitleText: '地址管理', + enableShareAppMessage: true, } diff --git a/src/pages/company/index.config.ts b/src/pages/company/index.config.ts index ef79748..e35cac0 100644 --- a/src/pages/company/index.config.ts +++ b/src/pages/company/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '公司资料' + navigationBarTitleText: '公司资料', + enableShareAppMessage: true, } diff --git a/src/pages/creditLine/index.config.ts b/src/pages/creditLine/index.config.ts index 432582a..7b71ba1 100644 --- a/src/pages/creditLine/index.config.ts +++ b/src/pages/creditLine/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '授信额度' + navigationBarTitleText: '授信额度', + enableShareAppMessage: true, } diff --git a/src/pages/creditLine/index.scss b/src/pages/creditLine/index.scss index fbbcf00..452833b 100644 --- a/src/pages/creditLine/index.scss +++ b/src/pages/creditLine/index.scss @@ -9,13 +9,13 @@ .credit-line-tips{ width: 100%; height: 66px; - background: #ecf5ff; - border: 2px solid #cde5ff; + background: #FFE6CE; + border: 2px solid #ffe6ce; padding: 0 30px; display: flex;align-items: center; font-size: 24px; font-weight: 400; - color: #007aff; + color: #EE7500; } .credit-line-tips text{ margin-right: 10px; @@ -33,6 +33,7 @@ display: flex;align-items: flex-end; padding: 30px 20px; border-bottom: 1px solid #f6f6f6; + position: relative; } .credit-line-card-top-info{ text-align: center; @@ -58,6 +59,18 @@ font-weight: 400; color: #ababab; } + .credit-line-card-top-status{ + padding: 0 20px; + height: 38px; + background: #ebfaea; + font-size: 22px; + font-weight: 400; + color: #07c160; + display: flex;align-items: center;justify-content: center; + border-top-right-radius: 20px; + border-bottom-left-radius: 20px; + position: absolute;right: 0;top: 30px; + } .credit-line-card-bottom{ padding: 30px 0; display: grid; diff --git a/src/pages/creditLine/index.tsx b/src/pages/creditLine/index.tsx index ea08485..87c154d 100644 --- a/src/pages/creditLine/index.tsx +++ b/src/pages/creditLine/index.tsx @@ -6,7 +6,7 @@ import { useEffect, useState } from "react" import {creditInfoApi} from "@/api/creditLine" import "./index.scss" import { useSelector } from "@/reducers/hooks"; -import { formatPriceDiv } from "@/common/fotmat" +import { formatDateTime, formatPriceDiv } from "@/common/fotmat" export default ()=>{ @@ -20,7 +20,20 @@ export default ()=>{ credit_quota_line: [0,"00"], credit_quota_available_line: [0,"00"], progress: 0, - create_time: "" + create_time: "", + quota_status_name: "", + quota_status: "", + credit_quota_start_time: "", + credit_quota_end_time: "" + }); + const [style, setStyle]= useState({ + type: {}, + cir: { + color: "", + background: {start: [], end: []} + }, + available: {}, + bottomTitle: {} }); // 获取数据 const getData = async ()=>{ @@ -28,20 +41,79 @@ export default ()=>{ const credit_quota_used_line = convertPrice(formatPriceDiv(result.data.credit_quota_used_line)); const credit_quota_line = convertPrice(formatPriceDiv(result.data.credit_quota_line)); const credit_quota_available_line = convertPrice(formatPriceDiv(result.data.credit_quota_available_line)); - const progress = credit_quota_line[0] / credit_quota_available_line[0] * 100; + const progress = (credit_quota_available_line[0] / credit_quota_line[0] * 100).toFixed(0); + + switch(Number(result.data.quota_status)){ + case 0://暂未开通 + setStyle({ + type: {background: "#e4e4ff",color: "#1818B4" }, + cir: { + color: "#707070", + background: {start: ["#727272", "#CDCDCD"] as any, end: ["#CDCDCD", "#EEEEEE"] as any} + }, + available: {color: "#707070", textDecoration: "line-through"}, + bottomTitle: {color: "#cccccc"} + }) + break; + case 1://申请中 + setStyle({ + type: {background: "#cde5ff",color: "#007AFF" }, + cir: { + color: "#707070", + background: {start: ["#727272", "#CDCDCD"] as any, end: ["#CDCDCD", "#EEEEEE"] as any} + }, + available: {color: "#707070", textDecoration: "line-through"}, + bottomTitle: {color: "#cccccc"} + }) + break; + case 2://生效中 + setStyle({ + type: {background: "#cde5ff",color: "#007AFF" }, + cir: { + color: "#007aff", + background: {start: ["#047CFF", "#51A4FF"] as any, end: ["#87C0FF", "#57A8FF"] as any} + }, + available: {color: "#007aff"}, + bottomTitle: {color: "#007AFF"} + }) + break; + case 3://已失效 + setStyle({ + type: {background: "#f6f6f6",color: "#ABABAB" }, + cir: { + color: "#707070", + background: {start: ["#727272", "#CDCDCD"] as any, end: ["#CDCDCD", "#EEEEEE"] as any} + }, + available: {color: "#707070", textDecoration: "line-through"}, + bottomTitle: {color: "#cccccc"} + }) + break; + case 4://失效待还款 + setStyle({ + type: {background: "#FFE6CE",color: "#EE7500" }, + cir: { + color: "#707070", + background: {start: ["#EF7907", "#FAC897"] as any, end: ["#FAC897", "#FFE6CE"] as any} + }, + available: {color: "#EE7500"}, + bottomTitle: {color: "#007AFF"} + }) + break; + } setData({ ...result.data, progress, credit_quota_used_line, credit_quota_line, - credit_quota_available_line + credit_quota_available_line, + credit_quota_start_time: formatDateTime(result.data?.credit_quota_start_time, "YYYY-MM-DD"), + credit_quota_end_time: formatDateTime(result.data?.credit_quota_end_time, "YYYY-MM-DD"), }) } const convertPrice = (data)=>{ var t = data.toString().split("."); - t[0] = t[0].toLocaleString(); - t[1] = t[1]?t[1].padStart(2,0):"00"; + t[1] = t[1]?t[1].padEnd(2,0):"00"; return t; } @@ -53,27 +125,28 @@ export default ()=>{ - + 可用额度 - ¥{data.credit_quota_available_line[0]}.{data.credit_quota_available_line[1]} - 有效期: {data.create_time} 2022-03-09至2022-05-13 + ¥{Number(data.credit_quota_available_line[0])?.toLocaleString()}.{data.credit_quota_available_line[1]} + 有效期: {data?.credit_quota_start_time} 至{data?.credit_quota_end_time} + {data.quota_status_name} - + 总额度 - ¥{data.credit_quota_line[0]}.{data.credit_quota_line[1]} + ¥{Number(data.credit_quota_line[0])?.toLocaleString()}.{data.credit_quota_line[1]} - + 已用额度 - ¥{data?.credit_quota_used_line[0]}.{data.credit_quota_used_line[1]} + ¥{Number(data?.credit_quota_used_line[0])?.toLocaleString()}.{data.credit_quota_used_line[1]} @@ -86,6 +159,7 @@ const Progress = (props)=>{ getCanvas(); },[props.progress]) const getCanvas = ()=>{ + // const percentage = props.progress??0; const percentage = props.progress??0; const query = Taro.createSelectorQuery(); query.select("#myCanvas").fields({ node: true, size: true }).exec((res) => { @@ -134,7 +208,7 @@ const Progress = (props)=>{ ctx.beginPath(); ctx.restore(); - ctx.fillStyle = "#007aff"; + ctx.fillStyle = props.style?.cir?.color// "#007aff"; ctx.font="42px Cambria, Cambria-Bold"; ctx.textAlign="center"; ctx.textBaseline="middle"; @@ -146,8 +220,8 @@ const Progress = (props)=>{ ctx.lineWidth = 25; ctx.lineCap = "round"; const gad = ctx.createLinearGradient(100,0,0,100); - gad.addColorStop(0, "#047CFF"); - gad.addColorStop(1, "#51A4FF"); + gad.addColorStop(0, props.style?.cir?.background?.start[0]); + gad.addColorStop(1, props.style?.cir?.background?.start[1]); ctx.strokeStyle = gad; ctx.arc(0,0,104,-Math.PI*0.5,2*Math.PI/100*((percentage<50?percentage:50)-25), false); ctx.stroke(); @@ -156,8 +230,8 @@ const Progress = (props)=>{ if(percentage>50){ ctx.beginPath(); const gad2 = ctx.createLinearGradient(0,-100,0,0); - gad2.addColorStop(0, "#87C0FF"); - gad2.addColorStop(1, "#57A8FF"); + gad2.addColorStop(0, props.style?.cir?.background?.end[0]); + gad2.addColorStop(1, props.style?.cir?.background?.start[1]); ctx.strokeStyle = gad2; ctx.arc(0,0,104,Math.PI*0.5,2*Math.PI/100*(percentage-25), false); ctx.stroke(); diff --git a/src/pages/creditUsed/index.config.ts b/src/pages/creditUsed/index.config.ts index b58982d..386d82b 100644 --- a/src/pages/creditUsed/index.config.ts +++ b/src/pages/creditUsed/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '已用额度' + navigationBarTitleText: '已用额度', + enableShareAppMessage: true, } diff --git a/src/pages/depositBeforehand/index.config.ts b/src/pages/depositBeforehand/index.config.ts index 8206758..67281be 100644 --- a/src/pages/depositBeforehand/index.config.ts +++ b/src/pages/depositBeforehand/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '预存款' + navigationBarTitleText: '预存款', + enableShareAppMessage: true, } diff --git a/src/pages/depositBeforehand/index.scss b/src/pages/depositBeforehand/index.scss index 8e73ead..d782d46 100644 --- a/src/pages/depositBeforehand/index.scss +++ b/src/pages/depositBeforehand/index.scss @@ -3,6 +3,23 @@ background-color: #f3f3f3; display: flex; flex-direction: column; + .deposit-beforehand-tips{ + width: 100%; + height: 66px; + background: #FFE6CE; + border: 2px solid #ffe6ce; + padding: 0 30px; + display: flex;align-items: center; + font-size: 24px; + font-weight: 400; + color: #EE7500; + margin: 0; + } + .deposit-beforehand-tips text{ + margin-right: 10px; + font-size: 30px; + } + .deposit-beforehand-card{ width: 702px; background: #ffffff; @@ -52,7 +69,7 @@ } .deposit-beforehand-info-list{ display: flex;align-items: center; - line-height: 60px; + margin-bottom: 38px; } .deposit-beforehand-info-list-left{ width: 160px; diff --git a/src/pages/depositBeforehand/index.tsx b/src/pages/depositBeforehand/index.tsx index 65925fa..c904f4c 100644 --- a/src/pages/depositBeforehand/index.tsx +++ b/src/pages/depositBeforehand/index.tsx @@ -2,15 +2,34 @@ import { Button, Canvas, Navigator, ScrollView, Text, View } from "@tarojs/components" import "./index.scss" +import { depositInfoApi } from "@/api/deposit" +import { useEffect } from "react"; +import { formatPriceDiv, toDecimal2 } from "@/common/fotmat"; +import { setClipboardData } from "@tarojs/taro"; export default ()=>{ + const {fetchData, state} = depositInfoApi(); + const getData = async ()=>{ + fetchData(); + } + useEffect(() => { + getData(); + }, []); + // 复制 + const handleCopy = ()=>{ + setClipboardData({data: state.data?.transfer_remittance_account}) + } + return ( + + 汇款成功后,1-5分钟自动到账。 + 余额 (元) - 999,999.20 + {toDecimal2(formatPriceDiv(state.data?.amount)).toLocaleString()} 转出 @@ -18,20 +37,20 @@ export default ()=>{ 预存款充值 - 复制 + 复制 开户名称 - 佛山市浩川盛世科技有限公司 + {state.data?.account_name} 开户银行 - 招商银行汾江支行 + {state.data?.bank_of_deposit} 专属汇款账号 - 62062342120001221231212 + {state.data?.transfer_remittance_account} diff --git a/src/pages/depositBeforehandDetail/index.config.ts b/src/pages/depositBeforehandDetail/index.config.ts index 1ae5fe4..602fd5e 100644 --- a/src/pages/depositBeforehandDetail/index.config.ts +++ b/src/pages/depositBeforehandDetail/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '交易详情' + navigationBarTitleText: '交易详情', + enableShareAppMessage: true, } diff --git a/src/pages/depositBeforehandDetail/index.scss b/src/pages/depositBeforehandDetail/index.scss index de766bc..662f147 100644 --- a/src/pages/depositBeforehandDetail/index.scss +++ b/src/pages/depositBeforehandDetail/index.scss @@ -1,12 +1,108 @@ .deposit-detail{ // height: 100vh; // background-color: #f3f3f3; + .deposit-detail-tips{ + width: 100%; + height: 66px; + background: #FFE6CE; + border: 2px solid #ffe6ce; + padding: 0 30px; + display: flex;align-items: center; + font-size: 24px; + font-weight: 400; + color: #EE7500; + margin: 0; + } + .deposit-detail-tips text{ + margin-right: 10px; + font-size: 30px; + } + &>view{ + padding: 30px 0; + margin: 0 25px; + border-bottom: 1px solid #F6F6F6; + } + &>view:last-child{ + border-bottom: 0; + } + .deposit-amount{ + text-align: center; + } + .deposit-type{ + font-size: 28px; + font-weight: 400; + color: #000000; + margin-bottom: 35px; + } + .deposit-price{ + font-size: 40px; + font-weight: 700; + color: #000000; + } + .deposit-status{ + display: flex; + } + .deposit-status-title{ + font-size: 24px; + font-weight: 400; + color: #707070; + margin-right: 105px; + } + .deposit-voucher-title{ + font-size: 24px; + font-weight: 400; + color: #707070; + margin-bottom: 28px; + } + .deposit-voucher-title::before{ + content: "*"; + color: #007AFF; + } + .deposit-voucher-content{ + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 30px; + height: 98px; + } + .deposit-voucher-content image{ + width: 100%; + height: 100%; + object-fit: cover; + } + .deposit-info-list{ + display: flex; + margin-bottom: 20px; + } + .deposit-info-list-title{ + width: 140px; + font-size: 24px; + font-weight: 400; + color: #707070; + border-right: 1px solid #F0F0F0; + } + .deposit-info-list-content{ + width: 468px; + font-size: 24px; + font-weight: 400; + color: #000000; + padding-left: 25px; + box-sizing: border-box; + } + .deposit-info-list-copy{ + font-size: 20px; + font-weight: 400; + color: #ababab; + padding-left: 18px; + border-left: 1px solid #F0F0F0; + } + .deposit-timeline{ } .deposit-timeline-item{ display: flex; margin-left: 50px; + height: 100px; } .deposit-timeline-item-title{ font-size: 24px; @@ -17,11 +113,11 @@ font-size: 24px; font-weight: 400; color: #ababab; - margin-bottom: 55px; } .deposit-timeline-item-left{ position: relative; margin-right: 55px; + width: 12px; } .deposit-timeline-item-left::before{ content: " "; @@ -38,4 +134,23 @@ position: absolute;top: 25px;bottom: -8px; left: 50%;transform: translateX(-50%); } + .deposit-timeline-item-success,.deposit-timeline-item-error{ + position: relative; + margin-right: 55px; + width: 12px; + } + .deposit-timeline-item-error Text,.deposit-timeline-item-success Text{ + display: inline-block; + width: 38px; + height: 38px; + background: #007aff; + border-radius: 50%; + position: absolute;left: 50%;transform: translateX(-50%); + color: white; + font-size: 30px; + display: flex;align-items: center;justify-content: center; + } + .deposit-timeline-item-error Text{ + background: #cccccc; + } } \ No newline at end of file diff --git a/src/pages/depositBeforehandDetail/index.tsx b/src/pages/depositBeforehandDetail/index.tsx index 6bdae63..7d5f73e 100644 --- a/src/pages/depositBeforehandDetail/index.tsx +++ b/src/pages/depositBeforehandDetail/index.tsx @@ -1,7 +1,7 @@ import AddressList from "@/components/AddressList" import InfiniteScroll from "@/components/infiniteScroll" -import { Button, Canvas, ScrollView, Text, View } from "@tarojs/components" +import { Button, Canvas, Image, ScrollView, Text, View } from "@tarojs/components" import Taro, { useReady } from "@tarojs/taro" import { useEffect, useState } from "react" import {creditListApi} from "@/api/creditLine" @@ -11,7 +11,48 @@ export default ()=>{ return ( - + + 转入失败原因:付款凭证与实际转入信息不符,请重新上传。 + + + 转入 (元) + 999,999.20 + + + 状态 + + + + 付款凭证 + + + + + + + + 银行流水号 + 2278204399678121212121288 + 复制 + + + 付款人 + 带生 + + + 付款账号 + 带生 + 复制 + + + 联系方式 + 带生 + + + 备注信息 + 带生 + + ) } @@ -28,6 +69,14 @@ const TimeLine = ()=>{ + + 申请提交 + + + + + + 申请提交 2022-04-24 16:10:11 diff --git a/src/pages/depositList/index.config.ts b/src/pages/depositList/index.config.ts index 63423c7..861e10c 100644 --- a/src/pages/depositList/index.config.ts +++ b/src/pages/depositList/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '收支明细' + navigationBarTitleText: '收支明细', + enableShareAppMessage: true, } diff --git a/src/pages/depositList/index.tsx b/src/pages/depositList/index.tsx index 22dc658..c741086 100644 --- a/src/pages/depositList/index.tsx +++ b/src/pages/depositList/index.tsx @@ -1,71 +1,45 @@ import AddressList from "@/components/AddressList" -import InfiniteScroll from "@/components/infiniteScroll" +import InfiniteScrollPaging from "@/components/InfiniteScrollPaging" import { Button, Canvas, ScrollView, Text, View } from "@tarojs/components" import Taro, { useReady } from "@tarojs/taro" -import { useEffect, useState } from "react" -import {creditListApi} from "@/api/creditLine" +import { useCallback, useEffect, useState } from "react" +import { depositListApi } from "@/api/deposit" import "./index.scss" +import { formatDateTime, formatPriceDiv } from "@/common/fotmat" export default ()=>{ - useEffect(()=>{ - getData(); + const {fetchData, state} = depositListApi(); + // 渲染(数据) + const [data, setData] = useState({ + list: [], + total: 0 + }); + // 数据更新 + const handleChange = useCallback((result)=>{ + setData({ + list: result.data.list, + total: result.data.total + }) }, []) - const {fetchData, state} = creditListApi(); - const data = Array.from({length: 10}); - const getData = async ()=>{ - fetchData(); - } - // 刷新 - const [refreshData, setRefreshData] = useState({ - refreshStatus: false, - moreStatus: false, - statusMore: 1 - }) - const handleRefresh = async ()=>{ - setRefreshData({ - ...refreshData, - refreshStatus: true - }) - - - setTimeout(()=>{ - setRefreshData({ - ...refreshData, - refreshStatus: false - }) - }, 3000) - } - const handleMoreLoad = async ()=>{ - setRefreshData({ - ...refreshData, - moreStatus: true - }) - - // setTimeout(()=>{ - // setRefreshData({ - // ...refreshData, - // moreStatus: false - // }) - // },3000) - } return ( - + { - data.map((item,index)=>{ + data.list?.map((item,index)=>{ return ( - 下单 - 2022-04-24 16:10:11 + {(item as any).type_name} + {formatDateTime((item as any).create_time)} - -999,999.00 + 0?'red':'green'}`}> + {(item as any).amount_received_this_time>0&&"+"}{formatPriceDiv((item as any).amount_received_this_time)} + 处理中 @@ -76,7 +50,7 @@ export default ()=>{ } {/* {data.length>0&&} */} - + ) } diff --git a/src/pages/user/index.config.ts b/src/pages/user/index.config.ts index c21435b..96b0f9a 100644 --- a/src/pages/user/index.config.ts +++ b/src/pages/user/index.config.ts @@ -1,4 +1,5 @@ export default { navigationBarTitleText: '我的', - navigationStyle: 'custom' + navigationStyle: 'custom', + enableShareAppMessage: true, } diff --git a/src/pages/userEdit/index.config.ts b/src/pages/userEdit/index.config.ts index 7b68fe2..3c669f3 100644 --- a/src/pages/userEdit/index.config.ts +++ b/src/pages/userEdit/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '编辑个人资料' + navigationBarTitleText: '编辑个人资料', + enableShareAppMessage: true, } diff --git a/src/pages/weightList/index.config.ts b/src/pages/weightList/index.config.ts index 961b919..935bd6e 100644 --- a/src/pages/weightList/index.config.ts +++ b/src/pages/weightList/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '码单管理' + navigationBarTitleText: '码单管理', + enableShareAppMessage: true, } diff --git a/src/pages/weightListAdd/index.config.ts b/src/pages/weightListAdd/index.config.ts index 969ece3..8e50c58 100644 --- a/src/pages/weightListAdd/index.config.ts +++ b/src/pages/weightListAdd/index.config.ts @@ -1,3 +1,4 @@ export default { - navigationBarTitleText: '' + navigationBarTitleText: '', + enableShareAppMessage: true, }