Browse Source

福利与享好物合并

xiaomei 1 year ago
parent
commit
3c8dc44f12

+ 8 - 2
src/pages.json

@@ -9,7 +9,7 @@
 		{
 			"path": "pages/sign/index",
 			"style": {
-				"navigationBarTitleText": "福利"
+				"navigationBarTitleText": "享好物"
 			}
 		},
 		{
@@ -631,6 +631,12 @@
 					"style": {
 						"navigationBarTitleText": "消费券兑换"
 					}
+				},
+				{
+					"path": "product/productOE",
+					"style": {
+						"navigationBarTitleText": "OE兑换"
+					}
 				}
 			]
 		}
@@ -654,7 +660,7 @@
 				"text": "首页"
 			},
 			{
-				"pagePath": "pages/consumerGold/enjoyGoods",
+				"pagePath": "pages/sign/index",
 				"iconPath": "static/nav/good_.png",
 				"selectedIconPath": "static/nav/good.png",
 				"text": "享好物"

+ 1 - 1
src/pages/invi-img/index.vue

@@ -10,7 +10,7 @@
                 </block>
             </swiper>
         </view>
-        <view class="invi_tops"><text space="nbsp">新用户扫二维码识别小程序 / 授权登录即可成功绑定关系</text></view>
+        <!-- <view class="invi_tops"><text space="nbsp">新用户扫二维码识别小程序 / 授权登录即可成功绑定关系</text></view> -->
         <view class="btn_group disFlex_goodsBox flex_hor_between" v-if="bgImgList && bgImgList.length > 0">
             <view class="btn_tab" @tap="getImg">生成专属海报</view>
         </view>

+ 2 - 2
src/pages/my/index.vue

@@ -30,12 +30,12 @@
                             <view class="copy_account flex_r flex_ac flex_jc" @tap="copyText(userinfo.mobile)">复制</view>
                         </view>
                     </view>
-                    <view class="user_option flex_r flex_ac flex_je">
+                    <!-- <view class="user_option flex_r flex_ac flex_je">
                         <navigator class="flex_c flex_ac" @tap="getImgPage" hover-class="none">
                             <image class="fun_img" src="/static/my/f_img_code.png"></image>
                             <view class="fun_text">分享海报</view>
                         </navigator>
-                    </view>
+                    </view> -->
                 </block>
                 <block v-else>
                     <view class="user_con flex_c flex_as flex_jc" @click="toLogin">

+ 12 - 4
src/pages/product/p_details.vue

@@ -15,6 +15,11 @@
                 <span v-if="Number(detail.consume) != 0 && Number(detail.cost_price) != 0">+</span>
                 <span v-if="Number(detail.consume) != 0">{{ detail.consume }}消费券</span>
             </view>
+            <view v-else-if="type == 8" class="price">
+                <span v-if="Number(detail.cost_price) != 0">{{ detail.cost_price }}元</span>
+                <span v-if="Number(detail.oe_price) != 0 && Number(detail.cost_price) != 0">+</span>
+                <span v-if="Number(detail.oe_price) != 0">{{ detail.oe_price }}OE</span>
+            </view>
             <view v-else-if="type == 1" class="price flex_c">
                 <text class="p_favour_teac" v-if="type == 1">¥: {{ $h.Add(detail.teac,$h.Mul(detail.trade_teac, 2))||0 }} TeaC +{{ detail.treasure_price||0 }} 茶宝</text>
                 <text class="p_trade_teac" v-if="type == 1">寄卖服务费:{{$h.Mul(detail.service,2)}} 元</text>
@@ -25,6 +30,7 @@
                 <text class="p_favour" v-if="type == 3">¥{{ detail.cost_price }}</text>
                 <text class="p_favour" v-if="type == 4">¥{{ $h.Sub(detail.cost_price,detail.consume) }}</text>
                 <text class="p_favour" v-if="type == 5">¥{{ detail.cost_price }} + {{ detail.treasure_price }}茶宝</text>
+                <text class="p_favour" v-if="type == 8">¥{{ detail.cost_price }} + {{ detail.treasure_price }}OE</text>
                 <template v-if="type == 6">
                     <text class="p_favour">¥{{ detail.cost_price }}</text>
                     <text class="un_p_favour">¥{{ detail.original_price }}</text>
@@ -59,13 +65,13 @@
                     <text class="red">{{ detail.first_teac }}</text>
                 </view> -->
             </view>
-            <view class="goods_teac flex_r flex_jb" v-if="['7'].includes(type)">
+            <!-- <view class="goods_teac flex_r flex_jb" v-if="['7'].includes(type)">
                 <view class="product-txt"></view>
                 <view class="product-txt fenxiang">
                     <text class="iconfont red">&#xe62b;</text>
                     <text class="red">分享约获得 {{ detail.first_int }} 现金</text>
                 </view>
-            </view>
+            </view> -->
             <view class="goods_subName">{{ detail.goodsMsg }}</view>
         </view>
         <!-- 标题信息栏-end -->
@@ -80,7 +86,7 @@
         <!-- 产品简介-end -->
         <!-- 底部导航组件 -->
         <view class="option">
-            <uni-goods-nav :fill="true" :options="options" :buttonGroup="type == 5 || type == 7? buttonGroupTea : buttonGroup" @click="onClick" @buttonClick="buttonClick" />
+            <uni-goods-nav :fill="true" :options="options" :buttonGroup="type == 5 || type == 7 || type == 8? buttonGroupTea : buttonGroup" @click="onClick" @buttonClick="buttonClick" />
         </view>
         <!-- 底部导航组件-end -->
         <!-- 购买或加入购物车弹窗 -->
@@ -146,15 +152,17 @@
                 <checkbox-group class="flex_r flex_ac flex_jc" @change="checkboxChange">
                     <label class="option_box">
                         <checkbox value="1" :checked="checked" color="#2DB389" style="transform: scale(0.7)" />
-                        我已阅读同意<text @tap.stop="getProPage" v-if="type != 5 && type != 6 && type != 7">《购买协议》</text>
+                        我已阅读同意<text @tap.stop="getProPage" v-if="type != 5 && type != 6 && type != 7 && type != 8">《购买协议》</text>
                         <text @tap.stop="getProPage" v-else-if="type == 5">《兑换协议》</text>
                         <text @tap.stop="getProPage" v-else-if="type == 6">《天天捡漏协议》</text>
                         <text @tap.stop="getProPage" v-else-if="type == 7">《消费券兑换协议》</text>
+                        <text @tap.stop="getProPage" v-else-if="type == 8">《兑换协议》</text>
                     </label>
                 </checkbox-group>
                 <view class="confim flex_r flex_ac flex_jc" v-if="type == 1" @tap="ToPayPage">立即支付</view>
                 <view class="confim flex_r flex_ac flex_jc" v-else-if="type == 5" @tap="ToPayPage">确认订单</view>
                 <view class="confim flex_r flex_ac flex_jc" v-else-if="type == 7" @tap="ToPayPage">确认订单</view>
+                <view class="confim flex_r flex_ac flex_jc" v-else-if="type == 8" @tap="ToPayPage">确认订单</view>
                 <view class="confim flex_r flex_ac flex_jc" v-else @tap="ToPayPage">立即支付 ¥{{afterSpecPrice * buyNum}}</view>
             </view>
         </uni-popup>

+ 84 - 47
src/pages/sign/index.vue

@@ -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">&#xe62b;</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">&#xe62b;</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">&#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>
         <!-- 精品推荐-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 {

+ 8 - 1
src/pages/to-pay-list/index.vue

@@ -97,6 +97,13 @@
                 <view class="list_con" v-if="Data.type != 5">{{ goodsInfo.treasure_price * Data.num }} 茶宝</view>
                 <view class="list_con" v-else>{{ $h.Mul(goodsInfo.cha_bao, Data.num) }} 茶宝</view>
             </view>
+            <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 8">
+                <view class="flex_r flex_ac">
+                    <view class="list_name">OE</view>
+                    <view class="list_con p_color">(可用{{ localInfo.original_equity }})</view>
+                </view>
+                <view class="list_con">{{ $h.Mul(goodsInfo.oe_price, Data.num) }} OE</view>
+            </view>
             <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 7">
                 <view class="flex_r flex_ac">
                     <view class="list_name">消费券</view>
@@ -363,7 +370,7 @@ export default {
                         obligation = b2 > 0 ? b2 : 0;
                     } else obligation = a;
                 }
-                else if (["5", "6", "7"].includes(type)) obligation = a;
+                else if (["5", "6", "7", "8"].includes(type)) obligation = a;
                 else if (["3"].includes(type)) obligation = b1 > 0 ? this.$h.Add(b1, ys) : ys;
                 else obligation = b > 0 ? b : 0;
                 this.obligation = obligation;

+ 179 - 0
src/pagesC/product/productOE.vue

@@ -0,0 +1,179 @@
+<template>
+  <view class="container">
+    <!-- 批发专区 -->
+    <view
+      class="who_list flex_r"
+      v-for="(item, index) in who_list"
+      :key="index"
+      @tap="NavToGoodsDetail(item.id)"
+    >
+      <image class="list_img" :src="item.original_img"></image>
+      <view class="list_info flex_c flex_jb">
+        <view class="info_name">{{ item.goods_name }}</view>
+        <view class="info_msg">
+          <view></view>
+          <span v-if="Number(item.price) != 0">{{ item.price }}元</span>
+          <span
+            v-if="Number(item.oe_price) != 0 && Number(item.price) != 0"
+            >+</span
+          >
+          <span v-if="Number(item.oe_price) != 0"
+            >{{ item.oe_price }}OE</span
+          >
+        </view>
+        <view class="info_btn_con flex_r flex_je">
+          <view class="info_btn flex_r flex_ac flex_jc">兑换</view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+<script>
+let page = 1;
+import { post } from "@/request/api.js";
+export default {
+  data() {
+    return {
+      who_list: [], // 茶宝兑换商品列表
+      type: "",
+    };
+  },
+  onLoad(e) {
+    this.type = e.type;
+  },
+  onShow() {
+    page = 1;
+    this.who_list = [];
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+      let that = this;
+      uni.showLoading({ mask: true });
+      let data = {
+        page: page,
+        type: this.type,
+      };
+      post("v1/goods/goodsList", data).then((res) => {
+        uni.hideLoading();
+        if (res.code === 0) {
+          let obj = res.data.data;
+          if (page == 1) that.who_list = [];
+          if (obj.length > 0) {
+            obj.forEach((e) => {
+              that.who_list.push(e);
+            });
+          } else {
+            page = -1;
+            this.$toast("暂无更多");
+          }
+        } else {
+          page = -1;
+          this.$toast("暂无更多");
+        }
+      });
+    },
+    // 跳转到商品详情页
+    NavToGoodsDetail: function (id) {
+      uni.navigateTo({
+        url: "/pages/product/p_details?id=" + id + "&type=" + this.type,
+      });
+    },
+  },
+
+  onShareAppMessage() {
+    let userinfo = uni.getStorageSync("userinfo");
+    var path = "/pages/product/productWholesale";
+    if (userinfo.invite)
+      path = "/pages/product/productWholesale?invite=" + userinfo.invite;
+    var title = `让数字经济赋能美好生活!`;
+    return {
+      title: title,
+      path: path,
+    };
+  },
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    if (page != -1) {
+      var that = this;
+      setTimeout(function () {
+        ++page;
+        that.loadData();
+      }, 800);
+    }
+  },
+};
+</script>
+<style lang="scss">
+// 页面配置
+page {
+  background: #f5f5f5;
+}
+
+.container {
+  padding: 18rpx 30rpx 0;
+  box-sizing: border-box;
+}
+
+// 页面配置-end
+
+// 批发商品列表
+.info_btn_con {
+  width: 100%;
+  overflow: hidden;
+}
+
+.list_info {
+  width: calc(100% - 200rpx);
+  overflow: hidden;
+}
+
+.list_img {
+  width: 200rpx;
+  height: 180rpx;
+  margin-right: 35rpx;
+  border-radius: 12rpx;
+}
+
+.info_btn {
+  width: 134rpx;
+  height: 50rpx;
+  background: #2db48a;
+  font-size: 30rpx;
+  color: #fff;
+  border-radius: 12rpx;
+}
+
+.info_msg {
+  width: 100%;
+  overflow: hidden;
+  font-size: 28rpx;
+  color: #18bb88;
+  font-family: "SourceHanSansCN-Medium";
+  font-weight: 500;
+}
+
+.info_name {
+  width: 100%;
+  overflow: hidden;
+  font-size: 34rpx;
+  color: #1b1b1b;
+  font-family: "SourceHanSansCN-Bold";
+  font-weight: bold;
+}
+
+.who_list {
+  width: 100%;
+  overflow: hidden;
+  background: #fff;
+  padding: 20rpx 16rpx;
+  box-sizing: border-box;
+  border-radius: 12rpx;
+  margin-bottom: 18rpx;
+  align-items: initial;
+}
+
+// 批发商品列表-end
+</style>

+ 1 - 0
src/utils/myfun.js

@@ -77,6 +77,7 @@ export function tidyTpye(va) {
         case 5: return "茶宝兑换";
         case 6: return "天天捡漏";
         case 7: return "消费券兑换";
+        case 8: return "OE兑换";
         default: return ""
     }
 }