|
|
@@ -2,16 +2,15 @@
|
|
|
<div class="container">
|
|
|
<view class="head">
|
|
|
<!-- 用户信息 -->
|
|
|
- <view class="userinfo flex_r flex_ac">
|
|
|
+ <!-- <view class="userinfo flex_r flex_ac">
|
|
|
<image class="user_img" :src="userinfo.head_pic" mode=""></image>
|
|
|
<view class="user_info flex_c flex_jc">
|
|
|
<view class="user_name">{{ userinfo.nickname }}</view>
|
|
|
<view class="level_con flex_r flex_ac">
|
|
|
- <!-- <image src="@/static/my/huangguan.png" class="live_ico" /> -->
|
|
|
<view class="level">{{ typeto(localInfo.level_id) }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<!-- 用户信息-end -->
|
|
|
<!-- 签到信息 -->
|
|
|
<view class="sign_info flex_c">
|
|
|
@@ -38,61 +37,86 @@
|
|
|
<!-- 签到信息-end -->
|
|
|
</view>
|
|
|
<!-- 天天捡漏等活动区-start -->
|
|
|
- <view class="pick">
|
|
|
+ <!-- <view class="pick">
|
|
|
<image
|
|
|
class="pick_img"
|
|
|
mode="widthFix"
|
|
|
:src="activityList[0].image"
|
|
|
@click="toPage(activityList[0].url)"
|
|
|
></image>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<!-- 天天捡漏等活动区-end -->
|
|
|
<!-- 活动 -->
|
|
|
<view class="activity" v-if="activityList.length">
|
|
|
- <image class="act_img act_one_img" :src="activityList[1].image" @click="toPage(activityList[1].url)" mode=""></image>
|
|
|
+ <image class="act_img act_one_img" :src="activityList[0].image" @click="toPage(activityList[0].url)" mode=""></image>
|
|
|
<view class="act_other">
|
|
|
- <image class="act_img act_two_img" :src="activityList[2].image" mode="" @click="toPage(activityList[2].url)"></image>
|
|
|
- <image class="act_img act_two_img" :src="activityList[3].image" @click="toPage(activityList[3].url)" mode=""></image>
|
|
|
+ <image class="act_img act_two_img" :src="activityList[1].image" mode="" @click="toPage(activityList[1].url)"></image>
|
|
|
+ <image class="act_img act_two_img" :src="activityList[2].image" @click="toPage(activityList[2].url)" mode=""></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 活动-end -->
|
|
|
<!-- 精品推荐 -->
|
|
|
<view class="bou_head flex_r flex_ac flex_jc">
|
|
|
<image class="bou_img" src="/static/sgin/left.png" mode=""></image>
|
|
|
- <view class="bou_title">精品推荐</view>
|
|
|
+ <view class="bou_title">享好物</view>
|
|
|
<image class="bou_img" src="/static/sgin/right.png" mode=""></image>
|
|
|
</view>
|
|
|
<view class="product-list">
|
|
|
- <view class="product" v-for="(i, s) in goods" :key="s" @click="NavToGoodsDetail(i.id, i.type)">
|
|
|
- <view class="image-view">
|
|
|
- <image class="product-image" :src="i.original_img"></image>
|
|
|
- </view>
|
|
|
- <view class="content-view">
|
|
|
- <view :class="['product-title', 'ellipsis']">{{ i.goods_name }}</view>
|
|
|
- <view class="product-price">
|
|
|
- <text class="product-price-original">{{ i.price }}</text>
|
|
|
- <text class="product-text" v-if="['3','4'].includes(i.type)">赠<text class="corFE2C15">{{ i.give_cha_bao }}</text>茶宝</text>
|
|
|
- </view>
|
|
|
- <view class="product-txt" v-if="i.type == 4">
|
|
|
- <text class="product-price-favour">{{i.market_price}}</text>
|
|
|
- <text class="product-text">消费券抵</text>
|
|
|
- <span class="corFE2C15">¥{{ Number(i.consume) }}</span>
|
|
|
- </view>
|
|
|
- <!-- <view class="product-txt" v-if="i.type == 1">赠送{{ i.give_integral + "批发券" }}</view> -->
|
|
|
- <view class="product-txt" v-if="['3'].includes(i.type)">限时赠送<text class="corFE2C15">{{ i.teac }}</text>TeaC</view>
|
|
|
- <view class="product-txt fenxiang" v-if="['3'].includes(i.type)">
|
|
|
- <text class="iconfont red"></text>
|
|
|
- <text class="red">分享约获得 {{ i.first_teac }} {{i.type==3?'TeaC':'现金'}}</text>
|
|
|
- </view>
|
|
|
- <view v-if="['4'].includes(i.type)" class="flex_r flex_ac">
|
|
|
- <view class="product-txt">赠<text class="corFE2C15">{{ i.teac }}</text>TeaC</view>
|
|
|
- <view class="product-txt fenxiang flex_r flex_ac" style="background-color: rgba(0, 0, 0, 0);">
|
|
|
- <text class="iconfont red"></text>
|
|
|
- <text class="red">{{ i.first_teac }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view
|
|
|
+ class="product"
|
|
|
+ v-for="(i, s) in goods"
|
|
|
+ :key="s"
|
|
|
+ @click="NavToGoodsDetail(i.id)"
|
|
|
+ >
|
|
|
+ <view class="image-view">
|
|
|
+ <image class="product-image" :src="i.goods.original_img"></image>
|
|
|
</view>
|
|
|
+ <view class="content-view">
|
|
|
+ <view :class="['product-title', 'ellipsis2']">{{
|
|
|
+ i.goods_name
|
|
|
+ }}</view>
|
|
|
+ <view class="product-price">
|
|
|
+ <text class="product-price-original">{{ i.cost_price }}</text>
|
|
|
+ <text class="product-text" v-if="['3', '4'].includes(type)"
|
|
|
+ >赠<text class="corFE2C15">{{ i.give_cha_bao }}</text
|
|
|
+ >茶宝</text
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ <view class="product-txt" v-if="type == 4">
|
|
|
+ <text class="product-price-favour">¥{{ i.market_price }}</text>
|
|
|
+ <text class="product-text">消费券抵</text>
|
|
|
+ <span class="corFE2C15">¥{{ Number(i.consume) }}</span>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="product-txt" v-if="type == 1">赠送{{ i.give_integral + "批发券" }}</view> -->
|
|
|
+ <view class="product-txt" v-if="type == 6"
|
|
|
+ >每<text class="green">{{ i.interval_time }}</text> 分钟降价
|
|
|
+ <text class="green">{{ i.drop_range * 100 }}%</text>
|
|
|
+ </view>
|
|
|
+ <view class="product-txt" v-if="['3'].includes(type)"
|
|
|
+ >限时赠送<text class="corFE2C15">{{ i.teac }}</text
|
|
|
+ >TeaC</view
|
|
|
+ >
|
|
|
+ <view class="product-txt fenxiang" v-if="['3'].includes(type)">
|
|
|
+ <text class="iconfont red"></text>
|
|
|
+ <text class="red"
|
|
|
+ >分享约获得{{ i.first_teac
|
|
|
+ }}{{ type == 3 ? "TeaC" : "现金" }}</text
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ <view v-if="['4'].includes(type)" class="flex_r flex_ac">
|
|
|
+ <view class="product-txt"
|
|
|
+ >赠<text class="corFE2C15">{{ i.teac }}</text
|
|
|
+ >TeaC</view
|
|
|
+ >
|
|
|
+ <!-- <view class="product-txt fenxiang" style="background-color: rgba(0, 0, 0, 0);">
|
|
|
+ <text class="iconfont red"></text>
|
|
|
+ <text class="red"
|
|
|
+ >{{ i.first_teac }}</text
|
|
|
+ >
|
|
|
+ </view> -->
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<!-- 精品推荐-end -->
|
|
|
<view class="fz_w_text">让数字经济赋能美好生活!</view>
|
|
|
@@ -123,16 +147,29 @@ export default {
|
|
|
canClick: true,
|
|
|
localInfo: {},
|
|
|
activityList:[], // 活动横幅区
|
|
|
+ type: 4,
|
|
|
+ categoryId: 11,
|
|
|
};
|
|
|
},
|
|
|
async onShow() {
|
|
|
+ uni.setTabBarStyle({
|
|
|
+ color: '#999',
|
|
|
+ selectedColor: '#E68B1E',
|
|
|
+ })
|
|
|
+ page = 1;
|
|
|
+ this.goods = [];
|
|
|
this.userinfo = uni.getStorageSync("userinfo");
|
|
|
this.loadData();
|
|
|
this.goodsDay();
|
|
|
this.getActivityList();
|
|
|
this.localInfo = await uni.Luserfun()
|
|
|
},
|
|
|
- onLoad(da) {},
|
|
|
+ onLoad(da) {
|
|
|
+ uni.setTabBarStyle({
|
|
|
+ color: '#999',
|
|
|
+ selectedColor: '#E68B1E',
|
|
|
+ })
|
|
|
+ },
|
|
|
onHide() {},
|
|
|
methods: {
|
|
|
loadData() {
|
|
|
@@ -162,7 +199,7 @@ export default {
|
|
|
},
|
|
|
// 横幅活动
|
|
|
getActivityList() {
|
|
|
- post("v1/goods/simple").then((res) => {
|
|
|
+ post("v1/goods/simple", {isWx: 1}).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
this.activityList = res.data.data
|
|
|
} else {
|
|
|
@@ -196,10 +233,10 @@ export default {
|
|
|
// 获取消费券电商
|
|
|
goodsDay() {
|
|
|
let that = this;
|
|
|
- let data = { page, type: 4 };
|
|
|
- post("v1/goods/goodsList", data).then((res) => {
|
|
|
+ let data = { page, type: 4, category_id: 11 };
|
|
|
+ post("v1/goods/categoryInfo", data).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
- let obj = res.data.data;
|
|
|
+ let obj = res.data.data.data;
|
|
|
if (page <= 1) that.goods = [];
|
|
|
if (obj.length > 0) {
|
|
|
obj.forEach((e) => {
|
|
|
@@ -227,7 +264,7 @@ export default {
|
|
|
},
|
|
|
// 跳转到商品详情页
|
|
|
NavToGoodsDetail(id, type) {
|
|
|
- this.goto("/pages/product/p_details", { id, type });
|
|
|
+ this.goto("/pages/product/p_details", { id, type: this.type });
|
|
|
},
|
|
|
},
|
|
|
//页面上拉触底事件的处理函数
|
|
|
@@ -362,9 +399,9 @@ page {
|
|
|
background: #fff;
|
|
|
border-radius: 16rpx;
|
|
|
box-shadow: 2px 3px 0px 0px rgba(16, 178, 127, 0.36), 0px 4px 15px 10px rgba(17, 179, 129, 0.2);
|
|
|
- padding: 24rpx 40rpx;
|
|
|
+ padding: 20rpx 40rpx 0;
|
|
|
box-sizing: border-box;
|
|
|
- margin-top: 44rpx;
|
|
|
+ // margin-top: 44rpx;
|
|
|
}
|
|
|
|
|
|
.g_color {
|
|
|
@@ -517,7 +554,7 @@ page {
|
|
|
.product-price-favour {
|
|
|
color: #888888;
|
|
|
text-decoration: line-through;
|
|
|
- margin-left: 20rpx;
|
|
|
+ // margin-left: 20rpx;
|
|
|
}
|
|
|
|
|
|
.product-tip {
|