diff --git a/components/qn-data-picker/qn-data-picker.vue b/components/qn-data-picker/qn-data-picker.vue index fc3914a..3b9d2c1 100644 --- a/components/qn-data-picker/qn-data-picker.vue +++ b/components/qn-data-picker/qn-data-picker.vue @@ -239,7 +239,7 @@ export default { this._dispatchEvent(e) }, _processReadonly(dataList, value) { - var isTree = dataList.findIndex((item) => { + let isTree = dataList.findIndex((item) => { return item.children }) if (isTree > -1) { @@ -275,7 +275,7 @@ export default { } }, _filterForArray(data, valueArray) { - var result = [] + let result = [] for (let value of valueArray) { let found = data.find((item) => { return item.value == value diff --git a/components/qn-data-pickerview/qn-data-picker.js b/components/qn-data-pickerview/qn-data-picker.js index d326ccb..518dbfc 100644 --- a/components/qn-data-pickerview/qn-data-picker.js +++ b/components/qn-data-pickerview/qn-data-picker.js @@ -146,7 +146,7 @@ export default { created() { this.$watch( () => { - var al = [] + let al = [] ;[ 'pageCurrent', 'pageSize', @@ -368,7 +368,7 @@ export default { result.push(`${parentField} == null || ${parentField} == ""`) } if (selected.length) { - for (var i = 0; i < selected.length - 1; i++) { + for (let i = 0; i < selected.length - 1; i++) { result.push(`${parentField} == '${selected[i].value}'`) } } @@ -415,15 +415,15 @@ export default { return this.parentField && this.selfField }, _updateSelected() { - var dl = this.dataList - var sl = this.selected + let dl = this.dataList + let sl = this.selected let textField = this.map.text let valueField = this.map.value - for (var i = 0; i < sl.length; i++) { - var value = sl[i].value - var dl2 = dl[i] + for (let i = 0; i < sl.length; i++) { + let value = sl[i].value + let dl2 = dl[i] for (let d of dl2) { - var item2 = d + let item2 = d if (item2[valueField] === value) { sl[i].text = item2[textField] break @@ -465,8 +465,8 @@ export default { }) ) for (let path of paths) { - var value = path.value - var nodes = data.filter((item) => { + let value = path.value + let nodes = data.filter((item) => { return item.parent_value === value }) @@ -550,7 +550,7 @@ export default { this._treeData = [] this._extractTree(this.localdata, this._treeData) - var inputValue = this.dataValue + let inputValue = this.dataValue if (inputValue === undefined) { return } diff --git a/components/qn-datetime-picker/Calendar.js b/components/qn-datetime-picker/Calendar.js index 50e359f..e747b61 100644 --- a/components/qn-datetime-picker/Calendar.js +++ b/components/qn-datetime-picker/Calendar.js @@ -247,16 +247,16 @@ class Calendar { * @param {Object} end */ geDateAll(begin, end) { - var arr = [] - var ab = begin.split('-') - var ae = end.split('-') - var db = new Date() + let arr = [] + let ab = begin.split('-') + let ae = end.split('-') + let db = new Date() db.setFullYear(ab[0], ab[1] - 1, ab[2]) - var de = new Date() + let de = new Date() de.setFullYear(ae[0], ae[1] - 1, ae[2]) - var unixDb = db.getTime() - 24 * 60 * 60 * 1000 - var unixDe = de.getTime() - 24 * 60 * 60 * 1000 - for (var k = unixDb; k <= unixDe; ) { + let unixDb = db.getTime() - 24 * 60 * 60 * 1000 + let unixDe = de.getTime() - 24 * 60 * 60 * 1000 + for (let k = unixDb; k <= unixDe; ) { k = k + 24 * 60 * 60 * 1000 arr.push(this.getDate(new Date(parseInt(k))).fullDate) } diff --git a/pages/account-management/index.vue b/pages/account-management/index.vue index 9fcab90..1195e5c 100644 --- a/pages/account-management/index.vue +++ b/pages/account-management/index.vue @@ -74,7 +74,7 @@ export default { this.deleteId = item.id }, confirm() { - var params = { + let params = { id: this.deleteId, enterpriseId: this.$store.state.supplierInfo.id } diff --git a/pages/add-account/index.vue b/pages/add-account/index.vue index b66c6a3..9b0044d 100644 --- a/pages/add-account/index.vue +++ b/pages/add-account/index.vue @@ -133,7 +133,7 @@ export default { return } } - var params = { + let params = { ...this.form, enterpriseId: this.$store.state.supplierInfo.id // userId:this.$store.state.userInfo.userId, diff --git a/pages/add-paper/index.vue b/pages/add-paper/index.vue index 6a5b2f6..a2bffa1 100644 --- a/pages/add-paper/index.vue +++ b/pages/add-paper/index.vue @@ -396,7 +396,7 @@ export default { }, //获取详情 getDetailList() { - var params = { + let params = { mallSupplierIds: this.$store.state.supplierInfo.supplierId, productId: this.option.id } @@ -517,7 +517,7 @@ export default { sku.isPromoting = false } } - var params = { + let params = { ...this.form, isMainProduct: this.form.isMainProductRep === 0 ? true : false, skuList: this.skuList, diff --git a/pages/client-detail/news-item.nvue b/pages/client-detail/news-item.nvue index 18973ed..a134e8d 100644 --- a/pages/client-detail/news-item.nvue +++ b/pages/client-detail/news-item.nvue @@ -1,464 +1,480 @@ - - - - - - - {{tab.name}} - - - - - - - - - - - - {{tab.refreshText}} - - - - - - - {{tab.loadingText}} - - - - - - - - - - {{tab.loadingText}} - - - - - - + + + + {{ tab.name }} + + + + + + + + + + + + {{ tab.refreshText }} + + + + + + + {{ tab.loadingText }} + + + + + + + + + + {{ tab.loadingText }} + + + + + + diff --git a/pages/mall/index.vue b/pages/mall/index.vue index b3a5a24..f6e882f 100644 --- a/pages/mall/index.vue +++ b/pages/mall/index.vue @@ -108,7 +108,7 @@ export default { components: { uGap, noData, notLogged }, filters: { timeFilter(value) { - var abs = '' + let abs = '' if (value) { abs = getTimer(value) } @@ -181,28 +181,24 @@ export default { }, // 获取上新商品数量 getSupplier(id) { - storeDetail(id) - .then((res) => { - if (res) { - this.storeInfo = res - this.$set(this.storeInformation, 'productNumber', res.productNumber) - this.$set(this.storeInformation, 'currentProductNumber', res.currentProductNumber) - this.$set(this.storeInformation, 'name', res.name) - if (!res.logo) { - this.logo = '/static/imgs/mine/user-avatar.png' - } else { - this.logo = res.logo - } - if (!res.backgroundImg) { - this.backgroundStyle = 'background: url("/static/imgs/mall/top-bg.png") no-repeat;' - } else { - this.backgroundStyle = 'background: url(' + res.backgroundImg + ') no-repeat;' - } + storeDetail(id).then((res) => { + if (res) { + this.storeInfo = res + this.$set(this.storeInformation, 'productNumber', res.productNumber) + this.$set(this.storeInformation, 'currentProductNumber', res.currentProductNumber) + this.$set(this.storeInformation, 'name', res.name) + if (!res.logo) { + this.logo = '/static/imgs/mine/user-avatar.png' + } else { + this.logo = res.logo } - }) - .catch((err) => { - reject(err) - }) + if (!res.backgroundImg) { + this.backgroundStyle = 'background: url("/static/imgs/mall/top-bg.png") no-repeat;' + } else { + this.backgroundStyle = 'background: url(' + res.backgroundImg + ') no-repeat;' + } + } + }) }, // 获取纸品列表 queryData() { @@ -252,14 +248,14 @@ export default { }, // 按钮点击事件 nativeTo() { - var params = { + let params = { title: '添加纸品' } go2('add-paper', params) }, // 编辑事件 editPaper(item) { - var params = { + let params = { ...item, title: '编辑纸品' } @@ -275,7 +271,7 @@ export default { }, // 上下架事件 productStatusChange(item) { - var params = { + let params = { id: item.id, status: item.status === 30111 ? 30112 : 30111 } diff --git a/pages/mall/no-data.vue b/pages/mall/no-data.vue index a47f47f..6e8ecb9 100644 --- a/pages/mall/no-data.vue +++ b/pages/mall/no-data.vue @@ -23,7 +23,7 @@ export default { methods: { // 按钮点击事件 nativeTo() { - var params = { + let params = { title: '添加纸品' } go2('add-paper', params) diff --git a/pages/message/system-message.vue b/pages/message/system-message.vue index 22e1ce7..8c0c92c 100644 --- a/pages/message/system-message.vue +++ b/pages/message/system-message.vue @@ -5,7 +5,7 @@ - {{ item.messageType | meesageTypeFilter }} + {{ item.messageType | messageTypeFilter }} {{ item.createTime }} @@ -37,8 +37,8 @@ export default { } }, filters: { - meesageTypeFilter(value) { - var mes = '' + messageTypeFilter(value) { + let mes = '' if (value) { switch (value) { case 1: @@ -73,8 +73,8 @@ export default { systemMessageList({ ...this.pagination }) .then((res) => { if (res) { - var data = res.records - var count = 0 + let data = res.records + let count = 0 for (let item of data) { if (item.readOrNot === 0) { count = count + 1 @@ -118,13 +118,13 @@ export default { this.$refs.messageRef.refreshFail() }) }, - allread() { + allRead() { return new Promise((resolve, reject) => { - var meesage = this.list.map((item) => { + let message = this.list.map((item) => { return item.id }) - var params = { - messageIds: meesage + let params = { + messageIds: message } systemRead(params) .then((res) => { diff --git a/pages/paper-detail/index.vue b/pages/paper-detail/index.vue index 39a1ccc..b91acf3 100644 --- a/pages/paper-detail/index.vue +++ b/pages/paper-detail/index.vue @@ -146,7 +146,7 @@ export default { back, //获取详情 getDetailList() { - var params = { + let params = { mallSupplierIds: this.$store.state.supplierInfo.supplierId, productId: this.id } diff --git a/pages/quotation-details/index.vue b/pages/quotation-details/index.vue index cc4d296..d99bfc2 100644 --- a/pages/quotation-details/index.vue +++ b/pages/quotation-details/index.vue @@ -143,30 +143,26 @@ export default { back, // 获取详情 getDetail(id) { - enquiryReplyDetail(id) - .then((res) => { - if (res) { - this.upDataObj = res - this.$set(this.upDataObj, 'otherFee', 0) - this.$set(this.upDataObj, 'totalAllPrice', 0) - this.priceFree() - } - }) - .catch((err) => { - reject(err) - }) + enquiryReplyDetail(id).then((res) => { + if (res) { + this.upDataObj = res + this.$set(this.upDataObj, 'otherFee', 0) + this.$set(this.upDataObj, 'totalAllPrice', 0) + this.priceFree() + } + }) }, priceFree() { for (let item of this.upDataObj.itemList) { - var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(item.totalPrice) + let totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(item.totalPrice) this.upDataObj.totalAllPrice = round(totalAllPrice, 2) - var otherFee = parseFloat(this.upDataObj.otherFee) + parseFloat(item.otherFee) + let otherFee = parseFloat(this.upDataObj.otherFee) + parseFloat(item.otherFee) this.upDataObj.otherFee = round(otherFee, 2) } }, // 修改报价按钮 editPrice() { - var params = { + let params = { title: '修改报价', id: this.upDataObj.id } diff --git a/pages/store-settings/index.vue b/pages/store-settings/index.vue index efb18c2..3c78902 100644 --- a/pages/store-settings/index.vue +++ b/pages/store-settings/index.vue @@ -99,7 +99,7 @@ export default { this.background = this.option.backgroundImg this.logo = this.option.logo if (this.option.logo) { - var logoImage = { + let logoImage = { name: 'text', type: 'image', url: this.option.logo @@ -107,7 +107,7 @@ export default { this.logoImage.push(logoImage) } if (this.option.backgroundImg) { - var backgroundImage = { + let backgroundImage = { name: 'text', type: 'image', url: this.option.backgroundImg @@ -155,7 +155,7 @@ export default { }, // 保存设置 uploadSet() { - var params = { + let params = { backgroundImg: this.background, id: this.$store.state.supplierInfo.id, logo: this.logo, diff --git a/pages/submit-quotation/index.vue b/pages/submit-quotation/index.vue index bc9a0d7..adb66af 100644 --- a/pages/submit-quotation/index.vue +++ b/pages/submit-quotation/index.vue @@ -303,8 +303,8 @@ export default { }) }, setEnquiryTime(time) { - var timeb = time.split(' ') - var timeabs = timeb[1].split(':') + let timeb = time.split(' ') + let timeabs = timeb[1].split(':') this.$set(this.upDataObj, 'enquiryValidTimeSplit', timeabs) }, countTime() { @@ -382,7 +382,7 @@ export default { pickerSure() { console.log('timeValue', this.timeValue) this.$refs.popupTime.close() - var abs = this.addDate(new Date(), this.timeValue[0] + 1, this.timeValue[1] + 1) + let abs = this.addDate(new Date(), this.timeValue[0] + 1, this.timeValue[1] + 1) this.curStartTime = abs this.$set(this.upDataObj, 'enquiryValidTime', abs) console.log(abs) @@ -394,11 +394,11 @@ export default { date = new Date(date) date.setDate(date.getDate() + days) date.setHours(date.getHours() + hours) - var month = date.getMonth() + 1 - var day = date.getDate() + let month = date.getMonth() + 1 + let day = date.getDate() hours = date.getHours() - var min = date.getMinutes() - var second = date.getSeconds() + let min = date.getMinutes() + let second = date.getSeconds() return ( date.getFullYear() + '-' + @@ -418,7 +418,7 @@ export default { return '' } - var re = arg + '' + let re = arg + '' if (re.length < 2) { re = '0' + re } @@ -465,7 +465,7 @@ export default { }, // 单价合计 pricesUnitFee(item) { - var abs = parseFloat(this.prices.unitFee) * parseFloat(this.prices.weight) + let abs = parseFloat(this.prices.unitFee) * parseFloat(this.prices.weight) this.prices.totalPrice = round(abs, 2) }, // 单价确认报价 @@ -475,7 +475,7 @@ export default { } this.$set(this.upDataObj.itemList[this.pricesIndex], 'otherFee', this.prices.otherFee) this.$set(this.upDataObj.itemList[this.pricesIndex], 'unitFee', this.prices.unitFee) - var abs = round(this.prices.unitFee * this.prices.weight, 2) + let abs = round(this.prices.unitFee * this.prices.weight, 2) this.$set(this.upDataObj.itemList[this.pricesIndex], 'totalPrice', round(abs, 2)) this.upDataObj = JSON.parse(JSON.stringify(this.upDataObj)) this.$refs.popupPrice.close() @@ -486,16 +486,16 @@ export default { this.upDataObj.totalAllPrice = 0 this.upDataObj.otherFee = 0 for (let item of this.upDataObj.itemList) { - var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(item.totalPrice) + let totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(item.totalPrice) this.upDataObj.totalAllPrice = round(totalAllPrice, 2) - var otherFee = parseFloat(this.upDataObj.otherFee) + parseFloat(item.otherFee) + let otherFee = parseFloat(this.upDataObj.otherFee) + parseFloat(item.otherFee) this.upDataObj.otherFee = round(otherFee, 2) } this.upDataObj.totalAllPrice = round(this.upDataObj.totalAllPrice + this.upDataObj.otherFee, 2) }, //提交报价 updateQuery() { - for (let target of this.upDataObj.itemList[i]) { + for (let target of this.upDataObj.itemList) { if (target.weight == 0 || target.unitFee == 0 || target.totalPrice == 0) { uni.showToast({ title: '请填写报价完整信息,费用、单价、重量不能为0', @@ -504,7 +504,7 @@ export default { return } } - var params = { + let params = { ...this.upDataObj, // remark: this.quotationRemark, // 报价备注 userId: this.$store.state.userInfo.userId diff --git a/pages/trade/quotationList.vue b/pages/trade/quotationList.vue index d05c410..5ee2d57 100644 --- a/pages/trade/quotationList.vue +++ b/pages/trade/quotationList.vue @@ -127,7 +127,7 @@ export default { }, methods: { // 获取报价列表 - getQuotationQurty() { + getQuotationQuery() { return new Promise((resolve, reject) => { getEnterpriseList({ ...this.params, ...this.pagination }) .then((res) => { @@ -151,7 +151,7 @@ export default { //报价分页 quotationUp(page) { this.pagination.pageNum++ - this.getQuotationQurty() + this.getQuotationQuery() .then(({ list, total }) => { this.$refs.quotationRef.refreshSuccess({ list, total }) }) @@ -162,7 +162,7 @@ export default { //报价分页 quotationDown() { this.pagination.pageNum = 1 - this.getQuotationQurty() + this.getQuotationQuery() .then(({ list, total }) => { this.$refs.quotationRef.refreshSuccess({ list, total }) }) @@ -172,7 +172,7 @@ export default { }, // 报价按钮事件 offerClick(item) { - var params = { + let params = { ...item, title: '提交报价' } diff --git a/pages/user-info/index.vue b/pages/user-info/index.vue index 4942cff..3bdf83e 100644 --- a/pages/user-info/index.vue +++ b/pages/user-info/index.vue @@ -40,7 +40,7 @@ export default { }) return } - var params = { + let params = { userId: this.$store.state.userInfo.userId, name: this.name, enterpriseId: this.$store.state.supplierInfo.id diff --git a/utils/hook.js b/utils/hook.js index f54ac2d..2c0e394 100644 --- a/utils/hook.js +++ b/utils/hook.js @@ -169,11 +169,11 @@ export function uploadFile(path, type = 'image') { * 屏幕截图并保存到相册(不包含状态栏和tabBar),原理就是用webview的draw方法 */ export function screenShot() { - var pages = getCurrentPages() - var page = pages[pages.length - 1] - var bitmap = null + let pages = getCurrentPages() + let page = pages[pages.length - 1] + let bitmap = null // 获取当前页面 webview 的对象实例 - var currentWebview = page.$getAppWebview() + let currentWebview = page.$getAppWebview() bitmap = new plus.nativeObj.Bitmap('amway_img') // 将webview内容绘制到Bitmap对象中 currentWebview.draw( diff --git a/utils/http/http.js b/utils/http/http.js index 5b83fa9..5de2eed 100644 --- a/utils/http/http.js +++ b/utils/http/http.js @@ -73,7 +73,7 @@ export default class Http { } // config:{} uploadFile(config, options) { - return new Promise((resolve, rejetc) => { + return new Promise((resolve, reject) => { let conf = Object.assign({}, config) conf.url = uploadUrl const { reqInterceptor } = this diff --git a/utils/index.js b/utils/index.js index f1c6af2..d0388e8 100644 --- a/utils/index.js +++ b/utils/index.js @@ -35,16 +35,16 @@ export const dateTimeFormat = (date, fmt) => { * @param stringTime 需要转换的日期 */ export const getTimer = (stringTime) => { - var minute = 1000 * 60 - var hour = minute * 60 - var day = hour * 24 - var week = day * 7 - var month = day * 30 - var time1 = new Date().getTime() //当前的时间戳 - var time2 = Date.parse(new Date(stringTime)) //指定时间的时间戳 - var time = time1 - time2 + let minute = 1000 * 60 + let hour = minute * 60 + let day = hour * 24 + let week = day * 7 + let month = day * 30 + let time1 = new Date().getTime() //当前的时间戳 + let time2 = Date.parse(new Date(stringTime)) //指定时间的时间戳 + let time = time1 - time2 - var result = null + let result = null if (time / month >= 1) { result = parseInt(time / month) + '月前' } else if (time / week >= 1) { diff --git a/utils/locationTransform.js b/utils/locationTransform.js index 4c1287b..0704279 100644 --- a/utils/locationTransform.js +++ b/utils/locationTransform.js @@ -1,6 +1,6 @@ -var pi = 3.14159265358979324 -var a = 6378245.0 -var ee = 0.00669342162296594323 +const pi = 3.14159265358979324 +const a = 6378245.0 +const ee = 0.00669342162296594323 /** * WGS84坐标转换GCJ02坐标 @@ -9,22 +9,22 @@ var ee = 0.00669342162296594323 * @return Array[lat:gcj纬度,lon:gcj经度] */ function wgs84togcj02(wgLat, wgLon) { - var mgLat, mgLon + let mgLat, mgLon if (outOfChina(wgLat, wgLon)) { console.log('out of china') return } - var dLat = transformLat(wgLon - 105.0, wgLat - 35.0) - var dLon = transformLon(wgLon - 105.0, wgLat - 35.0) - var radLat = (wgLat / 180.0) * pi - var magic = Math.sin(radLat) + let dLat = transformLat(wgLon - 105.0, wgLat - 35.0) + let dLon = transformLon(wgLon - 105.0, wgLat - 35.0) + let radLat = (wgLat / 180.0) * pi + let magic = Math.sin(radLat) magic = 1 - ee * magic * magic - var sqrtMagic = Math.sqrt(magic) + let sqrtMagic = Math.sqrt(magic) dLat = (dLat * 180.0) / (((a * (1 - ee)) / (magic * sqrtMagic)) * pi) dLon = (dLon * 180.0) / ((a / sqrtMagic) * Math.cos(radLat) * pi) mgLat = wgLat + dLat mgLon = wgLon + dLon - var arr = {} + let arr = {} arr['lat'] = mgLat arr['lon'] = mgLon return arr @@ -35,14 +35,14 @@ function outOfChina(lat, lon) { return false } function transformLat(x, y) { - var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x)) + let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x)) ret += ((20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0) / 3.0 ret += ((20.0 * Math.sin(y * pi) + 40.0 * Math.sin((y / 3.0) * pi)) * 2.0) / 3.0 ret += ((160.0 * Math.sin((y / 12.0) * pi) + 320 * Math.sin((y * pi) / 30.0)) * 2.0) / 3.0 return ret } function transformLon(x, y) { - var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x)) + let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x)) ret += ((20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0) / 3.0 ret += ((20.0 * Math.sin(x * pi) + 40.0 * Math.sin((x / 3.0) * pi)) * 2.0) / 3.0 ret += ((150.0 * Math.sin((x / 12.0) * pi) + 300.0 * Math.sin((x / 30.0) * pi)) * 2.0) / 3.0