优化单图选择不显示相机的问题
This commit is contained in:
@@ -11,23 +11,23 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { uploadFile } from "@/http/api/index.js";
|
||||
import { uploadFile } from '@/http/api/index.js';
|
||||
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
|
||||
const modelValue = defineModel({
|
||||
type: String,
|
||||
default: "",
|
||||
default: ''
|
||||
});
|
||||
|
||||
function chooseImage() {
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ["album", "camera "],
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera'],
|
||||
success: async function (res) {
|
||||
uni.showLoading({
|
||||
title: "上传中",
|
||||
title: '上传中'
|
||||
});
|
||||
console.log(res);
|
||||
const fileRes = await uploadFile(res.tempFiles[0]);
|
||||
@@ -36,16 +36,16 @@ function chooseImage() {
|
||||
modelValue.value = fileRes;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "上传失败",
|
||||
icon: "none",
|
||||
title: '上传失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function clearImg() {
|
||||
modelValue.value=""
|
||||
modelValue.value = '';
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ function toMiniApp() {
|
||||
uni.navigateToMiniProgram({
|
||||
appId: 'wxd88fffa983758a30',
|
||||
path: `/groupBuying/goodsDetail/goodsDetail?wareId=${query.id}&shopId=${query.shopId}`,
|
||||
envVersion: 'release', // 环境版本:release(正式版)、trial(体验版)、develop(开发版)
|
||||
envVersion: 'trial', // 环境版本:release(正式版)、trial(体验版)、develop(开发版)
|
||||
success: () => {},
|
||||
fail: () => {}
|
||||
});
|
||||
|
||||
@@ -210,7 +210,7 @@ function toMiniApp() {
|
||||
uni.navigateToMiniProgram({
|
||||
appId: 'wxd88fffa983758a30',
|
||||
path: `/userPackage/goodsDetail/goodsDetail?id=${query.id}&shopId=${query.shopId}`,
|
||||
envVersion: 'release', // 环境版本:release(正式版)、trial(体验版)、develop(开发版)
|
||||
envVersion: 'trial', // 环境版本:release(正式版)、trial(体验版)、develop(开发版)
|
||||
success: () => {},
|
||||
fail: () => {}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user