Explorar o código

Merge branch 'staging' of weapp/wx-custom-plugin into master

huangzhichao hai 1 ano
pai
achega
7ae9ba1923

+ 2 - 0
src/pages/index/index.less

@@ -1,4 +1,6 @@
 .index {
+  display: flex;
+  justify-content: center;
   width: 100vw;
   height: 100vh;
 }

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

@@ -2,11 +2,12 @@ import React from 'react'
 import { View } from '@tarojs/components'
 import './index.less'
 
-
+const adpId = 'ADY_17103126327291030'
 const Index: React.FC = () => {
   return (
     <View className='index'>
-      <calendar />
+      {/* <calendar /> */}
+      <custom props={{ adpId, width: 200 }}/>
     </View>
   )
 }

+ 1 - 0
src/plugin/components/calendar/index.scss

@@ -1 +1,2 @@
+	
 @import "~taro-ui/dist/style/components/calendar.scss";

+ 4 - 1
src/plugin/components/calendar/index.tsx

@@ -1,9 +1,12 @@
 import { View } from '@tarojs/components'
+import { AtCalendar } from "taro-ui"
 import './index.scss'
 
 function Index() {
   return (
-    <View></View>
+    <View>
+      <AtCalendar />
+    </View>
   )
 }
 

+ 0 - 1
src/plugin/components/custom/index.tsx

@@ -109,7 +109,6 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
       'wx5ef216d1caf4a0ea',
       `/pages/ad-launch-page/index?q=${path}`
     )
-    console.log(`/pages/ad-launch-page/index?q=${path}`)
   }
 
   function videoLoad() {

+ 8 - 0
src/plugin/share/index.ts

@@ -1,3 +1,4 @@
+import Taro from '@tarojs/taro'
 import { PropsWithChildren } from 'react'
 
 export const noop = () => {}
@@ -12,6 +13,13 @@ export function wrapProps(props: PropsWithChildren<CustomPropsType>) {
     onClose = noop
   } = props
 
+
+
+  if (!width) {
+    const windowInfo = Taro.getWindowInfo()
+    width = windowInfo?.windowWidth
+  }
+
   return {
     adpId,
     width,