diff --git a/src/boost/pages/detail/index.js b/src/boost/pages/detail/index.js index b5940c345..eeba4ec6c 100644 --- a/src/boost/pages/detail/index.js +++ b/src/boost/pages/detail/index.js @@ -23,7 +23,7 @@ import './index.scss' }) ) export default class Detail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) this.state = { diff --git a/src/boost/pages/flop/index.js b/src/boost/pages/flop/index.js index ff66c9702..3d92692d0 100644 --- a/src/boost/pages/flop/index.js +++ b/src/boost/pages/flop/index.js @@ -17,7 +17,7 @@ import './index.scss' memberData: user.userInfo })) export default class Flop extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/boost/pages/pay/index.js b/src/boost/pages/pay/index.js index 51ce918e7..ae7c4e7da 100644 --- a/src/boost/pages/pay/index.js +++ b/src/boost/pages/pay/index.js @@ -23,7 +23,7 @@ import './index.scss' }) ) export default class Pay extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) this.state = { diff --git a/src/boost/pages/payDetail/index.js b/src/boost/pages/payDetail/index.js index ab12ef9a4..2caae23cb 100644 --- a/src/boost/pages/payDetail/index.js +++ b/src/boost/pages/payDetail/index.js @@ -13,7 +13,7 @@ import { SpNavBar } from '@/components' import './index.scss' export default class PayDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/components/sp-cashier/index.js b/src/components/sp-cashier/index.js index 5325d37d9..604c876d3 100644 --- a/src/components/sp-cashier/index.js +++ b/src/components/sp-cashier/index.js @@ -49,7 +49,7 @@ function SpCashier(props) { salesman = false, isPurchase = false } = props - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { userInfo } = useSelector((state) => state.user) const { customerLnformation } = useSelector((state) => state.cart) const [state, setState] = useImmer(initialState) diff --git a/src/components/sp-chat/index.js b/src/components/sp-chat/index.js index 7387e2952..f9a05533a 100644 --- a/src/components/sp-chat/index.js +++ b/src/components/sp-chat/index.js @@ -22,7 +22,7 @@ function SpChat(props) { const [state, setState] = useImmer(initialState) const { isWeAppKefu } = state const { echat, meiqia } = useSelector((state) => state.sys) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} useEffect(() => { init() diff --git a/src/components/sp-deliver/index.js b/src/components/sp-deliver/index.js index 68eeef320..d52200fee 100644 --- a/src/components/sp-deliver/index.js +++ b/src/components/sp-deliver/index.js @@ -91,7 +91,7 @@ function SpDeliver(props, ref) { activeTimeIdMerchant } = state const formRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { cart_type } = $instance?.router?.params || {} // useEffect(() => { // fetch() diff --git a/src/components/sp-login/index.h5.js b/src/components/sp-login/index.h5.js index 643170803..2d44bde88 100644 --- a/src/components/sp-login/index.h5.js +++ b/src/components/sp-login/index.h5.js @@ -23,7 +23,7 @@ function SpLogin(props) { updateAddress() } }) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} /** * */ diff --git a/src/components/tab-bar/index.js b/src/components/tab-bar/index.js index 0362250b8..29ea0703b 100644 --- a/src/components/tab-bar/index.js +++ b/src/components/tab-bar/index.js @@ -15,7 +15,7 @@ const defaultTabList = [] // cartCount: cart.cartCount // })) export default class TabBar extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/hooks/themeColor.js b/src/hooks/themeColor.js index aad412b16..fea564532 100644 --- a/src/hooks/themeColor.js +++ b/src/hooks/themeColor.js @@ -10,7 +10,7 @@ function useThemsColor() { const sys = useSelector((state) => state.sys) const { colorPrimary, colorMarketing, colorAccent, rgb } = sys - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const themeColor = () => { const { page, router } = $instance diff --git a/src/hooks/useDianWuLogin.js b/src/hooks/useDianWuLogin.js index f8ade3d71..7e2f444ea 100644 --- a/src/hooks/useDianWuLogin.js +++ b/src/hooks/useDianWuLogin.js @@ -13,7 +13,7 @@ import S from '@/spx' import { SG_DIANWU_TOKEN } from '@/consts/localstorage' export default (props = {}) => { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} useEffect(() => { const { token } = $instance?.router?.params || {} diff --git a/src/hooks/useLogin.js b/src/hooks/useLogin.js index 337c19ac3..2659255fd 100644 --- a/src/hooks/useLogin.js +++ b/src/hooks/useLogin.js @@ -29,7 +29,7 @@ export default (props = {}) => { const dispatch = useDispatch() const { userInfo, isNewUser } = useSelector((state) => state.user) const { invite_code } = useSelector((state) => state.purchase) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} // const policyTime = useRef(0) useEffect(() => { diff --git a/src/hooks/useNavigation.js b/src/hooks/useNavigation.js index e8a2b91a9..bbc05e583 100644 --- a/src/hooks/useNavigation.js +++ b/src/hooks/useNavigation.js @@ -15,10 +15,10 @@ export default (props = {}) => { }) } - const { page } = getCurrentInstance() + const { page } = getCurrentInstance() || {} const allPages = Taro.getCurrentPages() - console.log('allPages:', allPages) - page.config['navigationBarTitleText'] = title + console.log('allPages:', allPages,page) + page && (page.config.navigationBarTitleText = title) } return { diff --git a/src/hooks/usePayment.js b/src/hooks/usePayment.js index 78e9e7f63..8e3204c70 100644 --- a/src/hooks/usePayment.js +++ b/src/hooks/usePayment.js @@ -24,7 +24,7 @@ export default (props = {}) => { // const [state, setState] = useImmer(initialState) // const { params, orderInfo } = state const cashierResultUrl = `/pages/cart/cashier-result` - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const currentPath = $instance?.router?.path const router = useRouter() const callbackRef = useRef() @@ -188,7 +188,7 @@ export default (props = {}) => { // 微信H5 JSDK const wxpayjsPay = async (params, orderInfo) => { - // const $instance = getCurrentInstance() + // const $instance = getCurrentInstance() || {} const { order_id, code } = router?.params if (!code) { // 微信客户端code授权 diff --git a/src/marketing/pages/distribution/good-category.js b/src/marketing/pages/distribution/good-category.js index 3c896c470..20c3ded33 100644 --- a/src/marketing/pages/distribution/good-category.js +++ b/src/marketing/pages/distribution/good-category.js @@ -16,7 +16,7 @@ import './shop-category.scss' @withPager @withBackToTop export default class DistributionShopCategory extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} spPageRef = React.createRef() constructor(props) { super(props) diff --git a/src/marketing/pages/distribution/goods.js b/src/marketing/pages/distribution/goods.js index 3a1f180bb..a6f514f95 100644 --- a/src/marketing/pages/distribution/goods.js +++ b/src/marketing/pages/distribution/goods.js @@ -19,7 +19,7 @@ import './goods.scss' @withPager @withBackToTop export default class DistributionGoods extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} spPageRef = React.createRef() constructor(props) { super(props) diff --git a/src/marketing/pages/distribution/qrcode.js b/src/marketing/pages/distribution/qrcode.js index 0441f3884..c2adf838d 100644 --- a/src/marketing/pages/distribution/qrcode.js +++ b/src/marketing/pages/distribution/qrcode.js @@ -16,7 +16,7 @@ import './qrcode.scss' colors: colors.current })) export default class DistributionQrcode extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/distribution/shop-category.js b/src/marketing/pages/distribution/shop-category.js index 6136a616b..82c66598a 100644 --- a/src/marketing/pages/distribution/shop-category.js +++ b/src/marketing/pages/distribution/shop-category.js @@ -17,7 +17,7 @@ import './shop-category.scss' @withPager @withBackToTop export default class DistributionShopCategory extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/distribution/shop-form.js b/src/marketing/pages/distribution/shop-form.js index 69bfb3b82..67b434798 100644 --- a/src/marketing/pages/distribution/shop-form.js +++ b/src/marketing/pages/distribution/shop-form.js @@ -15,7 +15,7 @@ import api from '@/api' import './shop-form.scss' export default class DistributionShopForm extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/distribution/shop-goods.js b/src/marketing/pages/distribution/shop-goods.js index cda7b3735..b9223d9f2 100644 --- a/src/marketing/pages/distribution/shop-goods.js +++ b/src/marketing/pages/distribution/shop-goods.js @@ -16,7 +16,7 @@ import './shop-goods.scss' @withPager @withBackToTop export default class DistributionShopGoods extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/distribution/shop-home.js b/src/marketing/pages/distribution/shop-home.js index c127075d0..8b5a689c6 100644 --- a/src/marketing/pages/distribution/shop-home.js +++ b/src/marketing/pages/distribution/shop-home.js @@ -20,7 +20,7 @@ import './shop-home.scss' @withPager export default class DistributionShopHome extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/distribution/shop.js b/src/marketing/pages/distribution/shop.js index 727405bb1..1ff7aafd4 100644 --- a/src/marketing/pages/distribution/shop.js +++ b/src/marketing/pages/distribution/shop.js @@ -17,7 +17,7 @@ import './shop.scss' colors: colors.current })) export default class DistributionShop extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/distribution/trade.js b/src/marketing/pages/distribution/trade.js index 4b4ca6f60..b2459a5a1 100644 --- a/src/marketing/pages/distribution/trade.js +++ b/src/marketing/pages/distribution/trade.js @@ -16,7 +16,7 @@ import './trade.scss' @withPager @withBackToTop export default class DistributionTrade extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/item/espier-evaluation-detail.js b/src/marketing/pages/item/espier-evaluation-detail.js index b0848b81c..6849c78e0 100644 --- a/src/marketing/pages/item/espier-evaluation-detail.js +++ b/src/marketing/pages/item/espier-evaluation-detail.js @@ -23,7 +23,7 @@ import './espier-evaluation.scss' ) @withPager export default class EvaluationDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} static options = { addGlobalClass: true } diff --git a/src/marketing/pages/item/espier-evaluation.js b/src/marketing/pages/item/espier-evaluation.js index 6fc3482e7..97224dfa0 100644 --- a/src/marketing/pages/item/espier-evaluation.js +++ b/src/marketing/pages/item/espier-evaluation.js @@ -23,7 +23,7 @@ import './espier-evaluation.scss' @withPager @withBackToTop export default class Evaluation extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} static options = { addGlobalClass: true } diff --git a/src/marketing/pages/item/group-detail.js b/src/marketing/pages/item/group-detail.js index 1c3a35676..4df9e182d 100644 --- a/src/marketing/pages/item/group-detail.js +++ b/src/marketing/pages/item/group-detail.js @@ -17,7 +17,7 @@ import { getDtidIdUrl } from '@/utils/helper' import './group-detail.scss' export default class GroupDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/item/rate.js b/src/marketing/pages/item/rate.js index 1e8f347a7..675284da2 100644 --- a/src/marketing/pages/item/rate.js +++ b/src/marketing/pages/item/rate.js @@ -22,7 +22,7 @@ import './rate.scss' () => ({}) ) export default class TradeRate extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/item/seckill-goods-list.js b/src/marketing/pages/item/seckill-goods-list.js index b186fea60..d2ba05c74 100644 --- a/src/marketing/pages/item/seckill-goods-list.js +++ b/src/marketing/pages/item/seckill-goods-list.js @@ -20,7 +20,7 @@ import './seckill-goods-list.scss' @withPager @withBackToTop export default class SeckillGoodsList extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/member/activity-detail-old.js b/src/marketing/pages/member/activity-detail-old.js index e6d013285..0cc63628a 100644 --- a/src/marketing/pages/member/activity-detail-old.js +++ b/src/marketing/pages/member/activity-detail-old.js @@ -26,7 +26,7 @@ import './activity-detail.scss' colors: colors.current })) export default class ActivityDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/member/address.js b/src/marketing/pages/member/address.js index 3147a6e32..6671276df 100644 --- a/src/marketing/pages/member/address.js +++ b/src/marketing/pages/member/address.js @@ -24,7 +24,7 @@ const initialState = { } function AddressIndex(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const colors = useSelector((state) => state.sys) const { address } = useSelector((state) => state.user) diff --git a/src/marketing/pages/member/coupon-detail.js b/src/marketing/pages/member/coupon-detail.js index 8132ee9fd..09b3e6681 100644 --- a/src/marketing/pages/member/coupon-detail.js +++ b/src/marketing/pages/member/coupon-detail.js @@ -15,7 +15,7 @@ import './coupon-detail.scss' colors: colors.current })) export default class CouponDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/member/destroy-member.js b/src/marketing/pages/member/destroy-member.js index 18a5e18fe..159dbb018 100644 --- a/src/marketing/pages/member/destroy-member.js +++ b/src/marketing/pages/member/destroy-member.js @@ -18,7 +18,7 @@ const { store } = configStore() colors: colors.current })) export default class SettingIndex extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) this.state = { diff --git a/src/marketing/pages/member/edit-address.js b/src/marketing/pages/member/edit-address.js index 32e76fe7b..d1a1b6f2a 100644 --- a/src/marketing/pages/member/edit-address.js +++ b/src/marketing/pages/member/edit-address.js @@ -27,7 +27,7 @@ const initialState = { } function AddressIndex(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const colors = useSelector((state) => state.colors.current) const dispatch = useDispatch() diff --git a/src/marketing/pages/member/shopping-guide-card.js b/src/marketing/pages/member/shopping-guide-card.js index c65cfc8d4..e89822158 100644 --- a/src/marketing/pages/member/shopping-guide-card.js +++ b/src/marketing/pages/member/shopping-guide-card.js @@ -14,7 +14,7 @@ import { normalizeQuerys } from '@/utils' import './shopping-guide-card.scss' export default class ShoppingGuideCard extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/member/user-info.js b/src/marketing/pages/member/user-info.js index c1c2c6efc..1902243f3 100644 --- a/src/marketing/pages/member/user-info.js +++ b/src/marketing/pages/member/user-info.js @@ -31,7 +31,7 @@ const isWeapp = Taro.getEnv() === Taro.ENV_TYPE.WEAPP () => ({}) ) export default class Reg extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/plusprice/cart-plusprice-list.js b/src/marketing/pages/plusprice/cart-plusprice-list.js index 0ff05146b..7afbce01e 100644 --- a/src/marketing/pages/plusprice/cart-plusprice-list.js +++ b/src/marketing/pages/plusprice/cart-plusprice-list.js @@ -20,7 +20,7 @@ import './plusprice.scss' @withPager @withBackToTop export default class DetailPluspriceList extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/plusprice/detail-plusprice-list.js b/src/marketing/pages/plusprice/detail-plusprice-list.js index 0f44753b4..1ba06a9dd 100644 --- a/src/marketing/pages/plusprice/detail-plusprice-list.js +++ b/src/marketing/pages/plusprice/detail-plusprice-list.js @@ -21,7 +21,7 @@ import './plusprice.scss' @withPager @withBackToTop export default class DetailPluspriceList extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/reservation/goods-reservate-old.js b/src/marketing/pages/reservation/goods-reservate-old.js index 74ce74967..a25b68d7b 100644 --- a/src/marketing/pages/reservation/goods-reservate-old.js +++ b/src/marketing/pages/reservation/goods-reservate-old.js @@ -22,7 +22,7 @@ import './goods-reservate.scss' @withPager @withBackToTop export default class GoodsReservate extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/marketing/pages/reservation/goods-reservate.js b/src/marketing/pages/reservation/goods-reservate.js index 2d065dc93..03f7cd8f1 100644 --- a/src/marketing/pages/reservation/goods-reservate.js +++ b/src/marketing/pages/reservation/goods-reservate.js @@ -46,7 +46,7 @@ const initialState = { } function GoodReservate(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const colors = useSelector((state) => state.colors.current) const dispatch = useDispatch() diff --git a/src/others/pages/auth/index.js b/src/others/pages/auth/index.js index bee25d5c8..dd1e8d06e 100644 --- a/src/others/pages/auth/index.js +++ b/src/others/pages/auth/index.js @@ -13,7 +13,7 @@ import { normalizeQuerys, getAppId } from '@/utils' import './index.scss' export default class AuthLogin extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) this.state = { diff --git a/src/others/pages/cart/coupon-picker.js b/src/others/pages/cart/coupon-picker.js index 0afed0af8..ec1662c5c 100644 --- a/src/others/pages/cart/coupon-picker.js +++ b/src/others/pages/cart/coupon-picker.js @@ -23,7 +23,7 @@ import './coupon-picker.scss' ) @withPager export default class CouponPicker extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) this.state = { diff --git a/src/others/pages/recharge/history.js b/src/others/pages/recharge/history.js index 6dcc03786..a529f2aa3 100644 --- a/src/others/pages/recharge/history.js +++ b/src/others/pages/recharge/history.js @@ -17,7 +17,7 @@ import './history.scss' colors: colors.current })) export default class History extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) this.state = { diff --git a/src/pages/article/index.js b/src/pages/article/index.js index a34ce5400..df244697c 100644 --- a/src/pages/article/index.js +++ b/src/pages/article/index.js @@ -12,7 +12,7 @@ import { formatTime } from '@/utils' import './index.scss' export default class ArticleIndex extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/pages/cart/add-personnel.js b/src/pages/cart/add-personnel.js index 796253d17..ac337197a 100644 --- a/src/pages/cart/add-personnel.js +++ b/src/pages/cart/add-personnel.js @@ -29,7 +29,7 @@ const initialState = { } function AddPersonnel() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { setNavigationBarTitle } = useNavigation() diff --git a/src/pages/cart/cashier-result.js b/src/pages/cart/cashier-result.js index 9bbd95f93..8ccd849b8 100644 --- a/src/pages/cart/cashier-result.js +++ b/src/pages/cart/cashier-result.js @@ -22,7 +22,7 @@ const initialState = { } function CashierResult(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { cashierPayment } = usePayment() const [state, setState] = useImmer(initialState) diff --git a/src/pages/cart/cashier-weapp.js b/src/pages/cart/cashier-weapp.js index f744cc267..a62d467db 100644 --- a/src/pages/cart/cashier-weapp.js +++ b/src/pages/cart/cashier-weapp.js @@ -24,7 +24,7 @@ const initialState = { orderInfo: {} } function CashierWeApp(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} // const { params, orderInfo } = $instance?.router?.params // const _params = JSON.parse(decodeURIComponent(params)) // const _orderInfo = JSON.parse(decodeURIComponent(orderInfo)) diff --git a/src/pages/cart/comps/comp-deliver.js b/src/pages/cart/comps/comp-deliver.js index dc84c6933..1b37d9dde 100644 --- a/src/pages/cart/comps/comp-deliver.js +++ b/src/pages/cart/comps/comp-deliver.js @@ -89,7 +89,7 @@ function CompDeliver(props, ref) { activeTimeIdMerchant } = state const formRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { cart_type } = $instance?.router?.params || {} // useEffect(() => { // fetch() diff --git a/src/pages/cart/comps/deliver.js b/src/pages/cart/comps/deliver.js index 45be9b780..0b17ffdc4 100644 --- a/src/pages/cart/comps/deliver.js +++ b/src/pages/cart/comps/deliver.js @@ -15,7 +15,7 @@ import './deliver.scss' colors: colors.current })) export default class Deliver extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} static defaultProps = { list: [], curStore: {}, diff --git a/src/pages/cart/espier-checkout.js b/src/pages/cart/espier-checkout.js index 262b84b79..13823480f 100644 --- a/src/pages/cart/espier-checkout.js +++ b/src/pages/cart/espier-checkout.js @@ -58,7 +58,7 @@ import CompPointUse from './comps/comp-pointuse' import './espier-checkout.scss' function CartCheckout(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { updateAddress } = useLocation() const { isLogin, getUserInfoAuth } = useLogin({ autoLogin: true, diff --git a/src/pages/cart/espier-index.js b/src/pages/cart/espier-index.js index 8df46200d..09bfc85d7 100644 --- a/src/pages/cart/espier-index.js +++ b/src/pages/cart/espier-index.js @@ -58,7 +58,7 @@ function CartIndex() { }) const dispatch = useDispatch() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const router = $instance?.router const [state, setState] = useImmer(initialState) diff --git a/src/pages/cart/offline-transfer.js b/src/pages/cart/offline-transfer.js index d42d95858..06613c9e4 100644 --- a/src/pages/cart/offline-transfer.js +++ b/src/pages/cart/offline-transfer.js @@ -37,7 +37,7 @@ const initialState = { } function OfflineTransfer() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const colors = useSelector((_state) => _state.colors.current) const { params } = useRouter() diff --git a/src/pages/category/comps/comps-category-addCart.js b/src/pages/category/comps/comps-category-addCart.js index e90ae8a24..5c0c7d14a 100644 --- a/src/pages/category/comps/comps-category-addCart.js +++ b/src/pages/category/comps/comps-category-addCart.js @@ -43,7 +43,7 @@ const initialState = { } function CompsCategoryAddCart(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) // const { purchase_share_info = {} } = useSelector((state) => state.purchase) const { diff --git a/src/pages/chat/index.js b/src/pages/chat/index.js index 1211efe16..fdc871377 100644 --- a/src/pages/chat/index.js +++ b/src/pages/chat/index.js @@ -10,7 +10,7 @@ import { SpPage } from '@/components' import './index.scss' function ChatIndex(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { url } = $instance?.router?.params const webviewSrc = decodeURIComponent(url) diff --git a/src/pages/custom/custom-page.js b/src/pages/custom/custom-page.js index 2cc126769..43f328507 100644 --- a/src/pages/custom/custom-page.js +++ b/src/pages/custom/custom-page.js @@ -34,7 +34,7 @@ const initialState = { footerHeight: 0 } function CustomPage(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { wgts, loading, shareInfo, skuPanelOpen, selectType, info, isShowTabBar } = state const MSpSkuSelect = React.memo(SpSkuSelect) diff --git a/src/pages/home/landing.js b/src/pages/home/landing.js index 817340b7a..8c4889256 100644 --- a/src/pages/home/landing.js +++ b/src/pages/home/landing.js @@ -17,7 +17,7 @@ import './landing.scss' }) ) export default class Landing extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/pages/home/wgts/couponcard/index.jsx b/src/pages/home/wgts/couponcard/index.jsx index 8643058c0..3642db21d 100644 --- a/src/pages/home/wgts/couponcard/index.jsx +++ b/src/pages/home/wgts/couponcard/index.jsx @@ -17,7 +17,7 @@ import doc from '@/doc' import { getGlobalBaseStyle } from '../helper' import './index.scss' -const $instance = getCurrentInstance() +const $instance = getCurrentInstance() || {} function WgtCouponCard(props) { const [state, setState] = useImmer({ couponCardList: [] diff --git a/src/pages/home/wgts/full-slider.js b/src/pages/home/wgts/full-slider.js index 6f2adb6d6..75d7ae546 100644 --- a/src/pages/home/wgts/full-slider.js +++ b/src/pages/home/wgts/full-slider.js @@ -13,7 +13,7 @@ import { needLoginPageType, needLoginPage } from '@/consts' import { WgtsContext } from './wgts-context' import './full-slider.scss' -const $instance = getCurrentInstance() +const $instance = getCurrentInstance() || {} const initState = { curIdx: 0, play: false, diff --git a/src/pages/home/wgts/full-slider/index.jsx b/src/pages/home/wgts/full-slider/index.jsx index fdacddaab..436aca3f6 100644 --- a/src/pages/home/wgts/full-slider/index.jsx +++ b/src/pages/home/wgts/full-slider/index.jsx @@ -14,7 +14,7 @@ import { WgtsContext } from '../wgts-context' import { getGlobalBaseStyle } from '../helper' import './index.scss' -const $instance = getCurrentInstance() +const $instance = getCurrentInstance() || {} const initState = { curIdx: 0, play: false, diff --git a/src/pages/home/wgts/goods-scroll.js b/src/pages/home/wgts/goods-scroll.js index f64b9848f..205b54de7 100644 --- a/src/pages/home/wgts/goods-scroll.js +++ b/src/pages/home/wgts/goods-scroll.js @@ -19,7 +19,7 @@ export default class WgtGoodsScroll extends Component { addGlobalClass: true, info: null } - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/pages/home/wgts/slider/index.jsx b/src/pages/home/wgts/slider/index.jsx index 7d5ff8f92..fbbd7b894 100644 --- a/src/pages/home/wgts/slider/index.jsx +++ b/src/pages/home/wgts/slider/index.jsx @@ -12,7 +12,7 @@ import { needLoginPageType, needLoginPage } from '@/consts' import { getGlobalBaseStyle } from '../helper' import './index.scss' -const $instance = getCurrentInstance() +const $instance = getCurrentInstance() || {} const initialState = { curIdx: 0, diff --git a/src/pages/index.js b/src/pages/index.js index 86f9b6f0e..bd54d621b 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -30,7 +30,8 @@ import { pickBy, log, showToast, - buildSharePath + buildSharePath, + isWeb } from '@/utils' import { updatePurchaseShareInfo, @@ -124,23 +125,21 @@ function Home() { // 仅当定位结果真正变化(如城市/区县)时重拉首页配置,避免每次 useDidShow→updateAddress 导致 location 引用变化就整页重载 useEffect(() => { if (!location || !VERSION_STANDARD) return - const key = [location.city, location.district, location.lat, location.lng].filter(Boolean).join('|') - if (locationKeyRef.current === key) return - locationKeyRef.current = key fetchWgts() }, [location]) useEffect(() => { if (skuPanelOpen) { - pageRef.current.pageLock() + pageRef.current?.pageLock() } else { - pageRef.current.pageUnLock() + pageRef.current?.pageUnLock() } }, [skuPanelOpen]) // H5:手动滚动到目标 section,等布局完成再测量并预留吸顶导航高度 useEffect(() => { - if (process.env.TARO_ENV !== 'h5' || !scrollIntoView) return + if (!isWeb || !scrollIntoView) return + console.log('scrollIntoView:', scrollIntoView) const id = String(scrollIntoView).replace(/^#/, '') if (!id) return const navH = state.navbarHeight || 0 diff --git a/src/pages/item/comps/comp-buytoolbar.js b/src/pages/item/comps/comp-buytoolbar.js index d75950736..154c78975 100644 --- a/src/pages/item/comps/comp-buytoolbar.js +++ b/src/pages/item/comps/comp-buytoolbar.js @@ -25,7 +25,7 @@ function CompGoodsBuyToolbar(props) { } = props const { cartCount = 0 } = useSelector((state) => state.cart) const { favs = [] } = useSelector((state) => state.user) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const dispatch = useDispatch() const btns = [] diff --git a/src/pages/item/espier-detail.js b/src/pages/item/espier-detail.js index 0d18dad02..f674a2be6 100644 --- a/src/pages/item/espier-detail.js +++ b/src/pages/item/espier-detail.js @@ -115,7 +115,7 @@ const initialState = { } function EspierDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const pageRef = useRef() const { userInfo } = useSelector((state) => state.user) diff --git a/src/pages/item/item-params.js b/src/pages/item/item-params.js index 9cdfa90fc..08092f13a 100644 --- a/src/pages/item/item-params.js +++ b/src/pages/item/item-params.js @@ -13,7 +13,7 @@ import { ParamsItem } from './comps' import './item-params.scss' export default class ItemParams extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/pages/purchase/auth.js b/src/pages/purchase/auth.js index 71ff6af4e..2d5f165c1 100644 --- a/src/pages/purchase/auth.js +++ b/src/pages/purchase/auth.js @@ -55,7 +55,7 @@ function PurchaseAuth() { const dispatch = useDispatch() const codeRef = useRef() const { showModal } = useModal() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { invite_code, activity_id, enterprise_id, is_activity } = state diff --git a/src/pages/recommend/detail.js b/src/pages/recommend/detail.js index 01a4d21b3..977a6be1b 100644 --- a/src/pages/recommend/detail.js +++ b/src/pages/recommend/detail.js @@ -29,7 +29,7 @@ const initialState = { collectArticleStatus: false } function GuideRecommendDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { img, shareImageUrl, itemId, title, content, articleFocusNum, updated } = state const { userInfo } = useSelector((state) => state.guide) diff --git a/src/pages/webview.js b/src/pages/webview.js index f85d1d4ef..f39ec97a6 100644 --- a/src/pages/webview.js +++ b/src/pages/webview.js @@ -9,7 +9,7 @@ import { View, WebView } from '@tarojs/components' const initialState = {} function WebviewIndex() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { url } = $instance?.router?.params const webviewSrc = decodeURIComponent(url) diff --git a/src/subpage/pages/auth/pclogin.js b/src/subpage/pages/auth/pclogin.js index caaa5c89a..55af06c1b 100644 --- a/src/subpage/pages/auth/pclogin.js +++ b/src/subpage/pages/auth/pclogin.js @@ -26,7 +26,7 @@ function parseUrlStr(urlStr) { } export default class PcAuth extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} state = { checkStatus: false } diff --git a/src/subpage/pages/cashier/cashier-result.js b/src/subpage/pages/cashier/cashier-result.js index 425c4248f..6af2a0526 100644 --- a/src/subpage/pages/cashier/cashier-result.js +++ b/src/subpage/pages/cashier/cashier-result.js @@ -13,7 +13,7 @@ import payFailPng from '../../../assets/imgs/pay_fail.png' import './cashier-result.scss' export default class CashierResult extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/cashier/comps/we-h5.js b/src/subpage/pages/cashier/comps/we-h5.js index 6df0d94bf..45e120c60 100644 --- a/src/subpage/pages/cashier/comps/we-h5.js +++ b/src/subpage/pages/cashier/comps/we-h5.js @@ -10,7 +10,7 @@ import api from '@/api' import './we.scss' export default class WeappBtn extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} static options = { addGlobalClass: true } diff --git a/src/subpage/pages/cashier/comps/we.js b/src/subpage/pages/cashier/comps/we.js index 3ba9c068d..096dda2b0 100644 --- a/src/subpage/pages/cashier/comps/we.js +++ b/src/subpage/pages/cashier/comps/we.js @@ -10,7 +10,7 @@ import api from '@/api' import './we.scss' export default class WeappBtn extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} static options = { addGlobalClass: true } diff --git a/src/subpage/pages/cashier/index.js b/src/subpage/pages/cashier/index.js index c348aa804..de818d134 100644 --- a/src/subpage/pages/cashier/index.js +++ b/src/subpage/pages/cashier/index.js @@ -23,7 +23,7 @@ import './index.scss' })) @withLogin() export default class Cashier extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} state = { info: null, env: '', diff --git a/src/subpage/pages/editShare/index.js b/src/subpage/pages/editShare/index.js index 8a27a96d0..6867b083b 100644 --- a/src/subpage/pages/editShare/index.js +++ b/src/subpage/pages/editShare/index.js @@ -34,7 +34,7 @@ const steps = [ colors: colors.current })) export default class EditShare extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(...props) { super(...props) diff --git a/src/subpage/pages/qrcode-buy.js b/src/subpage/pages/qrcode-buy.js index 451f7adf3..f80831645 100644 --- a/src/subpage/pages/qrcode-buy.js +++ b/src/subpage/pages/qrcode-buy.js @@ -22,7 +22,7 @@ import '../../pages/member/qrcode-buy.scss' @withPager @withBackToTop export default class QrcodeBuy extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/recommend/detail.js b/src/subpage/pages/recommend/detail.js index 9dedc97c7..06dd8a54a 100644 --- a/src/subpage/pages/recommend/detail.js +++ b/src/subpage/pages/recommend/detail.js @@ -20,7 +20,7 @@ import './detail.scss' })) @withPager export default class recommendDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { props = props || {} // props.pageSize = 50 diff --git a/src/subpage/pages/trade/after-sale-detail.js b/src/subpage/pages/trade/after-sale-detail.js index c8f5be8cc..ada0f4136 100644 --- a/src/subpage/pages/trade/after-sale-detail.js +++ b/src/subpage/pages/trade/after-sale-detail.js @@ -28,7 +28,7 @@ import './after-sale-detail.scss' pointName: sys.pointName })) export default class TradeDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/after-sale.js b/src/subpage/pages/trade/after-sale.js index 30b94fd9d..d55aa5a9a 100644 --- a/src/subpage/pages/trade/after-sale.js +++ b/src/subpage/pages/trade/after-sale.js @@ -23,7 +23,7 @@ import './list.scss' @withPager @withLogin() export default class AfterSale extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/cancel.js b/src/subpage/pages/trade/cancel.js index 259c9fad4..61c55d758 100644 --- a/src/subpage/pages/trade/cancel.js +++ b/src/subpage/pages/trade/cancel.js @@ -20,7 +20,7 @@ const TEXTCOUNT = 255 colors: colors.current })) export default class TradeCancel extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/customer-pickup-list.js b/src/subpage/pages/trade/customer-pickup-list.js index 25fcbf8c9..94d1aaecf 100644 --- a/src/subpage/pages/trade/customer-pickup-list.js +++ b/src/subpage/pages/trade/customer-pickup-list.js @@ -20,7 +20,7 @@ import './list.scss' })) @withPager export default class TradePickList extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/detail.js b/src/subpage/pages/trade/detail.js index 625dedd3e..efee2bbf4 100644 --- a/src/subpage/pages/trade/detail.js +++ b/src/subpage/pages/trade/detail.js @@ -70,7 +70,7 @@ const statusImg = { purchase: purchase.purchase_share_info })) export default class TradeDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/drug-list.js b/src/subpage/pages/trade/drug-list.js index 2f9024f42..74a3256c6 100644 --- a/src/subpage/pages/trade/drug-list.js +++ b/src/subpage/pages/trade/drug-list.js @@ -17,7 +17,7 @@ import './list.scss' @withPager @withLogin() export default class TradePickList extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/list.js b/src/subpage/pages/trade/list.js index fa2565ea3..a0810256f 100644 --- a/src/subpage/pages/trade/list.js +++ b/src/subpage/pages/trade/list.js @@ -35,7 +35,7 @@ import './list.scss' })) @withPager export default class TradeList extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/refund-detail.js b/src/subpage/pages/trade/refund-detail.js index 242856154..128f29853 100644 --- a/src/subpage/pages/trade/refund-detail.js +++ b/src/subpage/pages/trade/refund-detail.js @@ -12,7 +12,7 @@ import api from '@/api' import './refund-detail.scss' export default class TradeRefundDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/refund-sendback.js b/src/subpage/pages/trade/refund-sendback.js index 1b0eba350..56c6be3e4 100644 --- a/src/subpage/pages/trade/refund-sendback.js +++ b/src/subpage/pages/trade/refund-sendback.js @@ -33,7 +33,7 @@ import './refund-sendback.scss' // 'JTSD': '极兔速递', // } export default class TradeRefundSendback extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/trade/refund.js b/src/subpage/pages/trade/refund.js index 12c295fa3..113b3c127 100644 --- a/src/subpage/pages/trade/refund.js +++ b/src/subpage/pages/trade/refund.js @@ -21,7 +21,7 @@ import './refund.scss' colors: colors.current })) export default class TradeRefund extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpage/pages/vip/vipgrades.js b/src/subpage/pages/vip/vipgrades.js index 011b136d3..0435f659e 100644 --- a/src/subpage/pages/vip/vipgrades.js +++ b/src/subpage/pages/vip/vipgrades.js @@ -37,7 +37,7 @@ import './vipgrades.scss' }) ) export default class VipIndex extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/auth/auth-loading.js b/src/subpages/auth/auth-loading.js index c3a810542..d5a2cb1d8 100644 --- a/src/subpages/auth/auth-loading.js +++ b/src/subpages/auth/auth-loading.js @@ -12,7 +12,7 @@ import { setTokenAndRedirect, getToken } from './util' import './auth-loading.scss' const AuthLoading = () => { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { params: { code, redi_url } } = $instance?.router diff --git a/src/subpages/auth/bindPhone.js b/src/subpages/auth/bindPhone.js index e722f5d0c..ec01888ab 100644 --- a/src/subpages/auth/bindPhone.js +++ b/src/subpages/auth/bindPhone.js @@ -26,7 +26,7 @@ const initialValue = { } const PageBindPhone = () => { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { params: { unionid, redi_url } } = $instance?.router diff --git a/src/subpages/auth/comps/comp-otherlogin.js b/src/subpages/auth/comps/comp-otherlogin.js index fafc0105f..77e453cc9 100644 --- a/src/subpages/auth/comps/comp-otherlogin.js +++ b/src/subpages/auth/comps/comp-otherlogin.js @@ -11,7 +11,7 @@ import './comp-otherlogin.scss' const CompOtherLogin = () => { const handleClickWexin = async () => { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} //跳转 const { redirect = '' } = $instance?.router?.params const redirectUrl = diff --git a/src/subpages/auth/edit-password.js b/src/subpages/auth/edit-password.js index c5840a7d8..5166465ce 100644 --- a/src/subpages/auth/edit-password.js +++ b/src/subpages/auth/edit-password.js @@ -22,7 +22,7 @@ const initialValue = { } const PageEditPassword = () => { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { params: { phone, unionid, vcode } diff --git a/src/subpages/auth/forgotpwd.js b/src/subpages/auth/forgotpwd.js index 1fdf0d90c..09c97359e 100644 --- a/src/subpages/auth/forgotpwd.js +++ b/src/subpages/auth/forgotpwd.js @@ -28,7 +28,7 @@ const initialValue = { } const PageBindPhone = () => { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { params: { phone, redi_url } } = $instance?.router diff --git a/src/subpages/auth/login.js b/src/subpages/auth/login.js index 5d95e5820..ec2a942c0 100644 --- a/src/subpages/auth/login.js +++ b/src/subpages/auth/login.js @@ -23,7 +23,7 @@ import './login.scss' (dispatch) => ({ dispatch }) ) export default class Login extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/auth/reg-rule.js b/src/subpages/auth/reg-rule.js index 0561f2587..00336a52c 100644 --- a/src/subpages/auth/reg-rule.js +++ b/src/subpages/auth/reg-rule.js @@ -13,7 +13,7 @@ import './reg-rule.scss' @withPager export default class RegRule extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/case/detail.js b/src/subpages/case/detail.js index caae2a32f..f99810958 100644 --- a/src/subpages/case/detail.js +++ b/src/subpages/case/detail.js @@ -16,7 +16,7 @@ const initialState = { function CaseDetail() { const [state, setState] = useImmer(initialState) const { detail } = state - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { design_id, plan_id } = $instance?.router?.params || {} const { levelinfo } = detail || {} diff --git a/src/subpages/case/view-case.js b/src/subpages/case/view-case.js index 7ad3f375c..3089d934e 100644 --- a/src/subpages/case/view-case.js +++ b/src/subpages/case/view-case.js @@ -16,7 +16,7 @@ const initialState = { function ViewCase() { const [state, setState] = useImmer(initialState) const { designWorks } = state - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { design_works } = $instance?.router?.params || {} useEffect(() => { if (design_works) { diff --git a/src/subpages/community/apply-chief.js b/src/subpages/community/apply-chief.js index f32223286..afec4e71d 100644 --- a/src/subpages/community/apply-chief.js +++ b/src/subpages/community/apply-chief.js @@ -55,7 +55,7 @@ function ApplyChief(props) { loading } = state const { colorPrimary } = useSelector((state) => state.sys) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const formRef = useRef() const { distributor_id: dtid, scene = '' } = $instance?.router?.params let distributor_id = dtid diff --git a/src/subpages/community/boxlist.js b/src/subpages/community/boxlist.js index ce0481ce5..166e00c34 100644 --- a/src/subpages/community/boxlist.js +++ b/src/subpages/community/boxlist.js @@ -39,7 +39,7 @@ const BoxList = () => { const { startDate, startTime, endDate, endTime, activeIndex, list, itemBoxNum, itemPieceNum } = state const goodsRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { activity_id } = $instance?.router?.params // useEffect(() => { diff --git a/src/subpages/community/chief-licence.js b/src/subpages/community/chief-licence.js index 19f9928d8..bdacacf69 100644 --- a/src/subpages/community/chief-licence.js +++ b/src/subpages/community/chief-licence.js @@ -19,7 +19,7 @@ const initialState = { } function PointRule(props) { const [state, setState] = useImmer(initialState) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { content } = state useEffect(() => { diff --git a/src/subpages/community/community-edit.js b/src/subpages/community/community-edit.js index 2a75f6079..001284c0e 100644 --- a/src/subpages/community/community-edit.js +++ b/src/subpages/community/community-edit.js @@ -23,7 +23,7 @@ const initialState = { function CommunityEdit(props) { const [state, setState] = useImmer(initialState) const { ziti_name, address, areaValue, province, city, area } = state - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { id } = $instance?.router?.params useEffect(() => { if (id) { diff --git a/src/subpages/community/espier-checkout.js b/src/subpages/community/espier-checkout.js index a5a071c59..b9064c98a 100644 --- a/src/subpages/community/espier-checkout.js +++ b/src/subpages/community/espier-checkout.js @@ -26,7 +26,7 @@ const initialState = { } const EspierCheckout = () => { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { activity_id, items } = $instance?.router?.params const { address, chiefInfo, checkIsChief } = useSelector((state) => state.user) const { cashierPayment } = usePayment() diff --git a/src/subpages/community/espier-detail.js b/src/subpages/community/espier-detail.js index c8d7997f2..0f017ecc7 100644 --- a/src/subpages/community/espier-detail.js +++ b/src/subpages/community/espier-detail.js @@ -87,7 +87,7 @@ const initialState = { } function EspierDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} // const { type, id, dtid } = $instance?.router?.params // const { type, id, dtid } = await entryLaunch.getRouteParams() const { getUserInfoAuth } = useLogin() diff --git a/src/subpages/community/group-leaderdetail.js b/src/subpages/community/group-leaderdetail.js index 058f4b296..9ae73a63b 100644 --- a/src/subpages/community/group-leaderdetail.js +++ b/src/subpages/community/group-leaderdetail.js @@ -30,7 +30,7 @@ const initialState = { shareImageUrl: '' } function GroupLeaderDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { activity_id } = $instance?.router?.params const [state, setState] = useImmer(initialState) diff --git a/src/subpages/community/group-memberdetail.js b/src/subpages/community/group-memberdetail.js index 59e8d8601..a0bef7200 100644 --- a/src/subpages/community/group-memberdetail.js +++ b/src/subpages/community/group-memberdetail.js @@ -34,7 +34,7 @@ const initialState = { } function GroupLeaderDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { activity_id } = $instance?.router?.params const [state, setState] = useImmer(initialState) diff --git a/src/subpages/community/group.js b/src/subpages/community/group.js index a817f0368..cb942adf1 100644 --- a/src/subpages/community/group.js +++ b/src/subpages/community/group.js @@ -54,7 +54,7 @@ function Group(props) { const { qrcode, activityName, comps, startDate, startTime, endDate, endTime, shareImageUrl } = state const dispatch = useDispatch() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const pageRef = useRef('') useEffect(() => { diff --git a/src/subpages/community/list.js b/src/subpages/community/list.js index cf737206d..bfea536ea 100644 --- a/src/subpages/community/list.js +++ b/src/subpages/community/list.js @@ -23,7 +23,7 @@ const initialState = { function ListIndex(props) { const [state, setState] = useImmer(initialState) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { chief_id, distributor_id } = $instance?.router?.params const { list } = state const goodsRef = useRef() diff --git a/src/subpages/community/order-manage.js b/src/subpages/community/order-manage.js index aef513b90..756605b6e 100644 --- a/src/subpages/community/order-manage.js +++ b/src/subpages/community/order-manage.js @@ -66,7 +66,7 @@ function CheifOrderManage(props) { const { colorPrimary } = useSelector((state) => state.sys) const { checkIsChief } = useSelector((state) => state.user) const orderRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { activity_id } = $instance?.router?.params const { diff --git a/src/subpages/community/order.js b/src/subpages/community/order.js index 0deb433d4..872566a18 100644 --- a/src/subpages/community/order.js +++ b/src/subpages/community/order.js @@ -64,7 +64,7 @@ function CommunityOrder(props) { const [isShowSearch, setIsShowSearch] = useState(false) const { colorPrimary } = useSelector((state) => state.sys) const orderRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { activity_id } = $instance?.router?.params const { keywords, orderList, curTabIdx, isOpened, remark, payLoading } = state diff --git a/src/subpages/community/trade/after-sale-detail.js b/src/subpages/community/trade/after-sale-detail.js index 2a2116604..46f825e72 100644 --- a/src/subpages/community/trade/after-sale-detail.js +++ b/src/subpages/community/trade/after-sale-detail.js @@ -28,7 +28,7 @@ import './after-sale-detail.scss' pointName: sys.pointName })) export default class TradeDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/community/trade/cancel.js b/src/subpages/community/trade/cancel.js index 259c9fad4..61c55d758 100644 --- a/src/subpages/community/trade/cancel.js +++ b/src/subpages/community/trade/cancel.js @@ -20,7 +20,7 @@ const TEXTCOUNT = 255 colors: colors.current })) export default class TradeCancel extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/community/trade/delivery-info.js b/src/subpages/community/trade/delivery-info.js index 16543fa99..e9907c2ec 100644 --- a/src/subpages/community/trade/delivery-info.js +++ b/src/subpages/community/trade/delivery-info.js @@ -15,7 +15,7 @@ import './delivery-info.scss' //const LOGISTICS_CODE = {"AAE":"AAE\u5168\u7403\u4e13\u9012","ANE":"\u5b89\u80fd\u7269\u6d41","ARAMEX":"Aramex","AT":"\u5965\u5730\u5229\u90ae\u653f","BALUNZHI":"\u5df4\u4f26\u652f\u5feb\u9012","BEL":"\u6bd4\u5229\u65f6\u90ae\u653f","BFDF":"\u767e\u798f\u4e1c\u65b9","BHT":"BHT\u5feb\u9012","BKWL":"\u5b9d\u51ef\u7269\u6d41","BQXHM":"\u5317\u9752\u5c0f\u7ea2\u5e3d","BR":"\u5df4\u897f\u90ae\u653f","BSWL":"\u90a6\u9001\u7269\u6d41","CA":"\u52a0\u62ff\u5927\u90ae\u653f","CITY100":"\u57ce\u5e02100","COE":"COE\u4e1c\u65b9\u5feb\u9012","CSCY":"\u957f\u6c99\u521b\u4e00","D4PX":"\u9012\u56db\u65b9\u901f\u9012","DBL":"\u5fb7\u90a6","DHL_C":"DHL(\u4e2d\u56fd\u4ef6)","DHL_DE":"DHL(\u5fb7\u56fd\u4ef6)","DHL_GLB":"DHL\u5168\u7403","DHL_USA":"DHL(\u7f8e\u56fd)","DK":"\u4e39\u9ea6\u90ae\u653f","DPEX":"DPEX","DSWL":"D\u901f\u7269\u6d41","DTWL":"\u5927\u7530\u7269\u6d41","EMS":"EMS\u56fd\u5185","EMSGJ":"EMS\u56fd\u9645","FAST":"\u5feb\u6377\u901f\u9012","FEDEX_C":"FedEx\u8054\u90a6\u5feb\u9012(\u4e2d\u56fd\u4ef6)","FKD":"\u98de\u5eb7\u8fbe","FKRFD":"\u51e1\u5ba2\u5982\u98ce\u8fbe","GHX":"\u6302\u53f7\u4fe1","GJYZ":"\u56fd\u9645\u90ae\u653f\u5305\u88f9","GSD":"\u5171\u901f\u8fbe","GTO":"\u56fd\u901a\u5feb\u9012","GTSD":"\u9ad8\u94c1\u901f\u9012","HHTT":"\u5929\u5929\u5feb\u9012","HOAU":"\u5929\u5730\u534e\u5b87","hq568":"\u534e\u5f3a\u7269\u6d41","HTKY":"\u767e\u4e16\u6c47\u901a","HXLWL":"\u534e\u590f\u9f99\u7269\u6d41","HYLSD":"\u597d\u6765\u8fd0\u5feb\u9012","IE":"\u7231\u5c14\u5170\u90ae\u653f","JD":"\u4eac\u4e1c\u5feb\u9012","JGSD":"\u4eac\u5e7f\u901f\u9012","JJKY":"\u4f73\u5409\u5feb\u8fd0","JLDT":"\u5609\u91cc\u5927\u901a","JP":"\u65e5\u672c\u90ae\u653f","JTKD":"\u6377\u7279\u5feb\u9012","JXD":"\u6025\u5148\u8fbe","JYKD":"\u664b\u8d8a\u5feb\u9012","JYM":"\u52a0\u8fd0\u7f8e","JYWL":"\u4f73\u6021\u7269\u6d41","LB":"\u9f99\u90a6\u5feb\u9012","LHTEX":"\u8054\u660a\u901a\u901f\u9012","NEDA":"\u80fd\u8fbe\u901f\u9012","NL":"\u8377\u5170\u90ae\u653f","ONTRAC":"ONTRAC","QFKD":"\u5168\u5cf0\u5feb\u9012","QRT":"\u5168\u65e5\u901a\u5feb\u9012","RDSE":"\u745e\u5178\u90ae\u653f","SDWL":"\u4e0a\u5927\u7269\u6d41","SF":"\u987a\u4e30\u5feb\u9012","SFWL":"\u76db\u4e30\u7269\u6d41","SHWL":"\u76db\u8f89\u7269\u6d41","ST":"\u901f\u901a\u7269\u6d41","STO":"\u7533\u901a\u5feb\u9012","STSD":"\u4e09\u6001\u901f\u9012","SURE":"\u901f\u5c14\u5feb\u9012","SWCH":"\u745e\u58eb\u90ae\u653f","TSSTO":"\u5510\u5c71\u7533\u901a","UAPEX":"\u5168\u4e00\u5feb\u9012","UC":"\u4f18\u901f\u5feb\u9012","UPS":"UPS","USPS":"USPS\u7f8e\u56fd\u90ae\u653f","XFEX":"\u4fe1\u4e30\u5feb\u9012","XYT":"\u5e0c\u4f18\u7279","YADEX":"\u6e90\u5b89\u8fbe\u5feb\u9012","YAMA":"\u65e5\u672c\u5927\u548c\u8fd0\u8f93(Yamato)","YD":"\u97f5\u8fbe\u5feb\u9012","YFEX":"\u8d8a\u4e30\u7269\u6d41","YFHEX":"\u539f\u98de\u822a\u7269\u6d41","YJSD":"\u94f6\u6377\u901f\u9012","YTO":"\u5706\u901a\u901f\u9012","YZPY":"\u90ae\u653f\u5e73\u90ae\/\u5c0f\u5305","ZENY":"\u589e\u76ca\u5feb\u9012","ZJS":"\u5b85\u6025\u9001","ZMKM":"\u829d\u9ebb\u5f00\u95e8","ZTE":"\u4f17\u901a\u5feb\u9012","ZTKY":"\u4e2d\u94c1\u5feb\u8fd0","ZTO":"\u4e2d\u901a\u901f\u9012","ZTWL":"\u4e2d\u94c1\u7269\u6d41","ZY_AG":"\u7231\u8d2d\u8f6c\u8fd0","ZY_AOZ":"\u7231\u6b27\u6d32","ZY_AUSE":"\u6fb3\u4e16\u901f\u9012","ZY_AXO":"AXO","ZY_AZY":"\u6fb3\u8f6c\u8fd0","ZY_BDA":"\u516b\u8fbe\u7f51","ZY_BEE":"\u871c\u8702\u901f\u9012","ZY_BH":"\u8d1d\u6d77\u901f\u9012","ZY_BL":"\u767e\u5229\u5feb\u9012","ZY_BM":"\u6591\u9a6c\u7269\u6d41","ZY_BOZ":"\u8d25\u6b27\u6d32","ZY_BT":"\u767e\u901a\u7269\u6d41","ZY_BYECO":"\u8d1d\u6613\u8d2d","ZY_CM":"\u7b56\u9a6c\u8f6c\u8fd0","ZY_CTM":"\u8d64\u5154\u9a6c\u8f6c\u8fd0","ZY_CUL":"CUL\u4e2d\u7f8e\u901f\u9012","ZY_DGHT":"\u5fb7\u56fd\u6d77\u6dd8\u4e4b\u5bb6","ZY_DYW":"\u5fb7\u8fd0\u7f51","ZY_EFS":"EFS POST","ZY_ETD":"ETD","ZY_FD":"\u98de\u789f\u5feb\u9012","ZY_FG":"\u98de\u9e3d\u5feb\u9012","ZY_FLSD":"\u98ce\u96f7\u901f\u9012","ZY_FX":"\u98ce\u884c\u5feb\u9012","ZY_FXSD":"\u98ce\u884c\u901f\u9012","ZY_FY":"\u98de\u6d0b\u5feb\u9012","ZY_HC":"\u7693\u6668\u5feb\u9012","ZY_HCYD":"\u7693\u6668\u4f18\u9012","ZY_HDB":"\u6d77\u5e26\u5b9d","ZY_HFMZ":"\u6c47\u4e30\u7f8e\u4e2d\u901f\u9012","ZY_HJSD":"\u8c6a\u6770\u901f\u9012","ZY_HMKD":"\u534e\u7f8e\u5feb\u9012","ZY_HTAO":"360hitao\u8f6c\u8fd0","ZY_HTCUN":"\u6d77\u6dd8\u6751","ZY_HTKE":"365\u6d77\u6dd8\u5ba2","ZY_HTONG":"\u534e\u901a\u5feb\u8fd0","ZY_HXKD":"\u6d77\u661f\u6865\u5feb\u9012","ZY_HXSY":"\u534e\u5174\u901f\u8fd0","ZY_HYSD":"\u6d77\u60a6\u901f\u9012","ZY_IHERB":"LogisticsY","ZY_JA":"\u541b\u5b89\u5feb\u9012","ZY_JD":"\u65f6\u4ee3\u8f6c\u8fd0","ZY_JDKD":"\u9a8f\u8fbe\u5feb\u9012","ZY_JDZY":"\u9a8f\u8fbe\u8f6c\u8fd0","ZY_JH":"\u4e45\u79be\u5feb\u9012","ZY_JHT":"\u91d1\u6d77\u6dd8","ZY_LBZY":"\u8054\u90a6\u8f6c\u8fd0FedRoad","ZY_LPZ":"\u9886\u8dd1\u8005\u5feb\u9012","ZY_LX":"\u9f99\u8c61\u5feb\u9012","ZY_LZWL":"\u91cf\u5b50\u7269\u6d41","ZY_MBZY":"\u660e\u90a6\u8f6c\u8fd0","ZY_MGZY":"\u7f8e\u56fd\u8f6c\u8fd0","ZY_MJ":"\u7f8e\u5609\u5feb\u9012","ZY_MST":"\u7f8e\u901f\u901a","ZY_MXZY":"\u7f8e\u897f\u8f6c\u8fd0","ZY_MZ":"168 \u7f8e\u4e2d\u5feb\u9012","ZY_OEJ":"\u6b27e\u6377","ZY_OZF":"\u6b27\u6d32\u75af","ZY_OZGO":"\u6b27\u6d32GO","ZY_QMT":"\u5168\u7f8e\u901a","ZY_QQEX":"QQ-EX","ZY_RDGJ":"\u6da6\u4e1c\u56fd\u9645\u5feb\u7ebf","ZY_RT":"\u745e\u5929\u5feb\u9012","ZY_RTSD":"\u745e\u5929\u901f\u9012","ZY_SCS":"SCS\u56fd\u9645\u7269\u6d41","ZY_SDKD":"\u901f\u8fbe\u5feb\u9012","ZY_SFZY":"\u56db\u65b9\u8f6c\u8fd0","ZY_SOHO":"SOHO\u82cf\u8c6a\u56fd\u9645","ZY_SONIC":"Sonic-Ex\u901f\u9012","ZY_ST":"\u4e0a\u817e\u5feb\u9012","ZY_TCM":"\u901a\u8bda\u7f8e\u4e2d\u5feb\u9012","ZY_TJ":"\u5929\u9645\u5feb\u9012","ZY_TM":"\u5929\u9a6c\u8f6c\u8fd0","ZY_TN":"\u6ed5\u725b\u5feb\u9012","ZY_TPAK":"TrakPak","ZY_TPY":"\u592a\u5e73\u6d0b\u5feb\u9012","ZY_TSZ":"\u5510\u4e09\u85cf\u8f6c\u8fd0","ZY_TTHT":"\u5929\u5929\u6d77\u6dd8","ZY_TWC":"TWC\u8f6c\u8fd0\u4e16\u754c","ZY_TX":"\u540c\u5fc3\u5feb\u9012","ZY_TY":"\u5929\u7ffc\u5feb\u9012","ZY_TZH":"\u540c\u821f\u5feb\u9012","ZY_UCS":"UCS\u5408\u4f17\u5feb\u9012","ZY_WDCS":"\u6587\u8fbe\u56fd\u9645DCS","ZY_XC":"\u661f\u8fb0\u5feb\u9012","ZY_XDKD":"\u8fc5\u8fbe\u5feb\u9012","ZY_XDSY":"\u4fe1\u8fbe\u901f\u8fd0","ZY_XF":"\u5148\u950b\u5feb\u9012","ZY_XGX":"\u65b0\u5e72\u7ebf\u5feb\u9012","ZY_XIYJ":"\u897f\u90ae\u5bc4","ZY_XJ":"\u4fe1\u6377\u8f6c\u8fd0","ZY_YGKD":"\u4f18\u8d2d\u5feb\u9012","ZY_YJSD":"\u53cb\u5bb6\u901f\u9012(UCS)","ZY_YPW":"\u4e91\u7554\u7f51","ZY_YQ":"\u4e91\u9a91\u5feb\u9012","ZY_YQWL":"\u4e00\u67d2\u7269\u6d41","ZY_YSSD":"\u4f18\u665f\u901f\u9012","ZY_YSW":"\u6613\u9001\u7f51","ZY_YTUSA":"\u8fd0\u6dd8\u7f8e\u56fd","ZY_ZCSD":"\u81f3\u8bda\u901f\u9012","ZYWL":"\u4e2d\u90ae\u7269\u6d41"} export default class TradeDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/community/trade/refund-detail.js b/src/subpages/community/trade/refund-detail.js index ece0cd279..90eef0fd7 100644 --- a/src/subpages/community/trade/refund-detail.js +++ b/src/subpages/community/trade/refund-detail.js @@ -12,7 +12,7 @@ import api from '@/api' import './refund-detail.scss' export default class TradeRefundDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/community/trade/refund-sendback.js b/src/subpages/community/trade/refund-sendback.js index 7443ccc5d..0c114783e 100644 --- a/src/subpages/community/trade/refund-sendback.js +++ b/src/subpages/community/trade/refund-sendback.js @@ -33,7 +33,7 @@ import './refund-sendback.scss' // 'JTSD': '极兔速递', // } export default class TradeRefundSendback extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/community/trade/refund.js b/src/subpages/community/trade/refund.js index 7fa536a64..b89a85635 100644 --- a/src/subpages/community/trade/refund.js +++ b/src/subpages/community/trade/refund.js @@ -21,7 +21,7 @@ import './refund.scss' colors: colors.current })) export default class TradeRefund extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/community/trade/split-bagpack.js b/src/subpages/community/trade/split-bagpack.js index 445c0774a..e6e4d0421 100644 --- a/src/subpages/community/trade/split-bagpack.js +++ b/src/subpages/community/trade/split-bagpack.js @@ -30,7 +30,7 @@ import './split-bagpack.scss' // }) // } export default class TradeDetail extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/community/withdraw.js b/src/subpages/community/withdraw.js index 166f2977c..95d249766 100644 --- a/src/subpages/community/withdraw.js +++ b/src/subpages/community/withdraw.js @@ -21,7 +21,7 @@ const initialState = { money: '' } function CommunityWitdraw(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { withdraw } = $instance?.router?.params const [state, setState] = useImmer(initialState) const { bankName, bankCardNo, money } = state diff --git a/src/subpages/delivery/after-sale-detail.js b/src/subpages/delivery/after-sale-detail.js index 07e081076..b32bc72eb 100644 --- a/src/subpages/delivery/after-sale-detail.js +++ b/src/subpages/delivery/after-sale-detail.js @@ -46,7 +46,7 @@ const initialState = { } function TradeAfterSaleDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const pageRef = useRef() const { diff --git a/src/subpages/delivery/after-sale.js b/src/subpages/delivery/after-sale.js index b1fac3d9a..15cc17e18 100644 --- a/src/subpages/delivery/after-sale.js +++ b/src/subpages/delivery/after-sale.js @@ -54,7 +54,7 @@ const initialState = { } function TradeAfterSale(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const pageRef = useRef() const { diff --git a/src/subpages/dianwu/cashier.js b/src/subpages/dianwu/cashier.js index 6b2743a44..ae15d9fb5 100644 --- a/src/subpages/dianwu/cashier.js +++ b/src/subpages/dianwu/cashier.js @@ -68,7 +68,7 @@ function DianWuCashier() { const pageRef = useRef() const scanIsUseableRef = useRef(true) const audioContextRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { member } = useSelector((state) => state.dianwu) const dispatch = useDispatch() diff --git a/src/subpages/dianwu/change-price.js b/src/subpages/dianwu/change-price.js index 6e7818736..85a7fd2ee 100644 --- a/src/subpages/dianwu/change-price.js +++ b/src/subpages/dianwu/change-price.js @@ -46,7 +46,7 @@ function DianwuChangePrice(props) { globalPrice, globalFreightFee } = state - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { member } = useSelector((state) => state.dianwu) useEffect(() => { diff --git a/src/subpages/dianwu/checkout.js b/src/subpages/dianwu/checkout.js index 5085585bb..d219c09a8 100644 --- a/src/subpages/dianwu/checkout.js +++ b/src/subpages/dianwu/checkout.js @@ -78,7 +78,7 @@ function DianwuCheckout(props) { checkout_order_id } = state const pageRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { member } = useSelector((state) => state.dianwu) const dispatch = useDispatch() diff --git a/src/subpages/dianwu/collection-result.js b/src/subpages/dianwu/collection-result.js index 13a177943..559a18866 100644 --- a/src/subpages/dianwu/collection-result.js +++ b/src/subpages/dianwu/collection-result.js @@ -21,7 +21,7 @@ const initialState = { operatorInfo: null } function DianwuCollectionResult(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { member } = useSelector((state) => state.dianwu) const { order_id, trade_id, pay_type } = $instance?.router?.params const [state, setState] = useImmer(initialState) diff --git a/src/subpages/dianwu/comps/comp-tabbar.js b/src/subpages/dianwu/comps/comp-tabbar.js index 31669acb9..d2bce88e2 100644 --- a/src/subpages/dianwu/comps/comp-tabbar.js +++ b/src/subpages/dianwu/comps/comp-tabbar.js @@ -30,7 +30,7 @@ const TABBAR_LIST = [ ] function CompTabbar(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { colorPrimary } = useSelector((state) => state.sys) const tabList = TABBAR_LIST.map((item) => { diff --git a/src/subpages/dianwu/comps/comp-trade-info.js b/src/subpages/dianwu/comps/comp-trade-info.js index f84d7d793..1460d543f 100644 --- a/src/subpages/dianwu/comps/comp-trade-info.js +++ b/src/subpages/dianwu/comps/comp-trade-info.js @@ -25,7 +25,7 @@ const initialState = { function CompTradeInfo(props) { const { onFetch = () => {} } = props - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { tradeId, buyMember, receiptType, receiveName, receiveDate, receiveAddress } = state diff --git a/src/subpages/dianwu/list.js b/src/subpages/dianwu/list.js index 95d2e1023..28514c0e9 100644 --- a/src/subpages/dianwu/list.js +++ b/src/subpages/dianwu/list.js @@ -34,7 +34,7 @@ function DianWuList() { const [state, setState] = useImmer(initialState) const { keywords, typeList, current, list, cartList } = state const goodsRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { distributor_id } = $instance?.router?.params // useDianWuLogin() diff --git a/src/subpages/dianwu/pending-checkout.js b/src/subpages/dianwu/pending-checkout.js index 9b682d83e..70603d462 100644 --- a/src/subpages/dianwu/pending-checkout.js +++ b/src/subpages/dianwu/pending-checkout.js @@ -43,7 +43,7 @@ const initialState = { ] } function DianwuPendingCheckout(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { distributor_id, from } = $instance?.router?.params const [state, setState] = useImmer(initialState) const { list } = state diff --git a/src/subpages/dianwu/trade/cancel-trade.js b/src/subpages/dianwu/trade/cancel-trade.js index 4d2d756e3..be698f2b6 100644 --- a/src/subpages/dianwu/trade/cancel-trade.js +++ b/src/subpages/dianwu/trade/cancel-trade.js @@ -35,7 +35,7 @@ const initialState = { } function DianwuTradeCancel(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { info, reason, reasons } = state diff --git a/src/subpages/dianwu/trade/change-price.js b/src/subpages/dianwu/trade/change-price.js index 80fa3d5af..4131792bb 100644 --- a/src/subpages/dianwu/trade/change-price.js +++ b/src/subpages/dianwu/trade/change-price.js @@ -59,7 +59,7 @@ function DianwuChangePrice(props) { pointFreightFee, receiptType } = state - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { trade_id } = $instance?.router?.params useEffect(() => { diff --git a/src/subpages/dianwu/trade/invoice.js b/src/subpages/dianwu/trade/invoice.js index 006270a97..3f35b7d26 100644 --- a/src/subpages/dianwu/trade/invoice.js +++ b/src/subpages/dianwu/trade/invoice.js @@ -17,7 +17,7 @@ const initialState = { isInvoiced: false } function DianWuInvoice() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { billInfo, realFee, isInvoiced } = state //trade_id传递过来的订单id 获取订单发票详情 diff --git a/src/subpages/dianwu/trade/result.js b/src/subpages/dianwu/trade/result.js index 536e65209..44edfddcf 100644 --- a/src/subpages/dianwu/trade/result.js +++ b/src/subpages/dianwu/trade/result.js @@ -37,7 +37,7 @@ const tipMessage = { } function DianwuTradeResult(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { type = '1' } = $instance?.router?.params const { title, desc } = tipMessage[type] diff --git a/src/subpages/dianwu/trade/sale-after.js b/src/subpages/dianwu/trade/sale-after.js index 7086a764c..78de8d50f 100644 --- a/src/subpages/dianwu/trade/sale-after.js +++ b/src/subpages/dianwu/trade/sale-after.js @@ -62,7 +62,7 @@ const initialState = { } function DianwuTradeSaleAfter(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { tradeId, diff --git a/src/subpages/guide/cart/espier-index.js b/src/subpages/guide/cart/espier-index.js index f8d74493e..f4c5a8105 100644 --- a/src/subpages/guide/cart/espier-index.js +++ b/src/subpages/guide/cart/espier-index.js @@ -33,7 +33,7 @@ const initialState = { function CartIndex() { const dispatch = useDispatch() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const router = $instance?.router const [state, setState] = useImmer(initialState) diff --git a/src/subpages/guide/coupon-home/index.js b/src/subpages/guide/coupon-home/index.js index 0d2472715..750f99e90 100644 --- a/src/subpages/guide/coupon-home/index.js +++ b/src/subpages/guide/coupon-home/index.js @@ -37,7 +37,7 @@ function GuideCouponIndex(props) { const { isLogin, login } = useQwLogin({ autoLogin: true }) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { subtask_id = '' } = getCurrentInstance()?.router?.params const [state, setState] = useImmer(initialState) const { list } = state diff --git a/src/subpages/guide/custom/custom-page.js b/src/subpages/guide/custom/custom-page.js index c01dee83f..9b7840b9a 100644 --- a/src/subpages/guide/custom/custom-page.js +++ b/src/subpages/guide/custom/custom-page.js @@ -41,7 +41,7 @@ const initState = { function GuideCustomPage() { const [state, setState] = useImmer(initState) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { setNavigationBarTitle } = useNavigation() const { isLogin, login } = useQwLogin({ autoLogin: true diff --git a/src/subpages/guide/item/espier-detail.js b/src/subpages/guide/item/espier-detail.js index f57bacb53..ee5571499 100644 --- a/src/subpages/guide/item/espier-detail.js +++ b/src/subpages/guide/item/espier-detail.js @@ -96,7 +96,7 @@ const initialState = { } function EspierDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} // const { type, id, dtid } = $instance?.router?.params // const { type, id, dtid } = await entryLaunch.getRouteParams() const pageRef = useRef() diff --git a/src/subpages/guide/item/list.js b/src/subpages/guide/item/list.js index 3efa5b6f9..706cf4a64 100644 --- a/src/subpages/guide/item/list.js +++ b/src/subpages/guide/item/list.js @@ -60,7 +60,7 @@ const initialState = { } function ItemList(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { keywords, diff --git a/src/subpages/guide/recommend/detail.js b/src/subpages/guide/recommend/detail.js index 54cbee5b2..c0feaf343 100644 --- a/src/subpages/guide/recommend/detail.js +++ b/src/subpages/guide/recommend/detail.js @@ -24,7 +24,7 @@ const initialState = { updated: '' } function GuideRecommendDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { img, shareImageUrl, itemId, title, content, articleFocusNum, updated } = state const { userInfo } = useSelector((state) => state.guide) diff --git a/src/subpages/item/list.js b/src/subpages/item/list.js index ed52e5bed..6ec07633b 100644 --- a/src/subpages/item/list.js +++ b/src/subpages/item/list.js @@ -59,7 +59,7 @@ const initialState = { } function ItemList() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { keywords, diff --git a/src/subpages/marketing/coupon-center.js b/src/subpages/marketing/coupon-center.js index 784dde7bb..5260acd21 100644 --- a/src/subpages/marketing/coupon-center.js +++ b/src/subpages/marketing/coupon-center.js @@ -19,7 +19,7 @@ const initialState = { couponList: [] } function CouponCenter(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { couponList } = state const { gu } = Taro.getStorageSync(SG_GUIDE_PARAMS) diff --git a/src/subpages/marketing/coupon-detail.js b/src/subpages/marketing/coupon-detail.js index d922a1da2..d8252fe2b 100644 --- a/src/subpages/marketing/coupon-detail.js +++ b/src/subpages/marketing/coupon-detail.js @@ -23,7 +23,7 @@ const initialState = { info: {}, pageLoading: false } -const $instance = getCurrentInstance() +const $instance = getCurrentInstance() || {} const SpCouponDetail = (props) => { const [isValid, setIsValid] = useState(false) diff --git a/src/subpages/marketing/coupon-picker.js b/src/subpages/marketing/coupon-picker.js index 30220a867..9fd76c539 100644 --- a/src/subpages/marketing/coupon-picker.js +++ b/src/subpages/marketing/coupon-picker.js @@ -20,7 +20,7 @@ const initialState = { select: null } function CouponPicker(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) let { couponListVaild, couponListInVaild, select } = state const dispatch = useDispatch() diff --git a/src/subpages/marketing/exchange-code.js b/src/subpages/marketing/exchange-code.js index 6fdd6b14b..abaac250f 100644 --- a/src/subpages/marketing/exchange-code.js +++ b/src/subpages/marketing/exchange-code.js @@ -20,7 +20,7 @@ const initialState = { distributorInfo: null } function ExChangeCode() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { qrcodeUrl, barcodeUrl, codeContent, distributorInfo } = state const { from = 'espier-detail' } = $instance?.router?.params diff --git a/src/subpages/marketing/package-list.js b/src/subpages/marketing/package-list.js index 057e6089c..edd801eb2 100644 --- a/src/subpages/marketing/package-list.js +++ b/src/subpages/marketing/package-list.js @@ -22,7 +22,7 @@ const initialState = { } function PackageList(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { id, distributor_id } = $instance?.router?.params const dispatch = useDispatch() const [state, setState] = useImmer(initialState) diff --git a/src/subpages/member/index.js b/src/subpages/member/index.js index 5e5e7130a..f67ea3142 100644 --- a/src/subpages/member/index.js +++ b/src/subpages/member/index.js @@ -119,7 +119,7 @@ const initialState = { function MemberIndex(props) { // console.log('===>getCurrentPages==>', getCurrentPages(), getCurrentInstance()) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { updateAddress } = useLocation() const { isLogin, getUserInfo, isNewUser } = useLogin({ autoLogin: false, diff --git a/src/subpages/pointshop/comps/comp-buytoolbar.js b/src/subpages/pointshop/comps/comp-buytoolbar.js index 4445fe1dc..3673ed08c 100644 --- a/src/subpages/pointshop/comps/comp-buytoolbar.js +++ b/src/subpages/pointshop/comps/comp-buytoolbar.js @@ -24,7 +24,7 @@ function CompGoodsBuyToolbar(props) { } = props const { cartCount = 0 } = useSelector((state) => state.cart) const { favs = [] } = useSelector((state) => state.user) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const dispatch = useDispatch() const btns = [] diff --git a/src/subpages/pointshop/comps/comp-deliver.js b/src/subpages/pointshop/comps/comp-deliver.js index 9282ce6f3..c25b4b106 100644 --- a/src/subpages/pointshop/comps/comp-deliver.js +++ b/src/subpages/pointshop/comps/comp-deliver.js @@ -72,7 +72,7 @@ function CompDeliver(props, ref) { activeTimeId } = state const formRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { cart_type } = $instance?.router?.params || {} // useEffect(() => { // fetch() diff --git a/src/subpages/pointshop/espier-checkout.js b/src/subpages/pointshop/espier-checkout.js index 0f11e97b1..dcb342fee 100644 --- a/src/subpages/pointshop/espier-checkout.js +++ b/src/subpages/pointshop/espier-checkout.js @@ -47,7 +47,7 @@ import CompDeliver from './comps/comp-deliver' import './espier-checkout.scss' function PointShopEspierCheckout() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { updateAddress } = useLocation() const { isLogin, isNewUser, getUserInfoAuth } = useLogin({ autoLogin: true, diff --git a/src/subpages/pointshop/espier-detail.js b/src/subpages/pointshop/espier-detail.js index 14a61a0fa..3b0473469 100644 --- a/src/subpages/pointshop/espier-detail.js +++ b/src/subpages/pointshop/espier-detail.js @@ -81,7 +81,7 @@ const initialState = { } function PointShopEspierDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { getUserInfoAuth } = useLogin() const pageRef = useRef() const { userInfo } = useSelector((state) => state.user) diff --git a/src/subpages/pointshop/list.js b/src/subpages/pointshop/list.js index 4e9155960..eb158b6d8 100644 --- a/src/subpages/pointshop/list.js +++ b/src/subpages/pointshop/list.js @@ -59,7 +59,7 @@ const initialState = { } function PointShopList() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { leftList, diff --git a/src/subpages/prescription/add-personnel.js b/src/subpages/prescription/add-personnel.js index 9d800cee3..1582b1829 100644 --- a/src/subpages/prescription/add-personnel.js +++ b/src/subpages/prescription/add-personnel.js @@ -29,7 +29,7 @@ const initialState = { } function AddPersonnel() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { setNavigationBarTitle } = useNavigation() diff --git a/src/subpages/purchase/espier-checkout.js b/src/subpages/purchase/espier-checkout.js index 4c6660305..0cd129764 100644 --- a/src/subpages/purchase/espier-checkout.js +++ b/src/subpages/purchase/espier-checkout.js @@ -52,7 +52,7 @@ import CompDeliver from './comps/comp-deliver' import './espier-checkout.scss' function PurchaseCheckout(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { updateAddress } = useLocation() const { isLogin, isNewUser, getUserInfoAuth } = useLogin({ autoLogin: true, diff --git a/src/subpages/purchase/espier-detail.js b/src/subpages/purchase/espier-detail.js index b1ad32a99..564c77e59 100644 --- a/src/subpages/purchase/espier-detail.js +++ b/src/subpages/purchase/espier-detail.js @@ -85,7 +85,7 @@ const initialState = { } function EspierDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} // const { type, id, dtid } = $instance?.router?.params // const { type, id, dtid } = await entryLaunch.getRouteParams() const { getUserInfoAuth } = useLogin() diff --git a/src/subpages/purchase/espier-index.js b/src/subpages/purchase/espier-index.js index 596d70017..f5e06d232 100644 --- a/src/subpages/purchase/espier-index.js +++ b/src/subpages/purchase/espier-index.js @@ -40,7 +40,7 @@ function CartIndex() { }) const dispatch = useDispatch() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const router = $instance?.router const [state, setState] = useImmer(initialState) diff --git a/src/subpages/purchase/list.js b/src/subpages/purchase/list.js index 78bd60411..694de0e60 100644 --- a/src/subpages/purchase/list.js +++ b/src/subpages/purchase/list.js @@ -56,7 +56,7 @@ const initialState = { } function ItemList() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { keywords, diff --git a/src/subpages/purchase/select-company-phone.js b/src/subpages/purchase/select-company-phone.js index fe4945cf0..524409592 100644 --- a/src/subpages/purchase/select-company-phone.js +++ b/src/subpages/purchase/select-company-phone.js @@ -51,7 +51,7 @@ function PurchaseAuthPhone(props) { is_activity = '' } = params const { showModal } = useModal() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} useEffect(() => { getLoginCode() diff --git a/src/subpages/purchase/share.js b/src/subpages/purchase/share.js index eef177c3f..28798d251 100644 --- a/src/subpages/purchase/share.js +++ b/src/subpages/purchase/share.js @@ -19,7 +19,7 @@ import './share.scss' })) @withPager export default class PurchaseIndex extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/address.js b/src/subpages/salesman/address.js index d76a62ec6..6aad26a0f 100644 --- a/src/subpages/salesman/address.js +++ b/src/subpages/salesman/address.js @@ -24,7 +24,7 @@ const initialState = { } function AddressIndex(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { selectedId, isPicker, list } = state const colors = useSelector((state) => state.sys) diff --git a/src/subpages/salesman/cancel.js b/src/subpages/salesman/cancel.js index 429aae1f8..68916e4b0 100644 --- a/src/subpages/salesman/cancel.js +++ b/src/subpages/salesman/cancel.js @@ -20,7 +20,7 @@ const TEXTCOUNT = 255 colors: colors.current })) export default class TradeCancel extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/cart.js b/src/subpages/salesman/cart.js index 6aa2cb32b..9de3e0e06 100644 --- a/src/subpages/salesman/cart.js +++ b/src/subpages/salesman/cart.js @@ -34,7 +34,7 @@ function Cart() { const [state, setState] = useImmer(initialConfigState) const { allChecked, current } = state const dispatch = useDispatch() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const router = $instance?.router const { validSalesmanCart = [], diff --git a/src/subpages/salesman/comps/comp-delivers.js b/src/subpages/salesman/comps/comp-delivers.js index 951eb3606..7a28c60f8 100644 --- a/src/subpages/salesman/comps/comp-delivers.js +++ b/src/subpages/salesman/comps/comp-delivers.js @@ -89,7 +89,7 @@ function CompDeliver(props, ref) { activeTimeIdMerchant } = state const formRef = useRef() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { cart_type } = $instance?.router?.params || {} // useEffect(() => { // fetch() diff --git a/src/subpages/salesman/coupon-picker.js b/src/subpages/salesman/coupon-picker.js index 21746393d..cc53ef5f1 100644 --- a/src/subpages/salesman/coupon-picker.js +++ b/src/subpages/salesman/coupon-picker.js @@ -20,7 +20,7 @@ const initialState = { select: null } function CouponPicker(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) let { couponListVaild, couponListInVaild, select } = state const { customerLnformation } = useSelector((state) => state.cart) diff --git a/src/subpages/salesman/distribution/good-category.js b/src/subpages/salesman/distribution/good-category.js index fbedcebd3..2d4cdf1a2 100644 --- a/src/subpages/salesman/distribution/good-category.js +++ b/src/subpages/salesman/distribution/good-category.js @@ -16,7 +16,7 @@ import './shop-category.scss' @withPager @withBackToTop export default class DistributionShopCategory extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/distribution/goods.js b/src/subpages/salesman/distribution/goods.js index 64f8b421e..1ee67a742 100644 --- a/src/subpages/salesman/distribution/goods.js +++ b/src/subpages/salesman/distribution/goods.js @@ -29,7 +29,7 @@ import './goods.scss' @withPager @withBackToTop export default class DistributionGoods extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/distribution/qrcode.js b/src/subpages/salesman/distribution/qrcode.js index 8fe763d8d..7dcd523c4 100644 --- a/src/subpages/salesman/distribution/qrcode.js +++ b/src/subpages/salesman/distribution/qrcode.js @@ -16,7 +16,7 @@ import './qrcode.scss' colors: colors.current })) export default class DistributionQrcode extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/distribution/shop-category.js b/src/subpages/salesman/distribution/shop-category.js index 138950a97..d392acd03 100644 --- a/src/subpages/salesman/distribution/shop-category.js +++ b/src/subpages/salesman/distribution/shop-category.js @@ -17,7 +17,7 @@ import './shop-category.scss' @withPager @withBackToTop export default class DistributionShopCategory extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/distribution/shop-form.js b/src/subpages/salesman/distribution/shop-form.js index f7923eac3..16253222a 100644 --- a/src/subpages/salesman/distribution/shop-form.js +++ b/src/subpages/salesman/distribution/shop-form.js @@ -15,7 +15,7 @@ import api from '@/api' import './shop-form.scss' export default class DistributionShopForm extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/distribution/shop-goods.js b/src/subpages/salesman/distribution/shop-goods.js index 36f06d35a..4b666687d 100644 --- a/src/subpages/salesman/distribution/shop-goods.js +++ b/src/subpages/salesman/distribution/shop-goods.js @@ -16,7 +16,7 @@ import './shop-goods.scss' @withPager @withBackToTop export default class DistributionShopGoods extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/distribution/shop-home.js b/src/subpages/salesman/distribution/shop-home.js index a7eaed5ff..8602a2ef9 100644 --- a/src/subpages/salesman/distribution/shop-home.js +++ b/src/subpages/salesman/distribution/shop-home.js @@ -20,7 +20,7 @@ import './shop-home.scss' @withPager export default class DistributionShopHome extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/distribution/shop.js b/src/subpages/salesman/distribution/shop.js index 1c3089811..f7e085a8c 100644 --- a/src/subpages/salesman/distribution/shop.js +++ b/src/subpages/salesman/distribution/shop.js @@ -17,7 +17,7 @@ import './shop.scss' colors: colors.current })) export default class DistributionShop extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/distribution/trade.js b/src/subpages/salesman/distribution/trade.js index eb4ff4f7b..bedebe965 100644 --- a/src/subpages/salesman/distribution/trade.js +++ b/src/subpages/salesman/distribution/trade.js @@ -16,7 +16,7 @@ import './trade.scss' @withPager @withBackToTop export default class DistributionTrade extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/salesman/edit-address.js b/src/subpages/salesman/edit-address.js index 568e0e22d..5566246ec 100644 --- a/src/subpages/salesman/edit-address.js +++ b/src/subpages/salesman/edit-address.js @@ -27,7 +27,7 @@ const initialState = { } function AddressIndex(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const colors = useSelector((state) => state.colors.current) const { customerLnformation } = useSelector((state) => state.cart) diff --git a/src/subpages/salesman/espier-checkout.js b/src/subpages/salesman/espier-checkout.js index 27b628ca8..dfb9f32cd 100644 --- a/src/subpages/salesman/espier-checkout.js +++ b/src/subpages/salesman/espier-checkout.js @@ -56,7 +56,7 @@ import CompPointUse from './comps/comp-pointuse' import './espier-checkout.scss' function CartCheckout(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { isLogin, isNewUser, getUserInfoAuth } = useLogin({ autoLogin: true }) diff --git a/src/subpages/salesman/ziti-picker.js b/src/subpages/salesman/ziti-picker.js index 193e305b5..8dfaa1f73 100644 --- a/src/subpages/salesman/ziti-picker.js +++ b/src/subpages/salesman/ziti-picker.js @@ -20,7 +20,7 @@ const initialState = { isDefault: false } function StoreZitiPicker(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { zitiList, zitiId, isDefault } = state const dispatch = useDispatch() diff --git a/src/subpages/store/brand-info.js b/src/subpages/store/brand-info.js index 7b2fd972a..ff03f0b6d 100644 --- a/src/subpages/store/brand-info.js +++ b/src/subpages/store/brand-info.js @@ -20,7 +20,7 @@ const initialState = { const PageBrandInfo = () => { const [state, setState] = useImmer(initialState) - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const { storeInfo, fav } = state diff --git a/src/subpages/store/category.js b/src/subpages/store/category.js index 7dba48336..4e71fed74 100644 --- a/src/subpages/store/category.js +++ b/src/subpages/store/category.js @@ -25,7 +25,7 @@ const initialState = { } const CategoryIndex = (props) => { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { currentList, pIndex, sIndex, tabList, contentList, hasSeries } = state // 获取数据 diff --git a/src/subpages/store/categorys.js b/src/subpages/store/categorys.js index d951541dc..adaf6afe1 100644 --- a/src/subpages/store/categorys.js +++ b/src/subpages/store/categorys.js @@ -35,7 +35,7 @@ const initialState = { } function StoreItemList(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) // const { purchase_share_info = {} } = useSelector((state) => state.purchase) const { diff --git a/src/subpages/store/comps/comp-add-cart.js b/src/subpages/store/comps/comp-add-cart.js index bafd63674..877b3c778 100644 --- a/src/subpages/store/comps/comp-add-cart.js +++ b/src/subpages/store/comps/comp-add-cart.js @@ -37,7 +37,7 @@ function CompAddCart(props) { const { open = false, onMaskCloses = {}, parameter = {} } = props const [state, setState] = useImmer(initialState) const { hideClose } = state - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const router = $instance?.router const plus_buy_activity = shopCartCount?.storeDetails?.plus_buy_activity?.[0] const exchange_item = plus_buy_activity?.plus_item diff --git a/src/subpages/store/comps/comp-tab.js b/src/subpages/store/comps/comp-tab.js index f98d07969..1298e3044 100644 --- a/src/subpages/store/comps/comp-tab.js +++ b/src/subpages/store/comps/comp-tab.js @@ -25,7 +25,7 @@ function CompTab(props) { const { popFrame = {} } = props const [state, setState] = useImmer(initialState) const { fav, couponList, extend } = state - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const router = $instance?.router if (!shopCartCount) { diff --git a/src/subpages/store/index.js b/src/subpages/store/index.js index d8a9107bb..a07da1ec9 100644 --- a/src/subpages/store/index.js +++ b/src/subpages/store/index.js @@ -63,7 +63,7 @@ function StoreIndex() { const { openRecommend, colorPrimary } = useSelector((state) => state.sys) const { shopCartCount } = useSelector((state) => state.cart) const { setNavigationBarTitle } = useNavigation() - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const router = $instance?.router const { diff --git a/src/subpages/store/item-list.js b/src/subpages/store/item-list.js index 37841c249..f22e46f6c 100644 --- a/src/subpages/store/item-list.js +++ b/src/subpages/store/item-list.js @@ -44,7 +44,7 @@ const initialState = { } function StoreItemList() { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { keywords, diff --git a/src/subpages/store/ziti-list.js b/src/subpages/store/ziti-list.js index d0692e9e4..87105267d 100644 --- a/src/subpages/store/ziti-list.js +++ b/src/subpages/store/ziti-list.js @@ -34,7 +34,7 @@ import './ziti-list.scss' @withPager @withBackToTop export default class StoreZitiList extends Component { - $instance = getCurrentInstance() + $instance = getCurrentInstance() || {} constructor(props) { super(props) diff --git a/src/subpages/store/ziti-picker.js b/src/subpages/store/ziti-picker.js index d80a1c7ca..45257fa45 100644 --- a/src/subpages/store/ziti-picker.js +++ b/src/subpages/store/ziti-picker.js @@ -20,7 +20,7 @@ const initialState = { isDefault: false } function StoreZitiPicker(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { zitiList, zitiId, isDefault } = state const dispatch = useDispatch() diff --git a/src/subpages/trade/after-sale-detail.js b/src/subpages/trade/after-sale-detail.js index a4c52f705..a121dce5a 100644 --- a/src/subpages/trade/after-sale-detail.js +++ b/src/subpages/trade/after-sale-detail.js @@ -47,7 +47,7 @@ const initialState = { } function TradeAfterSaleDetail(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const pageRef = useRef() const { diff --git a/src/subpages/trade/after-sale.js b/src/subpages/trade/after-sale.js index 30b90a6d4..03cd4d0dc 100644 --- a/src/subpages/trade/after-sale.js +++ b/src/subpages/trade/after-sale.js @@ -57,7 +57,7 @@ const initialState = { } function TradeAfterSale(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const pageRef = useRef() const { diff --git a/src/subpages/trade/logistics-info.js b/src/subpages/trade/logistics-info.js index 186d21caa..f377c0828 100644 --- a/src/subpages/trade/logistics-info.js +++ b/src/subpages/trade/logistics-info.js @@ -21,7 +21,7 @@ const initialState = { afterInfo: null } function TradeLogisticsInfo(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { logi_no, expressList, corpIndex, afterInfo } = state const { item_id, order_id, aftersales_bn, type = 'single' } = $instance?.router?.params diff --git a/src/subpages/trade/store-picker.js b/src/subpages/trade/store-picker.js index a23d95f3a..17a5e16b2 100644 --- a/src/subpages/trade/store-picker.js +++ b/src/subpages/trade/store-picker.js @@ -21,7 +21,7 @@ const initialState = { refundStore: '' } function TradeStorePicker(props) { - const $instance = getCurrentInstance() + const $instance = getCurrentInstance() || {} const [state, setState] = useImmer(initialState) const { keywords, list, refundStore } = state diff --git a/src/utils/entryLaunch.js b/src/utils/entryLaunch.js index e53a24b2b..212223ea1 100644 --- a/src/utils/entryLaunch.js +++ b/src/utils/entryLaunch.js @@ -22,7 +22,7 @@ function getS() { ) } -const $instance = getCurrentInstance() +const $instance = getCurrentInstance() || {} const { store } = configStore() class EntryLaunch { constructor() {