Browse Source

feat: 测试

huangzhichao 1 năm trước cách đây
mục cha
commit
526c1a1ec9

+ 0 - 0
src/http/index.ts


+ 2 - 3
src/pages/index/index.tsx

@@ -1,7 +1,7 @@
 import Taro, { useLoad } from '@tarojs/taro'
 import React from 'react'
 import { View } from '@tarojs/components'
-import Demo from '@/pages/components/demo/index'
+// import Demo from '@/pages/components/demo/index'
 import './index.less'
 
 // console.log(Demo)
@@ -22,8 +22,7 @@ const Index: React.FC = () => {
 
   return (
     <View className='index'>
-      {/* <Demo width="123"></Demo> */}
-      <custom width="1000" props={{width: "300"}} onClick={hasCllick}/>
+      <custom props={{width: "300"}} />
     </View>
   )
 }

+ 23 - 43
src/plugin/components/custom/index.tsx

@@ -1,44 +1,26 @@
 import Taro, { useLoad, useReady } from '@tarojs/taro'
 import { View, Video, Navigator, Button, FunctionalPageNavigator } from '@tarojs/components'
-import React from 'react'
 import './index.less'
+import React, { PropsWithChildren } from 'react'
 
-const Custom: React.FC = (props) => {
+const Custom: React.FC = (props: PropsWithChildren<CustomPropsType>) => {
   function clickCustom() {
     console.log(props)
   }
 
-  const customWidth = props.width || 100
+  const customWidth = props.width
 
-  useReady(async () => {
-    // console.log(ctx.$scope.data.props)
-    // Taro.getSetting({
-    //   success(res) {
-    //     console.log('getSetting', res)
-    //   }
-    // })
-
-    // Taro.getUserInfo({
-    //   withCredentials: true,
-    //   success(res) {
-    //     console.log('success', res)
-    //   },
-    //   fail(res) {
-    //     console.log('fail', res)
-    //   }
-    // })
-
-    // const systemInfo = await Taro.getNetworkType()
-    // console.log(systemInfo)
-
-    // Taro.login({
-    //   success(res) {
-    //     console.log('success', res)
-    //   },
-    //   fail(res) {
-    //     console.log('fail', res)
-    //   }
-    // })
+  useReady(() => {
+    Taro.request({
+      url: 'https://api.piaoquantv.com/ad/self/inAbPredict',
+      method: 'POST',
+      success(res) {
+        console.log(res)
+      },
+      fail(err) {
+        console.log(err)
+      }
+    })
   })
 
   function clickPayment() {
@@ -64,10 +46,8 @@ const Custom: React.FC = (props) => {
   }
 
   return (
-    <View onClick={clickCustom}>
-      <View>{customWidth}</View>
-      <View>123</View>
-      {/*a <Navigator url='plugin-private://wxf7261ed54f2e450e/pages/h5/index'>
+    <View onClick={clickCustom} style={{width: customWidth + 'px'}}>
+      <Navigator url='plugin-private://wxf7261ed54f2e450e/pages/h5/index'>
         <Button>H5</Button>
       </Navigator>
 
@@ -77,20 +57,20 @@ const Custom: React.FC = (props) => {
 
       <Navigator url='plugin-private://wxf7261ed54f2e450e/pages/webview/index'>
         <Button>全屏</Button>
-      </Navigator> */}
+      </Navigator>
 
-      {/* <Navigator url='plugin-private://wxf7261ed54f2e450e/pages/webview/index'>
-        <Video autoplay controls={false} loop src='https://xycdn.yishihui.com/ad/prod/video/material_AD_1700025739_1700025739924.mp4' />
-      </Navigator> */}
-      {/* <Button onClick={clickPayment}>支付</Button> */}
-      {/* <FunctionalPageNavigator
+      <Navigator url='plugin-private://wxf7261ed54f2e450e/pages/webview/index'>
+        {/* <Video autoplay controls={false} loop src='https://xycdn.yishihui.com/ad/prod/video/material_AD_1700025739_1700025739924.mp4' /> */}
+      </Navigator>
+      <Button onClick={clickPayment}>支付</Button>
+      <FunctionalPageNavigator
         name="loginAndGetUserInfo"
         version="develop"
         onSuccess={loginSuccess}
         onFail={loginFail}
       >
         <Button className="login">登录到插件</Button>
-      </FunctionalPageNavigator> */}
+      </FunctionalPageNavigator>
     </View>
   )
 }

+ 2 - 2
src/plugin/pages/miniWeb/index.tsx

@@ -23,8 +23,8 @@ const MiniWeb: React.FC = () => {
 
   function btnClick() {
     Taro.openEmbeddedMiniProgram({
-      appId: 'wx89e7eb06478361d7',
-      path: 'pages/category'
+      appId: 'wxdd07a068bf2e6ef4',
+      path: 'pages/middlepage/middlepage?paramKey=fdc2ab9b532143aea717520b5f9b8f10'
     })
   }
 

+ 2 - 2
src/plugin/pages/webview/index.tsx

@@ -8,8 +8,8 @@ let count = 0
 const Webview: React.FC = () => {
   useDidShow(() => {
     Taro.navigateToMiniProgram({
-      appId: 'wx89e7eb06478361d7',
-      path: 'pages/category'
+      appId: 'wxdd07a068bf2e6ef4',
+      path: 'pages/middlepage/middlepage?paramKey=fdc2ab9b532143aea717520b5f9b8f10'
     })
     count++
     console.log(count)

+ 4 - 0
types/global.d.ts

@@ -24,3 +24,7 @@ declare namespace JSX {
 }
 
 declare const wx
+
+type CustomPropsType = {
+  width: number
+}