Browse Source

美团平台分佣

xiaomei 1 year ago
parent
commit
bf13584058

+ 343 - 4
src/pages/shoppingMall/index.vue

@@ -60,7 +60,7 @@
     </div>
     <!-- 平台切换-end -->
     <!-- 平台下分类-start -->
-    <div class="sort_box flex_r flex_jb flex_ac">
+    <div class="sort_box flex_r  flex_ac">
       <div
         :class="sortIndex == s ? 'sort sort-active' : 'sort'"
         v-for="(i, s) in sort"
@@ -71,7 +71,7 @@
       </div>
     </div>
     <!-- 平台下分类-end -->
-    <view class="product-list" v-if="goods.length > 0">
+    <view class="product-list" v-if="goods.length > 0 && platformObj.type != 5">
       <view
         class="product"
         v-for="(i, s) in goods"
@@ -240,6 +240,120 @@
               </text>
             </view>
           </template>
+          <!-- 美团 -->
+          <template v-else-if="platformObj.type == 5">
+            <view class="quan_box flex_r flex_as flex_wrap">
+              <!-- <view class="quan" v-if="i.coupon_discount > 0">
+                <span class="pl">券</span>
+                <span>¥{{ i.coupon_discount }}</span>
+              </view> -->
+              <view class="quan">
+                <span>赠付宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      (i.couponPackDetail.sellPrice *
+                        Number(i.commissionInfo.commissionPercent) /
+                        10000) *
+                        platformObj.ratio *
+                        100
+                    ) / 100
+                  }}
+                </span>
+              </view>
+              <view class="quan">
+                <span>赠茶宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      i.couponPackDetail.sellPrice * platformObj.chabao * 100
+                    ) / 100
+                  }}
+                </span>
+              </view>
+            </view>
+            <view class="product-price">
+              <text class="product-price-original">
+                <!-- // Math.floor(
+                  //   (i.min_group_price / 100 - i.coupon_discount / 100) * 100
+                  // ) / 100 -->
+                {{ i.couponPackDetail.sellPrice }}
+              </text>
+              <text class="product-price-favour">
+                ¥{{ i.couponPackDetail.originalPrice }}
+              </text>
+            </view>
+          </template>
+        </view>
+      </view>
+    </view>
+    <view class="product-list" v-if="goods.length > 0 && platformObj.type == 5">
+      <view
+        class="product type5"
+        v-for="(i, s) in goods"
+        :key="s"
+      >
+        <view class="flex_r flex_jb flex_ac">
+          <view class="image-view">
+            <image
+              class="product-image"
+              :src="i.couponPackDetail.headUrl"
+            ></image>
+          </view>
+          <view class="content-view">
+            <view :class="['product-title', 'ellipsis2']">
+              <span class="product-type">
+                {{ platformObj.name }}
+              </span>
+              <span>{{ i.couponPackDetail.name }}</span>
+            </view>
+            <view class="flex_r flex_jb flex_ae">
+              <view class="product-price">
+                <text class="product-price-original">
+                  {{ i.couponPackDetail.sellPrice }}
+                </text>
+                <text class="product-price-favour"
+                  >¥{{ i.couponPackDetail.originalPrice }}</text
+                >
+              </view>
+              <view class="buyed"> {{ i.couponPackDetail.saleVolume }} </view>
+            </view>
+              <view class="quan_box flex_r flex_as flex_wrap">
+                <!-- <view class="quan" v-if="i.coupon_discount > 0">
+                  <span class="pl">券</span>
+                  <span>¥{{ i.coupon_discount }}</span>
+                </view> -->
+                <view class="quan">
+                  <span>赠付宝:</span>
+                  <span>
+                    {{
+                      Math.floor(
+                        (i.couponPackDetail.sellPrice *
+                          Number(i.commissionInfo.commissionPercent) /
+                          10000) *
+                          platformObj.ratio *
+                          100
+                      ) / 100
+                    }}
+                  </span>
+                </view>
+                <view class="quan">
+                  <span>赠茶宝:</span>
+                  <span>
+                    {{
+                      Math.floor(
+                        i.couponPackDetail.sellPrice * platformObj.chabao * 100
+                      ) / 100
+                    }}
+                  </span>
+                </view>
+              </view>
+              <view class="shop"> {{ i.brandInfo.brandName || i.deliverablePoiInfo.poiName || "美团外卖" }} </view>
+          </view>
+        </view>
+        <view class="flex_r flex_ac flex_jb ">
+          <view class="mtBtn1" @click="copyMt(i)">分享好友</view>
+          <view class="mtBtn2" @click="toMt(i)">立即抢券</view>
         </view>
       </view>
     </view>
