电子商城测试版v3

This commit is contained in:
2022-06-30 20:31:51 +08:00
parent d0d4219413
commit 4ac7890915
22 changed files with 452 additions and 107 deletions
@@ -0,0 +1,47 @@
.collection_con{
padding: 20px ;
.header{
display: flex;
justify-content: center;
position: relative;
.title{
font-size: 30px;
font-weight: 700;
}
.miconfont_con{
position: absolute;
right: 10px;
top: 0;
font-size: 26px;
color: #007AFF;
.miconfont{
font-size: 30px;
color: #007AFF;
border: 1px solid #007AFF;
border-radius: 50%;
margin-right: 10px;
}
}
}
.scrollView{
height: 60vh;
}
.collection_item{
padding: 30px 0 15px 0;
border-bottom: 1px solid #F3F3F3;
.name{
font-size: 26px;
font-weight: 700;
text{
font-weight: normal;
}
}
.desc{
font-size: 22px;
color: #707070;
padding-left: 10px;
margin-top: 20px;
}
}
}
+49
View File
@@ -0,0 +1,49 @@
import Popup from "@/components/popup";
import { Input, ScrollView, Text, View } from "@tarojs/components";
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
import classnames from "classnames";
import styles from './index.module.scss'
import TextareaEnhance from "@/components/textareaEnhance";
import { CreateFavoriteApi, FavoriteListApi } from "@/api/favorite";
import { alert, goLink } from "@/common/common";
import { getFilterData } from "@/common/util";
//原因选择
type ReasonInfoParam = {
show?: boolean, //显示
onClose?: () => void, //关闭
onAdd?: (val: any) => void
}
export default memo(({show = false, onClose, onAdd}: ReasonInfoParam) => {
//获取列表
const [list, setList] = useState([])
const {fetchData: fetchDataList} = FavoriteListApi()
const getFavoriteList = async () => {
let res = await fetchDataList(getFilterData())
setList(() => res.data.list)
}
useEffect(() => {
if(show) getFavoriteList()
}, [show])
return (
<Popup show={show} onClose={onClose} showTitle={false} >
<View className={styles.collection_con}>
<View className={styles.header}>
<Text className={styles.title}>选择文件夹</Text>
<View className={styles.miconfont_con} >
<Text className={classnames(styles.miconfont, 'iconfont icon-jia')}></Text>
<Text onClick={() => goLink('/pages/collection/index')}>新建</Text>
</View>
</View>
<ScrollView scrollY className={styles.scrollView}>
{list?.map((item: any) => <View onClick={() => onAdd?.(item)} className={styles.collection_item}>
<View className={styles.name}>{item.name}<Text>({item.product_color_list?.length||0})</Text></View>
<View className={styles.desc}>{item.remark}</View>
</View>)}
</ScrollView>
</View>
</Popup>
)
})
+22 -2
View File
@@ -13,6 +13,7 @@ import { formatHashTag, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
import { setParam } from "@/common/system";
import { debounce } from "@/common/util";
import Counter from "../counter";
import { ApplyOrderAccessApi, GetAdminUserInfoApi } from "@/api/user";
type param = {
show?: true|false,
@@ -211,7 +212,25 @@ export default ({show = false, onClose}: param) => {
//去结算
const orderDetail = debounce(() => {
const {fetchData: useFetchData} = GetAdminUserInfoApi()
const orderDetail = debounce( async () => {
let res = await useFetchData()
if(res.data.order_access_status !== 3) {
Taro.showModal({
title: '提示',
content: '暂未开通下单权限功能,稍后有客服联系您,请注意接受电话。',
cancelText: '联系客服',
confirmText: '我知道',
success: function (res) {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
return false
}
getSelectId()
if(selectIds.current.length == 0) {
alert.error('请选择面料')
@@ -223,6 +242,7 @@ export default ({show = false, onClose}: param) => {
}
}, 500)
//计数组件-当后端修改完成才修改前端显示
const {fetchData: fetchDataUpdateShoppingCart} = UpdateShoppingCartApi()
const [UpdateShoppingCartLoading, setUpdateShoppingCartLoading] = useState(false)
@@ -241,7 +261,7 @@ export default ({show = false, onClose}: param) => {
<View className={styles.shop_cart_main}>
<Popup showTitle={false} show={showPopup} onClose={() => closePopup()} >
<View className={styles.popup_con}>
<View className={styles.header}>
<View className={styles.header}>
<View onClick={selectAll}>{!selectStatus?'全选':'反选'}</View>
<View onClick={delSelect}>
<text className={classnames('iconfont', 'icon-shanchu', styles.miconfont)}></text>
+1 -1
View File
@@ -17,7 +17,7 @@ export default memo(({onChange, title = '', placeholder = '请输入', defaultVa
count: 200,
show: false
})
const getDesc = (value) => {
const getDesc = (value = '') => {
let res = value
if(value.length > descData.count) {
res = value.slice(0, descData.count)
+4 -4
View File
@@ -11,14 +11,14 @@ type ImageParam = {
onChange?:(val: string[]) => void,
defaultList?: string[]
}
const PictureItem:FC<ImageParam> = memo(({onChange, defaultList = []}) => {
const PictureItem:FC<ImageParam> = memo(({onChange, defaultList}) => {
const {getWxPhoto} = useUploadCDNImg()
const [imageList, setImageLise] = useState<string[]>([])
useEffect(() => {
setImageLise(defaultList)
setImageLise(defaultList||[])
}, [defaultList])
//上传图片
const uploadImage = async () => {
let res:any = await getWxPhoto('after-sale')
@@ -33,7 +33,7 @@ const PictureItem:FC<ImageParam> = memo(({onChange, defaultList = []}) => {
}
//监听上传的图片变化
useEffect(() => {
onChange?.(imageList||[])
onChange?.(imageList)
}, [imageList])
//预览图片