Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d7a60033
authored
Feb 11, 2025
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
中邮延保协议优化紧急需求开发
1 parent
4a05fe29
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
289 additions
and
119 deletions
packageEquity/api.js
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.js
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.sass
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.wxml
packageEquity/pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple.js
packageEquity/pages/carQuotation/index/index.js
packageEquity/pages/carQuotation/index/index.wxml
packageEquity/pages/carQuotation/index/index.wxss
pages/webView/webView.js
pages/webView/webView.wxml
packageEquity/api.js
View file @
d7a6003
...
...
@@ -219,5 +219,9 @@ module.exports = {
// 更新客户签名
updateCustomerNameUrlAPI
(
data
)
{
return
api
.
post
(
"dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.updateCustomerNameUrl"
,
data
)
},
// 校验流水号
checkRecord
(
data
)
{
return
api
.
post
(
"dj.api.smartcarlife.vehicle.damage.upgrade.quotation.record.check"
,
data
)
}
}
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.js
View file @
d7a6003
...
...
@@ -15,6 +15,7 @@ Component({
if
(
n
)
{
let
sysInfo
=
wx
.
getSystemInfoSync
()
// sysInfo.environment 1 企业微信打开 0微信打开
// sysInfo.platform === 'windows' || sysInfo.platform === 'mac' || sysInfo.platform === 'linux' 是否pc端打开
this
.
setData
({
envName
:
sysInfo
.
environment
?
1
:
0
})
...
...
@@ -53,43 +54,50 @@ Component({
let
_this
=
this
let
{
fileList
}
=
_this
.
data
wx
.
chooseImage
({
count
:
1
,
count
:
9
-
fileList
?.
length
,
success
(
res
)
{
let
[
tempFiles
]
=
res
.
tempFilePaths
let
imgType
=
tempFiles
.
split
(
'.'
)[
1
]
let
type
=
imgType
==
'unknown'
?
'jpg'
:
imgType
_this
.
setData
({
loadingFlag
:
true
})
wx
.
getFileSystemManager
().
readFile
({
filePath
:
tempFiles
,
//选择图片返回的相对路径
encoding
:
'base64'
,
//编码格式
success
(
_res
)
{
api
.
uploadImg
({
file
:
`
${
type
}
@
${
_res
.
data
}
`
}).
then
(
img
=>
{
_this
.
setData
({
loadingFlag
:
false
const
uploadImages
=
async
(
tempFilePaths
)
=>
{
const
fileList
=
[]
await
Promise
.
all
(
tempFilePaths
.
map
((
val
,
index
)
=>
{
const
imgType
=
val
.
split
(
'.'
)[
1
]
const
type
=
imgType
===
'unknown'
?
'jpg'
:
imgType
return
new
Promise
((
resolve
,
reject
)
=>
{
wx
.
getFileSystemManager
().
readFile
({
filePath
:
val
,
// 选择图片返回的相对路径
encoding
:
'base64'
,
// 编码格式
success
:
async
(
_res
)
=>
{
try
{
const
img
=
await
api
.
uploadImg
({
file
:
`
${
type
}
@
${
_res
.
data
}
`
})
const
{
code
,
data
,
message
}
=
img
if
(
code
==
0
)
{
fileList
.
push
({
url
:
data
});
_this
.
setData
({
fileList
,
showChangeFileType
:
false
,
fileType
:
'image'
})
}
else
{
wx
.
$util
.
showToast
(
message
)
}
resolve
()
}
catch
(
error
)
{
reject
(
error
)
}
},
fail
:
reject
})
let
{
code
,
data
,
message
}
=
img
if
(
code
==
0
)
{
fileList
.
push
({
url
:
data
})
_this
.
setData
({
fileList
,
showChangeFileType
:
false
,
fileType
:
'image'
})
}
else
{
wx
.
$util
.
showToast
(
message
)
}
})
},
fail
()
{
_this
.
setData
({
loadingFlag
:
false
})
}
})
}))
_this
.
setData
({
loadingFlag
:
false
})
}
uploadImages
(
res
?.
tempFilePaths
)
}
})
},
...
...
@@ -103,88 +111,112 @@ Component({
})
},
uploadPDFs
()
{
let
_this
=
this
let
{
fileList
}
=
_this
.
data
wx
.
chooseMessageFile
({
count
:
1
,
type
:
'file'
,
extension
:
[
'pdf'
],
success
(
res
)
{
// 正确获取选择的文件
let
tempFile
=
res
.
tempFiles
[
0
]
let
fileName
=
tempFile
.
name
// 获取文件名
let
fileType
=
fileName
.
split
(
'.'
).
pop
()
// 获取文件扩展名
// 读取文件
if
(
fileType
!=
'pdf'
)
return
wx
.
$util
.
showToast
(
'只可上传pdf类型文件'
)
_this
.
setData
({
loadingFlag
:
true
})
wx
.
getFileSystemManager
().
readFile
({
filePath
:
tempFile
.
path
,
// 使用正确的路径
encoding
:
'base64'
,
success
(
_res
)
{
// 调用上传接口
api
.
uploadPdfAPI
({
file
:
`
${
fileType
}
@
${
_res
.
data
}
`
// 处理文件类型
}).
then
(
img
=>
{
_this
.
setData
({
loadingFlag
:
false
})
let
{
code
,
data
,
message
}
=
img
;
async
uploadPDFs
()
{
//
let _this = this
//
let { fileList } = _this.data
//
wx.chooseMessageFile({
//
count: 1,
//
type: 'file',
//
extension: ['pdf'],
//
success(res) {
//
// 正确获取选择的文件
//
let tempFile = res.tempFiles[0]
//
let fileName = tempFile.name // 获取文件名
//
let fileType = fileName.split('.').pop() // 获取文件扩展名
//
// 读取文件
//
if (fileType != 'pdf') return wx.$util.showToast('只可上传pdf类型文件')
//
_this.setData({
//
loadingFlag: true
//
})
//
wx.getFileSystemManager().readFile({
//
filePath: tempFile.path, // 使用正确的路径
//
encoding: 'base64',
//
success(_res) {
//
// 调用上传接口
//
api.uploadPdfAPI({
//
file: `${fileType}@${_res.data}` // 处理文件类型
//
}).then(img => {
//
_this.setData({
//
loadingFlag: false
//
})
//
let { code, data, message } = img;
if
(
code
==
0
)
{
fileList
.
push
({
url
:
data
,
fileName
:
fileName
});
// 添加到文件列表
_this
.
setData
({
fileList
,
showChangeFileType
:
false
,
fileType
:
'pdf'
// 设置文件类型为 pdf
});
}
else
{
wx
.
$util
.
showToast
(
message
);
}
});
},
fail
(
err
)
{
_this
.
setData
({
loadingFlag
:
false
})
console
.
error
(
'读取文件失败'
,
err
);
// if (code == 0) {
// fileList.push({ url: data, fileName: fileName }); // 添加到文件列表
// _this.setData({
// fileList,
// showChangeFileType: false,
// fileType: 'pdf' // 设置文件类型为 pdf
// });
// } else {
// wx.$util.showToast(message);
// }
// });
// },
// fail(err) {
// _this.setData({
// loadingFlag: false
// })
// console.error('读取文件失败', err);
// }
// });
// },
// fail(err) {
// console.error('选择文件失败', err);
// }
// })
this
.
setData
({
showChangeFileType
:
false
,
show
:
false
})
const
{
zyWebViewUrl
}
=
await
wx
.
$util
.
getMockData
()
let
path
=
`
${
zyWebViewUrl
}
/#/zyUpload`
return
wx
.
navigateTo
({
url
:
`/pages/webView/webView?url=
${
encodeURIComponent
(
path
)}
`
,
events
:
{
webViewMessage
:
(
data
)
=>
{
if
(
data
==
'cancel'
)
{
// 稍后补录
return
this
.
close
(
''
,
2
)
}
else
{
// 确认上传
this
.
setData
({
fileList
:
[
data
]
})
this
.
confirm
(
''
,
2
)
}
});
},
fail
(
err
)
{
console
.
error
(
'选择文件失败'
,
err
);
}
}
})
},
deleteFile
(
e
)
{
this
.
setData
({
fileList
:
[]
})
let
{
index
}
=
e
.
currentTarget
.
dataset
let
{
fileList
}
=
this
.
data
fileList
.
splice
(
index
,
1
)
this
.
setData
({
fileList
})
},
closeChangeUploadType
()
{
this
.
setData
({
showChangeFileType
:
false
})
},
close
()
{
close
(
e
,
pageBackNum
)
{
// pageBackNum 从h5返回页面层级数
let
{
isListShow
}
=
this
.
data
if
(
isListShow
)
return
this
.
setData
({
show
:
false
,
fileList
:
[]})
let
thisPage
=
wx
.
$router
.
getPageInstance
()
let
thisPage
=
wx
.
$router
.
getPageInstance
(
pageBackNum
||
1
)
thisPage
.
setData
({
[
'orderInfo.zyPayUrl'
]:
''
,
confirmStatus
:
false
})
thisPage
.
handleSecondConfirm
(
'cancel'
)
},
confirm
(
e
)
{
confirm
(
e
,
pageBackNum
)
{
// pageBackNum 从h5返回页面层级数
let
{
fileList
,
isListShow
}
=
this
.
data
let
thisPage
=
wx
.
$router
.
getPageInstance
()
let
thisPage
=
wx
.
$router
.
getPageInstance
(
pageBackNum
||
1
)
if
(
fileList
.
length
)
{
if
(
isListShow
)
{
this
.
triggerEvent
(
'confirm'
,
{
zyPayUrl
:
fileList
.
map
(
item
=>
item
.
url
)
[
0
]
})
this
.
triggerEvent
(
'confirm'
,
{
zyPayUrl
:
fileList
.
map
(
item
=>
item
.
url
)})
}
else
{
thisPage
.
setData
({
[
'orderInfo.zyPayUrl'
]:
fileList
.
map
(
item
=>
item
.
url
)
[
0
]
,
[
'orderInfo.zyPayUrl'
]:
fileList
.
map
(
item
=>
item
.
url
)
?.
join
(
','
)
,
confirmStatus
:
false
})
thisPage
.
handleSecondConfirm
()
...
...
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.sass
View file @
d7a6003
...
...
@@ -15,8 +15,8 @@
}
}
.upload_content
{
width
:
var
(
--
fontSize
192
)
;
height
:
var
(
--
fontSize
192
)
;
width
:
var
(
--
fontSize
200
)
;
height
:
var
(
--
fontSize
200
)
;
background
:
#F5F5F7
;
border-radius
:
var
(
--
fontSize8
)
;
display
:
flex
;
...
...
@@ -33,12 +33,17 @@
margin-top
:
var
(
--
fontSize20
)
;
}
}
.content_box
{
display
:
flex
;
flex-wrap
:
wrap
;
gap
:
var
(
--
fontSize20
)
;
}
.image_content
{
display
:
inline-block
;
position
:
relative
;
.image_box
{
width
:
var
(
--
fontSize
192
)
;
height
:
var
(
--
fontSize
192
)
;
width
:
var
(
--
fontSize
200
)
;
height
:
var
(
--
fontSize
200
)
;
}
.del_icon
{
width
:
var
(
--
fontSize36
)
;
...
...
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.wxml
View file @
d7a6003
...
...
@@ -21,9 +21,15 @@
<block wx:else>
<view class="tips-text">已上传</view>
<block wx:if="{{fileType == 'image'}}">
<view class="image_content" wx:for="{{fileList}}" wx:key="index">
<image bindtap="previewImage" class="image_box" data-url="{{[item.url]}}" data-index="{{index}}" src="{{item.url}}"/>
<image class="del_icon" src="{{IMG_URL}}zy_del_icon.png" mode="" bindtap="deleteFile"/>
<view class="content_box">
<view class="image_content" wx:for="{{fileList}}" wx:key="index">
<image bindtap="previewImage" class="image_box" data-url="{{fileList}}" data-index="{{index}}" src="{{item.url}}"/>
<image class="del_icon" src="{{IMG_URL}}zy_del_icon.png" mode="" bindtap="deleteFile" data-index="{{index}}" />
</view>
<view class="upload_content" bindtap="uploadImages" wx:if="{{fileList.length < 9}}">
<image src="{{IMG_URL}}zy-upload_icon.png"></image>
<text class="text">最多9张</text>
</view>
</view>
</block>
<block wx:else>
...
...
@@ -50,7 +56,7 @@
<view class="popup-content">
<view class="title">请选择</view>
<view class="popup-item" bindtap="uploadImages">上传图片</view>
<view class="popup-item"
wx:if="{{envName != 1}}"
bindtap="uploadPDFs">上传PDF</view>
<view class="popup-item" bindtap="uploadPDFs">上传PDF</view>
</view>
</van-popup>
</block>
...
...
packageEquity/pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple.js
View file @
d7a6003
...
...
@@ -10,7 +10,8 @@ import {
errorOrderById
,
staffDailyReportMerchantValid
,
updateOrderStatus
,
orderSettingList
orderSettingList
,
checkRecord
}
from
"../../../api"
;
import
{
quotedImgUrl
}
from
"~/config"
;
import
dataForm
from
'../components/constant/stepData'
...
...
@@ -494,14 +495,25 @@ Page({
// 门店收款且是智界/享界车型 弹出上传延保协议
try
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
// 当延保协议弹窗点击稍后补录会传值detail:cancel, 提交表单时不会重复弹出延保协议弹出
if
(
check
&&
orderInfo
.
payType
==
2
&&
carBrandList
?.
includes
(
orderInfo
?.
owner
?.
carChildsBrandId
)
&&
detail
!=
'cancel'
&&
!
orderInfo
?.
zyPayUrl
)
{
// 当延保协议弹窗点击稍后补录会传值detail:cancel, 提交表单时不会重复弹出延保协议弹出 标记错误订单的补录时无需上传延保协议
if
(
check
&&
orderInfo
.
payType
==
2
&&
carBrandList
?.
includes
(
orderInfo
?.
owner
?.
carChildsBrandId
)
&&
detail
!=
'cancel'
&&
!
orderInfo
?.
zyPayUrl
&&
!
orderInfo
.
resetOrder
)
{
// 添加流水号校验
wx
.
hideLoading
()
this
.
setData
({
showPopup
:
false
})
reject
()
return
this
.
setData
({
showZyPopup
:
true
})
let
result
=
await
checkRecord
({
transactionNo
:
orderInfo
.
transactionNo
})
let
{
code
,
message
}
=
result
if
(
code
==
0
)
{
this
.
setData
({
showPopup
:
false
})
reject
()
return
this
.
setData
({
showZyPopup
:
true
})
}
else
{
reject
()
this
.
setData
({
confirmStatus
:
false
})
return
wx
.
$util
.
showToast
(
message
)
}
}
// let { orderInfo } = this.data
console
.
log
(
"调接口---"
);
...
...
packageEquity/pages/carQuotation/index/index.js
View file @
d7a6003
...
...
@@ -7,7 +7,8 @@ import {
orderStatistics
,
cancelOrderById
,
getQuotationInfoById
,
updateCustomerInfo
updateCustomerInfo
,
errorOrderById
}
from
"../../../api"
;
import
{
checkDailyReport
}
from
"~/store/ModalToQueueControl"
;
import
data
from
"../constant/data"
;
...
...
@@ -147,7 +148,8 @@ Component({
repealVisible
:
false
,
repealReason
:
''
,
repealId
:
''
,
zyPayStatus
:
''
// 延保协议状态
zyPayStatus
:
''
,
// 延保协议状态
selectType
:
1
},
observers
:
{
mode
:
function
(
value
)
{
...
...
@@ -353,8 +355,9 @@ Component({
item
.
isTouchMove
=
false
;
// onlyRepeal 战败且为超管,或者是待报价、待支付的非融合都可撤销
item
.
onlyRepeal
=
((
item
.
orderStatus
==
2
||
item
.
orderStatus
==
0
)
||
(
item
.
orderStatus
==
-
1
&&
this
.
data
.
userInfo
.
isSuper
))
&&
item
.
mode
!=
0
;
// 待上传的支持可撤销
item
.
repeal
=
((
item
.
orderStatus
==
3
||
item
.
orderStatus
==
5
)
&&
((
item
.
orderStatus
==
3
||
item
.
orderStatus
==
5
||
item
.
orderStatus
==
7
)
&&
item
.
mode
!=
0
)
||
item
.
onlyRepeal
;
return
item
;
});
...
...
@@ -457,6 +460,11 @@ Component({
zyPayStatus
:
e
.
detail
==
(
tabList
?.
length
-
1
)
&&
!
e
.
zyPayStatus
?
1
:
e
.
zyPayStatus
?
e
.
zyPayStatus
:
''
,
// 当tab选中最后一项或筛选页面存在值
list
:
[]
});
const
thisPage
=
wx
.
$router
.
getPageInstance
();
thisPage
.
setData
({
orderStatus
,
zyPayStatus
:
e
.
detail
==
(
tabList
?.
length
-
1
)
&&
!
e
.
zyPayStatus
?
1
:
e
.
zyPayStatus
?
e
.
zyPayStatus
:
''
})
this
.
search
();
this
.
getOrderStatistics
();
},
...
...
@@ -466,6 +474,9 @@ Component({
console
.
log
(
target
);
// 上传延保协议
if
(
target
?.
zyPayStatus
==
'1'
&&
type
==
'upload'
)
{
// 校验是否填写昨日日报
let
staffCheck
=
await
checkDailyReport
(
true
);
if
(
staffCheck
)
return
false
;
return
this
.
setData
({
showZyPayPopup
:
true
,
showZyTarget
:
target
})
}
// wx.$router.go('createOrderCarQuotation', {
...
...
@@ -578,7 +589,7 @@ Component({
}).
then
(
res
=>
{
let
orderInfo
=
this
.
getInsurance
(
res
.
data
)
// 更新客户信息
updateCustomerInfo
({...
orderInfo
,
zyPayUrl
:
e
.
detail
?.
zyPayUrl
}).
then
(
result
=>
{
updateCustomerInfo
({...
orderInfo
,
zyPayUrl
:
e
.
detail
?.
zyPayUrl
?.
join
(
','
)
}).
then
(
result
=>
{
this
.
setData
({
showZyPayPopup
:
false
},
()
=>
{
...
...
@@ -896,6 +907,31 @@ Component({
title
:
"工单标记"
,
tabTitleShow
:
false
,
success
:
(
res
)
=>
{
this
.
showErrorType
(
item
);
},
error
:
()
=>
{
},
});
}
);
},
selectType
(
e
)
{
let
{
type
}
=
e
.
currentTarget
.
dataset
;
this
.
setData
({
selectType
:
type
,
});
},
// 确定是否要显示
showErrorType
(
item
)
{
wx
.
$modal
(
this
,
{
show
:
true
,
title
:
"请选择录单入口"
,
tabTitleShow
:
false
,
success
:
(
res
)
=>
{
// 跳转新增订单页面 并带特定参数
let
{
selectType
}
=
this
.
data
;
if
(
selectType
==
1
)
{
wx
.
$router
.
go
(
item
.
mode
!=
0
?
"createOrderCarQuotationSimple"
...
...
@@ -905,10 +941,23 @@ Component({
resetOrder
:
true
,
}
);
},
error
:
()
=>
{
},
});
}
}
else
{
// 无需补录
errorOrderById
({
oldQuotationId
:
item
.
id
,
needCreateNewOrder
:
false
}).
then
(
res
=>
{
let
{
code
,
message
}
=
res
if
(
code
==
0
)
{
this
.
search
()
}
else
{
wx
.
$util
.
showToast
(
message
)
}
}).
catch
(()
=>
{
})
}
},
error
:
()
=>
{
},
},
"#modal2"
);
},
jumpReception
(
e
)
{
...
...
@@ -942,7 +991,7 @@ Component({
let
name
=
constantData
.
orderStatusList
.
find
(
(
item
)
=>
item
.
confId
==
e
.
detail
.
orderStatus
)?.
confName
;
tabIndex
=
tabList
.
findIndex
((
item
)
=>
item
.
text
==
name
);
tabIndex
=
tabList
.
findIndex
((
item
)
=>
item
.
text
&&
item
.
text
==
name
);
if
(
tabIndex
==
-
1
)
tabIndex
=
0
;
}
if
(
e
.
detail
.
zyPayStatus
&&
e
.
detail
.
zyPayStatus
[
0
]
==
1
)
{
...
...
packageEquity/pages/carQuotation/index/index.wxml
View file @
d7a6003
...
...
@@ -90,7 +90,7 @@
</block>
<view class="header-status">
<!-- 待上传延保协议且是已支付的订单 -->
<block wx:if="{{item.zyPayStatus == 1 && (item.orderStatus == 3 || item.orderStatus == 4)}}">
<block wx:if="{{item.zyPayStatus == 1 && (item.orderStatus == 3 || item.orderStatus == 4
|| item.orderStatus == 7
)}}">
<view class="default-txt">待上传</view>
</block>
<block wx:else>
...
...
@@ -193,7 +193,7 @@
<view class="item-footer">
<!-- 超管isSuper/商户类型 userType 1账号不可操作 -->
<block wx:if="{{ !userInfo.isSuper && userInfo.userType == 2||staffUuid }}">
<block wx:if="{{ item.zyPayStatus == 1 && (item.orderStatus == 3 || item.orderStatus == 4) }}">
<block wx:if="{{ item.zyPayStatus == 1 && (item.orderStatus == 3 || item.orderStatus == 4
|| item.orderStatus == 7
) }}">
<view class="btn_class">
<block wx:if="{{ item.orderStatus != '0' }}">
<view class="order-btn default-btn padding_20" bindtap="jumpReception" data-item="{{ item }}">接待记录</view>
...
...
@@ -297,6 +297,18 @@
</view>
</view>
</modal>
<modal id="modal2" class="modal" custom="true" btns="{{ ['取消','确定'] }}">
<view class="modatcontent">
<view class="modalbox {{ selectType == 1?'act': '' }} com" bindtap="selectType" data-type="1">
<gl-image class="icon" src="/miniProgram/order1.png"></gl-image>
新增工单
</view>
<view class="modalbox cancle {{ selectType == 2?'act': '' }}" bindtap="selectType" data-type="2">
<gl-image class="icon" src="/miniProgram/order2.png"></gl-image>
无需补单
</view>
</view>
</modal>
<view class="repeal-modal" wx:if="{{ repealVisible }}">
<view class="repeal-wrap">
<view class="title">撤销原因</view>
...
...
packageEquity/pages/carQuotation/index/index.wxss
View file @
d7a6003
...
...
@@ -778,7 +778,7 @@
.modatcontent {
box-sizing: border-box;
padding: var(--fontSize48)
0
;
padding: var(--fontSize48);
}
.modal text,
...
...
@@ -799,6 +799,41 @@
color: #347BFF;
}
.modal .icon {
width: var(--fontSize96);
height: var(--fontSize96);
margin-right: var(--fontSize30);
}
.modalbox {
display: flex;
align-items: center;
box-sizing: border-box;
width: var(--fontSize522);
height: var(--fontSize136);
background: #F7F8FA;
border-radius: var(--fontSize8);
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: var(--fontSize28);
color: #292D33;
padding-left: var(--fontSize24);
margin: 0 auto;
}
.modalbox:last-child {
margin-top: var(--fontSize16);
}
.act {
background: #347bff1a;
border: var(--fontSize2) solid #347BFF;
color: #3582EE;
}
.modatcontent {
padding: var(--fontSize50) var(--fontSize48) var(--fontSize32);
}
.copy_icon {
width: var(--fontSize28);
height: var(--fontSize28);
...
...
pages/webView/webView.js
View file @
d7a6003
...
...
@@ -72,15 +72,30 @@ Page({
}
},
handleMessage
(
e
)
{
const
{
data
}
=
e
.
detail
;
// 将数据返回给跳转来源
if
(
data
)
{
const
eventChannel
=
this
.
getOpenerEventChannel
();
eventChannel
.
emit
(
'webViewMessage'
,
data
[
0
]);
// 发送数据
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
let
{
url
}
=
this
.
data
if
(
this
.
refresh
)
{
this
.
setData
({
flag
:
false
})
}
// 中邮上传延保协议页面
if
(
url
.
includes
(
'zyUpload'
))
{
const
eventChannel
=
this
.
getOpenerEventChannel
();
eventChannel
.
emit
(
'webViewMessage'
,
'cancel'
);
// 发送数据
}
},
/**
...
...
pages/webView/webView.wxml
View file @
d7a6003
<!-- <web-view src="{{url}}"></web-view> -->
<block wx:if="{{flag}}">
<web-view src="{{url}}"></web-view>
<web-view src="{{url}}"
bindmessage="handleMessage"
></web-view>
</block>
\ No newline at end of file
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