1. 弹窗点击对应操作 --- 已完成
This commit is contained in:
parent
bb0aeef750
commit
c33268d851
@ -7,13 +7,15 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onLaunch } from "@dcloudio/uni-app";
|
import { onLaunch, onShow } from "@dcloudio/uni-app";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useIndex } from '@/stores/index.js'
|
import { useIndex } from '@/stores/index.js'
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
useIndex().getAppInfo()
|
||||||
|
})
|
||||||
onLaunch( async(e) => {
|
onLaunch( async(e) => {
|
||||||
useIndex().menuInit()
|
useIndex().menuInit()
|
||||||
useIndex().getAppInfo()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
:inputBorder="false"
|
:inputBorder="false"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
:adjust-position="false"
|
:adjust-position="false"
|
||||||
|
:disabled="isInputDisabled"
|
||||||
:focus="inputFocus"
|
:focus="inputFocus"
|
||||||
v-model="sendVal"
|
v-model="sendVal"
|
||||||
trim="both"
|
trim="both"
|
||||||
@ -50,7 +51,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad, onUnload } from '@dcloudio/uni-app';
|
import { onLoad, onUnload } from '@dcloudio/uni-app';
|
||||||
import { ref, nextTick } from 'vue';
|
import { ref, nextTick, computed } from 'vue';
|
||||||
import dayJs from 'dayjs';
|
import dayJs from 'dayjs';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useScoketMsg } from '@/stores/index.js';
|
import { useScoketMsg } from '@/stores/index.js';
|
||||||
@ -63,6 +64,15 @@
|
|||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
const isInputDisabled = computed(() => {
|
||||||
|
let lastMessage = {}
|
||||||
|
let list = useScoketMsg().msgList
|
||||||
|
if (list.length) {
|
||||||
|
lastMessage = list[list.length - 1];
|
||||||
|
}
|
||||||
|
return lastMessage.type && lastMessage.type === 3
|
||||||
|
})
|
||||||
|
|
||||||
const inputFocus = ref(true)
|
const inputFocus = ref(true)
|
||||||
const sendVal = ref('')
|
const sendVal = ref('')
|
||||||
const send = async () => {
|
const send = async () => {
|
||||||
|
|||||||
@ -1,18 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="pages">
|
<view class="pages">
|
||||||
<view
|
<template v-if="list.length">
|
||||||
class="prod-item"
|
<view
|
||||||
v-for="item in list"
|
class="prod-item"
|
||||||
:key="item.id"
|
v-for="item in list"
|
||||||
@click="goDetails(item)"
|
:key="item.id"
|
||||||
>
|
@click="goDetails(item)"
|
||||||
<view class="cover">
|
>
|
||||||
<image :src="item.mainPic"></image>
|
<view class="cover">
|
||||||
</view>
|
<image :src="item.mainPic"></image>
|
||||||
<view class="title text-ellipsis">
|
</view>
|
||||||
{{item.title}}
|
<view class="title text-ellipsis">
|
||||||
</view>
|
{{item.title}}
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<Empty v-else />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
BIN
src/assets/images/icon/empty.png
Normal file
BIN
src/assets/images/icon/empty.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
28
src/components/empty.vue
Normal file
28
src/components/empty.vue
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<template>
|
||||||
|
<view class="empty-box">
|
||||||
|
<image src="@/assets/images/icon/empty.png" mode="widthFix"></image>
|
||||||
|
<view>
|
||||||
|
{{$t('common.empty')}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.empty-box {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
image {
|
||||||
|
width: 20%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -5,7 +5,7 @@
|
|||||||
{{$t('common.Quickcontact')}}
|
{{$t('common.Quickcontact')}}
|
||||||
</view>
|
</view>
|
||||||
<view class="contact-box">
|
<view class="contact-box">
|
||||||
<view class="desc-item">
|
<view class="desc-item" @click="makePhone">
|
||||||
<image class="icon" src="@/assets/images/icon/phone2.png"></image>
|
<image class="icon" src="@/assets/images/icon/phone2.png"></image>
|
||||||
<view class="desc">
|
<view class="desc">
|
||||||
<label>{{ $t('contactUs.contactUs') }}</label>
|
<label>{{ $t('contactUs.contactUs') }}</label>
|
||||||
@ -17,15 +17,23 @@
|
|||||||
<image class="icon" src="@/assets/images/icon/mail2.png"></image>
|
<image class="icon" src="@/assets/images/icon/mail2.png"></image>
|
||||||
<view class="desc">
|
<view class="desc">
|
||||||
<label>{{ $t('common.E-mail') }}</label>
|
<label>{{ $t('common.E-mail') }}</label>
|
||||||
<view>{{useIndex().appInfo.email}}</view>
|
<view>
|
||||||
|
<uni-link
|
||||||
|
:href="`mailto:${useIndex().appInfo.email}`"
|
||||||
|
:text="useIndex().appInfo.email"
|
||||||
|
color="#393c43"
|
||||||
|
:showUnderLine="false"
|
||||||
|
>
|
||||||
|
</uni-link>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="desc-item no-center">
|
<view class="desc-item no-center" @click="openWhatsApp">
|
||||||
<image class="icon" src="@/assets/images/icon/online.png"></image>
|
<image class="icon" src="@/assets/images/icon/online.png"></image>
|
||||||
<view class="desc">
|
<view class="desc">
|
||||||
<label>{{ $t('common.Online') }}</label>
|
<label>{{ $t('common.Online') }}</label>
|
||||||
<view>{{useIndex().appInfo.tel}}</view>
|
<view>{{useIndex().appInfo.whatsapp}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -40,16 +48,67 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useIndex } from '@/stores/index.js';
|
import { useIndex } from '@/stores/index.js';
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
const emits = defineEmits(['close'])
|
const emits = defineEmits(['close'])
|
||||||
|
|
||||||
|
const makePhone = () => {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber: useIndex().appInfo.tel,
|
||||||
|
fail: (err) => {
|
||||||
|
console.log(err)
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: useIndex().appInfo.tel,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const openWhatsApp = () => {
|
||||||
|
const installed = plus.runtime.isApplicationExist({
|
||||||
|
pname: "com.whatsapp",
|
||||||
|
action: "whatsapp://"
|
||||||
|
});
|
||||||
|
const whatsappUrl = `whatsapp://send?phone=${useIndex().appInfo.whatsapp}`;
|
||||||
|
const pname = "com.whatsapp";
|
||||||
|
if (installed) {
|
||||||
|
// 手机已安装 直接跳转
|
||||||
|
plus.runtime.openURL(whatsappUrl);
|
||||||
|
} else {
|
||||||
|
// 手机未安装,跳转到手机商城并搜索whatsapp (国内目前搜不到)
|
||||||
|
plus.nativeUI.actionSheet(
|
||||||
|
{
|
||||||
|
title: t('common.selectApp'),
|
||||||
|
cancel: t('common.cancel'),
|
||||||
|
buttons: [{ title: t('common.AppMarket') }],
|
||||||
|
},
|
||||||
|
function ({ index }) {
|
||||||
|
switch (index) {
|
||||||
|
case 1:
|
||||||
|
plus.runtime.openURL(
|
||||||
|
"market://details?id=" + pname,
|
||||||
|
function () {
|
||||||
|
// 手机没有应用市场
|
||||||
|
plus.nativeUI.alert(t('common.noApp'));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const goOnline = () => {
|
const goOnline = () => {
|
||||||
emits('close')
|
emits('close')
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/inquiry/index'
|
url: '/pages/inquiry/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -57,7 +57,10 @@
|
|||||||
"confirm": "confirm",
|
"confirm": "confirm",
|
||||||
"cancel": "cancel",
|
"cancel": "cancel",
|
||||||
"KindReminder": "KindReminder",
|
"KindReminder": "KindReminder",
|
||||||
"Loading": "Loading"
|
"Loading": "Loading",
|
||||||
|
"selectApp": "Select App",
|
||||||
|
"AppMarket": "App Market",
|
||||||
|
"noApp": "The specified application is not installed on this machine"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"Home": "Home",
|
"Home": "Home",
|
||||||
|
|||||||
@ -57,7 +57,10 @@
|
|||||||
"confirm": "确认",
|
"confirm": "确认",
|
||||||
"cancel": "取消",
|
"cancel": "取消",
|
||||||
"KindReminder": "温馨提示",
|
"KindReminder": "温馨提示",
|
||||||
"Loading": "加载中"
|
"Loading": "加载中",
|
||||||
|
"selectApp": "选择应用",
|
||||||
|
"AppMarket": "应用市场",
|
||||||
|
"noApp": "本机未安装指定的应用"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"Home": "首页",
|
"Home": "首页",
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import Tabs from "@/components/tabs.vue";
|
|||||||
import SuspensionBtn from "@/components/suspension-btn.vue";
|
import SuspensionBtn from "@/components/suspension-btn.vue";
|
||||||
import OnlineModal from "@/components/online-modal.vue";
|
import OnlineModal from "@/components/online-modal.vue";
|
||||||
import Apps from "@/components/apps.vue";
|
import Apps from "@/components/apps.vue";
|
||||||
|
import Empty from "@/components/empty.vue";
|
||||||
|
|
||||||
uni.$showTost = function (title='加载失败!',duration=1500,mask=false) {
|
uni.$showTost = function (title='加载失败!',duration=1500,mask=false) {
|
||||||
// 变成异步代码,处理一些特殊页面 必须等待消息提示结束后在做操作
|
// 变成异步代码,处理一些特殊页面 必须等待消息提示结束后在做操作
|
||||||
@ -47,6 +48,7 @@ export function createApp() {
|
|||||||
app.component('SuspensionBtn', SuspensionBtn)
|
app.component('SuspensionBtn', SuspensionBtn)
|
||||||
app.component('OnlineModal', OnlineModal)
|
app.component('OnlineModal', OnlineModal)
|
||||||
app.component('Apps', Apps)
|
app.component('Apps', Apps)
|
||||||
|
app.component('Empty', Empty)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
app,
|
app,
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
"name" : "HOWO",
|
"name" : "HOWO",
|
||||||
"appid" : "__UNI__DADC1D2",
|
"appid" : "__UNI__DADC1D2",
|
||||||
"description" : "Sinotruck Howo Sales Co.,Ltd is one of the most professional trailer, truck, trailer parts, truck parts manufacturers in China. Our factory brings here a great selection of truck for sale. Welcome to consult price with us.",
|
"description" : "Sinotruck Howo Sales Co.,Ltd is one of the most professional trailer, truck, trailer parts, truck parts manufacturers in China. Our factory brings here a great selection of truck for sale. Welcome to consult price with us.",
|
||||||
"versionName" : "1.0.1",
|
"versionName" : "1.0.4",
|
||||||
"versionCode" : 101,
|
"versionCode" : 104,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@ -20,7 +20,9 @@
|
|||||||
"ignoreVersion" : true
|
"ignoreVersion" : true
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules" : {},
|
"modules" : {
|
||||||
|
"Contacts" : {}
|
||||||
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
@ -40,7 +42,8 @@
|
|||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user