Commit 4df2577e by zhangzhen

细节优化

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