|
|
@@ -59,7 +59,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="btn" v-if="chooseId">
|
|
|
- <van-button @click="step = 1" type="primary" block round>确认销毁,下一步</van-button>
|
|
|
+ <van-button @click="sureCancel" type="primary" block round>确认销毁,下一步</van-button>
|
|
|
</div>
|
|
|
</van-list>
|
|
|
</van-pull-refresh>
|
|
|
@@ -133,6 +133,7 @@
|
|
|
<Vue3Lottie :width="200" :animationData="star2JSON" />
|
|
|
<div class="lottie-text">星图铸造中</div>
|
|
|
</div>
|
|
|
+ <picture-cropper ref="cropperRef" @updateImg="updateImg"></picture-cropper>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -141,36 +142,80 @@ import product from '../../mixins/product';
|
|
|
import list from '../../mixins/list';
|
|
|
import { Vue3Lottie } from 'vue3-lottie';
|
|
|
import 'vue3-lottie/dist/style.css';
|
|
|
-import zuzhaoJSON from '../../assets/lottie/zuzhao.json';
|
|
|
-import starJSON from '../../assets/lottie/star.json';
|
|
|
-import star1JSON from '../../assets/lottie/star1.json';
|
|
|
import star2JSON from '../../assets/lottie/star2.json';
|
|
|
+import pictureCropper from '../../components/PictureCropper.vue';
|
|
|
+import { getCurrentInstance, onMounted, reactive, ref } from 'vue-demi';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
|
|
|
export default {
|
|
|
mixins: [product, list],
|
|
|
components: {
|
|
|
- Vue3Lottie
|
|
|
+ Vue3Lottie,
|
|
|
+ pictureCropper
|
|
|
},
|
|
|
data() {
|
|
|
- return {
|
|
|
- step: 0,
|
|
|
- steps: ['销毁藏品', '上传星图', '星图铸造', '提交审核'],
|
|
|
- empty: false,
|
|
|
- list: [],
|
|
|
- chooseId: 0,
|
|
|
- refreshing: false,
|
|
|
- url: '/asset/all',
|
|
|
- form: {},
|
|
|
- photoAssetId: 0,
|
|
|
- info: {},
|
|
|
- nots: [],
|
|
|
- zuzhaoJSON,
|
|
|
- starJSON,
|
|
|
- star1JSON,
|
|
|
- star2JSON
|
|
|
+ return { empty: false, list: [], refreshing: false, url: '/asset/all', photoAssetId: 0, info: {}, star2JSON };
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ //剪切图片
|
|
|
+ const form = reactive({
|
|
|
+ pic: []
|
|
|
+ });
|
|
|
+ const updateImg = (img = '') => {
|
|
|
+ if (img) {
|
|
|
+ form.pic[0].status = 'done';
|
|
|
+ form.pic[0].url = img;
|
|
|
+ form.pic[0].content = img;
|
|
|
+ } else {
|
|
|
+ form.pic = [];
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const cropperRef = ref(null);
|
|
|
+ const afterRead = (file, e) => {
|
|
|
+ cropperRef.value.init(file.content);
|
|
|
+ file.status = 'uploading';
|
|
|
+ file.name = file.file.name;
|
|
|
+ file.type = file.file.type;
|
|
|
+ };
|
|
|
+
|
|
|
+ //屏蔽的藏品
|
|
|
+ const nots = ref([]);
|
|
|
+ const {
|
|
|
+ appContext: {
|
|
|
+ config: { globalProperties: gobal }
|
|
|
+ }
|
|
|
+ } = getCurrentInstance();
|
|
|
+ onMounted(() => {
|
|
|
+ gobal.$http.get('/sysConfig/get/xingtu_not').then(res => {
|
|
|
+ if (res.value) {
|
|
|
+ nots.value = res.value.split(',');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ //步骤
|
|
|
+ const step = ref(0);
|
|
|
+ //步骤名称
|
|
|
+ const steps = ref(['销毁藏品', '上传星图', '星图铸造', '提交审核']);
|
|
|
+
|
|
|
+ //选择消除藏品
|
|
|
+ const chooseId = ref(0);
|
|
|
+ const router = useRouter();
|
|
|
+ if (router.currentRoute.value.query.chooseId) {
|
|
|
+ chooseId.value = router.currentRoute.value.query.chooseId;
|
|
|
+ step.value = 1;
|
|
|
+ }
|
|
|
+ const choose = id => {
|
|
|
+ if (chooseId.value == id) {
|
|
|
+ chooseId.value = 0;
|
|
|
+ } else {
|
|
|
+ chooseId.value = id;
|
|
|
+ }
|
|
|
};
|
|
|
+
|
|
|
+ return { form, updateImg, cropperRef, afterRead, nots, step, steps, chooseId, choose };
|
|
|
},
|
|
|
- inject: ['barHeight'],
|
|
|
+ inject: ['barHeight', 'changeScroll'],
|
|
|
computed: {
|
|
|
showList() {
|
|
|
let list = [...this.list];
|
|
|
@@ -186,13 +231,6 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.$http.get('/sysConfig/get/xingtu_not').then(res => {
|
|
|
- if (res.value) {
|
|
|
- this.nots = res.value.split(',');
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
methods: {
|
|
|
beforeData() {
|
|
|
return {
|
|
|
@@ -204,30 +242,12 @@ export default {
|
|
|
sort: 'id,desc'
|
|
|
};
|
|
|
},
|
|
|
- choose(id) {
|
|
|
- if (this.chooseId == id) {
|
|
|
- this.chooseId = 0;
|
|
|
- } else {
|
|
|
- this.chooseId = id;
|
|
|
- }
|
|
|
- },
|
|
|
onRefresh() {
|
|
|
this.isLoading = true;
|
|
|
this.getData().then(() => {
|
|
|
this.isLoading = false;
|
|
|
});
|
|
|
},
|
|
|
- afterRead(file, e) {
|
|
|
- console.log(file);
|
|
|
- file.status = 'uploading';
|
|
|
- this.updateFile(file, 'id', 1000).then(img => {
|
|
|
- console.log(img);
|
|
|
- file.url = img;
|
|
|
- file.status = 'done';
|
|
|
- file.name = file.file.name;
|
|
|
- file.type = file.file.type;
|
|
|
- });
|
|
|
- },
|
|
|
submit() {
|
|
|
let form = {
|
|
|
...this.form,
|
|
|
@@ -260,6 +280,10 @@ export default {
|
|
|
this.$toast(e.error);
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ sureCancel() {
|
|
|
+ this.changeScroll(0);
|
|
|
+ this.step = 1;
|
|
|
}
|
|
|
}
|
|
|
};
|