王士厅
Showing 23 changed files with 837 additions and 394 deletions
  1 +<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>
  1 +<?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>
  1 +<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>
  1 +<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>
  1 +<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>
  1 +<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>
1 -<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>  
  1 +<?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>
  1 +<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>
  1 +<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>
@@ -41,13 +41,29 @@ export class HttpUrlUtils { @@ -41,13 +41,29 @@ export class HttpUrlUtils {
41 /** 41 /**
42 * 批查接口,查询互动相关数据,如收藏数、评论数等 42 * 批查接口,查询互动相关数据,如收藏数、评论数等
43 */ 43 */
44 - static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/v2/content/interactData"; 44 + static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData";
45 // 多图(图集)详情页 45 // 多图(图集)详情页
46 /** 46 /**
47 * 批量查询内容当前用户点赞、收藏状态 47 * 批量查询内容当前用户点赞、收藏状态
48 */ 48 */
49 static readonly INTERACT_DATA_STATUS: string = "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status"; 49 static readonly INTERACT_DATA_STATUS: string = "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status";
50 /** 50 /**
  51 + * 点赞、取消点赞
  52 + */
  53 + static readonly INTERACT_EXECUTELIKE: string = "/api/rmrb-interact/interact/zh/c/like/executeLike";
  54 + /**
  55 + * 收藏、取消收藏
  56 + */
  57 + static readonly INTERACT_EXECUTECOLLECTRECORD: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord";
  58 + /**
  59 + * 用户等级/积分-APP根据业务场景动态增减成长值(APP)
  60 + */
  61 + static readonly USERPOINT_OPERATE: string = "/api/rmrb-user-point/auth/pointLevel/zh/operate";
  62 + /**
  63 + * 评论发布
  64 + */
  65 + static readonly COMMENT_PUBLISH: string = "/api/rmrb-comment/comment/zh/c/publish";
  66 + /**
51 * 沉浸式視頻批量查詢20條數據 67 * 沉浸式視頻批量查詢20條數據
52 */ 68 */
53 static readonly RECOMMEND_VIDEOLIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/videoList"; 69 static readonly RECOMMEND_VIDEOLIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/videoList";
1 import { Logger } from 'wdKit'; 1 import { Logger } from 'wdKit';
2 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 2 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
3 -import { ContentDetailDTO, PhotoListBean } from 'wdBean'; 3 +import { ContentDetailDTO } from 'wdBean';
4 import media from '@ohos.multimedia.media'; 4 import media from '@ohos.multimedia.media';
5 import { OperRowListView } from './view/OperRowListView'; 5 import { OperRowListView } from './view/OperRowListView';
  6 +import { WDPlayerController } from 'wdPlayer';
6 const TAG = 'AudioDetailComponent' 7 const TAG = 'AudioDetailComponent'
  8 +interface Arr{
  9 + image:string,
  10 + title:string
  11 +}
  12 +
7 @Component 13 @Component
8 export struct AudioDetailComponent { 14 export struct AudioDetailComponent {
9 private relId: string = '' 15 private relId: string = ''
10 private contentId: string = '' 16 private contentId: string = ''
11 private relType: string = '' 17 private relType: string = ''
12 - // private avPlayer:media.AVPlayer 18 + private playerController: WDPlayerController = new WDPlayerController();
  19 +
  20 + private arr:Arr[]=[
  21 + {image:'clock',title:'定时'},
  22 + {image:'theOriginal',title:'原文'},
  23 + {image:'list',title:'列表'},
  24 + ]
13 25
14 - @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]  
15 - @State iocClock: string = '定时';  
16 - @State iconTheOriginal: string = '原文';  
17 - @State iconList: string = '列表';  
18 - @State text: string = ''  
19 - @State coverImage:string = 'app.media.audio'  
20 - @State newsTitle:string = '夜读' 26 + @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]//详情
  27 + @State coverImage:string = '' //封面图
  28 + @State newsTitle:string = '' //标题
  29 + @State duration:number = 0 //时长
  30 + @State audioUrl:string = '' //音频路径
  31 + @State outSetValueOne:number = 40 //播放进度
21 32
22 - @State palyIcon:string = "app.media.playicon" 33 + @State @Watch('onIsPlayChanged')isPlay: boolean = true
  34 + onIsPlayChanged(){
  35 + if(this.isPlay){
  36 + console.log('监听播放')
  37 + // this.avPlayer.play()
  38 + }else{
  39 + console.log('监听暂停')
  40 + // this.avPlayer.pause()
  41 + }
  42 + }
23 43
24 - @State showList: boolean = false  
25 - @State outSetValueOne:number = 40  
26 - //  
27 - // @State @Watch('onIsPlayChanged')isPlay: boolean = false  
28 - // onIsPlayChanged(){  
29 - // if(this.isPlay){  
30 - // this.avPlayer.play()  
31 - // this.palyIcon = "app.media.suspend"  
32 - // }else{  
33 - // this.avPlayer.pause()  
34 - // this.palyIcon = "app.media.playicon"  
35 - // }  
36 - // }  
37 - //  
38 async aboutToAppear() { 44 async aboutToAppear() {
39 - this.getContentDetailData()  
40 - // // 创建avPlayer实例对象  
41 - // this.avPlayer = await media.createAVPlayer()  
42 - // // 创建状态机变化回调函数  
43 - // this.setAVPlayerCallback() 45 + await this.getContentDetailData()
  46 + this.playerController.firstPlay(this.audioUrl);
44 } 47 }
45 - //  
46 - // // 注册avplayer回调函数  
47 - // setAVPlayerCallback() {  
48 - // // seek操作结果回调函数  
49 - // this.avPlayer.on('seekDone', (seekDoneTime) => {  
50 - // console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`);  
51 - // })  
52 - // // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程  
53 - // this.avPlayer.on('error', (err) => {  
54 - // console.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`);  
55 - // this.avPlayer.reset(); // 调用reset重置资源,触发idle状态  
56 - // })  
57 - // // 状态机变化回调函数  
58 - // this.avPlayer.on('stateChange', async (state, reason) => {  
59 - // switch (state) {  
60 - // case 'idle': // 成功调用reset接口后触发该状态机上报  
61 - // console.info('AVPlayer state idle called.');  
62 - // this.avPlayer.release(); // 调用release接口销毁实例对象  
63 - // this.isPlay = false  
64 - // break;  
65 - // case 'initialized': // avplayer 设置播放源后触发该状态上报  
66 - // console.info('AVPlayerstate initialized called.');  
67 - // this.avPlayer.prepare().then(() => {  
68 - // console.info('AVPlayer prepare succeeded.');  
69 - // })  
70 - // this.isPlay = false  
71 - // break;  
72 - // case 'prepared': // prepare调用成功后上报该状态机  
73 - // console.info('AVPlayer state prepared called.');  
74 - // this.isPlay = false  
75 - // this.avPlayer.play(); // 调用播放接口开始播放  
76 - // break;  
77 - // case 'playing': // play成功调用后触发该状态机上报  
78 - // console.info('AVPlayer state playing called.');  
79 - // this.isPlay = true  
80 - // break;  
81 - // case 'paused': // pause成功调用后触发该状态机上报  
82 - // console.info('AVPlayer state paused called.');  
83 - // this.avPlayer.play(); // 再次播放接口开始播放  
84 - // this.isPlay = false  
85 - // break;  
86 - // case 'completed': // 播放结束后触发该状态机上报  
87 - // console.info('AVPlayer state completed called.');  
88 - // this.avPlayer.stop(); //调用播放结束接口  
89 - // break;  
90 - // case 'stopped': // stop接口成功调用后触发该状态机上报  
91 - // console.info('AVPlayer state stopped called.');  
92 - // this.avPlayer.reset(); // 调用reset接口初始化avplayer状态  
93 - // this.isPlay = false  
94 - // break;  
95 - // case 'released':  
96 - // console.info('AVPlayer state released called.');  
97 - // break;  
98 - // default:  
99 - // console.info('AVPlayer state unknown called.');  
100 - // break;  
101 - // }  
102 - // })  
103 - // }  
104 - // gotoPlay(){  
105 - // this.avPlayer.url = this.contentDetailData[0].audioList[0].audioUrl  
106 - // }  
107 build() { 48 build() {
108 Row() { 49 Row() {
109 Column() { 50 Column() {
110 // 封面 51 // 封面
111 Row() { 52 Row() {
112 - Image($r('app.media.audio')) 53 + Image(this.coverImage)
113 .width(240) 54 .width(240)
114 .height(160) 55 .height(160)
115 .borderRadius('0') 56 .borderRadius('0')
@@ -129,49 +70,21 @@ export struct AudioDetailComponent { @@ -129,49 +70,21 @@ export struct AudioDetailComponent {
129 } 70 }
130 .padding({ left: 34, right: 34 }) 71 .padding({ left: 34, right: 34 })
131 .margin({ top: 32 }) 72 .margin({ top: 32 })
132 -  
133 // 操作矩阵 73 // 操作矩阵
134 Row() { 74 Row() {
135 - // 定时  
136 - Column() {  
137 - Image($r('app.media.clock'))  
138 - .width(28)  
139 - .height(28)  
140 - Text(this.iocClock)  
141 - .fontColor('#fff')  
142 - .fontSize(12)  
143 - .lineHeight(16)  
144 - .margin(2)  
145 - }  
146 -  
147 - // 原文  
148 - Column() {  
149 - Image($r('app.media.theOriginal'))  
150 - .width(28)  
151 - .height(28)  
152 - Text(this.iconTheOriginal)  
153 - .fontColor('#fff')  
154 - .fontSize(12)  
155 - .lineHeight(16)  
156 - .margin(2)  
157 - }  
158 -  
159 - // 列表  
160 - Column() {  
161 - Image($r('app.media.list'))  
162 - .width(28)  
163 - .height(28)  
164 - Text(this.iconList)  
165 - .fontColor('#fff')  
166 - .fontSize(12)  
167 - .lineHeight(16)  
168 - .margin(2)  
169 - }  
170 - .onClick(() => {  
171 - this.showList = !this.showList  
172 - Logger.info(TAG,'这里')  
173 - console.log('列表', this.showList) 75 + ForEach(this.arr,(item:Arr)=>{
  76 + Column() {
  77 + 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'):'')
  78 + .width(28)
  79 + .height(28)
  80 + Text(item.title)
  81 + .fontColor('#4D5258')
  82 + .fontSize(12)
  83 + .lineHeight(16)
  84 + .margin(2)
  85 + }
174 }) 86 })
  87 +
175 } 88 }
176 .width('100%') 89 .width('100%')
177 .padding({ left: 49, right: 49 }) 90 .padding({ left: 49, right: 49 })
@@ -181,61 +94,59 @@ export struct AudioDetailComponent { @@ -181,61 +94,59 @@ export struct AudioDetailComponent {
181 Column(){ 94 Column(){
182 // 进度条 95 // 进度条
183 Row(){ 96 Row(){
184 - Slider({  
185 - value: this.outSetValueOne,  
186 - min: 0,  
187 - max: 100,  
188 - style: SliderStyle.OutSet  
189 - })  
190 - .trackColor('rgba(0,0,0,0.5)')  
191 - .selectedColor('#ED2800')  
192 - .showTips(true)  
193 - .onChange((value: number, mode: SliderChangeMode) => {  
194 - this.outSetValueOne = value  
195 - console.info('value:' + value + 'mode:' + mode.toString())  
196 - }) 97 + Progress({ value: this.outSetValueOne, type: ProgressType.Linear })
  98 + .width('100%')
  99 + .color('#ED2800')
  100 + .backgroundColor('rgba(0,0,0,0.5)')
197 } 101 }
198 .width('100%') 102 .width('100%')
199 .padding({left:24,right:24}) 103 .padding({left:24,right:24})
200 .margin({top:110}) 104 .margin({top:110})
201 // 播放按钮 105 // 播放按钮
202 Row(){ 106 Row(){
203 - Image($r('app.media.loop'))  
204 - .width(24)  
205 - .height(24)  
206 - Image($r('app.media.Backward')) 107 + Column(){
  108 + Image($r('app.media.loop_close'))
  109 + .width(24)
  110 + .height(24)
  111 + Text('循环')
  112 + .fontColor('#4D5258')
  113 + .fontSize(12)
  114 + .lineHeight(16)
  115 + .margin(2)
  116 + }
  117 +
  118 + Image($r('app.media.Backward_close'))
207 .width(24) 119 .width(24)
208 .height(24) 120 .height(24)
209 - Stack(){  
210 - Image($r('app.media.playicon')) 121 + Stack({ alignContent: Alignment.Center }){
  122 + Image(this.isPlay?$r('app.media.suspend'):$r('app.media.playicon'))
211 .width(32) 123 .width(32)
212 .height(32) 124 .height(32)
213 -  
214 } 125 }
215 - .backgroundColor('rgba(255,255,255,0.1)')  
216 - .width(60)  
217 - .height(60) 126 + .padding(28)
  127 + .backgroundColor('#4D5258')
218 .borderRadius(50) 128 .borderRadius(50)
219 - .alignContent(Alignment.Center)  
220 - .onClick(()=>{  
221 - // this.gotoPlay()  
222 - console.log('播放')  
223 - this.getContentDetailData()  
224 - })  
225 -  
226 - Image($r('app.media.fastForward'))  
227 - .width(24)  
228 - .height(24)  
229 - Image($r('app.media.doubleSpeed')) 129 + Image($r('app.media.fastForward_close'))
230 .width(24) 130 .width(24)
231 .height(24) 131 .height(24)
  132 + Column(){
  133 + Image($r('app.media.doubleSpeed_close'))
  134 + .width(24)
  135 + .height(24)
  136 + Text('倍速')
  137 + .fontColor('#4D5258')
  138 + .fontSize(12)
  139 + .lineHeight(16)
  140 + .margin(2)
  141 + }
232 } 142 }
233 .width('100%') 143 .width('100%')
234 .justifyContent(FlexAlign.SpaceBetween) 144 .justifyContent(FlexAlign.SpaceBetween)
235 .margin({top:56}) 145 .margin({top:56})
236 .padding({left:32,right:32}) 146 .padding({left:32,right:32})
237 } 147 }
238 - // OperRowListView() 148 + .layoutWeight(1)
  149 + OperRowListView()
239 } 150 }
240 } 151 }
241 152
@@ -245,15 +156,17 @@ export struct AudioDetailComponent { @@ -245,15 +156,17 @@ export struct AudioDetailComponent {
245 try { 156 try {
246 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) 157 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
247 this.contentDetailData = data; 158 this.contentDetailData = data;
248 - this.coverImage = this.contentDetailData[0].audioList[0].fullColumnImgUrls[0].url 159 + console.log('音乐详情',JSON.stringify(this.contentDetailData))
249 this.newsTitle = this.contentDetailData[0].newsTitle 160 this.newsTitle = this.contentDetailData[0].newsTitle
250 - Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)  
251 - console.log(JSON.stringify(this.contentDetailData))  
252 - console.log(this.newsTitle)  
253 - console.log(this.coverImage)  
254 - 161 + console.log('标题',JSON.stringify(this.newsTitle))
  162 + this.coverImage = this.contentDetailData[0].fullColumnImgUrls[0].url
  163 + console.log('封面图',JSON.stringify(this.coverImage))
  164 + this.duration = this.contentDetailData[0].audioList[0].duration
  165 + console.log('音频时长',JSON.stringify(this.duration))
  166 + this.audioUrl = this.contentDetailData[0].audioList[0].audioUrl
  167 + console.log('音频时长',JSON.stringify(this.audioUrl))
255 } catch (exception) { 168 } catch (exception) {
256 - 169 + console.log('请求失败',JSON.stringify(exception))
257 } 170 }
258 } 171 }
259 } 172 }
1 import { Action, CompDTO, Params } from 'wdBean'; 1 import { Action, CompDTO, Params } from 'wdBean';
2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; 2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
  3 +import { CommonConstants } from 'wdConstant/Index';
3 import { DateTimeUtils, Logger } from 'wdKit'; 4 import { DateTimeUtils, Logger } from 'wdKit';
4 import { WDRouterRule } from 'wdRouter'; 5 import { WDRouterRule } from 'wdRouter';
5 6
@@ -23,15 +24,12 @@ export struct AlbumCardComponent { @@ -23,15 +24,12 @@ export struct AlbumCardComponent {
23 .fontColor(0x222222) 24 .fontColor(0x222222)
24 .lineHeight(25) 25 .lineHeight(25)
25 .maxLines(3) 26 .maxLines(3)
26 - .margin({ top: 6,  
27 - left: 16,  
28 - right: 16 })  
29 - .width(343) 27 + .width(CommonConstants.FULL_WIDTH)
30 28
31 RelativeContainer() { 29 RelativeContainer() {
32 Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url) 30 Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url)
33 - .width(229)  
34 - .height(154) 31 + .width('66.6%')
  32 + .aspectRatio(16/9)
35 .alignRules({ 33 .alignRules({
36 top: { anchor: "__container__", align: VerticalAlign.Top }, 34 top: { anchor: "__container__", align: VerticalAlign.Top },
37 left: { anchor: "__container__", align: HorizontalAlign.Start } 35 left: { anchor: "__container__", align: HorizontalAlign.Start }
@@ -39,8 +37,8 @@ export struct AlbumCardComponent { @@ -39,8 +37,8 @@ export struct AlbumCardComponent {
39 .id('mainImage') 37 .id('mainImage')
40 38
41 Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url) 39 Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url)
42 - .width(112)  
43 - .height(76) 40 + .width('33%')
  41 + .aspectRatio(16/9)
44 .alignRules({ 42 .alignRules({
45 top: { anchor: "__container__", align: VerticalAlign.Top }, 43 top: { anchor: "__container__", align: VerticalAlign.Top },
46 right: { anchor: "__container__", align: HorizontalAlign.End } 44 right: { anchor: "__container__", align: HorizontalAlign.End }
@@ -48,14 +46,14 @@ export struct AlbumCardComponent { @@ -48,14 +46,14 @@ export struct AlbumCardComponent {
48 .id('subTopImage') 46 .id('subTopImage')
49 47
50 Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url) 48 Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url)
51 - .width(112)  
52 - .height(76) 49 + .width('33%')
  50 + .aspectRatio(16/9)
53 .alignRules({ 51 .alignRules({
54 right: { anchor: "__container__", align: HorizontalAlign.End }, 52 right: { anchor: "__container__", align: HorizontalAlign.End },
55 bottom: { anchor: "__container__", align: VerticalAlign.Bottom } 53 bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
56 }) 54 })
57 .id('subBottomImage') 55 .id('subBottomImage')
58 - 56 + // 下面是渲染右下角图标
59 Shape() { 57 Shape() {
60 Rect().width(33).height(18) 58 Rect().width(33).height(18)
61 } 59 }
@@ -97,8 +95,8 @@ export struct AlbumCardComponent { @@ -97,8 +95,8 @@ export struct AlbumCardComponent {
97 .width(17) 95 .width(17)
98 .height(17) 96 .height(17)
99 } 97 }
100 - .width(343)  
101 - .height(154) 98 + .width(CommonConstants.FULL_WIDTH)
  99 + .aspectRatio(24/9)
102 .onClick((event: ClickEvent) => { 100 .onClick((event: ClickEvent) => {
103 let taskAction: Action = { 101 let taskAction: Action = {
104 type: 'JUMP_DETAIL_PAGE', 102 type: 'JUMP_DETAIL_PAGE',
@@ -134,13 +132,17 @@ export struct AlbumCardComponent { @@ -134,13 +132,17 @@ export struct AlbumCardComponent {
134 .margin({ 132 .margin({
135 left: 6 133 left: 6
136 }) 134 })
137 - }.margin({ left: 24 })  
138 - .width(375) 135 + }
  136 + .width(CommonConstants.FULL_WIDTH)
139 .height(16) 137 .height(16)
140 .id('label') 138 .id('label')
141 } 139 }
142 - .width(375)  
143 -  
144 - // .backgroundColor(0x000000) 140 + .width(CommonConstants.FULL_WIDTH)
  141 + .padding({
  142 + top: 14,
  143 + left: 16,
  144 + right: 16,
  145 + bottom: 14
  146 + })
145 } 147 }
146 } 148 }
@@ -13,7 +13,7 @@ export interface ContentDetailRequestParams { @@ -13,7 +13,7 @@ export interface ContentDetailRequestParams {
13 relType: string 13 relType: string
14 } 14 }
15 15
16 -export interface recommentVideoListParame { 16 +export interface recommentVideoListParams {
17 pageSize: number; 17 pageSize: number;
18 refreshCnt: number; 18 refreshCnt: number;
19 } 19 }
@@ -27,6 +27,94 @@ export interface contentListParams { @@ -27,6 +27,94 @@ export interface contentListParams {
27 contentList: contentListItem[]; 27 contentList: contentListItem[];
28 } 28 }
29 29
  30 +export interface IStatusContentList {
  31 + contentId: string;
  32 +
  33 + // relType: string;
  34 + contentType: string;
  35 + // contentRelId: string;
  36 +}
  37 +
  38 +export interface batchLikeAndCollectParams {
  39 + // userType: number;
  40 + // userId: string;
  41 + contentList: IStatusContentList[]
  42 +}
  43 +
  44 +export interface batchLikeAndCollectResult {
  45 + collectStatus: number;
  46 + contentType: string;
  47 + likeStatus: string;
  48 + relType: string;
  49 + contentId: string;
  50 + contentRelId: string;
  51 +}
  52 +
  53 +export interface postBatchAttentionStatusParamsItem {
  54 + creatorId: string;
  55 +}
  56 +
  57 +export interface postBatchAttentionStatusParams {
  58 + creatorIds: postBatchAttentionStatusParamsItem[]
  59 +}
  60 +
  61 +export interface postBatchAttentionStatusResult {
  62 + creatorId: string;
  63 + status: string;
  64 + userId: string;
  65 +}
  66 +
  67 +
  68 +export interface postExecuteLikeParams {
  69 + status: string;
  70 + contentId: string;
  71 + contentType: string;
  72 + relType?: string;
  73 + userName?: string;
  74 + title?: string;
  75 + contentRelId?: string;
  76 + userHeaderUrl?: string;
  77 + channelId?: string;
  78 +}
  79 +
  80 +export interface postExecuteCollectRecordParamsItem {
  81 + contentId: string;
  82 + contentType: string;
  83 + relType?: string;
  84 + contentRelId?: string;
  85 +}
  86 +
  87 +export interface postExecuteCollectRecordParams {
  88 + status: string;
  89 + contentList: postExecuteCollectRecordParamsItem[]
  90 +}
  91 +
  92 +export interface postPointLevelOperateParams {
  93 + operateType: number;
  94 +}
  95 +
  96 +export interface postCommentPublishParams {
  97 + targetId: string;
  98 + keyArticle: string;
  99 + commentPics: string;
  100 + targetTitle: string;
  101 + commentType: string;
  102 + targetType: string;
  103 + commentContent: string;
  104 + parentId: string;
  105 + rootCommentId: string;
  106 +}
  107 +
  108 +export interface postInteractBrowsOperateParamsContent {
  109 + browseTime: string;
  110 + contentId: string;
  111 + contentType: number;
  112 +}
  113 +
  114 +export interface postInteractBrowsOperateParams {
  115 + delStatus: number;
  116 + contentList: postInteractBrowsOperateParamsContent[]
  117 +}
30 118
31 export class ContentDetailRequest { 119 export class ContentDetailRequest {
32 static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> { 120 static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> {
@@ -71,23 +159,23 @@ export class ContentDetailRequest { @@ -71,23 +159,23 @@ export class ContentDetailRequest {
71 } 159 }
72 160
73 /** 161 /**
74 - * 162 + * 批量查询作品查询点赞、收藏状态
75 * @returns 163 * @returns
76 */ 164 */
77 - static postBatchLikeAndCollectStatus() { 165 + static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> {
78 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS 166 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS
79 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 167 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
80 - return WDHttp.post(url, headers) 168 + return WDHttp.post0(url, params, headers)
81 } 169 }
82 170
83 /** 171 /**
84 - * 172 + * 批量查号主是否为用户关注
85 * @returns 173 * @returns
86 */ 174 */
87 - static postBatchAttentionStatus() { 175 + static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
88 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH 176 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
89 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 177 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
90 - return WDHttp.post(url, headers) 178 + return WDHttp.post0(url, params, headers)
91 } 179 }
92 180
93 181
@@ -96,9 +184,60 @@ export class ContentDetailRequest { @@ -96,9 +184,60 @@ export class ContentDetailRequest {
96 * @returns 184 * @returns
97 */ 185 */
98 186
99 - static postRecommendVideoList(params: recommentVideoListParame): Promise<ResponseDTO<ContentDetailDTO[]>> { 187 + static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
100 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST 188 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST
101 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 189 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
102 return WDHttp.post0(url, params, headers) 190 return WDHttp.post0(url, params, headers)
103 } 191 }
  192 +
  193 + /**
  194 + *用户点赞、取消点赞
  195 + * @param params
  196 + * @returns
  197 + */
  198 + static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
  199 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
  200 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  201 + return WDHttp.post0(url, params, headers)
  202 + }
  203 +
  204 + /**
  205 + *用户收藏、取消收藏
  206 + * @param params
  207 + * @returns
  208 + */
  209 + static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
  210 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
  211 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  212 + return WDHttp.post0(url, params, headers)
  213 + }
  214 +
  215 + /**
  216 + *用户等级/积分-APP根据业务场景动态增减成长值(APP)
  217 + * 操作类型:1阅读 2评论 3回复(积分任务同评论) 4分享 5点赞 6关注 7打开客户端 8上传头像 9打开推送开关
  218 + */
  219 + static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> {
  220 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE
  221 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  222 + return WDHttp.post0(url, params, headers)
  223 + }
  224 +
  225 + /**
  226 + * 评论发布
  227 + */
  228 + static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> {
  229 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH
  230 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  231 + return WDHttp.post0(url, params, headers)
  232 + }
  233 +
  234 +
  235 + /**
  236 + * 浏览历史新增、删除接口
  237 + */
  238 + static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> {
  239 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE
  240 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  241 + return WDHttp.post0(url, params, headers)
  242 + }
104 } 243 }
1 -import router from '@ohos.router';  
2 import mediaquery from '@ohos.mediaquery'; 1 import mediaquery from '@ohos.mediaquery';
3 -import window from '@ohos.window';  
4 -import { Action, ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean';  
5 -import { Logger, SPHelper, WindowModel } from 'wdKit';  
6 -import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer';  
7 -import { devicePLSensorManager } from 'wdDetailPlayApi'; 2 +import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
  3 +import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
  4 +import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi';
8 import { PlayControlViewContainer } from '../view/PlayControlViewContainer'; 5 import { PlayControlViewContainer } from '../view/PlayControlViewContainer';
9 import { PlayerDetailContainer } from '../view/PlayerDetailContainer'; 6 import { PlayerDetailContainer } from '../view/PlayerDetailContainer';
10 -import { PlayViewModel } from '../viewmodel/PlayViewModel';  
11 import { DetailContainer } from '../view/DetailContainer'; 7 import { DetailContainer } from '../view/DetailContainer';
  8 +import {
  9 + batchLikeAndCollectParams,
  10 + batchLikeAndCollectResult,
  11 + postBatchAttentionStatusParams,
  12 + postInteractBrowsOperateParams
  13 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
  14 +import { HttpUrlUtils } from 'wdNetwork/Index';
  15 +import { DateTimeUtils } from 'wdKit/Index';
12 16
13 const TAG = 'DetailPlayShortVideoPage'; 17 const TAG = 'DetailPlayShortVideoPage';
14 18
@@ -18,74 +22,101 @@ const TAG = 'DetailPlayShortVideoPage'; @@ -18,74 +22,101 @@ const TAG = 'DetailPlayShortVideoPage';
18 22
19 @Component 23 @Component
20 export struct DetailPlayShortVideoPage { 24 export struct DetailPlayShortVideoPage {
21 - private contentId?: string = undefined  
22 - private relId?: string = undefined  
23 - private relType?: string = undefined  
24 - private contentDetailData: ContentDetailDTO | undefined = undefined  
25 - @Provide interactData: InteractDataDTO | undefined = undefined 25 + @Prop index: number = 0
26 @Prop @Watch('currentIndexChange') currentIndex: number = 0 26 @Prop @Watch('currentIndexChange') currentIndex: number = 0
27 - private index: number = 0  
28 - private playerController: WDPlayerController = new WDPlayerController();  
29 - @Watch("urlChanged") @State url?: string = undefined  
30 - @Watch('changeContinue') @Provide nextContId?: string = '';  
31 - @Watch('getPlayHistory') @Provide curContId?: string = undefined;  
32 - @Watch("playVMChanged") @Provide playVM: PlayViewModel = new PlayViewModel(); 27 + @State playerController: WDPlayerController = new WDPlayerController();
  28 + @Provide contentDetailData: ContentDetailDTO | undefined = undefined
  29 + @Provide interactData: InteractDataDTO | undefined = undefined
33 @Provide isFullScreen: boolean = false; 30 @Provide isFullScreen: boolean = false;
34 - @Provide canStart?: boolean = false;  
35 - @Provide status: number = PlayerConstants.STATUS_START;  
36 - @Provide userId: string = '';  
37 - @Provide newsSourceName?: string = ''  
38 - @Provide newsTitle?: string = ''  
39 - @Provide editorName?: string = ''  
40 - @Provide rmhInfo?: RmhInfoDTO | null = null  
41 - @Provide userInfo?: UserInfoDTO | null = null  
42 - @Provide message?: string = ''  
43 - @Provide newsSummary?: string = ''  
44 @Provide progressVal: number = 0; 31 @Provide progressVal: number = 0;
45 @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2 32 @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
46 -  
47 - playVMChanged() {  
48 - this.url = this.playVM.url  
49 - this.newsSourceName = this.playVM.newsSourceName  
50 - this.newsTitle = this.playVM.newsTitle  
51 - this.editorName = this.playVM.editorName  
52 - this.newsSummary = this.playVM.newsSummary  
53 - this.videoLandScape = this.playVM.videoLandScape ?? 1  
54 - this.curContId = this.playVM.contentId  
55 - this.nextContId = this.playVM.nextContId  
56 - this.canStart = this.playVM.canStart;  
57 - this.message = this.playVM.message  
58 - this.rmhInfo = this.playVM.rmhInfo  
59 - this.userInfo = this.playVM.userInfo  
60 - } 33 + @Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
  34 + @Provide followStatus: string = '0' // 关注状态
61 35
62 currentIndexChange() { 36 currentIndexChange() {
63 - console.log('currentIndexChange====', this.currentIndex)  
64 if (this.currentIndex != this.index) { 37 if (this.currentIndex != this.index) {
65 this.playerController.pause() 38 this.playerController.pause()
  39 +
  40 + // if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) {
  41 + // this.playerController.release()
  42 + // }
  43 +
66 } else { 44 } else {
67 - console.log('currentIndexChange====1', this.playerController)  
68 - this.playerController.switchPlayOrPause() 45 + this.queryNewsInfoOfUser()
  46 + console.log('currentIndex==== ', this.currentIndex)
  47 + if (!this.playerController.getPlayer()) {
  48 + this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '');
  49 + } else {
  50 + this.playerController.play()
  51 + }
  52 +
69 } 53 }
70 } 54 }
71 55
72 - aboutToAppear() {  
73 - console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData)) 56 + /**
  57 + * 查询用户点赞、收藏、关注等状态
  58 + */
  59 + queryNewsInfoOfUser() {
  60 + if (HttpUrlUtils.getUserId()) {
  61 + const params: batchLikeAndCollectParams = {
  62 + contentList: [
  63 + {
  64 + contentId: this.contentDetailData?.newsId + '',
  65 + contentType: this.contentDetailData?.newsType + '',
  66 + }
  67 + ]
  68 + }
  69 + // 已登录->查询用户对作品点赞、收藏状态
  70 + ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
  71 + console.log('查询点赞、收藏状态==', JSON.stringify(res.data))
  72 + if (res.data) {
  73 + this.newsStatusOfUser = res.data[0]
  74 + }
  75 + })
74 76
75 - this.playVM.setContentDetailData(this.contentDetailData) 77 + const params1: postBatchAttentionStatusParams = {
  78 + creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
  79 + }
  80 + // 已登录->批量查作品是否被号主关注
  81 + ContentDetailRequest.postBatchAttentionStatus(params1).then(res => {
  82 + console.log('批量查号主是否为用户关注==', JSON.stringify(res.data))
  83 + if (res.data) {
  84 + this.followStatus = res.data[0]?.status
  85 + }
  86 + })
76 87
77 - let action: Action = router.getParams() as Action  
78 - Logger.info(TAG, "action", JSON.stringify(action))  
79 - if (action) {  
80 - this.contentId = action.params?.contentID  
81 - if (action.params && action.params.extra) {  
82 - this.relId = action.params.extra.relId  
83 - this.relType = action.params.extra.relType 88 + // 记录浏览历史
  89 + const params2: postInteractBrowsOperateParams = {
  90 + delStatus: 0,
  91 + contentList: [{
  92 + browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),
  93 + contentId: this.contentDetailData?.newsId + '',
  94 + contentType: this.contentDetailData?.newsType || 0,
  95 + }]
84 } 96 }
  97 + ContentDetailRequest.postInteractBrowsOperate(params2).then(res => {
  98 + console.log('记录浏览历史==', JSON.stringify(res.data))
  99 +
  100 + })
  101 + }
  102 +
  103 + }
  104 +
  105 + aboutToAppear() {
  106 + console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
  107 + this.videoLandScape = this.contentDetailData?.videoInfo[0]?.videoLandScape
  108 + this.queryNewsInfoOfUser()
  109 + this.playerController.onCanplay = () => {
  110 + if (this.index == 0 || this.currentIndex === this.index) {
  111 + this.playerController.play()
  112 + }
  113 + }
  114 +
  115 + this.playerController.onTimeUpdate = (position, duration) => {
  116 + this.progressVal = Math.floor(position * 100 / duration);
85 } 117 }
86 118
87 // 设置播放地址 119 // 设置播放地址
88 - // this.url = 'https://media.w3.org/2010/05/sintel/trailer.mp4'  
89 let listener = mediaquery.matchMediaSync('(orientation: landscape)'); 120 let listener = mediaquery.matchMediaSync('(orientation: landscape)');
90 listener.on("change", (mediaQueryResult) => { 121 listener.on("change", (mediaQueryResult) => {
91 if (mediaQueryResult.matches) { 122 if (mediaQueryResult.matches) {
@@ -95,29 +126,24 @@ export struct DetailPlayShortVideoPage { @@ -95,29 +126,24 @@ export struct DetailPlayShortVideoPage {
95 this.isFullScreen = false 126 this.isFullScreen = false
96 console.log("横屏 no") 127 console.log("横屏 no")
97 } 128 }
98 - WindowModel.shared.setMainWindowFullScreen(this.isFullScreen) 129 + // WindowModel.shared.setMainWindowFullScreen(this.isFullScreen)
99 }) 130 })
100 - console.error('111,', this.index, this.currentIndex)  
101 - if (this.index == 0 && this.currentIndex === this.index) {  
102 - setTimeout(() => {  
103 - this.playerController.play()  
104 - }, 2000)  
105 131
106 - }  
107 } 132 }
108 133
109 onPageShow() { 134 onPageShow() {
110 - WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); 135 + // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
111 } 136 }
112 137
113 aboutToDisappear(): void { 138 aboutToDisappear(): void {
114 this.playerController?.pause(); 139 this.playerController?.pause();
  140 + // this.playerController.onCanplay = ()={}
115 } 141 }
116 142
117 onPageHide() { 143 onPageHide() {
118 - WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT); 144 + // WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
119 devicePLSensorManager.devicePLSensorOff(); 145 devicePLSensorManager.devicePLSensorOff();
120 - this.status = PlayerConstants.STATUS_PAUSE; 146 + // this.status = PlayerConstants.STATUS_PAUSE;
121 this.playerController?.pause(); 147 this.playerController?.pause();
122 } 148 }
123 149
@@ -127,10 +153,10 @@ export struct DetailPlayShortVideoPage { @@ -127,10 +153,10 @@ export struct DetailPlayShortVideoPage {
127 WDPlayerRenderView({ 153 WDPlayerRenderView({
128 playerController: this.playerController, 154 playerController: this.playerController,
129 onLoad: async () => { 155 onLoad: async () => {
130 - console.log('onload==', this.contentId, this.relId, this.relType)  
131 - // this.playVM.playWithContentId(this.contentId ?? "846899373")  
132 - this.playVM.playWithIds(this.contentId,  
133 - this.relId, this.relType) 156 + console.log('onload==',)
  157 + // if (this.index === 0) {
  158 + this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl);
  159 + // }
134 } 160 }
135 }) 161 })
136 .height('100%') 162 .height('100%')
@@ -177,49 +203,6 @@ export struct DetailPlayShortVideoPage { @@ -177,49 +203,6 @@ export struct DetailPlayShortVideoPage {
177 } 203 }
178 .height('100%') 204 .height('100%')
179 .width('100%') 205 .width('100%')
180 -  
181 .backgroundColor(Color.Black) 206 .backgroundColor(Color.Black)
182 } 207 }
183 -  
184 - // 续播判断  
185 - changeContinue() {  
186 - if (this.nextContId) {  
187 - this.playerController.continue = () => {  
188 - this.playerController?.stop();  
189 - this.playVM.playWithContentId(this.nextContId ?? '');  
190 - }  
191 - return;  
192 - }  
193 - this.playerController.continue = undefined;  
194 - }  
195 -  
196 - urlChanged() {  
197 - if (this.url) {  
198 - console.log("url:" + this.url);  
199 - this.status = PlayerConstants.STATUS_START;  
200 - this.playerController.firstPlay(this.url);  
201 - }  
202 - }  
203 -  
204 - getPlayHistory() {  
205 - SPHelper.default.get('playHistory', '').then((str) => {  
206 - let result = str.toString();  
207 - let time = 0;  
208 - if (result != null && result != "") {  
209 - let playHistory: Record<string, Record<string, number>> = JSON.parse(result);  
210 - let userData: Record<string, number> = {};  
211 - if (this.userId) {  
212 - userData = playHistory[this.userId] ?? {};  
213 - }  
214 - if (this.curContId) {  
215 - time = userData?.[this.curContId] ?? 0;  
216 - }  
217 - }  
218 - this.playerController?.setStartTime(time);  
219 - }).catch((err: Error) => {  
220 - // Error: Inner error. Error code 15500000  
221 - Logger.error(TAG, 'catch err:' + JSON.stringify(err));  
222 - this.playerController?.setStartTime(0);  
223 - });  
224 - }  
225 } 208 }
  1 +// import router from '@ohos.router';
  2 +import mediaquery from '@ohos.mediaquery';
  3 +import window from '@ohos.window';
  4 +import { ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean';
  5 +import { Logger, SPHelper, WindowModel } from 'wdKit';
  6 +import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
  7 +import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi';
  8 +import { PlayControlViewContainer } from '../view/PlayControlViewContainer';
  9 +import { PlayerDetailContainer } from '../view/PlayerDetailContainer';
  10 +// import { PlayViewModel } from '../viewmodel/PlayViewModel';
  11 +import { DetailContainer } from '../view/DetailContainer';
  12 +import {
  13 + batchLikeAndCollectParams,
  14 + batchLikeAndCollectResult,
  15 + postBatchAttentionStatusParams
  16 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
  17 +import { HttpUrlUtils } from 'wdNetwork/Index';
  18 +
  19 +const TAG = 'DetailPlayShortVideoPage';
  20 +
  21 +/**
  22 + * 详情&短视频播放页面
  23 + */
  24 +
  25 +@Component
  26 +export struct DetailPlayShortVideoPage {
  27 + // private contentId?: string = undefined
  28 + // private relId?: string = undefined
  29 + // private relType?: string = undefined
  30 + @Provide contentDetailData: ContentDetailDTO | undefined = undefined
  31 + @Provide interactData: InteractDataDTO | undefined = undefined
  32 + @Prop @Watch('currentIndexChange') currentIndex: number = 0
  33 + private index: number = 0
  34 + private playerController: WDPlayerController = new WDPlayerController();
  35 + // @Watch("urlChanged") @State url?: string = undefined
  36 + // @Watch('changeContinue') @Provide nextContId?: string = '';
  37 + // @Watch('getPlayHistory') @Provide curContId?: string = undefined;
  38 + // @Watch("playVMChanged") @Provide playVM: PlayViewModel = new PlayViewModel();
  39 + @Provide isFullScreen: boolean = false;
  40 + // @Provide canStart?: boolean = false;
  41 + // @Provide status: number = PlayerConstants.STATUS_START;
  42 + // @Provide userId: string = '';
  43 + // @Provide newsSourceName?: string = ''
  44 + // @Provide newsTitle?: string = ''
  45 + // @Provide editorName?: string = ''
  46 + // @Provide rmhInfo?: RmhInfoDTO | null = null
  47 + // @Provide userInfo?: UserInfoDTO | null = null
  48 + // @Provide message?: string = ''
  49 + // @Provide newsSummary?: string = ''
  50 + @Provide progressVal: number = 0;
  51 + @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
  52 + @Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
  53 + @Provide followStatus: string = '0' // 关注状态
  54 +
  55 + // playVMChanged() {
  56 + // this.url = this.playVM.url
  57 + // this.newsSourceName = this.playVM.newsSourceName
  58 + // this.newsTitle = this.playVM.newsTitle
  59 + // this.editorName = this.playVM.editorName
  60 + // this.newsSummary = this.playVM.newsSummary
  61 + // this.videoLandScape = this.playVM.videoLandScape ?? 1
  62 + // this.curContId = this.playVM.contentId
  63 + // this.nextContId = this.playVM.nextContId
  64 + // this.canStart = this.playVM.canStart;
  65 + // this.message = this.playVM.message
  66 + // this.rmhInfo = this.playVM.rmhInfo
  67 + // this.userInfo = this.playVM.userInfo
  68 + // console.error('rmhInfo', this.rmhInfo)
  69 + // console.error('userInfo', this.userInfo)
  70 + // }
  71 +
  72 + currentIndexChange() {
  73 + if (this.currentIndex != this.index) {
  74 + this.playerController.pause()
  75 +
  76 + if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) {
  77 + this.playerController.release()
  78 + }
  79 +
  80 + } else {
  81 + console.log('currentIndexChange====1', this.currentIndex)
  82 + this.playerController.play()
  83 + this.queryNewsInfoOfUser()
  84 +
  85 + }
  86 + }
  87 +
  88 + /**
  89 + * 查询用户点赞、收藏、关注等状态
  90 + */
  91 + queryNewsInfoOfUser() {
  92 + if (HttpUrlUtils.getUserId()) {
  93 + const params: batchLikeAndCollectParams = {
  94 + contentList: [
  95 + {
  96 + contentId: this.contentDetailData?.newsId + '',
  97 + contentType: this.contentDetailData?.newsType + '',
  98 + }
  99 + ]
  100 + }
  101 + // 已登录->查询用户对作品点赞、收藏状态
  102 + ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
  103 + console.log('查询点赞、收藏状态==', JSON.stringify(res.data))
  104 + if (res.data) {
  105 + this.newsStatusOfUser = res.data[0]
  106 + }
  107 + })
  108 +
  109 + const params1: postBatchAttentionStatusParams = {
  110 + creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
  111 + }
  112 + // 已登录->批量查作品是否被号主关注
  113 + ContentDetailRequest.postBatchAttentionStatus(params1).then(res => {
  114 + console.log('批量查号主是否为用户关注==', JSON.stringify(res.data))
  115 + if (res.data) {
  116 + this.followStatus = res.data[0]?.status
  117 + }
  118 + })
  119 + }
  120 + }
  121 +
  122 + aboutToAppear() {
  123 + console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
  124 +
  125 + // this.playVM.setContentDetailData(this.contentDetailData)
  126 +
  127 + // this.playVMChanged()
  128 + this.queryNewsInfoOfUser()
  129 + this.playerController.onCanplay = () => {
  130 + if (this.index == 0 || this.currentIndex === this.index) {
  131 + this.videoLandScape = this.contentDetailData?.videoInfo[0]?.videoLandScape
  132 + this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl);
  133 + this.playerController.play()
  134 + }
  135 + }
  136 +
  137 + // 设置播放地址
  138 + // this.url = 'https://media.w3.org/2010/05/sintel/trailer.mp4'
  139 + let listener = mediaquery.matchMediaSync('(orientation: landscape)');
  140 + listener.on("change", (mediaQueryResult) => {
  141 + if (mediaQueryResult.matches) {
  142 + console.log("横屏 yes")
  143 + this.isFullScreen = true
  144 + } else {
  145 + this.isFullScreen = false
  146 + console.log("横屏 no")
  147 + }
  148 + // WindowModel.shared.setMainWindowFullScreen(this.isFullScreen)
  149 + })
  150 +
  151 + }
  152 +
  153 + onPageShow() {
  154 + // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
  155 + }
  156 +
  157 + aboutToDisappear(): void {
  158 + this.playerController?.pause();
  159 + }
  160 +
  161 + onPageHide() {
  162 + // WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
  163 + devicePLSensorManager.devicePLSensorOff();
  164 + // this.status = PlayerConstants.STATUS_PAUSE;
  165 + this.playerController?.pause();
  166 + }
  167 +
  168 + @Builder
  169 + playerViewContainerBuilder() {
  170 + // 播放窗口
  171 + WDPlayerRenderView({
  172 + playerController: this.playerController,
  173 + onLoad: async () => {
  174 + console.log('onload==', this.contentId, this.relId, this.relType)
  175 +
  176 + }
  177 + })
  178 + .height('100%')
  179 + .width('100%')
  180 + .onClick(() => {
  181 + console.error('WDPlayerRenderView=== onClick')
  182 + this.playerController?.switchPlayOrPause();
  183 + })
  184 + }
  185 +
  186 + @Builder
  187 + playControlViewContainerBuilder() {
  188 + // 播放窗口控制bar
  189 + PlayControlViewContainer({
  190 + playerController: this.playerController
  191 + })
  192 + }
  193 +
  194 + @Builder
  195 + detailContainerBuilder() {
  196 + // DetailTabBarPageComponent({ pageId: this.pageId }).backgroundColor(Color.Black)
  197 + DetailContainer({
  198 + playerController: this.playerController
  199 + })
  200 + }
  201 +
  202 + build() {
  203 + Row() {
  204 + PlayerDetailContainer({
  205 + playerView: () => {
  206 + this.playerViewContainerBuilder()
  207 + }, playControlView: () => {
  208 + // this.playControlViewContainerBuilder()
  209 + }, detailView: () => {
  210 + this.detailContainerBuilder()
  211 + }
  212 + })
  213 + .height('100%')
  214 + .width('100%')
  215 + .onClick(() => {
  216 + console.error('PlayerDetailContainer=== onClick')
  217 + this.playerController?.switchPlayOrPause();
  218 + })
  219 + }
  220 + .height('100%')
  221 + .width('100%')
  222 +
  223 + .backgroundColor(Color.Black)
  224 + }
  225 +
  226 + // 续播判断
  227 + // changeContinue() {
  228 + // if (this.nextContId) {
  229 + // this.playerController.continue = () => {
  230 + // this.playerController?.stop();
  231 + // // this.playVM.playWithContentId(this.nextContId ?? '');
  232 + // }
  233 + // return;
  234 + // }
  235 + // this.playerController.continue = undefined;
  236 + // }
  237 +
  238 + // urlChanged() {
  239 + // console.error('urlChanged===')
  240 + // if (this.url) {
  241 + // this.status = PlayerConstants.STATUS_START;
  242 + // this.playerController.firstPlay(this.url);
  243 + // }
  244 + // }
  245 +
  246 + // getPlayHistory() {
  247 + // SPHelper.default.get('playHistory', '').then((str) => {
  248 + // let result = str.toString();
  249 + // let time = 0;
  250 + // if (result != null && result != "") {
  251 + // let playHistory: Record<string, Record<string, number>> = JSON.parse(result);
  252 + // let userData: Record<string, number> = {};
  253 + // if (this.userId) {
  254 + // userData = playHistory[this.userId] ?? {};
  255 + // }
  256 + // if (this.curContId) {
  257 + // time = userData?.[this.curContId] ?? 0;
  258 + // }
  259 + // }
  260 + // this.playerController?.setStartTime(time);
  261 + // }).catch((err: Error) => {
  262 + // // Error: Inner error. Error code 15500000
  263 + // Logger.error(TAG, 'catch err:' + JSON.stringify(err));
  264 + // this.playerController?.setStartTime(0);
  265 + // });
  266 + // }
  267 +}
@@ -21,7 +21,6 @@ export struct DetailVideoListPage { @@ -21,7 +21,6 @@ export struct DetailVideoListPage {
21 @State interactDataList: InteractDataDTO[] = [] 21 @State interactDataList: InteractDataDTO[] = []
22 22
23 async aboutToAppear(): Promise<void> { 23 async aboutToAppear(): Promise<void> {
24 - console.error('=================',)  
25 let data: ContentDetailDTO[] = [] 24 let data: ContentDetailDTO[] = []
26 let action: Action = router.getParams() as Action 25 let action: Action = router.getParams() as Action
27 if (action) { 26 if (action) {
@@ -37,29 +36,31 @@ export struct DetailVideoListPage { @@ -37,29 +36,31 @@ export struct DetailVideoListPage {
37 }).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => { 36 }).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => {
38 console.error('resDTO==', JSON.stringify(resDTO.data)) 37 console.error('resDTO==', JSON.stringify(resDTO.data))
39 if (resDTO.data) { 38 if (resDTO.data) {
40 - data.push(resDTO.data[0]) 39 + this.data.push(resDTO.data[0])
41 } 40 }
42 41
43 }) 42 })
44 } 43 }
45 44
46 - await ContentDetailRequest.postRecommendVideoList({  
47 - pageSize: 10,  
48 - refreshCnt: 1  
49 - }).then(res => {  
50 - if (res.data) {  
51 - data = data.concat(res.data)  
52 - }  
53 - console.log('res1===', JSON.stringify(res))  
54 - console.log('res==' + this.data)  
55 - }) 45 + await this.queryVideoList()
  46 +
  47 + // await ContentDetailRequest.postRecommendVideoList({
  48 + // pageSize: 5,
  49 + // refreshCnt: 1
  50 + // }).then(res => {
  51 + // if (res.data) {
  52 + // data = data.concat(res.data)
  53 + // }
  54 + // console.log('res1===', JSON.stringify(res))
  55 + // console.log('res==' + this.data)
  56 + // })
56 57
57 58
58 - if (data.length > 0) { 59 + if (this.data.length > 0) {
59 const params: contentListParams = { 60 const params: contentListParams = {
60 contentList: [] 61 contentList: []
61 } 62 }
62 - data.map(item => { 63 + this.data.map(item => {
63 params.contentList.push({ 64 params.contentList.push({
64 contentId: item.newsId + '', 65 contentId: item.newsId + '',
65 contentType: item.newsType 66 contentType: item.newsType
@@ -76,12 +77,27 @@ export struct DetailVideoListPage { @@ -76,12 +77,27 @@ export struct DetailVideoListPage {
76 77
77 } 78 }
78 79
79 - this.data = data 80 + // this.data = data
80 console.error('aboutToAppear===', this.data.length) 81 console.error('aboutToAppear===', this.data.length)
81 82
82 83
83 } 84 }
84 85
  86 + async queryVideoList() {
  87 + await ContentDetailRequest.postRecommendVideoList({
  88 + pageSize: 5,
  89 + refreshCnt: 1
  90 + }).then(res => {
  91 + if (res.data) {
  92 + this.data = this.data.concat(res.data)
  93 + }
  94 +
  95 +
  96 + console.log('queryVideoList===', JSON.stringify(this.data))
  97 + })
  98 +
  99 + }
  100 +
85 build() { 101 build() {
86 Column() { 102 Column() {
87 Swiper(this.swiperController) { 103 Swiper(this.swiperController) {
@@ -107,7 +123,7 @@ export struct DetailVideoListPage { @@ -107,7 +123,7 @@ export struct DetailVideoListPage {
107 // }, (item: string) => item) 123 // }, (item: string) => item)
108 124
109 } 125 }
110 - .cachedCount(0) 126 + .cachedCount(-1)
111 .indicator(false) 127 .indicator(false)
112 .vertical(true) 128 .vertical(true)
113 .loop(false) 129 .loop(false)
@@ -117,6 +133,10 @@ export struct DetailVideoListPage { @@ -117,6 +133,10 @@ export struct DetailVideoListPage {
117 .onChange((index: number) => { 133 .onChange((index: number) => {
118 this.currentIndex = index 134 this.currentIndex = index
119 console.info('onChange==', index.toString()) 135 console.info('onChange==', index.toString())
  136 +
  137 + if (this.currentIndex === this.data.length - 1) {
  138 + this.queryVideoList()
  139 + }
120 }) 140 })
121 141
122 }.width('100%').height('100%') 142 }.width('100%').height('100%')
1 -import { InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; 1 +import { ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
  2 +import {
  3 + batchLikeAndCollectParams,
  4 + batchLikeAndCollectResult,
  5 + ContentDetailRequest,
  6 + contentListParams,
  7 + postExecuteCollectRecordParams,
  8 + postExecuteLikeParams
  9 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
2 import { ToastUtils } from 'wdKit'; 10 import { ToastUtils } from 'wdKit';
  11 +import { HttpUrlUtils } from 'wdNetwork/Index';
  12 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
3 13
4 export interface OperationItem { 14 export interface OperationItem {
5 icon: Resource; 15 icon: Resource;
  16 + icon_check?: Resource;
6 17
7 // icon_selected: Resource; 18 // icon_selected: Resource;
8 text: string | Resource; 19 text: string | Resource;
@@ -16,17 +27,19 @@ const TAG = 'OperationListView'; @@ -16,17 +27,19 @@ const TAG = 'OperationListView';
16 @Preview 27 @Preview
17 @Component 28 @Component
18 export struct OperationListView { 29 export struct OperationListView {
19 - @Consume rmhInfo?: RmhInfoDTO  
20 - @Consume userInfo?: UserInfoDTO  
21 @Consume interactData: InteractDataDTO 30 @Consume interactData: InteractDataDTO
  31 + @Consume contentDetailData: ContentDetailDTO
  32 + @Consume newsStatusOfUser: batchLikeAndCollectResult
22 @State operationList: OperationItem[] = [ 33 @State operationList: OperationItem[] = [
23 { 34 {
24 icon: $r('app.media.ic_like_uncheck'), 35 icon: $r('app.media.ic_like_uncheck'),
  36 + icon_check: $r('app.media.ic_like_check'),
25 text: "赞", 37 text: "赞",
26 // num: 6622 38 // num: 6622
27 }, 39 },
28 { 40 {
29 icon: $r('app.media.ic_collect_uncheck'), 41 icon: $r('app.media.ic_collect_uncheck'),
  42 + icon_check: $r('app.media.ic_collect_check'),
30 text: "收藏", 43 text: "收藏",
31 // num: 662, 44 // num: 662,
32 }, 45 },
@@ -44,26 +57,78 @@ export struct OperationListView { @@ -44,26 +57,78 @@ export struct OperationListView {
44 aboutToAppear() { 57 aboutToAppear() {
45 } 58 }
46 59
  60 + /**
  61 + * 点赞、取消点赞
  62 + */
  63 + toggleLikeStatus() {
  64 + // 未登录,跳转登录
  65 + if (!HttpUrlUtils.getUserId()) {
  66 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  67 + return
  68 + }
  69 + const params: postExecuteLikeParams = {
  70 + status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
  71 + contentId: this.contentDetailData?.newsId + '',
  72 + contentType: this.contentDetailData?.newsType + '',
  73 + }
  74 + ContentDetailRequest.postExecuteLike(params).then(res => {
  75 + console.log('toggleLikeStatus==',)
  76 + if (this.newsStatusOfUser) {
  77 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
  78 + this.queryContentInteractCount()
  79 + }
  80 +
  81 + })
  82 + }
  83 +
  84 + /**
  85 + * 收藏、取消收藏
  86 + */
  87 + toggleCollectStatus() {
  88 + // 未登录,跳转登录
  89 + if (!HttpUrlUtils.getUserId()) {
  90 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  91 + return
  92 + }
  93 + const params: postExecuteCollectRecordParams = {
  94 + status: this.newsStatusOfUser?.collectStatus === 1 ? '0' : '1',
  95 + contentList: [{
  96 + contentId: this.contentDetailData?.newsId + '',
  97 + contentType: this.contentDetailData?.newsType + '',
  98 + }],
  99 +
  100 + }
  101 + ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
  102 + console.log('toggleLikeStatus==',)
  103 + if (this.newsStatusOfUser) {
  104 + this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
  105 + this.queryContentInteractCount()
  106 + }
  107 + })
  108 +
  109 + }
  110 +
  111 + /**
  112 + * 查询点赞、收藏数量
  113 + */
  114 + queryContentInteractCount() {
  115 + const params: contentListParams = {
  116 + contentList: [{
  117 + contentId: this.contentDetailData?.newsId + '',
  118 + contentType: this.contentDetailData?.newsType,
  119 + }]
  120 + }
  121 + ContentDetailRequest.getContentInteract(params).then(res => {
  122 + if (res.data && this.interactData) {
  123 + this.interactData.likeNum = res.data[0]?.likeNum
  124 + this.interactData.collectNum = res.data[0]?.collectNum
  125 + this.interactData.commentNum = res.data[0]?.commentNum
  126 + }
  127 + console.log('获取互动点赞等数据===', JSON.stringify(res))
  128 + })
  129 + }
  130 +
47 build() { 131 build() {
48 - // List({ space: 0, initialIndex: 0 }) {  
49 - // ForEach(this.operationList, (item: OperationItem, index: number) => {  
50 - // ListItem() {  
51 - // this.buildOperationItem(item, index)  
52 - // }  
53 - // }, (item: OperationItem, index: number) => JSON.stringify(item))  
54 - // }  
55 - // .width(48)  
56 - // .height(250)  
57 - // // .margin({ bottom: 100 })  
58 - // .backgroundColor(Color.Red)  
59 - // // .listDirection(Axis.Vertical) // 默认值:Axis.Vertical  
60 - // // .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1  
61 - // .cachedCount(2)  
62 - // .scrollBar(BarState.Off)  
63 - // .nestedScroll({  
64 - // scrollForward: NestedScrollMode.PARENT_FIRST,  
65 - // scrollBackward: NestedScrollMode.SELF_FIRST  
66 - // })  
67 132
68 Column() { 133 Column() {
69 this.buildUserComp() 134 this.buildUserComp()
@@ -74,32 +139,34 @@ export struct OperationListView { @@ -74,32 +139,34 @@ export struct OperationListView {
74 .width(48) 139 .width(48)
75 } 140 }
76 141
  142 + getImgUrl() {
  143 + return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl
  144 + }
  145 +
77 @Builder 146 @Builder
78 buildUserComp() { 147 buildUserComp() {
79 Column() { 148 Column() {
80 - Image(this.rmhInfo?.rmhHeadUrl || this.userInfo?.userHeadUrl)  
81 - .width('100%')  
82 - .borderRadius(24)  
83 - .aspectRatio(1)  
84 - .border({ width: 1, color: Color.White, style: BorderStyle.Solid })  
85 - .margin({ bottom: 30 })  
86 - }.width(48) 149 + if (this.getImgUrl()) {
  150 + Image(this.getImgUrl())
  151 + .width('100%')
  152 + .borderRadius(24)
  153 + .aspectRatio(1)
  154 + .border({ width: 1, color: Color.White, style: BorderStyle.Solid })
  155 + }
  156 + }.margin({ bottom: 30 })
87 } 157 }
88 158
89 - /**  
90 - * 组件项  
91 - *  
92 - * @param programmeBean item 组件项  
93 - */  
94 @Builder 159 @Builder
95 buildOperationItem(item: OperationItem, index: number) { 160 buildOperationItem(item: OperationItem, index: number) {
96 Column() { 161 Column() {
97 - Image(item.icon)  
98 - .width(32)  
99 - .aspectRatio(1)  
100 - // .borderRadius(6)  
101 if (item.text === '赞') { 162 if (item.text === '赞') {
102 - Text(this.interactData.likeNum ? (this.interactData.likeNum + '') : item.text) 163 + Image(this.newsStatusOfUser?.likeStatus == '0' ? item.icon : item.icon_check)
  164 + .width(32)
  165 + .aspectRatio(1)
  166 + .onClick(() => {
  167 + this.toggleLikeStatus()
  168 + })
  169 + Text(this.interactData?.likeNum ? (this.interactData.likeNum + '') : item.text)
103 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown) 170 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
104 .fontWeight(500) 171 .fontWeight(500)
105 .textAlign(TextAlign.Center) 172 .textAlign(TextAlign.Center)
@@ -108,7 +175,13 @@ export struct OperationListView { @@ -108,7 +175,13 @@ export struct OperationListView {
108 .maxLines(1) 175 .maxLines(1)
109 .textOverflow({ overflow: TextOverflow.Ellipsis }) 176 .textOverflow({ overflow: TextOverflow.Ellipsis })
110 } else if (item.text === '收藏') { 177 } else if (item.text === '收藏') {
111 - Text(this.interactData.collectNum ? (this.interactData.collectNum + '') : item.text) 178 + Image(this.newsStatusOfUser?.collectStatus == 0 ? item.icon : item.icon_check)
  179 + .width(32)
  180 + .aspectRatio(1)
  181 + .onClick(() => {
  182 + this.toggleCollectStatus()
  183 + })
  184 + Text(this.interactData?.collectNum ? (this.interactData.collectNum + '') : item.text)
112 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown) 185 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
113 .fontWeight(500) 186 .fontWeight(500)
114 .textAlign(TextAlign.Center) 187 .textAlign(TextAlign.Center)
@@ -117,7 +190,10 @@ export struct OperationListView { @@ -117,7 +190,10 @@ export struct OperationListView {
117 .maxLines(1) 190 .maxLines(1)
118 .textOverflow({ overflow: TextOverflow.Ellipsis }) 191 .textOverflow({ overflow: TextOverflow.Ellipsis })
119 } else if (item.text === '抢首评') { 192 } else if (item.text === '抢首评') {
120 - Text(this.interactData.commentNum ? (this.interactData.commentNum + '') : item.text) 193 + Image(item.icon)
  194 + .width(32)
  195 + .aspectRatio(1)
  196 + Text(this.interactData?.commentNum ? (this.interactData.commentNum + '') : item.text)
121 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown) 197 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
122 .fontWeight(500) 198 .fontWeight(500)
123 .textAlign(TextAlign.Center) 199 .textAlign(TextAlign.Center)
@@ -126,6 +202,9 @@ export struct OperationListView { @@ -126,6 +202,9 @@ export struct OperationListView {
126 .maxLines(1) 202 .maxLines(1)
127 .textOverflow({ overflow: TextOverflow.Ellipsis }) 203 .textOverflow({ overflow: TextOverflow.Ellipsis })
128 } else { 204 } else {
  205 + Image(item.icon)
  206 + .width(32)
  207 + .aspectRatio(1)
129 Text(item.text) 208 Text(item.text)
130 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown) 209 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
131 .fontWeight(500) 210 .fontWeight(500)
@@ -142,9 +221,10 @@ export struct OperationListView { @@ -142,9 +221,10 @@ export struct OperationListView {
142 // .backgroundColor(Color.Black) 221 // .backgroundColor(Color.Black)
143 .alignItems(HorizontalAlign.Center) 222 .alignItems(HorizontalAlign.Center)
144 .hoverEffect(HoverEffect.Scale) 223 .hoverEffect(HoverEffect.Scale)
145 - .onClick((event: ClickEvent) => {  
146 - console.info(TAG, `buildOperationItem onClick event index: ${index}`);  
147 - // ToastUtils.showToast('体验版,本功能暂未开发', 1000);  
148 - }) 224 +
  225 + // .onClick((event: ClickEvent) => {
  226 + // console.info(TAG, `buildOperationItem onClick event index: ${index}`);
  227 + // // ToastUtils.showToast('体验版,本功能暂未开发', 1000);
  228 + // })
149 } 229 }
150 } 230 }
@@ -5,18 +5,15 @@ import { WindowModel } from 'wdKit'; @@ -5,18 +5,15 @@ import { WindowModel } from 'wdKit';
5 import { WDPlayerController } from 'wdPlayer'; 5 import { WDPlayerController } from 'wdPlayer';
6 import { devicePLSensorManager } from 'wdDetailPlayApi'; 6 import { devicePLSensorManager } from 'wdDetailPlayApi';
7 import { OperationListView } from './OperationListView'; 7 import { OperationListView } from './OperationListView';
8 -import { RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; 8 +import { ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
9 9
10 @Component 10 @Component
11 export struct PlayerTitleComment { 11 export struct PlayerTitleComment {
12 private playerController?: WDPlayerController; 12 private playerController?: WDPlayerController;
13 - @Consume newsSourceName?: string  
14 - @Consume newsTitle?: string  
15 - @Consume editorName?: string  
16 - @Consume newsSummary?: string;  
17 @State @Watch('watchSpeed') playSpeed: number = 1; 13 @State @Watch('watchSpeed') playSpeed: number = 1;
18 - @Consume isFullScreen: boolean;  
19 @State comment: string = ''; 14 @State comment: string = '';
  15 + @Consume contentDetailData: ContentDetailDTO | undefined
  16 + @Consume isFullScreen: boolean;
20 @Consume progressVal: number; 17 @Consume progressVal: number;
21 @Consume videoLandScape?: number 18 @Consume videoLandScape?: number
22 19
@@ -27,6 +24,14 @@ export struct PlayerTitleComment { @@ -27,6 +24,14 @@ export struct PlayerTitleComment {
27 this.playerController?.setSpeed(this.playSpeed); 24 this.playerController?.setSpeed(this.playSpeed);
28 } 25 }
29 26
  27 + getName() {
  28 + return this.contentDetailData?.newsSourceName || this.contentDetailData?.editorName
  29 + }
  30 +
  31 + getTitle() {
  32 + return this.contentDetailData?.newsTitle || this.contentDetailData?.newsSummary
  33 + }
  34 +
30 build() { 35 build() {
31 Column() { 36 Column() {
32 // Column() { 37 // Column() {
@@ -59,15 +64,15 @@ export struct PlayerTitleComment { @@ -59,15 +64,15 @@ export struct PlayerTitleComment {
59 64
60 Row() { 65 Row() {
61 Column() { 66 Column() {
62 - if (this.newsSourceName || this.editorName) {  
63 - Text("@" + (this.newsSourceName || this.editorName)) 67 + if (this.getName()) {
  68 + Text("@" + this.getName())
64 .fontColor(Color.White) 69 .fontColor(Color.White)
65 .fontSize(15) 70 .fontSize(15)
66 .maxLines(1) 71 .maxLines(1)
67 .textOverflow({ overflow: TextOverflow.Ellipsis }) 72 .textOverflow({ overflow: TextOverflow.Ellipsis })
68 } 73 }
69 - if (this.newsTitle || this.newsSummary) {  
70 - Text(this.newsTitle || this.newsSummary) 74 + if (this.getTitle()) {
  75 + Text(this.getTitle())
71 .fontColor(Color.White) 76 .fontColor(Color.White)
72 .fontSize(15) 77 .fontSize(15)
73 .maxLines(3) 78 .maxLines(3)
@@ -134,7 +139,6 @@ export struct PlayerTitleComment { @@ -134,7 +139,6 @@ export struct PlayerTitleComment {
134 }) 139 })
135 140
136 TextInput({ placeholder: '说两句...', text: this.comment }) 141 TextInput({ placeholder: '说两句...', text: this.comment })
137 -  
138 .placeholderColor(Color.White) 142 .placeholderColor(Color.White)
139 .placeholderFont({ size: 14 }) 143 .placeholderFont({ size: 14 })
140 .fontColor(Color.White) 144 .fontColor(Color.White)
@@ -20,6 +20,7 @@ export class WDPlayerController { @@ -20,6 +20,7 @@ export class WDPlayerController {
20 public onTimeUpdate?: (position: number, duration: number) => void; 20 public onTimeUpdate?: (position: number, duration: number) => void;
21 public onVolumeUpdate?: (volume: number) => void; 21 public onVolumeUpdate?: (volume: number) => void;
22 public continue?: () => void; 22 public continue?: () => void;
  23 + public onCanplay?: () => void;
23 24
24 constructor() { 25 constructor() {
25 Logger.error("初始化") 26 Logger.error("初始化")
@@ -74,6 +75,9 @@ export class WDPlayerController { @@ -74,6 +75,9 @@ export class WDPlayerController {
74 } 75 }
75 // this.avPlayer.play(); 76 // this.avPlayer.play();
76 this.duration = this.avPlayer.duration; 77 this.duration = this.avPlayer.duration;
  78 + if (this.onCanplay) {
  79 + this.onCanplay()
  80 + }
77 break; 81 break;
78 case AVPlayerStatus.PLAYING: 82 case AVPlayerStatus.PLAYING:
79 this.setBright(); 83 this.setBright();
@@ -143,13 +147,15 @@ export class WDPlayerController { @@ -143,13 +147,15 @@ export class WDPlayerController {
143 } 147 }
144 148
145 async release() { 149 async release() {
146 - if (this.avPlayer == null) {  
147 - await this.initPromise;  
148 - } 150 + // if (this.avPlayer == null) {
  151 + // await this.initPromise;
  152 + // }
149 if (this.avPlayer == null) { 153 if (this.avPlayer == null) {
150 return 154 return
151 } 155 }
152 - this.avPlayer.release(); 156 + this.avPlayer.release()
  157 + this.avPlayer = undefined
  158 +
153 } 159 }
154 160
155 async pause() { 161 async pause() {
@@ -171,7 +177,7 @@ export class WDPlayerController { @@ -171,7 +177,7 @@ export class WDPlayerController {
171 } 177 }
172 this.avPlayer.play(); 178 this.avPlayer.play();
173 } 179 }
174 - 180 +
175 async stop() { 181 async stop() {
176 if (this.avPlayer == null) { 182 if (this.avPlayer == null) {
177 await this.initPromise; 183 await this.initPromise;
@@ -250,6 +256,10 @@ export class WDPlayerController { @@ -250,6 +256,10 @@ export class WDPlayerController {
250 return this.status; 256 return this.status;
251 } 257 }
252 258
  259 + getPlayer() {
  260 + return this.avPlayer;
  261 + }
  262 +
253 initProgress(time: number) { 263 initProgress(time: number) {
254 let nowSeconds = Math.floor(time / 1000); 264 let nowSeconds = Math.floor(time / 1000);
255 let totalSeconds = Math.floor(this.duration / 1000); 265 let totalSeconds = Math.floor(this.duration / 1000);
@@ -74,7 +74,7 @@ export struct WDPlayerRenderView { @@ -74,7 +74,7 @@ export struct WDPlayerRenderView {
74 Row() { 74 Row() {
75 // 设置为“surface“类型时XComponent组件可以和其他组件一起进行布局和渲染。 75 // 设置为“surface“类型时XComponent组件可以和其他组件一起进行布局和渲染。
76 XComponent({ 76 XComponent({
77 - id: 'xComponentId112233', 77 + id: 'xComponentId',
78 type: 'surface', 78 type: 'surface',
79 controller: this.xComponentController 79 controller: this.xComponentController
80 }) 80 })
@@ -31,5 +31,6 @@ struct AudioDetail { @@ -31,5 +31,6 @@ struct AudioDetail {
31 this.contentId = params?.contentID || ''; 31 this.contentId = params?.contentID || '';
32 Logger.info(TAG, 'aboutToAppear'); 32 Logger.info(TAG, 'aboutToAppear');
33 Logger.info(TAG, 'params', JSON.stringify(params)); 33 Logger.info(TAG, 'params', JSON.stringify(params));
  34 + console.log('参数',JSON.stringify(par))
34 } 35 }
35 } 36 }