diff --git a/src/api/https/merchant.ts b/src/api/https/merchant.ts index caafe4b..b92077d 100644 --- a/src/api/https/merchant.ts +++ b/src/api/https/merchant.ts @@ -47,7 +47,7 @@ const merchant = { * @param {object} params 请求参数 storeID int 门店ID vendorID int 厂商ID */ update_store_vendor_map: async (params: AnyObject): Promise => { - return await request.api('v2/store/UpdateStoreVendorMap','PUT',params) + return await request.api('/v2/store/UpdateStoreVendorMap','PUT',params) }, diff --git a/src/manifest.json b/src/manifest.json index 67b2657..4bb803f 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name" : "京西菜市商家版", "appid" : "__UNI__F9A47D3", "description" : "1、商户通过京西平台同时管理美团、饿了么、京东等多个外卖平台实现一键上架、下架、修改、删除多个平台商品;2、商户通过京西平台可以同时对、美团专送、达达、顺丰同城等多个专送平台召唤偶骑手", - "versionName" : "1.8.51", - "versionCode" : 1851, + "versionName" : "1.8.52", + "versionCode" : 1852, "transformPx" : false, "uni-app" : { "debug" : true diff --git a/src/pages/goods-manager/childPages/right-main/right-main.vue b/src/pages/goods-manager/childPages/right-main/right-main.vue index 2aaf445..f103628 100644 --- a/src/pages/goods-manager/childPages/right-main/right-main.vue +++ b/src/pages/goods-manager/childPages/right-main/right-main.vue @@ -70,8 +70,7 @@ (sku.mtwmSyncStatus & 2) !== 2 && (sku.mtwmSyncStatus & 4) !== 4 " - >美团:该商品无法修改价格,请联系运营修改 + >美团:该商品无法修改价格,请联系运营修改 若退款造成的损失较大,建议联系顾客,自行上门取回退货。 - 驳回 - 同意 + 驳回 + 同意 @@ -75,7 +75,7 @@ - 查看详情 + 查看详情 diff --git a/src/pages/order-manager/childPages/component/orderListTop.vue b/src/pages/order-manager/childPages/component/orderListTop.vue index 1990db2..a3d7d8a 100644 --- a/src/pages/order-manager/childPages/component/orderListTop.vue +++ b/src/pages/order-manager/childPages/component/orderListTop.vue @@ -138,7 +138,7 @@ let props = defineProps() */ function connectUser(item:AnyObject) { if(item.vendorID === 1){ - if(store.getters['storeInfo/imMtStatus'][0].imStatus !== 1) return toast('美团IM状态已关闭', 1) + if(store.getters['storeInfo/imMtStatus'][0].imStatus !== 1) return toast('美团IM状态已关闭', 2) setStorage('vendorUserInfo',{ venderOrderID:item.vendorOrderID, // venderOrderID:0, @@ -224,7 +224,7 @@ const cancelTime = ref() const timer = ref() onShow(() => { if (props.item.lockStatus === -5) { - let { purchaseVendorInfo } = store.state.serveInfo.sysInfo as any + let { purchaseVendorInfo } = store.state.serveInfo.serviceInfo as any let { userApplyCancelWaitMinute } = purchaseVendorInfo[props.item.vendorID] let cancelTime1 = new Date(props.item.lockStatusTime).getTime() + diff --git a/src/pages/order-manager/childPages/pending-distribution/pending-distribution.vue b/src/pages/order-manager/childPages/pending-distribution/pending-distribution.vue index f1b321d..227a5d6 100644 --- a/src/pages/order-manager/childPages/pending-distribution/pending-distribution.vue +++ b/src/pages/order-manager/childPages/pending-distribution/pending-distribution.vue @@ -48,13 +48,14 @@ @@ -156,7 +157,8 @@ function inputTakeCode() { */ const takeCode = ref() // 自提码 function jxSelfTake(type: string) { - if (type != 'jx' && takeCode.value == '') return toast('请输入自提码') + // if (type != 'jx' && takeCode.value == '') return toast('请输入自提码') + if (takeCode.value == '') return toast('请输入自提码') uni.jxConfirm({ title: '自提订单', content: '是否完成自提(请确保用户已出示正确订单,以免引起不必要的损失)', @@ -164,7 +166,8 @@ function jxSelfTake(type: string) { let data = { vendorOrderID: props.item.vendorOrderID, vendorID: props.item.vendorID, - selfTakeCode: type === 'jx' ? '135246' : takeCode.value, + // selfTakeCode: type === 'jx' ? '135246' : takeCode.value, + selfTakeCode: takeCode.value, } let res = await order.confirm_self_take(data) if (res.code == 0) { diff --git a/src/subPages/merchantChild/setUp/setUp.ts b/src/subPages/merchantChild/setUp/setUp.ts index 8ad6ea7..0688683 100644 --- a/src/subPages/merchantChild/setUp/setUp.ts +++ b/src/subPages/merchantChild/setUp/setUp.ts @@ -22,6 +22,9 @@ function setUp() { // IM单聊状态是否开启-饿百 const imEbStoreStatus = ref(0) + // 门店是否可自提 + const isDeliverSelf = ref(false) + // 美团门店信息 const mtStoreInfo = ref({}) @@ -64,6 +67,7 @@ function setUp() { }) async function getStoreMsg() { // 读取vuex 中的 store 数据 + await store.dispatch('storeInfo/getOneStore', getStorage("storeID")) smsNotify.value = store.state.storeInfo.allStoreInfo.smsNotify printerDisabled.value = store.state.storeInfo.allStoreInfo.printerDisabled // 获取第三方美团门店 @@ -83,6 +87,9 @@ function setUp() { let ebStataus = store.state.storeInfo.imOnlineStatus.filter(item => item.vendorID === 3) imEbStoreStatus.value = ebStataus.length > 0 ? ebStataus[0].imStatus : 0 } + + let jxStore = store.state.storeInfo.allStoreInfo.StoreMaps.find((item: { vendorID: number }) => item.vendorID === 9) + if(jxStore && JSON.stringify(jxStore) !== '{}') isDeliverSelf.value = jxStore.deliverySelf === 1 } // 网络打印机 netPrinter.value = (store.state.serveInfo.serviceInfo as any).printerVendorInfo @@ -541,6 +548,20 @@ function setUp() { setStorage('defaultOrderReminder', orderReminder.value ? 1 : 0) } + + /*************************************************** + * 修改自提的类型 + */ + async function switchJxDeliverySelf(e:AnyObject) { + let res = await merchant.update_store_vendor_map({ + storeID:getStorage('storeID'), + vendorID:9, + payload:JSON.stringify({ + deliverySelf:e.detail.value ? 1 : 0 + }) + }) + } + return { copyRight, // 京西版权信息 smsNotifyData, // 未拣货选项 @@ -560,6 +581,8 @@ function setUp() { switchprinterDisabled, // 网络打印机禁用开关, imMtStoreStatus, // IM单聊状态是否开启 imEbStoreStatus, // IM单聊状态是否开启 饿百 + isDeliverSelf, // 京西 + switchJxDeliverySelf, // 切换自送 switchImMtStoreStatus, // 更改IM单聊门店状态 isExistMtStore, // 是否绑定美团门店 isExistEbStore, // 是否绑定饿百门店 diff --git a/src/subPages/merchantChild/setUp/setUp.vue b/src/subPages/merchantChild/setUp/setUp.vue index 164253f..e566d87 100644 --- a/src/subPages/merchantChild/setUp/setUp.vue +++ b/src/subPages/merchantChild/setUp/setUp.vue @@ -173,6 +173,15 @@ 营业时间设置 + + 自提(仅京西) + + 发票设置(淘宝闪购) @@ -254,6 +263,8 @@ const { switchprinterDisabled, // 网络打印机禁用开关 imMtStoreStatus, // IM单聊状态是否开启 imEbStoreStatus, // IM单聊状态是否开启 饿百 + isDeliverSelf, // 京西 + switchJxDeliverySelf, // 切换自送 switchImMtStoreStatus, // 更改IM单聊门店状态 isExistMtStore, // 是否绑定美团门店 isExistEbStore, // 是否绑定饿百门店 diff --git a/src/subPages/messageChild/msgChat/msgChat.ts b/src/subPages/messageChild/msgChat/msgChat.ts index a3314c2..7b82778 100644 --- a/src/subPages/messageChild/msgChat/msgChat.ts +++ b/src/subPages/messageChild/msgChat/msgChat.ts @@ -35,6 +35,7 @@ const msgChatFn = function () { */ let useData: AnyObject = {} let ebStore: AnyObject = {} + let jdStore: AnyObject = {} onLoad((potion: any) => { let res:any = getStorage('vendorUserInfo') if(JSON.stringify(potion) === '{}') { @@ -49,14 +50,15 @@ const msgChatFn = function () { let useInfo: AnyObject = JSON.parse(potion.data) useData = useInfo } - if (store.state.storeInfo.allStoreInfo.StoreMaps && store.state.storeInfo.allStoreInfo.StoreMaps.length > 0) ebStore = store.state.storeInfo.allStoreInfo.StoreMaps.find((item: { vendorID: number }) => item.vendorID === 3) // 淘宝闪购 + if (store.state.storeInfo.allStoreInfo.StoreMaps && store.state.storeInfo.allStoreInfo.StoreMaps.length > 0) ebStore = store.state.storeInfo.allStoreInfo.StoreMaps.find((item: { vendorID: number }) => item.vendorID === 3) // 饿百 + if (store.state.storeInfo.allStoreInfo.StoreMaps && store.state.storeInfo.allStoreInfo.StoreMaps.length > 0) jdStore = store.state.storeInfo.allStoreInfo.StoreMaps.find((item: { vendorID: number }) => item.vendorID === 0) // 京东 // 修改标题 uni.setNavigationBarTitle({ title: useData.vendorID == 1 ? `【美团${useData.orderDesc}】${useData.userID === '0' ? '群发消息' : useData.userID}` - : `【淘宝闪购】${useData.userID}`, + : `【饿了么】${useData.userID}`, }) // 获取聊天数据 @@ -74,8 +76,8 @@ const msgChatFn = function () { async function SetMsgRead() { let venderIDInfo = store.state.storeInfo.vendorStoreIDS let data = { - appID: useData.vendorID === 1 ? venderIDInfo.appID : ebStore.vendorOrgCode, - vendorStoreID: useData.vendorID === 1 ? venderIDInfo.MT : ebStore.vendorStoreID, + appID: useData.vendorID === 1 ? venderIDInfo.appID : useData.vendorID === 3 ? ebStore.vendorOrgCode : jdStore.vendorOrgCode, + vendorStoreID: useData.vendorID === 1 ? venderIDInfo.MT : useData.vendorID === 3 ? ebStore.vendorStoreID : jdStore.vendorStoreID, vendorID: "" + useData.vendorID, orderID: "" + useData.orderID ? useData.orderID : '0', userID: useData.userID @@ -92,9 +94,9 @@ const msgChatFn = function () { let venderIDInfo = store.state.storeInfo.vendorStoreIDS let data = { payLoad: JSON.stringify([{ - vendorStoreID: useData.vendorID === 1 ? venderIDInfo.MT : ebStore.vendorStoreID, + vendorStoreID: useData.vendorID === 1 ? venderIDInfo.MT : useData.vendorID === 3 ? ebStore.vendorStoreID : jdStore.vendorStoreID, vendorID: "" + useData.vendorID, - appID: useData.vendorID === 1 ? venderIDInfo.appID : ebStore.vendorOrgCode, + appID: useData.vendorID === 1 ? venderIDInfo.appID : useData.vendorID === 3 ? ebStore.vendorOrgCode : jdStore.vendorOrgCode, userID: useData.userID }]) } @@ -108,7 +110,7 @@ const msgChatFn = function () { let newMsg = res.data[`${venderIDInfo.appID}:${venderIDInfo.MT}:${useData.vendorID}:${useData.userID}`] || [] newMsg.forEach((element: any) => { let resData = jxParse(element) - let msg_content = resData.msgContent.msg_type == 1 ? analyEmoji(Decrypt(resData.msgContent.msg_content, platformID.value)) : Decrypt(resData.msgContent.msg_content, platformID.value) + let msg_content = resData.msgContent.msg_type == 1 || resData.msgContent.msg_type == 11 ? analyEmoji(Decrypt(resData.msgContent.msg_content, platformID.value)) : Decrypt(resData.msgContent.msg_content, platformID.value) if (resData.msgContent.msg_type == 4) msg_content = resData.msgContent.app_spu_codes // 商品skuid if (resData.msgContent != undefined) { let msgList = { @@ -121,7 +123,7 @@ const msgChatFn = function () { newArr.push(msgList) } }) - } else { + } else if(useData.vendorID === 3){ // 饿百 let newMsg = res.data[`${ebStore.vendorOrgCode}:${ebStore.vendorStoreID}:${useData.vendorID}:${useData.userID}`] || [] newMsg.map((element: any, index: number) => { @@ -162,6 +164,25 @@ const msgChatFn = function () { newArr.push(msgList) } }) + }else if(useData.vendorID === 0){ + let newMsg = res.data[`${jdStore.vendorOrgCode}:${jdStore.vendorStoreID}:${useData.vendorID}:${useData.userID}`] || [] + newMsg.forEach((element:string) => { + let resData = jxParse(element) + if(resData.msgContent){ + let msg = JSON.parse(resData.msgContent.extendJsonData) + let content = msg.body.type === 'text' ? msg.body.content : msg.body.type === 'image' ? msg.body.url : msg.body.content + // console.log(msg,'msg','获取聊天详情,resData',resData,'useData',useData.userID) + + let msgList = { + sendType:'jd', + ...msg, + msg_content: msg.body.type === 'text' ? analyEmoji(content) : msg.body.type === 'image' ? content : '未知' , + msg_source: useData.userID === msg.from.pin ? 2 : 1, // 目前全是客户发的消息 + msg_type: msg.body.type === 'text' ? 1 : msg.body.type === 'image' ? 2 : 99 // 目前只支持文本消息 + } + newArr.push(msgList) + } + }) } chatData.value = newArr @@ -355,11 +376,11 @@ const msgChatFn = function () { * 发送数据 */ async function sendClick(msgData: AnyObject) { - let venderIDInfo = useData.vendorID === 1 ? store.state.storeInfo.vendorStoreIDS : ebStore.vendorOrgCode + let venderIDInfo = useData.vendorID === 1 ? store.state.storeInfo.vendorStoreIDS : useData.vendorID === 3 ? ebStore.vendorOrgCode : jdStore.vendorOrgCode let data = { - sendType: useData.vendorID === 1 ? "mt" : "elm", - app_id: useData.vendorID === 1 ? venderIDInfo.appID : ebStore.vendorOrgCode, - app_poi_code: useData.vendorID === 1 ? venderIDInfo.MT : ebStore.vendorStoreID, + sendType: useData.vendorID === 1 ? "mt" : useData.vendorID === 3 ? "elm" : 'jd', + app_id: useData.vendorID === 1 ? venderIDInfo.appID : useData.vendorID === 3 ? ebStore.vendorOrgCode : jdStore.vendorOrgCode, + app_poi_code: useData.vendorID === 1 ? venderIDInfo.MT : useData.vendorID === 3 ? ebStore.vendorStoreID : jdStore.vendorStoreID, cts: Math.round(new Date().getTime() / 1000).toString(), msg_content: msgData.type === 1 ? analyEmoji(msgData.msg) : msgData.msg, msg_id: Math.round(new Date().getTime()).toString(), @@ -396,7 +417,7 @@ const msgChatFn = function () { } }) } - } else { + } else if(useData.vendorID === 3){ let chatDataItem = chatData.value.filter(item => item.msg_source === 2) sendMsg = { platformShopId: chatDataItem[0].platformShopId, @@ -426,6 +447,44 @@ const msgChatFn = function () { data: { ...sendMsg } }) } + }else if(useData.vendorID === 0){ + sendMsg = { + vendorOrgCode: jdStore.vendorOrgCode, + sendData:JSON.stringify({ + vendorID: 0, + storeId:jdStore.storeID, + data:{ + id: '' + Math.round(new Date().getTime()).toString() + 184572 , // uuid //随机生成一个字符串 + lang: "zh_CN", + type: "chat_message", + from: { + pin:chatData.value[0].to.pin, + app:'im.waiter', // 固定不变 + clientType:'android' + }, + to: { + pin:chatData.value[0].from.pin, + app:'im.customer', // 固定不变 + }, + body: { + type:msgData.type === 1 ? "text" : "image", // 消息类型 + content:msgData.msg, + chatinfo:{ + venderId:chatData.value[0].body.chatinfo.venderId, + askAllocateType:chatData.value[0].body.chatinfo.askAllocateType, + sid:chatData.value[0].body.chatinfo.sid, + source:chatData.value[0].body.chatinfo.source + }, + template:{ + source:'dd_msg_583984a984834b1889f853be6e449f39_e66c448b9fbe4704901925d3217081a3' // 文本固定不变 //卡片类消息必传 + }, + mt:60, + }, + timestamp:new Date().getTime(), // 时间戳 + clientTime:new Date().getTime() // 客户端时间 + } + }) + } } let res = await message.send_to_vendor(sendMsg) diff --git a/src/subPages/messageChild/msgChat/msgChatChild/chat-item.vue b/src/subPages/messageChild/msgChat/msgChatChild/chat-item.vue index b328e0c..5610c5b 100644 --- a/src/subPages/messageChild/msgChat/msgChatChild/chat-item.vue +++ b/src/subPages/messageChild/msgChat/msgChatChild/chat-item.vue @@ -81,6 +81,19 @@ /> + + + + + 若退款造成的损失较大,建议联系顾客,自行上门取回退货。 - 驳回 - 同意 + 驳回 + 同意 diff --git a/src/subPages/orderChild/getPhone/getPhone.vue b/src/subPages/orderChild/getPhone/getPhone.vue index a0e1296..d07952a 100644 --- a/src/subPages/orderChild/getPhone/getPhone.vue +++ b/src/subPages/orderChild/getPhone/getPhone.vue @@ -39,7 +39,6 @@ const phoneList = ref>([ mobild: phoneData.operatorPhone2, }, { - // icon: 'https://image.jxc4.com/image/8ac4b05dfef6b18639489d32cd421551.png', icon: 'https://image.jxc4.com/image/06a27a6503a6695824bf361ded5f1d45.png', company: '淘宝闪购运营', name: phoneData.operatorName3 || '暂无', diff --git a/src/subPages/orderChild/orderDetail/orderDetail.ts b/src/subPages/orderChild/orderDetail/orderDetail.ts index 02e5cdc..7f279ef 100644 --- a/src/subPages/orderChild/orderDetail/orderDetail.ts +++ b/src/subPages/orderChild/orderDetail/orderDetail.ts @@ -224,7 +224,7 @@ function orderDetailFn() { */ function realMobile() { if(orderData.value.vendorID === 1){ - if(store.getters['storeInfo/imMtStatus'][0].imStatus !== 1) return toast('美团IM状态已关闭', 1) + if(store.getters['storeInfo/imMtStatus'][0].imStatus !== 1) return toast('美团IM状态已关闭', 2) setStorage('vendorUserInfo',{ venderOrderID:orderData.value.vendorOrderID, orderSeq:orderData.value.orderSeq, diff --git a/src/subPages/shoppingChild/createGoods/createGoodsChild/right-main/right-main.ts b/src/subPages/shoppingChild/createGoods/createGoodsChild/right-main/right-main.ts index 6956ec6..cc11226 100644 --- a/src/subPages/shoppingChild/createGoods/createGoodsChild/right-main/right-main.ts +++ b/src/subPages/shoppingChild/createGoods/createGoodsChild/right-main/right-main.ts @@ -58,6 +58,7 @@ function rightMainFn(props: any, emit: any) { if (item.storeSkuStatus) { skus.push({ skuID: item.id, + stock:20, // 默认20个库存 isSale: 1 }) }