电子商城测试版v4
This commit is contained in:
parent
8ec073a085
commit
0a77473193
@ -176,6 +176,7 @@ export default {
|
|||||||
root: "pages/collection",
|
root: "pages/collection",
|
||||||
pages: [
|
pages: [
|
||||||
"index",
|
"index",
|
||||||
|
"collectionClass/index"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
// 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.42:50001/lymarket` // 杰
|
// export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
||||||
|
|
||||||
// CDN
|
// CDN
|
||||||
// 生成密钥
|
// 生成密钥
|
||||||
|
@ -43,11 +43,11 @@ export const throttle = (fn, delay) => {
|
|||||||
let res = {}
|
let res = {}
|
||||||
for(let key in val) {
|
for(let key in val) {
|
||||||
if(val[key]!==undefined&&val[key]!==null&&val[key]!==''&&(!arr.includes(key))){
|
if(val[key]!==undefined&&val[key]!==null&&val[key]!==''&&(!arr.includes(key))){
|
||||||
if(val[key] instanceof Number){
|
if(typeof val[key] == 'number'){
|
||||||
if(!isNaN(val[key])) {
|
if(!isNaN(val[key])) {
|
||||||
res[key] = val[key]
|
res[key] = val[key]
|
||||||
}
|
}
|
||||||
}else{
|
} else{
|
||||||
res[key] = val[key]
|
res[key] = val[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.no_checkbox_item{
|
.no_checkbox_item{
|
||||||
border:0;
|
border:0;
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
.tag, .tag_g{
|
.tag, .tag_g{
|
||||||
max-width: 150rpx;
|
max-width: 260rpx;
|
||||||
padding: 3px 10px;
|
padding: 3px 10px;
|
||||||
background-color: #CDE5FF;
|
background-color: #CDE5FF;
|
||||||
font-size: $font_size_min;
|
font-size: $font_size_min;
|
||||||
|
@ -21,10 +21,14 @@ const PictureItem:FC<ImageParam> = memo(({onChange, defaultList}) => {
|
|||||||
|
|
||||||
//上传图片
|
//上传图片
|
||||||
const uploadImage = async () => {
|
const uploadImage = async () => {
|
||||||
let res:any = await getWxPhoto('after-sale')
|
let list:any = await getWxPhoto('after-sale', 5)
|
||||||
if(res.code == 200) {
|
let images:any[] = []
|
||||||
setImageLise([...imageList, res.url])
|
console.log('item22:::', list.length)
|
||||||
}
|
list?.map(item => {
|
||||||
|
console.log('item:::', item)
|
||||||
|
images.push(item.url)
|
||||||
|
})
|
||||||
|
setImageLise([...imageList, ...images])
|
||||||
}
|
}
|
||||||
//删除图片
|
//删除图片
|
||||||
const delImage = (index) => {
|
const delImage = (index) => {
|
||||||
|
@ -41,10 +41,9 @@ const kindeList:FC<Param> = memo(({order, onSelectChange}) => {
|
|||||||
|
|
||||||
//判断该面料下的颜色都退完了
|
//判断该面料下的颜色都退完了
|
||||||
const colorNum = (item) => {
|
const colorNum = (item) => {
|
||||||
let res = item.product_colors.some(val => {
|
return item.product_colors.some(val => {
|
||||||
return val.return_roll == 0
|
return val.return_roll + val.apply_return_roll == 0
|
||||||
})
|
})
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -55,7 +54,7 @@ const kindeList:FC<Param> = memo(({order, onSelectChange}) => {
|
|||||||
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.color_list}>
|
<View className={styles.color_list}>
|
||||||
{item.product_colors.map(colorItem => (colorItem.return_roll == 0)&&<View className={styles.color_item}>
|
{item.product_colors.map(colorItem => ((colorItem.return_roll + colorItem.apply_return_roll) == 0)&&<View className={styles.color_item}>
|
||||||
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
||||||
<View className={styles.name_and_number}><Text>{colorItem.code + ' ' + colorItem.name}</Text><Text>x {formatCount(colorItem)}</Text></View>
|
<View className={styles.name_and_number}><Text>{colorItem.code + ' ' + colorItem.name}</Text><Text>x {formatCount(colorItem)}</Text></View>
|
||||||
<MCheckbox status={item.select} onSelect={() => selectCallBack(colorItem)} onClose={() => colseCallBack(colorItem)}/>
|
<MCheckbox status={item.select} onSelect={() => selectCallBack(colorItem)} onClose={() => colseCallBack(colorItem)}/>
|
||||||
|
@ -24,7 +24,7 @@ type Param = {
|
|||||||
const kindeList:FC<Param> = memo(({order, onNumChange}) => {
|
const kindeList:FC<Param> = memo(({order, onNumChange}) => {
|
||||||
//对应数量
|
//对应数量
|
||||||
const formatCount = useCallback((item) => {
|
const formatCount = useCallback((item) => {
|
||||||
return (item.roll - item.return_roll) + order?.unit!
|
return (item.roll - item.return_roll - item.apply_return_roll) + order?.unit!
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
//计步器失返回值
|
//计步器失返回值
|
||||||
@ -50,11 +50,11 @@ const kindeList:FC<Param> = memo(({order, onNumChange}) => {
|
|||||||
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.color_list}>
|
<View className={styles.color_list}>
|
||||||
{item.product_colors.map(colorItem => (colorItem.return_roll < colorItem.roll)&&<View className={styles.color_item}>
|
{item.product_colors.map(colorItem => ((colorItem.return_roll + colorItem.apply_return_roll) < colorItem.roll)&&<View className={styles.color_item}>
|
||||||
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
||||||
<View className={styles.name_and_number}><Text>{colorItem.code + ' ' + colorItem.name}</Text><Text>x {formatCount(colorItem)}</Text></View>
|
<View className={styles.name_and_number}><Text>{colorItem.code + ' ' + colorItem.name}</Text><Text>x {formatCount(colorItem)}</Text></View>
|
||||||
<View className={styles.btn_count}>
|
<View className={styles.btn_count}>
|
||||||
<Counter maxNum={colorItem.roll - colorItem.return_roll} onChange={getCounterChange(colorItem)}/>
|
<Counter maxNum={colorItem.roll - (colorItem.return_roll + colorItem.apply_return_roll)} onChange={getCounterChange(colorItem)}/>
|
||||||
</View>
|
</View>
|
||||||
</View>)}
|
</View>)}
|
||||||
</View>
|
</View>
|
||||||
|
4
src/pages/collection/collectionClass/index.config.ts
Normal file
4
src/pages/collection/collectionClass/index.config.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export default {
|
||||||
|
navigationBarTitleText: '我的收藏a',
|
||||||
|
enableShareAppMessage: true,
|
||||||
|
}
|
47
src/pages/collection/collectionClass/index.module.scss
Normal file
47
src/pages/collection/collectionClass/index.module.scss
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
.collection_main {
|
||||||
|
padding: 0 20px;
|
||||||
|
min-height: 100%;
|
||||||
|
background-color: #F8F8F8;
|
||||||
|
.search {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.miconfont_con{
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
.miconfont{
|
||||||
|
font-size: 30px;
|
||||||
|
color: #007AFF;
|
||||||
|
border: 1px solid #007AFF;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.operation{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20px 20px 0 20px;
|
||||||
|
font-size: 26px;
|
||||||
|
color: #707070;
|
||||||
|
.operation_check{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
Text{
|
||||||
|
margin-left: 15px;
|
||||||
|
height: 100%;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.operation_check_right{
|
||||||
|
Text{
|
||||||
|
color: #CCCCCC;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.class_list{
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
65
src/pages/collection/collectionClass/index.tsx
Normal file
65
src/pages/collection/collectionClass/index.tsx
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
import { CreateFavoriteApi, DelFavoriteApi, FavoriteListApi, UpdateFavoriteApi } from "@/api/favorite";
|
||||||
|
import { alert } from "@/common/common";
|
||||||
|
import { getFilterData } from "@/common/util";
|
||||||
|
import Product from "../components/product";
|
||||||
|
import Search from "@/components/search"
|
||||||
|
import { Text, View } from "@tarojs/components"
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import classnames from "classnames";
|
||||||
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
|
import CreatePopup from "../components/createPopup";
|
||||||
|
import UpdatePopup from "../components/updatePopup";
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
import MCheckbox from "@/components/checkbox";
|
||||||
|
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
|
||||||
|
//获取收藏夹面料
|
||||||
|
const [list, setList] = useState<any[]>([])
|
||||||
|
const getFavoriteInfo = () => {
|
||||||
|
let arr:any[] = []
|
||||||
|
new Array(10).fill("").map((item, index) => {
|
||||||
|
arr.push({code: index})
|
||||||
|
})
|
||||||
|
setList(arr)
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取搜索数据
|
||||||
|
const [searchData, setSearchData] = useState('')
|
||||||
|
const onSearch = useCallback((e) => {
|
||||||
|
setSearchData(() => e)
|
||||||
|
}, [])
|
||||||
|
useEffect(() => {
|
||||||
|
getFavoriteInfo()
|
||||||
|
}, [searchData])
|
||||||
|
|
||||||
|
const selectCallBack = useCallback(() => {
|
||||||
|
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const colseCallBack = useCallback(() => {
|
||||||
|
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className={styles.collection_main}>
|
||||||
|
<View className={styles.search}>
|
||||||
|
<Search style={{width: '100%'}} debounceTime={300} changeOnSearch={onSearch} placeholder="请输入面料关键词" />
|
||||||
|
</View>
|
||||||
|
<View className={styles.operation}>
|
||||||
|
<View className={styles.operation_check}>
|
||||||
|
<MCheckbox onSelect={() => selectCallBack()} onClose={() => colseCallBack()}/>
|
||||||
|
<Text>全选</Text>
|
||||||
|
</View>
|
||||||
|
<View className={styles.operation_check_right}>
|
||||||
|
<Text>移动到</Text>
|
||||||
|
<Text>取消收藏</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.class_list}>
|
||||||
|
<Product productList={list}/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
89
src/pages/collection/components/product/index.module.scss
Normal file
89
src/pages/collection/components/product/index.module.scss
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
|
||||||
|
.products_list{
|
||||||
|
padding: 0 20px 20px 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.products_item{
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
position: relative;
|
||||||
|
&:nth-child(n+2){
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
.checkbox{
|
||||||
|
position: absolute;
|
||||||
|
left: 10px;
|
||||||
|
top: 10px;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
.item_img{
|
||||||
|
width: 198px;
|
||||||
|
height: 198px;
|
||||||
|
position: relative;
|
||||||
|
image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.num{
|
||||||
|
padding: 5px 10px 5px 20px;
|
||||||
|
font-size: $font_size_min;
|
||||||
|
position: absolute;
|
||||||
|
right:0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba($color: #000, $alpha: 0.3);
|
||||||
|
border-radius: 36px 0px 10px 0px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.item_con{
|
||||||
|
padding-left: 20px;
|
||||||
|
font-size: $font_size;
|
||||||
|
flex:1;
|
||||||
|
.title{
|
||||||
|
font-size: $font_size;
|
||||||
|
color: #707070;
|
||||||
|
text{
|
||||||
|
color: $color_font_one;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tag_list{
|
||||||
|
display: flex;
|
||||||
|
margin-top: 16px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
.tag, .tag_g{
|
||||||
|
max-width: 260rpx;
|
||||||
|
padding: 3px 10px;
|
||||||
|
background-color: #CDE5FF;
|
||||||
|
font-size: $font_size_min;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: $color_main;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.tag_g{
|
||||||
|
background-color: #FFE6CE;
|
||||||
|
color: #EE7500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.introduce{
|
||||||
|
font-size: $font_size_medium;
|
||||||
|
color: $color_font_two;
|
||||||
|
|
||||||
|
}
|
||||||
|
.des{
|
||||||
|
font-size:$font_size_medium;
|
||||||
|
color: #707070;
|
||||||
|
margin-top: 16px;
|
||||||
|
@include common_ellipsis($params:2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
58
src/pages/collection/components/product/index.tsx
Normal file
58
src/pages/collection/components/product/index.tsx
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { Image, View } from "@tarojs/components"
|
||||||
|
import Taro from "@tarojs/taro"
|
||||||
|
import { goLink } from "@/common/common"
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
import { formatHashTag, formatImgUrl } from "@/common/fotmat"
|
||||||
|
import LabAndImg from "@/components/LabAndImg"
|
||||||
|
import MCheckbox from "@/components/checkbox";
|
||||||
|
import { useCallback, useEffect, useState } from "react"
|
||||||
|
|
||||||
|
type Params = {
|
||||||
|
desStatus?: true|false,
|
||||||
|
productList?: any[]
|
||||||
|
}
|
||||||
|
export default ({desStatus = true, productList = []}:Params) => {
|
||||||
|
const [list, setList] = useState<any[]>([])
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('productList::', productList)
|
||||||
|
setList(() => [...productList])
|
||||||
|
},[productList])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const onSelect = (item, e) => {
|
||||||
|
console.log('e:::', e)
|
||||||
|
item.check = true
|
||||||
|
setList(() => ([...list]))
|
||||||
|
}
|
||||||
|
|
||||||
|
const onClose = (item, e) => {
|
||||||
|
item.check = false
|
||||||
|
setList(() => ([...list]))
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className={styles.products_list}>
|
||||||
|
{list?.map(item => {
|
||||||
|
return <View className={styles.products_item} onClick={() => goLink(`/pages/details/index?id=${item.id}`)}>
|
||||||
|
<View className={styles.checkbox}>
|
||||||
|
<MCheckbox status={item.check} onSelect={() => onSelect(item, e)} onClose={() => onClose(item, e)}/>
|
||||||
|
</View>
|
||||||
|
<View className={styles.item_img}>
|
||||||
|
<LabAndImg value={{lab:item.lab,rgb:item.rgb,texture_url:item.texture_url}}/>
|
||||||
|
<View className={styles.num}>{item.product_color_count}色</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.item_con}>
|
||||||
|
<View className={styles.title}><text>{formatHashTag(item.product_code, '')} </text>{item.product_name}</View>
|
||||||
|
<View className={styles.tag_list}>
|
||||||
|
<View className={styles.tag}>{item.width}</View>
|
||||||
|
<View className={styles.tag_g}>{item.weight_density}</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.introduce}>{item.component}</View>
|
||||||
|
{desStatus&&<View className={styles.des}>{item.describe}</View>}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import { CreateFavoriteApi, DelFavoriteApi, FavoriteListApi, UpdateFavoriteApi } from "@/api/favorite";
|
import { CreateFavoriteApi, DelFavoriteApi, FavoriteListApi, UpdateFavoriteApi } from "@/api/favorite";
|
||||||
import { alert } from "@/common/common";
|
import { alert } from "@/common/common";
|
||||||
import { getFilterData } from "@/common/util";
|
import { getFilterData } from "@/common/util";
|
||||||
import Product from "@/components/product";
|
import Product from "./components/product";
|
||||||
import Search from "@/components/search"
|
import Search from "@/components/search"
|
||||||
import { Text, View } from "@tarojs/components"
|
import { Text, View } from "@tarojs/components"
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from "@tarojs/taro";
|
||||||
@ -127,7 +127,6 @@ export default () => {
|
|||||||
setCollectioinShow(false)
|
setCollectioinShow(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.collection_main}>
|
<View className={styles.collection_main}>
|
||||||
<View className={styles.search}>
|
<View className={styles.search}>
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
.miconfont{
|
.miconfont{
|
||||||
font-size: 36px;
|
font-size: 45px;
|
||||||
}
|
}
|
||||||
.collected{
|
.collected{
|
||||||
color: #FFC300;
|
color: #FFC300;
|
||||||
|
@ -71,7 +71,10 @@ export default (props:Params) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(productInfo.code) getShortCode()
|
if(productInfo.code) {
|
||||||
|
getShortCode()
|
||||||
|
setCollectStatus(() => productInfo.is_favorite)
|
||||||
|
}
|
||||||
}, [productInfo])
|
}, [productInfo])
|
||||||
|
|
||||||
|
|
||||||
@ -98,12 +101,7 @@ export default (props:Params) => {
|
|||||||
setShowPreview(true)
|
setShowPreview(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//收藏功能
|
|
||||||
const [collectStatus, setCollectStatus] = useState(false)
|
|
||||||
const changeCollect = () => {
|
|
||||||
setCollectStatus(!collectStatus)
|
|
||||||
setCollectionShow(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
const {setSortCode, userInfo : userObj } = useUserInfo()
|
const {setSortCode, userInfo : userObj } = useUserInfo()
|
||||||
//详情页获取分享短码
|
//详情页获取分享短码
|
||||||
@ -132,18 +130,26 @@ export default (props:Params) => {
|
|||||||
setShowOrderCount(true)
|
setShowOrderCount(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//加入收藏夹
|
//收藏功能
|
||||||
|
const [collectStatus, setCollectStatus] = useState(false)
|
||||||
const [collectionShow, setCollectionShow] = useState(false)
|
const [collectionShow, setCollectionShow] = useState(false)
|
||||||
const {fetchData: addFavoritefetchData} = AddFavoriteApi()
|
const {fetchData: addFavoritefetchData} = AddFavoriteApi()
|
||||||
const onAdd = useCallback(async (val) => {
|
const onAdd = useCallback(async (val) => {
|
||||||
let res = await addFavoritefetchData({favorite_id: val.id, product_id: Number(params.id)})
|
let res = await addFavoritefetchData({favorite_id: val.id, product_id: Number(params.id)})
|
||||||
if(res.success) {
|
if(res.success) {
|
||||||
alert.success('添加成功')
|
alert.success('添加成功')
|
||||||
|
setCollectStatus(true)
|
||||||
} else {
|
} else {
|
||||||
alert.none(res.msg)
|
alert.none(res.msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
setCollectionShow(false)
|
setCollectionShow(false)
|
||||||
}, [params])
|
}, [params])
|
||||||
|
const closeCollection = useCallback(() => {
|
||||||
|
setCollectionShow(false)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//页面下拉刷新
|
//页面下拉刷新
|
||||||
@ -165,8 +171,8 @@ export default (props:Params) => {
|
|||||||
<View className={styles.text}>分享</View>
|
<View className={styles.text}>分享</View>
|
||||||
<Button open-type="share" className={styles.shareBtn}></Button>
|
<Button open-type="share" className={styles.shareBtn}></Button>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.collect}>
|
<View className={styles.collect} onClick={() => setCollectionShow(true)}>
|
||||||
<View className={classnames('iconfont icon-shoucang', styles.miconfont, collectStatus&&styles.collected)} onClick={() => changeCollect()}></View>
|
<View className={classnames(`iconfont ${collectStatus?'icon-shoucang-pressed':'icon-shoucang'}`, styles.miconfont, collectStatus&&styles.collected)} ></View>
|
||||||
<View className={styles.text}>收藏</View>
|
<View className={styles.text}>收藏</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@ -213,7 +219,7 @@ export default (props:Params) => {
|
|||||||
</CustomWrapper>
|
</CustomWrapper>
|
||||||
<ShopCart show={showCart} onClose={() => setShowCart(false)}/>
|
<ShopCart show={showCart} onClose={() => setShowCart(false)}/>
|
||||||
<Preview value={colorInfo} show={showPreview} onClose={() => setShowPreview(false)}/>
|
<Preview value={colorInfo} show={showPreview} onClose={() => setShowPreview(false)}/>
|
||||||
<AddCollection show={collectionShow} onAdd={onAdd}/>
|
<AddCollection show={collectionShow} onAdd={onAdd} onClose={closeCollection}/>
|
||||||
<View className='common_safe_area_y'></View>
|
<View className='common_safe_area_y'></View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -168,6 +168,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
<View className={styles.order_list_item_title}>
|
<View className={styles.order_list_item_title}>
|
||||||
{colorItem.code + ' ' + colorItem.name}
|
{colorItem.code + ' ' + colorItem.name}
|
||||||
{colorItem?.return_roll&&<Text>{`已退${colorItem?.return_roll}条`}</Text>}
|
{colorItem?.return_roll&&<Text>{`已退${colorItem?.return_roll}条`}</Text>}
|
||||||
|
{colorItem?.apply_return_roll&&<Text>{`待退${colorItem?.apply_return_roll}条`}</Text>}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_list_item_price}>
|
<View className={styles.order_list_item_price}>
|
||||||
¥{standardPrice(colorItem.sale_price)}
|
¥{standardPrice(colorItem.sale_price)}
|
||||||
|
@ -27,6 +27,13 @@ $top:190px;
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 25px 0;
|
padding: 25px 0;
|
||||||
}
|
}
|
||||||
|
.playMode{
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
font-size: 26px;
|
||||||
|
text-align: center;
|
||||||
|
color: #707070;
|
||||||
|
}
|
||||||
|
|
||||||
.payment_list{
|
.payment_list{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@ -44,7 +51,7 @@ $top:190px;
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
border-bottom: 3px dashed #ccc;
|
border-bottom: 3px dashed #ccc;
|
||||||
top: $top;
|
top: $top;
|
||||||
width: calc(100% - 100px);
|
width: calc(100% - 50px);
|
||||||
left:0;
|
left:0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
@ -171,6 +171,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
<View className={styles.amount}>
|
<View className={styles.amount}>
|
||||||
<AmountShow status={2} number={formatPriceDiv(payInfo?.should_collect_money - payInfo?.amount_paid)}/>
|
<AmountShow status={2} number={formatPriceDiv(payInfo?.should_collect_money - payInfo?.amount_paid)}/>
|
||||||
</View>
|
</View>
|
||||||
|
{(payInfo?.delivery_payment_name)&&<View className={styles.playMode}>已使用{payInfo?.delivery_payment_name}方式付款</View>}
|
||||||
<View className={styles.payment_list}>
|
<View className={styles.payment_list}>
|
||||||
<View className={styles.payment_list_top_border}></View>
|
<View className={styles.payment_list_top_border}></View>
|
||||||
<View className={styles.payment_list_title}>
|
<View className={styles.payment_list_title}>
|
||||||
|
@ -35,6 +35,16 @@ import styles from './index.module.scss'
|
|||||||
getSaleOrderPreView()
|
getSaleOrderPreView()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//订单状态枚举
|
||||||
|
const {
|
||||||
|
SaleOrderStatusWaitingReceipt, // 待收货
|
||||||
|
SaleOrderStatusAlreadyReceipt, // 已收货
|
||||||
|
SaleOrderStatusComplete, // 已完成
|
||||||
|
SaleOrderStatusRefund, // 已退款
|
||||||
|
SaleOrderStatusCancel, // 已取消
|
||||||
|
SaleorderstatusWaitingPrePayment, // 预付款
|
||||||
|
} = ORDER_STATUS
|
||||||
|
|
||||||
//获取订单详情
|
//获取订单详情
|
||||||
const [orderDetail, setOrderDetail] = useState<any>() //获取到的原始数据
|
const [orderDetail, setOrderDetail] = useState<any>() //获取到的原始数据
|
||||||
const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi()
|
const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi()
|
||||||
@ -123,6 +133,17 @@ import styles from './index.module.scss'
|
|||||||
}
|
}
|
||||||
setShowDesc(() => false)
|
setShowDesc(() => false)
|
||||||
}, [])
|
}, [])
|
||||||
|
const noCanOpenDescList = useRef([
|
||||||
|
SaleOrderStatusWaitingReceipt.value, // 待收货
|
||||||
|
SaleOrderStatusAlreadyReceipt.value, // 已收货
|
||||||
|
SaleOrderStatusComplete.value, // 已完成
|
||||||
|
SaleOrderStatusRefund.value, // 已退款
|
||||||
|
SaleOrderStatusCancel.value, // 已取消
|
||||||
|
])
|
||||||
|
const descOpen = () => {
|
||||||
|
if(noCanOpenDescList.current.includes(orderDetail?.status)) return false
|
||||||
|
setShowDesc(() => true)
|
||||||
|
}
|
||||||
|
|
||||||
//去付款
|
//去付款
|
||||||
const [payMentShow, setPayMentShow] = useState(false)
|
const [payMentShow, setPayMentShow] = useState(false)
|
||||||
@ -192,8 +213,7 @@ import styles from './index.module.scss'
|
|||||||
}
|
}
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
|
|
||||||
//订单状态枚举
|
|
||||||
const {SaleOrderStatusCancel, SaleorderstatusWaitingPrePayment} = ORDER_STATUS
|
|
||||||
|
|
||||||
//刷新页面
|
//刷新页面
|
||||||
const refresh = useCallback(() => {
|
const refresh = useCallback(() => {
|
||||||
@ -273,7 +293,7 @@ import styles from './index.module.scss'
|
|||||||
<Text>{formatDateTime(orderDetail?.payment_time)}</Text>
|
<Text>{formatDateTime(orderDetail?.payment_time)}</Text>
|
||||||
</SearchInput>}
|
</SearchInput>}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_desc} onClick={() => setShowDesc(true)}>
|
<View className={styles.order_desc} onClick={descOpen}>
|
||||||
<View className={styles.order_desc_con}>订单备注</View>
|
<View className={styles.order_desc_con}>订单备注</View>
|
||||||
{
|
{
|
||||||
orderRemark&&<View className={styles.order_desc_text}>{orderDetail?.remark}</View>||
|
orderRemark&&<View className={styles.order_desc_text}>{orderDetail?.remark}</View>||
|
||||||
|
@ -9,39 +9,47 @@
|
|||||||
.user{
|
.user{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.name {
|
|
||||||
color: #000;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-left: 15px;
|
|
||||||
font-size: $font_size;
|
|
||||||
}
|
|
||||||
image{
|
image{
|
||||||
width: 70px;
|
width: 70px;
|
||||||
height: 70px;
|
height: 70px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.order_con {
|
||||||
|
padding-left: 15px;
|
||||||
|
width: 100%;
|
||||||
|
.name {
|
||||||
|
color: #000;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: $font_size;
|
||||||
|
}
|
||||||
.order_num {
|
.order_num {
|
||||||
flex: 1;
|
|
||||||
font-size: $font_size_medium;
|
font-size: $font_size_medium;
|
||||||
color: $color_font_one;
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 30px;
|
padding-right: 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
.order_num_con{
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
.miconfont {
|
.miconfont {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
.order_no{
|
||||||
|
|
||||||
}
|
}
|
||||||
.tag{
|
|
||||||
font-size: $font_size_min;
|
|
||||||
padding: 5px 15px;
|
|
||||||
background-color: $color_main;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 0px 20px 0px 20px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.product_status{
|
||||||
|
font-size: $font_size;
|
||||||
|
color: $color_main;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
.product_con{
|
.product_con{
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
@ -63,9 +71,15 @@
|
|||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
@include common_ellipsis()
|
@include common_ellipsis()
|
||||||
}
|
}
|
||||||
.product_status{
|
|
||||||
font-size: $font_size;
|
.tag{
|
||||||
color: $color_main;
|
font-size: $font_size_min;
|
||||||
|
padding: 5px 15px;
|
||||||
|
background-color: $color_main;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 0px 20px 0px 20px;
|
||||||
|
position:relative;
|
||||||
|
right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.product_list{
|
.product_list{
|
||||||
|
@ -5,6 +5,7 @@ import OrderBtns from "@/components/orderBtns";
|
|||||||
import Payment from "@/pages/order/components/payment";
|
import Payment from "@/pages/order/components/payment";
|
||||||
import { useSelector } from "@/reducers/hooks";
|
import { useSelector } from "@/reducers/hooks";
|
||||||
import { Image, Text, View } from "@tarojs/components"
|
import { Image, Text, View } from "@tarojs/components"
|
||||||
|
import { useRouter } from "@tarojs/taro";
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
@ -34,6 +35,7 @@ type Param = {
|
|||||||
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
||||||
}
|
}
|
||||||
export default memo(({value, onClickBtn}: Param) => {
|
export default memo(({value, onClickBtn}: Param) => {
|
||||||
|
|
||||||
const userInfo = useSelector(state => state.userInfo)
|
const userInfo = useSelector(state => state.userInfo)
|
||||||
//对应数量
|
//对应数量
|
||||||
const formatCount = useCallback((item, sale_mode) => {
|
const formatCount = useCallback((item, sale_mode) => {
|
||||||
@ -71,19 +73,25 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
<View className={styles.header} onClick={() => goLink('/pages/order/index', {id: value?.id})}>
|
<View className={styles.header} onClick={() => goLink('/pages/order/index', {id: value?.id})}>
|
||||||
<View className={styles.user}>
|
<View className={styles.user}>
|
||||||
<Image src={`${userInfo?.adminUserInfo?.avatar_url}`}/>
|
<Image src={`${userInfo?.adminUserInfo?.avatar_url}`}/>
|
||||||
<Text className={styles.name}>{userInfo?.adminUserInfo?.user_name}</Text>
|
|
||||||
</View>
|
</View>
|
||||||
|
<View className={styles.order_con}>
|
||||||
|
<Text className={styles.name}>{userInfo?.adminUserInfo?.user_name}</Text>
|
||||||
<View className={styles.order_num}>
|
<View className={styles.order_num}>
|
||||||
<Text>订单号:{value?.order_no}</Text>
|
<View className={styles.order_num_con}>
|
||||||
|
<Text className={styles.order_no}>订单号:{value?.order_no}</Text>
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont, icon-a-moreback')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont, icon-a-moreback')}></Text>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.tag}>{value?.shipment_mode_name}</View>
|
<View className={styles.product_status}>{value?.status_name}</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.product_con} onClick={() => goLink('/pages/order/index', {id: value?.id})}>
|
<View className={styles.product_con} onClick={() => goLink('/pages/order/index', {id: value?.id})}>
|
||||||
<View className={styles.product_title}>
|
<View className={styles.product_title}>
|
||||||
<View className={styles.product_tag}>{value?.sale_mode_name}</View>
|
<View className={styles.product_tag}>{value?.sale_mode_name}</View>
|
||||||
<View className={styles.product_name}>{formatHashTag(value?.product_list[0].code, value?.product_list[0].name)}</View>
|
<View className={styles.product_name}>{formatHashTag(value?.product_list[0].code, value?.product_list[0].name)}</View>
|
||||||
<View className={styles.product_status}>{value?.status_name}</View>
|
<View className={styles.tag}>{value?.shipment_mode_name}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.product_list}>
|
<View className={styles.product_list}>
|
||||||
<View className={styles.image}>
|
<View className={styles.image}>
|
||||||
|
@ -15,8 +15,8 @@ export default memo(({list = [], defaultId = null, onSelect}: Param) => {
|
|||||||
})
|
})
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(defaultId) {
|
if(defaultId) {
|
||||||
|
console.log('defaultId:::', defaultId)
|
||||||
const index = list?.findIndex(item => {
|
const index = list?.findIndex(item => {
|
||||||
console.log(item.id, defaultId)
|
|
||||||
return item.id == defaultId
|
return item.id == defaultId
|
||||||
})
|
})
|
||||||
if(index !== -1) {
|
if(index !== -1) {
|
||||||
@ -24,6 +24,7 @@ export default memo(({list = [], defaultId = null, onSelect}: Param) => {
|
|||||||
setSelectInfo((e) => ({...e, tabId:list[num].id.toString()}))
|
setSelectInfo((e) => ({...e, tabId:list[num].id.toString()}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setSelectInfo((e) => ({...e, selected: defaultId||-1}))
|
||||||
}, [defaultId])
|
}, [defaultId])
|
||||||
const clickEvent = ({item, index}: {item:any, index:number}) => {
|
const clickEvent = ({item, index}: {item:any, index:number}) => {
|
||||||
const num = index > 0?( index - 1) : 0
|
const num = index > 0?( index - 1) : 0
|
||||||
|
@ -14,6 +14,7 @@ import { AddShoppingCartApi } from "@/api/shopCart"
|
|||||||
import ShopCart from "@/components/shopCart"
|
import ShopCart from "@/components/shopCart"
|
||||||
import ApplyRefund from "./components/applyRefund"
|
import ApplyRefund from "./components/applyRefund"
|
||||||
import { alert } from "@/common/common"
|
import { alert } from "@/common/common"
|
||||||
|
import { useRouter } from "@tarojs/runtime"
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const {checkLogin} = useLogin()
|
const {checkLogin} = useLogin()
|
||||||
@ -21,12 +22,22 @@ export default () => {
|
|||||||
await checkLogin()
|
await checkLogin()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//传递过来的参数
|
||||||
|
const router = useRouter()
|
||||||
|
useEffect(() => {
|
||||||
|
if(router?.params.status != undefined && router?.params.status !== '') {
|
||||||
|
setSearchField((e) => ({...e, status: router?.params.status as number}))
|
||||||
|
} else {
|
||||||
|
setSearchField((e) => ({...e, status:-1}))
|
||||||
|
}
|
||||||
|
}, [router])
|
||||||
|
|
||||||
//搜索参数
|
//搜索参数
|
||||||
const [searchField, setSearchField] = useState({
|
const [searchField, setSearchField] = useState<{status: number|null, page: number, size: number, name: string}>({
|
||||||
status: -1,
|
status: null,
|
||||||
page : 1,
|
page : 1,
|
||||||
size : 10,
|
size : 10,
|
||||||
Name:''
|
name:''
|
||||||
})
|
})
|
||||||
|
|
||||||
//获取订单状态
|
//获取订单状态
|
||||||
@ -45,14 +56,13 @@ export default () => {
|
|||||||
const [orderData, setOrderData] = useState<{list:any[], total:number}>({list:[], total:0})
|
const [orderData, setOrderData] = useState<{list:any[], total:number}>({list:[], total:0})
|
||||||
const getOrderList = async () => {
|
const getOrderList = async () => {
|
||||||
let res = await listFetchData(getFilterData(searchField))
|
let res = await listFetchData(getFilterData(searchField))
|
||||||
setOrderData({list: res.data.list, total: res.data.total})
|
setOrderData((e) => ({...e, list: res.data.list, total: res.data.total}))
|
||||||
setRefresherTriggeredStatus(() => false)
|
setRefresherTriggeredStatus(() => false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//监听筛选条件变化
|
//监听筛选条件变化
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getOrderList()
|
if(searchField.status != null) getOrderList()
|
||||||
}, [searchField])
|
}, [searchField])
|
||||||
|
|
||||||
//上拉加载数据
|
//上拉加载数据
|
||||||
@ -173,7 +183,7 @@ export default () => {
|
|||||||
<View className={styles.order_list_main}>
|
<View className={styles.order_list_main}>
|
||||||
<View className={styles.title}>
|
<View className={styles.title}>
|
||||||
<Search placeIcon="out" placeholder="搜索商品/名称/颜色/订单号" showBtn={true} changeOnSearch={getSearchData} debounceTime={300}/>
|
<Search placeIcon="out" placeholder="搜索商品/名称/颜色/订单号" showBtn={true} changeOnSearch={getSearchData} debounceTime={300}/>
|
||||||
<OrderStatusList list={statusList} onSelect={changeStatus} defaultId={1}/>
|
<OrderStatusList list={statusList} onSelect={changeStatus} defaultId={router?.params.status as number}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_list}>
|
<View className={styles.order_list}>
|
||||||
<InfiniteScroll statusMore={statusMore} selfonScrollToLower={getScrolltolower} refresherEnabled={false} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={getRefresherRefresh}>
|
<InfiniteScroll statusMore={statusMore} selfonScrollToLower={getScrolltolower} refresherEnabled={false} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={getRefresherRefresh}>
|
||||||
|
@ -97,8 +97,8 @@ const Modal = memo((props: any) => {
|
|||||||
const Header = memo((props: any) => {
|
const Header = memo((props: any) => {
|
||||||
const { data } = props;
|
const { data } = props;
|
||||||
console.log(props, 'propsprops')
|
console.log(props, 'propsprops')
|
||||||
let menu = [{ text: "待配布", icon: "icon-daipeibu", url: "/pages/orderList/index" }, { text: "待付款", icon: "icon-daifukuan", url: "/pages/orderList/index" },
|
let menu = [{ text: "待配布", icon: "icon-daipeibu", url: "/pages/orderList/index?status=0" }, { text: "待付款", icon: "icon-daifukuan", url: "/pages/orderList/index?status=1" },
|
||||||
{ text: "待发货", icon: "icon-daifahuo", url: "/pages/orderList/index" }, { text: "已发货", icon: "icon-yifahuo", url: "/pages/orderList/index" },
|
{ text: "待发货", icon: "icon-daifahuo", url: "/pages/orderList/index?status=2" }, { text: "已发货", icon: "icon-yifahuo", url: "/pages/orderList/index?status=3" },
|
||||||
{ text: "退款/售后", icon: "icon-a-tuikuanshouhou", url: "/pages/salesAfterList/index" }];
|
{ text: "退款/售后", icon: "icon-a-tuikuanshouhou", url: "/pages/salesAfterList/index" }];
|
||||||
const { getPhoneNumber } = useLogin();
|
const { getPhoneNumber } = useLogin();
|
||||||
const mGetPhoneNumber = (ev) => {
|
const mGetPhoneNumber = (ev) => {
|
||||||
|
@ -123,17 +123,20 @@ export default () => {
|
|||||||
// mall 电子商城相关的 全平台
|
// mall 电子商城相关的 全平台
|
||||||
// logistics 物流(发货、提货)相关的、图片、视频 全平台
|
// logistics 物流(发货、提货)相关的、图片、视频 全平台
|
||||||
type cdn_upload_type_Param = 'product'|'after-sale'|'mall'|'logistics'
|
type cdn_upload_type_Param = 'product'|'after-sale'|'mall'|'logistics'
|
||||||
const getWxPhoto = (cdn_upload_type: cdn_upload_type_Param) => {
|
const getWxPhoto = (cdn_upload_type: cdn_upload_type_Param, count: number = 1) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
let list:any[] = []
|
||||||
Taro.chooseImage({
|
Taro.chooseImage({
|
||||||
count: 1,
|
count: count,
|
||||||
sizeType: ['original', 'compressed'],
|
sizeType: ['original', 'compressed'],
|
||||||
sourceType: ['album', 'camera'],
|
sourceType: ['album', 'camera'],
|
||||||
success: async function (res) {
|
success: async function (res) {
|
||||||
const file = res.tempFiles[0]
|
|
||||||
try {
|
try {
|
||||||
let data = await uploadCDNImg(file, cdn_upload_type, cdn_upload_type)
|
for(let i = 0; i < res.tempFiles.length; i++) {
|
||||||
resolve(data)
|
let data = await uploadCDNImg(res.tempFiles[i], cdn_upload_type, cdn_upload_type)
|
||||||
|
list.push(data)
|
||||||
|
}
|
||||||
|
resolve(list)
|
||||||
} catch(res) {
|
} catch(res) {
|
||||||
reject(res)
|
reject(res)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user