@@ -251,6 +365,7 @@
 <script>
 let page = 1;
 import { post } from "@/request/api.js";
+import uniCopy from "@/utils/copy";
 import notGoods from "@/components/not-goods/index.vue";
 export default {
   components: { notGoods },
@@ -321,7 +436,7 @@ export default {
       post("v1/cashback/getIcon").then((res) => {
         if (res.code === 0) {
           this.platform = res.data;
-          this.platform.length = 3; // 后期要去掉
+          this.platform.length = 4; // 后期要去掉
           this.platformObj = this.platform[this.navIndex];
           this.ratio = this.platform[this.navIndex].ratio;
         } else {
@@ -364,6 +479,17 @@ export default {
         }
       });
     },
+    // 获取美团平台下的分类
+    meituanCats() {
+      post("v1/cashback/meituanCats").then((res) => {
+        if (res.code === 0) {
+          this.sort = res.data.cats;
+          this.catObj = this.sort[0];
+        } else {
+          this.$toast(res.msg);
+        }
+      });
+    },
     // 切换平台
     changeNav(item, index) {
       this.sortIndex = 0;
@@ -380,6 +506,8 @@ export default {
         this.taobaoCats();
       } else if (this.platformObj.type == 3) {
         this.jingdongCats();
+      } else if (this.platformObj.type == 5) {
+        this.meituanCats();
       }
       page = 1;
       this.goods = [];
@@ -403,7 +531,7 @@ export default {
       this.goodsDay();
     },
     // 获取商品列表
-    goodsDay() {
+    async goodsDay() {
       uni.showLoading();
       let that = this;
       let data = {};
@@ -576,6 +704,72 @@ export default {
           .catch((e) => {
             uni.hideLoading();
           });
+      } else if (this.platformObj.type == 5) {
+        let { lat, lng } = await uni.Location();
+
+        this.catObj.cat_name
+          ? (data = {
+              pageNo: page,
+              listTopiId: this.catObj.cat_id,
+              searchText: this.keyword,
+              latitude: lat,
+              longitude: lng,
+            })
+          : (data = {
+              pageNo: page,
+              searchText: this.keyword,
+              latitude: lat,
+              longitude: lng,
+              listTopiId: 2,
+            });
+        console.log(data);
+
+        uni.request({
+          url: "https://meituan-java.chafubao.cn/query_coupon", //仅为示例,并非真实接口地址。
+          method: "POST",
+          header: {
+            token: uni.getStorageSync("token"),
+            "Content-Type": "application/x-www-form-urlencoded",
+          },
+          data: data,
+          success: (res) => {
+            uni.hideLoading();
+            console.log(res.data);
+            if (res.data.statusCode === 200) {
+              let obj = JSON.parse(
+                res.data.body
+              ).data;
+              console.log(obj);
+
+              if (page <= 1) that.goods = [];
+              if (obj.length > 0) {
+                obj.forEach((e) => {
+                  that.goods.push(e);
+                });
+              } else {
+                if (page == 1) {
+                  that.haveGoods = true;
+                  page = -1;
+                } else {
+                  page = -1;
+                  this.$toast("暂无更多");
+                }
+              }
+            } else {
+              if (page == 1) {
+                that.haveGoods = true;
+                page = -1;
+              } else {
+                page = -1;
+                this.$toast("暂无更多");
+              }
+            }
+            
+          },
+          fail: (error) => {
+            uni.hideLoading();
+          }
+        });
       }
     },
     // 跳转到商品详情页
@@ -627,6 +821,86 @@ export default {
         });
       }
     },
+    copyMt(item){
+      uni.request({
+        url: "https://meituan-java.chafubao.cn/get_referral_link", 
+        method: "POST",
+        header: {
+          token: uni.getStorageSync("token"),
+          "Content-Type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          skuViewId: item.couponPackDetail.skuViewId,
+          linkType: 2,
+          sid: uni.getStorageSync("userinfo").user_id
+        },
+        success: (res) => {
+          uni.hideLoading();
+          console.log(res.data);
+          if (res.data.statusCode === 200) {
+            let url = JSON.parse(
+                res.data.body
+              ).data;
+            uniCopy({
+              content: url,
+              success: (res1) => {
+                uni.showToast({
+                  title: "链接已复制",
+                  icon: "none",
+                  duration: 2000,
+                });
+              },
+              error: (e) => {},
+            });
+          }
+          
+        },
+        fail: (error) => {
+          uni.hideLoading();
+        }
+      });
+    },
+    // 前往美团小程序
+    toMt(item){
+      uni.request({
+        url: "https://meituan-java.chafubao.cn/get_referral_link", 
+        method: "POST",
+        header: {
+          token: uni.getStorageSync("token"),
+          "Content-Type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          skuViewId: item.couponPackDetail.skuViewId,
+          linkType: 4,
+          sid: uni.getStorageSync("userinfo").user_id
+        },
+        success: (res) => {
+          uni.hideLoading();
+          console.log(res.data);
+          if (res.data.statusCode === 200) {
+            let url = JSON.parse(
+                res.data.body
+              ).data;
+            wx.navigateToMiniProgram({
+              appId: "wxde8ac0a21135c07d",
+              path: url,
+              extraData: {
+              },
+              envVersion: "release",
+              success(res) {
+                // 打开成功
+                // _this.$refs.popup.close();
+              },
+            });
+          }
+          
+        },
+        fail: (error) => {
+          uni.hideLoading();
+        }
+      });
+      
+    }
   },
   //页面上拉触底事件的处理函数
   onReachBottom() {
@@ -683,6 +957,70 @@ page {
     }
   }
 
