Commit b658abc4 by 张立顺

组件调整

1 parent 88be25cd
Showing 23 changed files with 87 additions and 66 deletions
...@@ -97,7 +97,6 @@ ...@@ -97,7 +97,6 @@
"remark-popup": "/components/RemarkPopup/RemarkPopup", "remark-popup": "/components/RemarkPopup/RemarkPopup",
"tab-bar": "/components/TabBar/TabBar", "tab-bar": "/components/TabBar/TabBar",
"order-confirm": "/components/Confirm/Confirm", "order-confirm": "/components/Confirm/Confirm",
"account-switch": "components/accountSwitch/accountSwitch",
"qr-box": "components/Qrbox/Qrbox", "qr-box": "components/Qrbox/Qrbox",
"modal": "components/modal/modal", "modal": "components/modal/modal",
"shareModal": "components/shareModal/shareModal", "shareModal": "components/shareModal/shareModal",
......
// components/accountSwitch.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
<!--components/accountSwitch.wxml-->
<text>components/accountSwitch.wxml</text>
/* components/accountSwitch.wxss */
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
...@@ -123,7 +123,10 @@ Page({ ...@@ -123,7 +123,10 @@ Page({
}, },
getDetail() { getDetail() {
let { routeInfo, apiObj } = this.data let {
routeInfo,
apiObj
} = this.data
if (!routeInfo?.apiName) { if (!routeInfo?.apiName) {
return return
} }
...@@ -152,14 +155,36 @@ Page({ ...@@ -152,14 +155,36 @@ Page({
// ocr图片识别 // ocr图片识别
reWrite(type, data) { reWrite(type, data) {
console.log(type, data) console.log(type, data)
let { serviceInfo } = this.data let {
serviceInfo
} = this.data
if (type == 'vehicleCertificate') { if (type == 'vehicleCertificate') {
let { vinNo: vin, seatingCapacity: seatesNum, engineNo: engineNo, carColor: vehicleColor } = data let {
serviceInfo = Object.assign(serviceInfo, { vin, seatesNum, engineNo, vehicleColor }) vinNo: vin,
seatingCapacity: seatesNum,
engineNo: engineNo,
carColor: vehicleColor
} = data
serviceInfo = Object.assign(serviceInfo, {
vin,
seatesNum,
engineNo,
vehicleColor
})
} }
if (type == 'idCard') { if (type == 'idCard') {
let { name: customerName, address: customerAddress, cardNo: cardNo } = data let {
serviceInfo = Object.assign(serviceInfo, { customerName, customerAddress, cardNo, customerType: 1, customerTypeName: '个人' }) name: customerName,
address: customerAddress,
cardNo: cardNo
} = data
serviceInfo = Object.assign(serviceInfo, {
customerName,
customerAddress,
cardNo,
customerType: 1,
customerTypeName: '个人'
})
console.log(serviceInfo, 'serviceInfo') console.log(serviceInfo, 'serviceInfo')
} }
...@@ -196,7 +221,9 @@ Page({ ...@@ -196,7 +221,9 @@ Page({
draft: 0, draft: 0,
confirm: 1 confirm: 1
} }
let { serviceInfo } = this.data let {
serviceInfo
} = this.data
let type = e.detail?.type || 'draft' let type = e.detail?.type || 'draft'
let params = this.dealComfirmData(JSON.parse(JSON.stringify(serviceInfo))) let params = this.dealComfirmData(JSON.parse(JSON.stringify(serviceInfo)))
// 0草稿,1提单 // 0草稿,1提单
...@@ -221,16 +248,23 @@ Page({ ...@@ -221,16 +248,23 @@ Page({
// 错误跳转 // 错误跳转
handleErrorJump(e) { handleErrorJump(e) {
let { height } = e.detail let {
height
} = e.detail
this.setData({ this.setData({
scrollTop: height // 滚动到的位置(距离顶部 px) scrollTop: height // 滚动到的位置(距离顶部 px)
}) })
}, },
handleSecondConfirm(e) { handleSecondConfirm(e) {
let { serviceInfo, conSecondObj } = this.data let {
serviceInfo,
conSecondObj
} = this.data
if (e.detail?.type == 'confirm') { if (e.detail?.type == 'confirm') {
carLifeApi.checkVin({ vin: serviceInfo.vin }).then(res => { carLifeApi.checkVin({
vin: serviceInfo.vin
}).then(res => {
if (res.code == '0') { if (res.code == '0') {
this.confirm(e) this.confirm(e)
} else if (res.code == '-2') { } else if (res.code == '-2') {
...@@ -262,7 +296,9 @@ Page({ ...@@ -262,7 +296,9 @@ Page({
}, },
handleTipClick(e) { handleTipClick(e) {
let { type } = e.currentTarget.dataset let {
type
} = e.currentTarget.dataset
if (type == 'success') { if (type == 'success') {
this.getUrl() this.getUrl()
return true return true
...@@ -276,7 +312,9 @@ Page({ ...@@ -276,7 +312,9 @@ Page({
}, },
handleTipClose(e) { handleTipClose(e) {
let { type } = e.currentTarget.dataset let {
type
} = e.currentTarget.dataset
if (type == 'success') { if (type == 'success') {
this.getUrl() this.getUrl()
return true return true
...@@ -308,7 +346,9 @@ Page({ ...@@ -308,7 +346,9 @@ Page({
}, },
handleDownload() { handleDownload() {
let { url } = this.data let {
url
} = this.data
let _this = this let _this = this
if (!url) { if (!url) {
wx.$util.showToast('没有合同') wx.$util.showToast('没有合同')
...@@ -324,8 +364,7 @@ Page({ ...@@ -324,8 +364,7 @@ Page({
manage.saveFile({ manage.saveFile({
tempFilePath: res.tempFilePath, tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + "/" + fileName, filePath: wx.env.USER_DATA_PATH + "/" + fileName,
success: function (res) { success: function (res) {}
}
}) })
wx.openDocument({ wx.openDocument({
filePath: wx.env.USER_DATA_PATH + "/" + fileName, filePath: wx.env.USER_DATA_PATH + "/" + fileName,
...@@ -346,6 +385,7 @@ Page({ ...@@ -346,6 +385,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options, 'options');
this.setData({ this.setData({
userInfo: wx.$util.getStorageSync('dj_boutique_user_info') userInfo: wx.$util.getStorageSync('dj_boutique_user_info')
}) })
...@@ -355,25 +395,34 @@ Page({ ...@@ -355,25 +395,34 @@ Page({
// }) // })
// this.getDetail() // this.getDetail()
//删---end //删---end
wx.$router.getData(res => { // wx.$router.getData(res => {
this.setData({ // console.log(res);
routeInfo: res // this.setData({
}) // routeInfo: res
console.log(this.data.routeInfo) // })
this.getDetail() // // console.log(this.data.routeInfo)
// this.getDetail()
// })
},
onRoute(options) {
console.log(options);
this.setData({
routeInfo: options
}) })
this.getDetail()
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { }, onReady() {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
let { isBack } = this.data let {
isBack
} = this.data
if (isBack) { if (isBack) {
wx.$router.reLaunch('packageEquity.equityPage') wx.$router.reLaunch('packageEquity.equityPage')
} }
...@@ -382,25 +431,25 @@ Page({ ...@@ -382,25 +431,25 @@ Page({
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { }, onHide() {},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { }, onUnload() {},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { }, onPullDownRefresh() {},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { }, onReachBottom() {},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { } onShareAppMessage() {}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -176,6 +176,8 @@ Page({ ...@@ -176,6 +176,8 @@ Page({
// console.log(e.currentTarget.dataset) // console.log(e.currentTarget.dataset)
let { name } = e.detail let { name } = e.detail
console.log(name) console.log(name)
// this.navigator()
// return
this[name]() this[name]()
}, },
cancel() { cancel() {
...@@ -222,6 +224,7 @@ Page({ ...@@ -222,6 +224,7 @@ Page({
}, },
navigator() { navigator() {
let { orderId } = this.data let { orderId } = this.data
console.log(orderId,'orderId');
wx.$router.redirectTo('serviceInfo', { wx.$router.redirectTo('serviceInfo', {
orderId: orderId, orderId: orderId,
apiName: 'handler' apiName: 'handler'
......
{ {
"usingComponents": { "usingComponents": {
"auth-setting": "/components/authSetting/authSetting" "auth-setting": "../components/authSetting/authSetting"
} }
} }
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<!-- </block> --> <!-- </block> -->
{{title||'日期选择'}} {{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar"> <view class='calender-close' bindtap="showCalendar">
<image src="../images/close.png" class='calender-close-image' /> <image src="/images/close.png" class='calender-close-image' />
</view> </view>
</view> </view>
<block wx:if='{{showSubTitle}}'> <block wx:if='{{showSubTitle}}'>
......
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"CalendarMonth": "/components/CalendarMonth/CalendarMonth" "CalendarMonth": "../components/CalendarMonth/CalendarMonth"
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!