This commit is contained in:
caoliancun
2023-02-15 21:00:15 +08:00
parent ea8e9f9eb7
commit 8ca3069737
21 changed files with 407 additions and 223 deletions

73
main.js
View File

@@ -15,7 +15,7 @@ import global from '@/api/global.js'
import Empty from '@/components/Empty.vue'
import {share} from './mixins/index.js'
import oilSiteApi from '@/api/oil-site.js'
Vue.mixin(share)
// Vue.component('home', home)
// Vue.component('user', user)
@@ -33,6 +33,77 @@ Vue.prototype.moneyIntercept = function(value){
return Number(value).toFixed(2)
}
}
Vue.prototype.SetFilterData = function(value){
return new Promise((re,rj)=>{
let menuList = [{
title: '渠道',
isMutiple: false,
key: 'channelCode',
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '0#轻柴油',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '品牌',
key: 'siteBrand',
isSort: true,
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
}
]
if(uni.getStorageSync('filterData')){
re('ok')
}else{
oilSiteApi.getCheckInfo().then(res => {
if (res.code == 20000) {
let channelCodes = []
res.data.channelCodes.map(item => {
channelCodes.push({
title: item.name,
value: item.id
})
})
let productCodes = []
res.data.productCodes.map(item => {
productCodes.push({
title: item.name,
value: item.id
})
})
let siteBrands = []
res.data.siteBrands.map(item => {
siteBrands.push({
title: item.name,
value: item.id
})
})
console.log(channelCodes, productCodes, siteBrands)
menuList[0].detailList = menuList[0].detailList.concat(channelCodes)
menuList[1].detailList = menuList[1].detailList.concat(productCodes)
menuList[2].detailList = menuList[2].detailList.concat(siteBrands)
uni.setStorageSync('filterData', this.menuList);
re('ok')
}else{
rj('no')
}
})
}
})
}
let qqmapsdk = new QQMapWX({
// key: 'IUKBZ-5MKL3-HXB3P-3OS7U-6MHX3-MYBI3'
key:'NYEBZ-YURY3-XTU3N-YBR54-PKW6E-ROB2F'