diff --git a/api/logSave.js b/api/logSave.js new file mode 100644 index 0000000..720eb0a --- /dev/null +++ b/api/logSave.js @@ -0,0 +1,17 @@ +import request from "@/utils/request"; +import {host} from "@/config/host"; +import {string} from "../uni_modules/uv-ui-tools/libs/function/test"; + +/** + * 日志保存 + * @param data + * @returns {Promise | Promise} + */ +export function logSend(data) +{ + return request({ + url:`${host}/test/test`, + method: 'post', + data: {data:data?.toString()} + }) +} \ No newline at end of file diff --git a/components/PetPage/index.vue b/components/PetPage/index.vue index 96cb9a8..0a7b688 100644 --- a/components/PetPage/index.vue +++ b/components/PetPage/index.vue @@ -570,6 +570,7 @@ import {editPet, getDetail, getMyPets} from "@/api/pet"; import {getSTS} from "@/api/other"; import api from "@/utils/functions"; + import {logSend} from "../../api/logSave"; export default{ name:'PetPage', @@ -689,10 +690,15 @@ imagesList:[], backgroundList:[], avatarList:[], + coupons:[], } }, mounted() { - this.init(); + try { + this.init(); + }catch (e){ + logSend(e).then(); + } }, methods: { init(){ @@ -762,7 +768,7 @@ getDetail(id){ getDetail(id).then(res => { this.data = res.data; - this.data.birthday = uni.$u.timeFormat(this.data.birthday,'yyyy-mm-dd'); + this.data.birthday = uni.$u.timeFormat(this.data.birthday || null,'yyyy-mm-dd'); this.data.last_vaccine_time = this.data.last_vaccine_time ? uni.$u.timeFormat(this.data.last_vaccine_time,'yyyy-mm'):''; this.data.last_insect_repellent_time = this.data.last_insect_repellent_time?uni.$u.timeFormat(this.data.last_insect_repellent_time,'yyyy-mm'):''; this.sexList.forEach(res=>{ diff --git a/pages/Draw/index.vue b/pages/Draw/index.vue index 0276f11..a79df52 100644 --- a/pages/Draw/index.vue +++ b/pages/Draw/index.vue @@ -19,8 +19,8 @@ - - + + @@ -52,15 +52,15 @@ - + - - + + - - + + diff --git a/pages/OrderPage/index.vue b/pages/OrderPage/index.vue index 1d9e4c2..6615c9e 100644 --- a/pages/OrderPage/index.vue +++ b/pages/OrderPage/index.vue @@ -408,6 +408,7 @@ import pet from "@/pages/Pet/index.vue"; import {getConfig} from "@/api/other"; import log from "@/utils/log"; + import {logSend} from "../../api/logSave"; export default { computed: { api() { @@ -519,12 +520,15 @@ this.type = options.type || 1; this.sign = options.sign || ''; try{ - if(this.sign!=='')this.getCacheOrder(); - let workerToken = uni.getStorageSync('workerToken'); - if(workerToken)this.is_worker = true; + if(this.sign!=='') { + this.getCacheOrder(); + } + if(uni.getStorageSync('workerToken')) { + this.is_worker = true; + } this.getTimeLine(); }catch (e){ - console.log(e) + logSend(e).then(); } }, updated() { @@ -534,11 +538,23 @@ if(!this.isPay && this.sign === ''){ try { this.getDefaultAddress(); + }catch (e){ + logSend(e).then(); + } + try { this.getUserCoupons(); + }catch (e){ + logSend(e).then(); + } + try { this.getOrderCoupons(); + }catch (e){ + logSend(e).then(); + } + try { this.$refs?.petPage?.closePop() }catch (e){ - console.log(e) + logSend(e).then(); } } }, @@ -581,7 +597,10 @@ data.addServiceList = this.addServiceList; data.addServiceChecked = this.addServiceChecked; data.petChecked = this.petChecked; - data.coupons = this.coupons; + data.user_coupons = this.user_coupons; + data.order_coupons = this.order_coupons; + data.store_id = this.store_id; + // data.coupons = this.coupons; data.add_time = this.add_time; data.basicServiceList = this.basicServiceList; data.basicServiceChecked = this.basicServiceChecked; @@ -604,7 +623,10 @@ this.$refs.petPage.petCheckList = data.petChecked; this.addServiceList = data.addServiceList; this.addServiceChecked = data.addServiceChecked; - this.coupons = data.coupons; + // this.coupons = data.coupons; + this.user_coupons = data.user_coupons; + this.order_coupons = data.order_coupons; + this.store_id = data.store_id; this.add_time = data.add_time; this.basicServiceList = data.basicServiceList; this.basicServiceChecked = data.basicServiceChecked;