# Conflicts:
#	jiuyi2/common/js/config.js
#	jiuyi2/pages/mine/setting/usePay.vue
#	jiuyi2/pages/mine/switch-accounts/index.vue
#	jiuyi2/pages/news/news.vue
#	jiuyi2/vite.config.js
This commit is contained in:
sx 2025-02-21 18:01:09 +08:00
commit 409f137e89
14 changed files with 331 additions and 640 deletions

View File

@ -14,8 +14,6 @@ onLaunch(() => {
getUserinfo()
//
getConfig()
//
getNoReadNum()
})
//
@ -53,41 +51,6 @@ function getConfig() {
}
})
}
//
async function getNoReadNum() {
// uni.removeTabBarBadge({
// index: 2,
// text: "",
// });
// api.getNoReadNum().then(rs => {
// if (rs.code == 200) {
// uni.setTabBarBadge({
// index: 0,
// text: "11",
// });
// }
// })
// uni.setTabBarBadge({
// index: 2,
// text: "11",
// });
// const res = await uni.request({ url: 'API_URL' });
// const count = res.data.unread;
// setTimeout(() => {
// uni.setTabBarBadge({
// index: 1,
// text: '10',
// success: function () {
// console.log(11111);
// },
// })
// }, 1000)
}
</script>
<style lang="scss">

View File

