Indicted for conspiracy and perjury in September, reelected with 58 percent of the vote in November, Mayor Roger Hedgecock today began the trial that will determine the immediate political future of the nation's eighth-largest city.

In his opening statement, a county prosecutor described the 38-year-old Republican as a cash-poor politician who used at least $370,000 in illegal contributions and thousands more in personal loans to win his 1983 campaign.

Hedgecock's attorney immediately countered that the contributions never went to Hedgecock's campaign and that the loans never illegally compromised his integrity.

Hedgecock, seemingly a rising star in California politics with his popular public-transportation and growth-management plans, was indicted Sept. 19 on charges of conspiracy to violate campaign-spending laws and perjury on campaign forms.

Assistant District Attorney Richard Huffman charged today that Hedgecock accepted unreported campaign staff and computer services from J. David Dominelli and Nancy Hoover, principals in a now-discredited investment firm, who funneled the money through a campaign consulting firm operated by former Hedgecock aide Thomas Shepard.

Dominelli, Hoover and Shepard also have been charged in the alleged conspiracy but were separated from this case when Hedgecock insisted on an early trial date.

Hedgecock's attorney, Michael Pancer, reminded the jury of seven men and five women that Hedgecock had raised $580,000 in legally reported contributions in the tight race to finish the unexpired term of Mayor Pete Wilson, who was elected to the U.S. Senate in 1982.

"He didn't need Thomas Shepard and Associates to funnel money into his campaign," said Pancer.

Hedgecock, he said, had no knowledge of the money Hoover and Dominelli were pumping into Shepard's firm.

Despite the controversy and subsequent indictment, San Diego voters and Hedgecock's most prominent political opponents appeared to take a wait-and-see posture when he ran for a full, four-year term this year. His opponent in the 1983 runoff election, Democrat Maureen O'Connor, passed up the race, and Hedgecock trounced a Republican former newscaster, Dick Carlson, who was making his first try for public office.

If convicted of any of the 12 perjury counts or one conspiracy count against him, Hedgecock would be removed from office immediately.

"I figured I'd vote for the mayor, and if the court found against him, I'd vote for someone else," said Ray Johnson, 60, a retired Navy chief gunnery officer.

Hedgecock seemed relaxed, joking with attorneys during recesses and telling reporters, "I'm very pleased that at last I'm going to have my side of the story told."

Huffman said he would present 45 witnesses in a trial expected to last until February. Superior Court Judge William L. Todd Jr. cut today's hearing short at 1:30 p.m., allowing Hedgecock to return to his office for a formal swearing-in ceremony. Future Monday sessions will be shortened to allow the mayor to conduct city business.

Huffman, who asked the jurors to convict Hedgecock for keeping his contributions "hidden from the voters," also charged that Hedgecock received unreported financial help from Hoover through the sale of a trust deed and a loan for improvements on his stately but rundown new home on a hill overlooking the city.

Failure to report this income, Pancer countered, was "a conceptual error, a good-faith mistake." He said the charges were politically motivated, since the district attorney, Edwin L. Miller, is a Democrat and an O'Connor backer.