合并代码
This commit is contained in:
parent
42072a546e
commit
35d0dde6c4
|
@ -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
|
|
@ -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,
|
||||
})
|
||||
|
|
|
@ -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',
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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" : {
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
function getDetail() {
|
||||
api.getArticle({
|
||||
query: {
|
||||
agreementId: 4,
|
||||
agreementId: wrapId.value,
|
||||
},
|
||||
}).then(rs => {
|
||||
if (rs.code == 200) {
|
||||
|
|
|
@ -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'
|
||||
})
|
||||
|
|
|
@ -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 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view class="line" v-if="imUserinfo.userID">
|
||||
<view class="line" v-if="userinfo.id">
|
||||
<picker :range="allowType" range-key="name" @change="handleAllowType" :value="allowTypeIndex">
|
||||
<view class=" rows">
|
||||
<view class="">好友验证方式</view>
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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 @@
|
|||
<!-- <view class="btn sm bar closeHollow plr30">下架</view> -->
|
||||
<!-- <view class="btn sm bar closeHollow plr30">改价</view> -->
|
||||
<!-- 在没有进行中的订单才能删除 -->
|
||||
<view class="btn sm bar closeHollow plr30" @click="handleRemove(item)">删除</view>
|
||||
<view class="btn sm bar closeHollow plr30" @click="handleRemove(item,index)">删除</view>
|
||||
<view class="btn sm bar warmHollow plr30" @click="handleEdit(item)">编辑</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -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()],
|
||||
|
|
Loading…
Reference in New Issue