Browse Source

去掉消费金电商+本地生活移到首页

xiaomei 1 year ago
parent
commit
f35729aaa4

+ 22 - 10
src/pages.json

@@ -235,6 +235,12 @@
 			"style": {
 				"navigationBarTitleText": "消费券电商"
 			}
+		},
+		{
+			"path": "pages/consumerGold/enjoyGoods",
+			"style": {
+				"navigationBarTitleText": "享好物"
+			}
 		}
 	],
 	"subPackages": [
@@ -648,18 +654,24 @@
 				"text": "首页"
 			},
 			{
-				"pagePath": "pages/settledMerchant/index",
-				"iconPath": "static/nav/live_.png",
-				"selectedIconPath": "static/nav/live.png",
-				"text": "本地生活"
-			},
-			{
-				"pagePath": "pages/consumerGold/index",
-				"iconPath": "static/nav/local_.png",
-				"selectedIconPath": "static/nav/local.png",
-				"text": "消费券电商"
+				"pagePath": "pages/consumerGold/enjoyGoods",
+				"iconPath": "static/nav/good_.png",
+				"selectedIconPath": "static/nav/good.png",
+				"text": "享好物"
 			},
 			// {
+			// 	"pagePath": "pages/settledMerchant/index",
+			// 	"iconPath": "static/nav/live_.png",
+			// 	"selectedIconPath": "static/nav/live.png",
+			// 	"text": "本地生活"
+			// },
+			// {
+			// 	"pagePath": "pages/consumerGold/index",
+			// 	"iconPath": "static/nav/local_.png",
+			// 	"selectedIconPath": "static/nav/local.png",
+			// 	"text": "消费券电商"
+			// },
+			// {
 			// 	"pagePath": "pages/sign/index",
 			// 	"iconPath": "static/nav/benefits_.png",
 			// 	"selectedIconPath": "static/nav/benefits.png",

+ 326 - 0
src/pages/consumerGold/enjoyGoods.vue

