uu
This commit is contained in:
parent
b77a01cc28
commit
7253d40032
@ -91,3 +91,8 @@ export const addComplaints = (data = {})=> {
|
|||||||
export const getComplainInfo = (data = {})=> {
|
export const getComplainInfo = (data = {})=> {
|
||||||
return coreRequest(url.getComplainInfo, data, {}, 'get')
|
return coreRequest(url.getComplainInfo, data, {}, 'get')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 小程序订阅消息模板列表
|
||||||
|
export const querySappNotifyTplList = (data = {})=> {
|
||||||
|
return coreRequest(url.querySappNotifyTplList, data, {}, 'get')
|
||||||
|
}
|
||||||
@ -62,5 +62,7 @@ export default {
|
|||||||
getWarehouseInList: `/oms2c/emisWarehouseIn/listSimple`, // 进仓单列表
|
getWarehouseInList: `/oms2c/emisWarehouseIn/listSimple`, // 进仓单列表
|
||||||
getWarehouseInInfo: `/oms2c/emisWarehouseIn/getWarehouseInDetail`, // 获取进仓单详情
|
getWarehouseInInfo: `/oms2c/emisWarehouseIn/getWarehouseInDetail`, // 获取进仓单详情
|
||||||
cusConfirmWsIn: `/oms2c/emisWarehouseIn/cusConfirmWsIn`, // 确认进仓单
|
cusConfirmWsIn: `/oms2c/emisWarehouseIn/cusConfirmWsIn`, // 确认进仓单
|
||||||
|
querySappNotifyTplList: `/oms2c/common/querySappNotifyTplList`, // 小程序订阅消息模板列表
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { goto } from "./untool"
|
|||||||
import { getCurrentInstance } from "vue"
|
import { getCurrentInstance } from "vue"
|
||||||
import { sysEventNames } from "@/common/enum"
|
import { sysEventNames } from "@/common/enum"
|
||||||
|
|
||||||
|
// 唤起登录
|
||||||
export const goLogin = ()=> {
|
export const goLogin = ()=> {
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
uni.$emit(sysEventNames.login, { })
|
uni.$emit(sysEventNames.login, { })
|
||||||
@ -12,3 +13,8 @@ export const goLogin = ()=> {
|
|||||||
goto("login/login", 2)
|
goto("login/login", 2)
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 唤起消息订阅
|
||||||
|
export const triggerSubscribeMessage = ()=> {
|
||||||
|
uni.$emit(sysEventNames.subMessage, { })
|
||||||
|
}
|
||||||
@ -30,6 +30,7 @@ const pageEventNames = {
|
|||||||
|
|
||||||
const sysEventNames = {
|
const sysEventNames = {
|
||||||
login: "login", // 触发登录
|
login: "login", // 触发登录
|
||||||
|
subMessage: "subMessage", // 触发订阅模板消息
|
||||||
}
|
}
|
||||||
|
|
||||||
const addressNameCodeMap = [
|
const addressNameCodeMap = [
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { goto, getImageTempFilePath } from "./untool";
|
|||||||
import { showToast, showLoading, hideLoading, downloadFile } from "./untool"
|
import { showToast, showLoading, hideLoading, downloadFile } from "./untool"
|
||||||
import { setSessionXToken, getSessionXToken } from "@/session"
|
import { setSessionXToken, getSessionXToken } from "@/session"
|
||||||
import { textEncoder, textDecoder } from "./util"
|
import { textEncoder, textDecoder } from "./util"
|
||||||
import { goLogin } from "@/common/loginHandle"
|
import { goLogin } from "@/common/componentEventHandle"
|
||||||
|
|
||||||
const getCommonReqData = ()=> {
|
const getCommonReqData = ()=> {
|
||||||
const xToken = getSessionXToken()
|
const xToken = getSessionXToken()
|
||||||
|
|||||||
46
components/buns-api/subscribe-message/index.vue
Normal file
46
components/buns-api/subscribe-message/index.vue
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { promiseTimeout, showToast, uniPromiseApi } from "@/common/untool"
|
||||||
|
import { sysEventNames } from "@/common/enum"
|
||||||
|
import * as apiService from "@/common/api"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tmplIds: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initData()
|
||||||
|
uni.$on(sysEventNames.subMessage, this.triggerCallApi)
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
},
|
||||||
|
unmounted(){
|
||||||
|
uni.$off(sysEventNames.subMessage, this.triggerCallApi)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async initData(){
|
||||||
|
let res = await apiService.querySappNotifyTplList()
|
||||||
|
let tmplIds = res?.data?.map?.(t=> t.tplId) || []
|
||||||
|
this.tmplIds = tmplIds
|
||||||
|
},
|
||||||
|
async triggerCallApi(){
|
||||||
|
await uniPromiseApi('requestSubscribeMessage', {
|
||||||
|
tmplIds: this.tmplIds
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -3,14 +3,16 @@
|
|||||||
<slot></slot>
|
<slot></slot>
|
||||||
</view>
|
</view>
|
||||||
<LoginComponent ref="loginRef"></LoginComponent>
|
<LoginComponent ref="loginRef"></LoginComponent>
|
||||||
|
<SubscribeMessage ref="subMessageRef"></SubscribeMessage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { pageEventNames } from "@/common/enum"
|
import { pageEventNames } from "@/common/enum"
|
||||||
import LoginComponent from "@/components/buns-api/login/index"
|
import LoginComponent from "@/components/buns-api/login/index"
|
||||||
|
import SubscribeMessage from "@/components/buns-api/subscribe-message/index"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { LoginComponent },
|
components: { LoginComponent, SubscribeMessage },
|
||||||
props: {
|
props: {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@ -218,6 +218,7 @@
|
|||||||
import BpeCheckagreeTmp from "@/components/buns-post-edit-templates/bpe-checkagree-tmp"
|
import BpeCheckagreeTmp from "@/components/buns-post-edit-templates/bpe-checkagree-tmp"
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import { debounce } from "@/common/util"
|
import { debounce } from "@/common/util"
|
||||||
|
import { triggerSubscribeMessage } from "@/common/componentEventHandle"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { getOrderModels, initDefaultModel, setBindTsm, getBindTsm } from "./model"
|
import { getOrderModels, initDefaultModel, setBindTsm, getBindTsm } from "./model"
|
||||||
|
|
||||||
@ -386,6 +387,7 @@
|
|||||||
curModal.show = true
|
curModal.show = true
|
||||||
},
|
},
|
||||||
async handleSave(type) {
|
async handleSave(type) {
|
||||||
|
triggerSubscribeMessage() // 唤起消息订阅
|
||||||
let errMsg = ''
|
let errMsg = ''
|
||||||
let saveServerHand = apiService.submitOrder
|
let saveServerHand = apiService.submitOrder
|
||||||
if(this.isEdit) { }
|
if(this.isEdit) { }
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
import { dealBtnMap } from "@/common/enum"
|
import { dealBtnMap } from "@/common/enum"
|
||||||
import { USERKEY } from "@/store/actionKey"
|
import { USERKEY } from "@/store/actionKey"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { goLogin } from "@/common/loginHandle"
|
import { goLogin } from "@/common/componentEventHandle"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
} from "@/session"
|
} from "@/session"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { goto } from "@/common/untool"
|
import { goto } from "@/common/untool"
|
||||||
import { goLogin } from "@/common/loginHandle"
|
import { goLogin } from "@/common/componentEventHandle"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
state: {
|
state: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user