Commit eea79865 by 前端

替换vuex

1 parent 52ce49ee
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<script> <script>
import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js"; import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js";
import { mapState } from "vuex"; import { mapState } from "vuex";
import * as sentry from "@/utils/sentryConfig/sentry-miniapp";
export default { export default {
computed: { computed: {
...mapState("audio", ["isEnd", "isStart"]), ...mapState("audio", ["isEnd", "isStart"]),
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
}, },
onHide: function () {}, onHide: function () {},
onError: function (e) { onError: function (e) {
// sentry.captureException(e); sentry.captureException(e);
}, },
}; };
</script> </script>
......
...@@ -39,8 +39,10 @@ import permision from "@/js_sdk/wa-permission/permission.js"; ...@@ -39,8 +39,10 @@ import permision from "@/js_sdk/wa-permission/permission.js";
Vue.prototype.$permision = permision; Vue.prototype.$permision = permision;
import sentryInit from "@/utils/sentryConfig/sentryInit"; import sentryInit from "@/utils/sentryConfig/sentryInit";
sentryInit(); sentryInit();
const app = new Vue({ const app = new Vue({
store, store,
...App, ...App,
}); });
app.$mount(); app.$mount();
\ No newline at end of file \ No newline at end of file
...@@ -108,7 +108,13 @@ export default { ...@@ -108,7 +108,13 @@ export default {
receptionCustomerPaySourceList, //1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径 receptionCustomerPaySourceList, //1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径
merchantId: shopMerchantId, merchantId: shopMerchantId,
}; };
console.log(customerName, phoneNumber, salesUuid, carModel); console.log(
customerName,
phoneNumber,
salesUuid,
carModel,
tempFilePath
);
if (customerName && phoneNumber && salesUuid && carModel) if (customerName && phoneNumber && salesUuid && carModel)
uni.$api.commonApi.saveRecCustomer(params).then((res) => { uni.$api.commonApi.saveRecCustomer(params).then((res) => {
console.log(res, params); console.log(res, params);
...@@ -132,12 +138,16 @@ export default { ...@@ -132,12 +138,16 @@ export default {
this.initTime(); this.initTime();
recorderManager.start({ recorderManager.start({
duration: 600000, duration: 600000,
sampleRate: 16000,
numberOfChannels: 1,
}); });
recorderManager.onStop(async (res) => { recorderManager.onStop(async (res) => {
console.log("结束录音"); console.log("结束录音");
if (!this.isEnd) { if (!this.isEnd) {
uni.getRecorderManager().start({ uni.getRecorderManager().start({
duration: 600000, duration: 600000,
sampleRate: 16000,
numberOfChannels: 1,
}); });
} }
const result = await upload(res.tempFilePath); const result = await upload(res.tempFilePath);
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
// import { setToken, getToken, removeToken } from '@/utils/token';; // import { setToken, getToken, removeToken } from '@/utils/token';;
export default { export default {
state () { state() {
return { return {
customerInfo: { customerInfo: {
customerName: "", customerName: "",
carBrand: '', carBrand: "",
carModel: "", carModel: "",
phoneNumber: "", phoneNumber: "",
salesUuid: "", salesUuid: "",
...@@ -21,48 +21,53 @@ export default { ...@@ -21,48 +21,53 @@ export default {
historyStatus: Date.now(), historyStatus: Date.now(),
carBrands: [], carBrands: [],
employeeList: [], employeeList: [],
paymentType: [] paymentType: [],
}; };
}, },
mutations: { mutations: {
getCustomerInfo (state) { getCustomerInfo(state) {
return state.customerInfo; return state.customerInfo;
}, },
setCustomerInfo (state, data) { setCustomerInfo(state, data) {
state.customerInfo = data; // state.customerInfo = data;
uni.$storage.set("customerInfo", JSON.stringify(data));
state.customerInfo = JSON.parse(uni.$storage.get("customerInfo") || "{}");
}, },
clearCustomerInfo (state) { clearCustomerInfo(state) {
state.customerInfo = { const info = {
customerName: "", customerName: "",
carBrand: "",
carModel: "", carModel: "",
phoneNumber: "", phoneNumber: "",
salesUuid: "", salesUuid: "",
staffName: "", staffName: "",
}; };
uni.$storage.set("customerInfo", JSON.stringify(info));
state.customerInfo = JSON.parse(uni.$storage.get("customerInfo") || "{}");
}, },
}, },
actions: { actions: {
// 获取用户详情 // 获取用户详情
getCustomerInfo ({ state }) { getCustomerInfo({ state }) {
return state.customerInfo; return state.customerInfo;
}, },
setCustomerInfo ({ commit }, value) { setCustomerInfo({ commit }, value) {
commit("setCustomerInfo", value); commit("setCustomerInfo", value);
}, },
clearCustomerInfo ({ commit }) { clearCustomerInfo({ commit }) {
commit("clearCustomerInfo"); commit("clearCustomerInfo");
}, },
clearHistory ({ state }) { clearHistory({ state }) {
state.historyStatus = Date.now() state.historyStatus = Date.now();
}, },
setPaymentType ({ state }, value) { setPaymentType({ state }, value) {
state.paymentType = value state.paymentType = value;
}, },
setCarBrandsList ({ state }, value) { setCarBrandsList({ state }, value) {
state.carBrands = value state.carBrands = value;
},
setEmployeeList({ state }, value) {
state.employeeList = value;
}, },
setEmployeeList ({ state }, value) {
state.employeeList = value
}
}, },
}; };
...@@ -11,10 +11,11 @@ export const STORAGE_OBJECTkEY = { ...@@ -11,10 +11,11 @@ export const STORAGE_OBJECTkEY = {
DEFAULT_GET_STORAGEKEY, DEFAULT_GET_STORAGEKEY,
mock_data: "mock_data", mock_data: "mock_data",
storageFile: "storageFile", storageFile: "storageFile",
userInfo: 'userInfo', userInfo: "userInfo",
noSignInUuid: 'noSignInUuid', customerInfo: "customerInfo",
noviceGuideStatus: 'noviceGuideStatus', noSignInUuid: "noSignInUuid",
accountLength: 'accountLength' noviceGuideStatus: "noviceGuideStatus",
accountLength: "accountLength",
}; };
// export const IMG_VERSION = async () => { // export const IMG_VERSION = async () => {
......
...@@ -4,5 +4,5 @@ export default function sentryInit() { ...@@ -4,5 +4,5 @@ export default function sentryInit() {
Sentry.init({ Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5' // dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: "https://cce6491788ff4b8899d8f912e6982a96@sentry.glsx.com.cn/42", dsn: "https://cce6491788ff4b8899d8f912e6982a96@sentry.glsx.com.cn/42",
}); })
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!