Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thinkApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
游洁
thinkApp
Commits
9211b7d4
Commit
9211b7d4
authored
Sep 28, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改绑定
parent
19ea2576
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
89 deletions
+72
-89
addFriendsAndRelatives.vue
src/pages/FriendsAndRelatives/addFriendsAndRelatives.vue
+56
-75
index.vue
src/pages/FriendsAndRelatives/index.vue
+16
-14
No files found.
src/pages/FriendsAndRelatives/addFriendsAndRelatives.vue
View file @
9211b7d4
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
<text>
{{
AccountName
?
AccountName
:
'**'
}}
的亲友团
</text>
<text>
{{
AccountName
?
AccountName
:
'**'
}}
的亲友团
</text>
</view>
</view>
<view
class=
"title"
>
<view
class=
"title"
>
{{
nickName
?
nickName
:
'
**
'
}}
邀请您加入亲友团
{{
nickName
?
nickName
:
''
}}
邀请您加入亲友团
</view>
</view>
<view
v-if=
"loading"
class=
"addChild-buttom"
@
click=
"getUserProfile"
>
<view
v-if=
"loading"
class=
"addChild-buttom"
@
click=
"getUserProfile"
>
立即加入
立即加入
...
@@ -93,22 +93,15 @@
...
@@ -93,22 +93,15 @@
options
:
null
,
options
:
null
,
nickName
:
''
,
nickName
:
''
,
AccountName
:
''
,
AccountName
:
''
,
Old
UnionId
:
''
,
share
UnionId
:
''
,
loading
:
true
,
loading
:
true
,
form
:{
currentWxUserAuth
:{}
OldUnionId
:
''
,
NewUnionId
:
''
},
msg
:
{
Unionid
:
''
}
});
});
const
pages
=
getCurrentPages
()
// 获取栈实例
const
pages
=
getCurrentPages
()
// 获取栈实例
const
currentRoute
=
pages
[
pages
.
length
-
1
].
route
;
// 获取当前页面路由
const
currentRoute
=
pages
[
pages
.
length
-
1
].
route
;
// 获取当前页面路由
const
methods
=
{
const
methods
=
{
getUserProfile
()
{
getUserProfile
()
{
//新的获取用户资料
//新的获取用户资料
var
that
=
this
;
wx
.
getUserProfile
({
wx
.
getUserProfile
({
desc
:
"用于完善资料"
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
desc
:
"用于完善资料"
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success
:
(
info
)
=>
{
success
:
(
info
)
=>
{
...
@@ -119,7 +112,7 @@
...
@@ -119,7 +112,7 @@
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'尝试授权登陆'
title
:
'尝试授权登陆'
})
})
that
.
loginByOpenCode
(
res
.
code
)
methods
.
loginByOpenCode
(
res
.
code
)
}
}
})
})
},
},
...
@@ -134,32 +127,33 @@
...
@@ -134,32 +127,33 @@
loginByOpenCode
(
Code
){
loginByOpenCode
(
Code
){
getWeChatOpenId
({
Code
}).
then
(
r
=>
{
getWeChatOpenId
({
Code
}).
then
(
r
=>
{
uni
.
setStorageSync
(
'wxUserAuthInfo'
,
r
.
Data
)
uni
.
setStorageSync
(
'wxUserAuthInfo'
,
r
.
Data
)
data
.
u
serAuth
=
r
.
Data
data
.
currentWxU
serAuth
=
r
.
Data
if
(
r
.
Data
.
unionid
){
if
(
r
.
Data
.
unionid
){
that
.
addFriend
(
r
)
methods
.
addFriend
(
r
)
}
}
}).
catch
(
e
=>
{})
}).
catch
(
e
=>
{})
},
},
addFriend
(
r
){
addFriend
(
r
){
data
.
form
=
{
OldUnionId
:
data
.
OldUnionId
,
NewUnionId
:
uni
.
getStorageSync
(
'wxUserAuthInfo'
).
unionid
}
data
.
loading
=
false
data
.
loading
=
false
uni
.
showLoading
()
uni
.
showLoading
()
let
res
=
SetFriend
(
data
.
form
);
let
res
=
SetFriend
({
if
(
res
.
Code
==
1
)
{
OldUnionId
:
data
.
shareUnionId
,
NewUnionId
:
data
.
currentWxUserAuth
.
unionid
}).
then
(
r
=>
{
if
(
r
.
Code
==
1
)
{
uni
.
hideLoading
()
uni
.
hideLoading
()
data
.
loading
=
true
data
.
loading
=
true
that
.
setUserLoginByUnionId
(
r
.
Data
.
unionid
)
methods
.
setUserLoginByUnionId
(
data
.
currentWxUserAuth
.
unionid
)
}
else
{
}
else
{
uni
.
hideLoading
()
uni
.
hideLoading
()
data
.
loading
=
true
data
.
loading
=
true
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
Message
,
title
:
r
.
Message
,
icon
:
"none"
,
icon
:
"none"
,
});
});
}
}
});
},
},
setUserLoginByUnionId
(
uid
){
setUserLoginByUnionId
(
uid
){
loginByUnionId
({
uid
}).
then
(
r
=>
{
loginByUnionId
({
uid
}).
then
(
r
=>
{
...
@@ -169,7 +163,16 @@
...
@@ -169,7 +163,16 @@
r
.
Data
.
forEach
(
x
=>
{
r
.
Data
.
forEach
(
x
=>
{
account
.
push
(
x
.
ClassInAccount
)
account
.
push
(
x
.
ClassInAccount
)
})
})
that
.
setAccountsLogin
(
`'
${
account
.
join
(
"','"
)}
'`
)
if
(
account
.
length
>
0
){
methods
.
setAccountsLogin
(
`'
${
account
.
join
(
"','"
)}
'`
)
}
else
{
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'users'
)
uni
.
setStorageSync
(
'erpUserInfo'
,
r
.
Data
[
0
])
uni
.
reLaunch
({
url
:
'/pages/index/index'
})
}
}
}
}).
catch
(
x
=>
{
}).
catch
(
x
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
...
@@ -197,6 +200,8 @@
...
@@ -197,6 +200,8 @@
url
:
'/pages/index/index'
url
:
'/pages/index/index'
})
})
}
else
if
(
erpStus
){
}
else
if
(
erpStus
){
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'users'
)
uni
.
setStorageSync
(
'erpUserInfo'
,
x
[
0
])
uni
.
setStorageSync
(
'erpUserInfo'
,
x
[
0
])
uni
.
reLaunch
({
uni
.
reLaunch
({
url
:
'/pages/index/index'
url
:
'/pages/index/index'
...
@@ -209,70 +214,46 @@
...
@@ -209,70 +214,46 @@
})
})
},
},
async
getData
()
{
async
getData
()
{
// uni.showLoading()
uni
.
showLoading
()
let
res
=
await
GetUserInfoByUnionId
(
data
.
msg
);
let
res
=
await
GetUserInfoByUnionId
({
Unionid
:
data
.
shareUnionId
});
if
(
res
.
Code
==
1
)
{
if
(
res
.
Code
==
1
)
{
// uni.hideLoading()
data
.
nickName
=
res
.
Data
.
WeChatName
data
.
nickName
=
res
.
Data
.
WeChatName
}
else
{
}
else
{
// uni.hideLoading()
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
Message
,
title
:
res
.
Message
,
icon
:
"none"
,
icon
:
"none"
,
});
});
}
}
uni
.
showModal
({
uni
.
hideLoading
()
title
:
'提示res'
,
content
:
JSON
.
stringify
(
res
.
Data
),
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
}
else
if
(
res
.
cancel
)
{
}
}
});
},
},
};
};
let
that
=
methods
;
onMounted
(()
=>
{
var
url
=
ctx
.
$scope
.
$page
.
fullPath
;
data
.
OldUnionId
=
decodeURIComponent
(
url
.
split
(
'='
)[
1
])
data
.
AccountName
=
decodeURIComponent
(
url
.
split
(
'='
)[
2
])
data
.
msg
.
Unionid
=
data
.
OldUnionId
uni
.
showModal
({
title
:
'ctx'
,
content
:
JSON
.
stringify
(
ctx
.
$scope
.
$page
.
fullPath
),
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
}
else
if
(
res
.
cancel
)
{
}
}
});
});
return
{
return
{
...
toRefs
(
data
),
...
toRefs
(
data
),
...
methods
...
methods
};
};
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
uni
.
showModal
({
console
.
log
(
options
)
title
:
'options'
,
if
(
options
.
AccountName
&&
options
.
unionId
){
content
:
JSON
.
stringify
(
options
),
this
.
AccountName
=
options
.
AccountName
success
:
function
(
res
)
{
this
.
shareUnionId
=
options
.
unionId
if
(
res
.
confirm
)
{
this
.
getData
()
}
// uni.showModal({
// title: 'options',
// content: JSON.stringify(options),
// success: function (res) {
// if (res.confirm) {
}
else
if
(
res
.
cancel
)
{
//
} else if (res.cancel) {
}
//
}
}
//
}
});
//
});
},
},
onShow
(){
onShow
(){
...
...
src/pages/FriendsAndRelatives/index.vue
View file @
9211b7d4
...
@@ -257,15 +257,17 @@
...
@@ -257,15 +257,17 @@
let
msg
=
{
let
msg
=
{
Id
:
item
.
Id
Id
:
item
.
Id
}
}
let
res
=
RemoveMyChild
(
msg
);
RemoveMyChild
(
msg
).
then
(
r
=>
{
if
(
res
.
Code
==
1
)
{
if
(
r
.
Code
==
1
)
{
uni
.
hideLoading
()
uni
.
hideLoading
()
data
.
dataList
=
[]
//
data.dataList = []
data
.
msg
.
pageIndex
=
1
data
.
msg
.
pageIndex
=
1
that
.
getData
()
methods
.
getData
()
}
else
{
}
else
{
uni
.
hideLoading
()
uni
.
hideLoading
()
}
}
});
}
else
if
(
res
.
cancel
)
{
}
else
if
(
res
.
cancel
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'已取消'
,
title
:
'已取消'
,
...
@@ -336,11 +338,11 @@
...
@@ -336,11 +338,11 @@
this
.
wxUserAuthInfo
=
uni
.
getStorageSync
(
'wxUserAuthInfo'
)
this
.
wxUserAuthInfo
=
uni
.
getStorageSync
(
'wxUserAuthInfo'
)
this
.
erpUserInfo
=
uni
.
getStorageSync
(
'erpUserInfo'
)
this
.
erpUserInfo
=
uni
.
getStorageSync
(
'erpUserInfo'
)
this
.
getData
()
this
.
getData
()
//
let path=`/pages/FriendsAndRelatives/addFriendsAndRelatives?unionId=${this.wxUserAuthInfo.unionid}&AccountName=${this.erpUserInfo.AccountName}`
let
path
=
`/pages/FriendsAndRelatives/addFriendsAndRelatives?unionId=
${
this
.
wxUserAuthInfo
.
unionid
}
&AccountName=
${
this
.
erpUserInfo
.
AccountName
}
`
//
console.log(path)
console
.
log
(
path
)
//
uni.navigateTo({
uni
.
navigateTo
({
//
url:path
url
:
path
//
})
})
},
},
onReachBottom
()
{
onReachBottom
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment