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 c6a03f6a
authored
Nov 14, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v3.1.0' into 'develop'
V3.1.0 See merge request
!151
2 parents
dd99e86d
c0285011
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
603 additions
and
149 deletions
api/activityApi/ActivityApi.js
api/mineApi/mineApi.js
components/mp-html/index.wxml
components/mp-html/node/node.wxml
components/sharePopup/sharePopup.js
components/sharePopup/sharePopup.wxml
packageActivity/pages/order/order.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/activeBox/activeBox.scss
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/activityDiagnosis/activityDiagnosis.scss
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/environment.js
utils/request/request.js
api/activityApi/ActivityApi.js
View file @
c6a03f6
...
...
@@ -9,11 +9,11 @@ class ActivityApi {
},
false
,
true
)
}
// 获取活动中任务内容
getActiveTaskList
(
data
)
{
getActiveTaskList
(
data
,
params
)
{
return
api
.
post
({
method
:
`stoassistant.api.mission.findStaffMissionList`
,
...
data
},
false
,
true
)
},
false
,
params
&&
params
.
isShowLoading
)
}
// 获取单个任务详情内容
getActiveTaskDetail
(
data
)
{
...
...
@@ -30,13 +30,7 @@ class ActivityApi {
...
data
})
}
// 获取活动诊断订单数据
getActivityEndOrderList
(
data
)
{
return
api
.
post
({
method
:
`
${
path
}
.service.activity.detail.old`
,
...
data
},
false
,
true
)
}
// 获取申请活动已开通场景
getOpenSceneList
(
data
)
{
return
api
.
post
({
...
...
@@ -60,11 +54,11 @@ class ActivityApi {
}
// 获取活动诊断待预约安装订单数据
getActivityEndInstallOrderList
(
data
)
{
getActivityEndInstallOrderList
(
data
,
params
)
{
return
api
.
post
({
method
:
`
${
path
}
.user.activity.to.be.installed.list`
,
...
data
})
}
,
false
,
params
&&
params
.
isShowLoading
)
}
// 获取我的访客数据
getActivityVisitorList
(
data
)
{
...
...
api/mineApi/mineApi.js
View file @
c6a03f6
...
...
@@ -28,12 +28,12 @@ class MineApi {
},
true
)
}
// 获取员工详情
getStaffDetailApi
(
data
)
{
getStaffDetailApi
(
data
,
params
)
{
return
api
.
post
(
{
method
:
'scrm.api.sso.wechat.account.staff.detail'
,
...
data
,
})
}
,
false
,
params
&&
params
.
isShowLoading
)
}
// 更新员工信息
updateStaffDetailApi
(
data
)
{
...
...
components/mp-html/index.wxml
View file @
c6a03f6
<view class="_root {{selectable?'_select':''}}" style="{{containerStyle}}"><slot wx:if="{{!nodes[0]}}"/><node id="_root" childs="{{nodes}}" opts="{{[lazyLoad,loadingImg,errorImg,showImgMenu]}}" catchadd="_add"/></view>
\ No newline at end of file
<view class="_root {{selectable?'_select':''}}" style="{{containerStyle}}"><slot wx:if="{{!nodes[0]}}"/><node id="_root" childs="{{nodes}}" opts="{{[lazyLoad,loadingImg,errorImg]}}" catchadd="_add"/></view>
\ No newline at end of file
components/mp-html/node/node.wxml
View file @
c6a03f6
<wxs module="use">var e={abbr:!0,b:!0,big:!0,code:!0,del:!0,em:!0,i:!0,ins:!0,label:!0,q:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0};module.exports=function(n){return!n.c&&(!n.children||"a"===n.name||!e[n.name]&&-1===(n.attrs.style||"").indexOf("inline"))};</wxs><template name="el"><block wx:if="{{n.name==='img'}}"><image wx:if="{{(opts[1]&&!ctrl[i])||ctrl[i]<0}}" class="_img" style="{{n.attrs.style}}" src="{{ctrl[i]<0?opts[2]:opts[1]}}" mode="widthFix"/><image id="{{n.attrs.id}}" class="_img {{n.attrs.class}}" style="{{ctrl[i]===-1?'display:none;':''}}width:{{ctrl[i]||1}}px;height:1px;{{n.attrs.style}}" src="{{n.attrs.src}}" mode="{{n.h?'':'widthFix'}}" lazy-load="{{opts[0]}}" webp="{{n.webp}}" show-menu-by-longpress="{{opts[3]&&!n.attrs.ignore}}" data-i="{{i}}" bindload="imgLoad" binderror="mediaError" catchtap="imgTap" bindlongpress="noop"/></block><text wx:elif="{{n.text}}" user-select="{{n.us}}" decode>{{n.text}}</text><text wx:elif="{{n.name==='br'}}">\n</text><view wx:elif="{{n.name==='a'}}" id="{{n.attrs.id}}" class="{{n.attrs.href?'_a ':''}}{{n.attrs.class}}" hover-class="_hover" style="display:inline;{{n.attrs.style}}" data-i="{{i}}" catchtap="linkTap"><node childs="{{n.children}}" opts="{{opts}}" style="display:inherit"/></view><video wx:elif="{{n.name==='video'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" autoplay="{{n.attrs.autoplay}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" muted="{{n.attrs.muted}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError"/><audio wx:elif="{{n.name==='audio'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" author="{{n.attrs.author}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" name="{{n.attrs.name}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError"/><rich-text wx:else id="{{n.attrs.id}}" style="{{n.f}}" nodes="{{[n]}}"/></template><block wx:for="{{childs}}" wx:for-item="n1" wx:for-index="i1" wx:key="i1"><template wx:if="{{use(n1)}}" is="el" data="{{n:n1,i:''+i1,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n1.attrs.id}}" class="_{{n1.name}} {{n1.attrs.class}}" style="{{n1.attrs.style}}"><block wx:for="{{n1.children}}" wx:for-item="n2" wx:for-index="i2" wx:key="i2"><template wx:if="{{use(n2)}}" is="el" data="{{n:n2,i:i1+'_'+i2,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n2.attrs.id}}" class="_{{n2.name}} {{n2.attrs.class}}" style="{{n2.attrs.style}}"><block wx:for="{{n2.children}}" wx:for-item="n3" wx:for-index="i3" wx:key="i3"><template wx:if="{{use(n3)}}" is="el" data="{{n:n3,i:i1+'_'+i2+'_'+i3,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n3.attrs.id}}" class="_{{n3.name}} {{n3.attrs.class}}" style="{{n3.attrs.style}}"><block wx:for="{{n3.children}}" wx:for-item="n4" wx:for-index="i4" wx:key="i4"><template wx:if="{{use(n4)}}" is="el" data="{{n:n4,i:i1+'_'+i2+'_'+i3+'_'+i4,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n4.attrs.id}}" class="_{{n4.name}} {{n4.attrs.class}}" style="{{n4.attrs.style}}"><block wx:for="{{n4.children}}" wx:for-item="n5" wx:for-index="i5" wx:key="i5"><template wx:if="{{use(n5)}}" is="el" data="{{n:n5,i:i1+'_'+i2+'_'+i3+'_'+i4+'_'+i5,opts:opts,ctrl:ctrl}}"/><node wx:else id="{{n5.attrs.id}}" class="_{{n5.name}} {{n5.attrs.class}}" style="{{n5.attrs.style}}" childs="{{n5.children}}" opts="{{opts}}"/></block></view></block></view></block></view></block></view></block>
\ No newline at end of file
<wxs module="use">var e={abbr:!0,b:!0,big:!0,code:!0,del:!0,em:!0,i:!0,ins:!0,label:!0,q:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0};module.exports=function(n){return!n.c&&(!n.children||"a"===n.name||!e[n.name]&&-1===(n.attrs.style||"").indexOf("inline"))};</wxs><template name="el"><block wx:if="{{n.name==='img'}}"><image wx:if="{{(opts[1]&&!ctrl[i])||ctrl[i]<0}}" class="_img" style="{{n.attrs.style}}" src="{{ctrl[i]<0?opts[2]:opts[1]}}" mode="widthFix"/><image id="{{n.attrs.id}}" class="_img {{n.attrs.class}}" style="{{ctrl[i]===-1?'display:none;':''}}width:{{ctrl[i]||1}}px;height:1px;{{n.attrs.style}}" src="{{n.attrs.src}}" mode="{{n.h?'':'widthFix'}}" lazy-load="{{opts[0]}}" webp="{{n.webp}}" show-menu-by-longpress="{{opts[3]&&!n.attrs.ignore}}" data-i="{{i}}" bindload="imgLoad" binderror="mediaError" catchtap="{{opts[4] ? 'imgTap' : ''}}" bindlongpress="noop"/></block><text wx:elif="{{n.text}}" user-select="{{n.us}}" decode>{{n.text}}</text><text wx:elif="{{n.name==='br'}}">\n</text><view wx:elif="{{n.name==='a'}}" id="{{n.attrs.id}}" class="{{n.attrs.href?'_a ':''}}{{n.attrs.class}}" hover-class="_hover" style="display:inline;{{n.attrs.style}}" data-i="{{i}}" catchtap="linkTap"><node childs="{{n.children}}" opts="{{opts}}" style="display:inherit"/></view><video wx:elif="{{n.name==='video'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" autoplay="{{n.attrs.autoplay}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" muted="{{n.attrs.muted}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError"/><audio wx:elif="{{n.name==='audio'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" author="{{n.attrs.author}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" name="{{n.attrs.name}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError"/><rich-text wx:else id="{{n.attrs.id}}" style="{{n.f}}" nodes="{{[n]}}"/></template><block wx:for="{{childs}}" wx:for-item="n1" wx:for-index="i1" wx:key="i1"><template wx:if="{{use(n1)}}" is="el" data="{{n:n1,i:''+i1,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n1.attrs.id}}" class="_{{n1.name}} {{n1.attrs.class}}" style="{{n1.attrs.style}}"><block wx:for="{{n1.children}}" wx:for-item="n2" wx:for-index="i2" wx:key="i2"><template wx:if="{{use(n2)}}" is="el" data="{{n:n2,i:i1+'_'+i2,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n2.attrs.id}}" class="_{{n2.name}} {{n2.attrs.class}}" style="{{n2.attrs.style}}"><block wx:for="{{n2.children}}" wx:for-item="n3" wx:for-index="i3" wx:key="i3"><template wx:if="{{use(n3)}}" is="el" data="{{n:n3,i:i1+'_'+i2+'_'+i3,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n3.attrs.id}}" class="_{{n3.name}} {{n3.attrs.class}}" style="{{n3.attrs.style}}"><block wx:for="{{n3.children}}" wx:for-item="n4" wx:for-index="i4" wx:key="i4"><template wx:if="{{use(n4)}}" is="el" data="{{n:n4,i:i1+'_'+i2+'_'+i3+'_'+i4,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n4.attrs.id}}" class="_{{n4.name}} {{n4.attrs.class}}" style="{{n4.attrs.style}}"><block wx:for="{{n4.children}}" wx:for-item="n5" wx:for-index="i5" wx:key="i5"><template wx:if="{{use(n5)}}" is="el" data="{{n:n5,i:i1+'_'+i2+'_'+i3+'_'+i4+'_'+i5,opts:opts,ctrl:ctrl}}"/><node wx:else id="{{n5.attrs.id}}" class="_{{n5.name}} {{n5.attrs.class}}" style="{{n5.attrs.style}}" childs="{{n5.children}}" opts="{{opts}}"/></block></view></block></view></block></view></block></view></block>
\ No newline at end of file
components/sharePopup/sharePopup.js
View file @
c6a03f6
...
...
@@ -17,7 +17,7 @@ Component({
navHeight
:
thisPage
.
data
.
navHeight
})
if
(
val
.
showSharePopup
)
{
wx
.
$api
.
showLoading
()
wx
.
$api
.
showLoading
(
'处理中'
)
val
.
boxImageHeight
=
66
// 计算弹窗图片区域最大高度
wx
.
$util
.
getViewInfo
(
'.layout'
,
res
=>
{
...
...
@@ -32,6 +32,9 @@ Component({
})
val
.
postersImageHeight
=
(
e
.
height
/
e
.
width
)
*
247
_this
.
init
(
val
)
},
fail
()
{
wx
.
$api
.
showToast
(
'生成失败'
)
}
})
})
...
...
@@ -163,6 +166,9 @@ Component({
}
)
},
emptyFunction
()
{
},
authFail
(
e
)
{
this
.
setData
({
showAuth
:
true
...
...
components/sharePopup/sharePopup.wxml
View file @
c6a03f6
<!--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-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));">
<view class="close-box">
...
...
@@ -7,9 +7,9 @@
<image webp src="{{IMGURL}}popup_close_btn.png"></image>
</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>
</view>
</
scroll-
view>
<view class="btn-box">
<view class="btn" bind:tap="saveImage">保存至相册</view>
<view class="tip">提示:这是您的专属活动海报,请保存至手机相册后转发给客户微信,系统将自动记录成交订单归属,并发放积分奖励!</view>
...
...
packageActivity/pages/order/order.wxml
View file @
c6a03f6
...
...
@@ -17,7 +17,6 @@
<view class="name-mobile">
<view class="name">
{{item.customerNickName || ""}}
<text class="order-statue {{item.orderStatus == 1 ? '' : 'green'}}">{{item.orderStatus == 1 ? '未下单' : '已下单'}}</text>
</view>
<view class="mobile">{{item.customerPhone || ""}}</view>
</view>
...
...
pages/authentication/login/login.js
View file @
c6a03f6
...
...
@@ -226,6 +226,9 @@ Page({
wxLogin
({
detail
})
{
if
(
!
detail
?.
code
)
{
return
wx
.
$api
.
showToast
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
)
}
if
(
!
detail
.
code
||
this
.
data
.
showLoading
)
return
// this.setShowLoading(true)
wx
.
showLoading
()
...
...
pages/authentication/register/register.js
View file @
c6a03f6
...
...
@@ -58,7 +58,9 @@ Page({
toRegister
({
detail
})
{
if
(
!
detail
.
code
)
return
if
(
!
detail
?.
code
)
{
return
wx
.
$api
.
showToast
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
)
}
let
params
=
{
detail
,
...
this
.
data
.
linkParams
...
...
pages/checkProduct/checkProduct.js
View file @
c6a03f6
...
...
@@ -233,6 +233,9 @@ Page({
});
},
authSuccess
(){
this
.
setData
({
showAuth
:
false
})
this
.
createImg
()
},
toSetting
(){
...
...
pages/tab/discovery/components/product/product.wxml
View file @
c6a03f6
...
...
@@ -42,7 +42,7 @@
<view class="project-img">
<block wx:for="{{tab}}" wx:key="index">
<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-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
...
...
pages/tab/index/components/activeBox/activeBox.js
View file @
c6a03f6
// pages/tab/index/components/activeBox/activeBox.js
import
{
imgUrlMixin
}
from
'~/mixins/index'
import
ActivityApi
from
"~/api/activityApi/index"
import
QR
from
'~/utils/lib/wxqrcode
'
import
{
showEmoji
}
from
'~/utils/emoji
'
import
{
domain
}
from
'~/utils/request/http'
...
...
@@ -55,12 +55,36 @@ Component({
collapseClick
(
e
)
{
let
{
key
,
flag
}
=
e
.
currentTarget
.
dataset
let
{
activeList
}
=
this
.
data
this
.
setData
({
activeDateIndex
:
0
})
activeList
.
forEach
((
val
,
idx
)
=>
{
if
(
key
==
idx
)
{
if
(
flag
&&
!
val
.
missionList
)
{
val
.
isloading
=
true
ActivityApi
.
getActiveTaskList
({
activityId
:
val
.
id
}).
then
(
res
=>
{
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
.
newtaskCalenderList
=
this
.
calenderFilter
(
JSON
.
parse
(
JSON
.
stringify
(
val
.
missionList
))
||
[],
7
)
let
d
=
new
Date
()
...
...
@@ -114,8 +138,8 @@ Component({
k
.
time
=
(
new
Date
(
k
.
activityTime
).
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"0"
)
+
"月"
+
new
Date
(
k
.
activityTime
).
getDate
().
toString
().
padStart
(
2
,
"0"
)
+
"日"
k
.
ind
=
ind
let
completeStatusNum
=
0
k
.
platformMerchantMissionResponseList
.
forEach
(
val
=>
{
if
(
val
.
completeStatus
==
2
)
completeStatusNum
++
k
.
platformMerchantMissionResponseList
.
forEach
(
i
=>
{
if
(
i
.
completeStatus
==
2
)
completeStatusNum
++
})
if
(
d
.
getTime
()
>
new
Date
(
`
${
k
.
activityTime
.
replace
(
/-/g
,
'/'
)}
23:59:59`
).
getTime
())
k
.
status
=
2
if
(
nowDate
==
k
.
time
)
{
...
...
pages/tab/index/components/activeBox/activeBox.scss
View file @
c6a03f6
...
...
@@ -7,10 +7,9 @@
position
:
relative
;
display
:
inline-block
;
margin
:
32rpx
0
8rpx
0
;
border-radius
:
24rpx
;
overflow
:
hidden
;
box-shadow
:
0
5px
10px
0
rgba
(
204
,
133
,
122
,
0
.16
);
border-radius
:
16
px
;
border-radius
:
32r
px
;
.item-bg
{
width
:
100%
;
height
:
100%
;
...
...
pages/tab/index/components/activityCalender/activityCalender.js
View file @
c6a03f6
// pages/tab/index/components/activityCalender/activityCalender.js
import
{
imgUrlMixin
}
from
'~/mixins/index'
import
{
domain
}
from
'~/utils/request/http'
Component
({
/**
* 组件的属性列表
...
...
@@ -42,11 +39,27 @@ Component({
if
(
data
)
data
.
calenderActiveIndex
=
e
.
detail
.
current
this
.
setData
({
data
})
},
// 任务详情
jump
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
if
(
item
.
completeStatus
==
2
)
return
// 已完成
wx
.
$router
.
go
(
'packageActivity.taskDetail'
,
{...
item
})
myevent
(
e
)
{
this
.
setData
({
finishFlag
:
e
.
detail
.
flag
,
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
)
{
...
...
pages/tab/index/components/activityCalender/activityCalender.json
View file @
c6a03f6
{
"component"
:
true
,
"usingComponents"
:
{}
"usingComponents"
:
{
"task-detail-box"
:
"../taskDetailBox/taskDetailBox"
}
}
\ No newline at end of file
pages/tab/index/components/activityCalender/activityCalender.scss
View file @
c6a03f6
...
...
@@ -78,85 +78,95 @@
padding-bottom
:
54rpx
;
}
.task-show-box
{
.task-item
{
padding
:
24rpx
0
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
7rpx
;
.item-box
{
border-bottom
:
1px
solid
#F0F1F5
;
.left
{
.task-item
{
padding
:
24rpx
0
;
display
:
flex
;
image
{
width
:
80rpx
;
height
:
80rpx
;
margin-right
:
20rpx
;
flex-shrink
:
0
;
}
.task-message
{
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
7rpx
;
.left
{
display
:
flex
;
flex-flow
:
column
;
justify-content
:
space-around
;
.task-title
{
font-family
:
PingFangSC-Medium
;
image
{
width
:
80rpx
;
height
:
80rpx
;
margin-right
:
20rpx
;
flex-shrink
:
0
;
}
.task-message
{
display
:
flex
;
align-items
:
center
;
flex-wrap
:
nowrap
;
font-size
:
28rpx
;
font-weight
:
500
;
color
:
#1B233D
;
word-break
:
break-all
;
image
{
width
:
28rpx
;
height
:
28rpx
;
margin
:
0
;
flex-shrink
:
0
;
}
.integral-num
{
flex-flow
:
column
;
justify-content
:
space-around
;
.task-title
{
font-family
:
PingFangSC-Medium
;
flex-shrink
:
0
;
font-size
:
24rpx
;
display
:
flex
;
align-items
:
center
;
flex-wrap
:
nowrap
;
font-size
:
28rpx
;
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
;
word-break
:
break-all
;
}
.task-btn
{
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
;
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
;
margin
:
0
;
}
...
...
pages/tab/index/components/activityCalender/activityCalender.wxml
View file @
c6a03f6
...
...
@@ -26,24 +26,42 @@
</view>
<view class="task-show-box">
<block wx:for="{{data.missionList[activeDateIndex].platformMerchantMissionResponseList}}" wx:for-item="val" wx:for-index="ky" wx:key="ky">
<view class="task-item">
<view class="left">
<image webp src="{{IMGURL}}task_icon_{{val.missonType}}.png"></image>
<view class="task-message">
<view class="task-title">
<view class="text">{{val.missionName}}</view>
<image webp src="{{IMGURL}}integral_icon.png"></image>
<view class="integral-num">+{{val.gainScore}}积分</view>
<view class="item-box">
<view class="task-item">
<view class="left">
<image webp src="{{IMGURL}}task_icon_{{val.missonType}}.png"></image>
<view class="task-message">
<view class="task-title">
<view class="text">{{val.missionName}}</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) || val.completeStatus == 2}}">
<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 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 class="task-btn">
<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>
</block>
</view>
</block>
pages/tab/index/components/activityDiagnosis/activityDiagnosis.scss
View file @
c6a03f6
...
...
@@ -7,7 +7,9 @@
position
:
relative
;
display
:
inline-block
;
margin
:
32rpx
0
8rpx
0
;
box-shadow
:
0
5px
10px
0
rgba
(
116
,
132
,
194
,
0
.16
)
,
inset
0
-1px
3px
0
rgba
(
255
,
255
,
255
,
0
.40
);
overflow
:
hidden
;
box-shadow
:
0
10rpx
20rpx
0
rgba
(
116
,
132
,
194
,
0
.16
)
,
inset
0
-2rpx
6rpx
0
rgba
(
255
,
255
,
255
,
0
.40
);
border-radius
:
32rpx
;
.item-bg
{
width
:
100%
;
height
:
100%
;
...
...
pages/tab/index/components/nothingData/nothingData.js
0 → 100644
View file @
c6a03f6
// 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 @
c6a03f6
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
pages/tab/index/components/nothingData/nothingData.scss
0 → 100644
View file @
c6a03f6
/* pages/tab/index/components/nothingData/nothingData.wxss */
.nothing-box
{
width
:
calc
(
100%
-
48rpx
);
height
:
calc
(
100%
-
16rpx
);
margin
:
0
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
pages/tab/index/components/nothingData/nothingData.wxml
0 → 100644
View file @
c6a03f6
<!--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 @
c6a03f6
// 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
()
{
if
(
!
item
.
detailInfo
.
imgUrlList
.
length
)
return
resolve
()
resolve
()
wx
.
showLoading
({
title
:
'图片视频下载中'
,
icon
:
'none'
,
mask
:
true
})
},
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 @
c6a03f6
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
pages/tab/index/components/taskDetailBox/taskDetailBox.scss
0 → 100644
View file @
c6a03f6
/* 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 @
c6a03f6
<!--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 @
c6a03f6
...
...
@@ -4,6 +4,7 @@ const navStyle = 'background-color: transparent;'
import
{
setUserInfo
}
from
'~/utils/cache/storageApi'
import
{
showEmoji
}
from
'~/utils/emoji'
Page
({
// behaviors: [kfMixin],
/**
...
...
@@ -58,7 +59,7 @@ Page({
let
para
=
{
id
:
userStorage
.
bussinessId
}
MineApi
.
getStaffDetailApi
(
para
).
then
(
res
=>
{
MineApi
.
getStaffDetailApi
(
para
,
{
isShowLoading
:
true
}
).
then
(
res
=>
{
if
(
res
.
merchantFileResponse
){
userStorage
.
sta_avatarUrl
=
res
.
merchantFileResponse
.
fileUrl
}
...
...
@@ -91,7 +92,28 @@ Page({
val
.
titleIsWarp
=
this
.
getTextWidth
(
val
.
activityName
,
'18'
,
600
)
>
activityTitleViewWidth
if
(
num
==
1
&&
activePageNum
==
1
&&
index
==
0
)
{
// 活动中默认展开第一条 数据处理
val
.
isloading
=
true
ActivityApi
.
getActiveTaskList
({
activityId
:
val
.
id
}).
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
.
missionList
=
res
val
.
newtaskCalenderList
=
this
.
calenderFilter
(
JSON
.
parse
(
JSON
.
stringify
(
val
.
missionList
))
||
[],
7
)
...
...
@@ -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
.
ind
=
ind
let
completeStatusNum
=
0
k
.
platformMerchantMissionResponseList
.
forEach
(
val
=>
{
if
(
val
.
completeStatus
==
2
)
completeStatusNum
++
k
.
platformMerchantMissionResponseList
.
forEach
(
i
=>
{
if
(
i
.
completeStatus
==
2
)
completeStatusNum
++
})
if
(
nowDate
==
k
.
time
)
{
val
.
calenderActiveIndex
=
index
...
...
@@ -127,13 +149,15 @@ Page({
this
.
setData
({
[
itemVal
]:
val
})
}).
catch
(
err
=>
{
val
.
isloading
=
false
})
}
if
(
num
==
2
&&
pageNum
==
1
&&
index
==
0
)
{
// 活动诊断展开第一条
ActivityApi
.
getActivityEndInstallOrderList
({
activityId
:
val
.
id
}).
then
(
res
=>
{
ActivityApi
.
getActivityEndInstallOrderList
({
activityId
:
val
.
id
}
,
{
isShowLoading
:
true
}
).
then
(
res
=>
{
val
.
isCollapse
=
false
res
.
orderList
&&
res
.
orderList
.
forEach
(
it
=>
{
it
.
time
=
new
Date
(
it
.
createdDate
).
format
(
'yyyy-MM-dd hh:mm:ss'
)
it
.
time
=
it
.
createdDate
?
new
Date
(
it
.
createdDate
).
format
(
'yyyy-MM-dd hh:mm'
)
:
''
})
val
.
orderList
=
res
.
orderList
val
.
orderTotal
=
res
.
orderTotal
...
...
@@ -143,6 +167,8 @@ Page({
this
.
setData
({
[
itemVal
]:
val
})
}).
catch
(
err
=>
{
val
.
isloading
=
false
})
}
})
...
...
pages/tab/index/index.json
View file @
c6a03f6
{
"usingComponents"
:
{
"active-box"
:
"./components/activeBox/activeBox"
,
"activity-diagnosis"
:
"./components/activityDiagnosis/activityDiagnosis"
"activity-diagnosis"
:
"./components/activityDiagnosis/activityDiagnosis"
,
"nothing-data"
:
"./components/nothingData/nothingData"
},
"navigationStyle"
:
"custom"
,
"onReachBottomDistance"
:
100
...
...
pages/tab/index/index.wxml
View file @
c6a03f6
...
...
@@ -8,7 +8,7 @@
<!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg">
<image webp src="{{IMGURL}}
/index_bg.png
?v={{img_version}}"></image>
<image webp src="{{IMGURL}}
index_bg.webp
?v={{img_version}}"></image>
</view>
</view>
<!-- tab切换 -->
...
...
@@ -21,21 +21,27 @@
</block>
</view>
<!-- 活动中 -->
<scroll-view scroll-y class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" data-type="{{1}}" refresher-triggered="{{activeTrigger}}" hidden="{{tabIndex != 0}}">
<block>
<scroll-view scroll-y class="content"
style="{{!activeList.length ? 'padding-top: 16rpx;' : ''}}"
refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" data-type="{{1}}" refresher-triggered="{{activeTrigger}}" hidden="{{tabIndex != 0}}">
<block
wx:if="{{activeList.length}}"
>
<active-box bind:showAuth="toShowAuth" activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}"></active-box>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</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}}">
<block>
<block
wx:if="{{activityEndList.length}}"
>
<activity-diagnosis activityList="{{activityEndList}}" nothing="{{nothing}}"></activity-diagnosis>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</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">
<image webp src="{{IMGURL}}application_activity.png"></image>
</view>
</view>
-->
<!-- 预约安装弹窗 -->
<install-popup show="{{showPopup}}" data="{{installItem}}" bind:hidePopup="hidePopup"></install-popup>
<!-- 分享活动弹窗 -->
...
...
utils/emoji.js
View file @
c6a03f6
...
...
@@ -17,7 +17,6 @@ const emoji = [
[
'让我看看'
,
'666'
,
'红包'
,
'蜡烛'
,
'烟花'
,
'福'
,
'庆祝'
,
'爆竹'
]
]
const
emojiReg
=
/
([^\u
0020-
\u
007E
\u
00A0-
\u
00BE
\u
2E80-
\u
A4CF
\u
F900-
\u
FAFF
\u
FE30-
\u
FE4F
\u
FF00-
\u
FFEF
\u
0080-
\u
009F
\u
2000-
\u
201f
\u
2026
\u
2022
\u
20ac
])
/g
/**过滤表情 */
export
function
haveEmoji
(
value
)
{
let
val
=
false
...
...
@@ -31,26 +30,44 @@ export function haveEmoji(value) {
}
return
val
}
/**替换表情 */
export
function
replaceEmoji
(
value
)
{
let
val
=
value
.
replace
(
emojiReg
,
''
)
return
val
.
trimStart
().
trimEnd
()
}
// 表情回显 文本内容
export
function
showEmoji
(
value
)
{
let
filterValue
=
value
.
replace
(
/
\[[\u
4E00-
\u
9FA5
]{1,3}\]
/gi
,
(
res
)
=>
{
const
list
=
emoji
.
flat
(
Infinity
)
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
);
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
if
(
index
<
10
)
{
index
=
'00'
+
index
}
else
if
(
index
>=
10
&&
index
<
100
)
{
index
=
'0'
+
index
}
console
.
log
(
index
,
word
)
return
`<img webp style="width: 40rpx; height: 40rpx;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/
${
index
}
.png" />`
;
if
(
!
value
)
return
let
a
=
decodeURIComponent
(
value
).
replace
(
/
[
(
\r\n
)|(
\n
)|(↵)
]
+/g
,
'\n'
)
let
b
=
a
.
split
(
'\n'
)
let
filterContent
=
''
b
&&
b
.
forEach
((
val
,
index
)
=>
{
let
spaceVal
=
val
.
replace
(
/ /g
,
'\xa0'
)
let
filterValue
=
spaceVal
.
replace
(
/
\[[\u
4E00-
\u
9FA5_A-Z0-9_
]{1,4}\]
/gi
,
(
res
)
=>
{
const
list
=
emoji
.
flat
(
Infinity
)
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
);
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
if
(
index
<
10
)
{
index
=
'00'
+
index
}
else
if
(
index
>=
10
&&
index
<
100
)
{
index
=
'0'
+
index
}
return
`<img webp style="width: 40rpx; height: 40rpx;display:inline-block;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/
${
index
}
.png" />`
;
})
filterContent
=
filterContent
+
`<view style="display: block">
${
filterValue
}
</view>`
})
return
filterValue
}
return
filterContent
// let filterValue = a.replace(/\[[\u4E00-\u9FA5]{1,3}\]/gi, (res) => {
// const list = emoji.flat(Infinity)
// let word = res.replace(/\[|\]/gi,'');
// let index = parseInt(list.indexOf(word)) + 1
// if (index < 10) {
// index = '00' + index
// } else if (index >= 10 && index < 100) {
// index = '0' + index
// }
// console.log(index, word)
// return `<img webp style="width: 40rpx; height: 40rpx;display:inline-block;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png" />`;
// })
// return filterValue
}
\ No newline at end of file
utils/request/environment.js
View file @
c6a03f6
...
...
@@ -7,7 +7,7 @@ const target = ['ip', 'dev', 'uat', 'prod']
2测试
3生产
*/
const
index
=
3
const
index
=
2
const
secretKey
=
{
ip
:
{},
dev
:
{
...
...
utils/request/request.js
View file @
c6a03f6
...
...
@@ -87,7 +87,7 @@ class Request {
},
complete
()
{
requestTimes
--
;
if
(
requestTimes
==
0
)
{
if
(
requestTimes
==
0
&&
isShowLoading
)
{
wx
.
hideLoading
()
}
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