From 8084522158f21c1ada6fad2e6adcf83d8d073726 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 29 Apr 2024 23:05:04 +0800 Subject: [PATCH] add --- App.vue | 21 +- api/user.js | 7 + pages/gather/gather.vue | 18 +- pages/index/index.vue | 46 +- pages/index/subnvue/concat.nvue | 31 +- pages/store/settled/index.vue | 1854 ++++++++++++++++++++++++++++++- utils/uniMP.js | 244 ++-- utils/uniMPevent.js | 23 +- 8 files changed, 2051 insertions(+), 193 deletions(-) diff --git a/App.vue b/App.vue index 3705ce8..5f67ab3 100644 --- a/App.vue +++ b/App.vue @@ -13,6 +13,7 @@ initEvent } from "@/utils/uniMPevent.js"; let jpushModule = uni.requireNativePlugin("JG-JPush"); + import uniMP from '@/utils/uniMP.js'; // #endif import { checkLogin @@ -130,9 +131,7 @@ let messageID = result.messageID let title = result.title let content = result.content - let extras = result.extras - - console.log("通知", result) + let extras = result.extras.type if (result.extras.type == 'ORDER_CREATE' && result.extras.mp3.length > 0) { if (result.extras.mp3[0] == '微信') this.audioTeam.push('/static/audio/wechat.MP3') @@ -166,9 +165,19 @@ } // 点击事件 if (notificationEventType == 'notificationOpened') { - uni.navigateTo({ - url: result.extras.route - }) + if (result.extras.type == 2) { + let data = result.extras.group_data + data.type = 2 + uniMP.loadAppletMP(data) + + } else { + uni.navigateTo({ + url: result.extras.route + }) + + } + + } }) diff --git a/api/user.js b/api/user.js index 585f6b6..d0119f2 100644 --- a/api/user.js +++ b/api/user.js @@ -270,6 +270,13 @@ export function extractCash(data) { export function getAdminApplyAPI(merId, data) { return request.get(`admin/${merId}/apply`, data); } + +/** + * 新商户 + */ +export function isNewMer(uid, mer_id, data) { + return request.post(`auth/guide/${uid}/${mer_id}`, data); +} /** * 提现银行/提现最低金额 * diff --git a/pages/gather/gather.vue b/pages/gather/gather.vue index f7c86fa..c73835d 100644 --- a/pages/gather/gather.vue +++ b/pages/gather/gather.vue @@ -176,7 +176,7 @@ - + @@ -356,6 +356,17 @@ uni.$emit('showLoading', false); }, methods: { + test() { + let data = { + "name": "供销助农平台", + "app_id": "__UNI__1EE148C", + "pic": "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0fa43202312291702314919.png", + "url": "https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/457d9202404291733397921.wgt", + "version": "1.4.5" + } + uniMP.loadAppletMP(data) + + }, openDiver() { this.subNVue.show('zoom-out', 300) uni.$emit('diverGatherEmit', this.elInfo); @@ -440,7 +451,7 @@ this.initMenu(); this.showControllerAllLet(); }).catch(e => { - console.log(e); + // console.log(e); }) }, // 根据类型来判断是否显示 @@ -466,7 +477,7 @@ }) // if() if (uni.getStorageSync('is_new_user') && !now.length) now[0] = all[0]; - console.log(all, now) + // console.log(all, now) this.AllMenuList = all; this.nowMenuList = now; @@ -498,7 +509,6 @@ }, getUniMp(data) { let that = this; - // #ifdef APP-PLUS if (data.version) return uniMP.loadAppletMP(data); else switch (data.type) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 2927ced..c206e70 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -276,7 +276,8 @@ var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; let app = getApp(); import { - getUserInfo + getUserInfo, + isNewMer } from '@/api/user.js'; import { getDiy, @@ -597,9 +598,16 @@ }, // #endif onLoad(options) { - // #ifdef APP this.subNVue = uni.getSubNVueById('concatIndex') + uni.$on('diverIndexSubEmit', function(data) { + that.subNVue.hide('slide-out-right', 300) + setTimeout(() => { + uni.switchTab({ + url: '/pages/gather/gather' + }) + }, 400) + }) // #endif let that = this @@ -626,22 +634,27 @@ }, onShow() { let that = this; - if (this.diverFlag && uni.getStorageSync('is_new_user')) { - setTimeout(() => { - that.openDiver() - that.diverFlag = false - }, 500) - uni.$on('diverIndexSubEmit', function(data) { - console.log("收到关闭通知") - that.subNVue.hide('slide-out-right', 300) - setTimeout(() => { - uni.switchTab({ - url: '/pages/gather/gather' - }) - }, 400) - + // console.log() + if (this.$store.state.app.userInfo.service?.mer_id) { + isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id).then(res => { + if (res.data == 'true') { + this.openDiver() + } }) } + // if (this.$store.state.app.userInfo) { + // console.log(this.$store.state.app.userInfo.service?.mer_id, 'sdsd') + + // } + // isNewMer(this.$store) + + // if (this.diverFlag && uni.getStorageSync('is_new_user')) { + // setTimeout(() => { + // that.openDiver() + // that.diverFlag = false + // }, 500) + + // } that.isIntegral = uni.getStorageSync('isIntegral') // #ifdef APP-PLUS if (that.appUpdate.openUpgrade == '1') { @@ -685,6 +698,7 @@ }, 50) // #endif }, + methods: { openDiver() { this.subNVue.show('slide-in-left', 300) diff --git a/pages/index/subnvue/concat.nvue b/pages/index/subnvue/concat.nvue index ff2eecc..4dac274 100644 --- a/pages/index/subnvue/concat.nvue +++ b/pages/index/subnvue/concat.nvue @@ -6,39 +6,19 @@ 下一步(1/4) - - + 点击生产页面,进入办公助手 - - - - 点击生产页面,进入办公助手 - - - - + - - - - - + 工作台 - - - 工作台 - - - - - - + @@ -150,6 +130,9 @@ .pointe2 { position: absolute; + left: 420rpx; + transform: translateX(-50%); + /* left: 150rpx; */ } .tras { diff --git a/pages/store/settled/index.vue b/pages/store/settled/index.vue index ba62e3b..4862f3e 100644 --- a/pages/store/settled/index.vue +++ b/pages/store/settled/index.vue @@ -1,7 +1,7 @@ -