Browse Source

upload

master
HolyKnightIX 1 year ago
parent
commit
63b81b66b9
3 changed files with 62 additions and 8 deletions
  1. +22
    -0
      src/pages/index/buyCoin.vue
  2. +38
    -6
      src/pages/index/index.vue
  3. +2
    -2
      src/pages/uploadPhoto/uploadPhoto.vue

+ 22
- 0
src/pages/index/buyCoin.vue View File

@@ -106,6 +106,28 @@ const startPay = (data) => {
console.log(res, "res");
getStatusOfOrder(orderNumber.value).then((res) => {
console.log(res, "status");
if (res == 1) {
uni.showToast({
title: "支付取消",
icon: "exception",
});
} else if (res == 2) {
} else if (res == 3) {
uni.showToast({
title: "支付成功!",
icon: "success",
success() {
setTimeout(() => {
uni.navigateBack();
}, 2000);
},
});
} else if (res == 4) {
uni.showToast({
title: "支付取消",
icon: "exception",
});
}
});
},
fail: function (err) {


+ 38
- 6
src/pages/index/index.vue View File

@@ -177,7 +177,11 @@
<text>时间</text>
<text>金币</text>
</view>
<scroll-view :scroll-y="true" class="bottom">
<scroll-view
:scroll-y="true"
class="bottom"
@scrolltolower="getMoreConsumeList"
>
<view class="OrderListItem" v-for="item in ConsumeList" :key="item.id">
<view class="name">{{ getConsumeName(item.type) }}</view>
<view class="time">{{
@@ -208,7 +212,7 @@
<script setup>
//#region 导入
import dayjs from "dayjs";
import { onLoad } from "@dcloudio/uni-app";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { ref, reactive, computed, inject } from "vue";
// import App from "../../App.vue";
import {
@@ -299,12 +303,20 @@ function goOtherPage(url, status) {
const tabList = ref([
{ name: "我的写真", id: 1 },
// { name: "我的视频", id: 2 },
{ name: "我的邀请", id: 3 },
// { name: "我的邀请", id: 3 },
{ name: "消费记录", id: 4 },
]);
const showListActive = ref(1);
function clickTabHandle(e) {
showListActive.value = e.id;
console.log(e.id, "id");
if (e.id == 1) {
getPhotoList(pageSize1.value, pageNum1.value);
} else if (e.id == 2) {
} else if (e.id == 3) {
} else if (e.id == 4) {
getConsumeList(pageSize2.value, pageNum2.value);
}
}
//#endregion
@@ -318,6 +330,10 @@ async function getPhotoList(pageSize, pageNum) {
PhotoList.value = res.data.list;
} catch (error) {}
}
/**
* @description:触底加载更多写真列表
*/
async function getMorePhotoList() {
try {
pageNum1.value += 1;
@@ -345,15 +361,20 @@ async function getConsumeList(pageSize, pageNum) {
ConsumeList.value = res.data.list;
} catch (error) {}
}
/**
* @description:触底加载更多消费记录
*/
async function getMoreConsumeList() {
try {
pageNum2.value += 1;
const res = await getConsumeList(pageSize2.value, pageNum2.value);
if (res.data.list.length == 0) {
const res = await getConsumeListApi(pageSize2.value, pageNum2.value);
if (res.data && res.data.list && res.data.list.length == 0) {
pageNum2.value -= 1;
}
ConsumeList.value.push(...res.data.list);
} catch (error) {
console.log(error, "error");
uni.showToast({
title: "获取数据失败,请重试",
icon: "none",
@@ -402,7 +423,10 @@ async function findGlod() {
if (!res.data) {
myGlod.value = 0;
} else {
myGlod.value = res.data.coin;
myGlod.value = res.data.digitalAvatarGlod;
userInfoModulesPinia.myGlod = res.data.digitalAvatarGlod
? res.data.digitalAvatarGlod
: 0;
}
} catch (error) {}
}
@@ -465,6 +489,14 @@ onLoad(async () => {
// }, 2000);
});
onShow(() => {
if (userInfoModulesPinia.token) {
findGlod();
getPhotoList(pageSize1.value, pageNum1.value);
getConsumeList(pageSize2.value, pageNum2.value);
}
});
//#endregion ---------------------------
//#region


+ 2
- 2
src/pages/uploadPhoto/uploadPhoto.vue View File

@@ -296,8 +296,8 @@ onLoad((options) => {
if (!res4.data) {
userInfoModulesPinia.myGlod = 0;
} else {
userInfoModulesPinia.myGlod = res4.data.coin
? res4.data.coin
userInfoModulesPinia.myGlod = res4.data.digitalAvatarGlod
? res4.data.digitalAvatarGlod
: 0;
}
uni.hideLoading();


Loading…
Cancel
Save