Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
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
刘文虎
account-book
Commits
5e6e0ffb
Commit
5e6e0ffb
authored
Oct 20, 2022
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 邀请有奖
parent
fad7aae3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
259 additions
and
21 deletions
+259
-21
App.vue
App.vue
+14
-3
pages.json
pages.json
+9
-0
index.vue
pages/card/index.vue
+1
-1
share.vue
pages/card/share.vue
+1
-5
index.vue
pages/index/index.vue
+13
-3
mine.vue
pages/index/mine/mine.vue
+15
-0
show.vue
pages/maintain-bill/show.vue
+1
-9
index.vue
pages/mine/share/index.vue
+205
-0
No files found.
App.vue
View file @
5e6e0ffb
...
...
@@ -2,7 +2,8 @@
<
script
>
import
{
getLatestVersionNumber
}
from
'@/api/common/index.js'
;
import
{
version
}
from
'@/utils/config.js'
;
import
{
checkToken
}
from
'@/utils/common.js'
;
export
default
{
onLaunch
:
function
()
{
// setToken("eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1bmlvbklkIjoib1gtVEs2VmVTWmNVbUx0cWhodk15NU1mYk9IMCIsIm9wZW5JZCI6Im9aZk5VNUVhSEF3bGdrbm8yQno3Y1Q0X0JRVUUiLCJuYW1lIjoi6Ze7562gIiwibW9iaWxlIjoiMTM0MjM4MzExOTEiLCJ0b2tlbl90eXBlIjoidG9rZW4iLCJ1c2VyaWQiOiIxNTUyNDg2NzEyMzY4NjkzMjQ4IiwiYWNjb3VudCI6IjEzNDIzODMxMTkxIiwiaWF0IjoxNjYwNzA4MzYyLCJuYmYiOjE2NjA3MDgzNjIsImV4cCI6MTY2MjAwNDM2Mn0.9hBVwqmYDxL4Q0S05JXQqteOWI9kda_UXxX5-eNO1LY")
...
...
@@ -21,8 +22,18 @@ import { version } from '@/utils/config.js';
this
.
appUpdateCheck
()
// #endif
},
onShow
:
function
()
{
console
.
log
(
'App Show'
)
onShow
:
function
(
options
)
{
var
options
=
{
query
:{
shareUserId
:
2131
}}
console
.
log
(
'App Show'
,
options
)
if
(
options
&&
options
.
query
&&
options
.
query
.
shareUserId
)
{
var
shareUserId
=
options
.
query
.
shareUserId
console
.
log
(
'---App Show---被邀请进来--------'
,
shareUserId
)
if
(
checkToken
())
{
// 调接口
}
else
{
uni
.
setStorageSync
(
'shareUserId'
,
shareUserId
);
}
}
},
onHide
:
function
()
{
console
.
log
(
'App Hide'
)
...
...
pages.json
View file @
5e6e0ffb
...
...
@@ -355,6 +355,15 @@
"navigationStyle"
:
"custom"
}
},{
"path"
:
"share/index"
,
"name"
:
"share"
,
"style"
:
{
"navigationBarTitleText"
:
"邀请有奖"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
]
},
...
...
pages/card/index.vue
View file @
5e6e0ffb
...
...
@@ -119,7 +119,7 @@ export default {
return
`"
${
this
.
info
.
name
}
"的名片`
;
},
shareParams
()
{
return
`?cardId=
${
this
.
info
.
id
}
&shareUserId=
${
this
.
userInfo
.
id
}
`
;
return
`?cardId=
${
this
.
info
.
id
}
`
;
},
infoKeys
()
{
// {view:浏览;call:拨打电话;list:通讯录},可用值:VIEW,CALL,LIST
...
...
pages/card/share.vue
View file @
5e6e0ffb
...
...
@@ -59,7 +59,6 @@ export default {
return
{
cardId
:
''
,
info
:
{},
// shareUserId: '',
loading
:
false
,
}
},
...
...
@@ -96,16 +95,13 @@ export default {
return
`"
${
this
.
info
.
name
}
"的名片`
},
shareParams
()
{
return
`?cardId=
${
this
.
info
.
id
}
&shareUserId=
${
this
.
userInfo
.
id
}
`
return
`?cardId=
${
this
.
info
.
id
}
`
},
},
onLoad
(
options
)
{
// 测试数据
// options.cardId = '1551474307392077824'
// if (options && options.shareUserId) {
// this.shareUserId = options.shareUserId
// }
if
(
options
.
q
)
{
// 扫码进的
const
q
=
decodeURIComponent
(
options
.
q
)
...
...
pages/index/index.vue
View file @
5e6e0ffb
...
...
@@ -284,6 +284,7 @@ export default {
this
.
initInfo
();
if
(
this
.
checkToken
())
{
this
.
getUserInfo
();
this
.
checkShare
()
}
this
.
shareSuccessTip
();
},
...
...
@@ -503,6 +504,15 @@ export default {
}
});
},
checkShare
()
{
const
shareUserId
=
uni
.
getStorageSync
(
'shareUserId'
);
if
(
shareUserId
)
{
console
.
log
(
'---index---被邀请进来------'
,
shareUserId
)
// 调接口
// 成功之后
// uni.setStorageSync('shareUserId', '');
}
},
handleClickShare
()
{
var
block
=
()
=>
{
if
(
this
.
userInfo
.
vip
.
code
==
'NO'
)
{
...
...
@@ -532,7 +542,7 @@ export default {
title
:
'扳手记账'
,
miniProgram
:
{
id
:
wxMiniId
,
path
:
`/pages/index/index
?shareUserId=
${
this
.
userInfo
.
id
}
`
,
path
:
`/pages/index/index`
,
type
:
0
,
webUrl
:
webUrl
},
...
...
@@ -555,7 +565,7 @@ export default {
}
return
{
title
:
'扳手记账'
,
path
:
`/pages/index/index
?shareUserId=
${
this
.
userInfo
.
id
}
`
,
path
:
`/pages/index/index`
,
imageUrl
:
image
};
},
...
...
@@ -567,7 +577,7 @@ export default {
}
return
{
title
:
'扳手记账'
,
path
:
`/pages/index/index
?shareUserId=
${
this
.
userInfo
.
id
}
`
,
path
:
`/pages/index/index`
,
imageUrl
:
image
};
}
...
...
pages/index/mine/mine.vue
View file @
5e6e0ffb
...
...
@@ -4,6 +4,9 @@
<user-header
:vipStatus=
"vipStatus"
:vipStatusText=
"vipStatusText"
></user-header>
<!-- 购买会员入口 -->
<vip-center
v-if=
"showPayEntrance"
></vip-center>
<view
v-else
class=
"invite-view"
hover-class=
"u-hover-class"
@
click=
"$u.throttle(handleClickInvite, 500)"
>
<image
:src=
"inviteImage"
></image>
</view>
<user-total
:list=
"usedOptions"
title=
"常用功能"
:showCDKey=
"showCDKey"
></user-total>
<my-package
:messageNum=
"messageNum"
></my-package>
</view>
...
...
@@ -24,6 +27,7 @@ import { tabbar } from '@/utils/settings.js';
import
{
mapGetters
}
from
'vuex'
;
import
{
notReadCount
}
from
'@/api/mine/update-log.js'
;
import
{
systemExchange
,
getGoodsList
,
getOrderInfo
}
from
'@/api/mine/pay.js'
;
import
{
baseUrl
}
from
'@/utils/config.js'
;
export
default
{
components
:
{
...
...
@@ -85,6 +89,9 @@ export default {
break
;
}
return
text
;
},
inviteImage
()
{
return
baseUrl
+
'yaoqingbanner@3x.png'
}
},
onLoad
()
{
...
...
@@ -276,6 +283,11 @@ export default {
console
.
log
(
'关闭订单失败'
);
});
},
handleClickInvite
()
{
this
.
$u
.
route
({
url
:
'pages/mine/share/index'
});
}
}
};
</
script
>
...
...
@@ -283,5 +295,8 @@ export default {
<
style
lang=
"scss"
scoped
>
.mine
{
padding
:
0
24upx
;
.invite-view
{
height
:
114upx
;
margin-top
:
56upx
;
}
}
</
style
>
pages/maintain-bill/show.vue
View file @
5e6e0ffb
...
...
@@ -213,7 +213,6 @@ export default {
sendStatus
:
{}
},
visible
:
false
,
shareUserId
:
''
,
buttonLoading
:
false
,
path
:
''
,
poster
:
{},
...
...
@@ -232,7 +231,7 @@ export default {
return
'请客户微信扫码领取账单'
;
},
shareParams
()
{
return
`?billId=
${
this
.
billId
}
&shareUserId=
${
this
.
userInfo
.
id
}
`
;
return
`?billId=
${
this
.
billId
}
`
;
},
shareUrl
()
{
return
maintain_share_url
+
this
.
shareParams
;
...
...
@@ -392,10 +391,6 @@ export default {
if
(
options
&&
options
.
billId
)
{
this
.
billId
=
options
.
billId
;
}
if
(
options
&&
options
.
shareUserId
)
{
this
.
shareUserId
=
options
.
shareUserId
;
}
}
// 测试数据
...
...
@@ -422,9 +417,6 @@ export default {
if
(
item
.
indexOf
(
'billId='
)
!=
-
1
)
{
this
.
billId
=
item
.
split
(
'='
)[
1
];
}
if
(
item
.
indexOf
(
'shareUserId='
)
!=
-
1
)
{
this
.
shareUserId
=
item
.
split
(
'='
)[
1
];
}
}
}
},
...
...
pages/mine/share/index.vue
0 → 100644
View file @
5e6e0ffb
<
template
>
<view
class=
"share-view"
>
<NavbarRight
title=
"邀请有奖"
/>
<view
class=
"content-view"
>
<!-- #ifdef APP-PLUS -->
<scroll-view
scroll-y=
"true"
style=
"height:100%;position: relative;"
>
<!-- #endif -->
<view
class=
"image-view"
>
<image
mode=
"widthFix"
:src=
"backgroundImage"
></image>
</view>
<!-- #ifdef APP-PLUS -->
</scroll-view>
<!-- #endif -->
<view
class=
"info-view"
>
<view
class=
"head-image"
>
<image
:src=
"userInfo.avatar"
></image>
</view>
<view>
{{
userInfo
.
nickname
}}
</view>
</view>
</view>
<view
class=
"bottom-view"
>
<u-button
type=
"success"
open-type=
"share"
:custom-style=
"customShare"
@
click=
"handleClickShare"
>
<view
class=
"bottom-content"
>
<view
class=
"icon-view"
>
<image
:src=
"shareIcon"
></image>
</view>
<view
class=
"share-view"
>
分享邀请
</view>
</view>
</u-button>
</view>
</view>
</
template
>
<
script
>
import
NavbarRight
from
'@/components/navbar-right'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
wxMiniId
,
webUrl
}
from
'@/utils/config.js'
;
export
default
{
components
:
{
NavbarRight
,
},
data
()
{
return
{
};
},
computed
:
{
...
mapGetters
([
'userInfo'
]),
baseUrl
()
{
return
process
.
uniEnv
.
qn_base_url
;
},
backgroundImage
()
{
return
this
.
baseUrl
+
'yaoqinghuodong.jpg'
},
shareImage
()
{
return
this
.
baseUrl
+
'yaoqinghuodongfenxiang.jpg'
},
shareIcon
()
{
return
this
.
baseUrl
+
'fenxiangicon@3x.png'
},
customShare
()
{
return
{
color
:
'transparent'
,
'background-color'
:
'transparent'
,
height
:
'104rpx'
,
'border-radius'
:
'52rpx'
,
width
:
'652rpx'
,
padding
:
'0rpx'
};
}
},
onLoad
(
options
)
{
},
onUnload
()
{
},
methods
:
{
handleClickShare
()
{
},
handleClickShare
()
{
// #ifdef APP-PLUS
uni
.
share
({
provider
:
'weixin'
,
scene
:
'WXSceneSession'
,
type
:
5
,
href
:
webUrl
,
imageUrl
:
this
.
shareImage
,
title
:
'扳手记账'
,
miniProgram
:
{
id
:
wxMiniId
,
path
:
`/pages/index/index?shareUserId=
${
this
.
userInfo
.
id
}
`
,
type
:
0
,
webUrl
:
webUrl
},
success
:
ret
=>
{
console
.
log
(
JSON
.
stringify
(
ret
));
block
();
},
fail
:
function
(
err
)
{
console
.
log
(
'fail:'
+
JSON
.
stringify
(
err
));
}
});
// #endif
},
// 朋友圈
onShareTimeline
(
res
)
{
return
{
title
:
'扳手记账'
,
path
:
`/pages/index/index?shareUserId=
${
this
.
userInfo
.
id
}
`
,
imageUrl
:
this
.
shareImage
};
},
// 好友
onShareAppMessage
(
res
)
{
return
{
title
:
'扳手记账'
,
path
:
`/pages/index/index?shareUserId=
${
this
.
userInfo
.
id
}
`
,
imageUrl
:
this
.
shareImage
};
}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
.share-view
{
display
:
flex
;
flex-direction
:
column
;
height
:
100vh
;
background-color
:
#f6f7fa
;
.content-view
{
height
:
100%
;
overflow
:
auto
;
position
:
relative
;
.image-view
{
width
:
100%
;
position
:
relative
;
}
.info-view
{
position
:
absolute
;
font-size
:
28rpx
;
color
:
#ffffff
;
font-weight
:
bold
;
top
:
36rpx
;
right
:
0
;
left
:
28rpx
;
display
:
flex
;
align-items
:
center
;
.head-image
{
width
:
56rpx
;
height
:
56rpx
;
border-radius
:
50%
;
margin-right
:
12rpx
;
overflow
:
hidden
;
border
:
2rpx
solid
#ffffff
;
}
}
}
.bottom-view
{
margin
:
16rpx
24rpx
36rpx
24rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
background-color
:
#ffffff
;
.bottom-content
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
background-image
:
linear-gradient
(
to
bottom
,
#FF8A20
0%
,
#EB172C
100%
);
overflow
:
hidden
;
border-radius
:
52rpx
;
.icon-view
{
width
:
32rpx
;
height
:
32rpx
;
margin-right
:
16rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.share-view
{
color
:
#ffffff
;
font-weight
:
bold
;
font-size
:
32rpx
;
margin-left
:
8rpx
;
background-color
:
transparent
;
height
:
100%
;
line-height
:
104rpx
;
}
}
}
}
</
style
>
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