Commit 27fa9bd0 by 张立顺

bug修复

1 parent aa501146
...@@ -54,6 +54,9 @@ App({ ...@@ -54,6 +54,9 @@ App({
}, },
login(relogin, context) { login(relogin, context) {
// debugger // debugger
// util.debounce( this.test,1000)
// return
// console.log(relogin, 'relogin') // console.log(relogin, 'relogin')
let that = this let that = this
// 清空多账号信息 // 清空多账号信息
...@@ -78,6 +81,9 @@ App({ ...@@ -78,6 +81,9 @@ App({
} }
}) })
} else { } else {
// 标志位 解决安卓查复弹框问题
if (wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOTLOGIN_MODAL = true
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
content: context || '登录过期,请重新登录。', content: context || '登录过期,请重新登录。',
...@@ -92,6 +98,13 @@ App({ ...@@ -92,6 +98,13 @@ App({
wx.$relogin = relogin wx.$relogin = relogin
router.reLaunch('pages.wxLogin') router.reLaunch('pages.wxLogin')
} }
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOTLOGIN_MODAL = false;
}, 2000);
} }
}) })
} }
...@@ -104,12 +117,77 @@ App({ ...@@ -104,12 +117,77 @@ App({
router.reLaunch('pages.wxLogin') router.reLaunch('pages.wxLogin')
} }
}, },
test (){
// console.log('loginOut');
// this.debounceWithParams()
const count = this.globalData.count
console.log(this.globalData.count);
let that = this
console.log(this.globalData.count,'globalData.count');
if (count) {
clearTimeout(this.globalData.count)
this.globalData.count = setTimeout(()=>{
// console.log('object');
console.log(that.globalData.count);
that.globalData.count = null
console.log('that.globalData.count',that.globalData.count);
},2000)
}else{
this.globalData.count = setTimeout(()=>{
// console.log('object');
console.log(that.globalData.count);
that.globalData.count = null
console.log('that.globalData.count',that.globalData.count);
},2000)
}
// globalData.count = setTimeout(()=>{
// console.log('object');
// console.log(globalData.count);
// },2000)
// globalData.count++
// setTimeout
// let timeCount
// console.log(timeCount);
// if (timeCount) {
// clearTimeout(timeCount)
// timeCount = setTimeout(()=>{
// console.log('这是一个寂寞的天');
// },1000)
// }else{
// timeCount = setTimeout(()=>{
// console.log('这是一个寂寞的天');
// },1000)
// }
// function doSomething() {
// console.log("Doing something!");
// }
// const debouncedDoSomething = util.debounce(doSomething, 500, false);
// debouncedDoSomething()
},
debounceWithParams(callback, delay) {
let timeoutId; // 用于保存定时器ID
return function (...args) {
const executeLater = function () {
// 定义一个延迟执行的函数
timeoutId = null; // 清空定时器ID,用于标记函数可以再次执行
callback(...args); // 执行回调函数,并将参数传递给回调函数
};
clearTimeout(timeoutId); // 清除之前的定时器
timeoutId = setTimeout(executeLater, delay); // 创建一个新的定时器
};
},
globalData: { globalData: {
statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], // 头部导航栏的高度 statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], // 头部导航栏的高度
yqdInfo: {}, yqdInfo: {},
isYqdSuper: true, isYqdSuper: true,
isStaff: false, isStaff: false,
YQorderSetting: '' YQorderSetting: '',
count:'',
} }
}) })
...@@ -94,10 +94,11 @@ Component({ ...@@ -94,10 +94,11 @@ Component({
let value = e.detail let value = e.detail
let { attr, item } = e.target.dataset let { attr, item } = e.target.dataset
let { dataAttrName } = this.data let { dataAttrName } = this.data
if (attr == 'price') { // if (attr == 'price') {
value = value >= 2000000 ? '2000000' : value // value = value >= 2000000 ? '2000000' : value
wx.$eventbus.emit('delete_goodsSelect') // // wx.$eventbus.emit('delete_goodsSelect')
} // }
// console.log(item,'handleInput');
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
if (item.inputLimit && item.inputLimit.maxVal) { if (item.inputLimit && item.inputLimit.maxVal) {
value = value >= item.inputLimit.maxVal ? item.inputLimit.maxVal : value value = value >= item.inputLimit.maxVal ? item.inputLimit.maxVal : value
...@@ -113,9 +114,14 @@ Component({ ...@@ -113,9 +114,14 @@ Component({
value = number value = number
} }
} }
const diffValue = value.toString()
const trimValue = value.toString().trim()
if (diffValue != trimValue) {
value = trimValue
}
thisPage.setData({ thisPage.setData({
[dataAttrName + '.' + attr]: value.toString().trim() [dataAttrName + '.' + attr]: value
// [dataAttrName + '.' + attr]: value
}) })
}, },
handlePickerChange(e) { handlePickerChange(e) {
......
...@@ -215,6 +215,7 @@ Page({ ...@@ -215,6 +215,7 @@ Page({
userInfo: { ...wx.$util.getUserInfo(), default4SStoreInfo } userInfo: { ...wx.$util.getUserInfo(), default4SStoreInfo }
}) })
this.getMerchant4SMode() this.getMerchant4SMode()
this.initList()
}, },
initList() { initList() {
let { tabIndex } = this.data let { tabIndex } = this.data
......
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"custom-content": "/components/ContentHiden/content"
} }
} }
...@@ -72,6 +72,9 @@ Component({ ...@@ -72,6 +72,9 @@ Component({
formRule[item][0].required = false formRule[item][0].required = false
}) })
} }
this.setData({
formRule
})
}, },
// 删除图片 // 删除图片
......
...@@ -57,13 +57,18 @@ Component({ ...@@ -57,13 +57,18 @@ Component({
*/ */
methods: { methods: {
dealFormRule() { dealFormRule() {
var { formData, formRule } = this.data let formData = this.getPageData()
var { formRule } = this.data
const list = ['tireBrand', 'frontTireSpecification', 'rearTireSpecification'] const list = ['tireBrand', 'frontTireSpecification', 'rearTireSpecification']
if(formData && formData.tireFlag == 0) { if(formData && formData.tireFlag == 0) {
list.forEach(item => { list.forEach(item => {
formRule[item][0].required = false formRule[item][0].required = false
}) })
} }
console.log(formRule);
this.setData({
formRule
})
}, },
handleUpDown(e) { handleUpDown(e) {
let { attr } = e.currentTarget.dataset let { attr } = e.currentTarget.dataset
......
...@@ -36,9 +36,10 @@ page { ...@@ -36,9 +36,10 @@ page {
.prevIcon { .prevIcon {
margin-left: auto; margin-left: auto;
margin-right: 20prx;
}
}
.downloadIcon{
margin-left: 20prx;}
.icon { .icon {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
<!-- <image src="" binderror="" bindload=""></image> --> <!-- <image src="" binderror="" bindload=""></image> -->
<!-- <view class="arrow"></view> --> <!-- <view class="arrow"></view> -->
<view class="icon prevIcon" bindtap="handlePreviewContract" data-target="{{ item }}"> <view class="icon prevIcon" bindtap="handlePreviewContract" data-target="{{ item }}">
<image webp="{{ true }}" src="../../image/previewIcon.webp" mode="" binderror="" bindload=""></image> <image wepb="true" src="../../image/previewIcon.png" mode="" binderror="" bindload=""></image>
</view> </view>
<view class="icon" bindtap="handlePreviewContract" data-target="{{ item }}" data-type="download"> <view class="icon downloadIcon" bindtap="handlePreviewContract" data-target="{{ item }}" data-type="download">
<image webp="{{ true }}" src="../../image/downloadIcon.webp" mode="" binderror="" bindload=""></image> <image wepb="true" src="../../image/downloadIcon.png" mode="" binderror="" bindload=""></image>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -33,6 +33,9 @@ Page({ ...@@ -33,6 +33,9 @@ Page({
}, },
selectPayType: 1 selectPayType: 1
}, },
back() {
wx.$router.back()
},
async changePayType(e) { async changePayType(e) {
console.log(e) console.log(e)
// pos支付 // pos支付
......
...@@ -20,7 +20,6 @@ Component({ ...@@ -20,7 +20,6 @@ Component({
}, },
minPrice: { minPrice: {
type: Number type: Number
// value:0
} }
}, },
...@@ -29,53 +28,72 @@ Component({ ...@@ -29,53 +28,72 @@ Component({
*/ */
data: { data: {
goodsList: [], goodsList: [],
test: () => { recordList: [],
return false // totalGoodsList:[],
}
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
cancel (){
let {goodsData} = this.data
this.setData({
goodsList: goodsData,
})
this.setGoodsActive()
},
setGoodsActive() { setGoodsActive() {
let { chooseGoodsList, goodsList } = this.data let {
chooseGoodsList,
goodsList,
recordList
} = this.data
if (chooseGoodsList.length == 0) { if (chooseGoodsList.length == 0) {
goodsList.forEach(e => { goodsList.forEach(e => {
e.active = false e.active = false
// e.map(c => (c.active = false)) })
recordList.forEach(e => {
e.active = false
}) })
} else { } else {
// let indexList = [] // let indexList = []
// debugger
goodsList.map((e, index) => { goodsList.map((e, index) => {
// e.upgradeGoodsList.map((c, ind) => {
e.active = false e.active = false
chooseGoodsList.map(s => { chooseGoodsList.map(s => {
console.log(s.goodsId == e.id, 's.id == e.id')
if (s.goodsId == e.id) { if (s.goodsId == e.id) {
e.active = true e.active = true
} }
}) })
// })
}) })
// indexList.map(e => { recordList.map((e, index) => {
// goodsList[e.index].upgradeGoodsList[e.ind].active = true e.active = false
// }) chooseGoodsList.map(s => {
if (s.goodsId == e.id) {
e.active = true
}
})
})
} }
this.setData({ this.setData({
goodsList goodsList,
recordList
}) })
}, },
getOrderBaseGoodsList(data) { getOrderBaseGoodsList(data) {
this.setData({ this.setData({
goodsList: data goodsList: data,
recordList: data
}) })
}, },
getChooseList() { getChooseList() {
let { goodsList, chooseGoodsList } = this.data let {
// goodsList,
recordList,
chooseGoodsList
} = this.data
let chooseList = [] let chooseList = []
goodsList.map(c => { recordList.map(c => {
// e.upgradeGoodsList.map(c => { // e.upgradeGoodsList.map(c => {
if (c.active) { if (c.active) {
if (!c.count) c.count = 1 if (!c.count) c.count = 1
...@@ -98,9 +116,18 @@ Component({ ...@@ -98,9 +116,18 @@ Component({
return chooseList return chooseList
}, },
choose(e) { choose(e) {
let { item, index, ind } = e.currentTarget.dataset let {
let { active } = item item,
let { minPrice } = this.data index,
ind
} = e.currentTarget.dataset
let {
active
} = item
let {
minPrice,
recordList
} = this.data
// item // item
// console.log(item) // console.log(item)
// console.log(minPrice) // console.log(minPrice)
...@@ -111,12 +138,20 @@ Component({ ...@@ -111,12 +138,20 @@ Component({
// 太阳膜类商品 未配置部位不可选择 // 太阳膜类商品 未配置部位不可选择
// if (item?.goodsInfo?.goodsType == 1 && !item.merchantGoodsPosition) return false // if (item?.goodsInfo?.goodsType == 1 && !item.merchantGoodsPosition) return false
let target = `goodsList[${ind}].active` let target = `goodsList[${ind}].active`
let recordIndex = recordList.findIndex(el=>el.id == item.id )
this.setData({ this.setData({
[`recordList[${recordIndex}].active`]:!active,
[target]: !active [target]: !active
}) })
}, },
addCount(e) { addCount(e) {
let { index, count, item, ind } = e.currentTarget.dataset let {
index,
count,
item,
ind
} = e.currentTarget.dataset
let target = `goodsList[${index}].upgradeGoodsList[${ind}].count` let target = `goodsList[${index}].upgradeGoodsList[${ind}].count`
if (!item.count) item.count = 1 if (!item.count) item.count = 1
item.count += count item.count += count
...@@ -127,9 +162,14 @@ Component({ ...@@ -127,9 +162,14 @@ Component({
}) })
}, },
input(e) { input(e) {
let { index, ind } = e.currentTarget.dataset let {
index,
ind
} = e.currentTarget.dataset
let target = `goodsList[${index}].upgradeGoodsList[${ind}].count` let target = `goodsList[${index}].upgradeGoodsList[${ind}].count`
let { value } = e.detail let {
value
} = e.detail
if (value < 1) value = 1 if (value < 1) value = 1
if (value > 999) value = 999 if (value > 999) value = 999
this.setData({ this.setData({
...@@ -137,16 +177,21 @@ Component({ ...@@ -137,16 +177,21 @@ Component({
}) })
}, },
searchGoods(e) { searchGoods(e) {
let { goodsData } = this.data let {
let { value } = e.detail goodsData,
recordList
} = this.data
let {
value
} = e.detail
if (!value) { if (!value) {
this.getOrderBaseGoodsList(goodsData) this.getOrderBaseGoodsList(recordList)
setTimeout(() => { // setTimeout(() => {
this.setGoodsActive() // this.setGoodsActive()
}, 500) // }, 500)
return return
} }
let _DATA_ = JSON.parse(JSON.stringify(goodsData)) let _DATA_ = JSON.parse(JSON.stringify(recordList))
let arr = [] let arr = []
_DATA_.map(c => { _DATA_.map(c => {
let upgradeGoodsList = [] let upgradeGoodsList = []
...@@ -170,7 +215,9 @@ Component({ ...@@ -170,7 +215,9 @@ Component({
confirm() { confirm() {
let chooseList = this.getChooseList() let chooseList = this.getChooseList()
let { goodsList } = this.data let {
goodsList
} = this.data
if (goodsList.length < 1) return if (goodsList.length < 1) return
if (!chooseList.length) return wx.$util.showToast('请勾选商品') if (!chooseList.length) return wx.$util.showToast('请勾选商品')
this.triggerEvent('confirm', chooseList) this.triggerEvent('confirm', chooseList)
......
<wxs src="index.wxs" module="filter" /> <wxs src="index.wxs" module="filter" />
<popup show="{{show}}" title="选择商品" bindconfirm="confirm"> <popup show="{{show}}" title="选择商品" bindconfirm="confirm" bindcancel="cancel">
<view class="coupon-box"> <view class="coupon-box">
<search-input bindsearch="searchGoods" /> <search-input bindsearch="searchGoods" />
<scroll-view class="coupon" scroll-y> <scroll-view class="coupon" scroll-y>
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
data-ind="{{ind}}" data-ind="{{ind}}"
data-item="{{i}}"> data-item="{{i}}">
<view class="name text-hide "> <view class="name text-hide ">
<view>{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</view> <!-- filter.replaceItemText(i.upgradeGoodsAlias) || -->
<view>{{filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</view>
<!-- <text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text> --> <!-- <text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text> -->
<view class="serveName">(包含{{i.serveName}})</view> <view class="serveName">(包含{{i.serveName}})</view>
<!-- <text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text> --> <!-- <text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text> -->
......
...@@ -119,7 +119,7 @@ Component({ ...@@ -119,7 +119,7 @@ Component({
} }
console.log(item.shopMinPrice||0,'item?.shopMinPrice||0'); console.log(item.shopMinPrice||0,'item?.shopMinPrice||0');
if ((item.shopMinPrice||0) > value) { if ((item.shopMinPrice||0) > value) {
wx.$util.showToast('单价不可低于商品最低价') return wx.$util.showToast('单价不可低于商品最低价')
} }
thisPage.setData({ thisPage.setData({
...@@ -142,9 +142,10 @@ Component({ ...@@ -142,9 +142,10 @@ Component({
setGoodsListTotal () { setGoodsListTotal () {
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
let {orderInfo} = thisPage.data let {orderInfo} = thisPage.data
// console.log(orderInfo,'orderInfo');
let total = 0 let total = 0
orderInfo.vdQuotationGoodsList.map(i => (total += i.count * i.price)) orderInfo.vdQuotationGoodsList.map(i => (total += parseFloat(i.count||1) * parseFloat(i.price)))
// console.log(total,'total');
thisPage.setData({ thisPage.setData({
['orderInfo.total']:wx.$util.decimal(total, 2) ['orderInfo.total']:wx.$util.decimal(total, 2)
}) })
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
"van-collapse-item": "@vant/weapp/collapse-item/index", "van-collapse-item": "@vant/weapp/collapse-item/index",
"van-checkbox": "@vant/weapp/checkbox/index", "van-checkbox": "@vant/weapp/checkbox/index",
"popup-input": "../PopupInput/PopupInput", "popup-input": "../PopupInput/PopupInput",
"custom-content": "/components/ContentHiden/content",
"goods": "../Goods/Goods" "goods": "../Goods/Goods"
} }
} }
...@@ -2,91 +2,124 @@ import constantList from './constantList' ...@@ -2,91 +2,124 @@ import constantList from './constantList'
import data from './data' import data from './data'
const formRule = { const formRule = {
owner: [{ required: true, message: '姓名不能为空' }], owner: [{
phone: [ required: true,
{ required: true, message: '联系电话不能为空' }, message: '姓名不能为空'
}],
phone: [{
required: true,
message: '联系电话不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return !data.phoneRex.test(value) ? { message: '请输入正确的手机号' } : null return !data.phoneRex.test(value) ? {
message: '请输入正确的手机号'
} : null
} }
} }
], ],
certificateNo: [ certificateNo: [{
{
validator: (rule, value) => { validator: (rule, value) => {
if (value) { if (value) {
return value.length != 18 ? { message: '请输入正确的18位证件号' } : null return value.length != 18 ? {
} message: '请输入正确的18位证件号'
} : null
} }
} }
], }],
carVin: [ carVin: [{
{ required: true, message: '车架号不能为空' }, required: true,
message: '车架号不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return value.length != 17 ? { message: '请输入正确的17位车架号' } : null return value.length != 17 ? {
message: '请输入正确的17位车架号'
} : null
} }
} }
], ],
seat: [{ required: true, message: '座位数不能为空' }], seat: [{
price: [ required: true,
{ required: true, message: '车辆发票价不能为空' }, message: '座位数不能为空'
}],
price: [{
required: true,
message: '车辆发票价不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return value > 2000000 ? { message: '车辆发票价最高不能超过200万' } : null return value > 2000000 ? {
message: '车辆发票价最高不能超过200万'
} : null
} }
} }
] ]
} }
const formRuleSimple = { const formRuleSimple = {
owner: [{ required: true, message: '姓名不能为空' }], owner: [{
phone: [ required: true,
{ required: true, message: '联系电话不能为空' }, message: '姓名不能为空'
}],
phone: [{
required: true,
message: '联系电话不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return !data.phoneRex.test(value) ? { message: '请输入正确的手机号' } : null return !data.phoneRex.test(value) ? {
message: '请输入正确的手机号'
} : null
} }
} }
], ],
certificateNo: [ certificateNo: [{
{
validator: (rule, value) => { validator: (rule, value) => {
if (value) { if (value) {
return value.length != 18 ? { message: '请输入正确的18位证件号' } : null return value.length != 18 ? {
message: '请输入正确的18位证件号'
} : null
} }
} }
} }],
],
carVin: [ carVin: [
// { required: true, message: '车架号不能为空' }, // { required: true, message: '车架号不能为空' },
{ {
validator: (rule, value) => { validator: (rule, value) => {
return value?value.length != 17 ? { message: '请输入正确的17位车架号' } : null:null return value ? value.length != 17 ? {
message: '请输入正确的17位车架号'
} : null : null
} }
} }
], ],
seat: [{ required: true, message: '座位数不能为空' }], seat: [{
price: [ required: true,
{ required: true, message: '车辆发票价不能为空' }, message: '座位数不能为空'
}],
price: [{
required: true,
message: '车辆发票价不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return value > 2000000 ? { message: '车辆发票价最高不能超过200万' } : null return value > 2000000 ? {
message: '车辆发票价最高不能超过200万'
} : null
} }
} }
] ]
} }
const firstObj = { const firstObj = {
customerFormList: [ customerFormList: [{
{
label: '姓名', label: '姓名',
name: 'owner', name: 'owner',
type: 'input', type: 'input',
maxlength: '10', maxlength: '10',
noCellHeight: true, noCellHeight: true,
fieldType: 'textarea', fieldType: 'textarea',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
label: '联系电话', label: '联系电话',
...@@ -94,8 +127,8 @@ const firstObj = { ...@@ -94,8 +127,8 @@ const firstObj = {
type: 'input', type: 'input',
fieldType: 'number', fieldType: 'number',
maxlength: '11', maxlength: '11',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
label: '证件号码', label: '证件号码',
...@@ -105,14 +138,13 @@ const firstObj = { ...@@ -105,14 +138,13 @@ const firstObj = {
placeholder: '请输入(非必填)' placeholder: '请输入(非必填)'
} }
], ],
carFormList: [ carFormList: [{
{
label: '车架号', label: '车架号',
name: 'carVin', name: 'carVin',
type: 'input', type: 'input',
maxlength: '17', maxlength: '17',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
...@@ -130,24 +162,25 @@ const firstObj = { ...@@ -130,24 +162,25 @@ const firstObj = {
type: 'input', type: 'input',
fieldType: 'digit', fieldType: 'digit',
maxlength: '8', maxlength: '8',
required:true, required: true,
requiredAfter:true, requiredAfter: true,
labelWidth:80 labelWidth: 80,
// fieldType: 'digit' inputLimit: {
maxVal: 2000000
}
} }
] ]
} }
const firstObjSimple = { const firstObjSimple = {
customerFormList: [ customerFormList: [{
{
label: '姓名', label: '姓名',
name: 'owner', name: 'owner',
type: 'input', type: 'input',
maxlength: '10', maxlength: '10',
noCellHeight: true, noCellHeight: true,
fieldType: 'textarea', fieldType: 'textarea',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
label: '联系电话', label: '联系电话',
...@@ -155,8 +188,8 @@ const firstObjSimple = { ...@@ -155,8 +188,8 @@ const firstObjSimple = {
type: 'input', type: 'input',
fieldType: 'number', fieldType: 'number',
maxlength: '11', maxlength: '11',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
label: '证件号码', label: '证件号码',
...@@ -166,8 +199,7 @@ const firstObjSimple = { ...@@ -166,8 +199,7 @@ const firstObjSimple = {
placeholder: '请输入(非必填)' placeholder: '请输入(非必填)'
} }
], ],
carFormList: [ carFormList: [{
{
label: '车架号', label: '车架号',
name: 'carVin', name: 'carVin',
type: 'input', type: 'input',
...@@ -191,16 +223,18 @@ const firstObjSimple = { ...@@ -191,16 +223,18 @@ const firstObjSimple = {
type: 'input', type: 'input',
fieldType: 'digit', fieldType: 'digit',
maxlength: '8', maxlength: '8',
required:true, required: true,
requiredAfter:true, requiredAfter: true,
labelWidth:80 labelWidth: 80,
inputLimit: {
maxVal: 2000000
}
// fieldType: 'digit' // fieldType: 'digit'
} }
] ]
} }
const optionsSelect = { const optionsSelect = {
companyType: [ companyType: [{
{
label: '中国平安' label: '中国平安'
}, },
{ {
...@@ -210,8 +244,7 @@ const optionsSelect = { ...@@ -210,8 +244,7 @@ const optionsSelect = {
label: '中国人保' label: '中国人保'
} }
], ],
thirdPartType: [ thirdPartType: [{
{
value: 1, value: 1,
label: '100万' label: '100万'
}, },
...@@ -232,8 +265,7 @@ const optionsSelect = { ...@@ -232,8 +265,7 @@ const optionsSelect = {
label: '500万' label: '500万'
} }
], ],
busRideDriverType: [ busRideDriverType: [{
{
value: 1, value: 1,
label: '1万' label: '1万'
}, },
...@@ -246,8 +278,7 @@ const optionsSelect = { ...@@ -246,8 +278,7 @@ const optionsSelect = {
label: '5万' label: '5万'
} }
], ],
busRideFareType: [ busRideFareType: [{
{
value: 1, value: 1,
label: '1万' label: '1万'
}, },
......
...@@ -57,9 +57,9 @@ const scrmSecretKey_items = { ...@@ -57,9 +57,9 @@ const scrmSecretKey_items = {
const domain_items = { const domain_items = {
ip: { ip: {
// dj: 'http://192.168.1.165:8292', // dj: 'http://192.168.1.165:8292',
// dj: 'http://192.168.1.170:8292', //叶立庆 dj: 'http://192.168.1.170:8292', //叶立庆
// dj: 'http://192.168.1.169:8292',//蔡远明 // dj: 'http://192.168.1.169:8292',//蔡远明
dj: 'http://192.168.1.174:8292',//范富荣 // dj: 'http://192.168.1.174:8292',//范富荣
// dj: 'http://192.168.1.203:8292',//周杭 // dj: 'http://192.168.1.203:8292',//周杭
// dj: 'http://192.168.1.53:8292',//陈希 // dj: 'http://192.168.1.53:8292',//陈希
// dj:'http://192.168.2.59:8292/',//周立明 // dj:'http://192.168.2.59:8292/',//周立明
......
...@@ -48,11 +48,6 @@ class Request { ...@@ -48,11 +48,6 @@ class Request {
getApp().login(true) getApp().login(true)
} }
} }
// else if (code == 32){
// resolve(data)
// // console.log(subErrors);
// throw subErrors
// }
else if (code == -1) { else if (code == -1) {
wx.showToast({ wx.showToast({
title: message || '网络请求失败', title: message || '网络请求失败',
...@@ -60,6 +55,8 @@ class Request { ...@@ -60,6 +55,8 @@ class Request {
}) })
resolve(data) resolve(data)
} else { } else {
// util.debounce( getApp().test(true),500)
// getApp().test()
resolve(data) resolve(data)
} }
}, },
......
...@@ -226,6 +226,38 @@ const pointRecord = clickEventType => { ...@@ -226,6 +226,38 @@ const pointRecord = clickEventType => {
console.log('burialPointRecord', res) console.log('burialPointRecord', res)
}) })
} }
/**
* 函数防抖:在指定的时间内,如果连续触发事件,则只执行一次,避免频繁触发。
* @param {Function} func - 要防抖的函数。
* @param {number} delay - 防抖的时间间隔,单位毫秒。
* @param {boolean} immediate - 是否立即执行一次。若为true,第一次触发会立即执行一次函数。
* @returns {Function} - 返回一个经过防抖处理的函数。
*/
const debounce = (func, delay, immediate)=> {
let timeoutId; // 用于保存定时器ID
return function (...args) {
const context = this; // 保存函数执行时的上下文环境
const executeLater = function () {
// 定义一个延迟执行的函数
timeoutId = null; // 清空定时器ID,用于标记函数可以再次执行
if (!immediate) {
// 如果不是立即执行模式,则执行函数
func.apply(context, args);
}
};
const callNow = immediate && !timeoutId; // 是否立即执行的条件
clearTimeout(timeoutId); // 清除之前的定时器
timeoutId = setTimeout(executeLater, delay); // 创建一个新的定时器
if (callNow) {
// 如果满足立即执行的条件,则立即执行函数
func.apply(context, args);
}
};
}
const util = { const util = {
onReachBottom, onReachBottom,
...@@ -247,7 +279,8 @@ const util = { ...@@ -247,7 +279,8 @@ const util = {
deepClone, deepClone,
getTimeState, getTimeState,
checkRule, checkRule,
pointRecord pointRecord,
debounce
} }
const Util = Object.assign(util, wxApi, format) const Util = Object.assign(util, wxApi, format)
// console.log('Util', Util) // console.log('Util', Util)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!