diff --git a/jiuyi2/api/durian.js b/jiuyi2/api/durian.js
index 7b6cc3ea..36bf2d11 100644
--- a/jiuyi2/api/durian.js
+++ b/jiuyi2/api/durian.js
@@ -72,5 +72,15 @@ export const durian = {
load: true,
})
},
+ /**
+ * 榴莲果配置
+ * @param {Object} param
+ */
+ durianFruitConfig() {
+ return util.request({
+ url: `/coreplay/durianFruitTransactionType/10`,
+ method: 'GET',
+ })
+ },
}
export default durian
\ No newline at end of file
diff --git a/jiuyi2/api/shop.js b/jiuyi2/api/shop.js
index 78776834..3170fbde 100644
--- a/jiuyi2/api/shop.js
+++ b/jiuyi2/api/shop.js
@@ -444,7 +444,32 @@ const shop = {
*/
getCustomerService(param) {
return util.request({
- url: `/user/MCustomerService/random`,
+ url: `/user/MCustomerService/random`,
+ method: 'GET',
+ query: param,
+ })
+ },
+
+
+ /**
+ * 根据店铺id查商品列表
+ * @param {Object} param
+ */
+ getShopProductList(param) {
+ return util.request({
+ url: `/shopify/appProductionApi/getProductionList`,
+ method: 'GET',
+ query: param,
+ })
+ },
+
+ /**
+ * 查询用户在当前商铺的订单列表
+ * @param {Object} param
+ */
+ getShopOrderList(param) {
+ return util.request({
+ url: `/shopify/appOrder/getOrderList`,
method: 'GET',
query: param,
})
diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js
index 4500abc9..c6bbe709 100644
--- a/jiuyi2/common/js/config.js
+++ b/jiuyi2/common/js/config.js
@@ -8,6 +8,7 @@ const config = {
// #ifndef H5
// host: 'http://91f.xyz:8080',
host: 'https://b433d23.r24.cpolar.top/',
+ // host: 'http://hvw2rn.natappfree.cc',
// #endif
// 支付方式配置
payType: {
diff --git a/jiuyi2/components/news/msgList.vue b/jiuyi2/components/news/msgList.vue
index 89288f74..ab9a87cf 100644
--- a/jiuyi2/components/news/msgList.vue
+++ b/jiuyi2/components/news/msgList.vue
@@ -110,6 +110,28 @@ function handleList(list) {
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
@@ -193,7 +215,7 @@ function delMsg(item) {
let conversationId = item.groupId == null ? `C2C${item.fromId}` : `GROUP${item.groupId}`;
- uni.$chat.deleteConversation(conversationId).then(rs => {
+ uni.$chat.deleteConversation(conversationId).then(rs => {
getList()
})
}
@@ -297,8 +319,7 @@ function setRead(item) {
{{ util.formatTime('MM-dd HH:mm', item.createTime) }}
- {{
- item.callbackJson.callback_json[0].MsgContent.Text }}
+ {{ item.chatText }}
diff --git a/jiuyi2/components/public/jy-commodity-information/index.vue b/jiuyi2/components/public/jy-commodity-information/index.vue
index 8e45ca3f..ee0462f5 100644
--- a/jiuyi2/components/public/jy-commodity-information/index.vue
+++ b/jiuyi2/components/public/jy-commodity-information/index.vue
@@ -4,15 +4,15 @@
-
+
- 耳钉耳钉耳钉耳钉耳钉耳钉耳钉耳钉耳钉耳钉耳钉
- X602 款式
- 待发货
+ {{ orderInfo.productName }}
+ {{ orderInfo.status_text }}
+ {{ orderInfo.status }}
@@ -54,10 +54,10 @@
¥
- 999.00
+ {{ orderInfo.productPrice }}
- x1
+ x{{ orderInfo.totalNum }}
@@ -106,6 +106,10 @@ const props = defineProps({
})
\ No newline at end of file
diff --git a/jiuyi2/pages/news/addFriend.vue b/jiuyi2/pages/news/addFriend.vue
index 08902e05..049ca7d8 100644
--- a/jiuyi2/pages/news/addFriend.vue
+++ b/jiuyi2/pages/news/addFriend.vue
@@ -1,161 +1,168 @@
@@ -169,14 +176,14 @@
-
- {{item.userName}}
+ {{ item.userName }}
@@ -227,14 +234,14 @@
\ No newline at end of file
diff --git a/jiuyi2/pages/news/chat/chat.vue b/jiuyi2/pages/news/chat/chat.vue
index fd44076a..6e593aa6 100644
--- a/jiuyi2/pages/news/chat/chat.vue
+++ b/jiuyi2/pages/news/chat/chat.vue
@@ -86,7 +86,7 @@ const videoContext = ref(null)
// 红包对象
const redPacket = reactive({})
-onLoad(option => {
+onLoad(option => {
// 标题
let title = ''
// 聊天类型
@@ -309,7 +309,7 @@ function sendMsg(param) {
//
if (msg.type == 'GROUP') request = api.news.sendGroupMsg
if (msg.isCustomer) request = api.news.sendCusomterService
-
+
// 发送消息
request({
query: param.query,
diff --git a/jiuyi2/pages/news/chat/jy-plus.vue b/jiuyi2/pages/news/chat/jy-plus.vue
index db497a14..ba0030bc 100644
--- a/jiuyi2/pages/news/chat/jy-plus.vue
+++ b/jiuyi2/pages/news/chat/jy-plus.vue
@@ -12,6 +12,8 @@ import {
screenHeight
} from '@/components/public/Mixins'
import JyCommodityInformation from '@/components/public/jy-commodity-information'
+// api
+import api from '@/api/index.js'
// 工具库
import util from '@/common/js/util.js'
import { inject } from 'vue'
@@ -45,7 +47,7 @@ const plusList = computed(() => {
]
const isCustomer = props.msg.isCustomer;
-
+
// 单聊
if (props.msg.type == 'C2C' && !isCustomer) result.push({
type: 'news-voice.png',
@@ -75,6 +77,9 @@ const popupData = reactive({
title: '选择订单'
})
+// 订单列表
+const list = reactive([])
+
// 加号方法对象
const plusClickObj = {
voice: () => {
@@ -109,14 +114,49 @@ const plusClickObj = {
// 选择订单
chooseOrder: () => {
- nextTick().then(() => {
- popupRef.value.open()
- });
+ let param = {
+ pageSize: 10,
+ pageNum: 1,
+ merId: props.msg.id,
+ }
+ api.shop.getShopOrderList(param).then(rs => {
+ if (rs.code == 200) {
+ list.length = 0
+ list.push(...rs.rows.map(item => {
+ // 状态
+ item.status = Number(item.status)
+ // 编辑订单状态文字
+ item.status_text = {
+ '0': '待支付',
+ '1': '待发货',
+ '4': '待收货',
+ '5': '已收货',
+ '6': '已完成',
+ '9': '已取消',
+ }[item.status]
+ return item
+ }))
+
+
+ nextTick().then(() => {
+ popupRef.value.open()
+ });
+ return
+ }
+
+ util.alert({
+ content: rs.msg,
+ showCancel: false,
+ })
+ })
+
},
// 选择商品
chooseShop: () => {
- checkLink('pages/news/goodsList/index')
+ uni.navigateTo({
+ url: `/pages/news/goodsList/index?merId=${props.msg.id}`
+ });
},
// 发送红包
@@ -228,11 +268,11 @@ const consult = (content) => {
-
+
- 下单时间:2024-07-28 22:45:25
+ 下单时间:{{ item.createTime }}
-
+
diff --git a/jiuyi2/pages/news/goodsList/index.vue b/jiuyi2/pages/news/goodsList/index.vue
index a362c160..3413b648 100644
--- a/jiuyi2/pages/news/goodsList/index.vue
+++ b/jiuyi2/pages/news/goodsList/index.vue
@@ -1,22 +1,122 @@
-
-
-
-
+
+
+
+
+
-
+
+
+ {{ item.name }}
+
+
+
+ ¥
+ {{ item.price }}
+ 销量:{{ item.sales }}
+
+ 去咨询
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/jiuyi2/pages/news/myQr.vue b/jiuyi2/pages/news/myQr.vue
index 25d2bd80..e952724b 100644
--- a/jiuyi2/pages/news/myQr.vue
+++ b/jiuyi2/pages/news/myQr.vue
@@ -1,63 +1,62 @@
@@ -65,13 +64,13 @@
-
+
- {{userinfo.userNickname}}
+ {{ userinfo.userNickname }}
扫一扫,添加我为好友
@@ -80,5 +79,4 @@
\ No newline at end of file
+//
\ No newline at end of file
diff --git a/jiuyi2/vite.config.js b/jiuyi2/vite.config.js
index 79d17e9e..db8799fa 100644
--- a/jiuyi2/vite.config.js
+++ b/jiuyi2/vite.config.js
@@ -5,6 +5,7 @@ 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'
export default defineConfig({
diff --git a/service/App.vue b/service/App.vue
index fb5baa94..d976220a 100644
--- a/service/App.vue
+++ b/service/App.vue
@@ -8,20 +8,21 @@ export default {
// 登录令牌
const token = uni.getStorageSync('token')
// 用户信息
- const userinfo = uni.getStorageSync('userinfo')
+ const userinfo = JSON.parse(uni.getStorageSync('userinfo'))
// 如果登录保活
if (token) {
- // 用户信息
- if (userinfo) store.commit('setState', {
- key: 'userinfo',
- value: userinfo
- })
+ // 用户信息
+ if (userinfo) {
+ store.commit('setState', {
+ key: 'userinfo',
+ value: userinfo
+ })
- // // 腾讯im登录
- // util.getUserinfo().then(rs => {
- // util.loginTencent(userinfo)
- // })
+
+ // 登录腾讯IM
+ // util.loginTencent(userinfo)
+ }
} else {
// 如果未登录,跳转到登录页面
uni.redirectTo({
diff --git a/service/api/login.js b/service/api/login.js
index 1c14d63c..9c173705 100644
--- a/service/api/login.js
+++ b/service/api/login.js
@@ -14,7 +14,7 @@ const login = {
method: 'GET',
})
},
-
+
/**
* 客服登录接口
* @param {Object} param
@@ -26,7 +26,7 @@ const login = {
load: true,
})
},
-
+
/**
* 客服退出登录
@@ -35,7 +35,8 @@ const login = {
userLoginOut(param) {
return util.request({
url: '/user/customerService/logout',
- data: param.data,
+ method: 'POST',
+ query: param,
load: true,
})
},
diff --git a/service/common/js/config.js b/service/common/js/config.js
index d16ca8c2..ee740762 100644
--- a/service/common/js/config.js
+++ b/service/common/js/config.js
@@ -2,7 +2,7 @@
const config = {
// 接口域名
// #ifdef H5
- host: 'http://localhost:5173',
+ host: 'http://localhost:8888',
// #endif
// #ifndef H5
// host: 'http://91f.xyz:8080',
diff --git a/service/common/js/util.js b/service/common/js/util.js
index 67378b37..745b7ad7 100644
--- a/service/common/js/util.js
+++ b/service/common/js/util.js
@@ -1433,31 +1433,33 @@ const util = {
// 登录腾讯聊天
loginTencent(userinfo) {
api.login.getIMToken({}).then(rs => {
- //
+ console.log(rs);
+
const imSig = rs.msg
- // #ifdef APP
- // 音视频登录
- const loginParams = {
- SDKAppID: util.config.TChat.SDKAppID,
- userID: userinfo.id + '',
- userSig: imSig,
- }
- uni.$TUICallKit.login(loginParams, res => {
- if (res.code === 0) {
- console.log('[TUICallKit] login success.');
- } else {
- console.error('[TUICallKit] login failed, failed message = ', res.msg, params);
- }
- })
- // #endif
-
uni.$chat.login({
- userID: userinfo.id + '',
+ userID: userinfo.serviceId + '',
userSig: imSig,
}).then(rs => {
console.log('im login success', rs)
})
+
+ // // #ifdef APP
+ // // 音视频登录
+ // const loginParams = {
+ // SDKAppID: util.config.TChat.SDKAppID,
+ // userID: userinfo.id + '',
+ // userSig: imSig,
+ // }
+ // uni.$TUICallKit.login(loginParams, res => {
+ // if (res.code === 0) {
+ // console.log('[TUICallKit] login success.');
+ // } else {
+ // console.error('[TUICallKit] login failed, failed message = ', res.msg, params);
+ // }
+ // })
+ // // #endif
+
})
},
@@ -1545,10 +1547,13 @@ const util = {
*/
logout(cb) {
// 用户信息
- const userinfo = store.state.userinfo
+ const userinfo = JSON.parse(uni.getStorageSync('userinfo'))
+
+ console.log(userinfo.serviceId);
+
// 用户id
- if (userinfo.id) {
+ if (userinfo.serviceId) {
uni.$emit('logout') // 触发自定义事件监听
// tim登出
@@ -1558,7 +1563,7 @@ const util = {
console.log('tim logout error:', rs);
});
- api.login.userLoginOut().then(rs => {
+ api.login.userLoginOut({ serviceId: userinfo.serviceId }).then(rs => {
setTimeout(() => {
uni.navigateTo({
url: '/pages/login/login',
diff --git a/service/pages/index/index.vue b/service/pages/index/index.vue
index 6ea5d166..0fcdf8f4 100644
--- a/service/pages/index/index.vue
+++ b/service/pages/index/index.vue
@@ -17,31 +17,28 @@ import {
} from '@dcloudio/uni-app'
// 路由
import util from '@/common/js/util.js'
+// 腾讯云聊天
+import TencentCloudChat from '@tencentcloud/chat';
-const chatList = reactive([{
- id: 1,
- avatar: 'https://p3-flow-imagex-sign.byteimg.com/user-avatar/9f4488a87a17f6f31b9716331e14fe26~tplv-a9rns2rl98-icon-tiny.jpeg?rk3s=98c978ad&x-expires=1740537084&x-signature=OrjX8tZaafN4XJE2o8QzZDs3Q20%3D',
- name: '客户 A',
- lastMessage: '您好,商品什么时候发货?',
- dot: 1,
-},
-{
- id: 2,
- avatar: 'https://p3-flow-imagex-sign.byteimg.com/user-avatar/9f4488a87a17f6f31b9716331e14fe26~tplv-a9rns2rl98-icon-tiny.jpeg?rk3s=98c978ad&x-expires=1740537084&x-signature=OrjX8tZaafN4XJE2o8QzZDs3Q20%3D',
- name: '客户 B',
- lastMessage: '这个商品有优惠吗?',
- dot: '',
-}
-])
-
+const chatList = reactive([])
// 用户信息
const userinfo = JSON.parse(uni.getStorageSync('userinfo'))
-
-console.log(userinfo);
-
-
+// 右滑菜单
+const rightOption = [{
+ text: '删除',
+ style: {
+ backgroundColor: '#F85050'
+ },
+ fn: (item) => delMsg(item)
+}, {
+ text: '设为已读',
+ style: {
+ backgroundColor: '#00ADEE'
+ },
+ fn: (item) => setRead(item)
+},]
onMounted(() => {
getList()
@@ -74,7 +71,27 @@ function getList() {
}
}).then(rs => {
if (rs.code == 200) {
- // list.data = handleList(rs.data);
+ chatList.push(...rs.data.map(item => {
+ item.callbackData = JSON.parse(item.callbackJson)
+
+ if (item.callbackData.callback_json.length) {
+ let msgType = item.callbackData.callback_json[0].MsgType;
+ if (msgType == TencentCloudChat.TYPES.MSG_TEXT) {
+ item.chatText = item.callbackData.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.callbackData.callback_json[0].businessType == 'redPacket') {
+ item.chatText = `[红包] ${item.callbackData.blessing}`
+ }
+ }
+ }
+ return item
+ }))
return
}
util.alert({
@@ -84,26 +101,23 @@ function getList() {
})
}
+// /**
+// * 去聊天
+// * @param {Number} item 聊天对象
+// */
+// function handleChat(item) {
+// //
+// }
-
-
-/**
- * 去聊天
- * @param {Number} item 聊天对象
- */
-function handleChat(item) {
- //
-}
-
-/**
- * 跳转
- * @param {String} url 路由地址
- */
-function link(url) {
- uni.navigateTo({
- url,
- })
-}
+// /**
+// * 跳转
+// * @param {String} url 路由地址
+// */
+// function link(url) {
+// uni.navigateTo({
+// url,
+// })
+// }
// 退出登录
@@ -111,8 +125,8 @@ function handleLogout() {
util.alert({
content: '确认退出登录吗?',
}).then(rs => {
- if (!rs.confirm) return
-
+ if (!rs.confirm) return
+
util.logout(() => {
// #ifdef APP
plus.runtime.restart()
@@ -120,6 +134,78 @@ function handleLogout() {
})
})
}
+
+
+
+
+/**
+ * 去聊天
+ * @param {Object} item
+ */
+function handleChat(item) {
+ let param = {};
+ // 单聊
+ if (item.groupId == null) {
+ param.type = 'C2C'
+ param.name = `${item.callbackJson.from_name}`
+ param.msgId = `${item.callbackJson.from_id}`
+ } else {
+ // 群聊
+ param.type = 'GROUP'
+ param.name = `${item.groupChatDTO.name}`
+ param.msgId = `${item.groupId}`
+ param.num = `${item.groupChatDTO.memberCount}`
+ }
+ //
+ util.toChat(param)
+}
+/**
+ * 菜单
+ * @param {Object} ev 默认事件
+ * @param {Object} item 单项
+ */
+function handleMenu(ev, item) {
+ console.log('ev', ev, item)
+ ev.content.fn(item)
+ proxy.$refs.swipeAction.closeAll()
+}
+
+// 删除会话
+function delMsg(item) {
+ // 验证sdk是否准备完毕
+ let isReady = uni.$chat.isReady();
+ if (!isReady) {
+ setTimeout(function () {
+ delMsg(item);
+ }, 200);
+ return
+ }
+
+ let conversationId = item.groupId == null ? `C2C${item.fromId}` : `GROUP${item.groupId}`;
+
+ uni.$chat.deleteConversation(conversationId).then(rs => {
+ getList()
+ })
+}
+
+// 标为已读
+function setRead(item) {
+ // 验证sdk是否准备完毕
+ let isReady = uni.$chat.isReady();
+ if (!isReady) {
+ setTimeout(function () {
+ setRead(item);
+ }, 200);
+ return
+ }
+
+ let conversationId = item.groupId == null ? `C2C${item.fromId}` : `GROUP${item.groupId}`;
+ uni.$chat.setMessageRead({
+ conversationID: conversationId,
+ }).then(rs => {
+ getList()
+ })
+}
@@ -148,7 +234,7 @@ function handleLogout() {
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.unreadCount
+ }}
+
+
+
+
+
+ {{ item.callbackJson.from_name }}
+
+
+ {{ item.groupChatDTO.name }}
+
+
+ {{ util.formatTime('MM-dd HH:mm', item.createTime) }}
+
+ {{ item.chatText }}
+
+
+
+ 到底啦~
+
+
+
@@ -194,25 +321,56 @@ function handleLogout() {
}
}
-//
-.list {
- .item {
- border-top: 1rpx solid #eee;
+// 朋友列表
+.firendBox {
+ height: 100%;
+
+ .scroll {
+ height: 100%;
+ }
+
+ // 列表
+ .list {
+
+ // 消息提示点
+ .mark,
+ .dot {
+ background-color: #FF6B17;
+ text-align: center;
+ line-height: 30rpx;
+ }
+
+ .mark {
+ width: 30rpx;
+ height: 30rpx;
+ }
.dot {
- padding: 5rpx;
- border-radius: 100rpx;
- background-color: #f00;
-
- // 内容
- .content {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 20rpx;
- height: 20rpx;
- }
+ width: 20rpx;
+ height: 20rpx;
}
}
}
-
\ No newline at end of file
+
+
+// //
+// .list {
+// .item {
+// border-top: 1rpx solid #eee;
+
+// .dot {
+// padding: 5rpx;
+// border-radius: 100rpx;
+// background-color: #f00;
+
+// // 内容
+// .content {
+// display: flex;
+// justify-content: center;
+// align-items: center;
+// width: 20rpx;
+// height: 20rpx;
+// }
+// }
+// }
+// }
\ No newline at end of file
diff --git a/service/vite.config.js b/service/vite.config.js
index 47c96de2..16dcc2ec 100644
--- a/service/vite.config.js
+++ b/service/vite.config.js
@@ -10,7 +10,7 @@ export default defineConfig({
plugins: [uni()],
server: {
host: "0.0.0.0",
- port: 5173,
+ port: 8888,
proxy: {
"/system": {
target,