|
|
@@ -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="cropper" @updateImg="updateImg"></picture-cropper>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -145,11 +146,13 @@ 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';
|
|
|
|
|
|
export default {
|
|
|
mixins: [product, list],
|
|
|
components: {
|
|
|
- Vue3Lottie
|
|
|
+ Vue3Lottie,
|
|
|
+ pictureCropper
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -170,7 +173,7 @@ export default {
|
|
|
star2JSON
|
|
|
};
|
|
|
},
|
|
|
- inject: ['barHeight'],
|
|
|
+ inject: ['barHeight', 'changeScroll'],
|
|
|
computed: {
|
|
|
showList() {
|
|
|
let list = [...this.list];
|
|
|
@@ -218,15 +221,26 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
afterRead(file, e) {
|
|
|
- console.log(file);
|
|
|
+ this.$refs.cropper.init(file.content);
|
|
|
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;
|
|
|
- });
|
|
|
+ file.name = file.file.name;
|
|
|
+ file.type = file.file.type;
|
|
|
+ // 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;
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ updateImg(img = '') {
|
|
|
+ if (img) {
|
|
|
+ this.form.pic[0].status = 'done';
|
|
|
+ this.form.pic[0].url = img;
|
|
|
+ } else {
|
|
|
+ this.form.pic[0].status = 'done';
|
|
|
+ this.form.pic = [];
|
|
|
+ }
|
|
|
},
|
|
|
submit() {
|
|
|
let form = {
|
|
|
@@ -260,6 +274,10 @@ export default {
|
|
|
this.$toast(e.error);
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ sureCancel() {
|
|
|
+ this.changeScroll(0);
|
|
|
+ this.step = 1;
|
|
|
}
|
|
|
}
|
|
|
};
|