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);
相关推荐
程序员猫哥_几秒前
HTML 生成网页工具推荐:从手写代码到 AI 自动生成网页的进化路径
前端·人工智能·html
龙飞051 分钟前
Systemd -systemctl - journalctl 速查表:服务管理 + 日志排障
linux·运维·前端·chrome·systemctl·journalctl
2501_915106325 分钟前
使用 Sniffmaster TCP 抓包和 Wireshark 网络分析
网络协议·tcp/ip·ios·小程序·uni-app·wireshark·iphone
我爱加班、、7 分钟前
Websocket能携带token过去后端吗
前端·后端·websocket
AAA阿giao7 分钟前
从零拆解一个 React + TypeScript 的 TodoList:模块化、数据流与工程实践
前端·react.js·ui·typescript·前端框架
杨超越luckly13 分钟前
HTML应用指南:利用GET请求获取中国500强企业名单,揭秘企业增长、分化与转型的新常态
前端·数据库·html·可视化·中国500强
hedley(●'◡'●)42 分钟前
基于cesium和vue的大疆司空模仿程序
前端·javascript·vue.js·python·typescript·无人机
qq5_81151751544 分钟前
web城乡居民基本医疗信息管理系统信息管理系统源码-SpringBoot后端+Vue前端+MySQL【可直接运行】
前端·vue.js·spring boot
百思可瑞教育1 小时前
构建自己的Vue UI组件库:从设计到发布
前端·javascript·vue.js·ui·百思可瑞教育·北京百思教育
百锦再1 小时前
Vue高阶知识:利用 defineModel 特性开发搜索组件组合
前端·vue.js·学习·flutter·typescript·前端框架