瀏覽代碼

no message

DaMowang 3 年之前
父節點
當前提交
05b20f9caf
共有 3 個文件被更改,包括 544 次插入532 次删除
  1. 451 468
      src/pages/product/p_details.vue
  2. 92 63
      src/pages/szw-order-list/index.vue
  3. 1 1
      src/pages/to-pay-list/index.vue

+ 451 - 468
src/pages/product/p_details.vue

@@ -1,144 +1,95 @@
 <template>
-  <view class="container">
-    <!-- 轮播图 -->
-    <swiper-banner
-      imgScale="25:17"
-      :imgArr="detail.goods_img"
-      :duration="1000"
-      :interval="5000"
-      :circular="true"
-      :autoplay="true"
-      :indicator-dots="true"
-      indicator-active-color="#12B280"
-      indicator-color="rgba(255, 255, 255, .82)"
-    ></swiper-banner>
-    <!-- 轮播图-end -->
-
-    <!-- 价格信息栏 -->
-    <view class="price_info flex_r flex_ac flex_jb">
-      <view v-if="type == 5" class="price">
-        <span v-if="Number(detail.cost_price) != 0"
-          >{{ detail.cost_price }}元</span
-        >
-        <span
-          v-if="Number(detail.cha_bao) != 0 && Number(detail.cost_price) != 0"
-          >+</span
-        >
-        <span v-if="Number(detail.cha_bao) != 0">{{ detail.cha_bao }}茶宝</span>
-      </view>
-      <view v-else class="price" :class="type == 2 ? 'samll' : ''"
-        >¥{{ type == 2 ? detail.trade_price : detail.cost_price }}</view
-      >
-      <view class="price_span flex_r flex_ac flex_je">
-        <view class="triangle"></view>
-        <view class="span_conten flex_r flex_ac flex_jc">{{
-          goodsDa.type == 1
-            ? "零售专区"
-            : goodsDa.type == 2
-            ? "批发专区"
-            : goodsDa.type == 3
-            ? "精品专区"
-            : goodsDa.type == 4
-            ? "今日值得买"
-            : goodsDa.type == 5
-            ? "茶宝兑换"
-            : ""
-        }}</view>
-      </view>
-    </view>
-    <!-- 价格信息栏-end -->
-
-    <!-- 标题信息栏 -->
-    <view class="title_info">
-      <view class="goods_name">{{ detail.goods_name }}</view>
-      <view class="goods_subName">{{ detail.goodsMsg }}</view>
-    </view>
-    <!-- 标题信息栏-end -->
-
-    <!-- 产品简介 -->
-    <view class="brief mar_t20">
-      <view class="brief_title flex_r flex_ac">产品简介</view>
-      <view class="brief_con">
-        <jyfParser :html="detail.goods_content" ref="jyf"></jyfParser>
-        <!-- <image :lazy-load="true" style="width: 100%;display: block;" v-for="(item,index) in detail.goodsDetailesImage" :key="index" :src="item" mode="widthFix"></image> -->
-      </view>
-    </view>
-    <!-- 产品简介-end -->
-
-    <!-- 底部导航组件 -->
-    <view class="option">
-      <uni-goods-nav
-        :fill="true"
-        :options="options"
-        :buttonGroup="buttonGroup"
-        @click="onClick"
-        @buttonClick="buttonClick"
-      />
-    </view>
-    <!-- 底部导航组件-end -->
-    <!-- 授权 -->
-    <!-- <authorize-module v-if="showAuth" :shopInfo="shopInfo" @authSuccess="onAuthSuccess" @onGotUserInfo="onGotUserInfo" ></authorize-module> -->
-    <!-- 授权-end -->
-
-    <!-- 购买或加入购物车弹窗 -->
-    <uni-popup ref="shopping" type="bottom">
-      <view class="shopping">
-        <view class="close_con flex_r flex_je">
-          <image
-            class="close_img"
-            src="/static/close.png"
-            @tap="closeBtn"
-            mode=""
-          ></image>
+    <view class="container">
+        <!-- 轮播图 -->
+        <swiper-banner imgScale="25:17" :imgArr="detail.goods_img" :duration="1000" :interval="5000" :circular="true" :autoplay="true" :indicator-dots="true" indicator-active-color="#12B280" indicator-color="rgba(255, 255, 255, .82)"></swiper-banner>
+        <!-- 轮播图-end -->
+        <!-- 价格信息栏 -->
+        <view class="price_info flex_r flex_ac flex_jb">
+            <view v-if="type == 5" class="price">
+                <span v-if="Number(detail.cost_price) != 0">{{ detail.cost_price }}元</span>
+                <span v-if="Number(detail.cha_bao) != 0 && Number(detail.cost_price) != 0">+</span>
+                <span v-if="Number(detail.cha_bao) != 0">{{ detail.cha_bao }}茶宝</span>
+            </view>
+            <view v-else class="price" :class="type == 2 ? 'samll' : ''">¥{{ type == 2 ? detail.trade_price : detail.cost_price }}</view>
+            <view class="price_span flex_r flex_ac flex_je">
+                <view class="triangle"></view>
+                <view class="span_conten flex_r flex_ac flex_jc">{{
+                    goodsDa.type == 1
+                    ? "零售专区"
+                    : goodsDa.type == 2
+                    ? "批发专区"
+                    : goodsDa.type == 3
+                    ? "精品专区"
+                    : goodsDa.type == 4
+                    ? "今日值得买"
+                    : goodsDa.type == 5
+                    ? "茶宝兑换"
+                    : ""
+                    }}</view>
+            </view>
         </view>
