|
|
@@ -9,7 +9,7 @@
|
|
|
<!-- 搜素栏 -->
|
|
|
<view class="search flex">
|
|
|
<image src="../../static/icon/address.png" class="address"></image>
|
|
|
- <view class="shop-name clamp" @click.stop="nav('/pages/shoping/list')">{{storeInfo.name}}</view>
|
|
|
+ <view class="shop-name clamp" @click.stop="nav('/pages/shoping/list')">{{ storeInfo.name }}</view>
|
|
|
<view class="input-box flex" @click.stop="clickSearch">
|
|
|
<view class=" input-content flex">
|
|
|
<view class="iconfont iconsearch"></view>
|
|
|
@@ -68,7 +68,7 @@
|
|
|
<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 goodsList" :key="item.id" @click="navToDetailPage(item)">
|
|
|
<image class="commodity-image" :src="item.image" mode=""></image>
|
|
|
<view class="commodity-title clamp">{{ item.store_name }}</view>
|
|
|
<view class="price">¥{{ item.ot_price }}</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/voucher')">
|
|
|
+ <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,7 +96,7 @@
|
|
|
<image src="../../static/icon/fanhui.png" class="go" mode=""></image>
|
|
|
</view>
|
|
|
<view class="commodity flex">
|
|
|
- <view class="commodity-item" v-for="(item, index) in bastList" :key="item.id">
|
|
|
+ <view class="commodity-item" v-for="(item, index) in bastList" :key="item.id" @click="navToDetailvoucher(item)">
|
|
|
<image class="commodity-image" :src="item.image" mode=""></image>
|
|
|
<view class="commodity-title clamp">{{ item.store_name }}</view>
|
|
|
<view class="price">¥{{ item.ot_price }}</view>
|
|
|
@@ -110,15 +110,11 @@
|
|
|
</view>
|
|
|
<!-- 精选好货 -->
|
|
|
<view class="bastgood-box">
|
|
|
- <view class="bast-bg">
|
|
|
- <image src="../../static/icon/jxhh.png" mode=""></image>
|
|
|
- </view>
|
|
|
+ <view class="bast-bg"><image src="../../static/icon/jxhh.png" mode=""></image></view>
|
|
|
<view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
|
|
|
<image :src="item.image"></image>
|
|
|
<view class="guess-box">
|
|
|
- <view class="title clamp2">
|
|
|
- {{ item.store_name }}
|
|
|
- </view>
|
|
|
+ <view class="title clamp2">{{ item.store_name }}</view>
|
|
|
<view class="price-box flex">
|
|
|
<view class="yuanprice">{{ item.ot_price }}</view>
|
|
|
<image src="../../static/icon/down.png" mode=""></image>
|
|
|
@@ -135,7 +131,7 @@
|
|
|
<script>
|
|
|
import seckill from './seckill';
|
|
|
import { openMap } from '@/utils/rocessor.js';
|
|
|
-import { loadIndexs,store_list } 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, mapMutations } from 'vuex';
|
|
|
@@ -157,8 +153,8 @@ export default {
|
|
|
titleNViewBackground: '',
|
|
|
swiperCurrent: 0,
|
|
|
swiperLength: 0,
|
|
|
- longitude:121.436289,//经度
|
|
|
- latitude:28.651485,//纬度
|
|
|
+ longitude: 121.436289, //经度
|
|
|
+ latitude: 28.651485, //纬度
|
|
|
carouselList: [], //轮播列表
|
|
|
goodsList: [], //积分商品列表
|
|
|
bastList: [], //消费券商品列表
|
|
|
@@ -172,17 +168,16 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['loginInterceptor','storeInfo']),
|
|
|
+ ...mapState(['loginInterceptor', 'storeInfo']),
|
|
|
...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({
|
|
|
@@ -231,22 +226,22 @@ export default {
|
|
|
},
|
|
|
// #endif
|
|
|
methods: {
|
|
|
- ...mapMutations(['setLat', 'setLon','setStoreInfo']),
|
|
|
+ ...mapMutations(['setLat', 'setLon', 'setStoreInfo']),
|
|
|
//获取定位信息
|
|
|
getaddress() {
|
|
|
- console.log('dizhi+++++++++++')
|
|
|
+ console.log('dizhi+++++++++++');
|
|
|
let obj = this;
|
|
|
uni.getLocation({
|
|
|
- type:'gcj02',
|
|
|
+ type: 'gcj02',
|
|
|
success: res => {
|
|
|
- console.log(res)
|
|
|
- console.log('66666666666666666666')
|
|
|
+ console.log(res);
|
|
|
+ console.log('66666666666666666666');
|
|
|
obj.setLat(res.latitude);
|
|
|
obj.setLon(res.longitude);
|
|
|
obj.getStore(res.latitude, res.longitude);
|
|
|
},
|
|
|
fail: err => {
|
|
|
- console.log(err,'shi+++++++++++++++')
|
|
|
+ console.log(err, 'shi+++++++++++++++');
|
|
|
openMap().then(e => {
|
|
|
this.getaddress();
|
|
|
});
|
|
|
@@ -263,25 +258,23 @@ export default {
|
|
|
onImageError(key, index) {
|
|
|
this[key][index].image = '/static/error/errorImage.jpg';
|
|
|
},
|
|
|
- getStore(latitude,longitude) {
|
|
|
- let obj = this
|
|
|
+ getStore(latitude, longitude) {
|
|
|
+ let obj = this;
|
|
|
store_list({
|
|
|
- latitude:latitude,
|
|
|
- longitude:longitude,
|
|
|
+ // latitude: latitude,
|
|
|
+ // longitude: longitude,
|
|
|
+ latitude: obj.latitude,
|
|
|
+ longitude: obj.longitude,
|
|
|
page: 1,
|
|
|
- limit: 1,
|
|
|
- }).then(({data})=> {
|
|
|
- console.log(data,'storeInfo++++')
|
|
|
- obj.setStoreInfo(data.list[0])
|
|
|
- })
|
|
|
+ limit: 1
|
|
|
+ }).then(({ data }) => {
|
|
|
+ console.log(data, 'storeInfo++++');
|
|
|
+ obj.setStoreInfo(data.list[0]);
|
|
|
+ });
|
|
|
},
|
|
|
// 请求载入数据
|
|
|
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;
|
|
|
@@ -290,9 +283,9 @@ export default {
|
|
|
this.goodsList = goods.bastList; //最新商品
|
|
|
});
|
|
|
getProducts({
|
|
|
- page:1,
|
|
|
+ page: 1,
|
|
|
limit: 2,
|
|
|
- is_consumer: 1,
|
|
|
+ is_consumer: 1
|
|
|
})
|
|
|
.then(({ data }) => {
|
|
|
obj.bastList = data.map(e => {
|
|
|
@@ -300,7 +293,7 @@ export default {
|
|
|
e.ot_price = Number(e.ot_price);
|
|
|
return e;
|
|
|
});
|
|
|
- console.log(obj.bastList,'123456')
|
|
|
+ console.log(obj.bastList, '123456');
|
|
|
})
|
|
|
.catch(e => {
|
|
|
console.log(e);
|
|
|
@@ -318,6 +311,12 @@ export default {
|
|
|
url: '/pages/product/product?id=' + item.id
|
|
|
});
|
|
|
},
|
|
|
+ //消费券详情页
|
|
|
+ navToDetailvoucher(item) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/prefecture/detail?id=' + item.id
|
|
|
+ });
|
|
|
+ },
|
|
|
// 轮播图跳转
|
|
|
bannerNavToUrl(item) {
|
|
|
// #ifdef H5
|
|
|
@@ -330,11 +329,11 @@ export default {
|
|
|
url: item.wap_url
|
|
|
});
|
|
|
},
|
|
|
- nav(url){
|
|
|
- console.log(url,'111111111')
|
|
|
+ nav(url) {
|
|
|
+ console.log(url, '111111111');
|
|
|
uni.navigateTo({
|
|
|
url
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -559,7 +558,7 @@ page {
|
|
|
margin: 20rpx auto 0;
|
|
|
padding-bottom: 10rpx;
|
|
|
.xfq {
|
|
|
- background: linear-gradient(43deg, #ffc063, #ffa163) !important;
|
|
|
+ background: linear-gradient(43deg, #ffc063, #ffa163) !important;
|
|
|
}
|
|
|
.content-top {
|
|
|
width: 690rpx;
|
|
|
@@ -642,13 +641,13 @@ page {
|
|
|
}
|
|
|
.bastgood-box {
|
|
|
margin-top: 20rpx;
|
|
|
- background-color: #FFFFFF;
|
|
|
+ background-color: #ffffff;
|
|
|
padding: 40rpx 0;
|
|
|
.bast-bg {
|
|
|
width: 376rpx;
|
|
|
height: 34rpx;
|
|
|
margin: 0 auto;
|
|
|
- image{
|
|
|
+ image {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
@@ -711,12 +710,12 @@ page {
|
|
|
.btn {
|
|
|
width: 138rpx;
|
|
|
height: 52rpx;
|
|
|
- background: #52C696;
|
|
|
+ background: #52c696;
|
|
|
border-radius: 26rpx;
|
|
|
font-size: 26rpx;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
line-height: 52rpx;
|
|
|
text-align: center;
|
|
|
position: absolute;
|
|
|
@@ -726,5 +725,4 @@ page {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</style>
|