TakeOutShop/store/counter.js
2025-03-11 20:43:27 +08:00

31 lines
1014 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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']);
const ButtonWidth = ref(uni.getMenuButtonBoundingClientRect().width);
const ButtonHeight = ref(uni.getMenuButtonBoundingClientRect().height)
//定义数据修改的方法(action)
const clickSType = (params)=>{
return apiService.post('/product/getPictureShareUrl',params)
}
//定义getters
// const doubleCount = computed(()=>count.value * 2)
//以对象的形式return供组件调用
return{
ButtonWidth,
ButtonHeight,
statusHeight,
headerHeight,
statusBartop,
clickSType
}
})