mice 4 years ago
parent 37127fd3b3
commit dd5d9f8090

@ -37,7 +37,7 @@
</view> </view>
<view class="_search"> <view class="_search">
<view class="_search1"> <view class="_search1">
<text @tap="area_nav">{{ city||'' }}</text> <text @tap="area_nav">{{ city }}</text>
<text v-if="city" style="color: #ff446b" :decode="true">&nbsp;&nbsp;&nbsp;&nbsp;</text> <text v-if="city" style="color: #ff446b" :decode="true">&nbsp;&nbsp;&nbsp;&nbsp;</text>
<!-- <input placeholder="开心麻花" placeholder-style="color: #ACACAC;" bindinput="write_in" bindconfirm="search" <!-- <input placeholder="开心麻花" placeholder-style="color: #ACACAC;" bindinput="write_in" bindconfirm="search"
type="text" confirm-type="search" /> --> type="text" confirm-type="search" /> -->
@ -144,7 +144,17 @@
var city_id = res.city_info.city_id; var city_id = res.city_info.city_id;
getApp().globalData.city_id = city_id; getApp().globalData.city_id = city_id;
this.refresh_info(city_id); this.refresh_info(city_id);
}); }).catch(rej=>{
if(rej==='定位未开启'){
getApp().globalData.locationPermise =false
location_city("beijing").then((res) => {
var city = res.city_info.city_name;
var city_id = res.city_info.city_id;
getApp().globalData.city_id = city_id;
this.refresh_info(city_id);
})
}
})
} else { } else {
this.refresh_info(getApp().globalData.city_id); this.refresh_info(getApp().globalData.city_id);
} }

@ -19419,6 +19419,7 @@ var location_city = function location_city() {
success: function success(res) { success: function success(res) {
console.log(res); console.log(res);
if (!res.longitude) { if (!res.longitude) {
reject('定位未开启');
setting(); setting();
return; return;
} }
@ -19435,6 +19436,8 @@ var location_city = function location_city() {
}); });
}, },
fail: function fail(res) { fail: function fail(res) {
// reject('定位失败,下拉重试或点击选择城市')
reject('定位未开启');
setting(); setting();
} }); } });
@ -19448,7 +19451,8 @@ var setting = function setting() {
var statu = res.authSetting; var statu = res.authSetting;
if (!statu['scope.userLocation']) {//判断是否授权,没有授权就提示下面的信息 if (!statu['scope.userLocation']) {//判断是否授权,没有授权就提示下面的信息
wx.showModal({ wx.showModal({
title: '需要获取您的地理位置,请确认授权定位,否则小程序功能将无法使用', // title: '需要获取您的地理位置,请确认授权定位,否则小程序功能将无法使用',
title: '需要获取您的地理位置,请确认授权定位,当前定位为北京',
cancelColor: '#666666', cancelColor: '#666666',
success: function success(tip) { success: function success(tip) {
if (tip.confirm) {//查看是否点击确定 if (tip.confirm) {//查看是否点击确定
@ -19486,11 +19490,11 @@ var setting = function setting() {
} }); } });
} else { } else {
wx.showToast({ // wx.showToast({
title: '首页下拉重新授权定位!', // title: '重新进入小程序唤起定位授权',
icon: 'error', // icon: 'error',
duration: 1000 }); // duration: 1000
// })
} }
} }); } });

