diff --git a/config/index.js b/config/index.js index bf9f0ac..a70400a 100644 --- a/config/index.js +++ b/config/index.js @@ -5,11 +5,11 @@ const versions = encoding: 'utf8', }) != 'HEAD\n' ? childProcess.execSync('git rev-parse --abbrev-ref HEAD', { - encoding: 'utf8', - }) + encoding: 'utf8', + }) : childProcess.execSync('git describe --tags --abbrev=0', { - encoding: 'utf8', - }) + encoding: 'utf8', + }) const CURRENT_GITHASH = childProcess.execSync('git rev-parse --short HEAD', { encoding: 'utf8', }) @@ -18,19 +18,6 @@ const CURRENT_VERSION = `Version: ${JSON.stringify(process.env.CODE_BRANCH || ve '', ) -const CIPluginOpt = { - // 微信小程序 - weapp: { - appid: 'wx64fe67f111d52457', - privateKeyPath: 'key/private.wx64fe67f111d52457.key', - // devToolsInstallPath: 'D:/weixin/微信web开发者工具', - }, - // 版本号 - version: versions, - // 版本发布描述 - desc: versions, -} - const config = { projectName: 'EShop', date: '2022-4-6', @@ -42,7 +29,6 @@ const config = { }, sourceRoot: 'src', outputRoot: 'dist', - plugins: [['@tarojs/plugin-mini-ci', CIPluginOpt]], defineConstants: { CURRENT_VERSION: JSON.stringify(CURRENT_VERSION), CURRENT_GITHASH: JSON.stringify(CURRENT_GITHASH), diff --git a/package.json b/package.json index f42e7d4..1503ff7 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,7 @@ "dev:jd": "npm run build:jd -- --watch", "dev:quickapp": "npm run build:quickapp -- --watch", "build:weapp:pre": "cross-env NODE_ENV=pre taro build --type weapp", - "dev:weapp:pre": "cross-env NODE_ENV=pre npm run build:weapp -- --watch", - "buildo:weapp:open": "taro build --type weapp --open", - "build:weapp:upload": "taro build --type weapp --upload", - "build:weapp:preview": "taro build --type weapp --preview" + "dev:weapp:pre": "cross-env NODE_ENV=pre npm run build:weapp -- --watch" }, "browserslist": [ "last 3 versions", @@ -78,4 +75,4 @@ "stylelint": "9.3.0", "typescript": "^4.1.0" } -} +} \ No newline at end of file diff --git a/project.config.json b/project.config.json index e796931..bb243d2 100644 --- a/project.config.json +++ b/project.config.json @@ -1,8 +1,8 @@ { "miniprogramRoot": "dist/", - "projectname": "EShop", + "projectname": "Mall-lymarket", "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "appid": "wx68d92d7cbf0b6963", + "appid": "wxa41b2eda1c6b557a", "setting": { "urlCheck": true, "es6": false, diff --git a/src/app.config.ts b/src/app.config.ts index eee2dca..c3a8af3 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,6 +1,7 @@ export default { pages: [ 'pages/index/index', + 'pages/order/index', 'pages/user/index', ], window: { @@ -15,14 +16,20 @@ export default { { pagePath: 'pages/index/index', text: '首页', - iconPath: './styles/tabbar/home.png', - selectedIconPath: './styles/tabbar/home_selected.png', + iconPath: './styles/tabbar/list.png', + selectedIconPath: './styles/tabbar/list_on.png', + }, + { + pagePath: 'pages/order/index', + text: '订单', + iconPath: './styles/tabbar/order.png', + selectedIconPath: './styles/tabbar/order_on.png', }, { pagePath: 'pages/user/index', text: '我的', iconPath: './styles/tabbar/my.png', - selectedIconPath: './styles/tabbar/my_selected.png', + selectedIconPath: './styles/tabbar/my_on.png', } ], 'color': '#707070', @@ -31,156 +38,7 @@ export default { 'borderStyle': 'white' }, subPackages: [ - { - root: "pages/search", - pages: [ - "index" - ] - }, - { - root: "pages/classList", - pages: [ - "index" - ] - }, - { - root: "pages/details", - pages: [ - "index", - ] - }, - { - root: "pages/searchList", - pages: [ - "searchList", - "hightSearchList", - "search" - ] - }, - { - root: "pages/userEdit", - pages: [ - "index" - ] - }, - { - root: "pages/addressManager", - pages: [ - "index" - ] - }, - { - root: "pages/addressAdd", - pages: [ - "index" - ] - }, - { - root: "pages/company", - pages: [ - "index" - ] - }, - { - root: "pages/weightList", - pages: [ - "index" - ] - }, - { - root: "pages/weightListAdd", - pages: [ - "index" - ] - }, - { - root: "pages/order", - pages: [ - "index", - "comfirm", - "orderList/index" - ] - }, - { - root: "pages/editOrder", - pages: [ - "index", - ] - }, - { - root: "pages/subjectList", - pages: [ - "index", - ] - }, - { - root: "pages/creditLine", - pages: [ - "index" - ] - }, - { - root: "pages/creditUsed", - pages: [ - "index" - ] - }, - { - root: "pages/depositBeforehandDetail", - pages: [ - "index" - ] - }, - { - root: "pages/depositBeforehand", - pages: [ - "index" - ] - }, - { - root: "pages/depositList", - pages: [ - "index" - ] - }, - { - root: "pages/salesAfter", - pages: [ - "index", - "salesAfterList/index" - ] - }, - { - root: "pages/certification", - pages: [ - "index", - ] - }, - { - root: "pages/applyAfterSales", - pages: [ - "index", - ] - }, - { - root: "pages/collection", - pages: [ - "index", - "collectionClass/index" - ] - }, - { - root: "pages/sampleComparison", - pages: [ - "index", - ] - }, - { - root: "pages/bindSalesman", - pages: [ - "index", - ] - }, + ] } diff --git a/src/pages/addressAdd/index.config.ts b/src/pages/addressAdd/index.config.ts deleted file mode 100644 index 8e50c58..0000000 --- a/src/pages/addressAdd/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '', - enableShareAppMessage: true, -} diff --git a/src/pages/addressAdd/index.scss b/src/pages/addressAdd/index.scss deleted file mode 100644 index 8443556..0000000 --- a/src/pages/addressAdd/index.scss +++ /dev/null @@ -1,47 +0,0 @@ -.add-address{ - display: flex; - flex-direction: column; - .add-address-default{ - display: flex;align-items: center;justify-content: space-between; - margin: 70px 30px 0; - font-size: 26px; - font-weight: 700; - color: #000000; - } - .add-address-default-active{ - width: 50px; - height: 50px; - background: #007aff; - border-radius: 50%; - display: flex;align-items: center; - justify-content: center; - font-size: 45px; - color: white; - box-sizing: border-box; - } - .add-address-default-active text{ - font-size: 35px; - } - .add-address-default-noactive{ - width: 50px; - height: 50px; - border: 2px solid #707070; - border-radius: 50%; - box-sizing: border-box; - display: flex;align-items: center;justify-content: center; - } - - .add-address-save{ - width: 668px; - height: 82px; - background: #68b4ff; - border-radius: 40px; - font-size: 32px; - font-weight: 400; - color: #ffffff; - display: flex;align-items: center;justify-content: center; - // margin: 620px auto 0; - position: fixed;left: 50%;bottom: 50px; - transform: translateX(-50%); - } -} \ No newline at end of file diff --git a/src/pages/addressAdd/index.tsx b/src/pages/addressAdd/index.tsx deleted file mode 100644 index 59b1de6..0000000 --- a/src/pages/addressAdd/index.tsx +++ /dev/null @@ -1,144 +0,0 @@ - -import { alert, retrieval } from "@/common/common" -import Address from "@/components/address" -import FromList from "@/components/FromList" -import { Button, Input, Text, Textarea, View } from "@tarojs/components" -import Taro, { setNavigationBarTitle, useRouter } from "@tarojs/taro" -import { useEffect, useState } from "react" -import "./index.scss" -import {addressAddApi, addressDetailApi,addressEditApi} from "@/api/addressManager" -import useLogin from "@/use/useLogin" - -export default ()=>{ - useLogin() - const [showSiteModal, setShowSiteModal] = useState(false); - const {type,id} = useRouter().params; - useEffect(()=>{ - if(type=="add"){ - setNavigationBarTitle({title:"新增收货地址"}) - }else{ - initalFormData(); - setNavigationBarTitle({title:"编辑收货地址"}) - } - },[]) - // 获取编辑地址信息 - const {fetchData: getFromData} = addressDetailApi() - const initalFormData = async ()=>{ - const detail = await getFromData({id}); - const { province_id,province_name,city_id,city_name,district_id,district_name } = detail.data; - const siteArray = [{id: province_id, name: province_name}]; - city_id&&siteArray.push({id: city_id, name: city_name}); - district_id&&siteArray.push({id: district_id, name: district_name}); - setFormData({ - name: detail.data.name, - phone: detail.data.phone, - site: siteArray.map(item=>item.name).join(" "), - siteArray: siteArray as any, - district_id: detail.data.district_id, - address_detail: detail.data.address_detail, - is_default: detail.data.is_default, - id: detail.data.id, - }) - } - - const {fetchData} = addressAddApi() - const {fetchData: editFetch} = addressEditApi() - // 保存 - const [formData, setFormData] = useState({ - name: "", - phone:"", - site:"", - siteArray: [], - district_id:"", - address_detail: "", - is_default: false, - id: 0 - }) - const rules = { - name: [{ - message: "请输入正确收货人姓名", - // validator: (value:any, rule:any)=>{ // 自定义验证,返回true表示匹配到了(错误) - // return value.length>5; - // } - }], - phone: [{ - message: "请输入正确的电话号码", regex: /^1[3|5|6|9|2|8|7]\d{9}$/ - }], - district_id: [{ - message: "请选择地址" - }], - address_detail: [{ - message: "请输入详细地址" - }], - } - const handleSave = ()=>{ - retrieval(formData, rules).then(async ()=>{ - const result = type=="add"?await fetchData({ - name: formData.name, - phone:formData.phone, - district_id:formData.district_id, - address_detail: formData.address_detail, - is_default: formData.is_default - }):await editFetch({ - name: formData.name, - phone:formData.phone, - district_id:formData.district_id, - address_detail: formData.address_detail, - is_default: formData.is_default, - id: formData.id - }); - if(result.success){ - Taro.eventCenter.trigger("addressList:refresh"); - Taro.navigateBack(); - alert.success("保存成功"); - }else{ - alert.error(result.msg); - } - }).catch((message)=>{ - alert.none(message) - }) - } - // 监听表单完善 - const [hozon, setHozon] = useState(false); - useEffect(()=>{ - if(retrieval){ - retrieval(formData).then(()=>setHozon(true)).catch(()=>setHozon(false)) - } - },[formData]) - // 设置选择地址 - const handleSetSite = (ev:any)=>{ - if(ev.length > 0){ - setFormData({ - ...formData, - siteArray: ev, - site: ev.map(item=>item.name+" "), - district_id: ev[ev.length-1]?.id - }) - }else{ - alert.error("请选择地址"); - } - } - - return ( - - setFormData({...formData,name:ev.detail.value})} value={formData["name"]} label="联系人" placeholder="请输入收货人姓名"/> - setFormData({...formData,phone:ev.detail.value})} value={formData["phone"]} label="联系方式" placeholder="请输入联系方式"/> - setShowSiteModal(true)} label="收货地址" type="select" placeholder="请选择/省/市/区"/> - setFormData({...formData,address_detail:ev.detail.value})} value={formData["address_detail"]} label="详细地址" type="textarea" placeholder="请输入详细地址(街道、门牌号等)"/> - - 设为默认地址 - setFormData({...formData ,is_default: !formData.is_default})}> - { - formData.is_default? - : - } - - - - -
setShowSiteModal(false)} show={showSiteModal}/> - - ) -} diff --git a/src/pages/addressManager/index.config.ts b/src/pages/addressManager/index.config.ts deleted file mode 100644 index 9d26929..0000000 --- a/src/pages/addressManager/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '地址管理', - enableShareAppMessage: true, -} diff --git a/src/pages/addressManager/index.scss b/src/pages/addressManager/index.scss deleted file mode 100644 index 61d7ccd..0000000 --- a/src/pages/addressManager/index.scss +++ /dev/null @@ -1,3 +0,0 @@ -.address-manager{ - height: 100vh; -} \ No newline at end of file diff --git a/src/pages/addressManager/index.tsx b/src/pages/addressManager/index.tsx deleted file mode 100644 index 427553e..0000000 --- a/src/pages/addressManager/index.tsx +++ /dev/null @@ -1,16 +0,0 @@ - -import AddressList from "@/components/AddressList" -import useLogin from "@/use/useLogin" -import { Button, ScrollView, Text, View } from "@tarojs/components" -import { stopPullDownRefresh, usePullDownRefresh } from "@tarojs/taro" -import { useState } from "react" -import "./index.scss" - -export default ()=>{ - useLogin() - return ( - - - - ) -} \ No newline at end of file diff --git a/src/pages/applyAfterSales/components/cutKindList/index.module.scss b/src/pages/applyAfterSales/components/cutKindList/index.module.scss deleted file mode 100644 index bc49015..0000000 --- a/src/pages/applyAfterSales/components/cutKindList/index.module.scss +++ /dev/null @@ -1,64 +0,0 @@ -.apply_after_sales_list{ - padding: 0 20px; - .apply_after_sales_item{ - margin-bottom: 50px; - .apply_after_sales_title{ - display: flex; - align-items: center; - .tag{ - font-size: $font_size_min; - background-color: #CDE5FF; - padding: 5px 10px; - border-radius: 6px; - color: $color_main; - } - .title{ - font-weight: 700; - font-size: $font_size; - margin-left: 20px; - flex:1; - } - } - .color_list { - .color_item{ - display: flex; - align-items: center; - margin: 30px 0; - } - .image{ - width: 70px; - height: 70px; - image{ - width: 100%; - height: 100%; - border-radius: 50%; - } - } - .name_and_number{ - padding-left: 30px; - flex:1; - text{ - &:nth-child(1) { - font-weight: 700; - font-size: $font_size; - } - &:nth-child(2) { - color: $color_font_two; - font-size: $font_size; - margin-left: 20px; - } - } - } - .btn_count{ - width: 216px; - height: 64px; - background-color: #ECF5FF; - border-radius: 40px 0px 16px 0px; - padding: 0 20px; - display: flex; - align-items: center; - } - } - } - -} diff --git a/src/pages/applyAfterSales/components/cutKindList/index.tsx b/src/pages/applyAfterSales/components/cutKindList/index.tsx deleted file mode 100644 index aea397b..0000000 --- a/src/pages/applyAfterSales/components/cutKindList/index.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { formatHashTag, formatImgUrl } from "@/common/fotmat"; -import Counter from "@/components/counter"; -import MCheckbox from "@/components/checkbox"; -import { Image, Text, View } from "@tarojs/components"; -import { FC, memo, useCallback } from "react"; -import styles from './index.module.scss' - -type OrderParam = { - list?: any[], - sale_mode?: number, - sale_mode_name?: string, - unit?: string, - total_colors?: number, - total_fabrics?: number, - total_number?: number, - status?: number, //订单状态 - av_return_product?: any[] //申请售后列表 -} - -type Param = { - order: OrderParam, - onSelectChange?: (val: {color_id:number, length: number, status: true|false, sale_order_detail_id:number}) => void -} - -const kindeList:FC = memo(({order, onSelectChange}) => { - - //checkbox选中回调 - const selectCallBack = (colorItem) => { - onSelectChange?.({color_id:colorItem.product_color_id, length:colorItem.length, sale_order_detail_id:colorItem.sale_order_detail_id, status: true}) - } - - //checkbox关闭回调 - const colseCallBack = (colorItem) => { - onSelectChange?.({color_id:colorItem.product_color_id, length:colorItem.length, status: false, sale_order_detail_id:colorItem.sale_order_detail_id,}) - } - - return ( - - {order?.av_return_product?.map(item => - - {order.sale_mode_name} - {formatHashTag(item.product_code, item.product_name)} - - - {item?.av_product_color?.map(colorItem => - - {colorItem.product_color_code + ' ' + colorItem.product_color_name}x {colorItem.length/100} m - selectCallBack(colorItem)} onClose={() => colseCallBack(colorItem)}/> - )} - - )} - - ) -}) - -export default kindeList \ No newline at end of file diff --git a/src/pages/applyAfterSales/components/kindList/index.module.scss b/src/pages/applyAfterSales/components/kindList/index.module.scss deleted file mode 100644 index bc49015..0000000 --- a/src/pages/applyAfterSales/components/kindList/index.module.scss +++ /dev/null @@ -1,64 +0,0 @@ -.apply_after_sales_list{ - padding: 0 20px; - .apply_after_sales_item{ - margin-bottom: 50px; - .apply_after_sales_title{ - display: flex; - align-items: center; - .tag{ - font-size: $font_size_min; - background-color: #CDE5FF; - padding: 5px 10px; - border-radius: 6px; - color: $color_main; - } - .title{ - font-weight: 700; - font-size: $font_size; - margin-left: 20px; - flex:1; - } - } - .color_list { - .color_item{ - display: flex; - align-items: center; - margin: 30px 0; - } - .image{ - width: 70px; - height: 70px; - image{ - width: 100%; - height: 100%; - border-radius: 50%; - } - } - .name_and_number{ - padding-left: 30px; - flex:1; - text{ - &:nth-child(1) { - font-weight: 700; - font-size: $font_size; - } - &:nth-child(2) { - color: $color_font_two; - font-size: $font_size; - margin-left: 20px; - } - } - } - .btn_count{ - width: 216px; - height: 64px; - background-color: #ECF5FF; - border-radius: 40px 0px 16px 0px; - padding: 0 20px; - display: flex; - align-items: center; - } - } - } - -} diff --git a/src/pages/applyAfterSales/components/kindList/index.tsx b/src/pages/applyAfterSales/components/kindList/index.tsx deleted file mode 100644 index c5cecd2..0000000 --- a/src/pages/applyAfterSales/components/kindList/index.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { formatHashTag, formatImgUrl } from "@/common/fotmat"; -import Counter from "@/components/counter"; -import MCheckbox from "@/components/checkbox"; -import { Image, Text, View } from "@tarojs/components"; -import { FC, memo, useCallback } from "react"; -import styles from './index.module.scss' - -type OrderParam = { - list?: any[], - sale_mode?: number, - sale_mode_name?: string, - unit?: string, - total_colors?: number, - total_fabrics?: number, - total_number?: number, - status?: number, //订单状态 - av_return_product?: any[] //申请售后列表 -} - -type Param = { - order: OrderParam, - onNumChange?: (val:any) => void -} - -const kindeList:FC = memo(({order, onNumChange}) => { - - //计步器返回值 - const getCounterChange = useCallback((colorItem) => { - return (number) => { - onNumChange?.({number, color_id: colorItem.product_color_id, sale_order_detail_id:colorItem.sale_order_detail_id}) - } - }, [order]) - - return ( - - {order?.av_return_product?.map(item => - - {order.sale_mode_name} - {formatHashTag(item.product_code, item.product_name)} - - - {item?.av_product_color?.map(colorItem => - - {colorItem.product_color_code + ' ' + colorItem.product_color_name}x {colorItem.roll} - - - - )} - - )} - - ) -}) - -export default kindeList \ No newline at end of file diff --git a/src/pages/applyAfterSales/components/otherReason/index.module.scss b/src/pages/applyAfterSales/components/otherReason/index.module.scss deleted file mode 100644 index e2d1b1b..0000000 --- a/src/pages/applyAfterSales/components/otherReason/index.module.scss +++ /dev/null @@ -1,36 +0,0 @@ -.other_desc{ - padding: 0 20px; - box-sizing: border-box; - .title{ - font-size: $font_size; - font-weight: 700; - } - .textarea{ - position: relative; - height: 165.4px; - .descDataNum{ - position: absolute; - right: 10px; - bottom: 10px; - font-size: 22px; - color: #ABABAB; - } - } - .textarea_con, .textarea_con_pretend{ - background-color: #f3f3f3; - border: 2px solid #e6e6e6; - border-radius: 10px; - width: 100%; - font-size: 25px; - height: 165.4px; - padding: 20px 20px 30px 20px; - box-sizing: border-box; - margin-top: 20px; - } - .textarea_con_pretend{ - color: $color_font_two; - } - .textarea_con_pretend_ed{ - color: #000; - } -} \ No newline at end of file diff --git a/src/pages/applyAfterSales/components/otherReason/index.tsx b/src/pages/applyAfterSales/components/otherReason/index.tsx deleted file mode 100644 index 5059f75..0000000 --- a/src/pages/applyAfterSales/components/otherReason/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import {Textarea, View } from "@tarojs/components"; -import { memo, useMemo, useState } from "react"; -import styles from './index.module.scss' -import classnames from "classnames"; - -//其他说明 -type Param = { - onChange: (val: string) => void -} -export default memo(({onChange}:Param) => { - const [descData, setDescData] = useState({ - number: 0, - value: '', - count: 200, - show: false - }) - const getDesc = (e) => { - let value = e.detail.value - let res = value - if(value.length > descData.count) { - res = value.slice(0, descData.count) - } - setDescData({...descData, number:res.length, value: res}) - onChange?.(res) - } - - const toggleShowRealTextarea = (show) => { - setDescData({...descData, show:show}) - } - return ( - - 其他说明 - - {descData.show&&|| - toggleShowRealTextarea(true)}>{descData.value||'一般情况下选填,当退货说明=“其它问题”时,必填'} - } - {descData.number +'/'+ descData.count} - - - ) -}) diff --git a/src/pages/applyAfterSales/components/reasonPopup/index copy 2.tsx b/src/pages/applyAfterSales/components/reasonPopup/index copy 2.tsx deleted file mode 100644 index 1cecb2a..0000000 --- a/src/pages/applyAfterSales/components/reasonPopup/index copy 2.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import Popup from "@/components/popup"; -import { ScrollView, Text, View } from "@tarojs/components"; -import { memo, useEffect, useMemo, useState } from "react"; -import classnames from "classnames"; -import styles from './index.module.scss' - -//原因选择 -type Param = {id:number, name:string, typle?:number} -type ReasonInfoParam = { - show?: boolean, //显示 - onClose?: () => void, //关闭 - title?: string, //标题 - list?: {id:number, name:string, typle?:number, children?:Param[]}[], //数据列表 - onSelect?: (val: object) => void, //选择 - defaultValue?: number, //默认选中 -} -export default memo(({show = false, onClose, title = '', list = [], onSelect, defaultValue}: ReasonInfoParam) => { - const [hasNextData, setHasNextData] = useState(true) //是否有下一级数据 - const [selectData, setSelectData] = useState() - const [headerList, setHeaderList] = useState<{id: number, name: string}[]>([]) - const onSelectData = (item) => { - setHeaderList((e) => [...e, {id:item.id, name:item.name}]) - } - useEffect(() => { - console.log('headerList::', headerList) - }, [headerList]) - return ( - - - - {headerList.map(item => { - return {item.name} - })} - {hasNextData&&请选择} - - - - {list.map(item => onSelectData(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name} )} - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/applyAfterSales/components/reasonPopup/index copy.tsx b/src/pages/applyAfterSales/components/reasonPopup/index copy.tsx deleted file mode 100644 index 0ed990c..0000000 --- a/src/pages/applyAfterSales/components/reasonPopup/index copy.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import Popup from "@/components/popup"; -import { ScrollView, Text, View } from "@tarojs/components"; -import { memo, useMemo } from "react"; -import classnames from "classnames"; -import styles from './index.module.scss' - -//原因选择 -type ReasonInfoParam = { - show?: boolean, //显示 - onClose?: () => void, //关闭 - title?: string, //标题 - list?: {id:number, name:string, typle?:number}[], //数据列表 - onSelect?: (val: object) => void, //选择 - defaultValue?: number, //默认选中 -} -export default memo(({show = false, onClose, title = '', list= [], onSelect, defaultValue}: ReasonInfoParam) => { - - return ( - - - {title} - - - {list.map(item => onSelect?.(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name} )} - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/applyAfterSales/components/reasonPopup/index.module.scss b/src/pages/applyAfterSales/components/reasonPopup/index.module.scss deleted file mode 100644 index a988394..0000000 --- a/src/pages/applyAfterSales/components/reasonPopup/index.module.scss +++ /dev/null @@ -1,43 +0,0 @@ -.reason_return_con{ - height: 50vh; - .reason_title{ - padding: 10px 20px 0 20px; - border-bottom: 1PX solid #F3F3F3; - box-sizing: border-box; - text{ - margin-right: 15px; - font-size: 27px; - display: inline-block; - } - .selectName{ - font-size: 26px; - padding: 20px 10px; - font-weight: 400; - color: #ABABAB; - } - .tips{ - color: #ABABAB; - border-bottom: 0; - padding: 20px 10px; - } - .select_bottom { - border-bottom: 3px solid #007AFF; - color: #000; - } - - } - .reason_scroll{ - height: calc(100% - 70px); - .reason_list{ - font-size: 26px; - padding: 30px 20px 0 20px; - color: #707070; - .reason_item{ - margin-bottom: 36px; - } - .select_item { - color: #007AFF; - } - } - } -} \ No newline at end of file diff --git a/src/pages/applyAfterSales/components/reasonPopup/index.tsx b/src/pages/applyAfterSales/components/reasonPopup/index.tsx deleted file mode 100644 index ec631c4..0000000 --- a/src/pages/applyAfterSales/components/reasonPopup/index.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import Popup from "@/components/popup"; -import { ScrollView, Text, View } from "@tarojs/components"; -import { Children, memo, useEffect, useMemo, useRef, useState } from "react"; -import classnames from "classnames"; -import styles from './index.module.scss' -import { ReturnExplainApi, ReturnReasonApi } from "@/api/salesAfterOrder"; - -//原因选择 -type Param = {id:number, name:string, typle?:number} -type ReasonInfoParam = { - show?: boolean, //显示 - onClose?: () => void, //关闭 - title?: string, //标题 - list?: {id:number, name:string, typle?:number}[], //数据列表 - onSelect?: (val: object) => void, //选择 - onHeaderSelect?: (val: object) => void, //点击头部标题 - defaultValue?: number, //默认选中 - dataLength?: number, //可显示的数据列数 -} -export default memo(({show = false, onClose, title = '', list = [], onSelect, onHeaderSelect, defaultValue, dataLength = 1}: ReasonInfoParam) => { - - const [initList, setInitList] = useState([]) - - useEffect(() => { - setInitList(list) - }, [list]) - const [selectIndex, setSelectIndex] = useState(1) - const [headerList, setHeaderList] = useState<{id: number, name: string}[]>([]) - const onSelectData = (item) => { - if(selectIndex <= dataLength) { - headerList[selectIndex - 1] = {id:item.id, name:item.name} - onSelect?.({data:headerList, index:selectIndex}) - setSelectIndex(selectIndex == dataLength?dataLength:selectIndex + 1) - setHeaderList((e) => [...e]) - if(selectIndex == dataLength) onClose?.() - } - } - - const onHeaderClick = ({val, index}) => { - let list = headerList.slice(0, index + 1) - setSelectIndex(index + 1) - setHeaderList(list) - onHeaderSelect?.({data:val, index: index + 1}) - } - - return ( - - - - {headerList.map((item, index) => { - return onHeaderClick({val:item, index})} className={classnames(styles.selectName, (headerList.length == index + 1)&&styles.select_bottom)}>{item.name} - })} - {dataLength > headerList.length&&请选择} - - - - {initList.map(item => onSelectData(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name} )} - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/applyAfterSales/index.config.ts b/src/pages/applyAfterSales/index.config.ts deleted file mode 100644 index a7a7e32..0000000 --- a/src/pages/applyAfterSales/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '申请售后', - enableShareAppMessage: true, -} diff --git a/src/pages/applyAfterSales/index.module.scss b/src/pages/applyAfterSales/index.module.scss deleted file mode 100644 index b8d2820..0000000 --- a/src/pages/applyAfterSales/index.module.scss +++ /dev/null @@ -1,110 +0,0 @@ - -.apply_after_sales_main{ - .apply_after_sales_head{ - font-size: 30px; - text-align: center; - padding: 20px 0; - font-weight: 700; - } - .kind_number{ - width: 100%; - padding: 20px; - box-sizing: border-box; - border-bottom: 1PX solid #f3f3f3; - text{ - background-color: #F6F6F6; - border-radius: 10px; - font-size: $font_size_medium; - padding: 5px 0; - text-align: center; - width: 100%; - display: block; - color: $color_font_three; - } - } - .apply_after_sales_con{ - .scroll{ - height: calc(100% - 170px); - } - .scroll_con{ - padding: 20px 0 150px 0; - } - .returnSaleInput{ - margin: 0 20px; - padding-top: 30px; - border-top: 1px solid #F6F6F6; - .returnSaleInput_item{ - display: flex; - align-items: center; - padding-bottom: 30px; - flex-wrap: wrap; - .title{ - font-size: $font_size; - font-weight: 700; - width: 119px; - } - .select{ - flex:1; - height: 60px; - border: 2px solid #e6e6e6; - border-radius: 10px; - margin-left: 20px; - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 20px; - font-size: 26px; - color: $color_font_two; - .miconfont{ - font-size: 30px; - } - .selected{ - color: #000; - } - } - .upload_image{ - flex:1; - } - } - } - - } - - - .btns_con{ - width: 100%; - position: fixed; - bottom:0; - padding: 0 20px; - box-sizing: border-box; - padding-bottom: constant(safe-area-inset-bottom); - padding-bottom: env(safe-area-inset-bottom); - .btns_two{ - display: flex; - height: 82px; - // border: 1PX solid #007aff; - font-size: $font_size_big; - border-radius: 40px; - margin-bottom: 20px; - .rest_btn{ - flex:1; - border: 1PX solid #007aff; - border-radius: 40px 0 0 40px; - text-align: center; - line-height: 82px; - color: $color_main; - background-color: #fff; - - } - .verify_btn{ - flex:1; - border-radius: 0 40px 40px 0; - background: #007aff; - text-align: center; - line-height: 82px; - color: #fff; - } - } - } -} - diff --git a/src/pages/applyAfterSales/index.tsx b/src/pages/applyAfterSales/index.tsx deleted file mode 100644 index bd40d95..0000000 --- a/src/pages/applyAfterSales/index.tsx +++ /dev/null @@ -1,260 +0,0 @@ -import { Image, ScrollView, Text, View } from "@tarojs/components"; -import { FC, memo, useCallback, useEffect, useMemo, useRef, useState } from "react"; -import classnames from "classnames"; -import styles from './index.module.scss' -import ReasonPopup from "./components/reasonPopup"; -import Taro, { useDidShow, useRouter } from "@tarojs/taro"; -import { GetSaleOrderDetailApi } from "@/api/order"; -import KindList from "./components/kindList" -import CutKindList from "./components/cutkindList" -import { ReturnApplyOrderApi, ReturnExplainApi, ReturnGoodsStatusApi, ReturnReasonApi } from "@/api/salesAfterOrder"; -import { alert, goLink } from "@/common/common"; -import UploadImage from "@/components/uploadImage" -import TextareaEnhance from "@/components/textareaEnhance"; -import useLogin from "@/use/useLogin"; -import { throttle } from "@/common/util"; - -enum returnStatus { - return_reason = 1, //原因 - goods_status = 2, //状况 - return_explain = 3, //说明 - -} -export default () => { - useLogin() - useDidShow(() => { - getSaleOrderPreView() - }) - - const router = useRouter() - const orderId = useRef(Number(router.params.id)) - - //需要提交的数据 - const [submitData, setSubmitData] = useState({ - fabric_piece_accessory_url: [], - goods_status: '', //货物状况 - reason_describe: '', //其他说明 - return_explain: '', //退货说明 - return_reason: '', //退货原因 - roll: 0, - roll_list: [], - sale_order_id: orderId.current - }) - - //获取订单数据 - const [orderDetail, setOrderDetail] = useState() //获取到的原始数据 - const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi() - const getSaleOrderPreView = async () => { - if(orderId.current) { - let res = await getOrderFetchData({id: orderId.current}) - setOrderDetail(res.data) - } - } - - //监听获取到的数据 - useEffect(() => { - if(orderDetail) { - formatData() - } - }, [orderDetail]) - - //格式化数据格式 - const [formatDetailOrder, setFormatDetailOrder] = useState() //格式化后的数据 - const formatData = () => { - setFormatDetailOrder({ - ...orderDetail, - unit: orderDetail.sale_mode == 0?'条':'m', //单位 - list: orderDetail.product_list, - - }) - } - - //数据总量 - const dataCount = useMemo(() => { - if(formatDetailOrder) { - let total_number = formatDetailOrder.sale_mode == 0?formatDetailOrder.av_total_number + '条':(formatDetailOrder.av_total_number/100) + '米' - return `${formatDetailOrder.av_total_fabrics}种面料,${formatDetailOrder.av_total_colors}种颜色,共${total_number}` - } - }, [formatDetailOrder]) - - - - //面料数据 - let roll_list = useRef({}) - - //大货时获取计步器数据 - const getNumChange = useCallback((val) => { - if(parseInt(val.number) > 0) { - roll_list.current[val.color_id] = {product_roll: val.number, sale_order_detail_id: val.sale_order_detail_id} - } else { - delete roll_list.current[val.color_id] - } - setSubmitData((e) => ({...e, roll_list:Object.values(roll_list.current)})) - }, []) - - //散剪和剪板 - const getSelectChange = useCallback((val) => { - if(val.status) { - roll_list.current[val.color_id] = {product_roll: val.length, sale_order_detail_id: val.sale_order_detail_id} - } else { - delete roll_list.current[val.color_id] - } - setSubmitData((e) => ({...e, roll_list:Object.values(roll_list.current)})) - }, []) - - //获取图片列表 - const getImageList = useCallback((list) => { - setSubmitData((e) => ({...e, fabric_piece_accessory_url:list})) - }, []) - - //其他说明 - const getOtherReason = useCallback((val) => { - setSubmitData((e) => ({...e, reason_describe: val})) - }, []) - - //提交数据 - const {fetchData: fetchDataReturnApply} = ReturnApplyOrderApi() - const onSubmitData = async () => { - if(submitData.roll_list.length <= 0) return alert.none('请选择或输入退货颜色') - console.log('submitData::',submitData) - let res = await fetchDataReturnApply(submitData) - if(res.success) { - alert.success('申请成功') - goLink('/pages/salesAfter/salesAfterList/index',{}, 'reLaunch') - } else { - alert.error(res.msg) - } - } - - //底部按钮 - const onSubmit = throttle((val) => { - if(val == 2) { - if(submitData.goods_status === '') return alert.error('请选择货物状况') - if(submitData.return_explain === '') return alert.error('请选择退货原因') - if(!submitData.return_explain && !submitData.reason_describe) return alert.error('请填写其他说明') - onSubmitData() - } else { - Taro.navigateBack() - } - }, 600) - - //退货原因选择弹窗 - const [showReason, setShowReason] = useState(false) - const closeReason = useCallback(() => setShowReason(false), []) - const onShowReason = () => { - setShowReason(true) - } - useEffect(() => { - getReturnReason() - }, []) - - //请求获取到的数据 - const [returnGoodsInfo, setReturnGoodsInfo] = useState([]) - - //退货原因 - const {fetchData: fetchDataReturnReason} = ReturnReasonApi() - const getReturnReason = async () => { - let res = await fetchDataReturnReason() - setReturnGoodsInfo((e) => (res.data?.list)) - } - //售后退货说明 - const {fetchData: fetchDataReturnExplain} = ReturnExplainApi() - const getReturnExplain = async (id) => { - let res = await fetchDataReturnExplain({return_reason: id}) - setReturnGoodsInfo((e) => (res.data?.list)) - } - //退货原因选择列表返回的数据 - const [returnObj, setReturnObj] = useState([]) - const onReturnSelect = useCallback((val) => { - let res = val.data[val.data.length - 1] - if(val.index == 1) { - getReturnExplain(res.id) - setReturnGoodsInfo(() => []) - } - if(val.index == 2) setReturnObj(val.data) - }, []) - const onHeaderSelect = useCallback((val) => { - setReturnGoodsInfo((e) => []) - if(val.index == 1) getReturnReason() - }, []) - - //选择货物状况 - const [showStatus, setShowStatus] = useState(false) - const [statusInfo, setStatusInfo] = useState() - const [statusGoodsInfo, setStatusGoodsInfo] = useState([]) - const {fetchData: fetchDataGoodsStatus} = ReturnGoodsStatusApi() - const getReturnGoodsStatus = async () => { - let res = await fetchDataGoodsStatus() - setStatusGoodsInfo((e) => (res.data?.list)) - } - const onShowStatus = () => { - setShowStatus(() => true) - getReturnGoodsStatus() - } - const closeStatus = useCallback(() => { - setShowStatus(() => false) - }, []) - const onStatusSelect = useCallback((val) => { - let res = val.data[val.data.length - 1] - setStatusInfo(res) - }, []) - - useEffect(() => { - if(returnObj.length > 0) { - submitData.return_reason = returnObj[0].id - submitData.return_explain = returnObj[1].id - } - if(statusInfo) { - submitData.goods_status = statusInfo.id - } - setSubmitData(() => ({...submitData})) - }, [returnObj, statusInfo]) - - - return ( - - - {dataCount} - - - {(orderDetail?.sale_mode == 0)&&|| - } - - - 退货原因 - - 0&&styles.selected}>{returnObj?.length > 0?(returnObj[0]?.name + '/' +returnObj[1]?.name):'请选择'} - - - - - 货物状况 - - {statusInfo?.name||'请选择'} - - - - - 拍照上传 - - - - - - - - - - - - - - onSubmit(1)}>取消 - onSubmit(2)}>确认 - - - - - - ) -} \ No newline at end of file diff --git a/src/pages/bindSalesman/component/successBind/index.module.scss b/src/pages/bindSalesman/component/successBind/index.module.scss deleted file mode 100644 index 2d3c1c6..0000000 --- a/src/pages/bindSalesman/component/successBind/index.module.scss +++ /dev/null @@ -1,62 +0,0 @@ -.bindSalesman_main{ - width: 100%; - height: 100vh; - position: fixed; - left:0; - top:0; - .bindSalesman_pop{ - width: 654px; - height: 560px; - border-radius: 40px; - display: flex; - flex-direction: column; - align-items: center; - position:absolute; - margin:auto; - left: 0; - right: 0; - bottom: 0; - top: 0; - bottom: 0; - z-index: 1999; - .bindSalesman_header{ - width: 654px; - position: relative; - image{ - width: 100%; - height: 100%; - border-radius: 40px 40px 0 0; - } - .sale_man{ - color: #fff; - text-align: center; - font-size: 26px; - position: absolute; - margin: auto; - left: 0; - right: 0; - bottom: 60px; - height: 100px; - line-height: 100px; - } - } - .btns{ - width: 488px; - height: 104px; - margin: 50px; - image{ - width: 100%; - } - } - } - .bindSalesman_mask{ - z-index: 99; - position: absolute; - left:0; - top:0; - width: 100%; - height: 100%; - opacity: 0.8; - background: #000000; - } -} \ No newline at end of file diff --git a/src/pages/bindSalesman/component/successBind/index.tsx b/src/pages/bindSalesman/component/successBind/index.tsx deleted file mode 100644 index 35beb6b..0000000 --- a/src/pages/bindSalesman/component/successBind/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { Image, Swiper, SwiperItem, Text, View } from "@tarojs/components" -import styles from './index.module.scss' -import { formatImgUrl } from "@/common/fotmat" -import Taro from "@tarojs/taro"; -import { goLink } from "@/common/common"; -import CloseBtn from "@/components/closeBtn"; -import { useEffect, useState } from "react"; - -type params = { - show?: true|false, - onClose?: () => void, - saleMan?: string -} -export default ({show = false, saleMan = '', onClose}:params) => { - const onClick = async () => { - onClose?.() - goLink('/pages/index/index', {}, 'switchTab') - - } - const onCloseEven = () => { - onClose?.() - } - return ( - <> - {show&& - - onClick()}> - - 邀请人: {saleMan} - - - onClick()}/> - - - - - } - - ) - -} \ No newline at end of file diff --git a/src/pages/bindSalesman/index.config.ts b/src/pages/bindSalesman/index.config.ts deleted file mode 100644 index 3f25181..0000000 --- a/src/pages/bindSalesman/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '邀请码', - enableShareAppMessage: true, -} diff --git a/src/pages/bindSalesman/index.module.scss b/src/pages/bindSalesman/index.module.scss deleted file mode 100644 index 9d930a3..0000000 --- a/src/pages/bindSalesman/index.module.scss +++ /dev/null @@ -1,83 +0,0 @@ -.bindSalesmanPage_main{ - display: flex; - flex-direction: column; - align-items: center; - .header_image{ - width: 240px; - height: 188px; - padding: 50px 0; - image{ - width: 100%; - height: 100%; - } - } - .salesman_name{ - font-size: 30px; - color: #007AFF; - box-sizing: border-box; - padding-top: 50px; - text{ - &:nth-child(2) { - margin-left: 20px; - } - } - } - .inputCode{ - width: 670px; - height: 106px; - background: #f6f6f6; - border: 2px solid #f0f0f0; - border-radius: 20px; - display: flex; - align-items: center; - padding: 20px 0 20px 30px; - box-sizing: border-box; - position: relative; - input{ - flex:1; - z-index: 0; - } - .scan_code{ - width: 101px; - height: 100%; - display: flex; - justify-content: center; - align-items: center; - border-left: 1PX solid #ccc; - .miconfont{ - font-size: 50px; - color: #007AFF; - } - } - .close_btn{ - padding: 0 20px; - } - } - .btns{ - width: 670px; - height: 90px; - opacity: 0.6; - background: linear-gradient(41deg,#007aff, #3a9bfd 86%, #4ba2fa 100%); - border-radius: 46px; - text-align: center; - line-height: 90px; - color: #fff; - margin-top: 50px; - } - .select_btns{ - opacity: 1; - } - .message{ - padding: 150px 30px 20px 30px; - color: #ABABAB; - font-size: 28px; - text{ - display: block; - margin-bottom: 30px; - &:nth-child(1) { - text-align: center; - font-weight: 700; - } - } - } -} \ No newline at end of file diff --git a/src/pages/bindSalesman/index.tsx b/src/pages/bindSalesman/index.tsx deleted file mode 100644 index 79caa6a..0000000 --- a/src/pages/bindSalesman/index.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { Image, Input, Text, View } from '@tarojs/components' -import styles from './index.module.scss' -import useLogin from '@/use/useLogin' -import classnames from "classnames"; -import { formatImgUrl } from '@/common/fotmat' -import { useEffect, useMemo, useRef, useState } from 'react'; -import { alert } from '@/common/common'; -import CloseBtn from '@/components/closeBtn'; -import SuccessBind from './component/successBind'; -import Taro, { useDidShow } from "@tarojs/taro"; -import { BindInvitationInfoApi, GetInvitationInfoApi } from '@/api/user'; -import { debounce, getFilterData, throttle } from '@/common/util'; -export default () => { - useLogin() - - useEffect(() => { - onClipboardData() - }, []) - - const [submitData, setSubmitData] = useState({ - invitation_code: '', - }) - - //获取业务员信息 - type Param = {invitation_code: string, name: string, phone: string} - const [salesMan, setSalesMan] = useState(null) - const {fetchData: GetInvitationInfoFetchData} = GetInvitationInfoApi() - const getInvitationInfo = async () => { - let res = await GetInvitationInfoFetchData(getFilterData({...submitData})) - res.success?setSalesMan(res.data):setSalesMan(null) - } - useEffect(() => { - if(submitData.invitation_code.length === 4) - getInvitationInfo() - }, [submitData]) - - const onInputCode = (e) => { - const value = e.detail.value.replace(/[\W]/g, "") - setSubmitData((val) => ({...val, invitation_code:value})) - } - - const oncloseEven = () => { - setSubmitData((val) => ({...val, invitation_code:''})) - setSalesMan(null) - } - - //绑定业务员 - const [bindShow, setBindShow] = useState(false) - const {fetchData: bindInvitationInfoFetchData} = BindInvitationInfoApi() - const onSubmit = async () => { - if(!submitData.invitation_code) return alert.error('请输入邀请码') - let res = await bindInvitationInfoFetchData({...submitData}) - if(res.success) setBindShow(() => true) - } - - const onScanCode = () => { - Taro.scanCode({ - success: (res) => { - setSubmitData(() => ({invitation_code: res.result})) - } - }) - } - - //获取粘贴版内容 - const onClipboardData = () => { - Taro.getClipboardData({ - success: function (res){ - let val = res.data.match(/InviteCode:([a-zA-Z0-9]{4})/) - if(val) setSubmitData((e) => ({...e, invitation_code: val?val[1]:''})) - } - }) - } - - return ( - - - - - - - - {submitData.invitation_code&&} - - onScanCode()}> - - - - {salesMan&&邀请人:{`${salesMan.name} (${salesMan.phone})`}} - 提交 - - 温馨提示 - 1. 新用户授权手机号码后,7天内可以输入邀请码,超过时间不能输入。 - 2. 一个手机只能输入一次邀请码。输入邀请码。 - - - setBindShow(false)} saleMan={salesMan?.name}/> - - ) -} - diff --git a/src/pages/certification/components/SelectEnterpriseType.scss b/src/pages/certification/components/SelectEnterpriseType.scss deleted file mode 100644 index f18cf81..0000000 --- a/src/pages/certification/components/SelectEnterpriseType.scss +++ /dev/null @@ -1,22 +0,0 @@ -.select-enterprise-type{ - .select-enterprise-type-btn{ - color: #ABABAB; - font-size: 28px; - padding: 20px; - display: flex;justify-content: space-between; - border-bottom: 1rpx solid #eaeaea; - } - .select-enterprise-type-content{ - padding: 0 20px; - padding-bottom: 120px; - } - .select-enterprise-type-content view{ - padding: 20px 0; - font-size: 28px; - display: flex;justify-content: space-between; - } - .select-enterprise-type-content view text:last-child{ - color: #007AFF; - font-size: 35px; - } -} \ No newline at end of file diff --git a/src/pages/certification/components/SelectEnterpriseType.tsx b/src/pages/certification/components/SelectEnterpriseType.tsx deleted file mode 100644 index acf9598..0000000 --- a/src/pages/certification/components/SelectEnterpriseType.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { Text, View } from "@tarojs/components" -import Popup from "@/components/popup"; -import "./SelectEnterpriseType.scss" -import { forwardRef, useEffect, useImperativeHandle, useState } from "react"; -import {certificationTypeListApi} from "@/api/certification" - -interface Params{ - confirm?: (selected:any)=>void, // 确定 -} - -export default forwardRef((props: Params, ref)=>{ - const [modalShow, setModalShow] = useState(false) - // 获取认证信息 - const {fetchData, state} = certificationTypeListApi(); - useEffect(()=>{ - fetchData(); - }, []) - const [selected, setSelected] = useState({}); - // 确定 - const handleSelect = (item)=>{ - setSelected(item); - } - // 设置弹窗是否显示 - const setShow = (ev)=>{ - setModalShow(ev); - } - useImperativeHandle(ref,()=>({ - setShow - })) - // 确定 - const handleConfirm = ()=>{ - props.confirm&&props.confirm(selected); - setModalShow(false); - } - - return ( - - setModalShow(false)}> - - setModalShow(false)}>取消 - 确定 - - - { - state.data?.list?.map((item,index)=>{ - return handleSelect(item)} key={index}> - {item.name} - {item.id==(selected as any).id?:} - - }) - } - - - - ) -}) diff --git a/src/pages/certification/index.config.ts b/src/pages/certification/index.config.ts deleted file mode 100644 index b645668..0000000 --- a/src/pages/certification/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '认证信息', - enableShareAppMessage: true, -} diff --git a/src/pages/certification/index.scss b/src/pages/certification/index.scss deleted file mode 100644 index a6c7bcf..0000000 --- a/src/pages/certification/index.scss +++ /dev/null @@ -1,115 +0,0 @@ -.certification{ - display: flex; - flex-direction: column; - background-color: #F0F0F0; - padding-bottom: 300px; - .certification-content{ - background-color: white; - padding-bottom: 50px; - } - .certification-content:nth-of-type(3){ - margin-top: 18px; - } - .certification-title{ - font-size: 26px; - font-weight: 700; - margin-left: 30px; - padding-top: 40px; - color: #000000; - padding-bottom: 20px; - // border-top: 18px solid #F0F0F0; - } - .certification-upload{ - width: 642px; - height: 316px; - border: 10px solid #cde5ff; - border-radius: 30px; - margin: 0 auto; - display: flex;align-items: center;justify-content: center; - font-size: 34px; - font-weight: 700; - color: #68b4ff; - background-color: #ECF5FF; - position: relative; - margin-top: 60px; - } - .certification-upload text{ - margin-bottom: 60px; - } - .certification-upload-no{ - display: flex;flex-direction: column;align-items: center; - } - .certification-upload image{ - position: absolute;width: 100%;height: 100%; - object-fit: cover;border-radius: 30px; - } - .certification-upload-no-icon{ - width: 104px; - height: 104px; - background: #68b4ff; - box-shadow: 0px 0px 12px 0px #68b4ff; - display: flex;align-items: center;justify-content: center; - border-radius: 50%; - color: white; - } - .certification-upload-no-tips{ - margin-top: 30px; - border-radius: 30px; - font-size: 24px; - font-weight: 400; - color: #000000; - } - .certification-button{ - position: absolute;bottom: -10px;left: -10px;right: -10px; - background-color: rgba(0,0,0,0.65); - display: flex; - height: 86px; - border-radius: 0 0 30px 30px; - z-index: 1; - } - .certification-button view{ - flex: 1; - display: flex;align-items: center;justify-content: center; - font-size: 24px; - font-weight: 400; - color: #ffffff; - } - .certification-button view:first-child{ - border-right: 1px solid #CCCCCC; - } - .certification-footer{ - width: 750px; - height: 174px; - background: #ffffff; - box-shadow: 6px 0px 12px 0px rgba(0,0,0,0.16); - position: fixed;bottom: 0;left: 0;right: 0; - width: 100%; - display: flex;align-items: center;justify-content: center; - z-index: 2; - } - .certification-footer-button{ - width: 696px; - height: 82px; - background: #ffffff; - border: 2px solid #cde5ff; - display: flex; - border-radius: 40px; - box-sizing: border-box; - overflow: hidden; - } - .certification-footer-button view,.certification-footer-button navigator{ - flex: 1; - display: flex;align-items: center;justify-content: center; - font-size: 32px; - font-weight: 400; - color: #007aff; - border: 0;border-radius: none; - } - .certification-footer-button navigator::after{ - border: 0;border-radius: none; - } - .certification-footer-button view:last-child{ - color: white; - background-color: #007AFF; - } -} \ No newline at end of file diff --git a/src/pages/certification/index.tsx b/src/pages/certification/index.tsx deleted file mode 100644 index bc53251..0000000 --- a/src/pages/certification/index.tsx +++ /dev/null @@ -1,201 +0,0 @@ - -import FromListCertification from "@/components/FromListCertification" -import { Button, Image, Input, NavigationBar, Navigator, Text, Textarea, View } from "@tarojs/components" -import Taro, { setNavigationBarTitle, useRouter } from "@tarojs/taro" -import { certificationSaveApi, certificationDetailApi } from "@/api/certification" -import { useEffect, useRef, useState } from "react" -import { alert, retrieval } from "@/common/common" -import "./index.scss" -import useUploadCDNImg from "@/use/useUploadImage"; -import Message from "@/components/Message" -import { IMG_CND_Prefix } from "@/common/constant"; -import SelectEnterpriseType from "./components/SelectEnterpriseType" -import { useSelector } from "@/reducers/hooks"; -import useLogin from "@/use/useLogin"; - -export default () => { - const { getAdminUserInfo } = useLogin(); - const { adminUserInfo } = useSelector(state => state.userInfo); - useEffect(() => { - initalFormData(); - }, []); - // 获取认证信息 - const { fetchData: getFromData } = certificationDetailApi() - const initalFormData = async () => { - const detail = await getFromData(); - setFormData({ - ...detail.data ?? {}, - legal_person_identity_url: detail?.data?.legal_person_identity_url ?? [], - // business_license_url: "https://test.cdn.zzfzyc.com/mall/827082e888860dd9da10f0fbb0ac3cf023081456.png" - } as any) - } - // 保存 - const [formData, setFormData] = useState({ - authentication_type: 0, - authentication_type_name: "", - business_license_url: "", - legal_person: "", - legal_person_identity: "", - business_license: '', - legal_person_identity_url: [], - name: "" - }); - const rules = { - // authentication_type: [{ - // message: "请选择认证类型" - // }], - name: [{ - message: "请输入企业名称" - }], - business_license: [{ - message: "请输入企业营业执照" - }], - business_license_url: [{ - message: "请上传营业执照" - }], - legal_person: [{ - message: "请输入法人名称" - }], - legal_person_identity: [{ - message: "请输入正确法人身份证", - regex: /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/ - }], - legal_person_identity_url: [{ - message: "请上传法人身份证", - validator: (value: any, rule: any) => { - if (!value[0] || !value[1]) { - return true; - } - return false; - } - }], - } - const { fetchData } = certificationSaveApi() - const handleSave = () => { - retrieval(formData, rules).then(async () => { - const result = await fetchData({ ...formData, authentication_type: 2 }) - if (result.success) { - // Taro.eventCenter.trigger("weightList:refresh"); - getAdminUserInfo(); - Taro.navigateBack(); - alert.success("保存成功"); - } else { - alert.error(result.msg); - } - }).catch((message) => { - alert.none(message) - }) - } - // 监听表单完善 - const [hozon, setHozon] = useState(false); - useEffect(() => { - if (retrieval) { - retrieval(formData).then(() => setHozon(true)).catch(() => setHozon(false)) - } - }, [formData]) - // 选择类型弹窗显示 - const selectTypeRef = useRef(null) - const handleSelectTypeModalShow = () => { - (selectTypeRef.current as any).setShow(true) - } - // 选择类型确定 - const handleSelectTypeConfirm = (item) => { - setFormData({ - ...formData, - authentication_type: item.id, - authentication_type_name: item.name - }); - } - // 上传图片 - const { getWxPhoto } = useUploadCDNImg(); - const handleUploadImage = async (text: any) => { - let result = await getWxPhoto('mall'); - if (text == "business_license_url") { - formData.business_license_url = IMG_CND_Prefix + (result as any).url; - } else { - formData.legal_person_identity_url[text] = IMG_CND_Prefix + (result as any).url as never; - } - setFormData({ ...formData }); - } - // 查看图片 - const handleViewImage = (event, url) => { - event.stopPropagation(); - Taro.previewImage({ - current: url, - urls: [url] - }) - } - - return ( - - {(adminUserInfo as any)?.authentication_status == 3 && } - - 企业认证 - {/* */} - - setFormData({ ...formData, name: ev.detail.value })} value={formData["name"]} label="企业名称" placeholder="请输入营业执照上的企业名称" required /> - {/* */} - setFormData({ ...formData, business_license: ev.detail.value })} value={formData["business_license"]} style={{ border: "0" }} label="企业营业执照" placeholder="注册号、统一社会信用代码、组织机构代码" required /> - handleUploadImage("business_license_url")} className="certification-upload"> - {(formData as any)?.business_license_url ? - <> - 营业执照正面 - - handleViewImage(e, (formData as any)?.business_license_url)}>查看证件 - 重新上传 - - - : - - + - 上传营业执照正面 - - } - - - - 法人认证 - setFormData({ ...formData, legal_person: ev.detail.value })} value={formData["legal_person"]} label="法人代表" placeholder="填写法人名称" required /> - setFormData({ ...formData, legal_person_identity: ev.detail.value })} value={formData["legal_person_identity"]} label="法人身份" placeholder="填写法人代表身份证号" required /> - handleUploadImage(0)} className="certification-upload"> - {(formData as any)?.legal_person_identity_url[0] ? - <> - 营业执照正面 - - handleViewImage(e, (formData as any)?.legal_person_identity_url[0])}>查看证件 - 重新上传 - - - : - - + - 上传身份证正面 - - } - - handleUploadImage(1)} className="certification-upload"> - {(formData as any)?.legal_person_identity_url[1] ? - <> - 营业执照正面 - - handleViewImage(e, (formData as any)?.legal_person_identity_url[1])}>查看证件 - 重新上传 - - - : - - + - 上传身份证正面 - - } - - - - - 取消 - {[3, 4].includes((adminUserInfo as any)?.authentication_status) ? "重新认证" : "提交"} - - - - ) -} diff --git a/src/pages/classList/components/filter/index.module.scss b/src/pages/classList/components/filter/index.module.scss deleted file mode 100644 index 599cdd0..0000000 --- a/src/pages/classList/components/filter/index.module.scss +++ /dev/null @@ -1,126 +0,0 @@ -.popup_main{ - width: 608px; - height: 100vh; - padding: 20px; - box-sizing: border-box; - display: flex; - flex-direction: column; - .popup_title{ - font-size: $font_size; - font-weight: 700; - text-align: center; - padding: 20px 0; - } - .scroll{ - flex:1; - height: 0; - } - .popup_filter{ - padding-bottom: 100px; - } - .popup_filter_item{ - margin-bottom: 20px; - .title{ - font-size: $font_size; - color: $color_font_one; - font-weight: 700; - padding: 20px 0; - } - .btn_list{ - display: grid; - grid-template-columns: repeat(3, 165.75px); - justify-content: space-between; - .btn_item{ - width: 165.75px; - height: 69.2px; - background: #f0f0f0; - border-radius: 34px; - text-align: center; - line-height: 69.2px; - font-size: $font_size_medium; - color: $color_font_one; - margin-bottom: 20px; - } - .select_btn_item{ - color: $color_main; - background: #ecf5ff; - border: 2px solid #007aff; - width: 161.75px; - height: 65.2px; - } - } - .btn_list_input{ - display: flex; - // justify-content: space-between; - align-items: center; - .btn_width { - width: 220px; - height: 70px; - background: #f0f0f0; - border-radius: 50px; - padding: 10px 20px; - box-sizing: border-box; - input{ - width: 100%; - height: 100%; - font-size: $font_size_medium; - } - } - .unit{ - color: $color_font_one; - font-size: $font_size; - margin-left: 20px; - } - text{ - color: #ccc; - padding: 0 20px; - } - .width_main{ - - } - } - .btn_list_element{ - background-color: #F0F0F0; - border-radius: 30px; - padding: 20px; - box-sizing: border-box; - textarea{ - width: 100%; - height: 126px; - font-size: $font_size_medium; - } - } - } - .btns_con{ - width: 100%; - position: fixed; - bottom:0; - padding-bottom: constant(safe-area-inset-bottom); - padding-bottom: env(safe-area-inset-bottom); - .btns_two{ - display: flex; - width: 552px; - height: 82px; - border: 2px solid #cde5ff; - font-size: $font_size_big; - border-radius: 40px; - margin-bottom: 20px; - .rest_btn{ - flex:1; - border-radius: 0px 40px 40px 0px; - text-align: center; - line-height: 82px; - color: $color_main; - - } - .verify_btn{ - flex:1; - border-radius: 0px 40px 40px 0px; - background: #007aff; - text-align: center; - line-height: 82px; - color: #fff; - } - } - } -} \ No newline at end of file diff --git a/src/pages/classList/components/filter/index.tsx b/src/pages/classList/components/filter/index.tsx deleted file mode 100644 index d64ab87..0000000 --- a/src/pages/classList/components/filter/index.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import Popup, {Params as PopuParams} from "@/components/popup" -import { Input, ScrollView, Text, Textarea, View } from "@tarojs/components" -import classnames from "classnames"; -import { useEffect, useState } from "react"; -import styles from './index.module.scss' - -type params = { - onFiltr?: (val:object) => void -} & PopuParams -export default ({onClose, onFiltr, show = false}:params) => { - const [filterObj, setFilterObj] = useState({ - series: '', - minWidth: '', - maxWidth: '', - minWeight: '', - maxWeight: '', - element: '' - - }) - const onCloseEven = () => { - onClose?.() - } - const onRest = () => { - console.log('12123') - setFilterObj({ - series: '', - minWidth: '', - maxWidth: '', - minWeight: '', - maxWeight: '', - element: '' - }) - } - useEffect(() => { - console.log(filterObj) - }, [filterObj]) - - const onVerify = () => { - console.log(filterObj) - onFiltr?.(filterObj) - } - - const setNumber = (e, field) => { - console.log(e) - let num = parseFloat(e.detail.value) - if(isNaN(num)) { - filterObj[field] = null - } else { - filterObj[field] = parseFloat(num.toFixed(2)) - } - setFilterObj({...filterObj}) - } - - const setElement = (e) => { - let res = e.detail.value - setFilterObj({...filterObj, element:res}) - } - return ( - - onCloseEven()} showIconButton={true}> - - 全部筛选 - - - - - 系列 - - 不限 - 不限 - 不限 - 不限 - 不限 - 不限 - - - - 幅宽 - - setNumber(e,'minWidth')} placeholder="自定义最低值" placeholderStyle="font-size: 26rpx"/> - - setNumber(e,'maxWidth')} placeholder="自定义最高值" placeholderStyle="font-size: 26rpx"/> - cm - - - - 克重 - - setNumber(e,'minWeight')} placeholder="自定义最低值" placeholderStyle="font-size: 26rpx"/> - - setNumber(e,'maxWeight')} placeholder="自定义最高值" placeholderStyle="font-size: 26rpx"/> - g - - - - 成分 - - - {descData.number}/{descData.count} - - setSave()}>保存 - - ) -} \ No newline at end of file diff --git a/src/pages/order/components/returnRecord/index.module.scss b/src/pages/order/components/returnRecord/index.module.scss deleted file mode 100644 index 4ef3d47..0000000 --- a/src/pages/order/components/returnRecord/index.module.scss +++ /dev/null @@ -1,165 +0,0 @@ -.returnRecord_main{ - height: 70vh; - .returnRecord_con{ - padding: 20px; - } - .order_item{ - background-color: #fff; - border-radius: 20px; - padding: 20px; - box-sizing: border-box; - box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.16); - margin-bottom: 20px; - .header{ - display: flex; - align-items: center; - .user{ - display: flex; - align-items: center; - .name { - color: #000; - font-weight: 700; - margin-left: 15px; - font-size: $font_size; - width: 100px; - @include common_ellipsis(); - } - image{ - width: 70px; - height: 70px; - border-radius: 50%; - } - } - .order_con { - padding-left: 15px; - width: 100%; - .name { - color: #000; - font-weight: 700; - font-size: $font_size; - } - .order_num { - flex: 1; - font-size: $font_size_medium; - color: $color_font_one; - padding-right: 10px; - display: flex; - justify-content: flex-start; - align-items: center; - .order_num_con{ - flex:1; - } - .miconfont { - font-size: 20px; - } - } - } - .tag{ - font-size: $font_size_min; - padding: 5px 15px; - background-color: $color_main; - color: #fff; - border-radius: 0px 20px 0px 20px; - } - } - .product_title{ - display: flex; - align-items: center; - padding: 35px 0; - .product_tag{ - background-color: #CDE5FF; - font-size: $font_size_min; - padding: 5px 10px; - color: $color_main; - border-radius: 6px; - } - .product_name{ - flex:1; - font-size: $font_size; - font-weight: 700; - padding: 0 20px; - @include common_ellipsis() - } - .product_status{ - font-size: $font_size; - color: $color_main; - } - } - .product_list{ - display: flex; - .image{ - width: 126px; - height: 126px; - border-radius: 20px ; - position: relative; - image{ - width: 100%; - height: 100%; - border-radius: 20px ; - } - .color_num { - background: rgba(0,0,0, 0.5); - border-radius: 36px 0px 20px 0px; - font-size: $font_size_min; - color: #fff; - position: absolute; - right:0; - bottom:0; - padding: 5px 10px 5px 15px; - box-sizing: border-box; - } - } - .color_list{ - flex:1; - padding-left: 30px; - .color_item{ - display: flex; - justify-content: space-between; - font-size: $font_size_min; - color: $color_font_three; - align-items: center; - margin-bottom: 20px; - .color_title{ - font-weight: 700; - font-size: $font_size; - color: #000; - } - .color_more{ - color: $color_font_three; - } - } - } - - } - .color_count_num{ - font-size: $font_size_min; - color: $color_font_two; - background-color: #F6F6F6; - border-radius: 10px; - padding: 10px 22px; - margin-top: 20px; - } - .order_number{ - display: flex; - background-color: #F6F6F6; - padding: 20px; - margin: 20px 0; - align-items: center; - font-size: $font_size_medium; - border-radius: 10px; - text{ - &:nth-child(1) { - - font-weight: 700; - color: $color_font_three; - border-right: 2px solid #CCCCCC; - padding-right: 20px; - } - &:nth-child(2) { - padding-left: 20px; - color: $color_font_one; - } - } - } - } -} \ No newline at end of file diff --git a/src/pages/order/components/returnRecord/index.tsx b/src/pages/order/components/returnRecord/index.tsx deleted file mode 100644 index 30a5ac9..0000000 --- a/src/pages/order/components/returnRecord/index.tsx +++ /dev/null @@ -1,164 +0,0 @@ -import { GetSaleOrderListApi, ReturnRecordApi } from "@/api/salesAfterOrder"; -import { goLink } from "@/common/common"; -import { formatHashTag, formatPriceDiv } from "@/common/fotmat"; -import { dataLoadingStatus, getFilterData } from "@/common/util"; -import InfiniteScroll from "@/components/infiniteScroll"; -import LabAndImg from "@/components/LabAndImg"; -import Popup from "@/components/popup"; -import { useSelector } from "@/reducers/hooks"; -import { Image, 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 { REFUND_STATUS_ORDER } from "@/common/enum"; -import OrderStatusTag from "../orderStatusTag"; - -type Param = { - show?: true|false, - onClose?: () => void, - onSubmit?: () => void, - id?: number -} -export default memo(({show, onClose, onSubmit, id}:Param) => { - //搜索参数 - const searchField = useRef({ - page : 1, - size : 10, - sale_order_id: 0 - }) - - useEffect(() => { - if(show && id) { - searchField.current.sale_order_id = id - getOrderList() - } - }, [show, id]) - - const userInfo = useSelector(state => state.userInfo) - - //获取售后订单列表 - const {fetchData: listFetchData, state:orderState} = ReturnRecordApi() - const [orderData, setOrderData] = useState<{list:any[], total:number}>({list:[], total:0}) - const getOrderList = async () => { - let res = await listFetchData(getFilterData(searchField.current)) - setOrderData({list: res.data.list, total: res.data.total}) - } - - //整理颜色 - const labAndRgbAndUrl = useCallback((item) => { - return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url} - }, [orderData]) - - const { - ReturnApplyOrderTypeReturnForRefund, // 退货退款 - } = REFUND_STATUS_ORDER - - //对应单价 - const standardPrice = useCallback((price, sale_mode) => { - return formatPriceDiv(price).toLocaleString() + '/' + (sale_mode == 1?'m':'kg') - }, [orderData]) - - //对应数量 - const formatCount = useCallback((item, sale_mode) => { - return sale_mode == 0? item.roll + '条' : Number(item.length / 100) + '米' - }, [orderData]) - - //上拉加载数据 - const pageNum = useRef({size: searchField.current.size, page: searchField.current.page}) - const getScrolltolower = () => { - if(orderData.list.length < orderData.total) { - pageNum.current.page++ - const size = pageNum.current.size * pageNum.current.page - searchField.current.size = size - } - } - - const numText = useCallback((value) => { - let total_number_new = value?.sale_mode == 0? value?.total_number:(value?.total_number/100) - return `${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${total_number_new}${value?.sale_mode == 0? '条':'米'}` - }, [orderData]) - - //监听滚动 - const [scrollStatus, setScrollStatus] = useState(false) - const onscroll = useCallback((e) => { - if(e.detail.scrollTop > 20) { - setScrollStatus(true) - } else { - setScrollStatus(false) - } - },[]) - - //数据加载状态 - const statusMore = useMemo(() => { - return dataLoadingStatus({list:orderData.list, total: orderData.total, status: orderState.loading}) - }, [orderData, orderState]) - - return ( - <> - - - - - {orderData?.list?.map(item => - goLink('/pages/salesAfter/index', {id: item?.id})}> - - - - - {userInfo?.adminUserInfo?.user_name} - - - 售后单号:{item?.return_order_no} - - - - - - - goLink('/pages/salesAfter/index', {id: item?.id})}> - - {item?.sale_mode_name} - {formatHashTag(item?.product_list?.[0].code, item?.product_list?.[0].name)} - {item?.stage_name} - - - - - {item?.product_list?.[0].product_colors?.[0].code} - - - {item?.product_list?.[0].product_colors?.map((itemColor, index) => { - return ( - (index <= 1)&& - {formatHashTag(itemColor.code, itemColor.name)} - {standardPrice(itemColor.sale_price, item.sale_mode)} - ×{formatCount(itemColor, item.sale_mode)} - - ) - }) - } - {(item?.product_list?.[0].product_colors.length > 2) && - …… - …… - …… - } - - - {numText(item)} - - {item?.type == ReturnApplyOrderTypeReturnForRefund?.value?'已申请退货':'已申请退款'} - 订单号:{item?.order_no} - - - )} - - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/order/components/scanPay/index.module.scss b/src/pages/order/components/scanPay/index.module.scss deleted file mode 100644 index dcb356d..0000000 --- a/src/pages/order/components/scanPay/index.module.scss +++ /dev/null @@ -1,54 +0,0 @@ -$top:170px; -.scanPay_main{ - .scanPay_con{ - padding: 20px; - background-color: #F6F6F6; - border-radius: 20px; - .miconfont_title{ - transform: rotate(-180deg); - position: absolute; - left: 20px; - top: 27px; - font-size: 37px; - color: $color_font_three; - z-index: 99; - - } - } - .title{ - font-size: $font_size_big; - color: #000000; - text-align: center; - font-weight: 700; - position: relative; - } - .desc{ - font-size: $font_size_min; - color: $color_main; - text-align: center; - padding: 10px 0; - .miconfont{ - font-size: 25px; - } - } - - .scanPay_list{ - border-radius: 10px; - height: 900px; - image{ - width: 100%; - } - } - .btns{ - background: #007aff; - border-radius: 40px; - width: 668px; - height: 82px; - text-align: center; - line-height: 80px; - width: 100%; - color: #fff; - font-size: 32px; - margin-top: 30px; - } -} \ No newline at end of file diff --git a/src/pages/order/components/scanPay/index.tsx b/src/pages/order/components/scanPay/index.tsx deleted file mode 100644 index 0e84828..0000000 --- a/src/pages/order/components/scanPay/index.tsx +++ /dev/null @@ -1,198 +0,0 @@ -import { Image, ScrollView, Text, View } from '@tarojs/components' -import { memo, useEffect, useRef, useState } from 'react' -import classnames from 'classnames' -import styles from './index.module.scss' -import Popup from '@/components/popup' -import Taro from '@tarojs/taro' -import { alert } from '@/common/common' -import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatWeightDiv } from '@/common/fotmat' -import useCheckAuthorize from '@/use/useCheckAuthorize' -import { GetPayCode } from '@/api/onlinePay' -import LoadingCard from '@/components/loadingCard' - -type Param = { - show?: true | false - onClose?: () => void - company?: string - qrcode?: string - orderInfo?: any -} -type ListParam = { - product_code: string - product_name: string - product_color_code: string - product_color_name: string - num: string - weight: string - length: string - sale_price: string - total_price: string - weight_error: string -} -export default memo(({ show = true, onClose, company, orderInfo }: Param) => { - const [detail, setDetail] = useState() - - useEffect(() => { - if (orderInfo) { - let lists: ListParam[] = [] - orderInfo.product_list?.map((pitem) => { - pitem?.product_colors?.map((citem) => { - lists.push({ - product_code: formatHashTag(pitem.code, '', 'name')!, - product_name: pitem.name, - product_color_code: formatHashTag(citem.code)!, - product_color_name: citem.name, - num: citem.roll.toString(), - length: (citem.length / 100).toString(), - weight: formatWeightDiv(citem.actual_weight || citem.estimate_weight).toString(), - sale_price: formatPriceDiv(citem.sale_price).toString(), - total_price: formatPriceDiv(citem.total_sale_price || citem.estimate_amount).toString(), //小计 - weight_error: formatWeightDiv(citem.weight_error).toString(), - }) - }) - }) - setDetail(() => ({ - title: '面料销售电子确认单', - company: orderInfo.company_name, //后端公司 - order_type: orderInfo.sale_mode_name, //类型:大货 - sale_user: orderInfo.sale_user_name, //业务员 - order_created_time: formatDateTime(orderInfo.create_time), - order_no: orderInfo.order_no, - shipment_mode: orderInfo.shipment_mode_name, //发货方式 - target_user_name: userName(orderInfo), //收件人 - target_address: address(orderInfo), //收货地址 - target_description: orderInfo.remark, //发货备注 - pay_account: orderInfo.offline_remittance_information?.transfer_remittance_account, //专属收款账号 - bank_account_name: orderInfo.offline_remittance_information?.account_name, //账户名称 - bank_name: orderInfo.offline_remittance_information?.bank_of_deposit, //开户银行 - pay_type: '', //支付方式, 可不传 - client: orderInfo.purchaser_name, //客户名称 - phone: userPhone(orderInfo), //收货手机号码 - order_total_length: (orderInfo.total_number / 100).toString(), //订单布匹长度 - order_total_price: formatPriceDiv(orderInfo.bill_total_sale_price).toString(), //订单价格 - order_total_num: orderInfo.total_number + '', - qrcode: '', //跳转链接 - order_total_weight: formatWeightDiv(orderInfo.total_weight || orderInfo.total_estimate_weight).toString(), //订单布匹重量 - list: lists, - show_qrcode: true, //是否显示码单 - estimate_amount: formatPriceDiv(orderInfo.estimate_amount).toString(), - show_estimate_amount: orderInfo.estimate_amount > 0 && orderInfo.total_sale_price <= 0, - total_sale_price: formatPriceDiv(orderInfo.total_sale_price).toString(), - show_total_sale_price: orderInfo.total_sale_price > 0, - total_weight_error_discount: formatPriceDiv(orderInfo.total_weight_error_discount).toString(), - show_total_weight_error_discount: orderInfo.total_weight_error_discount > 0, - actual_amount: formatPriceDiv(orderInfo.actual_amount).toString(), - show_actual_amount: orderInfo.actual_amount > 0, - wait_pay_amount: formatPriceDiv(orderInfo.wait_pay_amount).toString(), - show_wait_pay_amount: orderInfo.wait_pay_amount > 0, - show_barcode: true, - order_total_weight_error: formatWeightDiv(orderInfo.total_weight_error).toString(), //总空差重量 - })) - } - }, [orderInfo]) - - //收货地址 - const address = (addressInfo) => { - if (addressInfo?.shipment_mode == 2) { - return addressInfo?.province_name ? addressInfo.province_name + addressInfo.city_name + addressInfo.district_name + addressInfo.address_detail : '' - } else { - return addressInfo?.take_goods_address - } - } - - //收件人 - const userName = (addressInfo) => { - return addressInfo?.shipment_mode == 2 ? orderInfo.target_user_name : '' - } - - //手机号 - const userPhone = (addressInfo) => { - return addressInfo?.shipment_mode == 2 ? orderInfo.target_user_phone : orderInfo.take_goods_phone - } - - //获取支付二维码 - const [payCodeImage, setPayCodeImage] = useState('') - const fileData = useRef({ - filePath: '', - base64: '', - }) - const { fetchData, state } = GetPayCode() - const getCore = async () => { - let res = await fetchData(detail) - const base64 = res.data.base64 - setPayCodeImage(() => base64) - const time = new Date().valueOf() - const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64) || [] - let filePath = Taro.env.USER_DATA_PATH + '/img' + time + '.' + format - fileData.current.filePath = filePath - fileData.current.base64 = bodyData - const save = Taro.getFileSystemManager() - save.writeFile({ - filePath: fileData.current.filePath, - data: fileData.current.base64, - encoding: 'base64', - }) - } - useEffect(() => { - if (show) getCore() - }, [show]) - - //检查是否开启保存图片权限 - const { check } = useCheckAuthorize({ - scope: 'scope.writePhotosAlbum', - msg: '您没授权,无法保存图片', - }) - const saveImageCheck = async () => { - const res = await check() - res && saveImage() - } - - //保存图片 - const saveImage = () => { - alert.loading('正在保存图片') - Taro.saveImageToPhotosAlbum({ - filePath: fileData.current.filePath, - success: function (res) { - alert.success('图片保存成功') - }, - fail: function (err) { - console.log('err::', err) - }, - }) - } - - //预览图片 - const showImage = () => { - console.log('fileData.current.filePath::', fileData.current.filePath) - Taro.previewImage({ - current: fileData.current.filePath, // 当前显示 - urls: [fileData.current.filePath], // 需要预览的图片http链接列表 - }) - } - - //复制功能 - return ( - - - - - 扫码支付 - - - 扫码支付成功后,自动更新状态 - - - {(state.loading && ) || ( - - - - )} - - - 保存电子确认单 - - - - - ) -}) diff --git a/src/pages/order/components/scanPayCheck/index.module.scss b/src/pages/order/components/scanPayCheck/index.module.scss deleted file mode 100644 index 1aa0537..0000000 --- a/src/pages/order/components/scanPayCheck/index.module.scss +++ /dev/null @@ -1,55 +0,0 @@ -$top:170px; -.scanPay_main{ - .scanPay_con{ - padding: 20px; - background-color: #F6F6F6; - border-radius: 20px; - .miconfont_title{ - transform: rotate(-180deg); - position: absolute; - left: 20px; - top: 27px; - font-size: 37px; - color: $color_font_three; - z-index: 99; - - } - } - .title{ - font-size: $font_size_big; - color: #000000; - text-align: center; - font-weight: 700; - position: relative; - padding: 10px 0; - } - .desc{ - font-size: $font_size_min; - color: $color_main; - text-align: center; - padding: 10px 0; - .miconfont{ - font-size: 25px; - } - } - - .scanPay_list{ - border-radius: 10px; - height: 900px; - image{ - width: 100%; - } - } - .btns{ - background: #007aff; - border-radius: 40px; - width: 668px; - height: 82px; - text-align: center; - line-height: 80px; - width: 100%; - color: #fff; - font-size: 32px; - margin-top: 30px; - } -} \ No newline at end of file diff --git a/src/pages/order/components/scanPayCheck/index.tsx b/src/pages/order/components/scanPayCheck/index.tsx deleted file mode 100644 index 35b4835..0000000 --- a/src/pages/order/components/scanPayCheck/index.tsx +++ /dev/null @@ -1,194 +0,0 @@ -import { Image, ScrollView, Text, View } from '@tarojs/components' -import { memo, useEffect, useRef, useState } from 'react' -import classnames from 'classnames' -import styles from './index.module.scss' -import Popup from '@/components/popup' -import Taro from '@tarojs/taro' -import { alert } from '@/common/common' -import { formatDateTime, formatPriceDiv, formatRemoveHashTag, formatWeightDiv } from '@/common/fotmat' -import useCheckAuthorize from '@/use/useCheckAuthorize' -import { GetPayCode } from '@/api/onlinePay' -import LoadingCard from '@/components/loadingCard' - -type Param = { - show?: true | false - onClose?: () => void - company?: string - qrcode?: string - orderInfo?: any -} -type ListParam = { - product_code: string - product_name: string - product_color_code: string - product_color_name: string - num: string - weight: string - length: string - sale_price: string - total_price: string - weight_error: string -} -export default memo(({ show = true, onClose, company, orderInfo }: Param) => { - const [detail, setDetail] = useState() - - useEffect(() => { - if (show) { - getCore() - } - }, [show]) - - useEffect(() => { - if (orderInfo) { - let lists: ListParam[] = [] - orderInfo.product_list?.map((pitem) => { - pitem?.product_colors?.map((citem) => { - lists.push({ - product_code: formatRemoveHashTag(pitem.code), - product_name: pitem.name, - product_color_code: formatRemoveHashTag(citem.code), - product_color_name: citem.name, - num: citem.roll.toString(), - length: (citem.length / 100).toString(), - weight: formatWeightDiv(citem.actual_weight || citem.estimate_weight).toString(), - sale_price: formatPriceDiv(citem.sale_price).toString(), - total_price: formatPriceDiv(citem.total_sale_price || citem.estimate_amount).toString(), //小计 - weight_error: formatWeightDiv(citem.weight_error).toString(), - }) - }) - }) - setDetail(() => ({ - title: '面料销售电子确认单', - company: orderInfo.company_name, //后端公司 - order_type: orderInfo.sale_mode_name, //类型:大货 - sale_user: orderInfo.sale_user_name, //业务员 - order_created_time: formatDateTime(orderInfo.create_time), - order_no: orderInfo.order_no, - shipment_mode: orderInfo.shipment_mode_name, //发货方式 - target_user_name: userName(orderInfo), //收件人 - target_address: address(orderInfo), //收货地址 - target_description: orderInfo.remark, //发货备注 - pay_account: orderInfo.account, //专属收款账号 - bank_account_name: orderInfo.account_name, //账户名称 - bank_name: orderInfo.bank_of_deposit, //开户银行 - pay_type: '', //支付方式, 可不传 - client: orderInfo.purchaser_name, //客户名称 - phone: userPhone(orderInfo), //收货手机号码 - order_total_length: (orderInfo.total_number / 100).toString(), //订单布匹长度 - order_total_price: formatPriceDiv(orderInfo.bill_total_sale_price).toString(), //订单价格 - order_total_num: orderInfo.total_number.toString(), - qrcode: '', //跳转链接 - order_total_weight: formatWeightDiv(orderInfo.total_weight || orderInfo.total_estimate_weight).toString(), //订单布匹重量 - list: lists, - - estimate_amount: formatPriceDiv(orderInfo.estimate_amount).toString(), - show_estimate_amount: orderInfo.estimate_amount > 0 && orderInfo.total_sale_price <= 0, - total_sale_price: formatPriceDiv(orderInfo.total_sale_price).toString(), - show_total_sale_price: orderInfo.total_sale_price > 0, - total_weight_error_discount: formatPriceDiv(orderInfo.total_weight_error_discount).toString(), - show_total_weight_error_discount: orderInfo.total_weight_error_discount > 0, - actual_amount: formatPriceDiv(orderInfo.actual_amount).toString(), - show_actual_amount: orderInfo.actual_amount > 0, - wait_pay_amount: formatPriceDiv(orderInfo.wait_pay_amount).toString(), - show_wait_pay_amount: orderInfo.wait_pay_amount > 0, - show_barcode: true, - order_total_weight_error: formatWeightDiv(orderInfo.total_weight_error).toString(), //总空差重量 - })) - } - }, [orderInfo]) - - //收货地址 - const address = (addressInfo) => { - if (addressInfo?.shipment_mode == 2) { - return addressInfo?.province_name ? addressInfo.province_name + addressInfo.city_name + addressInfo.district_name + addressInfo.address_detail : '' - } else { - return addressInfo?.take_goods_address - } - } - - //收件人 - const userName = (addressInfo) => { - return addressInfo?.shipment_mode == 2 ? orderInfo.target_user_name : '' - } - - //手机号 - const userPhone = (addressInfo) => { - return addressInfo?.shipment_mode == 2 ? orderInfo.target_user_phone : orderInfo.take_goods_phone - } - - //获取支付二维码 - const [payCodeImage, setPayCodeImage] = useState('') - const fileData = useRef({ - filePath: '', - base64: '', - }) - const { fetchData, state } = GetPayCode() - const getCore = async () => { - let res = await fetchData(detail) - const base64 = res.data.base64 - setPayCodeImage(() => base64) - const time = new Date().valueOf() - const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64) || [] - let filePath = Taro.env.USER_DATA_PATH + '/img' + time + '.' + format - fileData.current.filePath = filePath - fileData.current.base64 = bodyData - const save = Taro.getFileSystemManager() - save.writeFile({ - filePath: fileData.current.filePath, - data: fileData.current.base64, - encoding: 'base64', - }) - } - - //检查是否开启保存图片权限 - const { check } = useCheckAuthorize({ scope: 'scope.writePhotosAlbum', msg: '您没授权,无法保存图片' }) - const saveImageCheck = async () => { - const res = await check() - res && saveImage() - } - - //保存图片 - const saveImage = () => { - alert.loading('正在保存图片') - Taro.saveImageToPhotosAlbum({ - filePath: fileData.current.filePath, - success: function () { - alert.success('图片保存成功') - }, - fail: function (err) { - console.log('err::', err) - }, - }) - } - - //预览图片 - const showImage = () => { - console.log('fileData.current.filePath::', fileData.current.filePath) - Taro.previewImage({ - current: fileData.current.filePath, // 当前显示 - urls: [fileData.current.filePath], // 需要预览的图片http链接列表 - }) - } - - //复制功能 - return ( - - - - - 查看销售码单 - - {(state.loading && ) || ( - - - - )} - - - 保存电子确认单 - - - - - ) -}) diff --git a/src/pages/order/components/shipmentMode/index.module.scss b/src/pages/order/components/shipmentMode/index.module.scss deleted file mode 100644 index 5f818f9..0000000 --- a/src/pages/order/components/shipmentMode/index.module.scss +++ /dev/null @@ -1,33 +0,0 @@ - - .order_title{ - display: flex; - align-items: center; - padding: 20px 30px; - box-sizing: border-box; - background-color: #fff; - height: 116px; - border-radius: 20px; - margin-top: 20px; - text{ - flex:1; - font-size: $font_size; - font-weight: 700; - } - .order_status{ - background-color: #F0F0F0; - width: 148px; - height: 55px; - color: $color_font_three; - text-align: center; - line-height: 55px; - font-size: $font_size_medium; - border-radius: 30px; - &:nth-last-child(1) { - margin-left: 20px; - } - } - .order_status_selected{ - color: $color_main; - border: 1px solid $color_main; - } - } \ No newline at end of file diff --git a/src/pages/order/components/shipmentMode/index.tsx b/src/pages/order/components/shipmentMode/index.tsx deleted file mode 100644 index 235591c..0000000 --- a/src/pages/order/components/shipmentMode/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { Text, View } from "@tarojs/components" -import styles from './index.module.scss' -import classnames from "classnames"; -import { memo, useRef, useState } from "react"; - -type Param = { - onSelect?:(val:number) => void -} -export default memo(({onSelect}: Param) => { - //收货方法 1:自提,2:物流 - const shipmentMode = useRef([ - {value:1, label:'上门自提', selected:false}, - {value:2, label:'物流', selected:false} - ]) - const [selectValue, setSelectValue] = useState() - const selectShipmentMode = (value) => { - setSelectValue(() => value) - onSelect?.(value) - } - return ( - - 收货方式 - {shipmentMode.current.map(item => { - return selectShipmentMode(item.value)}>{item.label} - })} - - ) -}) \ No newline at end of file diff --git a/src/pages/order/components/submitOrderBtn/index.module.scss b/src/pages/order/components/submitOrderBtn/index.module.scss deleted file mode 100644 index 7330951..0000000 --- a/src/pages/order/components/submitOrderBtn/index.module.scss +++ /dev/null @@ -1,67 +0,0 @@ -.order_price{ - display: flex; - align-items: center; - // justify-content: space-between; - width: 100%; - - .order_price_text{ - font-size: $font_size_medium; - // margin-right: 10px; - display: flex; - .iconfont_msg{ - position: relative; - } - .miconfont{ - font-size: 30px; - font-weight: normal; - } - .message{ - position: absolute; - top: -50px; - background: #A8B3BD; - z-index: 9; - min-height: 50px; - border-radius: 10px; - padding: 10px; - box-sizing: border-box; - &::before{ - z-index: 1; - position: absolute; - bottom: -7px; - left: 10px; - width: 15px; - height: 15px; - content: " "; - transform: rotate(45deg); - background: #A8B3BD; - box-sizing: border-box; - } - } - } - .emphasis{ - // font-weight: 700; - } - .order_price_num{ - color: $color_main; - font-weight: 700; - text{ - &:nth-child(1) { - font-size: $font_size_min; - } - &:nth-child(2) { - font-size: 44px; - } - &:nth-child(3) { - font-size: $font_size_medium; - } - } - } - .emphasis_num{ - text{ - &:nth-child(2) { - font-size: 44px; - } - } - } - -} \ No newline at end of file diff --git a/src/pages/order/components/submitOrderBtn/index.tsx b/src/pages/order/components/submitOrderBtn/index.tsx deleted file mode 100644 index 5e083c3..0000000 --- a/src/pages/order/components/submitOrderBtn/index.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { Text, View } from "@tarojs/components" -import { memo, useCallback, useEffect, useMemo } from "react" -import {formatKbPrice} from '@/common/common' -import classnames from "classnames"; -import styles from './index.module.scss' -type Param = { - style?: Object, - number?: number, //数量 - priceTitle: string //描述 - -} -export default memo(({style, number = 0, priceTitle = ''}:Param) => { - const priceDom = useCallback(() => { - let res = number.toFixed(2).split('.') - let int_num = parseInt(res[0]) + '' - let decimals_num = res[1] - return ( - <> - ¥ - {Number(int_num).toLocaleString()} - .{decimals_num} - - ) - }, [number]) - return ( - <> - - - {priceTitle}: - - - {priceDom()} - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/order/components/weightMemo/index.module.scss b/src/pages/order/components/weightMemo/index.module.scss deleted file mode 100644 index 3c74511..0000000 --- a/src/pages/order/components/weightMemo/index.module.scss +++ /dev/null @@ -1,39 +0,0 @@ - -.weight_memo{ - background-color: #fff; - border-radius: 20px; - padding: 0 20px; - .weight_memo_item{ - display: flex; - justify-content: space-between; - height: 130px; - &:nth-child(1) { - border-bottom: 1px solid #f3f3f3; - } - .title, .desc{ - display: flex; - align-items: center; - } - .title { - font-size: $font_size; - font-weight: 700; - } - .desc{ - color: $color_font_two; - font-size: $font_size_medium; - } - .miconfont_check, .miconfont_custom{ - font-size: 37px; - color: $color_main; - font-weight: normal; - padding-right: 10px; - } - .miconfont_custom{ - color:#FFC300; - } - .miconfont_more{ - font-size: 30px; - padding-left: 10px; - } - } -} \ No newline at end of file diff --git a/src/pages/order/components/weightMemo/index.tsx b/src/pages/order/components/weightMemo/index.tsx deleted file mode 100644 index 7cbfd13..0000000 --- a/src/pages/order/components/weightMemo/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import Popup from "@/components/popup" -import { Text, Textarea, View } from "@tarojs/components" -import { memo, useCallback, useState } from "react" -import styles from './index.module.scss' -import classnames from "classnames"; - -type Param = { - onCheck?: () => void - onCustom?: () => void -} -export default memo(({onCheck, onCustom}:Param) => { - return ( - - onCheck?.()}> - - - 陆盈纺织 - - - 查看原码单 - - - - onCustom?.()}> - - - 我的码单 - - - 自定义 - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/order/index.cofig.ts b/src/pages/order/index.cofig.ts new file mode 100644 index 0000000..2e9c6fa --- /dev/null +++ b/src/pages/order/index.cofig.ts @@ -0,0 +1,3 @@ +export default { + navigationBarTitleText: '订单', +} diff --git a/src/pages/order/index.config.ts b/src/pages/order/index.config.ts deleted file mode 100644 index 030cb10..0000000 --- a/src/pages/order/index.config.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default { - navigationBarTitleText: '订单详情', - enablePullDownRefresh: true, - backgroundTextStyle: 'dark', - enableShareAppMessage: true, -} diff --git a/src/pages/order/index.module.scss b/src/pages/order/index.module.scss deleted file mode 100644 index 9220587..0000000 --- a/src/pages/order/index.module.scss +++ /dev/null @@ -1,128 +0,0 @@ -.order_main { - min-height: 100%; - background-color: $color_bg_one; - padding: 20px; - padding-bottom: 190px; - box-sizing: border-box; - - .order_title { - display: flex; - align-items: center; - padding: 20px 30px; - box-sizing: border-box; - background-color: #fff; - height: 116px; - border-radius: 20px; - margin-top: 20px; - text { - flex: 1; - font-size: $font_size; - font-weight: 700; - } - .order_status { - background-color: #f0f0f0; - width: 148px; - height: 55px; - color: $color_font_three; - text-align: center; - line-height: 55px; - font-size: $font_size_medium; - border-radius: 30px; - &:nth-last-child(1) { - margin-left: 20px; - } - } - } - .order_desc { - display: flex; - align-items: center; - background-color: #fff; - padding: 20px; - min-height: 116px; - border-radius: 20px; - margin-top: 20px; - box-sizing: border-box; - .order_desc_con { - width: 150px; - font-size: $font_size; - font-weight: 700; - } - .order_desc_text, - .order_desc_text_hint { - font-size: $font_size_medium; - - margin-right: 10px; - flex: 1; - word-break: break-all; - } - .order_desc_text_hint { - text-align: right; - color: $color_font_two; - } - .miconfont { - font-size: 20px; - color: $color_font_two; - } - } - .submit_order_con { - position: fixed; - bottom: 0; - left: 0; - width: 100%; - background-color: #fff; - box-shadow: 6px 0px 12px 0px rgba(0, 0, 0, 0.16); - padding: 20px 20px; - box-sizing: border-box; - .order_btn { - width: 152px; - height: 72px; - border: 2px solid #dddddd; - border-radius: 46px; - display: flex; - justify-content: center; - align-items: center; - color: $color_font_three; - &:nth-child(n + 2) { - margin-left: 34px; - } - } - .order_btn_select { - color: $color_main; - border: 2px solid $color_main; - } - .order_number_desc { - font-size: $font_size_medium; - color: $color_font_two; - } - } - .order_info { - background-color: #fff; - margin-top: 20px; - border-radius: 20px; - padding: 20px; - .order_info_title { - font-size: $font_size; - font-weight: 700; - margin-bottom: 20px; - } - .order_num { - display: flex; - justify-content: space-between; - align-items: center; - width: 100%; - .order_num_btn { - font-size: $font_size_medium; - padding: 5px 10px; - border: 2px solid #007cf7; - border-radius: 10px; - color: $color_main; - } - } - text { - font-size: $font_size; - } - } - .weight_memo_con { - margin-bottom: 20px; - } -} diff --git a/src/pages/order/index.ts b/src/pages/order/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx deleted file mode 100644 index 348cec5..0000000 --- a/src/pages/order/index.tsx +++ /dev/null @@ -1,343 +0,0 @@ -import { GetSaleOrderDetailApi, EditSaleOrderRemarkApi } from '@/api/order' -import { AddShoppingCartApi } from '@/api/shopCart' -import { SubscriptionMessageApi } from '@/api/user' -import { alert, goLink } from '@/common/common' -import { ORDER_STATUS } from '@/common/enum' -import { formatDateTime, formatImgUrl } from '@/common/fotmat' -import OrderBtns from '@/components/orderBtns' -import Popup from '@/components/popup' -import SearchInput from '@/components/searchInput' -import ShopCart from '@/components/shopCart' -import useLogin from '@/use/useLogin' -import { Text, View } from '@tarojs/components' -import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro' -import classnames from 'classnames' -import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import AddressInfoDetail from './components/addressInfoDetail' -import AdvanceOrderState from './components/advanceOrderState' -import ApplyRefund from './components/applyRefund' -import KindList from './components/kindList' -import OrderState from './components/orderState' -import Payment from './components/payment' -import Remark from './components/remark' -import ReturnRecord from './components/returnRecord' -import ScanPayCheck from './components/scanPayCheck' -import styles from './index.module.scss' - -export default () => { - useLogin() - const [showDesc, setShowDesc] = useState(false) - const router = useRouter() - const orderId = useRef(Number(router.params.id)) - useDidShow(() => { - getSaleOrderPreView() - }) - - //订单状态枚举 - const { - SaleOrderStatusTaking, - SaleOrderStatusWaitingDelivery, - SaleOrderStatusWaitingReceipt, // 待收货 - SaleOrderStatusAlreadyReceipt, // 已收货 - SaleOrderStatusComplete, // 已完成 - SaleOrderStatusRefund, // 已退款 - SaleOrderStatusCancel, // 已取消 - SaleorderstatusWaitingPrePayment, // 预付款 - } = ORDER_STATUS - - //获取订单详情 - const firstOpen = useRef(true) - const [orderDetail, setOrderDetail] = useState() //获取到的原始数据 - const { fetchData: getOrderFetchData } = GetSaleOrderDetailApi() - const getSaleOrderPreView = async () => { - if (orderId.current) { - let res = await getOrderFetchData({ id: orderId.current }) - setOrderDetail(res.data) - setOrderRemark(res.data.remark) - //预付款自动打开支付 - if (firstOpen.current && SaleorderstatusWaitingPrePayment.value == res.data.status) { - firstOpen.current = false - toPay() - } - } - Taro.stopPullDownRefresh() - // Taro.hideToast() - } - - //监听获取到的数据 - useEffect(() => { - if (orderDetail) formatData() - }, [orderDetail]) - - //格式化数据格式 - const [formatDetailOrder, setFormatDetailOrder] = useState() //格式化后的数据 - const formatData = () => { - setFormatDetailOrder({ - ...orderDetail, - unit: orderDetail.sale_mode == 0 ? '条' : 'm', //单位 - list: orderDetail.product_list, - }) - } - const formatPreViewOrderMemo = useMemo(() => { - return formatDetailOrder - }, [formatDetailOrder]) - - //复制功能 - const clipboardData = () => { - Taro.setClipboardData({ - data: orderDetail?.order_no || '', - success: function (res) { - Taro.showToast({ - icon: 'none', - title: '复制成功', - }) - }, - }) - } - - //初始地址数据 - const defaultAddress = useMemo(() => { - return { - province_name: orderDetail?.province_name, - city_name: orderDetail?.city_name, - district_name: orderDetail?.district_name, - address_detail: orderDetail?.address_detail, - target_user_name: orderDetail?.target_user_name, - target_user_phone: orderDetail?.target_user_phone, - shipment_mode: orderDetail?.shipment_mode, - id: orderDetail?.id, - sale_mode: orderDetail?.sale_mode, - status: orderDetail?.status, - take_goods_address: orderDetail?.take_goods_address, - take_goods_phone: orderDetail?.take_goods_phone, - } - }, [orderDetail]) - - //订单备注 - const { fetchData: remarkFetchData } = EditSaleOrderRemarkApi() - const [orderRemark, setOrderRemark] = useState('') - const getRemark = useCallback(async (e) => { - setOrderRemark(() => e) - let res = await remarkFetchData({ remark: e, id: orderId.current }) - if (res.success) { - getSaleOrderPreView() - alert.success('提交成功') - } else { - alert.error(res.msg) - } - setShowDesc(() => false) - }, []) - const noCanOpenDescList = useRef([ - SaleOrderStatusTaking.value, //提货中 - SaleOrderStatusWaitingDelivery.value, //待发货 - SaleOrderStatusWaitingReceipt.value, // 待收货 - SaleOrderStatusAlreadyReceipt.value, // 已收货 - SaleOrderStatusComplete.value, // 已完成 - SaleOrderStatusRefund.value, // 已退款 - SaleOrderStatusCancel.value, // 已取消 - ]) - const descOpen = () => { - if (noCanOpenDescList.current.includes(orderDetail?.status)) return alert.none('该订单状态不能修改备注') - setShowDesc(() => true) - } - - //去付款 - const [payMentShow, setPayMentShow] = useState(false) - const toPay = () => { - setPayMentShow(true) - } - - //打开地址修改 - const addressRef = useRef(null) - - //修改收货方式 - const getShipmentMode = useCallback(() => { - getSaleOrderPreView() - }, [orderDetail]) - - //修改地址 - const getAddress = useCallback(() => { - getSaleOrderPreView() - }, [orderDetail]) - - //获取底部按钮点击, 获取按钮状态 - const orderStateClick = useCallback( - (val) => { - if (val == 1 || val == 6 || val == 8) { - getSaleOrderPreView() - } else if (val == 2) { - //待付款 - toPay() - } else if (val == 3) { - //申请退款 - if (!orderDetail?.av_return_roll) return alert.none('该订单已申请过退款') - setRefundShow(true) - } else if (val == 7) { - //再购 - addShopCart() - } else if (val == 9) { - //售后记录 - onReturnRecordShow() - } else if (val == 10) { - setShowScanPayCheck(true) - } - }, - [orderDetail], - ) - - //页面下拉刷新 - usePullDownRefresh(() => { - getSaleOrderPreView() - }) - - //支付成功 - const onPaySuccess = useCallback(() => { - alert.success('支付成功') - getSaleOrderPreView() - closePayShow() - }, [orderDetail]) - - //关闭支付弹窗 - const closePayShow = useCallback(() => { - setPayMentShow(() => false) - }, [orderDetail]) - - //按钮所需数据 - const orderInfo = useMemo(() => { - return { - orderId: orderDetail?.id, - ...orderDetail, - } - }, [orderDetail]) - - //刷新页面 - const refresh = useCallback(() => { - alert.loading('刷新中') - getSaleOrderPreView() - }, [orderDetail]) - - //退款申请 - const [refundShow, setRefundShow] = useState(false) - const applyRefundClose = useCallback(() => { - setRefundShow(false) - }, []) - const applyRefundSuccess = useCallback(() => { - getSaleOrderPreView() - }, []) - - //查看物流 - const getLogistics = useCallback(() => { - if (orderDetail?.delivery_appendix_url) { - const list = orderDetail?.delivery_appendix_url?.map((item) => { - return formatImgUrl(item, '!w800') - }) - if (list?.length <= 0) return alert.error('暂无图片') - Taro.previewImage({ - current: list[0], // 当前显示 - urls: list, // 需要预览的图片http链接列表 - }) - } - }, [orderDetail]) - - //添加购物车 - const [showCart, setShowCart] = useState(false) - const { fetchData: addFetchData } = AddShoppingCartApi() - const addShopCart = async () => { - let color_list: { product_color_id: number; roll?: number; length?: number }[] = [] - orderDetail?.product_list.map((pitem) => { - pitem?.product_colors.map((citem) => { - if (orderDetail?.sale_mode == 0) { - return color_list.push({ product_color_id: citem.id, roll: citem.roll }) - } else { - return color_list.push({ product_color_id: citem.id, length: citem.length }) - } - }) - }) - const state = await addFetchData({ - sale_mode: orderDetail?.sale_mode, - color_list, - }) - if (state.success) { - Taro.showToast({ - title: '已加入购物车', - }) - setShowCart(true) - } else { - Taro.showToast({ - icon: 'none', - title: state.msg, - }) - } - } - - //显示售后记录 - const [returnRecordShow, setReturnRecordShow] = useState(false) - const onReturnRecordShow = useCallback(() => { - setReturnRecordShow(true) - }, []) - const closeReturnRecord = useCallback(() => { - setReturnRecordShow(false) - }, []) - - //显示 - const [showScanPayCheck, setShowScanPayCheck] = useState(false) - - return ( - - {(orderDetail?.status != SaleorderstatusWaitingPrePayment.value && ) || ( - - )} - - - - - - 订单信息 - - - {orderDetail?.order_no} - clipboardData()}> - 复制 - - - - - {formatDateTime(orderDetail?.create_time)} - - {orderDetail?.payment_time && ( - - {formatDateTime(orderDetail?.payment_time)} - - )} - - - 订单备注 - {(orderRemark && {orderDetail?.remark}) || ( - 填写备注 - )} - - - {orderDetail?.status != SaleOrderStatusCancel.value && ( - - - - - )} - setShowDesc(false)}> - getRemark(e)} defaultValue={orderDetail?.remark} /> - - - setShowScanPayCheck(false)} orderInfo={orderDetail} /> - - setShowCart(false)} /> - - - - ) -} diff --git a/src/pages/order/orderList/components/order/index.module.scss b/src/pages/order/orderList/components/order/index.module.scss deleted file mode 100644 index 1d21036..0000000 --- a/src/pages/order/orderList/components/order/index.module.scss +++ /dev/null @@ -1,149 +0,0 @@ -.order_item{ - background-color: #fff; - border-radius: 20px; - padding: 20px; - box-sizing: border-box; - .header{ - display: flex; - align-items: center; - .user{ - display: flex; - align-items: center; - - image{ - width: 70px; - height: 70px; - border-radius: 50%; - } - } - .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{ - - } - - } - } - .product_status{ - font-size: $font_size; - color: $color_main; - font-weight: 700; - } - - } - .product_con{ - margin-bottom: 20px; - } - .product_title{ - display: flex; - align-items: center; - padding: 35px 0; - .product_tag{ - background-color: #CDE5FF; - font-size: $font_size_min; - padding: 5px 10px; - color: $color_main; - border-radius: 6px; - } - .product_name{ - flex:1; - font-size: $font_size; - font-weight: 700; - padding: 0 20px; - @include common_ellipsis() - } - - .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{ - display: flex; - .image{ - width: 126px; - height: 126px; - border-radius: 20px; - position: relative; - image{ - width: 100%; - height: 100%; - border-radius: 20px 20px 0px 0px; - } - .color_num { - background: rgba(0,0,0, 0.5); - border-radius: 50px 0px 20px 0px; - font-size: $font_size_min; - color: #fff; - position: absolute; - right:0; - bottom:0; - padding: 5px 10px 5px 20px; - box-sizing: border-box; - } - } - .color_list{ - flex:1; - padding-left: 30px; - .color_item{ - display: flex; - justify-content: space-between; - font-size: $font_size_min; - color: $color_font_three; - align-items: center; - margin-bottom: 20px; - .color_title{ - font-weight: 700; - font-size: $font_size; - color: #000; - } - .color_more{ - color: $color_font_three; - } - } - } - - } - .color_count_num{ - font-size: $font_size_min; - color: $color_font_two; - background-color: #F6F6F6; - border-radius: 10px; - padding: 10px 22px; - margin-top: 20px; - display: flex; - justify-content: space-between; - align-items: center; - .price{ - font-size: 30px; - color: #007AFF; - text{ - font-size: 23px; - } - } - } -} \ No newline at end of file diff --git a/src/pages/order/orderList/components/order/index.tsx b/src/pages/order/orderList/components/order/index.tsx deleted file mode 100644 index b52f925..0000000 --- a/src/pages/order/orderList/components/order/index.tsx +++ /dev/null @@ -1,163 +0,0 @@ -import { goLink } from '@/common/common' -import { ORDER_STATUS } from '@/common/enum' -import { formatHashTag, formatImgUrl, formatPriceDiv } from '@/common/fotmat' -import LabAndImg from '@/components/LabAndImg' -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' - -type Param = { - value: { - order_no: string - sale_mode: number - sale_mode_name: string - status_name: string - shipment_mode: number - shipment_mode_name: string - product_list: any[] - total_fabrics: number - total_colors: number - total_number: number - status: 0 - id: number - lab: any - rgb: any - texture_url: string - payment_method: number //支付方式 - actual_amount: number //实付金额 - wait_pay_amount: number //待付金额 - should_collect_order_id: number //应付单id - av_return_roll: number - total_sale_price: number - estimate_amount: number - is_return: true | false - } - 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) => { - return sale_mode == 0 ? item.roll : Number(item.length / 100) - }, - [value], - ) - //对应单价 - const standardPrice = useCallback( - (price, sale_mode) => { - return '¥' + formatPriceDiv(price).toLocaleString() + '/' + (sale_mode == 1 ? 'm' : 'kg') - }, - [value], - ) - - //点击订单按钮 - const orderBtnsClick = useCallback( - (status) => { - onClickBtn?.({ status, orderInfo: value }) - }, - [value], - ) - - let { SaleOrderStatusTaking, SaleOrderStatusWaitingReceipt } = ORDER_STATUS - - //订单状态 - // const orderStatus = useCallback((item) => { - // return item.status == SaleOrderStatusTaking.value?'装车中':item.status_name - // }, [value]) - - //按钮所需数据 - const orderInfo = useMemo(() => { - return { - orderId: value?.id, - ...value, - } - }, [value]) - - //总条数 - const numText = useMemo(() => { - let total_number_new = value?.sale_mode == 0 ? value?.total_number : value?.total_number / 100 - return `${value?.total_fabrics} 种面料,${value?.total_colors} 种颜色,共 ${total_number_new}${value?.sale_mode == 0 ? ' 条' : ' 米'}` - }, [value]) - - //订单状态 - const orderStatus = useMemo(() => { - if (value.status == SaleOrderStatusWaitingReceipt.value && value.shipment_mode == 1) { - return '待提货' - } else { - return value?.status_name - } - }, [value]) - - return ( - - goLink('/pages/order/index', { id: value?.id })}> - - - - - {userInfo?.adminUserInfo?.user_name} - - - 订单号:{value?.order_no} - - - {orderStatus} - - - - goLink('/pages/order/index', { id: value?.id })}> - - {value?.sale_mode_name} - {formatHashTag(value?.product_list?.[0].code, value?.product_list?.[0].name)} - {value?.shipment_mode_name} - - - - - {value?.product_list?.[0].product_colors?.[0].code} - - - {value?.product_list?.[0].product_colors.map((itemColor, index) => { - return ( - index <= 1 && ( - - {formatHashTag(itemColor.code, itemColor.name)} - {standardPrice(itemColor.sale_price, value.sale_mode)} - ×{formatCount(itemColor, value.sale_mode) + (value.sale_mode == 0 ? ' 条' : ' 米')} - - ) - ) - })} - {value?.product_list?.[0].length > 2 && ( - - …… - …… - …… - - )} - - - - {numText} - - ¥ - {value.total_sale_price ? formatPriceDiv(value.total_sale_price, 100, true) : formatPriceDiv(value.estimate_amount, 100, true)} - - - - - - ) -}) diff --git a/src/pages/order/orderList/components/orderStatusList/index.module.scss b/src/pages/order/orderList/components/orderStatusList/index.module.scss deleted file mode 100644 index 47de83d..0000000 --- a/src/pages/order/orderList/components/orderStatusList/index.module.scss +++ /dev/null @@ -1,18 +0,0 @@ -.order_status_list{ - font-size: $font_size; - color: #9E9E9E; - margin-top: 20px; - .order_status_item{ - padding: 20px; - box-sizing: border-box; - } - .selected{ - font-weight: 700; - color: #000; - border-bottom: 4px solid #707070; - } - .order_list_scroll{ - white-space: nowrap; - display: flex; - } -} \ No newline at end of file diff --git a/src/pages/order/orderList/components/orderStatusList/index.tsx b/src/pages/order/orderList/components/orderStatusList/index.tsx deleted file mode 100644 index b2e1e89..0000000 --- a/src/pages/order/orderList/components/orderStatusList/index.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { ScrollView, View } from '@tarojs/components' -import { memo, useEffect, useState } from 'react' -import styles from './index.module.scss' -import classnames from 'classnames' - -type Param = { - list: { id: number; name: string }[] - defaultId?: number | null - onSelect?: (val: number) => void -} -export default memo(({ list = [], defaultId = null, onSelect }: Param) => { - const [selectInfo, setSelectInfo] = useState({ - selected: -1, //当前选中的id - tabId: '', //需要滚动到的id - }) - useEffect(() => { - if (defaultId) { - console.log('defaultId:::', defaultId) - const index = list?.findIndex((item) => { - return item.id == defaultId - }) - if (index !== -1) { - const num = index > 0 ? index - 1 : 0 - 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 - setSelectInfo((e) => ({ ...e, tabId: list[num].id.toString(), selected: item.id })) - onSelect?.(item.id) - } - - return ( - - - - {list.map((item, index) => { - return ( - clickEvent({ item, index })} - className={classnames(styles.order_status_item, selectInfo.selected == item.id && styles.selected)}> - {item.name} - - ) - })} - - - - ) -}) diff --git a/src/pages/order/orderList/index.config.ts b/src/pages/order/orderList/index.config.ts deleted file mode 100644 index 7a9457b..0000000 --- a/src/pages/order/orderList/index.config.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default { - navigationBarTitleText: '订单列表', - enableShareAppMessage: true, - enablePullDownRefresh: true, - backgroundTextStyle: 'dark', -} diff --git a/src/pages/order/orderList/index.module.scss b/src/pages/order/orderList/index.module.scss deleted file mode 100644 index a106442..0000000 --- a/src/pages/order/orderList/index.module.scss +++ /dev/null @@ -1,38 +0,0 @@ -.order_list_main { - height: 100vh; - background-color: $color_bg_one; - display: flex; - flex-direction: column; - .title { - padding: 0 20px; - background-color: #fff; - box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.16); - border-bottom: 2px solid #e2e2e2; - height: 160px; - .order_status_list { - font-size: $font_size; - color: #9e9e9e; - margin-top: 20px; - .order_status_item { - padding: 20px; - box-sizing: border-box; - } - .selected { - font-weight: 700; - color: #000; - border-bottom: 4px solid #707070; - } - .order_list_scroll { - white-space: nowrap; - display: flex; - } - } - } - .order_list { - height: calc(100vh - 160px); - .order_item_con { - margin-top: 20px; - padding: 0 20px; - } - } -} diff --git a/src/pages/order/orderList/index.tsx b/src/pages/order/orderList/index.tsx deleted file mode 100644 index c9f3c02..0000000 --- a/src/pages/order/orderList/index.tsx +++ /dev/null @@ -1,228 +0,0 @@ -import Search from '@/components/search' -import useLogin from '@/use/useLogin' -import { View } from '@tarojs/components' -import Taro, { useDidShow } from '@tarojs/taro' -import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import styles from './index.module.scss' -import Order from './components/order' -import InfiniteScroll from '@/components/infiniteScroll' -import { GetOrderListApi, OrderStatusListApi } from '@/api/order' -import { dataLoadingStatus, getFilterData } from '@/common/util' -import OrderStatusList from './components/orderStatusList' -import { AddShoppingCartApi } from '@/api/shopCart' -import ShopCart from '@/components/shopCart' -import { alert } from '@/common/common' -import { useRouter } from '@tarojs/runtime' -import Payment from '../components/payment' -import ApplyRefund from '../components/applyRefund' -import ReturnRecord from '../components/returnRecord' - -export default () => { - const { checkLogin } = useLogin() - useDidShow(async () => { - 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: number | null; page: number; size: number; name: string }>({ - status: null, - page: 1, - size: 10, - name: '', - }) - - //获取订单状态 - const { fetchData: orderStatusListFetchData } = OrderStatusListApi() - const [statusList, setStatusList] = useState([{ id: -1, name: '全部' }]) - const getOrderStatusList = async () => { - let res = await orderStatusListFetchData() - setStatusList((e) => [...e, ...res.data.list]) - } - useEffect(() => { - getOrderStatusList() - }, []) - - //获取订单列表 - const { fetchData: listFetchData, state: orderState } = GetOrderListApi() - const [orderData, setOrderData] = useState<{ list: any[]; total: number }>({ list: [], total: 0 }) - const getOrderList = async () => { - let res = await listFetchData(getFilterData(searchField)) - setOrderData((e) => ({ ...e, list: res.data?.list, total: res.data?.total })) - setRefresherTriggeredStatus(() => false) - } - - //监听筛选条件变化 - useEffect(() => { - if (searchField.status != null) getOrderList() - }, [searchField]) - - //上拉加载数据 - const pageNum = useRef({ size: searchField.size, page: searchField.page }) - const getScrolltolower = useCallback(() => { - if (orderData.list.length < orderData.total) { - pageNum.current.page++ - const size = pageNum.current.size * pageNum.current.page - setSearchField({ ...searchField, size }) - } - }, [orderData]) - - //状态改变 - const changeStatus = useCallback((e) => { - pageNum.current.page = 1 - setSearchField((value) => ({ ...value, status: e, size: 10 })) - setOrderData(() => ({ list: [], total: 0 })) - }, []) - - //数据加载状态 - const statusMore = useMemo(() => { - return dataLoadingStatus({ list: orderData.list, total: orderData.total, status: orderState.loading }) - }, [orderData, orderState]) - - //输入了搜索关键字 - const getSearchData = useCallback((e) => { - pageNum.current.page = 1 - setOrderData(() => ({ list: [], total: 0 })) - setSearchField((val) => ({ ...val, name: e, size: 10 })) - }, []) - - //列表下拉刷新 - const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false) - const getRefresherRefresh = async () => { - pageNum.current.size = 1 - setRefresherTriggeredStatus(true) - setSearchField((val) => ({ ...val, size: 10 })) - } - - //监听点击的按钮 - const clickOrderBtn = useCallback( - ({ status, orderInfo }) => { - setCallBackPayOrderInfo(() => orderInfo) - if (status == 1 || status == 6 || status == 8) { - getOrderList() - } else if (status == 2) { - //去支付 - toPay() - } else if (status == 3) { - //申请退款 - if (!orderInfo?.av_return_roll) return alert.none('该订单已申请过退款') - setRefundShow(true) - } else if (status == 7) { - //购买 - addShopCart(orderInfo) - } else if (status == 9) { - onReturnRecordShow() - } else if (status == 10) { - setShowScanPayCheck(true) - } - }, - [orderData], - ) - - const [callBackOrderInfo, setCallBackPayOrderInfo] = useState() - - //去付款 - const [payMentShow, setPayMentShow] = useState(false) - const toPay = () => { - setPayMentShow(true) - } - //关闭支付弹窗 - const closePayShow = useCallback(() => { - setPayMentShow(() => false) - }, []) - //支付成功 - const onPaySuccess = useCallback(() => { - getOrderList() - closePayShow() - }, []) - - //添加购物车 - const [showCart, setShowCart] = useState(false) - const { fetchData: addFetchData } = AddShoppingCartApi() - const addShopCart = async (item) => { - let color_list: { product_color_id: number; roll?: number; length?: number }[] = [] - item?.product_list.map((pitem) => { - pitem?.product_colors.map((citem) => { - if (item?.sale_mode == 0) { - return color_list.push({ product_color_id: citem.id, roll: citem.roll }) - } else { - return color_list.push({ product_color_id: citem.id, length: citem.length }) - } - }) - }) - const state = await addFetchData({ - sale_mode: item?.sale_mode, - color_list, - }) - if (state.success) { - Taro.showToast({ - title: '已加入购物车', - }) - setShowCart(true) - } else { - Taro.showToast({ - icon: 'none', - title: state.msg, - }) - } - } - - //申请退款 - const [refundShow, setRefundShow] = useState(false) - const applyRefundClose = useCallback(() => { - setRefundShow(false) - }, []) - const applyRefundSuccess = useCallback(() => { - getOrderList() - }, []) - - //显示售后记录 - const [returnRecordShow, setReturnRecordShow] = useState(false) - const onReturnRecordShow = useCallback(() => { - setReturnRecordShow(true) - }, []) - const closeReturnRecord = useCallback(() => { - setReturnRecordShow(false) - }, []) - - //显示 - const [showScanPayCheck, setShowScanPayCheck] = useState(false) - - return ( - - - - - - - - {orderData?.list?.map((item) => { - return ( - - - - ) - })} - - - - setShowCart(false)} default_sale_mode={callBackOrderInfo?.sale_mode} /> - - - - ) -} diff --git a/src/pages/salesAfter/components/addressInfo/index.module.scss b/src/pages/salesAfter/components/addressInfo/index.module.scss deleted file mode 100644 index 4e9ea21..0000000 --- a/src/pages/salesAfter/components/addressInfo/index.module.scss +++ /dev/null @@ -1,71 +0,0 @@ -.order_address{ - height: 178px; - background: #ffffff; - border-radius: 20px; - display: flex; - align-items: center; - padding: 30px; - box-sizing: border-box; - margin-top: 20px; - .order_address_icon{ - font-size: 76px; - color: $color_main; - } - .order_address_text_con{ - flex:1; - padding: 0 30px; - box-sizing: border-box; - .order_address_text_title{ - font-size: $font_size_medium; - margin-top: 10px; - @include common_ellipsis; - } - .order_address_text_name{ - - align-items: center; - text{ - &:nth-child(1) { - color: #000; - font-weight: 700; - font-size: $color_font_one; - margin-right: 40px; - } - &:nth-child(2) { - color: $color_font_one; - font-size: $font_size_medium; - } - } - } - } - .updateBtn{ - font-size: $font_size_medium; - color: $color_font_three; - width: 96px; - height: 52px; - border: 2px solid #dddddd; - border-radius: 28px; - text-align: center; - line-height: 52px; - } - .order_address_text_no{ - flex: 1; - font-size: $font_size; - font-weight: 700; - margin-left: 30px; - } - .order_address_more_icon{ - color: $color_font_three; - font-size: $font_size; - } - -} -.order_address_list { - height: 900px; - .order_address_title{ - font-size: $font_size; - font-weight: 700; - width: 100%; - text-align: center; - padding: 20px 0 30px 0; - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/addressInfo/index.tsx b/src/pages/salesAfter/components/addressInfo/index.tsx deleted file mode 100644 index 4225fea..0000000 --- a/src/pages/salesAfter/components/addressInfo/index.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import AddressList from "@/components/AddressList"; -import Popup from "@/components/popup"; -import { Text, View } from "@tarojs/components" -import classnames from "classnames"; -import { memo, useCallback, useEffect, useMemo, useState } from "react"; -import styles from './index.module.scss' - -export type AddressInfoParam = { - province_name: string, - city_name: string, - district_name: string, - address_detail: string, - id?: number, - name: string, - phone: string -} -type Param = { - onSelect?: (val:any) => void, //选择 - defaultValue?: AddressInfoParam|null //默认值 - disabled?: false|true //true禁用后只用于展示 -} - -export default memo(({onSelect, defaultValue = null, disabled = false}: Param) => { - const [showAddressList, setShowAddressList] = useState(false) - - useEffect(() => { - setUserInfo(() => defaultValue) - }, [defaultValue]) - - //选择地址 - const [userInfo, setUserInfo] = useState() - const getAddress = useCallback((val) => { - setShowAddressList(() => false) - setUserInfo(() => val) - onSelect?.(val) - }, []) - - //地址格式 - const formatAddress = useMemo(() => { - if(userInfo) - return userInfo.province_name + userInfo.city_name + userInfo.district_name + userInfo.address_detail - }, [userInfo]) - - const changeShow = () => { - if(!disabled) - setShowAddressList(() => true) - } - return ( - - changeShow()}> - - {!userInfo&& - <> - 请选择收货地址及信息 - - - ||<> - - - {userInfo?.name} - {userInfo?.phone} - - {formatAddress} - - 修改 - } - - {!disabled&& setShowAddressList(false)}> - - 请选择收货地址 - getAddress(item)}/> - - } - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/addressInfoDetail/index.module.scss b/src/pages/salesAfter/components/addressInfoDetail/index.module.scss deleted file mode 100644 index 95a6490..0000000 --- a/src/pages/salesAfter/components/addressInfoDetail/index.module.scss +++ /dev/null @@ -1,88 +0,0 @@ -.address_main { - margin-top: 20px; -} - -.address_title_tag { - font-size: 24px; - color: #ee7500; - background: rgba(255, 230, 206, 0.36); - border-radius: 20px 20px 0px 0px; - height: 56px; - display: flex; - align-items: center; - position: relative; - z-index: 999; - .miconfont { - font-size: 30px; - padding: 0 20px; - } -} - -.order_address { - min-height: 178px; - background: #ffffff; - border-radius: 0 0 20px 20px; - display: flex; - align-items: center; - padding: 30px; - box-sizing: border-box; - position: relative; - .order_address_icon { - font-size: 50px; - color: $color_main; - position: absolute; - top: 35px; - left: 20px; - } - .order_address_text_con { - flex: 1; - padding-left: 50px; - box-sizing: border-box; - height: 100%; - display: flex; - flex-direction: column; - justify-content: space-between; - .order_address_text_title { - font-size: $font_size_medium; - margin-top: 10px; - display: flex; - align-items: center; - justify-content: space-between; - .moreIconfont { - font-size: 20px; - } - .address_text { - word-break: break-all; - font-size: 28px; - font-weight: 700; - } - } - .order_address_text_name { - color: #707070; - align-items: center; - display: flex; - margin-top: 20px; - text { - &:nth-child(1) { - font-size: $font_size_medium; - margin-right: 40px; - } - &:nth-child(2) { - flex: 1; - font-size: $font_size_medium; - } - } - } - } - .updateBtn { - width: 152px; - font-size: 28px; - height: 60px; - color: #007aff; - z-index: 999; - border: 2px solid #007aff; - border-radius: 36px; - text-align: center; - line-height: 60px; - } -} diff --git a/src/pages/salesAfter/components/addressInfoDetail/index.tsx b/src/pages/salesAfter/components/addressInfoDetail/index.tsx deleted file mode 100644 index fb99242..0000000 --- a/src/pages/salesAfter/components/addressInfoDetail/index.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { AFTER_ORDER_STATUS, REFUND_STATUS_ORDER } from '@/common/enum' -import { Text, View } from '@tarojs/components' -import classnames from 'classnames' -import { memo, useMemo } from 'react' -import styles from './index.module.scss' - -type Param = { - onLogistics?: (val: 1 | 2) => void //1 上传物流 2 查看物流 - orderInfo: { - return_user_name?: string - return_user_phone?: string - stage?: number - sale_mode?: 0 | 1 | 2 //0 大货 1剪板 2散剪 - type?: number //申请单退款状态 - return_address?: string - } -} -export default memo(({ orderInfo, onLogistics }: Param) => { - const { - ReturnStageApplying, - ReturnStageWaitCheck, - ReturnStageChecked, - ReturnStageReturned, - ReturnStageCancel, - ReturnStageQualityCheckPendingRefund, - ReturnStageServiceOrderPendingRefund, - ReturnStageRejected, - } = AFTER_ORDER_STATUS - - const { - ReturnApplyOrderTypeAdvanceReceiptRefund, // 预收退款 - ReturnApplyOrderTypeReturnForRefund, // 退货退款 - ReturnApplyOrderTypeSalesRefund, // 销售退款 - } = REFUND_STATUS_ORDER - - //是否显示地址 - const showAddress = useMemo(() => { - let after_list = [ReturnStageApplying.value, ReturnStageCancel.value, ReturnStageRejected.value] - let refurn_list = [ReturnApplyOrderTypeSalesRefund.value, ReturnApplyOrderTypeAdvanceReceiptRefund.value] - return !after_list.includes(orderInfo?.stage!) && orderInfo?.sale_mode != 1 && !refurn_list.includes(orderInfo?.type!) - }, [orderInfo]) - - //上传物流 - const upLogistics = useMemo(() => { - return orderInfo?.stage == ReturnStageWaitCheck.value - }, [orderInfo]) - - return ( - <> - {showAddress && ( - - - - 请按以下退货地址寄回货物并提供退货物流信息 - - - - - - {orderInfo?.return_address} - - - 谭先生 - {orderInfo?.return_user_phone} - {(upLogistics && ( - onLogistics?.(1)}> - 上传物流 - - )) || ( - onLogistics?.(2)}> - 查看物流 - - )} - - - - - )} - - ) -}) diff --git a/src/pages/salesAfter/components/amountShow/index.module.scss b/src/pages/salesAfter/components/amountShow/index.module.scss deleted file mode 100644 index 647e203..0000000 --- a/src/pages/salesAfter/components/amountShow/index.module.scss +++ /dev/null @@ -1,35 +0,0 @@ -.order_price_num{ - color: $color_main; - font-weight: 700; - text{ - &:nth-child(1) { - font-size: $font_size_min; - } - &:nth-child(2) { - font-size: $font_size; - } - &:nth-child(3) { - font-size: $font_size_medium; - } - } -} -.emphasis_num{ - .price_text{ - &:nth-child(2) { - font-size: $font_size_big; - } - } -} -.emphasis_num_big{ - .price_text{ - &:nth-child(1) { - font-size: $font_size_big; - } - &:nth-child(2) { - font-size: 60px; - } - &:nth-child(1) { - font-size: $font_size_big; - } - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/amountShow/index.tsx b/src/pages/salesAfter/components/amountShow/index.tsx deleted file mode 100644 index 877f7df..0000000 --- a/src/pages/salesAfter/components/amountShow/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { Text, View } from "@tarojs/components"; -import { memo, useCallback } from "react"; -import styles from './index.module.scss' -import classnames from "classnames"; - -type Param = { - number: number, //数字 - status: 0|1|2 //0 小型,1中型,2大 -} -export default memo(({number = 0, status = 1}:Param) => { - const priceDom = useCallback(() => { - let res = number.toFixed(2).split('.') - let int_num = parseInt(res[0]) + '' - let decimals_num = res[1] - return ( - <> - ¥ - {Number(int_num).toLocaleString()} - .{decimals_num} - - ) - }, [number]) - return ( - - {priceDom()} - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/applyRecord/index.module.scss b/src/pages/salesAfter/components/applyRecord/index.module.scss deleted file mode 100644 index 7cf80e1..0000000 --- a/src/pages/salesAfter/components/applyRecord/index.module.scss +++ /dev/null @@ -1,153 +0,0 @@ - -.apply_record_main{ - margin-top: 20px; - padding: 0 30px; - height: 70vh; - .apply_record_scroll{ - height: 100%; - } - .kind_number{ - width: 100%; - padding: 20px; - box-sizing: border-box; - text{ - background-color: #F6F6F6; - border-radius: 10px; - font-size: $font_size_medium; - padding: 5px 0; - text-align: center; - width: 100%; - display: block; - color: $color_font_three; - } - } - .orders_list_con{ - - background-color: #fff; - border-radius: 20px; - padding: 20px; - .orders_return_title{ - font-size: 28px; - font-weight: 700; - padding-bottom: 20px; - } - .order_list{ - &:nth-child(n+2) { - margin-top: 45px; - } - .order_list_title{ - display: flex; - align-items: center; - .tag{ - font-size: $font_size_min; - background-color: #CDE5FF; - padding: 5px 10px; - border-radius: 6px; - color: $color_main; - } - .title{ - font-weight: 700; - font-size: $font_size; - margin-left: 20px; - flex:1; - @include common_ellipsis(1); - } - .num{ - color: $color_font_two; - font-size: $font_size_min; - } - } - } - .order_list_scroll{ - margin-top: 30px; - - .order_list_item { - display: flex; - &:nth-child(n+2) { - margin-top: 30px; - } - .order_list_item_img{ - width: 126px; - height: 126px; - border-radius: 20px; - } - .order_list_item_con{ - display: flex; - width: 100%; - flex:1; - border-bottom: 1px solid #f0f0f0; - height: 150px; - padding-top: 20px; - box-sizing: border-box; - } - .order_list_item_des{ - flex:1; - box-sizing: border-box; - padding-left: 30px; - .order_list_item_title{ - font-weight: 700; - font-size: $font_size; - margin-bottom: 15px; - } - .order_list_item_price{ - font-size: 26px; - color: $color_font_three; - text{ - &:nth-child(1) { - margin-right: 10px; - } - } - } - } - .order_list_item_count{ - display: flex; - flex-direction: column; - align-items: flex-end; - .count_num{ - color: $color_main; - font-size: $font_size; - margin-bottom: 15px; - font-weight: 400; - text{ - font-size: $font_size_min; - } - } - .count_price { - font-size: $font_size; - font-weight: 700; - text{ - font-size: $font_size_min; - } - } - } - } - } - .order_total{ - padding-top: 30px; - display: flex; - justify-content: space-between; - text{ - &:nth-child(1) { - font-size: 28px; - font-weight: 700; - } - &:nth-child(2) { - font-size: 32px; - font-weight: 700; - color: #007AFF; - } - } - } - .order_estimated_amount{ - display: flex; - align-items: flex-end; - flex-direction: column; - padding: 30px 0; - .order_price_des{ - font-size: $font_size_medium; - color: $color_font_two; - } - } - } -} - diff --git a/src/pages/salesAfter/components/applyRecord/index.tsx b/src/pages/salesAfter/components/applyRecord/index.tsx deleted file mode 100644 index d704020..0000000 --- a/src/pages/salesAfter/components/applyRecord/index.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import { SaleOrderOrderDetailApi } from '@/api/salesAfterOrder' -import { formatHashTag, formatPriceDiv, formatWeightDiv } from '@/common/fotmat' -import LabAndImg from '@/components/LabAndImg' -import Popup from '@/components/popup' -import { ScrollView, Text, View } from '@tarojs/components' -import { memo, useCallback, useEffect, useMemo, useState } from 'react' -import Taro from '@tarojs/taro' -import styles from './index.module.scss' - -type Param = { - show?: true | false - onClose?: () => void - onSubmit?: () => void - id?: number -} -export default memo(({ show, onClose, onSubmit, id }: Param) => { - useEffect(() => { - if (show && id) getSaleOrderPreView() - if (!show) setFormatDetailOrder(() => null) - }, [show, id]) - - //获取订单详情 - const [orderDetail, setOrderDetail] = useState(null) //获取到的原始数据 - const { fetchData: saleOrderOrderDetailData } = SaleOrderOrderDetailApi() - const getSaleOrderPreView = async () => { - if (id) { - let res = await saleOrderOrderDetailData({ id: id }) - setOrderDetail(res.data) - } - Taro.stopPullDownRefresh() - } - //格式化数据格式 - const [formatDetailOrder, setFormatDetailOrder] = useState() //格式化后的数据 - const formatData = () => { - setFormatDetailOrder({ - estimate_amount: orderDetail.estimate_amount, //预估金额 - sale_mode: orderDetail.sale_mode, - sale_mode_name: orderDetail.sale_mode_name, - total_colors: orderDetail.total_colors, //总颜色数量 - total_number: orderDetail.total_number, //总数量 - total_fabrics: orderDetail.total_fabrics, //面料数量 - unit: orderDetail.sale_mode == 0 ? '条' : 'm', //单位 - list: orderDetail.product_list, - stage: orderDetail.stage, //订单状态 - type: orderDetail.type, //退货or退款 - total_sale_price: orderDetail.total_sale_price, //销售金额 - total_should_collect_money: orderDetail.total_should_collect_money, //应收金额 - total_weight_error_discount: orderDetail.total_weight_error_discount, //空差优惠 - actual_amount: orderDetail.actual_amount, //实付金额 - the_previous_status: orderDetail.the_previous_status, //取消订单时的订单状态 - }) - } - - //监听获取到的数据 - useEffect(() => { - if (orderDetail) formatData() - }, [orderDetail]) - - //对应数量 - const formatCount = useCallback( - (item) => { - return formatDetailOrder?.sale_mode == 0 ? item.roll : Number(item.length / 100) - }, - [formatDetailOrder], - ) - - //对应单价 - const standardPrice = useCallback( - (price) => { - return formatPriceDiv(price).toLocaleString() + '/' + (formatDetailOrder?.sale_mode == 1 ? 'm' : 'kg') - }, - [formatDetailOrder], - ) - - //数量格式 - const numText = useMemo(() => { - if (formatDetailOrder) { - let tatal_number = formatDetailOrder?.sale_mode == 0 ? formatDetailOrder?.total_number : formatDetailOrder?.total_number / 100 - return `${formatDetailOrder?.total_fabrics} 种面料,${formatDetailOrder?.total_colors} 种颜色,共 ${tatal_number} ${formatDetailOrder?.unit}` - } - }, [formatDetailOrder]) - - //整理颜色 - const labAndRgbAndUrl = useCallback((item) => { - return { lab: { ...item?.lab }, rgb: { ...item?.rgb }, texturl_url: item?.texturl_url } - }, []) - - return ( - <> - - - {formatDetailOrder && ( - <> - - {numText} - - - - {formatDetailOrder?.list?.map((item) => { - return ( - - - {formatDetailOrder.sale_mode_name} - {formatHashTag(item.code, item.name)} - 共{item?.product_colors.length}种 - - - {item?.product_colors?.map((colorItem) => { - return ( - - - - - - - {colorItem.code + ' ' + colorItem.name} - - ¥{standardPrice(colorItem.sale_price)} - 总重{formatWeightDiv(colorItem.estimate_weight)}kg - - - - - ×{formatCount(colorItem)} - {formatDetailOrder.unit} - - - ¥ - {formatPriceDiv(colorItem.estimate_amount, 100, true)} - - - - - ) - })} - - - ) - })} - - - - )} - - - - ) -}) diff --git a/src/pages/salesAfter/components/contentBox/index.module.scss b/src/pages/salesAfter/components/contentBox/index.module.scss deleted file mode 100644 index a5a2fc0..0000000 --- a/src/pages/salesAfter/components/contentBox/index.module.scss +++ /dev/null @@ -1,14 +0,0 @@ -.content_box { - background-color: #fff; - margin-top: 20px; - border-radius: 20px; - padding: 20px; - .content_box_title{ - font-size: $font_size; - font-weight: 700; - margin-bottom: 20px; - } - .content_box_con { - - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/contentBox/index.tsx b/src/pages/salesAfter/components/contentBox/index.tsx deleted file mode 100644 index 8a81420..0000000 --- a/src/pages/salesAfter/components/contentBox/index.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import {View } from "@tarojs/components"; -import { memo, ReactDOM, ReactNode } from "react"; -import styles from './index.module.scss' - -type Param = { - children?: ReactNode, - title?: string -} -export default memo(({children, title=''}: Param) => { - return ( - <> - - {title} - - {children} - - - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/estimatedAmount/index.module.scss b/src/pages/salesAfter/components/estimatedAmount/index.module.scss deleted file mode 100644 index 4b4a958..0000000 --- a/src/pages/salesAfter/components/estimatedAmount/index.module.scss +++ /dev/null @@ -1,70 +0,0 @@ -.order_price{ - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - &:nth-last-child(n+2) { - margin-bottom: 30px; - } - .order_price_text{ - font-size: $font_size_medium; - // margin-right: 10px; - display: flex; - .iconfont_msg{ - position: relative; - } - .miconfont{ - font-size: 26px; - font-weight: normal; - margin-left: 5px; - } - .message{ - position: absolute; - top: -50px; - background: #A8B3BD; - z-index: 9; - min-height: 50px; - border-radius: 10px; - padding: 10px; - box-sizing: border-box; - &::before{ - z-index: 1; - position: absolute; - bottom: -7px; - left: 10px; - width: 15px; - height: 15px; - content: " "; - transform: rotate(45deg); - background: #A8B3BD; - box-sizing: border-box; - } - } - } - .emphasis{ - font-weight: 700; - } - .order_price_num{ - color: $color_main; - font-weight: 700; - text{ - &:nth-child(1) { - font-size: $font_size_min; - } - &:nth-child(2) { - font-size: 26px; - } - &:nth-child(3) { - font-size: $font_size_medium; - } - } - } - .emphasis_num{ - text{ - &:nth-child(2) { - font-size: $font_size_big; - } - } - } - -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/estimatedAmount/index.tsx b/src/pages/salesAfter/components/estimatedAmount/index.tsx deleted file mode 100644 index 04bc49a..0000000 --- a/src/pages/salesAfter/components/estimatedAmount/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Text, View } from "@tarojs/components" -import { memo, useCallback, useEffect, useMemo } from "react" -import {formatKbPrice} from '@/common/common' -import classnames from "classnames"; -import styles from './index.module.scss' -import AmountShow from "../amountShow"; -type Param = { - style?: Object, - number?: number, - title?: string, - titleStatus?: true|false, //true 标题加大加深 - numberStatus?: 0|1|2, //数字尺寸 -} -export default memo(({style, number = 0, titleStatus = true, title = '', numberStatus = 1}:Param) => { - return ( - <> - - - {title} - - - {/* 123123123121212312312312312 */} - - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/kindList/index.module.scss b/src/pages/salesAfter/components/kindList/index.module.scss deleted file mode 100644 index 0b99988..0000000 --- a/src/pages/salesAfter/components/kindList/index.module.scss +++ /dev/null @@ -1,150 +0,0 @@ - -.kindsList_main{ - margin-top: 20px; -} -.orders_list_con{ - - background-color: #fff; - border-radius: 20px; - padding: 20px; - .orders_return_title{ - font-size: 28px; - font-weight: 700; - padding-bottom: 20px; - } - .order_list{ - &:nth-child(n+2) { - margin-top: 30px; - } - .order_list_title{ - display: flex; - align-items: center; - .tag{ - font-size: $font_size_min; - background-color: #CDE5FF; - padding: 5px 10px; - border-radius: 6px; - color: $color_main; - } - .title{ - font-weight: 700; - font-size: $font_size; - margin-left: 20px; - flex:1; - } - .num{ - color: $color_font_two; - font-size: $font_size_min; - } - } - } - .order_list_scroll{ - margin-top: 30px; - .order_list_item { - display: flex; - &:nth-child(n + 2) { - margin-top: 30px; - } - .order_list_item_img{ - width: 126px; - height: 126px; - border-radius: 20px; - } - .order_list_item_con{ - display: flex; - width: 100%; - flex:1; - border-bottom: 1px solid #f0f0f0; - height: 150px; - padding-top: 20px; - box-sizing: border-box; - } - .order_list_item_des{ - flex:1; - box-sizing: border-box; - padding-left: 30px; - .order_list_item_title{ - font-weight: 700; - font-size: $font_size; - margin-bottom: 15px; - } - .order_list_item_price{ - font-size: 26px; - color: $color_font_three; - text{ - &:nth-child(n+1) { - margin-right: 20px; - } - } - } - } - .order_list_item_count{ - display: flex; - flex-direction: column; - align-items: flex-end; - .count_num{ - color: $color_main; - font-size: $font_size; - margin-bottom: 15px; - font-weight: 400; - text{ - font-size: $font_size_min; - } - } - .count_price { - font-size: $font_size; - font-weight: 700; - text{ - font-size: $font_size_min; - } - } - } - } - } - .order_total{ - padding-top: 20px; - display: flex; - justify-content: space-between; - text{ - &:nth-child(1) { - font-size: 28px; - font-weight: 700; - } - &:nth-child(2) { - font-size: 24px; - font-weight: 700; - } - } - } - .order_estimated_amount{ - display: flex; - align-items: flex-end; - flex-direction: column; - padding: 30px 0; - .order_price_des{ - font-size: $font_size_medium; - color: $color_font_two; - } - } -} -.inspection{ - background: linear-gradient(38deg,#007aff, #4fa6ff 100%, #68b4ff 100%); - border-radius: 20px; - color: #fff; - height: 176px; - padding: 30px ; - box-sizing: border-box; - font-size: 28px; - .inspection_title{ - font-weight: 700; - } - .inspection_con{ - margin-top: 20px; - display: flex; - align-items: center; - .miconfont{ - font-size: 50px; - margin-right: 10px; - } - } -} diff --git a/src/pages/salesAfter/components/kindList/index.tsx b/src/pages/salesAfter/components/kindList/index.tsx deleted file mode 100644 index 9f9d2de..0000000 --- a/src/pages/salesAfter/components/kindList/index.tsx +++ /dev/null @@ -1,202 +0,0 @@ -import { AFTER_ORDER_STATUS, ORDER_STATUS, REFUND_STATUS } from "@/common/enum" -import { formatHashTag, formatPriceDiv, formatWeightDiv } from "@/common/fotmat" -import EstimatedAmount from "@/components/estimatedAmount" -import LabAndImg from "@/components/LabAndImg" -import { Text, View } from "@tarojs/components" -import { memo, useCallback, useMemo } from "react" -import classnames from "classnames"; -import styles from './index.module.scss' - -type OrderParam = { - estimate_amount: number, //预估金额 - list: any[], - product_list: any[], - quality_check_pass_product: any[], - sale_mode: number, - sale_mode_name: string, - unit: string, - total_colors: number, - total_fabrics: number, - total_number: number, - stage: number, //订单状态 - type: 1|2, //1退货, 2退款 - refund_type: number, //退款状态 - total_sale_price: number, //销售金额 - total_should_collect_money: number, //应收金额 - total_weight_error_discount: number, //空差优惠 - the_previous_status: number, //取消订单时的订单状态 - actual_amount: number //实付金额 - quality_check_pass_colors: number, //验布后的颜色总数 - quality_check_pass_fabrics: number, //验布后的面料数量 - quality_check_pass_number: number, //验布后的总数量 - is_quality_check: true|false, //是否质检过 -} - -type Param = { - order: OrderParam, - comfirm?: boolean //是否是确认订单页面使用 -} - -export default memo(({order, comfirm = false}:Param) => { - - //售后单状态枚举 - const { - ReturnStageApplying, // 申请中 - ReturnStageWaitCheck, // 退货中 - ReturnStageChecked, // 待验布 - ReturnStageReturned, // 已退款 - ReturnStageCancel, // 已取消 - ReturnStageQualityCheckPendingRefund, // 已验布 - ReturnStageServiceOrderPendingRefund, // 待退款 - ReturnStageRejected, // 已拒绝 - } = AFTER_ORDER_STATUS - - //金额列表枚举 - const priceList = [ - { - id:5, - value: [ReturnStageReturned.value], - label:'合计金额', - field: 'total_refund_amount', - message: '按原单价*退货重量的金额', - - }, - { - id:1, - value: [ReturnStageReturned.value], - label:'扣款金额', - field: 'other_deduction_amount', - message: '本次售后扣款金额' - }, - { - id:3, - value: [ReturnStageReturned.value], - label:'退款金额', - field: 'refund_amount', - message: '本次售后应退款金额' - }, - { - id:4, - value: [ReturnStageReturned.value], - label:'退款去向', - field: 'refund_flow_name', - message: '本次售后退款金额去向' - }, - ] - - //是否显示价格 - const showPrice = useCallback((priceInfo) => { - return priceInfo.value.includes(order?.stage) - }, [order]) - - const priceConDom = useMemo(() => { - if(!order) return - return ( - <> - { - priceList.map(item => { - return <>{showPrice(item)&&} - }) - } - - ) - }, [order]) - - //对应数量 - const formatCount = useCallback((item) => { - return order?.sale_mode == 0? item.roll : Number(item.length / 100) - }, [order]) - - //对应单价 - const standardPrice = useCallback(price => { - return formatPriceDiv(price).toLocaleString() + '/' + (order?.sale_mode == 1?'m':'kg') - }, [order]) - - //数量格式 - const numText = useMemo(() => { - if(order) { - if(!order?.is_quality_check) { - let total_number = order?.sale_mode == 0?order?.total_number:(order?.total_number/100) - return `${order?.total_fabrics} 种面料,${order?.total_colors} 种颜色,共 ${total_number} ${order?.unit}` - } else { - let total_number = order?.sale_mode == 0?order?.quality_check_pass_number:(order?.quality_check_pass_number/100) - return `${order?.quality_check_pass_fabrics} 种面料,${order?.quality_check_pass_colors} 种颜色,共 ${total_number} ${order?.unit}` - } - } - }, [order]) - - //获取面料数组 - const list = useMemo(() => { - return order?.is_quality_check?order?.quality_check_pass_product:order?.product_list - }, [order]) - - //整理颜色 - const labAndRgbAndUrl = useCallback((item) => { - return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url} - }, []) - - //单价显示判断 - const sale_price_show = useMemo(() => { - return order?.stage != ReturnStageServiceOrderPendingRefund.value && order?.stage != ReturnStageQualityCheckPendingRefund.value - }, [order]) - - //销售价格 - const formatPrice = useCallback((colorItem) => { - return (ReturnStageReturned.value == order?.stage) && ¥{formatPriceDiv(colorItem.estimate_amount, 100 , true)} - }, [order]) - - return ( - - {list?.length > 0 && - {order?.type == 1?'退货信息':'退款信息'} - { - list?.map(item => { - return - - {order.sale_mode_name} - {formatHashTag(item.code, item.name)} - 共{item?.product_colors?.length}种 - - - {item?.product_colors?.map(colorItem => { - return - - - - - - {colorItem.code + ' ' + colorItem.name} - - {sale_price_show&&¥{standardPrice(colorItem.sale_price)}} - {(order?.stage == ReturnStageReturned.value)&&总重{formatWeightDiv(colorItem.estimate_weight)}kg} - - - - ×{formatCount(colorItem)}{order.unit} - {formatPrice(colorItem)} - - - - })} - - - }) - } - 合计{numText} - - {priceConDom} - - - } - { - (list?.length <=0 && order?.is_quality_check) && - 质检情况 - - - 没有质检通过的商品,无法退款 - - - } - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/offlinePay/index.module.scss b/src/pages/salesAfter/components/offlinePay/index.module.scss deleted file mode 100644 index f84e995..0000000 --- a/src/pages/salesAfter/components/offlinePay/index.module.scss +++ /dev/null @@ -1,46 +0,0 @@ -$top:170px; -.offlinePay_main{ - .offlinePay_con{ - padding: 20px; - background-color: #F6F6F6; - border-radius: 20px; - .miconfont_title{ - transform: rotate(-180deg); - position: absolute; - left: 20px; - top: 27px; - font-size: 37px; - color: $color_font_three; - z-index: 99; - } - } - .title{ - font-size: $font_size_big; - color: #000000; - text-align: center; - font-weight: 700; - position: relative; - - } - - .offlinePay_list{ - border-radius: 10px; - padding: 60px 0; - .offlinePay_con_text{ - font-size: $font_size; - font-weight: 700; - } - } - .btns{ - background: #007aff; - border-radius: 40px; - width: 668px; - height: 82px; - text-align: center; - line-height: 80px; - width: 100%; - color: #fff; - font-size: 32px; - margin-top: 30px; - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/offlinePay/index.tsx b/src/pages/salesAfter/components/offlinePay/index.tsx deleted file mode 100644 index 4022374..0000000 --- a/src/pages/salesAfter/components/offlinePay/index.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Text, View } from "@tarojs/components"; -import { memo } from "react"; -import AmountShow from "../amountShow"; -import classnames from "classnames"; -import styles from './index.module.scss' - -import MCheckbox from "@/components/checkbox"; -import Popup from "@/components/popup"; -import SearchInput from "@/components/searchInput"; -import Taro from "@tarojs/taro"; - -type Param = { - show?: true|false, - onClose?: () => void -} -export default memo(({show = true, onClose}:Param) => { - //复制功能 - const clipboardData = () => { - Taro.setClipboardData({ - data: '开户名称:佛山市浩川盛世科技有限公司; 开户银行:招商银行汾江支行; 转账汇款账号:62062342120001221231212', - success: function (res) { - Taro.showToast({ - icon: 'none', - title: '复制成功' - }) - } - }) - } - return ( - - - - - 线下汇款 - - - 佛山市浩川盛世科技有限公司 - - - 招商银行汾江支行 - - - 62062342120001221231212 - - - 复制信息 - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/orderState/index.module.scss b/src/pages/salesAfter/components/orderState/index.module.scss deleted file mode 100644 index 0cc33d6..0000000 --- a/src/pages/salesAfter/components/orderState/index.module.scss +++ /dev/null @@ -1,139 +0,0 @@ -.order_flow_state{ - background-color: #fff; - border-radius: 20px; - padding: 20px; - box-sizing:border-box; - position: relative; - overflow: hidden; - .order_status_list{ - max-height: 250px; - overflow: hidden; - transition: all 0.3s ease-in-out; - } - .order_status_list_show { - max-height: 1000px !important; - } - .order_status_item{ - position: relative; - &:nth-last-child(n+2) { - padding-bottom: 30px; - } - .order_status_tail_end, .order_status_tail{ - width: 15px; - height: 15px; - border: 2px solid $color_main; - background-color: #fff; - border-radius: 50%; - position:absolute; - left: 0; - top: 10px; - z-index: 10; - } - .order_status_tail_end{ - background-color: $color_main; - } - .order_status_line{ - border-left: 2px solid $color_main; - height: 100%; - top: 10px; - left: 9px; - position: absolute; - z-index: 1; - } - .order_status_content{ - display: flex; - align-items: center; - padding: 0 30px; - .order_status_title{ - color: $color_font_two; - font-size: $font_size; - font-weight: 700; - } - .order_status_time{ - color: $color_font_two; - font-size: $font_size_medium; - padding: 0 20px; - } - .order_status_tag{ - font-size: $font_size_min; - background: #F0F0F0; - border-radius: 6px; - padding: 5px 10px; - color: $color_font_two; - } - .order_status_select{ - color: $color_main; - } - .order_status_tag_select{ - color: $color_main; - } - } - .order_status_des{ - color: $color_font_two; - font-size: $font_size_medium; - } - .order_status_des_select{ - color: $color_font_one; - } - .pay_time{ - height: 56px; - background: #f6f6f6; - border-radius: 20px; - color: #3C3C3C; - font-size: 24px; - display: flex; - align-items: center; - justify-content: center; - font-weight: 700; - margin-top: 20px; - text{ - font-size: 28px; - color: $color_main; - padding: 0 10px; - - } - } - } - .more{ - width: 100%; - text-align: center; - font-size: $font_size_min; - color: $color_font_one; - padding-top: 20px; - .miconfonts{ - display: inline-block; - font-size: 25px; - transform:rotate(90deg); - } - .open_miconfonts{ - transform:rotate(-90deg); - } - } - .image_tag{ - width: 140px; - height: 144px; - .image{ - width: 140px; - height: 144px; - } - position: absolute; - top: -10px; - right: -10px; - } - .refresh{ - position: absolute; - top: 23px; - right: 20px; - display: flex; - color: #707070; - display: flex; - align-items: center; - - .mconfont{ - font-size: 30px; - } - .refresh_text{ - font-size: 23px; - } - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/orderState/index.tsx b/src/pages/salesAfter/components/orderState/index.tsx deleted file mode 100644 index f5b5d84..0000000 --- a/src/pages/salesAfter/components/orderState/index.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { Text, View } from "@tarojs/components" -import { memo, useMemo, useState } from "react" -import styles from './index.module.scss' -import classnames from "classnames"; -import { formatDateTime } from "@/common/fotmat"; -import { ORDER_STATUS } from "@/common/enum"; - -type List = { - status: string, - time: string, - tag: string, - desc: string, - expire_time: string -} - -type Param = { - onRefresh?: () => void, - orderInfo?: { - logistics_details:List[], //订单状态列表 - payment_method: number, //支付方式 - status: number, //订单状态 - } -} - -export default memo(({orderInfo = {logistics_details: [],payment_method: 0, status: 0}, onRefresh}:Param) => { - - const [showMore, setShowMore] = useState(false) - const changeMore = () => { - setShowMore(() => !showMore) - } - const dataList = useMemo(() => { - return orderInfo.logistics_details?orderInfo?.logistics_details.reverse():[] - }, [orderInfo.logistics_details]) - - //订单状态枚举 - const {SaleorderstatusWaitingPrePayment} = ORDER_STATUS - - - return ( - <> - {(dataList?.length > 0)&& - - {dataList.map((item, index) => - {(dataList.length > 1)&&} - {(dataList.length != (index + 1))&&} - - {item.status} - {formatDateTime(item.time)} - - {item.desc} - )} - - {(dataList.length > 2) && changeMore()}> - {showMore&&'收起详情'||'点击查看详情'} - - } - } - - ) -}) diff --git a/src/pages/salesAfter/components/payment/index.module.scss b/src/pages/salesAfter/components/payment/index.module.scss deleted file mode 100644 index 340b0ed..0000000 --- a/src/pages/salesAfter/components/payment/index.module.scss +++ /dev/null @@ -1,126 +0,0 @@ -$top:190px; -.payment_main{ - .payment_con{ - padding: 20px; - background-color: #F6F6F6; - border-radius: 20px; - .miconfont_title{ - transform: rotate(-180deg); - position: absolute; - left: 20px; - top: 27px; - font-size: 37px; - color: $color_font_three; - z-index: 99; - } - - } - .title{ - font-size: $font_size_big; - color: #000000; - text-align: center; - font-weight: 700; - position: relative; - - } - .amount{ - text-align: center; - padding: 25px 0; - } - - .payment_list{ - background-color: #fff; - // box-shadow: 2px 2px 6px 0px rgba(0,0,0,0.16); - min-height: 300px; - border-radius: 10px; - padding-bottom: 100px; - position: relative; - background: radial-gradient(circle 20px at left $top, transparent 20px, #fff 20px + 3px) left 0px/60% no-repeat , - radial-gradient(circle 20px at right $top, transparent 20px, #fff 20px + 3px) right 0px/60% no-repeat; - filter: drop-shadow(2px 2px 6px rgba(0, 0, 0, .16)); - position: relative; - &::before{ - content: ''; - position: absolute; - border-bottom: 3px dashed #ccc; - top: $top; - width: calc(100% - 100px); - left:0; - right: 0; - margin: auto; - - } - .payment_list_top_border{ - height: 32px; - width: 100%; - background: linear-gradient(215deg,#cde5ff 2%, #cde5ff 2%, #68b4ff 72%); - border-radius: 10px 10px 0px 0px; - } - .payment_list_title{ - text-align: center; - padding: 30px 0 50px 0; - font-size: $font_size; - color: $color_font_three; - .payment_list_title_price_item{ - display: flex; - justify-content: space-between; - padding: 0 90px; - &:nth-child(1) { - margin-bottom: 15px; - } - } - text{ - &:nth-child(2) { - color: $color_main; - } - } - } - .payment_list_con{ - padding: 20px 30px 0 30px; - .payment_list_item{ - display: flex; - justify-content: space-between; - align-items: center; - height: 123px; - &:nth-last-child(n+2) { - border-bottom: 2px solid #F3F3F3; - } - } - .payment_list_item_left{ - display: flex; - flex-direction: column; - font-size: $font_size; - .payment_list_item_left_name{ - display: flex; - align-items: center; - } - .miconfont{ - font-size: 30px; - color: #FFC300; - padding-right: 10px; - } - .payment_list_item_left_price{ - font-size: $font_size_min; - color: $color_font_two; - padding-left: 35px; - padding-top: 5px; - } - } - .miconfont_more{ - font-size: 20px; - } - } - } - .btns{ - background: #007aff; - border-radius: 40px; - width: 668px; - height: 82px; - text-align: center; - line-height: 80px; - width: 100%; - color: #fff; - font-size: 32px; - margin-top: 30px; - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/payment/index.tsx b/src/pages/salesAfter/components/payment/index.tsx deleted file mode 100644 index 8af70dc..0000000 --- a/src/pages/salesAfter/components/payment/index.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import { Text, View } from "@tarojs/components"; -import { memo, useCallback, useEffect, useMemo, useState } from "react"; -import AmountShow from "../amountShow"; -import classnames from "classnames"; -import styles from './index.module.scss' - -import MCheckbox from "@/components/checkbox"; -import Popup from "@/components/popup"; -import OfflinePay from "../offlinePay"; -import ScanPay from "../scanPay"; -import { GetOrderPayApi, SubmitOrderPayApi } from "@/api/orderPay"; -import { formatPriceDiv } from "@/common/fotmat"; -import {alert} from "@/common/common" -import { PAYMENT_METHOD, PAYMENT_METHOD_PARAM } from "@/common/enum"; - -type Param = { - show?: true|false, - onClose?: () => void, - onSubmitSuccess?: () => void, //支付成功 - orderInfo?: OrderInfo -} - -type OrderInfo = { - orderId: number, //应付单id - payment_method: 0|PAYMENT_METHOD_PARAM //支付方式 -} - -type PayStatus = 1|2|3|4|5|null //1:预存款, 2:账期,3:线下汇款, 4:扫码支付, 5:货到付款 -export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param) => { - - //提交参数 - const [submitData, setSubmitData] = useState<{id:number, payment_method: PayStatus}>({ - id:0, - payment_method: null - }) - - //线下付款 - const [offlinePayShow, setofflinePayShow] = useState(false) - const onShowOfflinePay = () => { - setofflinePayShow(true) - onClose?.() - } - - //扫码支付 - const [scanPayShow, setScanPayShow] = useState(false) - const onShowScanPay = () => { - setScanPayShow(true) - onClose?.() - } - - //获取支付方式数据 - const [payInfo, setPayInfo] = useState() - const {fetchData: orderFetchData} = GetOrderPayApi() - const getOrderPay = async () => { - let {data} = await orderFetchData({id: orderInfo?.orderId}) - setPayInfo(() => data) - } - useEffect(() => { - if(show&&orderInfo?.orderId) { - setSubmitData((val) => ({...val, id:orderInfo.orderId})) - getOrderPay() - } - }, [show, orderInfo]) - - //预存款选择 - const advanceSelectData = useCallback((val) => { - setSubmitData((e) => ({...e, payment_method:val})) - }, []) - - //账期选择 - const periodSelectData = (val) => { - setSubmitData((e) => ({...e, payment_method:val})) - } - - //提交支付 - const {fetchData: submitFetchData} = SubmitOrderPayApi() - const submitPay = async () => { - if(submitData.payment_method === null) { - alert.error('请选择支付方式') - return false - } - alert.loading('正在支付') - let res = await submitFetchData(submitData) - if(res.success) { - alert.success('支付成功') - onSubmitSuccess?.() - } else { - alert.none(res.msg) - } - } - - //预付款 - const advance_payment = useMemo(() => { - const price = payInfo?.should_collect_money - payInfo?.amount_paid - return ( - {(payInfo?.advance_deposit_balance < price)&&'余额不足,' }剩余 ¥{formatPriceDiv(payInfo?.advance_deposit_balance)} - ) - }, [payInfo]) - - //账期 - const account_peyment = useMemo(() => { - const price = payInfo?.should_collect_money - payInfo?.amount_paid - return ( - {(payInfo?.account_period < price)&&'额度不足, '}剩余 ¥{formatPriceDiv(payInfo?.account_period_credit_available_line)} - ) - }, [payInfo]) - - //支付方式枚举 - const {PaymentMethodPreDeposit, PaymentMethodAccountPeriod} = PAYMENT_METHOD - - return ( - - - - - 订单支付 - - - - - - - {/* 向商家发起支付 */} - - - 订单金额 - ¥{formatPriceDiv(payInfo?.should_collect_money)} - - - 已付金额 - ¥{formatPriceDiv(payInfo?.amount_paid)} - - - - - - - - - 预存款 - - {advance_payment} - - advanceSelectData(PaymentMethodPreDeposit.value)} onClose={() => advanceSelectData(null)}/> - - {(orderInfo?.payment_method != PaymentMethodAccountPeriod.value)&& - - - - {payInfo?.account_period}天账期 - - {/* 可用额度 ¥{formatPriceDiv(payInfo?.account_period_credit_available_line)} */} - {account_peyment} - - periodSelectData(PaymentMethodAccountPeriod.value)} onClose={() => periodSelectData(null)}/> - } - - - - - 线下汇款 - - - - - - - - - 扫码支付 - - - - - - - 确认交易 - - - setofflinePayShow(false)}/> - setScanPayShow(false)}/> - - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/remark/index.module.scss b/src/pages/salesAfter/components/remark/index.module.scss deleted file mode 100644 index d624050..0000000 --- a/src/pages/salesAfter/components/remark/index.module.scss +++ /dev/null @@ -1,48 +0,0 @@ -.order_popup{ - display: flex; - flex-direction: column; - align-items: center; - padding: 20px 0; - .order_popup_title{ - color: $font_size_big; - font-weight: 700; - color: #000000; - padding-bottom: 20px; - } - .order_popup_input{ - width: 100%; - padding: 0 25px; - box-sizing: border-box; - margin-top: 43px; - position: relative; - .descDataNum{ - position: absolute; - right: 40px; - bottom: 10px; - height: 39px; - font-size: $font_size_medium; - color: $color_font_two; - } - textarea{ - background-color: #f3f3f3; - border-radius: 10px; - width: 100%; - height: 313px; - padding: 20px; - padding-bottom: 50px; - box-sizing: border-box; - font-size: $font_size; - border: 2px solid #e6e6e6; - } - } - .order_save_address{ - height: 82px; - background: #007aff; - border-radius: 40px; - width: 668px; - text-align: center; - line-height: 82px; - color: #fff; - margin-top: 60px; - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/remark/index.tsx b/src/pages/salesAfter/components/remark/index.tsx deleted file mode 100644 index 14d981b..0000000 --- a/src/pages/salesAfter/components/remark/index.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import Popup from "@/components/popup" -import { Textarea, View } from "@tarojs/components" -import { useCallback, useState } from "react" -import styles from './index.module.scss' - -type Param = { - onBlur?: (val:any) => void - onSave?: (val: string) => void -} -export default ({onBlur, onSave}:Param) => { - const [descData, setDescData] = useState({ - number: 0, - value: '', - count: 200 - }) - const getDesc = useCallback((e) => { - let value = e.detail.value - let res = value - if(value.length > descData.count) { - res = value.slice(0, descData.count) - } - setDescData({...descData, number:res.length, value: res}) - },[]) - - const setSave = () => { - onSave?.(descData.value) - } - return ( - - 编辑备注 - - - {descData.number}/{descData.count} - - setSave()}>保存 - - ) -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/returnLogistics/index.module.scss b/src/pages/salesAfter/components/returnLogistics/index.module.scss deleted file mode 100644 index 1a22287..0000000 --- a/src/pages/salesAfter/components/returnLogistics/index.module.scss +++ /dev/null @@ -1,35 +0,0 @@ - -.logistics_main{ - padding: 20px 30px; - box-sizing: border-box; - .logistics_image{ - display: flex; - .title_desc{ - font-size: 28px; - font-weight: 700; - padding-top: 50px; - box-sizing: border-box; - } - .upload_image{ - flex:1; - } - } - .logistics_desc{ - margin-top: 50px; - } - .btns_two{ - display: flex; - height: 82px; - font-size: $font_size_big; - border-radius: 40px; - margin-top: 50px; - .verify_btn{ - flex:1; - border-radius: 40px; - background: #007aff; - text-align: center; - line-height: 82px; - color: #fff; - } - } -} diff --git a/src/pages/salesAfter/components/returnLogistics/index.tsx b/src/pages/salesAfter/components/returnLogistics/index.tsx deleted file mode 100644 index c51c38e..0000000 --- a/src/pages/salesAfter/components/returnLogistics/index.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import Popup from '@/components/popup' -import { Text, View } from '@tarojs/components' -import { memo, useCallback, useEffect, useRef, useState } from 'react' -import UploadImage from '@/components/uploadImage' -import styles from './index.module.scss' -import TextareaEnhance from '@/components/textareaEnhance' -import { ReturnApplyLogisticsApi } from '@/api/salesAfterOrder' -import { alert } from '@/common/common' - -type Param = { - show?: true | false - onClose?: () => void - onSubmit?: () => void - id?: number //订单id - images: string[] //图片列表 - descValue?: string //描述 - onlyRead?: false | true //true 只读 -} -export default memo(({ show = false, onClose, onSubmit, id = 0, images = [], descValue = '', onlyRead = false }: Param) => { - //需要提交的数据 - const submitData = useRef({ - accessory_url: [], - remark: '', - id: 0, - }) - useEffect(() => { - if (id) submitData.current.id = id - }, [id]) - - //获取图片列表 - const getImageList = useCallback((list) => { - submitData.current.accessory_url = list - }, []) - - //备注 - const getOtherReason = useCallback((val) => { - submitData.current.remark = val - }, []) - - //确定 - const { fetchData } = ReturnApplyLogisticsApi() - const onSubmitEven = async () => { - if (!id) return alert.error('参数有误') - if (submitData.current.accessory_url.length <= 0) return alert.error('请上传附件') - let res = await fetchData(submitData.current) - if (res.success) { - alert.success('上传成功') - } else { - alert.error('上传失败') - } - onSubmit?.() - } - - return ( - <> - - - - 上传附件: - - - - - - - - {!onlyRead && ( - - onSubmitEven()}> - 保存 - - - )} - - - - ) -}) diff --git a/src/pages/salesAfter/components/scanPay/index.module.scss b/src/pages/salesAfter/components/scanPay/index.module.scss deleted file mode 100644 index dcb356d..0000000 --- a/src/pages/salesAfter/components/scanPay/index.module.scss +++ /dev/null @@ -1,54 +0,0 @@ -$top:170px; -.scanPay_main{ - .scanPay_con{ - padding: 20px; - background-color: #F6F6F6; - border-radius: 20px; - .miconfont_title{ - transform: rotate(-180deg); - position: absolute; - left: 20px; - top: 27px; - font-size: 37px; - color: $color_font_three; - z-index: 99; - - } - } - .title{ - font-size: $font_size_big; - color: #000000; - text-align: center; - font-weight: 700; - position: relative; - } - .desc{ - font-size: $font_size_min; - color: $color_main; - text-align: center; - padding: 10px 0; - .miconfont{ - font-size: 25px; - } - } - - .scanPay_list{ - border-radius: 10px; - height: 900px; - image{ - width: 100%; - } - } - .btns{ - background: #007aff; - border-radius: 40px; - width: 668px; - height: 82px; - text-align: center; - line-height: 80px; - width: 100%; - color: #fff; - font-size: 32px; - margin-top: 30px; - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/scanPay/index.tsx b/src/pages/salesAfter/components/scanPay/index.tsx deleted file mode 100644 index d6fb06e..0000000 --- a/src/pages/salesAfter/components/scanPay/index.tsx +++ /dev/null @@ -1,161 +0,0 @@ -import { Image, ScrollView, Text, View } from "@tarojs/components"; -import { memo, useEffect, useRef, useState } from "react"; -import classnames from "classnames"; -import styles from './index.module.scss' -import Popup from "@/components/popup"; -import Taro from "@tarojs/taro"; -import { alert } from "@/common/common"; -import { formatImgUrl } from "@/common/fotmat"; -import useCheckAuthorize from "@/use/useCheckAuthorize"; -import { GetPayCode } from "@/api/onlinePay"; -import LoadingCard from "@/components/loadingCard"; - - -type Param = { - show?: true|false, - onClose?: () => void -} - - -type Item = { - product_code: string, - product_name: string, - product_color_code: string, - product_color_name: string, - num: string, - weight: string, - sale_price: string, - total_price: string -} -type CodeParam = { - title: string, - company: string, - order_type: string, - sale_user: string, - order_created_time: string, - order_no: string, - department: string, - shipment_mode: string, - target_user_name: string, - target_address: string, - target_description: string, - pay_account: string, - bank_account_name: string, - bank_name: string, - pay_type: string, - client: string, - phone: string, - order_total_length: string, - order_total_price: string, - qrcode: string, - order_total_weight: string, - list: Item[] -} -export default memo(({show = true, onClose}:Param) => { - - //获取支付二维码 - const [payCodeImage, setPayCodeImage] = useState('') - const fileData = useRef({ - filePath: '', - base64: '' - }) - const {fetchData, state} = GetPayCode() - const getCore = async () => { - let res = await fetchData({ - title: "面料销售电子确认单", - company: "什么什么公司123", - order_type: "散剪", - sale_user: "小崔", - order_created_time:"2022/02/01 12:32:13", - order_no:"XS-211005888", - department:"嘻嘻嘻", - shipment_mode:"自提", - target_user_name:"大崔", - target_address:"阿斯顿发斯蒂芬", - target_description:"无", - pay_account:"1234567890123450001", - bank_account_name:"佛山市浩川长盛科技有限公司", - bank_name:"招商银行佛山分行禅城支行", - pay_type:"现结", - client:"客户名称", - phone:"15818085802", - order_total_length:"12", - order_total_price:"63000", - qrcode:"https://www.zzfzyc.com/checkorder/XS-211005888", - order_total_weight:"300.00", - list: [{product_code:'5215',product_name:'26S双纱亲水滑爽棉',product_color_code:'053',product_color_name:'洋红',num:'4',weight:'123.23',sale_price:'43',total_price:'4510.7'}] - }) - const base64 = res.data.base64 - setPayCodeImage(() => base64) - const time = new Date().valueOf() - const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64) || []; - let filePath = Taro.env.USER_DATA_PATH + '/img' + time +'.'+ format - fileData.current.filePath = filePath - fileData.current.base64 = bodyData - const save = Taro.getFileSystemManager() - save.writeFile({ - filePath: fileData.current.filePath, - data: fileData.current.base64, - encoding: 'base64', - }) - - } - useEffect(() => { - if(show) - getCore() - }, [show]) - - //检查是否开启保存图片权限 - const {check} = useCheckAuthorize({scope:'scope.writePhotosAlbum', msg:'您没授权,无法保存图片'}) - const saveImageCheck = async () => { - const res = await check() - res&&saveImage() - } - - //保存图片 - const saveImage = () => { - alert.loading('正在保存图片') - Taro.saveImageToPhotosAlbum({ - filePath: fileData.current.filePath, - success: function (res) { - alert.success('图片保存成功') - }, - fail: function (err) { - console.log('err::', err) - } - }) - } - - //预览图片 - const showImage = () => { - console.log('fileData.current.filePath::', fileData.current.filePath) - Taro.previewImage({ - current: fileData.current.filePath, // 当前显示 - urls: [fileData.current.filePath] // 需要预览的图片http链接列表 - }) - } - - //复制功能 - return ( - - - - - 扫码支付 - - - 扫码支付成功后,自动更新状态 - - - {(state.loading)&&|| - - - } - - 保存电子确认单 - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/shipmentMode/index.module.scss b/src/pages/salesAfter/components/shipmentMode/index.module.scss deleted file mode 100644 index 5f818f9..0000000 --- a/src/pages/salesAfter/components/shipmentMode/index.module.scss +++ /dev/null @@ -1,33 +0,0 @@ - - .order_title{ - display: flex; - align-items: center; - padding: 20px 30px; - box-sizing: border-box; - background-color: #fff; - height: 116px; - border-radius: 20px; - margin-top: 20px; - text{ - flex:1; - font-size: $font_size; - font-weight: 700; - } - .order_status{ - background-color: #F0F0F0; - width: 148px; - height: 55px; - color: $color_font_three; - text-align: center; - line-height: 55px; - font-size: $font_size_medium; - border-radius: 30px; - &:nth-last-child(1) { - margin-left: 20px; - } - } - .order_status_selected{ - color: $color_main; - border: 1px solid $color_main; - } - } \ No newline at end of file diff --git a/src/pages/salesAfter/components/shipmentMode/index.tsx b/src/pages/salesAfter/components/shipmentMode/index.tsx deleted file mode 100644 index 235591c..0000000 --- a/src/pages/salesAfter/components/shipmentMode/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { Text, View } from "@tarojs/components" -import styles from './index.module.scss' -import classnames from "classnames"; -import { memo, useRef, useState } from "react"; - -type Param = { - onSelect?:(val:number) => void -} -export default memo(({onSelect}: Param) => { - //收货方法 1:自提,2:物流 - const shipmentMode = useRef([ - {value:1, label:'上门自提', selected:false}, - {value:2, label:'物流', selected:false} - ]) - const [selectValue, setSelectValue] = useState() - const selectShipmentMode = (value) => { - setSelectValue(() => value) - onSelect?.(value) - } - return ( - - 收货方式 - {shipmentMode.current.map(item => { - return selectShipmentMode(item.value)}>{item.label} - })} - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/submitOrderBtn/index.module.scss b/src/pages/salesAfter/components/submitOrderBtn/index.module.scss deleted file mode 100644 index c5ac9ed..0000000 --- a/src/pages/salesAfter/components/submitOrderBtn/index.module.scss +++ /dev/null @@ -1,69 +0,0 @@ -.order_price{ - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - &:nth-last-child(n+2) { - margin-bottom: 30px; - } - .order_price_text{ - font-size: $font_size_medium; - // margin-right: 10px; - display: flex; - .iconfont_msg{ - position: relative; - } - .miconfont{ - font-size: 30px; - font-weight: normal; - } - .message{ - position: absolute; - top: -50px; - background: #A8B3BD; - z-index: 9; - min-height: 50px; - border-radius: 10px; - padding: 10px; - box-sizing: border-box; - &::before{ - z-index: 1; - position: absolute; - bottom: -7px; - left: 10px; - width: 15px; - height: 15px; - content: " "; - transform: rotate(45deg); - background: #A8B3BD; - box-sizing: border-box; - } - } - } - .emphasis{ - font-weight: 700; - } - .order_price_num{ - color: $color_main; - font-weight: 700; - text{ - &:nth-child(1) { - font-size: $font_size_min; - } - &:nth-child(2) { - font-size: 26px; - } - &:nth-child(3) { - font-size: $font_size_medium; - } - } - } - .emphasis_num{ - text{ - &:nth-child(2) { - font-size: $font_size_big; - } - } - } - -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/submitOrderBtn/index.tsx b/src/pages/salesAfter/components/submitOrderBtn/index.tsx deleted file mode 100644 index db9b432..0000000 --- a/src/pages/salesAfter/components/submitOrderBtn/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { Text, View } from "@tarojs/components" -import { memo, useCallback, useEffect, useMemo } from "react" -import {formatKbPrice} from '@/common/common' -import classnames from "classnames"; -import styles from './index.module.scss' -type Param = { - style?: Object, - number?: number -} -export default memo(({style, number = 0}:Param) => { - const priceDom = useCallback(() => { - let res = number.toFixed(2).split('.') - let int_num = parseInt(res[0]) + '' - let decimals_num = res[1] - return ( - <> - ¥ - {Number(int_num).toLocaleString()} - .{decimals_num} - - ) - }, [number]) - return ( - <> - - - 应付金额 - - - {/* 123123123121212312312312312 */} - - - - {priceDom()} - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/components/weightMemo/index.module.scss b/src/pages/salesAfter/components/weightMemo/index.module.scss deleted file mode 100644 index 3c74511..0000000 --- a/src/pages/salesAfter/components/weightMemo/index.module.scss +++ /dev/null @@ -1,39 +0,0 @@ - -.weight_memo{ - background-color: #fff; - border-radius: 20px; - padding: 0 20px; - .weight_memo_item{ - display: flex; - justify-content: space-between; - height: 130px; - &:nth-child(1) { - border-bottom: 1px solid #f3f3f3; - } - .title, .desc{ - display: flex; - align-items: center; - } - .title { - font-size: $font_size; - font-weight: 700; - } - .desc{ - color: $color_font_two; - font-size: $font_size_medium; - } - .miconfont_check, .miconfont_custom{ - font-size: 37px; - color: $color_main; - font-weight: normal; - padding-right: 10px; - } - .miconfont_custom{ - color:#FFC300; - } - .miconfont_more{ - font-size: 30px; - padding-left: 10px; - } - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/components/weightMemo/index.tsx b/src/pages/salesAfter/components/weightMemo/index.tsx deleted file mode 100644 index 7cbfd13..0000000 --- a/src/pages/salesAfter/components/weightMemo/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import Popup from "@/components/popup" -import { Text, Textarea, View } from "@tarojs/components" -import { memo, useCallback, useState } from "react" -import styles from './index.module.scss' -import classnames from "classnames"; - -type Param = { - onCheck?: () => void - onCustom?: () => void -} -export default memo(({onCheck, onCustom}:Param) => { - return ( - - onCheck?.()}> - - - 陆盈纺织 - - - 查看原码单 - - - - onCustom?.()}> - - - 我的码单 - - - 自定义 - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/index.config.ts b/src/pages/salesAfter/index.config.ts deleted file mode 100644 index 5000759..0000000 --- a/src/pages/salesAfter/index.config.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default { - navigationBarTitleText: '售后详情', - enablePullDownRefresh: true, - backgroundTextStyle: 'dark', - enableShareAppMessage: true, -} diff --git a/src/pages/salesAfter/index.module.scss b/src/pages/salesAfter/index.module.scss deleted file mode 100644 index 635ee29..0000000 --- a/src/pages/salesAfter/index.module.scss +++ /dev/null @@ -1,155 +0,0 @@ -.order_main{ - min-height: 100%; - background-color:$color_bg_one; - padding: 20px; - padding-bottom: 190px; - box-sizing: border-box; - - .order_title{ - display: flex; - align-items: center; - padding: 20px 30px; - box-sizing: border-box; - background-color: #fff; - height: 116px; - border-radius: 20px; - margin-top: 20px; - text{ - flex:1; - font-size: $font_size; - font-weight: 700; - } - .order_status{ - background-color: #F0F0F0; - width: 148px; - height: 55px; - color: $color_font_three; - text-align: center; - line-height: 55px; - font-size: $font_size_medium; - border-radius: 30px; - &:nth-last-child(1) { - margin-left: 20px; - } - } - } - .order_desc{ - display: flex; - align-items: center; - background-color: #fff; - padding: 20px; - min-height: 116px; - border-radius: 20px; - margin-top: 20px; - box-sizing: border-box; - .order_desc_con{ - width: 150px; - font-size: $font_size; - font-weight: 700; - } - .order_desc_text, .order_desc_text_hint{ - font-size: $font_size_medium; - color: $color_font_two; - margin-right: 10px; - flex:1; - word-break:break-all; - } - .order_desc_text_hint{ - text-align: right; - } - .miconfont{ - font-size: 20px; - color: $color_font_two; - } - } - .submit_order{ - display: flex; - position: fixed; - bottom: 0; - left: 0; - justify-content: flex-end; - width: 100%; - height: 175px; - align-items: center; - background-color: #fff; - box-shadow: 6px 0px 12px 0px rgba(0,0,0,0.16); - padding: 20px 20px; - box-sizing: border-box; - padding-bottom: constant(safe-area-inset-bottom); - padding-bottom: env(safe-area-inset-bottom); - .order_btn { - width: 152px; - height: 72px; - border: 2px solid #dddddd; - border-radius: 46px; - display: flex; - justify-content: center; - align-items: center; - color: $color_font_three; - &:nth-child(n+2) { - margin-left: 34px; - } - } - .order_btn_select{ - color: $color_main; - border: 2px solid $color_main; - } - .order_number_desc{ - font-size: $font_size_medium; - color: $color_font_two; - } - } - .order_info{ - background-color: #fff; - margin-top: 20px; - border-radius: 20px; - padding: 20px; - .order_info_title{ - font-size: $font_size; - font-weight: 700; - margin-bottom: 20px; - - } - .order_num{ - display: flex; - width: 100%; - justify-content: space-between; - align-items: center; - .order_num_btn{ - font-size: $font_size_medium; - padding: 5px; - border: 2px solid #007cf7; - border-radius: 10px; - color: $color_main; - } - } - text{ - font-size: $font_size; - word-break: break-all; - } - - } - - .after_sale_picture_list{ - display: grid; - grid-template-columns: repeat(5, 102px); - justify-items: center; - grid-row-gap:20px; - grid-column-gap: calc((100% - 102px*5)/4); - .after_sale_picture_item{ - width: 102px; - height: 102px; - image{ - width:100%; - height: 100%; - border-radius: 10px; - } - } - } - - - .weight_memo_con{ - margin-bottom: 20px; - } - -} \ No newline at end of file diff --git a/src/pages/salesAfter/index.tsx b/src/pages/salesAfter/index.tsx deleted file mode 100644 index a4f75bc..0000000 --- a/src/pages/salesAfter/index.tsx +++ /dev/null @@ -1,204 +0,0 @@ -import { SaleOrderOrderDetailApi } from '@/api/salesAfterOrder' -import { AFTER_ORDER_STATUS, ORDER_STATUS } from '@/common/enum' -import { formatDateTime, formatImgUrl, formatPriceDiv } from '@/common/fotmat' -import AfterOrderBtns from '@/components/afterOrderBtns' -import SearchInput from '@/components/searchInput' -import useLogin from '@/use/useLogin' -import { Image, Text, Textarea, View } from '@tarojs/components' -import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro' -import classnames from 'classnames' -import { useCallback, useEffect, useMemo, useRef, useState, memo } from 'react' -import AddressInfoDetail from './components/addressInfoDetail' -import ApplyRecord from './components/applyRecord' -import ContentBox from './components/contentBox' -import KindList from './components/kindList' -import OrderState from './components/orderState' -import ReturnLogistics from './components/returnLogistics' -import styles from './index.module.scss' - -export default () => { - useLogin() - const router = useRouter() - const orderId = useRef(Number(router.params.id)) - useDidShow(() => { - getSaleOrderPreView() - }) - - //获取订单详情 - const [orderDetail, setOrderDetail] = useState() //获取到的原始数据 - const { fetchData: saleOrderOrderDetailData } = SaleOrderOrderDetailApi() - const getSaleOrderPreView = async () => { - if (orderId.current) { - let res = await saleOrderOrderDetailData({ id: orderId.current }) - setOrderDetail(res.data) - } - Taro.stopPullDownRefresh() - } - - //监听获取到的数据 - useEffect(() => { - if (orderDetail) formatData() - }, [orderDetail]) - - //格式化数据格式 - const [formatDetailOrder, setFormatDetailOrder] = useState() //格式化后的数据 - const formatData = () => { - setFormatDetailOrder({ - ...orderDetail, - unit: orderDetail.sale_mode == 0 ? '条' : 'm', //单位 - }) - } - const formatPreViewOrderMemo = useMemo(() => { - return formatDetailOrder - }, [formatDetailOrder]) - - //获取底部按钮点击, 获取按钮状态 - const orderStateClick = useCallback( - (val) => { - if (val == 1 || val == 6) { - getSaleOrderPreView() - } else if (val == 8) { - //申请记录 - setApplyRecord(true) - } else if (val == 5) { - onShowLogistics(1) - } - }, - [orderDetail], - ) - - //页面下拉刷新 - usePullDownRefresh(() => { - getSaleOrderPreView() - }) - - //按钮所需数据 - const orderInfo = useMemo(() => { - return { - ...orderDetail, - } - }, [orderDetail]) - - //售后订单状态枚举 - const {} = AFTER_ORDER_STATUS - - //物流显示 - const [logisticsShow, setLogisticsShow] = useState(false) - const [logistics, setLogistics] = useState(false) - const onShowLogistics = useCallback((val) => { - setLogisticsShow(true) - if (val != 1) setLogistics(true) - }, []) - const onCloseLogistics = useCallback(() => { - setLogisticsShow(false) - }, []) - //物流成功上传 - const logisticsSuccess = useCallback(() => { - setLogisticsShow(false) - getSaleOrderPreView() - }, []) - - //显示记录 - const [applyRecord, setApplyRecord] = useState(false) - - return ( - - - - - - - - - setApplyRecord(false)} /> - - - ) -} - -const OrderDes = memo(({ orderInfo }: { orderInfo?: any }) => { - //复制功能 - const clipboardData = (val) => { - Taro.setClipboardData({ - data: val, - success: function (res) { - Taro.showToast({ - icon: 'none', - title: '复制成功', - }) - }, - }) - } - return ( - - 订单信息 - - - {orderInfo?.return_order_no} - clipboardData(orderInfo?.return_order_no)}> - 复制 - - - - - - {orderInfo?.order_no} - clipboardData(orderInfo?.order_no)}> - 复制 - - - - - {orderInfo?.return_reason_name} - - - {orderInfo?.return_explain_name} - - - {orderInfo?.goods_status_name} - - - {formatDateTime(orderInfo?.apply_time)} - - - {orderInfo?.reason_describe} - - - ) -}) - -const AfterSalePricture = memo(({ urls = [] }: { urls: string[] }) => { - const showList = useMemo(() => { - let res = urls.map((item) => { - return formatImgUrl(item, '!w800') - }) - return res - }, [urls]) - - //预览图片 - const showImage = () => { - Taro.previewImage({ - current: showList[0], // 当前显示 - urls: showList, // 需要预览的图片http链接列表 - }) - } - return ( - - - {urls?.map((item) => ( - - - - ))} - - - ) -}) diff --git a/src/pages/salesAfter/salesAfterList/components/order/index.module.scss b/src/pages/salesAfter/salesAfterList/components/order/index.module.scss deleted file mode 100644 index be8d9a6..0000000 --- a/src/pages/salesAfter/salesAfterList/components/order/index.module.scss +++ /dev/null @@ -1,184 +0,0 @@ -.order_item{ - background-color: #fff; - border-radius: 20px; - padding: 20px; - box-sizing: border-box; - .header{ - display: flex; - align-items: center; - .user{ - display: flex; - align-items: center; - .name { - color: #000; - font-weight: 700; - margin-left: 15px; - font-size: $font_size; - width: 100px; - @include common_ellipsis(); - } - image{ - width: 70px; - height: 70px; - border-radius: 50%; - } - } - .order_con { - padding-left: 15px; - width: 100%; - .name { - color: #000; - font-weight: 700; - font-size: $font_size; - } - .order_num { - flex: 1; - font-size: $font_size_medium; - color: $color_font_one; - padding-right: 10px; - display: flex; - justify-content: flex-start; - align-items: center; - .order_num_con{ - flex:1; - } - .miconfont { - font-size: 20px; - } - } - } - .tag{ - font-size: $font_size_min; - padding: 5px 15px; - background-color: $color_main; - color: #fff; - border-radius: 0px 20px 0px 20px; - } - } - .product_title{ - display: flex; - align-items: center; - padding: 35px 0; - .product_tag{ - background-color: #CDE5FF; - font-size: $font_size_min; - padding: 5px 10px; - color: $color_main; - border-radius: 6px; - } - .product_name{ - flex:1; - font-size: $font_size; - font-weight: 700; - padding: 0 20px; - @include common_ellipsis() - } - .product_status{ - font-size: $font_size; - color: $color_main; - } - } - .product_list{ - display: flex; - .image{ - width: 126px; - height: 126px; - border-radius: 20px ; - position: relative; - image{ - width: 100%; - height: 100%; - border-radius: 20px ; - } - .color_num { - background: rgba(0,0,0, 0.5); - border-radius: 36px 0px 20px 0px; - font-size: $font_size_min; - color: #fff; - position: absolute; - right:0; - bottom:0; - padding: 5px 10px 5px 15px; - box-sizing: border-box; - } - } - .color_list{ - flex:1; - padding-left: 30px; - .color_item{ - display: flex; - justify-content: space-between; - font-size: $font_size_min; - color: $color_font_three; - align-items: center; - margin-bottom: 20px; - .color_title{ - font-weight: 700; - font-size: $font_size; - color: #000; - } - .color_more{ - color: $color_font_three; - } - } - } - - } - .color_count_num{ - font-size: $font_size_min; - color: $color_font_two; - background-color: #F6F6F6; - border-radius: 10px; - padding: 10px 22px; - margin-top: 20px; - display: flex; - justify-content: space-between; - .refund_amount{ - font-size: 30rpx; - color: #007AFF; - text{ - &:nth-child(1) { - font-size: 23px; - } - } - } - } - .order_number{ - display: flex; - background-color: #F6F6F6; - padding: 20px; - margin: 20px 0; - align-items: center; - font-size: $font_size_medium; - border-radius: 10px; - text{ - &:nth-child(1) { - - font-weight: 700; - color: $color_font_three; - border-right: 2px solid #CCCCCC; - padding-right: 20px; - } - &:nth-child(2) { - padding-left: 20px; - color: $color_font_one; - } - } - } - .inspection{ - height: 82px; - background-color: #F6F6F6; - border-radius: 10px; - padding: 0 20px; - box-sizing: border-box; - color: #007AFF; - display: flex; - align-items: center; - margin: 20px 0; - font-size: 28px; - .miconfont{ - font-size: 50px; - margin-right: 20px; - } - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/salesAfterList/components/order/index.tsx b/src/pages/salesAfter/salesAfterList/components/order/index.tsx deleted file mode 100644 index d85beeb..0000000 --- a/src/pages/salesAfter/salesAfterList/components/order/index.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import { goLink } from "@/common/common"; -import { AFTER_ORDER_STATUS, REFUND_STATUS_ORDER } from "@/common/enum"; -import { formatHashTag, formatImgUrl, formatPriceDiv } from "@/common/fotmat"; -import AfterOrderBtns from "@/components/afterOrderBtns"; -import LabAndImg from "@/components/LabAndImg"; -import { useSelector } from "@/reducers/hooks"; -import { Image, Text, View } from "@tarojs/components" -import classnames from "classnames"; -import { memo, useCallback, useMemo, useRef, useState } from "react"; -import OrderStatusTag from "../orderStatusTag"; -import styles from './index.module.scss' - -type Param = { - value: { - order_no: string, - return_order_no: string, - sale_mode: number, - sale_mode_name: string, - stage_name: string, - shipment_mode_name: string, - product_list: any[], - total_fabrics: number, - total_colors: number, - total_number: number, - stage: 0, - id: number, - lab: {l:number, a:number, b:number}, - rgb: {r:number, g:number, b:number}, - texturl_url: string, - type: number //2 退货 1 预收退款 3 销售 - return_apply_order_id: number //退款申请单 - refund_amount: number // 退款金额 - is_quality_check: true|false, - accessory_url: string[], //物流图片 - take_goods_remark: string, //物流备注 - quality_check_pass_product: any[] - - }, - 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) => { - return sale_mode == 0? item.roll + '条' : Number(item.length / 100) + '米' - }, [value]) - //对应单价 - const standardPrice = useCallback((price, sale_mode) => { - return formatPriceDiv(price).toLocaleString() + '/' + (sale_mode == 1?'m':'kg') - }, [value]) - - //点击订单按钮 - const orderBtnsClick = useCallback((status) => { - onClickBtn?.({status, orderInfo:value}) - }, [value]) - - //按钮所需数据 - const orderInfo = useMemo(() => { - return value - }, [value]) - - //整理颜色 - const labAndRgbAndUrl = useMemo(() => { - return {lab:{...value?.lab}, rgb:{...value?.rgb}, texturl_url: value?.texturl_url} - }, [value]) - - const { - ReturnApplyOrderTypeReturnForRefund, // 退货退款 - } = REFUND_STATUS_ORDER - - const numText = useMemo(() => { - let total_number_new = value?.sale_mode == 0? value?.total_number:(value?.total_number/100) - return `${value?.total_fabrics} 种面料,${value?.total_colors} 种颜色,共 ${total_number_new}${value?.sale_mode == 0? ' 条':' 米'}` - }, [value]) - - //售后单状态 - const {ReturnStageQualityCheckPendingRefund, ReturnStageServiceOrderPendingRefund, ReturnStageReturned} = AFTER_ORDER_STATUS - const stage_name = useMemo(() => { - return [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value].includes(value?.stage)?'待退款':value?.stage_name - }, [value]) - - //获取面料数组 - const list = useMemo(() => { - let res = value?.is_quality_check? value?.quality_check_pass_product : value?.product_list - return res || [] - }, [value]) - - - return ( - - goLink('/pages/salesAfter/index', {id: value?.id})}> - - - - - {userInfo?.adminUserInfo?.user_name} - - - 售后单号:{value?.return_order_no} - - - - - - - {list?.length > 0 && goLink('/pages/salesAfter/index', {id: value?.id})}> - - {value?.sale_mode_name} - {formatHashTag(list?.[0].code, list?.[0].name)} - {stage_name} - - - - - {list?.[0].product_colors?.[0].code} - - - {list?.[0].product_colors?.map((itemColor, index) => { - return ( - (index <= 1)&& - {formatHashTag(itemColor.code, itemColor.name)} - ¥{standardPrice(itemColor.sale_price, value.sale_mode)} - ×{formatCount(itemColor, value.sale_mode)} - - ) - }) - } - {list?.[0].product_colors?.length > 2 && - …… - …… - …… - } - - - - {numText} - {/* {ReturnStageReturned.value == value?.stage && ¥{formatPriceDiv(value?.refund_amount, 100, true)}} */} - - - {value?.type == ReturnApplyOrderTypeReturnForRefund.value?'已申请退货':'已申请退款'} - 订单号:{value?.order_no} - - } - {(list?.length <= 0 && value?.is_quality_check) && goLink('/pages/salesAfter/index', {id: value?.id})}> - - 没有质检通过的商品,无法退款 - } - - - - ) -}) - diff --git a/src/pages/salesAfter/salesAfterList/components/orderStatusList/index.module.scss b/src/pages/salesAfter/salesAfterList/components/orderStatusList/index.module.scss deleted file mode 100644 index 47de83d..0000000 --- a/src/pages/salesAfter/salesAfterList/components/orderStatusList/index.module.scss +++ /dev/null @@ -1,18 +0,0 @@ -.order_status_list{ - font-size: $font_size; - color: #9E9E9E; - margin-top: 20px; - .order_status_item{ - padding: 20px; - box-sizing: border-box; - } - .selected{ - font-weight: 700; - color: #000; - border-bottom: 4px solid #707070; - } - .order_list_scroll{ - white-space: nowrap; - display: flex; - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/salesAfterList/components/orderStatusList/index.tsx b/src/pages/salesAfter/salesAfterList/components/orderStatusList/index.tsx deleted file mode 100644 index 3e12f6f..0000000 --- a/src/pages/salesAfter/salesAfterList/components/orderStatusList/index.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { ScrollView, View } from "@tarojs/components" -import { memo, useEffect, useState } from "react" -import styles from './index.module.scss' -import classnames from "classnames"; - -type Param = { - list: {id: number, name: string}[], - defaultId?: number|null, - onSelect?: (val: number) => void -} -export default memo(({list = [], defaultId = null, onSelect}: Param) => { - const [selectInfo, setSelectInfo] = useState({ - selected: -1, //当前选中的id - tabId: '', //需要滚动到的id - }) - useEffect(() => { - if(defaultId) { - const index = list?.findIndex(item => { - console.log(item.id, defaultId) - return item.id == defaultId - }) - if(index !== -1) { - const num = index > 0?( index - 1) : 0 - setSelectInfo((e) => ({...e, tabId:list[num].id.toString()})) - } - } - }, [defaultId]) - const clickEvent = ({item, index}: {item:any, index:number}) => { - const num = index > 0?( index - 1) : 0 - setSelectInfo((e) => ({...e, tabId:list[num].id.toString(), selected: item.id})) - onSelect?.(item.id) - } - - return ( - - - - {list.map((item, index) => { - return clickEvent({item, index})} className={classnames(styles.order_status_item, (selectInfo.selected==item.id)&&styles.selected)}>{item.name} - })} - - - - ) -}) - diff --git a/src/pages/salesAfter/salesAfterList/components/orderStatusTag/index.module.scss b/src/pages/salesAfter/salesAfterList/components/orderStatusTag/index.module.scss deleted file mode 100644 index df84721..0000000 --- a/src/pages/salesAfter/salesAfterList/components/orderStatusTag/index.module.scss +++ /dev/null @@ -1,21 +0,0 @@ -.tag{ - font-size: $font_size_min; - padding: 5px 15px; - background-color: $color_main; - color: #fff; - border-radius: 0px 20px 0px 20px; - display: flex; - align-items: center; - .miconfont{ - font-size: 30px; - } - -} -.saleReturn_tag{ - background-color: #E4E4FF; - color: #1818B4; -} -.refund_tag { - background-color: #FFE6CE; - color: #EE7500; -} \ No newline at end of file diff --git a/src/pages/salesAfter/salesAfterList/components/orderStatusTag/index.tsx b/src/pages/salesAfter/salesAfterList/components/orderStatusTag/index.tsx deleted file mode 100644 index 968fe99..0000000 --- a/src/pages/salesAfter/salesAfterList/components/orderStatusTag/index.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Text, View } from "@tarojs/components" -import { memo } from "react" -import classnames from "classnames"; -import styles from './index.module.scss' -import { REFUND_STATUS_ORDER } from "@/common/enum"; - - -type Param = { - status?: number -} -export default memo(({status = 0}:Param) => { - const { - ReturnApplyOrderTypeAdvanceReceiptRefund, // 预收退款 - ReturnApplyOrderTypeReturnForRefund, // 退货退款 - ReturnApplyOrderTypeSalesRefund // 销售退款 - } = REFUND_STATUS_ORDER - return ( - <> - {(status !== 0)&& - - { status == ReturnApplyOrderTypeReturnForRefund.value?'退货':'退款'} - } - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/salesAfterList/components/returnLogistics/index.module.scss b/src/pages/salesAfter/salesAfterList/components/returnLogistics/index.module.scss deleted file mode 100644 index 1a22287..0000000 --- a/src/pages/salesAfter/salesAfterList/components/returnLogistics/index.module.scss +++ /dev/null @@ -1,35 +0,0 @@ - -.logistics_main{ - padding: 20px 30px; - box-sizing: border-box; - .logistics_image{ - display: flex; - .title_desc{ - font-size: 28px; - font-weight: 700; - padding-top: 50px; - box-sizing: border-box; - } - .upload_image{ - flex:1; - } - } - .logistics_desc{ - margin-top: 50px; - } - .btns_two{ - display: flex; - height: 82px; - font-size: $font_size_big; - border-radius: 40px; - margin-top: 50px; - .verify_btn{ - flex:1; - border-radius: 40px; - background: #007aff; - text-align: center; - line-height: 82px; - color: #fff; - } - } -} diff --git a/src/pages/salesAfter/salesAfterList/components/returnLogistics/index.tsx b/src/pages/salesAfter/salesAfterList/components/returnLogistics/index.tsx deleted file mode 100644 index 3d6b19f..0000000 --- a/src/pages/salesAfter/salesAfterList/components/returnLogistics/index.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import Popup from "@/components/popup"; -import { Text, View } from "@tarojs/components"; -import { memo, useCallback, useEffect, useRef, useState } from "react"; -import UploadImage from "@/components/uploadImage" -import styles from './index.module.scss' -import TextareaEnhance from "@/components/textareaEnhance"; -import { ReturnApplyLogisticsApi } from "@/api/salesAfterOrder"; -import { alert } from "@/common/common"; - -type Param = { - show?: true|false, - onClose?: () => void, - onSubmit?: () => void, - id?: number //订单id -} -export default memo(({show = false, onClose, onSubmit, id = 0}: Param) => { - //需要提交的数据 - const submitData = useRef({ - accessory_url: [], - remark: '', - id: 0 - }) - useEffect(() => { - if(id) submitData.current.id = id - }, [id]) - - //获取图片列表 - const getImageList = useCallback((list) => { - submitData.current.accessory_url = list - }, []) - - //备注 - const getOtherReason = useCallback((val) => { - submitData.current.remark = val - }, []) - - //确定 - const {fetchData} = ReturnApplyLogisticsApi() - const onSubmitEven = async () => { - if(!id) return alert.error('参数有误') - if(submitData.current.accessory_url.length <= 0) return alert.error('请上传附件') - let res = await fetchData(submitData.current) - if(res.success) { - alert.success('上传成功') - } else { - alert.error('上传失败') - } - } - - return ( - <> - - - - 上传附件: - - - - - - - - - onSubmitEven()}>保存 - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/salesAfter/salesAfterList/index.config.ts b/src/pages/salesAfter/salesAfterList/index.config.ts deleted file mode 100644 index d4c9fc3..0000000 --- a/src/pages/salesAfter/salesAfterList/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '退货/售后', - enableShareAppMessage: true, -} diff --git a/src/pages/salesAfter/salesAfterList/index.module.scss b/src/pages/salesAfter/salesAfterList/index.module.scss deleted file mode 100644 index e8f528a..0000000 --- a/src/pages/salesAfter/salesAfterList/index.module.scss +++ /dev/null @@ -1,38 +0,0 @@ -.order_list_main{ - height: 100vh; - background-color: $color_bg_one; - display: flex; - flex-direction: column; - .title{ - padding: 0 20px; - background-color: #fff; - box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.16); - border-bottom: 2px solid #e2e2e2; - height: 160px; - .order_status_list{ - font-size: $font_size; - color: #9E9E9E; - margin-top: 20px; - .order_status_item{ - padding: 20px; - box-sizing: border-box; - } - .selected{ - font-weight: 700; - color: #000; - border-bottom: 4px solid #707070; - } - .order_list_scroll{ - white-space: nowrap; - display: flex; - } - } - } - .order_list{ - height: calc(100vh - 160px); - .order_item_con{ - margin-top: 20px; - padding: 0 20px; - } - } -} \ No newline at end of file diff --git a/src/pages/salesAfter/salesAfterList/index.tsx b/src/pages/salesAfter/salesAfterList/index.tsx deleted file mode 100644 index 5797e62..0000000 --- a/src/pages/salesAfter/salesAfterList/index.tsx +++ /dev/null @@ -1,160 +0,0 @@ -import Search from '@/components/search' -import useLogin from '@/use/useLogin' -import { View } from '@tarojs/components' -import Taro, { useDidShow } from '@tarojs/taro' -import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import styles from './index.module.scss' -import classnames from 'classnames' -import Order from './components/order' -import InfiniteScroll from '@/components/infiniteScroll' -import { dataLoadingStatus, getFilterData } from '@/common/util' -import OrderStatusList from './components/orderStatusList' -import { GetSaleOrderListApi, RefundOrderSatausApi } from '@/api/salesAfterOrder' -import ApplyRecord from '../components/applyRecord' -import ReturnLogistics from '../components/returnLogistics' - -export default () => { - useLogin() - - //搜索参数 - const [searchField, setSearchField] = useState<{ status: number | null; page: number; size: number; name: string }>({ - status: null, - page: 1, - size: 10, - name: '', - }) - - //获取订单状态 - const [statusList, setStatusList] = useState([{ id: -1, name: '全部' }]) - const { fetchData: fetchDataStatus } = RefundOrderSatausApi() - const getOrderStatusList = async () => { - let res = await fetchDataStatus() - setStatusList((e) => [...e, ...res.data.list]) - } - useEffect(() => { - getOrderStatusList() - setSearchField((e) => ({ ...e, status: -1 })) - }, []) - - //获取订单列表 - const { fetchData: listFetchData, state: orderState } = GetSaleOrderListApi() - 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 }) - setRefresherTriggeredStatus(() => false) - } - - useDidShow(() => { - if (searchField.status != null) getOrderList() - }) - - //监听筛选条件变化 - useEffect(() => { - if (searchField.status != null) getOrderList() - }, [searchField]) - - //上拉加载数据 - const pageNum = useRef({ size: searchField.size, page: searchField.page }) - const getScrolltolower = useCallback(() => { - if (orderData.list.length < orderData.total) { - pageNum.current.page++ - const size = pageNum.current.size * pageNum.current.page - setSearchField((e) => ({ ...e, size })) - } - }, [orderData]) - - //状态改变 - const changeStatus = useCallback((e) => { - pageNum.current.page = 1 - setSearchField((value) => ({ ...value, status: e, size: 10 })) - setOrderData(() => ({ list: [], total: 0 })) - }, []) - - //数据加载状态 - const statusMore = useMemo(() => { - return dataLoadingStatus({ list: orderData.list, total: orderData.total, status: orderState.loading }) - }, [orderData, orderState]) - - //输入了搜索关键字 - const getSearchData = useCallback((e) => { - pageNum.current.page = 1 - setOrderData(() => ({ list: [], total: 0 })) - setSearchField((val) => ({ ...val, name: e, size: 10 })) - }, []) - - //列表下拉刷新 - const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false) - const getRefresherRefresh = async () => { - pageNum.current.size = 1 - setRefresherTriggeredStatus(true) - setSearchField((val) => ({ ...val, size: 10 })) - } - - //监听点击的按钮 - const [callBackOrderInfo, setCallBackPayOrderInfo] = useState() - const clickOrderBtn = useCallback( - ({ status, orderInfo }) => { - if (status == 1 || status == 6) { - getOrderList() - } else if (status == 8) { - setApplyRecord(true) - } else if (status == 5) { - onShowLogistics(() => true) - } - setCallBackPayOrderInfo(orderInfo) - }, - [orderData], - ) - - //显示记录 - const [applyRecord, setApplyRecord] = useState(false) - - //物流显示 - const [logisticsShow, setLogisticsShow] = useState(false) - const onShowLogistics = useCallback((val) => { - setLogisticsShow(true) - }, []) - const onCloseLogistics = useCallback(() => { - setLogisticsShow(false) - }, []) - //物流成功上传 - const logisticsSuccess = useCallback(() => { - setLogisticsShow(false) - getOrderList() - }, [orderData]) - - return ( - - - - - - - - {orderData?.list.map((item) => { - return ( - - - - ) - })} - - - setApplyRecord(false)} /> - - - ) -} diff --git a/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx b/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx deleted file mode 100644 index 4be6b33..0000000 --- a/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { View } from "@tarojs/components"; -import { memo, useEffect, useMemo, useState } from "react"; -import Taro from "@tarojs/taro"; -import { useBluetooth } from "@/use/contextBlueTooth" -import SearchInput from "@/components/searchInput"; -import Popup from "./Popup" -import classnames from "classnames"; -import styles from "../../css/linkBlueTooth.module.scss" - -export default memo(() => { - const { state, init, startScan, connect, disconnect } = useBluetooth() - - useEffect(() => { - init() - }, []) - - const [linkStatus, setLinkStatus] = useState(1) - useEffect(() => { - if (!state.available) { - setLinkStatus(1) - } else if (state.available && state.connected?.name) { - setLinkStatus(3) - } else { - setLinkStatus(2) - } - }, [state.available, state.connected]) - - const linkName = useMemo(() => { - return state.connected?.localName || '' - }, [state.connected]) - - //链接设备 - const onLinkListen = (item) => { - if (!state.connected && !state.connecting) - connect(item) - } - - const [popupShow, setPopupShow] = useState(false) - //显示设备列表 - const onFindDevice = () => { - if (linkStatus == 1) { - Taro.showToast({ - title: '请打开蓝牙', - icon: 'none' - }) - } else { - setPopupShow(true) - onFindEven() - } - - } - const onFindEven = () => { - if (!state.discovering && !state.connected && !state.connecting) - startScan() - } - - //断开链接 - const onDisconnect = () => { - disconnect() - setPopupShow(false) - } - - return ( - <> - - - - - { - linkStatus == 1 && 请开启蓝牙 || - linkStatus == 2 && 未连接设备 || - linkStatus == 3 && {linkName} - } - - - setPopupShow(false)} - onLink={item => onLinkListen(item)} - onOff={onDisconnect} - onFind={onFindEven} - /> - - - - ); - -}) diff --git a/src/pages/sampleComparison/compoents/bluetooth/Popup.tsx b/src/pages/sampleComparison/compoents/bluetooth/Popup.tsx deleted file mode 100644 index d8a9464..0000000 --- a/src/pages/sampleComparison/compoents/bluetooth/Popup.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { ScrollView, View } from "@tarojs/components" -import { memo, useEffect, useState } from "react" -import Loading from "@/components/loading" -import style from "../../css/popup.module.scss" - -interface params { - state: any, - show: Boolean, - onClose: (Boolean) => void, - onLink: (any) => void, - children?: React.ReactNode - onOff: () => void, - onFind: () => void, -} - -export default memo(({state, show=false, onClose, onLink, onOff, onFind}:params) => { - const [popupShow, setPopupShow] = useState(show) - useEffect(() => { - setPopupShow(show) - }, [show]) - const onCloseListener = () => { - onClose(false) - } - - return ( - <> - { - popupShow&& - - 搜索设备 - - - { - (state.devices&&state.devices.length > 0)&&state?.devices.map(item => { - return ( - onLink(item)}> - {item.name} - { - (!state.connecting&&!state.connected)&&链接|| - (state.connecting&&item.deviceId == state.connecting.deviceId)&&正在链接...|| - (state.connected&&item.deviceId == state.connected.deviceId)&&链接成功 - } - - ) - })|| - - { - (!state.discovering)&& <> - 暂无设备,请按以下条件检查 - 1.请确保取色仪处于激活状态 - 2.请确保取色仪没有链接其他设备 - 3.请打开手机定位 - || - 设备搜索中 - } - - - - } - - - { - state.connected&&断开链接|| - (!state.connected&&state.discovering)&&搜索中|| - 重新搜索 - } - - - - } - - ) -}) \ No newline at end of file diff --git a/src/pages/sampleComparison/css/linkBlueTooth.module.scss b/src/pages/sampleComparison/css/linkBlueTooth.module.scss deleted file mode 100644 index 0714b46..0000000 --- a/src/pages/sampleComparison/css/linkBlueTooth.module.scss +++ /dev/null @@ -1,42 +0,0 @@ -.main { - width: 690px; - height: 86px; - background: #ffffff; - border-radius: 10px; - margin-top: 24px; - margin-left: 30px; - - .bluetooth_link { - display: flex; - align-items: center; - - .link_status { - width: 12px; - height: 12px; - background: #f02409; - border-radius: 50%; - } - - .link_statused { - background: #07C160; - } - - .link_statused_no { - background: #f0ec09; - } - - .link_name { - font-size: $font_size; - margin-left: 20px; - - } - - .link_name_no { - color: #f02409; - } - - .link_name_no_link { - color: #f0ec09; - } - } -} \ No newline at end of file diff --git a/src/pages/sampleComparison/css/popup.module.scss b/src/pages/sampleComparison/css/popup.module.scss deleted file mode 100644 index d6c273f..0000000 --- a/src/pages/sampleComparison/css/popup.module.scss +++ /dev/null @@ -1,90 +0,0 @@ -.popup{ - width: 100vw; - height: 100vh; - position: absolute; - top: 0; - left: 0; - .mask{ - width: 100%; - height: 100%; - background-color: rgba(0,0,0,0.5); - position: fixed; - top:0; - left:0; - z-index: 9; - } - .content{ - z-index: 99; - background-color: #fff; - width: 75vw; - height: 600px; - position: fixed; - top: 50%; - left: 50%; - border-radius: 20px; - transform: translateX(-50%) translateY(-50%); - display: flex; - flex-direction: column; - font-size: 28px; - .title{ - text-align: center; - margin: 20px; - } - .list{ - height: 480px; - padding: 0 20px; - .scroll{ - height: 100%; - } - .item{ - margin-bottom: 20px; - display: flex; - justify-content: space-between; - border-bottom: 1px dashed #ccc; - padding: 15px 0; - color: #3b3b3b; - @mixin link{ - font-size: 25px; - } - .link_success{ - @include link; - color: green; - } - .link_ing { - color: orange; - } - } - .noDevice{ - height: 100%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - color: #a8a8a8; - .n_item{ - width: 100%; - text-align: left; - margin-top: 20px; - padding: 0 30px; - box-sizing: border-box; - } - } - - } - .footer{ - text-align: center; - padding: 20px 0; - background-color: #f1f1f1; - border-radius: 0 0 10px 10px; - display: flex; - justify-content: center; - align-items: center; - } - .finding{ - color: orange; - } - .footer_off{ - color: red; - } - } -} diff --git a/src/pages/sampleComparison/index.config.ts b/src/pages/sampleComparison/index.config.ts deleted file mode 100644 index cfc4a8a..0000000 --- a/src/pages/sampleComparison/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '样品对比', - enableShareAppMessage: false, -} diff --git a/src/pages/sampleComparison/index.module.scss b/src/pages/sampleComparison/index.module.scss deleted file mode 100644 index e46e9fe..0000000 --- a/src/pages/sampleComparison/index.module.scss +++ /dev/null @@ -1,253 +0,0 @@ -page { - background: #f3f3f3; - overflow: hidden; -} - -.body { - overflow: hidden; - - .topBox { - margin-top: 24px; - margin-left: 30px; - width: 690px; - height: 86px; - background: #ffffff; - border-radius: 10px; - display: flex; - align-items: center; - justify-content: space-between; - - .leftBox { - display: flex; - align-items: center; - padding-left: 19px; - - .leftFont { - font-size: 28px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - text-align: left; - color: #707070; - margin-right: 14px; - } - - .borderBox { - width: 0px; - height: 62px; - border: 2px solid #f3f3f3; - margin-right: 39px; - } - - .cricleBox { - width: 12px; - height: 12px; - background: #cccccc; - border-radius: 50%; - margin-right: 12px; - } - - .notNet { - font-size: 28px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - color: #aaaaaa; - } - } - - .iconMore { - margin-right: 30px; - font-size: 30px; - } - } - - .contBox { - margin-top: 53px; - display: flex; - padding-left: 56px; - - .firstBox { - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; - - .firstLeftName { - font-size: 26px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - color: #707070; - } - - .firstLeftbox { - width: 290px; - height: 290px; - background: #dddddd; - margin-top: 13px; - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; - border-radius: 50%; - - .clickFont { - font-size: 28px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - color: #707070; - - } - - } - - .color_bock { - width: 290px; - height: 290px; - border-radius: 50%; - } - - .color_bocktwo { - width: 290px; - height: 290px; - border-radius: 50%; - } - - .nameColor { - font-size: 24px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - color: #707070; - margin-top: 30px; - } - } - } - - .reslutBox { - width: 692px; - height: 180px; - background: #ffffff; - margin-top: 30px; - margin-left: 29px; - border-radius: 20px; - overflow: hidden; - } - - .reslutTitle { - overflow: hidden; - width: 100%; - margin-top: 41px; - display: flex; - align-items: center; - justify-content: space-between; - - .titleLeft { - margin-left: 48px; - font-size: 26px; - font-family: Microsoft YaHei, Microsoft YaHei-Bold; - font-weight: 700; - color: #707070; - } - - .titleRiht { - margin-right: 37px; - width: 136px; - height: 46px; - background: #ffd9d9; - border-radius: 10px; - font-size: 28px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - text-align: center; - color: #ff4a4a; - line-height: 46px; - } - - .titleRiht1 { - background: #cdf3df; - margin-right: 37px; - width: 136px; - height: 46px; - border-radius: 10px; - font-size: 28px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - text-align: center; - line-height: 46px; - color: #07C160; - } - } - - .notResult { - width: 100%; - text-align: center; - font-size: 26px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - color: #ababab; - margin-top: 14px; - } - - .notBox { - margin-top: 32px; - display: flex; - align-items: center; - justify-content: space-between; - overflow: hidden; - - .notLeft { - font-size: 26px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - color: #707070; - margin-left: 40px; - } - - .notright { - font-size: 26px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - color: #707070; - margin-right: 37px; - } - } - - .bottomBox { - position: fixed; - bottom: 0; - width: 750px; - height: 182px; - background: #f3f3f3; - box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.16); - overflow: hidden; - display: flex; - - .leftBtn { - width: 264px; - height: 82px; - background: #ffffff; - border-radius: 42px; - font-size: 32px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - text-align: center; - color: #007aff; - line-height: 82px; - margin-top: 34px; - margin-left: 67px; - } - - .rightBtn { - width: 264px; - height: 82px; - background: #007aff; - border-radius: 42px; - font-size: 32px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - text-align: center; - color: #ffffff; - line-height: 82px; - margin-top: 34px; - margin-left: 88px; - } - } -} \ No newline at end of file diff --git a/src/pages/sampleComparison/index.tsx b/src/pages/sampleComparison/index.tsx deleted file mode 100644 index f91c0bd..0000000 --- a/src/pages/sampleComparison/index.tsx +++ /dev/null @@ -1,212 +0,0 @@ - -import { Image, Text, Textarea, View } from "@tarojs/components" -import Taro, { useDidShow, usePullDownRefresh, useRouter } from "@tarojs/taro"; -import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { useBluetooth } from "../../use/contextBlueTooth" -import classnames from "classnames"; -import LinkBlueTooth from "./compoents/bluetooth/LinkBlueTooth"; -import { toRgb } from '../../common/bluetooth/color/colorSpace' -import styles from './index.module.scss' -import { productabsorbcontrast } from "@/api/mine" -export default () => { - //搜索参数 - const [searchField, setSearchField] = useState({ - l1: '', - a1: '', - b1: '', - l2: '', - a2: '', - b2: '', - }) - type ColorList = { - one?: any, - two?: any - } - const [colorList, setColorList] = useState({ - one: null, - two: null - }) - const { state: colorState, measureAndGetLab } = useBluetooth() - - const getLab = async (val) => { - if (colorState.connected) { - let res = await measureAndGetLab() - if (val === 1) { - setColorList({ ...colorList, one: res }) - } else { - setColorList({ ...colorList, two: res }) - } - } else { - Taro.showToast({ - title: '请链接设备', - icon: 'none' - }) - } - } - const getNowTime = () => { - const yy = new Date().getFullYear() - const MM = (new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : (new Date().getMonth() + 1) - const dd = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate() - const HH = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours() - const mm = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes() - const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds() - return yy + '-' + MM + '-' + dd + ' ' + HH + ':' + mm + ':' + ss - } - //监听lab数据变化 - const [blueToothColor, setBlueToothColor] = useState('') - const [blueToothColorTwo, setBlueToothColorTwo] = useState('') - const [time, setTime] = useState('') - const [timeTwo, setTimeTwo] = useState('') - useEffect(() => { - if (colorState.deviceLab) { - - if ((colorList as any).one?.constructor === Object) { - const rgb = toRgb([(colorList as any).one?.L, (colorList as any).one?.a, (colorList as any).one?.b]) - setBlueToothColor(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) - setTime(getNowTime()) - setSearchField({ ...searchField, l1: rgb[0], a1: rgb[1], b1: rgb[2] }) - } - if ((colorList as any).two?.constructor === Object) { - - const rgb = toRgb([(colorList as any).two?.L, (colorList as any).two?.a, (colorList as any).two?.b]) - setBlueToothColorTwo(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) - setTimeTwo(getNowTime()) - setSearchField({ ...searchField, l2: rgb[0], a2: rgb[1], b2: rgb[2] }) - - } - } - }, [colorList]) - const reset = () => { - setColorList({}) - setBlueToothColor('') - setBlueToothColorTwo('') - setTime('') - setTimeTwo('') - setData('') - setResult('') - } - const [data, setData] = useState('') - const [result, setResult] = useState('') - const { fetchData } = productabsorbcontrast() - const handTake = async () => { - if (searchField.l1 === '') { - Taro.showToast({ - title: '请填充基础样品', - icon: 'none' - }) - return - } - if (searchField.l2 === '') { - Taro.showToast({ - title: '请填充对比样品', - icon: 'none' - }) - return - } - const query = { - ...searchField - } - const res = await fetchData(query) - if (res.data) { - setData(res.data) - let diffarray = [ - res.data.reddish && "偏红", - res.data.yellowish && "偏黄", - res.data.greenish && "偏绿", - res.data.bluish && "偏蓝", - res.data.whitish && "偏亮", - res.data.darker && "偏暗", - ]; - let resCont = diffarray.filter(item => item).join(","); - setResult(resCont) - } - } - return ( - - {/* - - 蓝牙设备 - - - - - - */} - - - - 基础样品 - { - blueToothColor === '' && - getLab(1)}> - 点击取色 - - } - {blueToothColor && getLab(1)} style={{ background: blueToothColor }}> - - } - { - time === '' && -- - } - { - time && {time} - } - - - 对比样品 - { - blueToothColorTwo === '' && - getLab(2)}> - 点击取色 - - } - {blueToothColorTwo && getLab(2)} style={{ background: blueToothColorTwo }}> - - } - { - timeTwo === '' && -- - } - { - timeTwo && {timeTwo} - } - - - - - 测量结果 - { - (data as any).ciede_2000 >= 1 && - 不合格 - } - { - (data as any).ciede_2000 <= 1 && - 合格 - } - - - { - data === '' && - 暂无数据 - } - { - data && - - 色差值: {(data as any).ciede_2000} - { - !(data as any).reddish && !(data as any).yellowish && !(data as any).greenish && !(data as any).bluish && !(data as any).whitish && !(data as any).darker && - 无明显色差 - } - { - result && - {result} - } - - } - - - reset()}>重置 - handTake()}>提交 - - - ) -} \ No newline at end of file diff --git a/src/pages/search/index.config.ts b/src/pages/search/index.config.ts deleted file mode 100644 index eac2247..0000000 --- a/src/pages/search/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '搜索', - enableShareAppMessage: true, -} diff --git a/src/pages/search/index.module.scss b/src/pages/search/index.module.scss deleted file mode 100644 index 2e4ede6..0000000 --- a/src/pages/search/index.module.scss +++ /dev/null @@ -1,72 +0,0 @@ -.main{ - .search{ - display: flex; - justify-content: space-between; - padding: 20px; - padding-bottom: 50px; - } - - .hot { - padding: 0 20px; - .hot_header { - width:100%; - display: flex; - justify-content: space-between; - font-size: $font_size_medium; - .hot_header_title { - font-size: $font_size; - color: $color_font_one; - font-weight: 700; - } - .hot_header_up{ - color: $color_main; - } - } - .list{ - display: flex; - font-size: $font_size_medium; - flex-wrap: wrap; - padding: 20px 0; - .item{ - margin-right: 20px; - margin-bottom: 20px; - padding: 10px 20px; - background-color: #F0F0F0; - color: $color_font_three; - border-radius: 50px; - } - } - } - .history { - padding: 0 20px; - .history_header { - width:100%; - display: flex; - justify-content: space-between; - font-size: $font_size_medium; - .history_header_title { - font-size: $font_size; - color: $color_font_one; - font-weight: 700; - } - .miconfont{ - font-size: 30px; - color: $color_font_three; - } - } - .list{ - display: flex; - font-size: $font_size_medium; - flex-wrap: wrap; - padding: 20px 0; - .item{ - margin-right: 20px; - margin-bottom: 20px; - padding: 10px 20px; - background-color: #F0F0F0; - color: $color_font_three; - border-radius: 50px; - } - } - } -} \ No newline at end of file diff --git a/src/pages/search/index.tsx b/src/pages/search/index.tsx deleted file mode 100644 index dbdc018..0000000 --- a/src/pages/search/index.tsx +++ /dev/null @@ -1,47 +0,0 @@ - -import { View } from '@tarojs/components' -import Search from '@/components/search' -import { goLink } from '@/common/common'; -import classnames from "classnames"; -import styles from './index.module.scss' -import { useEffect } from 'react'; -import useLogin from '@/use/useLogin'; - -export default () => { - useLogin() - return ( - - - console.log(e)} placeholder="请输入面料关键词" placeIcon="out" showBtn={true} /> - - - - 热门面料 - 高级搜索 - - - 9265 - 全棉双卫衣 - 全棉双卫衣 - 全棉双卫衣 - 全棉双卫衣 - 26s - - - - - 历史搜索 - - - - 9265 - 全棉双卫衣 - 全棉双卫衣 - 全棉双卫衣 - 全棉双卫衣 - 26s - - - - ) -} diff --git a/src/pages/searchList/components/selectData/index.module.scss b/src/pages/searchList/components/selectData/index.module.scss deleted file mode 100644 index f7f3ea5..0000000 --- a/src/pages/searchList/components/selectData/index.module.scss +++ /dev/null @@ -1,51 +0,0 @@ -.tabs_main{ - display: flex; - width: 100%; - .tabs_scroll{ - width: 100%; - // display: flex; - white-space: nowrap; - ::-webkit-scrollbar { - display:none; - width:0; - height:0; - color:transparent; - } - .tabs_item{ - min-width: 130px; - padding: 0 10px; - display: inline-block; - font-size: 24px; - background-color: #ecf5ff; - border-radius: 24rpx; - height: 46.93rpx; - text-align: center; - line-height: 46.93rpx; - color: #707070; - margin-right: 20px; - border: 2px solid #cde5ff; - .tabs_item_con{ - height: 100%; - display: flex; - align-items: center; - justify-content: center; - font-size: $font_size_medium; - @include common_ellipsis(); - } - .tabs_index{ - height: 5px; - width: 100%; - background-color:$color_main; - position:absolute; - bottom: 0; - left:0; - border-radius: 50px; - } - .tabs_item_select{ - color: $color_main; - } - } - - - } -} \ No newline at end of file diff --git a/src/pages/searchList/components/selectData/index.tsx b/src/pages/searchList/components/selectData/index.tsx deleted file mode 100644 index e82b2d2..0000000 --- a/src/pages/searchList/components/selectData/index.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { ScrollView, View } from "@tarojs/components"; -import { memo, useState, ReactNode, useEffect } from "react"; -import classnames from "classnames"; -import styles from './index.module.scss' - - -export type ListProps = { - title: string, - value: number -} - -type Params = { - list?: ListProps[], - defaultValue?: number|string, - children?: ReactNode, - tabsOnClick?: (ListProps) => void, - -} - -export default memo(({list = [], defaultValue = 0, tabsOnClick}: Params) => { - - const [tabId, setTabId] = useState('') - - useEffect(() => { - const index = list?.findIndex(item => { - return item.value == defaultValue - }) - if(index !== -1) { - const num = index > 0?( index - 1) : 0 - setTabId(list[num].value.toString()) - } - }, []) - - const clickEvent = ({item, index}: {item:ListProps, index:number}) => { - tabsOnClick?.(item) - setTabId(index.toString()) - } - return ( - <> - - - - { - list.map((item, index) => { - return ( - clickEvent({item,index})}> - {`${item.title}: ${item.value}`} - - ) - }) - } - - - - - ) -}) \ No newline at end of file diff --git a/src/pages/searchList/hightSearchList.config.ts b/src/pages/searchList/hightSearchList.config.ts deleted file mode 100644 index 34c8c61..0000000 --- a/src/pages/searchList/hightSearchList.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - navigationBarTitleText: '搜索', - enablePullDownRefresh: true, - backgroundTextStyle: 'dark' -} diff --git a/src/pages/searchList/hightSearchList.module.scss b/src/pages/searchList/hightSearchList.module.scss deleted file mode 100644 index da2d667..0000000 --- a/src/pages/searchList/hightSearchList.module.scss +++ /dev/null @@ -1,214 +0,0 @@ -.main { - display: flex; - flex-direction: column; - height: 100vh; - background-color: $color_bg_one; - .search { - padding: 20px; - .SearchInput { - background-color: #fff; - padding: 10px 20px; - box-sizing: border-box; - border-radius: 10px; - } - - .bluetooth_color { - .color_bock { - width: 100px; - height: 46px; - } - .color_bock_no { - font-size: $font_size_medium; - color: $color_font_three; - } - } - } - .filter { - .filter_all { - display: flex; - justify-content: space-between; - align-items: center; - padding: 20px 130px; - font-size: $font_size_medium; - color: $color_font_three; - .text_zh, - .text_sc { - color: $color_main; - display: flex; - align-items: center; - .sortIcon { - display: flex; - flex-direction: column; - position: relative; - .icon_one { - font-size: $font_size_medium; - position: absolute; - margin: auto; - top: 0; - } - } - } - .text_ss { - position: relative; - .miconfont { - font-size: 20px; - margin-left: 5px; - } - &::before { - content: ''; - width: 2px; - height: 32px; - background-color: #c2c2c2; - position: absolute; - top: 0; - left: -30px; - } - } - } - .filter_btn_con { - display: flex; - justify-content: space-between; - align-items: center; - height: 86px; - } - .filter_scroll { - flex: 1; - width: 0; - padding-left: 20px; - ::-webkit-scrollbar { - display: none; - width: 0; - height: 0; - color: transparent; - } - } - .filter_btn { - display: flex; - justify-content: space-between; - padding: 20px; - margin-right: 20px; - flex: 1; - view { - font-size: $font_size_medium; - background-color: #f0f0f0; - border-radius: 24px; - min-width: 126px; - height: 46.93px; - text-align: center; - line-height: 46.93px; - color: $color_font_three; - &:nth-last-child(n + 2) { - margin-right: 10px; - } - &:nth-last-child(1) { - margin-right: 30px; - } - } - .selected { - background-color: #ecf5ff; - border: 2px solid #cde5ff; - color: $color_main; - width: 122px; - height: 42.93px; - } - } - .filter_more { - font-size: $font_size_medium; - color: $color_font_three; - padding: 0 30px 0 20px; - position: relative; - height: 100%; - line-height: 86px; - &::before { - content: ''; - opacity: 1; - width: 30px; - height: 100%; - position: absolute; - left: -15px; - background-image: linear-gradient(to right, rgba(248, 248, 248, 0.3), rgba(248, 248, 248, 1) 60%); - // z-index: 99; - } - .miconfont { - font-size: 27px; - } - } - } - .list { - height: calc(100vh - 440px); - .list_num { - font-size: $font_size_min; - color: $color_font_two; - padding: 10px 38px; - border-bottom: 1px solid rgb(233, 233, 233); - } - - .scroll { - height: 100%; - padding-top: 3px; - } - .product_list { - padding: 38px; - display: grid; - grid-template-columns: 321px 321px; - justify-content: space-between; - .product_item { - width: 321px; - background-color: #fff; - border-radius: 20px; - margin-bottom: 20px; - box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1); - .product_img { - width: 100%; - height: 224px; - border-radius: 20px 20px 0px 0px; - position: relative; - image { - width: 100%; - height: 100%; - border-radius: 20px 20px 0px 0px; - } - .color_num { - background: rgba(0, 0, 0, 0.5); - border-radius: 0px 50px 0px 30px; - font-size: $font_size_min; - color: #fff; - position: absolute; - left: 0; - bottom: 0; - padding: 5px 20px; - box-sizing: border-box; - } - } - } - .product_info { - padding: 20px; - .title { - font-size: $font_size; - color: $color_font_three; - @include common_ellipsis(); - } - .tag_list { - display: flex; - margin-top: 16px; - .tag { - padding: 3px 10px; - background-color: #cde5ff; - font-size: $font_size_min; - border-radius: 5px; - color: $color_main; - &:nth-child(2) { - margin-left: 10px; - } - } - } - .introduce { - font-size: $font_size_medium; - color: $color_font_two; - margin-top: 16px; - @include common_ellipsis(); - } - } - } - } -} diff --git a/src/pages/searchList/hightSearchList.tsx b/src/pages/searchList/hightSearchList.tsx deleted file mode 100644 index 0ba64ce..0000000 --- a/src/pages/searchList/hightSearchList.tsx +++ /dev/null @@ -1,221 +0,0 @@ -import { Image, ScrollView, Text, View } from '@tarojs/components' -import classnames from 'classnames' -import Filter from '@/components/filter' -import InfiniteScroll from '@/components/infiniteScroll' -import SortBtn from '@/components/sortBtn' -import SearchInput from '@/components/searchInput' -import LinkBlueTooth from '@/components/bluetooth/LinkBlueTooth' -import { useBluetooth } from '@/use/contextBlueTooth' -import { toRgb } from '@/common/bluetooth/color/colorSpace' -import styles from './hightSearchList.module.scss' -import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import Taro, { useDidShow, usePullDownRefresh, useReady } from '@tarojs/taro' -import { GetLabProductApi } from '@/api/material' -import { dataLoadingStatus, getFilterData } from '@/common/util' -import { formatHashTag, formatImgUrl } from '@/common/fotmat' -import useLogin from '@/use/useLogin' -import { goLink } from '@/common/common' -import SelectData, { ListProps } from './components/selectData' -import LabAndImg from '@/components/LabAndImg' - -export default () => { - useLogin() - - const firstOpen = useRef(true) - const [showFilter, setShowFilter] = useState(false) - //搜索参数 - const [searchField, setSearchField] = useState({ - l: '', - a: '', - b: '', - page: 1, - size: 10, - width: '', - weight_density: '', - product_kind_id: '', - component: '', - abstract_sort_key: '', - }) - - //获取面料列表 - const [materialList, setMaterialList] = useState<{ list: any[]; total: number }>({ list: [], total: 0 }) - const { fetchData: materialFetchData, state: materialState } = GetLabProductApi() - const getProductList = async () => { - let { data } = await materialFetchData(getFilterData(searchField)) - setMaterialList({ list: data.list, total: data.total }) - Taro.stopPullDownRefresh() - firstOpen.current = false - } - - //监听筛选条件变化 - useEffect(() => { - getProductList() - }, [searchField]) - - //上拉加载数据 - const pageNum = useRef({ size: searchField.size, page: searchField.page }) - const getScrolltolower = () => { - if (materialList.list.length < materialList.total) { - pageNum.current.page++ - const size = pageNum.current.size * pageNum.current.page - setSearchField({ ...searchField, size }) - } - } - - //数据加载状态 - const statusMore = useMemo(() => { - return dataLoadingStatus({ list: materialList.list, total: materialList.total, status: materialState.loading }) - }, [materialList, materialState]) - - const { state: colorState, measureAndGetLab } = useBluetooth() - const getLab = () => { - if (colorState.connected) { - measureAndGetLab() - } else { - Taro.showToast({ - title: '请链接设备', - icon: 'none', - }) - } - } - - //监听lab数据变化 - const [blueToothColor, setBlueToothColor] = useState('') - useEffect(() => { - if (colorState.deviceLab && !firstOpen.current) { - const rgb = toRgb([colorState.deviceLab.L, colorState.deviceLab.a, colorState.deviceLab.b]) - setBlueToothColor(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) - setSearchField({ ...searchField, l: rgb[0], a: rgb[1], b: rgb[2], size: 10, page: 1 }) - setMaterialList(() => ({ list: [], total: 0 })) - pageNum.current = { size: 10, page: 1 } - } - }, [colorState.deviceLab]) - - const goLinkPage = (item) => { - goLink('/pages/details/index', { id: item.product_id }) - } - - //获取筛选条件 - const getFiltr = (e) => { - pageNum.current.page = 1 - setMaterialList(() => ({ list: [], total: 0 })) - const { data } = e - setSearchField({ - ...searchField, - width: data?.width, - weight_density: data?.weight, - size: 10, - component: data?.element, - product_kind_id: data?.seriesId, - }) - formatSelectList(e) - } - - //筛选条件格式化 - const [selectList, setSelectList] = useState() - const formatSelectList = (val = { data: {}, field: {} }) => { - let data: ListProps[] = [] - for (let key in val.data) { - if (key !== 'seriesId' && val.data[key] != '') { - data.push({ title: val.field[key], value: val.data[key] }) - } - } - setSelectList([...data]) - } - - //页面下拉刷新 - usePullDownRefresh(() => { - setSearchField({ ...searchField, size: 10 }) - }) - - //排序 - type sortParam = 'none' | 'top' | 'bottom' - const sortComprehensiveRef = useRef(null) - const sortCollectionRef = useRef(null) - const [sortStatus, setSortStatus] = useState<{ comprehensive: sortParam; collection: sortParam }>({ - comprehensive: 'none', - collection: 'none', - }) - const changeSort = (val) => { - setMaterialList(() => ({ list: [], total: 0 })) - if (val == 1) { - const { status, value } = sortComprehensiveRef.current.changeSort() - setSortStatus((e) => ({ ...e, comprehensive: status, collection: 'none' })) - setSearchField((e) => ({ ...e, abstract_sort_key: value, size: 10, page: 1 })) - } else { - const { status, value } = sortCollectionRef.current.changeSort() - setSortStatus((e) => ({ ...e, collection: status, comprehensive: 'none' })) - setSearchField((e) => ({ ...e, abstract_sort_key: value, size: 10, page: 1 })) - } - pageNum.current = { size: 10, page: 1 } - } - - const labAndImgObj = useCallback( - (item) => { - const img = item ? item.texture_url.split(',')[0] : '' - return { lab: item.lab, rgb: item.rgb, texture_url: img } - }, - [materialList], - ) - return ( - - - - - - getLab()}> - {(blueToothColor && ) || ( - 请取色 - )} - - - - - - - changeSort(1)}> - 综合 - - - changeSort(2)}> - 收藏 - - - - - - - - setShowFilter(true)}> - 筛选 - - - - - - 搜索结果 ({materialList.total}条记录) - - - - {materialList.list.map((item) => { - return ( - goLinkPage(item)}> - - - {item.product_color_code} - - - {formatHashTag(item.product_code, item.product_name)} - {item.product_kind_name} - - - ) - })} - - - - - getFiltr(e)} onClose={() => setShowFilter(false)} /> - - ) -} diff --git a/src/pages/searchList/search.config.ts b/src/pages/searchList/search.config.ts deleted file mode 100644 index eac2247..0000000 --- a/src/pages/searchList/search.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '搜索', - enableShareAppMessage: true, -} diff --git a/src/pages/searchList/search.module.scss b/src/pages/searchList/search.module.scss deleted file mode 100644 index b539403..0000000 --- a/src/pages/searchList/search.module.scss +++ /dev/null @@ -1,78 +0,0 @@ -.main{ - position: relative; - .search{ - display: flex; - justify-content: space-between; - padding: 20px; - padding-bottom: 50px; - } - .up_search{ - color: $color_main; - font-size: $font_size; - position: absolute; - right: 20px; - } - .hot { - padding: 0 20px; - .hot_header { - width:100%; - display: flex; - justify-content: space-between; - font-size: $font_size_medium; - .hot_header_title { - font-size: $font_size; - color: $color_font_one; - font-weight: 700; - } - - } - - .list{ - display: flex; - font-size: $font_size_medium; - flex-wrap: wrap; - padding: 20px 0; - .item{ - margin-right: 20px; - margin-bottom: 20px; - padding: 10px 20px; - background-color: #F0F0F0; - color: $color_font_three; - border-radius: 50px; - } - } - } - .history { - padding: 0 20px; - .history_header { - width:100%; - display: flex; - // justify-content: space-between; - font-size: $font_size_medium; - .history_header_title { - font-size: $font_size; - color: $color_font_one; - font-weight: 700; - } - .miconfont{ - font-size: 40px; - color: $color_font_three; - margin-left: 20px; - } - } - .list{ - display: flex; - font-size: $font_size_medium; - flex-wrap: wrap; - padding: 20px 0; - .item{ - margin-right: 20px; - margin-bottom: 20px; - padding: 10px 20px; - background-color: #F0F0F0; - color: $color_font_three; - border-radius: 50px; - } - } - } -} \ No newline at end of file diff --git a/src/pages/searchList/search.tsx b/src/pages/searchList/search.tsx deleted file mode 100644 index a37cbbc..0000000 --- a/src/pages/searchList/search.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import { Text, View } from '@tarojs/components' -import Search from '@/components/search' -import { alert, goLink } from '@/common/common' -import classnames from 'classnames' -import styles from './search.module.scss' -import { useEffect, useRef, useState } from 'react' -import { GetHotSearchApi, GetSearchHistoryApi, AddSearchHistoryApi } from '@/api/search' -import { SCENE } from '@/common/constant' -import useLogin from '@/use/useLogin' -import Taro, { useDidShow, useShareAppMessage } from '@tarojs/taro' - -type searchDataParam = { search_key: '' } -export default () => { - useLogin() - - const [searchData, setSearchData] = useState<{ hotField: searchDataParam[]; historyField: searchDataParam[] }>({ - hotField: [], - historyField: [], - }) - - //获取热门搜索数据 - const { fetchData: hotFetchData } = GetHotSearchApi() - const getHotSearch = async () => { - let { data } = await hotFetchData({ page: 1, size: 10 }) - setSearchData((val) => ({ ...val, hotField: data.list })) - } - - //获取历史搜索数据 - const { fetchData: HistoryFetchData } = GetSearchHistoryApi() - const getSearchHistory = async () => { - let { data } = await HistoryFetchData({ page: 1, size: 10 }) - setSearchData((val) => ({ ...val, historyField: data.list })) - } - - useDidShow(() => { - getHotSearch() - getSearchHistory() - }) - - //添加搜索关键字 - const addSearchField = useRef({ key: '', screen: SCENE.SearchScene }) - const { fetchData: addFetchData } = AddSearchHistoryApi() - const addSearchHistory = async () => { - await addFetchData(addSearchField.current) - // goLink('/pages/searchList/searchList', {key: addSearchField.current.key}) - } - - //搜索事件, status = true 添加搜索, status = false 直接跳转 - const searchEvent = (e, status = true) => { - if (e == '') { - alert.error('请输入关键词') - return false - } - addSearchField.current.key = e - status && addSearchHistory() - Taro.navigateTo({ - url: `/pages/searchList/searchList?key=${addSearchField.current.key}`, - }) - } - - return ( - - - searchEvent(e)} /> - - goLink('/pages/searchList/hightSearchList')}> - 高级搜索 - - {searchData?.hotField.length > 0 && ( - - - 热门面料 - - - {searchData.hotField.map((item) => { - return ( - searchEvent(item.search_key, false)}> - {item.search_key} - - ) - })} - - - )} - {searchData?.historyField.length > 0 && ( - - - 历史搜索 - {/* */} - - - {searchData?.historyField?.map((item) => ( - searchEvent(item.search_key, false)}> - {item.search_key} - - ))} - - - )} - - ) -} diff --git a/src/pages/searchList/searchList.config.ts b/src/pages/searchList/searchList.config.ts deleted file mode 100644 index 34c8c61..0000000 --- a/src/pages/searchList/searchList.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - navigationBarTitleText: '搜索', - enablePullDownRefresh: true, - backgroundTextStyle: 'dark' -} diff --git a/src/pages/searchList/searchList.module.scss b/src/pages/searchList/searchList.module.scss deleted file mode 100644 index 1a82944..0000000 --- a/src/pages/searchList/searchList.module.scss +++ /dev/null @@ -1,198 +0,0 @@ -.main { - display: flex; - flex-direction: column; - height: 100vh; - background-color: #f8f8f8; - .search { - padding: 20px; - } - .filter { - .filter_all { - display: flex; - justify-content: space-between; - align-items: center; - padding: 20px 50px; - font-size: $font_size_medium; - color: $color_font_three; - .text_zh, - .text_sc { - color: $color_main; - display: flex; - align-items: center; - .sortIcon { - display: flex; - flex-direction: column; - position: relative; - .icon_one { - font-size: $font_size_medium; - position: absolute; - margin: auto; - top: 0; - } - } - } - .text_ss { - position: relative; - .miconfont { - font-size: 30px; - margin-left: 5px; - } - &::before { - content: ''; - width: 2px; - height: 32px; - background-color: #c2c2c2; - position: absolute; - top: 0; - left: -30px; - } - } - } - .filter_btn_con { - display: flex; - justify-content: space-between; - align-items: center; - height: 86px; - } - .filter_scroll { - flex: 1; - width: 0; - padding-left: 20px; - ::-webkit-scrollbar { - display: none; - width: 0; - height: 0; - color: transparent; - } - } - .filter_btn { - display: flex; - justify-content: space-between; - padding: 20px; - margin-right: 20px; - flex: 1; - view { - font-size: $font_size_medium; - background-color: #f0f0f0; - border-radius: 24px; - min-width: 126px; - height: 46.93px; - text-align: center; - line-height: 46.93px; - color: $color_font_three; - &:nth-last-child(n + 2) { - margin-right: 10px; - } - &:nth-last-child(1) { - margin-right: 30px; - } - } - .selected { - background-color: #ecf5ff; - border: 2px solid #cde5ff; - color: $color_main; - width: 122px; - height: 42.93px; - } - } - .filter_more { - font-size: $font_size_medium; - color: $color_font_three; - padding: 0 30px 0 20px; - position: relative; - height: 100%; - line-height: 86px; - &::before { - content: ''; - opacity: 1; - width: 30px; - height: 100%; - position: absolute; - left: -15px; - background-image: linear-gradient(to right, rgba(248, 248, 248, 0.3), rgba(248, 248, 248, 1) 60%); - // z-index: 99; - } - .miconfont { - font-size: 27px; - } - } - } - .list { - height: calc(100vh - 330px); - .list_num { - font-size: $font_size_min; - color: $color_font_two; - padding: 10px 38px; - border-bottom: 1px solid #e9e9e9; - } - - .scroll { - height: 100%; - padding-top: 3px; - } - .product_list { - padding: 38px; - display: grid; - grid-template-columns: 321px 321px; - justify-content: space-between; - .product_item { - width: 321px; - background-color: #fff; - border-radius: 20px; - margin-bottom: 20px; - box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1); - .product_img { - width: 100%; - height: 224px; - border-radius: 20px 20px 0px 0px; - position: relative; - image { - width: 100%; - height: 100%; - border-radius: 20px; - } - .color_num { - background: rgba(0, 0, 0, 0.5); - border-radius: 50px 0px 0px 0px; - font-size: $font_size_min; - color: #fff; - position: absolute; - right: 0; - bottom: 0; - padding: 5px 20px; - box-sizing: border-box; - } - } - } - .product_info { - padding: 20px; - .title { - font-size: $font_size; - color: $color_font_three; - @include common_ellipsis(); - } - .tag_list { - display: flex; - margin-top: 16px; - .tag { - padding: 3px 10px; - background-color: #cde5ff; - font-size: $font_size_min; - border-radius: 5px; - color: $color_main; - @include common_ellipsis(); - &:nth-child(2) { - margin-left: 10px; - } - } - } - .introduce { - font-size: $font_size_medium; - color: $color_font_two; - margin-top: 16px; - @include common_ellipsis(); - } - } - } - } -} diff --git a/src/pages/searchList/searchList.tsx b/src/pages/searchList/searchList.tsx deleted file mode 100644 index d9c39f6..0000000 --- a/src/pages/searchList/searchList.tsx +++ /dev/null @@ -1,199 +0,0 @@ -import { Image, ScrollView, Text, View } from '@tarojs/components' -import classnames from 'classnames' -import Search from '@/components/search' -import Filter from '@/components/filter' -import InfiniteScroll from '@/components/infiniteScroll' -import SortBtn from '@/components/sortBtn' -import SelectData, { ListProps } from './components/selectData' -import { goLink } from '@/common/common' -import styles from './searchList.module.scss' -import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import { GetProductListApi } from '@/api/material' -import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro' -import { formatHashTag, formatImgUrl } from '@/common/fotmat' -import { dataLoadingStatus, getFilterData } from '@/common/util' -import useLogin from '@/use/useLogin' -import LabAndImg from '@/components/LabAndImg' - -export default () => { - useLogin() - - const [showFilter, setShowFilter] = useState(false) - const router = useRouter() - - //搜索参数 - const [searchField, setSearchField] = useState({ - code_or_name: router.params.key, - page: 1, - size: 10, - width: '', - weight_density: '', - product_kind_id: '', - component: '', - abstract_sort_key: '', - }) - - //获取面料列表 - const [materialList, setMaterialList] = useState<{ list: any[]; total: number }>({ list: [], total: 0 }) - const { fetchData: materialFetchData, state: materialState } = GetProductListApi() - const getProductList = async () => { - let { data } = await materialFetchData(getFilterData(searchField)) - setMaterialList({ list: data.list, total: data.total }) - Taro.stopPullDownRefresh() - } - - //监听筛选条件变化 - useEffect(() => { - getProductList() - }, [searchField]) - - //上拉加载数据 - const pageNum = useRef({ size: searchField.size, page: searchField.page }) - const getScrolltolower = () => { - if (materialList.list.length < materialList.total) { - pageNum.current.page++ - const size = pageNum.current.size * pageNum.current.page - setSearchField({ ...searchField, size }) - } - } - - //数据加载状态 - const statusMore = useMemo(() => { - return dataLoadingStatus({ list: materialList.list, total: materialList.total, status: materialState.loading }) - }, [materialList, materialState]) - - //输入了搜索关键字 - const getSearchData = useCallback((e) => { - pageNum.current.page = 1 - setMaterialList(() => ({ list: [], total: 0 })) - setSearchField((val) => ({ ...val, code_or_name: e, size: 10 })) - pageNum.current = { size: 10, page: 1 } - }, []) - - const goLinkPage = (item) => { - goLink('/pages/details/index', { id: item.id }) - } - - //页面下拉刷新 - usePullDownRefresh(() => { - setSearchField({ ...searchField, size: 10 }) - }) - - //获取筛选条件 - const getFiltr = (e) => { - pageNum.current.page = 1 - setMaterialList(() => ({ list: [], total: 0 })) - const { data } = e - setSearchField({ - ...searchField, - width: data?.width, - weight_density: data?.weight, - size: 10, - component: data?.element, - product_kind_id: data?.seriesId, - }) - formatSelectList(e) - } - - //筛选条件格式化 - const [selectList, setSelectList] = useState() - const formatSelectList = (val = { data: {}, field: {} }) => { - let data: ListProps[] = [] - for (let key in val.data) { - if (key !== 'seriesId' && val.data[key] != '') { - data.push({ title: val.field[key], value: val.data[key] }) - } - } - setSelectList([...data]) - } - - //排序 - type sortParam = 'none' | 'top' | 'bottom' - const sortComprehensiveRef = useRef(null) - const sortCollectionRef = useRef(null) - const [sortStatus, setSortStatus] = useState<{ comprehensive: sortParam; collection: sortParam }>({ - comprehensive: 'none', - collection: 'none', - }) - const changeSort = (val) => { - if (val == 1) { - const { status, value } = sortComprehensiveRef.current.changeSort() - setSortStatus((e) => ({ ...e, comprehensive: status, collection: 'none' })) - setSearchField((e) => ({ ...e, abstract_sort_key: value, size: 10, page: 1 })) - } else { - const { status, value } = sortCollectionRef.current.changeSort() - setSortStatus((e) => ({ ...e, collection: status, comprehensive: 'none' })) - setSearchField((e) => ({ ...e, abstract_sort_key: value, size: 10, page: 1 })) - } - pageNum.current = { size: 10, page: 1 } - } - - const labAndImgObj = useCallback( - (item) => { - const img = item ? item.texture_url.split(',')[0] : '' - return { lab: item.lab, rgb: item.rgb, texture_url: img } - }, - [materialList], - ) - return ( - - - - - - - changeSort(1)}> - 综合 - - - changeSort(2)}> - 收藏 - - - goLink('/pages/searchList/hightSearchList')}> - 高级搜索 - - - - - - - - - setShowFilter(true)}> - 筛选 - - - - - - 搜索结果 ({materialList.total}条记录) - - - - {materialList.list.map((item) => { - return ( - goLinkPage(item)}> - - - {item.product_color_count}色 - - - {formatHashTag(item.code, item.name)} - - {item.width} - {item.weight_density} - - {item.component} - - - ) - })} - - - - - setShowFilter(false)} onFiltr={(e) => getFiltr(e)} /> - - ) -} diff --git a/src/pages/subjectList/components/filter/index.module.scss b/src/pages/subjectList/components/filter/index.module.scss deleted file mode 100644 index 599cdd0..0000000 --- a/src/pages/subjectList/components/filter/index.module.scss +++ /dev/null @@ -1,126 +0,0 @@ -.popup_main{ - width: 608px; - height: 100vh; - padding: 20px; - box-sizing: border-box; - display: flex; - flex-direction: column; - .popup_title{ - font-size: $font_size; - font-weight: 700; - text-align: center; - padding: 20px 0; - } - .scroll{ - flex:1; - height: 0; - } - .popup_filter{ - padding-bottom: 100px; - } - .popup_filter_item{ - margin-bottom: 20px; - .title{ - font-size: $font_size; - color: $color_font_one; - font-weight: 700; - padding: 20px 0; - } - .btn_list{ - display: grid; - grid-template-columns: repeat(3, 165.75px); - justify-content: space-between; - .btn_item{ - width: 165.75px; - height: 69.2px; - background: #f0f0f0; - border-radius: 34px; - text-align: center; - line-height: 69.2px; - font-size: $font_size_medium; - color: $color_font_one; - margin-bottom: 20px; - } - .select_btn_item{ - color: $color_main; - background: #ecf5ff; - border: 2px solid #007aff; - width: 161.75px; - height: 65.2px; - } - } - .btn_list_input{ - display: flex; - // justify-content: space-between; - align-items: center; - .btn_width { - width: 220px; - height: 70px; - background: #f0f0f0; - border-radius: 50px; - padding: 10px 20px; - box-sizing: border-box; - input{ - width: 100%; - height: 100%; - font-size: $font_size_medium; - } - } - .unit{ - color: $color_font_one; - font-size: $font_size; - margin-left: 20px; - } - text{ - color: #ccc; - padding: 0 20px; - } - .width_main{ - - } - } - .btn_list_element{ - background-color: #F0F0F0; - border-radius: 30px; - padding: 20px; - box-sizing: border-box; - textarea{ - width: 100%; - height: 126px; - font-size: $font_size_medium; - } - } - } - .btns_con{ - width: 100%; - position: fixed; - bottom:0; - padding-bottom: constant(safe-area-inset-bottom); - padding-bottom: env(safe-area-inset-bottom); - .btns_two{ - display: flex; - width: 552px; - height: 82px; - border: 2px solid #cde5ff; - font-size: $font_size_big; - border-radius: 40px; - margin-bottom: 20px; - .rest_btn{ - flex:1; - border-radius: 0px 40px 40px 0px; - text-align: center; - line-height: 82px; - color: $color_main; - - } - .verify_btn{ - flex:1; - border-radius: 0px 40px 40px 0px; - background: #007aff; - text-align: center; - line-height: 82px; - color: #fff; - } - } - } -} \ No newline at end of file diff --git a/src/pages/subjectList/components/filter/index.tsx b/src/pages/subjectList/components/filter/index.tsx deleted file mode 100644 index d64ab87..0000000 --- a/src/pages/subjectList/components/filter/index.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import Popup, {Params as PopuParams} from "@/components/popup" -import { Input, ScrollView, Text, Textarea, View } from "@tarojs/components" -import classnames from "classnames"; -import { useEffect, useState } from "react"; -import styles from './index.module.scss' - -type params = { - onFiltr?: (val:object) => void -} & PopuParams -export default ({onClose, onFiltr, show = false}:params) => { - const [filterObj, setFilterObj] = useState({ - series: '', - minWidth: '', - maxWidth: '', - minWeight: '', - maxWeight: '', - element: '' - - }) - const onCloseEven = () => { - onClose?.() - } - const onRest = () => { - console.log('12123') - setFilterObj({ - series: '', - minWidth: '', - maxWidth: '', - minWeight: '', - maxWeight: '', - element: '' - }) - } - useEffect(() => { - console.log(filterObj) - }, [filterObj]) - - const onVerify = () => { - console.log(filterObj) - onFiltr?.(filterObj) - } - - const setNumber = (e, field) => { - console.log(e) - let num = parseFloat(e.detail.value) - if(isNaN(num)) { - filterObj[field] = null - } else { - filterObj[field] = parseFloat(num.toFixed(2)) - } - setFilterObj({...filterObj}) - } - - const setElement = (e) => { - let res = e.detail.value - setFilterObj({...filterObj, element:res}) - } - return ( - - onCloseEven()} showIconButton={true}> - - 全部筛选 - - - - - 系列 - - 不限 - 不限 - 不限 - 不限 - 不限 - 不限 - - - - 幅宽 - - setNumber(e,'minWidth')} placeholder="自定义最低值" placeholderStyle="font-size: 26rpx"/> - - setNumber(e,'maxWidth')} placeholder="自定义最高值" placeholderStyle="font-size: 26rpx"/> - cm - - - - 克重 - - setNumber(e,'minWeight')} placeholder="自定义最低值" placeholderStyle="font-size: 26rpx"/> - - setNumber(e,'maxWeight')} placeholder="自定义最高值" placeholderStyle="font-size: 26rpx"/> - g - - - - 成分 - -