瀏覽代碼

fix(app): 活动报名成功

EvilDragon 4 月之前
父節點
當前提交
840d2247de

+ 1 - 0
packages/app/src/main.ts

@@ -4,6 +4,7 @@ import store from './store'
 import { routeInterceptor, requestInterceptor, prototypeInterceptor } from './interceptors'
 import 'virtual:uno.css'
 import '@/style/index.scss'
+import '@/style/fonts.css'
 import '@/core/themes/default.scss'
 
 export function createApp() {

+ 38 - 25
packages/app/src/pages/home/activity/detail/index.vue

@@ -18,6 +18,7 @@ import { ConfigProviderThemeVars } from 'wot-design-uni'
 import SectionHeading from '@/components/section-heading.vue'
 import AvatarGroupCasual from '@/components/avatar-group-casual/avatar-group-casual.vue'
 import { calendar, clock, funnel, location, user } from '@designer-hub/assets/src/icons'
+import { signupSuccessDialogBg } from '@designer-hub/assets/src/bgs'
 import { NetImages } from '../../../../core/libs/net-images'
 
 const themeVars = ref<ConfigProviderThemeVars>({
@@ -36,7 +37,7 @@ const { data: signups, run: setSignups } = useRequest(
 )
 const show = ref(false)
 const successShow = ref(false)
-const listShow = ref(false)
+const listShow = ref(true)
 const isActivity = computed(() => type.value === 'activity')
 const isStudyTour = computed(() => type.value === 'studyTour')
 const infos = computed(() => [
@@ -213,23 +214,22 @@ onLoad(async (query: { id: string; type: 'activity' }) => {
     <wd-action-sheet v-model="show">
       <view class="px-3.5 py-10">
         <div class="flex gap-5 mb-13.5">
-          <div class="w-[110px] h-[94px] bg-[#f6f6f6] rounded-2xl"></div>
+          <div class="w-[110px] h-[94px] bg-[#f6f6f6] rounded-2xl">
+            <wd-img width="100%" height="100%" :src="data.thumbnailUrl"></wd-img>
+          </div>
           <div class="flex flex-col justify-between flex-1">
             <div class="text-black text-base font-normal font-['PingFang SC'] leading-normal">
-              阿芙佳朵
+              {{ data.name }}
             </div>
-            <div class="flex items-center gap-1">
-              <div class="text-[#ef4343] text-[22px] font-normal font-['D-DIN Exp'] leading-normal">
-                1000
-              </div>
-              <div class="text-black/40 text-sm font-normal font-['PingFang SC'] leading-[34px]">
-                积分
+            <div class="flex items-end gap-1">
+              <div class="text-[#ef4343] text-[22px] font-normal leading-[22px]">
+                {{ data.needPointsCount }}
               </div>
-              <div class="text-black/40 text-xs font-normal font-['PingFang SC'] leading-[34px]">
-                剩余:9003
+              <div class="text-black/40 text-sm font-normal font-['PingFang SC']">积分</div>
+              <div class="ml-1 text-black/40 text-xs font-normal font-['PingFang SC']">
+                剩余:{{ data.activityAllowCount }}
               </div>
               <div class="flex-1"></div>
-              <!-- <wd-input-number /> -->
             </div>
           </div>
         </div>
@@ -252,20 +252,33 @@ onLoad(async (query: { id: string; type: 'activity' }) => {
       </view>
     </wd-overlay>
     <wd-overlay :show="successShow" @click="successShow = false">
-      <view class="flex h-full items-center justify-center">
-        <div class="flex flex-col gap-5 bg-white">
-          <div class="flex gap-1.5">
-            <wd-icon name="error-circle" size="22px"></wd-icon>
-            <div
-              class="w-[151px] h-[21px] text-justify text-black/40 text-base font-normal font-['PingFang SC'] leading-[21px]"
-            >
-              请准时参加活动!
-            </div>
+      <view class="flex mx-10 h-full items-center justify-center">
+        <div class="w-full flex flex-col gap-5 aspect-[1.12/1] relative">
+          <div class="absolute top-0 left-0 right-0 bottom-0 z--1">
+            <wd-img width="100%" height="100%" :src="signupSuccessDialogBg"></wd-img>
           </div>
-          <div
-            class="w-[237px] h-[60px] text-justify text-black/60 text-base font-normal font-['PingFang SC'] leading-normal"
-          >
-            如有问题可咨询官方客服或您的专属经纪人!
+          <div class="h-full box-border py-5 px-7.25 flex flex-col justify-between">
+            <div class="flex justify-between">
+              <div class="text-justify text-white text-2xl font-bold font-['Alimama_ShuHeiTi']">
+                报名成功
+              </div>
+              <wd-icon name="close" color="white" size="22px"></wd-icon>
+            </div>
+            <div class="flex flex-col justify-center aspect-[1.46/1] gap-5">
+              <div class="flex gap-1.5">
+                <wd-icon name="error-circle" size="22px"></wd-icon>
+                <div
+                  class="w-[151px] h-[21px] text-justify text-black text-base font-normal font-['PingFang SC'] leading-[21px]"
+                >
+                  请准时参加活动!
+                </div>
+              </div>
+              <div
+                class="w-[237px] h-[60px] text-justify text-black/60 text-base font-normal font-['PingFang SC'] leading-normal"
+              >
+                如有问题可咨询官方客服或您的专属经纪人!
+              </div>
+            </div>
           </div>
         </div>
       </view>

+ 1 - 1
packages/app/src/pages/material/detail/index.vue

@@ -7,7 +7,7 @@ import SectionHeading from '@/components/section-heading.vue'
 import { getMaterialDetail, getByDictType, getMaterialHomePage } from '../../../core/libs/requests'
 import NavbarEvo from '@/components/navbar-evo.vue'
 import { DictType } from '../../../core/models/moment'
-import { materialDealers, close, phone } from '../../../core/libs/svgs'
+import { phone } from '../../../core/libs/svgs'
 import { handleCall } from '../../../core/utils/common'
 import router from '@designer-hub/assets/src/assets/svgs/router'
 

+ 2 - 1
packages/app/src/pages/material/index.vue

@@ -7,10 +7,11 @@ import Card from '@/components/card.vue'
 import SectionHeading from '@/components/section-heading.vue'
 import { abc, calculator } from '../../core/libs/pngs'
 import { getAppMaterials, getBanners, getByDictType } from '../../core/libs/requests'
-import { materialDealers, close, phone } from '../../core/libs/svgs'
+import { close, phone } from '../../core/libs/svgs'
 import { BannerMode, DictType, MaterialDealer, MaterialsList } from '../../core/models/moment'
 import router from '@designer-hub/assets/src/assets/svgs/router'
 import Banner from '../home/components/banner.vue'
+import materialDealers from '@designer-hub/assets/src/libs/assets/materialDealers'
 
 const { data: materialDealerData, run: setMaterialDealerData } = useRequest(
   () => getAppMaterials(),

+ 1 - 1
packages/app/src/pages/mine/agents/index.vue

@@ -3,7 +3,7 @@
 </route>
 <script setup lang="ts">
 import Card from '@/components/card.vue'
-import { materialDealers, close, phone } from '../../../core/libs/svgs'
+import { phone } from '../../../core/libs/svgs'
 
 const data = ref([{}, {}, {}])
 const handleClick = () => {

+ 27 - 0
packages/app/src/pages/mine/homepage/index.vue

@@ -28,12 +28,39 @@ const tabs = ref([
   { label: '视频', value: '0' },
 ])
 onMounted(async () => {})
+function getVideoListByAccessToken(accessToken, openid) {
+  const VIDEO_API = 'https://api.weixin.qq.com/wxa/business/getuservideo'
+
+  uni.request({
+    url: VIDEO_API,
+    method: 'POST',
+    header: {
+      'Content-Type': 'application/json',
+    },
+    data: {
+      access_token: accessToken,
+      openid,
+      // 可以添加其他参数,如offset, limit
+    },
+    success: function (res) {
+      // 获取视频号列表成功
+      console.log('视频号列表:', res.data)
+    },
+    fail: function (error) {
+      console.log('获取视频号列表失败', error)
+    },
+  })
+}
 onLoad(async (query: { id: string }) => {
   if (query.id) {
     id.value = query.id
   } else {
     id.value = userInfo.value.userId
   }
+  // uni.request({
+  //   url: '',
+  // })
+  getVideoListByAccessToken(userInfo.value.accessToken, userInfo.value.openid)
 })
 onShareAppMessage(() => ({ title: `${userInfo.value.nickname}` }))
 defineExpose({

二進制
packages/app/src/static/font-faces/subset-AlimamaShuHeiTi-Bold.woff


二進制
packages/app/src/static/font-faces/subset-AlimamaShuHeiTi-Bold.woff2


+ 9 - 0
packages/app/src/style/fonts.css

@@ -0,0 +1,9 @@
+@font-face {
+  font-family: 'Alimama ShuHeiTi';
+  font-style: normal;
+  font-weight: bold;
+  src:
+    url('/static/font-faces/subset-AlimamaShuHeiTi-Bold.woff2') format('woff2'),
+    url('/static/font-faces/subset-AlimamaShuHeiTi-Bold.woff') format('woff');
+  font-display: swap;
+}

+ 3 - 1
packages/assets/package.json

@@ -3,7 +3,9 @@
   "private": true,
   "version": "0.0.0",
   "type": "module",
-  "scripts": {},
+  "scripts": {
+    "generator": "cd src && node ./generator.js"
+  },
   "devDependencies": {
     "typescript": "^5.5.3",
     "vite": "^5.4.1"

File diff suppressed because it is too large
+ 6 - 0
packages/assets/src/assets/material-dealers.svg


+ 10 - 0
packages/assets/src/assets/svgs/signup_success_model.svg

@@ -0,0 +1,10 @@
+<svg width="293" height="262" viewBox="0 0 293 262" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="271" height="171" rx="16" transform="matrix(-1 0 0 1 282 0)" fill="url(#paint0_linear_1900_298)"/>
+<path d="M293 96.0283C293 87.6385 286.519 80.6735 278.151 80.0698L17.1515 61.2375C7.88547 60.569 0 67.906 0 77.1961V246C0 254.837 7.16345 262 16 262H277C285.837 262 293 254.837 293 246V96.0283Z" fill="white"/>
+<defs>
+<linearGradient id="paint0_linear_1900_298" x1="-8" y1="93" x2="271" y2="-15" gradientUnits="userSpaceOnUse">
+<stop offset="0.0995896" stop-color="#121114"/>
+<stop offset="1" stop-color="#444245"/>
+</linearGradient>
+</defs>
+</svg>

+ 0 - 0
packages/assets/src/assets/test.svg


+ 0 - 0
packages/assets/src/assets/testa.png


+ 2 - 0
packages/assets/src/bgs.ts

@@ -0,0 +1,2 @@
+import signupSuccessDialogBg from "./bgs/signupSuccessDialogBg";
+export { signupSuccessDialogBg };

+ 2 - 0
packages/assets/src/bgs/signupSuccessDialogBg.ts

@@ -0,0 +1,2 @@
+import signupSuccessDialogBg from "../assets/svgs/signup_success_model.svg";
+export default signupSuccessDialogBg;

+ 72 - 0
packages/assets/src/generator.js

@@ -0,0 +1,72 @@
+
+// const fs = require('fs');
+// const path = require('path');
+import * as path from 'path'
+import * as fs from 'fs';
+import { log } from 'console';
+
+// 选定assets文件夹路径
+const assetsPath = 'assets';
+
+// 选定ts文件夹路径
+const tsPath = './libs';
+
+// 生成ts文件路径
+const tsAssetsPath = path.join(tsPath, assetsPath);
+
+// 读取assets文件夹下的所有文件
+fs.readdir(assetsPath, (err, files) => {
+  if (err) {
+    console.error(err);
+    return;
+  }
+
+  // 遍历每个文件
+  files.forEach((file) => {
+    const filePath = path.join(assetsPath, file);
+    const stat = fs.statSync(filePath);
+
+    if (stat.isDirectory()) {
+      console.log(`dir: ${filePath}`);
+    } else if (stat.isFile()) {
+      // console.log(`file: ${filePath}`);
+      // 生成ts文件名称和内容
+      const fileName = path.basename(file, path.extname(file)).replace(/-([a-z])/g, (_, letter) => letter.toUpperCase())
+      const tsFileName = fileName + '.ts';
+      const tsFilePath = path.join(tsAssetsPath, tsFileName);
+      console.log()
+      console.log('tsName:' + tsFileName)
+      // console.log('tsFilePath:' + tsFilePath)
+      let tsFileContent = `import ${fileName} from '../../assets/${path.basename(file).toString()}' \n export default ${fileName}`;
+
+
+      // try {
+      //   // 读取assets文件的内容
+      //   const fileContent = fs.readFileSync(filePath, 'utf8');
+      //   if (fileContent.includes('<svg')) {
+      //     // svg文件内容
+      //     const match = fileContent.match(/<svg[^>]*>(.*?)<\/svg>/s);
+      //     if (match) {
+      //       tsFileContent += `import icon${path.basename(file, path.extname(file))} from './assets/${file}';\n`;
+      //       tsFileContent += `export default ${match[1].trim()};\n\n`;
+      //     }
+      //   } else if (fileContent.includes('.png')) {
+      //     // png文件内容
+      //     const match = fileContent.match(/data:image\/png;,\s*base64\((.*?)\)/);
+      //     if (match) {
+      //       tsFileContent += `import icon${path.basename(file, path.extname(file))} from './assets/${file}';\n`;
+      //       tsFileContent += `export default ${match[1].trim()};\n\n`;
+      //     }
+      //   }
+      // } catch (error) {
+      //   console.error(error);
+      //   return;
+      // }
+
+      // 写入ts文件
+      fs.writeFileSync(tsFilePath, tsFileContent);
+
+      console.log(`ts file ${tsFileName} created!`);
+    }
+  });
+});

+ 0 - 8
packages/assets/src/index.ts

@@ -1,8 +0,0 @@
-export * from "./svgs";
-export * from "./assets/svgs";
-
-export const getAssets = (path: string) => {
-  const fullPath = `/src/assets/${path}`;
-  console.log(import.meta, fullPath);
-  return (import.meta as any).globEager("/src/assets/**/*")[fullPath].default;
-};

+ 2 - 0
packages/assets/src/libs/assets/materialDealers.ts

@@ -0,0 +1,2 @@
+import materialDealers from '../../assets/material-dealers.svg' 
+ export default materialDealers

+ 2 - 0
packages/assets/src/libs/assets/test.ts

@@ -0,0 +1,2 @@
+import test from '../../assets/test.svg' 
+ export default test

+ 2 - 0
packages/assets/src/libs/assets/testa.ts

@@ -0,0 +1,2 @@
+import testa from '../../assets/testa.png' 
+ export default testa

+ 70 - 24
packages/assets/src/main.ts

@@ -1,24 +1,70 @@
-import './style.css'
-import typescriptLogo from './typescript.svg'
-import viteLogo from '/vite.svg'
-import { setupCounter } from './counter.ts'
-
-document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
-  <div>
-    <a href="https://vitejs.dev" target="_blank">
-      <img src="${viteLogo}" class="logo" alt="Vite logo" />
-    </a>
-    <a href="https://www.typescriptlang.org/" target="_blank">
-      <img src="${typescriptLogo}" class="logo vanilla" alt="TypeScript logo" />
-    </a>
-    <h1>Vite + TypeScript</h1>
-    <div class="card">
-      <button id="counter" type="button"></button>
-    </div>
-    <p class="read-the-docs">
-      Click on the Vite and TypeScript logos to learn more
-    </p>
-  </div>
-`
-
-setupCounter(document.querySelector<HTMLButtonElement>('#counter')!)
+import "./style.css";
+import typescriptLogo from "./typescript.svg";
+import viteLogo from "/vite.svg";
+import { setupCounter } from "./counter.ts";
+
+// document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
+//   <div>
+//     <a href="https://vitejs.dev" target="_blank">
+//       <img src="${viteLogo}" class="logo" alt="Vite logo" />
+//     </a>
+//     <a href="https://www.typescriptlang.org/" target="_blank">
+//       <img src="${typescriptLogo}" class="logo vanilla" alt="TypeScript logo" />
+//     </a>
+//     <h1>Vite + TypeScript</h1>
+//     <div class="card">
+//       <button id="counter" type="button"></button>
+//     </div>
+//     <p class="read-the-docs">
+//       Click on the Vite and TypeScript logos to learn more
+//     </p>
+//   </div>
+// `
+
+// setupCounter(document.querySelector<HTMLButtonElement>('#counter')!)
+
+// index.ts
+
+import fs from "fs/promises";
+import { log } from "console";
+
+const assetsPath = "./assets";
+const tsPath = "./tsFiles";
+
+async function main() {
+  console.log(1111);
+
+  const files = await fs.readdir(assetsPath);
+  for (const file of files) {
+    const filePath = path.join(assetsPath, file);
+    const stat = await fs.stat(filePath);
+
+    if (stat.isDirectory()) {
+      console.log(`dir: ${filePath}`);
+    } else if (stat.isFile() && ["svg", "png"].includes(path.extname(file))) {
+      // 生成 ts files
+      generateTsFile(filePath);
+    }
+  }
+}
+
+async function generateTsFile(filePath) {
+  const fileContent = fs.readFile(filePath, "utf8");
+  if (fileContent.includes("<svg")) {
+    // svg文件内容
+    const match = fileContent.match(/<svg[^>]*>(.*?)<\/svg>/s);
+    if (match) {
+      console.log(`icon ${filePath} created!`);
+    }
+  } else if (fileContent.includes(".png")) {
+    // png文件内容
+    const match = fileContent.match(/data:image\/png;,\s*base64\((.*?)\)/);
+    if (match) {
+      console.log(`icon ${filePath} created!`);
+    }
+  }
+}
+
+main().catch((error) => {
+  console.error(error);
+});

+ 14 - 0
packages/assets/vite.config.ts

@@ -0,0 +1,14 @@
+// vite.config.js
+
+import { defineConfig } from "vite";
+
+export default defineConfig({
+  // base: './',
+  plugins: [
+    // ...
+  ],
+  // ...其他配置选项
+  build: {
+    sourcemap: true,
+  },
+});

Some files were not shown because too many files changed in this diff