31 lines
1014 B
JavaScript
31 lines
1014 B
JavaScript
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
|
||
}
|
||
}) |