|
@@ -23,7 +23,57 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 商品栏 -->
|
|
|
- <view class="commodity">
|
|
|
+ <view class="commodity" v-if="vipList.length > 0">
|
|
|
+ <view class="title">
|
|
|
+ <view class="left">
|
|
|
+ <image src="../../static/img/index-vip.png" mode=""></image>
|
|
|
+ <view class="font">
|
|
|
+ 会员福利
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="right" @click="nav('/pages/index/recommend?type=4')">
|
|
|
+ <view class="right-font">
|
|
|
+ 更多
|
|
|
+ </view>
|
|
|
+ <image src="../../static/img/jiantou.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="commodity-item" v-for="(item, index) in vipList" @click="navToDetailPages(item)">
|
|
|
+ <view class="commodity-prc">
|
|
|
+ <image :src="item.image" mode=""></image>
|
|
|
+ <!-- <view class="fanli" v-if="item.type == 1">
|
|
|
+ <view class="fanli-bg"><image src="../../static/img/index-fanl.png" mode=""></image></view>
|
|
|
+ <view class="fanli-font flex">
|
|
|
+ <view class="font-left">购物最高可返消费金额的</view>
|
|
|
+ <view class="font-right">10<text>%</text></view>
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
+ </view>
|
|
|
+ <view class="commodity-info">
|
|
|
+ <view class="commodity-name clamp">{{ item.store_name }}</view>
|
|
|
+ <view class="commodity-systom clamp">{{ item.systom }}</view>
|
|
|
+ <view class="commodity-price">
|
|
|
+ ¥{{ item.price }}
|
|
|
+ <text>¥{{ item.ot_price }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="commodity" v-if="commodityList.length > 0">
|
|
|
+ <view class="title">
|
|
|
+ <view class="left">
|
|
|
+ <image src="../../static/img/index-good.png" mode=""></image>
|
|
|
+ <view class="font">
|
|
|
+ 精选好货
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="right" @click="nav('/pages/index/recommend?type=2')">
|
|
|
+ <view class="right-font">
|
|
|
+ 更多
|
|
|
+ </view>
|
|
|
+ <image src="../../static/img/jiantou.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="commodity-item" v-for="(item, index) in commodityList" @click="navToDetailPages(item)">
|
|
|
<view class="commodity-prc">
|
|
|
<image :src="item.image" mode=""></image>
|
|
@@ -83,46 +133,51 @@ import { loadIndexs, dhList } from '@/api/user.js';
|
|
|
import { saveUrl, interceptor } from '@/utils/loginUtils.js';
|
|
|
import { mapState, mapMutations } from 'vuex';
|
|
|
import { wallet } from '@/api/finance.js';
|
|
|
+// #ifdef H5
|
|
|
+import { weixindata, weixinlocation,shareLoad } from '@/utils/wxAuthorized';
|
|
|
+import weixinObj from "@/plugin/jweixin-module/index.js";
|
|
|
+// #endif
|
|
|
export default {
|
|
|
computed: {
|
|
|
- ...mapState('user', ['userInfo', 'baseURL', 'hasLogin', 'urlFile'])
|
|
|
+ ...mapState('user', ['userInfo' , 'hasLogin', 'urlFile']),
|
|
|
+ ...mapState(['baseURL']),
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
carouselList: [],
|
|
|
main: [
|
|
|
- {
|
|
|
- name: '自动拼团',
|
|
|
- pic: '../../static/icon/index1.png',
|
|
|
- url: '/pages/index/appointment'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '11人团专区',
|
|
|
- pic: '../../static/icon/index2.png',
|
|
|
- url: '/pages/product/ping'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // name: '自动拼团',
|
|
|
+ // pic: '../../static/icon/index1.png',
|
|
|
+ // url: '/pages/index/appointment'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: '11人团专区',
|
|
|
+ // pic: '../../static/icon/index2.png',
|
|
|
+ // url: '/pages/product/ping'
|
|
|
+ // },
|
|
|
{
|
|
|
name: '拼团合伙人',
|
|
|
pic: '../../static/icon/index3.png',
|
|
|
url: '/pages/index/node'
|
|
|
},
|
|
|
- // {
|
|
|
- // name: '素材分享',
|
|
|
- // pic: '../../static/icon/index4.png',
|
|
|
- // url: '/pages/index/faquan'
|
|
|
- // },
|
|
|
+ {
|
|
|
+ name: '货款充值',
|
|
|
+ pic: '../../static/icon/index4.png',
|
|
|
+ url: '/pages/money/huodai'
|
|
|
+ },
|
|
|
{
|
|
|
name: '邀请有礼',
|
|
|
pic: '../../static/icon/index5.png',
|
|
|
url: '/pages/user/shareQrCode'
|
|
|
},
|
|
|
+ // {
|
|
|
+ // name: '拼购福利',
|
|
|
+ // pic: '../../static/icon/index6.png',
|
|
|
+ // url: '/pages/user/fulilist'
|
|
|
+ // },
|
|
|
{
|
|
|
- name: '拼购福利',
|
|
|
- pic: '../../static/icon/index6.png',
|
|
|
- url: '/pages/user/fulilist'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '互助专区',
|
|
|
+ name: '福利专区',
|
|
|
pic: '../../static/icon/index7.png',
|
|
|
url: '/pages/assets/logroll'
|
|
|
},
|
|
@@ -131,11 +186,11 @@ export default {
|
|
|
pic: '../../static/icon/index8.png',
|
|
|
url: '/pages/index/sign'
|
|
|
},
|
|
|
- {
|
|
|
- name: '服务器兑换',
|
|
|
- pic: '../../static/icon/index9.png',
|
|
|
- url: '/pages/market/market'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // name: '服务器兑换',
|
|
|
+ // pic: '../../static/icon/index9.png',
|
|
|
+ // url: '/pages/market/market'
|
|
|
+ // },
|
|
|
{
|
|
|
name: '话费充值',
|
|
|
pic: '../../static/icon/index10.png',
|
|
@@ -145,14 +200,70 @@ export default {
|
|
|
swiperLength: 0,
|
|
|
swiperCurrent: 0,
|
|
|
commodityList: [], //普通商品列表
|
|
|
+ vipList:[],//会员列表
|
|
|
list: [] //拼团积分列表
|
|
|
};
|
|
|
},
|
|
|
+ onNavigationBarSearchInputClicked(e) {
|
|
|
+ //跳转到搜索页面
|
|
|
+ this.clickSearch();
|
|
|
+ },
|
|
|
+ onLoad(option) {
|
|
|
+ // #ifndef MP
|
|
|
+ if (option.spread) {
|
|
|
+ // 存储其他邀请人
|
|
|
+ uni.setStorageSync('spread', option.spread);
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ // #ifdef MP
|
|
|
+ if (option.scene) {
|
|
|
+ // 存储小程序邀请人
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'spread_code',
|
|
|
+ data: option.scene
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ // #ifdef H5
|
|
|
+ console.log(this.hasLogin)
|
|
|
+ if (this.hasLogin) {
|
|
|
+ console.log('显示')
|
|
|
+ weixinObj.hideAllNonBaseMenuItem();
|
|
|
+ this.IndexShare();
|
|
|
+ }else {
|
|
|
+ console.log('隐藏')
|
|
|
+ weixinObj.hideAllNonBaseMenuItem();
|
|
|
+ }
|
|
|
+ //#endif
|
|
|
+ },
|
|
|
//页面加载即刻发生
|
|
|
onShow() {
|
|
|
this.loadDate();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // #ifdef H5
|
|
|
+ IndexShare() {
|
|
|
+ let obj = this;
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ // 获取当前页面
|
|
|
+ let page = pages[pages.length - 1];
|
|
|
+ let path = '/#/' + page.route + '?';
|
|
|
+ // 保存传值
|
|
|
+ for (let i in page.options) {
|
|
|
+ path += i + '=' + page.options[i] + '&';
|
|
|
+ }
|
|
|
+ console.log(obj.Path)
|
|
|
+ // 保存邀请人
|
|
|
+ path += 'spread=' + this.userInfo.uid;
|
|
|
+ let data = {
|
|
|
+ link: this.baseURL + '/index/' + path,
|
|
|
+ title: this.userInfo.nickname + '邀请您进入星拼乐',
|
|
|
+ desc:'欢迎加入星拼乐',
|
|
|
+ imgUrl: 'https://xingpinle.liuniu946.com/index/static/img/log.png'
|
|
|
+ };
|
|
|
+ weixindata(data);
|
|
|
+ },
|
|
|
+ // #endif
|
|
|
loadDate() {
|
|
|
uni.showLoading({
|
|
|
title: '加载中'
|
|
@@ -163,6 +274,10 @@ export default {
|
|
|
obj.carouselList = data.banner;
|
|
|
obj.swiperLength = data.banner.length;
|
|
|
obj.commodityList = data.likeInfo;
|
|
|
+ obj.vipList = data.benefit;
|
|
|
+ uni.hideLoading();
|
|
|
+ }).catch(e =>{
|
|
|
+ uni.hideLoading();
|
|
|
});
|
|
|
wallet({}).then(({ data }) => {
|
|
|
const obj = this;
|
|
@@ -182,6 +297,8 @@ export default {
|
|
|
});
|
|
|
})
|
|
|
uni.hideLoading();
|
|
|
+ }).catch(e =>{
|
|
|
+ uni.hideLoading();
|
|
|
});
|
|
|
},
|
|
|
//轮播图切换修改背景色
|
|
@@ -189,6 +306,13 @@ export default {
|
|
|
const index = e.detail.current;
|
|
|
this.swiperCurrent = index;
|
|
|
},
|
|
|
+ // 點擊搜索框
|
|
|
+ clickSearch() {
|
|
|
+ console.log(222)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/product/search'
|
|
|
+ });
|
|
|
+ },
|
|
|
navToDetailPage(item) {
|
|
|
if (!this.hasLogin) {
|
|
|
uni.showModal({
|
|
@@ -230,6 +354,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
nav(url) {
|
|
|
+ console.log(url)
|
|
|
if (!this.hasLogin) {
|
|
|
uni.showModal({
|
|
|
title: '登录',
|
|
@@ -371,22 +496,62 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.commodity {
|
|
|
- padding: 36rpx 14rpx;
|
|
|
+ padding: 36rpx 20rpx;
|
|
|
margin-top: 20rpx;
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ .title {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ padding:0 20rpx;
|
|
|
+ .left {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ image{
|
|
|
+ width: 40rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ }
|
|
|
+ .font {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .right {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ .right-font {
|
|
|
+ color: #a2a2a2;
|
|
|
+ font-size: 26rpx;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ }
|
|
|
+ image {
|
|
|
+
|
|
|
+ width: 16rpx;
|
|
|
+ height: 26rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.commodity-item {
|
|
|
- width: 348rpx;
|
|
|
+ width: 334rpx;
|
|
|
background: #ffffff;
|
|
|
box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
|
|
|
- margin: 10rpx 6rpx 0;
|
|
|
border-radius: 10rpx;
|
|
|
+ margin: 0 10rpx;
|
|
|
.commodity-prc {
|
|
|
- width: 344rpx;
|
|
|
- height: 344rpx;
|
|
|
+
|
|
|
+ width: 330rpx;
|
|
|
+ height: 330rpx;
|
|
|
border-radius: 10rpx;
|
|
|
position: relative;
|
|
|
image {
|
|
|
+ border-radius: 10rpx;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|