-        <view class="goods_info flex_r">
-          <image class="goods_img" :src="detail.original_img" mode=""></image>
-          <view class="goods_con flex_c flex_jb">
-            <view class="shop_names">{{ detail.goods_name }}</view>
-            <!-- <view class="goods_msg">{{type == 2 ? detail.pfCombination : '¥' + detail.price}}</view> -->
-            <view class="num_con flex_r flex_je">
-              <uni-number-box
-                :min="1"
-                @change="bindChange"
-                :value="buyNum"
-              ></uni-number-box>
+        <!-- 价格信息栏-end -->
+        <!-- 标题信息栏 -->
+        <view class="title_info">
+            <view class="goods_name">{{ detail.goods_name }}</view>
+            <view class="goods_subName">{{ detail.goodsMsg }}</view>
+        </view>
+        <!-- 标题信息栏-end -->
+        <!-- 产品简介 -->
+        <view class="brief mar_t20">
+            <view class="brief_title flex_r flex_ac">产品简介</view>
+            <view class="brief_con">
+                <jyfParser :html="detail.goods_content" ref="jyf"></jyfParser>
+                <!-- <image :lazy-load="true" style="width: 100%;display: block;" v-for="(item,index) in detail.goodsDetailesImage" :key="index" :src="item" mode="widthFix"></image> -->
             </view>
-          </view>
         </view>
-        <view class="goods_option flex_r flex_ac flex_jc" v-if="type == 2">
-          <view class="goods_raido flex_r flex_ac" @tap="setWay('1')">
-            <view
-              class="raido_img"
-              :class="pfway == '1' ? 'raido_box' : ''"
-            ></view>
-            <view class="raido_text">申请寄售</view>
-          </view>
-          <view class="goods_raido flex_r flex_ac" @tap="setWay('0')">
-            <view
-              class="raido_img"
-              :class="pfway == '0' ? 'raido_box' : ''"
-            ></view>
-            <view class="raido_text">发货邮寄</view>
-          </view>
+        <!-- 产品简介-end -->
+        <!-- 底部导航组件 -->
+        <view class="option">
+            <uni-goods-nav :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick" @buttonClick="buttonClick" />
         </view>
-        <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">《购买协议》</text>
-          </label>
-        </checkbox-group>
-        <view class="confim flex_r flex_ac flex_jc" @tap="ToPayPage">确定</view>
-      </view>
-    </uni-popup>
-    <!-- 购买或加入购物车弹窗-end -->
-  </view>
+        <!-- 底部导航组件-end -->
+        <!-- 授权 -->
+        <!-- <authorize-module v-if="showAuth" :shopInfo="shopInfo" @authSuccess="onAuthSuccess" @onGotUserInfo="onGotUserInfo" ></authorize-module> -->
+        <!-- 授权-end -->
+        <!-- 购买或加入购物车弹窗 -->
+        <uni-popup ref="shopping" type="bottom">
+            <view class="shopping">
+                <view class="close_con flex_r flex_je">
+                    <image class="close_img" src="/static/close.png" @tap="closeBtn" mode=""></image>
+                </view>
+                <view class="goods_info flex_r">
+                    <image class="goods_img" :src="detail.original_img" mode=""></image>
+                    <view class="goods_con flex_c flex_jb">
+                        <view class="shop_names">{{ detail.goods_name }}</view>
+                        <!-- <view class="goods_msg">{{type == 2 ? detail.pfCombination : '¥' + detail.price}}</view> -->
+                        <view class="num_con flex_r flex_je">
+                            <uni-number-box :min="1" @change="bindChange" :value="buyNum"></uni-number-box>
+                        </view>
+                    </view>
+                </view>
+                <view class="goods_option flex_r flex_ac flex_jc" v-if="type == 2">
+                    <view class="goods_raido flex_r flex_ac" @tap="setWay('1')">
+                        <view class="raido_img" :class="pfway == '1' ? 'raido_box' : ''"></view>
+                        <view class="raido_text">申请寄售</view>
+                    </view>
+                    <view class="goods_raido flex_r flex_ac" @tap="setWay('0')">
+                        <view class="raido_img" :class="pfway == '0' ? 'raido_box' : ''"></view>
+                        <view class="raido_text">发货邮寄</view>
+                    </view>
+                </view>
+                <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">《购买协议》</text>
+                    </label>
+                </checkbox-group>
+                <view class="confim flex_r flex_ac flex_jc" @tap="ToPayPage">确定</view>
+            </view>
+        </uni-popup>
+        <!-- 购买或加入购物车弹窗-end -->
+    </view>
 </template>
-
 <script>
 let page = 1;
 let app = getApp();