+  .type5{
+    width: 100%;
+    margin-bottom: 20rpx;
+    padding: 12rpx;
+    border-radius: 10rpx;
+    box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.06);
+    background-color: #fff;
+    &:nth-child(2n) {
+      margin-left: 0%;
+    }
+
+    .product-image {
+      border-radius: 10rpx;
+      width: 29vw;
+      height: 29vw;
+      object-fit: cover;
+    }
+    .content-view {
+      width: calc(100% - 29vw);
+      padding: 0 16rpx;
+      box-sizing: border-box;
+    }
+    .shop {
+      font-size: 22rpx;
+      color: #c4c4c4;
+    }
+    .buyed {
+      color: #888888;
+      font-size: 22rpx;
+      margin: 16rpx 0 4rpx;
+    }
+    .quan_box {
+      min-height: 0;
+      font-size: 20rpx;
+      color: #e90406;
+      margin: 12rpx 0 14rpx;
+    }
+    .mtBtn1{
+      width: 45%;
+      color: #FE6232;
+      text-align: center;
+      font-size: 26rpx;
+      font-weight: bold;
+      letter-spacing: 2rpx;
+      padding: 10rpx 0;
+      border-radius: 50rpx;
+      border: 1rpx solid #FE6232;
+      margin-top: 15rpx;
+    }
+    .mtBtn2{
+      width: 45%;
+      color: #fff;
+      text-align: center;
+      font-size: 26rpx;
+      font-weight: bold;
+      letter-spacing: 2rpx;
+      padding: 10rpx 0;
+      border-radius: 50rpx;
+      border: 1rpx solid #FE6232;
+      background-color: #FE6232;
+      margin-top: 15rpx;
+    }
+  }
+
   .product-image {
     border-radius: 10rpx 10rpx 0 0;
     width: 100%;
@@ -699,6 +1037,7 @@ page {
     overflow: hidden;
     line-height: 1.5;
     font-size: 26rpx;
+    height: 80rpx;
     font-weight: bold;
     color: #121212;
   }

+ 404 - 152
src/pagesC/shoppingMallType/index.vue

@@ -60,7 +60,7 @@
         <div class="tit">{{ i.name }}</div>
       </div>
     </div>
-    <div class="sort_box flex_r flex_jb flex_ac">
+    <div class="sort_box flex_r flex_ac">
       <div
         :class="sortIndex == s ? 'sort sort-active' : 'sort'"
         v-for="(i, s) in sort"
@@ -72,182 +72,259 @@
     </div>
     <view class="product-list" v-if="goods.length > 0">
       <view
-        class="product flex_r flex_jb flex_ac"
+        class="product"
         v-for="(i, s) in goods"
         :key="s"
         @click="NavToGoodsDetail(i)"
       >
-        <view class="image-view" v-if="typeObj.type == 1">
-          <image class="product-image" :src="i.goods_image_url"></image>
-        </view>
-        <view class="image-view" v-if="typeObj.type == 2">
-          <image
-            class="product-image"
-            :src="i.item_basic_info.pict_url"
-          ></image>
-        </view>
-        <view class="image-view" v-if="typeObj.type == 3">
-          <image
-            class="product-image"
-            :src="i.imageInfo.imageList[0].url"
-          ></image>
-        </view>
-        <view class="content-view flex_c flex_jb" v-if="typeObj.type == 1">
-          <view :class="['product-title', 'ellipsis2']">
-            <span class="product-type">
-              {{ typeObj.name }}
-            </span>
-            {{ i.goods_name }}
+        <view class="flex_r flex_jb flex_ac">
+          <view class="image-view" v-if="typeObj.type == 1">
+            <image class="product-image" :src="i.goods_image_url"></image>
           </view>
-          <view class="flex_r flex_jb flex_ae">
-            <view class="product-price">
-              <text class="product-price-original">
-                {{
-                  Math.floor(
-                    (i.min_group_price / 100 - i.coupon_discount / 100) * 100
-                  ) / 100
-                }}
-              </text>
-              <text class="product-price-favour"
-                >¥{{ i.min_group_price / 100 }}</text
-              >
-            </view>
-            <view class="buyed"> {{ i.sales_tip }}人已购 </view>
+          <view class="image-view" v-if="typeObj.type == 2">
+            <image
+              class="product-image"
+              :src="i.item_basic_info.pict_url"
+            ></image>
           </view>
-          <view class="quan_box flex_r flex_as flex_wrap">
-            <view class="quan" v-if="i.has_coupon">
-              <span class="pl">券</span>
-              <span>¥{{ i.coupon_discount / 100 }}</span>
+          <view class="image-view" v-if="typeObj.type == 3">
+            <image
+              class="product-image"
+              :src="i.imageInfo.imageList[0].url"
+            ></image>
+          </view>
+          <view class="image-view" v-if="typeObj.type == 5">
+            <image
+              class="product-image"
+              :src="i.couponPackDetail.headUrl"
+            ></image>
+          </view>
+          <view class="content-view flex_c flex_jb" v-if="typeObj.type == 1">
+            <view :class="['product-title', 'ellipsis2']">
+              <span class="product-type">
+                {{ typeObj.name }}
+              </span>
+              {{ i.goods_name }}
             </view>
-            <view class="quan">
-              <span>赠付宝:</span>
-              <span>{{
-                Math.floor(
-                  (i.min_group_price / 100) *
-                    (i.promotion_rate / 1000) *
-                    ratio *
-                    100
-                ) / 100
-              }}</span>
+            <view class="flex_r flex_jb flex_ae">
+              <view class="product-price">
+                <text class="product-price-original">
+                  {{
+                    Math.floor(
+                      (i.min_group_price / 100 - i.coupon_discount / 100) * 100
+                    ) / 100
+                  }}
+                </text>
+                <text class="product-price-favour"
+                  >¥{{ i.min_group_price / 100 }}</text
+                >
+              </view>
+              <view class="buyed"> {{ i.sales_tip }}人已购 </view>
             </view>
-            <view class="quan">
-              <span>赠茶宝:</span>
-              <span>
-                {{
+            <view class="quan_box flex_r flex_as flex_wrap">
+              <view class="quan" v-if="i.has_coupon">
+                <span class="pl">券</span>
+                <span>¥{{ i.coupon_discount / 100 }}</span>
+              </view>
+              <view class="quan">
+                <span>赠付宝:</span>
+                <span>{{
                   Math.floor(
-                    (i.min_group_price / 100 - i.coupon_discount / 100) *
-                      chabao_ratio *
+                    (i.min_group_price / 100) *
+                      (i.promotion_rate / 1000) *
+                      ratio *
                       100
                   ) / 100
-                }}
-              </span>
+                }}</span>
+              </view>
+              <view class="quan">
+                <span>赠茶宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      (i.min_group_price / 100 - i.coupon_discount / 100) *
+                        chabao_ratio *
+                        100
+                    ) / 100
+                  }}
+                </span>
+              </view>
             </view>
