易拼购源码--易拼购拼团系统开发源码分享

易拼购拼团系统部分开发源码分享:

<template>
  <div class="my-order" ref="container">
    <div class="header bg-color-red">
      <div class="picTxt acea-row row-between-wrapper">
        <div class="text">
          <div class="name">拼团订单信息</div>
        </div>
        <div class="pictrue"><img src="@assets/images/orderTime.png" /></div>
      </div>
    </div>
    <div class="nav acea-row row-around" style="height:1rem !important;">
      <div
        class="item"
        :class="{ on: type === 0 }"
        @click="$router.replace({ path: '/order/group_order/' })"
      >
        <div>正在拼团</div>
        <div class="num"></div>
      </div>
      <div
        class="item"
        :class="{ on: type === 1 }"
        @click="$router.replace({ path: '/order/group_order/1' })"
      >
        <div>拼团成功</div>
        <div class="num"></div>
      </div>
      <div
        class="item"
        :class="{ on: type === 2 }"
        @click="$router.replace({ path: '/order/group_order/2' })"
      >
        <div>自动拼团</div>
        <div class="num"></div>
      </div>
    </div>
    <div class="list">
      <div class="item" v-for="order in orderList" :key="order.id">
        <div class="title acea-row row-between-wrapper">
          <div>
            {{ order._add_time }}
          </div>
          <div v-show="$route.path.indexOf('/order/group_order/1')!= -1">
            <font v-show="order.is_show == 1" color="green">已中奖</font>
            <font v-show="order.is_show == 0" color="red">未中奖</font>
          </div>
        </div>
        <div >
          <div
            class="item-info acea-row row-between row-top"
            v-for="cart in order.cartInfo"
            :key="cart.id"
          >
            <div class="pictrue">
              <img :src="cart.productInfo.image" />
            </div>
            <div class="text acea-row row-between">
              <div class="name line2">
                {{ cart.productInfo.store_name }}
              </div>
              <div class="money">
                <div>
                  ¥{{
                    cart.productInfo.attrInfo
                      ? cart.productInfo.attrInfo.price
                      : cart.productInfo.price
                  }}
                </div>
                <div>x{{ cart.cart_num }}</div>
              </div>
            </div>
          </div>
        </div>
        <div class="totalPrice">
          共{{ order.cartInfo.length || 0 }}件商品,总金额
          <span class="money font-color-red">¥{{ order.pay_price }}</span>
        </div>
        <div class="bottom acea-row row-right row-middle">
          <div v-if="$route.path.indexOf('/order/group_order/2')!= -1">
            <div class="bnt cancelBnt" @click="cancelAutoSpell(order)" style="width: 2.8rem;">
              取消自动参团
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="noCart" v-if="orderList.length === 0 && page > 1">
      <div class="pictrue"><img src="@assets/images/noOrder.png" /></div>
    </div>
    <Loading :loaded="loaded" :loading="loading"></Loading>
    <Payment
      v-model="pay"
      :types="payType"
      @checked="toPay"
      :balance="userInfo.now_money"
    ></Payment>
    <GeneralWindow
      :generalActive="generalActive"
      @closeGeneralWindow="closeGeneralWindow"
      :generalContent="generalContent"
    ></GeneralWindow>
  </div>
</template>
<script>
import { getOrderData, getGroupOrderList, cancelAutoSpell } from "@api/order";
import {
  takeOrderHandle
} from "@libs/order";
import Loading from "@components/Loading";
import Payment from "@components/Payment";
import { mapGetters } from "vuex";
import { isWeixin } from "@utils";
import GeneralWindow from "@components/GeneralWindow";
import {Toast as toast} from "vue-ydui/dist/lib.rem/dialog";

const NAME = "GroupOrder";

