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