+            <view class="shop"> {{ i.mall_name }} </view>
           </view>
-          <view class="shop"> {{ i.mall_name }} </view>
-        </view>
-        <view class="content-view flex_c flex_jb" v-else-if="typeObj.type == 2">
-          <view :class="['product-title', 'ellipsis2']">
-            <span class="product-type">
-              {{ typeObj.name }}
-            </span>
-            {{ i.item_basic_info.title }}
-          </view>
-          <view class="flex_r flex_jb flex_ae">
-            <view class="product-price">
-              <text class="product-price-original">
-                {{ i.price_promotion_info.final_promotion_price }}
-              </text>
-              <text class="product-price-favour"
-                >¥{{ i.price_promotion_info.zk_final_price }}</text
-              >
+          <view
+            class="content-view flex_c flex_jb"
+            v-else-if="typeObj.type == 2"
+          >
+            <view :class="['product-title', 'ellipsis2']">
+              <span class="product-type">
+                {{ typeObj.name }}
+              </span>
+              {{ i.item_basic_info.title }}
             </view>
-            <view class="buyed">
-              {{ i.item_basic_info.annual_vol }}人已购
+            <view class="flex_r flex_jb flex_ae">
+              <view class="product-price">
+                <text class="product-price-original">
+                  {{ i.price_promotion_info.final_promotion_price }}
+                </text>
+                <text class="product-price-favour"
+                  >¥{{ i.price_promotion_info.zk_final_price }}</text
+                >
+              </view>
+              <view class="buyed">
+                {{ i.item_basic_info.annual_vol }}人已购
+              </view>
             </view>
