拼拼有礼开发--仿拼拼有礼商城APP系统二次开发源码分享

拼拼有礼APP商城系统开发源码分享:

<template>
  <div class="deliver-goods">
    <header>
      <div class="order-num acea-row row-between-wrapper">
        <div class="num line1">订单号:{{ order_id }}</div>
        <div class="name line1">
          <span class="iconfont icon-yonghu2"></span>{{ delivery.nickname }}
        </div>
      </div>
      <div class="address">
        <div class="name">
          {{ delivery.real_name
          }}<span class="phone">{{ delivery.user_phone }}</span>
        </div>
        <div>{{ delivery.user_address }}</div>
      </div>
      <div class="line"><img src="@assets/images/line.jpg" /></div>
    </header>
    <div class="wrapper">
      <div class="item acea-row row-between-wrapper">
        <div>发货方式</div>
        <div class="mode acea-row row-middle row-right">
          <div
            class="goods"
            :class="active === index ? 'on' : ''"
            v-for="(item, index) in types"
            :key="index"
            @click="changeType(item, index)"
          >
            {{ item.title }}<span class="iconfont icon-xuanzhong2"></span>
          </div>
        </div>
      </div>
      <div class="list" v-show="active === 0">
        <div class="item acea-row row-between-wrapper">
          <div>发货方式</div>
          <select class="mode" v-model="delivery_name">
            <option value="">选择快递公司</option>
            <option
              :value="item.name"
              v-for="(item, index) in logistics"
              :key="index"
              >{{ item.name }}</option
            >
          </select>
          <span class="iconfont icon-up"></span>
        </div>
        <div class="item acea-row row-between-wrapper">
          <div>快递单号</div>
          <input
            type="text"
            placeholder="填写快递单号"
            v-model="delivery_id"
            class="mode"
          />
        </div>
      </div>
      <div class="list" v-show="active === 1">
        <div class="item acea-row row-between-wrapper">
          <div>送货人</div>
          <input
            type="text"
            placeholder="填写送货人"
            v-model="delivery_name"
            class="mode"
          />
        </div>
        <div class="item acea-row row-between-wrapper">
          <div>送货电话</div>
          <input
            type="text"
            placeholder="填写送货电话"
            v-model="delivery_id"
            class="mode"
          />
        </div>
      </div>
    </div>
    <div style="height:1.2rem;"></div>
    <div class="confirm" @click="saveInfo">确认提交</div>
  </div>
</template>
<script>
import { getAdminOrderDelivery, setAdminOrderDelivery } from "../../api/admin";
import { getLogistics } from "../../api/public";
import { required } from "@utils/validate";
import { validatorDefaultCatch } from "@utils/dialog";

export default {
  name: "GoodsDeliver",
  components: {},
  props: {},
  data: function() {
    return {
      types: [
        {
          type: "express",
          title: "发货"
        },
        {
          type: "send",
          title: "送货"
        },
        {
          type: "fictitious",
          title: "无需发货"
        }
      ],
      active: 0,
      order_id: "",
      delivery: [],
      logistics: [],
      delivery_type: "express",
      delivery_name: "",
      delivery_id: ""
    };
  },
  watch: {
    "$route.params.oid": function(newVal) {
      let that = this;
      if (newVal != undefined) {
        that.order_id = newVal;
        that.getIndex();
      }
    }
  },
  mounted: function() {
    this.order_id = this.$route.params.oid;
    this.getIndex();
    this.getLogistics();
  },
  methods: {
    changeType: function(item, index) {
      this.active = index;
      this.delivery_type = item.type;
      this.delivery_name = "";
      this.delivery_id = "";
    },
    getIndex: function() {
      let that = this;
      getAdminOrderDelivery(that.order_id).then(
        res => {
          that.delivery = res.data;
        },
        error => {
          that.$dialog.error(error.msg);
        }
      );
    },
    getLogistics: function() {
      let that = this;
      getLogistics().then(
        res => {
          that.logistics = res.data;
        },
        error => {
          that.$dialog.error(error.msg);
        }
      );
    },
    async saveInfo() {
      let that = this,
        delivery_type = that.delivery_type,
        delivery_name = that.delivery_name,
        delivery_id = that.delivery_id,
        save = {};
      save.order_id = that.order_id;
      save.delivery_type = that.delivery_type;
      switch (delivery_type) {
        case "send":
          try {
            await this.$validator({
              delivery_name: [required(required.message("快递公司"))],
              delivery_id: [required(required.message("快递单号"))]
            }).validate({ delivery_name, delivery_id });
          } catch (e) {
            return validatorDefaultCatch(e);
          }
          save.delivery_name = delivery_name;
          save.delivery_id = delivery_id;
          that.setInfo(save);
          break;
        case "express":
          try {
            await this.$validator({
              delivery_name: [required(required.message("发货人姓名"))],
              delivery_id: [required(required.message("发货人电话"))]
            }).validate({ delivery_name, delivery_id });
          } catch (e) {
            return validatorDefaultCatch(e);
          }
          save.delivery_name = delivery_name;
          save.delivery_id = delivery_id;
          that.setInfo(save);
          break;
        case "fictitious":
          that.setInfo(save);
          break;
      }
    },
    setInfo: function(item) {
      let that = this;
      console.log(item);
      setAdminOrderDelivery(item).then(
        res => {
          that.$dialog.success(res.msg);
          that.$router.go(-1);
        },
        error => {
          that.$dialog.error(error.msg);
        }
      );
    }
  }
};
</script>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
微信小程序电商平台(前后端开源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/开发文档/
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值