Commit 3feb2fbf authored by 罗超's avatar 罗超

1

parent 0c587d2d
...@@ -349,7 +349,7 @@ export default { ...@@ -349,7 +349,7 @@ export default {
}; };
// console.log(app.serverUrl + '/login/' + res.authCode); // console.log(app.serverUrl + '/login/' + res.authCode);
// 调用自己的服务端接口,让服务端进行后端的授权认证 // 调用自己的服务端接口,让服务端进行后端的授权认证
// that.getBaseInfoAli(); that.getBaseInfoAli();
console.log(327, res); console.log(327, res);
that.getCodeAli(obj); that.getCodeAli(obj);
} }
...@@ -366,16 +366,16 @@ export default { ...@@ -366,16 +366,16 @@ export default {
my.getOpenUserInfo({ my.getOpenUserInfo({
success: (res) => { success: (res) => {
let userInfo = JSON.parse(res.response).response; // 以下方的报文格式解析两层 response let userInfo = JSON.parse(res.response).response; // 以下方的报文格式解析两层 response
console.log(res, userInfo); console.log(369, res, userInfo);
}, },
}); });
}, },
//调用获取code //调用获取code
getCodeAli(obj) { getCodeAli(obj) {
var that = this; var that = this;
uni.showLoading({ // uni.showLoading({
title: "登录中", // title: "登录中",
}); // });
//这里请求接口 //这里请求接口
var OpenId = ""; var OpenId = "";
that.request2( that.request2(
...@@ -387,9 +387,8 @@ export default { ...@@ -387,9 +387,8 @@ export default {
}, },
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
console.log("390", res); obj.OpenId = res.data;
// obj.OpenId = res.data; // that.getLoginAli(obj);
// that.getLogin(obj);
} }
} }
); );
......
...@@ -167,9 +167,8 @@ export default { ...@@ -167,9 +167,8 @@ export default {
Name = item.Name; Name = item.Name;
} }
let pages = getCurrentPages(); // 当前页面 let pages = getCurrentPages(); // 当前页面
let beforePage; let beforePage = null;
beforePage = pages[pages.length - 2]; // 前一个页面 beforePage = pages[pages.length - 2]; // 前一个页面
// console.log( beforePage.$vm)
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
......
...@@ -2,90 +2,170 @@ ...@@ -2,90 +2,170 @@
<view class="hotel-list"> <view class="hotel-list">
<view class="search-box"> <view class="search-box">
<view class="city-box" @click="showCity"> <view class="city-box" @click="showCity">
<u-icon name="location" :size="28" color="#000000" style="margin-right: 8rpx;"></u-icon> <u-icon
{{city}} name="location"
:size="28"
color="#000000"
style="margin-right: 8rpx"
></u-icon>
{{ city }}
</view> </view>
<view style="width: 1px; flex: 1;"> <view style="width: 1px; flex: 1">
<u-search placeholder="美食名称" v-model="msg.Name" input-align="left" text-color="#111" <u-search
bg-color="rgba(0,0,0,0)" :show-action="false" clearabled @search="searchList" @clear="searchList"> placeholder="美食名称"
v-model="msg.Name"
input-align="left"
text-color="#111"
bg-color="rgba(0,0,0,0)"
:show-action="false"
clearabled
@search="searchList"
@clear="searchList"
>
</u-search> </u-search>
</view> </view>
</view> </view>
<u-popup v-model="showCityList" mode="bottom" :border-radius="40" :safe-area-inset-bottom="true" > <u-popup
<Address @confirm="confirmCity" :list="cityList"/> v-model="showCityList"
mode="bottom"
:border-radius="40"
:safe-area-inset-bottom="true"
>
<Address @confirm="confirmCity" :list="cityList" />
</u-popup> </u-popup>
<view> <view>
<u-dropdown ref="uDropdown" @open="open" @close="close" active-color="#000" inactive-color="#444"> <u-dropdown
<u-dropdown-item v-model="msg.OrderBy" :title="optionsTitle[0]" :options="options1" ref="uDropdown"
@change="orderChange"> @open="open"
@close="close"
active-color="#000"
inactive-color="#444"
>
<u-dropdown-item
v-model="msg.OrderBy"
:title="optionsTitle[0]"
:options="options1"
@change="orderChange"
>
</u-dropdown-item> </u-dropdown-item>
<u-dropdown-item :title="optionsTitle[1]"> <u-dropdown-item :title="optionsTitle[1]">
<view class="slot-content"> <view class="slot-content">
<restaurant-type @sure-type="sureType" :current="currentTypeObj" :d="foodType"> <restaurant-type
@sure-type="sureType"
:current="currentTypeObj"
:d="foodType"
>
</restaurant-type> </restaurant-type>
</view> </view>
</u-dropdown-item> </u-dropdown-item>
<u-dropdown-item v-model="msg.District" :title="optionsTitle[2]" :options="DistrictOptions" <u-dropdown-item
@change="changeDistrict"> v-model="msg.District"
:title="optionsTitle[2]"
:options="DistrictOptions"
@change="changeDistrict"
>
</u-dropdown-item> </u-dropdown-item>
<u-dropdown-item :title="optionsTitle[3]"> <u-dropdown-item :title="optionsTitle[3]">
<view class="slot-content" style="padding: 30rpx;background-color: #FFF;"> <view
class="slot-content"
style="padding: 30rpx; background-color: #fff"
>
<!-- <view> <!-- <view>
<text style="font-size: 28rpx;color:#111;font-weight: 800;margin-right: 10rpx;">餐厅类型</text> <text style="font-size: 28rpx;color:#111;font-weight: 800;margin-right: 10rpx;">餐厅类型</text>
</view> </view>
<view class="hotel-rate-box"> <view class="hotel-rate-box">
<view v-for="(x,i) in options2" :key="i" class="hotel-rate" :class="{'active':tempRateAndPrice.types.indexOf(x.value)!=-1}" @click="setRestaurant(x.value)">{{x.label}}</view> <view v-for="(x,i) in options2" :key="i" class="hotel-rate" :class="{'active':tempRateAndPrice.types.indexOf(x.value)!=-1}" @click="setRestaurant(x.value)">{{x.label}}</view>
</view> --> </view> -->
<view style="margin-top: 20rpx;"> <view style="margin-top: 20rpx">
<text style="font-size: 28rpx;color:#111;font-weight: 800;">价格</text> <text style="font-size: 28rpx; color: #111; font-weight: 800"
>价格</text
>
</view> </view>
<view class="hotel-rate-box"> <view class="hotel-rate-box">
<!-- <view v-for="(x,i) in rates" class="hotel-rate" :class="{'active':tempRateAndPrice.rate.indexOf(x.ID)!=-1}" @click="setRestaurantPrice(x.ID)">{{x.Name}}</view> --> <!-- <view v-for="(x,i) in rates" class="hotel-rate" :class="{'active':tempRateAndPrice.rate.indexOf(x.ID)!=-1}" @click="setRestaurantPrice(x.ID)">{{x.Name}}</view> -->
<view v-for="(x,i) in rates" class="hotel-rate" <view
:class="{'active':msg.DiningPriceType===x.ID}" @click="setRestaurantPrice(x.ID,x.Name)"> v-for="(x, i) in rates"
{{x.Name}}</view> class="hotel-rate"
:class="{ active: msg.DiningPriceType === x.ID }"
@click="setRestaurantPrice(x.ID, x.Name)"
>
{{ x.Name }}</view
>
</view> </view>
<view <view
style="box-shadow: 0px -10px 30px 0px rgba(36, 36, 36, 0.06);margin-top:40rpx;display: flex;"> style="
<view style="flex:1;margin-right: 30rpx;"> box-shadow: 0px -10px 30px 0px rgba(36, 36, 36, 0.06);
<u-button :custom-style="btnStyle" @click="resetPrice">重置</u-button> margin-top: 40rpx;
display: flex;
"
>
<view style="flex: 1; margin-right: 30rpx">
<u-button :custom-style="btnStyle" @click="resetPrice"
>重置</u-button
>
</view> </view>
<view style="flex:1;"> <view style="flex: 1">
<u-button :custom-style="btnStyle2" @click="surePrice">完成</u-button> <u-button :custom-style="btnStyle2" @click="surePrice"
>完成</u-button
>
</view> </view>
</view> </view>
</view> </view>
</u-dropdown-item> </u-dropdown-item>
</u-dropdown> </u-dropdown>
</view> </view>
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true" <view class="no-data" v-if="restaurantList.length === 0">
:scroll-top="scrollTop" @scroll="scroll" style="height: calc(100% - 168rpx); padding-bottom: 0px;"> <image
<view v-for="(item,index) in restaurantList" :key="index"> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/no-data.png"
<restaurant-good :data="item" @confirm="confirm(item.ID)"></restaurant-good> mode="aspectFit"
class="no-data-img"
></image>
<view class="zhanwu"> 暂无数据 </view>
</view>
<scroll-view
:scroll-y="true"
@scrolltolower="lower"
:enable-back-to-top="true"
:enable-flex="true"
:scroll-top="scrollTop"
@scroll="scroll"
style="height: calc(100% - 168rpx); padding-bottom: 0px"
v-if="restaurantList.length > 0"
>
<view v-for="(item, index) in restaurantList" :key="index">
<restaurant-good
:data="item"
@confirm="confirm(item.ID)"
></restaurant-good>
</view> </view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" <u-loadmore
bg-color="#FFF" /> :status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#FFF"
/>
</scroll-view> </scroll-view>
<!-- 加载中 --> <!-- 加载中 -->
<view class="loading" v-if="loading"> <view class="loading" v-if="loading">
<u-loading mode="flower" size="48"></u-loading> <u-loading mode="flower" size="48"></u-loading>
<Text style="color: #fff; margin-top: 10rpx;">加载中...</Text> <Text style="color: #fff; margin-top: 10rpx">加载中...</Text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import rangeSlider from "./components/range-slider.vue" import rangeSlider from "./components/range-slider.vue";
import restaurantGood from './components/restaurant-good.vue'; import restaurantGood from "./components/restaurant-good.vue";
import restaurantType from './components/restaurant-type.vue'; import restaurantType from "./components/restaurant-type.vue";
import Address from './components/address/smh-address-indexed.vue' import Address from "./components/address/smh-address-indexed.vue";
export default { export default {
data() { data() {
return { return {
city:"成都", city: "成都",
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
...@@ -93,9 +173,8 @@ ...@@ -93,9 +173,8 @@
OrderBy: 0, OrderBy: 0,
FoodTypeIds: 0, FoodTypeIds: 0,
DiningPriceType: 0, DiningPriceType: 0,
City:262, City: 262,
District:0, District: 0,
}, },
page_count: 1, page_count: 1,
status: "loadmore", status: "loadmore",
...@@ -107,74 +186,70 @@ ...@@ -107,74 +186,70 @@
rateAndPrice: { rateAndPrice: {
types: [-1], types: [-1],
priceText: "不限", priceText: "不限",
rate: [-1] rate: [-1],
} },
}, },
tempRateAndPrice: { tempRateAndPrice: {
rate: [-1], rate: [-1],
types: [-1] types: [-1],
}, },
optionsTitle: [ optionsTitle: ["推荐排序", "分类", "区域", "筛选"],
"推荐排序",
"分类",
"区域",
"筛选",
],
rates: [], //价格列表 rates: [], //价格列表
options1: [{ options1: [
label: '不限', {
label: "不限",
value: 0, value: 0,
}, },
{ {
label: '人均最高', label: "人均最高",
value: 1, value: 1,
}, },
{ {
label: '人均最低', label: "人均最低",
value: 2, value: 2,
}, },
], ],
options2: [{ options2: [
label: '不限', {
label: "不限",
value: -1, value: -1,
}, },
{ {
label: '中式料理', label: "中式料理",
value: 1, value: 1,
}, },
{ {
label: '日式料理', label: "日式料理",
value: 2, value: 2,
}, },
{ {
label: '欧美料理', label: "欧美料理",
value: 3, value: 3,
}, },
{ {
label: '泰式料理', label: "泰式料理",
value: 4, value: 4,
}, },
{ {
label: '韩式料理', label: "韩式料理",
value: 5, value: 5,
} },
], ],
classOptions: [], classOptions: [],
btnStyle: { btnStyle: {
borderRadius: '16rpx', borderRadius: "16rpx",
color: '#111', color: "#111",
fontSize: '30rpx', fontSize: "30rpx",
width: '100%', width: "100%",
border: "1px solid #111", border: "1px solid #111",
background: "#FFF" background: "#FFF",
}, },
btnStyle2: { btnStyle2: {
borderRadius: '16rpx', borderRadius: "16rpx",
color: '#fff', color: "#fff",
fontSize: '30rpx', fontSize: "30rpx",
width: '100%', width: "100%",
background: "#111" background: "#111",
}, },
loadText: { loadText: {
loadmore: "轻轻上拉,加载更多", loadmore: "轻轻上拉,加载更多",
...@@ -189,13 +264,13 @@ ...@@ -189,13 +264,13 @@
status: "loadmore", status: "loadmore",
currentTypeObj: { currentTypeObj: {
ID: -1, ID: -1,
active: 0 active: 0,
}, },
foodType: [], foodType: [],
showCityList:false, showCityList: false,
cityList:[], cityList: [],
DistrictOptions:[{label:"不限",value:0}], DistrictOptions: [{ label: "不限", value: 0 }],
} };
}, },
components: { components: {
rangeSlider, rangeSlider,
...@@ -204,30 +279,29 @@ ...@@ -204,30 +279,29 @@
Address, Address,
}, },
onLoad(options) { onLoad(options) {
if(options && options.Name){ if (options && options.Name) {
this.msg.Name = options.Name this.msg.Name = options.Name;
} }
let d1 = new Date(); let d1 = new Date();
let d = new Date(); let d = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1)) let d2 = new Date(d.setDate(d.getDate() + 1));
var obj = { var obj = {
start: `${d1.getFullYear()}-${d1.getMonth()+1}-${d1.getDate()}`, start: `${d1.getFullYear()}-${d1.getMonth() + 1}-${d1.getDate()}`,
end: `${d2.getFullYear()}-${d2.getMonth()+1}-${d2.getDate()}`, end: `${d2.getFullYear()}-${d2.getMonth() + 1}-${d2.getDate()}`,
startDay: `${d1.getMonth()+1}-${d1.getDate()}`, startDay: `${d1.getMonth() + 1}-${d1.getDate()}`,
endDay: `${d2.getMonth()+1}-${d2.getDate()}`, endDay: `${d2.getMonth() + 1}-${d2.getDate()}`,
day: 1 day: 1,
} };
uni.setStorage({ uni.setStorage({
key: 'Time', key: "Time",
data: JSON.stringify(obj) data: JSON.stringify(obj),
}) });
this.searchObj.date = obj this.searchObj.date = obj;
this.getFoodType(); this.getFoodType();
this.getPriceEnum(); this.getPriceEnum();
this.getFoodList(); this.getFoodList();
this.getCity(); this.getCity();
this.getDistrict(262); this.getDistrict(262);
}, },
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -235,22 +309,24 @@ ...@@ -235,22 +309,24 @@
}); });
}, },
methods: { methods: {
orderChange(val){ orderChange(val) {
this.msg.pageIndex=1 this.msg.pageIndex = 1;
this.getFoodList(); this.getFoodList();
let res= this.options1.filter(i=>{return i.value==val}) let res = this.options1.filter((i) => {
this.optionsTitle[0]=res[0].label return i.value == val;
});
this.optionsTitle[0] = res[0].label;
}, },
searchList() { searchList() {
this.msg.pageIndex = 1 this.msg.pageIndex = 1;
this.getFoodList(); this.getFoodList();
}, },
scroll: function(e) { scroll: function (e) {
this.old.scrollTop = e.detail.scrollTop; this.old.scrollTop = e.detail.scrollTop;
}, },
goTop: function(e) { goTop: function (e) {
this.scrollTop = this.old.scrollTop; this.scrollTop = this.old.scrollTop;
this.$nextTick(function() { this.$nextTick(function () {
this.scrollTop = 0; this.scrollTop = 0;
}); });
}, },
...@@ -263,9 +339,9 @@ ...@@ -263,9 +339,9 @@
this.status = "nomore"; this.status = "nomore";
} }
}, },
setRestaurantPrice(rateId,name) { setRestaurantPrice(rateId, name) {
this.msg.DiningPriceType = rateId this.msg.DiningPriceType = rateId;
this.optionsTitle[3]=name this.optionsTitle[3] = name;
// if(rateId==-1){ // if(rateId==-1){
// this.tempRateAndPrice.rate=[-1] // this.tempRateAndPrice.rate=[-1]
// }else{ // }else{
...@@ -296,14 +372,14 @@ ...@@ -296,14 +372,14 @@
// } // }
// }, // },
resetPrice() { resetPrice() {
this.optionsTitle[3]="筛选" this.optionsTitle[3] = "筛选";
// this.searchObj.rateAndPrice={ // this.searchObj.rateAndPrice={
// types:[-1], // types:[-1],
// priceText:"不限", // priceText:"不限",
// rate:[-1] // rate:[-1]
// } // }
this.msg.DiningPriceType = 0 this.msg.DiningPriceType = 0;
this.msg.pageIndex=1 this.msg.pageIndex = 1;
this.getFoodList(); this.getFoodList();
this.closeDropdown(); this.closeDropdown();
}, },
...@@ -330,18 +406,18 @@ ...@@ -330,18 +406,18 @@
// this.$forceUpdate() // this.$forceUpdate()
// this.searchObj.rateAndPrice=this.tempRateAndPrice // this.searchObj.rateAndPrice=this.tempRateAndPrice
// this.msg.DiningPriceType=this.tempRateAndPrice.rate.toString(); // this.msg.DiningPriceType=this.tempRateAndPrice.rate.toString();
this.msg.pageIndex=1 this.msg.pageIndex = 1;
this.getFoodList(); this.getFoodList();
this.closeDropdown(); this.closeDropdown();
}, },
sureType(item) { sureType(item) {
this.msg.FoodTypeIds = item.ID; this.msg.FoodTypeIds = item.ID;
this.optionsTitle[1]=item.Name this.optionsTitle[1] = item.Name;
if(!this.optionsTitle[1]){ if (!this.optionsTitle[1]) {
this.optionsTitle[1]="分类" this.optionsTitle[1] = "分类";
this.msg.FoodTypeIds=0 this.msg.FoodTypeIds = 0;
} }
this.msg.pageIndex=1 this.msg.pageIndex = 1;
this.getFoodList(); this.getFoodList();
this.closeDropdown(); this.closeDropdown();
}, },
...@@ -366,11 +442,10 @@ ...@@ -366,11 +442,10 @@
// 同时内部会自动给当前展开项进行高亮 // 同时内部会自动给当前展开项进行高亮
this.$refs.uDropdown.highlight(); this.$refs.uDropdown.highlight();
if (index == 2) { if (index == 2) {
this.tempRateAndPrice = this.searchObj.rateAndPrice this.tempRateAndPrice = this.searchObj.rateAndPrice;
} else if (index == 1) { } else if (index == 1) {
this.currentTypeObj.newTimespan = this.rand(1000, 9999);
this.currentTypeObj.newTimespan = this.rand(1000, 9999) this.$forceUpdate();
this.$forceUpdate()
// console.log(this.currentTypeObj.newTimespan) // console.log(this.currentTypeObj.newTimespan)
} }
}, },
...@@ -384,50 +459,55 @@ ...@@ -384,50 +459,55 @@
}, },
// 获取餐食类型 // 获取餐食类型
getFoodType() { getFoodType() {
this.request2({ this.request2(
url: '/api/AppletDining/GetFoodType', {
url: "/api/AppletDining/GetFoodType",
data: { data: {
ClassType: 0 ClassType: 0,
}
}, },
res => { },
(res) => {
if (res.resultCode === 1) { if (res.resultCode === 1) {
this.foodType = res.data this.foodType = res.data;
} }
} }
); );
}, },
// 获取餐食价格枚举 // 获取餐食价格枚举
getPriceEnum() { getPriceEnum() {
this.request2({ this.request2(
url: '/api/AppletDining/GetDiningPriceType', {
data: {} url: "/api/AppletDining/GetDiningPriceType",
data: {},
}, },
res => { (res) => {
if (res.resultCode === 1) { if (res.resultCode === 1) {
this.rates = res.data this.rates = res.data;
} }
} }
); );
}, },
// 获取餐食列表 // 获取餐食列表
getFoodList() { getFoodList() {
this.request2({ this.request2(
url: '/api/AppletDining/GetDiningPage', {
data: this.msg url: "/api/AppletDining/GetDiningPage",
data: this.msg,
}, },
res => { (res) => {
if (res.resultCode === 1) { if (res.resultCode === 1) {
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
res.data.pageData.forEach(item => { res.data.pageData.forEach((item) => {
item.FoodTag = item.FoodTag.split(',') item.FoodTag = item.FoodTag.split(",");
item.GeographicTag = item.GeographicTag.split(',') item.GeographicTag = item.GeographicTag.split(",");
}) });
if (this.msg.pageIndex == 1) { if (this.msg.pageIndex == 1) {
this.restaurantList = res.data.pageData; this.restaurantList = res.data.pageData;
} else if (this.msg.pageIndex > 1) { } else if (this.msg.pageIndex > 1) {
this.restaurantList = [...this.restaurantList, ...res.data.pageData]; this.restaurantList = [
...this.restaurantList,
...res.data.pageData,
];
} }
if (this.page_count == 1) { if (this.page_count == 1) {
...@@ -439,114 +519,113 @@ ...@@ -439,114 +519,113 @@
}, },
confirm(id) { confirm(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/restaurant/detail?id=" + id url: "/pages/restaurant/detail?id=" + id,
}) });
}, },
showCity(){ showCity() {
this.showCityList=true this.showCityList = true;
}, },
confirmCity(val){ confirmCity(val) {
this.showCityList=false this.showCityList = false;
this.msg.City=val.ID this.msg.City = val.ID;
this.city=val.Name this.city = val.Name;
this.getDistrict(val.ID) this.getDistrict(val.ID);
this.msg.District=0 this.msg.District = 0;
this.optionsTitle[2]="区域" this.optionsTitle[2] = "区域";
this.msg.pageIndex=1 this.msg.pageIndex = 1;
this.getFoodList(); this.getFoodList();
}, },
getCity(){ getCity() {
this.request2({ this.request2(
url: '/api/AppletDining/GetDiningDestination', {
data: {ID:0} url: "/api/AppletDining/GetDiningDestination",
data: { ID: 0 },
}, },
res => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.cityList=[] this.cityList = [];
res.data.map(i=>{ res.data.map((i) => {
let initial=i.PinYin.slice(0,1) let initial = i.PinYin.slice(0, 1);
let find =this.cityList.filter((e)=>{ let find = this.cityList.filter((e) => {
return e.letter==initial return e.letter == initial;
}) });
if(find.length>0){ if (find.length > 0) {
find[0].citylist.push(i) find[0].citylist.push(i);
}else{ } else {
let obj={ let obj = {
letter:initial, letter: initial,
citylist:[i], citylist: [i],
} };
this.cityList.push(obj) this.cityList.push(obj);
} }
}) });
} }
}, },
err => { (err) => {}
}
); );
}, },
getDistrict(id){ getDistrict(id) {
this.request2({ this.request2(
url: '/api/AppletDining/GetDiningDestination', {
data: {ID:id} url: "/api/AppletDining/GetDiningDestination",
data: { ID: id },
}, },
res => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.DistrictOptions=[{label:"不限",value:0}] this.DistrictOptions = [{ label: "不限", value: 0 }];
res.data.map(i=>{ res.data.map((i) => {
let obj={ let obj = {
label:i.Name, label: i.Name,
value:i.ID value: i.ID,
} };
this.DistrictOptions.push(obj) this.DistrictOptions.push(obj);
}) });
} }
}, },
err => { (err) => {}
}
); );
}, },
changeDistrict(val){ changeDistrict(val) {
this.msg.pageIndex=1 this.msg.pageIndex = 1;
this.getFoodList(); this.getFoodList();
let res= this.DistrictOptions.filter(i=>{return i.value==val}) let res = this.DistrictOptions.filter((i) => {
this.optionsTitle[2]=res[0].label return i.value == val;
} });
this.optionsTitle[2] = res[0].label;
}, },
} },
};
</script> </script>
<style scoped> <style scoped>
.city-box { .city-box {
width: 120rpx; width: 120rpx;
height: 40rpx; height: 40rpx;
padding: 0rpx 20rpx 8rpx 0rpx; padding: 0rpx 20rpx 8rpx 0rpx;
text-align: center; text-align: center;
border-right: 1px solid #E2E2E2; border-right: 1px solid #e2e2e2;
font-size: 28rpx; font-size: 28rpx;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: flex; display: flex;
align-items: center; align-items: center;
} }
/deep/.u-flex { /deep/.u-flex {
justify-content: center; justify-content: center;
} }
.hotel-rate-box { .hotel-rate-box {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
} }
.hotel-rate { .hotel-rate {
width: 215rpx; width: 215rpx;
height: 60rpx; height: 60rpx;
background: #ECF1F4; background: #ecf1f4;
border-radius: 10rpx; border-radius: 10rpx;
font-size: 26rpx; font-size: 26rpx;
color: #999999; color: #999999;
...@@ -554,29 +633,47 @@ ...@@ -554,29 +633,47 @@
margin-right: 15rpx; margin-right: 15rpx;
text-align: center; text-align: center;
margin-top: 29rpx; margin-top: 29rpx;
} }
.hotel-rate:last-child { .hotel-rate:last-child {
margin-right: 0; margin-right: 0;
} }
.hotel-rate.active { .hotel-rate.active {
background: #111111; background: #111111;
color: #FFFFFF; color: #ffffff;
} }
.hotel-list { .hotel-list {
height: 100vh; height: 100vh;
}
} .hotel-list .search-box {
.hotel-list .search-box {
height: 88rpx; height: 88rpx;
background: #ECF1F4; background: #ecf1f4;
border-radius: 44rpx; border-radius: 44rpx;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 19rpx 30rpx; padding: 19rpx 30rpx;
margin: 0 30rpx; margin: 0 30rpx;
}
</style>
<style lang="scss" scoped>
.no-data {
.no-data-img {
width: 180rpx;
height: 240rpx;
margin-left: 50%;
transform: translateX(-50%);
}
.zhanwu {
text-align: center;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
margin-top: 20rpx;
} }
}
</style> </style>
...@@ -113,12 +113,21 @@ ...@@ -113,12 +113,21 @@
> >
<canlendar @finish="chosenDateResult"></canlendar> <canlendar @finish="chosenDateResult"></canlendar>
</u-popup> </u-popup>
<view class="no-data" v-if="dataList.length === 0">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/no-data.png"
mode="aspectFit"
class="no-data-img"
></image>
<view class="zhanwu"> 暂无数据 </view>
</view>
<scroll-view <scroll-view
:scroll-y="true" :scroll-y="true"
:enable-back-to-top="true" :enable-back-to-top="true"
:enable-flex="true" :enable-flex="true"
@scrolltolower="lower" @scrolltolower="lower"
style="height: calc(100% - 224rpx); padding-bottom: 0px" style="height: calc(100% - 224rpx); padding-bottom: 0px"
v-if="dataList.length > 0"
> >
<view class="ticket-list"> <view class="ticket-list">
<view <view
...@@ -681,4 +690,21 @@ export default { ...@@ -681,4 +690,21 @@ export default {
} }
} }
} }
.no-data {
.no-data-img {
width: 180rpx;
height: 240rpx;
margin-left: 50%;
transform: translateX(-50%);
}
.zhanwu {
text-align: center;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
margin-top: 20rpx;
}
}
</style> </style>
...@@ -111,6 +111,9 @@ export default { ...@@ -111,6 +111,9 @@ export default {
onLoad(options) { onLoad(options) {
this.ID = options.id; this.ID = options.id;
this.getDetail(); this.getDetail();
uni.setNavigationBarTitle({
title: "景区详细信息",
});
}, },
onPageScroll(res) {}, onPageScroll(res) {},
methods: { methods: {
......
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