Browse Source

拼多多

xiaomei 1 year ago
parent
commit
c79f11cc35

+ 26 - 18
src/pages.json

@@ -79,12 +79,12 @@
 				"navigationBarTitleText": "寄卖"
 			}
 		},
-		{
-			"path": "pages/account/giveAsPresent",
-			"style": {
-				"navigationBarTitleText": "赠送"
-			}
-		},
+		// {
+		// 	"path": "pages/account/giveAsPresent",
+		// 	"style": {
+		// 		"navigationBarTitleText": "赠送"
+		// 	}
+		// },
 		// {
 		// 	"path": "pages/account/conversion",
 		// 	"style": {
@@ -200,12 +200,7 @@
 				"navigationBarTitleText": "登录"
 			}
 		},
-		{
-			"path": "pages/pay-agreement/index",
-			"style": {
-				"navigationBarTitleText": "购买协议"
-			}
-		},
+		
 		{
 			"path": "pages/agreement/index",
 			"style": {
@@ -241,6 +236,13 @@
 			"style": {
 				"navigationBarTitleText": "享好物"
 			}
+		},
+		{
+			"path": "pages/shoppingMall/index",
+			"style": {
+				"navigationBarTitleText": "商城购物",
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"subPackages": [
@@ -655,6 +657,12 @@
 					"style": {
 						"navigationBarTitleText": "我的消费"
 					}
+				},
+				{
+					"path": "pay-agreement/index",
+					"style": {
+						"navigationBarTitleText": "购买协议"
+					}
 				}
 			]
 		}
@@ -695,12 +703,12 @@
 			// 	"selectedIconPath": "static/nav/local.png",
 			// 	"text": "消费券电商"
 			// },
-			// {
-			// 	"pagePath": "pages/sign/index",
-			// 	"iconPath": "static/nav/benefits_.png",
-			// 	"selectedIconPath": "static/nav/benefits.png",
-			// 	"text": "福利"
-			// },
+			{
+				"pagePath": "pages/shoppingMall/index",
+				"iconPath": "static/nav/good_.png",
+				"selectedIconPath": "static/nav/good.png",
+				"text": "商城购物"
+			},
 			{
 				"pagePath": "pages/my/index",
 				"iconPath": "static/nav/my_.png",

+ 9 - 3
src/pages/my/index.vue

@@ -218,9 +218,9 @@
                         <image class="fun_img" src="/static/my/15.png"></image>
                         <view class="fun_text">电商订单</view>
                     </navigator>
-                    <navigator class="fun_list flex_c flex_ac" @click="copy" hover-class="none">
-                        <image class="fun_img" src="/static/my/14.png"></image>
-                        <view class="fun_text">APP下载</view>
+                    <navigator class="fun_list flex_c flex_ac" url="/pagesC/shoppingMallType/order/list" hover-class="none">
+                        <image class="fun_img" src="/static/my/15.png"></image>
+                        <view class="fun_text">商城订单</view>
                     </navigator>
                 </view>
                 <view class="fun_con mar_t50 flex_r flex_ac">
@@ -261,6 +261,12 @@
                         </button>
                     </view>
                 </view>
+                <view class="fun_con mar_t50 flex_r flex_ac">
+                    <navigator class="fun_list flex_c flex_ac" @click="copy" hover-class="none">
+                        <image class="fun_img" src="/static/my/14.png"></image>
+                        <view class="fun_text">APP下载</view>
+                    </navigator>
+                </view>
             </view>
         </view>
         <!-- #ifdef APP-PLUS || H5 -->

+ 1 - 1
src/pages/product/p_details.vue

@@ -364,7 +364,7 @@ export default {
         },
         getProPage() {
             uni.navigateTo({
-                url: "/pages/pay-agreement/index?type=" + this.goodsDa.type,
+                url: "/pagesC/pay-agreement/index?type=" + this.goodsDa.type,
             });
         },
         // SoHAuth() {

+ 12 - 4
src/pagesC/shoppingMall/index.vue → src/pages/shoppingMall/index.vue

@@ -92,7 +92,7 @@
                 >¥
                 {{
                   Math.floor(
-                    (i.min_group_price / 100) * (i.promotion_rate / 1000) * 100
+                    (i.min_group_price / 100) * (i.promotion_rate / 1000) * radio * 100
                   ) / 100
                 }}
               </span>
@@ -136,9 +136,11 @@ export default {
       cat_id: 0,
       keyword: "", // 搜索关键字
       banner: {},
+      radio: 0
     };
   },
   async onShow() {
+    this.getIcon()
     uni.setTabBarStyle({
       color: "#999",
       selectedColor: "#E68B1E",
@@ -147,9 +149,10 @@ export default {
     this.goods = [];
     this.duoduoCats();
     this.goodsDay();
-    this.getIcon();
+    
   },
   onLoad(da) {
+    this.getIcon();
     uni.setTabBarStyle({
       color: "#999",
       selectedColor: "#E68B1E",
@@ -169,6 +172,11 @@ export default {
       post("v1/cashback/getIcon").then((res) => {
         if (res.code === 0) {
           this.tabs = res.data;
+          console.log(this.tabs);
+          
+          this.radio = this.tabs[this.navIndex].ratio
+          console.log(this.radio);
+          
         } else {
           this.$toast(res.msg);
         }
@@ -240,10 +248,10 @@ export default {
         });
     },
     // 跳转到商品详情页
-    NavToGoodsDetail(goods_sign, type) {
+    NavToGoodsDetail(goods_sign) {
       this.goto("/pagesC/shoppingMallType/p_details", {
         goods_sign,
-        type: this.type,
+        type: this.tabs[this.navIndex].type,
       });
     },
   },

+ 0 - 0
src/pages/pay-agreement/index.vue → src/pagesC/pay-agreement/index.vue


+ 18 - 3
src/pagesC/shoppingMallType/index.vue

@@ -111,7 +111,7 @@
               <span
                 >¥{{
                   Math.floor(
-                    (i.min_group_price / 100) * (i.promotion_rate / 1000) * 100
+                    (i.min_group_price / 100) * (i.promotion_rate / 1000) *radio * 100
                   ) / 100
                 }}</span
               >
@@ -175,6 +175,7 @@ export default {
       typeObj: {},
       keyword: "",
       banner: {},
+      radio: 0
     };
   },
   async onShow() {
@@ -194,6 +195,7 @@ export default {
     console.log(da);
 
     this.typeObj = da;
+    this.getIcon()
   },
   onHide() {},
   onPageScroll(e) {
@@ -216,6 +218,19 @@ export default {
       this.cat_id = item.cat_id;
       this.goodsDay();
     },
+    getIcon() {
+      post("v1/cashback/getIcon").then((res) => {
+        if (res.code === 0) {
+          let tabs = res.data;
+          
+          this.radio = tabs[0].ratio
+          console.log(this.radio);
+          
+        } else {
+          this.$toast(res.msg);
+        }
+      });
+    },
     duoduoCats() {
       post("v1/cashback/duoduoCats").then((res) => {
         if (res.code === 0) {
@@ -376,10 +391,10 @@ export default {
       uni.navigateBack();
     },
     // 跳转到商品详情页
-    NavToGoodsDetail(goods_sign, type) {
+    NavToGoodsDetail(goods_sign) {
       this.goto("/pagesC/shoppingMallType/p_details", {
         goods_sign,
-        type: this.type,
+        type: this.typeObj.type,
       });
     },
   },

+ 508 - 538
src/pagesC/shoppingMallType/order/list.vue

@@ -1,681 +1,651 @@
 <template>
-    <view class="container">
-        <view class="status-box">
-            <view class="status_tap_box" style="position: relative">
-                <view @tap="statusTap" class="status-label" v-for="(item, index) in statusType" :key="index" :class="item[0] == currentType ? 'active' : ''" :data-index="item[0]">{{ item[1] }}</view>
+  <view class="container">
+    <view class="status-box">
+      <view class="status_tap_box" style="position: relative">
+        <view
+          @tap="statusTap"
+          class="status-label"
+          v-for="(item, index) in statusType"
+          :key="index"
+          :class="item[0] == currentType ? 'active' : ''"
+          :data-index="item[0]"
+          >{{ item[1] }}</view
+        >
+      </view>
+    </view>
+    <not-goods v-if="haveGoods" textStr="抱歉!暂无相关订单" />
+    <view class="order-list" v-if="orderList && orderList.length > 0">
+      <view v-for="(li, index) in orderList" :key="index">
+        <view class="a-order">
+          <view class="overflow" :data-id="li.id">
+            <view class="list-title flex_r flex_ac flex_jb">
+              <view class="fz_text">{{ li.mall_name }}</view>
+              <view :class="['fz_text', 'typetag', 'tagcolor' + li.type]">
+                {{
+                  tabs.filter((t) => {
+                    return li.type == t.type;
+                  })[0].name
+                }}
+              </view>
             </view>
-        </view>
-        <not-goods v-if="haveGoods" textStr="抱歉!暂无相关订单" />
-        <view class="order-list" v-if="orderList && orderList.length > 0">
-            <view v-for="(li, index) in orderList" :key="index">
-                <view class="a-order">
-                    <view class="overflow" :data-id="li.id">
-                        <view class="list-title flex_r flex_ac flex_jb">
-                            <view class="fz_text">立邦官方旗舰店</view>
-                            <view :class="['fz_text', 'typetag', 'tagcolor' + li.type]">拼多多</view>
-                        </view>
-                        <view class="goods-info flex_r flex_jb" :data-type="li.type" @tap="toDetails(li)">
-                            <image :src="li.original_img" mode="cover" class="goods-img" />
-                            <view class="goodsDetail_info flex_c flex_jb">
-                                <view class="good_name flex_r flex_ac flex_jb">
-                                    <span class="width_r ellipsis">{{ li.goods_name || "" }}</span>
-                                    <span class="status_text">即将到账</span>
-                                </view>
-                                <view class="good_text flex_r flex_ac flex_jb" :style="{bottom:li.type == 1?'15rpx':0}">
-                                    <view class="unimport flex_r flex_ac flex_jb width_r">
-                                        <span class="width_r_1 ellipsis">交易编号:241025-276048145972667</span>
-                                        <view class="copy">复制</view>
-                                    </view>
-                                    <span class="status_text status_text_1">已付款</span>
-                                </view>
-                            </view>
-                        </view>
-                    </view>
-                    <view class="price-box flex_r flex_ac">
-                        <view class="item flex_c flex_ac">
-                            <span class="k">实付</span>
-                            <span class="v">18.90</span>
-                        </view>
-                        <view class="item flex_c flex_ac">
-                            <span class="k">预估收益</span>
-                            <uni-tooltip class="tooltip" :content="'买单收益:¥'+18.90" placement="bottom">
-                                <span class="v">18.90</span>
-                            </uni-tooltip>
-                            
-                        </view>
-                    </view>
-                    <view class="time">付款时间:2024/10/28 11:56:58</view>
-                    <view class="time">收货后15天收益到账</view>
+            <view
+              class="goods-info flex_r flex_jb"
+              :data-type="li.type"
+              @tap="toDetails(li)"
+            >
+              <image :src="li.image" mode="cover" class="goods-img" />
+              <view class="goodsDetail_info flex_c flex_jb">
+                <view class="good_name flex_r flex_ac flex_jb">
+                  <span class="width_r ellipsis">
+                    {{ li.name || "" }}
+                  </span>
+                  <span class="status_text">
+                    {{ statusDesc[li.status].t2 }}
+                  </span>
                 </view>
+                <view class="good_text flex_r flex_ac flex_jb">
+                  <view class="unimport flex_r flex_ac flex_jb width_r">
+                    <span class="width_r_1 ellipsis"
+                      >交易编号:{{ li.order_no }}</span
+                    >
+                    <view class="copy" @click.stop="copyText(li.order_no)"
+                      >复制</view
+                    >
+                  </view>
+                  <span class="status_text status_text_1">
+                    {{ statusDesc[li.status].t1 }}
+                  </span>
+                </view>
+              </view>
+            </view>
+          </view>
+          <view class="price-box flex_r flex_ac">
+            <view class="item flex_c flex_ac">
+              <span class="k">实付</span>
+              <span class="v">{{ li.order_amount }}</span>
             </view>
+            <view class="item flex_c flex_ac">
+              <span class="k">预估收益</span>
+              <uni-tooltip
+                class="tooltip"
+                :content="'买单收益:¥' + li.income_amount"
+                placement="bottom"
+              >
+                <span class="v">{{ li.income_amount }}</span>
+              </uni-tooltip>
+            </view>
+          </view>
+          <view class="time"
+            >付款时间:{{
+              $day(li.pay_time * 1000).format("YYYY-MM-DD HH:mm:ss")
+            }}</view
+          >
+          <view class="time" v-if="li.status == 1">收货后15天收益到账</view>
         </view>
-        <view class="loading-indicator opacity">{{ loadingTip }}</view>
-        <!-- <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" /> -->
+      </view>
     </view>
+    <view class="loading-indicator opacity">{{ loadingTip }}</view>
+    <!-- <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" /> -->
+  </view>
 </template>
 <script>
 var page = 1;
 var app = getApp();
-import { ToPayOpre } from "@/utils/reqTools.js";
-var toPayOpre = new ToPayOpre();
 import notGoods from "@/components/not-goods/index";
 import authorizeModule from "@/components/authorize-module/index";
 import { post } from "@/request/api.js";
+import uniCopy from "@/utils/copy";
 export default {
-    components: {
-        notGoods,
-        authorizeModule
-    },
-    data() {
-        return {
-            statusType: [
-                ["1", "已付款"],
-                ["2", "退款/售后"],
-            ],
-            orderList: [],
-            currentType: "0",
-            haveGoods: false,
-            loadingMoreHidden: true,
-            loadingTip: "没有更多了",
-            userId: "",
-            isweixin: "",
-            pt: {},
-            shopInfo: {}, // 商铺信息
-            unid: "",
-            token: uni.getStorageSync("token"),
-        };
-    },
-    onLoad(options) {
-        this.currentType = options.status ? options.status : 0;
-    },
-    onShow() {
-        page = 1
-        if (!this.token) this.login()
-        else this.loadData();
-    },
-    methods: {
-        login() {
-            let that = this;
-            // #ifdef  MP-WEIXIN
-            wx.login({
-                success(res) {
-                    if (res.code) {
-                        post("v1/appletLogin", {
-                            code: res.code,
-                            invite: uni.getStorageSync("inviteCode") || "",
-                        }).then((res) => {
-                            if (res.code === 0) {
-                                if (res.data.token) {
-                                    uni.setStorageSync("token", res.data.token);
-                                    that.loadData();
-                                } else {
-                                    that.unid = res.data.unid;
-                                    uni.setStorageSync("unid", res.data.unid);
-                                    that.shopInfo = app.globalData.shopInfo;
-                                    // that.SoHAuth(); //调取授权弹窗
-                                }
-                            }
-                        });
-                    }
-                },
-            });
-            // #endif
+  components: {
+    notGoods,
+    authorizeModule,
+  },
+  data() {
+    return {
+      statusType: [
+        ["1", "已付款"],
+        ["0", "退款/售后"],
+      ],
+      orderList: [],
+      currentType: "1",
+      haveGoods: false,
+      loadingMoreHidden: true,
+      loadingTip: "没有更多了",
+      userId: "",
+      isweixin: "",
+      pt: {},
+      shopInfo: {}, // 商铺信息
+      unid: "",
+      token: uni.getStorageSync("token"),
+      statusDesc: {
+        1: {
+          t1: "已付款",
+          t2: "即将到账",
         },
-        // 获取手机号
-        // onauthGetTelSuccess(da) {
-        //     this.SoHAuth();
-        //     post("v1/getMobile", {
-        //         unid: this.unid,
-        //         ...da.detail,
-        //     }).then((res) => {
-        //         if (res.code === 0) {
-        //             uni.setStorageSync("token", res.data.token);
-        //             this.loadData();
-        //         }
-        //     });
-        // },
-        // SoHAuth() {
-        //     this.$refs.autho.onSoHAuth();
-        // },
-        
-        clearData(isclearCat = true, callBack) {
-            page = 1;
-            this.orderList = [];
-            this.haveGoods = false;
-            if (callBack) {
-                callBack();
-            }
+        2: {
+          t1: "已完成",
+          t2: "已经结算",
         },
-        loadData() {
-            if (page == -1) {
-                return;
-            }
-            uni.showLoading({
-                title: "加载中…",
-                mask: true,
-            });
-            var data = {
-                page,
-                type: this.currentType,
-            };
-
-            post("v1/my/order", data).then((res) => {
-                if (res.code === 0) {
-                    uni.hideLoading();
-                    uni.stopPullDownRefresh();
-                    let da = res.data.data.data;
-
-                    if (page <= 1) {
-                        this.orderList = [];
-                        if (!da.length) this.haveGoods = true;
-                    }
-                    this.orderList = [...this.orderList, ...da];
-                } else {
-                    this.$toast(res.msg || "");
-                    this.loadingMoreHidden = false;
-                }
-            });
-        },
-        toDetails(da) {
-            this.goto("/pages/szw-order-details/index", { id: da.order_id });
+        3: {
+          t1: "退款成功",
+          t2: "收益扣回",
         },
-
-        // 立即支付
-        toPay(e) {
-            let type = "jsapi";
-            // #ifdef  H5
-            type = "H5";
-            // #endif
-            // #ifdef  APP
-            type = "app";
-            // #endif
-            // #ifdef  MP-WEIXIN
-            type = "jsapi";
-            // #endif
-            post("v1/goods/payOrder", {
-                id: e.order_id,
-                trade_type: type,
+      },
+      tabs: [],
+    };
+  },
+  onLoad(options) {
+    this.currentType = options.status ? options.status : 1;
+  },
+  onShow() {
+    page = 1;
+    this.getIcon();
+    if (!this.token) this.login();
+    else this.loadData();
+  },
+  methods: {
+    login() {
+      let that = this;
+      // #ifdef  MP-WEIXIN
+      wx.login({
+        success(res) {
+          if (res.code) {
+            post("v1/appletLogin", {
+              code: res.code,
+              invite: uni.getStorageSync("inviteCode") || "",
             }).then((res) => {
-                if(res.data && res.data != 200){
-                    let data = JSON.parse(res.data)
-                    data.prepayid = data.package?data.package.split('prepay_id=')[1]:''
-                    if (res.code === 0 && data.prepayid) {
-                        toPayOpre.toPay(data, (da) => {
-                            if (!da) {
-                                // 支付成功
-                                this.$toast("支付成功");
-                            } else {
-                                // 支付失败
-                                this.$toast("支付已取消");
-                            }
-                            // this.$toast('支付成功');
-                            this.loadData();
-                        });
-                    }
+              if (res.code === 0) {
+                if (res.data.token) {
+                  uni.setStorageSync("token", res.data.token);
+                  that.loadData();
+                } else {
+                  that.unid = res.data.unid;
+                  uni.setStorageSync("unid", res.data.unid);
+                  that.shopInfo = app.globalData.shopInfo;
+                  // that.SoHAuth(); //调取授权弹窗
                 }
+              }
             });
+          }
         },
-        // 取消订单
-        toCancel(e) {
-            let that = this;
-            uni.showModal({
-                title: "温馨提示",
-                content: "取消订单后,微信支付部分也将退回至余额账户",
-                // showCancel: false,
-                confirmText: "知道了",
-                confirmColor: "#f02f2f",
-                cancelText: "取消",
-                cancelColor: "#bbb",
-                success(res) {
-                    if (res.confirm) {
-                        post("v1/my/orderCancel", {
-                            order_id: e.order_id,
-                        }).then((res) => {
-                            if (res.code === 0) {
-                                that.$toast(res.msg);
-                                that.loadData();
-                            }
-                        });
-                    }
-                },
-            });
-        },
-        // 确认收货
-        toTake(e) {
-            let that = this;
-            uni.showModal({
-                content: "亲,“确定收货”代表着本订单的交付流程已经完成,不再支持任何形式的退换货。",
-                confirmText: "确认收货",
-                confirmColor: "#fa2f2e",
-                cancelText: "取消",
-                cancelColor: "#bbb",
-                success(res) {
-                    if (res.confirm) {
-                        post("v1/goods/confirmOrder", {
-                            order_id: e.order_id,
-                        }).then((res) => {
-                            if (res.code === 0) {
-                                that.$toast(res.msg);
-                                page = 1
-                                that.loadData();
-                            }
-                        });
-                    }
-                },
-            });
-        },
-        toCode(e) {
-            this.goto("/pagesB/order/verificationCode", { id: e.order_id });
-        },
-        //菜单切换
-        statusTap(e) {
-            //重置数据
-            var curType = e.currentTarget.dataset.index;
-            this.currentType = curType;
-            this.clearData(false, this.loadData);
-        },
+      });
+      // #endif
+    },
+    copyText(e) {
+      uniCopy({
+        content: e,
+        success: (res) => {},
+        error: (e) => {},
+      });
+    },
 
-        //删除订单
-        removeItem(order_id) {
-            let that = this;
-            uni.showModal({
-                content: "亲,确认删除本订单吗?",
-                confirmText: "确认删除",
-                confirmColor: "#fa2f2e",
-                cancelText: "取消",
-                cancelColor: "#bbb",
-                success(res) {
-                    if (res.confirm) {
-                        post("v1/my/orderDel", {
-                            order_id
-                        }).then(res => {
-                            if (res.code === 0) {
-                                that.$toast(res.msg);
-                                that.loadData();
-                            }
-                        });
-                    }
-                },
-            });
+    clearData(isclearCat = true, callBack) {
+      page = 1;
+      this.orderList = [];
+      this.haveGoods = false;
+      if (callBack) {
+        callBack();
+      }
+    },
+    loadData() {
+      if (page == -1) {
+        return;
+      }
+      uni.showLoading({
+        title: "加载中…",
+        mask: true,
+      });
+      var data = {
+        page,
+        status: this.currentType,
+      };
+
+      post("v1/cashback/orderList", data).then((res) => {
+        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;
+          }
+          this.orderList = [...this.orderList, ...da];
+        } else {
+          uni.hideLoading();
+          this.$toast(res.msg || "");
+          this.loadingMoreHidden = false;
         }
+      });
     },
-    computed: {
-        // 0  支付状态   1 订单状态
-        tidyStatus() {
-            return (da) => {
-                let str;
-                if (da[1] === 0) str = "待发货";
-                if (da[1] === 1) str = "已发货";
-                if (da[1] === 2) str = "已完成";
-                if (da[1] === 3) str = "申请退货";
-                if (da[1] === 4) str = "确认退货";
-                if (da[1] === 5) str = "已作废";
-                if (da[1] === 6) str = "转邮寄";
-                if (da[1] === 7) str = "待收货";
-                if (da[1] === 8) str = "待自提";
-                if ([0, 2].includes(da[0]) && da[1] != 5) str = "待支付";
-                return str;
-            };
-        },
+    toDetails(da) {
+      this.goto("/pagesC/shoppingMallType/p_details", {
+        goods_sign: da.goods_sign,
+        type: da.type,
+      });
     },
-    //上拉加载事件
-    onReachBottom() {
-        if (page != -1) {
-            var that = this;
-            setTimeout(() => {
-                // 为页数迭加1
-                ++page;
-                that.loadData();
-            }, 800);
+    // 分类
+    getIcon() {
+      post("v1/cashback/getIcon").then((res) => {
+        if (res.code === 0) {
+          this.tabs = res.data;
         }
+      });
     },
-    // 下拉刷新
-    onPullDownRefresh() {
-        var that = this;
-        that.clearData(false, () => {
-            that.loadData();
-        });
+
+    // 取消订单
+    toCancel(e) {
+      let that = this;
+      uni.showModal({
+        title: "温馨提示",
+        content: "取消订单后,微信支付部分也将退回至余额账户",
+        // showCancel: false,
+        confirmText: "知道了",
+        confirmColor: "#f02f2f",
+        cancelText: "取消",
+        cancelColor: "#bbb",
+        success(res) {
+          if (res.confirm) {
+            post("v1/my/orderCancel", {
+              order_id: e.order_id,
+            }).then((res) => {
+              if (res.code === 0) {
+                that.$toast(res.msg);
+                that.loadData();
+              }
+            });
+          }
+        },
+      });
     },
-    // 监听卸载页面  同等于  返回拦截
-    onUnload() {
-        let pages = getCurrentPages();
-        let prevPage = pages[pages.length - 2]?.route
-        if (prevPage == "pages/to-pay-list/index") {
-            uni.switchTab({ url: "/pages/my/index" });
-        }
+
+    toCode(e) {
+      this.goto("/pagesB/order/verificationCode", { id: e.order_id });
+    },
+    //菜单切换
+    statusTap(e) {
+      //重置数据
+      var curType = e.currentTarget.dataset.index;
+      this.currentType = curType;
+      this.clearData(false, this.loadData);
+    },
+  },
+  computed: {
+    // 0  支付状态   1 订单状态
+    tidyStatus() {
+      return (da) => {
+        let str;
+        if (da[1] === 0) str = "待发货";
+        if (da[1] === 1) str = "已发货";
+        if (da[1] === 2) str = "已完成";
+        if (da[1] === 3) str = "申请退货";
+        if (da[1] === 4) str = "确认退货";
+        if (da[1] === 5) str = "已作废";
+        if (da[1] === 6) str = "转邮寄";
+        if (da[1] === 7) str = "待收货";
+        if (da[1] === 8) str = "待自提";
+        if ([0, 2].includes(da[0]) && da[1] != 5) str = "待支付";
+        return str;
+      };
     },
+  },
+  //上拉加载事件
+  onReachBottom() {
+    if (page != -1) {
+      var that = this;
+      setTimeout(() => {
+        // 为页数迭加1
+        ++page;
+        that.loadData();
+      }, 800);
+    }
+  },
+  // 下拉刷新
+  onPullDownRefresh() {
+    var that = this;
+    that.clearData(false, () => {
+      that.loadData();
+    });
+  },
+  // 监听卸载页面  同等于  返回拦截
+  onUnload() {
+    let pages = getCurrentPages();
+    let prevPage = pages[pages.length - 2]?.route;
+    if (prevPage == "pages/to-pay-list/index") {
+      uni.switchTab({ url: "/pages/my/index" });
+    }
+  },
 };
 </script>
 <style lang="scss">
 page {
-    background-color: #f3f5f7;
+  background-color: #f3f5f7;
 }
 
 .container {
-    width: 100%;
+  width: 100%;
 }
 
 .fl {
-    float: left;
+  float: left;
 }
 
 .fr {
-    float: right;
+  float: right;
 }
 
 .overflow {
-    overflow: hidden;
+  overflow: hidden;
 }
 
 .r_color {
-    color: #fa2f2e;
+  color: #fa2f2e;
 }
 
 .loading-indicator {
-    width: 100%;
-    text-align: center;
-    font-size: 24rpx;
-    color: #666;
-    margin: 20rpx 0;
-    line-height: 1.5;
+  width: 100%;
+  text-align: center;
+  font-size: 24rpx;
+  color: #666;
+  margin: 20rpx 0;
+  line-height: 1.5;
 }
 
 .opacity {
-    opacity: 0;
-    display: none;
+  opacity: 0;
+  display: none;
 }
 
 .terraceComp {
-    height: 84rpx;
+  height: 84rpx;
 }
 
 .terraceComp_fix {
-    position: fixed;
-    top: -12rpx;
-    left: 0;
-    right: 0;
-    z-index: 15;
+  position: fixed;
+  top: -12rpx;
+  left: 0;
+  right: 0;
+  z-index: 15;
 }
 
 .status-box {
-    width: 100%;
-    height: 94rpx;
+  width: 100%;
+  height: 94rpx;
 }
 
 .status_tap_box {
-    position: fixed;
-    left: 0;
-    top: 0;
-    width: 100%;
-    overflow: hidden;
-    line-height: 88rpx;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    background-color: #fff;
-    z-index: 300;
-    box-shadow: 0rpx 8rpx 8rpx rgba(0, 0, 0, 0.025);
+  position: fixed;
+  left: 0;
+  top: 0;
+  width: 100%;
+  overflow: hidden;
+  line-height: 88rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  background-color: #fff;
+  z-index: 300;
+  box-shadow: 0rpx 8rpx 8rpx rgba(0, 0, 0, 0.025);
 }
 
 .status-box .status-label {
-    flex-grow: 1;
-    height: 100%;
-    text-align: center;
-    font-size: 28rpx;
-    color: #353535;
-    box-sizing: border-box;
-    position: relative;
-    border-bottom: 6rpx solid transparent;
+  flex-grow: 1;
+  height: 100%;
+  text-align: center;
+  font-size: 28rpx;
+  color: #353535;
+  box-sizing: border-box;
+  position: relative;
+  border-bottom: 6rpx solid transparent;
 }
 
 .status-box .status-label.active {
-    color: #e05f0b;
-    border-bottom-color: #e05f0b;
+  color: #e05f0b;
+  border-bottom-color: #e05f0b;
 }
 
 .order-list {
-    width: 100%;
-    overflow: hidden;
+  width: 100%;
+  overflow: hidden;
 }
 
 .order-list .a-order {
-    // width: 100%;
-    padding: 30rpx;
-    box-sizing: border-box;
-    background-color: #fff;
-    margin: 24rpx;
-    border-radius: 6rpx;
+  // width: 100%;
+  padding: 30rpx;
+  box-sizing: border-box;
+  background-color: #fff;
+  margin: 24rpx;
+  border-radius: 6rpx;
 }
 
 .order-list .a-order .order-date {
-    padding: 16rpx 30rpx 20rpx;
-    line-height: 40rpx;
-    font-size: 26rpx;
-    color: #000;
-    overflow: hidden;
+  padding: 16rpx 30rpx 20rpx;
+  line-height: 40rpx;
+  font-size: 26rpx;
+  color: #000;
+  overflow: hidden;
 }
 
 .order-list .a-order .order-date .red {
-    font-size: 26rpx;
-    color: #fa2f2e;
+  font-size: 26rpx;
+  color: #fa2f2e;
 }
 
 .order-list .a-order .order-date text.r_color {
-    font-weight: 600;
+  font-weight: 600;
 }
 
 .a-order .list-title {
-    font-size: 28rpx;
-    font-weight: 600;
-    color: #000;
-    padding: 0 0 16rpx;
+  font-size: 28rpx;
+  font-weight: 600;
+  color: #000;
+  padding: 0 0 16rpx;
 }
 
 .avaImgs {
-    width: 54rpx;
-    height: 54rpx;
-    overflow: hidden;
-    border-radius: 50%;
-    background-color: #f3f5f7;
-    margin-right: 20rpx;
+  width: 54rpx;
+  height: 54rpx;
+  overflow: hidden;
+  border-radius: 50%;
+  background-color: #f3f5f7;
+  margin-right: 20rpx;
 }
 
 .order-list .a-order .price-box {
-    // width: 100%;
-    box-sizing: border-box;
-    padding: 16rpx 0;
-    font-size: 26rpx;
-    justify-content: center;
-    border-radius: 6rpx;
-    margin: 16rpx 0 0;
-    background-color: #F4F4F4;
-    .item{
-        width: 50%;
-        .k{
-            font-size: 26rpx;
-            color: #868686;
-            padding-bottom: 16rpx;
-        }
-        .v{
-            font-size: 30rpx;
-            color: #000;
-        }
-        .v::before{
-            content: '¥';
-            font-size: 24rpx;
-            color: #000;
-        }
-        .v:first-child::after{
-            content: '>';
-            padding-left: 2rpx;
-            font-size: 30rpx;
-            color: #000;
-        }
+  // width: 100%;
+  box-sizing: border-box;
+  padding: 16rpx 0;
+  font-size: 26rpx;
+  justify-content: center;
+  border-radius: 6rpx;
+  margin: 16rpx 0 0;
+  background-color: #f4f4f4;
+  .item {
+    width: 50%;
+    .k {
+      font-size: 26rpx;
+      color: #868686;
+      padding-bottom: 16rpx;
     }
-
-    
+    .v {
+      font-size: 30rpx;
+      color: #000;
+    }
+    .v::before {
+      content: "¥";
+      font-size: 24rpx;
+      color: #000;
+    }
+    .v:first-child::after {
+      content: ">";
+      padding-left: 2rpx;
+      font-size: 30rpx;
+      color: #000;
+    }
+  }
 }
 .tooltip {
-	white-space: nowrap;
-    width: 100%;
-    text-align: center;
+  white-space: nowrap;
+  width: 100%;
+  text-align: center;
 }
-::v-deep .uni-tooltip-popup{
-    border-radius: 8rpx !important;
-    padding: 6rpx 12rpx !important;
-    left: 20% !important;
+::v-deep .uni-tooltip-popup {
+  border-radius: 8rpx !important;
+  padding: 6rpx 12rpx !important;
+  left: 20% !important;
 }
 .a-order .price-box .btn {
-    box-sizing: border-box;
-    text-align: center;
-    border-radius: 40rpx;
-    margin-left: 20rpx;
-    border: 1rpx solid #ccc;
-    padding: 12rpx 24rpx;
+  box-sizing: border-box;
+  text-align: center;
+  border-radius: 40rpx;
+  margin-left: 20rpx;
+  border: 1rpx solid #ccc;
+  padding: 12rpx 24rpx;
 }
 
 .order-list .a-order .price-box .total-price {
-    color: #e05f0b;
+  color: #e05f0b;
 }
 
 .a-order .price-box .topay-btn {
-    border-color: #e05f0b;
-    color: #e05f0b;
+  border-color: #e05f0b;
+  color: #e05f0b;
 }
 
 .a-order .price-box .r_topay-btn {
-    border-color: #e05f0b;
-    background-color: #e05f0b;
-    color: #fff;
-}
-.time{
+  border-color: #e05f0b;
+  background-color: #e05f0b;
+  color: #fff;
+}
+.time {
+  color: #868686;
+  font-size: 24rpx;
+  margin: 16rpx 0 0;
+}
+.goods-info {
+  padding: 12rpx 0;
+  .goods-img {
+    width: 120rpx;
+    height: 120rpx;
+    border-radius: 10rpx;
+  }
+  .goodsDetail_info {
+    width: calc(100% - 130rpx);
+    padding: 10rpx 0 10rpx 20rpx;
+    position: relative;
+  }
+  .good_name {
+    font-size: 28rpx;
+    // font-weight: 600;
+  }
+  .width_r {
+    width: calc(100% - 130rpx);
+  }
+  .width_r_1 {
+    width: calc(100% - 60rpx);
     color: #868686;
+    font-size: 26rpx;
+  }
+  .status_text {
+    color: #d9af68;
     font-size: 24rpx;
-    margin: 16rpx 0 0;
-}
-.goods-info{
-    padding: 12rpx 0;
-    .goods-img{
-        width: 120rpx;
-        height: 120rpx;
-        border-radius: 10rpx;
-    }
-    .goodsDetail_info{
-        width: calc(100% - 130rpx);
-        padding: 10rpx 0 10rpx 20rpx;
-        position: relative;
-    }
-    .good_name{
-        font-size: 28rpx;
-        // font-weight: 600;
-    }
-    .width_r{
-        width: calc(100% - 130rpx);
-    }
-    .width_r_1{
-        width: calc(100% - 60rpx);
-        color: #868686;
-        font-size: 26rpx;
-    }
-    .status_text {
-        font-size: 22rpx;
-        display: inline-block;
-        width: 150rpx;
-        text-align: right;
-    }
-    .status_text_1{
-        color: #868686;
-    }
-    .copy{
-        font-size: 18rpx;
-        color: #868686;
-        padding: 3rpx 6rpx;
-        border-radius: 2rpx;
-        border: 1rpx solid rgba($color: #868686, $alpha: 0.5);
-    }
-    
-    .good_text{
-        width: 100%;
-        // padding-left: 28rpx;
-        // position: absolute;
-        // bottom: 0;
-        // left: 0;
-    }
-    .good_server{
-        font-size: 20rpx;
-        color: rgb(245, 8, 8);
-        text-align: right;
-        position: absolute;
-        bottom: -10rpx;
-        right: 0;
-    }
-    .goods_price{
-        font-weight: 600;
-        font-size: 32rpx;
-    }
-    .unimport{
-        font-size: 26rpx;
-    }
+    display: inline-block;
+    width: 150rpx;
+    text-align: right;
+  }
+  .status_text_1 {
+    color: #868686;
+  }
+  .copy {
+    font-size: 20rpx;
+    color: #868686;
+    padding: 2rpx 6rpx;
+    border-radius: 4rpx;
+    border: 1rpx solid rgba($color: #868686, $alpha: 0.3);
+  }
+
+  .good_text {
+    width: 100%;
+    // padding-left: 28rpx;
+    // position: absolute;
+    // bottom: 0;
+    // left: 0;
+  }
+  .good_server {
+    font-size: 20rpx;
+    color: rgb(245, 8, 8);
+    text-align: right;
+    position: absolute;
+    bottom: -10rpx;
+    right: 0;
+  }
+  .goods_price {
+    font-weight: 600;
+    font-size: 32rpx;
+  }
+  .unimport {
+    font-size: 26rpx;
+  }
 }
 
 .typetag {
-    border: 1px solid #ccc;
-    border-radius: 10rpx;
-    padding: 2rpx 10rpx;
-    font-size: 22rpx;
-    font-weight: 500;
+  border: 1px solid #ccc;
+  border-radius: 10rpx;
+  padding: 2rpx 10rpx;
+  font-size: 22rpx;
+  font-weight: 500;
 }
 
 .tagcolor1 {
-    border-color: #007aff;
-    color: #007aff;
+  border-color: #007aff;
+  color: #007aff;
 }
 
 .tagcolor2 {
-    border-color: #4cd964;
-    color: #4cd964;
+  border-color: #4cd964;
+  color: #4cd964;
 }
 
 .tagcolor3 {
-    border-color: #f0ad4e;
-    color: #f0ad4e;
+  border-color: #f0ad4e;
+  color: #f0ad4e;
 }
 
 .tagcolor4 {
-    border-color: #dd524d;
-    color: #dd524d;
+  border-color: #dd524d;
+  color: #dd524d;
 }
 
 .tagcolor5 {
-    border-color: #4335d6;
-    color: #4335d6;
+  border-color: #4335d6;
+  color: #4335d6;
 }
 
 .tagcolor6 {
-    border-color: rgb(245, 8, 8);
-    color: rgb(245, 8, 8);
+  border-color: rgb(245, 8, 8);
+  color: rgb(245, 8, 8);
 }
 
 .tagcolor7 {
-    border-color: #b44ddd;
-    color: #b44ddd;
+  border-color: #b44ddd;
+  color: #b44ddd;
 }
 
 // 商品规格-start
-.goods_spec{
-    font-size: 24rpx;
-    color: #868686;
-    padding-top: 16rpx;
-    text{
-        padding: 10rpx 20rpx;
-        border-radius: 10rpx;
-        margin-right: 12rpx;
-        background-color: #f5f5f5;
-        
-    }
-    &_text{
-        padding-right: 8rpx;
-    }
+.goods_spec {
+  font-size: 24rpx;
+  color: #868686;
+  padding-top: 16rpx;
+  text {
+    padding: 10rpx 20rpx;
+    border-radius: 10rpx;
+    margin-right: 12rpx;
+    background-color: #f5f5f5;
+  }
+  &_text {
+    padding-right: 8rpx;
+  }
 }
 // 商品规格-end
 </style>

+ 28 - 7
src/pagesC/shoppingMallType/p_details.vue

@@ -39,7 +39,13 @@
     <!-- 标题信息栏 -->
     <view class="title_info">
       <view class="goods_name">
-        <span class="product-type"> 拼多多 </span>
+        <span class="product-type">
+          {{
+            tabs.filter((t) => {
+              return type == t.type;
+            })[0].name
+          }}
+        </span>
         {{ detail.goods_name }}
       </view>
       <view class="quan flex_r flex_ac flex_jb" v-if="detail.has_coupon">
@@ -59,7 +65,11 @@
       </view>
     </view>
     <view class="mall flex_r flex_ac">
-      <img src="https://teaclub.oss-cn-chengdu.aliyuncs.com/mall/shop.png" alt="" class="mall_img" />
+      <img
+        src="https://teaclub.oss-cn-chengdu.aliyuncs.com/mall/shop.png"
+        alt=""
+        class="mall_img"
+      />
       <view class="text7 bottom">{{ detail.mall_name }}</view>
     </view>
     <!-- 标题信息栏-end -->
@@ -149,19 +159,33 @@ export default {
       afterSpecPrice: 0, // 规格选择后显示价格
       goods_price: 0, //到手价
       yj_price: 0, // 返利金额
+      tabs: [],
+      radio: 0, // 返利比例
     };
   },
   onLoad: function (e) {
+    console.log(e);
+    
     this.userinfo = uni.getStorageSync("userinfo");
     let token = uni.getStorageSync("token");
     this.type = e.type;
     this.goodsDa = e;
+    this.getIcon();
     this.loadData(e);
 
     if (!token) this.login();
   },
   onShow: function () {},
   methods: {
+    // 分类
+    getIcon() {
+      post("v1/cashback/getIcon").then((res) => {
+        if (res.code === 0) {
+          this.tabs = res.data;
+          this.radio = this.tabs[0].ratio
+        }
+      });
+    },
     // 商品详情信息
     loadData(da) {
       post("v1/cashback/duoduoInfo", da).then((res) => {
@@ -169,9 +193,6 @@ export default {
           this.detail = JSON.parse(
             res.data
           ).goods_detail_response.goods_details[0];
-          console.log(JSON.parse(res.data));
-          console.log(this.detail);
-          console.log(this.detail.sku_list);
           this.detail.goods_img = this.detail.goods_gallery_urls;
           this.goods_price =
             Math.floor(
@@ -183,7 +204,7 @@ export default {
           this.yj_price =
             Math.floor(
               (this.detail.min_group_price / 100) *
-                (this.detail.promotion_rate / 1000) *
+                (this.detail.promotion_rate / 1000) * this.radio*
                 100
             ) / 100;
 
@@ -303,7 +324,7 @@ export default {
     var path = `pagesC/shoppingMallType/p_details?goods_sign=${this.detail.goods_sign}&type=${this.type}`;
     var title = this.detail.goods_name;
     console.log(this.detail.goods_name);
-    
+
     return {
       title: title,
       path: path,