Explorar o código

活动权益展示页修改

zuy hai 1 ano
pai
achega
1df438d180
Modificáronse 2 ficheiros con 35 adicións e 9 borrados
  1. 3 0
      src/api/index.ts
  2. 32 9
      src/pages-common/activity/activity.vue

+ 3 - 0
src/api/index.ts

@@ -34,3 +34,6 @@ export function cancelApplyInvoice() {
 export function fetchInvoicePDF(invoiceId: string) {
   return indexHttp.get(`/invoice/downloadInvoice/${invoiceId}`);
 }
+export function fetchActivity(activityId: string) {
+  return indexHttp.get(`/activity/${activityId}`);
+}

+ 32 - 9
src/pages-common/activity/activity.vue

@@ -35,9 +35,9 @@
 </template>
 
 <script setup lang="ts">
-import {fetchProfile} from "../../api/user";
 import {onLoad} from "@dcloudio/uni-app";
 import {ref} from "vue";
+import {fetchActivity} from "@/api";
 
 const desc = ref<string[]>([]);
 const activity = ref();
@@ -46,18 +46,41 @@ onLoad((options: any) => {
   uni.showLoading({
     title: "加载中",
   });
-  fetchProfile().then((res) => {
-    //TODO 改为活动接口查询
-    const a = res.activityList.find((item: any) => item.id == options.id);
-    // desc.value = a?.activityDesc?.split("\n");
-    activity.value = a;
-    if (a && a.name) {
+
+  // let {activityDesc,activityName,activityDescPage} = options;
+  // desc.value = activityDesc?.split("\n");
+  // activity.value = {
+  //   name:activityName,
+  //   activityDesc:activityDesc,
+  //   activityDescPage:activityDescPage,
+  // }
+  // if(activityName){
+  //   uni.setNavigationBarTitle({
+  //     title:activityName
+  //   });
+  // }
+
+  fetchActivity(options.id).then((res) => {
+    // desc.value = res.activityDesc?.split("\n");
+    activity.value = res;
+    if (res && res.name) {
       uni.setNavigationBarTitle({
-        title: a.name
+        title: res.name
       });
     }
     uni.hideLoading();
-  });
+  })
+  // fetchProfile().then((res) => {
+  //   const a = res.activityList.find((item: any) => item.id == options.id);
+  //   // desc.value = a?.activityDesc?.split("\n");
+  //   activity.value = a;
+  //   if (a && a.name) {
+  //     uni.setNavigationBarTitle({
+  //       title: a.name
+  //     });
+  //   }
+  //   uni.hideLoading();
+  // });
 });
 </script>