|
@@ -48,9 +48,63 @@ const menuList = ref([
|
|
{ name: t('mine.menu.address'), url: '/pages/mine/addressBook', icon: '/static/icons/address-book.png' },
|
|
{ name: t('mine.menu.address'), url: '/pages/mine/addressBook', icon: '/static/icons/address-book.png' },
|
|
{ name: t('mine.menu.share'), url: '/pages/mine/share', icon: '/static/icons/share.png' },
|
|
{ name: t('mine.menu.share'), url: '/pages/mine/share', icon: '/static/icons/share.png' },
|
|
{ name: t('mine.menu.favorite'), url: '/pages/mine/myFavorite', icon: '/static/icons/my-favorite.png' },
|
|
{ name: t('mine.menu.favorite'), url: '/pages/mine/myFavorite', icon: '/static/icons/my-favorite.png' },
|
|
- { name: t('mine.menu.chat'), url: '', icon: '/static/icons/live-chat.png' },
|
|
|
|
|
|
+ { name: t('mine.menu.chat'), icon: '/static/icons/live-chat.png' },
|
|
{ name: t('mine.menu.activity'), url: '/pages/referEarn/referEarn', icon: '/static/icons/activity-group.png' },
|
|
{ name: t('mine.menu.activity'), url: '/pages/referEarn/referEarn', icon: '/static/icons/activity-group.png' },
|
|
])
|
|
])
|
|
|
|
+function menuClick(item: any) {
|
|
|
|
+ if (item.url) {
|
|
|
|
+ toPage(item.url)
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ openWhatsApp()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+// 跳转whatsapp
|
|
|
|
+function openWhatsApp() {
|
|
|
|
+ // 判断手机是否安装whatsapp
|
|
|
|
+ // pname:Android 需要查询的包名 action:ios 需要查询的 URL Scheme
|
|
|
|
+ // installed ture:安装 false:未安装
|
|
|
|
+ const installed = plus.runtime.isApplicationExist({
|
|
|
|
+ pname: 'com.whatsapp',
|
|
|
|
+ action: 'whatsapp://',
|
|
|
|
+ })
|
|
|
|
+ // 电话号码
|
|
|
|
+ const phoneNumber = '+8615058371889'
|
|
|
|
+ // whatsapp 联系人聊天页面链接
|
|
|
|
+ const whatsappUrl = `whatsapp://send?phone=${phoneNumber}`
|
|
|
|
+ // whatsapp包名
|
|
|
|
+ const pname = 'com.whatsapp'
|
|
|
|
+
|
|
|
|
+ // 判断手机系统,走不同方法
|
|
|
|
+ if (plus.os.name === 'Android') {
|
|
|
|
+ if (installed) {
|
|
|
|
+ // 手机已安装 直接跳转
|
|
|
|
+ plus.runtime.openURL(whatsappUrl)
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ // 手机未安装,跳转到手机商城并搜索whatsapp (国内目前搜不到)
|
|
|
|
+ plus.nativeUI.actionSheet(
|
|
|
|
+ {
|
|
|
|
+ title: '选择应用',
|
|
|
|
+ cancel: '取消',
|
|
|
|
+ buttons: [{ title: '应用市场' }],
|
|
|
|
+ },
|
|
|
|
+ ({ index }) => {
|
|
|
|
+ switch (index) {
|
|
|
|
+ case 1:
|
|
|
|
+ plus.runtime.openURL(
|
|
|
|
+ `market://details?id=${pname}`,
|
|
|
|
+ () => {
|
|
|
|
+ // 手机没有应用市场
|
|
|
|
+ plus.nativeUI.alert('本机未安装指定的应用')
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
const walletInfo = ref<any>({})
|
|
const walletInfo = ref<any>({})
|
|
async function getWalletInfo() {
|
|
async function getWalletInfo() {
|
|
// 获取钱包信息-查询余额
|
|
// 获取钱包信息-查询余额
|
|
@@ -138,7 +192,7 @@ onShow(() => {
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="grid grid-cols-3 gap-24rpx bg-white py-45rpx">
|
|
<view class="grid grid-cols-3 gap-24rpx bg-white py-45rpx">
|
|
- <view v-for="(item, index) in menuList" :key="index" class="flex flex-col items-center" @click="toPage(item.url)">
|
|
|
|
|
|
+ <view v-for="(item, index) in menuList" :key="index" class="flex flex-col items-center" @click="menuClick(item)">
|
|
<wd-img width="48rpx" height="48rpx" :src="item.icon" />
|
|
<wd-img width="48rpx" height="48rpx" :src="item.icon" />
|
|
<view class="mt-18rpx text-22rpx text-#3A444C">
|
|
<view class="mt-18rpx text-22rpx text-#3A444C">
|
|
{{ item.name }}
|
|
{{ item.name }}
|