|
@@ -125,16 +125,26 @@
|
|
|
7.最终解释权归RAEX绿洲宇宙平台所有。
|
|
7.最终解释权归RAEX绿洲宇宙平台所有。
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="btn btns">
|
|
|
|
|
|
|
+ <!-- //未下单 -->
|
|
|
|
|
+ <div class="btn btns" v-if="!orderId">
|
|
|
<van-button type="primary" @click="step = 0" plain round> 上一步</van-button>
|
|
<van-button type="primary" @click="step = 0" plain round> 上一步</van-button>
|
|
|
<van-button round type="primary" native-type="submit">提交铸造</van-button>
|
|
<van-button round type="primary" native-type="submit">提交铸造</van-button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="btn btns" v-else>
|
|
|
|
|
+ <van-button type="primary" @click="$router.go(-1)" plain round> 返回</van-button>
|
|
|
|
|
+ <van-button round type="primary" @click="payEvent" v-if="orderStatus === 'NOT_PAID'"
|
|
|
|
|
+ >立即支付</van-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <van-button round type="primary" v-else-if="!orderId" native-type="submit">提交铸造</van-button>
|
|
|
|
|
+ </div>
|
|
|
</van-form>
|
|
</van-form>
|
|
|
<div class="zhuzao" v-else-if="step === 2">
|
|
<div class="zhuzao" v-else-if="step === 2">
|
|
|
<Vue3Lottie :width="200" :animationData="star2JSON" />
|
|
<Vue3Lottie :width="200" :animationData="star2JSON" />
|
|
|
<div class="lottie-text">星图铸造中</div>
|
|
<div class="lottie-text">星图铸造中</div>
|
|
|
</div>
|
|
</div>
|
|
|
<picture-cropper ref="cropperRef" @updateImg="updateImg"></picture-cropper>
|
|
<picture-cropper ref="cropperRef" @updateImg="updateImg"></picture-cropper>
|
|
|
|
|
+
|
|
|
|
|
+ <star-pay ref="pay" @payNext="payNext"></star-pay>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -145,14 +155,17 @@ import { Vue3Lottie } from 'vue3-lottie';
|
|
|
import 'vue3-lottie/dist/style.css';
|
|
import 'vue3-lottie/dist/style.css';
|
|
|
import star2JSON from '../../assets/lottie/star2.json';
|
|
import star2JSON from '../../assets/lottie/star2.json';
|
|
|
import pictureCropper from '../../components/PictureCropper.vue';
|
|
import pictureCropper from '../../components/PictureCropper.vue';
|
|
|
-import { getCurrentInstance, onMounted, reactive, ref } from 'vue-demi';
|
|
|
|
|
|
|
+import { getCurrentInstance, onMounted, reactive, ref, watch } from 'vue-demi';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
+import starPay from '../../components/star/pay.vue';
|
|
|
|
|
+import { usePageVisibility } from '@vant/use';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [product, list],
|
|
mixins: [product, list],
|
|
|
components: {
|
|
components: {
|
|
|
Vue3Lottie,
|
|
Vue3Lottie,
|
|
|
- pictureCropper
|
|
|
|
|
|
|
+ pictureCropper,
|
|
|
|
|
+ starPay
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return { empty: false, list: [], refreshing: false, url: '/asset/all', photoAssetId: 0, info: {}, star2JSON };
|
|
return { empty: false, list: [], refreshing: false, url: '/asset/all', photoAssetId: 0, info: {}, star2JSON };
|
|
@@ -160,7 +173,9 @@ export default {
|
|
|
setup() {
|
|
setup() {
|
|
|
//剪切图片
|
|
//剪切图片
|
|
|
const form = reactive({
|
|
const form = reactive({
|
|
|
- pic: []
|
|
|
|
|
|
|
+ pic: [],
|
|
|
|
|
+ picName: '',
|
|
|
|
|
+ picDesc: ''
|
|
|
});
|
|
});
|
|
|
const updateImg = (img = '') => {
|
|
const updateImg = (img = '') => {
|
|
|
if (img) {
|
|
if (img) {
|
|
@@ -173,28 +188,13 @@ export default {
|
|
|
};
|
|
};
|
|
|
const cropperRef = ref(null);
|
|
const cropperRef = ref(null);
|
|
|
const afterRead = (file, e) => {
|
|
const afterRead = (file, e) => {
|
|
|
- console.log(file)
|
|
|
|
|
|
|
+ console.log(file);
|
|
|
cropperRef.value.init(file.content, file);
|
|
cropperRef.value.init(file.content, file);
|
|
|
file.status = 'uploading';
|
|
file.status = 'uploading';
|
|
|
file.name = file.file.name;
|
|
file.name = file.file.name;
|
|
|
file.type = file.file.type;
|
|
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 step = ref(0);
|
|
|
//步骤名称
|
|
//步骤名称
|
|
@@ -215,7 +215,107 @@ export default {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- return { form, updateImg, cropperRef, afterRead, nots, step, steps, chooseId, choose };
|
|
|
|
|
|
|
+ //未支付订单
|
|
|
|
|
+ const orderId = ref(0);
|
|
|
|
|
+ const pay = ref(0);
|
|
|
|
|
+ const orderStatus = ref('');
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
|
+ if (router.currentRoute.value.query.id) {
|
|
|
|
|
+ orderId.value = router.currentRoute.value.query.id;
|
|
|
|
|
+ getAsset();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //获取藏品
|
|
|
|
|
+ const getAsset = () => {
|
|
|
|
|
+ pay.value.hide();
|
|
|
|
|
+ gobal.$toast.loading('加载中');
|
|
|
|
|
+ gobal.$http
|
|
|
|
|
+ .get('/photoAsset/get/' + orderId.value)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ gobal.$toast.clear();
|
|
|
|
|
+ if (res.orderStatus === 'NOT_PAID') {
|
|
|
|
|
+ form.pic = [res.pic];
|
|
|
|
|
+ form.picName = res.picName;
|
|
|
|
|
+ form.picDesc = res.picDesc;
|
|
|
|
|
+ price.value = res.price;
|
|
|
|
|
+ step.value = 1;
|
|
|
|
|
+ orderStatus.value = res.orderStatus;
|
|
|
|
|
+ payEvent();
|
|
|
|
|
+ } else if (!res.del) {
|
|
|
|
|
+ payNext();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ gobal.$toast.clear();
|
|
|
|
|
+ if (e.error) {
|
|
|
|
|
+ gobal.$toast(e.error);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ //支付
|
|
|
|
|
+ const payEvent = () => {
|
|
|
|
|
+ pay.value.init(price.value, orderId.value);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ //屏蔽的藏品
|
|
|
|
|
+ const nots = ref([]);
|
|
|
|
|
+ const price = ref(0); //铸造价格
|
|
|
|
|
+ const {
|
|
|
|
|
+ appContext: {
|
|
|
|
|
+ config: { globalProperties: gobal }
|
|
|
|
|
+ }
|
|
|
|
|
+ } = getCurrentInstance();
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
|
+ gobal.$http.get('/sysConfig/get/xingtu_not,pic_price').then(res => {
|
|
|
|
|
+ if (res.xingtu_not) {
|
|
|
|
|
+ nots.value = res.xingtu_not.value.split(',');
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res.pic_price && !orderId.value) {
|
|
|
|
|
+ price.value = Number(res.pic_price.value);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //支付成功
|
|
|
|
|
+ const payNext = () => {
|
|
|
|
|
+ step.value = 2;
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ router.replace({
|
|
|
|
|
+ path: '/starCreateResult',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ id: orderId.value
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 3000);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ //页面获取焦点刷新
|
|
|
|
|
+ const pageVisibility = usePageVisibility();
|
|
|
|
|
+ watch(pageVisibility, value => {
|
|
|
|
|
+ if (orderId.value) {
|
|
|
|
|
+ getAsset();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return {
|
|
|
|
|
+ form,
|
|
|
|
|
+ updateImg,
|
|
|
|
|
+ cropperRef,
|
|
|
|
|
+ afterRead,
|
|
|
|
|
+ nots,
|
|
|
|
|
+ step,
|
|
|
|
|
+ steps,
|
|
|
|
|
+ chooseId,
|
|
|
|
|
+ choose,
|
|
|
|
|
+ price,
|
|
|
|
|
+ pay,
|
|
|
|
|
+ orderStatus,
|
|
|
|
|
+ orderId,
|
|
|
|
|
+ payEvent,
|
|
|
|
|
+ payNext
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
inject: ['barHeight', 'changeScroll'],
|
|
inject: ['barHeight', 'changeScroll'],
|
|
|
computed: {
|
|
computed: {
|
|
@@ -264,6 +364,10 @@ export default {
|
|
|
type: form.pic[0].type,
|
|
type: form.pic[0].type,
|
|
|
thumb: null
|
|
thumb: null
|
|
|
};
|
|
};
|
|
|
|
|
+ if (this.price) {
|
|
|
|
|
+ form.destroyed = true;
|
|
|
|
|
+ form.price = this.price;
|
|
|
|
|
+ }
|
|
|
this.$toast.loading({
|
|
this.$toast.loading({
|
|
|
message: '加载中...',
|
|
message: '加载中...',
|
|
|
forbidClick: true
|
|
forbidClick: true
|
|
@@ -272,10 +376,16 @@ export default {
|
|
|
.post('/photoAsset/save', form, { body: 'json' })
|
|
.post('/photoAsset/save', form, { body: 'json' })
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
this.$toast.clear();
|
|
this.$toast.clear();
|
|
|
- this.step = 2;
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.$router.replace('/starCreateResult?id=' + res.id);
|
|
|
|
|
- }, 3000);
|
|
|
|
|
|
|
+ if (this.price) {
|
|
|
|
|
+ this.orderStatus = res.orderStatus;
|
|
|
|
|
+ this.orderId = res.id;
|
|
|
|
|
+ this.payEvent();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.step = 2;
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.$router.replace('/starCreateResult?id=' + res.id);
|
|
|
|
|
+ }, 3000);
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
|
if (e.error) {
|
|
if (e.error) {
|