Commit eea79865 by 前端

替换vuex

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