完成京东购物
This commit is contained in:
parent
52af4ca4ff
commit
21eb405746
|
|
@ -4,7 +4,7 @@
|
||||||
<view class="nav-bar-box" :class="{ 'border-nav-bar-box': isScroll }">
|
<view class="nav-bar-box" :class="{ 'border-nav-bar-box': isScroll }">
|
||||||
<NavBar :isBack="false" :bgColor="isScroll ? data.navBar.bgColor : '#fff'" :buttonGroup="buttonGroup"
|
<NavBar :isBack="false" :bgColor="isScroll ? data.navBar.bgColor : '#fff'" :buttonGroup="buttonGroup"
|
||||||
@button-click="util.clickTitlePopupButton" tipLayerType="message-list-tip" isTipLayer
|
@button-click="util.clickTitlePopupButton" tipLayerType="message-list-tip" isTipLayer
|
||||||
tipLayerText="添加短信" @add="emit('add')">
|
isClickNavBarOpenPopup tipLayerText="添加短信" @add="emit('add')">
|
||||||
<!-- 左侧文字图标 -->
|
<!-- 左侧文字图标 -->
|
||||||
<template v-slot:left>
|
<template v-slot:left>
|
||||||
<view v-if="phone == 'iphone'" class="flex flex-align-center">
|
<view v-if="phone == 'iphone'" class="flex flex-align-center">
|
||||||
|
|
@ -125,6 +125,10 @@ const props = defineProps({
|
||||||
isScroll: {
|
isScroll: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
noticeCount: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -158,7 +162,8 @@ const data = reactive({
|
||||||
navBar: {
|
navBar: {
|
||||||
title: '信息',
|
title: '信息',
|
||||||
bgColor: '#FFFFFF',
|
bgColor: '#FFFFFF',
|
||||||
}
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 展示文字信息
|
// 展示文字信息
|
||||||
|
|
@ -185,7 +190,7 @@ const showInfo = computed(() => {
|
||||||
case "huawei":
|
case "huawei":
|
||||||
text = "信息"
|
text = "信息"
|
||||||
placeholder = '搜索信息'
|
placeholder = '搜索信息'
|
||||||
secondText = "388 条未读"
|
secondText = props.noticeCount > 0 ? `${props.noticeCount} 条未读` : ''
|
||||||
break;
|
break;
|
||||||
case "vivo":
|
case "vivo":
|
||||||
placeholder = '搜索信息'
|
placeholder = '搜索信息'
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<uni-nav-bar backgroundColor="#00000000" class="nav-bar" :border="false" :title="title" v-bind="$attrs"
|
<uni-nav-bar backgroundColor="#00000000" class="nav-bar" :border="false" :title="title" v-bind="$attrs"
|
||||||
v-on="$attrs">
|
v-on="$attrs">
|
||||||
<template v-slot:left>
|
<template v-slot:left>
|
||||||
<view class="nav-bar-left">
|
<view class="nav-bar-left" @click.stop="isClickNavBarOpenPopup ? openPopup() : ''">
|
||||||
<slot name="left">
|
<slot name="left">
|
||||||
<view v-if="isBack" class="left-icon" @click.stop="onBack">
|
<view v-if="isBack" class="left-icon" @click.stop="onBack">
|
||||||
<image class="nav-icon-back"
|
<image class="nav-icon-back"
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
</slot>
|
</slot>
|
||||||
</view>
|
</view>
|
||||||
<template v-slot:right>
|
<template v-slot:right>
|
||||||
<view class="nav-bar-right" @click.stop="onRightClick">
|
<view class="nav-bar-right" @click.stop="isClickNavBarOpenPopup ? openPopup() : onRightClick()">
|
||||||
<slot name="right">
|
<slot name="right">
|
||||||
<view v-if="isRightIcon" class="right-icon">
|
<view v-if="isRightIcon" class="right-icon">
|
||||||
<image class="nav-icon-more"
|
<image class="nav-icon-more"
|
||||||
|
|
@ -145,6 +145,10 @@ const props = defineProps({
|
||||||
tipLayerType: {
|
tipLayerType: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
isClickNavBarOpenPopup: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
2
main.js
2
main.js
|
|
@ -27,7 +27,7 @@ export function createApp() {
|
||||||
const systemInfo = uni.getStorageSync('systemInfo') || {}
|
const systemInfo = uni.getStorageSync('systemInfo') || {}
|
||||||
app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android'
|
app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android'
|
||||||
app.config.globalProperties.$systemInfo = systemInfo
|
app.config.globalProperties.$systemInfo = systemInfo
|
||||||
uni.setStorageSync('version', '1.0.4.sp3')
|
uni.setStorageSync('version', '1.0.4.sp4')
|
||||||
app.config.globalProperties.$version = uni.getStorageSync('version')
|
app.config.globalProperties.$version = uni.getStorageSync('version')
|
||||||
app.use(globalMethods);
|
app.use(globalMethods);
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<MessageNavBar :phone="data.phone" :isScroll="data.isScroll" @add="openAddPopup" @setSim="setSim"
|
<MessageNavBar :phone="data.phone" :isScroll="data.isScroll" @add="openAddPopup" @setSim="setSim"
|
||||||
@setNoticeCount="setNoticeCount">
|
:noticeCount="allNoticeCount" @setNoticeCount="setNoticeCount">
|
||||||
<view v-if="data.phone == 'huawei'" class="huawei-notice">
|
<view v-if="data.phone == 'huawei'" class="huawei-notice">
|
||||||
<view class="img-box">
|
<view class="img-box">
|
||||||
<image class="img" src="/static/image/phone-message/huawei/notice.png" mode="aspectFill"></image>
|
<image class="img" src="/static/image/phone-message/huawei/notice.png" mode="aspectFill"></image>
|
||||||
|
|
@ -134,7 +134,8 @@ import MessageList from '@/components/message/list/list.vue'
|
||||||
import defaultData from './defaultData.json'
|
import defaultData from './defaultData.json'
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive
|
reactive,
|
||||||
|
computed
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
|
|
@ -170,6 +171,16 @@ const STORAGE_KEY = 'message_list'
|
||||||
const SIM_STORAGE_KEY = 'sim_info'
|
const SIM_STORAGE_KEY = 'sim_info'
|
||||||
const NOTICE_COUNT_KEY = 'huawei_notice_count'
|
const NOTICE_COUNT_KEY = 'huawei_notice_count'
|
||||||
|
|
||||||
|
const allNoticeCount = computed(() => {
|
||||||
|
let count = 0
|
||||||
|
defaultList.value.forEach(element => {
|
||||||
|
if (element.unRead) {
|
||||||
|
count += element.unReadNumber
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Number(data.noticeCount) + Number(count)
|
||||||
|
})
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
if (options.phone) {
|
if (options.phone) {
|
||||||
data.phone = options.phone
|
data.phone = options.phone
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,22 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, getCurrentInstance } from 'vue';
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
if (options.phone) {
|
||||||
|
data.phone = options.phone
|
||||||
|
}
|
||||||
|
proxy.$apiUserEvent('all', {
|
||||||
|
type: 'event',
|
||||||
|
key: 'shopping',
|
||||||
|
prefix: '.uni.other.',
|
||||||
|
value: '购物'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const menuList = ref([
|
const menuList = ref([
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@
|
||||||
:class="{ active: currentFilter === index, disabled: item.disabled }"
|
:class="{ active: currentFilter === index, disabled: item.disabled }"
|
||||||
@click="switchFilter(index)">
|
@click="switchFilter(index)">
|
||||||
<text class="text">{{ item.name }}</text>
|
<text class="text">{{ item.name }}</text>
|
||||||
<text class="close-icon" v-if="currentFilter === index">×</text>
|
<text class="close-icon" :style="{ marginTop: $system == 'iOS' ? '-4rpx' : '-2rpx' }"
|
||||||
|
v-if="currentFilter === index">×</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
@ -899,6 +900,10 @@ const mockOrderList = ref([
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #F51919;
|
color: #F51919;
|
||||||
|
|
@ -961,13 +966,14 @@ const mockOrderList = ref([
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
line-height: 26rpx;
|
||||||
color: #1A1A1A;
|
color: #1A1A1A;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-icon {
|
.close-icon {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
color: #E40C24;
|
color: #E40C24;
|
||||||
margin-top: -10rpx;
|
margin-top: -4rpx;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
margin-left: 6rpx;
|
margin-left: 6rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue