uniapp 页面标签 传值 ————— uniapp 定义 接口

父页面

复制代码
<template>
	<view style="margin: 0;height: 100vh;overflow: hidden;">
	
			<scroll-view scroll-y="true" @scrolltolower="scrollToLower"
				:style="'height:calc(100vh - '+(fixedHeigth+navBarHeight+20)+'px);'">
			
				<view class="menu">
				<view 
				  class="item" 
				  v-for="(item, index) in sampleList" 
				  :key="index"
				@click="toPage('/subPackages/association/pages/association/followshotadd?image='+item.sampleImage+'&id='+item.id)"
				>
				    
				  
			</scroll-view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
	
		methods: {
		
		toPage(item) { 
		  uni.navigateTo({ url: item });  
		}


		}
	}
</script>

子页面

复制代码
<template>
	<view style="margin: 0;height: 100vh;overflow: hidden;">
		{{this.receivedImage}}{{this.receivedId}}
	</view>
</template>

<script>
	export default {
		data() {
			return {
				receivedId:[],
				receivedImage: [],
			}
		},
	
// 初始化  接受页面穿过来的数据
		onLoad(options) {
			// 获取上一个页面带来的数据 
			if (options.image) {
				this.receivedImage = options.image.split(',')
				// console.log('接收到的图片参数:', this.receivedImage)
			}

			if (options.id) {
				this.receivedId = options.id;
				console.log(this.receivedId, 'receivedId')
			}
			
		},
		computed: {},
		
	}
</script>

uniapp 定义 接口

复制代码
<!-- uniapp  get  post接口 -->
<!-- 真实接口的数据链接  传值 传id 和 全部数据-->
let makeupDelete = (params = {}) => vm.$u.post(Vue.prototype.currshop.value+'/makeupArtist/delete?id='+params.id, params, normalHeader);
 
<!-- 真实接口的数据链接  传值 传id-->
let makeupDelete = (params = {}) => vm.$u.post(Vue.prototype.currshop.value+'/makeupArtist/delete?id='+params.id);
 
<!-- 真是接口的数据链接  传值 传全部-->
let getSampleSeriesList = (params = {}) => vm.$u.get(Vue.prototype.currshop.value+'/sample/getSampleSeriesList', params, 
normalHeader);
 
<!-- 模拟接口的数据链接 -->
let getSampleSeriesList = (params = {}) => vm.$u.get('http://localhost:8080/travelPhotography-shop/sample/getSampleSeriesList', params, normalHeader);
相关推荐
Championship.23.2411 小时前
Open Source Pipeline Skill深度解析:自动化开源贡献全流程
前端·javascript·html
Bigger11 小时前
🧠 前端岗位的"结构性调整":现象背后的冷思考
前端·程序员·ai编程
薯老板11 小时前
vue组件之间的通信
前端·vue.js
迪菲赫尔曼11 小时前
从 0 到 1 打造工业级推理控制台:UltraConsole(Ultralytics + FastAPI + React)开源啦!
前端·yolo·react.js·计算机视觉·开源·fastapi
万邦科技Lafite11 小时前
京东开放API接口:item_get返回参数指南
java·前端·javascript·api·电商开放平台
梦想CAD控件11 小时前
网页CAD协同设计平台-生产级在线实时协同CAD引擎
前端·javascript·架构
Highcharts.js11 小时前
React 开发实战:如何使用 useEffect 为 Highcharts 注入实时数据
前端·javascript·react.js·开发实战·实时数据·highcharts·轮询数据
陆枫Larry11 小时前
Vue Slot 到底在解决什么问题?
前端
梦想很大很大11 小时前
让 AI 成为“报表配置员”:BI 低代码平台的 Schema 实践路径
前端·人工智能·低代码
用户0595401744611 小时前
asyncio 踩坑实录:这个问题坑了我3小时,差点让线上服务崩掉
前端·css