-          </view>
-          <view class="quan_box flex_r flex_as flex_wrap">
-            <view class="quan" v-if="i.coupon_discount > 0">
-              <span class="pl">券</span>
-              <span>¥{{ i.coupon_discount }}</span>
+            <view class="quan_box flex_r flex_as flex_wrap">
+              <view class="quan" v-if="i.coupon_discount > 0">
+                <span class="pl">券</span>
+                <span>¥{{ i.coupon_discount }}</span>
+              </view>
+              <view class="quan">
+                <span>赠付宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      ((i.price_promotion_info.final_promotion_price *
+                        i.publish_info.income_rate) /
+                        100) *
+                        ratio *
+                        100
+                    ) / 100
+                  }}
+                </span>
+              </view>
+              <view class="quan">
+                <span>赠茶宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      i.price_promotion_info.final_promotion_price *
+                        chabao_ratio *
+                        100
+                    ) / 100
+                  }}
+                </span>
+              </view>
             </view>
-            <view class="quan">
-              <span>赠付宝:</span>
-              <span>
-                {{
-                  Math.floor(
-                    ((i.price_promotion_info.final_promotion_price *
-                      i.publish_info.income_rate) /
-                      100) *
-                      ratio *
-                      100
-                  ) / 100
-                }}
+            <view class="shop"> {{ i.item_basic_info.shop_title }} </view>
+          </view>
+          <view
+            class="content-view flex_c flex_jb"
+            v-else-if="typeObj.type == 3"
+          >
+            <view :class="['product-title', 'ellipsis2']">
+              <span class="product-type">
+                {{ typeObj.name }}
               </span>
+              {{ i.skuName }}
             </view>
-            <view class="quan">
-              <span>赠茶宝:</span>
-              <span>
-                {{
-                  Math.floor(
-                    i.price_promotion_info.final_promotion_price *
-                      chabao_ratio *
-                      100
-                  ) / 100
-                }}
-              </span>
+            <view class="flex_r flex_jb flex_ae">
+              <view class="product-price">
+                <text class="product-price-original">
+                  {{ i.priceInfo.lowestCouponPrice }}
+                </text>
+                <text class="product-price-favour"
+                  >¥{{ i.priceInfo.price }}</text
+                >
+              </view>
+              <view class="buyed"> {{ i.inOrderCount30Days }}人已购 </view>
             </view>
