diff --git a/src/app.config.ts b/src/app.config.ts index 0d19c18..66e2c08 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -176,6 +176,7 @@ export default { root: "pages/collection", pages: [ "index", + "collectionClass/index" ] }, { diff --git a/src/common/constant.js b/src/common/constant.js index 3dc9ec4..9eb3a66 100644 --- a/src/common/constant.js +++ b/src/common/constant.js @@ -10,8 +10,8 @@ // 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.7:50002/lymarket` // 添 -export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰 +export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添 +// export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰 // CDN // 生成密钥 diff --git a/src/common/util.ts b/src/common/util.ts index 15f5d6b..e136a9a 100644 --- a/src/common/util.ts +++ b/src/common/util.ts @@ -43,11 +43,11 @@ export const throttle = (fn, delay) => { let res = {} for(let key in val) { 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])) { res[key] = val[key] } - }else{ + } else{ res[key] = val[key] } } diff --git a/src/components/checkbox/index.module.scss b/src/components/checkbox/index.module.scss index b50f17d..8224c9a 100644 --- a/src/components/checkbox/index.module.scss +++ b/src/components/checkbox/index.module.scss @@ -12,6 +12,7 @@ border-radius: 50%; text-align: center; line-height: 40px; + background-color: #fff; } .no_checkbox_item{ border:0; diff --git a/src/components/product/index.module.scss b/src/components/product/index.module.scss index 793b028..3b62f33 100644 --- a/src/components/product/index.module.scss +++ b/src/components/product/index.module.scss @@ -53,7 +53,7 @@ margin-top: 16px; flex-wrap: wrap; .tag, .tag_g{ - max-width: 150rpx; + max-width: 260rpx; padding: 3px 10px; background-color: #CDE5FF; font-size: $font_size_min; diff --git a/src/components/uploadImage/index.tsx b/src/components/uploadImage/index.tsx index 9fe4775..25aa9cd 100644 --- a/src/components/uploadImage/index.tsx +++ b/src/components/uploadImage/index.tsx @@ -21,10 +21,14 @@ const PictureItem:FC = memo(({onChange, defaultList}) => { //上传图片 const uploadImage = async () => { - let res:any = await getWxPhoto('after-sale') - if(res.code == 200) { - setImageLise([...imageList, res.url]) - } + let list:any = await getWxPhoto('after-sale', 5) + let images:any[] = [] + console.log('item22:::', list.length) + list?.map(item => { + console.log('item:::', item) + images.push(item.url) + }) + setImageLise([...imageList, ...images]) } //删除图片 const delImage = (index) => { diff --git a/src/pages/applyAfterSales/components/cutKindList/index.tsx b/src/pages/applyAfterSales/components/cutKindList/index.tsx index 826ef66..2af3855 100644 --- a/src/pages/applyAfterSales/components/cutKindList/index.tsx +++ b/src/pages/applyAfterSales/components/cutKindList/index.tsx @@ -41,10 +41,9 @@ const kindeList:FC = memo(({order, onSelectChange}) => { //判断该面料下的颜色都退完了 const colorNum = (item) => { - let res = item.product_colors.some(val => { - return val.return_roll == 0 + return item.product_colors.some(val => { + return val.return_roll + val.apply_return_roll == 0 }) - return res } return ( @@ -55,7 +54,7 @@ const kindeList:FC = memo(({order, onSelectChange}) => { {formatHashTag(item.code, item.name)} - {item.product_colors.map(colorItem => (colorItem.return_roll == 0)&& + {item.product_colors.map(colorItem => ((colorItem.return_roll + colorItem.apply_return_roll) == 0)&& {colorItem.code + ' ' + colorItem.name}x {formatCount(colorItem)} selectCallBack(colorItem)} onClose={() => colseCallBack(colorItem)}/> diff --git a/src/pages/applyAfterSales/components/kindList/index.tsx b/src/pages/applyAfterSales/components/kindList/index.tsx index 9b7492e..f046edb 100644 --- a/src/pages/applyAfterSales/components/kindList/index.tsx +++ b/src/pages/applyAfterSales/components/kindList/index.tsx @@ -24,7 +24,7 @@ type Param = { const kindeList:FC = memo(({order, onNumChange}) => { //对应数量 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]) //计步器失返回值 @@ -50,11 +50,11 @@ const kindeList:FC = memo(({order, onNumChange}) => { {formatHashTag(item.code, item.name)} - {item.product_colors.map(colorItem => (colorItem.return_roll < colorItem.roll)&& + {item.product_colors.map(colorItem => ((colorItem.return_roll + colorItem.apply_return_roll) < colorItem.roll)&& {colorItem.code + ' ' + colorItem.name}x {formatCount(colorItem)} - + )} diff --git a/src/pages/collection/collectionClass/index.config.ts b/src/pages/collection/collectionClass/index.config.ts new file mode 100644 index 0000000..42b7aff --- /dev/null +++ b/src/pages/collection/collectionClass/index.config.ts @@ -0,0 +1,4 @@ +export default { + navigationBarTitleText: '我的收藏a', + enableShareAppMessage: true, +} diff --git a/src/pages/collection/collectionClass/index.module.scss b/src/pages/collection/collectionClass/index.module.scss new file mode 100644 index 0000000..7762701 --- /dev/null +++ b/src/pages/collection/collectionClass/index.module.scss @@ -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; + + } +} \ No newline at end of file diff --git a/src/pages/collection/collectionClass/index.tsx b/src/pages/collection/collectionClass/index.tsx new file mode 100644 index 0000000..b19f63d --- /dev/null +++ b/src/pages/collection/collectionClass/index.tsx @@ -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([]) + 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 ( + + + + + + + selectCallBack()} onClose={() => colseCallBack()}/> + 全选 + + + 移动到 + 取消收藏 + + + + + + + ) + } \ No newline at end of file diff --git a/src/pages/collection/components/product/index.module.scss b/src/pages/collection/components/product/index.module.scss new file mode 100644 index 0000000..691077d --- /dev/null +++ b/src/pages/collection/components/product/index.module.scss @@ -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); + } + } +} diff --git a/src/pages/collection/components/product/index.tsx b/src/pages/collection/components/product/index.tsx new file mode 100644 index 0000000..bca82bd --- /dev/null +++ b/src/pages/collection/components/product/index.tsx @@ -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([]) + 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 ( + + {list?.map(item => { + return goLink(`/pages/details/index?id=${item.id}`)}> + + onSelect(item, e)} onClose={() => onClose(item, e)}/> + + + + {item.product_color_count}色 + + + {formatHashTag(item.product_code, '')} {item.product_name} + + {item.width} + {item.weight_density} + + {item.component} + {desStatus&&{item.describe}} + + + })} + + ) +} diff --git a/src/pages/collection/index.tsx b/src/pages/collection/index.tsx index 92bb98c..88ad54e 100644 --- a/src/pages/collection/index.tsx +++ b/src/pages/collection/index.tsx @@ -1,7 +1,7 @@ import { CreateFavoriteApi, DelFavoriteApi, FavoriteListApi, UpdateFavoriteApi } from "@/api/favorite"; import { alert } from "@/common/common"; import { getFilterData } from "@/common/util"; -import Product from "@/components/product"; +import Product from "./components/product"; import Search from "@/components/search" import { Text, View } from "@tarojs/components" import Taro from "@tarojs/taro"; @@ -127,7 +127,6 @@ export default () => { setCollectioinShow(false) } - return ( diff --git a/src/pages/details/index.module.scss b/src/pages/details/index.module.scss index 750aefa..ed14ea5 100644 --- a/src/pages/details/index.module.scss +++ b/src/pages/details/index.module.scss @@ -43,7 +43,7 @@ opacity: 0; } .miconfont{ - font-size: 36px; + font-size: 45px; } .collected{ color: #FFC300; diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx index 5b2fbc0..00c1c17 100644 --- a/src/pages/details/index.tsx +++ b/src/pages/details/index.tsx @@ -71,7 +71,10 @@ export default (props:Params) => { } useEffect(() => { - if(productInfo.code) getShortCode() + if(productInfo.code) { + getShortCode() + setCollectStatus(() => productInfo.is_favorite) + } }, [productInfo]) @@ -98,12 +101,7 @@ export default (props:Params) => { setShowPreview(true) } - //收藏功能 - const [collectStatus, setCollectStatus] = useState(false) - const changeCollect = () => { - setCollectStatus(!collectStatus) - setCollectionShow(true) - } + const {setSortCode, userInfo : userObj } = useUserInfo() //详情页获取分享短码 @@ -132,20 +130,28 @@ export default (props:Params) => { setShowOrderCount(true) } - //加入收藏夹 + //收藏功能 + const [collectStatus, setCollectStatus] = useState(false) const [collectionShow, setCollectionShow] = useState(false) const {fetchData: addFavoritefetchData} = AddFavoriteApi() const onAdd = useCallback(async (val) => { let res = await addFavoritefetchData({favorite_id: val.id, product_id: Number(params.id)}) if(res.success) { alert.success('添加成功') + setCollectStatus(true) } else { alert.none(res.msg) } + setCollectionShow(false) }, [params]) + const closeCollection = useCallback(() => { + setCollectionShow(false) + }, []) + + //页面下拉刷新 usePullDownRefresh(() => { getProductDetail() @@ -165,8 +171,8 @@ export default (props:Params) => { 分享 - - changeCollect()}> + setCollectionShow(true)}> + 收藏 @@ -213,7 +219,7 @@ export default (props:Params) => { setShowCart(false)}/> setShowPreview(false)}/> - + ) diff --git a/src/pages/order/components/kindList/index.tsx b/src/pages/order/components/kindList/index.tsx index b2c2288..0696239 100644 --- a/src/pages/order/components/kindList/index.tsx +++ b/src/pages/order/components/kindList/index.tsx @@ -168,6 +168,7 @@ export default memo(({order, comfirm = false}:Param) => { {colorItem.code + ' ' + colorItem.name} {colorItem?.return_roll&&{`已退${colorItem?.return_roll}条`}} + {colorItem?.apply_return_roll&&{`待退${colorItem?.apply_return_roll}条`}} ¥{standardPrice(colorItem.sale_price)} diff --git a/src/pages/order/components/payment/index.module.scss b/src/pages/order/components/payment/index.module.scss index ade0ca3..f2828c7 100644 --- a/src/pages/order/components/payment/index.module.scss +++ b/src/pages/order/components/payment/index.module.scss @@ -27,6 +27,13 @@ $top:190px; text-align: center; padding: 25px 0; } + .playMode{ + width: 100%; + padding-bottom: 20px; + font-size: 26px; + text-align: center; + color: #707070; + } .payment_list{ background-color: #fff; @@ -44,7 +51,7 @@ $top:190px; position: absolute; border-bottom: 3px dashed #ccc; top: $top; - width: calc(100% - 100px); + width: calc(100% - 50px); left:0; right: 0; margin: auto; diff --git a/src/pages/order/components/payment/index.tsx b/src/pages/order/components/payment/index.tsx index a452a89..acb049f 100644 --- a/src/pages/order/components/payment/index.tsx +++ b/src/pages/order/components/payment/index.tsx @@ -171,6 +171,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param) + {(payInfo?.delivery_payment_name)&&已使用{payInfo?.delivery_payment_name}方式付款} diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx index 241b857..fb72266 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/index.tsx @@ -35,6 +35,16 @@ import styles from './index.module.scss' getSaleOrderPreView() }) + //订单状态枚举 + const { + SaleOrderStatusWaitingReceipt, // 待收货 + SaleOrderStatusAlreadyReceipt, // 已收货 + SaleOrderStatusComplete, // 已完成 + SaleOrderStatusRefund, // 已退款 + SaleOrderStatusCancel, // 已取消 + SaleorderstatusWaitingPrePayment, // 预付款 + } = ORDER_STATUS + //获取订单详情 const [orderDetail, setOrderDetail] = useState() //获取到的原始数据 const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi() @@ -123,6 +133,17 @@ import styles from './index.module.scss' } 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) @@ -192,8 +213,7 @@ import styles from './index.module.scss' } }, [orderDetail]) - //订单状态枚举 - const {SaleOrderStatusCancel, SaleorderstatusWaitingPrePayment} = ORDER_STATUS + //刷新页面 const refresh = useCallback(() => { @@ -273,7 +293,7 @@ import styles from './index.module.scss' {formatDateTime(orderDetail?.payment_time)} } - setShowDesc(true)}> + 订单备注 { orderRemark&&{orderDetail?.remark}|| diff --git a/src/pages/orderList/components/order/index.module.scss b/src/pages/orderList/components/order/index.module.scss index d63a621..edbaba9 100644 --- a/src/pages/orderList/components/order/index.module.scss +++ b/src/pages/orderList/components/order/index.module.scss @@ -9,38 +9,46 @@ .user{ display: flex; align-items: center; - .name { - color: #000; - font-weight: 700; - margin-left: 15px; - font-size: $font_size; - } + image{ width: 70px; height: 70px; border-radius: 50%; } } - .order_num { - flex: 1; - font-size: $font_size_medium; - color: $color_font_one; - text-align: right; - padding-right: 30px; - display: flex; - justify-content: flex-end; - align-items: center; - .miconfont { - font-size: 20px; + .order_con { + padding-left: 15px; + width: 100%; + .name { + color: #000; + font-weight: 700; + font-size: $font_size; + } + .order_num { + font-size: $font_size_medium; + padding-right: 30px; + display: flex; + justify-content: flex-start; + align-items: center; + width: 100%; + .order_num_con{ + flex:1; + } + .miconfont { + 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{ margin-bottom: 20px; @@ -63,9 +71,15 @@ padding: 0 20px; @include common_ellipsis() } - .product_status{ - font-size: $font_size; - color: $color_main; + + .tag{ + 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{ diff --git a/src/pages/orderList/components/order/index.tsx b/src/pages/orderList/components/order/index.tsx index aff2e02..960f734 100644 --- a/src/pages/orderList/components/order/index.tsx +++ b/src/pages/orderList/components/order/index.tsx @@ -5,6 +5,7 @@ import OrderBtns from "@/components/orderBtns"; import Payment from "@/pages/order/components/payment"; import { useSelector } from "@/reducers/hooks"; import { Image, Text, View } from "@tarojs/components" +import { useRouter } from "@tarojs/taro"; import classnames from "classnames"; import { memo, useCallback, useMemo, useRef, useState } from "react"; import styles from './index.module.scss' @@ -34,6 +35,7 @@ type Param = { onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void } export default memo(({value, onClickBtn}: Param) => { + const userInfo = useSelector(state => state.userInfo) //对应数量 const formatCount = useCallback((item, sale_mode) => { @@ -71,19 +73,25 @@ export default memo(({value, onClickBtn}: Param) => { goLink('/pages/order/index', {id: value?.id})}> + + {userInfo?.adminUserInfo?.user_name} + + + 订单号:{value?.order_no} + + + {value?.status_name} + - - 订单号:{value?.order_no} - - - {value?.shipment_mode_name} + + goLink('/pages/order/index', {id: value?.id})}> {value?.sale_mode_name} {formatHashTag(value?.product_list[0].code, value?.product_list[0].name)} - {value?.status_name} + {value?.shipment_mode_name} diff --git a/src/pages/orderList/components/orderStatusList/index.tsx b/src/pages/orderList/components/orderStatusList/index.tsx index 3e12f6f..1257330 100644 --- a/src/pages/orderList/components/orderStatusList/index.tsx +++ b/src/pages/orderList/components/orderStatusList/index.tsx @@ -15,8 +15,8 @@ export default memo(({list = [], defaultId = null, onSelect}: Param) => { }) useEffect(() => { if(defaultId) { + console.log('defaultId:::', defaultId) const index = list?.findIndex(item => { - console.log(item.id, defaultId) return item.id == defaultId }) 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, selected: defaultId||-1})) }, [defaultId]) const clickEvent = ({item, index}: {item:any, index:number}) => { const num = index > 0?( index - 1) : 0 diff --git a/src/pages/orderList/index.tsx b/src/pages/orderList/index.tsx index 10a3d57..42adcc6 100644 --- a/src/pages/orderList/index.tsx +++ b/src/pages/orderList/index.tsx @@ -14,6 +14,7 @@ import { AddShoppingCartApi } from "@/api/shopCart" import ShopCart from "@/components/shopCart" import ApplyRefund from "./components/applyRefund" import { alert } from "@/common/common" +import { useRouter } from "@tarojs/runtime" export default () => { const {checkLogin} = useLogin() @@ -21,12 +22,22 @@ export default () => { 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({ - status: -1, + const [searchField, setSearchField] = useState<{status: number|null, page: number, size: number, name: string}>({ + status: null, page : 1, size : 10, - Name:'' + name:'' }) //获取订单状态 @@ -45,14 +56,13 @@ export default () => { const [orderData, setOrderData] = useState<{list:any[], total:number}>({list:[], total:0}) const getOrderList = async () => { 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) } - //监听筛选条件变化 useEffect(() => { - getOrderList() + if(searchField.status != null) getOrderList() }, [searchField]) //上拉加载数据 @@ -173,7 +183,7 @@ export default () => { - + diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index be206a9..f578118 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -97,8 +97,8 @@ const Modal = memo((props: any) => { const Header = memo((props: any) => { const { data } = props; console.log(props, 'propsprops') - 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" }, + 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?status=2" }, { text: "已发货", icon: "icon-yifahuo", url: "/pages/orderList/index?status=3" }, { text: "退款/售后", icon: "icon-a-tuikuanshouhou", url: "/pages/salesAfterList/index" }]; const { getPhoneNumber } = useLogin(); const mGetPhoneNumber = (ev) => { diff --git a/src/use/useUploadImage.ts b/src/use/useUploadImage.ts index 86c698e..53be2f3 100644 --- a/src/use/useUploadImage.ts +++ b/src/use/useUploadImage.ts @@ -123,17 +123,20 @@ export default () => { // 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) => { + let list:any[] = [] Taro.chooseImage({ - count: 1, + count: count, sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success: async function (res) { - const file = res.tempFiles[0] try { - let data = await uploadCDNImg(file, cdn_upload_type, cdn_upload_type) - resolve(data) + for(let i = 0; i < res.tempFiles.length; i++) { + let data = await uploadCDNImg(res.tempFiles[i], cdn_upload_type, cdn_upload_type) + list.push(data) + } + resolve(list) } catch(res) { reject(res) }