@@ -153,432 +104,464 @@ import uniGoodsNav from "@/components/uni-goods-nav/uni-goods-nav.vue";
 import uniNumberBox from "@/components/uni-number-box/uni-number-box.vue";
 import authorizeModule from "@/components/authorize-module/index";
 export default {
-  components: {
-    uniPopup,
-    jyfParser,
-    uniGoodsNav,
-    swiperBanner,
-    uniNumberBox,
-    authorizeModule,
-  },
-  data() {
-    return {
-      imgArr: ["/static/goods5.jpg"],
-      content: "",
-      options: [
-        // 底部导航跳转
-        {
-          icon: "home",
-          text: "主页",
-        },
-        // {
-        // 	icon: 'cart',
-        // 	text: '购物车',
-        // 	info: 0
-        // }
-      ],
-      buttonGroup: [
-        // 底部操作按钮
-        // {
-        // 	text: '加入购物车',
-        // 	backgroundColor: '#ff0000',
-        // 	color: '#fff'
-        // },
-        {
-          text: "立即购买",
-          backgroundColor: "#ffa200",
-          color: "#fff",
-        },
-      ],
-      btnIndex: 0, // 用户点击按钮事件判断 0:加入购物车;1:立即购买
-      type: null, // 商品类型,1零售 2批发 3精品 4今日值买
-      goodsId: "", // 商品ID
-      id: "", //合伙人套餐ID
-      detail: {
-        goods: {},
-      }, // 商品详情
-      checked: false, //是否选中协议
-      buyNum: 1, //购买数量
-      pfway: "0", // 批发
-      showAuth: false,
-
-      userinfo: {},
-      goodsDa: {},
-    };
-  },
-  onLoad: function (e) {
-    this.type = e.type;
-    this.goodsDa = e;
-    this.userinfo = uni.getStorageSync("userinfo");
-    this.loadData(e);
-  },
-  onShow: function () {},
-  methods: {
-    // 商品详情信息
-    loadData(da) {
-      post("goods/goodsDetail", da).then((res) => {
-        if (res.code === 0) {
-          this.detail = res.data.data;
-          let imgs = [];
-          imgs.push(this.detail.original_img);
-          imgs.push(...this.detail.goods_img);
-          this.detail.goods_img = imgs;
-        } else {
-          uni.showModal({
-            title: "提示",
-            content: res.msg,
-            showCancel: false,
-            success: function (res) {
-              if (res) {
-                uni.navigateBack({
-                  delta: 1,
-                });
-              }
-            },
-          });
-        }
-      });
+    components: {
+        uniPopup,
+        jyfParser,
+        uniGoodsNav,
+        swiperBanner,
+        uniNumberBox,
+        authorizeModule,
     },
+    data() {
+        return {
+            imgArr: ["/static/goods5.jpg"],
+            content: "",
+            options: [
+                // 底部导航跳转
+                {
+                    icon: "home",
+                    text: "主页",
+                },
+                // {
+                //  icon: 'cart',
+                //  text: '购物车',
+                //  info: 0
+                // }
+            ],
+            buttonGroup: [
+                // 底部操作按钮
+                // {
+                //  text: '加入购物车',
+                //  backgroundColor: '#ff0000',
+                //  color: '#fff'
+                // },
+                {
+                    text: "立即购买",
+                    backgroundColor: "#ffa200",
+                    color: "#fff",
+                },
+            ],
+            btnIndex: 0, // 用户点击按钮事件判断 0:加入购物车;1:立即购买
+            type: null, // 商品类型,1零售 2批发 3精品 4今日值买
+            goodsId: "", // 商品ID
+            id: "", //合伙人套餐ID
+            detail: {
+                goods: {},
+            }, // 商品详情
+            checked: false, //是否选中协议
+            buyNum: 1, //购买数量
+            pfway: "0", // 批发
+            showAuth: false,
 
-    //授权并登录
-    onAuthSuccess: function () {
-      var that = this;
-      uni.showLoading({ mask: true });
-      appEv.setData((res) => {
-        uni.hideLoading();
-        that.showAuth = false;
-      });
+            userinfo: {},
+            goodsDa: {},
+        };
     },
-    // 去购买
-    ToPayPage: function () {
-      if (!this.checked) {
-        appEv.errTips("请阅读并同意购买协议");
-        return;
-      }
-	  this.toPayOrder();
-    //   if (this.btnIndex == 0) {
-    //     // if(this.type != 1){
-    //     this.toPayOrder();
-    //     // }else{
-    //     // 	this.SetCartGoodsList()
-    //     // }
-    //   } else {
-    //     this.toPayOrder();
-    //   }
+    onLoad: function(e) {
+        this.type = e.type;
+        this.goodsDa = e;
+        this.userinfo = uni.getStorageSync("userinfo");
+        this.loadData(e);
     },
-    // 创建购买订单
-    toPayOrder: function () {
-      this.goto("/pages/to-pay-list/index", {
-        ...this.goodsDa,
-        is_sell: this.pfway,
-        num: this.buyNum,
-      });
+    onShow: function() {},
+    methods: {
+        // 商品详情信息
+        loadData(da) {
+            post("goods/goodsDetail", da).then((res) => {
+                if (res.code === 0) {
+                    this.detail = res.data.data;
+                    let imgs = [];
+                    imgs.push(this.detail.original_img);
+                    imgs.push(...this.detail.goods_img);
+                    this.detail.goods_img = imgs;
+                } else {
+                    uni.showModal({
+                        title: "提示",
+                        content: res.msg,
+                        showCancel: false,
+                        success: function(res) {
+                            if (res) {
+                                uni.navigateBack({
+                                    delta: 1,
+                                });
+                            }
+                        },
+                    });
+                }
+            });
+        },
+
+        //授权并登录
+        onAuthSuccess: function() {
+            var that = this;
+            uni.showLoading({ mask: true });
+            appEv.setData((res) => {
+                uni.hideLoading();
+                that.showAuth = false;
+            });
+        },
+        // 去购买
+        ToPayPage: function() {
+            if (!this.checked) {
+                appEv.errTips("请阅读并同意购买协议");
+                return;
+            }
+            this.toPayOrder();
+            //   if (this.btnIndex == 0) {
+            //     // if(this.type != 1){
+            //     this.toPayOrder();
+            //     // }else{
+            //     //   this.SetCartGoodsList()
+            //     // }
+            //   } else {
+            //     this.toPayOrder();
+            //   }
+        },
+        // 创建购买订单
+        toPayOrder: function() {
+            this.goto("/pages/to-pay-list/index", {
+                ...this.goodsDa,
+                is_sell: this.pfway,
+                num: this.buyNum,
+            });
+        },
+        // 添加到购物车
+        SetCartGoodsList: function() {
+            let that = this;
+            let data = {
+                goodsId: this.goodsId,
+                buyCount: this.buyNum,
+                specialArea: this.type,
+            };
+            u_post("ShuZiTeaYW/shop/conShoppingCart", data).then((res) => {
+                if (res.status == 200) {
+                    appEv.errTips("添加成功");
+                    that.checked = false;
+                    that.buyNum = 1;
+                    that.$refs.shopping.close();
+                } else {
+                    appEv.errTips(res.msg);
+                }
+            });
+        },
+        // 购买数量更改
+        bindChange(e) {
+            this.buyNum = e;
+        },
+        // 更改批发方式
+        setWay(e) {
+            this.pfway = e;
+        },
+        // 点击同意协议
+        checkboxChange(e) {
+            let index = e.detail.value.indexOf("1");
+            if (index != -1) {
+                this.checked = true;
+            } else {
+                this.checked = false;
+            }
+        },
+        // 点击底部主页购物车等按钮
+        onClick(e) {
+            if (e.index === 0) {
+                uni.switchTab({ url: "/pages/index/index" });
+            }
+        },
+        // 点击立即购买或加入购物车
+        buttonClick: function(e) {
+            this.btnIndex = e.index;
+            this.$refs.shopping.open();
+        },
+        // 点击关闭弹窗
+        closeBtn: function() {
+            this.$refs.shopping.close();
+        },
+        getProPage: function() {
+            if (this.type == 1 || this.type == 2) {
+                uni.navigateTo({
+                    url: "/pages/protocol/index?type=" + this.type,
+                });
+            } else if (this.type == 4) {
+                uni.navigateTo({
+                    url: "/pages/protocol/index?type=" + 3,
+                });
+            } else if (this.type == 3) {
+                uni.navigateTo({
+                    url: "/pages/protocol/index?type=" + 5,
+                });
+            }
+        },
     },
-    // 添加到购物车
-    SetCartGoodsList: function () {
-      let that = this;
-      let data = {
-        goodsId: this.goodsId,
-        buyCount: this.buyNum,
-        specialArea: this.type,
-      };
-      u_post("ShuZiTeaYW/shop/conShoppingCart", data).then((res) => {
-        if (res.status == 200) {
-          appEv.errTips("添加成功");
-          that.checked = false;
-          that.buyNum = 1;
-          that.$refs.shopping.close();
-        } else {
-          appEv.errTips(res.msg);
+    onShareAppMessage: function() {
+        let userinfo = uni.getStorageSync("userinfo");
+        var path = "/pages/product/p_details?agentId=1";
+        if (userinfo.user_id) {
+            path = "/pages/product/p_details?agentId=" + userinfo.user_id;
         }
-      });
-    },
-    // 购买数量更改
-    bindChange(e) {
-      this.buyNum = e;
-    },
-    // 更改批发方式
-    setWay(e) {
-      this.pfway = e;
-    },
-    // 点击同意协议
-    checkboxChange(e) {
-      let index = e.detail.value.indexOf("1");
-      if (index != -1) {
-        this.checked = true;
-      } else {
-        this.checked = false;
-      }
-    },
-    // 点击底部主页购物车等按钮
-    onClick(e) {
-      if (e.index === 0) {
-        uni.switchTab({ url: "/pages/index/index" });
-      }
-    },
-    // 点击立即购买或加入购物车
-    buttonClick: function (e) {
-      this.btnIndex = e.index;
-      this.$refs.shopping.open();
+        var title = `让数字经济赋能美好生活!`;
+        return {
+            title: title,
+            path: path,
+        };
     },
-    // 点击关闭弹窗
-    closeBtn: function () {
-      this.$refs.shopping.close();
-    },
-    getProPage: function () {
-      if (this.type == 1 || this.type == 2) {
-        uni.navigateTo({
-          url: "/pages/protocol/index?type=" + this.type,
-        });
-      } else if (this.type == 4) {
-        uni.navigateTo({
-          url: "/pages/protocol/index?type=" + 3,
-        });
-      } else if (this.type == 3) {
-        uni.navigateTo({
-          url: "/pages/protocol/index?type=" + 5,
-        });
-      }
-    },
-  },
-  onShareAppMessage: function () {
-    let userinfo = uni.getStorageSync("userinfo");
-    var path = "/pages/product/p_details?agentId=1";
-    if (userinfo.user_id) {
-      path = "/pages/product/p_details?agentId=" + userinfo.user_id;
-    }
-    var title = `让数字经济赋能美好生活!`;
-    return {
-      title: title,
-      path: path,
-    };
-  },
 };
 </script>
-
 <style lang="scss">
 // 页面配置
 page {
-  background: #f5f5f5;
+    background: #f5f5f5;
 }
+
 .container {
-  padding-bottom: 90rpx;
+    padding-bottom: 90rpx;
 }
+
 // 页面配置-end
 
 // 价格信息栏
 .price_span {
-  width: 283rpx;
-  height: 100%;
-  position: relative;
+    width: 283rpx;
+    height: 100%;
+    position: relative;
 }
+
 .price text {
-  font-size: 24rpx;
-  color: #fff;
-  font-family: "SourceHanSansCN-Medium";
+    font-size: 24rpx;
+    color: #fff;
+    font-family: "SourceHanSansCN-Medium";
 }
+
 .price_info {
-  background: #ff6d44;
-  height: 92rpx;
-  width: 100%;
-  box-sizing: border-box;
+    background: #ff6d44;
+    height: 92rpx;
+    width: 100%;
+    box-sizing: border-box;
 }
+
 .price {
-  font-size: 38rpx;
-  color: #fff;
-  font-family: "SourceHanSansCN-Medium";
-  margin-left: 20rpx;
+    font-size: 38rpx;
+    color: #fff;
+    font-family: "SourceHanSansCN-Medium";
+    margin-left: 20rpx;
 }
+
 .span_conten {
-  width: calc(283rpx - 46rpx);
-  height: 100%;
-  background: #ffcabb;
-  position: relative;
-  font-size: 34rpx;
-  font-family: "SourceHanSansCN-Medium";
-  color: #682918;
+    width: calc(283rpx - 46rpx);
+    height: 100%;
+    background: #ffcabb;
+    position: relative;
+    font-size: 34rpx;
+    font-family: "SourceHanSansCN-Medium";
+    color: #682918;
 }
+
 .triangle {
-  width: 0px;
-  height: 0px;
-  border-top: 92rpx solid rgba(0, 0, 0, 0);
-  border-right: 92rpx solid rgba(0, 0, 0, 0);
-  border-bottom: 92rpx solid #ffcabb;
-  border-left: 92rpx solid rgba(0, 0, 0, 0);
-  transform: translate(-46rpx, -92rpx);
-  position: absolute;
-  top: 0;
-  left: 0;
+    width: 0px;
+    height: 0px;
+    border-top: 92rpx solid rgba(0, 0, 0, 0);
+    border-right: 92rpx solid rgba(0, 0, 0, 0);
+    border-bottom: 92rpx solid #ffcabb;
+    border-left: 92rpx solid rgba(0, 0, 0, 0);
+    transform: translate(-46rpx, -92rpx);
+    position: absolute;
+    top: 0;
+    left: 0;
 }
+
 .samll {
-  font-size: 28rpx;
-  max-width: calc(100% - 360rpx);
-  line-height: 1.3;
-  text-align: justify;
+    font-size: 28rpx;
+    max-width: calc(100% - 360rpx);
+    line-height: 1.3;
+    text-align: justify;
 }
+
 // 价格信息栏-end
 
 // 标题信息栏
 .goods_subName {
-  width: 100%;
-  overflow: hidden;
-  font-size: 22rpx;
-  color: #787878;
+    width: 100%;
+    overflow: hidden;
+    font-size: 22rpx;
+    color: #787878;
 }
+
 .title_info {
-  width: 100%;
-  overflow: hidden;
-  background: #ffffff;
-  padding: 20rpx;
-  box-sizing: border-box;
+    width: 100%;
+    overflow: hidden;
+    background: #ffffff;
+    padding: 20rpx;
+    box-sizing: border-box;
 }
+
 .goods_name {
-  width: 100%;
-  overflow: hidden;
-  font-size: 32rpx;
-  color: #1b1b1b;
-  font-family: "SourceHanSansCN-Bold";
-  font-weight: bold;
-  margin-bottom: 20rpx;
+    width: 100%;
+    overflow: hidden;
+    font-size: 32rpx;
+    color: #1b1b1b;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+    margin-bottom: 20rpx;
 }
+
 // 标题信息栏-end
 
 // 产品简介
 .brief {
-  width: 100%;
-  overflow: hidden;
-  background-color: #fff;
+    width: 100%;
+    overflow: hidden;
+    background-color: #fff;
 }
+
 .brief_con {
-  width: 100%;
-  overflow: hidden;
-  padding: 20rpx;
-  box-sizing: border-box;
+    width: 100%;
+    overflow: hidden;
+    padding: 20rpx;
+    box-sizing: border-box;
 }
+
 .brief_title {
-  width: 100%;
-  overflow: hidden;
-  font-size: 26rpx;
-  color: #1b1b1b;
-  padding: 0 20rpx;
-  box-sizing: border-box;
-  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
-  height: 74rpx;
+    width: 100%;
+    overflow: hidden;
+    font-size: 26rpx;
+    color: #1b1b1b;
+    padding: 0 20rpx;
+    box-sizing: border-box;
+    border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+    height: 74rpx;
 }
+
 // 产品简介-end
 
 // 底部导航组件
 .option {
-  position: fixed;
-  width: 100%;
-  overflow: hidden;
-  left: 0;
-  bottom: 0;
+    position: fixed;
+    width: 100%;
+    overflow: hidden;
+    left: 0;
+    bottom: 0;
 }
+
 // 底部导航组件-end
 
 // 购买或加入购物车弹窗
 .option_box text {
-  color: #2db389;
+    color: #2db389;
 }
+
 .goods_raido {
-  margin-right: 180rpx;
+    margin-right: 180rpx;
 }
+
 .close_img {
-  width: 36rpx;
-  height: 36rpx;
+    width: 36rpx;
+    height: 36rpx;
 }
+
 .option_box {
-  font-size: 26rpx;
-  margin-top: 80rpx;
+    font-size: 26rpx;
+    margin-top: 80rpx;
 }
+
 .goods_raido:nth-last-child(1) {
-  margin-right: 0;
+    margin-right: 0;
 }
+
 .num_con {
-  width: 100%;
-  overflow: hidden;
-  padding-bottom: 3rpx;
+    width: 100%;
+    overflow: hidden;
+    padding-bottom: 3rpx;
 }
+
 .goods_option {
-  width: 100%;
-  overflow: hidden;
-  padding-top: 50rpx;
+    width: 100%;
+    overflow: hidden;
+    padding-top: 50rpx;
 }
+
 .close_con {
-  width: 100%;
-  overflow: hidden;
-  margin-bottom: 35rpx;
+    width: 100%;
+    overflow: hidden;
+    margin-bottom: 35rpx;
 }
+
 .raido_text {
-  font-size: 26rpx;
-  color: #545454;
-  margin-left: 30rpx;
+    font-size: 26rpx;
+    color: #545454;
+    margin-left: 30rpx;
 }
+
 .goods_con {
-  width: calc(100% - 202rpx - 30rpx);
-  overflow: hidden;
+    width: calc(100% - 202rpx - 30rpx);
+    overflow: hidden;
 }
+
 .goods_img {
-  width: 202rpx;
-  height: 140rpx;
-  margin-right: 30rpx;
-  border-radius: 12rpx;
+    width: 202rpx;
+    height: 140rpx;
+    margin-right: 30rpx;
+    border-radius: 12rpx;
 }
+
 .confim {
-  width: 100%;
-  height: 60rpx;
-  border-radius: 30rpx;
-  background: #2db389;
-  color: #fff;
-  font-size: 26rpx;
-  margin-top: 44rpx;
+    width: 100%;
+    height: 60rpx;
+    border-radius: 30rpx;
+    background: #2db389;
+    color: #fff;
+    font-size: 26rpx;
+    margin-top: 44rpx;
 }
+
 .shopping {
-  width: 100%;
-  overflow: hidden;
-  padding: 20rpx;
-  box-sizing: border-box;
-  border-radius: 30rpx 30rpx 0 0;
-  background: #fff;
+    width: 100%;
+    overflow: hidden;
+    padding: 20rpx;
+    box-sizing: border-box;
+    border-radius: 30rpx 30rpx 0 0;
+    background: #fff;
 }
+
 .goods_info {
-  width: 100%;
-  overflow: hidden;
-  align-items: inherit;
-  padding-bottom: 48rpx;
-  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+    width: 100%;
+    overflow: hidden;
+    align-items: inherit;
+    padding-bottom: 48rpx;
+    border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
 }
+
 .shop_names {
-  width: 100%;
-  overflow: hidden;
-  font-family: "SourceHanSansCN-Bold";
-  font-weight: bold;
-  color: #1b1b1b;
-  font-size: 32rpx;
+    width: 100%;
+    overflow: hidden;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+    color: #1b1b1b;
+    font-size: 32rpx;
 }
+
 .goods_msg {
-  width: 100%;
-  overflow: hidden;
-  font-size: 28rpx;
-  color: #18bb88;
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: 500;
+    width: 100%;
+    overflow: hidden;
+    font-size: 28rpx;
+    color: #18bb88;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: 500;
 }
+
 .raido_img {
-  width: 39rpx;
-  height: 35rpx;
-  background: url(~@/static/img/weixuanzhong.png);
-  background-repeat: no-repeat;
-  background-size: 35rpx 35rpx;
-  background-position: center center;
+    width: 39rpx;
+    height: 35rpx;
+    background: url(~@/static/img/weixuanzhong.png);
+    background-repeat: no-repeat;
+    background-size: 35rpx 35rpx;
+    background-position: center center;
 }
 
 .raido_box {
-  background: url(~@/static/img/consent.png);
-  background-repeat: no-repeat;
-  background-size: 39rpx 35rpx;
-  background-position: center center;
+    background: url(~@/static/img/consent.png);
+    background-repeat: no-repeat;
+    background-size: 39rpx 35rpx;
+    background-position: center center;
 }
+
 // 购买或加入购物车弹窗-end
-</style>
+</style>

+ 92 - 63
src/pages/szw-order-list/index.vue

@@ -14,6 +14,19 @@
                 <view class="a-order">
                     <view class="overflow" :data-id="li.id">
                         <view class="list-title flex_r flex_ac flex_jb ellipsis">
+                            <view class="fz_text">{{
+                                li.type == 1
+                                ? "零售专区"
+                                : li.type == 2
+                                ? "批发专区"
+                                : li.type == 3
+                                ? "精品专区"
+                                : li.type == 4
+                                ? "今日值得买"
+                                : li.type == 5
+                                ? "茶宝兑换"
+                                : ""
+                                }}</view>
                             <view class="fz_text">{{ tidyStatus([li.pay_status, li.order_status]) }}</view>
                         </view>
                         <view class="goods-info flex_r flex_ac flex_jb" :data-type="li.type" @tap="toDetails(li)">
@@ -31,7 +44,7 @@
                     </view>
                     <view class="price-box flex_r flex_ac">
                         <view class="btn cancel-btn" @tap="toCancel(li)" v-if="li.pay_status === 0">取消订单</view>
-                        <view class="btn topay-btn" @tap="toPay" v-if="li.pay_status === 0">立即支付</view>
+                        <view class="btn topay-btn" @tap="toPay(li)" v-if="li.pay_status === 0">立即支付</view>
                         <view class="btn cancel-btn" @click="toDetails(li)" v-if="li.pay_status != 0">查看订单</view>
                         <view class="btn topay-btn" @tap="toTake(li)" v-if="[0, 1].includes(li.order_status)">确认收货</view>
                     </view>
@@ -42,17 +55,14 @@
         <view class="loading-indicator" :class="loadingMoreHidden ? 'opacity' : ''">{{ loadingTip }}</view>
     </view>
 </template>
-
 <script>
-// var reqApi = new ReqApi();
-// var toPayOpre = new ToPayOpre();
+var page = 1;
 var app = getApp();
 var appEv = app.$vm.$options;
-var page = 1;
 import notGoods from "@/components/not-goods/index";
 import { get, post, u_post } from "@/request/api.js";
-// import terraceTagbar from '@/components/terrace-tagbar/index'
-// import { ReqApi, ToPayOpre } from "../../utils/reqTools.js";
+import { ToPayOpre } from "@/utils/reqTools.js";
+var toPayOpre = new ToPayOpre();
 export default {
     components: {
         notGoods,
@@ -84,9 +94,6 @@ export default {
         this.loadData();
     },
     methods: {
-        returnBtn: function() {
-            uni.navigateBack({});
-        },
         clearData(isclearCat = true, callBack) {
             page = 1;
             this.orderList = [];
@@ -110,12 +117,12 @@ export default {
 
             post("my/order", data).then((res) => {
                 if (res.code === 0) {
-                        uni.hideLoading();
-                        uni.stopPullDownRefresh();
-                        let da = res.data.data.data;
+                    uni.hideLoading();
+                    uni.stopPullDownRefresh();
+                    let da = res.data.data.data;
 
-                        if(page == 1) this.orderList = []
-                        this.orderList = [...da,...this.orderList]
+                    if (page == 1) this.orderList = []
+                    this.orderList = [...da, ...this.orderList]
 
                 } else {
                     appEv.errTips(res.msg || "");
@@ -129,38 +136,33 @@ export default {
 
         // 立即支付
         toPay(e) {
-            var orderDetailIds = e.currentTarget.dataset.id;
-            var index = e.currentTarget.dataset.index;
-            var price = this.orderList[index].data.totalPrice;
-            var type = this.orderList[index].data.patType;
-            var teaIntegral = this.orderList[index].data.totalTeaInt;
-            var pfIntegral = this.orderList[index].data.totalPfInt;
-            var xfIntegral = this.orderList[index].data.totalXfInt;
-            var totalAccount = this.orderList[index].data.totalAccount;
-            var orderNo = this.orderList[index].data.orderNo;
-            let data = {
-                orderDetailIds: orderDetailIds,
-                types: 1,
-                price: price,
-                account: totalAccount,
-                teaIntegral: teaIntegral,
-                pfIntegral: pfIntegral,
-                xfIntegral: xfIntegral,
-                zfType: type,
-                ojsType: e.currentTarget.dataset.ojstype,
-            };
-            var info;
-            info = reqApi.payOrder(data);
-            var that = this;
-            if (info) {
-                info.then((res) => {
-                    if (res.data.status == 200) {
-                        toPayOpre.toPay(res.data.payParam);
-                    } else {
-                        appEv.errTips(res.data.msg || "支付失败");
-                    }
-                });
-            }
+            // #ifdef  H5
+            let type = "H5";
+            // #endif
+            // #ifdef  APP
+            let type = "app";
+            // #endif
+            // #ifdef  MP-WEIXIN
+            let type = "jsapi";
+            // #endif
+            post('goods/payOrder', {
+                id: e.order_id,
+                trade_type: type
+            }).then(res => {
+                if (res.code === 0) {
+                    toPayOpre.toPay(res.data.data, (da) => {
+                        if (!da) {
+                            // 支付成功
+                            appEv.errTips('支付成功')
+                        } else {
+                            // 支付失败
+                            appEv.errTips('支付已取消')
+                        }
+                        // appEv.errTips('支付成功');
+                        this.loadData();
+                    })
+                }
+            })
         },
         // 取消订单
         toCancel(e) {
@@ -173,10 +175,10 @@ export default {
                 confirmColor: "#f02f2f",
                 success(res) {
                     if (res.confirm) {
-                        post("my/orderCancel",{
+                        post("my/orderCancel", {
                             order_id: e.order_id
                         }).then(res => {
-                            if(res.code === 0){
+                            if (res.code === 0) {
                                 appEv.errTips(res.msg);
                                 that.loadData();
                             }
@@ -196,10 +198,10 @@ export default {
                 cancelColor: "#bbb",
                 success(res) {
                     if (res.confirm) {
-                        post("goods/confirmOrder",{
+                        post("goods/confirmOrder", {
                             order_id: e.order_id
                         }).then(res => {
-                            if(res.code === 0){
+                            if (res.code === 0) {
                                 appEv.errTips(res.msg);
                                 that.loadData();
                             }
@@ -208,15 +210,6 @@ export default {
                 },
             });
         },
-        // 整理数据
-        arrangeData(data = appEv.parameter("data")) {
-            var statusType = this.data.statusType;
-            statusType[0][2] = data.wholeCount;
-            statusType[1][2] = data.AlreadyPaymentCount;
-            statusType[2][2] = data.AlreadyCompleteCount;
-            statusType[3][2] = data.AlreadySettlementCount;
-            this.statusType = statusType;
-        },
         //菜单切换
         statusTap(e) {
             //重置数据
@@ -237,6 +230,14 @@ export default {
                 if (da[1] == 5) return "已作废";
             };
         },
+        // tidyTpye() {
+        //     return (da) => {
+        //         switch(da) {
+        //             1: return "待支付";
+        //             break;
+        //         }
+        //     };
+        // },
     },
     //上拉加载事件
     onReachBottom() {
@@ -256,7 +257,8 @@ export default {
             that.loadData();
         });
     },
-    onUnload(){
+    // 监听卸载页面  同等于  返回拦截
+    onUnload() {
         // #ifdef  H5 || APP-PLUS
         this.goto("/pages/my/index");
         // #endif
@@ -269,26 +271,31 @@ export default {
 
 };
 </script>
-
 <style lang="scss">
 page {
     background-color: #f3f5f7;
 }
+
 .container {
     width: 100%;
 }
+
 .fl {
     float: left;
 }
+
 .fr {
     float: right;
 }
+
 .overflow {
     overflow: hidden;
 }
+
 .r_color {
     color: #fa2f2e;
 }
+
 .loading-indicator {
     width: 100%;
     text-align: center;
@@ -297,13 +304,16 @@ page {
     margin: 20rpx 0;
     line-height: 1.5;
 }
+
 .opacity {
     opacity: 0;
     display: none;
 }
+
 .terraceComp {
     height: 84rpx;
 }
+
 .terraceComp_fix {
     position: fixed;
     top: -12rpx;
@@ -311,10 +321,12 @@ page {
     right: 0;
     z-index: 15;
 }
+
 .status-box {
     width: 100%;
     height: 94rpx;
 }
+
 .status_tap_box {
     position: fixed;
     left: 0;
@@ -329,6 +341,7 @@ page {
     z-index: 300;
     box-shadow: 0rpx 8rpx 8rpx rgba(0, 0, 0, 0.025);
 }
+
 .status-box .status-label {
     flex-grow: 1;
     height: 100%;
@@ -368,6 +381,7 @@ page {
     font-size: 26rpx;
     color: #fa2f2e;
 }
+
 .order-list .a-order .order-date text.r_color {
     font-weight: 600;
 }
@@ -376,12 +390,14 @@ page {
     width: 100%;
     overflow: hidden;
 }
+
 .a-order .list-title {
     font-size: 28rpx;
     font-weight: 600;
     color: #000;
     padding: 16rpx 24rpx;
 }
+
 .avaImgs {
     width: 54rpx;
     height: 54rpx;
@@ -401,9 +417,11 @@ page {
     background-color: #f3f5f7;
     box-sizing: border-box;
 }
+
 .goods-info-bar {
     width: calc(100% - 190rpx);
 }
+
 .goods-info .img-box {
     width: 172rpx;
     height: 120rpx;
@@ -412,11 +430,13 @@ page {
     border-radius: 12rpx;
     margin-right: 20rpx;
 }
+
 .goods-info .img-box .goods-img {
     width: 100%;
     display: block;
     height: 100%;
 }
+
 .goods-img-container {
     overflow: hidden;
     box-sizing: border-box;
@@ -424,34 +444,41 @@ page {
     height: 172rpx;
     white-space: nowrap;
 }
+
 .goods-img-container .img-box {
     display: inline-block;
 }
+
 .goods-img-container .img-box:last-of-type {
     margin-right: 0;
 }
+
 .goods-info .goods_name {
     width: calc(100% - 192rpx);
     font-size: 28rpx;
     font-weight: 500;
     color: #121212;
 }
+
 .goodsDetail_info {
     overflow: hidden;
     width: 180rpx;
     line-height: 1.5;
     text-align: right;
 }
+
 .goodsDetail_info .unimport {
     font-size: 24rpx;
     color: #999;
 }
+
 .goodsDetail_info .goods_price {
     font-size: 26rpx;
     line-height: 1.2;
     font-weight: 600;
     margin-bottom: 10rpx;
 }
+
 .goodsDetail_info .goods_price text {
     font-size: 36rpx;
 }
@@ -474,6 +501,7 @@ page {
     border: 1rpx solid #ccc;
     padding: 12rpx 24rpx;
 }
+
 .order-list .a-order .price-box .total-price {
     color: #e05f0b;
 }
@@ -494,10 +522,11 @@ page {
     // float: left;
     margin-left: auto;
 }
+
 .ptz {
     color: #18bb88;
     font-size: 30rpx;
     position: absolute;
     left: 30rpx;
 }
-</style>
+</style>

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

@@ -190,7 +190,7 @@ export default {
             // this.goto("/pages/xghc-addrress/userAddress");
         },
         // 支付
-        payment: function() {
+        payment() {
             // #ifdef  H5
             let type = "H5";
             // #endif