-          </view>
-          <view class="shop"> {{ i.item_basic_info.shop_title }} </view>
-        </view>
-        <view class="content-view flex_c flex_jb" v-else-if="typeObj.type == 3">
-          <view :class="['product-title', 'ellipsis2']">
-            <span class="product-type">
-              {{ typeObj.name }}
-            </span>
-            {{ i.skuName }}
-          </view>
-          <view class="flex_r flex_jb flex_ae">
-            <view class="product-price">
-              <text class="product-price-original">
-                {{ i.priceInfo.lowestCouponPrice }}
-              </text>
-              <text class="product-price-favour"
-                >¥{{ i.priceInfo.price }}</text
-              >
+            <view class="quan_box flex_r flex_as flex_wrap">
+              <view class="quan" v-if="i.coupon_discount > 0">
+                <span class="pl">券</span>
+                <span>¥{{ i.coupon_discount }}</span>
+              </view>
+              <view class="quan">
+                <span>赠付宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      ((i.priceInfo.lowestCouponPrice *
+                        i.commissionInfo.commissionShare) /
+                        100) *
+                        ratio *
+                        100
+                    ) / 100
+                  }}
+                </span>
+              </view>
+              <view class="quan">
+                <span>赠茶宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      i.priceInfo.lowestCouponPrice * chabao_ratio * 100
+                    ) / 100
+                  }}
+                </span>
+              </view>
             </view>
-            <view class="buyed"> {{ i.inOrderCount30Days }}人已购 </view>
+            <view class="shop"> {{ i.shopInfo.shopName }} </view>
           </view>
-          <view class="quan_box flex_r flex_as flex_wrap">
-            <view class="quan" v-if="i.coupon_discount > 0">
+          <view
+            class="content-view flex_c flex_jb"
+            v-else-if="typeObj.type == 5"
+          >
+            <view :class="['product-title', 'ellipsis2']">
+              <span class="product-type">
+                {{ typeObj.name }}
+              </span>
+              {{ i.couponPackDetail.name }}
+            </view>
+            <view class="flex_r flex_jb flex_ae">
+              <view class="product-price">
+                <text class="product-price-original">
+                  {{ i.couponPackDetail.sellPrice }}
+                </text>
+                <text class="product-price-favour"
+                  >¥{{ i.couponPackDetail.originalPrice }}</text
+                >
+              </view>
+              <view class="buyed"> {{ i.couponPackDetail.saleVolume }} </view>
+            </view>
+            <view class="quan_box flex_r flex_as flex_wrap">
+              <!-- <view class="quan" v-if="i.coupon_discount > 0">
               <span class="pl">券</span>
               <span>¥{{ i.coupon_discount }}</span>
+            </view> -->
+              <view class="quan">
+                <span>赠付宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      ((i.couponPackDetail.sellPrice *
+                        Number(i.commissionInfo.commissionPercent)) /
+                        10000) *
+                        ratio *
+                        100
+                    ) / 100
+                  }}
+                </span>
+              </view>
+              <view class="quan">
+                <span>赠茶宝:</span>
+                <span>
+                  {{
+                    Math.floor(
+                      i.couponPackDetail.sellPrice * chabao_ratio * 100
+                    ) / 100
+                  }}
+                </span>
+              </view>
             </view>
-            <view class="quan">
-              <span>赠付宝:</span>
-              <span>
-                {{
-                  Math.floor(
-                    ((i.priceInfo.lowestCouponPrice *
-                      i.commissionInfo.commissionShare) /
-                      100) *
-                      ratio *
-                      100
-                  ) / 100
-                }}
-              </span>
-            </view>
-            <view class="quan">
-              <span>赠茶宝:</span>
-              <span>
-                {{
-                  Math.floor(
-                    i.priceInfo.lowestCouponPrice * chabao_ratio * 100
-                  ) / 100
-                }}
-              </span>
+            <view class="shop">
+              {{
+                i.brandInfo.brandName ||
+                i.deliverablePoiInfo.poiName ||
+                "美团外卖"
+              }}
             </view>
           </view>
