From 35d0dde6c49c3df26b05d01fb7645bec67a8042e Mon Sep 17 00:00:00 2001 From: sx <2427911852@qq.com> Date: Sat, 8 Feb 2025 18:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jiuyi2/api/mine.js | 29 ++++++++++++++ jiuyi2/api/shop.js | 4 +- jiuyi2/api/video.js | 4 +- jiuyi2/common/js/config.js | 4 +- jiuyi2/manifest.json | 4 +- jiuyi2/pages/index/article.vue | 2 +- jiuyi2/pages/index/index.nvue | 2 +- jiuyi2/pages/mine/setting/setting.vue | 52 +++++++++++++++++-------- jiuyi2/pages/news/newFriend.vue | 1 + jiuyi2/pages/shop/store/commodities.vue | 8 ++-- jiuyi2/vite.config.js | 4 +- 11 files changed, 81 insertions(+), 33 deletions(-) diff --git a/jiuyi2/api/mine.js b/jiuyi2/api/mine.js index 5f116f73..e03e481c 100644 --- a/jiuyi2/api/mine.js +++ b/jiuyi2/api/mine.js @@ -232,6 +232,35 @@ const mine = { method: 'POST', }) }, + + /** + * 获取im用户资料 + * @param {Object} param + */ + getImUserInfo(param) { + return util.request({ + url: `/user/chat/getImUserInfo`, + query: param.query, + method: 'GET', + }) + }, + + /** + * 修改im用户资料 + * @param {Object} param + */ + setImUserInfo(param) { + return util.request({ + url: `/user/chat/setImUserInfo`, + query: param.query, + data: param.data, + method: 'POST', + load: true, + header: { + // 'Content-Type': 'multipart/form-data', + } + }) + }, } export default mine \ No newline at end of file diff --git a/jiuyi2/api/shop.js b/jiuyi2/api/shop.js index 8143f839..15eed9e5 100644 --- a/jiuyi2/api/shop.js +++ b/jiuyi2/api/shop.js @@ -91,8 +91,8 @@ const shop = { */ removeProduct(param) { return util.request({ - url: `/webProduct`, - method: 'POST', + url: `/shopify/webProduct`, + method: 'DELETE', path: param.path, load: true, }) diff --git a/jiuyi2/api/video.js b/jiuyi2/api/video.js index 43aef5e2..5a78ac20 100644 --- a/jiuyi2/api/video.js +++ b/jiuyi2/api/video.js @@ -227,9 +227,9 @@ const video = { */ followVideo(param) { return util.request({ - url: `/homecommon/followVideo`, + url: `/video/video/attentionList`, query: param.query, - method: 'POST', + method: 'GET', }) }, diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js index ef5cddbf..c3ea7466 100644 --- a/jiuyi2/common/js/config.js +++ b/jiuyi2/common/js/config.js @@ -7,8 +7,8 @@ const config = { // #endif // #ifndef H5 // host: 'http://91f.xyz:8080', - host: 'http://192.168.0.110:8080', - // host: 'http://192.168.0.100:8080', + // host: 'http://bg8fnj.natappfree.cc', + host: 'http://79c97567.r24.cpolar.top', // #endif // 支付方式配置 payType: { diff --git a/jiuyi2/manifest.json b/jiuyi2/manifest.json index 460f8832..578b80ac 100644 --- a/jiuyi2/manifest.json +++ b/jiuyi2/manifest.json @@ -2,8 +2,8 @@ "name" : "九亿", "appid" : "__UNI__08B31BC", "description" : "", - "versionName" : "2.0.0", - "versionCode" : 200, + "versionName" : "1.0.3", + "versionCode" : 1003, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/jiuyi2/pages/index/article.vue b/jiuyi2/pages/index/article.vue index 939d6fd0..b1e74a16 100644 --- a/jiuyi2/pages/index/article.vue +++ b/jiuyi2/pages/index/article.vue @@ -31,7 +31,7 @@ function getDetail() { api.getArticle({ query: { - agreementId: 4, + agreementId: wrapId.value, }, }).then(rs => { if (rs.code == 200) { diff --git a/jiuyi2/pages/index/index.nvue b/jiuyi2/pages/index/index.nvue index b0ae8db0..2cc3fb28 100644 --- a/jiuyi2/pages/index/index.nvue +++ b/jiuyi2/pages/index/index.nvue @@ -496,7 +496,7 @@ function handle_tab(index) { if (tabIndex.value === index) return // 如果是关注 但是没有用户id - if (tab[index].name == '关注' && !userinfo.value.userId) { + if (tab[index].name == '关注' && !userinfo.value.id) { uni.navigateTo({ url: '/pages/login/loginPhone' }) diff --git a/jiuyi2/pages/mine/setting/setting.vue b/jiuyi2/pages/mine/setting/setting.vue index 88bfc710..90cd99ec 100644 --- a/jiuyi2/pages/mine/setting/setting.vue +++ b/jiuyi2/pages/mine/setting/setting.vue @@ -11,24 +11,23 @@ } from '@dcloudio/uni-app' // 工具库 import util from '@/common/js/util.js' + // api + import api from '@/api/index.js' // 腾讯云聊天 import TencentCloudChat from '@tencentcloud/chat'; // 仓库 const store = useStore() // 用户信息 - const userinfo = computed(() => { - let result = store.state.userinfo - return result - }) + const userinfo = computed(() => store.state.userinfo) // 添加好友方式 const allowType = [{ - id: TencentCloudChat.TYPES.ALLOW_TYPE_ALLOW_ANY, + id: 'AllowType_Type_AllowAny', name: '允许任何人添加', }, { - id: TencentCloudChat.TYPES.ALLOW_TYPE_NEED_CONFIRM, + id: 'AllowType_Type_NeedConfirm', name: '需要确认才能添加', }, { - id: TencentCloudChat.TYPES.ALLOW_TYPE_DENY_ANY, + id: 'AllowType_Type_DenyAny', name: '不允许任何人添加 ', }, ] // 添加好友下标 @@ -60,20 +59,39 @@ // 获取添加好友方式 function getAddType() { - // - uni.$chat.getMyProfile().then((rs) => { - const result = rs.data - imUserinfo.value = result - // 添加好友下标 - allowTypeIndex.value = allowType.findIndex(node => node.id == result.allowType) + api.mine.getImUserInfo({ + query: { + userIds: userinfo.value.id + } + }).then(rs => { + if (rs.code === 200) { + console.log('rs', rs) + const result = JSON.parse(rs.msg) + allowTypeIndex.value = allowType.findIndex(item => item.id === result.UserProfileItem[0] + .ProfileItem[0].Value) + return + } + util.alert({ + content: rs.msg, + showCancel: false + }) }) } - // 更细im个人资料 + // 更新im个人资料 function updateMyProfile() { // 修改个人标配资料 - uni.$chat.updateMyProfile({ - allowType: allowType[allowTypeIndex.value].id + api.mine.setImUserInfo({ + query: { + 'allowType': allowType[allowTypeIndex.value].id, + userId: userinfo.value.id, + }, + }).then(rs => { + if (rs.code != 200) + util.alert({ + content: rs.msg, + showCancel: false + }) }) } @@ -182,7 +200,7 @@ - + 好友验证方式 diff --git a/jiuyi2/pages/news/newFriend.vue b/jiuyi2/pages/news/newFriend.vue index 2ca8b227..cccfc14b 100644 --- a/jiuyi2/pages/news/newFriend.vue +++ b/jiuyi2/pages/news/newFriend.vue @@ -106,6 +106,7 @@ // 获取添加朋友列表 function getFriendList() { uni.$chat.getFriendApplicationList().then(rs => { + console.log('getFriendApplicationList',rs) if (rs.code === 0) { const result = rs.data userList.data = result.friendApplicationList.map(node => { diff --git a/jiuyi2/pages/shop/store/commodities.vue b/jiuyi2/pages/shop/store/commodities.vue index bb0d9f23..c60a2783 100644 --- a/jiuyi2/pages/shop/store/commodities.vue +++ b/jiuyi2/pages/shop/store/commodities.vue @@ -99,8 +99,9 @@ /** * 删除发布的商品 * @param {Object} item 商品对象 + * @param {Object} index 操作的下标 */ - function handleRemove(item) { + function handleRemove(item, index) { util.alert({ content: '确定删除该商品吗?', }).then(res => { @@ -110,8 +111,7 @@ path: [item.id] }).then(rs => { if (rs.code === 200) { - // 重构商品列表 - refeshList() + product.list.splice(index, 1) return } util.alert({ @@ -160,7 +160,7 @@ - 删除 + 删除 编辑 diff --git a/jiuyi2/vite.config.js b/jiuyi2/vite.config.js index 9b1c0bdf..602e0d24 100644 --- a/jiuyi2/vite.config.js +++ b/jiuyi2/vite.config.js @@ -4,8 +4,8 @@ import { import uni from '@dcloudio/vite-plugin-uni'; // let target = 'http://91f.xyz:8080' -let target = 'http://192.168.0.110:8080' -// let target = 'http://192.168.0.100:8080' +// let target = 'http://bg8fnj.natappfree.cc' +let target = 'http://79c97567.r24.cpolar.top' export default defineConfig({ plugins: [uni()],