@@ -0,0 +1,326 @@
+<template>
+  <view class="container">
+    <view class="product-list">
+      <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">&#xe62b;</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">&#xe62b;</text>
+              <text class="red"
+                >{{ i.first_teac }}</text
+              >
+            </view> -->
+          </view>
+        </view>
+      </view>
+    </view>
+    <!-- <not-goods v-if="haveGoods" textStr="暂无商品信息"></not-goods> -->
+    <view class="con_nothing" v-if="haveGoods">
+      <image
+        mode="widthFix"
+        class="image"
+        src="/static/img/con_nothing.png"
+      ></image>
+      <text>{{ "暂无商品信息" }}</text>
+    </view>
+  </view>
+</template>
+<script>
+let page = 1;
+import { post } from "@/request/api.js";
+import notGoods from "@/components/not-goods/index.vue";
+export default {
+  components: { notGoods },
+  data() {
+    return {
+      title: "",
+      type: 4,
+      goods: [], // 商品列表
+      haveGoods: false, // 是否有商品
+      is_vip: undefined, //是否筛选“链接大使礼包”专区
+      categoryId: 11,
+      titleName: "享好物",
+    };
+  },
+  onLoad(e) {
+    uni.setTabBarStyle({
+      color: '#999',
+      selectedColor: '#E68B1E',
+    })
+  },
+  onShow() {
+    uni.setTabBarStyle({
+      color: '#999',
+      selectedColor: '#E68B1E',
+    })
+    page = 1;
+    this.goods = [];
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+      let that = this;
+      uni.showLoading({ mask: true });
+      let data = {
+        page: page,
+        type: this.type,
+        category_id: this.categoryId,
+      };
+      post("v1/goods/categoryInfo", data).then((res) => {
+        uni.hideLoading();
+        if (res.code === 0) {
+          let obj = res.data.data.data;
+          if (page == 1) that.goods = [];
+          if (page == 1 && obj.length <= 0) {
+            that.haveGoods = true;
+          } else {
+            that.haveGoods = false;
+          }
+          if (obj.length > 0) {
+            obj.forEach((e) => {
+              that.goods.push(e);
+            });
+          } else {
+            // console.log("这里");
+            page = -1;
+            this.$toast("暂无更多");
+          }
+        } else {
+          page = -1;
+          this.haveGoods = true;
+          this.$toast("暂无更多");
+        }
+      });
+    },
+    // 跳转到商品详情页
+    NavToGoodsDetail(id, type) {
+      uni.navigateTo({
+        url: "/pages/product/p_details?id=" + id + "&type=" + this.type,
+      });
+    },
+    // 点击关闭弹窗
+    closeBtn: function () {
+      this.$refs.shopping.close();
+    },
+  },
+  onShareAppMessage() {
+    let userinfo = uni.getStorageSync("userinfo");
+    var path =
+      "/pagesC/consumerGold/specialCategory?name=" +
+      this.titleName +
+      "&id=" +
+      this.categoryId +
+      "&type=4";
+    if (userinfo.invite)
+      path =
+        "/pagesC/consumerGold/specialCategory?invite=" +
+        userinfo.invite +
+        "&name=" +
+        this.titleName +
+        "&id=" +
+        this.categoryId +
+        "&type=4";
+    var title = `让数字经济赋能美好生活!`;
+    return {
+      title: title,
+      path: path,
+    };
+  },
+  //页面上拉触底事件的处理函数
+  onReachBottom: function () {
+    if (page != -1) {
+      var that = this;
+      setTimeout(function () {
+        page = page + 1;
+        that.loadData();
+      }, 800);
+    }
+  },
+};
+</script>
+<style lang="scss">
+// 页面配置
+page {
+  background: #f4f4f4;
+}
+
+.container {
+  padding: 30rpx 0;
+}
+
+// 页面配置-end
+
+// 商品列表
+.product-list {
+  width: 100%;
+  display: flex;
+  flex-wrap: wrap;
+  flex-direction: row;
+  padding: 0 30rpx;
+
+  .product {
+    width: 48.5%;
+    margin-bottom: 20rpx;
+    padding-bottom: 12rpx;
+    border-radius: 10rpx;
+    box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
+
+    &:nth-child(2n) {
+      margin-left: 3%;
+    }
+  }
+
+  .product-image {
+    border-radius: 10rpx 10rpx 0 0;
+    width: 100%;
+    height: 42.3vw;
+    object-fit: cover;
+  }
+
+  .content-view {
+    padding: 0 16rpx;
+  }
+
+  .product-title {
+    width: 100%;
+    overflow: hidden;
+    line-height: 1.5;
+    font-size: 28rpx;
+    color: #121212;
+  }
+
+  .product-price {
+    color: #121212;
+    font-size: 28rpx;
+    position: relative;
+  }
+
+  .product-price-original {
+    color: #18bb88;
+    font-size: 32rpx;
+    font-weight: bold;
+
+    &:before {
+      content: "¥";
+      font-size: 20rpx;
+    }
+  }
+
+  .product-price-favour {
+    color: #888;
+    text-decoration: line-through;
+    font-size: 22rpx;
+    margin-right: 10rpx;
+
+    &:before {
+      content: "¥";
+    }
+  }
+
+  .product-tip {
+    position: absolute;
+    right: 20rpx;
+    background-color: #ff3333;
+    color: #ffffff;
+    padding: 0 20rpx;
+    border-radius: 10rpx;
+  }
+
+  .product-unit {
+    font-size: 24rpx;
+  }
+
+  .green {
+    color: #18bb88;
+  }
+
+  .product-txt,
+  .product-text {
+    font-size: 22rpx;
+    color: #787878;
+
+    .iconfont {
+      margin-right: 3rpx;
+    }
+  }
+
+  .product-text {
+    margin-left: 16rpx;
+  }
+
+  .red {
+    color: #fa2e18;
+  }
+
+  .fenxiang {
+    font-size: 20rpx;
+    background: rgba(250, 46, 24, 0.08);
+    display: inline-block;
+    border-radius: 6rpx;
+    padding: 0 16rpx;
+  }
+}
+
+.con_nothing {
+  padding: 80rpx 30rpx;
+  overflow: hidden;
+  text-align: center;
+}
+.con_nothing .image {
+  width: 200rpx;
+  height: 200rpx;
+  display: block;
+  margin: 0 auto 20rpx;
+}
+.con_nothing text {
+  font-size: 32rpx;
+  color: #aaa;
+  line-height: 1.5;
+  padding: 20rpx 0;
+  width: 100%;
+  overflow: hidden;
+}
+</style>

+ 117 - 108
src/pages/index/index.vue

@@ -39,21 +39,21 @@
             </div>
             <!-- 专区-end -->
             <!-- 活动 -->
-            <view class="activity" v-if="homeImg.length">
+            <!-- <view class="activity" v-if="homeImg.length">
                 <image class="act_img act_one_img" :src="homeImg[0].image" @click="toActivePage(homeImg[0])" mode=""></image>
                 <view class="act_other">
                     <image class="act_img act_two_img" :src="homeImg[1].image" mode="" @click="toActivePage(homeImg[1])"></image>
                     <image class="act_img act_two_img" :src="homeImg[2].image" @click="toActivePage(homeImg[2])" mode=""></image>
                 </view>
-            </view>
+            </view> -->
             <!-- 活动-end -->
         </view>
-        <view class="bou_head flex_r flex_ac flex_jc">
+        <!-- <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>
             <image class="bou_img" src="/static/sgin/right.png" mode=""></image>