@ -1427,6 +1427,7 @@ const util = {
uni.$emit('login')
setTimeout(() => {
util.loginTencent(userinfo)
uni.reLaunch({
url: '/pages/index/index'
})

View File

@ -138,6 +138,12 @@ const showMenu = computed(() => {
//
const noReadNum = ref(0)
const getReadNum = () => {
getNoReadNum()
}
defineExpose({ getReadNum })
//
onMounted(() => {
//
@ -245,7 +251,7 @@ function getNoReadNum() {
<view class="option" :class="{ active: item.page === page }" v-if="item.type == 'option'">
<text class="text">{{ item.name }}</text>
<span class="pot" v-if="item.page == 'news' && noReadNum != 0">{{ noReadNum }}</span>
<view class="pot" v-if="item.page == 'news' && noReadNum != 0">{{ noReadNum }}</view>
</view>
<view class="middle" v-else-if="item.type === 'middle'">
@ -351,15 +357,20 @@ $boderSize: 2rpx;
color: #999;
}
}
.option {
position: relative;
z-index: 1;
.pot {
position: absolute;
top: -16rpx;
right: -30rpx;
height: 24rpx;
/* #ifndef APP-NVUE */
min-width: 24rpx;
/* #endif */
line-height: 24rpx;
border-radius: 24rpx;
background: #FF6B17;
@ -367,7 +378,7 @@ $boderSize: 2rpx;
font-size: 20rpx;
padding: 4rpx;
text-align: center;
}
z-index: 11;
}
}

View File

@ -52,7 +52,7 @@
//
function removeListener() {
uni.$chat.off(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED);
uni.$chat.off(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED,()=>{});
}
//

View File

@ -93,28 +93,66 @@ function addListener() {
//
function removeListener() {
// #ifdef APP
uni.$chat.off(TencentCloudChat.EVENT.CONVERSATION_LIST_UPDATED);
// #endif
uni.$chat.off(TencentCloudChat.EVENT.CONVERSATION_LIST_UPDATED, () => { });
}
//
function getList() {
api.news.getMessageList({
query: {
userId: userinfo.value.id,
}
}).then(rs => {
if (rs.code == 200) {
// list.data = handleList(rs.data);
list.data = handleList(JSON.parse(rs.msg).SessionItem);
// sdk
let isReady = uni.$chat.isReady();
if (!isReady) {
setTimeout(function () {
getList();
}, 800);
return
}
util.alert({
content: rs.msg,
showCancel: false,
uni.$emit('updateNum', {})
uni.$chat.getConversationList().then(rs => {
let res = rs.data.conversationList
let arr = []
res.forEach(item => {
let obj = {}
obj.type = item.type;
obj.chatText = item.lastMessage.messageForShow;
obj.MsgTime = handleDate(item.lastMessage.lastTime);
obj.unreadCount = item.unreadCount;
if (item.type == 'C2C') {
obj.avatar = item.userProfile.avatar;
obj.name = item.userProfile.nick;
obj.userID = item.userProfile.userID;
} else if (item.type == 'GROUP') {
obj.avatar = item.groupProfile.avatar;
obj.name = item.groupProfile.name;
obj.num = item.groupProfile.memberCount;
obj.groupID = item.groupProfile.groupID;
}
arr.push(obj)
})
list.data = arr;
})
// api.news.getMessageList({
// query: {
// userId: userinfo.value.id,
// }
// }).then(rs => {
// if (rs.code == 200) {
// let msg = JSON.parse(rs.msg);
// list.data = handleList(msg.SessionItem);
// return
// }
// util.alert({
// content: rs.msg,
// showCancel: false,
// })
// })
}
/**
@ -130,7 +168,7 @@ function handleList(list) {
}, 800);
return
}
if (list) {
list.forEach(item => {
item.MsgTime = handleDate(item.MsgTime)
@ -151,6 +189,7 @@ function handleList(list) {
})
})
}
return list
}
@ -178,15 +217,15 @@ function handleList(list) {
function handleChat(item) {
let param = {};
//
if (item.groupId == null) {
if (item.type == 'C2C') {
param.type = 'C2C'
param.name = `${item.name}`
param.msgId = `${item.To_Account}`
param.msgId = `${item.userID}`
} else {
//
param.type = 'GROUP'
param.name = `${item.name}`
param.msgId = `${item.GroupId}`
param.msgId = `${item.groupID}`
param.num = `${item.num}`
}
@ -216,7 +255,7 @@ function delMsg(item) {
return
}
let conversationId = item.Type == 1 ? `C2C${item.To_Account}` : `GROUP${item.GroupId}`;
let conversationId = item.Type == 1 ? `C2C${item.userID}` : `GROUP${item.groupID}`;
uni.$chat.deleteConversation(conversationId).then(rs => {
getList()
@ -234,7 +273,7 @@ function setRead(item) {
return
}
let conversationId = item.Type == 1 ? `C2C${item.To_Account}` : `GROUP${item.GroupId}`;
let conversationId = item.Type == 1 ? `C2C${item.userID}` : `GROUP${item.groupID}`;
uni.$chat.setMessageRead({
conversationID: conversationId,
}).then(rs => {

View File

@ -226,7 +226,7 @@
color: #333;
background-color: #F7F7F7;
border-radius: 10rpx;
transition: .3s;
// transition: .3s;
border: 2rpx solid #F7F7F7;
.text {}
@ -244,7 +244,7 @@
//
&.disabled {
background-color: F7F7F7;
background-color: #F7F7F7;
.txt {
color: #999;

View File

@ -1,30 +0,0 @@
<!-- 商品管理 -->
<template>
<view class="jy-business-operator-order">
<JyCommonHead title="商品管理" isRight>
<template v-slot:right>
<view @click="right">添加</view>
</template>
</JyCommonHead>
<view class="p16">
<JyOrderCard v-for="(item, index) in 10" type="merchandise_control"></JyOrderCard>
</view>
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import {
onLoad,
onReachBottom
} from "@dcloudio/uni-app"
import JyCommonHead from '@/components/public/jy-common-head'
//
import JyOrderCard from '@/components/public/jy-order-card'
onReachBottom(() => {
//
})
</script>

View File

@ -1,155 +0,0 @@
<!-- 商品发布 -->
<template>
<view class="jy-commodity_release">
<!-- 商品图片多选 -->
<uni-forms :modelValue="paramsData">
<uni-forms-item class="vertical-label margins" label="商品图片" name="name">
<uni-file-picker :imageStyles="{
width: '150rpx',
height: '150rpx'
}" limit="9">
<view>
<image class="wh120" src="/static/shop-upload-image.png"></image>
</view>
</uni-file-picker>
</uni-forms-item>
<uni-forms-item class="vertical-label margins" labelPosition="top" label="商品标题" name="name">
<uni-easyinput type="textarea" autoHeight :inputBorder="false" maxlength="30"
placeholder="最多输入60字符30个汉字" />
</uni-forms-item>
<view class="margins mb20">
<uni-forms-item label="类目" name="name">
<view class="df jcsb aic hohp" @click="category.open()">
<text class="click_select">点击选择</text>
<uni-icons color="#d8d8d8" type="arrowright" size="18" />
</view>
<JyPopup ref="category" title="请选择申请原因" :showSave="false">
<view class="reason-list" v-for="item in 10" @click="selectReason(item)">
<text class="label">{{ item }}</text>
</view>
</JyPopup>
</uni-forms-item>
<uni-forms-item label="规格" name="name">
<text class="click_select hohp df aic" @click="addSpecifications">添加规格</text>
<!-- <uni-easyinput class="hohp df aic" type="text" :inputBorder="false" placeholder="" /> -->
</uni-forms-item>
<uni-forms-item label="价格" name="name">
<uni-easyinput class="hohp df aic" type="number" :inputBorder="false" placeholder="¥0.00" />
</uni-forms-item>
<uni-forms-item label="库存" name="name">
<uni-easyinput class="hohp df aic" type="number" :inputBorder="false" placeholder="输入库存" />
</uni-forms-item>
</view>
<uni-forms-item class="margins" label="发货" name="name">
<view class="df jcsb aic hohp">
<text class="click_select">点击选择</text>
<uni-icons color="#d8d8d8" type="arrowright" size="18" />
</view>
<JyPopup ref="category" title="发货" :showSave="false">
<uni-forms :modelValue="paramsDeliveryData">
<uni-forms-item label="发货时间" name="name">
<uni-easyinput class="hohp df aic" type="text" :inputBorder="false" placeholder="输入时间" />
</uni-forms-item>
<uni-forms-item label="运费" name="name">
<uni-easyinput class="hohp df aic" type="text" :inputBorder="false" placeholder="输入运费" />
</uni-forms-item>
<uni-forms-item label="所在地" name="name">
<uni-easyinput class="hohp df aic" type="text" :inputBorder="false" placeholder="输入省,市,区" />
</uni-forms-item>
</uni-forms>
</JyPopup>
</uni-forms-item>
<uni-forms-item class="margins" name="name">
<view class="df jcsb aic hohp">
<view class="df aic hohp">
<image class="wh50 mr40" src="/static/commodity-release-video.png" mode="aspectFit" />
<text>添加链接到视频</text>
</view>
<uni-icons color="#d8d8d8" type="arrowright" size="18" />
</view>
</uni-forms-item>
</uni-forms>
</view>
<!-- 立即发布 -->
<JyBottomBtn @click="postApi">立即发布</JyBottomBtn>
</template>
<script setup>
import { ref, reactive, inject, onMounted, onUnmounted } from 'vue'
import JyBottomBtn from '@/components/public/jy-bottom-button'
import JyPopup from '@/components/public/jy-popup'
const { checkLink } = inject('util');
import { eventBus } from '@/components/public/event-bus'
onMounted(() => {
eventBus.on('business-operator', businessOperator)
})
onUnmounted(() => {
eventBus.off('business-operator')
});
const businessOperator = (value) => {
console.log('====================================');
console.log(value);
console.log('====================================');
}
const category = ref(null)
const paramsData = reactive({
name: ''
})
const paramsDeliveryData = reactive({
name: ''
})
const postApi = () => {
uni.showToast({
title: '发布成功',
icon: 'none'
})
}
const addSpecifications = () => {
checkLink('pages/merchant/specifications/index')
}
</script>
<style scoped lang="scss">
.jy-commodity_release {
padding: 26rpx;
.vertical-label {
display: flex;
flex-direction: column !important;
}
.uni-forms-item {
margin-bottom: 20rpx !important;
}
::v-deep .file-picker__box-content {
border: none !important;
}
::v-deep .uni-easyinput {
.uni-easyinput__content-input {
padding: 0px !important;
}
.uni-input-placeholder {
display: flex;
align-items: center;
color: #c9c9c9 !important;
font-size: 28rpx !important;
height: 100%;
}
}
.margins {
padding: 16rpx 24rpx;
border-radius: 20rpx;
background-color: #ffffff;
}
.click_select {
color: #C9C9C9;
}
}
</style>

View File

@ -1,68 +0,0 @@
<!-- 我的订单 -->
<template>
<view class="jy-business-operator-order">
<JyCommonHead>
<template v-slot:center>
<uni-easyinput prefixIcon="search" v-model="value" placeholder="搜索内容" />
</template>
</JyCommonHead>
<JyShopNavigation :current="params.currentTab" :list="tabs" @tabItemClick="itemClick" marright="25px"
activeWeight='600' activeColor="#333333" activeBarColor="initial" />
<view class="p16">
<JyOrderCard v-for="(item, index) in 10" type="business_order"></JyOrderCard>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from "@dcloudio/uni-app"
import JyCommonHead from '@/components/public/jy-common-head'
//
import JyShopNavigation from '@/components/public/jy-shop-navigation'
import JyOrderCard from '@/components/public/jy-order-card'
import { onReachBottom } from '@dcloudio/uni-app';
onReachBottom(() => {
console.log('====================================');
console.log("加载到底了通知刷新");
console.log('====================================');
})
const itemClick = (item, index) => {
}
const tabs = ref([{
id: 1,
name: '全部'
},
{
id: 2,
name: '待付款'
},
{
id: 3,
name: '待发货'
},
{
id: 4,
name: '待收货'
},
{
id: 6,
name: '售后/退款'
}])
const value = ref('')
const params = ref({
currentTab: 0
})
//
onLoad(options => {
params.value.currentTab = options.currentTab / 1
})
</script>
<style scoped lang="scss">
.jy-order {
::v-deep .uni-easyinput__content {
border-radius: 18rpx;
width: 542rpx;
}
}
</style>

View File

@ -1,33 +0,0 @@
<!-- 规格 -->
<template>
<view class="jy-specifications p25">
<JyCommonHead title="商品管理" @back="sendCommodity">
<template v-slot:right>
<text @click="add">添加</text>
</template>
</JyCommonHead>
<view v-if="list.length > 0">
<JySpecificationsCard class="mt20" v-for="(item, index) in list" :key="index" :item="item">
</JySpecificationsCard>
</view>
</view>
<JyBottomBtn @click="postApi">确定</JyBottomBtn>
</template>
<script setup>
import { ref } from 'vue'
import JyCommonHead from '@/components/public/jy-common-head'
import JySpecificationsCard from './jy-specifications-card'
import { eventBus } from '@/components/public/event-bus.js'
import JyBottomBtn from '@/components/public/jy-bottom-button'
const list = ref([{}])
const sendCommodity = () => {
eventBus.emit('business-operator', list.value)
uni.navigateBack();
}
const add = () => {
list.value.push({})
}
</script>
<style scoped lang="scss"></style>

View File

@ -1,51 +0,0 @@
<!-- 规格卡片 -->
<template>
<view class="jy-specifications-card bfff p25 br25">
<uni-forms :modelValue="paramsData">
<uni-forms-item label="商品图片" name="name">
<uni-file-picker :imageStyles="{
width: '150rpx',
height: '150rpx'
}" limit="9">
<uni-icons type="camera" color="#B2B2B2" size="60"></uni-icons>
</uni-file-picker>
</uni-forms-item>
<uni-forms-item label="规格" name="name">
<uni-easyinput class="hohp df aic" type="text" :inputBorder="false" placeholder="输入规格" />
</uni-forms-item>
<view class="df">
<uni-forms-item label="价格" name="name">
<uni-easyinput class="hohp df aic" type="number" :inputBorder="false" placeholder="¥0.00" />
</uni-forms-item>
<uni-forms-item label="库存" name="name">
<uni-easyinput class="hohp df aic" type="number" :inputBorder="false" placeholder="输入库存" />
</uni-forms-item>
</view>
</uni-forms>
</view>
</template>
<script setup>
import { ref } from 'vue'
const props = defineProps({
item: {
type: Object,
default: () => ({})
}
})
const paramsData = ref({})
</script>
<style scoped lang="scss">
.jy-specifications-card {
::v-deep .uni-forms-item {
margin-bottom: 16rpx !important;
.uni-forms-item__content {
display: flex !important;
align-items: center !important;
}
}
}
</style>

View File

@ -59,7 +59,7 @@
//
function removeListener() {
uni.$chat.off(TencentCloudChat.EVENT.GROUP_LIST_UPDATED);
uni.$chat.off(TencentCloudChat.EVENT.GROUP_LIST_UPDATED,()=>{});
}
//

View File

@ -33,10 +33,11 @@
// vuex
const store = useStore()
//
const menuList = reactive([{
const menuList = reactive([
{
key: 'group',
name: '即时消息',
load: true,
load: false,
}, {
key: 'friend',
name: '通讯录',
@ -67,6 +68,7 @@
const menuCurrent = computed(() => {
return menuList[menuIndex.value]
})
const footerMneuRef = ref()
onLoad(() => {
//
@ -74,6 +76,11 @@
//
addListener()
//
uni.$on('updateNum', (val) => {
getNoRead()
})
})
onUnload(() => {
@ -81,6 +88,12 @@
removeListener()
})
function getNoRead() {
setTimeout(() => {
footerMneuRef.value.getReadNum();
}, 200)
}
//
function addListener() {
uni.$chat.on(TencentCloudChat.EVENT.SDK_READY, imLoading);
@ -93,7 +106,9 @@
//
function removeListener() {
// #ifdef APP
uni.$chat.off(TencentCloudChat.EVENT.SDK_READY,()=>{});
// #endif
}
/**
@ -198,7 +213,7 @@
<swiper class="swiper" :current="menuIndex" disable-touch="true">
<!-- 群组 -->
<swiper-item>
<msgList v-if="menuList[0].load" :type="menuIndex" />
<msgList v-if="menuList[0].load" :type="menuIndex" @updateNum="updateNum" />
<view class="loading" v-else>正在加载</view>
</swiper-item>
@ -210,13 +225,13 @@
<!-- 视频消息 -->
<swiper-item>
<msgList v-if="menuList[2].load" :type="menuIndex" />
<msgList v-if="menuList[2].load" :type="menuIndex" @updateNum="updateNum" />
<view class="loading" v-else>正在加载</view>
</swiper-item>
<!-- 商城消息 -->
<swiper-item>
<msgList v-if="menuList[3].load" :type="menuIndex" />
<msgList v-if="menuList[3].load" :type="menuIndex" @updateNum="updateNum" />
</swiper-item>
</swiper>
</view>

View File

@ -43,7 +43,6 @@ import {
statusBarHeight,
goBack
} from '@/components/public/Mixins.js'
import JyCommonHead from '@/components/public/jy-common-head'
import { shareToPlatform } from '@/components/public/share.js'
const share_more = ref(null)
const more_share_data = ref([])