@ -1 +1 @@
<view><block a:if="{{isActionMarkShow}}"><view data-event-opts="{{[['touchStart',[['buttonStart',['$event']]]],['touchMove',[['buttonMove',['$event']]]]]}}" class="markinfo" onTouchStart="__e" catchTouchMove="__e"><view class="fiexbox"><view class="box" data-id="{{screen_list.id}}" data-link_url="{{screen_list.link_url}}" data-event-opts="{{[['tap',[['onlinkurl',['$event']]]]]}}" onTap="__e"><image src="{{screen_list.img_url}}"></image></view><view class="btn" data-id="{{screen_list.id}}" data-event-opts="{{[['tap',[['cancle_mark',['$event']]]]]}}" catchTap="__e">×</view></view></view></block><block a:if="{{isGiftMarkShow}}"><view data-event-opts="{{[['tap',[['advertisementMark_show',['$event']]]]]}}" class="surprise" onTap="__e"><view class="img"></view></view></block><view class="banner"><swiper class="swiper" autoplay="{{true}}" interval="2000" duration="500" previous-margin="20px" next-margin="20px" circular="{{true}}" data-event-opts="{{[['change',[['bindchange',['$event']]]]]}}" onChange="__e"><swiper-item class="swiper_item" a:for="{{banner_list}}" a:for-item="item" a:for-index="index" a:key="index"><image class="{{('img '+(swiperIdx==index?'active':'quiet'))}}" src="{{item.pic}}" data-key="{{item.route_path+item.key}}" data-event-opts="{{[['tap',[['banner_nav',['$event']]]]]}}" onTap="__e"></image><view class="shadow"></view></swiper-item></swiper><view class="indicator_dsn"><view class="{{('dot '+(swiperIdx==index?'active':'quiet'))}}" a:for="{{banner_list}}" a:for-item="item" a:for-index="index" a:key="index"></view></view></view><view class="search_area"><view class="cal"><image src="/static/images/ui/calendar.png" data-event-opts="{{[['tap',[['calendar_nav',['$event']]]]]}}" onTap="__e"></image></view><view class="_search"><view class="_search1"><text data-event-opts="{{[['tap',[['area_nav',['$event']]]]]}}" onTap="__e">{{city||'定位失败下拉重新获取'}}</text><block a:if="{{city}}"><text style="color:#ff446b;" decode="{{true}}"></text></block><view data-event-opts="{{[['tap',[['search1',['$event']]]]]}}" style="flex:1;color:#ACACAC;" onTap="__e">{{placeholder}}</view></view><image src="/static/images/ui/search.png" data-event-opts="{{[['tap',[['search1',['$event']]]]]}}" onTap="__e"></image></view></view><view class="line"><view class="{{('topLine '+(swith_area==index?'active':' '))}}" data-index="{{index}}" data-event-opts="{{[['tap',[['swith_tab',['$event']]]]]}}" onTap="__e" a:for="{{swich_space}}" a:for-item="item" a:for-index="index" a:key="index">{{''+item+''}}</view></view><view class="_list"><view class="_demo" data-cycle_id="{{item.cycle_id}}" data-event-opts="{{[['tap',[['show_detail',['$event']]]]]}}" onTap="__e" a:for="{{current_list}}" a:for-item="item" a:for-index="index" a:key="index"><image class="list_img" src="{{item.show_pic}}"></image><view class="_ln flexC fd-col"><view><view class="_ln1"><text>{{item.start_date+"-"+item.end_date}}</text><block a:if="{{item.is_discount==1}}"><image src="/static/images/ui/low_price.png"></image></block></view><view class="_ln2"><text>{{item.show_name}}</text></view></view><view class="_ln3"><view class="_ln4"><text style="font-size:24rpx;color:#ff1d42;">¥</text><text style="font-size:36rpx;font-weight:bold;color:#ff1d42;margin:0 2rpx;">{{item.lowest_price}}</text><text style="font-size:20rpx;color:#7b7b7b;">起</text></view><button class="_detail" data-cycle_id="{{item.cycle_id}}">详情</button></view></view></view></view><block a:if="{{no_more}}"><view class="more">别滑了,已经到底啦~</view></block></view> <view><block a:if="{{isActionMarkShow}}"><view data-event-opts="{{[['touchStart',[['buttonStart',['$event']]]],['touchMove',[['buttonMove',['$event']]]]]}}" class="markinfo" onTouchStart="__e" catchTouchMove="__e"><view class="fiexbox"><view class="box" data-id="{{screen_list.id}}" data-link_url="{{screen_list.link_url}}" data-event-opts="{{[['tap',[['onlinkurl',['$event']]]]]}}" onTap="__e"><image src="{{screen_list.img_url}}"></image></view><view class="btn" data-id="{{screen_list.id}}" data-event-opts="{{[['tap',[['cancle_mark',['$event']]]]]}}" catchTap="__e">×</view></view></view></block><block a:if="{{isGiftMarkShow}}"><view data-event-opts="{{[['tap',[['advertisementMark_show',['$event']]]]]}}" class="surprise" onTap="__e"><view class="img"></view></view></block><view class="banner"><swiper class="swiper" autoplay="{{true}}" interval="2000" duration="500" previous-margin="20px" next-margin="20px" circular="{{true}}" data-event-opts="{{[['change',[['bindchange',['$event']]]]]}}" onChange="__e"><swiper-item class="swiper_item" a:for="{{banner_list}}" a:for-item="item" a:for-index="index" a:key="index"><image class="{{('img '+(swiperIdx==index?'active':'quiet'))}}" src="{{item.pic}}" data-key="{{item.route_path+item.key}}" data-event-opts="{{[['tap',[['banner_nav',['$event']]]]]}}" onTap="__e"></image><view class="shadow"></view></swiper-item></swiper><view class="indicator_dsn"><view class="{{('dot '+(swiperIdx==index?'active':'quiet'))}}" a:for="{{banner_list}}" a:for-item="item" a:for-index="index" a:key="index"></view></view></view><view class="search_area"><view class="cal"><image src="/static/images/ui/calendar.png" data-event-opts="{{[['tap',[['calendar_nav',['$event']]]]]}}" onTap="__e"></image></view><view class="_search"><view class="_search1"><text data-event-opts="{{[['tap',[['area_nav',['$event']]]]]}}" onTap="__e">{{city}}</text><block a:if="{{city}}"><text style="color:#ff446b;" decode="{{true}}"></text></block><view data-event-opts="{{[['tap',[['search1',['$event']]]]]}}" style="flex:1;color:#ACACAC;" onTap="__e">{{placeholder}}</view></view><image src="/static/images/ui/search.png" data-event-opts="{{[['tap',[['search1',['$event']]]]]}}" onTap="__e"></image></view></view><view class="line"><view class="{{('topLine '+(swith_area==index?'active':' '))}}" data-index="{{index}}" data-event-opts="{{[['tap',[['swith_tab',['$event']]]]]}}" onTap="__e" a:for="{{swich_space}}" a:for-item="item" a:for-index="index" a:key="index">{{''+item+''}}</view></view><view class="_list"><view class="_demo" data-cycle_id="{{item.cycle_id}}" data-event-opts="{{[['tap',[['show_detail',['$event']]]]]}}" onTap="__e" a:for="{{current_list}}" a:for-item="item" a:for-index="index" a:key="index"><image class="list_img" src="{{item.show_pic}}"></image><view class="_ln flexC fd-col"><view><view class="_ln1"><text>{{item.start_date+"-"+item.end_date}}</text><block a:if="{{item.is_discount==1}}"><image src="/static/images/ui/low_price.png"></image></block></view><view class="_ln2"><text>{{item.show_name}}</text></view></view><view class="_ln3"><view class="_ln4"><text style="font-size:24rpx;color:#ff1d42;">¥</text><text style="font-size:36rpx;font-weight:bold;color:#ff1d42;margin:0 2rpx;">{{item.lowest_price}}</text><text style="font-size:20rpx;color:#7b7b7b;">起</text></view><button class="_detail" data-cycle_id="{{item.cycle_id}}">详情</button></view></view></view></view><block a:if="{{no_more}}"><view class="more">别滑了,已经到底啦~</view></block></view>

@ -276,6 +276,16 @@ var _util = __webpack_require__(/*! ../../../utils/util */ 143);function _toCons
var city_id = res.city_info.city_id; var city_id = res.city_info.city_id;
getApp().globalData.city_id = city_id; getApp().globalData.city_id = city_id;
_this.refresh_info(city_id); _this.refresh_info(city_id);
}).catch(function (rej) {
if (rej === '定位未开启') {
getApp().globalData.locationPermise = false;
(0, _util.location_city)("beijing").then(function (res) {
var city = res.city_info.city_name;
var city_id = res.city_info.city_id;
getApp().globalData.city_id = city_id;
_this.refresh_info(city_id);
});
}
}); });
} else { } else {
this.refresh_info(getApp().globalData.city_id); this.refresh_info(getApp().globalData.city_id);

@ -207,6 +207,7 @@ const location_city = function() {
success(res) { success(res) {
console.log(res); console.log(res);
if (!res.longitude) { if (!res.longitude) {
reject('定位未开启')
setting() setting()
return return
} }
@ -223,6 +224,8 @@ const location_city = function() {
}) })
}, },
fail(res) { fail(res) {
// reject('定位失败,下拉重试或点击选择城市')
reject('定位未开启')
setting() setting()
} }
}) })
@ -236,7 +239,8 @@ const setting = function() {
var statu = res.authSetting; var statu = res.authSetting;
if (!statu['scope.userLocation']) { //判断是否授权,没有授权就提示下面的信息 if (!statu['scope.userLocation']) { //判断是否授权,没有授权就提示下面的信息
wx.showModal({ wx.showModal({
title: '需要获取您的地理位置,请确认授权定位,否则小程序功能将无法使用', // title: '需要获取您的地理位置,请确认授权定位,否则小程序功能将无法使用',
title: '需要获取您的地理位置,请确认授权定位,当前定位为北京',
cancelColor: '#666666', cancelColor: '#666666',
success: function(tip) { success: function(tip) {
if (tip.confirm) { //查看是否点击确定 if (tip.confirm) { //查看是否点击确定
@ -274,11 +278,11 @@ const setting = function() {
} }
}) })
} else { } else {
wx.showToast({ // wx.showToast({
title: '首页下拉重新授权定位!', // title: '重新进入小程序唤起定位授权',
icon: 'error', // icon: 'error',
duration: 1000 // duration: 1000
}) // })
} }
} }
}) })

Loading…
Cancel
Save