Compare commits

...

6 Commits

Author SHA1 Message Date
lr e290d77397 消息列表 2025-02-20 15:12:53 +08:00
sx b33123604d 合并代码 2025-02-19 18:45:15 +08:00
sx eff7819402 合并代码 2025-02-19 18:04:30 +08:00
sx 9fd01b453f Merge branch 'lr' of http://1.94.221.165:3000/sx/jiuyiUniapp 2025-02-19 18:03:14 +08:00
sx a3f0bb6703 2025 02 19 工作代码提交 2025-02-19 18:02:15 +08:00
sx 0ee1576f8b 2025 02 19 工作代码提交
榴莲果树兑换和样式 卷轴兑换流程
2025-02-19 16:54:49 +08:00
22 changed files with 932 additions and 807 deletions

View File

@ -23,6 +23,7 @@ export const durian = {
url: `/coreplay/durianfruitdetail/getDetailInfoByTreeId`,
method: 'GET',
query: param.query,
load: true,
})
},
/**
@ -34,6 +35,7 @@ export const durian = {
url: `/coreplay/duriantreeinfo/boughtListByUser`,
method: 'GET',
query: param.query,
load: true,
})
},
/**

View File

@ -99,6 +99,7 @@ const intergral = {
method: 'POST',
query: param.query,
data: param.data,
load: true,
})
},

View File

@ -208,10 +208,11 @@ export const news = {
})
},
// 群聊发消息
// 消息列表
getMessageList(param) {
return util.request({
url: `/user/chat/getMessageList`,
// url: `/user/chat/getMessageList`,
url: `/user/chat/getMsgListById`,
query: param.query,
data: param.data,
method: 'GET'

View File

@ -6,9 +6,7 @@ const config = {
// host: 'h5api',
// #endif
// #ifndef H5
// host: 'http://91f.xyz:8080',
host: 'https://b433d23.r24.cpolar.top/',
// host: 'http://hvw2rn.natappfree.cc',
host: 'http://91f.xyz:8080',
// #endif
// 支付方式配置
payType: {

View File

@ -15,6 +15,9 @@ import {
reactive,
watch,
} from 'vue'
import {
onLoad,
} from "@dcloudio/uni-app"
//
import util from '@/common/js/util';
const {
@ -149,6 +152,8 @@ onMounted(() => {
//
// proxy.$refs.alert.open()
})
onLoad(()=>{
//
getNoReadNum()
})
@ -182,6 +187,7 @@ function handleMenu(item) {
else uni.navigateTo({
url: `/${item.pagePath}`,
})
getNoReadNum()
return
}
//
@ -221,9 +227,10 @@ function getNoReadNum() {
return
}
const unreadCount = uni.$chat.getTotalUnreadMessageCount();
// #ifdef APP
const unreadCount = uni.$chat.getTotalUnreadMessageCount();
noReadNum.value = +unreadCount > 99 ? '99+' : unreadCount;
// #endif
}
</script>

View File

@ -43,9 +43,11 @@
})
onBeforeUnmount(() => {
// #ifdef APP
uni.offKeyboardHeightChange(rs => {
console.log('rs', rs)
})
// #endif
})
/**

View File

@ -47,7 +47,7 @@
<view class="task pr mtb30 ptb20 plr40 f28 bFFFBF3 br20">
<view class="title c333 f36" v-if="task.taskType === 0">任务读秒</view>
<view class="title c333 f36" v-else>有效读秒</view>
<view>{{task.viewingDuration}}</view>
<!-- <view>{{task.viewingDuration}}</view> -->
<view class="progressBox oh bar mt60">
<view class="progress bar" :style="{width: progress + '%'}"></view>

View File

@ -1,430 +1,433 @@
<script setup>
/**
* 通讯录
*/
import {
useStore,
} from 'vuex'
import {
ref,
computed,
reactive,
onMounted,
onUnmounted,
inject,
getCurrentInstance,
} from 'vue'
//
import util from '@/common/js/util.js'
//
import TencentCloudChat from '@tencentcloud/chat';
// api
import api from '@/api/index.js'
import pinyin from 'js-pinyin'
import {
forEach
} from 'lodash';
const {
proxy
} = getCurrentInstance();
const store = useStore()
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
const msgType = {}
//
const userList = reactive({
data: [],
pageNum: 1,
pageSize: 10,
total: 0,
})
//
let user = reactive({})
//
const listKey = ref('')
//
const letterList = [{
key: 'other',
name: '#',
},
{
key: 'a',
name: 'A',
},
{
key: 'b',
name: 'B',
},
{
key: 'c',
name: 'C',
},
{
key: 'd',
name: 'D',
},
{
key: 'e',
name: 'E',
},
{
key: 'f',
name: 'F',
},
{
key: 'g',
name: 'G',
},
{
key: 'h',
name: 'H',
},
{
key: 'i',
name: 'I',
},
{
key: 'j',
name: 'J',
},
{
key: 'k',
name: 'K',
},
{
key: 'l',
name: 'L',
},
{
key: 'm',
name: 'M',
},
{
key: 'n',
name: 'N',
},
{
key: 'o',
name: 'O',
},
{
key: 'p',
name: 'P',
},
{
key: 'q',
name: 'Q',
},
{
key: 'r',
name: 'R',
},
{
key: 's',
name: 'S',
},
{
key: 't',
name: 'T',
},
{
key: 'u',
name: 'U',
},
{
key: 'v',
name: 'V',
},
{
key: 'w',
name: 'W',
},
{
key: 'x',
name: 'X',
},
{
key: 'y',
name: 'Y',
},
{
key: 'z',
name: 'Z',
},
]
//
const touchmove = ref(false)
// dom
const letterDom = reactive({
itemHeight: 0,
minHeight: 0,
maxHeight: 0,
height: 0,
})
//
const rightOption = [{
text: '删除',
style: {
backgroundColor: '#F85050'
},
fn: (user) => delFriend(user),
},
// {
// text: '',
// style: {
// backgroundColor: '#10C100'
// },
// fn: (user) => setFriendNote(user),
// },
]
onMounted(() => {
//
getFriendList()
//
getLetterProperty()
//
addlistener()
// proxy.$refs.note.open()
})
onUnmounted(() => {
removelistener()
})
const viewData = ref([])
//
function addlistener() {
let onFriendListUpdated = (event) => {
console.log('onFriendListUpdated', event.data);
getFriendList()
}
uni.$chat.on(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED, onFriendListUpdated);
}
//
function removelistener() {
uni.$chat.off(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED, () => {});
}
/**
* 通讯录
*/
import {
useStore,
} from 'vuex'
import {
ref,
computed,
reactive,
onMounted,
onUnmounted,
inject,
getCurrentInstance,
} from 'vue'
//
import util from '@/common/js/util.js'
//
import TencentCloudChat from '@tencentcloud/chat';
// api
import api from '@/api/index.js'
import pinyin from 'js-pinyin'
import {
forEach
} from 'lodash';
const {
proxy
} = getCurrentInstance();
const store = useStore()
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
const msgType = {}
//
const userList = reactive({
data: [],
pageNum: 1,
pageSize: 10,
total: 0,
})
//
let user = reactive({})
//
const listKey = ref('')
//
const letterList = [{
key: 'other',
name: '#',
},
{
key: 'a',
name: 'A',
},
{
key: 'b',
name: 'B',
},
{
key: 'c',
name: 'C',
},
{
key: 'd',
name: 'D',
},
{
key: 'e',
name: 'E',
},
{
key: 'f',
name: 'F',
},
{
key: 'g',
name: 'G',
},
{
key: 'h',
name: 'H',
},
{
key: 'i',
name: 'I',
},
{
key: 'j',
name: 'J',
},
{
key: 'k',
name: 'K',
},
{
key: 'l',
name: 'L',
},
{
key: 'm',
name: 'M',
},
{
key: 'n',
name: 'N',
},
{
key: 'o',
name: 'O',
},
{
key: 'p',
name: 'P',
},
{
key: 'q',
name: 'Q',
},
{
key: 'r',
name: 'R',
},
{
key: 's',
name: 'S',
},
{
key: 't',
name: 'T',
},
{
key: 'u',
name: 'U',
},
{
key: 'v',
name: 'V',
},
{
key: 'w',
name: 'W',
},
{
key: 'x',
name: 'X',
},
{
key: 'y',
name: 'Y',
},
{
key: 'z',
name: 'Z',
},
]
//
const touchmove = ref(false)
// dom
const letterDom = reactive({
itemHeight: 0,
minHeight: 0,
maxHeight: 0,
height: 0,
})
//
const rightOption = [{
text: '删除',
style: {
backgroundColor: '#F85050'
},
fn: (user) => delFriend(user),
},
// {
// text: '',
// style: {
// backgroundColor: '#10C100'
// },
// fn: (user) => setFriendNote(user),
// },
]
onMounted(() => {
//
function getFriendList() {
// sdk
let isReady = uni.$chat.isReady();
console.log('getFriendList', isReady)
getFriendList()
//
getLetterProperty()
//
addlistener()
if (!isReady) {
setTimeout(function() {
getFriendList()
}, 500);
// proxy.$refs.note.open()
})
onUnmounted(() => {
removelistener()
})
const viewData = ref([])
//
function addlistener() {
let onFriendListUpdated = (event) => {
console.log('onFriendListUpdated', event.data);
getFriendList()
}
// #ifdef APP
uni.$chat.on(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED, onFriendListUpdated);
// #endif
}
//
function removelistener() {
// #ifdef APP
uni.$chat.off(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED, () => { });
// #endif
}
//
function getFriendList() {
// sdk
let isReady = uni.$chat.isReady();
console.log('getFriendList', isReady)
if (!isReady) {
setTimeout(function () {
getFriendList()
}, 500);
return
}
//
api.news.getFriendList().then(rs => {
if (rs.code == 200) {
const result = rs.data
userList.data.length = 0
userList.data = handleUserList(result)
return
}
console.log('getFriendList')
//
api.news.getFriendList().then(rs => {
if (rs.code == 200) {
const result = rs.data
userList.data.length = 0
userList.data = handleUserList(result)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
util.alert({
content: rs.msg,
showCancel: false,
})
}
})
}
/**
* 用户列表排序
* @param {Object} userList
*/
function handleUserList(userList) {
//
const userArr = []
//
for (let i = 0; i < userList.length; i++) {
const user = userList[i]
//
let char = pinyin.getCamelChars(user.remark || user.userNickname);
//
const letter = char.charAt(0)
//
let find_index = userArr.findIndex(item => {
return item.key === letter
/**
* 用户列表排序
* @param {Object} userList
*/
function handleUserList(userList) {
//
const userArr = []
//
for (let i = 0; i < userList.length; i++) {
const user = userList[i]
//
let char = pinyin.getCamelChars(user.remark || user.userNickname);
//
const letter = char.charAt(0)
//
let find_index = userArr.findIndex(item => {
return item.key === letter
})
//
if (find_index == -1) {
userArr.push({
letter: letter,
key: letter,
child: [user]
})
//
if (find_index == -1) {
userArr.push({
letter: letter,
key: letter,
child: [user]
})
} else {
userArr[find_index].child.push(user)
}
} else {
userArr[find_index].child.push(user)
}
//
// userArr.sort((a, b) => {
// const surnameA = a.key;
// const surnameB = b.key;
// return surnameA.localeCompare(surnameB);
// });
return userArr;
}
//
// userArr.sort((a, b) => {
// const surnameA = a.key;
// const surnameB = b.key;
// return surnameA.localeCompare(surnameB);
// });
return userArr;
}
//
function getLetterProperty() {
const query = uni.createSelectorQuery().in(proxy);
query.select(".letterBox").boundingClientRect((data) => {
letterDom.minHeight = data.top
letterDom.height = data.height
letterDom.maxHeight = data.bottom
letterDom.itemHeight = data.height / letterList.length
}).exec();
}
//
function getLetterProperty() {
const query = uni.createSelectorQuery().in(proxy);
//
function handleTouchStart(ev) {
touchmove.value = true
}
query.select(".letterBox").boundingClientRect((data) => {
letterDom.minHeight = data.top
letterDom.height = data.height
letterDom.maxHeight = data.bottom
letterDom.itemHeight = data.height / letterList.length
}).exec();
}
//
function handleTouchMove(ev) {
if (!touchmove.value) return
//
let result = ev.touches[0].pageY
result = Math.max(result, letterDom.minHeight)
result = Math.min(result, letterDom.maxHeight)
//
function handleTouchStart(ev) {
touchmove.value = true
}
//
let index = Math.floor(result - letterDom.minHeight) / letterDom.itemHeight
index = parseInt(index)
//
function handleTouchMove(ev) {
if (!touchmove.value) return
//
let result = ev.touches[0].pageY
result = Math.max(result, letterDom.minHeight)
result = Math.min(result, letterDom.maxHeight)
//
listKey.value = letterList[index].key
}
//
let index = Math.floor(result - letterDom.minHeight) / letterDom.itemHeight
index = parseInt(index)
//
function handleTouchEnd(ev) {
touchmove.value = false
}
//
listKey.value = letterList[index].key
}
/**
* 点击字母
* @param {Object} item 点击的当前项
*/
function handleLetter(item) {
listKey.value = item.key
}
//
function handleTouchEnd(ev) {
touchmove.value = false
}
/**
* 右滑菜单
* @param {Object} ev 默认事件
* @param {Object} user 用户信息
*/
function handleSwipeAction(ev, user) {
ev.content.fn(user)
proxy.$refs.swipeAction.closeAll()
}
/**
* 点击字母
* @param {Object} item 点击的当前项
*/
function handleLetter(item) {
listKey.value = item.key
}
/**
* 删除好友
* @param {Object} user 需要删除的好友信息
*/
function delFriend(user) {
new Promise((resolve, reject) => {
util.alert({
content: `确认删除好友${user.remark || user.userNickname}`
}).then(res => {
if (!res.confirm) return
return resolve()
})
}).then(rs => {
api.news.deleteFriend({
query: {
toUserIds: user.userId,
},
}).then(rs => {
if (rs.code === 200) {
//
getFriendList()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
/**
* 右滑菜单
* @param {Object} ev 默认事件
* @param {Object} user 用户信息
*/
function handleSwipeAction(ev, user) {
ev.content.fn(user)
proxy.$refs.swipeAction.closeAll()
}
/**
* 删除好友
* @param {Object} user 需要删除的好友信息
*/
function delFriend(user) {
new Promise((resolve, reject) => {
util.alert({
content: `确认删除好友${user.remark || user.userNickname}`
}).then(res => {
if (!res.confirm) return
return resolve()
})
}
/**
* 设置好友备注
* @param {Object} ev 需要操作的好友信息
*/
function setFriendNote(ev) {
//
Object.assign(user, ev)
//
setTimeout(() => {
proxy.$refs.note.open()
}, 50)
}
//
function handleSaveNote() {
api.news.setNotes({
}).then(rs => {
api.news.deleteFriend({
query: {
name: user.note || '',
friendId: user.userId,
}
toUserIds: user.userId,
},
}).then(rs => {
if (rs.code === 200) {
proxy.$refs.note.close()
//
refreshFriendList()
//
getFriendList()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
})
}
/**
* 点击用户
* @param {Object} user 当前用户信息
*/
function handleUser(user) {
util.toChat({
name: user.remark || user.userNickname,
msgId: user.userId,
type: 'C2C',
})
}
/**
* 设置好友备注
* @param {Object} ev 需要操作的好友信息
*/
function setFriendNote(ev) {
//
Object.assign(user, ev)
//
setTimeout(() => {
proxy.$refs.note.open()
}, 50)
}
/**
* 跳转
* @param {Object} url
*/
function link(url) {
uni.navigateTo({
url,
//
function handleSaveNote() {
api.news.setNotes({
query: {
name: user.note || '',
friendId: user.userId,
}
}).then(rs => {
if (rs.code === 200) {
proxy.$refs.note.close()
//
refreshFriendList()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}
})
}
/**
* 点击用户
* @param {Object} user 当前用户信息
*/
function handleUser(user) {
util.toChat({
name: user.remark || user.userNickname,
msgId: user.userId,
type: 'C2C',
})
}
/**
* 跳转
* @param {Object} url
*/
function link(url) {
uni.navigateTo({
url,
})
}
</script>
<template>
@ -449,10 +452,10 @@
<view class="letter ptb10 plr30 c666 f20">{{ item.letter }}</view>
<view class="child pl30 pr50">
<uni-swipe-action-item :right-options="rightOption" v-for="(user, secIndex) in item.child"
:key="secIndex" @click="handleSwipeAction($event,user)">
:key="secIndex" @click="handleSwipeAction($event, user)">
<view class="item rows ptb20" @click="handleUser(user)">
<image class="wh80 avatar cir" :src="user.avatar" mode="aspectFill" />
<view class="name thd f1 ml20 c333 f32">{{user.remark || user.userNickname}}</view>
<view class="name thd f1 ml20 c333 f32">{{ user.remark || user.userNickname }}</view>
</view>
</uni-swipe-action-item>
</view>
@ -475,7 +478,7 @@
<uni-popup ref="note" type="bottom" mask-background-color="rgba(0,0,0,0)">
<view class="noteAlt popBot plr25 bfff">
<view class="header rows ptb20">
<view class="title c333 f34">设置好友({{user.remark}})备注</view>
<view class="title c333 f34">设置好友({{ user.remark }})备注</view>
<uni-icons type="closeempty" size="40rpx" @click="$refs.note.close()" />
</view>
@ -489,47 +492,47 @@
</template>
<style lang="scss" scoped>
//
.firendBox {
//
.firendBox {
height: 100%;
.scroll {
height: 100%;
}
.scroll {
height: 100%;
}
//
.li {
.letter {
background-color: #eee;
}
}
//
.child {
.item+.item {
border-top: 2rpx solid #eee;
}
//
.li {
.letter {
background-color: #eee;
}
}
//
.letterBox {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
}
//
.noteAlt {
box-shadow: 0 0 20rpx #0003;
.content {
.input {
padding: 20rpx 20rpx;
background-color: #eaeaea;
border-radius: 20rpx;
}
//
.child {
.item+.item {
border-top: 2rpx solid #eee;
}
}
}
//
.letterBox {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
}
//
.noteAlt {
box-shadow: 0 0 20rpx #0003;
.content {
.input {
padding: 20rpx 20rpx;
background-color: #eaeaea;
border-radius: 20rpx;
}
}
}
</style>

View File

@ -69,7 +69,7 @@ const list = reactive([])
onMounted(() => {
if (props.type == 0) {
getList()
} else if(props.type == 1) {
} else if (props.type == 1) {
//
} else if (props.type == 2) {
//
@ -79,7 +79,7 @@ onMounted(() => {
})
onUnmounted(() => {
// removeListener()
removeListener()
})
//
@ -93,7 +93,9 @@ function addListener() {
//
function removeListener() {
uni.$chat.on(TencentCloudChat.EVENT.CONVERSATION_LIST_UPDATED);
// #ifdef APP
uni.$chat.off(TencentCloudChat.EVENT.CONVERSATION_LIST_UPDATED);
// #endif
}
//
@ -104,7 +106,8 @@ function getList() {
}
}).then(rs => {
if (rs.code == 200) {
list.data = handleList(rs.data);
// list.data = handleList(rs.data);
list.data = handleList(JSON.parse(rs.msg).SessionItem);
return
}
util.alert({
@ -112,17 +115,6 @@ function getList() {
showCancel: false,
})
})
// // sdk
// let isReady = uni.$chat.isReady();
// if (!isReady) {
// setTimeout(function () {
// getList();
// }, 1000);
// return
// }
// uni.$chat.getMessageList({})
}
/**
@ -130,53 +122,37 @@ function getList() {
* @param {Object} item
*/
function handleList(list) {
list.forEach(item => {
item.callbackJson = JSON.parse(item.callbackJson);
if (item.groupId != null) {
item.unreadCount = getGroupNoReadNum(item.groupId)
}
if (item.callbackJson.callback_json.length) {
let msgType = item.callbackJson.callback_json[0].MsgType;
if (msgType == TencentCloudChat.TYPES.MSG_TEXT) {
item.chatText = item.callbackJson.callback_json[0].MsgContent.Text
} else if (msgType == TencentCloudChat.TYPES.MSG_IMAGE) {
item.chatText = '[图片]'
} else if (msgType == TencentCloudChat.TYPES.MSG_AUDIO) {
item.chatText = '[语音]'
} else if (msgType == TencentCloudChat.TYPES.MSG_VIDEO) {
item.chatText = '[视频]'
} else if (msgType == TencentCloudChat.TYPES.MSG_CUSTOM) {
if (item.callbackJson.callback_json[0].businessType == 'redPacket') {
item.chatText = `[红包] ${item.callbackJson.blessing}`
} else if (item.callbackJson.callback_json[0].businessType == '1') {
// if (item.callbackJson.callback_json[0].call_type == '1') {
// item.chatText = '[]'
// } else if (item.callbackJson.callback_json[0].call_type == '2') {
// item.chatText = '[]'
// }
}
}
}
})
return list
}
//
function getGroupNoReadNum(groupId) {
// sdk
let isReady = uni.$chat.isReady();
if (!isReady) {
setTimeout(function () {
getGroupNoReadNum(groupId);
handleList(list);
}, 800);
return
}
const unreadCount = uni.$chat.getTotalUnreadMessageCount('GROUP', groupId);
list.forEach(item => {
item.MsgTime = handleDate(item.MsgTime)
return unreadCount;
let type = item.Type == 1 ? `C2C${item.To_Account}` : `GROUP${item.GroupId}`;
uni.$chat.getConversationProfile(type).then(rs => {
let res = rs.data.conversation;
item.chatText = res.lastMessage.messageForShow;
item.unreadCount = res.unreadCount;
if (item.Type == 1) {
item.avatar = res.userProfile.avatar;
item.name = res.userProfile.nick;
} else if (item.Type == 2) {
item.avatar = res.groupProfile.avatar;
item.name = res.groupProfile.name;
item.num = res.groupProfile.memberCount;
}
})
})
return list
}
// //
@ -204,14 +180,14 @@ function handleChat(item) {
//
if (item.groupId == null) {
param.type = 'C2C'
param.name = `${item.callbackJson.from_name}`
param.msgId = `${item.callbackJson.from_id}`
param.name = `${item.name}`
param.msgId = `${item.To_Account}`
} else {
//
param.type = 'GROUP'
param.name = `${item.groupChatDTO.name}`
param.msgId = `${item.groupId}`
param.num = `${item.groupChatDTO.memberCount}`
param.name = `${item.name}`
param.msgId = `${item.GroupId}`
param.num = `${item.num}`
}
setRead(item)
@ -240,7 +216,7 @@ function delMsg(item) {
return
}
let conversationId = item.groupId == null ? `C2C${item.fromId}` : `GROUP${item.groupId}`;
let conversationId = item.Type == 1 ? `C2C${item.To_Account}` : `GROUP${item.GroupId}`;
uni.$chat.deleteConversation(conversationId).then(rs => {
getList()
@ -258,7 +234,7 @@ function setRead(item) {
return
}
let conversationId = item.groupId == null ? `C2C${item.fromId}` : `GROUP${item.groupId}`;
let conversationId = item.Type == 1 ? `C2C${item.To_Account}` : `GROUP${item.GroupId}`;
uni.$chat.setMessageRead({
conversationID: conversationId,
}).then(rs => {
@ -266,6 +242,21 @@ function setRead(item) {
})
}
//
function handleDate(timestamp) {
var timestamp = +timestamp * 1000;
var date = new Date(timestamp);
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
var formattedDate = M + D + h + m + s;
return formattedDate
}
</script>
@ -326,25 +317,28 @@ function setRead(item) {
@click="handleMenu($event, item)">
<view class="item rows ptb20 plr30" @click.stop="handleChat(item)">
<view class="image wh90 pr">
<template v-if="item.groupId == null">
<!-- <template v-if="item.groupId == null">
<image class="cir wh90" :src="item.callbackJson.from_url" mode="aspectFill" />
</template>
<template v-else>
<template v-else>
<image class="cir wh90" :src="item.groupChatDTO.groupFaceUrl" mode="aspectFill" />
</template>
</template> -->
<image class="cir wh90" :src="item.avatar" mode="aspectFill" />
<view class="mark pa t0 r0 cfff f22 cir" v-if="item.unreadCount">{{ item.unreadCount }}
</view>
</view>
<view class="col f1 ml20">
<view class="rows">
<template v-if="item.groupId == null">
<view class="name f1 thd c333 f32">{{ item.name }}</view>
<!-- <template v-if="item.groupId == null">
<view class="name f1 thd c333 f32">{{ item.callbackJson.from_name }}</view>
</template>
<template v-else>
<view class="name f1 thd c333 f32">{{ item.groupChatDTO.name }}</view>
</template>
</template> -->
<view class="datetime c999 f22">
{{ util.formatTime('MM-dd HH:mm', item.createTime) }}</view>
{{ util.formatTime('MM-dd HH:mm', item.MsgTime) }}</view>
</view>
<view class="desc thd mt10 c666 f24">{{ item.chatText }}</view>
</view>

View File

@ -2,8 +2,8 @@
"name" : "九亿",
"appid" : "__UNI__08B31BC",
"description" : "",
"versionName" : "1.0.5",
"versionCode" : 1005,
"versionName" : "1.0.6",
"versionCode" : 1006,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -240,7 +240,7 @@
{
"path": "pages/index/durainActivation",
"style": {
"navigationBarTitleText": "已激活",
"navigationBarTitleText": "我的榴莲果树",
"navigationBarBackgroundColor": "#fff"
}
},
@ -263,7 +263,7 @@
{
"path": "pages/index/durianLog",
"style": {
"navigationBarTitleText": "榴莲果明细",
"navigationBarTitleText": "榴莲果产出明细",
"navigationBarBackgroundColor": "#fff",
"enablePullDownRefresh": true
}

View File

@ -34,7 +34,23 @@
function buyDurianList() {
api.durian.buyDurianList({}).then(rs => {
if (rs.code == 200) {
//
treeData.value = rs.data.dataList.map(item => {
// orderType 0 1
item.style = {
'0': {
1: 'scroll1',
2: 'scroll2',
3: 'scroll3',
4: 'scroll4',
} [item.durianConfigId],
'1': {
1: 'buy1',
2: 'buy2',
3: 'buy3',
4: 'buy4',
} [item.durianConfigId],
} [item.orderType]
item.formatHash = formatStr(item.treeHash)
return item
})
@ -83,20 +99,21 @@
<view class="appbw">
<!-- -->
<view class="list mlr40">
<view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index"
@click="handleDetail(item)">
<view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index" @click="handleDetail(item)"
:class="item.style">
<image class="wh180 fs0" src="/static/tree.png" mode="aspectFit" />
<view class="col f1 ml30 mtb30 c333 f26">
<view class="txt mtb10">每日可释放{{item.release}}</view>
<view class="txt mtb10">每日可释放{{item.releasableDaily}}</view>
<view class="txt mtb10">剩余可释放{{item.remainFruitCount}}</view>
<view class="txt mtb10">当前级别{{item.treeName}}</view>
<view class="txt mtb10" @click.stop="util.copyText(item.treeHash)">
<text>哈希值 {{item.formatHash}}</text>
<image class="wh20 ml10" src="/static/copy.png" mode="aspectFit" />
<image class="wh20 ml10" src="/static/copy.png" mode="aspectFit" />
</view>
</view>
</view>
<view class="tac c999 f40 mt80" v-if="!treeData[0]">当前暂无榴莲果树~</view>
</view>
<!-- 填充 -->
@ -107,20 +124,44 @@
<style lang="scss">
//
.list {
//
.item {
background-color: #F4F4F4;
}
.item+.item:nth-child(3n+1) {
background-color: #F4CAFF;
//
.scroll1 {
background-color: #F4F4F4;
}
.item+.item:nth-child(3n+2) {
.scroll2 {
background-color: #E4FBFF;
}
.item+.item:nth-child(3n+3) {
.scroll3 {
background-color: #CACDFF;
}
.scroll4 {
background-color: #F4CAFF;
}
//
.buy1 {
background-color: rgb(225, 253, 204);
}
.buy2 {
background-color: #FFF0B1;
}
.buy3 {
background-color: #CAF0F3;
}
.buy4 {
background-color: #FBC5C5;
}
}
</style>

View File

@ -1,229 +1,249 @@
<script setup>
/**
* 榴莲首页
*/
import {
useStore,
} from 'vuex'
import {
onMounted,
ref,
reactive,
computed,
getCurrentInstance,
watch,
defineExpose,
} from 'vue';
/**
* 榴莲首页
*/
import {
useStore,
} from 'vuex'
import {
onMounted,
ref,
reactive,
computed,
getCurrentInstance,
watch,
defineExpose,
} from 'vue';
import {
onLoad,
onReady,
onHide,
} from '@dcloudio/uni-app'
//
import noLogin from '@/components/login/noLogin.vue'
//
import util from '@/common/js/util.js'
//
import task from '@/components/index/task'
//
import api from '@/api/index.js'
//
import payPwd from '@/components/mine/payPwd.vue'
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
//
const form = reactive({
// ID
targetUserId: '',
//
account: '',
//
fruitAmount: '',
//
first: '',
//
name: '',
//
secondPassword: '',
})
//
const viewData = ref({
seconds: 0
})
//
const userinfo = computed(() => {
return store.state.userinfo
})
//
const progress = computed(() => {
let result = viewData.value.seconds
result = Math.min(Number(result), 100)
return result
})
//
const purse = computed(() => {
return store.state.purse || {}
})
//
const configData = reactive({
minConsumption: '',
platformPercentage: ''
})
onReady(() => {
// proxy.$refs.dealRef.open()
// proxy.$refs.payPwdRef.open()
})
onLoad(() => {
//
util.getPurse()
getConfig()
})
//
function handleSubmit() {
//
if (!form.account) {
util.alert('请输入账号')
return
}
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
// id
api.mine.getUserDataByAccount({
query: {
account: form.account,
},
}).then(rs => {
if (rs.code === 200) {
const result = rs.data
// id
form.targetUserId = result.userName
form.name = result.userRealName.slice(1, result.userRealName.length)
//
proxy.$refs.payee.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
import {
onLoad,
onReady,
onHide,
} from '@dcloudio/uni-app'
//
import noLogin from '@/components/login/noLogin.vue'
//
import util from '@/common/js/util.js'
//
import task from '@/components/index/task'
//
import api from '@/api/index.js'
//
import payPwd from '@/components/mine/payPwd.vue'
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
//
const form = reactive({
// ID
targetUserId: '',
//
account: '',
//
fruitAmount: '',
//
first: '',
//
name: '',
//
secondPassword: '',
})
}
//
function handlePayeeConfirm() {
//
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
api.durian.nameComparison({
query: {
//
account: form.account,
//
name: `${form.first}${form.name}`,
}
}).then(rs => {
if (rs.code == 200) {
if (rs.data) proxy.$refs.payPwdRef.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
//
const viewData = ref({
seconds: 0
})
//
const userinfo = computed(() => {
return store.state.userinfo
})
//
const progress = computed(() => {
let result = viewData.value.seconds
result = Math.min(Number(result), 100)
return result
})
//
const purse = computed(() => {
return store.state.purse || {}
})
}
/**
* 交易
* @param {Object} ev 二级密码
*/
function handlePwdConfirm(ev) {
//
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
if (!form.account) {
util.alert('请输入账号')
return
}
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
//
const configData = reactive({
minConsumption: '',
platformPercentage: ''
})
onReady(() => {
// proxy.$refs.dealRef.open()
// proxy.$refs.payPwdRef.open()
})
onLoad(() => {
//
util.getPurse()
getConfig()
})
//
api.durian.consume({
data: {
//
userId: userinfo.value.id,
// id
targetUserId: form.targetUserId,
//
transactionType: 10,
//
fruitAmount: form.fruitAmount,
//
name: `${form.first}${form.name}`,
//
account: form.account,
//
secondPassword: ev
}
}).then(rs => {
if (rs.code === 200) {
//
util.getPurse()
function handleSubmit() {
//
if (!form.account) {
util.alert('请输入账号')
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function navigateToPage(path) {
uni.navigateTo({
url: path
})
}
//
function getConfig() {
api.durian.durianFruitConfig().then(rs => {
if (rs.code == 200) {
configData.minConsumption = rs.data.minConsumption
configData.platformPercentage = +rs.data.platformPercentage * 100
return;
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
util.alert({
content: rs.msg,
showCancel: false,
//
const min = parseFloat(configData.minConsumption)
const price = parseFloat(form.fruitAmount)
if (price < min) {
util.alert(`榴莲果最低${min}起转`)
return
}
// id
api.mine.getUserDataByAccount({
query: {
account: form.account,
},
}).then(rs => {
if (rs.code === 200) {
const result = rs.data
// id
form.targetUserId = result.userName
form.name = result.userRealName.slice(1, result.userRealName.length)
//
proxy.$refs.payee.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
})
}
}
//
function handlePayeeConfirm() {
//
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
api.durian.nameComparison({
query: {
//
account: form.account,
//
name: `${form.first}${form.name}`,
}
}).then(rs => {
if (rs.code == 200) {
if (rs.data) proxy.$refs.payPwdRef.open()
else {
util.alert({
content: '姓名不匹配',
showCancel: false,
})
form.first = ''
}
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
/**
* 交易
* @param {Object} ev 二级密码
*/
function handlePwdConfirm(ev) {
//
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
if (!form.account) {
util.alert('请输入账号')
return
}
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
//
api.durian.consume({
data: {
//
userId: userinfo.value.id,
// id
targetUserId: form.targetUserId,
//
transactionType: 10,
//
fruitAmount: form.fruitAmount,
//
totalAmount: form.fruitAmount,
//
name: `${form.first}${form.name}`,
//
account: form.account,
//
secondPassword: ev
}
}).then(rs => {
if (rs.code === 200) {
form.fruitAmount = ''
form.account = ''
form.first = ''
proxy.$refs.dealRef.close()
proxy.$refs.payee.close()
//
util.getPurse()
//
util.alert('转让成功')
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function navigateToPage(path) {
uni.navigateTo({
url: path
})
}
//
function getConfig() {
api.durian.durianFruitConfig().then(rs => {
if (rs.code == 200) {
configData.minConsumption = rs.data.minConsumption
configData.platformPercentage = +rs.data.platformPercentage * 100
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
@ -304,8 +324,8 @@ function getConfig() {
<!-- 互转 -->
<uni-popup ref="dealRef" type="center">
<view class="dealAlt popMid ptb40 plr60 bfff br30">
<view class="title tac c333 f28">榴莲果互转</view>
<view class="content rows mtb10">
<view class="title thd tac c333 f32"> 当前可用榴莲果 {{purse.fruit}}</view>
<view class="content rows mtb30">
<image class="wh140" src="/static/fruit.png" mode="aspectFit" />
<image class="wh70" src="/static/dealMid.png" mode="aspectFit" />
<image class="wh140" src="/static/dealUser.png" mode="aspectFit" />
@ -335,10 +355,12 @@ function getConfig() {
<view class="mtb20 f28">请补全对方姓名首字以防转错</view>
<view class="inputBox rows mauto mtb20 plr30">
<input class="first" v-model.trim="form.first" type="text" placeholder="" />
<view class="">*</view>
<view class="f1 tar">{{ form.name }}</view>
<view class="inputEdit rows mauto mtb20 plr30">
<input class="first side" v-model.trim="form.first" type="text" placeholder="" />
<view class="mlr20">*</view>
<view class="side tar">
<text v-if="0">{{ form.name }}</text>
</view>
</view>
<view class="rows mt50">
@ -354,64 +376,68 @@ function getConfig() {
</template>
<style lang="scss">
//
.board {
background-image: linear-gradient(103deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
//
.bgColor {
background-color: #FFFBF3;
border-radius: 20rpx;
}
.explain {
.button {
width: 250rpx;
margin-left: 0;
//
.board {
background-image: linear-gradient(103deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
}
//
.sapling {
.button {
width: 300rpx;
//
.bgColor {
background-color: #FFFBF3;
border-radius: 20rpx;
}
}
//
.durianSection {
//
.notice {
.key {
width: 140rpx;
height: 70rpx;
color: #fff;
background: linear-gradient(99deg, #27efe2 0%, #a45eff 43%, #ff004f 100%), linear-gradient(108deg, #d7f550 -2%, #afef4d 98%);
border-radius: 100rpx;
.explain {
.button {
width: 250rpx;
margin-left: 0;
}
}
}
//
.dealAlt {
.hint {
color: #3d3d3d;
opacity: .7;
}
}
//
.payee {
.inputBox {
width: 120rpx;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .2);
//
.sapling {
.button {
width: 300rpx;
}
}
.first {
width: 50rpx;
//
.durianSection {
//
.notice {
.key {
width: 140rpx;
height: 70rpx;
color: #fff;
background: linear-gradient(99deg, #27efe2 0%, #a45eff 43%, #ff004f 100%), linear-gradient(108deg, #d7f550 -2%, #afef4d 98%);
border-radius: 100rpx;
}
}
}
//
.dealAlt {
.hint {
color: #3d3d3d;
opacity: .7;
}
}
//
.payee {
//
.side {
width: 80rpx;
}
//
.first {
padding: 20rpx;
background-color: #f4f4f4;
border-radius: 20rpx;
}
}
}
</style>

View File

@ -110,6 +110,9 @@
</view>
</view>
</view>
<!-- 暂无更多 -->
<view class="nomore mtb50" v-if="!scrollLog.data[0]">暂无明细~</view>
</view>
<!-- 填充 -->

View File

@ -58,6 +58,12 @@
//
dataList.value = result.dataList.map(item => {
item.formatHash = item.scrollHash.replace(/(\d{4})\d*(\d{4})/, "$1****$2")
// item.style = {
// '1': 'scroll1',
// '2': 'scroll2',
// '3': 'scroll3',
// '4': 'scroll4',
// } [item.scrollName]
return item
})
return
@ -117,7 +123,6 @@
* @param {Object} item 当前对象
*/
function handleCopy(item) {
// scrollHash
util.copyText(item.scrollHash)
}
</script>
@ -129,8 +134,9 @@
<view class="value mt5 ptb5 plr20 tac br10">{{total}}</view>
</view>
<view v-for="(item, index) in dataList" :key="item.id" @click="handleDetail(item)">
<view class="board pr oh mtb30 mlr30 ptb20 plr20 cfff f30 br20">
<view class="listBox">
<view class="board pr oh mtb30 mlr30 ptb20 plr20 cfff f30 br20" v-for="(item, index) in dataList"
:key="item.id" @click="handleDetail(item)">
<view class=" df">
<view class="left f1 mr40">
<view class="key mt20 f32">卷轴可释放</view>
@ -183,6 +189,25 @@
background-color: #333;
}
//
// .listBox {
// .scroll1 {
// background-color: #F4F4F4;
// }
// .scroll2 {
// background-color: #E4FBFF;
// }
// .scroll3 {
// background-color: #CACDFF;
// }
// .scroll4 {
// background-color: #F4CAFF;
// }
// }
//
.board {
background-image: linear-gradient(121deg, #27EFE2 0%, #A45EFF 43%, #FF004F 99%);

View File

@ -157,7 +157,8 @@
<!-- 一级 -->
<view class="li mtb30" v-for="(item,index) in team.sonUser" :key="item.id">
<view class="menber df aic">
<view class="c333 f32">{{item.userNickname}}</view>
<view class="count mr20 plr10 cfff br10" v-if="item.isShop == 1"></view>
<view class="c333 f32">{{item.userNickname}}{{item.isShop}}</view>
<template v-if="item.sonList[0]">
<uni-icons @click="lowTeam(item)" type="up" color="#A45EFF" size="28rpx"
v-if="item.showSecond" />
@ -178,7 +179,7 @@
<view class="content df aic f1 ptb10">
<view class="line"></view>
<view class="ml10 df aic c999 f28">
<view class="count mr20 plr10 cfff br10" v-if="secItem.isShop"></view>
<view class="count mr20 plr10 cfff br10" v-if="secItem.isShop == 1"></view>
<view class="name">{{secItem.userNickname}}</view>
<view class="label ml10">{{secItem.count}}</view>
</view>
@ -221,6 +222,12 @@
.team {
background-color: #FFFBF3;
//
.count {
font-size: 28rpx;
background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
//
.list {
padding-left: .5em;
@ -259,11 +266,6 @@
// background-clip: text;
// text-fill-color: transparent;
// }
//
.count {
background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
}
}
}

View File

@ -25,6 +25,7 @@
import {
useStore,
} from 'vuex'
// api
import durianlApi from '@/api/durian.js';
const {
proxy
@ -50,6 +51,8 @@
buyDurianList()
//
util.getPurse()
//
getArticle()
})
onReady(() => {
@ -117,7 +120,7 @@
function getArticle() {
api.getArticle({
query: {
id: 2,
agreementId: 5,
}
}).then(rs => {
if (rs.code == 200) {
@ -201,7 +204,7 @@
<view class="content mtb20 mlr25">
<scroll-view scroll-y="true" class="scroll">
<rich-text :nodes="rule.context"></rich-text>
<rich-text :nodes="rule.content"></rich-text>
</scroll-view>
</view>
</view>

View File

@ -107,7 +107,7 @@
})
onReady(() => {
proxy.$refs.orderDetail.open()
// proxy.$refs.orderDetail.open()
})
onPullDownRefresh(() => {

View File

@ -19,6 +19,8 @@ import {
} from 'vuex'
//
import statusBar from '@/components/header/statusBar'
//
import noLogin from '@/components/login/noLogin'
//
import productList from '@/components/shop/productList/productList';
@ -64,7 +66,19 @@ function toCustomer() {
</script>
<template>
<view class="app">
<view class="page" v-if="!userinfo.id">
<statusBar />
<view class="head rows plr30">
<view class="side"></view>
<view class="f1"></view>
<view class="side">
<uni-icons type="gear" size="40rpx" color="#333" @click="link('/pages/mine/setting/setting')" />
</view>
</view>
<noLogin class="f1" />
</view>
<view class="app" v-else>
<view class="apex" :class="{ 'active': showHeader }">
<statusBar />
<view class="head rows">

View File

@ -155,7 +155,9 @@ function addListener() {
}, 200)
}
// #ifdef APP
uni.$chat.on(TencentCloudChat.EVENT.MESSAGE_RECEIVED, onMessageReceived);
// #endif
}
//
@ -210,6 +212,7 @@ function sendMsg(param) {
data: param.data,
}).then((rs) => {
if (rs.code == 200) {
getHistory()
param.success ? param.success() : ''
return
}
@ -310,15 +313,15 @@ function getMoreHistroy() {
*/
function getHistory(param = {}) {
// sdk
// #ifdef APP
let isReady = uni.$chat.isReady();
//
if (!isReady && userinfo.value.id) {
setTimeout(function () {
getHistory(param)
getHistory()
}, 200);
return
}
//
// #endif
loading.value = true
//

View File

@ -94,7 +94,9 @@ function imLoading() {
//
function removeListener() {
// #ifdef APP
uni.$chat.off(TencentCloudChat.EVENT.SDK_READY);
// #endif
}
/**

View File

@ -3,9 +3,7 @@ import {
} from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
// let target = 'http://91f.xyz:8080'
let target = 'https://b433d23.r24.cpolar.top/'
// let target = 'http://hvw2rn.natappfree.cc'
let target = 'http://91f.xyz:8080'
export default defineConfig({
plugins: [uni()],