-          <view class="shop"> {{ i.shopInfo.shopName }} </view>
+        </view>
+        <view class="flex_r flex_ac flex_jb" v-if="typeObj.type == 5">
+          <view class="mtBtn1" @click="copyMt(i)">分享好友</view>
+          <view class="mtBtn2" @click="toMt(i)">立即抢券</view>
         </view>
       </view>
     </view>
@@ -319,6 +396,8 @@ export default {
       this.taobaoCats();
     } else if (this.typeObj.type == 3) {
       this.jingdongCats();
+    } else if (this.typeObj.type == 5) {
+      this.meituanCats();
     }
     this.goodsDay();
   },
@@ -401,6 +480,18 @@ export default {
         }
       });
     },
+    // 获取美团平台下的分类
+    meituanCats() {
+      post("v1/cashback/meituanCats").then((res) => {
+        if (res.code === 0) {
+          this.sort = res.data.cats;
+          this.catObj = this.sort[0];
+          this.Channels = res.data.channel;
+        } else {
+          this.$toast(res.msg);
+        }
+      });
+    },
     toPage(url) {
       this.goto(url);
     },
@@ -584,7 +675,7 @@ export default {
       });
     },
     // 获取商品列表
-    goodsDay() {
+    async goodsDay() {
       uni.showLoading();
       let that = this;
       let data = {};
@@ -755,6 +846,69 @@ export default {
           .catch((e) => {
             uni.hideLoading();
           });
+      } else if (this.typeObj.type == 5) {
+        let { lat, lng } = await uni.Location();
+
+        this.catObj.cat_name
+          ? (data = {
+              pageNo: page,
+              listTopiId: this.catObj.cat_id,
+              searchText: this.keyword,
+              latitude: lat,
+              longitude: lng,
+            })
+          : (data = {
+              pageNo: page,
+              searchText: this.keyword,
+              latitude: lat,
+              longitude: lng,
+              listTopiId: 2,
+            });
+        console.log(data);
+
+        uni.request({
+          url: "https://meituan-java.chafubao.cn/query_coupon", //仅为示例,并非真实接口地址。
+          method: "POST",
+          header: {
+            token: uni.getStorageSync("token"),
+            "Content-Type": "application/x-www-form-urlencoded",
+          },
+          data: data,
+          success: (res) => {
+            uni.hideLoading();
+            console.log(res.data);
+            if (res.data.statusCode === 200) {
+              let obj = JSON.parse(res.data.body).data;
+              console.log(obj);
+
+              if (page <= 1) that.goods = [];
+              if (obj.length > 0) {
+                obj.forEach((e) => {
+                  that.goods.push(e);
+                });
+              } else {
+                if (page == 1) {
+                  that.haveGoods = true;
+                  page = -1;
+                } else {
+                  page = -1;
+                  this.$toast("暂无更多");
+                }
+              }
+            } else {
+              if (page == 1) {
+                that.haveGoods = true;
+                page = -1;
+              } else {
+                page = -1;
+                this.$toast("暂无更多");
+              }
+            }
+          },
+          fail: (error) => {
+            uni.hideLoading();
+          },
+        });
       }
     },
     onBack() {
@@ -809,6 +963,78 @@ export default {
         });
       }
     },
