Basically you build your weapon from components:
A masterwork weapon
1 or more rune plates
Conduits
Spell Triggers
Socket
The rune plates are essencially enchantments, note that you dont need a +1 before you add Shocking or the like.
Conduits connect everything and are basically just a flat cost depending on the total enhancement bonus of the item. There is a second kind of conduit for linking two low powered (+1 for example) plates together instead of using a higher powered one (+2 in this case) these are not that expensive.
Spell triggers allow you to use your weapon as a kind of wand, they are expensive but you can do interesting things with them.
The socket is where you plug your power source into it, there are two types to be concerned with for weapons, trickle and hybrid. Trickle is for always on type enchantments and hybrid is for burst magic like wand type spells.
For example a +2 Shocking Greatsword that can cast Lightning bolt.
Masterwork Greatsword (315gp)
Plates:
+1 Plate (1200 gp)
+1 Plate (1200 gp)
Shocking Plate (1200 gp)
Lightning Bolt Plate (8250 gp)
Offensive Spell Trigger (3000 gp)
Conduits:
+3 Weapon Conduit (7020 gp)
Series Conduit (200 gp)
Socket:
Hybrid Socket (450 gp)
Now that you have decided what you are making you have to draft the schematics for it, this is a Craft (Mechanika) check with a DC of 15+1/component. The above design has 8 components so the schematics require a DC 23 check. It costs 1/20th of the items total cost +1xp per component to draft the schematics for this weapon that is 1142gp and 9xp as the weapon costs 22,835gp and has 9 components.
Finally you fuse everything together, this costs 1/25 of the conduit cost in xp and takes 1 day for every 1000gp. In this case 280 xp and 7 days.
Total cost: 25,422gp
Comparatively a +2 Shocking Greatsword costs 27,000 gp (and has a 20% chance of permanently eating 6hp from its creator and is thus massively rare)
In sum: the mechanika weapon is 1500gp cheaper and shoots lightning (it would be a lot cheaper if it didn't)
You then need some sort of power source, the weapon eats 3 charges a day plus 1 charge each time you use Lightning Bolt.