|
@@ -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>
|
|
|
)
|
|
|
}
|