export default {
  name: NAME,
  data() {
    return {
      offlinePayStatus: 2,
      orderData: {},
      type: parseInt(this.$route.params.type) || 0,
      page: 1,
      limit: 10,
      loaded: false,
      loading: false,
      orderList: [],
      pay: false,
      payType: ["yue", "weixin"],
      from: isWeixin() ? "weixin" : "weixinh5",
      generalActive: false,
      generalContent: {
        promoterNum: "",
        title: ""
      }
    };
  },
  components: {
    Loading,
    Payment,
    GeneralWindow
  },
  computed: mapGetters(["userInfo"]),
  watch: {
    $route(n) {
      if (n.name === NAME) {
        const type = parseInt(this.$route.params.type) || 0;
        if (this.type !== type) {
          this.changeType(type);
        }
        this.getOrderData();
      }
    }
  },
  methods: {
    setOfflinePayStatus: function(status) {
      var that = this;
      that.offlinePayStatus = status;
      if (status === 1) {
        if (that.payType.indexOf("offline") < 0) {
          that.payType.push("offline");
        }
      }
    },
    getOrderData() {
      getOrderData().then(res => {
        this.orderData = res.data;
      });
    },
    takeOrder(order) {
      this.$dialog.loading.open("正在加载中");
      takeOrderHandle(order.order_id)
        .then(res => {
          if (
            (res.data.gain_integral != "0.00" &&
              res.data.gain_coupon != "0.00") ||
            (res.data.gain_integral > 0 && res.data.gain_coupon > 0)
          ) {
            this.$dialog.loading.close();
            this.generalActive = true;
            this.generalContent = {
              promoterNum: `恭喜您获得${res.data.gain_coupon}元优惠券以及${
                res.data.gain_integral
              }太阳豆,购买商品时可抵现哦~`,
              title: "恭喜您获得优惠礼包"
            };
            return;
          } else if (
            res.data.gain_integral != "0.00" ||
            res.data.gain_integral > 0
          ) {
            this.$dialog.loading.close();
            this.generalActive = true;
            this.generalContent = {
              promoterNum: `恭喜您获得${
                res.data.gain_integral
              }太阳豆,购买商品时可抵现哦~`,
              title: "赠送太阳豆"
            };
            return;
          } else if (
            res.data.gain_coupon != "0.00" ||
            res.data.gain_coupon > 0
          ) {
            this.$dialog.loading.close();
            this.generalActive = true;
            this.generalContent = {
              promoterNum: `恭喜您获得${
                res.data.gain_coupon
              }元优惠券,购买商品时可抵现哦~`,
              title: "恭喜您获得优惠券"
            };
            return;
          } else {
            this.$dialog.loading.close();
            this.$dialog.success("收货成功");
          }
          this.getOrderData();
          this.orderList = [];
          this.page = 1;
          this.loaded = false;
          this.loading = false;
          this.getOrderList();
        })
        .catch(err => {
          this.$dialog.loading.close();
          this.$dialog.error(err.msg);
        });
    },
    closeGeneralWindow(msg) {
      this.generalActive = msg;
      this.reload();
      this.getOrderData();
    },
    reload() {
      this.changeType(this.type);
    },
    changeType(type) {
      this.type = type;
      this.orderList = [];
      this.page = 1;
      this.loaded = false;
      this.loading = false;
      this.getOrderList();
    },
    getOrderList() {
      if (this.loading || this.loaded) return;
      this.loading = true;
      const { page, limit, type } = this;
      getGroupOrderList({
        page,
        limit,
        type
      }).then(res => {
        this.orderList = this.orderList.concat(res.data);
        this.page++;
        this.loaded = res.data.length < this.limit;
        this.loading = false;
      });
    },
    cancelAutoSpell(item){
      this.$dialog.confirm({
        mes: '确定取消自动参团吗?',
        opts: [
          {
            txt: "确认",
            color: false,
            callback: () => {
              cancelAutoSpell({id:item.spell_id}).then(res => {
                this.$dialog.toast({ mes: '取消成功' });
                this.$router.go(0);
              }).catch(err => {
                this.$dialog.error(err.msg ? err.msg : '取消失败');
              });
            }
          },
          {
            txt: "取消",
            color: false,
            callback: () => {
            }
          }
        ]
      });

    },
  },
  mounted() {
    this.getOrderData();
    this.getOrderList();
    this.$scroll(this.$refs.container, () => {
      !this.loading && this.getOrderList();
    });
  }
};
</script>

<style scoped>
  .font-color-green{
    color:green;
  }
  .font-color-blue{
    color:blue;
  }
.my-order .list{
  margin: 0.14rem auto 1.1rem auto;
}
.noCart {
  margin-top: 0.17rem;
  padding-top: 0.1rem;
}

.noCart .pictrue {
  width: 4rem;
  height: 3rem;
  margin: 0.7rem auto 0.5rem auto;
}

.noCart .pictrue img {
  width: 100%;
  height: 100%;
}
</style>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
微信小程序电商平台(前后端开源PHP),拼团营销插件,整个系统架构非常简单,适合小型团队或者个人开发者二次开发。 小程序 + APP + 公众号 + PC + 生活号 注重界面美感与用户体验,打造独特电商系统生态圈 演示地址:https://xiaochengxu.laiketui.com/duan/LKT/index.php (账号:admin 密码:000000) 软件架构 PHP5.6+ MYSQL5.5+ 自主研发框架 安装教程 http://www.laiketui.com 功能列表 1. 产品管理(产品分类管理、产品品牌管理、产品列表管理) 2. 订单管理(订单列表、评价管理、退货管理、订单设置、打印设置) 3. 用户管理(用户列表、用户信息修改) 4. 插件管理(插件列表、拼团活动、抽奖活动) 5. 财务管理(提现申请、提现列表、充值列表) 6. 优惠券管理(优惠券活动、优惠券列表) 7. 签到管理(签到活动、签到记录) 8. 拆红包管理(活动列表、拆红包记录) 9. 砍价管理(砍价商品、砍价记录) 10. 轮播图管理 11. 新闻管理(新闻分类、新闻列表) 12. 页面管理 13. 公告管理(发布公告、公告列表、消息公告) 14. 系统管理(系统参数配置、推广图设置、热门关键词、管理员列表、新增管理员、权限设置) 15. 拼团活动(发布活动、活动列表) 16. 抽奖管理(发布活动、开奖管理) 安装教程 官网查看:http://www.laiketui.com/ 使用说明 官网查看:http://www.laiketui.com/help/ QQ交流群 340645969 安装部署教程 官网查看:http://www.laiketui.com/docs/使用文档/安装教程-2/ 开发文档 官网查看:http://www.laiketui.com/docs/开发文档/

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值