Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
junlebao-milk-20240619
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
SparkProjects
junlebao-milk-20240619
Commits
6fd90f2f
Commit
6fd90f2f
authored
Jun 25, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
30d16745
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
16 deletions
+31
-16
activity.ts
miniprogram/pages/activity/activity.ts
+5
-8
activity.wxml
miniprogram/pages/activity/activity.wxml
+3
-3
index.ts
miniprogram/pages/index/index.ts
+1
-1
store.ts
miniprogram/store/store.ts
+22
-4
No files found.
miniprogram/pages/activity/activity.ts
View file @
6fd90f2f
...
@@ -6,8 +6,8 @@ ComponentWithStore({
...
@@ -6,8 +6,8 @@ ComponentWithStore({
storeBindings
:
{
storeBindings
:
{
store
,
store
,
fields
:
{
fields
:
{
homeInfo
:
()
=>
store
.
homeInfo
,
showPhoneBtn
:
()
=>
!
store
.
homeInfo
.
mobile
,
showPhoneBtn
:
()
=>
!
store
.
homeInfo
.
mobile
,
activityInfo
:
()
=>
store
.
activityInfo
,
},
},
actions
:
{},
actions
:
{},
},
},
...
@@ -33,15 +33,12 @@ ComponentWithStore({
...
@@ -33,15 +33,12 @@ ComponentWithStore({
prompt
:
"200毫升"
,
prompt
:
"200毫升"
,
logo
:
"//yun.duiba.com.cn/polaris/%E9%B2%9C%E7%89%9B%E5%A5%B6logo.7ee8ec3fc21f699756f54512835ffd8d50a18bed.png"
,
logo
:
"//yun.duiba.com.cn/polaris/%E9%B2%9C%E7%89%9B%E5%A5%B6logo.7ee8ec3fc21f699756f54512835ffd8d50a18bed.png"
,
},
},
].
concat
(
new
Array
(
2
+
~~
(
Math
.
random
()
*
10
)).
fill
({
]
img
:
"//yun.duiba.com.cn/polaris/%E9%B2%9C%E7%89%9B%E5%A5%B6.fd352be87520d04261ba36348022c36836e4c819.png"
,
introduce
:
"更多的鲜活营养,更好喝的鲜甜口感,更优质的牧场奶源,更安全的品质保障更多的鲜活营养,更好喝的鲜甜口感,更优质的牧场奶源,更安全的品质保障"
,
prompt
:
"200毫升"
,
logo
:
"//yun.duiba.com.cn/polaris/%E9%B2%9C%E7%89%9B%E5%A5%B6logo.7ee8ec3fc21f699756f54512835ffd8d50a18bed.png"
,
}))
},
},
created
()
{
store
.
updateActivity
();
},
methods
:
{
methods
:
{
onShareAppMessage
()
{
onShareAppMessage
()
{
return
{
return
{
...
...
miniprogram/pages/activity/activity.wxml
View file @
6fd90f2f
<!--pages/activity/activity.wxml-->
<!--pages/activity/activity.wxml-->
<view class="act_root">
<view class="act_root">
<swiper class="act_swiper" autoplay>
<swiper class="act_swiper" autoplay>
<swiper-item class="act_swiper_item" wx:for="{{
banner
}}">
<swiper-item class="act_swiper_item" wx:for="{{
activityInfo.topBanners
}}">
<image class="swiper_item_img" src="{{item}}" lazy-load/>
<image class="swiper_item_img" src="{{item}}" lazy-load/>
</swiper-item>
</swiper-item>
</swiper>
</swiper>
<view class="act_prod_list">
<view class="act_prod_list">
<view class="act_prod_item" wx:for="{{
prod
List}}">
<view class="act_prod_item" wx:for="{{
activityInfo.product
List}}">
<view class="prod_item_prompt">{{item.prompt}}</view>
<view class="prod_item_prompt">{{item.prompt}}</view>
<view class="prod_item_introduce">{{item.
introduce
}}</view>
<view class="prod_item_introduce">{{item.
content
}}</view>
<image class="prod_item_img" src="{{item.img}}" mode="aspectFit" lazy-load/>
<image class="prod_item_img" src="{{item.img}}" mode="aspectFit" lazy-load/>
<image class="prod_item_logo" src="{{item.logo}}" mode="aspectFit" lazy-load/>
<image class="prod_item_logo" src="{{item.logo}}" mode="aspectFit" lazy-load/>
<view
<view
...
...
miniprogram/pages/index/index.ts
View file @
6fd90f2f
...
@@ -31,7 +31,7 @@ ComponentWithStore({
...
@@ -31,7 +31,7 @@ ComponentWithStore({
canIUseGetUserProfile
:
wx
.
canIUse
(
'getUserProfile'
),
canIUseGetUserProfile
:
wx
.
canIUse
(
'getUserProfile'
),
canIUseNicknameComp
:
wx
.
canIUse
(
'input.type.nickname'
),
canIUseNicknameComp
:
wx
.
canIUse
(
'input.type.nickname'
),
},
},
async
ready
()
{
async
created
()
{
this
.
updateHomeInfo
();
this
.
updateHomeInfo
();
},
},
methods
:
{
methods
:
{
...
...
miniprogram/store/store.ts
View file @
6fd90f2f
...
@@ -11,10 +11,8 @@ class Store {
...
@@ -11,10 +11,8 @@ class Store {
mobile
:
""
,
mobile
:
""
,
subscribe
:
""
,
subscribe
:
""
,
first
:
true
,
first
:
true
,
topBanners
:
[
topBanners
:
[],
],
activities
:
[]
activities
:
[
]
}
}
async
updateHomeInfo
()
{
async
updateHomeInfo
()
{
...
@@ -31,6 +29,26 @@ class Store {
...
@@ -31,6 +29,26 @@ class Store {
this
.
homeInfo
=
data
;
this
.
homeInfo
=
data
;
}
}
activityInfo
=
{
topBanners
:
[],
productList
:
[],
}
async
updateActivity
()
{
// wx.showLoading({
// title: '加载中',
// mask: true,
// });
const
{
success
,
data
}
=
await
request
({
url
:
API_PATH
.
activity
,
});
if
(
!
success
)
return
;
this
.
activityInfo
=
data
;
}
}
}
// 数据仓库
// 数据仓库
...
...
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