408249787@qq.com 1 týždeň pred
rodič
commit
299f38e623

+ 11 - 3
pages/programming/web-view.uvue

@@ -1,19 +1,27 @@
 <script setup lang='ts'>
 import { ref, onMounted, watchEffect } from 'vue'
 import Loading from '@/components/loading.uvue'
-import { router } from '@/.cool'
+import { router, user } from '@/.cool'
 import Back from '@/components/back.uvue'
+const baseUrl = ref('https://oss.xiaoxiongcode.com/gui/index.html')
 const webviewSrc = ref('')
+
 var isLoading = ref(true)
 
 function handleLoad() {
   isLoading.value = false
 }
+function handleMessage(e) {
+  console.log(e)
+}
 
+onMounted(() => {
+  webviewSrc.value = baseUrl.value + '?token=' + user.token + '&userId=' + user.info.value?.userInfo.userId
+})
 </script>
 <template>
   <Loading v-show="isLoading" />
-  <web-view src="https://oss.xiaoxiongcode.com/scratch-gui/index.html" class="w-full h-full"
-    @load="handleLoad"></web-view>
+  <web-view id="webView1" :src="webviewSrc" class="w-full h-full" @load="handleLoad"
+    @message="handleMessage"></web-view>
 </template>
 <style lang="less" scoped></style>

+ 0 - 59
pages/user/components/conversion.uvue

@@ -1,59 +0,0 @@
-<script setup lang='ts'>
-import { fetchSubjectFeeRecord } from '@/services/subject/record'
-import { onMounted, ref } from 'vue'
-import { user } from '@/.cool'
-const recordList = ref<any[]>([])
-onMounted(() => {
-  fetchSubjectFeeRecord({
-    createdUserId: user.info.value?.userInfo.userId
-  }).then(res => {
-    recordList.value = res
-  })
-})
-</script>
-<template>
-  <view class=" bg-[#fff] shadow rounded-xl mt-[20px] text-[#00A9FF] ">
-    <scroll-view direction="vertical" :show-scrollbar="false" class="sidebar">
-      <view class="w-full grid grid-cols-2 gap-4 py-2" v-if="recordList.length > 0">
-        <view v-for="item in recordList" :key="item" class="box flex flex-row  items-center gap-2">
-          <view class="h-full">
-            <image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 13.png" mode="heightFix" class=" h-full" />
-          </view>
-          <view class="flex flex-col justify-around h-full">
-            <view class="text-[3vh]  font-bold text-[#FC500F]">
-              {{ item.mainTitle }}
-            </view>
-            <view class="text-[2vh] text-[#999]">
-              兑换时间:{{ item.createdTime }}
-            </view>
-            <view class="text-[2vh]  text-[#999]">
-              到期时间:{{ item.updateTime }}
-            </view>
-          </view>
-        </view>
-      </view>
-      <view v-else class="w-full h-full flex flex-col justify-center items-center">
-        <view class="text-center text-[#999] text-[14px]">
-          暂无兑换记录
-        </view>
-      </view>
-    </scroll-view>
-  </view>
-</template>
-<style lang="scss" scoped>
-.sidebar {
-  height: calc(80vh - 90px);
-  max-height: calc(620px - 90px);
-  padding: 20px;
-}
-
-.box {
-  width: 98%;
-  // 宽高比3/1
-  aspect-ratio: 4 / 1;
-  padding: 5px;
-  border-radius: 10px;
-  background: linear-gradient(0deg, #FFFBF7 0%, #FFE0CC 100%);
-  box-shadow: 3px 6px 4px 0px rgba(239, 103, 36, 0.48);
-}
-</style>