|
@@ -9,8 +9,8 @@
|
|
|
<!-- 搜素栏 -->
|
|
|
<view class="search flex">
|
|
|
<image src="../../static/icon/address.png" class="address"></image>
|
|
|
- <view class="shop-name clamp">满园春台州店11111111</view>
|
|
|
- <view class="input-box flex" @click="clickSearch">
|
|
|
+ <view class="shop-name clamp" @click.stop="nav('/pages/shoping/list')">{{store_name}}</view>
|
|
|
+ <view class="input-box flex" @click.stop="clickSearch">
|
|
|
<view class=" input-content flex">
|
|
|
<view class="iconfont iconsearch"></view>
|
|
|
<view class="input"><input type="text" disabled value="输入关键字搜索" /></view>
|
|
@@ -71,10 +71,10 @@
|
|
|
<view class="commodity-item" v-for="(item, index) in goodsList" :key="item.id">
|
|
|
<image class="commodity-image" :src="item.image" mode=""></image>
|
|
|
<view class="commodity-title clamp">{{ item.store_name }}</view>
|
|
|
- <view class="price">¥{{ item.price }}</view>
|
|
|
+ <view class="price">¥{{ item.ot_price }}</view>
|
|
|
<view class="vip-price">
|
|
|
<image src="../../static/icon/jf.png" mode=""></image>
|
|
|
- <text>{{ item.vip_price }}</text>
|
|
|
+ <text>{{ item.price }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -88,7 +88,7 @@
|
|
|
<view class="main-synopsis">买多赚多</view>
|
|
|
</view>
|
|
|
<view class="main-content ">
|
|
|
- <view class="content-top flex xfq" @click="nav('/pages/prefecture/consumer')">
|
|
|
+ <view class="content-top flex xfq" @click="nav('/pages/prefecture/voucher')">
|
|
|
<view class="content-font">
|
|
|
<view class="content-title">精选好货 平台推荐</view>
|
|
|
<view class="content-synopsis">消费券兑换</view>
|
|
@@ -96,13 +96,13 @@
|
|
|
<image src="../../static/icon/fanhui.png" class="go" mode=""></image>
|
|
|
</view>
|
|
|
<view class="commodity flex">
|
|
|
- <view class="commodity-item" v-for="(item, index) in goodsList" :key="item.id">
|
|
|
+ <view class="commodity-item" v-for="(item, index) in bastList" :key="item.id">
|
|
|
<image class="commodity-image" :src="item.image" mode=""></image>
|
|
|
<view class="commodity-title clamp">{{ item.store_name }}</view>
|
|
|
- <view class="price">¥{{ item.price }}</view>
|
|
|
+ <view class="price">¥{{ item.ot_price }}</view>
|
|
|
<view class="vip-price">
|
|
|
<image src="../../static/icon/xfq.png" mode=""></image>
|
|
|
- <text>{{ item.vip_price }}</text>
|
|
|
+ <text>{{ item.price }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -120,11 +120,11 @@
|
|
|
{{ item.store_name }}
|
|
|
</view>
|
|
|
<view class="price-box flex">
|
|
|
- <view class="yuanprice">{{ item.price }}</view>
|
|
|
+ <view class="yuanprice">{{ item.ot_price }}</view>
|
|
|
<image src="../../static/icon/down.png" mode=""></image>
|
|
|
- <view class="jiang">直降{{ (item.vip_price - item.price).toFixed(2) }}元</view>
|
|
|
+ <view class="jiang">直降{{ (item.ot_price - item.price).toFixed(2) }}元</view>
|
|
|
</view>
|
|
|
- <view class="price">¥{{ item.vip_price }}</view>
|
|
|
+ <view class="price">¥{{ item.price }}</view>
|
|
|
<view class="btn">立即购买</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -134,10 +134,14 @@
|
|
|
|
|
|
<script>
|
|
|
import seckill from './seckill';
|
|
|
-import { loadIndexs } from '@/api/index.js';
|
|
|
+import { loadIndexs,store_list } from '@/api/index.js';
|
|
|
import { interceptor } from '@/utils/loginUtils';
|
|
|
import { userinfo } from '@/api/user.js';
|
|
|
import { mapState } from 'vuex';
|
|
|
+import { getProducts } from '@/api/product.js';
|
|
|
+// #ifdef H5
|
|
|
+import { weixindata } from '@/utils/wxAuthorized';
|
|
|
+// #endif
|
|
|
export default {
|
|
|
components: {
|
|
|
seckill
|
|
@@ -152,9 +156,12 @@ export default {
|
|
|
titleNViewBackground: '',
|
|
|
swiperCurrent: 0,
|
|
|
swiperLength: 0,
|
|
|
+ longitude:121.436289,//经度
|
|
|
+ latitude:28.651485,//纬度
|
|
|
+ store_name:'',//门店姓名
|
|
|
carouselList: [], //轮播列表
|
|
|
- goodsList: [], //最新商品列表
|
|
|
- bastList: [], //精品推荐列表
|
|
|
+ goodsList: [], //积分商品列表
|
|
|
+ bastList: [], //消费券商品列表
|
|
|
bastBanner: [], //促销商品列表
|
|
|
menusList: [], //头部菜单
|
|
|
userServant: [
|
|
@@ -169,11 +176,13 @@ export default {
|
|
|
...mapState('user', ['hasLogin', 'userInfo'])
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
+
|
|
|
let agree = uni.getStorageSync('agree') || false;
|
|
|
// 判断是否已经同意协议
|
|
|
if (!agree) {
|
|
|
uni.redirectTo({ url: '/pages/contract/start' });
|
|
|
}
|
|
|
+
|
|
|
if (option.spread) {
|
|
|
// 存储邀请人
|
|
|
uni.setStorage({
|
|
@@ -192,6 +201,39 @@ export default {
|
|
|
console.log(e);
|
|
|
});
|
|
|
}
|
|
|
+ // // #ifdef H5
|
|
|
+ // weixindata().then(wxOjb => {
|
|
|
+ // console.log(wxOjb,'123456798')
|
|
|
+ // wxOjb.getLocation({
|
|
|
+ // type: 'wgs84',
|
|
|
+ // success: function(res) {
|
|
|
+ // console.log('获取经纬度', res);
|
|
|
+ // obj.longitude = res.longitude;
|
|
|
+ // obj.latitude = res.latitude;
|
|
|
+ // uni.setStorageSync('longitude', obj.longitude4);
|
|
|
+ // uni.setStorageSync('latitude', obj.latitude4);
|
|
|
+ // obj.marker = [
|
|
|
+ // {
|
|
|
+ // longitude: res.longitude,
|
|
|
+ // latitude: res.latitude,
|
|
|
+ // iconPath: '/static/img/img19.png',
|
|
|
+ // width: '45',
|
|
|
+ // height: '45'
|
|
|
+ // }
|
|
|
+ // ];
|
|
|
+ // obj.loadData();
|
|
|
+ // },
|
|
|
+ // fail(e) {
|
|
|
+ // console.log('失败', e);
|
|
|
+ // // window.location.reload();
|
|
|
+ // obj.tishi()
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }).catch(err => {
|
|
|
+ // obj.tishi()
|
|
|
+ // console.log(err)
|
|
|
+ // })
|
|
|
+ // // #endif
|
|
|
this.loadData();
|
|
|
},
|
|
|
// #ifndef MP
|
|
@@ -233,17 +275,34 @@ export default {
|
|
|
},
|
|
|
// 请求载入数据
|
|
|
async loadData() {
|
|
|
+ const obj = this;
|
|
|
+ store_list({latitude:obj.latitude,longitude:obj.longitude}).then(({data}) =>{
|
|
|
+ console.log(data)
|
|
|
+ obj.store_name = data.list[0].detailed_address
|
|
|
+ })
|
|
|
loadIndexs({}).then(({ data }) => {
|
|
|
let goods = data.info;
|
|
|
this.carouselList = data.banner;
|
|
|
this.swiperLength = this.carouselList.length;
|
|
|
this.menusList = data.menus;
|
|
|
- this.goodsList = goods.firstList; //最新商品
|
|
|
- console.log(this.goodsList, '123456');
|
|
|
- this.bastList = goods.bastList; //精品推荐
|
|
|
- this.bastBanner = goods.bastBanner; //促销单品
|
|
|
- this.userServant = goods.platoonList; //服务商品
|
|
|
+ this.goodsList = goods.bastList; //最新商品
|
|
|
});
|
|
|
+ getProducts({
|
|
|
+ page:1,
|
|
|
+ limit: 2,
|
|
|
+ is_consumer: 1,
|
|
|
+ })
|
|
|
+ .then(({ data }) => {
|
|
|
+ obj.bastList = data.map(e => {
|
|
|
+ e.price = Number(e.price);
|
|
|
+ e.ot_price = Number(e.ot_price);
|
|
|
+ return e;
|
|
|
+ });
|
|
|
+ console.log(obj.bastList,'123456')
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
},
|
|
|
//轮播图切换修改背景色
|
|
|
swiperChange(e) {
|
|
@@ -270,6 +329,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
nav(url){
|
|
|
+ console.log(url,'111111111')
|
|
|
uni.navigateTo({
|
|
|
url
|
|
|
})
|
|
@@ -316,7 +376,7 @@ page {
|
|
|
}
|
|
|
.shop-name {
|
|
|
position: relative;
|
|
|
- z-index: 10;
|
|
|
+ z-index: 100;
|
|
|
width: 206rpx;
|
|
|
font-size: 30rpx;
|
|
|
font-family: PingFang SC;
|
|
@@ -326,7 +386,7 @@ page {
|
|
|
}
|
|
|
.input-box {
|
|
|
position: relative;
|
|
|
- z-index: 999;
|
|
|
+ z-index: 99;
|
|
|
width: 427rpx;
|
|
|
height: 60rpx;
|
|
|
background: rgba(39, 170, 116, 0.4);
|
|
@@ -580,7 +640,7 @@ page {
|
|
|
.bastgood-box {
|
|
|
margin-top: 20rpx;
|
|
|
background-color: #FFFFFF;
|
|
|
- padding-top: 40rpx;
|
|
|
+ padding: 40rpx 0;
|
|
|
.bast-bg {
|
|
|
width: 376rpx;
|
|
|
height: 34rpx;
|
|
@@ -593,17 +653,15 @@ page {
|
|
|
.guess-item {
|
|
|
display: flex;
|
|
|
width: 710rpx;
|
|
|
- height: 290rpx;
|
|
|
background: #ffffff;
|
|
|
box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
|
|
|
border-radius: 10rpx;
|
|
|
padding: 15rpx;
|
|
|
- padding-bottom: 150rpx;
|
|
|
margin: 20rpx auto 0;
|
|
|
position: relative;
|
|
|
image {
|
|
|
- width: 260rpx;
|
|
|
- height: 260rpx;
|
|
|
+ width: 236rpx;
|
|
|
+ height: 236rpx;
|
|
|
border-radius: 10rpx;
|
|
|
}
|
|
|
.guess-box {
|