|
@@ -85,7 +85,11 @@
|
|
|
<script setup>
|
|
|
import { reactive, ref, defineEmits, defineExpose } from "vue";
|
|
|
import { showDialog, showToast, showConfirmDialog } from "vant";
|
|
|
-import { getDrawOri, getUpdateOri } from "@/api/SilkRoadSpringGala.js";
|
|
|
+import {
|
|
|
+ getDrawOri,
|
|
|
+ getUpdateOri,
|
|
|
+ getGiftList,
|
|
|
+} from "@/api/SilkRoadSpringGala.js";
|
|
|
// import { onMounted, reactive } from "vue";
|
|
|
// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
|
/**
|
|
@@ -147,14 +151,16 @@ function draw() {
|
|
|
placeholder="请输入昵称"
|
|
|
/>
|
|
|
);
|
|
|
+ const showName = !nickName.value;
|
|
|
+ const showAddress = !address.value;
|
|
|
showConfirmDialog({
|
|
|
title: "获得" + r.name,
|
|
|
message: () => {
|
|
|
return (
|
|
|
<div>
|
|
|
<img src={r.url} style="width: 5em" />
|
|
|
- {!nickName.value ? nickNameEle : ""}
|
|
|
- {!address.value ? field : ""}
|
|
|
+ {showName ? nickNameEle : ""}
|
|
|
+ {showAddress ? field : ""}
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
@@ -178,21 +184,30 @@ function draw() {
|
|
|
}
|
|
|
|
|
|
function mygift() {
|
|
|
- showConfirmDialog({
|
|
|
- title: "奖品",
|
|
|
- confirmButtonText: "关闭",
|
|
|
- message: () => {
|
|
|
- return (
|
|
|
- <div>
|
|
|
- <van-card
|
|
|
- num="1"
|
|
|
- title="商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题"
|
|
|
- thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ getGiftList({
|
|
|
+ phone: localStorage.getItem("silkRoadPhone"),
|
|
|
+ }).then(r => {
|
|
|
+ console.log(r);
|
|
|
+ const giftList = r || [];
|
|
|
+ const cardList = [];
|
|
|
+ for (let i = 0; i < giftList.length; i++) {
|
|
|
+ const v = giftList[i];
|
|
|
+ cardList.push(
|
|
|
+ <van-card
|
|
|
+ num="1"
|
|
|
+ title={v.prize ? v.prize.name : ""}
|
|
|
+ thumb={v.prize ? v.prize.url : ""}
|
|
|
+ />
|
|
|
);
|
|
|
- },
|
|
|
- showCancelButton: false,
|
|
|
+ }
|
|
|
+ showConfirmDialog({
|
|
|
+ title: "奖品",
|
|
|
+ confirmButtonText: "关闭",
|
|
|
+ message: () => {
|
|
|
+ return <div>{cardList}</div>;
|
|
|
+ },
|
|
|
+ showCancelButton: false,
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|