-        </view>
-        <view class="list_bar">
+        </view> -->
+        <!-- <view class="list_bar">
             <view class="product-list">
                 <view class="product" v-for="(i, s) in productList" :key="s" @click="NavToGoodsDetail(i.id, i.type)">
                     <view class="image-view">
@@ -74,7 +74,6 @@
                             <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">&#xe62b;</text>
@@ -82,15 +81,25 @@
                         </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">&#xe62b;</text>
-                                <text class="red">{{ i.first_teac }}</text>
-                            </view> -->
+
                         </view>
                     </view>
                 </view>
             </view>
-        </view>
+        </view> -->
+        <div class="list" v-if="list.length">
+            <div class="li_item" v-for="(i,s) in list" :key="s" @click="goMerchant(i)">
+                <div class="logo_img">
+                    <img :src="i.logo" alt="">
+                </div>
+                <div class="con_box">
+                    <div class="p1 ellipsis"><span class="topicon" v-if="i.is_recom == 1">⭐️</span>{{ i.name }}</div>
+                    <div class="p2">{{ i.address }}</div>
+                    <div class="p3">{{ $h.Div(i.distance, 1000).toFixed(2) }} km</div>
+                </div>
+            </div>
+        </div>
+        <not-goods v-else textStr="暂无附近商家"></not-goods>
         <view class="fz_w_text">让数字经济赋能美好生活!</view>
         <!-- 城市选择 -->
         <h-address @select="selectaddress" :visible.sync="showAddress" />
@@ -111,13 +120,15 @@
 import swiperBanner from "@/components/swiperBanner/index.vue"; //轮播
 import hAddress from "@/components/h-address/address.vue"; //城市选择
 // import tabs from '@/static/js/tabs' //专区入口
+import notGoods from "@/components/not-goods/index.vue";
 import { post } from "@/request/api.js";
 import { formatBytes } from "@/utils/index";
 export default {
     name: "Appindex",
     components: {
         swiperBanner, //轮播
-        hAddress
+        hAddress,
+        notGoods
         // xhPrivacy,
     },
     data() {
@@ -134,22 +145,43 @@ export default {
             totalBytesExpectedToWrite: "0B", // 预期需要下载的数据总长度
             filePath:"",
             percentVal:0,
-            newAppInfo:{}
+            newAppInfo:{},
+            list: [],
+            Query: {
+                latitude: "",
+                longitude: "",
+                page: 1,
+                rows: 20,
+                city: "",
+                business: -1
+            },
+            pageData: {},
         };
     },
     onLoad(option) {
+        uni.setTabBarStyle({
+            color: '#999',
+            selectedColor: '#18bb88',
+        })
         this.getToCity()
-        this.loadData()
+        // this.loadData()
         // uni.Luserfun()
         // #ifdef APP-PLUS
         this.getNewVersion()
         // #endif
     },
     onShow() {
+        uni.setTabBarStyle({
+            color: '#999',
+            selectedColor: '#18bb88',
+        })
+        this.Query.page = 1
+        this.list = []
+        this.pageData  = {}
         this.getBanner(); //获取轮播图
         this.getAnnounce(); //获取公告列表
-        this.gethomeImg(); //活动列表
         this.getTabs(); //获取专区
+        this.getList(); //商家列表
     },
     onHide() {},
     methods: {
@@ -161,6 +193,24 @@ export default {
             });
             
         },
