import { defineStore } from 'pinia'; import { computed,ref } from 'vue'; import { apiService } from "@/server/api.service"; export const useCounterStore = defineStore('counter',()=>{ //定义数据(state) const openId = ref(''); const cellPhone = ref(''); const isLogin = ref(''); const statusHeight = ref(uni.getMenuButtonBoundingClientRect()['height']); const headerHeight = ref(uni.getSystemInfoSync()['statusBarHeight']); const statusBartop = ref(uni.getMenuButtonBoundingClientRect()['top']); //定义数据修改的方法(action) const clickSType = (params)=>{ return apiService.post('/product/getPictureShareUrl',params) } //定义getters // const doubleCount = computed(()=>count.value * 2) //以对象的形式return供组件调用 return{ statusHeight, headerHeight, statusBartop, clickSType } })