|
@@ -2,7 +2,11 @@
|
|
|
<view class="winnerListContent">
|
|
|
<view class="title">奖励记录</view>
|
|
|
<view class="content">
|
|
|
- <empty-box v-if="list.length == 0" text="暂无奖励记录" src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/no-data.png"></empty-box>
|
|
|
+ <empty-box
|
|
|
+ v-if="list.length == 0"
|
|
|
+ text="暂无奖励记录"
|
|
|
+ src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/no-data.png"
|
|
|
+ ></empty-box>
|
|
|
<view v-for="(item, index) in list" :key="item.id" class="activityItem">
|
|
|
<view class="top flex-start-center">
|
|
|
<image
|
|
@@ -31,7 +35,7 @@
|
|
|
<view
|
|
|
class="widthBtn"
|
|
|
:class="isWithDraw(item.processStatus) ? 'active' : 'static'"
|
|
|
- @click="onPayment(item)"
|
|
|
+ @click="onPayment(item, '1')"
|
|
|
>{{ isWithDraw(item.processStatus) ? "提现" : "提现成功" }}</view
|
|
|
>
|
|
|
</view>
|
|
@@ -42,102 +46,102 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
|
|
-import { ref,reactive } from "vue";
|
|
|
+import { ref, reactive } from "vue";
|
|
|
import { auditSuccessList, payment } from "@/services/ams";
|
|
|
-import emptyBox from '@/components/emptyBox.vue'
|
|
|
-
|
|
|
+import emptyBox from "@/components/emptyBox.vue";
|
|
|
+import { useDraw } from "@/hooks/useDraw";
|
|
|
|
|
|
+const { onPayment, isWithDraw } = useDraw();
|
|
|
|
|
|
const openid = uni.getStorageSync("openid");
|
|
|
-const appid = uni.getStorageSync("appid");
|
|
|
+// const appid = uni.getStorageSync("appid");
|
|
|
const list = <any>ref([]);
|
|
|
-const params =<any>reactive({
|
|
|
- pageSize:10,
|
|
|
- pageNum:1,
|
|
|
- currentPage:0
|
|
|
-})
|
|
|
+const params = <any>reactive({
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 1,
|
|
|
+ currentPage: 0,
|
|
|
+});
|
|
|
|
|
|
-let isBtn = ref(true);
|
|
|
+// let isBtn = ref(true);
|
|
|
|
|
|
const getList = () => {
|
|
|
- auditSuccessList({ openid,...params }).then((res: any) => {
|
|
|
- params.currentPage = Math.ceil(res.total / params.pageSize)
|
|
|
- list.value = [...list.value,...res.rows];
|
|
|
+ auditSuccessList({ openid, ...params }).then((res: any) => {
|
|
|
+ params.currentPage = Math.ceil(res.total / params.pageSize);
|
|
|
+ list.value = [...list.value, ...res.rows];
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const onPayment = (data: any) => {
|
|
|
- if(!isWithDraw(data.processStatus)) return
|
|
|
- if(!isBtn.value) return
|
|
|
- isBtn.value = false
|
|
|
- const status =
|
|
|
- data.processStatus === "3" ||
|
|
|
- data.processStatus === "5" ||
|
|
|
- data.processStatus === "6";
|
|
|
- if (!status) return;
|
|
|
- payment(data.id)
|
|
|
- .then((res: any) => {
|
|
|
- if (res.code === 500) {
|
|
|
- uni.showToast({ icon: "none", title: "提现中" });
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (wx.canIUse("requestMerchantTransfer") && res.data && res.data.packageInfo) {
|
|
|
- wx.requestMerchantTransfer({
|
|
|
- mchId: res.data.merchantId,
|
|
|
- appId: appid,
|
|
|
- package: res.data.packageInfo,
|
|
|
- success: (response: any) => {
|
|
|
- uni.showToast({ icon: "success", title: "请求成功" });
|
|
|
- // getList();
|
|
|
- setTimeout(() => {
|
|
|
- uni.switchTab({
|
|
|
- url: "/pages/my/index",
|
|
|
- });
|
|
|
- }, 500);
|
|
|
+// const onPayment = (data: any) => {
|
|
|
+// if (!isWithDraw(data.processStatus)) return;
|
|
|
+// if (!isBtn.value) return;
|
|
|
+// isBtn.value = false;
|
|
|
+// const status =
|
|
|
+// data.processStatus === "3" ||
|
|
|
+// data.processStatus === "5" ||
|
|
|
+// data.processStatus === "6";
|
|
|
+// if (!status) return;
|
|
|
+// payment(data.id)
|
|
|
+// .then((res: any) => {
|
|
|
+// if (res.code === 500) {
|
|
|
+// uni.showToast({ icon: "none", title: "提现中" });
|
|
|
+// return;
|
|
|
+// }
|
|
|
|
|
|
- // res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
|
|
|
- // console.log("success:", res);
|
|
|
- },
|
|
|
- fail: (response: any) => {
|
|
|
- // uni.showToast({ icon: "none", title: "提现中" });
|
|
|
- },
|
|
|
- });
|
|
|
- } else {
|
|
|
- if(!res.data || !res.data.packageInfo) {
|
|
|
- uni.showToast({ icon: "none", title: "提现中" });
|
|
|
- }else {
|
|
|
- wx.showModal({
|
|
|
- content: "你的微信版本过低,请更新至最新版本。",
|
|
|
- showCancel: false,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log('-----------------------')
|
|
|
- uni.showToast({ icon: "none", title: err.msg });
|
|
|
- });
|
|
|
- setTimeout(()=>{
|
|
|
- isBtn.value = true
|
|
|
- },1500)
|
|
|
-};
|
|
|
-
|
|
|
-const isWithDraw = (status: string) => {
|
|
|
- return status === "3" || status === "5" || status === "6";
|
|
|
-};
|
|
|
+// if (
|
|
|
+// wx.canIUse("requestMerchantTransfer") &&
|
|
|
+// res.data &&
|
|
|
+// res.data.packageInfo
|
|
|
+// ) {
|
|
|
+// wx.requestMerchantTransfer({
|
|
|
+// mchId: res.data.merchantId,
|
|
|
+// appId: appid,
|
|
|
+// package: res.data.packageInfo,
|
|
|
+// success: (response: any) => {
|
|
|
+// uni.showToast({ icon: "success", title: "请求成功" });
|
|
|
+// setTimeout(() => {
|
|
|
+// uni.switchTab({
|
|
|
+// url: "/pages/my/index",
|
|
|
+// });
|
|
|
+// }, 500);
|
|
|
+// },
|
|
|
+// fail: (response: any) => {
|
|
|
+// // uni.showToast({ icon: "none", title: "提现中" });
|
|
|
+// },
|
|
|
+// });
|
|
|
+// } else {
|
|
|
+// if (!res.data || !res.data.packageInfo) {
|
|
|
+// uni.showToast({ icon: "none", title: "提现中" });
|
|
|
+// } else {
|
|
|
+// wx.showModal({
|
|
|
+// content: "你的微信版本过低,请更新至最新版本。",
|
|
|
+// showCancel: false,
|
|
|
+// });
|
|
|
+// }
|
|
|
+// }
|
|
|
+// })
|
|
|
+// .catch((err) => {
|
|
|
+// console.log("-----------------------");
|
|
|
+// uni.showToast({ icon: "none", title: err.msg });
|
|
|
+// });
|
|
|
+// setTimeout(() => {
|
|
|
+// isBtn.value = true;
|
|
|
+// }, 1500);
|
|
|
+// };
|
|
|
|
|
|
+// const isWithDraw = (status: string) => {
|
|
|
+// return status === "3" || status === "5" || status === "6";
|
|
|
+// };
|
|
|
|
|
|
onLoad(() => {
|
|
|
getList();
|
|
|
});
|
|
|
|
|
|
-onReachBottom(()=>{
|
|
|
- if (params.pageNum < params.currentPage) {
|
|
|
- params.pageNum ++
|
|
|
- getList()
|
|
|
- }
|
|
|
-})
|
|
|
+onReachBottom(() => {
|
|
|
+ if (params.pageNum < params.currentPage) {
|
|
|
+ params.pageNum++;
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|