You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
jiansheng/pages/index/index.vue

447 lines
8.9 KiB

<template>
<view>
<image src="@/static/bg.png" mode="" style="width: 100%;height: 928rpx;"></image>
<view class="top">
<image class="dw" src="@/static/定位.png" mode="" style="width: 30rpx;height: 30rpx;"></image>
<view class="xuzou">{{city}}</view>
<!-- <picker @change="bindPickerChange" :value="index" :range="array">
<image class="jiantou" src="@/static/jiantou.png" mode="" style="width: 15rpx;height: 15rpx;"></image>
</picker> -->
</view>
<view class="topimg">
<image class="topimg1" :src="tuijianlist[0].image.url" mode=""></image>
</view>
<view class="mendian">
<view class="mendian1">
<view class="tj">门店推荐</view>
<view class="" @click="mendianlist">
找门店<uni-icons type="right" size="18"></uni-icons>
</view>
</view>
<view class="mddz" v-for="(item,index) in tuijianlist" :key="index">
<view class="mddz1">
<image class="mddz1img" :src="item.image.url" mode=""></image>
<view class="mddz1wz">{{item.name}}</view>
</view>
<view class="mddz2">
<view style='width:570rpx' @click="handleNavigation(item)">
<image class="mddz1img1" src="@/static/定位1.png" mode=""></image>
<text class="dz">{{item.address}}</text>
</view>
<image class="mddz1img2" src="@/static/电话o.png" mode="" @click="makePhoneCall(item.mobile)"></image>
</view>
</view>
</view>
<view class="btn" @click="tuanquan">
<view class="btnwz">团购验券</view>
<view class="btnwz1">美团/抖音验券进场</view>
</view>
<view class="hy">会员套餐</view>
<view class="btboxs">
<view class="btbox" v-for="(item,index) in viplist" :key="index" @click="taochan(item)">
<image :src="item.img.url" mode="" class="btimg"></image>
<view class="bttitle">{{item.name}}</view>
<view class="btwz">期限:{{item.validity_day}}</view>
<view class="btwzjg">
<text class="btwzjg1">¥{{item.price}}</text>
<text class="btwzjg2">原件:¥{{item.original_price}}</text>
</view>
</view>
</view>
<uni-popup ref="popup" background-color="#fff" :mask-click='false'>
<view class="popbox">
<view class="close">
<image src="@/static/close-l.png" mode="" style="width: 44rpx;height: 44rpx;" @click="close">
</image>
</view>
<view class="popuptitle">
团购验券
</view>
<view class="input">
<input class="input1" type="text" placeholder="请输入抖音/美团券码" v-model="number"/>
<image class="saoma" src="@/static/扫一扫.png" mode=""></image>
</view>
<view class="yqbtn" @click="numberCheck">
验券
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
city:'',
number:'',
viplist:[],
mendainlist:[],
latitude:'',
longitude:'',
tuijianlist:[],
}
},
onShow() {
this.cardList(1)
// this.storeList(1)
this.getLocation()
},
methods: {
handleNavigation(i) {
uni.openLocation({
longitude:Number(i.longitude),
latitude:Number(i.latitude),
name:i.name,
address: i.address,
success: function(res) {
console.log('打开系统位置地图成功')
},
fail: function(error) {
console.log(error)
}
})
},
numberCheck(){
this.$api.numberCheck({number:this.number}).then(res=>{
if(res.data.code==200){
uni.showToast({
icon: "none",
title: res.data.msg,
duration: 3000
});
this.$refs.popup.close('center')
}
})
},
getLocation(){
console.log(1234);
var that=this
uni.getLocation({
type: 'wgs84',
success: function (res) {
that.latitude= res.latitude;
that.longitude= res.longitude;
that.$api.nearStore({latitude:that.latitude,longitude:that.longitude,limit:1}).then(res=>{
that.tuijianlist=res.data
})
that.$api.ipGetCity().then(res=>{
console.log('res',res);
that.city=res.data.city
})
},
fail: function (error) {
console.error('获取位置失败:', error);
}
});
},
cardList(page){
this.$api.cardList({page:page}).then(res=>{
console.log(123,res);
this.viplist=res.data.list
})
},
storeList(page){
this.$api.storeList({page:page}).then(res=>{
this.mendainlist=res.data.list
})
},
makePhoneCall(e){
uni.makePhoneCall({
phoneNumber: e //仅为示例
});
},
mendianlist() {
uni.navigateTo({
url: '/pages/mendainlist/mendainlist?item='+'shouye'
})
},
tuanquan() {
this.$refs.popup.open('center')
},
close() {
this.$refs.popup.close('center')
},
taochan(i) {
uni.setStorageSync('xzmd','')
var that=this
var tuijianlist=JSON.stringify(that.tuijianlist[0])
var item=JSON.stringify(i)
uni.navigateTo({
url: `/pages/order/order?tuijianlist=${tuijianlist}&item=${item}`
})
},
}
}
</script>
<style scoped>
.yqbtn {
width: 550rpx;
height: 90rpx;
background: #F8A617;
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(19, 14, 4, 0.08);
border-radius: 45rpx;
text-align: center;
line-height: 90rpx;
margin: 0 auto;
margin-top: 35rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
}
.input1 {
height: 91rpx;
}
.saoma {
width: 44rpx;
height: 44rpx;
position: relative;
left: 481rpx;
top: -70rpx
}
.input {
width: 531rpx;
height: 91rpx;
background: #FFFFFF;
border-radius: 10rpx;
border: 1px solid #CCCCCC;
padding: 0 20rpx;
margin: 0 auto;
margin-top: 48rpx;
/* background: url("@/static/扫一扫.png") no-repeat;
background-position: 501rpx 15px;
background-size: 44rpx; */
}
.popbox {
width: 630rpx;
height: 400rpx;
background: #FFFFFF;
border-radius: 20rpx;
}
.popuptitle {
font-family: PingFang SC;
font-weight: 500;
font-size: 36rpx;
color: #222222;
text-align: center;
margin-top: -20rpx;
}
.close {
text-align: right;
padding-right: 30rpx;
padding-top: 24rpx;
}
.btbox {
width: 340rpx;
margin-left: 24rpx;
background: #FFFFFF;
margin-top: 30rpx;
}
.btboxs {
display: flex;
}
.btwz {
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 24rpx;
color: #999999;
margin-top: 15rpx;
margin-left: 24rpx;
}
.btwzjg {
margin-top: 15rpx;
margin-left: 24rpx;
margin-bottom: 26rpx;
}
.btwzjg1 {
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 30rpx;
color: #EF3D25;
}
.btwzjg2 {
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 24rpx;
color: #CCCCCC;
padding-left: 15rpx;
text-decoration-line: line-through;
}
.bttitle {
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 30rpx;
color: #333333;
margin-top: 15rpx;
margin-left: 24rpx;
}
.btimg {
width: 340rpx;
height: 200rpx;
}
.hy {
font-family: PingFang SC;
font-weight: bold;
font-size: 34rpx;
color: #222222;
margin-top: 40rpx;
margin-left: 22rpx;
}
.btn {
text-align: center;
width: 700rpx;
height: 120rpx;
background: #F8A617;
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(19, 14, 4, 0.14);
border-radius: 60rpx;
margin: 0 auto;
margin-top: 20rpx;
}
.btnwz {
font-family: PingFang SC;
font-weight: bold;
font-size: 30rpx;
color: #FFFFFF;
padding-top: 23rpx;
margin-bottom: 17rpx;
}
.btnwz1 {
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
}
.mddz1img2 {
width: 44rpx;
height: 44rpx;
position: absolute;
right: 70rpx;
}
.mddz2 {
margin-top: 32rpx;
display: flex;
}
.dz {
margin-left: 17rpx;
}
.mddz1img1 {
width: 22rpx;
height: 27rpx;
}
.mddz1 {
display: flex;
}
.mddz1img {
width: 60rpx;
height: 60rpx;
}
.mddz1wz {
font-family: PingFang SC;
font-weight: bold;
font-size: 30rpx;
color: #222222;
margin-left: 21rpx;
margin-top: 12rpx;
}
.mddz {
width: 643rpx;
/* height: 142rpx; */
background: #FFFFFF;
box-shadow: 0rpx 3rpx 9rpx 0rpx rgba(19, 14, 4, 0.08);
border-radius: 20rpx;
margin-top: 24rpx;
padding: 20rpx 17rpx;
}
.tj {
font-family: PingFang SC;
font-weight: bold;
font-size: 34rpx;
color: #222222;
}
.mendian1 {
display: flex;
justify-content: space-between;
}
.mendian {
width: 670rpx;
/* height: 278rpx; */
background: #EBEFF0;
border-radius: 20rpx;
margin: 0 auto;
margin-top: 20rpx;
padding: 29rpx 23rpx;
}
.top {
display: flex;
position: absolute;
top: 96rpx;
}
.jiantou {
margin-left: 18rpx;
margin-top: 10rpx;
}
.xuzou {
margin-left: 13rpx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 30rpx;
color: #222222;
}
.dw {
margin-top: 2rpx;
margin-left: 22rpx;
}
.topimg {
width: 700rpx;
height: 361rpx;
background: #E1E5E6;
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(19, 14, 4, 0.14);
border-radius: 20rpx;
margin: 0 auto;
margin-top: -750rpx;
}
.topimg1 {
width: 700rpx;
height: 361rpx;
}
</style>