背景图设置
This commit is contained in:
@@ -11,15 +11,19 @@
|
||||
onLoad((e) => {
|
||||
res_.value = JSON.parse(decodeURIComponent(e.res))
|
||||
console.log(res_.value)
|
||||
console.log(store.bgList)
|
||||
if(store.bgList.length>0) {
|
||||
bg_imgs.value = store.bgList
|
||||
}
|
||||
randomFunc()
|
||||
})
|
||||
// 变量
|
||||
const res_ = ref(null)
|
||||
const userInfo = ref(null)
|
||||
const bg_imgs = ref([
|
||||
'/static/result1.jpg',
|
||||
'/static/result2.jpg',
|
||||
'/static/result3.jpg',
|
||||
{url:'/static/result1.jpg'},
|
||||
{url:'/static/result2.jpg'},
|
||||
{url:'/static/result3.jpg'},
|
||||
])
|
||||
const bg_index = ref(0)
|
||||
const avatarUrl = ref(null)
|
||||
@@ -29,7 +33,8 @@
|
||||
function randomFunc() {
|
||||
bg_index.value = parseInt((Math.random()*3))
|
||||
uni.getImageInfo({
|
||||
src:bg_imgs.value[bg_index.value],
|
||||
// src:bg_imgs.value[bg_index.value],
|
||||
src:bg_imgs.value[bg_index.value].url,
|
||||
success:function(res) {
|
||||
avatarUrl.value = uni.getStorageSync('avatarUrl')
|
||||
info.value.left = res_.value.leftEyeVision
|
||||
@@ -49,7 +54,7 @@
|
||||
</view> -->
|
||||
<view class="actionBox">
|
||||
<view class="img-box">
|
||||
<image style="width: 100%;" :src="bg_imgs[bg_index]" mode="widthFix"></image>
|
||||
<image style="width: 100%;" :src="bg_imgs[bg_index].url" mode="widthFix"></image>
|
||||
<view v-if="show_" class="avatar-box">
|
||||
<image :src="avatarUrl" mode="widthFix"></image>
|
||||
</view>
|
||||
|
@@ -56,21 +56,28 @@
|
||||
duration:2000
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
function toResult(params) {
|
||||
console.log(params)
|
||||
uni.redirectTo({
|
||||
url:"/pages/index/result?res="+encodeURIComponent(JSON.stringify(params))
|
||||
})
|
||||
}
|
||||
// encodeURIComponent(JSON.stringify(params))
|
||||
</script>
|
||||
<template>
|
||||
<view class="visinoListBox page-box">
|
||||
<view class="vl-item-box" v-if="list.length > 0">
|
||||
<view class="vl-item" v-for="(item,i) in list">
|
||||
<view class="vl-item" v-for="(item,i) in list" @tap="toResult(item)">
|
||||
<view class="vl-title">{{util.timestampToDate(item.CreatedAt)}}</view>
|
||||
<view class="vl-row-box">
|
||||
<view class="vl-row">
|
||||
<view class="vlr-left">右眼</view>
|
||||
<view class="vlr-left">{{item.rightEyeVision}}</view>
|
||||
<view class="vlr-right">{{item.rightEyeVision}}</view>
|
||||
</view>
|
||||
<view class="vl-row">
|
||||
<view class="vlr-left">左眼</view>
|
||||
<view class="vlr-left">{{item.leftEyeVision}}</view>
|
||||
<view class="vlr-right">{{item.leftEyeVision}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -83,15 +90,23 @@
|
||||
.vl-item-box{
|
||||
padding: 20rpx;
|
||||
.vl-item{
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx;
|
||||
/* border: 1px solid #eaeaea; */
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 5px 5px 5px #f3f3f3;
|
||||
.vl-title{
|
||||
border-left: 4rpx solid red;
|
||||
border-left: 10rpx solid #26758d;
|
||||
padding-left: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.vl-row-box{
|
||||
.vl-row{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.vlr-left{
|
||||
|
||||
margin-right:20rpx
|
||||
;color: gray;
|
||||
}
|
||||
.vlr-right{
|
||||
margin-left: 20rpx;
|
||||
|
Reference in New Issue
Block a user