cyl/app
jscyl13849007907 4 months ago
parent 02fd68bea3
commit a5479084e6

@ -57,212 +57,17 @@ export default {
uni.$on('isGlogin', function (data) { uni.$on('isGlogin', function (data) {
console.log('app.vue 接收', data) console.log('app.vue 接收', data)
if (uni.getStorageSync('apply-uid')) { if (uni.getStorageSync('apply-uid')) {
that.initWyyx() // that.initWyyx()
} }
}) })
if (uni.getStorageSync('apply-token')) { if (uni.getStorageSync('apply-token')) {
console.log('app.vue 是否调用') console.log('app.vue 是否调用')
that.initWyyx() // that.initWyyx()
} }
}, },
onHide: function () {}, onHide: function () {},
methods: { methods: {
initWyyx() { checkNum() {
let that = this
that.F.wyyxPost(
that.api.wyyx_getConfig,
{
userId: uni.getStorageSync('apply-uid'),
},
(res) => {
console.log('wyyx_getConfig', res)
let resData = {
appkey: res.appKey,
accid: res.accid,
token: res.token,
}
const imOptions = {
appkey: resData.appkey, // appkey
account: resData.accid, // account
token: resData.token, // token
// appkey: "7e19d679085266aa872a8de12f0c1ae5", // appkey
// account: "9", // account
// token: "2d4ca36cca6293cf3a81d6ca1b8026f7", // token
}
if (imOptions) {
this.initNim(imOptions)
} else {
// ,
}
}
)
},
async initNim(opts) {
let that = this
// nim sdk
const nim = (uni.$UIKitNIM = V2NIM.getInstance(
{
appkey: opts.appkey,
needReconnect: true,
// "reconnectionAttempts": 5,
debugLevel: 'debug',
apiVersion: 'v2',
enableV2CloudConversation: true,
},
{
V2NIMLoginServiceConfig: {
lbsUrls: isWxApp ? ['https://lbs.netease.im/lbs/wxwebconf.jsp'] : ['https://lbs.netease.im/lbs/webconf.jsp'],
linkUrl: isWxApp ? 'wlnimsc0.netease.im' : 'weblink.netease.im',
/**
* 使用固定设备 ID
*/
isFixedDeviceId: true,
},
}
))
that.globalData.nim = nim
// store
const store = (uni.$UIKitStore = new RootStore(
nim,
{
addFriendNeedVerify: false,
// p2p p2p false
p2pMsgReceiptVisible: true,
// false
teamMsgReceiptVisible: true,
teamAgreeMode: V2NIMConst.V2NIMTeamAgreeMode.V2NIM_TEAM_AGREE_MODE_NO_AUTH,
sendMsgBefore: async (options: { msg: V2NIMMessage; conversationId: string; serverExtension?: Record<string, unknown> }) => {
const pushContent = getMsgContentTipByType({
text: options.msg.text,
messageType: options.msg.messageType,
})
const yxAitMsg = options.serverExtension ? options.serverExtension.yxAitMsg : { forcePushIDsList: '[]', needForcePush: false }
// at 线
const { forcePushIDsList, needForcePush } = yxAitMsg
? // @ts-ignore
store.msgStore._formatExtAitToPushInfo(yxAitMsg, options.msg.text)
: { forcePushIDsList: '[]', needForcePush: false }
console.log('forcePushIDsList: ', forcePushIDsList)
const { conversationId } = options
const conversationType = nim.V2NIMConversationIdUtil.parseConversationType(conversationId)
const targetId = nim.V2NIMConversationIdUtil.parseConversationTargetId(conversationId)
const pushPayload = JSON.stringify({
// oppo
oppoField: {
click_action_type: 4, // oppo
click_action_activity: '', // TODO
action_parameters: {
sessionId: targetId,
sessionType: conversationType,
}, //
},
// vivo
vivoField: {
pushMode: 0, //0 1 0
},
// huawei
hwField: {
click_action: {
type: 1,
action: '', // TODO
},
androidConfig: {
category: 'IM',
data: JSON.stringify({
sessionId: targetId,
sessionType: conversationType,
}),
},
},
//
sessionId: targetId,
sessionType: conversationType,
})
const pushConfig: V2NIMMessagePushConfig = {
pushEnabled: true,
pushNickEnabled: true,
forcePush: needForcePush,
forcePushContent: pushContent,
forcePushAccountIds: forcePushIDsList,
pushPayload: '{}',
pushContent,
}
return { ...options, pushConfig }
},
},
'UniApp'
))
// #ifdef APP-PLUS
const nimPushPlugin = uni.requireNativePlugin('NIMUniPlugin-PluginModule')
nim.V2NIMSettingService.setOfflinePushConfig(nimPushPlugin, {
miPush: {
appId: '2882303761520397320',
appKey: '5102039734320',
certificateName: 'xiaomiCertificateName',
},
vivoPush: {
certificateName: 'vivoCertificateName',
},
oppoPush: {
appId: '32967155',
appKey: 'b98618cb272944dea324af6421d42a79',
secret: '0b7ce705a2304a17b78f20011c18890c',
certificateName: 'opopCertificateName',
},
honorPush: {
certificateName: 'rongyaoCertificateName',
},
apns: {
// certificateName: 'AuthKey_98P8URRXUD_test', //:
certificateName: 'AuthKey_98P8URRXUD', //
},
})
console.log('是否执行 推送')
// #endif
nim.V2NIMLoginService.login(opts.account, opts.token).then(() => {})
nim.V2NIMConversationService.on('onConversationChanged', function (conversationList: V2NIMConversation[]) {
console.log('初始化监听会话:', conversationList)
let _bool = conversationList.filter((item) => {
return Number(item.unreadCount) > 0
})
console.log('初始化监听会话bool:', _bool)
if (_bool && _bool.length > 0) {
that.playAudio() //
}
})
},
playAudio() {
let that = this
const innerAudioContext = uni.createInnerAudioContext()
innerAudioContext.autoplay = true
innerAudioContext.src = 'https://matripe-cms.oss-cn-beijing.aliyuncs.com/ibocai/tip.mp3'
innerAudioContext.onPlay(() => {
console.log('开始播放')
})
uni.vibrateShort()
innerAudioContext.onError((res) => {
console.log(res.errMsg)
console.log(res.errCode)
})
},
checkNum() {
let that = this let that = this
if (uni.getStorageSync('apply-token')) { if (uni.getStorageSync('apply-token')) {
that.G.Get(that.api.bind_getApplyNum, {}, (res) => { that.G.Get(that.api.bind_getApplyNum, {}, (res) => {

@ -116,8 +116,19 @@
3用户不得利用本服务进行任何有损本平台及其关联单位之权利利益及商誉或其他用户合法权利之行为 <br /> 3用户不得利用本服务进行任何有损本平台及其关联单位之权利利益及商誉或其他用户合法权利之行为 <br />
4用户不得基于本服务从事侵害本平台合法权益的行为如有违反本平台将依据中国现行法律法规及本平台的相关规定予以处理 <br /> 4用户不得基于本服务从事侵害本平台合法权益的行为如有违反本平台将依据中国现行法律法规及本平台的相关规定予以处理 <br />
5用户不得从事任何利用本平台平台系统漏洞进行有损其他用户本平台或互联网安全的行为 <br /> 5用户不得从事任何利用本平台平台系统漏洞进行有损其他用户本平台或互联网安全的行为 <br />
6用户知悉并确认本平台通过公告邮件短信账户通知以及用户在账户中登记的即时通讯工具等方式向用户发出关于本服务的通知规则提示等信息均为有效通知该等信息一经公布或发布即视为已送达至用户 6用户知悉并确认本平台通过公告邮件短信账户通知以及用户在账户中登记的即时通讯工具等方式向用户发出关于本服务的通知规则提示等信息均为有效通知该等信息一经公布或发布即视为已送达至用户 <br />
7支持注销账户删除后不可恢复请慎重操作
</view> </view>
<div>
开发者 <br />
开发者名称郑州伯才科技有限公司 <br />
运营者名称郑州伯才科技有限公司 <br />
更新日期2025年7月23日 <br />发布日期 2025年7月23日 <br />
生效日期 2025年7月23日 <br />
</div>
</view> </view>
</template> </template>

@ -332,7 +332,16 @@
<view class="fw500">11.3 协议可分性</view> <view class="fw500">11.3 协议可分性</view>
<text class="fw500">协议可分性</text> 本协议任一条款被视为废止无效或不可执行该条应视为可分的且并不影响本协议其余条款的有效性及可执行性 <text class="fw500">协议可分性</text> 本协议任一条款被视为废止无效或不可执行该条应视为可分的且并不影响本协议其余条款的有效性及可执行性
<div>
开发者 <br />
开发者名称郑州伯才科技有限公司 <br />
运营者名称郑州伯才科技有限公司 <br />
更新日期2025年7月23日 <br /> 发布日期 2025年7月23日 <br />
生效日期 2025年7月23日 <br />
</div>
</view> </view>
</view> </view>
</template> </template>

@ -34,6 +34,20 @@
]" ]"
@clickItem="handleClickItem" @clickItem="handleClickItem"
/> />
<view class="g_mt_24">
<g-panel-form-item
:list="[
{
icon: '',
label: '注销',
result: '',
path: '',
tip: 'zhuxiao',
},
]"
@clickItem="handleClickZHUxiao"
/>
</view>
<view class="g_mt_24"> <view class="g_mt_24">
<g-panel-form-item <g-panel-form-item
:list="[ :list="[
@ -177,6 +191,26 @@ export default {
}); });
}); });
}, },
handleClickZHUxiao(){
let that = this;
that.G.handleConfirm({
content: "确认注销吗?注销后不可恢复,请慎重操作",
success: (res) => {
if (res.confirm) {
that.G.Get(that.api.login_out, {}, (res) => {
that.G.clearLocalStorage();
let params = {
path: "",
level: "",
};
uni.reLaunch({
url: "/root/person/loginIndex?" + that.G.objToStr(params),
});
});
}
},
});
},
handleClickItem(e) { handleClickItem(e) {
console.log("item点击事件", e); console.log("item点击事件", e);
if (e.item.path == "qiehuan") { if (e.item.path == "qiehuan") {

Loading…
Cancel
Save