import { PAGE_SHOP_HOME, PAGE_SHOP_SEARCH } from '@/utils/pageRoute'

/** 跳转店铺主页 */
export function goShopHome(shopId) {
  if (!shopId) return
  uni.navigateTo({
    url: `${PAGE_SHOP_HOME}?shopId=${shopId}`
  })
}

/** 跳转店内搜索页 */
export function goShopSearch(shopId, keyword) {
  if (!shopId) return
  let url = `${PAGE_SHOP_SEARCH}?shopId=${shopId}`
  const kw = (keyword || '').trim()
  if (kw) {
    url += `&keyword=${encodeURIComponent(kw)}`
  }
  uni.navigateTo({ url })
}
