
父页面
<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);