上传代码
This commit is contained in:
23
p-BluPrint_1.0.288888/store/bluetooth/index.js
Normal file
23
p-BluPrint_1.0.288888/store/bluetooth/index.js
Normal file
@ -0,0 +1,23 @@
|
||||
let sysinfo = uni.getSystemInfoSync();
|
||||
const Bluetooth = {
|
||||
state: {
|
||||
//蓝牙信息
|
||||
BLEInformation: {
|
||||
platform: sysinfo.platform || "",
|
||||
deviceId: "",
|
||||
writeCharaterId: "",
|
||||
writeServiceId: "",
|
||||
notifyCharaterId: "",
|
||||
notifyServiceId: "",
|
||||
readCharaterId: "",
|
||||
readServiceId: "",
|
||||
}
|
||||
},
|
||||
mutations:{
|
||||
BLEInformationSet(state, info){
|
||||
state.BLEInformation = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Bluetooth;
|
24
p-BluPrint_1.0.288888/store/index.js
Normal file
24
p-BluPrint_1.0.288888/store/index.js
Normal file
@ -0,0 +1,24 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
|
||||
//蓝牙设置
|
||||
import Bluetooth from '@/store/bluetooth/index.js'
|
||||
|
||||
|
||||
|
||||
const store = new Vuex.Store({
|
||||
modules: {
|
||||
Bluetooth
|
||||
},
|
||||
state: {
|
||||
sysinfo: uni.getSystemInfoSync(),//系统信息
|
||||
},
|
||||
mutations: {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
export default store
|
27
p-BluPrint_1.0.288888/store/user.js
Normal file
27
p-BluPrint_1.0.288888/store/user.js
Normal file
@ -0,0 +1,27 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
const state = {
|
||||
userInfo: {}
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
SET_USER_INFO(state, userInfo) {
|
||||
state.userInfo = userInfo;
|
||||
}
|
||||
};
|
||||
|
||||
const actions = {
|
||||
setUserInfo({ commit }, userInfo) {
|
||||
commit('SET_USER_INFO', userInfo);
|
||||
}
|
||||
};
|
||||
|
||||
export default new Vuex.Module({
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
});
|
Reference in New Issue
Block a user