2025年最新获取所有指定微信小程序的appid和path路径的方法


标签: 微信小程序、AppID、Path路径、获取方法


前言:

有时候,开发者需要快速获取别的微信小程序的 AppID 和 Path 路径,尤其是当你在调试做一些自动化页面跳转或者是快捷方式时,知道这些信息非常重要。前几天,我就在做一个小程序项目的时候遇到了这个需求。虽然手动查找AppID和Path路径有点麻烦,但我发现了一个超简单的办法并写好了代码,今天就来分享给大家。

步骤解析:

第一步:进入需要获取的小程序页面

首先,打开你需要获取 AppID 和 Path 路径的小程序页面,确保页面内容是你想要获取的。

第二步:点击右上角的三个点

在这里插入图片描述

在小程序页面右上角,有三个小点的图标,点击它。

第三步:点击选择“收藏”

弹出的选项中,选择“收藏”这个功能。通过这个步骤,你可以将当前小程序页面收藏到你的微信里。

第四步:使用绿泡泡搜索

在这里插入图片描述

接下来,打开“绿泡泡”的搜索框,在搜索框中输入“代码简单说”并关注。

第五步:进入“代码简单说”并选择“+号”

<template> <view class="bg-content"> <z-paging ref="paging1" v-model="dataList" @query="queryList"> <view slot="top"> <view class="tablesChange"> <view class="tables"> <u-tabs :list="tabsList4" @click="clickTabFn" :scrollable="true" lineColor="#FF6400" :activeStyle="{color: '#303133',fontWeight: 600,transform: 'scale(1.05)',fontSize: '31rpx'}" :inactiveStyle="{color: '#606266',fontWeight:500,transform: 'scale(1)',fontSize: '31rpx'}" itemStyle="padding-left: 30rpx; padding-right: 30rpx; height: 80rpx;"> </u-tabs> </view> </view> </view> <!-- <view class="my-evaluate f-jcsb f-a-i" @click="navMyevaluateFn" v-if="actTab==3"> <view class="f-a-i"> <u-icon type="eye" size="20" color="#fff"></u-icon> <u-icon name="chat" color="#999" size="18"></u-icon> 我的评价 </view> <view> <u-icon name="arrow-right" color="#999" size="18"></u-icon> </view> </view> --> <view> <view @click="jump()" class="list-cont" v-for="(item,index) in dataList" :key="index" > <canvas style="width:220rpx;height:86rpx;" canvas-id="colorCanvas"></canvas> <view class="top-flex"> <text class="grayfont">2025-7-10 11:29:15</text> <text style="font-weight: 500;">待支付</text> </view> <view class="main"> <image src="/static/images/tabbar/showroom_active.png" mode=""></image> <view class="main-msg"> <text class="font">东风风行E702022款500超享版</text> <view class="car-money"> <text class="blue-font">¥<text style="padding-right: 10rpx;">210000</text>元</text> </view> <view class="profit-estimate"> <text class="profit-label">预估可赚</text> <text class="profit-value">30000元</text> </view> </view> </view> <view class="main-bto"> <text>车辆限:1内</text> <text>公里数:1.78万公里</text> <text>使用性质:营运</text> </view> </view> </view> </z-paging> </view> </template> <script> import { tabsList4 } from "@/data/tabsData2.js" export default { data() { return { tabsList4, actTab: -1, dataList: [], buttStyle: { width: '160rpx', height: '56rpx', marginLeft: '16rpx' }, imageUrl: 'https://cbl.diyouzhijia.com/static/images/ygctzmp/home/backgroundHeader.png', dominantColor: '', topUpTypeShow: false, topUpType: 'ye', payPrice: 0, payData: { from: "", orderNo: "", payChannel: "yue", payType: "yue", scene: 0 } }; }, onLoad(){ this.getImageColor() }, methods: { // 加载图片时获取背景? async getImageColor() { try { // 1. 确保使用正确的Canvas上下文 const canvasId = 'colorCanvas'; const ctx = uni.createCanvasContext(canvasId, this); // 2. 等待图片加载完成 await new Promise((resolve, reject) => { const img = new Image(); img.onload = () => resolve(img); img.onerror = reject; img.src = this.imageUrl; }); // 3. 绘制图片(使用明确尺寸) ctx.drawImage(this.imageUrl, 0, 0, 100, 100); // 4. 必须使用 draw(true) 同步绘制 await new Promise(resolve => ctx.draw(true, resolve)); // 5. 获取像素数据 const res = await new Promise((resolve, reject) => { uni.canvasGetImageData({ canvasId, x: 0, y: 0, width: 1, height: 1, success: resolve, fail: reject }); }); // 6. 提取颜色(注意微信小程序返回的data是Uint8ClampedArray) const pixelData = res.data || []; const [r, g, b] = pixelData.slice(0, 3); this.dominantColor = `rgb(${r}, ${g}, ${b})`; console.log('成功获取主色调:', this.dominantColor); } catch (err) { console.error('颜色分析失败:', err); this.dominantColor = 'rgb(255,255,255)'; // 默认白色 } }, jump(){ uni.navigateTo({ url:'/pagesB/home/publish' }) }, topUpTypeClose() { this.topUpTypeShow = false }, // 去支付 //详情 navParticularFn(item) { uni.navigateTo({ url:'/pagesA/showroom/newPayOrder/detalorder?orderId='+item.id }) }, clickTabFn(tab) { this.actTab = tab.value this.$refs.paging1.refresh(); }, //订单列表 queryList(pageNo, pageSize) { // 此处请求仅为演示,请替换为自己项目中的请求 let obj = { page: pageNo, limit: pageSize, type: this.actTab } let arr=[ { name:'1', value:'2' }, { name:'2', value:'3' } ] this.$refs.paging1.complete(arr); // getInformationOrderList(obj).then(res => { // this.$refs.paging.complete(res.data.list); // }) }, }, onShow() { if (this.$refs.paging1) { this.$refs.paging1.refresh(); } } } </script> <style lang="scss" scoped> .bg-content { min-height: 100vh; background: #F6F7FB; } .order-list-butt { width: 100%; padding: 0 24rpx; .order-list-butt-go { width: 120rpx; font-size: 24rpx; font-weight: 400; color: #999999; image { width: 48rpx; height: 48rpx; } } .order-list-butt-refund { padding: 16rpx 24rpx; font-size: 24rpx; font-weight: 400; color: #111111; background: #F5F5F5; margin-top: 16rpx; } } .user-data { padding: 24rpx 24rpx 0 24rpx; .user-data-image { width: 48rpx; height: 48rpx; border-radius: 50%; background: #f5f5f5; image { width: 100%; height: 100%; } } .user-data-name { font-size: 28rpx; font-weight: 400; color: #000000; margin-left: 16rpx; } .user-data-state { font-size: 24rpx; font-weight: bold; color: #FF6400; } } .car-rental { width: calc(100% - 48rpx); margin: 24rpx 24rpx 0 24rpx; padding-bottom: 24rpx; border-bottom: 1rpx solid #eee; .car-rental-cont { height: 150rpx; width: calc(100% - 218rpx); margin-left: 16rpx; display: flex; flex-direction: column; justify-content: space-around; .car-rental-cont-name { font-size: 32rpx; font-weight: 400; color: #111111; } .car-rental-cont-price { font-size: 32rpx; font-weight: bold; color: #111111; } .car-rental-cont-total-payment { font-size: 24rpx; font-weight: 400; color: #666666; } } image { width: 202rpx; height: 150rpx; } } .list-cont { // width: calc(100% - 30rpx); margin: 24rpx; background: #fff; border-radius: 8rpx; padding-bottom: 24rpx; // border: 1px solid red; padding: 30rpx; .top-flex{ display: flex; width: 100%; padding-bottom: 26rpx; justify-content: space-between; align-items: center; border-bottom: 1px solid #DBDBDB; text{ font-size: 28rpx; color: #2F74FA; font-weight: 500; } .grayfont{ color: #666666; font-size: 28rpx; } } .main-bto{ display: flex; width: 100%; align-items: center; justify-content: space-between; color: #666666; font-size: 24rpx; text{ padding-top: 30rpx; } } .main{ display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #DBDBDB; padding-bottom: 30rpx; margin-top: 30rpx; image{ width: 259rpx; height: 180rpx; border-radius: 10rpx; } .main-msg{ flex: 1; height: 100%; margin-left: 30rpx; display: flex; flex-direction: column; justify-content: space-between; .car-money{ margin-top: 10rpx; .blue-font{ color: #FF6400; font-size: 24rpx; text{ font-size: 36rpx; } } } // .bg-money{ // width: 100%; // height: 44rpx; // margin-top: 10rpx; // font-size: 24rpx; // font-weight: 500; // color: white; // line-height: 44rpx; // // border: 1px solid #3E80F5; // background: url('https://cbl.diyouzhijia.com/static/images/ygcmp/home/yugu.png') no-repeat; // background-size: 100% 100%; // } .profit-estimate { display: flex; align-items: center; width: 100%; height: 48rpx; margin-top: 10rpx; // margin-bottom: 30rpx; color: white; background: url('https://cbl.diyouzhijia.com/static/images/ygcmp/home/yugu.png') no-repeat; background-size: 100% 100%; .profit-label { color: #ffffff; font-weight: 700; font-size: 24rpx; margin: 0 31rpx 0 13rpx; } .profit-value { flex: 1; text-align: center; font-weight: 700; color: #2f74fa; font-size: 32rpx; } } .font{ color: #333333; font-size: 28rpx; // margin-top: 10rpx; font-weight: 500; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; /* 限制显示的行数 */ overflow: hidden; text-overflow: ellipsis; } } } } .tab-list { background: #fff; overflow: auto; view { width: 88rpx; padding-bottom: 12rpx; border-bottom: 6rpx solid transparent; font-size: 29rpx; font-weight: bold; display: inline-block; color: #555555; text-align: center; } .act-tab { border-bottom: 6rpx solid #000; font-size: 29rpx; font-weight: bold; color: #222222; } } .act-flaf { width: calc(100% - 56rpx); margin-left: 24rpx; } .circle { width: 30rpx; height: 30rpx; border-radius: 50%; border: 2rpx solid #D7D7D7; } .my-evaluate { background: #fff; padding: 16rpx 24rpx; width: calc(100% - 48rpx); margin: 24rpx; border-radius: 8rpx; } .tablesChange{ // padding: 0px 30rpx; .tables{ background-color: white; // border-radius: ; border-radius: 20rpx 20rpx 0px 0px; padding: 30rpx 20rpx; padding-bottom: 0px; } } </style>上面代码中颜色分析失败: ReferenceError: Image is not defined报错;帮我写出完整可以用的getImageColor函数里的方法
最新发布
07-24
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

代码简单说

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值