diff --git a/project.config.json b/project.config.json index 070713d..fc5ffc5 100644 --- a/project.config.json +++ b/project.config.json @@ -2,7 +2,7 @@ "miniprogramRoot": "dist/", "projectname": "EShop", "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "appid": "wx68d92d7cbf0b6963", + "appid": "wx714eaf2dfdb9c6bb", "setting": { "urlCheck": false, "es6": false, diff --git a/src/api/user.ts b/src/api/user.ts index b9c4912..4f4e86a 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -85,7 +85,8 @@ export const ApplyOrderAccessApi = () => { */ export const SubscriptionMessageApi = () => { return useRequest({ - url: '/v1/mall/subscriptionMessage', + // url: '/v1/mall/subscriptionMessage', + url: '/lymarket/v3/mallCherry/subscriptionMessage', method: 'get', }) } diff --git a/src/app.config.ts b/src/app.config.ts index 0f04496..88a74f8 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -248,5 +248,11 @@ export default { 'index', ], }, + { + root: 'pages/login', + pages: [ + 'index', + ], + }, ], } diff --git a/src/common/constant.ts b/src/common/constant.ts index 19f8db6..26695db 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -1,4 +1,4 @@ -export const BASE_URL = CURRENT_BASE_URL +// export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` @@ -12,7 +12,7 @@ export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = 'https://dev.zzfzyc.com/lymarket' // 开发环境 // export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境 // export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞 -// export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添 +export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添 // export const BASE_URL = 'http://192.168.1.28:50001/lymarket' // 婷 // export const BASE_URL = 'http://192.168.1.42:50002/lymarket' // 杰 @@ -39,7 +39,8 @@ export const getCDNSource = (suffix: string) => { export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}` // appid -export const WX_APPID = 'wx68d92d7cbf0b6963' +// export const WX_APPID = 'wx68d92d7cbf0b6963' +export const WX_APPID = 'wx714eaf2dfdb9c6bb' // 招商银行小程序appid export const BANk_WX_APPID = 'wx65934ee32a88d726' diff --git a/src/pages/login/index.config.ts b/src/pages/login/index.config.ts new file mode 100644 index 0000000..22aaa7e --- /dev/null +++ b/src/pages/login/index.config.ts @@ -0,0 +1,4 @@ +export default { + navigationBarTitleText: '登录', + enableShareAppMessage: true, +} diff --git a/src/pages/login/index.module.scss b/src/pages/login/index.module.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/user copy/index.config.ts b/src/pages/user copy/index.config.ts deleted file mode 100644 index 96b0f9a..0000000 --- a/src/pages/user copy/index.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - navigationBarTitleText: '我的', - navigationStyle: 'custom', - enableShareAppMessage: true, -} diff --git a/src/pages/user copy/index.module.scss b/src/pages/user copy/index.module.scss deleted file mode 100644 index cfeae30..0000000 --- a/src/pages/user copy/index.module.scss +++ /dev/null @@ -1,565 +0,0 @@ -.main { - background-color: #f8f8f8; - min-height: 100vh; - display: flex; - flex-direction: column; - position: relative; - - .header { - background: #68b4ff; - background-size: cover; - height: 560px; - position: relative; - - .card-main { - margin-top: 10px; - } - } - - .auth-suspension { - position: fixed; - left: 0; - top: 0; - z-index: 1; - width: 100vw; - height: 100vh; - inset: 0; - } - - .header-card { - position: absolute; - left: 50%; - bottom: -18%; - transform: translateX(-50%); - } - - .crad { - width: 702px; - background: rgba(255, 255, 255, 0.95); - border-radius: 20px; - padding: 30px; - box-sizing: border-box; - box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.05); - } - - .card-info { - display: flex; - justify-content: space-between; - position: absolute; - top: -15%; - left: 0; - right: 0; - width: 702px; - padding: 0 30px; - box-sizing: border-box; - } - - .arcd-info-left { - display: flex; - align-items: flex-end; - } - - .arcd-info-left-portrait { - width: 170px; - height: 170px; - background: rgba(0, 0, 0, 0); - border: 4px solid #ffffff; - border-radius: 50%; - overflow: hidden; - } - - .arcd-info-left-portrait image { - width: 100%; - height: 100%; - object-fit: cover; - } - - .arcd-info-left-desc { - margin-left: 24px; - } - - .arcd-info-left-nickname { - font-size: 44px; - font-weight: 700; - color: #000000; - display: flex; - align-items: center; - } - - .arcd-info-left-phone { - font-size: 24px; - font-weight: 400; - color: #707070; - } - - .arcd-info-left-phone button { - padding: 0 10px; - height: 42px; - background: #ffffff; - border: 2px solid #cde5ff; - border-radius: 20px; - font-size: 22px; - font-weight: 400; - color: $color_main; - display: flex; - align-items: center; - justify-content: center; - } - - .card-info-right { - font-size: 26px; - display: flex; - align-items: flex-end; - } - - .setup-icon { - position: relative; - padding-bottom: 10px; - } - - .icon-wrapper { - font-size: 60px; - } - - .icon-point { - width: 8px; - height: 8px; - border-radius: 50%; - background: #ff0000; - position: absolute; - right: 0; - top: 0; - } - - .card-main { - margin: 20px auto 0; - } - - .card-main-title { - display: flex; - justify-content: space-between; - align-items: center; - border-bottom: 2px solid #dddddd; - padding: 0 5px 15px; - box-sizing: border-box; - .card_main_title_order { - flex: 1; - font-size: 28px; - font-weight: 700; - } - .order_more { - display: flex; - justify-content: flex-end; - align-items: center; - font-size: 25px; - color: #707070; - text { - width: auto; - } - } - } - - .card-main-title text { - font-size: 22px; - font-weight: 400; - color: #ababab; - display: inline-block; - text-align: right; - width: 150px; - } - - .card-main-title-content { - display: grid; - grid-template-columns: repeat(5, 1fr); - } - - .card-main-title-content-item { - font-size: 24px; - font-weight: 400; - color: #3c3c3c; - text-align: center; - margin-top: 30px; - position: relative; - } - - .card-main-title-content-item Text { - font-size: 56px; - color: #3c3c3c; - } - - .card-main-title-content-item-badge { - padding: 0 10px; - height: 32px; - background: $color_main; - border: 2px solid #ffffff; - border-radius: 32px; - box-sizing: border-box; - overflow: hidden; - font-size: 18px; - font-weight: 700; - color: #ffffff; - display: flex; - align-items: center; - justify-content: center; - position: absolute; - top: -10px; - right: 0; - } - - .assets-title { - font-size: 28px; - font-weight: 700; - color: #3c3c3c; - margin-bottom: 20px; - } - - .assets-content { - display: grid; - grid-template-columns: repeat(2, 1fr); - } - - .assets-content > view, - .assets-content > navigator { - text-align: center; - } - - .assets-content-item-top { - color: $color_main; - font-weight: 400; - } - - .assets-content-item-top-before { - font-size: 20px; - } - - .assets-content-item-top-content { - font-size: 36px; - } - - .assets-content-item-top-after { - font-size: 20px; - } - - .assets-content-item-tips { - font-size: 24px; - font-weight: 400; - color: #707070; - } - - .main-card { - margin: 131px auto 0; - } - - .card-feature { - margin-bottom: 50px; - } - - .card-main-list-content-item { - display: flex; - align-items: center; - justify-content: space-between; - height: 90px; - position: relative; - } - - .card-main-list-content-item-left { - font-size: 26px; - font-weight: 400; - text-align: left; - color: #707070; - display: flex; - align-items: center; - min-width: 260px; - } - .card-main-list-content-item .label { - width: 100%; - text-align: right; - padding-right: 10px; - font-size: 26px; - } - .card-main-list-content-item-left text { - margin-right: 35px; - font-size: 56px; - color: #707070; - } - - .card-main-list-content-item-right text { - font-size: 30px; - } - .card-main-list-content-item .customer { - position: absolute; - opacity: 0; - width: 100%; - height: 100%; - } - - .auth { - margin-top: 115px; - } - - .auth-top { - display: flex; - align-items: center; - justify-content: space-between; - } - - .auth-status { - padding: 0 10px; - height: 30px; - background: #dddddd; - border-radius: 10px 4px 0px 0px; - display: flex; - align-items: center; - justify-content: center; - font-size: 18px; - font-weight: 400; - color: #707070; - } - - .auth-status, - .auth-status-ongoing { - color: #ee7500; - background-color: #ffe6ce; - } - - .auth-status, - .auth-status-adopt { - color: $color_main; - background-color: #cde5ff; - } - - .auth-tips { - font-size: 18px; - font-weight: 400; - color: $color_main; - text-align: right; - } - - .auth-tips, - .auth-tips-adopt { - color: #ababab; - } - - .auth-tips text { - font-size: 17px; - } - - .auth-company { - height: 70px; - width: 100%; - background: #f6f6f6; - border: 2px solid #f0f0f0; - border-radius: 0px 10px 10px 10px; - font-size: 26px; - font-weight: 700; - color: #707070; - display: flex; - align-items: center; - justify-content: center; - } - - .auth-company, - .auth-company-adopt { - background: #ecf5ff; - border: 2px solid #cde5ff; - } - - .tips-modal { - background: rgba(0, 0, 0, 0.6); - position: fixed; - inset: 0; - display: flex; - justify-content: center; - align-items: center; - z-index: 2; - } - - .tips-modal-content { - width: 598px; - background: #ffffff; - border-radius: 10px; - animation: enlargeK 0.2s linear; - overflow: hidden; - } - - @keyframes enlargeK { - 0% { - transform: scale(0); - } - - 100% { - transform: scale(1); - } - } - - .tips-modal-title { - font-size: 32px; - font-weight: 700; - text-align: center; - color: #000000; - margin-bottom: 58px; - padding-top: 48px; - } - - .tips-modal-letter { - font-size: 26px; - font-weight: 400; - color: #707070; - padding: 0 30px; - line-height: 50px; - } - - .tips-modal-letter-text { - text-indent: 60px; - } - - .tips-modal-letter-beginn { - font-size: 28px; - font-weight: 400; - color: #000000; - margin-bottom: 25px; - } - - .tips-modal-letter-end { - font-size: 26px; - font-weight: 400; - text-align: right; - margin-top: 61px; - } - - .tips-modal-button { - display: flex; - border-top: 1px solid #dddddd; - margin-top: 45px; - } - - .tips-modal-button button, - .tips-modal-button view { - display: flex; - align-items: center; - justify-content: center; - width: 50%; - height: 90px; - background-color: white; - } - - .tips-modal-button button { - font-size: 26px; - font-weight: 400; - color: #707070; - border-radius: 0; - border-right: 1px solid #dddddd; - } - - .tips-modal-button button::after { - border: 0; - border-radius: 0; - } - - .tips-modal-button view { - font-size: 26px; - font-weight: 400; - color: $color_main; - } - - .auth-box { - width: 614px; - height: 70px; - background: #f6f6f6; - border-radius: 10px; - display: flex; - align-items: center; - justify-content: space-between; - padding-left: 18px; - padding-right: 16px; - - .auth-left-box { - display: flex; - align-items: center; - - .auth-tag { - width: 86px; - height: 34px; - background: #dddddd; - border-radius: 10px; - font-size: 22px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - text-align: center; - color: #707070; - text-align: center; - line-height: 34px; - margin-right: 28px; - } - - .auth-tagone { - width: 86px; - height: 34px; - background: #ffe6ce; - border-radius: 10px; - font-size: 22px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - text-align: center; - color: #707070; - text-align: center; - line-height: 34px; - margin-right: 28px; - } - - .auth-tagtwo { - display: flex; - align-items: center; - overflow: hidden; - padding-left: 10px; - width: 100px; - height: 32px; - background: #cde5ff; - border-radius: 10px; - - .iconFont-color { - display: flex; - align-items: center; - font-size: 30px; - margin-right: 3px; - color: $color_main; - } - - .auth-font { - font-size: 20px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; - font-weight: 400; - color: $color_main; - } - } - - .tagthree { - display: flex; - align-items: center; - overflow: hidden; - padding-left: 10px; - width: 100px; - height: 32px; - background: rgba(255, 0, 0, 0.1); - border-radius: 10px; - color: #ff0000; - } - - .auth-cont { - margin-left: 16px; - font-size: 26px; - font-family: Microsoft YaHei, Microsoft YaHei-Bold; - font-weight: 700; - color: #ababab; - } - - .auth-contone { - margin-left: 16px; - font-size: 26px; - font-family: Microsoft YaHei, Microsoft YaHei-Bold; - font-weight: 700; - color: #3c3c3c; - } - } - } -} diff --git a/src/pages/user copy/index.tsx b/src/pages/user copy/index.tsx deleted file mode 100644 index e45bc45..0000000 --- a/src/pages/user copy/index.tsx +++ /dev/null @@ -1,366 +0,0 @@ -import { Button, Image, Navigator, Text, View } from '@tarojs/components' -import Taro, { useDidShow, useShareAppMessage } from '@tarojs/taro' -import { memo, useEffect, useMemo, useState } from 'react' -import classnames from 'classnames' -import styles from './index.module.scss' -import { useSelector } from '@/reducers/hooks' -import { alert, goLink } from '@/common/common' -import useLogin from '@/use/useLogin' -import { BASE_URL } from '@/common/constant' -import { userassets, userorderStatistics } from '@/api/mine' -import { formatImgUrl, formatPriceDiv } from '@/common/fotmat' -import { GetAdminUserInfoApi } from '@/api/user' - -// 提示弹窗 -const Modal = (props: any) => { - const { data } = props - const [modalShow, setModalShow] = useState(true) - const handleouter = () => {} - return ( - <> - {modalShow && ( - - e.stopPropagation()}> - 首次登录提醒 - - To: 万丰园纺织科技 - - 尊敬的老朋友,欢迎你使用小程序商城;由于您是我们长期合作的伙伴,你的组织已自动为你生成,关联后可查看历史订单哟。 - - 信息错误请联系客服 - - - - setModalShow(false)}>我知道 - - - - )} - - ) -} -const ModalWithMemo = memo(Modal) - -// 头部 | 订单 -const Header = (props: any) => { - const { data } = props - console.log(props, 'propsprops') - const menu = [ - { text: '待配布', icon: 'icon-daipeibu', url: '/pages/order/orderList/index?status=0' }, - { text: '待付款', icon: 'icon-daifukuan', url: '/pages/order/orderList/index?status=1' }, - { text: '待发货', icon: 'icon-daifahuo', url: '/pages/order/orderList/index?status=2' }, - { text: '待收货', icon: 'icon-yifahuo', url: '/pages/order/orderList/index?status=3' }, - { text: '退款/售后', icon: 'icon-a-tuikuanshouhou', url: '/pages/salesAfter/salesAfterList/index' }, - ] - const { getPhoneNumber } = useLogin() - const mGetPhoneNumber = (ev) => { - if (ev.detail?.code) { - getPhoneNumber(ev.detail.code) - } - else { - alert.none('绑定失败!') - } - } - const navTo = () => { - Taro.navigateTo({ - // url: '/pages/certification/index', - url: '/pages/userEdit/index', - }) - } - - return ( - - - - - - - - - - {/* {state.data.user_name} */} - {data?.user_name} - - - {data?.phone - ? ( - data?.phone?.replace(data?.phone?.substring(3, 7), '****') - ) - : ( - - )} - - - - - - - - - - - - {(data?.authentication_status == 0 || data?.authentication_status == 1) && data?.order_access_status == 3 && ( - navTo()}> - - 未认证 - {data?.company_name || '暂未加入或注册组织'} - - - - )} - {data?.authentication_status == 3 && data?.order_access_status == 3 && ( - navTo()}> - - 认证失败 - {data?.company_name || '暂未加入或注册组织'} - - - - )} - {data?.authentication_status == 2 && data?.order_access_status == 3 && ( - navTo()}> - - 认证中 - {data?.company_name || '暂未加入或注册组织'} - - - - )} - {data?.authentication_status == 4 && data?.order_access_status == 3 && ( - navTo()}> - - - - - - 已认证 - - {data?.company_name} - - - - )} - {/* - - 1 - {data?.authentication_status==1&&"未认证"} - {data?.authentication_status==2&&"认证中"} - {data?.authentication_status==3&&"认证不通过"} - {data?.authentication_status==4&&"已认证"} - - {data?.authentication_status==1&&认证通过后,解锁更多权限 } - {data?.authentication_status==2&&1-3个工作日,审核完成 } - {data?.authentication_status==3&&重新认证 } - {data?.authentication_status==4&&认证通过,可以下单啦 } - */} - {/* - {data?.authentication_status==1&&"暂未加入或注册组织"} - {data?.authentication_status==2&&data?.company_name} - {data?.authentication_status==3&&data?.company_name} - {data?.authentication_status==4&&data?.company_name} - */} - - - - 订单 - goLink('/pages/order/orderList/index')}> - 全部 - - - - {menu.map((item, index) => { - return ( - - - {item.text} - {index == 0 && props.MenuData.data.wait_match !== 0 && ( - - {props.MenuData.data.wait_match > 99 ? '99+' : props.MenuData.data.wait_match} - - )} - {index == 1 && props.MenuData.data.wait_pay !== 0 && ( - - {props.MenuData.data.wait_pay > 99 ? '99+' : props.MenuData.data.wait_pay} - - )} - {index == 2 && props.MenuData.data.wait_shipped !== 0 && ( - - {props.MenuData.data.wait_shipped > 99 ? '99+' : props.MenuData.data.wait_shipped} - - )} - {index == 3 && props.MenuData.data.already_shipped !== 0 && ( - - {props.MenuData.data.already_shipped > 99 ? '99+' : props.MenuData.data.already_shipped} - - )} - {index == 4 && props.MenuData.data.after_return !== 0 && ( - - {props.MenuData.data.after_return > 99 ? '99+' : props.MenuData.data.after_return} - - )} - - ) - })} - - - - - ) -} -const HeaderWithMemo = memo(Header) -// 我的资产 -const Assets = (props: any) => { - return ( - <> - {(props?.userInfo?.order_access_status == 3 && ( - - 我的资产 - - - - ¥ - {formatPriceDiv(props.data.data.wallet_money || 0, 100, true)} - {/* {props.wallet_money || 0} */} - - 预存款 - - {/* - - {props.data.data.coupon_count || 0} - - - 优惠券 - */} - props.checkShow()}> - - ¥ - {formatPriceDiv(props.data.data.credit_line || 0, 100, true)} - {/* .-00 */} - - 授信额度 - - - - )) || } - - ) -} - -// 功能 -const Main = () => { - const menu = [ - { text: '我的客服', icon: 'icon-wodekefu', type: 'customer', label: '(0757) 8270 6695' }, - { text: '地址管理', icon: 'icon-daohang', url: '/pages/addressManager/index', type: 'url' }, - { text: '码单管理', icon: 'icon-a-yuanmadanmadanguanli', url: '/pages/weightList/index', type: 'url' }, - { text: '我的收藏', icon: 'icon-shoucang', url: '/pages/collection/index', type: 'url' }, - { text: '颜色对比', icon: 'icon-yanseduibi', url: '/pages/sampleComparison/index', type: 'url' }, - // { text: "分享推广", icon: "icon-fenxiang" }, - { text: '邀请码', icon: 'icon-yaoqingma', url: '/pages/bindSalesman/index', type: 'url' }, - ] - const navigation = (item) => { - if (item.type === 'url') { goLink(item.url) } - } - return ( - - - {menu.map((item, index) => { - return ( - navigation(item)} key={index} className={styles['card-main-list-content-item']}> - - - {item.text} - - {item.label} - - - - {item.type === 'customer' && } - - ) - })} - - - ) -} -const MainWithMemo = memo(Main) -const User = () => { - // 用户信息 - const { getSelfUserInfo, getAdminUserInfo } = useLogin() - const { adminUserInfo } = useSelector(state => state.userInfo) - - const [current_version, setCurrent_version] = useState(CURRENT_VERSION) - const [current_githash, setCurrent_githash] = useState(CURRENT_GITHASH) - const [current_env, setCurrent_env] = useState(CURRENT_ENV) - - const handleAuth = async() => { - console.log('授权面版') - if (adminUserInfo?.is_authorize_name) { return false } - getSelfUserInfo() - .then() - .catch(() => { - alert.none('授权失败,请授权后再使用') - }) - } - const { fetchData: Apiassets, state } = userassets() - const { fetchData: ApigetTotal, state: stateData } = userorderStatistics() - - useDidShow(() => { - ApigetTotal() - getAdminUserInfo() - Apiassets() - }) - - // 临时注释 - // const checkGo = async () => { - // if (adminUserInfo?.authentication_status !== 4) { - // let res = await Taro.showModal({ - // title: '提示', - // content: '你暂未开通授信,目前仅支持线下申请,开通后可使用账期采购。', - // cancelText: '稍后认证', - // confirmText: '联系客服', - // }) - // if (res.confirm) { - // Taro.showModal({ - // content: '联系电话:0757-8270 6695', - // cancelText: '取消', - // confirmText: '拨打', - // success: function (res) { - // if (res.confirm) { - // Taro.makePhoneCall({ - // phoneNumber: '(0757)82706695', - // }) - // } - // }, - // }) - // } - // } else { - // Taro.navigateTo({ - // url: '/pages/creditLine/index', - // }) - // } - // } - const checkGo = async() => { - Taro.navigateTo({ - url: '/pages/creditLine/index', - }) - } - - return ( - - - checkGo()} userInfo={adminUserInfo} /> - - {/* {(adminUserInfo as any)?.authentication_status==1&&} */} - {/* 测试暂时添加 */} - {current_version} - {current_env === 'development' && {BASE_URL}} - {!adminUserInfo?.is_authorize_name && } - - ) -} -export default User diff --git a/src/styles/image/lgo@2x.png b/src/styles/image/lgo@2x.png new file mode 100644 index 0000000..33e3dfe Binary files /dev/null and b/src/styles/image/lgo@2x.png differ diff --git a/src/styles/image/name.png b/src/styles/image/name.png new file mode 100644 index 0000000..519d09b Binary files /dev/null and b/src/styles/image/name.png differ diff --git a/src/use/useHttp.ts b/src/use/useHttp.ts index 520b7ac..f3a6b63 100644 --- a/src/use/useHttp.ts +++ b/src/use/useHttp.ts @@ -147,7 +147,8 @@ export const useRequest = ( ...options, ...{ header: { - Platform: 6, + // Platform: 6, + Platform: 9, Appid: WX_APPID, Authorization: token || stateRef.current.token, }, diff --git a/src/use/useLoginRequest.ts b/src/use/useLoginRequest.ts index 13e82f1..2679014 100644 --- a/src/use/useLoginRequest.ts +++ b/src/use/useLoginRequest.ts @@ -25,7 +25,8 @@ export default () => { const q = { url: `${BASE_URL}/v1/mall/login`, header: { - Platform: 6, + // Platform: 6, + Platform: 9, Appid: WX_APPID, }, method: 'post',