Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b6570274
authored
Nov 10, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'zhangxw_v3.1.0' into zhangxw_v3.1.1
2 parents
e532e865
25fa9dad
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
535 additions
and
110 deletions
components/sharePopup/sharePopup.js
components/sharePopup/sharePopup.wxml
pages/authentication/login/login.js
pages/authentication/register/register.js
pages/checkProduct/checkProduct.js
pages/tab/discovery/components/product/product.wxml
pages/tab/index/components/activeBox/activeBox.js
pages/tab/index/components/activityCalender/activityCalender.js
pages/tab/index/components/activityCalender/activityCalender.json
pages/tab/index/components/activityCalender/activityCalender.scss
pages/tab/index/components/activityCalender/activityCalender.wxml
pages/tab/index/components/nothingData/nothingData.js
pages/tab/index/components/nothingData/nothingData.json
pages/tab/index/components/nothingData/nothingData.scss
pages/tab/index/components/nothingData/nothingData.wxml
pages/tab/index/components/taskDetailBox/taskDetailBox.js
pages/tab/index/components/taskDetailBox/taskDetailBox.json
pages/tab/index/components/taskDetailBox/taskDetailBox.scss
pages/tab/index/components/taskDetailBox/taskDetailBox.wxml
pages/tab/index/index.js
pages/tab/index/index.json
pages/tab/index/index.wxml
utils/emoji.js
utils/request/request.js
components/sharePopup/sharePopup.js
View file @
b657027
...
@@ -17,11 +17,6 @@ Component({
...
@@ -17,11 +17,6 @@ Component({
navHeight
:
thisPage
.
data
.
navHeight
navHeight
:
thisPage
.
data
.
navHeight
})
})
if
(
val
.
showSharePopup
)
{
if
(
val
.
showSharePopup
)
{
wx
.
setPageStyle
({
style
:
{
overflow
:
'hidden'
}
})
wx
.
$api
.
showLoading
(
'处理中'
)
wx
.
$api
.
showLoading
(
'处理中'
)
val
.
boxImageHeight
=
66
val
.
boxImageHeight
=
66
// 计算弹窗图片区域最大高度
// 计算弹窗图片区域最大高度
...
@@ -171,6 +166,9 @@ Component({
...
@@ -171,6 +166,9 @@ Component({
}
}
)
)
},
},
emptyFunction
()
{
},
authFail
(
e
)
{
authFail
(
e
)
{
this
.
setData
({
this
.
setData
({
showAuth
:
true
showAuth
:
true
...
...
components/sharePopup/sharePopup.wxml
View file @
b657027
<!--components/sharePopup/sharePopup.wxml-->
<!--components/sharePopup/sharePopup.wxml-->
<view class="share-popup" wx:if="{{data.showSharePopup && poster}}">
<view class="share-popup" wx:if="{{data.showSharePopup && poster}}"
catchtouchmove="emptyFunction"
>
<view class="share-popup-bg"/>
<view class="share-popup-bg"/>
<view class="share-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));">
<view class="share-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));">
<view class="close-box">
<view class="close-box">
...
@@ -7,9 +7,9 @@
...
@@ -7,9 +7,9 @@
<image webp src="{{IMGURL}}popup_close_btn.png"></image>
<image webp src="{{IMGURL}}popup_close_btn.png"></image>
</view>
</view>
</view>
</view>
<
view
class="share-popup-content" style="max-height: {{postersBoxHeight}}px;">
<
scroll-view scroll-y
class="share-popup-content" style="max-height: {{postersBoxHeight}}px;">
<image mode="widthFix" src="{{poster}}"></image>
<image mode="widthFix" src="{{poster}}"></image>
</view>
</
scroll-
view>
<view class="btn-box">
<view class="btn-box">
<view class="btn" bind:tap="saveImage">保存至相册</view>
<view class="btn" bind:tap="saveImage">保存至相册</view>
<view class="tip">提示:这是您的专属活动海报,请保存至手机相册后转发给客户微信,系统将自动记录成交订单归属,并发放积分奖励!</view>
<view class="tip">提示:这是您的专属活动海报,请保存至手机相册后转发给客户微信,系统将自动记录成交订单归属,并发放积分奖励!</view>
...
...
pages/authentication/login/login.js
View file @
b657027
...
@@ -226,6 +226,9 @@ Page({
...
@@ -226,6 +226,9 @@ Page({
wxLogin
({
wxLogin
({
detail
detail
})
{
})
{
if
(
!
detail
?.
code
)
{
return
wx
.
$api
.
showToast
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
)
}
if
(
!
detail
.
code
||
this
.
data
.
showLoading
)
return
if
(
!
detail
.
code
||
this
.
data
.
showLoading
)
return
// this.setShowLoading(true)
// this.setShowLoading(true)
wx
.
showLoading
()
wx
.
showLoading
()
...
...
pages/authentication/register/register.js
View file @
b657027
...
@@ -58,7 +58,9 @@ Page({
...
@@ -58,7 +58,9 @@ Page({
toRegister
({
toRegister
({
detail
detail
})
{
})
{
if
(
!
detail
.
code
)
return
if
(
!
detail
?.
code
)
{
return
wx
.
$api
.
showToast
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
)
}
let
params
=
{
let
params
=
{
detail
,
detail
,
...
this
.
data
.
linkParams
...
this
.
data
.
linkParams
...
...
pages/checkProduct/checkProduct.js
View file @
b657027
...
@@ -233,6 +233,9 @@ Page({
...
@@ -233,6 +233,9 @@ Page({
});
});
},
},
authSuccess
(){
authSuccess
(){
this
.
setData
({
showAuth
:
false
})
this
.
createImg
()
this
.
createImg
()
},
},
toSetting
(){
toSetting
(){
...
...
pages/tab/discovery/components/product/product.wxml
View file @
b657027
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<view class="project-img">
<view class="project-img">
<block wx:for="{{tab}}" wx:key="index">
<block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}">
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}">
<image webp class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene/scene{{actNum+1}}{{index+1}}.png?v={{img_version}}" />
<image
lazy-load="{{true}}"
webp class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene/scene{{actNum+1}}{{index+1}}.png?v={{img_version}}" />
<view class="video-bg" wx:if="{{index==5 && senceData[actNum].videoList.length}}">
<view class="video-bg" wx:if="{{index==5 && senceData[actNum].videoList.length}}">
<view class="video-list">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
...
...
pages/tab/index/components/activeBox/activeBox.js
View file @
b657027
// pages/tab/index/components/activeBox/activeBox.js
// pages/tab/index/components/activeBox/activeBox.js
import
{
imgUrlMixin
}
from
'~/mixins/index'
import
{
imgUrlMixin
}
from
'~/mixins/index'
import
ActivityApi
from
"~/api/activityApi/index"
import
ActivityApi
from
"~/api/activityApi/index"
import
{
showEmoji
}
from
'~/utils/emoji'
import
{
import
{
domain
domain
}
from
'~/utils/request/http'
}
from
'~/utils/request/http'
...
@@ -60,6 +61,27 @@ Component({
...
@@ -60,6 +61,27 @@ Component({
val
.
isloading
=
true
val
.
isloading
=
true
ActivityApi
.
getActiveTaskList
({
activityId
:
val
.
id
}).
then
(
res
=>
{
ActivityApi
.
getActiveTaskList
({
activityId
:
val
.
id
}).
then
(
res
=>
{
val
.
isloading
=
false
val
.
isloading
=
false
res
.
forEach
(
a
=>
{
a
.
platformMerchantMissionResponseList
&&
a
.
platformMerchantMissionResponseList
.
forEach
(
k
=>
{
k
.
detailInfo
=
{
activityId
:
val
.
id
,
imgUrlList
:
[]}
k
.
platformMerchantMissionMaterialResponseList
&&
k
.
platformMerchantMissionMaterialResponseList
.
forEach
(
i
=>
{
// materialType 素材类型1文案 2图片 3视频 4专属链接
if
(
i
.
materialType
==
1
)
{
// 文案
k
.
detailInfo
.
textContent
=
i
.
materialContent
k
.
detailInfo
.
filterTextContent
=
i
.
materialContent
?
`<view style="word-break: break-all;">
${
showEmoji
(
i
.
materialContent
)}
</view>`
:
undefined
}
if
(
i
.
materialType
==
2
||
i
.
materialType
==
3
)
{
// 图片视频
k
.
detailInfo
.
imgUrlList
.
push
({
url
:
i
.
materialContent
,
type
:
i
.
materialType
==
2
?
'image'
:
'video'
})
}
if
(
i
.
materialType
==
4
)
{
// 链接
k
.
detailInfo
.
linkUrl
=
val
.
activityUrl
}
})
})
})
val
.
missionList
=
res
val
.
missionList
=
res
val
.
newtaskCalenderList
=
this
.
calenderFilter
(
JSON
.
parse
(
JSON
.
stringify
(
val
.
missionList
))
||
[],
7
)
val
.
newtaskCalenderList
=
this
.
calenderFilter
(
JSON
.
parse
(
JSON
.
stringify
(
val
.
missionList
))
||
[],
7
)
let
d
=
new
Date
()
let
d
=
new
Date
()
...
@@ -113,8 +135,8 @@ Component({
...
@@ -113,8 +135,8 @@ Component({
k
.
time
=
(
new
Date
(
k
.
activityTime
).
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"0"
)
+
"月"
+
new
Date
(
k
.
activityTime
).
getDate
().
toString
().
padStart
(
2
,
"0"
)
+
"日"
k
.
time
=
(
new
Date
(
k
.
activityTime
).
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"0"
)
+
"月"
+
new
Date
(
k
.
activityTime
).
getDate
().
toString
().
padStart
(
2
,
"0"
)
+
"日"
k
.
ind
=
ind
k
.
ind
=
ind
let
completeStatusNum
=
0
let
completeStatusNum
=
0
k
.
platformMerchantMissionResponseList
.
forEach
(
val
=>
{
k
.
platformMerchantMissionResponseList
.
forEach
(
i
=>
{
if
(
val
.
completeStatus
==
2
)
completeStatusNum
++
if
(
i
.
completeStatus
==
2
)
completeStatusNum
++
})
})
if
(
d
.
getTime
()
>
new
Date
(
`
${
k
.
activityTime
.
replace
(
/-/g
,
'/'
)}
23:59:59`
).
getTime
())
k
.
status
=
2
if
(
d
.
getTime
()
>
new
Date
(
`
${
k
.
activityTime
.
replace
(
/-/g
,
'/'
)}
23:59:59`
).
getTime
())
k
.
status
=
2
if
(
nowDate
==
k
.
time
)
{
if
(
nowDate
==
k
.
time
)
{
...
@@ -192,7 +214,8 @@ Component({
...
@@ -192,7 +214,8 @@ Component({
// 活动战报
// 活动战报
jump
(
e
)
{
jump
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
let
{
item
}
=
e
.
currentTarget
.
dataset
wx
.
$router
.
jumpH5
(
item
.
reportUrl
)
// wx.$router.jumpH5(item.reportUrl)
wx
.
$router
.
jumpH5
(
'http://glsx-posters.test.glsx.com.cn/#/activiting?activityId=769'
)
// wx.$router.go('packageActivity.warReport', item)
// wx.$router.go('packageActivity.warReport', item)
}
}
}
}
...
...
pages/tab/index/components/activityCalender/activityCalender.js
View file @
b657027
// pages/tab/index/components/activityCalender/activityCalender.js
// pages/tab/index/components/activityCalender/activityCalender.js
import
{
imgUrlMixin
}
from
'~/mixins/index'
import
{
imgUrlMixin
}
from
'~/mixins/index'
import
{
domain
}
from
'~/utils/request/http'
Component
({
Component
({
/**
/**
* 组件的属性列表
* 组件的属性列表
...
@@ -42,11 +39,27 @@ Component({
...
@@ -42,11 +39,27 @@ Component({
if
(
data
)
data
.
calenderActiveIndex
=
e
.
detail
.
current
if
(
data
)
data
.
calenderActiveIndex
=
e
.
detail
.
current
this
.
setData
({
data
})
this
.
setData
({
data
})
},
},
// 任务详情
jump
(
e
)
{
myevent
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
if
(
item
.
completeStatus
==
2
)
return
// 已完成
finishFlag
:
e
.
detail
.
flag
,
wx
.
$router
.
go
(
'packageActivity.taskDetail'
,
{...
item
})
finishKey
:
e
.
detail
.
index
})
},
finish
(
e
)
{
let
{
item
,
index
}
=
e
.
currentTarget
.
dataset
let
{
finishFlag
}
=
this
.
data
// wx.$router.go('packageActivity.taskDetail', {...item})
if
(
finishFlag
)
{
return
wx
.
showToast
({
title
:
'正在下载中'
,
icon
:
'none'
})
}
if
(
!
item
.
platformMerchantMissionMaterialResponseList
)
return
// 数据为空处理 未下载完
let
taskDetailBox
=
this
.
selectComponent
(
"#taskDetailBox"
)
taskDetailBox
.
finishTask
(
item
,
index
)
},
},
// 切换日期查看任务
// 切换日期查看任务
changeDate
(
e
)
{
changeDate
(
e
)
{
...
...
pages/tab/index/components/activityCalender/activityCalender.json
View file @
b657027
{
{
"component"
:
true
,
"component"
:
true
,
"usingComponents"
:
{}
"usingComponents"
:
{
"task-detail-box"
:
"../taskDetailBox/taskDetailBox"
}
}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/index/components/activityCalender/activityCalender.scss
View file @
b657027
...
@@ -78,85 +78,95 @@
...
@@ -78,85 +78,95 @@
padding-bottom
:
54rpx
;
padding-bottom
:
54rpx
;
}
}
.task-show-box
{
.task-show-box
{
.task-item
{
.item-box
{
padding
:
24rpx
0
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
7rpx
;
border-bottom
:
1px
solid
#F0F1F5
;
border-bottom
:
1px
solid
#F0F1F5
;
.left
{
.task-item
{
padding
:
24rpx
0
;
display
:
flex
;
display
:
flex
;
image
{
align-items
:
center
;
width
:
80rpx
;
justify-content
:
space-between
;
height
:
80rpx
;
margin-bottom
:
7rpx
;
margin-right
:
20rpx
;
.left
{
flex-shrink
:
0
;
}
.task-message
{
display
:
flex
;
display
:
flex
;
flex-flow
:
column
;
image
{
justify-content
:
space-around
;
width
:
80rpx
;
.task-title
{
height
:
80rpx
;
font-family
:
PingFangSC-Medium
;
margin-right
:
20rpx
;
flex-shrink
:
0
;
}
.task-message
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
flex-flow
:
column
;
flex-wrap
:
nowrap
;
justify-content
:
space-around
;
font-size
:
28rpx
;
.task-title
{
font-weight
:
500
;
color
:
#1B233D
;
word-break
:
break-all
;
image
{
width
:
28rpx
;
height
:
28rpx
;
margin
:
0
;
flex-shrink
:
0
;
}
.integral-num
{
font-family
:
PingFangSC-Medium
;
font-family
:
PingFangSC-Medium
;
flex-shrink
:
0
;
display
:
flex
;
font-size
:
24rpx
;
align-items
:
center
;
flex-wrap
:
nowrap
;
font-size
:
28rpx
;
font-weight
:
500
;
font-weight
:
500
;
color
:
#FE5662
;
color
:
#1B233D
;
word-break
:
break-all
;
image
{
width
:
28rpx
;
height
:
28rpx
;
margin
:
0
;
flex-shrink
:
0
;
}
.integral-num
{
font-family
:
PingFangSC-Medium
;
flex-shrink
:
0
;
font-size
:
24rpx
;
font-weight
:
500
;
color
:
#FE5662
;
}
}
.task-content
{
font-size
:
22rpx
;
word-break
:
break-all
;
color
:
#9299AD
;
}
}
}
}
.task-content
{
}
font-size
:
22rpx
;
.task-btn
{
word-break
:
break-all
;
margin-left
:
32rpx
;
text-align
:
center
;
.btn
{
// line-height: 48rpx;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
116rpx
;
height
:
48rpx
;
background
:
#FEF1F4
;
border
:
2rpx
solid
rgba
(
254
,
86
,
98
,
0
.40
);
border-radius
:
12rpx
;
font-size
:
24rpx
;
color
:
#FE5662
;
}
.primary
{
border
:
none
;
width
:
120rpx
;
height
:
56rpx
;
line-height
:
56rpx
;
background-image
:
linear-gradient
(
270deg
,
#FF3E7F
0%
,
#FE624B
100%
);
border-radius
:
6px
;
color
:
#FFFFFF
;
}
.grey-btn
{
color
:
#9299AD
;
color
:
#9299AD
;
border
:
2rpx
solid
#CACDD5
;
background
:
#F5F6F7
;
}
.btn_title
{
margin-top
:
8rpx
;
font-size
:
11px
;
color
:
#FE5662
;
}
}
}
}
.task-btn
{
margin-left
:
32rpx
;
text-align
:
center
;
.btn
{
line-height
:
48rpx
;
width
:
116rpx
;
height
:
48rpx
;
background
:
#FEF1F4
;
border
:
2rpx
solid
rgba
(
254
,
86
,
98
,
0
.40
);
border-radius
:
12rpx
;
font-size
:
24rpx
;
color
:
#FE5662
;
}
.primary
{
border
:
none
;
width
:
120rpx
;
height
:
56rpx
;
line-height
:
56rpx
;
background-image
:
linear-gradient
(
270deg
,
#FF3E7F
0%
,
#FE624B
100%
);
border-radius
:
6px
;
color
:
#FFFFFF
;
}
.btn_title
{
margin-top
:
8rpx
;
font-size
:
11px
;
color
:
#FE5662
;
}
}
}
}
}
}
.
task-item
:last-child
{
.
item-box
:last-child
{
border
:
none
;
border
:
none
;
margin
:
0
;
margin
:
0
;
}
}
...
...
pages/tab/index/components/activityCalender/activityCalender.wxml
View file @
b657027
...
@@ -26,24 +26,42 @@
...
@@ -26,24 +26,42 @@
</view>
</view>
<view class="task-show-box">
<view class="task-show-box">
<block wx:for="{{data.missionList[activeDateIndex].platformMerchantMissionResponseList}}" wx:for-item="val" wx:for-index="ky" wx:key="ky">
<block wx:for="{{data.missionList[activeDateIndex].platformMerchantMissionResponseList}}" wx:for-item="val" wx:for-index="ky" wx:key="ky">
<view class="task-item">
<view class="item-box">
<view class="left">
<view class="task-item">
<image webp src="{{IMGURL}}task_icon_{{val.missonType}}.png"></image>
<view class="left">
<view class="task-message">
<image webp src="{{IMGURL}}task_icon_{{val.missonType}}.png"></image>
<view class="task-title">
<view class="task-message">
<view class="text">{{val.missionName}}</view>
<view class="task-title">
<image webp src="{{IMGURL}}integral_icon.png"></image>
<view class="text">{{val.missionName}}</view>
<view class="integral-num">+{{val.gainScore}}积分</view>
<image webp src="{{IMGURL}}integral_icon.png"></image>
<view class="integral-num">+{{val.gainScore}}积分</view>
</view>
<view class="task-content">{{val.missonDesc}}</view>
</view>
</view>
<view class="task-btn">
<!-- <view class="btn {{val.completeStatus == 1 ? (val.missonType == 2 ? 'primary' : 'grey-btn') : ''}}" wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 1) || val.completeStatus == 2 || fn.timeFilter(data.startTime, 2)}}"bind:tap="jump" data-item="{{val}}">{{(val.completeStatus == 1 ? (val.missonType != 2 ? '未达标' : '去完成') : '已完成')}}</view> -->
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 1)}}">
<view class="btn primary" wx:if="{{val.completeStatus == 1 && val.missonType == 2}}" bind:tap="finish" data-item="{{val}}" data-index="{{ky}}">
<van-loading wx:if="{{ky == finishKey && finishFlag}}" size="30rpx" type="spinner" />
<text wx:else>去完成</text>
</view>
<view class="btn grey-btn" wx:if="{{val.completeStatus == 1 && val.missonType != 2}}">
<text>未达标</text>
</view>
<view class="btn" wx:if="{{val.completeStatus == 2}}">
<text>已完成</text>
</view>
<view class="btn_title" wx:if="{{val.completeStatus == 2}}">奖励已发放</view>
</block>
</view>
</view>
<view class="task-content">{{val.missonDesc}}</view>
</view>
<!-- 分享类任务 显示物料 -->
<view class="task-detail" wx:if="{{val.missonType == 2}}">
<task-detail-box id="taskDetailBox" bind:myevent="myevent" data="{{val.detailInfo}}"></task-detail-box>
</view>
</view>
</view>
</view>
<view class="task-btn">
</block>
<view class="btn {{val.completeStatus == 1 ? 'primary' : ''}}" wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 1) || val.completeStatus == 2 || fn.timeFilter(data.startTime, 2)}}" bind:tap="jump" data-item="{{val}}">{{val.completeStatus == 1 ? '去完成' : '已完成'}}</view>
<view class="btn_title" wx:if="{{val.completeStatus == 2}}">奖励已发放</view>
</view>
</view>
</block>
</view>
</view>
</block>
</block>
pages/tab/index/components/nothingData/nothingData.js
0 → 100644
View file @
b657027
// pages/tab/index/components/nothingData/nothingData.js
import
{
imgUrlMixin
}
from
'~/mixins/index'
Component
({
/**
* 组件的属性列表
*/
behaviors
:
[
imgUrlMixin
],
properties
:
{
},
/**
* 组件的初始数据
*/
data
:
{
},
/**
* 组件的方法列表
*/
methods
:
{
}
})
pages/tab/index/components/nothingData/nothingData.json
0 → 100644
View file @
b657027
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/index/components/nothingData/nothingData.scss
0 → 100644
View file @
b657027
/* pages/tab/index/components/nothingData/nothingData.wxss */
.nothing-box
{
width
:
calc
(
100%
-
48rpx
);
height
:
calc
(
100%
-
16rpx
);
margin
:
16rpx
24rpx
;
background
:
#FFFFFF
;
border-radius
:
32rpx
;
display
:
flex
;
align-items
:
center
;
flex-flow
:
column
;
image
{
margin-top
:
192rpx
;
width
:
400rpx
;
height
:
400rpx
;
}
.tips
{
text-align
:
center
;
font-size
:
28rpx
;
color
:
#7A8299
;
}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/index/components/nothingData/nothingData.wxml
0 → 100644
View file @
b657027
<!--pages/tab/index/components/nothingData/nothingData.wxml-->
<view class="nothing-box">
<image webp src="{{IMGURL}}activity_list_nothing.webp"></image>
<view class="tips">暂无活动~</view>
</view>
pages/tab/index/components/taskDetailBox/taskDetailBox.js
0 → 100644
View file @
b657027
// pages/tab/index/components/taskDetailBox/taskDetailBox.js
import
{
imgUrlMixin
}
from
'~/mixins/index'
import
{
taskShareReport
}
from
'~/api/api.js'
import
{
domain
}
from
'~/utils/request/http'
Component
({
/**
* 组件的属性列表
*/
behaviors
:
[
imgUrlMixin
],
properties
:
{
data
:
{
type
:
Object
}
},
/**
* 组件的初始数据
*/
data
:
{
},
/**
* 组件的方法列表
*/
methods
:
{
// 预览图片/视频
previewMedia
(
e
)
{
let
{
imglist
,
current
}
=
e
.
currentTarget
.
dataset
wx
.
previewMedia
({
sources
:
imglist
,
current
:
current
})
},
// 跳转链接
goShareLink
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
// 跳转拼接的链接
let
linkUrl
=
this
.
filterJumpUrl
(
item
.
activityId
)
wx
.
$router
.
jumpH5
(
linkUrl
)
},
// 拼接活动专属链接
filterJumpUrl
(
id
)
{
const
userStorage
=
wx
.
$storage
.
get
(
'userInfo'
)
return
`
${
domain
}
/scrm-wx-merchant-activity/#/?id=
${
id
}
&merchantId=
${
userStorage
.
merchantId
}
&shareStaffUuid=
${
userStorage
.
uuid
}
&shareStaffName=
${
this
.
toUnicode
(
userStorage
.
name
)}
&isExclusive=1&exclusiveUuid=
${
userStorage
.
uuid
}
&shareStaffType=2&sharedTime=
${
Date
.
now
()}
`
},
toUnicode
(
chineseStr
=
''
)
{
let
unicodeStr
=
''
for
(
let
i
=
0
,
iLength
=
chineseStr
.
length
;
i
<
iLength
;
i
++
)
{
unicodeStr
+=
'@'
+
chineseStr
.
charCodeAt
(
i
).
toString
(
16
)
}
return
unicodeStr
},
finishTask
(
item
,
ky
)
{
this
.
triggerEvent
(
'myevent'
,
{
flag
:
true
,
index
:
ky
})
Promise
.
all
([
this
.
copyText
(
item
,
ky
),
this
.
saveWith
(
item
,
ky
)]).
then
(()
=>
{
const
USERINFO
=
wx
.
$storage
.
get
(
'userInfo'
)
let
data
=
{
action_type
:
4
,
// 事件类型固定为4-分享
item_type
:
3
,
// 商品类型,固定为3-众筹活动
merchant_id
:
USERINFO
.
merchantId
,
// 门店号
staff_uuid
:
USERINFO
.
uuid
,
business_type
:
1
,
// 业务类型,固定为1
add_way
:
104
,
// 来源,固定为104
create_time
:
new
Date
().
format
(
"yyyy-MM-dd hh:mm:ss"
),
// 分享时间
item_id
:
item
.
detailInfo
&&
item
.
detailInfo
.
activityId
,
share_staff_type
:
3
}
let
jsonList
=
[
JSON
.
stringify
(
data
)]
taskShareReport
({
jsonList
}).
then
((
res
)
=>
{
if
(
res
)
{
wx
.
showToast
({
title
:
'图片及视频已保存到手机相册,文案已黏贴到剪切板。'
,
icon
:
'none'
})
this
.
triggerEvent
(
'myevent'
,
{
flag
:
false
,
index
:
ky
})
}
})
}).
catch
(
err
=>
{
wx
.
showToast
({
title
:
err
,
icon
:
'none'
})
})
},
// 复制文案及专属链接
copyText
(
item
,
ky
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
{
textContent
,
linkUrl
}
=
item
.
detailInfo
let
copyData
=
''
if
(
textContent
&&
linkUrl
)
{
copyData
=
`
${
textContent
}
\n活动链接:
${
linkUrl
}
`
}
else
if
(
!
textContent
&&
linkUrl
)
{
copyData
=
`活动链接:
${
linkUrl
}
`
}
else
if
(
textContent
&&
!
linkUrl
)
{
copyData
=
textContent
}
let
_this
=
this
if
(
!
copyData
.
length
)
{
// 复制内容为空 不做处理
return
resolve
()
}
wx
.
setClipboardData
({
data
:
copyData
,
success
()
{
wx
.
hideLoading
()
resolve
()
},
fail
()
{
this
.
triggerEvent
(
'myevent'
,
{
flag
:
false
,
index
:
ky
})
reject
(
'文案复制失败'
)
}
})
})
},
// 一键保存
saveWith
(
item
,
ky
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
var
_this
=
this
let
thisPage
=
wx
.
$router
.
getPageInstance
()
if
(
!
item
.
detailInfo
.
imgUrlList
.
length
)
return
resolve
()
// 获取保存到相册权限
wx
.
getSetting
({
success
(
res
)
{
if
(
res
.
authSetting
[
'scope.writePhotosAlbum'
]
===
false
){
thisPage
.
setData
({
showAuth
:
true
})
_this
.
triggerEvent
(
'myevent'
,
{
flag
:
false
,
index
:
ky
})
}
else
{
_this
.
queue
(
item
.
detailInfo
.
imgUrlList
,
ky
).
then
(()
=>
{
resolve
()
})
.
catch
(()
=>
{
_this
.
triggerEvent
(
'myevent'
,
{
flag
:
false
,
index
:
ky
})
reject
(
'图片下载失败'
)
})
}
}
})
})
},
// 队列
queue
(
urls
,
ky
)
{
let
promise
=
Promise
.
resolve
()
urls
.
forEach
(
item
=>
{
promise
=
promise
.
then
(()
=>
{
return
this
.
download
(
item
.
url
,
item
.
type
,
ky
)
})
})
return
promise
},
// 下载
download
(
url
,
type
,
ky
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
_this
=
this
wx
.
downloadFile
({
url
:
url
,
success
:
function
(
res
)
{
var
temp
=
res
.
tempFilePath
let
fn
=
type
==
'image'
?
wx
.
saveImageToPhotosAlbum
:
wx
.
saveVideoToPhotosAlbum
fn
({
filePath
:
temp
,
success
:
function
(
res
)
{
resolve
(
res
)
},
fail
:
function
(
err
)
{
_this
.
triggerEvent
(
'myevent'
,
{
flag
:
false
,
index
:
ky
})
reject
(
res
)
}
})
},
fail
:
function
(
err
)
{
_this
.
triggerEvent
(
'myevent'
,
{
flag
:
false
,
index
:
ky
})
reject
(
err
)
}
})
})
}
}
})
pages/tab/index/components/taskDetailBox/taskDetailBox.json
0 → 100644
View file @
b657027
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/index/components/taskDetailBox/taskDetailBox.scss
0 → 100644
View file @
b657027
/* pages/tab/index/components/taskDetailBox/taskDetailBox.wxss */
.break-line
{
display
:
flex
;
width
:
100%
;
justify-content
:
center
;
align-items
:
center
;
color
:
#9299AD
;
font-size
:
22rpx
;
.title
{
margin
:
0
20rpx
;
}
.line
{
width
:
100rpx
;
height
:
2rpx
;
background
:
#F0F1F5
;
}
}
.content
{
padding
:
16rpx
24rpx
;
.link-box
{
word-break
:
break-all
;
margin-top
:
10rpx
;
text
{
color
:
#4466F0
;
}
}
.img_video
{
margin-top
:
32rpx
;
display
:
flex
;
flex-wrap
:
wrap
;
.image-box
{
flex
:
0
0
33
.3%
;
width
:
152rpx
;
height
:
152rpx
;
margin-bottom
:
16rpx
;
text-align
:
center
;
image
{
display
:
inline-block
;
}
}
.video-box
{
flex
:
0
0
33
.3%
;
position
:
relative
;
text-align
:
center
;
video
{
width
:
152rpx
;
height
:
152rpx
;
display
:
inline-block
;
}
.paly-icon
{
width
:
60rpx
;
height
:
60rpx
;
position
:
absolute
;
z-index
:
2
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
}
}
}
}
pages/tab/index/components/taskDetailBox/taskDetailBox.wxml
0 → 100644
View file @
b657027
<!--pages/tab/index/components/taskDetailBox/taskDetailBox.wxml-->
<view class="break-line">
<view class="line"></view>
<view class="title">指定分享内容</view>
<view class="line"></view>
</view>
<view class="content">
<view class="text-box">
<mp-html content="{{data.filterTextContent || ''}}"></mp-html>
</view>
<view class="link-box" wx:if="{{data.linkUrl}}">活动链接:<text bind:tap="goShareLink" data-item="{{data}}">{{data.linkUrl}}</text></view>
<view class="img_video">
<block wx:for="{{data.imgUrlList}}" wx:key="index">
<view wx:if="{{item.type == 'image'}}" class="image-box">
<image class="image-box" bind:tap="previewMedia" data-current="{{index}}" data-imglist="{{data.imgUrlList}}" src="{{item.url}}"></image>
</view>
<view wx:else class="video-box" bind:tap="previewMedia" data-current="{{index}}" data-imglist="{{data.imgUrlList}}">
<image class="paly-icon" webp src="{{IMGURL}}video_paly_icon.png"></image>
<video controls="{{false}}" show-center-play-btn="{{false}}" show-fullscreen-btn="{{false}}" src="{{item.url}}"></video>
</view>
</block>
</view>
</view>
pages/tab/index/index.js
View file @
b657027
...
@@ -4,6 +4,7 @@ const navStyle = 'background-color: transparent;'
...
@@ -4,6 +4,7 @@ const navStyle = 'background-color: transparent;'
import
{
import
{
setUserInfo
setUserInfo
}
from
'~/utils/cache/storageApi'
}
from
'~/utils/cache/storageApi'
import
{
showEmoji
}
from
'~/utils/emoji'
Page
({
Page
({
// behaviors: [kfMixin],
// behaviors: [kfMixin],
/**
/**
...
@@ -92,6 +93,27 @@ Page({
...
@@ -92,6 +93,27 @@ Page({
if
(
num
==
1
&&
activePageNum
==
1
&&
index
==
0
)
{
// 活动中默认展开第一条 数据处理
if
(
num
==
1
&&
activePageNum
==
1
&&
index
==
0
)
{
// 活动中默认展开第一条 数据处理
val
.
isloading
=
true
val
.
isloading
=
true
ActivityApi
.
getActiveTaskList
({
activityId
:
val
.
id
},
{
isShowLoading
:
true
}).
then
(
res
=>
{
ActivityApi
.
getActiveTaskList
({
activityId
:
val
.
id
},
{
isShowLoading
:
true
}).
then
(
res
=>
{
res
.
forEach
(
a
=>
{
a
.
platformMerchantMissionResponseList
&&
a
.
platformMerchantMissionResponseList
.
forEach
(
k
=>
{
k
.
detailInfo
=
{
activityId
:
val
.
id
,
imgUrlList
:
[]}
k
.
platformMerchantMissionMaterialResponseList
&&
k
.
platformMerchantMissionMaterialResponseList
.
forEach
(
i
=>
{
// materialType 素材类型1文案 2图片 3视频 4专属链接
if
(
i
.
materialType
==
1
)
{
// 文案
k
.
detailInfo
.
textContent
=
i
.
materialContent
k
.
detailInfo
.
filterTextContent
=
i
.
materialContent
?
`<view style="word-break: break-all;">
${
showEmoji
(
i
.
materialContent
)}
</view>`
:
undefined
}
if
(
i
.
materialType
==
2
||
i
.
materialType
==
3
)
{
// 图片视频
k
.
detailInfo
.
imgUrlList
.
push
({
url
:
i
.
materialContent
,
type
:
i
.
materialType
==
2
?
'image'
:
'video'
})
}
if
(
i
.
materialType
==
4
)
{
// 链接
k
.
detailInfo
.
linkUrl
=
val
.
activityUrl
}
})
})
})
val
.
isloading
=
false
val
.
isloading
=
false
val
.
missionList
=
res
val
.
missionList
=
res
val
.
newtaskCalenderList
=
this
.
calenderFilter
(
JSON
.
parse
(
JSON
.
stringify
(
val
.
missionList
))
||
[],
7
)
val
.
newtaskCalenderList
=
this
.
calenderFilter
(
JSON
.
parse
(
JSON
.
stringify
(
val
.
missionList
))
||
[],
7
)
...
@@ -104,8 +126,8 @@ Page({
...
@@ -104,8 +126,8 @@ Page({
k
.
time
=
(
new
Date
(
k
.
activityTime
).
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"0"
)
+
"月"
+
new
Date
(
k
.
activityTime
).
getDate
().
toString
().
padStart
(
2
,
"0"
)
+
"日"
k
.
time
=
(
new
Date
(
k
.
activityTime
).
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"0"
)
+
"月"
+
new
Date
(
k
.
activityTime
).
getDate
().
toString
().
padStart
(
2
,
"0"
)
+
"日"
k
.
ind
=
ind
k
.
ind
=
ind
let
completeStatusNum
=
0
let
completeStatusNum
=
0
k
.
platformMerchantMissionResponseList
.
forEach
(
val
=>
{
k
.
platformMerchantMissionResponseList
.
forEach
(
i
=>
{
if
(
val
.
completeStatus
==
2
)
completeStatusNum
++
if
(
i
.
completeStatus
==
2
)
completeStatusNum
++
})
})
if
(
nowDate
==
k
.
time
)
{
if
(
nowDate
==
k
.
time
)
{
val
.
calenderActiveIndex
=
index
val
.
calenderActiveIndex
=
index
...
...
pages/tab/index/index.json
View file @
b657027
{
{
"usingComponents"
:
{
"usingComponents"
:
{
"active-box"
:
"./components/activeBox/activeBox"
,
"active-box"
:
"./components/activeBox/activeBox"
,
"activity-diagnosis"
:
"./components/activityDiagnosis/activityDiagnosis"
"activity-diagnosis"
:
"./components/activityDiagnosis/activityDiagnosis"
,
"nothing-data"
:
"./components/nothingData/nothingData"
},
},
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"onReachBottomDistance"
:
100
"onReachBottomDistance"
:
100
...
...
pages/tab/index/index.wxml
View file @
b657027
...
@@ -22,15 +22,21 @@
...
@@ -22,15 +22,21 @@
</view>
</view>
<!-- 活动中 -->
<!-- 活动中 -->
<scroll-view scroll-y class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" data-type="{{1}}" refresher-triggered="{{activeTrigger}}" hidden="{{tabIndex != 0}}">
<scroll-view scroll-y class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" data-type="{{1}}" refresher-triggered="{{activeTrigger}}" hidden="{{tabIndex != 0}}">
<block>
<block
wx:if="{{activeList.length}}"
>
<active-box bind:showAuth="toShowAuth" activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}"></active-box>
<active-box bind:showAuth="toShowAuth" activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}"></active-box>
</block>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view>
</scroll-view>
<!-- 活动诊断 -->
<!-- 活动诊断 -->
<scroll-view scroll-y class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" data-type="{{2}}" refresher-triggered="{{activeTrigger}}" bindscroll="scrollIng" hidden="{{tabIndex != 1}}">
<scroll-view scroll-y class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" data-type="{{2}}" refresher-triggered="{{activeTrigger}}" bindscroll="scrollIng" hidden="{{tabIndex != 1}}">
<block>
<block
wx:if="{{activityEndList.length}}"
>
<activity-diagnosis activityList="{{activityEndList}}" nothing="{{nothing}}"></activity-diagnosis>
<activity-diagnosis activityList="{{activityEndList}}" nothing="{{nothing}}"></activity-diagnosis>
</block>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view>
</scroll-view>
<!-- 申请活动 -->
<!-- 申请活动 -->
<view class="add-activity" style="transform: translateX({{tabIndex == 0 ? activeTranslateValue : activityEndTranslateValue}}rpx);transition: all {{tabIndex == 0 ? (activeTranslateValue >= 130 ? 0.3 : 0) : (activityEndTranslateValue >= 130 ? 0.3 : 0)}}s;" bind:tap="applyActivity">
<view class="add-activity" style="transform: translateX({{tabIndex == 0 ? activeTranslateValue : activityEndTranslateValue}}rpx);transition: all {{tabIndex == 0 ? (activeTranslateValue >= 130 ? 0.3 : 0) : (activityEndTranslateValue >= 130 ? 0.3 : 0)}}s;" bind:tap="applyActivity">
...
...
utils/emoji.js
View file @
b657027
...
@@ -42,7 +42,7 @@ export function showEmoji(value) {
...
@@ -42,7 +42,7 @@ export function showEmoji(value) {
let
b
=
a
.
split
(
'\n'
)
let
b
=
a
.
split
(
'\n'
)
let
filterContent
=
''
let
filterContent
=
''
b
&&
b
.
forEach
((
val
,
index
)
=>
{
b
&&
b
.
forEach
((
val
,
index
)
=>
{
let
filterValue
=
val
.
replace
(
/
\[[\u
4E00-
\u
9FA5
]{1,3
}\]
/gi
,
(
res
)
=>
{
let
filterValue
=
val
.
replace
(
/
\[[\u
4E00-
\u
9FA5
_A-Z0-9_
]{1,4
}\]
/gi
,
(
res
)
=>
{
const
list
=
emoji
.
flat
(
Infinity
)
const
list
=
emoji
.
flat
(
Infinity
)
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
);
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
);
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
...
...
utils/request/request.js
View file @
b657027
...
@@ -87,7 +87,7 @@ class Request {
...
@@ -87,7 +87,7 @@ class Request {
},
},
complete
()
{
complete
()
{
requestTimes
--
;
requestTimes
--
;
if
(
requestTimes
==
0
)
{
if
(
requestTimes
==
0
&&
isShowLoading
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
}
}
wx
.
stopPullDownRefresh
()
wx
.
stopPullDownRefresh
()
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment