tianyi 2 weeks ago
parent
commit
98f0548397
  1. 23
      pages/index/index.vue

23
pages/index/index.vue

@ -5,16 +5,6 @@
<view style="position: relative;height: 545rpx;"> <view style="position: relative;height: 545rpx;">
<view style="width:100%;height: 260rpx;position: fixed;top: 0;background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;z-index: 90;" <view style="width:100%;height: 260rpx;position: fixed;top: 0;background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;z-index: 90;"
v-if="lastScrollTop>583"></view> v-if="lastScrollTop>583"></view>
<!-- <view style="position: absolute;top: 110rpx;left: 20rpx;z-index: 999;">
<view @click="checkArea" v-if="areaName == ''">
点击选择区域
<uni-icons type="right" size="12" style="margin-left: 10rpx;"></uni-icons>
</view>
<view @click="checkArea" v-else>
{{areaName}}
<uni-icons type="right" size="12" style="margin-left: 10rpx;"></uni-icons>
</view>
</view> -->
<view class="campus-hero campus-hero--ad"> <view class="campus-hero campus-hero--ad">
<swiper class="swiper hero-bg-swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" <swiper class="swiper hero-bg-swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
:interval="interval" :duration="duration"> :interval="interval" :duration="duration">
@ -974,6 +964,7 @@
isSwipeOrderActive(item, index) { isSwipeOrderActive(item, index) {
return this.swipeOrder.id === item.id && this.swipeOrder.index === index && this.swipeOrder.progress > 0 return this.swipeOrder.id === item.id && this.swipeOrder.index === index && this.swipeOrder.progress > 0
}, },
//
startSwipeOrder(event, item, index) { startSwipeOrder(event, item, index) {
const touch = event.touches && event.touches[0] const touch = event.touches && event.touches[0]
if (!touch) return if (!touch) return
@ -1004,6 +995,7 @@
const progress = Math.min(100, Math.round(deltaX / (trackWidth * 0.72) * 100)) const progress = Math.min(100, Math.round(deltaX / (trackWidth * 0.72) * 100))
this.setSwipeOrderProgress(progress) this.setSwipeOrderProgress(progress)
}, },
//
endSwipeOrder(item, index) { endSwipeOrder(item, index) {
if (this.swipeOrder.id !== item.id || this.swipeOrder.index !== index) return if (this.swipeOrder.id !== item.id || this.swipeOrder.index !== index) return
if (this.swipeOrder.progress >= 92 && !this.swipeOrder.confirmed) { if (this.swipeOrder.progress >= 92 && !this.swipeOrder.confirmed) {
@ -1174,6 +1166,7 @@
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}); }).catch((res) => {});
}, },
//广
goAdPage(item) { goAdPage(item) {
uni.navigateTo({ uni.navigateTo({
url: item.linkUrl + item.linkParams url: item.linkUrl + item.linkParams
@ -1208,6 +1201,7 @@
url: '/package2/seckill/seckillGroup' url: '/package2/seckill/seckillGroup'
}) })
}, },
//
goDetail(type) { goDetail(type) {
let url = '' let url = ''
switch (type) { switch (type) {
@ -1231,11 +1225,13 @@
url: url url: url
}) })
}, },
//
goOrderDetail(item) { goOrderDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: '/package1/order/orderDetail?id=' + item.id url: '/package1/order/orderDetail?id=' + item.id
}); });
}, },
//
onClickArea(item) { onClickArea(item) {
uni.setStorageSync('area', JSON.stringify(item)) uni.setStorageSync('area', JSON.stringify(item))
this.areaName = item.title this.areaName = item.title
@ -1272,6 +1268,7 @@
} }
}) })
}, },
//
getShopArea() { getShopArea() {
let that = this let that = this
that.tui.request("/app/shopArea/getByParentId/" + that.searchForm.regionId, "GET", {}, false, true).then(( that.tui.request("/app/shopArea/getByParentId/" + that.searchForm.regionId, "GET", {}, false, true).then((
@ -1287,6 +1284,7 @@
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
//
getUserOrders() { getUserOrders() {
let that = this let that = this
that.tui.request("/mall/order/getOrdersByUserId/" + uni.getStorageSync('id'), "GET", {}, false, true).then( that.tui.request("/mall/order/getOrdersByUserId/" + uni.getStorageSync('id'), "GET", {}, false, true).then(
@ -1302,6 +1300,7 @@
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
//
searchOrder(type, value) { searchOrder(type, value) {
if (type == 'getarea') { if (type == 'getarea') {
if (this.searchForm.getAreaId == value.id) { if (this.searchForm.getAreaId == value.id) {
@ -1358,6 +1357,7 @@
fail: (err) => {} fail: (err) => {}
}); });
}, },
//
checkTab1(type) { checkTab1(type) {
this.checked = type this.checked = type
if (type == 'waimai') { if (type == 'waimai') {
@ -1395,6 +1395,7 @@
}); });
}).exec(); }).exec();
}, },
//
makeCall(phone) { makeCall(phone) {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone phoneNumber: phone
@ -1406,9 +1407,11 @@
clearInterval(this.deliveryTimer); clearInterval(this.deliveryTimer);
} }
}, },
//
checkAdd() { checkAdd() {
this.isgetArea = !this.isgetArea this.isgetArea = !this.isgetArea
}, },
//
checkAdd1() { checkAdd1() {
this.isputArea = !this.isputArea this.isputArea = !this.isputArea
}, },

Loading…
Cancel
Save