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,
......
<template> <template>
<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"
</view> :size="28"
<view style="width: 1px; flex: 1;"> color="#000000"
<u-search placeholder="美食名称" v-model="msg.Name" input-align="left" text-color="#111" style="margin-right: 8rpx"
bg-color="rgba(0,0,0,0)" :show-action="false" clearabled @search="searchList" @clear="searchList"> ></u-icon>
</u-search> {{ city }}
</view> </view>
</view> <view style="width: 1px; flex: 1">
<u-popup v-model="showCityList" mode="bottom" :border-radius="40" :safe-area-inset-bottom="true" > <u-search
<Address @confirm="confirmCity" :list="cityList"/> placeholder="美食名称"
</u-popup> v-model="msg.Name"
<view> input-align="left"
<u-dropdown ref="uDropdown" @open="open" @close="close" active-color="#000" inactive-color="#444"> text-color="#111"
<u-dropdown-item v-model="msg.OrderBy" :title="optionsTitle[0]" :options="options1" bg-color="rgba(0,0,0,0)"
@change="orderChange"> :show-action="false"
</u-dropdown-item> clearabled
@search="searchList"
@clear="searchList"
>
</u-search>
</view>
</view>
<u-popup
v-model="showCityList"
mode="bottom"
:border-radius="40"
:safe-area-inset-bottom="true"
>
<Address @confirm="confirmCity" :list="cityList" />
</u-popup>
<view>
<u-dropdown
ref="uDropdown"
@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 :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
</restaurant-type> @sure-type="sureType"
</view> :current="currentTypeObj"
</u-dropdown-item> :d="foodType"
<u-dropdown-item v-model="msg.District" :title="optionsTitle[2]" :options="DistrictOptions" >
@change="changeDistrict"> </restaurant-type>
</u-dropdown-item> </view>
<u-dropdown-item :title="optionsTitle[3]"> </u-dropdown-item>
<view class="slot-content" style="padding: 30rpx;background-color: #FFF;"> <u-dropdown-item
<!-- <view> v-model="msg.District"
:title="optionsTitle[2]"
:options="DistrictOptions"
@change="changeDistrict"
>
</u-dropdown-item>
<u-dropdown-item :title="optionsTitle[3]">
<view
class="slot-content"
style="padding: 30rpx; background-color: #fff"
>
<!-- <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"
</view> >价格</text
<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>
<view v-for="(x,i) in rates" class="hotel-rate" <view class="hotel-rate-box">
:class="{'active':msg.DiningPriceType===x.ID}" @click="setRestaurantPrice(x.ID,x.Name)"> <!-- <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> -->
{{x.Name}}</view> <view
</view> v-for="(x, i) in rates"
<view class="hotel-rate"
style="box-shadow: 0px -10px 30px 0px rgba(36, 36, 36, 0.06);margin-top:40rpx;display: flex;"> :class="{ active: msg.DiningPriceType === x.ID }"
<view style="flex:1;margin-right: 30rpx;"> @click="setRestaurantPrice(x.ID, x.Name)"
<u-button :custom-style="btnStyle" @click="resetPrice">重置</u-button> >
</view> {{ x.Name }}</view
<view style="flex:1;"> >
<u-button :custom-style="btnStyle2" @click="surePrice">完成</u-button> </view>
</view> <view
</view> style="
</view> box-shadow: 0px -10px 30px 0px rgba(36, 36, 36, 0.06);
</u-dropdown-item> margin-top: 40rpx;
</u-dropdown> display: flex;
</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;"> <view style="flex: 1; margin-right: 30rpx">
<view v-for="(item,index) in restaurantList" :key="index"> <u-button :custom-style="btnStyle" @click="resetPrice"
<restaurant-good :data="item" @confirm="confirm(item.ID)"></restaurant-good> >重置</u-button
</view> >
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" <view style="flex: 1">
bg-color="#FFF" /> <u-button :custom-style="btnStyle2" @click="surePrice"
>完成</u-button
>
</view>
</view>
</view>
</u-dropdown-item>
</u-dropdown>
</view>
<view class="no-data" v-if="restaurantList.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-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>
</scroll-view> <u-loadmore
<!-- 加载中 --> :status="status"
<view class="loading" v-if="loading"> :load-text="loadText"
<u-loading mode="flower" size="48"></u-loading> :font-size="24"
<Text style="color: #fff; margin-top: 10rpx;">加载中...</Text> :margin-top="20"
</view> :margin-bottom="20"
</view> bg-color="#FFF"
/>
</scroll-view>
<!-- 加载中 -->
<view class="loading" v-if="loading">
<u-loading mode="flower" size="48"></u-loading>
<Text style="color: #fff; margin-top: 10rpx">加载中...</Text>
</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,
Name: "", Name: "",
OrderBy: 0, OrderBy: 0,
FoodTypeIds: 0, FoodTypeIds: 0,
DiningPriceType: 0, DiningPriceType: 0,
City:262, City: 262,
District:0, District: 0,
},
page_count: 1,
status: "loadmore",
restaurantList: [], //餐厅列表
searchObj: {
Name: "",
OrderBy: 0,
rtype: -1,
rateAndPrice: {
types: [-1],
priceText: "不限",
rate: [-1],
},
},
tempRateAndPrice: {
rate: [-1],
types: [-1],
},
optionsTitle: ["推荐排序", "分类", "区域", "筛选"],
rates: [], //价格列表
options1: [
{
label: "不限",
value: 0,
},
{
label: "人均最高",
value: 1,
},
{
label: "人均最低",
value: 2,
},
],
options2: [
{
label: "不限",
value: -1,
},
{
label: "中式料理",
value: 1,
},
{
label: "日式料理",
value: 2,
},
{
label: "欧美料理",
value: 3,
},
{
label: "泰式料理",
value: 4,
},
{
label: "韩式料理",
value: 5,
},
],
classOptions: [],
btnStyle: {
borderRadius: "16rpx",
color: "#111",
fontSize: "30rpx",
width: "100%",
border: "1px solid #111",
background: "#FFF",
},
btnStyle2: {
borderRadius: "16rpx",
color: "#fff",
fontSize: "30rpx",
width: "100%",
background: "#111",
},
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多商品了",
},
scrollTop: 0,
old: {
scrollTop: 0,
},
showLoading: false,
status: "loadmore",
currentTypeObj: {
ID: -1,
active: 0,
},
foodType: [],
showCityList: false,
cityList: [],
DistrictOptions: [{ label: "不限", value: 0 }],
};
},
components: {
rangeSlider,
restaurantGood,
restaurantType,
Address,
},
onLoad(options) {
if (options && options.Name) {
this.msg.Name = options.Name;
}
let d1 = new Date();
let d = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1));
var obj = {
start: `${d1.getFullYear()}-${d1.getMonth() + 1}-${d1.getDate()}`,
end: `${d2.getFullYear()}-${d2.getMonth() + 1}-${d2.getDate()}`,
startDay: `${d1.getMonth() + 1}-${d1.getDate()}`,
endDay: `${d2.getMonth() + 1}-${d2.getDate()}`,
day: 1,
};
uni.setStorage({
key: "Time",
data: JSON.stringify(obj),
});
this.searchObj.date = obj;
this.getFoodType();
this.getPriceEnum();
this.getFoodList();
this.getCity();
this.getDistrict(262);
},
created() {
uni.setNavigationBarTitle({
title: "美食",
});
},
methods: {
orderChange(val) {
this.msg.pageIndex = 1;
this.getFoodList();
let res = this.options1.filter((i) => {
return i.value == val;
});
this.optionsTitle[0] = res[0].label;
},
searchList() {
this.msg.pageIndex = 1;
this.getFoodList();
},
scroll: function (e) {
this.old.scrollTop = e.detail.scrollTop;
},
goTop: function (e) {
this.scrollTop = this.old.scrollTop;
this.$nextTick(function () {
this.scrollTop = 0;
});
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.getFoodList();
} else {
this.status = "nomore";
}
},
setRestaurantPrice(rateId, name) {
this.msg.DiningPriceType = rateId;
this.optionsTitle[3] = name;
// if(rateId==-1){
// this.tempRateAndPrice.rate=[-1]
// }else{
// if(this.tempRateAndPrice.rate.indexOf(-1)!=-1){
// this.tempRateAndPrice.rate.splice(this.tempRateAndPrice.rate.indexOf(-1),1)
// }
// let temp=this.tempRateAndPrice.rate.indexOf(rateId)
// if(temp==-1){
// this.tempRateAndPrice.rate.push(rateId)
// }else{
// this.tempRateAndPrice.rate.splice(temp,1)
// }
// }
},
// setRestaurant(typeId){
// if(typeId==-1){
// this.tempRateAndPrice.types=[-1]
// }else{
// if(this.tempRateAndPrice.types.indexOf(-1)!=-1){
// this.tempRateAndPrice.types.splice(this.tempRateAndPrice.types.indexOf(-1),1)
// }
// let temp=this.tempRateAndPrice.types.indexOf(typeId)
// if(temp==-1){
// this.tempRateAndPrice.types.push(typeId)
// }else{
// this.tempRateAndPrice.types.splice(temp,1)
// }
// }
// },
resetPrice() {
this.optionsTitle[3] = "筛选";
// this.searchObj.rateAndPrice={
// types:[-1],
// priceText:"不限",
// rate:[-1]
// }
this.msg.DiningPriceType = 0;
this.msg.pageIndex = 1;
this.getFoodList();
this.closeDropdown();
},
surePrice() {
// let result=""
// if(this.tempRateAndPrice.types.length>0){
// this.options2.forEach(x=>{
// if(this.tempRateAndPrice.types.indexOf(x.value)!=-1){
// result+=x.label+","
// }
// })
// }
// if(this.tempRateAndPrice.rate.length>0){
// this.rates.forEach(x=>{
// if(this.tempRateAndPrice.rate.indexOf(x.value)!=-1){
// result+=x.label+","
// }
// })
// }
}, // result=result==""?"筛选":result
page_count: 1, // console.log(296,result)
status: "loadmore", // this.optionsTitle[2]=result
restaurantList: [], //餐厅列表 // this.$forceUpdate()
searchObj: { // this.searchObj.rateAndPrice=this.tempRateAndPrice
Name: "", // this.msg.DiningPriceType=this.tempRateAndPrice.rate.toString();
OrderBy: 0, this.msg.pageIndex = 1;
rtype: -1, this.getFoodList();
rateAndPrice: { this.closeDropdown();
types: [-1], },
priceText: "不限", sureType(item) {
rate: [-1] this.msg.FoodTypeIds = item.ID;
} this.optionsTitle[1] = item.Name;
}, if (!this.optionsTitle[1]) {
tempRateAndPrice: { this.optionsTitle[1] = "分类";
rate: [-1], this.msg.FoodTypeIds = 0;
types: [-1] }
}, this.msg.pageIndex = 1;
optionsTitle: [ this.getFoodList();
"推荐排序", this.closeDropdown();
"分类", },
"区域", // rangechange4(e){
"筛选", // if(e.minValue==0){
], // if(e.maxValue==1000){
rates: [], //价格列表 // this.tempRateAndPrice.priceText="不限"
options1: [{ // }else{
label: '不限', // this.tempRateAndPrice.priceText=`¥${e.maxValue}以下`
value: 0, // }
}, // }else if(e.maxValue==1000){
{ // this.tempRateAndPrice.priceText=`¥${e.minValue}以上`
label: '人均最高', // }else{
value: 1, // this.tempRateAndPrice.priceText=`¥${e.minValue} - ¥${e.maxValue}之间`
}, // }
{ // },
label: '人均最低', closeDropdown() {
value: 2, this.$refs.uDropdown.close();
}, },
open(index) {
// 展开某个下来菜单时,先关闭原来的其他菜单的高亮
// 同时内部会自动给当前展开项进行高亮
this.$refs.uDropdown.highlight();
if (index == 2) {
this.tempRateAndPrice = this.searchObj.rateAndPrice;
} else if (index == 1) {
this.currentTypeObj.newTimespan = this.rand(1000, 9999);
this.$forceUpdate();
// console.log(this.currentTypeObj.newTimespan)
}
},
rand(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
},
close(index) {
// 关闭的时候,给当前项加上高亮
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
this.$refs.uDropdown.highlight(index);
},
// 获取餐食类型
getFoodType() {
this.request2(
{
url: "/api/AppletDining/GetFoodType",
data: {
ClassType: 0,
},
},
(res) => {
if (res.resultCode === 1) {
this.foodType = res.data;
}
}
);
},
// 获取餐食价格枚举
getPriceEnum() {
this.request2(
{
url: "/api/AppletDining/GetDiningPriceType",
data: {},
},
(res) => {
if (res.resultCode === 1) {
this.rates = res.data;
}
}
);
},
// 获取餐食列表
getFoodList() {
this.request2(
{
url: "/api/AppletDining/GetDiningPage",
data: this.msg,
},
(res) => {
if (res.resultCode === 1) {
this.page_count = res.data.pageCount;
res.data.pageData.forEach((item) => {
item.FoodTag = item.FoodTag.split(",");
item.GeographicTag = item.GeographicTag.split(",");
});
if (this.msg.pageIndex == 1) {
this.restaurantList = res.data.pageData;
} else if (this.msg.pageIndex > 1) {
this.restaurantList = [
...this.restaurantList,
...res.data.pageData,
];
}
], if (this.page_count == 1) {
options2: [{ this.status = "nomore";
label: '不限', }
value: -1, }
}, }
{ );
label: '中式料理', },
value: 1, confirm(id) {
}, uni.navigateTo({
{ url: "/pages/restaurant/detail?id=" + id,
label: '日式料理', });
value: 2, },
}, showCity() {
{ this.showCityList = true;
label: '欧美料理', },
value: 3, confirmCity(val) {
}, this.showCityList = false;
{ this.msg.City = val.ID;
label: '泰式料理', this.city = val.Name;
value: 4, this.getDistrict(val.ID);
}, this.msg.District = 0;
{ this.optionsTitle[2] = "区域";
label: '韩式料理', this.msg.pageIndex = 1;
value: 5, this.getFoodList();
} },
], getCity() {
classOptions: [], this.request2(
btnStyle: { {
borderRadius: '16rpx', url: "/api/AppletDining/GetDiningDestination",
color: '#111', data: { ID: 0 },
fontSize: '30rpx', },
width: '100%', (res) => {
border: "1px solid #111", if (res.resultCode == 1) {
background: "#FFF" this.cityList = [];
}, res.data.map((i) => {
btnStyle2: { let initial = i.PinYin.slice(0, 1);
borderRadius: '16rpx',
color: '#fff',
fontSize: '30rpx',
width: '100%',
background: "#111"
},
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多商品了",
},
scrollTop: 0,
old: {
scrollTop: 0,
},
showLoading: false,
status: "loadmore",
currentTypeObj: {
ID: -1,
active: 0
},
foodType: [],
showCityList:false,
cityList:[],
DistrictOptions:[{label:"不限",value:0}],
}
},
components: {
rangeSlider,
restaurantGood,
restaurantType,
Address,
},
onLoad(options) {
if(options && options.Name){
this.msg.Name = options.Name
}
let d1 = new Date();
let d = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1))
var obj = {
start: `${d1.getFullYear()}-${d1.getMonth()+1}-${d1.getDate()}`,
end: `${d2.getFullYear()}-${d2.getMonth()+1}-${d2.getDate()}`,
startDay: `${d1.getMonth()+1}-${d1.getDate()}`,
endDay: `${d2.getMonth()+1}-${d2.getDate()}`,
day: 1
}
uni.setStorage({
key: 'Time',
data: JSON.stringify(obj)
})
this.searchObj.date = obj
this.getFoodType();
this.getPriceEnum();
this.getFoodList();
this.getCity();
this.getDistrict(262);
},
created() {
uni.setNavigationBarTitle({
title: "美食",
});
},
methods: {
orderChange(val){
this.msg.pageIndex=1
this.getFoodList();
let res= this.options1.filter(i=>{return i.value==val})
this.optionsTitle[0]=res[0].label
},
searchList() {
this.msg.pageIndex = 1
this.getFoodList();
},
scroll: function(e) {
this.old.scrollTop = e.detail.scrollTop;
},
goTop: function(e) {
this.scrollTop = this.old.scrollTop;
this.$nextTick(function() {
this.scrollTop = 0;
});
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.getFoodList();
} else {
this.status = "nomore";
}
},
setRestaurantPrice(rateId,name) {
this.msg.DiningPriceType = rateId
this.optionsTitle[3]=name
// if(rateId==-1){
// this.tempRateAndPrice.rate=[-1]
// }else{
// if(this.tempRateAndPrice.rate.indexOf(-1)!=-1){
// this.tempRateAndPrice.rate.splice(this.tempRateAndPrice.rate.indexOf(-1),1)
// }
// let temp=this.tempRateAndPrice.rate.indexOf(rateId)
// if(temp==-1){
// this.tempRateAndPrice.rate.push(rateId)
// }else{
// this.tempRateAndPrice.rate.splice(temp,1)
// }
// }
},
// setRestaurant(typeId){
// if(typeId==-1){
// this.tempRateAndPrice.types=[-1]
// }else{
// if(this.tempRateAndPrice.types.indexOf(-1)!=-1){
// this.tempRateAndPrice.types.splice(this.tempRateAndPrice.types.indexOf(-1),1)
// }
// let temp=this.tempRateAndPrice.types.indexOf(typeId)
// if(temp==-1){
// this.tempRateAndPrice.types.push(typeId)
// }else{
// this.tempRateAndPrice.types.splice(temp,1)
// }
// }
// },
resetPrice() {
this.optionsTitle[3]="筛选"
// this.searchObj.rateAndPrice={
// types:[-1],
// priceText:"不限",
// rate:[-1]
// }
this.msg.DiningPriceType = 0
this.msg.pageIndex=1
this.getFoodList();
this.closeDropdown();
},
surePrice() {
// let result=""
// if(this.tempRateAndPrice.types.length>0){
// this.options2.forEach(x=>{
// if(this.tempRateAndPrice.types.indexOf(x.value)!=-1){
// result+=x.label+","
// }
// })
// }
// if(this.tempRateAndPrice.rate.length>0){
// this.rates.forEach(x=>{
// if(this.tempRateAndPrice.rate.indexOf(x.value)!=-1){
// result+=x.label+","
// }
// })
// }
// result=result==""?"筛选":result let find = this.cityList.filter((e) => {
// console.log(296,result) return e.letter == initial;
// this.optionsTitle[2]=result });
// this.$forceUpdate() if (find.length > 0) {
// this.searchObj.rateAndPrice=this.tempRateAndPrice find[0].citylist.push(i);
// this.msg.DiningPriceType=this.tempRateAndPrice.rate.toString(); } else {
this.msg.pageIndex=1 let obj = {
this.getFoodList(); letter: initial,
this.closeDropdown(); citylist: [i],
}, };
sureType(item) { this.cityList.push(obj);
this.msg.FoodTypeIds = item.ID; }
this.optionsTitle[1]=item.Name });
if(!this.optionsTitle[1]){ }
this.optionsTitle[1]="分类" },
this.msg.FoodTypeIds=0 (err) => {}
} );
this.msg.pageIndex=1 },
this.getFoodList(); getDistrict(id) {
this.closeDropdown(); this.request2(
}, {
// rangechange4(e){ url: "/api/AppletDining/GetDiningDestination",
// if(e.minValue==0){ data: { ID: id },
// if(e.maxValue==1000){ },
// this.tempRateAndPrice.priceText="不限" (res) => {
// }else{ if (res.resultCode == 1) {
// this.tempRateAndPrice.priceText=`¥${e.maxValue}以下` this.DistrictOptions = [{ label: "不限", value: 0 }];
// } res.data.map((i) => {
// }else if(e.maxValue==1000){ let obj = {
// this.tempRateAndPrice.priceText=`¥${e.minValue}以上` label: i.Name,
// }else{ value: i.ID,
// this.tempRateAndPrice.priceText=`¥${e.minValue} - ¥${e.maxValue}之间` };
// } this.DistrictOptions.push(obj);
// }, });
closeDropdown() { }
this.$refs.uDropdown.close(); },
}, (err) => {}
open(index) { );
// 展开某个下来菜单时,先关闭原来的其他菜单的高亮 },
// 同时内部会自动给当前展开项进行高亮 changeDistrict(val) {
this.$refs.uDropdown.highlight(); this.msg.pageIndex = 1;
if (index == 2) { this.getFoodList();
this.tempRateAndPrice = this.searchObj.rateAndPrice let res = this.DistrictOptions.filter((i) => {
} else if (index == 1) { return i.value == val;
});
this.currentTypeObj.newTimespan = this.rand(1000, 9999) this.optionsTitle[2] = res[0].label;
this.$forceUpdate() },
// console.log(this.currentTypeObj.newTimespan) },
} };
},
rand(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
},
close(index) {
// 关闭的时候,给当前项加上高亮
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
this.$refs.uDropdown.highlight(index);
},
// 获取餐食类型
getFoodType() {
this.request2({
url: '/api/AppletDining/GetFoodType',
data: {
ClassType: 0
}
},
res => {
if (res.resultCode === 1) {
this.foodType = res.data
}
}
);
},
// 获取餐食价格枚举
getPriceEnum() {
this.request2({
url: '/api/AppletDining/GetDiningPriceType',
data: {}
},
res => {
if (res.resultCode === 1) {
this.rates = res.data
}
}
);
},
// 获取餐食列表
getFoodList() {
this.request2({
url: '/api/AppletDining/GetDiningPage',
data: this.msg
},
res => {
if (res.resultCode === 1) {
this.page_count = res.data.pageCount;
res.data.pageData.forEach(item => {
item.FoodTag = item.FoodTag.split(',')
item.GeographicTag = item.GeographicTag.split(',')
})
if (this.msg.pageIndex == 1) {
this.restaurantList = res.data.pageData;
} else if (this.msg.pageIndex > 1) {
this.restaurantList = [...this.restaurantList, ...res.data.pageData];
}
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
confirm(id) {
uni.navigateTo({
url: "/pages/restaurant/detail?id=" + id
})
},
showCity(){
this.showCityList=true
},
confirmCity(val){
this.showCityList=false
this.msg.City=val.ID
this.city=val.Name
this.getDistrict(val.ID)
this.msg.District=0
this.optionsTitle[2]="区域"
this.msg.pageIndex=1
this.getFoodList();
},
getCity(){
this.request2({
url: '/api/AppletDining/GetDiningDestination',
data: {ID:0}
},
res => {
if (res.resultCode == 1) {
this.cityList=[]
res.data.map(i=>{
let initial=i.PinYin.slice(0,1)
let find =this.cityList.filter((e)=>{
return e.letter==initial
})
if(find.length>0){
find[0].citylist.push(i)
}else{
let obj={
letter:initial,
citylist:[i],
}
this.cityList.push(obj)
}
})
}
},
err => {
}
);
},
getDistrict(id){
this.request2({
url: '/api/AppletDining/GetDiningDestination',
data: {ID:id}
},
res => {
if (res.resultCode == 1) {
this.DistrictOptions=[{label:"不限",value:0}]
res.data.map(i=>{
let obj={
label:i.Name,
value:i.ID
}
this.DistrictOptions.push(obj)
})
}
},
err => {
}
);
},
changeDistrict(val){
this.msg.pageIndex=1
this.getFoodList();
let res= this.DistrictOptions.filter(i=>{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;
line-height: 60rpx; line-height: 60rpx;
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 {
height: 88rpx;
background: #ecf1f4;
border-radius: 44rpx;
display: flex;
align-items: center;
padding: 19rpx 30rpx;
margin: 0 30rpx;
}
</style>
<style lang="scss" scoped>
.no-data {
.no-data-img {
width: 180rpx;
height: 240rpx;
margin-left: 50%;
transform: translateX(-50%);
}
.hotel-list .search-box { .zhanwu {
height: 88rpx; text-align: center;
background: #ECF1F4; font-size: 28rpx;
border-radius: 44rpx; font-family: PingFang SC;
display: flex; font-weight: 500;
align-items: center; color: #999999;
padding: 19rpx 30rpx; margin-top: 20rpx;
margin: 0 30rpx; }
} }
</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