王士厅
Showing 23 changed files with 818 additions and 375 deletions
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M6.29805,13.2927L19.701900000000002,20.8323C19.8353,20.9073,20,20.811,20,20.658L20,3.34197C20,3.189004,19.8353,3.0926614,19.701900000000002,3.167654L6.29805,10.70735C6.1647300000000005,10.78234,6,10.686,6,10.53303L6,3.2C6,3.0895431,5.9104600000000005,3,5.8,3L4.2,3C4.0895431,3,4,3.0895431,4,3.2L4,20.6764C4,20.8251,4.156463,20.9218,4.289443,20.8553L5.8894400000000005,20.0553C5.9572,20.0214,6,19.9521,6,19.8764L6,13.467C6,13.314,6.1647300000000005,13.2177,6.29805,13.2927" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712047709053" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11870" width="28" height="28" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M878.885769 568.138291c0 201.397023-163.248995 364.646017-364.646017 364.646017S149.485359 769.535314 149.485359 568.138291c0-192.076766 148.582234-349.076131 336.901997-363.309391 0-0.4335-0.252875-0.903126-0.252875-1.408876V147.353983h-112.168207c-15.497636 0-28.033021-12.535384-28.033021-28.105271 0-15.497636 12.535384-28.033021 28.033021-28.03302h280.51083c15.461511 0 28.105271 12.535384 28.105271 28.03302 0 15.569886-12.643759 28.105271-28.105271 28.105271h-112.168207V203.383899c0 0.541875-0.252875 0.975376-0.252875 1.408876 188.247513 14.269385 336.829747 171.26875 336.829747 363.345516zM514.239752 259.52219c-170.437875 0-308.616101 138.142101-308.616101 308.616101s138.142101 308.616101 308.616101 308.616101c170.365625 0 308.507726-138.142101 308.507726-308.616101s-138.142101-308.616101-308.507726-308.616101z m0 392.787413c-46.529034 0-84.171312-37.714528-84.171312-84.171312 0-36.558527 23.481267-67.445424 56.029916-79.005433V343.693502c0-15.497636 12.535384-28.033021 28.105271-28.033021 15.497636 0 28.033021 12.535384 28.03302 28.033021v145.439356c32.657024 11.560008 56.138291 42.446906 56.138291 79.005433 0 46.456784-37.714528 84.171312-84.135186 84.171312z" fill="#4D5258" p-id="11871"></path></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_13448_089636"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g style="opacity:0.20000000298023224;" clip-path="url(#master_svg0_13448_089636)"><g><path d="M10.67639,4L3.2,4C3.0895431,4,3,4.0895431,3,4.2L3,20.8C3,20.9105,3.0895431,21,3.2,21L20.8,21C20.9105,21,21,20.9105,21,20.8L21,5.12361C21,5.04785,20.9572,4.9786,20.8894,4.944721L19.2894,4.144721C19.1565,4.0782313,19,4.17493,19,4.323607L19,19L5,19L5,6L9.87639,6C9.95215,6,10.0214,5.9572,10.05528,5.8894400000000005L10.85528,4.289443C10.92177,4.156463,10.82507,4,10.67639,4" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M11.5,3.0706476L11.5,6.52935C11.5,6.56044,11.5339189,6.57965,11.5605798,6.56365L14.44283,4.8343C14.46873,4.81876,14.46873,4.78124,14.44283,4.7657L11.5605798,3.0363479C11.5339189,3.0203513,11.5,3.0395558,11.5,3.0706476" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M15,3.0706476L15,6.52935C15,6.56044,15.0339189,6.57965,15.0605798,6.56365L17.94283,4.8343C17.96873,4.81876,17.96873,4.78124,17.94283,4.7657L15.0605798,3.0363479C15.0339189,3.0203513,15,3.0395558,15,3.0706476" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M8.916,11.64L8.916,16L9.964,16L9.964,10.48L8.916,10.48L7.9879999999999995,11.176L7.9879999999999995,12.312000000000001L8.916,11.64ZM10.788,14.864L10.788,16L11.9,16L11.9,14.864L10.788,14.864ZM13.008,15.612C13.27725,15.9294,13.692,16.0881,14.251999999999999,16.088C14.812000000000001,16.088,15.22663,15.928,15.496,15.608C15.76525,15.2881,15.9,14.81338,15.9,14.184L15.9,12.232C15.9,11.623999999999999,15.76525,11.16537,15.496,10.856C15.22663,10.54675,14.812000000000001,10.392,14.251999999999999,10.392C13.71325,10.392,13.304,10.548,13.024000000000001,10.86C12.744,11.172,12.604,11.62937,12.604,12.232L12.604,14.184C12.604,14.81875,12.73863,15.2948,13.008,15.612ZM14.728,14.932C14.64525,15.0947,14.48663,15.176,14.251999999999999,15.176C14.02262,15.176,13.866620000000001,15.0947,13.783999999999999,14.932C13.70125,14.76937,13.66,14.49075,13.66,14.096L13.66,12.384C13.66,11.989370000000001,13.7,11.712,13.780000000000001,11.552C13.86,11.392,14.01725,11.312000000000001,14.251999999999999,11.312000000000001C14.48663,11.312000000000001,14.64525,11.392,14.728,11.552C14.81063,11.712,14.852,11.989370000000001,14.852,12.384L14.852,14.096C14.852,14.49075,14.81063,14.76937,14.728,14.932Z" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M17.701900000000002,13.2927L4.298053,20.8323C4.164731,20.9073,4,20.811,4,20.658L4,3.34197C4,3.189004,4.164731,3.0926614,4.298052,3.167654L17.701900000000002,10.70735C17.8353,10.78234,18,10.686,18,10.53303L18,3.2C18,3.0895431,18.0895,3,18.2,3L19.8,3C19.9105,3,20,3.0895431,20,3.2L20,20.6764C20,20.8251,19.8435,20.9218,19.7106,20.8553L18.110599999999998,20.0553C18.0428,20.0214,18,19.9521,18,19.8764L18,13.467C18,13.314,17.8353,13.2177,17.701900000000002,13.2927" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="28" height="28" viewBox="0 0 28 28"><g style="opacity:0.20000000298023224;"><g><path d="M3.5,4.31780565625L3.5,6.18447265625Q3.5,6.2308826562499995,3.5177614,6.27376265625Q3.5355229,6.31664265625,3.5683417,6.34946265625Q3.601161,6.38228265625,3.644041,6.40004265625Q3.68692,6.41780265625,3.733333,6.41780265625L24.2667,6.41780265625Q24.3131,6.41780265625,24.356,6.40004265625Q24.3988,6.38228265625,24.4317,6.34946265625Q24.4645,6.31664265625,24.4822,6.27376265625Q24.5,6.2308826562499995,24.5,6.18447265625L24.5,4.31780565625Q24.5,4.27139265625,24.4822,4.22851365625Q24.4645,4.18563365625,24.4317,4.15281435625Q24.3988,4.11999555625,24.356,4.10223405625Q24.3131,4.08447265625,24.2667,4.08447265625L3.733333,4.08447265625Q3.68692,4.08447265625,3.644041,4.10223405625Q3.601161,4.11999555625,3.5683417,4.15281435625Q3.5355229,4.18563365625,3.5177614,4.22851365625Q3.5,4.27139265625,3.5,4.31780565625ZM10.20878,13.80699265625L3.862763,9.57631265625C3.707701,9.47294265625,3.5,9.58410265625,3.5,9.77046265625L3.5,18.23177265625C3.5,18.41817265625,3.707701,18.52937265625,3.862763,18.42597265625L10.20878,14.19527265625C10.34732,14.10297265625,10.34732,13.89935265625,10.20878,13.80699265625ZM24.2667,12.83349265625L13.5609,12.83349265625C13.47249,12.83349265625,13.3917,12.88343265625,13.35217,12.96248265625L12.41884,14.82917265625C12.34127,14.98427265625,12.45409,15.16687265625,12.62754,15.16687265625L24.2667,15.16687265625C24.3955,15.16687265625,24.5,15.06237265625,24.5,14.93347265625L24.5,13.06683265625C24.5,12.93796265625,24.3955,12.83349265625,24.2667,12.83349265625ZM3.5,21.81777265625L3.5,23.68447265625Q3.5,23.73087265625,3.5177614,23.77377265625Q3.5355229,23.81667265625,3.5683417,23.84947265625Q3.601161,23.88227265625,3.644041,23.90007265625Q3.68692,23.91777265625,3.733333,23.91777265625L24.2667,23.91777265625Q24.3131,23.91777265625,24.356,23.90007265625Q24.3988,23.88227265625,24.4317,23.84947265625Q24.4645,23.81667265625,24.4822,23.77377265625Q24.5,23.73087265625,24.5,23.68447265625L24.5,21.81777265625Q24.5,21.77137265625,24.4822,21.72847265625Q24.4645,21.68567265625,24.4317,21.65277265625Q24.3988,21.61997265625,24.356,21.60227265625Q24.3131,21.58447265625,24.2667,21.58447265625L3.733333,21.58447265625Q3.68692,21.58447265625,3.644041,21.60227265625Q3.601161,21.61997265625,3.5683417,21.65277265625Q3.5355229,21.68567265625,3.5177614,21.72847265625Q3.5,21.77137265625,3.5,21.81777265625Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M16.61255231628418,0.6909312143875121L15.48135231628418,1.8221886143875121C15.40315231628418,1.9003386143875123,15.40325231628418,2.0270586143875122,15.48145231628418,2.105148614387512L16.87945231628418,3.5008286143875122L2.19995231628418,3.5008286143875122C2.0894953162841796,3.5008286143875122,1.9999523162841797,3.5903786143875123,1.9999523162841797,3.7008286143875124L1.9999523162841797,14.377268614387512C1.9999523162841797,14.452968614387512,2.0427528162841795,14.522268614387512,2.1105093162841797,14.556068614387513L3.7105123162841798,15.356068614387512C3.8434923162841796,15.422568614387512,3.9999523162841797,15.325868614387511,3.9999523162841797,15.177268614387513L3.9999523162841797,5.500828614387512L18.99995231628418,5.500828614387512L18.99995231628418,5.499258614387513L21.22095231628418,5.499258614387513C21.39905231628418,5.499258614387513,21.48835231628418,5.283828614387512,21.36235231628418,5.157838614387512L16.895452316284178,0.6909312143875121C16.81735231628418,0.6128262143875122,16.69065231628418,0.6128263143875122,16.61255231628418,0.6909312143875121ZM19.99995231628418,8.823458614387512L19.99995231628418,18.499868614387513L5.11660231628418,18.499868614387513L5.115252316284179,18.498468614387512L2.7755723162841797,18.498468614387512C2.5973913162841797,18.498468614387512,2.50815731628418,18.71396861438751,2.6341503162841797,18.839968614387512L7.101052316284179,23.30686861438751C7.17916231628418,23.384968614387514,7.30579231628418,23.384968614387514,7.383902316284179,23.30686861438751L8.51515231628418,22.17556861438751C8.59330231628418,22.097468614387513,8.593252316284179,21.970668614387513,8.51503231628418,21.89256861438751L7.11995231628418,20.499868614387513L21.79995231628418,20.499868614387513C21.91045231628418,20.499868614387513,21.99995231628418,20.410268614387512,21.99995231628418,20.299868614387513L21.99995231628418,9.623458614387513C21.99995231628418,9.547708614387512,21.95715231628418,9.478458614387511,21.889352316284178,9.444578614387511L20.28935231628418,8.644578614387513C20.15645231628418,8.578088614387513,19.99995231628418,8.674788614387513,19.99995231628418,8.823458614387512Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><g><path d="M6.915255046875,4.7314907592749025L11.848588046875001,5.964826319274902C11.937618046875,5.987086319274902,12.000078046875,6.067076319274903,12.000078046875,6.158856319274903L12.000078046875,28.413216319274902C12.000078046875,28.5433163192749,11.877808046875,28.638816319274902,11.751578046875,28.6072163192749L6.818241046875,27.3739163192749C6.729207546875,27.351616319274903,6.666748046875,27.2716163192749,6.666748046875,27.179916319274902L6.666748046875,4.925519319274902C6.666748046875,4.795405019274902,6.789026046875,4.6999334192749025,6.915255046875,4.7314907592749025M20.248548046875,4.7314907592749025L25.181848046875,5.964826319274902C25.270848046875,5.987086319274902,25.333348046875,6.067076319274903,25.333348046875,6.158856319274903L25.333348046875,28.413216319274902C25.333348046875,28.5433163192749,25.211048046875,28.638816319274902,25.084848046875,28.6072163192749L20.151448046875,27.3739163192749C20.062448046874998,27.351616319274903,20.000048046875,27.2716163192749,20.000048046875,27.179916319274902L20.000048046875,4.925519319274902C20.000048046875,4.795405019274902,20.122248046875,4.6999334192749025,20.248548046875,4.7314907592749025" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712048425819" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13530" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M893.035 463.821679C839.00765 429.699141 210.584253 28.759328 179.305261 8.854514 139.495634-16.737389 99.686007 17.385148 99.686007 57.194775v909.934329c0 45.496716 42.653172 68.245075 76.775709 48.340262 45.496716-28.435448 676.763657-429.375262 716.573284-454.967165 34.122537-22.748358 34.122537-76.775709 0-96.680522z" fill="#FFFFFF" p-id="13531"></path></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="32" height="32" viewBox="0 0 32 32"><g><g><path d="M6.915255046875,4.7314907592749025L11.848588046875001,5.964826319274902C11.937618046875,5.987086319274902,12.000078046875,6.067076319274903,12.000078046875,6.158856319274903L12.000078046875,28.413216319274902C12.000078046875,28.5433163192749,11.877808046875,28.638816319274902,11.751578046875,28.6072163192749L6.818241046875,27.3739163192749C6.729207546875,27.351616319274903,6.666748046875,27.2716163192749,6.666748046875,27.179916319274902L6.666748046875,4.925519319274902C6.666748046875,4.795405019274902,6.789026046875,4.6999334192749025,6.915255046875,4.7314907592749025M20.248548046875,4.7314907592749025L25.181848046875,5.964826319274902C25.270848046875,5.987086319274902,25.333348046875,6.067076319274903,25.333348046875,6.158856319274903L25.333348046875,28.413216319274902C25.333348046875,28.5433163192749,25.211048046875,28.638816319274902,25.084848046875,28.6072163192749L20.151448046875,27.3739163192749C20.062448046874998,27.351616319274903,20.000048046875,27.2716163192749,20.000048046875,27.179916319274902L20.000048046875,4.925519319274902C20.000048046875,4.795405019274902,20.122248046875,4.6999334192749025,20.248548046875,4.7314907592749025" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="28.000001907348633" height="28.000001907348633" viewBox="0 0 28.000001907348633 28.000001907348633"><g style="opacity:0.20000000298023224;"><g></g><g><path d="M3.5,25.08349609375L3.5,2.91682909375Q3.5,2.85937609375,3.5112086,2.80302709375Q3.5224172,2.74667709375,3.5444036,2.6935970937500002Q3.56639,2.6405170937499998,3.5983094,2.59274709375Q3.630229,2.54497609375,3.670854,2.50435009375Q3.71148,2.46372509375,3.759251,2.43180549375Q3.8070209999999998,2.39988609375,3.8601010000000002,2.37789969375Q3.913181,2.35591329375,3.969531,2.34470469375Q4.02588,2.33349609375,4.083333,2.33349609375L23.9167,2.33349609375Q23.9741,2.33349609375,24.0305,2.34470469375Q24.0868,2.35591329375,24.1399,2.37789969375Q24.193,2.39988609375,24.2407,2.43180549375Q24.2885,2.46372509375,24.3291,2.50435009375Q24.3698,2.54497609375,24.4017,2.59274709375Q24.4336,2.6405170937499998,24.4556,2.6935970937500002Q24.4776,2.74667709375,24.4888,2.80302709375Q24.5,2.85937609375,24.5,2.91682909375L24.5,15.16649609375L22.1666,15.16649609375L22.1666,4.66650609375L5.83325,4.66650609375L5.83325,23.33319609375L14,23.33319609375L14,25.66679609375L4.083333,25.66679609375Q4.02588,25.66679609375,3.969531,25.65559609375Q3.913181,25.64439609375,3.8601010000000002,25.62239609375Q3.8070209999999998,25.60039609375,3.759251,25.56849609375Q3.71148,25.53659609375,3.670854,25.49599609375Q3.630229,25.45539609375,3.5983094,25.40759609375Q3.56639,25.35979609375,3.5444036,25.30669609375Q3.5224172,25.25369609375,3.5112086,25.19729609375Q3.5,25.14099609375,3.5,25.08349609375Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M9.333251953125,11.43447265625C9.333251953125,11.56334265625,9.437718953125,11.66780265625,9.566584953125,11.66780265625L17.355711953125002,11.66780265625C17.444091953125,11.66780265625,17.524881953125,11.61787265625,17.564411953125,11.53882265625L18.497741953125,9.67215565625C18.575311953125002,9.51701265625,18.462501953125,9.33447265625,18.289041953125,9.33447265625L9.566584953125,9.33447265625C9.437718953125,9.33447265625,9.333251953125,9.43893965625,9.333251953125,9.56780565625L9.333251953125,11.43447265625Z" fill="#4D5258" fill-opacity="1"/></g><g><path d="M9.333251953125,16.68203125C9.333251953125,16.81090125,9.437718953125,16.91536125,9.566584953125,16.91536125L14.439041953124999,16.91536125C14.527421953125,16.91536125,14.608221953125,16.86543125,14.647741953125,16.786381249999998L15.581081953125,14.91971425C15.658651953125,14.76457125,15.545831953124999,14.58203125,15.372381953125,14.58203125L9.566584953125,14.58203125C9.437718953125,14.58203125,9.333251953125,14.68649825,9.333251953125,14.81536425L9.333251953125,16.68203125Z" fill="#4D5258" fill-opacity="1"/></g><g><path d="M17.588956390625,19.15734328125L20.566870390625,19.16774328125L20.548890390625,24.31857328125L19.458060390625,24.314763281250002L19.471360390625,20.50559328125C19.471810390625,20.37673328125,19.367710390625,20.27190328125,19.238840390625,20.27145328125L18.346340390625,20.26833328125C18.217470390625,20.26788328125,18.112640390625,20.37198328125,18.112190390625,20.50085328125L18.098890390625,24.31002328125L17.054726390625,24.30637328125C16.925861390625,24.30592328125,16.821030110625,24.410023281249998,16.820580290625,24.53889328125L16.817464871625,25.43139328125C16.817015045625,25.560263281250002,16.921116390625,25.66509328125,17.049982390625,25.66554328125L24.933730390625,25.693063281249998C25.062600390625,25.69351328125,25.167430390625,25.58941328125,25.167880390625,25.46054328125L25.171000390625,24.56804328125C25.171450390624997,24.43917328125,25.067340390625,24.33434328125,24.938480390625,24.33389328125L21.934310390625,24.323413281249998L21.941450390625,22.27882328125L24.105620390625,22.28638328125C24.234480390625002,22.28683328125,24.339310390625002,22.18272328125,24.339760390625,22.05386328125L24.342820390625,21.17886328125C24.343270390625,21.04999328125,24.239170390625,20.94516328125,24.110300390625,20.94471328125L21.946130390625,20.93716328125L21.952290390625002,19.17257328125L24.588960390625,19.18178328125C24.717820390625,19.18223328125,24.822660390625,19.07812328125,24.823100390625,18.94926328125L24.826220390625,18.05675828125C24.826670390625,17.92789328125,24.722570390625002,17.82306218125,24.593700390625,17.82261228125L17.593700390625,17.79817776225C17.464835390625,17.79772793625,17.360004390625,17.90182928125,17.359554390625,18.03069528125L17.356439390625,18.92320328125C17.355989390625,19.05206328125,17.460090390625,19.15689328125,17.588956390625,19.15734328125Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
... ... @@ -41,13 +41,29 @@ export class HttpUrlUtils {
/**
* 批查接口,查询互动相关数据,如收藏数、评论数等
*/
static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/v2/content/interactData";
static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData";
// 多图(图集)详情页
/**
* 批量查询内容当前用户点赞、收藏状态
*/
static readonly INTERACT_DATA_STATUS: string = "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status";
/**
* 点赞、取消点赞
*/
static readonly INTERACT_EXECUTELIKE: string = "/api/rmrb-interact/interact/zh/c/like/executeLike";
/**
* 收藏、取消收藏
*/
static readonly INTERACT_EXECUTECOLLECTRECORD: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord";
/**
* 用户等级/积分-APP根据业务场景动态增减成长值(APP)
*/
static readonly USERPOINT_OPERATE: string = "/api/rmrb-user-point/auth/pointLevel/zh/operate";
/**
* 评论发布
*/
static readonly COMMENT_PUBLISH: string = "/api/rmrb-comment/comment/zh/c/publish";
/**
* 沉浸式視頻批量查詢20條數據
*/
static readonly RECOMMEND_VIDEOLIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/videoList";
... ...
import { Logger } from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { ContentDetailDTO, PhotoListBean } from 'wdBean';
import { ContentDetailDTO } from 'wdBean';
import media from '@ohos.multimedia.media';
import { OperRowListView } from './view/OperRowListView';
import { WDPlayerController } from 'wdPlayer';
const TAG = 'AudioDetailComponent'
interface Arr{
image:string,
title:string
}
@Component
export struct AudioDetailComponent {
private relId: string = ''
private contentId: string = ''
private relType: string = ''
// private avPlayer:media.AVPlayer
private playerController: WDPlayerController = new WDPlayerController();
@State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]
@State iocClock: string = '定时';
@State iconTheOriginal: string = '原文';
@State iconList: string = '列表';
@State text: string = ''
@State coverImage:string = 'app.media.audio'
@State newsTitle:string = '夜读'
private arr:Arr[]=[
{image:'clock',title:'定时'},
{image:'theOriginal',title:'原文'},
{image:'list',title:'列表'},
]
@State palyIcon:string = "app.media.playicon"
@State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]//详情
@State coverImage:string = '' //封面图
@State newsTitle:string = '' //标题
@State duration:number = 0 //时长
@State audioUrl:string = '' //音频路径
@State outSetValueOne:number = 40 //播放进度
@State showList: boolean = false
@State outSetValueOne:number = 40
//
// @State @Watch('onIsPlayChanged')isPlay: boolean = false
// onIsPlayChanged(){
// if(this.isPlay){
@State @Watch('onIsPlayChanged')isPlay: boolean = true
onIsPlayChanged(){
if(this.isPlay){
console.log('监听播放')
// this.avPlayer.play()
// this.palyIcon = "app.media.suspend"
// }else{
}else{
console.log('监听暂停')
// this.avPlayer.pause()
// this.palyIcon = "app.media.playicon"
// }
// }
//
}
}
async aboutToAppear() {
this.getContentDetailData()
// // 创建avPlayer实例对象
// this.avPlayer = await media.createAVPlayer()
// // 创建状态机变化回调函数
// this.setAVPlayerCallback()
await this.getContentDetailData()
this.playerController.firstPlay(this.audioUrl);
}
//
// // 注册avplayer回调函数
// setAVPlayerCallback() {
// // seek操作结果回调函数
// this.avPlayer.on('seekDone', (seekDoneTime) => {
// console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`);
// })
// // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程
// this.avPlayer.on('error', (err) => {
// console.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`);
// this.avPlayer.reset(); // 调用reset重置资源,触发idle状态
// })
// // 状态机变化回调函数
// this.avPlayer.on('stateChange', async (state, reason) => {
// switch (state) {
// case 'idle': // 成功调用reset接口后触发该状态机上报
// console.info('AVPlayer state idle called.');
// this.avPlayer.release(); // 调用release接口销毁实例对象
// this.isPlay = false
// break;
// case 'initialized': // avplayer 设置播放源后触发该状态上报
// console.info('AVPlayerstate initialized called.');
// this.avPlayer.prepare().then(() => {
// console.info('AVPlayer prepare succeeded.');
// })
// this.isPlay = false
// break;
// case 'prepared': // prepare调用成功后上报该状态机
// console.info('AVPlayer state prepared called.');
// this.isPlay = false
// this.avPlayer.play(); // 调用播放接口开始播放
// break;
// case 'playing': // play成功调用后触发该状态机上报
// console.info('AVPlayer state playing called.');
// this.isPlay = true
// break;
// case 'paused': // pause成功调用后触发该状态机上报
// console.info('AVPlayer state paused called.');
// this.avPlayer.play(); // 再次播放接口开始播放
// this.isPlay = false
// break;
// case 'completed': // 播放结束后触发该状态机上报
// console.info('AVPlayer state completed called.');
// this.avPlayer.stop(); //调用播放结束接口
// break;
// case 'stopped': // stop接口成功调用后触发该状态机上报
// console.info('AVPlayer state stopped called.');
// this.avPlayer.reset(); // 调用reset接口初始化avplayer状态
// this.isPlay = false
// break;
// case 'released':
// console.info('AVPlayer state released called.');
// break;
// default:
// console.info('AVPlayer state unknown called.');
// break;
// }
// })
// }
// gotoPlay(){
// this.avPlayer.url = this.contentDetailData[0].audioList[0].audioUrl
// }
build() {
Row() {
Column() {
// 封面
Row() {
Image($r('app.media.audio'))
Image(this.coverImage)
.width(240)
.height(160)
.borderRadius('0')
... ... @@ -129,49 +70,21 @@ export struct AudioDetailComponent {
}
.padding({ left: 34, right: 34 })
.margin({ top: 32 })
// 操作矩阵
Row() {
// 定时
Column() {
Image($r('app.media.clock'))
.width(28)
.height(28)
Text(this.iocClock)
.fontColor('#fff')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
// 原文
Column() {
Image($r('app.media.theOriginal'))
.width(28)
.height(28)
Text(this.iconTheOriginal)
.fontColor('#fff')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
// 列表
ForEach(this.arr,(item:Arr)=>{
Column() {
Image($r('app.media.list'))
Image(item.image=='clock'?$r('app.media.clock_close'):item.image=='theOriginal'?$r('app.media.theOriginal_close'):item.image=='list'?$r('app.media.list_close'):'')
.width(28)
.height(28)
Text(this.iconList)
.fontColor('#fff')
Text(item.title)
.fontColor('#4D5258')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
.onClick(() => {
this.showList = !this.showList
Logger.info(TAG,'这里')
console.log('列表', this.showList)
})
}
.width('100%')
.padding({ left: 49, right: 49 })
... ... @@ -181,61 +94,59 @@ export struct AudioDetailComponent {
Column(){
// 进度条
Row(){
Slider({
value: this.outSetValueOne,
min: 0,
max: 100,
style: SliderStyle.OutSet
})
.trackColor('rgba(0,0,0,0.5)')
.selectedColor('#ED2800')
.showTips(true)
.onChange((value: number, mode: SliderChangeMode) => {
this.outSetValueOne = value
console.info('value:' + value + 'mode:' + mode.toString())
})
Progress({ value: this.outSetValueOne, type: ProgressType.Linear })
.width('100%')
.color('#ED2800')
.backgroundColor('rgba(0,0,0,0.5)')
}
.width('100%')
.padding({left:24,right:24})
.margin({top:110})
// 播放按钮
Row(){
Image($r('app.media.loop'))
Column(){
Image($r('app.media.loop_close'))
.width(24)
.height(24)
Image($r('app.media.Backward'))
Text('循环')
.fontColor('#4D5258')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
Image($r('app.media.Backward_close'))
.width(24)
.height(24)
Stack(){
Image($r('app.media.playicon'))
Stack({ alignContent: Alignment.Center }){
Image(this.isPlay?$r('app.media.suspend'):$r('app.media.playicon'))
.width(32)
.height(32)
}
.backgroundColor('rgba(255,255,255,0.1)')
.width(60)
.height(60)
.padding(28)
.backgroundColor('#4D5258')
.borderRadius(50)
.alignContent(Alignment.Center)
.onClick(()=>{
// this.gotoPlay()
console.log('播放')
this.getContentDetailData()
})
Image($r('app.media.fastForward'))
Image($r('app.media.fastForward_close'))
.width(24)
.height(24)
Image($r('app.media.doubleSpeed'))
Column(){
Image($r('app.media.doubleSpeed_close'))
.width(24)
.height(24)
Text('倍速')
.fontColor('#4D5258')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({top:56})
.padding({left:32,right:32})
}
// OperRowListView()
.layoutWeight(1)
OperRowListView()
}
}
... ... @@ -245,15 +156,17 @@ export struct AudioDetailComponent {
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
this.contentDetailData = data;
this.coverImage = this.contentDetailData[0].audioList[0].fullColumnImgUrls[0].url
console.log('音乐详情',JSON.stringify(this.contentDetailData))
this.newsTitle = this.contentDetailData[0].newsTitle
Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
console.log(JSON.stringify(this.contentDetailData))
console.log(this.newsTitle)
console.log(this.coverImage)
console.log('标题',JSON.stringify(this.newsTitle))
this.coverImage = this.contentDetailData[0].fullColumnImgUrls[0].url
console.log('封面图',JSON.stringify(this.coverImage))
this.duration = this.contentDetailData[0].audioList[0].duration
console.log('音频时长',JSON.stringify(this.duration))
this.audioUrl = this.contentDetailData[0].audioList[0].audioUrl
console.log('音频时长',JSON.stringify(this.audioUrl))
} catch (exception) {
console.log('请求失败',JSON.stringify(exception))
}
}
}
\ No newline at end of file
... ...
import { Action, CompDTO, Params } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils, Logger } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
... ... @@ -23,15 +24,12 @@ export struct AlbumCardComponent {
.fontColor(0x222222)
.lineHeight(25)
.maxLines(3)
.margin({ top: 6,
left: 16,
right: 16 })
.width(343)
.width(CommonConstants.FULL_WIDTH)
RelativeContainer() {
Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url)
.width(229)
.height(154)
.width('66.6%')
.aspectRatio(16/9)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
... ... @@ -39,8 +37,8 @@ export struct AlbumCardComponent {
.id('mainImage')
Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url)
.width(112)
.height(76)
.width('33%')
.aspectRatio(16/9)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
... ... @@ -48,14 +46,14 @@ export struct AlbumCardComponent {
.id('subTopImage')
Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url)
.width(112)
.height(76)
.width('33%')
.aspectRatio(16/9)
.alignRules({
right: { anchor: "__container__", align: HorizontalAlign.End },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('subBottomImage')
// 下面是渲染右下角图标
Shape() {
Rect().width(33).height(18)
}
... ... @@ -97,8 +95,8 @@ export struct AlbumCardComponent {
.width(17)
.height(17)
}
.width(343)
.height(154)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(24/9)
.onClick((event: ClickEvent) => {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
... ... @@ -134,13 +132,17 @@ export struct AlbumCardComponent {
.margin({
left: 6
})
}.margin({ left: 24 })
.width(375)
}
.width(CommonConstants.FULL_WIDTH)
.height(16)
.id('label')
}
.width(375)
// .backgroundColor(0x000000)
.width(CommonConstants.FULL_WIDTH)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
})
}
}
\ No newline at end of file
... ...
... ... @@ -13,7 +13,7 @@ export interface ContentDetailRequestParams {
relType: string
}
export interface recommentVideoListParame {
export interface recommentVideoListParams {
pageSize: number;
refreshCnt: number;
}
... ... @@ -27,6 +27,94 @@ export interface contentListParams {
contentList: contentListItem[];
}
export interface IStatusContentList {
contentId: string;
// relType: string;
contentType: string;
// contentRelId: string;
}
export interface batchLikeAndCollectParams {
// userType: number;
// userId: string;
contentList: IStatusContentList[]
}
export interface batchLikeAndCollectResult {
collectStatus: number;
contentType: string;
likeStatus: string;
relType: string;
contentId: string;
contentRelId: string;
}
export interface postBatchAttentionStatusParamsItem {
creatorId: string;
}
export interface postBatchAttentionStatusParams {
creatorIds: postBatchAttentionStatusParamsItem[]
}
export interface postBatchAttentionStatusResult {
creatorId: string;
status: string;
userId: string;
}
export interface postExecuteLikeParams {
status: string;
contentId: string;
contentType: string;
relType?: string;
userName?: string;
title?: string;
contentRelId?: string;
userHeaderUrl?: string;
channelId?: string;
}
export interface postExecuteCollectRecordParamsItem {
contentId: string;
contentType: string;
relType?: string;
contentRelId?: string;
}
export interface postExecuteCollectRecordParams {
status: string;
contentList: postExecuteCollectRecordParamsItem[]
}
export interface postPointLevelOperateParams {
operateType: number;
}
export interface postCommentPublishParams {
targetId: string;
keyArticle: string;
commentPics: string;
targetTitle: string;
commentType: string;
targetType: string;
commentContent: string;
parentId: string;
rootCommentId: string;
}
export interface postInteractBrowsOperateParamsContent {
browseTime: string;
contentId: string;
contentType: number;
}
export interface postInteractBrowsOperateParams {
delStatus: number;
contentList: postInteractBrowsOperateParamsContent[]
}
export class ContentDetailRequest {
static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> {
... ... @@ -71,23 +159,23 @@ export class ContentDetailRequest {
}
/**
*
* 批量查询作品查询点赞、收藏状态
* @returns
*/
static postBatchLikeAndCollectStatus() {
static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post(url, headers)
return WDHttp.post0(url, params, headers)
}
/**
*
* 批量查号主是否为用户关注
* @returns
*/
static postBatchAttentionStatus() {
static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post(url, headers)
return WDHttp.post0(url, params, headers)
}
... ... @@ -96,9 +184,60 @@ export class ContentDetailRequest {
* @returns
*/
static postRecommendVideoList(params: recommentVideoListParame): Promise<ResponseDTO<ContentDetailDTO[]>> {
static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
*用户点赞、取消点赞
* @param params
* @returns
*/
static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
*用户收藏、取消收藏
* @param params
* @returns
*/
static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
*用户等级/积分-APP根据业务场景动态增减成长值(APP)
* 操作类型:1阅读 2评论 3回复(积分任务同评论) 4分享 5点赞 6关注 7打开客户端 8上传头像 9打开推送开关
*/
static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 评论发布
*/
static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 浏览历史新增、删除接口
*/
static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
}
\ No newline at end of file
... ...
import router from '@ohos.router';
import mediaquery from '@ohos.mediaquery';
import window from '@ohos.window';
import { Action, ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean';
import { Logger, SPHelper, WindowModel } from 'wdKit';
import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
import { devicePLSensorManager } from 'wdDetailPlayApi';
import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi';
import { PlayControlViewContainer } from '../view/PlayControlViewContainer';
import { PlayerDetailContainer } from '../view/PlayerDetailContainer';
import { PlayViewModel } from '../viewmodel/PlayViewModel';
import { DetailContainer } from '../view/DetailContainer';
import {
batchLikeAndCollectParams,
batchLikeAndCollectResult,
postBatchAttentionStatusParams,
postInteractBrowsOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { DateTimeUtils } from 'wdKit/Index';
const TAG = 'DetailPlayShortVideoPage';
... ... @@ -18,74 +22,101 @@ const TAG = 'DetailPlayShortVideoPage';
@Component
export struct DetailPlayShortVideoPage {
private contentId?: string = undefined
private relId?: string = undefined
private relType?: string = undefined
private contentDetailData: ContentDetailDTO | undefined = undefined
@Provide interactData: InteractDataDTO | undefined = undefined
@Prop index: number = 0
@Prop @Watch('currentIndexChange') currentIndex: number = 0
private index: number = 0
private playerController: WDPlayerController = new WDPlayerController();
@Watch("urlChanged") @State url?: string = undefined
@Watch('changeContinue') @Provide nextContId?: string = '';
@Watch('getPlayHistory') @Provide curContId?: string = undefined;
@Watch("playVMChanged") @Provide playVM: PlayViewModel = new PlayViewModel();
@State playerController: WDPlayerController = new WDPlayerController();
@Provide contentDetailData: ContentDetailDTO | undefined = undefined
@Provide interactData: InteractDataDTO | undefined = undefined
@Provide isFullScreen: boolean = false;
@Provide canStart?: boolean = false;
@Provide status: number = PlayerConstants.STATUS_START;
@Provide userId: string = '';
@Provide newsSourceName?: string = ''
@Provide newsTitle?: string = ''
@Provide editorName?: string = ''
@Provide rmhInfo?: RmhInfoDTO | null = null
@Provide userInfo?: UserInfoDTO | null = null
@Provide message?: string = ''
@Provide newsSummary?: string = ''
@Provide progressVal: number = 0;
@Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
playVMChanged() {
this.url = this.playVM.url
this.newsSourceName = this.playVM.newsSourceName
this.newsTitle = this.playVM.newsTitle
this.editorName = this.playVM.editorName
this.newsSummary = this.playVM.newsSummary
this.videoLandScape = this.playVM.videoLandScape ?? 1
this.curContId = this.playVM.contentId
this.nextContId = this.playVM.nextContId
this.canStart = this.playVM.canStart;
this.message = this.playVM.message
this.rmhInfo = this.playVM.rmhInfo
this.userInfo = this.playVM.userInfo
}
@Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@Provide followStatus: string = '0' // 关注状态
currentIndexChange() {
console.log('currentIndexChange====', this.currentIndex)
if (this.currentIndex != this.index) {
this.playerController.pause()
// if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) {
// this.playerController.release()
// }
} else {
console.log('currentIndexChange====1', this.playerController)
this.playerController.switchPlayOrPause()
this.queryNewsInfoOfUser()
console.log('currentIndex==== ', this.currentIndex)
if (!this.playerController.getPlayer()) {
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '');
} else {
this.playerController.play()
}
}
}
aboutToAppear() {
console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
/**
* 查询用户点赞、收藏、关注等状态
*/
queryNewsInfoOfUser() {
if (HttpUrlUtils.getUserId()) {
const params: batchLikeAndCollectParams = {
contentList: [
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
]
}
// 已登录->查询用户对作品点赞、收藏状态
ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
console.log('查询点赞、收藏状态==', JSON.stringify(res.data))
if (res.data) {
this.newsStatusOfUser = res.data[0]
}
})
this.playVM.setContentDetailData(this.contentDetailData)
const params1: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
}
// 已登录->批量查作品是否被号主关注
ContentDetailRequest.postBatchAttentionStatus(params1).then(res => {
console.log('批量查号主是否为用户关注==', JSON.stringify(res.data))
if (res.data) {
this.followStatus = res.data[0]?.status
}
})
let action: Action = router.getParams() as Action
Logger.info(TAG, "action", JSON.stringify(action))
if (action) {
this.contentId = action.params?.contentID
if (action.params && action.params.extra) {
this.relId = action.params.extra.relId
this.relType = action.params.extra.relType
// 记录浏览历史
const params2: postInteractBrowsOperateParams = {
delStatus: 0,
contentList: [{
browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType || 0,
}]
}
ContentDetailRequest.postInteractBrowsOperate(params2).then(res => {
console.log('记录浏览历史==', JSON.stringify(res.data))
})
}
}
aboutToAppear() {
console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
this.videoLandScape = this.contentDetailData?.videoInfo[0]?.videoLandScape
this.queryNewsInfoOfUser()
this.playerController.onCanplay = () => {
if (this.index == 0 || this.currentIndex === this.index) {
this.playerController.play()
}
}
this.playerController.onTimeUpdate = (position, duration) => {
this.progressVal = Math.floor(position * 100 / duration);
}
// 设置播放地址
// this.url = 'https://media.w3.org/2010/05/sintel/trailer.mp4'
let listener = mediaquery.matchMediaSync('(orientation: landscape)');
listener.on("change", (mediaQueryResult) => {
if (mediaQueryResult.matches) {
... ... @@ -95,29 +126,24 @@ export struct DetailPlayShortVideoPage {
this.isFullScreen = false
console.log("横屏 no")
}
WindowModel.shared.setMainWindowFullScreen(this.isFullScreen)
// WindowModel.shared.setMainWindowFullScreen(this.isFullScreen)
})
console.error('111,', this.index, this.currentIndex)
if (this.index == 0 && this.currentIndex === this.index) {
setTimeout(() => {
this.playerController.play()
}, 2000)
}
}
onPageShow() {
WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
// WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
}
aboutToDisappear(): void {
this.playerController?.pause();
// this.playerController.onCanplay = ()={}
}
onPageHide() {
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
// WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
devicePLSensorManager.devicePLSensorOff();
this.status = PlayerConstants.STATUS_PAUSE;
// this.status = PlayerConstants.STATUS_PAUSE;
this.playerController?.pause();
}
... ... @@ -127,10 +153,10 @@ export struct DetailPlayShortVideoPage {
WDPlayerRenderView({
playerController: this.playerController,
onLoad: async () => {
console.log('onload==', this.contentId, this.relId, this.relType)
// this.playVM.playWithContentId(this.contentId ?? "846899373")
this.playVM.playWithIds(this.contentId,
this.relId, this.relType)
console.log('onload==',)
// if (this.index === 0) {
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl);
// }
}
})
.height('100%')
... ... @@ -177,49 +203,6 @@ export struct DetailPlayShortVideoPage {
}
.height('100%')
.width('100%')
.backgroundColor(Color.Black)
}
// 续播判断
changeContinue() {
if (this.nextContId) {
this.playerController.continue = () => {
this.playerController?.stop();
this.playVM.playWithContentId(this.nextContId ?? '');
}
return;
}
this.playerController.continue = undefined;
}
urlChanged() {
if (this.url) {
console.log("url:" + this.url);
this.status = PlayerConstants.STATUS_START;
this.playerController.firstPlay(this.url);
}
}
getPlayHistory() {
SPHelper.default.get('playHistory', '').then((str) => {
let result = str.toString();
let time = 0;
if (result != null && result != "") {
let playHistory: Record<string, Record<string, number>> = JSON.parse(result);
let userData: Record<string, number> = {};
if (this.userId) {
userData = playHistory[this.userId] ?? {};
}
if (this.curContId) {
time = userData?.[this.curContId] ?? 0;
}
}
this.playerController?.setStartTime(time);
}).catch((err: Error) => {
// Error: Inner error. Error code 15500000
Logger.error(TAG, 'catch err:' + JSON.stringify(err));
this.playerController?.setStartTime(0);
});
}
}
\ No newline at end of file
... ...
// import router from '@ohos.router';
import mediaquery from '@ohos.mediaquery';
import window from '@ohos.window';
import { ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean';
import { Logger, SPHelper, WindowModel } from 'wdKit';
import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi';
import { PlayControlViewContainer } from '../view/PlayControlViewContainer';
import { PlayerDetailContainer } from '../view/PlayerDetailContainer';
// import { PlayViewModel } from '../viewmodel/PlayViewModel';
import { DetailContainer } from '../view/DetailContainer';
import {
batchLikeAndCollectParams,
batchLikeAndCollectResult,
postBatchAttentionStatusParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { HttpUrlUtils } from 'wdNetwork/Index';
const TAG = 'DetailPlayShortVideoPage';
/**
* 详情&短视频播放页面
*/
@Component
export struct DetailPlayShortVideoPage {
// private contentId?: string = undefined
// private relId?: string = undefined
// private relType?: string = undefined
@Provide contentDetailData: ContentDetailDTO | undefined = undefined
@Provide interactData: InteractDataDTO | undefined = undefined
@Prop @Watch('currentIndexChange') currentIndex: number = 0
private index: number = 0
private playerController: WDPlayerController = new WDPlayerController();
// @Watch("urlChanged") @State url?: string = undefined
// @Watch('changeContinue') @Provide nextContId?: string = '';
// @Watch('getPlayHistory') @Provide curContId?: string = undefined;
// @Watch("playVMChanged") @Provide playVM: PlayViewModel = new PlayViewModel();
@Provide isFullScreen: boolean = false;
// @Provide canStart?: boolean = false;
// @Provide status: number = PlayerConstants.STATUS_START;
// @Provide userId: string = '';
// @Provide newsSourceName?: string = ''
// @Provide newsTitle?: string = ''
// @Provide editorName?: string = ''
// @Provide rmhInfo?: RmhInfoDTO | null = null
// @Provide userInfo?: UserInfoDTO | null = null
// @Provide message?: string = ''
// @Provide newsSummary?: string = ''
@Provide progressVal: number = 0;
@Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
@Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@Provide followStatus: string = '0' // 关注状态
// playVMChanged() {
// this.url = this.playVM.url
// this.newsSourceName = this.playVM.newsSourceName
// this.newsTitle = this.playVM.newsTitle
// this.editorName = this.playVM.editorName
// this.newsSummary = this.playVM.newsSummary
// this.videoLandScape = this.playVM.videoLandScape ?? 1
// this.curContId = this.playVM.contentId
// this.nextContId = this.playVM.nextContId
// this.canStart = this.playVM.canStart;
// this.message = this.playVM.message
// this.rmhInfo = this.playVM.rmhInfo
// this.userInfo = this.playVM.userInfo
// console.error('rmhInfo', this.rmhInfo)
// console.error('userInfo', this.userInfo)
// }
currentIndexChange() {
if (this.currentIndex != this.index) {
this.playerController.pause()
if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) {
this.playerController.release()
}
} else {
console.log('currentIndexChange====1', this.currentIndex)
this.playerController.play()
this.queryNewsInfoOfUser()
}
}
/**
* 查询用户点赞、收藏、关注等状态
*/
queryNewsInfoOfUser() {
if (HttpUrlUtils.getUserId()) {
const params: batchLikeAndCollectParams = {
contentList: [
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
]
}
// 已登录->查询用户对作品点赞、收藏状态
ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
console.log('查询点赞、收藏状态==', JSON.stringify(res.data))
if (res.data) {
this.newsStatusOfUser = res.data[0]
}
})
const params1: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
}
// 已登录->批量查作品是否被号主关注
ContentDetailRequest.postBatchAttentionStatus(params1).then(res => {
console.log('批量查号主是否为用户关注==', JSON.stringify(res.data))
if (res.data) {
this.followStatus = res.data[0]?.status
}
})
}
}
aboutToAppear() {
console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
// this.playVM.setContentDetailData(this.contentDetailData)
// this.playVMChanged()
this.queryNewsInfoOfUser()
this.playerController.onCanplay = () => {
if (this.index == 0 || this.currentIndex === this.index) {
this.videoLandScape = this.contentDetailData?.videoInfo[0]?.videoLandScape
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl);
this.playerController.play()
}
}
// 设置播放地址
// this.url = 'https://media.w3.org/2010/05/sintel/trailer.mp4'
let listener = mediaquery.matchMediaSync('(orientation: landscape)');
listener.on("change", (mediaQueryResult) => {
if (mediaQueryResult.matches) {
console.log("横屏 yes")
this.isFullScreen = true
} else {
this.isFullScreen = false
console.log("横屏 no")
}
// WindowModel.shared.setMainWindowFullScreen(this.isFullScreen)
})
}
onPageShow() {
// WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
}
aboutToDisappear(): void {
this.playerController?.pause();
}
onPageHide() {
// WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
devicePLSensorManager.devicePLSensorOff();
// this.status = PlayerConstants.STATUS_PAUSE;
this.playerController?.pause();
}
@Builder
playerViewContainerBuilder() {
// 播放窗口
WDPlayerRenderView({
playerController: this.playerController,
onLoad: async () => {
console.log('onload==', this.contentId, this.relId, this.relType)
}
})
.height('100%')
.width('100%')
.onClick(() => {
console.error('WDPlayerRenderView=== onClick')
this.playerController?.switchPlayOrPause();
})
}
@Builder
playControlViewContainerBuilder() {
// 播放窗口控制bar
PlayControlViewContainer({
playerController: this.playerController
})
}
@Builder
detailContainerBuilder() {
// DetailTabBarPageComponent({ pageId: this.pageId }).backgroundColor(Color.Black)
DetailContainer({
playerController: this.playerController
})
}
build() {
Row() {
PlayerDetailContainer({
playerView: () => {
this.playerViewContainerBuilder()
}, playControlView: () => {
// this.playControlViewContainerBuilder()
}, detailView: () => {
this.detailContainerBuilder()
}
})
.height('100%')
.width('100%')
.onClick(() => {
console.error('PlayerDetailContainer=== onClick')
this.playerController?.switchPlayOrPause();
})
}
.height('100%')
.width('100%')
.backgroundColor(Color.Black)
}
// 续播判断
// changeContinue() {
// if (this.nextContId) {
// this.playerController.continue = () => {
// this.playerController?.stop();
// // this.playVM.playWithContentId(this.nextContId ?? '');
// }
// return;
// }
// this.playerController.continue = undefined;
// }
// urlChanged() {
// console.error('urlChanged===')
// if (this.url) {
// this.status = PlayerConstants.STATUS_START;
// this.playerController.firstPlay(this.url);
// }
// }
// getPlayHistory() {
// SPHelper.default.get('playHistory', '').then((str) => {
// let result = str.toString();
// let time = 0;
// if (result != null && result != "") {
// let playHistory: Record<string, Record<string, number>> = JSON.parse(result);
// let userData: Record<string, number> = {};
// if (this.userId) {
// userData = playHistory[this.userId] ?? {};
// }
// if (this.curContId) {
// time = userData?.[this.curContId] ?? 0;
// }
// }
// this.playerController?.setStartTime(time);
// }).catch((err: Error) => {
// // Error: Inner error. Error code 15500000
// Logger.error(TAG, 'catch err:' + JSON.stringify(err));
// this.playerController?.setStartTime(0);
// });
// }
}
\ No newline at end of file
... ...
... ... @@ -21,7 +21,6 @@ export struct DetailVideoListPage {
@State interactDataList: InteractDataDTO[] = []
async aboutToAppear(): Promise<void> {
console.error('=================',)
let data: ContentDetailDTO[] = []
let action: Action = router.getParams() as Action
if (action) {
... ... @@ -37,29 +36,31 @@ export struct DetailVideoListPage {
}).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.error('resDTO==', JSON.stringify(resDTO.data))
if (resDTO.data) {
data.push(resDTO.data[0])
this.data.push(resDTO.data[0])
}
})
}
await ContentDetailRequest.postRecommendVideoList({
pageSize: 10,
refreshCnt: 1
}).then(res => {
if (res.data) {
data = data.concat(res.data)
}
console.log('res1===', JSON.stringify(res))
console.log('res==' + this.data)
})
await this.queryVideoList()
// await ContentDetailRequest.postRecommendVideoList({
// pageSize: 5,
// refreshCnt: 1
// }).then(res => {
// if (res.data) {
// data = data.concat(res.data)
// }
// console.log('res1===', JSON.stringify(res))
// console.log('res==' + this.data)
// })
if (data.length > 0) {
if (this.data.length > 0) {
const params: contentListParams = {
contentList: []
}
data.map(item => {
this.data.map(item => {
params.contentList.push({
contentId: item.newsId + '',
contentType: item.newsType
... ... @@ -76,12 +77,27 @@ export struct DetailVideoListPage {
}
this.data = data
// this.data = data
console.error('aboutToAppear===', this.data.length)
}
async queryVideoList() {
await ContentDetailRequest.postRecommendVideoList({
pageSize: 5,
refreshCnt: 1
}).then(res => {
if (res.data) {
this.data = this.data.concat(res.data)
}
console.log('queryVideoList===', JSON.stringify(this.data))
})
}
build() {
Column() {
Swiper(this.swiperController) {
... ... @@ -107,7 +123,7 @@ export struct DetailVideoListPage {
// }, (item: string) => item)
}
.cachedCount(0)
.cachedCount(-1)
.indicator(false)
.vertical(true)
.loop(false)
... ... @@ -117,6 +133,10 @@ export struct DetailVideoListPage {
.onChange((index: number) => {
this.currentIndex = index
console.info('onChange==', index.toString())
if (this.currentIndex === this.data.length - 1) {
this.queryVideoList()
}
})
}.width('100%').height('100%')
... ...
import { InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import { ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import {
batchLikeAndCollectParams,
batchLikeAndCollectResult,
ContentDetailRequest,
contentListParams,
postExecuteCollectRecordParams,
postExecuteLikeParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { ToastUtils } from 'wdKit';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
export interface OperationItem {
icon: Resource;
icon_check?: Resource;
// icon_selected: Resource;
text: string | Resource;
... ... @@ -16,17 +27,19 @@ const TAG = 'OperationListView';
@Preview
@Component
export struct OperationListView {
@Consume rmhInfo?: RmhInfoDTO
@Consume userInfo?: UserInfoDTO
@Consume interactData: InteractDataDTO
@Consume contentDetailData: ContentDetailDTO
@Consume newsStatusOfUser: batchLikeAndCollectResult
@State operationList: OperationItem[] = [
{
icon: $r('app.media.ic_like_uncheck'),
icon_check: $r('app.media.ic_like_check'),
text: "赞",
// num: 6622
},
{
icon: $r('app.media.ic_collect_uncheck'),
icon_check: $r('app.media.ic_collect_check'),
text: "收藏",
// num: 662,
},
... ... @@ -44,26 +57,78 @@ export struct OperationListView {
aboutToAppear() {
}
/**
* 点赞、取消点赞
*/
toggleLikeStatus() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params: postExecuteLikeParams = {
status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
ContentDetailRequest.postExecuteLike(params).then(res => {
console.log('toggleLikeStatus==',)
if (this.newsStatusOfUser) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
this.queryContentInteractCount()
}
})
}
/**
* 收藏、取消收藏
*/
toggleCollectStatus() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params: postExecuteCollectRecordParams = {
status: this.newsStatusOfUser?.collectStatus === 1 ? '0' : '1',
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}],
}
ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
console.log('toggleLikeStatus==',)
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
this.queryContentInteractCount()
}
})
}
/**
* 查询点赞、收藏数量
*/
queryContentInteractCount() {
const params: contentListParams = {
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType,
}]
}
ContentDetailRequest.getContentInteract(params).then(res => {
if (res.data && this.interactData) {
this.interactData.likeNum = res.data[0]?.likeNum
this.interactData.collectNum = res.data[0]?.collectNum
this.interactData.commentNum = res.data[0]?.commentNum
}
console.log('获取互动点赞等数据===', JSON.stringify(res))
})
}
build() {
// List({ space: 0, initialIndex: 0 }) {
// ForEach(this.operationList, (item: OperationItem, index: number) => {
// ListItem() {
// this.buildOperationItem(item, index)
// }
// }, (item: OperationItem, index: number) => JSON.stringify(item))
// }
// .width(48)
// .height(250)
// // .margin({ bottom: 100 })
// .backgroundColor(Color.Red)
// // .listDirection(Axis.Vertical) // 默认值:Axis.Vertical
// // .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1
// .cachedCount(2)
// .scrollBar(BarState.Off)
// .nestedScroll({
// scrollForward: NestedScrollMode.PARENT_FIRST,
// scrollBackward: NestedScrollMode.SELF_FIRST
// })
Column() {
this.buildUserComp()
... ... @@ -74,32 +139,34 @@ export struct OperationListView {
.width(48)
}
getImgUrl() {
return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl
}
@Builder
buildUserComp() {
Column() {
Image(this.rmhInfo?.rmhHeadUrl || this.userInfo?.userHeadUrl)
if (this.getImgUrl()) {
Image(this.getImgUrl())
.width('100%')
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.margin({ bottom: 30 })
}.width(48)
}
}.margin({ bottom: 30 })
}
/**
* 组件项
*
* @param programmeBean item 组件项
*/
@Builder
buildOperationItem(item: OperationItem, index: number) {
Column() {
Image(item.icon)
if (item.text === '赞') {
Image(this.newsStatusOfUser?.likeStatus == '0' ? item.icon : item.icon_check)
.width(32)
.aspectRatio(1)
// .borderRadius(6)
if (item.text === '赞') {
Text(this.interactData.likeNum ? (this.interactData.likeNum + '') : item.text)
.onClick(() => {
this.toggleLikeStatus()
})
Text(this.interactData?.likeNum ? (this.interactData.likeNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
... ... @@ -108,7 +175,13 @@ export struct OperationListView {
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (item.text === '收藏') {
Text(this.interactData.collectNum ? (this.interactData.collectNum + '') : item.text)
Image(this.newsStatusOfUser?.collectStatus == 0 ? item.icon : item.icon_check)
.width(32)
.aspectRatio(1)
.onClick(() => {
this.toggleCollectStatus()
})
Text(this.interactData?.collectNum ? (this.interactData.collectNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
... ... @@ -117,7 +190,10 @@ export struct OperationListView {
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (item.text === '抢首评') {
Text(this.interactData.commentNum ? (this.interactData.commentNum + '') : item.text)
Image(item.icon)
.width(32)
.aspectRatio(1)
Text(this.interactData?.commentNum ? (this.interactData.commentNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
... ... @@ -126,6 +202,9 @@ export struct OperationListView {
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else {
Image(item.icon)
.width(32)
.aspectRatio(1)
Text(item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
... ... @@ -142,9 +221,10 @@ export struct OperationListView {
// .backgroundColor(Color.Black)
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
.onClick((event: ClickEvent) => {
console.info(TAG, `buildOperationItem onClick event index: ${index}`);
// ToastUtils.showToast('体验版,本功能暂未开发', 1000);
})
// .onClick((event: ClickEvent) => {
// console.info(TAG, `buildOperationItem onClick event index: ${index}`);
// // ToastUtils.showToast('体验版,本功能暂未开发', 1000);
// })
}
}
\ No newline at end of file
... ...
... ... @@ -5,18 +5,15 @@ import { WindowModel } from 'wdKit';
import { WDPlayerController } from 'wdPlayer';
import { devicePLSensorManager } from 'wdDetailPlayApi';
import { OperationListView } from './OperationListView';
import { RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import { ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
@Component
export struct PlayerTitleComment {
private playerController?: WDPlayerController;
@Consume newsSourceName?: string
@Consume newsTitle?: string
@Consume editorName?: string
@Consume newsSummary?: string;
@State @Watch('watchSpeed') playSpeed: number = 1;
@Consume isFullScreen: boolean;
@State comment: string = '';
@Consume contentDetailData: ContentDetailDTO | undefined
@Consume isFullScreen: boolean;
@Consume progressVal: number;
@Consume videoLandScape?: number
... ... @@ -27,6 +24,14 @@ export struct PlayerTitleComment {
this.playerController?.setSpeed(this.playSpeed);
}
getName() {
return this.contentDetailData?.newsSourceName || this.contentDetailData?.editorName
}
getTitle() {
return this.contentDetailData?.newsTitle || this.contentDetailData?.newsSummary
}
build() {
Column() {
// Column() {
... ... @@ -59,15 +64,15 @@ export struct PlayerTitleComment {
Row() {
Column() {
if (this.newsSourceName || this.editorName) {
Text("@" + (this.newsSourceName || this.editorName))
if (this.getName()) {
Text("@" + this.getName())
.fontColor(Color.White)
.fontSize(15)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
if (this.newsTitle || this.newsSummary) {
Text(this.newsTitle || this.newsSummary)
if (this.getTitle()) {
Text(this.getTitle())
.fontColor(Color.White)
.fontSize(15)
.maxLines(3)
... ... @@ -134,7 +139,6 @@ export struct PlayerTitleComment {
})
TextInput({ placeholder: '说两句...', text: this.comment })
.placeholderColor(Color.White)
.placeholderFont({ size: 14 })
.fontColor(Color.White)
... ...
... ... @@ -20,6 +20,7 @@ export class WDPlayerController {
public onTimeUpdate?: (position: number, duration: number) => void;
public onVolumeUpdate?: (volume: number) => void;
public continue?: () => void;
public onCanplay?: () => void;
constructor() {
Logger.error("初始化")
... ... @@ -74,6 +75,9 @@ export class WDPlayerController {
}
// this.avPlayer.play();
this.duration = this.avPlayer.duration;
if (this.onCanplay) {
this.onCanplay()
}
break;
case AVPlayerStatus.PLAYING:
this.setBright();
... ... @@ -143,13 +147,15 @@ export class WDPlayerController {
}
async release() {
if (this.avPlayer == null) {
await this.initPromise;
}
// if (this.avPlayer == null) {
// await this.initPromise;
// }
if (this.avPlayer == null) {
return
}
this.avPlayer.release();
this.avPlayer.release()
this.avPlayer = undefined
}
async pause() {
... ... @@ -250,6 +256,10 @@ export class WDPlayerController {
return this.status;
}
getPlayer() {
return this.avPlayer;
}
initProgress(time: number) {
let nowSeconds = Math.floor(time / 1000);
let totalSeconds = Math.floor(this.duration / 1000);
... ...
... ... @@ -74,7 +74,7 @@ export struct WDPlayerRenderView {
Row() {
// 设置为“surface“类型时XComponent组件可以和其他组件一起进行布局和渲染。
XComponent({
id: 'xComponentId112233',
id: 'xComponentId',
type: 'surface',
controller: this.xComponentController
})
... ...
... ... @@ -31,5 +31,6 @@ struct AudioDetail {
this.contentId = params?.contentID || '';
Logger.info(TAG, 'aboutToAppear');
Logger.info(TAG, 'params', JSON.stringify(params));
console.log('参数',JSON.stringify(par))
}
}
\ No newline at end of file
... ...