Commit be3b7e7f by 胡悦

Merge branch 'v1.0.7' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.7

2 parents c57dd383 4aa7f548
...@@ -113,15 +113,22 @@ export default { ...@@ -113,15 +113,22 @@ export default {
let { clickFlga } = this let { clickFlga } = this
if (clickFlga) return if (clickFlga) return
this.clickFlga = true this.clickFlga = true
if (!auto) uni.showLoading({
mask: true
})
this.selectItem = { this.selectItem = {
carBrand: e.brandName, carBrand: e.brandName,
carBrandId: e.brandId, carBrandId: e.brandId,
carChildsBrandName: e.name, carChildsBrandName: e.name,
carChildsBrandId: e.id carChildsBrandId: e.id
} }
const carList = uni.getStorageSync(`${e.id}_${e.brandId}_carlist`)
if (carList) {
this.carlist = carList
if (auto && carList.length) this.handleSelect(carList[0])
else this.$refs.carBoxVisible.open()
} else {
if (!auto) uni.showLoading({
mask: true
})
}
uni.$api.commonApi.getCarBrandsList({ uni.$api.commonApi.getCarBrandsList({
brandId: e.brandId, brandId: e.brandId,
childBrandId: e.id childBrandId: e.id
...@@ -129,26 +136,23 @@ export default { ...@@ -129,26 +136,23 @@ export default {
uni.hideLoading() uni.hideLoading()
this.carlist = res this.carlist = res
uni.setStorageSync(`${e.id}_${e.brandId}_carlist`, res) uni.setStorageSync(`${e.id}_${e.brandId}_carlist`, res)
if (!carList) {
if (auto && res.length) this.handleSelect(res[0]) if (auto && res.length) this.handleSelect(res[0])
else this.$refs.carBoxVisible.open() else this.$refs.carBoxVisible.open()
}
this.clickFlga = false this.clickFlga = false
}).catch(err => { }).catch(err => {
this.clickFlga = false this.clickFlga = false
uni.hideLoading() uni.hideLoading()
const carList = uni.getStorageSync(`${e.id}_${e.brandId}_carlist`)
if (carList) {
this.carlist = carList
if (auto && carList.length) this.handleSelect(carList[0])
else this.$refs.carBoxVisible.open()
}
}) })
}, },
handleSelect (item) { handleSelect (item) {
const customerInfo = this.$store.state.user.customerInfo, const customerInfo = this.$store.state.user.customerInfo,
{ selectItem } = this { selectItem } = this
customerInfo.carBrand = selectItem.carChildsBrandName customerInfo.carBrand = selectItem.carChildsBrandName
this.$store.dispatch('setCustomerInfo', customerInfo) this.$store.dispatch('setCustomerInfo', customerInfo)
this.$refs.carBoxVisible.close(); this.$refs.carBoxVisible?.close();
this.$emit('select', { this.$emit('select', {
...item, ...item,
...selectItem ...selectItem
......
...@@ -51,15 +51,6 @@ export default { ...@@ -51,15 +51,6 @@ export default {
// }); // });
}, },
onShow() { onShow() {
const userInfo = uni.$storage.get("userInfo") || {};
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.reLaunch({
url: "/pages/common/login",
});
return;
}
// console.log(utils.requestAndroidPermission()); // console.log(utils.requestAndroidPermission());
}, },
methods: { methods: {
...@@ -357,7 +348,7 @@ export default { ...@@ -357,7 +348,7 @@ export default {
initTime() { initTime() {
if (this.audioInfo.audioStatus != "start") return; if (this.audioInfo.audioStatus != "start") return;
this.timer = setInterval(() => { this.timer = setInterval(() => {
console.log(this.times); // console.log(this.times);
this.times++; this.times++;
if (this.times >= this.timeout) { if (this.times >= this.timeout) {
this.$refs.tipBox?.open(); this.$refs.tipBox?.open();
......
...@@ -82,7 +82,16 @@ export default { ...@@ -82,7 +82,16 @@ export default {
// 其他情况允许正常返回 // 其他情况允许正常返回
return false; return false;
}, },
mounted () { onShow () {
const userInfo = uni.$storage.get("userInfo")
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.reLaunch({
url: "/pages/common/login",
});
return;
}
this.init() this.init()
}, },
methods: { methods: {
......
...@@ -82,6 +82,15 @@ export default { ...@@ -82,6 +82,15 @@ export default {
return false; return false;
}, },
onShow () { onShow () {
const userInfo = uni.$storage.get("userInfo")
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.reLaunch({
url: "/pages/common/login",
});
return;
}
this.init(); this.init();
}, },
async onReachBottom () { async onReachBottom () {
...@@ -114,12 +123,15 @@ export default { ...@@ -114,12 +123,15 @@ export default {
this.$store.dispatch("setCarBrandsList", carBrandList); this.$store.dispatch("setCarBrandsList", carBrandList);
uni.$storage.set('carBrandList', carBrandList) uni.$storage.set('carBrandList', carBrandList)
if (carBrandList.length) { if (carBrandList.length) {
let [defaultItem] = carBrandList carBrandList.map(async item => {
uni.$api.commonApi.getCarBrandsList({ const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`)
brandId: defaultItem.brandId, if (!carList) {
childBrandId: defaultItem.id const _res = await uni.$api.commonApi.getCarBrandsList({
}).then(_res => { brandId: item.brandId,
uni.setStorageSync(`${defaultItem.id}_${defaultItem.brandId}_carlist`, _res) childBrandId: item.id
})
if (_res) uni.setStorageSync(`${item.id}_${item.brandId}_carlist`, _res)
}
}) })
} }
...@@ -212,6 +224,7 @@ export default { ...@@ -212,6 +224,7 @@ export default {
clearHistory () { clearHistory () {
this.$store.dispatch("clearCustomerInfo"); this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory"); this.$store.dispatch("clearHistory");
this.$refs.home.setBooks([])
}, },
openStep () { openStep () {
this.$refs.home.finishRef.close(); this.$refs.home.finishRef.close();
......
...@@ -7,24 +7,29 @@ ...@@ -7,24 +7,29 @@
--> -->
<template> <template>
<view class="information-entry"> <view class="information-entry">
<view class="information-tips" <view class="information-tips">建议同步采集凭证,若接待工作繁忙可在提单环节再进行补充。</view>
>建议同步采集凭证,若接待工作繁忙可在提单环节再进行补充。</view
>
<view class="information-box"> <view class="information-box">
<view <view
class="information-item" class="information-item"
v-for="(item, index) in infoList" v-for="(item, index) in infoList"
:key="item.title" :key="item.title"
> >
<view class="upload-img" v-if="item.imgUrl"> <view
class="upload-img"
v-if="item.imgUrl"
>
<image <image
class="img" class="img"
:src="item.imgUrl" :src="item.imgUrl"
mode="aspectFill" mode="aspectFill"
@click="preview(index)" @click="preview(index)"
/> />
<view class="upload-close" @click="close(index)" <view
><glsx-image src="detail/icon-close.png" mode="scaleToFill" class="upload-close"
@click="close(index)"
><glsx-image
src="detail/icon-close.png"
mode="scaleToFill"
/></view> /></view>
<!-- <uni-icons <!-- <uni-icons
class="upload-close" class="upload-close"
...@@ -33,13 +38,20 @@ ...@@ -33,13 +38,20 @@
@click="close(index)" @click="close(index)"
></uni-icons> --> ></uni-icons> -->
</view> </view>
<view v-else class="icon" @tap="choose(index)"> <view
v-else
class="icon"
@tap="choose(index)"
>
<view class="icon-upload sprite-icon icon-icon-upload"></view> <view class="icon-upload sprite-icon icon-icon-upload"></view>
</view> </view>
<view class="information-title">{{ item.title }} </view> <view class="information-title">{{ item.title }} </view>
</view> </view>
</view> </view>
<view class="information-done" @click="done()">完成接待</view> <view
class="information-done"
@click="done()"
>完成接待</view>
<!-- <uni-popup ref="preview" type="center" border-radius="10px 10px 0 0"> <!-- <uni-popup ref="preview" type="center" border-radius="10px 10px 0 0">
<image class="preview-img" :src="previewImg" mode="aspectFit" /> <image class="preview-img" :src="previewImg" mode="aspectFit" />
</uni-popup> --> </uni-popup> -->
...@@ -51,7 +63,10 @@ ...@@ -51,7 +63,10 @@
cancelBtnText="否" cancelBtnText="否"
confirmBtnText="是" confirmBtnText="是"
></MessageBox> ></MessageBox>
<finish-step ref="stepRef" @submit="submit" /> <finish-step
ref="stepRef"
@submit="submit"
/>
<update-box /> <update-box />
</view> </view>
</template> </template>
...@@ -79,31 +94,46 @@ import FinishStep from "@/components/FinishStep.vue"; ...@@ -79,31 +94,46 @@ import FinishStep from "@/components/FinishStep.vue";
export default { export default {
components: { FinishStep }, components: { FinishStep },
mixins: [myClick], mixins: [myClick],
data() { data () {
return { return {
infoList: INFO_LIST, infoList: JSON.parse(JSON.stringify(INFO_LIST)),
previewImg: "", previewImg: "",
isPreview: false, isPreview: false,
}; };
}, },
onLoad(options) { onLoad (options) {
const text = options.text; const text = options.text;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: text, title: text,
}); });
}, },
onBackPress() { watch: {
this.infoList = this.infoList.map((item) => { watchBooksList: {
if (item.imgUrl) { immediate: true,
delete item.imgUrl; handler (newValue) {
console.log(newValue,'===')
if(newValue.length) this.infoList = newValue
else this.infoList = JSON.parse(JSON.stringify(INFO_LIST))
},
} }
return item; },
}); computed: {
watchBooksList () {
return this.$store.state.audio.booksList
}
},
onBackPress () {
// this.infoList = this.infoList.map((item) => {
// if (item.imgUrl) {
// delete item.imgUrl;
// }
// return item;
// });
}, },
methods: { methods: {
...mapMutations("audio", ["setBooks"]), ...mapMutations("audio", ["setBooks"]),
// 上传图 // 上传图
async choose(index) { async choose (index) {
const result = await this.$permision.requestAndroidPermission( const result = await this.$permision.requestAndroidPermission(
"android.permission.CAMERA" "android.permission.CAMERA"
); );
...@@ -118,11 +148,14 @@ export default { ...@@ -118,11 +148,14 @@ export default {
count: 1, count: 1,
success: async (res) => { success: async (res) => {
// await upload(res.tempFilePath) // await upload(res.tempFilePath)
this.$set( let url = await upload(res.tempFilePaths[0])
this.infoList[index], // this.$set(
"imgUrl", // this.infoList[index],
await upload(res.tempFilePaths[0]) // "imgUrl",
); // url
// );
this.infoList[index].imgUrl = url
this.setBooks(utils.deepClone(this.infoList))
}, },
fail: (err) => { fail: (err) => {
console.log(err); console.log(err);
...@@ -130,18 +163,19 @@ export default { ...@@ -130,18 +163,19 @@ export default {
}); });
}, },
// 删除图 // 删除图
close(index) { close (index) {
this.$set(this.infoList[index], "imgUrl"); // this.$set(this.infoList[index], "imgUrl");
this.infoList[index].imgUrl = ''
this.setBooks(utils.deepClone(this.infoList))
}, },
// 完成接待按钮 // 完成接待按钮
done() { done () {
this.$refs.stepRef.open(); this.$refs.stepRef.open();
}, },
submit() { submit () {
this.$refs.stepRef.close(); this.$refs.stepRef.close();
this.setBooks(utils.deepClone(this.infoList));
this.stopAudio(); this.stopAudio();
this.infoList = INFO_LIST.map((item) => delete item.imgUrl); // this.infoList = INFO_LIST.map((item) => delete item.imgUrl);
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: "/pages/equity/index", url: "/pages/equity/index",
...@@ -149,7 +183,7 @@ export default { ...@@ -149,7 +183,7 @@ export default {
}, 1500); }, 1500);
}, },
// 预览图片 // 预览图片
preview(index) { preview (index) {
this.isPreview = true; this.isPreview = true;
this.previewImg = this.infoList[index].imgUrl; this.previewImg = this.infoList[index].imgUrl;
uni.previewImage({ uni.previewImage({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!