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 893fdbca
authored
Nov 14, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug 修复
1 parent
919352d7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
250 additions
and
198 deletions
packagesList/mineDetail/pages/customerManagement.js
packagesList/mineDetail/pages/messageBox.js
packagesList/mineDetail/pages/messageBox.wxml
pages/tab/output/components/SceneBox/SceneBox.wxss
project.private.config.json
utils/utils_wx.js
packagesList/mineDetail/pages/customerManagement.js
View file @
893fdbc
...
...
@@ -138,7 +138,7 @@ Component({
item
.
merchantName
=
item
.
merchantName
||
item
.
actualMerchantName
item
.
phone
=
item
.
phone
||
item
.
actualPhone
// || item.actualContactName
item
.
contactName
=
item
.
contactName
||
item
.
actual
Accoun
tName
item
.
contactName
=
item
.
contactName
||
item
.
actual
Contac
tName
return
item
})
console
.
log
(
list
)
...
...
@@ -180,23 +180,21 @@ Component({
// let
let
status
=
customerList
[
index
].
isEdit
// console.log(isEdit)
// customerList[index]['isEdit'] = !customerList[index]['isEdit']
if
(
item
.
isEdit
)
{
// 提交客户信息更新
// this.checkout(customerList[index])
// console.log('customerList[index]', customerList[index])
// let {} =
!
isSuper
&&
this
.
submit
(
customerList
[
index
])
}
else
{
customerList
[
index
][
'isEdit'
]
=
true
this
.
setData
({
customerList
})
}
console
.
log
(
index
)
// let indexEdit = console.log(!status)
this
.
setData
({
[
`customerList[
${
index
}
].isEdit`
]:
!
status
})
},
input
(
e
)
{
let
{
index
,
name
}
=
e
.
currentTarget
.
dataset
console
.
log
(
index
)
console
.
log
(
name
)
//
console.log(index)
//
console.log(name)
let
{
customerList
,
listObj
}
=
this
.
data
let
{
value
}
=
e
.
detail
// listObj
...
...
packagesList/mineDetail/pages/messageBox.js
View file @
893fdbc
...
...
@@ -172,12 +172,23 @@ Component({
tabBarStyle
:
height
/
2
+
statusBarHeight
})
},
refreshList
(
e
)
{
async
refreshList
(
e
)
{
console
.
log
(
e
)
let
{
type
}
=
this
.
data
let
{
typename
}
=
e
.
currentTarget
.
dataset
type
[
typename
].
pageNum
=
1
this
.
getMessageList
(
typename
)
let
res
=
await
this
.
getMessageList
(
typename
)
let
toastObj
=
{
success
:
{
title
:
'刷新成功'
,
icon
:
'success'
},
fail
:
{
title
:
'刷新失败'
,
icon
:
'error'
}
}
wx
.
$api
.
showToast
(
toastObj
[
res
])
},
scrollonReachBottom
(
e
)
{
console
.
log
(
e
)
...
...
@@ -203,35 +214,40 @@ Component({
},
getMessageList
(
typeName
)
{
let
that
=
this
let
{
serviceMerchantId
,
type
,
warReportList
,
messageList
}
=
this
.
data
let
list
=
type
[
typeName
][
'list'
]
// console.log('list', this.data[list])
// return
let
params
=
{
serviceMerchantId
:
serviceMerchantId
,
...
type
[
typeName
]
}
// console.log(Math.ceil(2.8))
wx
.
$api
.
showLoading
(
'加载中...'
)
mineApi
.
messageBoxPage
(
params
)
.
then
(
result
=>
{
console
.
log
(
result
)
let
{
count
,
data
,
pageSize
,
pageNum
,
pages
}
=
result
const
listName
=
`
${
type
[
typeName
][
'list'
]}
`
type
[
typeName
][
'pages'
]
=
pages
type
[
typeName
][
'pageNum'
]
=
pageNum
console
.
log
(
listName
)
this
.
setData
({
[
listName
]:
type
[
typeName
].
pageNum
==
1
?
data
:
[...
this
.
data
[
list
],
...
data
],
type
,
triggered
:
false
return
new
Promise
((
resolve
,
reject
)
=>
{
let
{
serviceMerchantId
,
type
,
warReportList
,
messageList
}
=
this
.
data
let
list
=
type
[
typeName
][
'list'
]
// console.log('list', this.data[list])
// return
let
params
=
{
serviceMerchantId
:
serviceMerchantId
,
...
type
[
typeName
]
}
// console.log(Math.ceil(2.8))
wx
.
$api
.
showLoading
(
'加载中...'
)
mineApi
.
messageBoxPage
(
params
)
.
then
(
result
=>
{
console
.
log
(
result
)
let
{
count
,
data
,
pageSize
,
pageNum
,
pages
}
=
result
const
listName
=
`
${
type
[
typeName
][
'list'
]}
`
type
[
typeName
][
'pages'
]
=
pages
type
[
typeName
][
'pageNum'
]
=
pageNum
console
.
log
(
listName
)
this
.
setData
({
[
listName
]:
type
[
typeName
].
pageNum
==
1
?
data
:
[...
this
.
data
[
list
],
...
data
],
type
,
triggered
:
false
})
resolve
(
'success'
)
})
})
.
catch
(
err
=>
{})
.
finally
(()
=>
{
wx
.
$api
.
hideLoading
()
})
.
catch
(
err
=>
{
reject
(
'fail'
)
})
.
finally
(()
=>
{
wx
.
$api
.
hideLoading
()
})
})
}
}
})
packagesList/mineDetail/pages/messageBox.wxml
View file @
893fdbc
...
...
@@ -5,78 +5,119 @@
</view> -->
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">
<view>消息盒子</view>
<view>消息盒子</view>
</navigation-bar>
<view class="layout " style="padding-top:{{tabBarStyle}}px; height:calc(100vh - {{tabBarStyle}}px)">
<tab tab="{{tabList}}" itemWidth="{{'50%'}}" index="{{tabIndx}}" bindclick="changeTabIndx" class="tabContainer" />
<!-- -->
<view class="scrollCon" hidden="{{tabIndx==1}}">
<scroll-view wx:if="{{tabBarStyle}}" scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="refreshList" bindscrolltolower="scrollonReachBottom" refresher-threshold="104" style="height:100%;" scroll-top="{{scrollTop}}" class="list" data-typeName="warReport" refresher-triggered="{{triggered}}">
<msg-box wx:for="{{warReportList}}" wx:key='index' merchantName="{{item.merchantName}}" messageType="{{item.messageType}}" time="{{item.updatedTime}}">
<view class="warReportBox" wx:if="{{item.messageType == 2}}">
<view class="item">
<view class="label">当前产值</view>
<view class="num font-number">{{item.currentValue||'0.0'}}元</view>
</view>
</view>
<view class="warReportBox" wx:if="{{item.messageType == 3}}">
<view class="item">
<view class="label">总产值</view>
<view class="num font-number">{{item.totalValue}}元</view>
</view>
<view class="item">
<view class="label">完成目标</view>
<view class="num font-number">{{item.completeRate}}</view>
</view>
</view>
<view class="warReportLink">
<view class="label">点击了解详情:</view>
<view class="link" wx:if="{{item.valueUrl}}" data-valueurl="{{item.valueUrl}}" data-item="{{item}}" bind:tap="downLoad">
战报详情
</view>
</view>
</msg-box>
</scroll-view>
</view>
<view hidden="{{tabIndx==0}}" class="scrollCon">
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="refreshList" bindscrolltolower="scrollonReachBottom" refresher-threshold="104" style="height:100%;" scroll-top="{{scrollTop}}" class="list" data-typeName="message" refresher-triggered="{{triggered}}">
<msg-box wx:for="{{messageList}}" wx:key='index' merchantName="{{item.merchantName}}" messageType="{{item.messageType}}" time="{{item.updatedTime}}">
<view wx:if="{{item.messageType == 1}}">
<view class="cell">
<view class="label">活动名称:</view>
<view class="value">{{item.activityName}}</view>
</view>
<view class="cell">
<view class="label">开始时间:</view>
<view class="value">{{item.activityStartTime||'-'}}</view>
</view>
<view class="cell">
<view class="label">结算时间:</view>
<view class="value">{{item.activityEndTime||'-'}}</view>
</view>
<view class="cell" wx:if="{{item.crowdFundActivityId}}">
<view class="label">活动链接:</view>
<view class="link" bind:tap="copyLink" data-item="{{item}}">下载海报</view>
</view>
</view>
<view class="cell" wx:if="{{item.messageType == 4}}">
<view class="label">产品名称:</view>
<view class="value">{{item.activityName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 5}}">
<view class="label">新车交付场景:</view>
<view class="value">{{item.activityName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 6}}">
<view class="label">0~12个月场景:</view>
<view class="value">{{item.activityName}}</view>
</view>
</msg-box>
</scroll-view>
</view>
<tab
tab="{{tabList}}"
itemWidth="{{'50%'}}"
index="{{tabIndx}}"
bindclick="changeTabIndx"
class="tabContainer" />
<!-- -->
<view class="scrollCon" hidden="{{tabIndx==1}}">
<scroll-view
wx:if="{{tabBarStyle}}"
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
bindscrolltolower="scrollonReachBottom"
refresher-threshold="104"
style="height:100%;"
scroll-top="{{scrollTop}}"
class="list"
data-typeName="warReport"
refresher-triggered="{{triggered}}">
<msg-box
wx:for="{{warReportList}}"
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
<view class="warReportBox" wx:if="{{item.messageType == 2}}">
<view class="item">
<view class="label">当前产值</view>
<view class="num font-number">{{item.currentValue||'0.0'}}元</view>
</view>
</view>
<view class="warReportBox" wx:if="{{item.messageType == 3}}">
<view class="item">
<view class="label">总产值</view>
<view class="num font-number">{{item.totalValue}}元</view>
</view>
<view class="item">
<view class="label">完成目标</view>
<view class="num font-number">{{item.completeRate}}</view>
</view>
</view>
<view class="warReportLink">
<view class="label">点击了解详情:</view>
<view
class="link"
wx:if="{{item.valueUrl}}"
data-valueurl="{{item.valueUrl}}"
data-item="{{item}}"
bind:tap="downLoad">
战报详情
</view>
</view>
</msg-box>
</scroll-view>
</view>
<view hidden="{{tabIndx==0}}" class="scrollCon">
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
bindscrolltolower="scrollonReachBottom"
refresher-threshold="104"
style="height:100%;"
scroll-top="{{scrollTop}}"
class="list"
data-typeName="message"
refresher-triggered="{{triggered}}">
<msg-box
wx:for="{{messageList}}"
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
<view wx:if="{{item.messageType == 1}}">
<view class="cell">
<view class="label">活动名称:</view>
<view class="value">{{item.activityName}}</view>
</view>
<view class="cell">
<view class="label">开始时间:</view>
<view class="value">{{item.activityStartTime||'-'}}</view>
</view>
<view class="cell">
<view class="label">结算时间:</view>
<view class="value">{{item.activityEndTime||'-'}}</view>
</view>
<view class="cell" wx:if="{{item.crowdFundActivityId}}">
<view class="label">母链海报:</view>
<view class="link" bind:tap="copyLink" data-item="{{item}}">下载母链海报分享给门店开展活动</view>
</view>
</view>
<view class="cell" wx:if="{{item.messageType == 4}}">
<view class="label">产品名称:</view>
<view class="value">{{item.activityName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 5}}">
<view class="label">新车交付场景:</view>
<view class="value">{{item.activityName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 6}}">
<view class="label">0~12个月场景:</view>
<view class="value">{{item.activityName}}</view>
</view>
</msg-box>
</scroll-view>
</view>
</view>
<crowdfund-poster findKey="crowdFundActivityId" id="poster" item="{{posterItem}}" />
<canvas class="erweimaCanvas" style="width: 600rpx; height: 600rpx;" canvas-id="myQrcode" />
\ No newline at end of file
<canvas class="erweimaCanvas" style="width: 600rpx; height: 600rpx;" canvas-id="myQrcode" />
pages/tab/output/components/SceneBox/SceneBox.wxss
View file @
893fdbc
...
...
@@ -98,7 +98,7 @@
font-size: 16rpx;
}
.total-price {
height: 40rpx;
line-height: 40rpx;
...
...
project.private.config.json
View file @
893fdbc
...
...
@@ -41,14 +41,14 @@
},
{
"name"
:
"客户管理"
,
"pathName"
:
"pa
ges/mineDetail/customerManagement
/customerManagement"
,
"pathName"
:
"pa
ckagesList/mineDetail/pages
/customerManagement"
,
"query"
:
""
,
"launchMode"
:
"default"
,
"scene"
:
null
},
{
"name"
:
"消息盒子"
,
"pathName"
:
"pa
ges/mineDetail/messageBox
/messageBox"
,
"pathName"
:
"pa
ckagesList/mineDetail/pages
/messageBox"
,
"query"
:
""
,
"launchMode"
:
"default"
,
"scene"
:
null
...
...
utils/utils_wx.js
View file @
893fdbc
import
wxqrcode
from
"~/utils/lib/wxqrcode.js"
;
import
wxqrcode
from
'~/utils/lib/wxqrcode.js'
/**
* 微信校验通知类工具封装
*/
const
tipsObj
=
{
phone
:
{
icon
:
"error"
,
title
:
"请输入手机号"
,
icon
:
'error'
,
title
:
'请输入手机号'
},
username
:
{
icon
:
"error"
,
title
:
"请输入用户名"
,
icon
:
'error'
,
title
:
'请输入用户名'
},
password
:
{
icon
:
"error"
,
title
:
"请输入密码"
,
}
,
}
;
icon
:
'error'
,
title
:
'请输入密码'
}
}
/**
* 禁止滑动
*/
const
noScroll
=
()
=>
{}
;
const
noScroll
=
()
=>
{}
/**设置粘贴板内容 */
const
setCopyData
=
(
data
,
callBack
)
=>
{
wx
.
setClipboardData
({
data
:
data
,
success
(
res
)
{
if
(
callBack
&&
typeof
callBack
===
"function"
)
callBack
(
res
);
}
,
})
;
}
;
if
(
callBack
&&
typeof
callBack
===
'function'
)
callBack
(
res
)
}
})
}
/**
* 防止重复点击
*/
const
showLoading
=
(
title
=
""
)
=>
{
const
showLoading
=
(
title
=
''
)
=>
{
if
(
wx
.
showLoading
)
{
// 基础库 1.1.0 微信6.5.6版本开始支持,低版本需做兼容处理
wx
.
showLoading
({
title
,
mask
:
true
,
})
;
mask
:
true
})
}
else
{
// 低版本采用Toast兼容处理并将时间设为20秒以免自动消失
wx
.
showToast
({
title
,
icon
:
"loading"
,
icon
:
'loading'
,
mask
:
true
,
duration
:
20000
,
})
;
duration
:
20000
})
}
}
;
}
const
hideLoading
=
()
=>
{
if
(
wx
.
hideLoading
)
{
// 基础库 1.1.0 微信6.5.6版本开始支持,低版本需做兼容处理
wx
.
hideLoading
()
;
wx
.
hideLoading
()
}
else
{
wx
.
hideToast
()
;
wx
.
hideToast
()
}
}
;
const
showToast
=
(
val
)
=>
{
let
obj
=
{}
;
if
(
val
&&
typeof
val
===
"string"
)
{
obj
.
title
=
val
;
obj
.
icon
=
"none"
;
}
const
showToast
=
val
=>
{
let
obj
=
{}
if
(
val
&&
typeof
val
===
'string'
)
{
obj
.
title
=
val
obj
.
icon
=
'none'
}
else
{
obj
=
val
;
obj
=
val
}
return
wx
.
showToast
(
obj
)
;
}
;
return
wx
.
showToast
(
obj
)
}
/**
*
...
...
@@ -80,77 +80,76 @@ const showToast = (val) => {
const
wxShowToast
=
(
name
,
params
)
=>
{
if
(
arguments
.
length
==
2
)
{
wx
.
showToast
({
title
:
tipsObj
[
name
][
"title"
],
icon
:
tipsObj
[
name
][
"icon"
],
...
params
,
})
;
title
:
tipsObj
[
name
][
'title'
],
icon
:
tipsObj
[
name
][
'icon'
],
...
params
})
}
else
{
wx
.
showToast
({
...
params
,
})
;
...
params
})
}
}
;
}
/**获取设备信息 */
const
getSystemInfo
=
(
callBack
)
=>
{
const
getSystemInfo
=
callBack
=>
{
wx
.
getSystemInfo
({
success
(
res
)
{
callBack
(
res
)
;
callBack
(
res
)
},
fail
(
err
)
{
callBack
(
err
)
;
}
,
})
;
}
;
callBack
(
err
)
}
})
}
/**拨打电话 */
const
phoneCall
=
(
phoneNumber
)
=>
{
const
phoneCall
=
phoneNumber
=>
{
wx
.
makePhoneCall
({
phoneNumber
:
`
${
phoneNumber
}
`
,
})
;
}
;
phoneNumber
:
`
${
phoneNumber
}
`
})
}
/**查看大图 */
const
previewImage
=
(
params
)
=>
{
wx
.
previewImage
(
params
)
;
}
;
const
previewImage
=
params
=>
{
wx
.
previewImage
(
params
)
}
export
function
handleCopy
(
url
)
{
// var { idx } = e.currentTarget.dataset
// var currentItem = this.data.orderObj.activityList[idx]
var
qr
=
wxqrcode
.
createQrCodeImg
(
url
)
;
var
qr
=
wxqrcode
.
createQrCodeImg
(
url
)
const
base64src
=
function
(
base64data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
[
a
,
format
,
bodyData
]
=
/data:image
\/(\w
+
)
;base64,
(
.*
)
/
.
exec
(
base64data
)
||
[];
if
(
!
format
)
reject
(
new
Error
(
"ERROR_BASE64SRC_PARSE"
));
const
filePath
=
`
${
wx
.
env
.
USER_DATA_PATH
}
/tmp_base64src.
${
format
}
`
;
const
buffer
=
wx
.
base64ToArrayBuffer
(
bodyData
);
const
[
a
,
format
,
bodyData
]
=
/data:image
\/(\w
+
)
;base64,
(
.*
)
/
.
exec
(
base64data
)
||
[]
if
(
!
format
)
reject
(
new
Error
(
'ERROR_BASE64SRC_PARSE'
))
const
filePath
=
`
${
wx
.
env
.
USER_DATA_PATH
}
/tmp_base64src.
${
format
}
`
const
buffer
=
wx
.
base64ToArrayBuffer
(
bodyData
)
wx
.
getFileSystemManager
().
writeFile
({
filePath
,
data
:
buffer
,
encoding
:
"binary"
,
encoding
:
'binary'
,
success
()
{
resolve
(
filePath
)
;
resolve
(
filePath
)
},
fail
()
{
reject
(
new
Error
(
"ERROR_BASE64SRC_WRITE"
));
}
,
})
;
})
;
}
;
base64src
(
qr
).
then
(
(
res
)
=>
{
console
.
log
(
res
)
;
reject
(
new
Error
(
'ERROR_BASE64SRC_WRITE'
))
}
})
})
}
base64src
(
qr
).
then
(
res
=>
{
console
.
log
(
res
)
wx
.
getImageInfo
({
src
:
res
,
success
(
obj
)
{
wx
.
showShareImageMenu
({
path
:
obj
.
path
,
})
;
path
:
obj
.
path
})
},
fail
()
{}
,
})
;
})
;
fail
()
{}
})
})
}
/**获取节点信息
...
...
@@ -159,18 +158,15 @@ export function handleCopy(url) {
* isComponents是否在组件
*/
const
getViewInfo
=
(
name
,
callBack
,
isComponents
)
=>
{
const
query
=
!
isComponents
?
wx
.
createSelectorQuery
()
:
wx
.
createSelectorQuery
().
in
(
isComponents
);
const
query
=
!
isComponents
?
wx
.
createSelectorQuery
()
:
wx
.
createSelectorQuery
().
in
(
isComponents
)
query
.
selectAll
(
name
)
.
boundingClientRect
(
(
res
)
=>
{
console
.
log
(
'res: '
,
res
)
;
callBack
(
res
)
;
.
boundingClientRect
(
res
=>
{
console
.
log
(
'res: '
,
res
)
callBack
(
res
)
})
.
exec
()
;
}
;
.
exec
()
}
const
wxApi
=
{
previewImage
,
...
...
@@ -182,6 +178,7 @@ const wxApi = {
phoneCall
,
noScroll
,
getViewInfo
,
};
wxShowToast
}
export
default
wxApi
;
export
default
wxApi
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