Commit 4df2577e by zhangzhen

细节优化

parent 415937b5
<template>
<view class="store-list">
<view class="flex-col" v-for="(val,i) in list" :key="i">
<view class="flex-col" v-for="(val,i) in list" :key="i" @tap.stop="onNavToHome(val)">
<view class="flex-row">
<view class="room-img-box">
<image :src="val.images[0]" mode="scaleToFill" @tap="onPreview(val)"></image>
<image :src="val.images[0]" mode="scaleToFill" @tap.stop="onPreview(val)"></image>
</view>
<view class="flex-1 part-right">
<view class="part-title">
......@@ -23,7 +23,7 @@
<view class="flex-between part-title">
<view class='cu-tag radius line-pink'>距离{{Number(val.distance).toFixed(2)}}km</view>
<view class="location">
<button class="cu-btn bg-blue" @tap.stop="onNavToHome(val)">去预定</button>
<button class="cu-btn bg-blue" >去预定</button>
</view>
</view>
</view>
......
......@@ -57,7 +57,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx0802dd3453f72cc9",
"appid" : "wxdd170b8783edf7a0",
"setting" : {
"urlCheck" : false,
"es6" : true,
......@@ -70,7 +70,7 @@
"desc" : "为您提供更精准的服务"
}
},
"requiredPrivateInfos" : [ "getLocation" ],
"requiredPrivateInfos" : [ "getLocation" ],
"uniStatistics" : {
"enable" : true
}
......
<template>
<view class="home" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd">
<f-navbar title="凑角" :isShowTransparentTitle="false" :isShowLeft="false" fontColor="#ffffff" :fontSize="46" bgColor="#e40583"
:scrollTop="scrollTop" navbarType='5'></f-navbar>
<f-navbar title="凑角" :isShowTransparentTitle="false" :isShowLeft="false" fontColor="#ffffff" :fontSize="46"
bgColor="#e40583" :scrollTop="scrollTop" navbarType='5'></f-navbar>
<scroll-view class="scroll-view" scroll-y="true" @scroll="onScroll">
<view class="content-box">
<view class="header-content"
......@@ -123,7 +123,7 @@
return {
scrollTop: 0,
storeId: '',
storeList:[],
storeList: [],
storeInfo: {},
statusBarHeight: this.statusBarHeight,
hostUrl: config.hostUrl,
......@@ -174,23 +174,19 @@
if (uni.getStorageSync("storeId") && this.storeList.length) {
this.storeId = uni.getStorageSync("storeId")
let obj = this.storeList.filter(item => item.id === this.storeId)[0]
console.log(obj,909090)
if (obj.roomVoList.length) {
this.storeInfo = {
...obj,
roomVoList: obj.roomVoList.map(item => {
return {
...item,
images: item.images ? item.images
.split(",").map(val => this.hostUrl + val) : []
}
})
}
this.$forceUpdate();
console.log(obj, 909090)
this.storeInfo = {
...obj,
roomVoList: obj.roomVoList.length ? obj.roomVoList.map(item => {
return {
...item,
images: item.images ? item.images
.split(",").map(val => this.hostUrl + val) : []
}
}) : []
}
console.log(this.storeInfo, 9999)
}else{
} else {
uni.showLoading({
title: "加载中"
})
......@@ -210,7 +206,7 @@
console.log(option, 909090)
},
methods: {
onScroll(e){
onScroll(e) {
this.scrollTop = e.target.scrollTop;
},
onLoading() {
......@@ -226,24 +222,19 @@
if (res.data.code == 200 && res.data.data.length) {
this.storeList = res.data.data;
let obj = {}
if (this.storeId) {
obj = res.data.data.filter(item => item.id === this.storeId)[0]
} else {
obj = res.data.data[0];
}
if (obj.roomVoList.length) {
this.storeInfo = {
...obj,
roomVoList: obj.roomVoList.map(item => {
return {
...item,
images: item.images ? item.images
.split(",").map(val => this.hostUrl + val) : []
}
})
obj = res.data.data[0];
this.storeInfo = {
...obj,
roomVoList: obj.roomVoList.map(item => {
return {
...item,
images: item.images ? item.images
.split(",").map(val => this.hostUrl + val) : []
}
})
}
}
}
})
},
......@@ -321,17 +312,20 @@
height: 100vh;
overflow-x: hidden;
}
.scroll-view{
position: relative;
width: 100vw;
height: 100%;
.content-box{
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
.scroll-view {
position: relative;
width: 100vw;
height: 100%;
.content-box {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
}
}
.header-content {
display: flex;
justify-content: center;
......@@ -345,6 +339,7 @@
margin-top: -16upx;
}
}
.store-nav {
position: relative;
display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment