Commit 6ceb0202 by 李伟康

commit 车型销售

1 parent 9e9c5ad0
...@@ -83,7 +83,31 @@ export default { ...@@ -83,7 +83,31 @@ export default {
if (carBrandList.length) this.selectCar(carBrandList[0], true) if (carBrandList.length) this.selectCar(carBrandList[0], true)
}, },
open () { open () {
uni.showLoading({
mask: true
})
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
/**获取品牌车型 */
uni.$api.commonApi
.getMerchantCarBrandList([shopMerchantId])
.then(({ data }) => {
let list = data[0].carBrandList,
carBrandList = [];
list?.map((e) => {
e.childs.map((i) => {
i.brandId = e.id;
carBrandList.push(i);
});
});
this.$store.dispatch("setCarBrandsList", carBrandList);
this.$refs.carBrandListVisible.open()
uni.hideLoading()
}).catch(() => {
this.$refs.carBrandListVisible.open() this.$refs.carBrandListVisible.open()
uni.hideLoading()
})
}, },
selectCar (e, auto = false) { selectCar (e, auto = false) {
let { clickFlga } = this let { clickFlga } = this
......
...@@ -57,7 +57,24 @@ export default { ...@@ -57,7 +57,24 @@ export default {
}, },
methods: { methods: {
open () { open () {
uni.showLoading({
mask: true
})
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
})
.then((res) => {
this.$store.dispatch("setEmployeeList", res);
this.$refs.employeeBoxVisible.open() this.$refs.employeeBoxVisible.open()
uni.hideLoading()
}).catch(() => {
this.$refs.employeeBoxVisible.open()
uni.hideLoading()
})
}, },
handleSelect (item) { handleSelect (item) {
this.close(); this.close();
......
...@@ -82,6 +82,16 @@ export default { ...@@ -82,6 +82,16 @@ export default {
return false; return false;
}, },
onShow () { onShow () {
var localStorageSpace = function () {
var allStrings = '';
for (var key in window.localStorage) {
if (window.localStorage.hasOwnProperty(key)) {
allStrings += window.localStorage[key];
}
}
return allStrings ? 3 + ((allStrings.length * 16) / (8 * 1024)) + ' KB' : 'Empty (0 KB)';
}
console.log('localStorage当前占用' + localStorageSpace())
this.init(); this.init();
}, },
async onReachBottom () { async onReachBottom () {
...@@ -120,14 +130,22 @@ export default { ...@@ -120,14 +130,22 @@ export default {
}, },
// 查询素材 // 查询素材
async getSoure () { async getSoure () {
try {
uni.showLoading({
mask: true
})
let { moduleList, toolList } = await uni.$api.systemApi.getMockData(); let { moduleList, toolList } = await uni.$api.systemApi.getMockData();
await moduleList.map(async e => { await moduleList.map(async e => {
if (e.receptionSourceDetailList) e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl') if (e.receptionSourceDetailList) e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl')
if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList) if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList)
}) })
uni.hideLoading()
this.moduleList = moduleList this.moduleList = moduleList
this.toolList = toolList this.toolList = toolList
uni.$api.systemApi.updateMockData(moduleList, 'moduleList') uni.$api.systemApi.updateMockData(moduleList, 'moduleList')
} catch (error) {
uni.hideLoading()
}
}, },
errorImg (index) { errorImg (index) {
this.moduleList[index].showAlt = true this.moduleList[index].showAlt = true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!