🎈 perf(客服咨询完成):
This commit is contained in:
parent
9e6cf1738f
commit
12e70ce8ae
@ -1,4 +1,4 @@
|
|||||||
// export const BASE_URL = CURRENT_BASE_URL
|
export const BASE_URL = CURRENT_BASE_URL
|
||||||
// export const BASE_URL = `http://192.168.0.75:50001/lymarket`
|
// export const BASE_URL = `http://192.168.0.75:50001/lymarket`
|
||||||
// export const BASE_URL = `http://192.168.0.89:50001/lymarket`
|
// export const BASE_URL = `http://192.168.0.89:50001/lymarket`
|
||||||
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
||||||
@ -12,7 +12,7 @@
|
|||||||
// 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` // 王霞
|
||||||
export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
||||||
// export const BASE_URL = `http://192.168.1.22:50002/lymarket` // 婷
|
// export const BASE_URL = `http://192.168.1.22:50002/lymarket` // 婷
|
||||||
// export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰
|
// export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰
|
||||||
|
|
||||||
|
@ -1,28 +1,29 @@
|
|||||||
.swiper{
|
.swiper {
|
||||||
height: 450px;
|
height: 450px;
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
.swiper_item {
|
||||||
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
}
|
||||||
.swiper_item{
|
.image_item {
|
||||||
height: 100%;
|
width: 100%;
|
||||||
width: 100%;
|
height: 100%;
|
||||||
}
|
image {
|
||||||
.image_item{
|
width: 100%;
|
||||||
width: 100%;
|
height: 100%;
|
||||||
height: 100%;
|
display: block;
|
||||||
image{
|
border-radius: 20px 20px 0 0;
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.page{
|
|
||||||
font-size: $font_size_min;
|
|
||||||
padding: 5px 20px;
|
|
||||||
background-color: rgba(0,0,0,0.3);
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 50px;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 20px;
|
|
||||||
right: 20px;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
font-size: $font_size_min;
|
||||||
|
padding: 5px 20px;
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 50px;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 20px;
|
||||||
|
right: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
@ -3,11 +3,12 @@
|
|||||||
background-color: $color_bg_one;
|
background-color: $color_bg_one;
|
||||||
padding: 20px 20px 100px 20px;
|
padding: 20px 20px 100px 20px;
|
||||||
.product_header {
|
.product_header {
|
||||||
padding: 0 20px;
|
padding: 20px 20px 0 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
|
||||||
height: 163.57px;
|
height: 163.57px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 20px;
|
||||||
.title {
|
.title {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
.name {
|
.name {
|
||||||
@ -30,8 +31,9 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: $color_font_three;
|
color: $color_font_three;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
margin-left: 10px;
|
||||||
.text {
|
.text {
|
||||||
margin-top: 10px;
|
margin-top: 5px;
|
||||||
font-size: $font_size_medium;
|
font-size: $font_size_medium;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,6 +47,7 @@
|
|||||||
}
|
}
|
||||||
.miconfont {
|
.miconfont {
|
||||||
font-size: 45px;
|
font-size: 45px;
|
||||||
|
color: #333333;
|
||||||
}
|
}
|
||||||
.collected {
|
.collected {
|
||||||
color: #ffc300;
|
color: #ffc300;
|
||||||
@ -57,7 +60,7 @@
|
|||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
.title {
|
.title {
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
font-weight: 700;
|
font-weight: 500;
|
||||||
color: $color_font_one;
|
color: $color_font_one;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
@ -88,7 +91,10 @@
|
|||||||
padding: 30px 20px 0;
|
padding: 30px 20px 0;
|
||||||
color: $color_font_one;
|
color: $color_font_one;
|
||||||
font-size: $font_size_medium;
|
font-size: $font_size_medium;
|
||||||
|
border-radius: 20px;
|
||||||
.title {
|
.title {
|
||||||
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
.list {
|
.list {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
@ -147,7 +153,10 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
.icon_btn {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 20px 0 50px;
|
||||||
|
}
|
||||||
.buy_cart {
|
.buy_cart {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
color: $color_font_three;
|
color: $color_font_three;
|
||||||
@ -155,9 +164,11 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
.text {
|
.text {
|
||||||
font-size: $font_size_min;
|
font-size: $font_size_min;
|
||||||
|
color: #333333;
|
||||||
}
|
}
|
||||||
.miconfont {
|
.miconfont {
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
|
color: #333333;
|
||||||
}
|
}
|
||||||
.product_num {
|
.product_num {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -176,11 +187,13 @@
|
|||||||
}
|
}
|
||||||
.customer_service {
|
.customer_service {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
.miconfont {
|
.miconfont {
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
}
|
}
|
||||||
.text {
|
.text {
|
||||||
font-size: $font_size_min;
|
font-size: $font_size_min;
|
||||||
|
color: #333333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.buy_btn {
|
.buy_btn {
|
||||||
@ -193,12 +206,15 @@
|
|||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
position: relative;
|
position: relative;
|
||||||
.phoneBtn {
|
|
||||||
background-color: rgba(0, 0, 0, 0);
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.wxBtn {
|
||||||
|
// background-color: rgba(0, 0, 0, 0);
|
||||||
|
opacity: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,12 @@ export default (props: Params) => {
|
|||||||
// `
|
// `
|
||||||
const html = ``
|
const html = ``
|
||||||
|
|
||||||
|
const shareImg = useMemo(() => {
|
||||||
|
let data = productInfo.texture_url ? productInfo.texture_url.toString().split(',') : []
|
||||||
|
let str = data.length > 0 ? data[0] : '/mall/share_img_01.png'
|
||||||
|
return formatImgUrl(str, '!w400')
|
||||||
|
}, [productInfo])
|
||||||
|
|
||||||
const { setSortCode, userInfo: userObj } = useUserInfo()
|
const { setSortCode, userInfo: userObj } = useUserInfo()
|
||||||
//详情页获取分享短码
|
//详情页获取分享短码
|
||||||
const { ShareDetail } = SHARE_SCENE
|
const { ShareDetail } = SHARE_SCENE
|
||||||
@ -102,7 +108,7 @@ export default (props: Params) => {
|
|||||||
type: ShareDetail.value,
|
type: ShareDetail.value,
|
||||||
product_id: parseInt(params.id),
|
product_id: parseInt(params.id),
|
||||||
})
|
})
|
||||||
const img = formatImgUrl(productInfo.texture_url || '/mall/share_img_01.png', '!w400')
|
const img = formatImgUrl(shareImg, '!w400')
|
||||||
setSortCode({ ...userObj.sort_code, shareShortDetail: { title: productName as string, code: resDetail.md5_key, img: img } })
|
setSortCode({ ...userObj.sort_code, shareShortDetail: { title: productName as string, code: resDetail.md5_key, img: img } })
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,20 +183,20 @@ export default (props: Params) => {
|
|||||||
{productInfo.code && <View className={styles.name}>{productName}</View>}
|
{productInfo.code && <View className={styles.name}>{productName}</View>}
|
||||||
<View className={styles.des}>{productInfo.describe}</View>
|
<View className={styles.des}>{productInfo.describe}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.share}>
|
|
||||||
<View className={classnames('iconfont icon-fenxiang', styles.miconfont)}></View>
|
|
||||||
<View className={styles.text}>分享</View>
|
|
||||||
<Button open-type='share' className={styles.shareBtn}></Button>
|
|
||||||
</View>
|
|
||||||
<View className={styles.collect} onClick={openCollection}>
|
<View className={styles.collect} onClick={openCollection}>
|
||||||
<View
|
<View
|
||||||
className={classnames(
|
className={classnames(
|
||||||
`iconfont ${collectStatus ? 'icon-shoucang-pressed' : 'icon-shoucang'}`,
|
`iconfont ${collectStatus ? 'icon-shoucangchenggong' : 'icon-dianjishoucang'}`,
|
||||||
styles.miconfont,
|
styles.miconfont,
|
||||||
collectStatus && styles.collected,
|
collectStatus && styles.collected,
|
||||||
)}></View>
|
)}></View>
|
||||||
<View className={styles.text}>收藏</View>
|
<View className={styles.text}>收藏</View>
|
||||||
</View>
|
</View>
|
||||||
|
<View className={styles.share}>
|
||||||
|
<View className={classnames('iconfont icon-fenxiangshangpin', styles.miconfont)}></View>
|
||||||
|
<View className={styles.text}>分享</View>
|
||||||
|
<Button open-type='share' className={styles.shareBtn}></Button>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.des_data}>
|
<View className={styles.des_data}>
|
||||||
<View className={styles.title}>商品参数</View>
|
<View className={styles.title}>商品参数</View>
|
||||||
@ -237,10 +243,19 @@ export default (props: Params) => {
|
|||||||
<RichText nodes={html}></RichText>
|
<RichText nodes={html}></RichText>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.product_buy}>
|
<View className={styles.product_buy}>
|
||||||
<View>
|
<View className={styles.icon_btn}>
|
||||||
<View className={styles.customer_service}>
|
<View className={styles.customer_service}>
|
||||||
<View className={classnames('iconfont icon-kefu', styles.miconfont)}></View>
|
<View className={classnames('iconfont icon-kefu', styles.miconfont)}></View>
|
||||||
<View className={styles.text}>客服</View>
|
<View className={styles.text}>
|
||||||
|
客服
|
||||||
|
<Button
|
||||||
|
className={styles.wxBtn}
|
||||||
|
openType='contact'
|
||||||
|
sendMessageImg={shareImg}
|
||||||
|
sendMessageTitle={productName}
|
||||||
|
showMessageCard={true}
|
||||||
|
sendMessagePath={`pages/details/index?id=${productInfo.id}`}></Button>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.buy_cart} onClick={() => setShowCart(true)}>
|
<View className={styles.buy_cart} onClick={() => setShowCart(true)}>
|
||||||
<View className={classnames('iconfont icon-gouwuche', styles.miconfont)}></View>
|
<View className={classnames('iconfont icon-gouwuche', styles.miconfont)}></View>
|
||||||
@ -251,7 +266,7 @@ export default (props: Params) => {
|
|||||||
|
|
||||||
{(!userInfo.adminUserInfo?.is_authorize_phone && (
|
{(!userInfo.adminUserInfo?.is_authorize_phone && (
|
||||||
<View className={styles.buy_btn}>
|
<View className={styles.buy_btn}>
|
||||||
<Button className={styles.phoneBtn} open-type='getPhoneNumber' onGetPhoneNumber={(e) => placeOrder('to_phone', e)}></Button>
|
<Button className={styles.wxBtn} open-type='getPhoneNumber' onGetPhoneNumber={(e) => placeOrder('to_phone', e)}></Button>
|
||||||
选购商品
|
选购商品
|
||||||
</View>
|
</View>
|
||||||
)) || (
|
)) || (
|
||||||
|
@ -341,16 +341,7 @@ const Main = memo(() => {
|
|||||||
<View className={styles['card-main-list-content-item-right']}>
|
<View className={styles['card-main-list-content-item-right']}>
|
||||||
<Text className='iconfont icon-a-moreback'></Text>
|
<Text className='iconfont icon-a-moreback'></Text>
|
||||||
</View>
|
</View>
|
||||||
{item.type === 'customer' && (
|
{item.type === 'customer' && <Button openType='contact' className={styles.customer}></Button>}
|
||||||
<Button
|
|
||||||
openType='contact'
|
|
||||||
// sendMessageTitle='有个靓仔要询货:0770# 21S全棉平纹'
|
|
||||||
// showMessageCard={true}
|
|
||||||
// sendMessageImg='https://test.cdn.zzfzyc.com/mall/no_img.png'
|
|
||||||
// sendMessagePath='/pages/details/index?id=21'
|
|
||||||
// onContact={(e) => console.log('ee:::', e)}
|
|
||||||
className={styles.customer}></Button>
|
|
||||||
)}
|
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
@ -1,158 +1,161 @@
|
|||||||
|
import { alert, goLink, isEmptyObject, retrieval } from '@/common/common'
|
||||||
import { alert, goLink, isEmptyObject, retrieval } from "@/common/common";
|
import Popup from '@/components/popup'
|
||||||
import Popup from "@/components/popup";
|
import { Button, Image, Picker, Text, Textarea, View } from '@tarojs/components'
|
||||||
import { Button, Image, Picker, Text, Textarea, View } from "@tarojs/components"
|
import Taro, { chooseMedia } from '@tarojs/taro'
|
||||||
import Taro, { chooseMedia } from "@tarojs/taro";
|
import { realNameUpdateApi, companyTypeApi, portraitUpdateApi } from '@/api/user'
|
||||||
import { realNameUpdateApi, companyTypeApi, portraitUpdateApi } from "@/api/user";
|
import { companyDetailApi, companyUpdateApi } from '@/api/company'
|
||||||
import { companyDetailApi, companyUpdateApi } from "@/api/company"
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react"
|
import './index.scss'
|
||||||
import "./index.scss"
|
import ModifyModal from './components/ModifyModal'
|
||||||
import ModifyModal from "./components/ModifyModal";
|
import useLogin from '@/use/useLogin'
|
||||||
import useLogin from "@/use/useLogin";
|
import { useSelector } from '@/reducers/hooks'
|
||||||
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";
|
import useUserInfo from '@/use/useUserInfo'
|
||||||
import useUserInfo from "@/use/useUserInfo";
|
|
||||||
|
|
||||||
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<typeof adminUserInfo>(adminUserInfo);
|
const [formData, setFormData] = useState<typeof adminUserInfo>(adminUserInfo)
|
||||||
// 昵称修改保存
|
// 昵称修改保存
|
||||||
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)
|
||||||
let result;
|
.then(async () => {
|
||||||
if (type == "Ickname") {
|
let result
|
||||||
result = await realNameUpdateFetch({ real_name: text });
|
if (type == 'Ickname') {
|
||||||
} else {
|
result = await realNameUpdateFetch({ real_name: text })
|
||||||
const params = await getCompanyFetch();
|
} else {
|
||||||
result = await saveFetch({
|
const params = await getCompanyFetch()
|
||||||
...params.data,
|
result = await saveFetch({
|
||||||
company_name: text
|
...params.data,
|
||||||
});
|
company_name: text,
|
||||||
}
|
})
|
||||||
if (result.success) {
|
}
|
||||||
getAdminUserInfo();
|
if (result.success) {
|
||||||
(ModifyIcknameEl.current as any).setModalShow(false);
|
getAdminUserInfo()
|
||||||
(ModifyCompanyNameEl.current as any).setModalShow(false)
|
;(ModifyIcknameEl.current as any).setModalShow(false)
|
||||||
alert.success("保存成功");
|
;(ModifyCompanyNameEl.current as any).setModalShow(false)
|
||||||
} else {
|
alert.success('保存成功')
|
||||||
alert.none(result.msg);
|
} else {
|
||||||
}
|
alert.none(result.msg)
|
||||||
}).catch(message => {
|
}
|
||||||
alert.none(message);
|
})
|
||||||
})
|
.catch((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,
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
return true;
|
return true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 修改企业类型
|
// 修改企业类型
|
||||||
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) {
|
||||||
if(item.id == 0) return alert.error('请选择类型')
|
if (item.id == 0) return alert.error('请选择类型')
|
||||||
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const {removeToken, removeSessionKey, removeUserInfo} = useUserInfo()
|
const { removeToken, removeSessionKey, removeUserInfo } = useUserInfo()
|
||||||
const outLogin = () => {
|
const outLogin = () => {
|
||||||
removeToken()
|
removeToken()
|
||||||
removeSessionKey()
|
removeSessionKey()
|
||||||
removeUserInfo()
|
removeUserInfo()
|
||||||
goLink('/pages/index/index',{}, 'switchTab')
|
goLink('/pages/index/index', {}, 'switchTab')
|
||||||
}
|
}
|
||||||
|
|
||||||
const comanyTypeDataFormat = useMemo(() => {
|
const comanyTypeDataFormat = useMemo(() => {
|
||||||
if(companyTypeData.data.list) {
|
if (companyTypeData.data.list) {
|
||||||
return companyTypeData.data.list?.map(item => {
|
return companyTypeData.data.list?.map((item) => {
|
||||||
if(item.id == 0) item.name = '--请选择类型--'
|
if (item.id == 0) item.name = '--请选择类型--'
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -161,42 +164,69 @@ export default () => {
|
|||||||
}, [companyTypeData])
|
}, [companyTypeData])
|
||||||
|
|
||||||
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'>
|
||||||
<UserEditList onClick={() => (ModifyIcknameEl.current as any).setModalShow(true)} data={(formData as any)?.user_name} label="昵称" placeholder="请输入" icon="" />
|
<Text /> 个人资料
|
||||||
<UserEditList label="手机号" placeholder="去绑定" icon="">
|
</View>
|
||||||
{((formData as any)?.phone) ? <View className="user-edit-content-phone">
|
<UserEditList
|
||||||
<View>{(formData as any)?.phone}</View>
|
onClick={() => (ModifyIcknameEl.current as any).setModalShow(true)}
|
||||||
<Text>已绑定</Text>
|
data={(formData as any)?.user_name}
|
||||||
</View> :
|
label='昵称'
|
||||||
<Button className="user-edit-content-bindphone" openType="getPhoneNumber" onGetPhoneNumber={mGetPhoneNumber}>去绑定</Button>
|
placeholder='请输入'
|
||||||
}
|
icon=''
|
||||||
|
/>
|
||||||
|
<UserEditList label='手机号' placeholder='去绑定' icon=''>
|
||||||
|
{(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>
|
||||||
|
)}
|
||||||
</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'>
|
||||||
<UserEditList onClick={() => (ModifyCompanyNameEl.current as any).setModalShow(true)} data={(formData as any)?.company_name} label="组织名称" placeholder="待绑定" icon="" />
|
<Text /> 组织资料
|
||||||
<UserEditList label="组织类型" placeholder="完善公司/组织信息" icon="">
|
</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={comanyTypeDataFormat as any} rangeKey="name" value={(formData as any)?.purchaser_type} onChange={handleCompanyType}>
|
<Picker mode="selector" range={comanyTypeDataFormat as any} rangeKey="name" value={(formData as any)?.purchaser_type} onChange={handleCompanyType}>
|
||||||
{formData?.purchaser_type_name}
|
{formData?.purchaser_type_name}
|
||||||
</Picker>
|
</Picker>
|
||||||
</UserEditList>
|
</UserEditList> */}
|
||||||
<UserEditList label="我的认证" placeholder="待绑定" icon="" useIcon="true">
|
<UserEditList label='我的认证' placeholder='待绑定' icon='' useIcon='true'>
|
||||||
<View className={`user-edit-content-company ${(formData as any)?.authentication_status == 4 && "user-edit-content-company-adopt"}`}>
|
<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 ? "已认证" : "未认证"}
|
<Text className='iconfont ' /> {(formData as any)?.authentication_status == 4 ? '已认证' : '未认证'}
|
||||||
</View>
|
</View>
|
||||||
</UserEditList>
|
</UserEditList>
|
||||||
<UserEditList label="创建人" data={(formData as any)?.founder_user_name} placeholder="完善公司/组织信息" icon="" useIcon="true" />
|
<UserEditList label='创建人' data={(formData as any)?.founder_user_name} placeholder='完善公司/组织信息' icon='' useIcon='true' />
|
||||||
</View>
|
</View>
|
||||||
<Button hoverClass="none" className="user-edit-logout" onClick={outLogin}>退出当前账号</Button>
|
<Button hoverClass='none' className='user-edit-logout' onClick={outLogin}>
|
||||||
|
退出当前账号
|
||||||
|
</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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -204,22 +234,11 @@ export default () => {
|
|||||||
// 列表
|
// 列表
|
||||||
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'>{props.label}</View>
|
||||||
{props.label}
|
<View className='user-edit-list-right'>
|
||||||
</View>
|
<View>{props.children ? props.children : props.data ? props.data : <View className='user-edit-list-right-placeholder'>{props.placeholder}</View>}</View>
|
||||||
<View className="user-edit-list-right">
|
{!props.useIcon && <Text className='iconfont icon-a-moreback'></Text>}
|
||||||
<View>
|
|
||||||
{
|
|
||||||
props.children ? props.children :
|
|
||||||
props.data ? props.data :
|
|
||||||
<View className="user-edit-list-right-placeholder">{props.placeholder}</View>
|
|
||||||
}
|
|
||||||
</View>
|
|
||||||
{
|
|
||||||
!props.useIcon &&
|
|
||||||
<Text className="iconfont icon-a-moreback"></Text>
|
|
||||||
}
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -267,9 +267,9 @@
|
|||||||
content: '\e62f';
|
content: '\e62f';
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-daifahuo:before {
|
// .icon-daifahuo:before {
|
||||||
content: '\e629';
|
// content: '\e629';
|
||||||
}
|
// }
|
||||||
|
|
||||||
.icon-daishouhuo:before {
|
.icon-daishouhuo:before {
|
||||||
content: '\e62a';
|
content: '\e62a';
|
||||||
@ -279,70 +279,10 @@
|
|||||||
content: '\e62b';
|
content: '\e62b';
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-daipeibu:before {
|
// .icon-daipeibu:before {
|
||||||
content: '\e62c';
|
// content: '\e62c';
|
||||||
}
|
// }
|
||||||
|
|
||||||
.icon-daifukuan:before {
|
// .icon-daifukuan:before {
|
||||||
content: '\e62d';
|
// content: '\e62d';
|
||||||
}
|
// }
|
||||||
|
|
||||||
.icon-shezhi:before {
|
|
||||||
content: '\e630';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-tishi:before {
|
|
||||||
content: '\e631';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-erweima:before {
|
|
||||||
content: '\e632';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-dianjishoucang:before {
|
|
||||||
content: '\e633';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-gouwuche:before {
|
|
||||||
content: '\e634';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-shoucangchenggong:before {
|
|
||||||
content: '\e635';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-fenxiangshangpin:before {
|
|
||||||
content: '\e636';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-kefu:before {
|
|
||||||
content: '\e637';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-xinzenganniu:before {
|
|
||||||
content: '\e62e';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-jianshaoanniu:before {
|
|
||||||
content: '\e62f';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-daifahuo:before {
|
|
||||||
content: '\e629';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-daishouhuo:before {
|
|
||||||
content: '\e62a';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-tuikuan-shouhou:before {
|
|
||||||
content: '\e62b';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-daipeibu:before {
|
|
||||||
content: '\e62c';
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-daifukuan:before {
|
|
||||||
content: '\e62d';
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user