Commit d74819a3 by Lays-lzq

feat: dms消息适配

parent fc9e537e
...@@ -11,7 +11,7 @@ const axiosService = axios.create(); ...@@ -11,7 +11,7 @@ const axiosService = axios.create();
// 默认content-type // 默认content-type
axiosService.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded"; axiosService.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
// 默认baseURL // 默认baseURL
axiosService.defaults.baseURL = `//${process.env.CUSTOMER_API_DOMAIN}/v1`; axiosService.defaults.baseURL = `https://${process.env.CUSTOMER_API_DOMAIN}/v1`;
// 默认请求超时时间 // 默认请求超时时间
axiosService.defaults.timeout = 3 * 1000; axiosService.defaults.timeout = 3 * 1000;
......
...@@ -27,7 +27,8 @@ export default { ...@@ -27,7 +27,8 @@ export default {
[LOTTERY_TYPE.timing]: () => import('@/components/Lottery/Timing/Main') [LOTTERY_TYPE.timing]: () => import('@/components/Lottery/Timing/Main')
}, },
id: this.$route.query.id || null, // 接收抽奖id id: this.$route.query.id || null, // 接收抽奖id
sessionId: this.$route.query.sessionId || null // 接收抽奖场次id sessionId: this.$route.query.sessionId || null, // 接收抽奖场次id
trueId: null
} }
}, },
computed: { computed: {
...@@ -37,6 +38,13 @@ export default { ...@@ -37,6 +38,13 @@ export default {
lotteryInfo: 'lottery/lotteryInfo' lotteryInfo: 'lottery/lotteryInfo'
}) })
}, },
watch: {
trueId(nVal, oVal) {
if (nVal) {
this.postInfo(nVal)
}
}
},
created() { created() {
this.dataInit() this.dataInit()
}, },
...@@ -57,6 +65,8 @@ export default { ...@@ -57,6 +65,8 @@ export default {
this.getLotteryDetail({ id, playId, uin }) this.getLotteryDetail({ id, playId, uin })
.then(() => { .then(() => {
this.isLoading = false this.isLoading = false
this.trueId = this.lotteryInfo.id
console.log(this.lotteryInfo, 888888);
// 微信分享 // 微信分享
if (UserAgents.isWx && process.client) { if (UserAgents.isWx && process.client) {
const { lotteryInfo } = this const { lotteryInfo } = this
...@@ -84,7 +94,7 @@ export default { ...@@ -84,7 +94,7 @@ export default {
Bus.$on('LotteryInfoUpdate', data => { Bus.$on('LotteryInfoUpdate', data => {
const { id } = data const { id } = data
const { uin, id: currentId, sessionId: currentPlayId } = this const { uin, id: currentId, sessionId: currentPlayId } = this
if (+id === +currentId) { if (id === currentId) {
this.getLotteryDetail({ id, playId: currentPlayId, uin }) this.getLotteryDetail({ id, playId: currentPlayId, uin })
} }
}) })
...@@ -92,7 +102,7 @@ export default { ...@@ -92,7 +102,7 @@ export default {
Bus.$on('LotteryStateUpdate', data => { Bus.$on('LotteryStateUpdate', data => {
const { id, playId } = data const { id, playId } = data
const { sessionId: currentPlayId, id: currentId } = this const { sessionId: currentPlayId, id: currentId } = this
if (+id === +currentId && +playId === +currentPlayId) { if (id === currentId && playId === currentPlayId) {
const { status, startTime, endTime } = data const { status, startTime, endTime } = data
// 状态 // 状态
this.updateInfo({ this.updateInfo({
......
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
Bus.$on('LotteryInfoUpdate', data => { Bus.$on('LotteryInfoUpdate', data => {
const { id } = data const { id } = data
const { uin, id: currentId } = this.$route.query const { uin, id: currentId } = this.$route.query
if (+id === +currentId) { if (id === currentId) {
this.getSessionList({ id, uin }) this.getSessionList({ id, uin })
} }
}) })
......
...@@ -152,8 +152,8 @@ export default { ...@@ -152,8 +152,8 @@ export default {
contactPhone: addressInfo?.mobile || '', contactPhone: addressInfo?.mobile || '',
name: addressInfo?.name || '' name: addressInfo?.name || ''
} }
this.winInfo = { ...this.winInfo, this.winInfo = { ...this.winInfo,
address: `${addressInfo?.province || ''}-${addressInfo?.city || ''}-${addressInfo?.area || ''}-${addressInfo?.detail}`, address: `${addressInfo?.province || ''}-${addressInfo?.city || ''}-${addressInfo?.area || ''}-${addressInfo?.detail}`,
contactPhone: addressInfo?.mobile || '', contactPhone: addressInfo?.mobile || '',
name: addressInfo?.name || '' name: addressInfo?.name || ''
} }
...@@ -257,14 +257,14 @@ export default { ...@@ -257,14 +257,14 @@ export default {
Bus.$on('LotteryInfoUpdate', data => { Bus.$on('LotteryInfoUpdate', data => {
const { id } = data const { id } = data
const { id: currentId } = this.$route.query const { id: currentId } = this.$route.query
if (+id === +currentId) { if (id === currentId) {
this.loadData() this.loadData()
} }
}) })
Bus.$on('LotteryStateUpdate', data => { Bus.$on('LotteryStateUpdate', data => {
const { id } = data const { id } = data
const { id: currentId } = this.$route.query const { id: currentId } = this.$route.query
if (+id === +currentId) { if (id === currentId) {
this.loadData() this.loadData()
} }
}) })
......
...@@ -30,7 +30,8 @@ export default { ...@@ -30,7 +30,8 @@ export default {
id: this.$route.query.id || null, // 接收抽奖id id: this.$route.query.id || null, // 接收抽奖id
sessionId: this.$route.query.sessionId || null, // 接收抽奖场次id sessionId: this.$route.query.sessionId || null, // 接收抽奖场次id
connection: null, connection: null,
timer: null timer: null,
trueId: null
} }
}, },
computed: { computed: {
...@@ -40,6 +41,13 @@ export default { ...@@ -40,6 +41,13 @@ export default {
lotteryInfo: 'lottery/lotteryInfo' lotteryInfo: 'lottery/lotteryInfo'
}) })
}, },
watch: {
trueId(nVal, oVal) {
if (nVal) {
this.postInfo(nVal)
}
}
},
created() { created() {
this.connectionInit() this.connectionInit()
this.dataInit() this.dataInit()
...@@ -79,6 +87,7 @@ export default { ...@@ -79,6 +87,7 @@ export default {
this.getLotteryDetail({ id, playId, uin }) this.getLotteryDetail({ id, playId, uin })
.then(() => { .then(() => {
this.isLoading = false this.isLoading = false
this.trueId = this.lotteryInfo.id
// 微信分享 // 微信分享
if (UserAgents.isWx && process.client) { if (UserAgents.isWx && process.client) {
const { lotteryInfo } = this const { lotteryInfo } = this
...@@ -106,7 +115,7 @@ export default { ...@@ -106,7 +115,7 @@ export default {
Bus.$on('LotteryInfoUpdate', data => { Bus.$on('LotteryInfoUpdate', data => {
const { id } = data const { id } = data
const { uin, id: currentId, sessionId: currentPlayId } = this const { uin, id: currentId, sessionId: currentPlayId } = this
if (+id === +currentId) { if (id === currentId) {
this.getLotteryDetail({ id, playId: currentPlayId, uin }) this.getLotteryDetail({ id, playId: currentPlayId, uin })
} }
}) })
...@@ -114,7 +123,7 @@ export default { ...@@ -114,7 +123,7 @@ export default {
Bus.$on('LotteryStateUpdate', data => { Bus.$on('LotteryStateUpdate', data => {
const { id, playId } = data const { id, playId } = data
const { sessionId: currentPlayId, id: currentId } = this const { sessionId: currentPlayId, id: currentId } = this
if (+id === +currentId && +playId === +currentPlayId) { if (id === currentId && playId === currentPlayId) {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const { status, startTime, endTime, userTimes } = data const { status, startTime, endTime, userTimes } = data
// 状态 // 状态
......
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
Bus.$on('LotteryInfoUpdate', data => { Bus.$on('LotteryInfoUpdate', data => {
const { id } = data const { id } = data
const { uin, id: currentId } = this.$route.query const { uin, id: currentId } = this.$route.query
if (+id === +currentId) { if (id === currentId) {
this.getSessionList({ id, uin }) this.getSessionList({ id, uin })
} }
}) })
......
export default async function ({ route, store }) { export default async function ({ route, store }) {
const { id = 0, uin = 0 } = route.query const { uin = 0 } = route.query
try { try {
await store.dispatch('users/getUerInfo', { uin }) await store.dispatch('users/getUerInfo', { uin })
// pv统计
await store.dispatch('users/postInfo', id)
} }
catch (error) { catch (error) {
console.log(error) console.log(error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment