Merge branch 'dev' of ssh://git.online.zzfzyc.com:10022/mp/EShop into dev

This commit is contained in:
czm 2022-06-28 10:03:19 +08:00
commit 523946db67
13 changed files with 1518 additions and 1606 deletions

1978
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -1,13 +1,47 @@
{
"miniprogramRoot": "./dist",
"miniprogramRoot": "dist/",
"projectname": "EShop",
"description": "电子商城",
"description": "项目配置文件详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"appid": "wx68d92d7cbf0b6963",
"setting": {
"urlCheck": true,
"es6": 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
}
}

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

@ -5,12 +5,12 @@
// export const BASE_URL = `http://192.168.0.89: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 = `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.30:40001/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://www.zzfzyc.com/lymarket` // 正式环境
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
// export const BASE_URL = `http://192.168.1.224:50002/lymarket` // 添
export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
// export const BASE_URL = `http://192.168.1.15:50001/lymarket` // 杰
// CDN

View File

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

View File

@ -2,7 +2,7 @@
import FromListCertification from "@/components/FromListCertification"
import { Button, Image, Input, NavigationBar, Navigator, Text, Textarea, View } from "@tarojs/components"
import Taro, { setNavigationBarTitle, useRouter } from "@tarojs/taro"
import {certificationSaveApi, certificationDetailApi} from "@/api/certification"
import { certificationSaveApi, certificationDetailApi } from "@/api/certification"
import { useEffect, useRef, useState } from "react"
import { alert, retrieval } from "@/common/common"
import "./index.scss"
@ -13,19 +13,19 @@ import SelectEnterpriseType from "./components/SelectEnterpriseType"
import { useSelector } from "@/reducers/hooks";
import useLogin from "@/use/useLogin";
export default ()=>{
export default () => {
const { getAdminUserInfo } = useLogin();
const {adminUserInfo} = useSelector(state => state.userInfo);
useEffect(()=>{
const { adminUserInfo } = useSelector(state => state.userInfo);
useEffect(() => {
initalFormData();
},[]);
}, []);
// 获取认证信息
const {fetchData: getFromData} = certificationDetailApi()
const initalFormData = async ()=>{
const { fetchData: getFromData } = certificationDetailApi()
const initalFormData = async () => {
const detail = await getFromData();
setFormData({
...detail.data??{},
legal_person_identity_url: detail?.data?.legal_person_identity_url??[],
...detail.data ?? {},
legal_person_identity_url: detail?.data?.legal_person_identity_url ?? [],
// business_license_url: "https://test.cdn.zzfzyc.com/mall/827082e888860dd9da10f0fbb0ac3cf023081456.png"
} as any)
}
@ -36,6 +36,7 @@ export default ()=>{
business_license_url: "",
legal_person: "",
legal_person_identity: "",
businessLicense: '',
legal_person_identity_url: [],
name: ""
});
@ -54,48 +55,48 @@ export default ()=>{
}],
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]$/
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]){
validator: (value: any, rule: any) => {
if (!value[0] || !value[1]) {
return true;
}
return false;
}
}],
}
const {fetchData} = certificationSaveApi()
const handleSave = ()=>{
retrieval(formData, rules).then(async ()=>{
const result = await fetchData({...formData, authentication_type: 2})
if(result.success){
const { fetchData } = certificationSaveApi()
const handleSave = () => {
retrieval(formData, rules).then(async () => {
const result = await fetchData({ ...formData, authentication_type: 2 })
if (result.success) {
// Taro.eventCenter.trigger("weightList:refresh");
getAdminUserInfo();
Taro.navigateBack();
alert.success("保存成功");
}else{
} else {
alert.error(result.msg);
}
}).catch((message)=>{
}).catch((message) => {
alert.none(message)
})
}
// 监听表单完善
const [hozon, setHozon] = useState(false);
useEffect(()=>{
if(retrieval){
retrieval(formData).then(()=>setHozon(true)).catch(()=>setHozon(false))
useEffect(() => {
if (retrieval) {
retrieval(formData).then(() => setHozon(true)).catch(() => setHozon(false))
}
},[formData])
}, [formData])
// 选择类型弹窗显示
const selectTypeRef= useRef(null)
const handleSelectTypeModalShow = ()=>{
const selectTypeRef = useRef(null)
const handleSelectTypeModalShow = () => {
(selectTypeRef.current as any).setShow(true)
}
// 选择类型确定
const handleSelectTypeConfirm = (item)=>{
const handleSelectTypeConfirm = (item) => {
setFormData({
...formData,
authentication_type: item.id,
@ -103,18 +104,18 @@ export default ()=>{
});
}
// 上传图片
const {getWxPhoto} = useUploadCDNImg();
const handleUploadImage = async (text: any)=>{
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;
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});
setFormData({ ...formData });
}
// 查看图片
const handleViewImage = (event,url)=>{
const handleViewImage = (event, url) => {
event.stopPropagation();
Taro.previewImage({
current: url,
@ -124,71 +125,72 @@ export default ()=>{
return (
<View className="certification">
{(adminUserInfo as any)?.authentication_status==3&&<Message text={`认证不通过,原因:${(formData as any).authentication_feedback},请重新认证`}/>}
{(adminUserInfo as any)?.authentication_status == 3 && <Message text={`认证不通过,原因:${(formData as any).authentication_feedback},请重新认证`} />}
<View className="certification-content">
<View className="certification-title"></View>
{/* <FromListCertification type="select" onClick={handleSelectTypeModalShow} value={(formData as any)?.authentication_type_name} label="认证类型" placeholder="企业认证"/> */}
<SelectEnterpriseType ref={selectTypeRef} confirm={handleSelectTypeConfirm} />
<FromListCertification onInput={(ev:any)=>setFormData({...formData,name:ev.detail.value})} value={formData["name"]} label="企业名称" placeholder="请输入营业执照上的企业名称" required/>
<FromListCertification type="select" style={{border: "0"}}label="企业营业执照" placeholder="注册号、统一社会信用代码、组织机构代码" required showIcon={false}/>
<View onClick={()=>handleUploadImage("business_license_url")} className="certification-upload">
{(formData as any)?.business_license_url?
<>
<Text></Text>
<View className="certification-button">
<View onClick={(e)=>handleViewImage(e,(formData as any)?.business_license_url)}></View>
<View></View>
<FromListCertification onInput={(ev: any) => setFormData({ ...formData, name: ev.detail.value })} value={formData["name"]} label="企业名称" placeholder="请输入营业执照上的企业名称" required />
{/* <FromListCertification type="select" style={{border: "0"}}label="企业营业执照" placeholder="注册号、统一社会信用代码、组织机构代码" required showIcon={false}/> */}
<FromListCertification onInput={(ev: any) => setFormData({ ...formData, businessLicense: ev.detail.value })} value={formData["businessLicense"]} style={{ border: "0" }} label="企业营业执照" placeholder="注册号、统一社会信用代码、组织机构代码" required />
<View onClick={() => handleUploadImage("business_license_url")} className="certification-upload">
{(formData as any)?.business_license_url ?
<>
<Text></Text>
<View className="certification-button">
<View onClick={(e) => handleViewImage(e, (formData as any)?.business_license_url)}></View>
<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>
<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 className="certification-content">
<View className="certification-title"></View>
<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,legal_person_identity:ev.detail.value})} value={formData["legal_person_identity"]} label="法人身份" placeholder="填写法人代表身份证号" required/>
<View onClick={()=>handleUploadImage(0)} className="certification-upload">
{(formData as any)?.legal_person_identity_url[0]?
<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, legal_person_identity: ev.detail.value })} value={formData["legal_person_identity"]} label="法人身份" placeholder="填写法人代表身份证号" required />
<View onClick={() => handleUploadImage(0)} className="certification-upload">
{(formData as any)?.legal_person_identity_url[0] ?
<>
<Text></Text>
<View className="certification-button">
<View onClick={(e)=>handleViewImage(e,(formData as any)?.legal_person_identity_url[0])}></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]}/>
</>:
<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 onClick={()=>handleUploadImage(1)} className="certification-upload">
{(formData as any)?.legal_person_identity_url[1]?
<>
<Text></Text>
<View className="certification-button">
<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 onClick={() => handleUploadImage(1)} className="certification-upload">
{(formData as any)?.legal_person_identity_url[1] ?
<>
<Text></Text>
<View className="certification-button">
<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 className="certification-footer">
<View className="certification-footer-button">
<Navigator openType="navigateBack"></Navigator>
<View onClick={handleSave}>{[3,4].includes((adminUserInfo as any)?.authentication_status)?"重新认证":"提交"}</View>
<View onClick={handleSave}>{[3, 4].includes((adminUserInfo as any)?.authentication_status) ? "重新认证" : "提交"}</View>
</View>
</View>
</View>

View File

@ -1,4 +1,4 @@
import {View} from '@tarojs/components'
import { View } from '@tarojs/components'
import Banner from '@/components/banner'
import Search from '@/components/search'
import SideBar from '@/components/sideBar'
@ -6,16 +6,17 @@ import Product from '@/components/product'
import MoveBtn from '@/components/moveBtn'
import ShopCart from '@/components/shopCart'
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 Taro, { Events, useDidShow, usePullDownRefresh} from '@tarojs/taro'
import {GetProductKindListApi, GetProductListApi} from '@/api/material'
import { useSelector } from "@/reducers/hooks";
import Taro, { Events, useDidShow, usePullDownRefresh } from '@tarojs/taro'
import { GetProductKindListApi, GetProductListApi } from '@/api/material'
import useLogin from '@/use/useLogin'
import { dataLoadingStatus } from '@/common/util'
export default () => {
const {checkLogin} = useLogin()
const { checkLogin } = useLogin()
useDidShow(async () => {
await checkLogin()
})
@ -25,32 +26,33 @@ export default () => {
}, [])
//获取面料种类
const [kindData, setKindData] = useState<any>({list:[], defaultId:0})
const {fetchData} = GetProductKindListApi()
const [kindData, setKindData] = useState<any>({ list: [], defaultId: 0 })
const { fetchData } = GetProductKindListApi()
const categoryList = async () => {
const res = await fetchData()
if(res.data?.list) {
setKindData({...kindData, list:res.data.list, defaultId: res.data.list[0].id})
setFiltrate({...filtrate, product_kind_id:res.data.list[0].id})
if (res.data?.list) {
setKindData({ ...kindData, list: res.data.list, defaultId: 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 [filtrate, setFiltrate] = useState({product_kind_id:0, size: 5,page: 1})
const pageNum = useRef({size:filtrate.size, page:filtrate.page})
const {fetchData: productFetchData, state: productState} = GetProductListApi()
const [filtrate, setFiltrate] = useState({ product_kind_id: 0, size: 5, page: 1 })
const pageNum = useRef({ size: filtrate.size, page: filtrate.page })
const { fetchData: productFetchData, state: productState } = GetProductListApi()
//获取数据方法
const getProductList = async () => {
const {data,total} = await productFetchData(filtrate)
setProductData({...productData,list:data.list,total})
const { data, total } = await productFetchData(filtrate)
setProductData({ ...productData, list: data.list, total })
setRefresherTriggeredStatus(() => false)
}
//监听查询条件
useEffect(() => {
if(filtrate.product_kind_id)
if (filtrate.product_kind_id)
getProductList()
}, [filtrate])
@ -58,30 +60,30 @@ export default () => {
//点击面料类型
const getProductKindId = useCallback((e) => {
pageNum.current.page = 1
setProductData({list:[], total:0})
setFiltrate((list) => ({...list, size:5, product_kind_id:e.id}))
setProductData({ list: [], total: 0 })
setFiltrate((list) => ({ ...list, size: 5, product_kind_id: e.id }))
// setHasMore(true)
}, [])
//上拉加载数据
const getScrolltolower = useCallback(() => {
if(productData.list.length >= productData.total) {
if (productData.list.length >= productData.total) {
setHasMore(false)
} else {
pageNum.current.page++
const newSize = pageNum.current.size * pageNum.current.page
setFiltrate((e) => ({...e, size:newSize}))
setFiltrate((e) => ({ ...e, size: newSize }))
}
}, [productData])
const [showShopCart, setShowShopCart] = useState(false)
//列表下拉刷新
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
const getRefresherRefresh = async () => {
pageNum.current.page = 1
setFiltrate({...filtrate, size:5})
setFiltrate({ ...filtrate, size: 5 })
setHasMore(true)
setRefresherTriggeredStatus(true)
}
@ -95,26 +97,85 @@ export default () => {
//数据加载状态
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])
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 (
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}>
<MoveBtn onClick={() => checkShow()}>
<View className={styles.main}>
<Banner/>
<Banner />
<View className={styles.search}>
<View className={styles.search_collect}></View>
<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 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()}>
<Product productList={productData.list}/>
</SideBar>
<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} />
</SideBar>
</View>
<View className='common_safe_area_y'></View>
<ShopCart show={showShopCart} onClose={() => setShowShopCart(false)}/>
<ShopCart show={showShopCart} onClose={() => setShowShopCart(false)} />
</View>
</MoveBtn>
)

View File

@ -1,73 +1,94 @@
.main{
.main {
background-color: #F8F8F8;
min-height: 100vh;
display: flex;
flex-direction: column;
position: relative;
.header{
.header {
background: #68b4ff;
background-size: cover;
height: 560px;
position: relative;
.card-main{
.card-main {
margin-top: 10px;
}
}
.auth-suspension{
.auth-suspension {
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%);
}
.crad{
width: 702px;
background: rgba(255,255,255,0.95);
border-radius: 20px;
padding: 30px;
box-sizing: border-box;
box-shadow: 0px 6px 12px 0px rgba(0,0,0,0.05);
.crad {
width: 702px;
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
padding: 30px;
box-sizing: border-box;
box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.05);
}
.card-info{
display: flex;justify-content: space-between;
position: absolute;top: -15%;left: 0;right: 0;
width: 702px;
padding: 0 30px;
box-sizing: border-box;
.card-info {
display: flex;
justify-content: space-between;
position: absolute;
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;
height: 170px;
background: rgba(0,0,0,0.00);
border: 4px solid #ffffff;
border-radius: 50%;
overflow: hidden;
.arcd-info-left-portrait {
width: 170px;
height: 170px;
background: rgba(0, 0, 0, 0.00);
border: 4px solid #ffffff;
border-radius: 50%;
overflow: hidden;
}
.arcd-info-left-portrait image{
width: 100%;
height: 100%;
object-fit: cover;
.arcd-info-left-portrait image {
width: 100%;
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;
font-weight: 700;
color: #000000;
display: flex;
align-items: center;
.arcd-info-left-nickname {
font-size: 44px;
font-weight: 700;
color: #000000;
display: flex;
align-items: center;
}
.arcd-info-left-phone{
.arcd-info-left-phone {
font-size: 24px;
font-weight: 400;
color: #707070;
}
.arcd-info-left-phone button{
.arcd-info-left-phone button {
padding: 0 10px;
height: 42px;
background: #ffffff;
@ -76,39 +97,50 @@
font-size: 22px;
font-weight: 400;
color: #007aff;
display: flex;align-items: center;justify-content: center;
display: flex;
align-items: center;
justify-content: center;
}
.card-info-right{
font-size: 26px;
display: flex;align-items: flex-end;
.card-info-right {
font-size: 26px;
display: flex;
align-items: flex-end;
}
.setup-icon{
.setup-icon {
position: relative;
padding-bottom: 10px;
}
.icon-wrapper{
.icon-wrapper {
font-size: 60px;
}
.icon-point{
.icon-point {
width: 8px;
height: 8px;
border-radius: 50%;
background: #ff0000;
position: absolute;
right: 0;top: 0;
right: 0;
top: 0;
}
.card-main{
.card-main {
margin: 20px auto 0;
}
.card-main-title{
display: flex;justify-content: space-between;
align-items: center;
border-bottom: 2px solid #dddddd;
padding: 0 5px 15px;
box-sizing: border-box;
.card-main-title {
display: flex;
justify-content: space-between;
align-items: center;
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-weight: 400;
color: #ababab;
@ -116,23 +148,27 @@
text-align: right;
width: 150px;
}
.card-main-title-content{
display: grid;
grid-template-columns: repeat(5,1fr);
.card-main-title-content {
display: grid;
grid-template-columns: repeat(5, 1fr);
}
.card-main-title-content-item{
font-size: 24px;
font-weight: 400;
color: #3c3c3c;
text-align: center;
margin-top: 30px;
position: relative;
.card-main-title-content-item {
font-size: 24px;
font-weight: 400;
color: #3c3c3c;
text-align: center;
margin-top: 30px;
position: relative;
}
.card-main-title-content-item Text{
.card-main-title-content-item Text {
font-size: 56px;
color: #3C3C3C;
}
.card-main-title-content-item-badge{
.card-main-title-content-item-badge {
padding: 0 10px;
height: 32px;
background: #007aff;
@ -143,106 +179,140 @@
font-size: 18px;
font-weight: 700;
color: #ffffff;
display: flex;align-items: center;justify-content: center;
position: absolute;top: -10px;right: 0;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: -10px;
right: 0;
}
.assets-title{
.assets-title {
font-size: 28px;
font-weight: 700;
color: #3c3c3c;
margin-bottom: 20px;
}
.assets-content{
.assets-content {
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;
}
.assets-content-item-top{
.assets-content-item-top {
color: #007aff;
font-weight: 400;
}
.assets-content-item-top-before{
.assets-content-item-top-before {
font-size: 20px;
}
.assets-content-item-top-content{
.assets-content-item-top-content {
font-size: 36px;
}
.assets-content-item-top-after{
.assets-content-item-top-after {
font-size: 20px;
}
.assets-content-item-tips{
.assets-content-item-tips {
font-size: 24px;
font-weight: 400;
color: #707070;
}
.main-card{
.main-card {
margin: 131px auto 0;
}
.card-feature{
.card-feature {
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;
height: 90px;
}
.card-main-list-content-item-left{
.card-main-list-content-item-left {
font-size: 26px;
font-weight: 400;
text-align: left;
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;
font-size: 56px;
color: #707070;
}
.card-main-list-content-item-right text{
.card-main-list-content-item-right text {
font-size: 30px;
}
.auth{
.auth {
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;
height: 30px;
background: #dddddd;
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-weight: 400;
color: #707070;
}
.auth-status,.auth-status-ongoing{
.auth-status,
.auth-status-ongoing {
color: #EE7500;
background-color: #FFE6CE;
}
.auth-status,.auth-status-adopt{
.auth-status,
.auth-status-adopt {
color: #007AFF;
background-color: #CDE5FF;
}
.auth-tips{
.auth-tips {
font-size: 18px;
font-weight: 400;
color: #007aff;
text-align: right;
}
.auth-tips,.auth-tips-adopt{
.auth-tips,
.auth-tips-adopt {
color: #ABABAB;
}
.auth-tips text{
.auth-tips text {
font-size: 17px;
}
.auth-company{
.auth-company {
height: 70px;
width: 100%;
background: #f6f6f6;
@ -251,35 +321,46 @@
font-size: 26px;
font-weight: 700;
color: #707070;
display: flex;align-items: center;justify-content: center;
display: flex;
align-items: center;
justify-content: center;
}
.auth-company,.auth-company-adopt{
.auth-company,
.auth-company-adopt {
background: #ecf5ff;
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;
.tips-modal {
background: rgba(0, 0, 0, 0.6);
position: fixed;
inset: 0;
display: flex;
justify-content: center;
align-items: center;
z-index: 2;
}
.tips-modal-content{
.tips-modal-content {
width: 598px;
background: #ffffff;
border-radius: 10px;
animation: enlargeK 0.2s linear;
overflow: hidden;
}
@keyframes enlargeK {
0%{
0% {
transform: scale(0);
}
100%{
100% {
transform: scale(1);
}
}
.tips-modal-title{
.tips-modal-title {
font-size: 32px;
font-weight: 700;
text-align: center;
@ -287,53 +368,166 @@
margin-bottom: 58px;
padding-top: 48px;
}
.tips-modal-letter{
.tips-modal-letter {
font-size: 26px;
font-weight: 400;
color: #707070;
padding: 0 30px;
line-height: 50px;
}
.tips-modal-letter-text{
.tips-modal-letter-text {
text-indent: 60px;
}
.tips-modal-letter-beginn{
.tips-modal-letter-beginn {
font-size: 28px;
font-weight: 400;
color: #000000;
margin-bottom: 25px;
}
.tips-modal-letter-end{
.tips-modal-letter-end {
font-size: 26px;
font-weight: 400;
text-align: right;
margin-top: 61px;
}
.tips-modal-button{
.tips-modal-button {
display: flex;
border-top: 1px solid #DDDDDD;
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%;
height: 90px;
background-color: white;
}
.tips-modal-button button{
.tips-modal-button button {
font-size: 26px;
font-weight: 400;
color: #707070;
border-radius: 0;
border-right: 1px solid #DDDDDD;
}
.tips-modal-button button::after{
.tips-modal-button button::after {
border: 0;
border-radius: 0;
}
.tips-modal-button view{
.tips-modal-button view {
font-size: 26px;
font-weight: 400;
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 { alert, goLink } from "@/common/common";
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 () => {
// 用户信息
const { getSelfUserInfo } = useLogin();
const {adminUserInfo} = useSelector(state => state.userInfo);
useEffect(()=>{
getSelfUserInfo().then().catch(()=>{
const { adminUserInfo } = useSelector(state => state.userInfo);
useEffect(() => {
getSelfUserInfo().then().catch(() => {
alert.none("授权失败,请授权后再使用");
});
},[]);
const handleAuth = async ()=>{
getSelfUserInfo().then().catch(()=>{
}, []);
const handleAuth = async () => {
getSelfUserInfo().then().catch(() => {
alert.none("授权失败,请授权后再使用");
});
}
const { fetchData, state } = userassets()
useEffect(() => {
fetchData();
}, [])
return (
<View className={styles.main}>
<Header data={adminUserInfo} />
<Assets />
<Assets data={state} />
<Main />
{(adminUserInfo as any)?.authentication_status==1&&<Modal data={adminUserInfo}/>}
{/* {(adminUserInfo as any)?.authentication_status==1&&<Modal data={adminUserInfo}/>} */}
{/* 测试暂时添加 */}
<View style={{fontSize:'26rpx', textAlign:'center'}}>{BASE_URL}</View>
{!adminUserInfo.is_authorize_name&&<View onClick={handleAuth} className={styles["auth-suspension"]}></View>}
<View style={{ fontSize: '26rpx', textAlign: 'center' }}>{BASE_URL}</View>
{!adminUserInfo.is_authorize_name && <View onClick={handleAuth} className={styles["auth-suspension"]}></View>}
</View>
)
}
// 提示弹窗
const Modal = memo((props:any)=>{
const {data} = props;
const [modalShow, setModalShow]=useState(true);
const handleouter = ()=>{
const Modal = memo((props: any) => {
const { data } = props;
const [modalShow, setModalShow] = useState(true);
const handleouter = () => {
}
return(
return (
<>
{modalShow&&
<View onClick={handleouter} catchMove className={styles['tips-modal']}>
<View className={styles['tips-modal-content']} onClick={e=>e.stopPropagation()}>
<View className={styles['tips-modal-title']}></View>
<View className={styles['tips-modal-letter']}>
<View className={styles['tips-modal-letter-beginn']}>To: 万丰园纺织科技</View>
<View className={styles['tips-modal-letter-text']}>使</View>
<View className={styles['tips-modal-letter-end']}></View>
{modalShow &&
<View onClick={handleouter} catchMove className={styles['tips-modal']}>
<View className={styles['tips-modal-content']} onClick={e => e.stopPropagation()}>
<View className={styles['tips-modal-title']}></View>
<View className={styles['tips-modal-letter']}>
<View className={styles['tips-modal-letter-beginn']}>To: 万丰园纺织科技</View>
<View className={styles['tips-modal-letter-text']}>使</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 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 {data} = props;
const Header = memo((props: any) => {
const { data } = props;
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-a-tuikuanshouhou", 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/orderList/index" }];
const { getPhoneNumber } = useLogin();
const mGetPhoneNumber = (ev)=>{
if(ev.detail?.code){
const mGetPhoneNumber = (ev) => {
if (ev.detail?.code) {
getPhoneNumber(ev.detail.code);
}else{
} else {
alert.none("绑定失败!");
}
}
const navTo = () => {
Taro.navigateTo({
url: '/pages/certification/index'
})
}
return (
<View className={styles.header}>
<View className={`${styles.crad} ${styles['header-card']}`}>
@ -90,7 +100,7 @@ const Header = memo((props:any) => {
{data?.user_name}
</View>
<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>
@ -106,7 +116,62 @@ const Header = memo((props:any) => {
</View>
</View>
<View className={styles['auth']}>
<View className={`${styles['auth-top']} ${data?.authentication_status==4&&"auth-tips-adopt"}`}>
{(data?.authentication_status == 0 || data?.authentication_status == 1) &&
<View className={styles['auth-box']} onClick={() => navTo()}>
<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>
}
{(data?.authentication_status == 3) &&
<View className={styles['auth-box']} onClick={() => navTo()}>
<View className={styles['auth-left-box']}>
<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&&"未认证"}
@ -118,13 +183,13 @@ const Header = memo((props:any) => {
{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"}`}>
</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-title']}>
@ -138,7 +203,7 @@ const Header = memo((props:any) => {
<Navigator hoverClass="none" url={item.url} className={styles['card-main-title-content-item']}>
<Text className={`iconfont ${item.icon}`}></Text>
<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>
)
})
@ -149,9 +214,9 @@ const Header = memo((props:any) => {
</View>
)
})
// 我的资产
const Assets = () => {
const Assets = (props: any) => {
console.log(props, 'propsprops')
return (
<View className={`${styles.assets} ${styles.crad} ${styles['main-card']}`}>
<View className={`${styles['assets-title']}`}></View>
@ -159,14 +224,14 @@ const Assets = () => {
<Navigator hoverClass="none" url="/pages/depositBeforehand/index">
<View className={`${styles['assets-content-item-top']}`}>
<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-after']}`}>.20</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']}`}>{props.wallet_money || 0}</Text> */}
</View>
<Text className={`${styles['assets-content-item-tips']}`}></Text>
</Navigator>
<View>
<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>
</View>
<Text className={`${styles['assets-content-item-tips']}`}></Text>
@ -174,8 +239,8 @@ const Assets = () => {
<Navigator hoverClass="none" url="/pages/creditLine/index">
<View className={`${styles['assets-content-item-top']}`}>
<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-after']}`}>.-00</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> */}
</View>
<Text className={`${styles['assets-content-item-tips']}`}></Text>
</Navigator>
@ -186,9 +251,9 @@ const Assets = () => {
// 功能
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-fenxiang" }, { text: "团队邀请", icon: "icon-yaoqingtuandui" }]
{ text: "分享推广", icon: "icon-fenxiang" }, { text: "团队邀请", icon: "icon-yaoqingtuandui" }]
return (
<View className={`${styles.crad} ${styles['card-main']} ${styles['card-feature']}`}>
<View className={styles['card-main-list-content']}>

View File

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

View File

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

View File

@ -1231,6 +1231,29 @@
"schema-utils" "^2.6.5"
"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":
"integrity" "sha512-gU6+Yyd6O0KrCSS/O6j8KKqmRo+/Dcs2fI0+APCpbAWK+nqhwDISpdnSEfGDCLMoAC08XOZCycBRk2K1VGnEcg=="
"resolved" "https://registry.npmjs.org/@stencil/core/-/core-2.4.0.tgz"
@ -1345,6 +1368,18 @@
"webpack-format-messages" "^2.0.5"
"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":
"integrity" "sha512-hbsCk++etkRsi/IQNEIY4R94dwqtTSVB/1sBfgbtuzVe0fOSbrlfwFwzJOrE131CnAXmI9sWiCF/MTy0qCKWjA=="
"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"
"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":
"integrity" "sha512-r2vcLDFfovVv2kJ1RMPGoH7pgk8kNFMCTDgoWXbZxpddmpbO7Q1QYVP3EDNykgidnMVfw2cKnEkQdyTSsh+lbA=="
"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"
"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":
"integrity" "sha512-hBVr0Ee7rGTD+cuK5ugPUHwbD0L9qOwMKHqMyUzqAb8LS6aYF3aIFDwVbCYx77ZgtpGZFUqXnpDCvnHofWVyTg=="
"resolved" "https://registry.npmjs.org/@tarojs/taro-h5/-/taro-h5-3.3.10.tgz"
@ -2030,9 +2080,9 @@
"version" "6.4.2"
"acorn@^8.0.4":
"integrity" "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ=="
"resolved" "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz"
"version" "8.7.0"
"integrity" "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A=="
"resolved" "https://registry.npmmirror.com/acorn/-/acorn-8.7.1.tgz"
"version" "8.7.1"
"acorn@^8.7.0":
"integrity" "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ=="
@ -3757,7 +3807,7 @@
"dayjs@^1.11.3":
"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"
"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"
"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":
"integrity" "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
"resolved" "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz"