1. 弹窗点击对应操作 --- 已完成
This commit is contained in:
parent
bb0aeef750
commit
c33268d851
@ -7,13 +7,15 @@
|
||||
</script>
|
||||
|
||||
<script setup>
|
||||
import { onLaunch } from "@dcloudio/uni-app";
|
||||
import { onLaunch, onShow } from "@dcloudio/uni-app";
|
||||
import { ref } from "vue";
|
||||
import { useIndex } from '@/stores/index.js'
|
||||
|
||||
onShow(() => {
|
||||
useIndex().getAppInfo()
|
||||
})
|
||||
onLaunch( async(e) => {
|
||||
useIndex().menuInit()
|
||||
useIndex().getAppInfo()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
@ -27,6 +27,7 @@
|
||||
:inputBorder="false"
|
||||
:clearable="false"
|
||||
:adjust-position="false"
|
||||
:disabled="isInputDisabled"
|
||||
:focus="inputFocus"
|
||||
v-model="sendVal"
|
||||
trim="both"
|
||||
@ -50,7 +51,7 @@
|
||||
|
||||
<script setup>
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app';
|
||||
import { ref, nextTick } from 'vue';
|
||||
import { ref, nextTick, computed } from 'vue';
|
||||
import dayJs from 'dayjs';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useScoketMsg } from '@/stores/index.js';
|
||||
@ -63,6 +64,15 @@
|
||||
|
||||
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 sendVal = ref('')
|
||||
const send = async () => {
|
||||
|
@ -1,18 +1,21 @@
|
||||
<template>
|
||||
<view class="pages">
|
||||
<view
|
||||
class="prod-item"
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
@click="goDetails(item)"
|
||||
>
|
||||
<view class="cover">
|
||||
<image :src="item.mainPic"></image>
|
||||
</view>
|
||||
<view class="title text-ellipsis">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="list.length">
|
||||
<view
|
||||
class="prod-item"
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
@click="goDetails(item)"
|
||||
>
|
||||
<view class="cover">
|
||||
<image :src="item.mainPic"></image>
|
||||
</view>
|
||||
<view class="title text-ellipsis">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<Empty v-else />
|
||||
</view>
|
||||
</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')}}
|
||||
</view>
|
||||
<view class="contact-box">
|
||||
<view class="desc-item">
|
||||
<view class="desc-item" @click="makePhone">
|
||||
<image class="icon" src="@/assets/images/icon/phone2.png"></image>
|
||||
<view class="desc">
|
||||
<label>{{ $t('contactUs.contactUs') }}</label>
|
||||
@ -17,15 +17,23 @@
|
||||
<image class="icon" src="@/assets/images/icon/mail2.png"></image>
|
||||
<view class="desc">
|
||||
<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 class="desc-item no-center">
|
||||
<view class="desc-item no-center" @click="openWhatsApp">
|
||||
<image class="icon" src="@/assets/images/icon/online.png"></image>
|
||||
<view class="desc">
|
||||
<label>{{ $t('common.Online') }}</label>
|
||||
<view>{{useIndex().appInfo.tel}}</view>
|
||||
<view>{{useIndex().appInfo.whatsapp}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -40,16 +48,67 @@
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useIndex } from '@/stores/index.js';
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
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 = () => {
|
||||
emits('close')
|
||||
uni.switchTab({
|
||||
url: '/pages/inquiry/index'
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -57,7 +57,10 @@
|
||||
"confirm": "confirm",
|
||||
"cancel": "cancel",
|
||||
"KindReminder": "KindReminder",
|
||||
"Loading": "Loading"
|
||||
"Loading": "Loading",
|
||||
"selectApp": "Select App",
|
||||
"AppMarket": "App Market",
|
||||
"noApp": "The specified application is not installed on this machine"
|
||||
},
|
||||
"menu": {
|
||||
"Home": "Home",
|
||||
|
@ -57,7 +57,10 @@
|
||||
"confirm": "确认",
|
||||
"cancel": "取消",
|
||||
"KindReminder": "温馨提示",
|
||||
"Loading": "加载中"
|
||||
"Loading": "加载中",
|
||||
"selectApp": "选择应用",
|
||||
"AppMarket": "应用市场",
|
||||
"noApp": "本机未安装指定的应用"
|
||||
},
|
||||
"menu": {
|
||||
"Home": "首页",
|
||||
|
@ -10,6 +10,7 @@ import Tabs from "@/components/tabs.vue";
|
||||
import SuspensionBtn from "@/components/suspension-btn.vue";
|
||||
import OnlineModal from "@/components/online-modal.vue";
|
||||
import Apps from "@/components/apps.vue";
|
||||
import Empty from "@/components/empty.vue";
|
||||
|
||||
uni.$showTost = function (title='加载失败!',duration=1500,mask=false) {
|
||||
// 变成异步代码,处理一些特殊页面 必须等待消息提示结束后在做操作
|
||||
@ -47,6 +48,7 @@ export function createApp() {
|
||||
app.component('SuspensionBtn', SuspensionBtn)
|
||||
app.component('OnlineModal', OnlineModal)
|
||||
app.component('Apps', Apps)
|
||||
app.component('Empty', Empty)
|
||||
|
||||
return {
|
||||
app,
|
||||
|
@ -2,8 +2,8 @@
|
||||
"name" : "HOWO",
|
||||
"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.",
|
||||
"versionName" : "1.0.1",
|
||||
"versionCode" : 101,
|
||||
"versionName" : "1.0.4",
|
||||
"versionCode" : 104,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
@ -20,7 +20,9 @@
|
||||
"ignoreVersion" : true
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {},
|
||||
"modules" : {
|
||||
"Contacts" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
@ -40,7 +42,8 @@
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<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打包配置 */
|
||||
|
Loading…
Reference in New Issue
Block a user