Merge branch 'dev' of ssh://git.online.zzfzyc.com:10022/mp/EShop into 电子商城测试版v2

This commit is contained in:
czm 2022-06-28 10:02:49 +08:00
commit 9897f085ca
23 changed files with 1781 additions and 1651 deletions

1978
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -37,6 +37,7 @@
"dependencies": { "dependencies": {
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"@tarojs/components": "3.3.10", "@tarojs/components": "3.3.10",
"@tarojs/plugin-framework-react": "^3.4.12",
"@tarojs/react": "3.3.10", "@tarojs/react": "3.3.10",
"@tarojs/runtime": "3.3.10", "@tarojs/runtime": "3.3.10",
"@tarojs/taro": "3.3.10", "@tarojs/taro": "3.3.10",

View File

@ -1,13 +1,47 @@
{ {
"miniprogramRoot": "./dist", "miniprogramRoot": "dist/",
"projectname": "EShop", "projectname": "EShop",
"description": "电子商城", "description": "项目配置文件详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"appid": "wx68d92d7cbf0b6963", "appid": "wx68d92d7cbf0b6963",
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": false, "es6": false,
"postcss": false, "postcss": false,
"minified": false "minified": false,
"coverView": true,
"lazyloadPlaceholderEnable": false,
"preloadBackgroundData": false,
"autoAudits": false,
"uglifyFileName": false,
"uploadWithSourceMap": true,
"enhance": true,
"useMultiFrameRuntime": true,
"showShadowRootInWxmlPanel": true,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"useStaticServer": true,
"showES6CompileOption": false,
"checkInvalidKey": true,
"compileHotReLoad": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"disableUseStrict": false,
"useCompilerPlugins": false
}, },
"compileType": "miniprogram" "compileType": "miniprogram",
"libVersion": "2.24.5",
"srcMiniprogramRoot": "dist/",
"packOptions": {
"ignore": [],
"include": []
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
} }

34
src/api/certification.ts Normal file
View File

@ -0,0 +1,34 @@
import { useRequest } from "@/use/useHttp"
/**
*
* @returns
*/
export const certificationDetailApi = () => {
return useRequest({
url: `/v1/mall/company/authentication`,
method: "get",
})
}
/**
*
* @returns
*/
export const certificationSaveApi = () => {
return useRequest({
url: `/v1/mall/company/authentication`,
method: "put",
})
}
/**
*
* @returns
*/
export const certificationTypeListApi = () => {
return useRequest({
url: `/v1/mall/enum/companyAuthenticationType`,
method: "get",
})
}

12
src/api/mine.ts Normal file
View File

@ -0,0 +1,12 @@
import { useRequest } from "@/use/useHttp"
/**
*
* @returns
*/
export const userassets = () => {
return useRequest({
url: `/v1/mall/user/assets`,
method: "get",
})
}

View File

@ -6,7 +6,7 @@
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞 // export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境 // export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
// export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发 // export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发 // export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境 // export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境 // export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞 // export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞

View File

@ -9,9 +9,9 @@
font-size: 28px; font-size: 28px;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
margin-top: 20px; width: 200px;
width: 150px;
border-right: 1px solid #F0F0F0; border-right: 1px solid #F0F0F0;
display: flex;align-items: center;
} }
.From-list-certification-label-required::before{ .From-list-certification-label-required::before{
content: "*"; content: "*";
@ -19,12 +19,12 @@
font-size: 28px; font-size: 28px;
} }
.From-list-certification-right{ .From-list-certification-right{
width: 506px; min-width: 100px;
flex: 1;
font-size: 26px; font-size: 26px;
font-weight: 400; font-weight: 400;
} }
.From-list-certification-right-meet{ .From-list-certification-right-meet{
width: 506px;
min-height: 45px; min-height: 45px;
border-radius: 20px; border-radius: 20px;
box-sizing: border-box; box-sizing: border-box;
@ -69,6 +69,8 @@
} }
.From-list-certification-right-placeholder{ .From-list-certification-right-placeholder{
color: #ababab; color: #ababab;
text-overflow: ellipsis;overflow: hidden;white-space: nowrap;
width: 100%;
} }
.From-list-certification-right-enter .icon-a-moreback{ .From-list-certification-right-enter .icon-a-moreback{
font-size: 28px; font-size: 28px;

View File

@ -14,12 +14,13 @@ interface ListParams{
style?: object, //整行样式 style?: object, //整行样式
labelStyle?: object, // label样式 labelStyle?: object, // label样式
contentStyle?: object, contentStyle?: object,
required?: boolean required?: boolean,
showIcon?: boolean, // 是否显示右边的箭头type=select
} }
// 表单列表 // 表单列表
const FromList = memo((props:ListParams)=>{ const FromList = memo((props:ListParams)=>{
const {type="input",value="",style={},labelStyle={},contentStyle={},required=false} = props; const {type="input",value="",style={},labelStyle={},contentStyle={},required=false,showIcon=true} = props;
return ( return (
<View style={style} className="From-list-certification"> <View style={style} className="From-list-certification">
@ -44,7 +45,9 @@ const FromList = memo((props:ListParams)=>{
{props.placeholder} {props.placeholder}
</View> </View>
} }
<View className="From-list-certification-right-enter"><Text className="iconfont icon-a-moreback"></Text></View> <View className="From-list-certification-right-enter">
{showIcon&&<Text className="iconfont icon-a-moreback"></Text>}
</View>
</> </>
} }
</View> </View>

View File

@ -55,9 +55,9 @@ export default ()=>{
const rules = { const rules = {
name: [{ name: [{
message: "请输入正确收货人姓名", message: "请输入正确收货人姓名",
validator: (value:any, rule:any)=>{ // 自定义验证返回true表示匹配到了(错误) // validator: (value:any, rule:any)=>{ // 自定义验证返回true表示匹配到了(错误)
return value.length>5; // return value.length>5;
} // }
}], }],
phone: [{ phone: [{
message: "请输入正确的电话号码", regex: /^1[3|5|6|9|2|8|7]\d{9}$/ message: "请输入正确的电话号码", regex: /^1[3|5|6|9|2|8|7]\d{9}$/

View File

@ -0,0 +1,22 @@
.select-enterprise-type{
.select-enterprise-type-btn{
color: #ABABAB;
font-size: 28px;
padding: 20px;
display: flex;justify-content: space-between;
border-bottom: 1rpx solid #eaeaea;
}
.select-enterprise-type-content{
padding: 0 20px;
padding-bottom: 120px;
}
.select-enterprise-type-content view{
padding: 20px 0;
font-size: 28px;
display: flex;justify-content: space-between;
}
.select-enterprise-type-content view text:last-child{
color: #007AFF;
font-size: 35px;
}
}

View File

@ -0,0 +1,56 @@
import { Text, View } from "@tarojs/components"
import Popup from "@/components/popup";
import "./SelectEnterpriseType.scss"
import { forwardRef, useEffect, useImperativeHandle, useState } from "react";
import {certificationTypeListApi} from "@/api/certification"
interface Params{
confirm?: (selected:any)=>void, // 确定
}
export default forwardRef((props: Params, ref)=>{
const [modalShow, setModalShow] = useState(false)
// 获取认证信息
const {fetchData, state} = certificationTypeListApi();
useEffect(()=>{
fetchData();
}, [])
const [selected, setSelected] = useState({});
// 确定
const handleSelect = (item)=>{
setSelected(item);
}
// 设置弹窗是否显示
const setShow = (ev)=>{
setModalShow(ev);
}
useImperativeHandle(ref,()=>({
setShow
}))
// 确定
const handleConfirm = ()=>{
props.confirm&&props.confirm(selected);
setModalShow(false);
}
return (
<View className="select-enterprise-type">
<Popup showTitle={false} show={modalShow} onClose={() => setModalShow(false)}>
<View className="select-enterprise-type-btn">
<View onClick={() => setModalShow(false)}></View>
<View onClick={handleConfirm}></View>
</View>
<View className="select-enterprise-type-content">
{
state.data?.list?.map((item,index)=>{
return <View onClick={()=>handleSelect(item)} key={index}>
<Text>{item.name}</Text>
{item.id==(selected as any).id?<Text className="iconfont icon-tick"/>:<Text/>}
</View>
})
}
</View>
</Popup>
</View>
)
})

View File

@ -16,6 +16,7 @@
margin-left: 30px; margin-left: 30px;
padding-top: 40px; padding-top: 40px;
color: #000000; color: #000000;
padding-bottom: 20px;
// border-top: 18px solid #F0F0F0; // border-top: 18px solid #F0F0F0;
} }
.certification-upload{ .certification-upload{
@ -38,6 +39,10 @@
.certification-upload-no{ .certification-upload-no{
display: flex;flex-direction: column;align-items: center; display: flex;flex-direction: column;align-items: center;
} }
.certification-upload image{
position: absolute;width: 100%;height: 100%;
object-fit: cover;border-radius: 30px;
}
.certification-upload-no-icon{ .certification-upload-no-icon{
width: 104px; width: 104px;
height: 104px; height: 104px;
@ -56,10 +61,11 @@
} }
.certification-button{ .certification-button{
position: absolute;bottom: -10px;left: -10px;right: -10px; position: absolute;bottom: -10px;left: -10px;right: -10px;
background-color: #858A8F; background-color: rgba(0,0,0,0.65);
display: flex; display: flex;
height: 86px; height: 86px;
border-radius: 0 0 30px 30px; border-radius: 0 0 30px 30px;
z-index: 1;
} }
.certification-button view{ .certification-button view{
flex: 1; flex: 1;
@ -79,6 +85,7 @@
position: fixed;bottom: 0;left: 0;right: 0; position: fixed;bottom: 0;left: 0;right: 0;
width: 100%; width: 100%;
display: flex;align-items: center;justify-content: center; display: flex;align-items: center;justify-content: center;
z-index: 2;
} }
.certification-footer-button{ .certification-footer-button{
width: 696px; width: 696px;
@ -90,12 +97,16 @@
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
} }
.certification-footer-button view{ .certification-footer-button view,.certification-footer-button navigator{
flex: 1; flex: 1;
display: flex;align-items: center;justify-content: center; display: flex;align-items: center;justify-content: center;
font-size: 32px; font-size: 32px;
font-weight: 400; font-weight: 400;
color: #007aff; color: #007aff;
border: 0;border-radius: none;
}
.certification-footer-button navigator::after{
border: 0;border-radius: none;
} }
.certification-footer-button view:last-child{ .certification-footer-button view:last-child{
color: white; color: white;

View File

@ -1,133 +1,196 @@
import FromListCertification from "@/components/FromListCertification" import FromListCertification from "@/components/FromListCertification"
import { Button, Input, Text, Textarea, View } from "@tarojs/components" import { Button, Image, Input, NavigationBar, Navigator, Text, Textarea, View } from "@tarojs/components"
import Taro, { setNavigationBarTitle, useRouter } from "@tarojs/taro" import Taro, { setNavigationBarTitle, useRouter } from "@tarojs/taro"
import {weightAddApi, weightDetailApi,weightEditApi} from "@/api/weightList" import { certificationSaveApi, certificationDetailApi } from "@/api/certification"
import { useEffect, useState } from "react" import { useEffect, useRef, useState } from "react"
import { alert, retrieval } from "@/common/common" import { alert, retrieval } from "@/common/common"
import "./index.scss" import "./index.scss"
import useUploadCDNImg from "@/use/useUploadImage";
import Message from "@/components/Message" import Message from "@/components/Message"
import { IMG_CND_Prefix } from "@/common/constant";
import SelectEnterpriseType from "./components/SelectEnterpriseType"
import { useSelector } from "@/reducers/hooks";
import useLogin from "@/use/useLogin";
export default ()=>{ export default () => {
const {type,id} = useRouter().params; const { getAdminUserInfo } = useLogin();
useEffect(()=>{ const { adminUserInfo } = useSelector(state => state.userInfo);
if(type=="add"){ useEffect(() => {
setNavigationBarTitle({title:"添加码单信息"}) initalFormData();
}else{ }, []);
initalFormData(); // 获取认证信息
setNavigationBarTitle({title:"修改码单信息"}) const { fetchData: getFromData } = certificationDetailApi()
} const initalFormData = async () => {
},[]); const detail = await getFromData();
// 获取编辑码单信息
const {fetchData: getFromData} = weightDetailApi()
const initalFormData = async ()=>{
const detail = await getFromData({id});
setFormData({ setFormData({
title: detail.data.title, ...detail.data ?? {},
purchaser_name: detail.data.purchaser_name, legal_person_identity_url: detail?.data?.legal_person_identity_url ?? [],
phone: detail.data.phone, // business_license_url: "https://test.cdn.zzfzyc.com/mall/827082e888860dd9da10f0fbb0ac3cf023081456.png"
is_default: detail.data.is_default, } as any)
id: detail.data.id,
})
} }
// 保存 // 保存
const [formData, setFormData] = useState({ const [formData, setFormData] = useState({
title: "", authentication_type: 0,
purchaser_name: "", authentication_type_name: "",
phone: "", business_license_url: "",
is_default: false, legal_person: "",
id: 0 legal_person_identity: "",
}) businessLicense: '',
legal_person_identity_url: [],
name: ""
});
const rules = { const rules = {
title: [{ authentication_type: [{
message: "请输入抬头" message: "请选择认证类型"
}], }],
purchaser_name: [{ name: [{
message: "请输入客户名称" message: "请输入企业名称"
}],
business_license_url: [{
message: "请上传营业执照"
}],
legal_person: [{
message: "请输入法人名称"
}],
legal_person_identity: [{
message: "请输入正确法人身份证",
regex: /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
}],
legal_person_identity_url: [{
message: "请上传法人身份证",
validator: (value: any, rule: any) => {
if (!value[0] || !value[1]) {
return true;
}
return false;
}
}], }],
phone: [{
message: "请输入正确的电话号码", regex: /^1[3|5|6|9|2|8|7]\d{9}$/
}]
} }
const {fetchData} = weightAddApi() const { fetchData } = certificationSaveApi()
const {fetchData: editFetch} = weightEditApi() const handleSave = () => {
const handleSave = ()=>{ retrieval(formData, rules).then(async () => {
retrieval(formData, rules).then(async ()=>{ const result = await fetchData({ ...formData, authentication_type: 2 })
const result = type=="add"?await fetchData({ if (result.success) {
title: formData.title, // Taro.eventCenter.trigger("weightList:refresh");
purchaser_name: formData.purchaser_name, getAdminUserInfo();
phone: formData.phone,
is_default: formData.is_default,
}):await editFetch({
title: formData.title,
purchaser_name: formData.purchaser_name,
phone: formData.phone,
is_default: formData.is_default,
id: formData.id
});
if(result.success){
Taro.eventCenter.trigger("weightList:refresh");
Taro.navigateBack(); Taro.navigateBack();
alert.success("保存成功"); alert.success("保存成功");
}else{ } else {
alert.error(result.msg); alert.error(result.msg);
} }
}).catch((message)=>{ }).catch((message) => {
alert.none(message) alert.none(message)
}) })
} }
// 监听表单完善 // 监听表单完善
const [hozon, setHozon] = useState(false); const [hozon, setHozon] = useState(false);
useEffect(()=>{ useEffect(() => {
if(retrieval){ if (retrieval) {
retrieval(formData).then(()=>setHozon(true)).catch(()=>setHozon(false)) retrieval(formData).then(() => setHozon(true)).catch(() => setHozon(false))
} }
},[formData]) }, [formData])
// 选择类型弹窗显示
const selectTypeRef = useRef(null)
const handleSelectTypeModalShow = () => {
(selectTypeRef.current as any).setShow(true)
}
// 选择类型确定
const handleSelectTypeConfirm = (item) => {
setFormData({
...formData,
authentication_type: item.id,
authentication_type_name: item.name
});
}
// 上传图片
const { getWxPhoto } = useUploadCDNImg();
const handleUploadImage = async (text: any) => {
let result = await getWxPhoto('mall');
if (text == "business_license_url") {
formData.business_license_url = IMG_CND_Prefix + (result as any).url;
} else {
formData.legal_person_identity_url[text] = IMG_CND_Prefix + (result as any).url as never;
}
setFormData({ ...formData });
}
// 查看图片
const handleViewImage = (event, url) => {
event.stopPropagation();
Taro.previewImage({
current: url,
urls: [url]
})
}
return ( return (
<View className="certification"> <View className="certification">
<Message text="认证不通过原因xxx请重新认证"/> {(adminUserInfo as any)?.authentication_status == 3 && <Message text={`认证不通过,原因:${(formData as any).authentication_feedback},请重新认证`} />}
<View className="certification-content"> <View className="certification-content">
<View className="certification-title"></View> <View className="certification-title"></View>
<FromListCertification type="select" onInput={(ev:any)=>setFormData({...formData,title:ev.detail.value})} {/* <FromListCertification type="select" onClick={handleSelectTypeModalShow} value={(formData as any)?.authentication_type_name} label="认证类型" placeholder="企业认证"/> */}
value={formData["title"]} label="认证类型" placeholder="企业认证"/> <SelectEnterpriseType ref={selectTypeRef} confirm={handleSelectTypeConfirm} />
<FromListCertification onInput={(ev:any)=>setFormData({...formData,title:ev.detail.value})} value={formData["title"]} label="企业名称" placeholder="请输入营业执照上的企业名称" required/> <FromListCertification onInput={(ev: any) => setFormData({ ...formData, name: ev.detail.value })} value={formData["name"]} label="企业名称" placeholder="请输入营业执照上的企业名称" required />
<FromListCertification style={{border: "0"}} onInput={(ev:any)=>setFormData({...formData,title:ev.detail.value})} value={formData["title"]} label="企业营业" placeholder="注册号、统一社会信用代码、组织机构代码" required/> {/* <FromListCertification type="select" style={{border: "0"}}label="企业营业执照" placeholder="注册号、统一社会信用代码、组织机构代码" required showIcon={false}/> */}
<View className="certification-upload"> <FromListCertification onInput={(ev: any) => setFormData({ ...formData, businessLicense: ev.detail.value })} value={formData["businessLicense"]} style={{ border: "0" }} label="企业营业执照" placeholder="注册号、统一社会信用代码、组织机构代码" required />
{/* <Text></Text> <View onClick={() => handleUploadImage("business_license_url")} className="certification-upload">
<View className="certification-button"> {(formData as any)?.business_license_url ?
<View></View> <>
<View></View> <Text></Text>
</View> */} <View className="certification-button">
<View className="certification-upload-no"> <View onClick={(e) => handleViewImage(e, (formData as any)?.business_license_url)}></View>
<View className="certification-upload-no-icon">+</View> <View></View>
<View className="certification-upload-no-tips"></View> </View>
</View> <Image mode="aspectFit" src={(formData as any)?.business_license_url} />
</> :
<View className="certification-upload-no">
<View className="certification-upload-no-icon">+</View>
<View className="certification-upload-no-tips"></View>
</View>
}
</View> </View>
</View> </View>
<View className="certification-content"> <View className="certification-content">
<View className="certification-title"></View> <View className="certification-title"></View>
<FromListCertification onInput={(ev:any)=>setFormData({...formData,title:ev.detail.value})} value={formData["title"]} label="法人代表" placeholder="填写法人名称" required/> <FromListCertification onInput={(ev: any) => setFormData({ ...formData, legal_person: ev.detail.value })} value={formData["legal_person"]} label="法人代表" placeholder="填写法人名称" required />
<FromListCertification style={{border: "0"}} onInput={(ev:any)=>setFormData({...formData,title:ev.detail.value})} value={formData["title"]} label="法人身份" placeholder="填写法人代表身份证号" required/> <FromListCertification style={{ border: "0" }} onInput={(ev: any) => setFormData({ ...formData, legal_person_identity: ev.detail.value })} value={formData["legal_person_identity"]} label="法人身份" placeholder="填写法人代表身份证号" required />
<View className="certification-upload"> <View onClick={() => handleUploadImage(0)} className="certification-upload">
<Text></Text> {(formData as any)?.legal_person_identity_url[0] ?
<View className="certification-button"> <>
<View></View> <Text></Text>
<View></View> <View className="certification-button">
</View> <View onClick={(e) => handleViewImage(e, (formData as any)?.legal_person_identity_url[0])}></View>
<View></View>
</View>
<Image mode="aspectFit" src={(formData as any)?.legal_person_identity_url[0]} />
</> :
<View className="certification-upload-no">
<View className="certification-upload-no-icon">+</View>
<View className="certification-upload-no-tips"></View>
</View>
}
</View> </View>
<View className="certification-upload"> <View onClick={() => handleUploadImage(1)} className="certification-upload">
<Text></Text> {(formData as any)?.legal_person_identity_url[1] ?
<View className="certification-button"> <>
<View></View> <Text></Text>
<View></View> <View className="certification-button">
</View> <View onClick={(e) => handleViewImage(e, (formData as any)?.legal_person_identity_url[1])}></View>
<View></View>
</View>
<Image mode="aspectFit" src={(formData as any)?.legal_person_identity_url[1]} />
</> :
<View className="certification-upload-no">
<View className="certification-upload-no-icon">+</View>
<View className="certification-upload-no-tips"></View>
</View>
}
</View> </View>
</View> </View>
<View className="certification-footer"> <View className="certification-footer">
<View className="certification-footer-button"> <View className="certification-footer-button">
<View></View> <Navigator openType="navigateBack"></Navigator>
<View></View> <View onClick={handleSave}>{[3, 4].includes((adminUserInfo as any)?.authentication_status) ? "重新认证" : "提交"}</View>
</View> </View>
</View> </View>
</View> </View>

View File

@ -18,11 +18,12 @@
.credit-used-list-price{ .credit-used-list-price{
font-size: 28px; font-size: 28px;
font-weight: 400; font-weight: 400;
margin-bottom: 20px;
} }
.credit-used-list-right{ .credit-used-list-right{
display: flex;align-items: center; display: flex;align-items: center;
text-align: right; }
.credit-used-list-right-price view{
display: flex;align-items: center;
} }
.credit-used-list-right text{ .credit-used-list-right text{
font-size: 30px; font-size: 30px;
@ -36,6 +37,7 @@
.credit-used-list-orderno{ .credit-used-list-orderno{
font-size: 20px; font-size: 20px;
font-weight: 400; font-weight: 400;
margin-top: 20px;
color: #ababab; color: #ababab;
} }
.green{ .green{

View File

@ -36,11 +36,11 @@ export default ()=>{
</View> </View>
<View className="credit-used-list-right"> <View className="credit-used-list-right">
<View> <View className="credit-used-list-right-price">
<View className={`credit-used-list-price ${(item as any).amount_received_this_time>0?'red':'green'}`}> <View className={`credit-used-list-price ${[1,2,3].includes((item as any).type as never)?'red':'green'}`}>
{(item as any).amount_received_this_time>0&&"+"}{formatPriceDiv((item as any).amount_received_this_time)} {[1,2,3].includes((item as any).type as never)?"+":"-"}{formatPriceDiv((item as any).amount_received_this_time)}
</View> </View>
<View className="credit-used-list-orderno"></View> {/* <View className="credit-used-list-orderno">处理中</View> */}
</View> </View>
<Text className="iconfont icon-a-moreback"></Text> <Text className="iconfont icon-a-moreback"></Text>
</View> </View>

View File

@ -1,4 +1,4 @@
import {View} from '@tarojs/components' import { View } from '@tarojs/components'
import Banner from '@/components/banner' import Banner from '@/components/banner'
import Search from '@/components/search' import Search from '@/components/search'
import SideBar from '@/components/sideBar' import SideBar from '@/components/sideBar'
@ -6,16 +6,17 @@ import Product from '@/components/product'
import MoveBtn from '@/components/moveBtn' import MoveBtn from '@/components/moveBtn'
import ShopCart from '@/components/shopCart' import ShopCart from '@/components/shopCart'
import { goLink } from '@/common/common' import { goLink } from '@/common/common'
import styles from './index.module.scss' import styles from './index.module.scss'
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import Taro, { Events, useDidShow, usePullDownRefresh} from '@tarojs/taro' import { useSelector } from "@/reducers/hooks";
import {GetProductKindListApi, GetProductListApi} from '@/api/material' import Taro, { Events, useDidShow, usePullDownRefresh } from '@tarojs/taro'
import { GetProductKindListApi, GetProductListApi } from '@/api/material'
import useLogin from '@/use/useLogin' import useLogin from '@/use/useLogin'
import { dataLoadingStatus } from '@/common/util' import { dataLoadingStatus } from '@/common/util'
export default () => { export default () => {
const {checkLogin} = useLogin() const { checkLogin } = useLogin()
useDidShow(async () => { useDidShow(async () => {
await checkLogin() await checkLogin()
}) })
@ -25,32 +26,33 @@ export default () => {
}, []) }, [])
//获取面料种类 //获取面料种类
const [kindData, setKindData] = useState<any>({list:[], defaultId:0}) const [kindData, setKindData] = useState<any>({ list: [], defaultId: 0 })
const {fetchData} = GetProductKindListApi() const { fetchData } = GetProductKindListApi()
const categoryList = async () => { const categoryList = async () => {
const res = await fetchData() const res = await fetchData()
if(res.data?.list) { if (res.data?.list) {
setKindData({...kindData, list:res.data.list, defaultId: res.data.list[0].id}) setKindData({ ...kindData, list: res.data.list, defaultId: res.data.list[0].id })
setFiltrate({...filtrate, product_kind_id:res.data.list[0].id}) setFiltrate({ ...filtrate, product_kind_id: res.data.list[0].id })
} }
} }
//获取面料列表 //获取面料列表
const [productData, setProductData] = useState({list:[], total:0}) const [productData, setProductData] = useState({ list: [], total: 0 })
const [hasMore, setHasMore] = useState(true) const [hasMore, setHasMore] = useState(true)
const [filtrate, setFiltrate] = useState({product_kind_id:0, size: 5,page: 1}) const [filtrate, setFiltrate] = useState({ product_kind_id: 0, size: 5, page: 1 })
const pageNum = useRef({size:filtrate.size, page:filtrate.page}) const pageNum = useRef({ size: filtrate.size, page: filtrate.page })
const {fetchData: productFetchData, state: productState} = GetProductListApi() const { fetchData: productFetchData, state: productState } = GetProductListApi()
//获取数据方法 //获取数据方法
const getProductList = async () => { const getProductList = async () => {
const {data,total} = await productFetchData(filtrate) const { data, total } = await productFetchData(filtrate)
setProductData({...productData,list:data.list,total}) setProductData({ ...productData, list: data.list, total })
setRefresherTriggeredStatus(() => false) setRefresherTriggeredStatus(() => false)
} }
//监听查询条件 //监听查询条件
useEffect(() => { useEffect(() => {
if(filtrate.product_kind_id)
if (filtrate.product_kind_id)
getProductList() getProductList()
}, [filtrate]) }, [filtrate])
@ -58,19 +60,19 @@ export default () => {
//点击面料类型 //点击面料类型
const getProductKindId = useCallback((e) => { const getProductKindId = useCallback((e) => {
pageNum.current.page = 1 pageNum.current.page = 1
setProductData({list:[], total:0}) setProductData({ list: [], total: 0 })
setFiltrate((list) => ({...list, size:5, product_kind_id:e.id})) setFiltrate((list) => ({ ...list, size: 5, product_kind_id: e.id }))
// setHasMore(true) // setHasMore(true)
}, []) }, [])
//上拉加载数据 //上拉加载数据
const getScrolltolower = useCallback(() => { const getScrolltolower = useCallback(() => {
if(productData.list.length >= productData.total) { if (productData.list.length >= productData.total) {
setHasMore(false) setHasMore(false)
} else { } else {
pageNum.current.page++ pageNum.current.page++
const newSize = pageNum.current.size * pageNum.current.page const newSize = pageNum.current.size * pageNum.current.page
setFiltrate((e) => ({...e, size:newSize})) setFiltrate((e) => ({ ...e, size: newSize }))
} }
}, [productData]) }, [productData])
@ -81,7 +83,7 @@ export default () => {
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false) const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
const getRefresherRefresh = async () => { const getRefresherRefresh = async () => {
pageNum.current.page = 1 pageNum.current.page = 1
setFiltrate({...filtrate, size:5}) setFiltrate({ ...filtrate, size: 5 })
setHasMore(true) setHasMore(true)
setRefresherTriggeredStatus(true) setRefresherTriggeredStatus(true)
} }
@ -95,26 +97,85 @@ export default () => {
//数据加载状态 //数据加载状态
const statusMore = useMemo(() => { const statusMore = useMemo(() => {
return dataLoadingStatus({list:productData.list, total: productData.total, status: productState.loading}) return dataLoadingStatus({ list: productData.list, total: productData.total, status: productState.loading })
}, [productData, productState.loading]) }, [productData, productState.loading])
useEffect(() => {
getShow()
}, [])
// const [time, setShow] = useState(false)
//拿状态存储的东西判断
const { adminUserInfo } = useSelector(state => state.userInfo);
const getShow = () => {
if (adminUserInfo?.authentication_status === 0 || adminUserInfo?.authentication_status === 1 || adminUserInfo?.authentication_status === 2 || adminUserInfo?.authentication_status === 3) {
//倒计时弹出去认证
const countTime: any = 60
//获取倒计时的变量
var time = parseInt(countTime);
const countDown = setInterval(() => {
if (time == 0) {
Taro.showModal({
title: '提示',
content: '你还未认证,认证后解锁更多功能',
cancelText: '稍后认证',
confirmText: '去认证',
success: function (res) {
if (res.confirm) {
Taro.navigateTo({ url: '/pages/certification/index' })
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
//清除定时器
clearInterval(countDown);
} else {
time--;
}
}, 1000)
}
}
//检查认证是否认证
const checkShow = () => {
if (adminUserInfo.authentication_status === 0 || adminUserInfo.authentication_status === 1 || adminUserInfo.authentication_status === 2 || adminUserInfo.authentication_status === 3) {
Taro.showModal({
title: '提示',
content: '你还未认证,认证后解锁更多功能',
cancelText: '稍后认证',
confirmText: '去认证',
success: function (res) {
if (res.confirm) {
Taro.navigateTo({ url: '/pages/certification/index' })
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
} else {
setShowShopCart(!showShopCart)
}
}
return ( return (
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}> <MoveBtn onClick={() => checkShow()}>
<View className={styles.main}> <View className={styles.main}>
<Banner/> <Banner />
<View className={styles.search}> <View className={styles.search}>
<View className={styles.search_collect}></View> <View className={styles.search_collect}></View>
<View className={styles.search_input} onClick={() => goLink('/pages/searchList/search')}> <View className={styles.search_input} onClick={() => goLink('/pages/searchList/search')}>
<Search disabled={true} style={{width: '263rpx'}} /> <Search disabled={true} style={{ width: '263rpx' }} />
</View> </View>
</View> </View>
<View className={styles.products}> <View className={styles.products}>
<SideBar list={kindData.list} height="100%" defaultValue={kindData.defaultId} hasMore={hasMore} statusMore={statusMore} selfOnScrolltolower={getScrolltolower} sideBarOnClick={getProductKindId} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}> <SideBar list={kindData.list} height="100%" defaultValue={kindData.defaultId} hasMore={hasMore} statusMore={statusMore} selfOnScrolltolower={getScrolltolower} sideBarOnClick={getProductKindId} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
<Product productList={productData.list}/> <Product productList={productData.list} />
</SideBar> </SideBar>
</View> </View>
<View className='common_safe_area_y'></View> <View className='common_safe_area_y'></View>
<ShopCart show={showShopCart} onClose={() => setShowShopCart(false)}/> <ShopCart show={showShopCart} onClose={() => setShowShopCart(false)} />
</View> </View>
</MoveBtn> </MoveBtn>
) )

View File

@ -1,73 +1,94 @@
.main{ .main {
background-color: #F8F8F8; background-color: #F8F8F8;
min-height: 100vh; min-height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
.header{
.header {
background: #68b4ff; background: #68b4ff;
background-size: cover; background-size: cover;
height: 560px; height: 560px;
position: relative; position: relative;
.card-main{
.card-main {
margin-top: 10px; margin-top: 10px;
} }
} }
.auth-suspension{
.auth-suspension {
position: absolute; position: absolute;
z-index: 1;inset: 0; z-index: 1;
inset: 0;
} }
.header-card{
position: absolute;left: 50%;bottom: -18%; .header-card {
position: absolute;
left: 50%;
bottom: -18%;
transform: translateX(-50%); transform: translateX(-50%);
} }
.crad{
width: 702px; .crad {
background: rgba(255,255,255,0.95); width: 702px;
border-radius: 20px; background: rgba(255, 255, 255, 0.95);
padding: 30px; border-radius: 20px;
box-sizing: border-box; padding: 30px;
box-shadow: 0px 6px 12px 0px rgba(0,0,0,0.05); box-sizing: border-box;
box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.05);
} }
.card-info{
display: flex;justify-content: space-between; .card-info {
position: absolute;top: -15%;left: 0;right: 0; display: flex;
width: 702px; justify-content: space-between;
padding: 0 30px; position: absolute;
box-sizing: border-box; top: -15%;
left: 0;
right: 0;
width: 702px;
padding: 0 30px;
box-sizing: border-box;
} }
.arcd-info-left{
display: flex;align-items: flex-end; .arcd-info-left {
display: flex;
align-items: flex-end;
} }
.arcd-info-left-portrait{
width: 170px; .arcd-info-left-portrait {
height: 170px; width: 170px;
background: rgba(0,0,0,0.00); height: 170px;
border: 4px solid #ffffff; background: rgba(0, 0, 0, 0.00);
border-radius: 50%; border: 4px solid #ffffff;
overflow: hidden; border-radius: 50%;
overflow: hidden;
} }
.arcd-info-left-portrait image{
width: 100%; .arcd-info-left-portrait image {
height: 100%; width: 100%;
object-fit: cover; height: 100%;
object-fit: cover;
} }
.arcd-info-left-desc{
margin-left: 24px; .arcd-info-left-desc {
margin-left: 24px;
} }
.arcd-info-left-nickname{
font-size: 44px; .arcd-info-left-nickname {
font-weight: 700; font-size: 44px;
color: #000000; font-weight: 700;
display: flex; color: #000000;
align-items: center; display: flex;
align-items: center;
} }
.arcd-info-left-phone{
.arcd-info-left-phone {
font-size: 24px; font-size: 24px;
font-weight: 400; font-weight: 400;
color: #707070; color: #707070;
} }
.arcd-info-left-phone button{
.arcd-info-left-phone button {
padding: 0 10px; padding: 0 10px;
height: 42px; height: 42px;
background: #ffffff; background: #ffffff;
@ -76,39 +97,50 @@
font-size: 22px; font-size: 22px;
font-weight: 400; font-weight: 400;
color: #007aff; color: #007aff;
display: flex;align-items: center;justify-content: center; display: flex;
align-items: center;
justify-content: center;
} }
.card-info-right{
font-size: 26px; .card-info-right {
display: flex;align-items: flex-end; font-size: 26px;
display: flex;
align-items: flex-end;
} }
.setup-icon{
.setup-icon {
position: relative; position: relative;
padding-bottom: 10px; padding-bottom: 10px;
} }
.icon-wrapper{
.icon-wrapper {
font-size: 60px; font-size: 60px;
} }
.icon-point{
.icon-point {
width: 8px; width: 8px;
height: 8px; height: 8px;
border-radius: 50%; border-radius: 50%;
background: #ff0000; background: #ff0000;
position: absolute; position: absolute;
right: 0;top: 0; right: 0;
top: 0;
} }
.card-main{ .card-main {
margin: 20px auto 0; margin: 20px auto 0;
} }
.card-main-title{
display: flex;justify-content: space-between; .card-main-title {
align-items: center; display: flex;
border-bottom: 2px solid #dddddd; justify-content: space-between;
padding: 0 5px 15px; align-items: center;
box-sizing: border-box; border-bottom: 2px solid #dddddd;
padding: 0 5px 15px;
box-sizing: border-box;
} }
.card-main-title text{
.card-main-title text {
font-size: 22px; font-size: 22px;
font-weight: 400; font-weight: 400;
color: #ababab; color: #ababab;
@ -116,23 +148,27 @@
text-align: right; text-align: right;
width: 150px; width: 150px;
} }
.card-main-title-content{
display: grid; .card-main-title-content {
grid-template-columns: repeat(5,1fr); display: grid;
grid-template-columns: repeat(5, 1fr);
} }
.card-main-title-content-item{
font-size: 24px; .card-main-title-content-item {
font-weight: 400; font-size: 24px;
color: #3c3c3c; font-weight: 400;
text-align: center; color: #3c3c3c;
margin-top: 30px; text-align: center;
position: relative; margin-top: 30px;
position: relative;
} }
.card-main-title-content-item Text{
.card-main-title-content-item Text {
font-size: 56px; font-size: 56px;
color: #3C3C3C; color: #3C3C3C;
} }
.card-main-title-content-item-badge{
.card-main-title-content-item-badge {
padding: 0 10px; padding: 0 10px;
height: 32px; height: 32px;
background: #007aff; background: #007aff;
@ -143,96 +179,140 @@
font-size: 18px; font-size: 18px;
font-weight: 700; font-weight: 700;
color: #ffffff; color: #ffffff;
display: flex;align-items: center;justify-content: center; display: flex;
position: absolute;top: -10px;right: 0; align-items: center;
justify-content: center;
position: absolute;
top: -10px;
right: 0;
} }
.assets-title{ .assets-title {
font-size: 28px; font-size: 28px;
font-weight: 700; font-weight: 700;
color: #3c3c3c; color: #3c3c3c;
margin-bottom: 20px; margin-bottom: 20px;
} }
.assets-content{
.assets-content {
display: grid; display: grid;
grid-template-columns: repeat(3,1fr); grid-template-columns: repeat(3, 1fr);
} }
.assets-content>view,.assets-content>navigator{
.assets-content>view,
.assets-content>navigator {
text-align: center; text-align: center;
} }
.assets-content-item-top{
.assets-content-item-top {
color: #007aff; color: #007aff;
font-weight: 400; font-weight: 400;
} }
.assets-content-item-top-before{
.assets-content-item-top-before {
font-size: 20px; font-size: 20px;
} }
.assets-content-item-top-content{
.assets-content-item-top-content {
font-size: 36px; font-size: 36px;
} }
.assets-content-item-top-after{
.assets-content-item-top-after {
font-size: 20px; font-size: 20px;
} }
.assets-content-item-tips{
.assets-content-item-tips {
font-size: 24px; font-size: 24px;
font-weight: 400; font-weight: 400;
color: #707070; color: #707070;
} }
.main-card{ .main-card {
margin: 131px auto 0; margin: 131px auto 0;
} }
.card-feature{
.card-feature {
margin-bottom: 50px; margin-bottom: 50px;
} }
.card-main-list-content-item{
display: flex;align-items: center; .card-main-list-content-item {
display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
height: 90px; height: 90px;
} }
.card-main-list-content-item-left{
.card-main-list-content-item-left {
font-size: 26px; font-size: 26px;
font-weight: 400; font-weight: 400;
text-align: left; text-align: left;
color: #707070; color: #707070;
display: flex;align-items: center; display: flex;
align-items: center;
} }
.card-main-list-content-item-left text{
.card-main-list-content-item-left text {
margin-right: 35px; margin-right: 35px;
font-size: 56px; font-size: 56px;
color: #707070; color: #707070;
} }
.card-main-list-content-item-right text{
.card-main-list-content-item-right text {
font-size: 30px; font-size: 30px;
} }
.auth{ .auth {
margin-top: 115px; margin-top: 115px;
} }
.auth-top{
display: flex;align-items: center;justify-content: space-between; .auth-top {
display: flex;
align-items: center;
justify-content: space-between;
} }
.auth-status{
.auth-status {
padding: 0 10px; padding: 0 10px;
height: 30px; height: 30px;
background: #dddddd; background: #dddddd;
border-radius: 10px 4px 0px 0px; border-radius: 10px 4px 0px 0px;
display: flex;align-items: center;justify-content: center; display: flex;
align-items: center;
justify-content: center;
font-size: 18px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #707070; color: #707070;
} }
.auth-tips{
.auth-status,
.auth-status-ongoing {
color: #EE7500;
background-color: #FFE6CE;
}
.auth-status,
.auth-status-adopt {
color: #007AFF;
background-color: #CDE5FF;
}
.auth-tips {
font-size: 18px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #007aff; color: #007aff;
width: 150px;
text-align: right; text-align: right;
} }
.auth-tips text{
.auth-tips,
.auth-tips-adopt {
color: #ABABAB;
}
.auth-tips text {
font-size: 17px; font-size: 17px;
} }
.auth-company{
.auth-company {
height: 70px; height: 70px;
width: 100%; width: 100%;
background: #f6f6f6; background: #f6f6f6;
@ -241,31 +321,46 @@
font-size: 26px; font-size: 26px;
font-weight: 700; font-weight: 700;
color: #707070; color: #707070;
display: flex;align-items: center;justify-content: center; display: flex;
align-items: center;
justify-content: center;
} }
.tips-modal{ .auth-company,
background: rgba(0,0,0,0.6); .auth-company-adopt {
position: fixed;inset: 0; background: #ecf5ff;
display: flex;justify-content: center;align-items: center; border: 2px solid #cde5ff;
}
.tips-modal {
background: rgba(0, 0, 0, 0.6);
position: fixed;
inset: 0;
display: flex;
justify-content: center;
align-items: center;
z-index: 2; z-index: 2;
} }
.tips-modal-content{
.tips-modal-content {
width: 598px; width: 598px;
background: #ffffff; background: #ffffff;
border-radius: 10px; border-radius: 10px;
animation: enlargeK 0.2s linear; animation: enlargeK 0.2s linear;
overflow: hidden; overflow: hidden;
} }
@keyframes enlargeK { @keyframes enlargeK {
0%{ 0% {
transform: scale(0); transform: scale(0);
} }
100%{
100% {
transform: scale(1); transform: scale(1);
} }
} }
.tips-modal-title{
.tips-modal-title {
font-size: 32px; font-size: 32px;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
@ -273,53 +368,166 @@
margin-bottom: 58px; margin-bottom: 58px;
padding-top: 48px; padding-top: 48px;
} }
.tips-modal-letter{
.tips-modal-letter {
font-size: 26px; font-size: 26px;
font-weight: 400; font-weight: 400;
color: #707070; color: #707070;
padding: 0 30px; padding: 0 30px;
line-height: 50px; line-height: 50px;
} }
.tips-modal-letter-text{
.tips-modal-letter-text {
text-indent: 60px; text-indent: 60px;
} }
.tips-modal-letter-beginn{
.tips-modal-letter-beginn {
font-size: 28px; font-size: 28px;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
margin-bottom: 25px; margin-bottom: 25px;
} }
.tips-modal-letter-end{
.tips-modal-letter-end {
font-size: 26px; font-size: 26px;
font-weight: 400; font-weight: 400;
text-align: right; text-align: right;
margin-top: 61px; margin-top: 61px;
} }
.tips-modal-button{
.tips-modal-button {
display: flex; display: flex;
border-top: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD;
margin-top: 45px; margin-top: 45px;
} }
.tips-modal-button button, .tips-modal-button view{
display: flex;align-items: center;justify-content: center; .tips-modal-button button,
.tips-modal-button view {
display: flex;
align-items: center;
justify-content: center;
width: 50%; width: 50%;
height: 90px; height: 90px;
background-color: white; background-color: white;
} }
.tips-modal-button button{
.tips-modal-button button {
font-size: 26px; font-size: 26px;
font-weight: 400; font-weight: 400;
color: #707070; color: #707070;
border-radius: 0; border-radius: 0;
border-right: 1px solid #DDDDDD; border-right: 1px solid #DDDDDD;
} }
.tips-modal-button button::after{
.tips-modal-button button::after {
border: 0; border: 0;
border-radius: 0; border-radius: 0;
} }
.tips-modal-button view{
.tips-modal-button view {
font-size: 26px; font-size: 26px;
font-weight: 400; font-weight: 400;
color: #007aff; color: #007aff;
} }
.auth-box {
width: 614px;
height: 70px;
background: #f6f6f6;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 18px;
padding-right: 16px;
.auth-left-box {
display: flex;
align-items: center;
.auth-tag {
width: 86px;
height: 34px;
background: #dddddd;
border-radius: 10px;
font-size: 22px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-weight: 400;
text-align: center;
color: #707070;
text-align: center;
line-height: 34px;
margin-right: 28px;
}
.auth-tagone {
width: 86px;
height: 34px;
background: #ffe6ce;
border-radius: 10px;
font-size: 22px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-weight: 400;
text-align: center;
color: #707070;
text-align: center;
line-height: 34px;
margin-right: 28px;
}
.auth-tagtwo {
display: flex;
align-items: center;
overflow: hidden;
padding-left: 10px;
width: 100px;
height: 32px;
background: #cde5ff;
border-radius: 10px;
.iconFont-color {
display: flex;
align-items: center;
font-size: 30px;
margin-right: 3px;
color: #007aff;
}
.auth-font {
font-size: 20px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-weight: 400;
color: #007aff;
}
}
.tagthree {
display: flex;
align-items: center;
overflow: hidden;
padding-left: 10px;
width: 100px;
height: 32px;
background: rgba(255, 0, 0, 0.10);
border-radius: 10px;
color: #ff0000;
}
.auth-cont {
margin-left: 16px;
font-size: 26px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-weight: 700;
color: #ababab;
}
.auth-contone {
margin-left: 16px;
font-size: 26px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-weight: 700;
color: #3c3c3c;
}
}
}
} }

View File

@ -5,77 +5,87 @@ import classnames from "classnames";
import { useSelector } from "@/reducers/hooks"; import { useSelector } from "@/reducers/hooks";
import { alert, goLink } from "@/common/common"; import { alert, goLink } from "@/common/common";
import useLogin from '@/use/useLogin' import useLogin from '@/use/useLogin'
import {BASE_URL} from '@/common/constant' import { BASE_URL } from '@/common/constant'
import Taro from "@tarojs/taro";
import { userassets } from "@/api/mine"
import { formatPriceDiv } from "@/common/fotmat"
export default () => { export default () => {
// 用户信息 // 用户信息
const { getSelfUserInfo } = useLogin(); const { getSelfUserInfo } = useLogin();
const {adminUserInfo} = useSelector(state => state.userInfo); const { adminUserInfo } = useSelector(state => state.userInfo);
useEffect(()=>{ useEffect(() => {
getSelfUserInfo().then().catch(()=>{ getSelfUserInfo().then().catch(() => {
alert.none("授权失败,请授权后再使用"); alert.none("授权失败,请授权后再使用");
}); });
},[]); }, []);
const handleAuth = async ()=>{ const handleAuth = async () => {
getSelfUserInfo().then().catch(()=>{ getSelfUserInfo().then().catch(() => {
alert.none("授权失败,请授权后再使用"); alert.none("授权失败,请授权后再使用");
}); });
} }
const { fetchData, state } = userassets()
useEffect(() => {
fetchData();
}, [])
return ( return (
<View className={styles.main}> <View className={styles.main}>
<Header data={adminUserInfo} /> <Header data={adminUserInfo} />
<Assets /> <Assets data={state} />
<Main /> <Main />
<Modal data={adminUserInfo}/> {/* {(adminUserInfo as any)?.authentication_status==1&&<Modal data={adminUserInfo}/>} */}
{/* 测试暂时添加 */} {/* 测试暂时添加 */}
<View style={{fontSize:'26rpx', textAlign:'center'}}>{BASE_URL}</View> <View style={{ fontSize: '26rpx', textAlign: 'center' }}>{BASE_URL}</View>
{!adminUserInfo.is_authorize_name&&<View onClick={handleAuth} className={styles["auth-suspension"]}></View>} {!adminUserInfo.is_authorize_name && <View onClick={handleAuth} className={styles["auth-suspension"]}></View>}
</View> </View>
) )
} }
// 提示弹窗 // 提示弹窗
const Modal = memo((props:any)=>{ const Modal = memo((props: any) => {
const {data} = props; const { data } = props;
const [modalShow, setModalShow]=useState(true); const [modalShow, setModalShow] = useState(true);
const handleouter = ()=>{ const handleouter = () => {
} }
return( return (
<> <>
{!data?.is_authorize_phone&&modalShow&& {modalShow &&
<View onClick={handleouter} catchMove className={styles['tips-modal']}> <View onClick={handleouter} catchMove className={styles['tips-modal']}>
<View className={styles['tips-modal-content']} onClick={e=>e.stopPropagation()}> <View className={styles['tips-modal-content']} onClick={e => e.stopPropagation()}>
<View className={styles['tips-modal-title']}></View> <View className={styles['tips-modal-title']}></View>
<View className={styles['tips-modal-letter']}> <View className={styles['tips-modal-letter']}>
<View className={styles['tips-modal-letter-beginn']}>To: 万丰园纺织科技</View> <View className={styles['tips-modal-letter-beginn']}>To: 万丰园纺织科技</View>
<View className={styles['tips-modal-letter-text']}>使</View> <View className={styles['tips-modal-letter-text']}>使</View>
<View className={styles['tips-modal-letter-end']}></View> <View className={styles['tips-modal-letter-end']}></View>
</View>
<View className={styles['tips-modal-button']}>
<Button hoverClass="none" openType="contact"></Button>
<View onClick={() => setModalShow(false)}></View>
</View>
</View>
</View> </View>
<View className={styles['tips-modal-button']}> }
<Button hoverClass="none" openType="contact"></Button>
<View onClick={()=>setModalShow(false)}></View>
</View>
</View>
</View>
}
</> </>
) )
}) })
// 头部 | 订单 // 头部 | 订单
const Header = memo((props:any) => { const Header = memo((props: any) => {
const {data} = props; const { data } = props;
let menu = [{ text: "待配布", icon: "icon-daipeibu", url: "/pages/orderList/index" }, { text: "待付款", icon: "icon-daifukuan", url: "/pages/orderList/index" }, let menu = [{ text: "待配布", icon: "icon-daipeibu", url: "/pages/orderList/index" }, { text: "待付款", icon: "icon-daifukuan", url: "/pages/orderList/index" },
{ text: "待发货", icon: "icon-daifahuo", url: "/pages/orderList/index" }, { text: "已发货", icon: "icon-yifahuo", url: "/pages/orderList/index" }, { text: "待发货", icon: "icon-daifahuo", url: "/pages/orderList/index" }, { text: "已发货", icon: "icon-yifahuo", url: "/pages/orderList/index" },
{ text: "退款/售后", icon: "icon-a-tuikuanshouhou", url: "/pages/salesAfterList/index" }]; { text: "退款/售后", icon: "icon-a-tuikuanshouhou", url: "/pages/orderList/index" }];
const { getPhoneNumber } = useLogin(); const { getPhoneNumber } = useLogin();
const mGetPhoneNumber = (ev)=>{ const mGetPhoneNumber = (ev) => {
if(ev.detail?.code){ if (ev.detail?.code) {
getPhoneNumber(ev.detail.code); getPhoneNumber(ev.detail.code);
}else{ } else {
alert.none("绑定失败!"); alert.none("绑定失败!");
} }
} }
const navTo = () => {
Taro.navigateTo({
url: '/pages/certification/index'
})
}
return ( return (
<View className={styles.header}> <View className={styles.header}>
<View className={`${styles.crad} ${styles['header-card']}`}> <View className={`${styles.crad} ${styles['header-card']}`}>
@ -90,7 +100,7 @@ const Header = memo((props:any) => {
{data?.user_name} {data?.user_name}
</View> </View>
<View className={styles['arcd-info-left-phone']}> <View className={styles['arcd-info-left-phone']}>
{data?.phone?data?.phone?.replace(data?.phone?.substring(3,7), "****"):<Button openType="getPhoneNumber" onGetPhoneNumber={mGetPhoneNumber}></Button>} {data?.phone ? data?.phone?.replace(data?.phone?.substring(3, 7), "****") : <Button openType="getPhoneNumber" onGetPhoneNumber={mGetPhoneNumber}></Button>}
</View> </View>
</View> </View>
</View> </View>
@ -106,16 +116,80 @@ const Header = memo((props:any) => {
</View> </View>
</View> </View>
<View className={styles['auth']}> <View className={styles['auth']}>
<View className={styles['auth-top']}> {(data?.authentication_status == 0 || data?.authentication_status == 1) &&
<View className={styles['auth-status']}> <View className={styles['auth-box']} onClick={() => navTo()}>
<Text>1</Text> <View className={styles['auth-left-box']}>
<View className={styles['auth-tag']}>
</View>
<View className={styles['auth-cont']}>
</View>
</View>
<Text className="iconfont icon-a-moreback"></Text>
</View> </View>
<Navigator hoverClass="none" url="/pages/certification/index" className={styles['auth-tips']}> <Text className="iconfont icon-a-moreback"/></Navigator> }
</View> {(data?.authentication_status == 3) &&
<View className={styles['auth-company']}> <View className={styles['auth-box']} onClick={() => navTo()}>
{data?.company_name} <View className={styles['auth-left-box']}>
</View> <View className={styles['auth-tagthree']}>
</View>
<View className={styles['auth-cont']}>
</View>
</View>
<Text className="iconfont icon-a-moreback"></Text>
</View>
}
{data?.authentication_status == 2 &&
<View className={styles['auth-box']} onClick={() => navTo()}>
<View className={styles['auth-left-box']}>
<View className={styles['auth-tagone']}>
</View>
<View className={styles['auth-contone']}>
{data?.company_name || '暂未加入或注册组织'}
</View>
</View>
<Text className="iconfont icon-a-moreback"></Text>
</View>
}
{data?.authentication_status == 4 &&
<View className={styles['auth-box']} onClick={() => navTo()}>
<View className={styles['auth-left-box']}>
<View className={styles['auth-tagtwo']}>
<View className={styles['iconFont-color']}>
<Text className="iconfont icon-xtianzhangqi"></Text>
</View>
<View className={styles['auth-font']}></View>
</View>
<View className={styles['auth-contone']}>
{data?.company_name}
</View>
</View>
<Text className="iconfont icon-a-moreback"></Text>
</View>
}
{/* <View className={`${styles['auth-top']} ${data?.authentication_status==4&&"auth-tips-adopt"}`}>
<View className={`${styles['auth-status']} ${data?.authentication_status==2&&styles['auth-status-ongoing']} ${data?.authentication_status==4&&styles['auth-status-adopt']}`}>
<Text>1</Text>
{data?.authentication_status==1&&"未认证"}
{data?.authentication_status==2&&"认证中"}
{data?.authentication_status==3&&"认证不通过"}
{data?.authentication_status==4&&"已认证"}
</View>
{data?.authentication_status==1&&<Navigator hoverClass="none" url="/pages/certification/index" className={styles['auth-tips']}> <Text className="iconfont icon-a-moreback"/></Navigator>}
{data?.authentication_status==2&&<Navigator hoverClass="none" url="/pages/certification/index" className={styles['auth-tips']}>1-3 <Text className="iconfont icon-a-moreback"/></Navigator>}
{data?.authentication_status==3&&<Navigator hoverClass="none" url="/pages/certification/index" className={styles['auth-tips']}> <Text className="iconfont icon-a-moreback"/></Navigator>}
{data?.authentication_status==4&&<View className={styles['auth-tips']}> <Text className="iconfont icon-a-moreback"/></View>}
</View> */}
{/* <View className={`${styles['auth-company']} ${data?.authentication_status==4&&"auth-tips-adopt"}`}>
{data?.authentication_status==1&&"暂未加入或注册组织"}
{data?.authentication_status==2&&data?.company_name}
{data?.authentication_status==3&&data?.company_name}
{data?.authentication_status==4&&data?.company_name}
</View> */}
</View> </View>
<View className={styles['card-main']}> <View className={styles['card-main']}>
<View className={styles['card-main-title']}> <View className={styles['card-main-title']}>
@ -129,7 +203,7 @@ const Header = memo((props:any) => {
<Navigator hoverClass="none" url={item.url} className={styles['card-main-title-content-item']}> <Navigator hoverClass="none" url={item.url} className={styles['card-main-title-content-item']}>
<Text className={`iconfont ${item.icon}`}></Text> <Text className={`iconfont ${item.icon}`}></Text>
<View>{item.text}</View> <View>{item.text}</View>
<View className={styles['card-main-title-content-item-badge']}>{index==2?"99+":10}</View> <View className={styles['card-main-title-content-item-badge']}>{index == 2 ? "99+" : 10}</View>
</Navigator> </Navigator>
) )
}) })
@ -140,9 +214,9 @@ const Header = memo((props:any) => {
</View> </View>
) )
}) })
// 我的资产 // 我的资产
const Assets = () => { const Assets = (props: any) => {
console.log(props, 'propsprops')
return ( return (
<View className={`${styles.assets} ${styles.crad} ${styles['main-card']}`}> <View className={`${styles.assets} ${styles.crad} ${styles['main-card']}`}>
<View className={`${styles['assets-title']}`}></View> <View className={`${styles['assets-title']}`}></View>
@ -150,14 +224,14 @@ const Assets = () => {
<Navigator hoverClass="none" url="/pages/depositBeforehand/index"> <Navigator hoverClass="none" url="/pages/depositBeforehand/index">
<View className={`${styles['assets-content-item-top']}`}> <View className={`${styles['assets-content-item-top']}`}>
<Text className={`${styles['assets-content-item-top-before']}`}>¥</Text> <Text className={`${styles['assets-content-item-top-before']}`}>¥</Text>
<Text className={`${styles['assets-content-item-top-content']}`}>0</Text> <Text className={`${styles['assets-content-item-top-content']}`}>{formatPriceDiv(props.data.data.wallet_money || 0)}</Text>
<Text className={`${styles['assets-content-item-top-after']}`}>.20</Text> {/* <Text className={`${styles['assets-content-item-top-after']}`}>{props.wallet_money || 0}</Text> */}
</View> </View>
<Text className={`${styles['assets-content-item-tips']}`}></Text> <Text className={`${styles['assets-content-item-tips']}`}></Text>
</Navigator> </Navigator>
<View> <View>
<View className={`${styles['assets-content-item-top']}`}> <View className={`${styles['assets-content-item-top']}`}>
<Text className={`${styles['assets-content-item-top-content']}`}>4</Text> <Text className={`${styles['assets-content-item-top-content']}`}>{props.data.data.coupon_count || 0}</Text>
<Text className={`${styles['assets-content-item-top-after']}`}></Text> <Text className={`${styles['assets-content-item-top-after']}`}></Text>
</View> </View>
<Text className={`${styles['assets-content-item-tips']}`}></Text> <Text className={`${styles['assets-content-item-tips']}`}></Text>
@ -165,8 +239,8 @@ const Assets = () => {
<Navigator hoverClass="none" url="/pages/creditLine/index"> <Navigator hoverClass="none" url="/pages/creditLine/index">
<View className={`${styles['assets-content-item-top']}`}> <View className={`${styles['assets-content-item-top']}`}>
<Text className={`${styles['assets-content-item-top-before']}`}>¥</Text> <Text className={`${styles['assets-content-item-top-before']}`}>¥</Text>
<Text className={`${styles['assets-content-item-top-content']}`}>99999</Text> <Text className={`${styles['assets-content-item-top-content']}`}>{formatPriceDiv(props.data.data.credit_line || 0)}</Text>
<Text className={`${styles['assets-content-item-top-after']}`}>.-00</Text> {/* <Text className={`${styles['assets-content-item-top-after']}`}>.-00</Text> */}
</View> </View>
<Text className={`${styles['assets-content-item-tips']}`}></Text> <Text className={`${styles['assets-content-item-tips']}`}></Text>
</Navigator> </Navigator>
@ -177,9 +251,9 @@ const Assets = () => {
// 功能 // 功能
const Main = memo(() => { const Main = memo(() => {
let menu = [{ text: "地址管理", icon: "icon-shoucang",url: "/pages/addressManager/index" },{ text: "码单管理", icon: "icon-shoucang",url: "/pages/weightList/index" }, let menu = [{ text: "地址管理", icon: "icon-shoucang", url: "/pages/addressManager/index" }, { text: "码单管理", icon: "icon-shoucang", url: "/pages/weightList/index" },
{ text: "我的收藏", icon: "icon-shoucang" }, { text: "颜色对比", icon: "icon-yanseduibi" }, { text: "我的收藏", icon: "icon-shoucang" }, { text: "颜色对比", icon: "icon-yanseduibi" },
{ text: "分享推广", icon: "icon-fenxiang" }, { text: "团队邀请", icon: "icon-yaoqingtuandui" }] { text: "分享推广", icon: "icon-fenxiang" }, { text: "团队邀请", icon: "icon-yaoqingtuandui" }]
return ( return (
<View className={`${styles.crad} ${styles['card-main']} ${styles['card-feature']}`}> <View className={`${styles.crad} ${styles['card-main']} ${styles['card-feature']}`}>
<View className={styles['card-main-list-content']}> <View className={styles['card-main-list-content']}>

View File

@ -33,17 +33,17 @@ export default memo(forwardRef((props:any,ref)=>{
useImperativeHandle(ref, ()=>({setModalShow})) useImperativeHandle(ref, ()=>({setModalShow}))
return ( return (
<Popup onClose={()=>setModalShow(false)} title={title} show={modalShow}> <Popup onClose={()=>setModalShow(false)} title={title} show={modalShow}>
<View style={{marginBottom: `${textareaBottom}px`}} className="modify-ickname-content"> <View style={{marginBottom: `${textareaBottom}px`}} className="modify-ickname-content">
<View className="modify-ickname-input"> <View className="modify-ickname-input">
<Textarea showConfirmBar={false} auto-focus adjustPosition={false} value={value} onBlur={handleBlur} onFocus={handleFocus} onInput={handleTextareaInput} maxlength={20}/> <Textarea showConfirmBar={false} auto-focus adjustPosition={false} value={value} onBlur={handleBlur} onFocus={handleFocus} onInput={handleTextareaInput} maxlength={20}/>
<Text>{value?.length}/20</Text> <Text>{value?.length}/20</Text>
</View>
<Text className="modify-ickname-tips">2-20</Text>
<View className="modify-ickname-operation">
<Button onClick={handleTextareaReset} hoverClass="none" className="modify-ickname-operation-reset"></Button>
<Button onClick={()=>props.save(value)} hoverClass="none" className="modify-ickname-operation-save"></Button>
</View>
</View> </View>
</Popup> <Text className="modify-ickname-tips">2-20</Text>
<View className="modify-ickname-operation">
<Button onClick={handleTextareaReset} hoverClass="none" className="modify-ickname-operation-reset"></Button>
<Button onClick={()=>props.save(value)} hoverClass="none" className="modify-ickname-operation-save"></Button>
</View>
</View>
</Popup>
) )
})) }))

View File

@ -65,6 +65,10 @@
font-weight: 400; font-weight: 400;
color: #707070; color: #707070;
} }
.user-edit-content-company,.user-edit-content-company-adopt{
background: #CDF3DF;
color: #07C160;
}
.user-edit-content-company text{ .user-edit-content-company text{
margin-left: 5px; margin-left: 5px;
} }

View File

@ -13,105 +13,105 @@ import { useSelector } from "@/reducers/hooks";
import useUploadCDNImg from "@/use/useUploadImage"; import useUploadCDNImg from "@/use/useUploadImage";
import { IMG_CND_Prefix } from "@/common/constant"; import { IMG_CND_Prefix } from "@/common/constant";
export default ()=>{ export default () => {
const { getPhoneNumber, getAdminUserInfo } = useLogin(); const { getPhoneNumber, getAdminUserInfo } = useLogin();
const {adminUserInfo} = useSelector(state => state.userInfo); const { adminUserInfo } = useSelector(state => state.userInfo);
// 用户信息 // 用户信息
useEffect(()=>{ useEffect(() => {
setFormData({ setFormData({
...formData, ...formData,
...adminUserInfo as any, ...adminUserInfo as any,
}); });
}, [adminUserInfo]); }, [adminUserInfo]);
useEffect(()=>{ useEffect(() => {
setFormData({ setFormData({
...adminUserInfo as any, ...adminUserInfo as any,
company_type_index: 0 company_type_index: 0
}); });
getCompanyTypeData(); getCompanyTypeData();
},[]) }, [])
// 表单数据 // 表单数据
const [formData, setFormData] = useState({ const [formData, setFormData] = useState({
user_name: "麦兜" user_name: "麦兜"
}); });
// 昵称修改保存 // 昵称修改保存
const { fetchData: realNameUpdateFetch } = realNameUpdateApi(); const { fetchData: realNameUpdateFetch } = realNameUpdateApi();
const rules = { const rules = {
text: [{ text: [{
message: "请输入" message: "请输入"
}] }]
} }
const {fetchData: saveFetch} = companyUpdateApi(); const { fetchData: saveFetch } = companyUpdateApi();
const {fetchData: getCompanyFetch} = companyDetailApi(); const { fetchData: getCompanyFetch } = companyDetailApi();
const handleTextareaSave = async (text, type)=>{ const handleTextareaSave = async (text, type) => {
retrieval({text},rules).then(async ()=>{ retrieval({ text }, rules).then(async () => {
let result; let result;
if(type=="Ickname"){ if (type == "Ickname") {
result = await realNameUpdateFetch({real_name: text}); result = await realNameUpdateFetch({ real_name: text });
}else{ } else {
const params = await getCompanyFetch(); const params = await getCompanyFetch();
result = await saveFetch({ result = await saveFetch({
...params.data, ...params.data,
company_name: text company_name: text
}); });
} }
if(result.success){ if (result.success) {
getAdminUserInfo(); getAdminUserInfo();
(ModifyIcknameEl.current as any).setModalShow(false); (ModifyIcknameEl.current as any).setModalShow(false);
(ModifyCompanyNameEl.current as any).setModalShow(false) (ModifyCompanyNameEl.current as any).setModalShow(false)
alert.success("保存成功"); alert.success("保存成功");
}else{ } else {
alert.none(result.msg); alert.none(result.msg);
} }
}).catch(message=>{ }).catch(message => {
alert.none(message); alert.none(message);
}) })
} }
// Taro.eventCenter.on('message:detail', (message) => console.log(message)) // Taro.eventCenter.on('message:detail', (message) => console.log(message))
// 面面跳转 // 面面跳转
const onNavigate = (url:string)=>{ const onNavigate = (url: string) => {
goLink(url); goLink(url);
} }
// 肖像编辑 // 肖像编辑
const { fetchData: portraitUpdateFetch } = portraitUpdateApi(); const { fetchData: portraitUpdateFetch } = portraitUpdateApi();
const {getWxPhoto} = useUploadCDNImg(); const { getWxPhoto } = useUploadCDNImg();
const handleSelectRortrait = ()=>{ const handleSelectRortrait = () => {
Taro.showModal({ Taro.showModal({
title: "提示", title: "提示",
content: "是否确定更改头像?", content: "是否确定更改头像?",
showCancel: true, showCancel: true,
async success(ev){ async success(ev) {
if(ev.confirm){ if (ev.confirm) {
let result = await getWxPhoto('mall'); let result = await getWxPhoto('mall');
const portraitUpdateResult = await portraitUpdateFetch({ const portraitUpdateResult = await portraitUpdateFetch({
avatar_url: IMG_CND_Prefix+(result as any).url avatar_url: IMG_CND_Prefix + (result as any).url
}); });
if(portraitUpdateResult.success){ if (portraitUpdateResult.success) {
getAdminUserInfo(); getAdminUserInfo();
alert.success("保存成功"); alert.success("保存成功");
}else{ } else {
alert.none(portraitUpdateResult.msg); alert.none(portraitUpdateResult.msg);
} }
} }
} }
}) })
} }
const mGetPhoneNumber = (ev)=>{ const mGetPhoneNumber = (ev) => {
if(ev.detail?.code){ if (ev.detail?.code) {
getPhoneNumber(ev.detail.code); getPhoneNumber(ev.detail.code);
}else{ } else {
alert.none("绑定失败!"); alert.none("绑定失败!");
} }
} }
const ModifyIcknameEl = useRef(null); const ModifyIcknameEl = useRef(null);
const ModifyCompanyNameEl = useRef(null); const ModifyCompanyNameEl = useRef(null);
// 获取企业类型 // 获取企业类型
const { fetchData: companyTypeFetch, state: companyTypeData } = companyTypeApi(); const { fetchData: companyTypeFetch, state: companyTypeData } = companyTypeApi();
const getCompanyTypeData = async ()=>{ const getCompanyTypeData = async () => {
const reuslt = await companyTypeFetch(); const reuslt = await companyTypeFetch();
if(reuslt.success){ if (reuslt.success) {
reuslt.data?.list?.every((item,index)=>{ reuslt.data?.list?.every((item, index) => {
if(item.id==(adminUserInfo as any).purchaser_type){ if (item.id == (adminUserInfo as any).purchaser_type) {
setFormData({ setFormData({
...adminUserInfo as any, ...adminUserInfo as any,
company_type_index: index company_type_index: index
@ -123,19 +123,19 @@ export default ()=>{
} }
} }
// 修改企业类型 // 修改企业类型
const handleCompanyType = async (ev)=>{ const handleCompanyType = async (ev) => {
const {value} = ev.detail; const { value } = ev.detail;
const item = companyTypeData.data.list&&companyTypeData.data.list[value]; const item = companyTypeData.data.list && companyTypeData.data.list[value];
if(item){ if (item) {
const params = await getCompanyFetch(); const params = await getCompanyFetch();
const result = await saveFetch({ const result = await saveFetch({
...params.data, ...params.data,
purchaser_type: item.id purchaser_type: item.id
}); });
if(result.success){ if (result.success) {
getAdminUserInfo(); getAdminUserInfo();
alert.success("保存成功") alert.success("保存成功")
}else{ } else {
alert.none(result.msg); alert.none(result.msg);
} }
} }
@ -144,46 +144,46 @@ export default ()=>{
return ( return (
<View className="user-edit"> <View className="user-edit">
<View onClick={handleSelectRortrait} className="user-edit-portrait"> <View onClick={handleSelectRortrait} className="user-edit-portrait">
<Image src={(formData as any)?.avatar_url}/> <Image src={(formData as any)?.avatar_url} />
<View></View> <View></View>
</View> </View>
<View className="user-edit-content"> <View className="user-edit-content">
<View className="user-edit-content-title"><Text/> </View> <View className="user-edit-content-title"><Text /> </View>
<UserEditList onClick={()=>(ModifyIcknameEl.current as any).setModalShow(true)} data={(formData as any)?.user_name} label="昵称" placeholder="请输入" icon=""/> <UserEditList onClick={() => (ModifyIcknameEl.current as any).setModalShow(true)} data={(formData as any)?.user_name} label="昵称" placeholder="请输入" icon="" />
<UserEditList label="手机号" placeholder="去绑定" icon=""> <UserEditList label="手机号" placeholder="去绑定" icon="">
{((formData as any)?.phone)?<View className="user-edit-content-phone"> {((formData as any)?.phone) ? <View className="user-edit-content-phone">
<View>{(formData as any)?.phone}</View> <View>{(formData as any)?.phone}</View>
<Text></Text> <Text></Text>
</View>: </View> :
<Button className="user-edit-content-bindphone" openType="getPhoneNumber" onGetPhoneNumber={mGetPhoneNumber}></Button> <Button className="user-edit-content-bindphone" openType="getPhoneNumber" onGetPhoneNumber={mGetPhoneNumber}></Button>
} }
</UserEditList> </UserEditList>
</View> </View>
<View className="user-edit-content"> <View className="user-edit-content">
<View className="user-edit-content-title"><Text/> </View> <View className="user-edit-content-title"><Text /> </View>
<UserEditList onClick={()=>(ModifyCompanyNameEl.current as any).setModalShow(true)} data={(formData as any)?.company_name} label="名称" placeholder="待绑定" icon=""/> <UserEditList onClick={() => (ModifyCompanyNameEl.current as any).setModalShow(true)} data={(formData as any)?.company_name} label="名称" placeholder="待绑定" icon="" />
<UserEditList label="类型" placeholder="完善公司/组织信息" icon=""> <UserEditList label="类型" placeholder="完善公司/组织信息" icon="">
<Picker mode="selector" range={(companyTypeData.data as any).list as any} rangeKey="name" value={(formData as any)?.company_type_index} onChange={handleCompanyType}> <Picker mode="selector" range={(companyTypeData.data as any).list as any} rangeKey="name" value={(formData as any)?.company_type_index} onChange={handleCompanyType}>
{(companyTypeData.data as any).list&&(companyTypeData.data as any).list[(formData as any)?.company_type_index].name} {(companyTypeData.data as any).list && (companyTypeData.data as any).list[(formData as any)?.company_type_index].name}
</Picker> </Picker>
</UserEditList> </UserEditList>
<UserEditList onClick={()=>onNavigate("/pages/certification/index")} label="我的认证" placeholder="待绑定" icon=""> <UserEditList onClick={() => onNavigate("/pages/certification/index")} label="我的认证" placeholder="待绑定" icon="">
<View className="user-edit-content-company"> <View className={`user-edit-content-company ${(formData as any)?.authentication_status == 4 && "user-edit-content-company-adopt"}`}>
<Text className="iconfont "/> <Text className="iconfont " /> {(formData as any)?.authentication_status == 4 ? "已认证" : "未认证"}
</View> </View>
</UserEditList> </UserEditList>
<UserEditList label="创建人" data={(formData as any)?.founder_user_name} placeholder="完善公司/组织信息" icon=""/> <UserEditList label="创建人" data={(formData as any)?.founder_user_name} placeholder="完善公司/组织信息" icon="" useIcon="true" />
</View> </View>
<Button hoverClass="none" className="user-edit-logout">退</Button> {/* <Button hoverClass="none" className="user-edit-logout">退出当前账号</Button> */}
<ModifyModal title="修改昵称" ref={ModifyIcknameEl} value={(formData as any)?.user_name} save={(value)=>handleTextareaSave(value, "Ickname")}/> <ModifyModal title="修改昵称" ref={ModifyIcknameEl} value={(formData as any)?.user_name} save={(value) => handleTextareaSave(value, "Ickname")} />
<ModifyModal title="修改名称" ref={ModifyCompanyNameEl} value={(formData as any)?.company_name} save={(value)=>handleTextareaSave(value, "companyName")}/> <ModifyModal title="修改名称" ref={ModifyCompanyNameEl} value={(formData as any)?.company_name} save={(value) => handleTextareaSave(value, "companyName")} />
</View> </View>
) )
} }
// 列表 // 列表
const UserEditList = memo((props:any)=>{ const UserEditList = memo((props: any) => {
return ( return (
<View onClick={props.onClick} className="user-edit-list"> <View onClick={props.onClick} className="user-edit-list">
<View className="user-edit-list-left"> <View className="user-edit-list-left">
@ -192,12 +192,15 @@ const UserEditList = memo((props:any)=>{
<View className="user-edit-list-right"> <View className="user-edit-list-right">
<View> <View>
{ {
props.children?props.children: props.children ? props.children :
props.data?props.data: props.data ? props.data :
<View className="user-edit-list-right-placeholder">{props.placeholder}</View> <View className="user-edit-list-right-placeholder">{props.placeholder}</View>
} }
</View> </View>
<Text className="iconfont icon-a-moreback"></Text> {
!props.useIcon &&
<Text className="iconfont icon-a-moreback"></Text>
}
</View> </View>
</View> </View>
) )

View File

@ -41,6 +41,7 @@ export type UserAdminParam = {
is_authorize_name?: false|true, is_authorize_name?: false|true,
is_authorize_phone?: false|true, is_authorize_phone?: false|true,
phone?:string, phone?:string,
authentication_status?:number
} }
export type SortCodeParam = { export type SortCodeParam = {

View File

@ -1231,6 +1231,29 @@
"schema-utils" "^2.6.5" "schema-utils" "^2.6.5"
"source-map" "^0.7.3" "source-map" "^0.7.3"
"@prefresh/babel-plugin@^0.4.0":
"integrity" "sha512-fYAWbU1WDSLn108kKY4eDaaeUcnszFqXjgaGKYXNZ5NLulpRTpsrY+Sbfo9q8LDpWrBpqIgzjrwNnvglWI1xNQ=="
"resolved" "https://registry.npmmirror.com/@prefresh/babel-plugin/-/babel-plugin-0.4.3.tgz"
"version" "0.4.3"
"@prefresh/core@^1.3.3":
"integrity" "sha512-s7iNsnyJ3lZEUrYIgmVIB/hKtp4U6mdD91a31Zg7Q8M49O0x2KThrbrMQYraoDDrs4STdFB8Zv6bceUguOoX1A=="
"resolved" "https://registry.npmmirror.com/@prefresh/core/-/core-1.3.4.tgz"
"version" "1.3.4"
"@prefresh/utils@^1.1.2":
"integrity" "sha512-Mb9abhJTOV4yCfkXrMrcgFiFT7MfNOw8sDa+XyZBdq/Ai2p4Zyxqsb3EgHLOEdHpMj6J9aiZ54W8H6FTam1u+A=="
"resolved" "https://registry.npmmirror.com/@prefresh/utils/-/utils-1.1.3.tgz"
"version" "1.1.3"
"@prefresh/webpack@^3.2.3":
"integrity" "sha512-uT+A7ZuA7fuuUPNEde6Gmzr4oFnzreW9xw6iqw01nPpDiv46o6YWq1j0oGCbdffzHl3fBpcgkPuY07vIfmZ9Lg=="
"resolved" "https://registry.npmmirror.com/@prefresh/webpack/-/webpack-3.3.3.tgz"
"version" "3.3.3"
dependencies:
"@prefresh/core" "^1.3.3"
"@prefresh/utils" "^1.1.2"
"@stencil/core@2.4.0": "@stencil/core@2.4.0":
"integrity" "sha512-gU6+Yyd6O0KrCSS/O6j8KKqmRo+/Dcs2fI0+APCpbAWK+nqhwDISpdnSEfGDCLMoAC08XOZCycBRk2K1VGnEcg==" "integrity" "sha512-gU6+Yyd6O0KrCSS/O6j8KKqmRo+/Dcs2fI0+APCpbAWK+nqhwDISpdnSEfGDCLMoAC08XOZCycBRk2K1VGnEcg=="
"resolved" "https://registry.npmjs.org/@stencil/core/-/core-2.4.0.tgz" "resolved" "https://registry.npmjs.org/@stencil/core/-/core-2.4.0.tgz"
@ -1345,6 +1368,18 @@
"webpack-format-messages" "^2.0.5" "webpack-format-messages" "^2.0.5"
"yauzl" "2.10.0" "yauzl" "2.10.0"
"@tarojs/plugin-framework-react@^3.4.12":
"integrity" "sha512-kc03rvuotgQ2q7gYM9rjy7IV1tjT4ZcbdfdVs2e7olpdXcY9d4x1OqF3vYy+FT/f6WXgf/xs7cBa8Btw3J44iQ=="
"resolved" "https://registry.npmmirror.com/@tarojs/plugin-framework-react/-/plugin-framework-react-3.4.12.tgz"
"version" "3.4.12"
dependencies:
"@pmmmwh/react-refresh-webpack-plugin" "0.4.3"
"@prefresh/webpack" "^3.2.3"
"@tarojs/runtime" "3.4.12"
"@tarojs/shared" "3.4.12"
"acorn" "^8.0.4"
"acorn-walk" "^8.0.0"
"@tarojs/plugin-platform-alipay@3.3.10": "@tarojs/plugin-platform-alipay@3.3.10":
"integrity" "sha512-hbsCk++etkRsi/IQNEIY4R94dwqtTSVB/1sBfgbtuzVe0fOSbrlfwFwzJOrE131CnAXmI9sWiCF/MTy0qCKWjA==" "integrity" "sha512-hbsCk++etkRsi/IQNEIY4R94dwqtTSVB/1sBfgbtuzVe0fOSbrlfwFwzJOrE131CnAXmI9sWiCF/MTy0qCKWjA=="
"resolved" "https://registry.npmjs.org/@tarojs/plugin-platform-alipay/-/plugin-platform-alipay-3.3.10.tgz" "resolved" "https://registry.npmjs.org/@tarojs/plugin-platform-alipay/-/plugin-platform-alipay-3.3.10.tgz"
@ -1436,6 +1471,16 @@
"lodash-es" "4.17.15" "lodash-es" "4.17.15"
"reflect-metadata" "^0.1.13" "reflect-metadata" "^0.1.13"
"@tarojs/runtime@3.4.12":
"integrity" "sha512-4bQIXoiMRQa0xzma4nm4MAmLpPtcZLOalmW/X8WtPjAVqENZ8o3FE2lZMHjhv62HhvyHf+XZWWk/V+VzAhjcGQ=="
"resolved" "https://registry.npmmirror.com/@tarojs/runtime/-/runtime-3.4.12.tgz"
"version" "3.4.12"
dependencies:
"@tarojs/shared" "3.4.12"
"inversify" "5.1.1"
"lodash-es" "4.17.15"
"reflect-metadata" "^0.1.13"
"@tarojs/service@3.3.10": "@tarojs/service@3.3.10":
"integrity" "sha512-r2vcLDFfovVv2kJ1RMPGoH7pgk8kNFMCTDgoWXbZxpddmpbO7Q1QYVP3EDNykgidnMVfw2cKnEkQdyTSsh+lbA==" "integrity" "sha512-r2vcLDFfovVv2kJ1RMPGoH7pgk8kNFMCTDgoWXbZxpddmpbO7Q1QYVP3EDNykgidnMVfw2cKnEkQdyTSsh+lbA=="
"resolved" "https://registry.npmjs.org/@tarojs/service/-/service-3.3.10.tgz" "resolved" "https://registry.npmjs.org/@tarojs/service/-/service-3.3.10.tgz"
@ -1455,6 +1500,11 @@
"resolved" "https://registry.npmjs.org/@tarojs/shared/-/shared-3.3.10.tgz" "resolved" "https://registry.npmjs.org/@tarojs/shared/-/shared-3.3.10.tgz"
"version" "3.3.10" "version" "3.3.10"
"@tarojs/shared@3.4.12":
"integrity" "sha512-ELpEOA7Uzr5rQujfSmVS+ugTO22ZP8j3vi2AfrwJKg7zit1kZcBnDUIsN6+3Es3Vnp1oXsyQobWrgn30xYt2Ug=="
"resolved" "https://registry.npmmirror.com/@tarojs/shared/-/shared-3.4.12.tgz"
"version" "3.4.12"
"@tarojs/taro-h5@3.3.10": "@tarojs/taro-h5@3.3.10":
"integrity" "sha512-hBVr0Ee7rGTD+cuK5ugPUHwbD0L9qOwMKHqMyUzqAb8LS6aYF3aIFDwVbCYx77ZgtpGZFUqXnpDCvnHofWVyTg==" "integrity" "sha512-hBVr0Ee7rGTD+cuK5ugPUHwbD0L9qOwMKHqMyUzqAb8LS6aYF3aIFDwVbCYx77ZgtpGZFUqXnpDCvnHofWVyTg=="
"resolved" "https://registry.npmjs.org/@tarojs/taro-h5/-/taro-h5-3.3.10.tgz" "resolved" "https://registry.npmjs.org/@tarojs/taro-h5/-/taro-h5-3.3.10.tgz"
@ -2030,9 +2080,9 @@
"version" "6.4.2" "version" "6.4.2"
"acorn@^8.0.4": "acorn@^8.0.4":
"integrity" "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" "integrity" "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A=="
"resolved" "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz" "resolved" "https://registry.npmmirror.com/acorn/-/acorn-8.7.1.tgz"
"version" "8.7.0" "version" "8.7.1"
"acorn@^8.7.0": "acorn@^8.7.0":
"integrity" "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" "integrity" "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ=="
@ -3757,7 +3807,7 @@
"dayjs@^1.11.3": "dayjs@^1.11.3":
"integrity" "sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==" "integrity" "sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A=="
"resolved" "https://registry.npmjs.org/dayjs/-/dayjs-1.11.3.tgz" "resolved" "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.3.tgz"
"version" "1.11.3" "version" "1.11.3"
"debug@^2.2.0", "debug@^2.3.3", "debug@^2.6.0", "debug@^2.6.9", "debug@2.6.9": "debug@^2.2.0", "debug@^2.3.3", "debug@^2.6.0", "debug@^2.6.9", "debug@2.6.9":
@ -8229,6 +8279,11 @@
"source-map" "^0.6.1" "source-map" "^0.6.1"
"supports-color" "^6.1.0" "supports-color" "^6.1.0"
"preact@^10.0.0", "preact@^10.4.0":
"integrity" "sha512-AKGt0BsDSiAYzVS78jZ9qRwuorY2CoSZtf1iOC6gLb/3QyZt+fLT09aYJBjRc/BEcRc4j+j3ggERMdNE43i1LQ=="
"resolved" "https://registry.npmmirror.com/preact/-/preact-10.8.2.tgz"
"version" "10.8.2"
"prelude-ls@~1.1.2": "prelude-ls@~1.1.2":
"integrity" "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" "integrity" "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
"resolved" "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" "resolved" "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz"