feat: feat
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<script setup lang='ts'>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import useStore from '@/store'
|
||||
import { IPrizeConfig } from '@/types/storeType'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import localforage from 'localforage'
|
||||
import { IPrizeConfig } from '@/types/prizeConfig';
|
||||
|
||||
const imageDbStore = localforage.createInstance({
|
||||
name: 'imgStore'
|
||||
@@ -51,7 +51,7 @@ const getImageDbStore = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const sort = (item: any, isUp: number) => {
|
||||
const sort = (item: IPrizeConfig, isUp: number) => {
|
||||
const itemIndex = prizeList.value.indexOf(item)
|
||||
if (isUp == 1) {
|
||||
prizeList.value.splice(itemIndex, 1)
|
||||
@@ -70,7 +70,7 @@ const delAll = async () => {
|
||||
onMounted(() => {
|
||||
getImageDbStore()
|
||||
})
|
||||
watch(() => prizeList, (val:any) => {
|
||||
watch(() => prizeList.value, (val:IPrizeConfig[]) => {
|
||||
prizeConfig.setPrizeConfig(val)
|
||||
}, { deep: true })
|
||||
</script>
|
||||
@@ -136,18 +136,21 @@ watch(() => prizeList, (val:any) => {
|
||||
<span class="label-text">图片</span>
|
||||
</div>
|
||||
<select class="w-full max-w-xs select select-warning select-sm" v-model="item.picture">
|
||||
|
||||
|
||||
<option v-if="item.picture.id" :value="{id:'',name:'',url:''}"><span>❌</span></option>
|
||||
<option disabled selected>选择一张图片</option>
|
||||
<option v-for="picItem in localImageList" :key="picItem.id" :value="picItem">{{ picItem.name }}
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="w-full max-w-xs mb-10 form-control">
|
||||
<!-- <label class="w-full max-w-xs mb-10 form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">展示在主界面</span>
|
||||
</div>
|
||||
<input type="checkbox" :checked="item.isShow" @change="item.isShow = !item.isShow"
|
||||
class="mt-2 border-solid checkbox checkbox-secondary border-1" />
|
||||
</label>
|
||||
</label> -->
|
||||
<!-- <label class="w-full max-w-xs mb-10 form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">抽取次数</span>
|
||||
|
||||
Reference in New Issue
Block a user