docs: link fixes, add cables

This commit is contained in:
Prohurtz 2024-03-19 18:06:03 -07:00
parent 750a0fe81c
commit 29c290ab4d
2 changed files with 70 additions and 11 deletions

View File

@ -15,7 +15,7 @@
<tr v-for="component in components" :key="component.name"> <tr v-for="component in components" :key="component.name">
<th>{{ component.name }}</th> <th>{{ component.name }}</th>
<td> <td>
<select v-if="component.choices.length > 1" v-model="component.selectedChoice" @change="updatePrices"> <select v-if="component.choices.length > 1" v-model="component.selectedChoice" @change="switchSelect($event, component)">
<option v-for="(choice, index) in component.choices" :key="index" :value="index">{{ choice.name }}</option> <option v-for="(choice, index) in component.choices" :key="index" :value="index">{{ choice.name }}</option>
</select> </select>
<span v-else>{{ component.choices[0].name }}</span> <span v-else>{{ component.choices[0].name }}</span>
@ -109,8 +109,8 @@ export default {
name: 'Bring Your Own', name: 'Bring Your Own',
amount: () => this.tracker, amount: () => this.tracker,
cost: 0, cost: 0,
costAll: () => this.tracker * 0 , costAll: () => this.tracker * 0,
links: 'If you already have safe IR LED hardware and know what you are doing.' links: '<a href="https://docs.eyetrackvr.dev/getting_started/led_safety">IR LED Safety<a/> If you already have safe IR LED hardware and know what you are doing.'
}, },
{ {
name: 'Official V4 mini Solder-less Kit', name: 'Official V4 mini Solder-less Kit',
@ -124,17 +124,17 @@ export default {
amount: () => 1, amount: () => 1,
cost: 24, cost: 24,
costAll: () => this.tracker + 24 + 3, costAll: () => this.tracker + 24 + 3,
links: '<a href="https://store.eyetrackvr.dev/products/v4-mini-some-assemblly-required">AliExpress</a> Must solder up your own wires' links: '<a href="https://store.eyetrackvr.dev/products/v4-mini-some-assemblly-required">ETVR Store</a> Must solder up your own wires'
}, },
{ {
name: 'Official V4 lite Assemble Yourself', name: 'Official V4 lite Assemble Yourself',
amount: () => 1, amount: () => 1,
cost: 7, cost: 7,
costAll: () => this.tracker + 7 + 3, costAll: () => this.tracker + 7 + 3,
links: '<a href="https://store.eyetrackvr.dev/products/v4-1-lite-diy-led-kit">AliExpress</a> Must assemble yourself' links: '<a href="https://store.eyetrackvr.dev/products/v4-1-lite-diy-led-kit">ETVR Store</a> Must assemble yourself'
}, },
], ],
selectedChoice: 1 selectedChoice: 2
}, },
{ {
name: 'USB Hub', name: 'USB Hub',
@ -168,7 +168,7 @@ export default {
links: '<a href="https://www.aliexpress.us/item/3256801220206638.html">AliExpress</a> Small but non MTT hub breakout' links: '<a href="https://www.aliexpress.us/item/3256801220206638.html">AliExpress</a> Small but non MTT hub breakout'
}, },
{ {
name: '3 port USB 3.0 Hub With Power Passthrough (Not MTT)', name: '3 port USB 3.0 Hub With Power Passthrough (MTT)',
amount: () => 1, amount: () => 1,
cost: 17.99, cost: 17.99,
costAll: () => this.tracker + 1.41, costAll: () => this.tracker + 1.41,
@ -210,18 +210,24 @@ export default {
this.components.forEach(component => { this.components.forEach(component => {
if (component.choices.length > 1) { if (component.choices.length > 1) {
const choice = component.choices[component.selectedChoice]; const choice = component.choices[component.selectedChoice];
total += choice.costAll(); total += choice.costAll(this.tracker);
} }
}); });
this.total = total; this.total = total;
}, },
switchSelect(event, component) {
// Use Vue's $set method to ensure reactivity
this.$set(component, 'selectedChoice', event.target.value);
this.updatePrices();
}
}, },
mounted() { mounted() {
this.updatePrices(); this.updatePrices();
}, },
}; };
</script> </script>
<style scoped> <style scoped>
/* Your styles here */ /* Your styles here */
</style> </style>

View File

@ -242,7 +242,60 @@ export default {
], ],
selectedChoice: 0 selectedChoice: 0
}, },
{
name: 'USB-C Cables',
choices: [
{
name: 'Bring Your Own',
amount: () => this.tracker,
cost: 0,
costAll: () => this.tracker * 0,
links: 'If you do not need or already have.'
},
{
name: 'Short USB-C to USB-C Amazon',
amount: () => 1,
cost: 6.29,
costAll: () => this.tracker + 5.29,
links: '<a href="https://www.amazon.com/gp/product/B09C2D9Z7T/ref=ox_sc_act_title_2?smid=A10X1BEP2GKRDQ&th=1">Amazon</a>'
},
{
name: 'Short USB-A to USB-C Amazon',
amount: () => 1,
cost: 7.99,
costAll: () => this.tracker + 5.99,
links: '<a href="https://www.amazon.com/Charging-Durable-Station-Compatible-Samsung/dp/B08LL1SVZD/">Amazon</a>'
},
],
selectedChoice: 0
},
{
name: 'V4 LED Wire Extensions/Replacements',
choices: [
{
name: 'Bring Your Own',
amount: () => this.tracker,
cost: 0,
costAll: () => this.tracker * 0,
links: 'If you do not need or already have.'
},
{
name: '110mm Extension/Replacement',
amount: () => 1,
cost: 1.50,
costAll: () => this.tracker + 1.50 + 5,
links: '<a href="https://store.eyetrackvr.dev/products/2x-110mm-replacement-wires">ETVR Store</a>'
},
{
name: '200mm Extension/Replacement',
amount: () => 1,
cost: 1.50,
costAll: () => this.tracker + 1.50 + 5,
links: '<a href="https://store.eyetrackvr.dev/products/2x-200mm-replacement-wires">ETVR Store</a>'
},
],
selectedChoice: 0
},
// Add other components similarly // Add other components similarly
], ],
total: 0, total: 0,