+        async getList(page) {
+            let { lat, lng } = await uni.Location();
+            this.Query.latitude = lat;
+            this.Query.longitude = lng;
+            if (page) {
+                this.list = []
+                this.Query.page = 1
+            }
+            post("v1/merchant/list", this.Query).then(res => {
+                if (res.code == 0) {
+                    let da = res.data.data
+                    delete res.data.data
+                    this.pageData = res.data
+                    this.list = [...this.list, ...da]
+                    this.Query.page++
+                }
+            })
+        },
         getNewVersion(){
             post("v1/getAppVersion").then((res) => {
                 if (res.code === 0) {
@@ -184,6 +234,10 @@ export default {
         NavToGoodsDetail(id, type) {
             this.goto("/pages/product/p_details", { id, type });
         },
+        goMerchant(da) {
+            this.setLS("merchant", da)
+            this.goto("/pagesC/settledMerchant/merchant", { id: da.id })
+        },
         // 获取轮播图
         getBanner() {
             post("v1/banner").then((res) => {
@@ -368,6 +422,9 @@ export default {
     },
     computed: {},
     watch: {},
+    onReachBottom() {
+        if (this.Query.page < this.pageData.last_page) this.getList();
+    },
 };
 </script>
 <style scoped lang='scss'>
@@ -434,7 +491,7 @@ export default {
 }
 
 .l_tabBar {
-    margin: 32rpx 0;
+    margin: 32rpx 0 20rpx;
     background-color: #fff;
     padding: 10rpx 20rpx;
     border-radius: 10rpx;
@@ -562,116 +619,68 @@ export default {
     }
 }
 
-.product-list {
-    width: 100%;
-    display: flex;
-    flex-wrap: wrap;
-    flex-direction: row;
-    padding: 0 30rpx;
 
-    .product {
-        width: 48.5%;
+.progressBox{
+    padding: 40rpx;
+    border-radius: 4rpx;
+    background-color: #fff;
+}
+
+.list {
+    padding: 0rpx 30rpx 30rpx;
+
+    .li_item {
         margin-bottom: 20rpx;
-        padding-bottom: 12rpx;
+        padding: 28rpx 32rpx;
+        background-color: #fff;
         border-radius: 10rpx;
         box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
-
-        &:nth-child(2n) {
-            margin-left: 3%;
-        }
     }
 
-    .product-image {
-        border-radius: 10rpx 10rpx 0 0;
-        width: 100%;
-        height: 42.3vw;
-        object-fit: cover;
+    .li_title {
+        font-size: 36rpx;
+        margin-bottom: 16rpx;
     }
 
-    .content-view {
-        padding: 0 16rpx;
+    .logo_img,
+    .con_box {
+        display: inline-block;
+        vertical-align: top;
     }
 
-    .product-title {
-        width: 100%;
-        overflow: hidden;
-        line-height: 1.5;
-        font-size: 28rpx;
-        color: #121212;
+    .logo_img {
+        img {
+            height: 180rpx;
+            width: 180rpx;
+            border-radius: 10rpx;
+        }
     }
 
-    .product-price {
-        color: #121212;
-        font-size: 28rpx;
+    .con_box {
+        height: 180rpx;
+        width: calc(100% - 180rpx - 28rpx);
+        margin-left: 28rpx;
         position: relative;
-    }
-
-    .product-price-original {
-        color: #18bb88;
-        font-size: 32rpx;
-        font-weight: bold;
 
-        &:before {
-            content: "¥";
-            font-size: 20rpx;
+        .p1 {
+            font-size: 32rpx;
+            font-weight: bold;
+            color: #333;
+            margin-bottom: 6rpx;
         }
-    }
-
-    .product-price-favour {
-        color: #888888;
-        text-decoration: line-through;
-        margin-left: 20rpx;
-    }
-
-    .product-tip {
-        position: absolute;
-        right: 20rpx;
-        background-color: #ff3333;
-        color: #ffffff;
-        padding: 0 20rpx;
-        border-radius: 10rpx;
-    }
-
-    .product-unit {
-        font-size: 24rpx;
-        color: #18bb88;
-    }
-
-    .product-txt,
-    .product-text {
-        font-size: 22rpx;
-        color: #787878;
 
-        .iconfont {
-            margin-right: 3rpx;
+        .p2 {
+            font-size: 24rpx;
+            color: #999;
         }
-    }
-
-    .product-price-msg {
-        font-size: 20rpx;
-        color: #ff6d44;
-    }
-
-    .product-text {
-        margin-left: 16rpx;
-    }
-
-    .red {
-        color: #FA2E18;
-    }
 
-    .fenxiang {
-        font-size: 20rpx;
-        background: rgba(250, 46, 24, 0.08);
-        display: inline-block;
-        border-radius: 6rpx;
-        padding: 0 16rpx;
+        .p3 {
+            font-size: 24rpx;
+            color: #666;
+            position: absolute;
+            right: 0;
+            bottom: 0;
+        }
     }
 }
-
-.progressBox{
-    padding: 40rpx;
-    border-radius: 4rpx;
-    background-color: #fff;
-}
 </style>

+ 8 - 0
src/pages/my/index.vue

@@ -310,11 +310,19 @@ export default {
         };
     },
     onLoad(options) {
+        uni.setTabBarStyle({
+            color: '#999',
+            selectedColor: '#3EAEF0',
+        })
         //推荐人邀请码|受邀码
         this.invited = uni.getStorageSync("inviteCode") || ""
         this.closeAuto(); //关闭实名功能
     },
     onShow() {
+        uni.setTabBarStyle({
+            color: '#999',
+            selectedColor: '#3EAEF0',
+        })
         let token = uni.getStorageSync("token");
         if (!token) this.login()
         else {

BIN
src/static/nav/benefits.png


BIN
src/static/nav/benefits_.png


BIN
src/static/nav/good.png


BIN
src/static/nav/good_.png


BIN
src/static/nav/live.png


BIN
src/static/nav/live_.png


BIN
src/static/nav/local.png


BIN
src/static/nav/local_.png