Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-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 fe302537
authored
Feb 28, 2023
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
自动登录
1 parent
848c7cf2
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
315 additions
and
38 deletions
api/api.js
components/SceneBox/SceneBox.wxss
login/loading/loading.js
packagesList/packageOutput/components/outputCrowdfund/outputCrowdfund.js
packagesList/packageOutput/components/outputCrowdfund/outputCrowdfund.wxml
packagesList/packageOutput/components/outputTransform/constant/data.js
packagesList/packageOutput/pages/summary.js
packagesList/packageOutput/pages/summary.wxml
pages/tab/output/components/SceneBox/SceneBox.wxss
pages/tab/output/components/client/client.js
project.private.config.json
utils/util.js
api/api.js
View file @
fe30253
...
@@ -20,5 +20,22 @@ module.exports = {
...
@@ -20,5 +20,22 @@ module.exports = {
noSignAttr
:
[
'file'
]
noSignAttr
:
[
'file'
]
})
})
},
},
/** mock */
getMock
()
{
let
url
=
'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config'
return
new
Promise
((
resolve
)
=>
{
wx
.
request
({
url
,
data
:
{},
method
:
'GET'
,
header
:
{},
dataType
:
'json'
,
responseType
:
'text'
,
success
(
response
)
{
resolve
(
response
.
data
)
}
})
})
}
}
}
}
}
components/SceneBox/SceneBox.wxss
View file @
fe30253
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
height: 40rpx;
height: 40rpx;
line-height: 40rpx;
line-height: 40rpx;
margin-top: 22rpx;
margin-top: 22rpx;
font-size: 2
4
rpx;
font-size: 2
0
rpx;
color: #3666FE;
color: #3666FE;
/* font-weight: 600; */
/* font-weight: 600; */
font-family: 'number';
font-family: 'number';
...
...
login/loading/loading.js
View file @
fe30253
...
@@ -2,6 +2,8 @@ import { checkLoginUserInfo, setRouteData, setLoginInfo, loginModal } from '../l
...
@@ -2,6 +2,8 @@ import { checkLoginUserInfo, setRouteData, setLoginInfo, loginModal } from '../l
import
{
getSessionId
}
from
'~/utils/cache/storageApi'
import
{
getSessionId
}
from
'~/utils/cache/storageApi'
import
USERAPI
from
'~/api/usersApi/index'
import
USERAPI
from
'~/api/usersApi/index'
import
{
IMG_URL
}
from
'~/utils/constantData'
import
{
IMG_URL
}
from
'~/utils/constantData'
import
md5
from
'~/utils/lib/md5'
import
{
sceneByIdApi
}
from
'~/api/checkProduct.js'
Page
({
Page
({
/**
/**
* 页面的初始数据
* 页面的初始数据
...
@@ -13,12 +15,12 @@ Page({
...
@@ -13,12 +15,12 @@ Page({
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{},
onLoad
(
options
)
{
},
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
*/
*/
onReady
()
{},
onReady
()
{
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
...
@@ -31,28 +33,52 @@ Page({
...
@@ -31,28 +33,52 @@ Page({
if
(
extraData
&&
Object
.
keys
(
extraData
).
length
)
this
.
phoneSmsLogin
(
extraData
)
if
(
extraData
&&
Object
.
keys
(
extraData
).
length
)
this
.
phoneSmsLogin
(
extraData
)
else
this
.
init
()
else
this
.
init
()
}
else
this
.
init
()
}
else
this
.
init
()
}
else
if
([
1011
,
1012
,
1013
].
includes
(
appEnter
.
scene
))
{
sceneByIdApi
({
id
:
decodeURIComponent
(
appEnter
.
query
.
scene
).
split
(
'='
)[
1
]
}).
then
(
res
=>
{
const
url
=
res
.
scene
const
obj
=
this
.
arrToObj
(
url
.
split
(
'&'
))
if
(
obj
.
hasOwnProperty
(
'userName'
)
&&
obj
.
hasOwnProperty
(
'password'
))
{
this
.
accountLogin
(
obj
)
}
else
this
.
init
()
}).
catch
(()
=>
{
this
.
init
()
})
}
else
this
.
init
()
}
else
this
.
init
()
},
},
/**
/**
* 生命周期函数--监听页面隐藏
* 生命周期函数--监听页面隐藏
*/
*/
onHide
()
{},
onHide
()
{
},
/**
/**
* 生命周期函数--监听页面卸载
* 生命周期函数--监听页面卸载
*/
*/
onUnload
()
{},
onUnload
()
{
},
/**
/**
* 页面相关事件处理函数--监听用户下拉动作
* 页面相关事件处理函数--监听用户下拉动作
*/
*/
onPullDownRefresh
()
{},
onPullDownRefresh
()
{
},
/**
/**
* 页面上拉触底事件的处理函数
* 页面上拉触底事件的处理函数
*/
*/
onReachBottom
()
{},
onReachBottom
()
{
},
arrToObj
(
list
)
{
if
(
!
Array
.
isArray
(
list
))
{
return
{}
}
var
obj
=
{}
list
.
forEach
(
item
=>
{
let
temp
=
item
.
split
(
'='
)
obj
[
temp
[
0
]]
=
temp
[
1
]
})
return
obj
},
init
()
{
init
()
{
wx
.
nextTick
(()
=>
{
wx
.
nextTick
(()
=>
{
const
sessionId
=
getSessionId
(),
const
sessionId
=
getSessionId
(),
...
@@ -102,7 +128,6 @@ Page({
...
@@ -102,7 +128,6 @@ Page({
}
else
wx
.
$router
.
reLaunch
(
'login.index'
,
obj
)
}
else
wx
.
$router
.
reLaunch
(
'login.index'
,
obj
)
},
},
phoneSmsLogin
(
extraData
)
{
phoneSmsLogin
(
extraData
)
{
console
.
log
(
extraData
)
USERAPI
.
phoneSmsLogin
({
USERAPI
.
phoneSmsLogin
({
mobile
:
extraData
.
phone
,
mobile
:
extraData
.
phone
,
code
:
extraData
.
smscode
code
:
extraData
.
smscode
...
@@ -122,5 +147,41 @@ Page({
...
@@ -122,5 +147,41 @@ Page({
wx
.
$router
.
reLaunch
(
'login.index'
)
wx
.
$router
.
reLaunch
(
'login.index'
)
},
1
e3
)
},
1
e3
)
})
})
},
accountLogin
(
obj
)
{
const
params
=
{
userName
:
obj
.
userName
,
password
:
md5
(
obj
.
password
)
}
USERAPI
.
accountLogin
(
params
).
then
(({
code
,
data
,
message
})
=>
{
if
(
code
==
'0'
)
{
const
{
sessionId
,
loginUserInfoList
}
=
data
var
routeParams
=
{}
setLoginInfo
(
loginUserInfoList
[
0
],
sessionId
)
if
(
obj
.
url
==
'/packagesList/packageOutput/pages/summary'
)
{
routeParams
=
{
merchantId
:
obj
.
merchantId
,
merchantName
:
obj
.
merchantName
,
pMerchantId
:
loginUserInfoList
[
0
].
subLoginUser
.
merchantId
,
pMerchantName
:
loginUserInfoList
[
0
].
subLoginUser
.
merchantName
,
isSuper
:
loginUserInfoList
[
0
].
isSuper
,
fixScenceCode
:
obj
.
sceneCode
}
// console.log(routeParams, 'routeParams---')
}
wx
.
$router
.
reLaunch
(
obj
.
url
,
routeParams
)
}
else
{
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
setTimeout
(()
=>
{
wx
.
$router
.
reLaunch
(
'login.index'
)
},
1
e3
)
}
})
.
catch
(
err
=>
{
wx
.
$api
.
showToast
(
'系统异常'
)
setTimeout
(()
=>
{
wx
.
$router
.
reLaunch
(
'login.index'
)
},
1
e3
)
})
}
}
})
})
packagesList/packageOutput/components/outputCrowdfund/outputCrowdfund.js
View file @
fe30253
...
@@ -13,10 +13,14 @@ Component({
...
@@ -13,10 +13,14 @@ Component({
properties
:
{
properties
:
{
orderObj
:
{
orderObj
:
{
type
:
Object
,
type
:
Object
,
value
:
()
=>
{},
value
:
()
=>
{
},
observer
(
n
)
{
observer
(
n
)
{
n
&&
this
.
dealStaffList
()
n
&&
this
.
dealStaffList
()
}
}
},
hasReport
:
{
type
:
Boolean
,
value
:
true
}
}
},
},
...
@@ -164,7 +168,7 @@ Component({
...
@@ -164,7 +168,7 @@ Component({
path
:
obj
.
path
path
:
obj
.
path
})
})
},
},
fail
()
{}
fail
()
{
}
})
})
})
})
},
},
...
@@ -174,6 +178,15 @@ Component({
...
@@ -174,6 +178,15 @@ Component({
},
},
async
download
(
e
)
{
async
download
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
const
{
item
}
=
e
.
currentTarget
.
dataset
if
(
item
.
mockPoster
)
{
item
.
posterUrl
=
item
.
mockPoster
this
.
setData
({
crowdPosterItem
:
item
,
isShowTip
:
false
})
return
}
// posterObj = this.selectComponent('#crowdPoster'),
// posterObj = this.selectComponent('#crowdPoster'),
// { options } = wx.$router.getPageInstance()
// { options } = wx.$router.getPageInstance()
// const { options } = wx.$router.getPageInstance()
// const { options } = wx.$router.getPageInstance()
...
@@ -213,7 +226,7 @@ Component({
...
@@ -213,7 +226,7 @@ Component({
this
.
triggerEvent
(
'posterTrack'
)
this
.
triggerEvent
(
'posterTrack'
)
},
},
/**长按战报/喜报 */
/**长按战报/喜报 */
async
handlePosterTouch
(
e
)
{},
async
handlePosterTouch
(
e
)
{
},
/**战报 */
/**战报 */
handleReport
(
e
)
{
handleReport
(
e
)
{
const
{
item
,
idx
}
=
e
.
currentTarget
.
dataset
const
{
item
,
idx
}
=
e
.
currentTarget
.
dataset
...
...
packagesList/packageOutput/components/outputCrowdfund/outputCrowdfund.wxml
View file @
fe30253
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
</view>
</view>
</view>
</view>
<!-- 战报 -->
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view class="new-report" wx:if="{{item.activityStatus != 1
&& hasReport
}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view>
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view>
<view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view>
<view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view>
</view>
</view>
...
...
packagesList/packageOutput/components/outputTransform/constant/data.js
View file @
fe30253
...
@@ -24,7 +24,8 @@ const formList = [{
...
@@ -24,7 +24,8 @@ const formList = [{
label
:
'体验转化率'
,
label
:
'体验转化率'
,
name
:
'calTransform'
,
name
:
'calTransform'
,
suffix
:
'%'
suffix
:
'%'
}]
}
]
const
formObj
=
{
const
formObj
=
{
SC001
:
[{
SC001
:
[{
...
@@ -43,8 +44,7 @@ const formObj = {
...
@@ -43,8 +44,7 @@ const formObj = {
prefix
:
'¥'
prefix
:
'¥'
},
{
},
{
label
:
'转化率'
,
label
:
'转化率'
,
name
:
'conversionRate'
,
name
:
'conversionRate'
suffix
:
'%'
},
{
},
{
label
:
'单价'
,
label
:
'单价'
,
name
:
'price'
,
name
:
'price'
,
...
...
packagesList/packageOutput/pages/summary.js
View file @
fe30253
// packageOutput/pages/summary/summary.js
// packageOutput/pages/summary/summary.js
import
outputApi
from
'~/api/outputApi/index'
import
outputApi
from
'~/api/outputApi/index'
import
{
commonApi
}
from
'~/api/api'
import
{
IMG_URL
}
from
'~/utils/constantData'
import
{
IMG_URL
}
from
'~/utils/constantData'
import
{
getNowMonth
}
from
'~/utils/format'
import
{
getNowMonth
}
from
'~/utils/format'
import
utils
from
'~/utils/util.js'
const
defaultSceneCode
=
'SC004'
const
defaultSceneCode
=
'SC004'
Page
({
Page
({
/**
/**
...
@@ -11,7 +13,17 @@ Page({
...
@@ -11,7 +13,17 @@ Page({
IMGURL
:
IMG_URL
,
IMGURL
:
IMG_URL
,
sceneCodeList
:
[
'SC002'
,
'SC003'
,
'SC004'
,
'SC001'
],
sceneCodeList
:
[
'SC002'
,
'SC003'
,
'SC004'
,
'SC001'
],
merchantInfo
:
{},
merchantInfo
:
{},
sceneInfo
:
{},
sceneInfo
:
{
sceneList
:
[{
sceneCode
:
"SC002"
,
flag
:
false
},
{
sceneCode
:
"SC003"
,
flag
:
false
},
{
sceneCode
:
"SC004"
,
flag
:
false
},
{
sceneCode
:
"SC001"
,
flag
:
false
}]
},
sceneData
:
{},
sceneData
:
{},
// sceneObj: {
// sceneObj: {
// scene1: null,
// scene1: null,
...
@@ -45,6 +57,7 @@ Page({
...
@@ -45,6 +57,7 @@ Page({
scene2
:
[],
scene2
:
[],
scene3
:
[]
scene3
:
[]
},
},
fixScenceCode
:
'-1'
,
// 产值
// 产值
searchForm
:
{
searchForm
:
{
sceneSC002
:
0
,
sceneSC002
:
0
,
...
@@ -54,6 +67,13 @@ Page({
...
@@ -54,6 +67,13 @@ Page({
baseData
:
{
baseData
:
{
timeList
:
[
'全部'
,
'本月'
,
'本日'
],
timeList
:
[
'全部'
,
'本月'
,
'本日'
],
actStatusList
:
[
'全部'
,
'申请中'
,
'活动中'
,
'已结束'
]
actStatusList
:
[
'全部'
,
'申请中'
,
'活动中'
,
'已结束'
]
},
mockObj
:
{},
isMock
:
{
'SC001'
:
false
,
'SC002'
:
false
,
'SC003'
:
false
,
'SC004'
:
false
}
}
},
},
...
@@ -143,6 +163,12 @@ Page({
...
@@ -143,6 +163,12 @@ Page({
// 定位已开通的场景,默认定位至场景4
// 定位已开通的场景,默认定位至场景4
findOpenScene
()
{
findOpenScene
()
{
let
sceneCodeActive
=
defaultSceneCode
let
sceneCodeActive
=
defaultSceneCode
if
(
this
.
data
.
fixScenceCode
!=
'-1'
)
{
this
.
setData
({
sceneCodeActive
:
this
.
data
.
fixScenceCode
||
'SC004'
})
return
}
const
list
=
[]
const
list
=
[]
this
.
data
.
sceneCodeList
.
forEach
(
item
=>
{
this
.
data
.
sceneCodeList
.
forEach
(
item
=>
{
let
sceneIsOpen
=
this
.
data
.
sceneData
.
find
(
k
=>
k
.
sceneCode
==
item
)?.
sceneIsOpen
let
sceneIsOpen
=
this
.
data
.
sceneData
.
find
(
k
=>
k
.
sceneCode
==
item
)?.
sceneIsOpen
...
@@ -199,6 +225,9 @@ Page({
...
@@ -199,6 +225,9 @@ Page({
if
(
!
[
'SC001'
].
includes
(
this
.
data
.
sceneCodeActive
))
{
if
(
!
[
'SC001'
].
includes
(
this
.
data
.
sceneCodeActive
))
{
this
.
getEquityRevenue
(
isFirst
)
this
.
getEquityRevenue
(
isFirst
)
}
}
if
(
!
[
'SC004'
].
includes
(
this
.
data
.
sceneCodeActive
))
{
this
.
getActivityRevenue
(
isFirst
)
}
}
}
// console.log(this.data.sceneCodeActive == defaultSceneCode)
// console.log(this.data.sceneCodeActive == defaultSceneCode)
if
([
'SC002'
,
'SC003'
].
includes
(
this
.
data
.
sceneCodeActive
))
{
if
([
'SC002'
,
'SC003'
].
includes
(
this
.
data
.
sceneCodeActive
))
{
...
@@ -266,11 +295,10 @@ Page({
...
@@ -266,11 +295,10 @@ Page({
var
idx
=
actCodeList
.
findIndex
(
i
=>
i
==
item
.
productCode
)
var
idx
=
actCodeList
.
findIndex
(
i
=>
i
==
item
.
productCode
)
var
orderTotal
=
item
.
orderTotal
var
orderTotal
=
item
.
orderTotal
if
(
item
.
orderTotal
)
{
if
(
item
.
orderTotal
)
{
item
.
orderTotal
.
totalAmount
=
Number
(
orderTotal
.
totalAmount
).
toFixed
(
2
)
total
=
(
total
+
Number
(
item
.
orderTotal
?.
totalAmount
)).
toFixed
(
2
)
item
.
orderTotal
.
totalAmount
=
utils
.
moneyThreeForTwoThousands
(
Number
(
orderTotal
.
totalAmount
).
toFixed
(
2
))
item
.
orderTotal
.
monthAmount
=
Number
(
orderTotal
.
monthAmount
).
toFixed
(
2
)
item
.
orderTotal
.
monthAmount
=
Number
(
orderTotal
.
monthAmount
).
toFixed
(
2
)
item
.
orderTotal
.
conversionRate
=
Number
(
orderTotal
.
conversionRate
).
toFixed
(
0
)
item
.
orderTotal
.
price
=
Number
(
orderTotal
.
price
).
toFixed
(
2
)
item
.
orderTotal
.
price
=
Number
(
orderTotal
.
price
).
toFixed
(
2
)
total
=
(
total
+
Number
(
item
.
orderTotal
?.
totalAmount
)).
toFixed
(
2
)
}
}
actList
[
idx
]
=
{
actList
[
idx
]
=
{
...
actList
[
idx
],
...
actList
[
idx
],
...
@@ -301,11 +329,15 @@ Page({
...
@@ -301,11 +329,15 @@ Page({
var
curTotal
=
0
var
curTotal
=
0
var
otherTotal
=
0
var
otherTotal
=
0
var
otherSceneIdx
=
isFirst
?
this
.
findSceneIdx
(
'SC002'
)
:
this
.
data
.
sceneCodeActive
==
'SC002'
?
this
.
findSceneIdx
(
'SC003'
)
:
this
.
findSceneIdx
(
'SC002'
)
var
otherSceneIdx
=
isFirst
?
this
.
findSceneIdx
(
'SC002'
)
:
this
.
data
.
sceneCodeActive
==
'SC002'
?
this
.
findSceneIdx
(
'SC003'
)
:
this
.
findSceneIdx
(
'SC002'
)
let
obj
=
this
.
judgeUpgrade
()
res
.
forEach
(
item
=>
{
res
.
forEach
(
item
=>
{
var
idx
=
actCodeList
.
findIndex
(
i
=>
i
==
item
.
productCode
)
var
idx
=
actCodeList
.
findIndex
(
i
=>
i
==
item
.
productCode
)
if
(
idx
!=
-
1
)
{
if
(
idx
!=
-
1
)
{
var
orderTotal
=
item
.
orderTotal
var
orderTotal
=
item
.
orderTotal
if
(
item
.
orderTotal
)
{
if
(
this
.
data
.
sceneCodeActive
==
'SC002'
&&
obj
.
flag
)
{
let
upgradeObj
=
this
.
data
.
mockObj
.
upgradeObj
[
obj
.
idx
]
item
.
orderTotal
=
upgradeObj
.
orderTotal
}
else
if
(
item
.
orderTotal
)
{
item
.
orderTotal
.
calCustomerUnitPrice
=
Math
.
round
(
orderTotal
.
totalSubOrderOrderMoney
/
orderTotal
.
upgradeCount
).
toFixed
(
2
)
item
.
orderTotal
.
calCustomerUnitPrice
=
Math
.
round
(
orderTotal
.
totalSubOrderOrderMoney
/
orderTotal
.
upgradeCount
).
toFixed
(
2
)
item
.
orderTotal
.
calExperience
=
Math
.
round
((
orderTotal
.
experienceCount
*
100
)
/
orderTotal
.
toShopCount
).
toFixed
(
0
)
item
.
orderTotal
.
calExperience
=
Math
.
round
((
orderTotal
.
experienceCount
*
100
)
/
orderTotal
.
toShopCount
).
toFixed
(
0
)
item
.
orderTotal
.
calTransform
=
Math
.
round
((
orderTotal
.
upgradeCount
*
100
)
/
orderTotal
.
experienceCount
).
toFixed
(
0
)
item
.
orderTotal
.
calTransform
=
Math
.
round
((
orderTotal
.
upgradeCount
*
100
)
/
orderTotal
.
experienceCount
).
toFixed
(
0
)
...
@@ -360,8 +392,28 @@ Page({
...
@@ -360,8 +392,28 @@ Page({
return
params
return
params
},
},
/**处理SC004的数据 */
mockDealCrowd
(
data
)
{
var
obj
=
this
.
judgeCrowd
(
this
.
data
.
merchantInfo
.
pMerchantId
,
data
.
merchantId
)
if
(
!
obj
.
flag
)
{
return
data
}
var
mockActivityList
=
this
.
data
.
mockObj
?.
crowdObj
[
obj
.
pIdx
].
merchantList
[
obj
.
idx
].
activityList
var
actIds
=
mockActivityList
.
map
(
item
=>
item
.
activityId
)
// console.log(mockActivityList, 'mockActivityList')
data
.
activityList
.
forEach
(
item
=>
{
let
idx
=
actIds
.
findIndex
(
k
=>
k
==
item
.
activityId
)
if
(
idx
!=
-
1
)
{
item
.
activityName
=
mockActivityList
[
idx
].
activityName
item
.
mockPoster
=
mockActivityList
[
idx
].
postUrl
}
})
return
data
},
/** 查询场景4的产值 */
/** 查询场景4的产值 */
getActivityRevenue
(
isFirst
=
false
)
{
getActivityRevenue
(
isFirst
=
false
)
{
console
.
log
(
this
.
data
.
isMock
,
'SC004--mock---'
)
wx
.
showLoading
()
wx
.
showLoading
()
var
params
=
this
.
dealSearchStatus
()
var
params
=
this
.
dealSearchStatus
()
outputApi
outputApi
...
@@ -377,6 +429,7 @@ Page({
...
@@ -377,6 +429,7 @@ Page({
actList
.
forEach
((
item
,
idx
)
=>
{
actList
.
forEach
((
item
,
idx
)
=>
{
var
curItem
=
res
.
find
(
k
=>
k
.
goodsCategoryCode
==
item
.
productCode
)
var
curItem
=
res
.
find
(
k
=>
k
.
goodsCategoryCode
==
item
.
productCode
)
if
(
curItem
)
{
if
(
curItem
)
{
curItem
=
this
.
mockDealCrowd
(
curItem
)
curItem
.
totalNum
=
curItem
.
activityList
.
length
curItem
.
totalNum
=
curItem
.
activityList
.
length
curItem
.
shareBtnIdx
=
-
1
curItem
.
shareBtnIdx
=
-
1
let
shareFlag
=
false
let
shareFlag
=
false
...
@@ -473,6 +526,15 @@ Page({
...
@@ -473,6 +526,15 @@ Page({
// show: true
// show: true
// })
// })
// } catch (error) {
// } catch (error) {
if
(
item
.
mockPoster
)
{
item
.
posterUrl
=
item
.
mockPoster
this
.
setData
({
crowdPosterItem
:
item
,
isShowTip
:
false
})
return
}
wx
.
$api
.
showLoading
(
'加载中...'
)
wx
.
$api
.
showLoading
(
'加载中...'
)
outputApi
outputApi
.
getPosterUrl
({
.
getPosterUrl
({
...
@@ -516,27 +578,110 @@ Page({
...
@@ -516,27 +578,110 @@ Page({
this
.
setCurActivity
()
this
.
setCurActivity
()
},
},
// 精品升级-SC002
judgeUpgrade
(
pId
,
id
)
{
let
res
=
{
flag
:
false
,
idx
:
-
1
}
let
pMerchantId
=
pId
||
this
.
data
.
merchantInfo
.
pMerchantId
let
merchantId
=
id
||
this
.
data
.
merchantInfo
.
merchantId
if
(
this
.
data
.
mockObj
?.
upgradeObj
)
{
let
pList
=
this
.
data
.
mockObj
.
upgradeObj
.
map
(
item
=>
item
.
pMerchantId
)
for
(
let
i
=
0
;
i
<
this
.
data
.
mockObj
.
upgradeObj
.
length
;
i
++
)
{
let
item
=
this
.
data
.
mockObj
.
upgradeObj
[
i
]
if
(
item
.
pMerchantId
==
pMerchantId
&&
item
.
merchantId
==
merchantId
)
{
res
=
{
flag
:
true
,
idx
:
i
}
break
}
}
}
return
res
},
// 售后众筹-SC004
judgeCrowd
(
pId
,
id
)
{
let
res
=
{
flag
:
false
,
pIdx
:
-
1
,
idx
:
-
1
}
if
(
this
.
data
.
mockObj
?.
crowdObj
)
{
let
pList
=
this
.
data
.
mockObj
.
crowdObj
.
map
(
item
=>
item
.
pMerchantId
)
for
(
let
i
=
0
;
i
<
this
.
data
.
mockObj
.
crowdObj
.
length
;
i
++
)
{
let
item
=
this
.
data
.
mockObj
.
crowdObj
[
i
]
console
.
log
(
item
,
'item---'
)
let
cList
=
item
.
merchantList
.
map
(
k
=>
k
.
merhantId
)
if
(
cList
.
includes
((
id
||
this
.
data
.
merchantInfo
.
merchantId
)
+
''
)
&&
pList
.
includes
((
pId
||
this
.
data
.
merchantInfo
.
pMerchantId
)
+
''
))
{
res
=
{
flag
:
true
,
pIdx
:
i
,
idx
:
cList
.
findIndex
(
k
=>
k
==
(
id
||
this
.
data
.
merchantInfo
.
merchantId
))
}
break
}
}
}
return
res
},
// 判断是否Mock数据写死
judgeAccount
()
{
console
.
log
(
this
.
data
.
merchantInfo
,
'this.data.merchantInfo'
)
console
.
log
(
this
.
data
.
mockObj
,
'this.data.mockObj'
)
// 精品升级-SC002
// 售后众筹-SC004
this
.
setData
({
[
'isMock.SC002'
]:
this
.
judgeUpgrade
().
flag
,
[
'isMock.SC004'
]:
this
.
judgeCrowd
().
flag
})
console
.
log
(
this
.
data
.
isMock
,
'isMock---'
)
},
// 二维码自动登录
onRoute
(
options
)
{
if
(
!
options
.
hasOwnProperty
(
'fixScenceCode'
))
{
return
}
this
.
setData
({
merchantInfo
:
options
,
fixScenceCode
:
options
.
fixScenceCode
})
commonApi
.
getMock
().
then
(
res
=>
{
// console.log(res, '---')
this
.
setData
({
mockObj
:
res
})
this
.
judgeAccount
()
this
.
getSceneProStatus
(
this
.
data
.
sceneCodeList
[
this
.
findSceneIdx
()],
true
)
})
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
* 从client跳转
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
this
.
initTime
()
this
.
initTime
()
wx
.
$router
.
getData
(
obj
=>
{
wx
.
$router
.
getData
(
obj
=>
{
var
list
=
[]
console
.
log
(
obj
,
'summary---onload'
)
this
.
data
.
sceneCodeList
.
forEach
(
item
=>
{
let
temp
=
obj
.
sceneList
.
find
(
k
=>
k
.
sceneCode
==
item
)
||
{}
list
.
push
(
temp
)
})
this
.
setData
({
this
.
setData
({
merchantInfo
:
obj
,
merchantInfo
:
obj
,
sceneInfo
:
{
sceneList
:
list
}
// sceneCodeList: obj.sceneCodeList
})
})
commonApi
.
getMock
().
then
(
res
=>
{
console
.
log
(
res
,
'---'
)
this
.
setData
({
mockObj
:
res
})
this
.
judgeAccount
()
this
.
getSceneProStatus
(
this
.
data
.
sceneCodeList
[
this
.
findSceneIdx
()],
true
)
this
.
getSceneProStatus
(
this
.
data
.
sceneCodeList
[
this
.
findSceneIdx
()],
true
)
})
})
})
},
},
// 查找当前高亮场景的idx
// 查找当前高亮场景的idx
...
@@ -549,7 +694,7 @@ Page({
...
@@ -549,7 +694,7 @@ Page({
*/
*/
onReady
()
{
onReady
()
{
wx
.
setNavigationBarTitle
({
wx
.
setNavigationBarTitle
({
title
:
this
.
data
.
merchantInfo
.
merchantName
title
:
this
.
data
.
merchantInfo
?
.
merchantName
})
})
},
},
...
...
packagesList/packageOutput/pages/summary.wxml
View file @
fe30253
...
@@ -31,17 +31,18 @@
...
@@ -31,17 +31,18 @@
<view class="activity-title title bg-white p-l-20 no-border">
<view class="activity-title title bg-white p-l-20 no-border">
<view>看产值</view>
<view>看产值</view>
<view wx:if="{{sceneCodeActive != 'SC001'}}" class="select" bindtap="handleSearch">
<view wx:if="{{sceneCodeActive != 'SC001'}}" class="select" bindtap="handleSearch">
<view wx:if="{{
sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003'
}}" class="select-txt">
<view wx:if="{{
(sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003') && !isMock.SC002
}}" class="select-txt">
{{baseData.timeList[sceneCodeActive == 'SC002' ? searchForm.sceneSC002 : searchForm.sceneSC003]}}
{{baseData.timeList[sceneCodeActive == 'SC002' ? searchForm.sceneSC002 : searchForm.sceneSC003]}}
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
</view>
</view>
<view wx:if="{{sceneCodeActive == 'SC004'}}" class="select-txt">
<view wx:if="{{sceneCodeActive == 'SC004'
&& !isMock.SC004
}}" class="select-txt">
{{baseData.actStatusList[searchForm.sceneSC004]}}
{{baseData.actStatusList[searchForm.sceneSC004]}}
</view>
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
</view>
</view>
</view>
</view>
<output-transform wx:if="{{sceneCodeActive != 'SC004'}}" formData="{{activityList[activityActive].orderTotal}}" hasNavigate="{{sceneCodeActive != 'SC001'}}" sceneCode="{{sceneCodeActive}}"/>
</view>
<output-crowdfund wx:if="{{sceneCodeActive == 'SC004'}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack"/>
<output-transform wx:if="{{sceneCodeActive != 'SC004'}}" formData="{{activityList[activityActive].orderTotal}}" hasNavigate="{{sceneCodeActive != 'SC001' && !isMock.SC002}}" sceneCode="{{sceneCodeActive}}" />
<output-crowdfund wx:if="{{sceneCodeActive == 'SC004'}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack" hasReport="{{isMock.SC004}}" />
</view>
</view>
<view wx:else class="content-empty bg-white">
<view wx:else class="content-empty bg-white">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
...
...
pages/tab/output/components/SceneBox/SceneBox.wxss
View file @
fe30253
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
height: 40rpx;
height: 40rpx;
line-height: 40rpx;
line-height: 40rpx;
margin-top: 36rpx;
margin-top: 36rpx;
font-size: 2
4
rpx;
font-size: 2
2
rpx;
color: #3666FE;
color: #3666FE;
/* font-weight: 600; */
/* font-weight: 600; */
font-family: "number";
font-family: "number";
...
...
pages/tab/output/components/client/client.js
View file @
fe30253
...
@@ -153,7 +153,7 @@ Component({
...
@@ -153,7 +153,7 @@ Component({
// scene2: currentItem.scene2,
// scene2: currentItem.scene2,
// scene3: currentItem.scene3,
// scene3: currentItem.scene3,
// scene4: currentItem.scene4,
// scene4: currentItem.scene4,
sceneList
:
currentItem
.
sceneList
,
//
sceneList: currentItem.sceneList,
// sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
// sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
pMerchantId
:
this
.
data
.
pMerchantId
,
pMerchantId
:
this
.
data
.
pMerchantId
,
pMerchantName
:
this
.
data
.
pMerchantInfo
.
subLoginUser
.
merchantName
,
pMerchantName
:
this
.
data
.
pMerchantInfo
.
subLoginUser
.
merchantName
,
...
...
project.private.config.json
View file @
fe30253
...
@@ -80,6 +80,13 @@
...
@@ -80,6 +80,13 @@
"query"
:
""
,
"query"
:
""
,
"launchMode"
:
"default"
,
"launchMode"
:
"default"
,
"scene"
:
null
"scene"
:
null
},
{
"name"
:
""
,
"pathName"
:
"login/loading/loading"
,
"query"
:
"scene=sceneId%3D22401"
,
"launchMode"
:
"default"
,
"scene"
:
1011
}
}
]
]
}
}
...
...
utils/util.js
View file @
fe30253
...
@@ -256,6 +256,38 @@ const setNavigationBarTitle = (title) =>{
...
@@ -256,6 +256,38 @@ const setNavigationBarTitle = (title) =>{
});
});
}
}
/** 钱转化千分 */
const
moneyThreeForTwoThousands
=
num
=>
{
//num = parseInt(num);
// return num
var
num
=
num
+
''
var
d
=
''
if
(
num
.
slice
(
0
,
1
)
==
'-'
)
{
d
=
num
.
slice
(
0
,
1
)
num
=
num
.
slice
(
1
)
}
var
len
=
num
.
length
var
index
=
num
.
indexOf
(
'.'
)
if
(
index
==
-
1
)
{
num
=
num
+
'.00'
}
else
if
(
index
+
2
==
len
)
{
num
=
num
+
'0'
}
var
index
=
num
.
indexOf
(
'.'
)
// 字符出现的位置
var
num2
=
num
.
slice
(
-
3
)
num
=
num
.
slice
(
0
,
index
)
var
result
=
''
while
(
num
.
length
>
3
)
{
result
=
','
+
num
.
slice
(
-
3
)
+
result
num
=
num
.
slice
(
0
,
num
.
length
-
3
)
}
if
(
num
)
{
result
=
num
+
result
}
// return result
return
d
+
(
result
+
num2
)
}
const
Util
=
{
const
Util
=
{
getImgVersion
,
getImgVersion
,
...
@@ -267,6 +299,7 @@ const Util = {
...
@@ -267,6 +299,7 @@ const Util = {
parseString
,
parseString
,
getCurrentPageUrl
,
getCurrentPageUrl
,
deepClone
,
deepClone
,
setNavigationBarTitle
setNavigationBarTitle
,
moneyThreeForTwoThousands
};
};
export
default
Util
;
export
default
Util
;
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