diff --git a/src/App.vue b/src/App.vue index c688604..37c5930 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,7 @@ \ No newline at end of file + diff --git a/src/pages/shop/brandDetail.vue b/src/pages/shop/brandDetail.vue index d4c37da..547fd78 100644 --- a/src/pages/shop/brandDetail.vue +++ b/src/pages/shop/brandDetail.vue @@ -96,13 +96,15 @@ const toDetail = async (v: any) => { {{ v.name }} - + {{ v.phone }} - {{ v.deptName.length > 5 ? v.deptName.substring(0, 5) + "..." : v.deptName }} + + {{ v.deptName.length > 5 ? v.deptName.substring(0, 5) + "..." : v.deptName }} + 营业时间: diff --git a/src/pages/shop/detail.vue b/src/pages/shop/detail.vue index 9402a96..66ed27f 100644 --- a/src/pages/shop/detail.vue +++ b/src/pages/shop/detail.vue @@ -24,19 +24,24 @@ {{ state.detail.name }} - - + + - {{ state.detail.phone?.slice(0, 11) }} + {{ item.trim() }} 联系商家 - + {{ state.detail.deptName?.length > 5 ? state.detail.deptName.substring(0, 5) + "..." : state.detail.deptName }} @@ -132,13 +137,15 @@ import { reactive, nextTick } from "vue" import { onLoad, onShow } from "@dcloudio/uni-app" import { isEmpty } from "radash" -import { router } from "@@/index" +import { hooks, router } from "@@/index" import { foodApi, merchantApi, payApi, shopApi } from "@@/api" import { filePath } from "@@/utils/file" import ProductRow from "./components/product-row.vue" import ProductCart from "./components/product-cart.vue" import ProductTotal from "./components/product-total.vue" import ProductSku from "./components/product-sku.vue" +import { getAppInfo } from "@/sheep/utils/app" +import { APPENV } from "@/sheep/constant" // 商品详情相关数据 const state = reactive({ @@ -331,15 +338,19 @@ const submitPay = async () => { } // 联系商家 -const doPhone = () => { - if (isEmpty(state.detail.phone)) { - uni.showToast({ title: "该商户没有预留电话", icon: "none" }) +const doPhone = async (item: string) => { + if (isEmpty(item)) return uni.showToast({ title: "该商户没有预留电话", icon: "none" }) + if ((await getAppInfo()) == APPENV.ZZD) { + ;(window as any).dd + .callPhone({ phoneNum: item.trim() }) + .then((res) => {}) + .catch((err) => {}) + return + } + if ((await getAppInfo()) == APPENV.SH) { + hooks.useMakePhoneCall(item.trim()) return } - ;(window as any).dd - .callPhone({ phoneNum: state.detail.phone.slice(0, 11) }) - .then((res) => {}) - .catch((err) => {}) } diff --git a/src/pages/tabbar/coopMerchant.vue b/src/pages/tabbar/coopMerchant.vue index 92d498f..c63513f 100644 --- a/src/pages/tabbar/coopMerchant.vue +++ b/src/pages/tabbar/coopMerchant.vue @@ -113,13 +113,13 @@ const toDetail = async (v: any) => { - + {{ v.phone }} - {{ v.deptName.length > 5 ? v.deptName.substring(0, 5) + "..." : v.deptName }} + {{ v.deptName.length > 5 ? v.deptName.substring(0, 5) + "..." : v.deptName }} 营业时间: diff --git a/src/pages/tabbar/index.vue b/src/pages/tabbar/index.vue index 03b5ea3..9326f03 100644 --- a/src/pages/tabbar/index.vue +++ b/src/pages/tabbar/index.vue @@ -1,4 +1,5 @@