2024-05-02 15:59:36 +08:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
import Vuex from 'vuex'
|
|
|
|
|
import actions from './actions.js'
|
|
|
|
|
Vue.use(Vuex)
|
|
|
|
|
export default new Vuex.Store({
|
2024-05-29 16:35:45 +08:00
|
|
|
// state: 存储基本数据
|
|
|
|
|
state: {
|
|
|
|
|
user: {
|
|
|
|
|
id: "",
|
2024-09-12 11:20:52 +08:00
|
|
|
head_pic: null,
|
2024-05-29 16:35:45 +08:00
|
|
|
nickname: "",
|
|
|
|
|
birthday: "",
|
|
|
|
|
gender: 0,
|
|
|
|
|
sex: 0,
|
2024-09-12 11:20:52 +08:00
|
|
|
age: 0,
|
2024-12-09 09:57:51 +08:00
|
|
|
stage: "",
|
2024-11-12 15:38:28 +08:00
|
|
|
height: "",
|
2024-09-12 11:20:52 +08:00
|
|
|
weight: "",
|
|
|
|
|
address: "",
|
2024-12-09 09:57:51 +08:00
|
|
|
head_data: 0,
|
2024-09-12 11:20:52 +08:00
|
|
|
card_order: [],
|
2024-05-29 16:35:45 +08:00
|
|
|
card_data_list: [],
|
2024-09-12 11:20:52 +08:00
|
|
|
target_current: {},
|
|
|
|
|
vitalcapacity_data: []
|
2024-05-29 16:35:45 +08:00
|
|
|
},
|
2024-06-13 18:03:50 +08:00
|
|
|
accountNumber: {
|
|
|
|
|
create_time: "",
|
|
|
|
|
head_pic: "",
|
|
|
|
|
last_update_time: "",
|
|
|
|
|
my_email: "",
|
|
|
|
|
my_tel: "",
|
|
|
|
|
nickname: "",
|
|
|
|
|
},
|
2024-05-29 16:35:45 +08:00
|
|
|
MeasureSkip: null,
|
2024-12-07 10:41:48 +08:00
|
|
|
MeasureResult: {
|
|
|
|
|
body_type_name: "",
|
|
|
|
|
body_type_unit: "",
|
|
|
|
|
body_type_value: "",
|
|
|
|
|
bottom_list: [],
|
|
|
|
|
cplist: {
|
|
|
|
|
moodlist: [],
|
|
|
|
|
nutritionlist: [],
|
|
|
|
|
sleeplist: [],
|
|
|
|
|
sportlist: []
|
|
|
|
|
},
|
|
|
|
|
literature: [],
|
|
|
|
|
record_time: "",
|
|
|
|
|
score_name: "",
|
|
|
|
|
score_unit: "",
|
|
|
|
|
score_value: "",
|
|
|
|
|
target_current: {
|
|
|
|
|
target_weight: 0,
|
|
|
|
|
initial_weight: "",
|
|
|
|
|
cumulative_weight: "",
|
|
|
|
|
cumulative_day: ""
|
|
|
|
|
},
|
|
|
|
|
top_list: []
|
|
|
|
|
},
|
2024-05-29 16:35:45 +08:00
|
|
|
MeasureLung: null,
|
2024-09-26 09:18:27 +08:00
|
|
|
PublicContent: null,
|
2024-05-29 16:35:45 +08:00
|
|
|
familayList: [],
|
|
|
|
|
historyList: [],
|
2024-09-26 09:18:27 +08:00
|
|
|
PublicRecord: [],
|
2024-05-29 16:35:45 +08:00
|
|
|
cardList: {
|
|
|
|
|
user: [],
|
|
|
|
|
all: []
|
|
|
|
|
},
|
|
|
|
|
Trend: [],
|
2024-07-08 10:50:07 +08:00
|
|
|
userDeviceList: [], //用户设备列表
|
2024-05-29 16:35:45 +08:00
|
|
|
isDrawe: false, //左侧弹框
|
|
|
|
|
isedit: false, //信息弹框
|
|
|
|
|
isTarget: false, //目标体重
|
|
|
|
|
isFirst: false, //初始体重
|
|
|
|
|
isRecord: false, //手动记录
|
|
|
|
|
isSlider: false, //分数占比
|
2024-06-13 18:03:50 +08:00
|
|
|
isConnected: false,
|
2024-11-12 15:38:28 +08:00
|
|
|
isPublicRecord: false,
|
2024-06-13 18:03:50 +08:00
|
|
|
isBluetoothTyle: false,
|
2024-12-07 10:41:48 +08:00
|
|
|
CooperationUrl: [],
|
2024-07-22 14:13:19 +08:00
|
|
|
LungLevel: [], //肺活量标准
|
|
|
|
|
devicesList: [], //筛选设备列表
|
2025-09-30 09:46:29 +08:00
|
|
|
devicesList2: [], //F01PRO使用
|
2024-09-26 09:18:27 +08:00
|
|
|
labelList: [],
|
2024-07-22 14:13:19 +08:00
|
|
|
phoneInfo: {
|
|
|
|
|
info: {},
|
2024-09-12 11:20:52 +08:00
|
|
|
versionUrl: null,
|
2024-07-22 14:13:19 +08:00
|
|
|
platform: ""
|
|
|
|
|
},
|
2024-10-11 10:04:19 +08:00
|
|
|
cityList: [],
|
|
|
|
|
gradeList: [],
|
2025-09-30 09:46:29 +08:00
|
|
|
identityList: [],
|
|
|
|
|
Config: {}
|
2024-05-29 16:35:45 +08:00
|
|
|
},
|
2025-09-30 09:46:29 +08:00
|
|
|
|
2024-05-29 16:35:45 +08:00
|
|
|
// mutations: Store中更改state数据状态的唯一方法(必须是同步函数)
|
|
|
|
|
mutations: {
|
2024-07-22 14:13:19 +08:00
|
|
|
// 版本信息
|
|
|
|
|
changePhoneInfo(state, newData) {
|
|
|
|
|
Object.assign(state.phoneInfo, newData)
|
|
|
|
|
},
|
2024-06-13 18:03:50 +08:00
|
|
|
// 账户信息
|
|
|
|
|
changeAccountNumber(state, newData) {
|
|
|
|
|
Object.assign(state.accountNumber, newData)
|
|
|
|
|
},
|
2024-05-29 16:35:45 +08:00
|
|
|
/* 用户信息 */
|
|
|
|
|
changeUser(state, newData) {
|
|
|
|
|
Object.assign(state.user, newData)
|
|
|
|
|
},
|
|
|
|
|
// 卡片列表
|
|
|
|
|
changeCardList(state, newData) {
|
|
|
|
|
state.cardList = newData
|
|
|
|
|
},
|
|
|
|
|
//历史记录
|
|
|
|
|
changehistoryList(state, newData) {
|
|
|
|
|
state.historyList = newData
|
|
|
|
|
},
|
|
|
|
|
// 获取称重数据
|
|
|
|
|
changeMeasureResult(state, newData) {
|
2024-12-07 10:41:48 +08:00
|
|
|
// state.MeasureResult = newData
|
|
|
|
|
Object.assign(state.MeasureResult, newData)
|
2024-05-29 16:35:45 +08:00
|
|
|
},
|
|
|
|
|
// 跳绳数据
|
|
|
|
|
changeMeasureSkip(state, newData) {
|
|
|
|
|
state.MeasureSkip = newData
|
|
|
|
|
},
|
|
|
|
|
// 肺活量
|
|
|
|
|
changeMeasureLung(state, newData) {
|
|
|
|
|
state.MeasureLung = newData
|
|
|
|
|
},
|
2024-09-26 09:18:27 +08:00
|
|
|
// 公共
|
|
|
|
|
changePublicContent(state, newData) {
|
|
|
|
|
state.PublicContent = newData
|
|
|
|
|
},
|
2025-09-30 09:46:29 +08:00
|
|
|
changeConfig(state, newData){
|
|
|
|
|
state.Config = newData
|
|
|
|
|
},
|
2024-09-26 09:18:27 +08:00
|
|
|
// 公共手动记录内容
|
|
|
|
|
changePublicRecord(state, newData) {
|
|
|
|
|
state.PublicRecord = newData
|
|
|
|
|
},
|
2024-05-29 16:35:45 +08:00
|
|
|
|
|
|
|
|
// 信息弹框
|
|
|
|
|
changeEdit(state, newData) {
|
|
|
|
|
state.isedit = newData
|
|
|
|
|
},
|
|
|
|
|
// 目标体重
|
|
|
|
|
changeTarget(state, newData) {
|
|
|
|
|
state.isTarget = newData
|
|
|
|
|
},
|
|
|
|
|
// 初始体重
|
|
|
|
|
changeFirst(state, newData) {
|
|
|
|
|
state.isFirst = newData
|
|
|
|
|
},
|
|
|
|
|
// 手动记录
|
|
|
|
|
changeRecord(state, newData) {
|
|
|
|
|
state.isRecord = newData
|
|
|
|
|
},
|
|
|
|
|
// 分数占比
|
|
|
|
|
changeSlider(state, newData) {
|
|
|
|
|
state.isSlider = newData
|
|
|
|
|
},
|
|
|
|
|
// 左侧菜单弹框
|
|
|
|
|
changeDrawe(state, newData) {
|
|
|
|
|
state.isDrawe = newData
|
|
|
|
|
},
|
2024-07-22 14:13:19 +08:00
|
|
|
// 肺活量标准
|
|
|
|
|
changeLungLevel(state, newData) {
|
|
|
|
|
state.lungLevel = newData
|
|
|
|
|
},
|
2024-05-29 16:35:45 +08:00
|
|
|
//获取家庭成员
|
|
|
|
|
changeFamilay(state, newData) {
|
2024-06-13 18:03:50 +08:00
|
|
|
if (newData.length == 0) {
|
|
|
|
|
uni.setStorageSync('userid', "")
|
|
|
|
|
uni.setStorageSync('gender', 0)
|
2024-11-12 15:38:28 +08:00
|
|
|
state.user = {
|
|
|
|
|
id: "",
|
|
|
|
|
head_pic: null,
|
|
|
|
|
nickname: "",
|
|
|
|
|
birthday: "",
|
|
|
|
|
gender: 0,
|
|
|
|
|
sex: 0,
|
|
|
|
|
age: 0,
|
|
|
|
|
weight: "",
|
|
|
|
|
address: "",
|
|
|
|
|
measure_model: 0,
|
|
|
|
|
card_order: [],
|
|
|
|
|
card_data_list: [],
|
|
|
|
|
target_current: {},
|
|
|
|
|
vitalcapacity_data: []
|
|
|
|
|
}
|
2024-06-13 18:03:50 +08:00
|
|
|
}
|
2024-05-29 16:35:45 +08:00
|
|
|
state.familayList = newData
|
|
|
|
|
},
|
|
|
|
|
//趋势
|
|
|
|
|
changeTrend(state, newData) {
|
|
|
|
|
state.Trend = newData
|
2024-06-13 18:03:50 +08:00
|
|
|
},
|
|
|
|
|
//蓝牙是否开启
|
|
|
|
|
changeBluetooth(state, newData) {
|
|
|
|
|
state.isBluetoothTyle = newData
|
|
|
|
|
},
|
|
|
|
|
// 蓝牙起否连接
|
|
|
|
|
changeConnected(state, newData) {
|
|
|
|
|
state.isConnected = newData
|
|
|
|
|
},
|
2024-07-08 10:50:07 +08:00
|
|
|
// 用户设备列表
|
|
|
|
|
changeUserDeviceList(state, newData) {
|
|
|
|
|
state.userDeviceList = newData
|
2024-07-22 14:13:19 +08:00
|
|
|
}, //
|
|
|
|
|
changedevicesList(state, newData) {
|
|
|
|
|
state.devicesList = newData
|
2024-09-26 09:18:27 +08:00
|
|
|
},
|
|
|
|
|
// 公共卡片
|
|
|
|
|
changeLabelList(state, newData) {
|
|
|
|
|
state.labelList = newData
|
2024-10-11 10:04:19 +08:00
|
|
|
},
|
|
|
|
|
// 城市
|
|
|
|
|
changeCityList(state, newData) {
|
|
|
|
|
state.cityList = newData
|
|
|
|
|
},
|
|
|
|
|
changeGradeList(state, newData) {
|
|
|
|
|
state.gradeList = newData
|
|
|
|
|
},
|
|
|
|
|
changeIdentityList(state, newData) {
|
|
|
|
|
state.identityList = newData
|
|
|
|
|
},
|
2024-11-12 15:38:28 +08:00
|
|
|
changePublicAdd(state, newData) {
|
|
|
|
|
state.isPublicRecord = newData
|
|
|
|
|
},
|
2024-12-07 10:41:48 +08:00
|
|
|
// 合作服务
|
|
|
|
|
changeCooperationUrl(state, newData) {
|
|
|
|
|
state.CooperationUrl = newData
|
|
|
|
|
},
|
2024-11-12 15:38:28 +08:00
|
|
|
|
2024-05-29 16:35:45 +08:00
|
|
|
},
|
|
|
|
|
// 模块化vuex
|
|
|
|
|
modules: {},
|
|
|
|
|
actions
|
|
|
|
|
})
|