huangzhichao 1 éve
szülő
commit
e9f45a591d

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

@@ -1,4 +1,5 @@
 .index {
+  background: #000;
   width: 100vw;
   height: 100vh;
   display: flex;

+ 9 - 4
src/plugin/components/custom/index.less

@@ -61,12 +61,11 @@
 
       .custom-bottom {
         box-sizing: border-box;
-        width: 100%;
         height: 120rpx;
         background: #fff;
         display: flex;
-        padding: 0 24rpx;
         align-items: center;
+        padding: 0 10rpx;
 
         .logo {
           width: 80rpx;
@@ -75,11 +74,14 @@
 
         .title {
           flex: 1;
-          margin: 0 12rpx
+          padding: 0 12rpx;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow:ellipsis;
         }
 
         .button {
-          width: 180rpx;
+          padding: 0 10rpx;
           height: 66rpx;
           background: #00C25D;
           border-radius: 12rpx;
@@ -87,6 +89,9 @@
           color: #FFFFFF;
           text-align: center;
           line-height: 66rpx;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow:ellipsis;
         }
       }
     }

+ 4 - 5
src/plugin/components/custom/index.tsx

@@ -15,8 +15,6 @@ import AES from 'crypto-js/aes.js'
 let loadedMetaFiredInOnce = 0
 let pqtId
 
-console.log('YLQCustom', Taro.$global)
-
 function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
   let {
     adpId,
@@ -30,6 +28,7 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
   const [adData, setAdData] = useState<any>({})
 
   useReady(() => {
+    console.log('YLQCustom init', Taro.$global)
     init()
     pqtId = generateUUID()
     getAdConfig()
@@ -204,7 +203,7 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
 
   return (
     <>
-      {show && <View className='pq-custom' onClick={clickMask}>
+      {show && <View className='pq-custom' onClick={clickMask} style={{width: `${width}px`}}>
         <View className='custom-container'>
           {/* 广告icon */}
           <View className='icon'>
@@ -267,7 +266,7 @@ function Custom({
         style={style}
         objectFit='fill'
         controls={false}
-        autoplay
+        autoplay={false}
         loop
         src={adData.materialAddress}
         poster={adData.materialCoverPic}
@@ -277,7 +276,7 @@ function Custom({
         onClick={onClick}
         onLoadedMetaData={onLoadedMetaData}
       />
-      <View className='custom-bottom'>
+      <View className='custom-bottom' style={{width: `${width}px`}}>
         <Image src={adData.creativeLogoAddress} className='logo' />
         <View className='title'>{adData.creativeTitle}</View>
         <View className='button'>{adData.clickButtonText}</View>

+ 1 - 1
src/plugin/index.ts

@@ -6,7 +6,7 @@ function loadPlugin() {
   listenNetwork()
 }
 
-async function createTaroGlobal() {
+function createTaroGlobal() {
   const global = {
     systemInfo: Taro.getSystemInfoSync() || {},
     network: {},