Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
51ef1251
Commit
51ef1251
authored
Oct 18, 2025
by
王炽
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab2.dui88.com/fh/20250528_FHQ1
into dev
parents
5fe80fcc
c85fa219
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
654 additions
and
65 deletions
+654
-65
api.ts
activities/1015/api.ts
+3
-3
home.vue
activities/1015/home.vue
+2
-1
mock-configs.js
activities/1015/mock-configs.js
+1
-15
mock-configs.json
activities/1015/mock-configs.json
+541
-0
request.js
api/request.js
+1
-0
index.vue
pages/activity/index.vue
+58
-30
prize-1.png
public/activity/1015/v1/prize-img/prize-1.png
+0
-0
prize-2.png
public/activity/1015/v1/prize-img/prize-2.png
+0
-0
prize-3.png
public/activity/1015/v1/prize-img/prize-3.png
+0
-0
prize-nothing.png
public/activity/1015/v1/prize-img/prize-nothing.png
+0
-0
icon_mamaaihuodong.png
public/icons/icon_mamaaihuodong.png
+0
-0
icon_xianxiahuodong.png
public/icons/icon_xianxiahuodong.png
+0
-0
gen-webview-urls.js
scripts/gen-webview-urls.js
+2
-2
index.js
utils/index.js
+46
-14
No files found.
activities/1015/api.ts
View file @
51ef1251
...
...
@@ -8,10 +8,10 @@ import {InvitationInfo, CodeResponse} from "@/activities/1015/types";
* @returns
*/
export
function
fetchPageConfig
()
{
//return api.get('/c/front/content', {type: 'act915',version: '1'})
return
Promise
.
resolve
({
/*return Promise.resolve({
data: homeConfig(),
})
})*/
return
api
.
get
(
'/c/front/content'
,
{
type
:
'act1015'
,
version
:
'1'
})
}
/**
...
...
activities/1015/home.vue
View file @
51ef1251
...
...
@@ -132,6 +132,7 @@ const updatePageConfig = async () => {
try {
loading.value = true
const response = await fetchPageConfig()
//console.log('获取到的配置数据:', JSON.stringify(response.data, null, 2))
if (response && response.data) {
pageConfig.value = response.data
...
...
@@ -204,7 +205,7 @@ const onGetPhoneNumber = async (e) => {
console.warn('授权后重新获取用户信息')
}, {
wxLoginBusinessDTO: {
activityUserInvite
10
15Code: incomingCode
activityUserInvite
9
15Code: incomingCode
}
})
} catch (error) {
...
...
activities/1015/mock-configs.js
View file @
51ef1251
...
...
@@ -6,7 +6,7 @@ const pageName = '1015专题活动页面'
export
function
homeConfig
(){
return
{
"background"
:
{
image
:
getCdnUrl
(
'home/bg.
pn
g'
),
image
:
getCdnUrl
(
'home/bg.
jp
g'
),
style
:
{
backgroundPosition
:
{
y
:
"calc(4937rpx + 845rpx)"
}
}
...
...
@@ -390,23 +390,9 @@ export function homeConfig(){
}
},
],
"lottery"
:
{
"image"
:
"act1015Page/v3/act1015PageLotteryBanner.png"
,
"link"
:
{
"type"
:
1
,
"url"
:
"/activity0915/lottery/lottery"
}
},
"invite"
:
{
"image"
:
"act1015Page/v3/act1015PageInviteConBg.png"
,
"link"
:
{
"type"
:
1
,
"url"
:
"/pages/invite/invite"
},
"inviteConStatusNo1Img"
:
"act1015Page/v3/act1015PageInviteConStatusNo.png"
,
"inviteConStatusYes2Img"
:
"act1015Page/v3/act1015PageInviteConStatusYes.png"
,
"inviteConStatusYes1Img"
:
"act1015Page/v3/act1015PageInviteConStatusYes.png"
,
"inviteConStatusNo2Img"
:
"act1015Page/v3/act1015PageInviteConStatusNo.png"
}
}
}
//console.log('page-config:', JSON.stringify(act1015Config, null, 2))
// 获取图片URL的工具函数
export
const
getImageUrl
=
(
imagePath
)
=>
{
return
imagePath
...
...
activities/1015/mock-configs.json
0 → 100644
View file @
51ef1251
This diff is collapsed.
Click to expand it.
api/request.js
View file @
51ef1251
...
...
@@ -17,6 +17,7 @@ const {
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
// const baseUrl = "https://momclub-test.feihe.com/pmall";//测试环境2
let
baseUrl
=
"https://momclub.feihe.com/pmall"
;
//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
...
...
pages/activity/index.vue
View file @
51ef1251
...
...
@@ -2,7 +2,7 @@
<web-view
:src=
"src"
@
message=
"onMessage"
/>
</
template
>
<
script
setup
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
watch
,
nextTick
}
from
"vue"
;
import
{
onLoad
,
onShow
,
onShareAppMessage
,
onShareTimeline
}
from
"@dcloudio/uni-app"
;
import
{
useGlobalStore
}
from
"../../stores/global"
;
...
...
@@ -13,12 +13,12 @@ const userStore = useUserStore();
const
globalStore
=
useGlobalStore
()
function
getRegistered
()
{
return
userStore
.
userInfo
?.
memberId
!==
"not_login"
return
!!
(
userStore
.
userInfo
&&
userStore
.
userInfo
?.
memberId
!==
"not_login"
)
}
const
pageOptions
=
ref
({})
const
src
=
ref
(
""
)
;
const
registered
=
ref
(
false
)
const
src
=
ref
(
""
)
const
registered
=
ref
(
undefined
)
const
urlMap
=
{
//'main': 'http://192.168.0.5:8001/#/page',
...
...
@@ -27,8 +27,57 @@ const urlMap = {
const
shareData
=
ref
(
null
)
onShow
(()
=>
{
const
handleBack
=
()
=>
{
try
{
uni
.
navigateBack
({
delta
:
1
,
fail
:
()
=>
{
// 如果返回失败,跳转到首页
uni
.
redirectTo
({
url
:
'/pages/index/index'
})
}
})
}
catch
(
error
)
{
console
.
log
(
'返回失败:'
,
error
)
uni
.
redirectTo
({
url
:
'/pages/index/index'
})
}
}
async
function
ensureAutoLogin
()
{
if
(
!
globalStore
.
cuk
)
{
await
userStore
.
normalAutoLogin
()
}
}
onShow
(
async
()
=>
{
const
oldVal
=
registered
.
value
await
ensureAutoLogin
()
await
userStore
.
loadUserInfo
()
registered
.
value
=
getRegistered
()
if
(
oldVal
===
undefined
)
{
if
(
pageOptions
.
value
.
needLogin
&&
!
registered
.
value
)
{
jump
({
type
:
JumpType
.
INNER
,
url
:
'/pages/activity/register'
,
})
}
}
else
{
if
(
registered
.
value
===
false
)
{
uni
.
showToast
({
title
:
"授权失败,即将返回"
,
icon
:
"none"
,
});
setTimeout
(()
=>
{
handleBack
()
},
1000
)
}
}
})
function
joinUrlAndQs
(
url
,
qs
)
{
...
...
@@ -38,12 +87,11 @@ function joinUrlAndQs(url, qs) {
}
watch
(()
=>
registered
.
value
,
(
newVal
,
oldVal
)
=>
{
if
(
newVal
!==
oldVal
)
{
const
oldSrc
=
src
.
value
if
(
!
pageOptions
.
value
.
needLogin
||
newVal
)
{
src
.
value
=
''
nextTick
(()
=>
{
src
.
value
=
joinUrlAndQs
(
oldSrc
,
'registered='
+
newVal
)
initOk
(
newVal
)
})
}
})
...
...
@@ -76,7 +124,7 @@ function initOk() {
.
join
(
'&'
)
url
=
joinUrlAndQs
(
url
,
paramStr
)
if
(
options
.
params
)
{
if
(
options
.
params
)
{
url
=
joinUrlAndQs
(
url
,
decodeURIComponent
(
options
.
params
))
}
...
...
@@ -92,20 +140,6 @@ onLoad(async (options) => {
withShareTicket
:
true
,
menus
:
[
'shareAppMessage'
,
'shareTimeline'
]
})
await
userStore
.
normalAutoLogin
()
await
userStore
.
loadUserInfo
()
registered
.
value
=
getRegistered
()
if
(
options
.
needLogin
&&
!
registered
.
value
)
{
jump
({
type
:
JumpType
.
INNER
,
url
:
'/pages/activity/register'
,
})
}
else
{
initOk
()
}
});
function
onMessage
(
e
)
{
...
...
@@ -153,15 +187,9 @@ onShareAppMessage((options) => {
return
shareHook
()
})
onShareTimeline
((
options
)
=>
{
console
.
log
(
'分享到朋友圈数据:'
,
shareData
.
value
)
return
shareHook
()
})
</
script
>
<
script
>
<
script
lang=
"ts"
>
/*export default {
onShareAppMessage() {
return this.shareHook()
...
...
public/activity/1015/v1/prize-img/prize-1.png
0 → 100644
View file @
51ef1251
51.2 KB
public/activity/1015/v1/prize-img/prize-2.png
0 → 100644
View file @
51ef1251
361 KB
public/activity/1015/v1/prize-img/prize-3.png
0 → 100644
View file @
51ef1251
374 KB
public/activity/1015/v1/prize-img/prize-nothing.png
0 → 100755
View file @
51ef1251
5.11 KB
public/icons/icon_mamaaihuodong.png
0 → 100644
View file @
51ef1251
7.06 KB
public/icons/icon_xianxiahuodong.png
0 → 100644
View file @
51ef1251
5.25 KB
scripts/gen-webview-urls.js
View file @
51ef1251
...
...
@@ -9,7 +9,7 @@ const pages = [
{
value
:
'/mini/#/page/home/index?page_source=3'
,
alias
:
'路演活动'
},
]
const
mpPage
=
'pages/activity/index'
const
mpPage
=
'
/
pages/activity/index'
function
joinUrlAndQs
(
url
,
qs
)
{
return
qs
...
...
@@ -19,7 +19,7 @@ function joinUrlAndQs(url, qs) {
for
(
const
page
of
pages
)
{
for
(
const
host
of
hosts
)
{
const
url
=
joinUrlAndQs
(
mpPage
,
`url=
${
encodeURIComponent
(
host
.
value
+
page
.
value
)}
`
)
const
url
=
joinUrlAndQs
(
mpPage
,
`
needLogin=1&
url=
${
encodeURIComponent
(
host
.
value
+
page
.
value
)}
`
)
console
.
log
(
`
${
page
.
alias
}
-
${
host
.
alias
}
:
${
url
}
`
)
}
}
utils/index.js
View file @
51ef1251
// 导入全局store
import
{
useGlobalStore
}
from
"../stores/global"
;
// 跳转类型枚举
export
const
JumpType
=
{
INNER
:
1
,
// 内部小程序页面跳转
...
...
@@ -15,11 +18,40 @@ export const JumpType = {
export
function
jump
({
type
,
url
,
extra
=
{}
})
{
switch
(
type
)
{
case
JumpType
.
INNER
:
// 内部小程序页面跳转
uni
.
navigateTo
({
url
,
...
extra
,
});
try
{
const
pages
=
getCurrentPages
();
const
currentPage
=
pages
[
pages
.
length
-
1
];
const
currentPath
=
currentPage
.
route
;
if
(
url
.
indexOf
(
'pages/index/index'
)
>=
0
&&
currentPath
.
indexOf
(
'pages/index/index'
)
>=
0
)
{
// 获取全局store
const
globalStore
=
useGlobalStore
();
if
(
url
.
indexOf
(
'home'
)
>=
0
)
{
globalStore
.
setCurTabIndex
(
0
);
}
else
if
(
url
.
indexOf
(
'brand'
)
>=
0
)
{
globalStore
.
setCurTabIndex
(
1
);
}
else
if
(
url
.
indexOf
(
'integral'
)
>=
0
)
{
globalStore
.
setCurTabIndex
(
2
);
}
else
if
(
url
.
indexOf
(
'my'
)
>=
0
)
{
globalStore
.
setCurTabIndex
(
3
);
}
}
else
{
// 内部小程序页面跳转
uni
.
navigateTo
({
url
,
...
extra
,
});
}
}
catch
(
error
)
{
console
.
error
(
'跳转处理错误:'
,
error
);
// 出错时默认执行内部跳转
uni
.
navigateTo
({
url
,
...
extra
,
});
}
break
;
case
JumpType
.
MINI
:
// 跳转到其他小程序页面
...
...
@@ -36,11 +68,11 @@ export function jump({ type, url, extra = {} }) {
console
.
log
(
"jumpParams:"
,
jumpParams
);
if
(
extra
.
embedded
||
jumpParams
.
appId
===
'wx4205ec55b793245e'
)
{
// 星妈优选的小程序都为半屏拉起
console
.
log
(
'半屏拉起'
,
jumpParams
)
if
(
extra
.
embedded
||
jumpParams
.
appId
===
'wx4205ec55b793245e'
)
{
// 星妈优选的小程序都为半屏拉起
console
.
log
(
'半屏拉起'
,
jumpParams
)
uni
.
openEmbeddedMiniProgram
(
jumpParams
);
}
else
{
console
.
log
(
'直接跳转'
,
jumpParams
)
}
else
{
console
.
log
(
'直接跳转'
,
jumpParams
)
uni
.
navigateToMiniProgram
(
jumpParams
);
}
break
;
...
...
@@ -60,11 +92,11 @@ export function jump({ type, url, extra = {} }) {
}
}
export
function
formatDate
(
timestamp
){
export
function
formatDate
(
timestamp
)
{
const
date
=
new
Date
(
timestamp
);
if
(
isNaN
(
date
.
getTime
()))
{
console
.
error
(
'无效的时间戳:'
,
timestamp
);
return
''
;
console
.
error
(
'无效的时间戳:'
,
timestamp
);
return
''
;
}
const
year
=
date
.
getFullYear
()
...
...
@@ -136,7 +168,7 @@ export function hideLoading() {
* @param format 字符串,需要的格式例如:'yyyy/MM/dd hh:mm:ss'
* @returns {String}
*/
const
dateFormatter
=
(
date
,
format
=
"yyyy/MM/dd"
)
=>
{
const
dateFormatter
=
(
date
,
format
=
"yyyy/MM/dd"
)
=>
{
if
(
!
date
)
return
"-"
;
date
=
new
Date
(
typeof
date
===
"string"
&&
isNaN
(
date
)
...
...
@@ -169,5 +201,5 @@ export function hideLoading() {
return
format
;
};
export
{
dateFormatter
dateFormatter
}
\ No newline at end of file
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