liyongli 2 anni fa
parent
commit
65086cb506

+ 13 - 0
src/api/SilkRoadSpringGala.js

@@ -122,3 +122,16 @@ export function getTimes(data) {
     data,
   });
 }
+
+// 礼物列表
+export function getGiftList(data) {
+    return ajax({
+      url: "prize/list",
+      method: "GET",
+      urlType: "slikRoad",
+      header:{
+          Authorization: localStorage.getItem("silkRoadToken") || "",
+      },
+      data,
+    });
+}

+ 32 - 17
src/view/SilkRoadSpringFestivalGala/pages/eight.vue

@@ -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,
+    });
   });
 }
 

+ 0 - 1
src/view/SilkRoadSpringFestivalGala/pages/six.vue

@@ -307,7 +307,6 @@ function closeTitle(type) {
     return false;
   }
   getStore({
-    userName: from.name,
     phone: from.phone,
     verifyCode: from.code,
   })