...
|
...
|
@@ -68,7 +68,7 @@ |
|
|
</view>
|
|
|
<view class="homename">秒杀专区</view>
|
|
|
</view>
|
|
|
<view class="homeboxitem flexfour">
|
|
|
<view class="homeboxitem flexfour" @click="hotline">
|
|
|
<view class="homeitemimg">
|
|
|
<image src="../../static/hotline.png" mode=""></image>
|
|
|
</view>
|
...
|
...
|
@@ -141,9 +141,9 @@ |
|
|
<view class="jiimg">
|
|
|
<image src="../../static/ji.png" mode=""></image>
|
|
|
<view class="jitext">
|
|
|
<view class="jiname">+5积分</view>
|
|
|
<view class="jiname">+{{qiandaoinfo.score}}积分</view>
|
|
|
<view class="qian">每日签到</view>
|
|
|
<view class="lianxu lianqianday">连续签到22天</view>
|
|
|
<view class="lianxu lianqianday">{{qiandaoinfo.title}}</view>
|
|
|
<view class="lianxu">明天签到可获得10积分</view>
|
|
|
</view>
|
|
|
<view class="chahao" @click="hidejifen">
|
...
|
...
|
@@ -152,9 +152,9 @@ |
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
|
|
|
<!-- @click="tabClick" -->
|
|
|
<tabBar :current="currentTabIndex" backgroundColor="#fbfbfb" color="#999" tintColor="#42b983" ></tabBar>
|
|
|
<tabBar :current="currentTabIndex" backgroundColor="#fbfbfb" color="#999" tintColor="#42b983"></tabBar>
|
|
|
<!-- 底部导航 -->
|
|
|
<!-- <view class="teacherfooter">
|
|
|
<view class="teacherfootitem" @click="selnav" :data-id="1">
|
...
|
...
|
@@ -189,9 +189,9 @@ |
|
|
import app from "../../App.vue";
|
|
|
import tabBar from '../../components/tabvue/tabvue.vue'
|
|
|
export default {
|
|
|
components:{
|
|
|
tabBar
|
|
|
},
|
|
|
components: {
|
|
|
tabBar
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
showbanben: false,
|
...
|
...
|
@@ -201,62 +201,71 @@ |
|
|
order: '',
|
|
|
page: 1,
|
|
|
shoplist: [],
|
|
|
carttotal:0,
|
|
|
provincename:'',
|
|
|
currentTabIndex:0
|
|
|
carttotal: 0,
|
|
|
provincename: '',
|
|
|
currentTabIndex: 0,
|
|
|
datamianfang:false,
|
|
|
qiandaoinfo:''
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.getfoodlist();
|
|
|
// uni.setStorageSync("token","")
|
|
|
|
|
|
|
|
|
this.getfoodlist();
|
|
|
// uni.setStorageSync("token","")
|
|
|
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
// tabClick(index){
|
|
|
// this.currentTabIndex=index;
|
|
|
// console.log('我是homepage',this.currentTabIndex)
|
|
|
// },
|
|
|
// 拨打电话
|
|
|
hotline() {
|
|
|
uni.makePhoneCall({
|
|
|
phoneNumber: '114' //仅为示例
|
|
|
});
|
|
|
},
|
|
|
// 获取签到信息
|
|
|
getqiandaoinfo(){
|
|
|
getqiandaoinfo() {
|
|
|
let that = this;
|
|
|
var url = 'sign/index';
|
|
|
var params = {
|
|
|
|
|
|
|
|
|
}
|
|
|
console.log(params)
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
|
|
|
console.log('获取签到信息',res);
|
|
|
that.qiandaoinfo=res.data.data
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
|
|
|
})
|
|
|
},
|
|
|
// 签到
|
|
|
qiandao(){
|
|
|
qiandao() {
|
|
|
let that = this;
|
|
|
var url = 'sign/sign';
|
|
|
var params = {
|
|
|
|
|
|
|
|
|
}
|
|
|
console.log(params)
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
getlocation() {
|
|
|
let that=this;
|
|
|
let that = this;
|
|
|
uni.getLocation({
|
|
|
type: 'wgs84',
|
|
|
success: function(res) {
|
|
|
console.log('当前位置的经度:' + res.longitude);
|
|
|
console.log('当前位置的纬度:' + res.latitude);
|
|
|
uni.setStorageSync("longitude",res.longitude);
|
|
|
uni.setStorageSync("latitude",res.latitude)
|
|
|
uni.setStorageSync("longitude", res.longitude);
|
|
|
uni.setStorageSync("latitude", res.latitude)
|
|
|
var point = new plus.maps.Point(res.longitude, res.latitude);
|
|
|
plus.maps.Map.reverseGeocode(
|
|
|
point, {},
|
...
|
...
|
@@ -268,26 +277,26 @@ |
|
|
console.log(address, 'address');
|
|
|
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
|
|
|
console.log(address.match(reg));
|
|
|
var addressname=address.match(reg);
|
|
|
var addressname = address.match(reg);
|
|
|
console.log(addressname);
|
|
|
|
|
|
if(uni.getStorageSync("provincename")==''){
|
|
|
that.provincename=addressname[0];
|
|
|
uni.setStorageSync("provincename",that.provincename)
|
|
|
}else{
|
|
|
that.provincename=uni.getStorageSync("provincename")
|
|
|
|
|
|
if (uni.getStorageSync("provincename") == '') {
|
|
|
that.provincename = addressname[0];
|
|
|
uni.setStorageSync("provincename", that.provincename)
|
|
|
} else {
|
|
|
that.provincename = uni.getStorageSync("provincename")
|
|
|
}
|
|
|
|
|
|
|
|
|
console.log(that.provincename);
|
|
|
that.changeinfo()
|
|
|
// that.getprovinceid()
|
|
|
|
|
|
|
|
|
// _this.addressList = address.match(reg).toString().split(",");
|
|
|
// _this.address = _this.addressList[1];
|
|
|
// console.log(_this.addressList[0]);
|
|
|
// console.log(_this.addressList[1]);
|
|
|
// console.log(_this.addressList[2]);
|
|
|
|
|
|
|
|
|
},
|
|
|
function(e) {}
|
|
|
);
|
...
|
...
|
@@ -295,49 +304,49 @@ |
|
|
});
|
|
|
},
|
|
|
// 修改个人信息
|
|
|
changeinfo(){
|
|
|
changeinfo() {
|
|
|
let that = this;
|
|
|
var url = 'member/update_user';
|
|
|
var params = {
|
|
|
|
|
|
longitude:uni.getStorageSync("longitude"),
|
|
|
latitude:uni.getStorageSync("latitude")
|
|
|
|
|
|
longitude: uni.getStorageSync("longitude"),
|
|
|
latitude: uni.getStorageSync("latitude")
|
|
|
}
|
|
|
console.log(params)
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
this.carttotal=res.data.data.total
|
|
|
this.carttotal = res.data.data.total
|
|
|
}).catch((err) => {
|
|
|
|
|
|
|
|
|
})
|
|
|
},
|
|
|
// 获取购物车气泡
|
|
|
getcartnum(){
|
|
|
getcartnum() {
|
|
|
let that = this;
|
|
|
var url = 'car/bubble';
|
|
|
var params = {
|
|
|
|
|
|
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
this.carttotal=res.data.data.total
|
|
|
this.carttotal = res.data.data.total
|
|
|
}).catch((err) => {
|
|
|
|
|
|
|
|
|
})
|
|
|
},
|
|
|
// 店铺收藏
|
|
|
collectshop(){
|
|
|
let token=uni.getStorageSync("token");
|
|
|
if(token==''){
|
|
|
collectshop() {
|
|
|
let token = uni.getStorageSync("token");
|
|
|
if (token == '') {
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/login/loginindex'
|
|
|
url: '/pages/login/loginindex'
|
|
|
})
|
|
|
}else{
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
url:"/pages/homepage/collectshop"
|
|
|
url: "/pages/homepage/collectshop"
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
// 抽奖专区
|
|
|
choujiang() {
|
...
|
...
|
@@ -346,37 +355,37 @@ |
|
|
})
|
|
|
},
|
|
|
// 购物车列表
|
|
|
cartlist(){
|
|
|
let token=uni.getStorageSync("token");
|
|
|
if(token==''){
|
|
|
cartlist() {
|
|
|
let token = uni.getStorageSync("token");
|
|
|
if (token == '') {
|
|
|
uni.redirectTo({
|
|
|
url:'/pages/login/loginindex?type=1'
|
|
|
url: '/pages/login/loginindex?type=1'
|
|
|
})
|
|
|
}else{
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/nearshop/cartlist'
|
|
|
url: '/pages/nearshop/cartlist'
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
// 会员卡
|
|
|
huiyuanka(){
|
|
|
let token=uni.getStorageSync("token");
|
|
|
if(token==''){
|
|
|
huiyuanka() {
|
|
|
let token = uni.getStorageSync("token");
|
|
|
if (token == '') {
|
|
|
uni.navigateTo({
|
|
|
url:"/pages/login/loginindex"
|
|
|
url: "/pages/login/loginindex"
|
|
|
})
|
|
|
}else{
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/usercenter/usercenter'
|
|
|
url: '/pages/usercenter/usercenter'
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
// 覆盖城市
|
|
|
gocityfugai(){
|
|
|
gocityfugai() {
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/homepage/map'
|
|
|
url: '/pages/homepage/map'
|
|
|
})
|
|
|
},
|
|
|
// 获取面访商品列表
|
...
|
...
|
@@ -390,9 +399,11 @@ |
|
|
pageNum: 6
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
that.shoplist = res.data.data
|
|
|
|
|
|
console.log('面坊列表', res);
|
|
|
that.shoplist = that.shoplist.concat(res.data.data)
|
|
|
if (res.data.data.length == 0) {
|
|
|
that.datamianfang=true
|
|
|
}
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
...
|
...
|
@@ -466,16 +477,35 @@ |
|
|
}
|
|
|
},
|
|
|
},
|
|
|
onShow(){
|
|
|
onShow() {
|
|
|
uni.hideTabBar({
|
|
|
|
|
|
|
|
|
})
|
|
|
// this.page = 1;
|
|
|
// this.shoplist=[];
|
|
|
|
|
|
this.getlocation();
|
|
|
this.getqiandaoinfo();
|
|
|
let token=uni.getStorageSync("token");
|
|
|
if(token!=''){
|
|
|
let token = uni.getStorageSync("token");
|
|
|
if (token != '') {
|
|
|
this.getcartnum()
|
|
|
}
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
if(this.datamianfang==true){
|
|
|
uni.showToast({
|
|
|
title:'没有更多了~',
|
|
|
icon:"none"
|
|
|
})
|
|
|
}else{
|
|
|
let newpage = this.page;
|
|
|
newpage++;
|
|
|
this.page = newpage;
|
|
|
this.getfoodlist()
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
@@ -483,19 +513,22 @@ |
|
|
|
|
|
<style>
|
|
|
@import url('../../base/homepage');
|
|
|
.middleenter{
|
|
|
color:#BDC4CE;
|
|
|
|
|
|
.middleenter {
|
|
|
color: #BDC4CE;
|
|
|
font-size: 24rpx;
|
|
|
height:60rpx;
|
|
|
height: 60rpx;
|
|
|
line-height: 60rpx;
|
|
|
}
|
|
|
|
|
|
|
|
|
.content {
|
|
|
padding-top: calc(var(--status-bar-height) + 88rpx);
|
|
|
}
|
|
|
|
|
|
.status_bar {
|
|
|
background: ;
|
|
|
}
|
|
|
|
|
|
.lianxu {
|
|
|
color: #3D444C;
|
|
|
font-size: 28rpx;
|
...
|
...
|
@@ -551,7 +584,7 @@ |
|
|
}
|
|
|
|
|
|
.listbox {
|
|
|
margin-bottom: 150rpx;
|
|
|
margin-bottom: 20rpx;
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|