+    copyMt(item) {
+      uni.request({
+        url: "https://meituan-java.chafubao.cn/get_referral_link",
+        method: "POST",
+        header: {
+          token: uni.getStorageSync("token"),
+          "Content-Type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          skuViewId: item.couponPackDetail.skuViewId,
+          linkType: 2,
+          sid: uni.getStorageSync("userinfo").user_id,
+        },
+        success: (res) => {
+          uni.hideLoading();
+          console.log(res.data);
+          if (res.data.statusCode === 200) {
+            let url = JSON.parse(res.data.body).data;
+            uniCopy({
+              content: url,
+              success: (res1) => {
+                uni.showToast({
+                  title: "链接已复制",
+                  icon: "none",
+                  duration: 2000,
+                });
+              },
+              error: (e) => {},
+            });
+          }
+        },
+        fail: (error) => {
+          uni.hideLoading();
+        },
+      });
+    },
+    // 前往美团小程序
+    toMt(item) {
+      uni.request({
+        url: "https://meituan-java.chafubao.cn/get_referral_link",
+        method: "POST",
+        header: {
+          token: uni.getStorageSync("token"),
+          "Content-Type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          skuViewId: item.couponPackDetail.skuViewId,
+          linkType: 4,
+          sid: uni.getStorageSync("userinfo").user_id,
+        },
+        success: (res) => {
+          uni.hideLoading();
+          console.log(res.data);
+          if (res.data.statusCode === 200) {
+            let url = JSON.parse(res.data.body).data;
+            wx.navigateToMiniProgram({
+              appId: "wxde8ac0a21135c07d",
+              path: url,
+              extraData: {},
+              envVersion: "release",
+              success(res) {
+                // 打开成功
+                // _this.$refs.popup.close();
+              },
+            });
+          }
+        },
+        fail: (error) => {
+          uni.hideLoading();
+        },
+      });
+    },
   },
   //页面上拉触底事件的处理函数
   onReachBottom() {
@@ -949,6 +1175,31 @@ page {
     font-size: 22rpx;
     color: #c4c4c4;
   }
+  .mtBtn1 {
+    width: 45%;
+    color: #fe6232;
+    text-align: center;
+    font-size: 26rpx;
+    font-weight: bold;
+    letter-spacing: 2rpx;
+    padding: 10rpx 0;
+    border-radius: 50rpx;
+    border: 1rpx solid #fe6232;
+    margin-top: 15rpx;
+  }
+  .mtBtn2 {
+    width: 45%;
+    color: #fff;
+    text-align: center;
+    font-size: 26rpx;
+    font-weight: bold;
+    letter-spacing: 2rpx;
+    padding: 10rpx 0;
+    border-radius: 50rpx;
+    border: 1rpx solid #fe6232;
+    background-color: #fe6232;
+    margin-top: 15rpx;
+  }
 
   .product-price-favour {
     color: #a0a0a0;
@@ -1095,6 +1346,7 @@ page {
   margin: -50rpx 0 0;
   padding: 20rpx 20rpx 0;
   border-radius: 20rpx;
+  min-height: 50rpx;
   // flex-wrap: wrap;
   background-color: #f5f6f8;
 

+ 21 - 15
src/pagesC/shoppingMallType/order/list.vue

@@ -33,8 +33,8 @@
               :data-type="li.type"
               @tap="toDetails(li)"
             >
-              <image :src="li.image" mode="cover" class="goods-img" />
-              <view class="goodsDetail_info flex_c flex_jb">
+              <image :src="li.image" mode="cover" class="goods-img" v-if="li.image" />
+              <view class="goodsDetail_info flex_c flex_jb" :style="{width: !li.image?'100%':'calc(100% - 130rpx)',padding:!li.image?'6rpx 0':'6rpx 0 6rpx 20rpx'}">
                 <view class="good_name flex_r flex_ac flex_jb">
                   <span class="width_r ellipsis">
                     {{ li.name || "" }}
@@ -207,26 +207,32 @@ export default {
         mask: true,
       });
       var data = {
-        page,
+        p: page,
         status: this.currentType,
       };
 
       post("v1/cashback/orderList", data).then((res) => {
+        uni.hideLoading();
         if (res.code === 0) {
-          uni.hideLoading();
-          uni.stopPullDownRefresh();
-          let da = res.data.data;
-          console.log(da);
-
-          if (page <= 1) {
-            this.orderList = [];
-            if (!da.length) this.haveGoods = true;
+          if (res.data.data.length > 0) {
+            this.orderList = this.orderList.concat(res.data.data);
+          } else {
+            if (page == 1) {
+              this.haveGoods = true;
+              page = -1;
+            } else {
+              page = -1;
+              this.$toast("暂无更多");
+            }
           }
-          this.orderList = [...this.orderList, ...da];
         } else {
-          uni.hideLoading();
-          this.$toast(res.msg || "");
-          this.loadingMoreHidden = false;
+          if (page == 1) {
+            this.haveGoods = true;
+            page = -1;
+          } else {
+            page = -1;
+            this.$toast("暂无更多");
+          }
         }
       });
     },

BIN
src/static/my/f_img_code.png


BIN
src/static/my/weixin.png


BIN
src/static/my/weixin_dis.png


BIN
src/static/wallet/10.png