|
@@ -0,0 +1,311 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+<view class="app-content">
|
|
|
|
|
+ <view class="affirm-page">
|
|
|
|
|
+ <view class="affirm-view overscroll">
|
|
|
|
|
+ <form>
|
|
|
|
|
+ <view class="module-com">
|
|
|
|
|
+ <view class="commodity-view">
|
|
|
|
|
+ <view class="commodity-list">
|
|
|
|
|
+ <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
|
|
|
|
|
+ <image class="item-icon" :src="item.cover"></image>
|
|
|
|
|
+ <view class="item-info">
|
|
|
|
|
+ <view class="info-line">
|
|
|
|
|
+ <text class="item-name">{{ item.name }}</text>
|
|
|
|
|
+ <text class="item-price">
|
|
|
|
|
+ <text class="unit"></text>
|
|
|
|
|
+ <text class="price">
|
|
|
|
|
+ <text>{{item.bigCount}}*¥{{parseFloat(item.userPrice)}}</text>
|
|
|
|
|
+ </text>
|
|
|
|
|
+ </text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="info-line">
|
|
|
|
|
+ <text class="item-type"></text>
|
|
|
|
|
+ <text class="item-count">
|
|
|
|
|
+ </text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="summary-bar">
|
|
|
|
|
+ <view class="operate-view" @click="gobackEvent"><text class="iconfont icongouwuche"></text>重选商品</view>
|
|
|
|
|
+ <view class="describe-view"> 共{{ selectList.length }}种 </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <view class="tui-title">运费</view>
|
|
|
|
|
+ <input v-model="form.sendCost" placeholder-class="phcolor" class="tui-input" name="sendCost" @focus="form.sendCost=''" placeholder="请填写运费,没有留空" maxlength="50" type="digit" />
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
|
|
+ <view class="tui-title">
|
|
|
|
|
+ <text>合计金额</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text style="color: #3385FF">{{parseFloat(finalPrice)}}</text>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
|
|
+ <view class="tui-title">实收金额</view>
|
|
|
|
|
+ <input style="border:1upx solid #eee;color:#3385FF;width:150upx;height:70upx;" type="digit" @focus="modifyPrice=''" v-model="modifyPrice" placeholder-class="tui-placeholder"/>
|
|
|
|
|
+ <text v-if="modifyPrice > 0 && modifyPrice > finalPrice" style="font-size:25upx;margin-left:20upx;color:red;">人工资材费 ¥{{parseFloat((modifyPrice-finalPrice).toFixed(2))}}</text>
|
|
|
|
|
+ <text v-if="modifyPrice > 0 && modifyPrice < finalPrice" style="font-size:25upx;margin-left:20upx;color:green;">优惠 ¥{{parseFloat((finalPrice-modifyPrice).toFixed(2))}}</text>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <app-delivery-module ref="appDelivery" @changeAddress="changeAddress" />
|
|
|
|
|
+
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="under-bar">
|
|
|
|
|
+ <view class="price-view"></view>
|
|
|
|
|
+ <button class="admin-button-com blue middle" @click="confirmToSubmit">提交</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+</view>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+import TuiListCell from "@/components/plugin/list-cell";
|
|
|
|
|
+import productMins from "@/mixins/cgPlantProduct";
|
|
|
|
|
+import AppDeliveryModule from "@/components/app-delivery";
|
|
|
|
|
+import { cgPlant } from "@/api/goods/index";
|
|
|
|
|
+import { mapActions, mapGetters } from "vuex";
|
|
|
|
|
+import { getUserDistance } from "@/api/express";
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: "plantConfirm",
|
|
|
|
|
+ components: {
|
|
|
|
|
+ TuiListCell,AppDeliveryModule
|
|
|
|
|
+ },
|
|
|
|
|
+ mixins: [productMins],
|
|
|
|
|
+ data () {
|
|
|
|
|
+ return {
|
|
|
|
|
+ selectJobType: "addOrder",
|
|
|
|
|
+ form: {
|
|
|
|
|
+ anonymity: "0", // 是否匿名 0不 1要
|
|
|
|
|
+ sendDistance: "", // 配送距离,根据腾讯js进行计算
|
|
|
|
|
+ goodsId: "", // 【商城下单特有字段】商品id
|
|
|
|
|
+ goodsStyleId: "", // 【商城下单特有字段】商品款式id
|
|
|
|
|
+ goodsNum: "", // 【商城下单特有字段】商品数量
|
|
|
|
|
+ couponId: "0", // 优惠券id,默认0没有使用优惠券
|
|
|
|
|
+ receiveLat: "", // 收花人纬度
|
|
|
|
|
+ receiveLong: "",// 收花人经度
|
|
|
|
|
+ remark:"",
|
|
|
|
|
+ sendCost:''
|
|
|
|
|
+ },
|
|
|
|
|
+ modifyPrice:0
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad (option) {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ onShow(){
|
|
|
|
|
+ },
|
|
|
|
|
+ onUnload(){
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ ...mapGetters(["getLoginInfo"]),
|
|
|
|
|
+ finalPrice(){
|
|
|
|
|
+ let totalPrice = this.allPrice.toFixed(2)
|
|
|
|
|
+ let finalPrice = (Number(totalPrice) + Number(this.form.sendCost)).toFixed(2)
|
|
|
|
|
+ let currentPrice = parseFloat(finalPrice)
|
|
|
|
|
+ this.modifyPrice = currentPrice
|
|
|
|
|
+ return currentPrice
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ //计算客户距离和运费
|
|
|
|
|
+ changeAddress(e) {
|
|
|
|
|
+ let lat = this.$refs.appDelivery.region.latitude;
|
|
|
|
|
+ let long = this.$refs.appDelivery.region.longitude;
|
|
|
|
|
+ getUserDistance({ lat: lat, lng: long }).then(res => {
|
|
|
|
|
+ this.freightPrice = res.data.fee;
|
|
|
|
|
+ this.showDistance = res.data.showDistance;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmToSubmit () {
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ let goods = this.selectList.map((ele) => {
|
|
|
|
|
+ return {goodsId: ele.id, num: ele.bigCount,price: ele.userPrice,goodsSn:ele.sn,cover:ele.shortCover}
|
|
|
|
|
+ })
|
|
|
|
|
+ that.$util.confirmModal({content:'确认提交?'},() => {
|
|
|
|
|
+ cgPlant({goods:JSON.stringify(goods),...that.form}).then((res) => {
|
|
|
|
|
+ that.removeFromSaveDirect()
|
|
|
|
|
+ that.pageTo({url: '/admin/order/addOrderResult',type:2,query:{id:res.data.id}})
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ gobackEvent () {
|
|
|
|
|
+ this.pageTo({url: '/admin/order/addOrder',type:2})
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+.admin-button-com {
|
|
|
|
|
+ margin-right: 20upx;
|
|
|
|
|
+}
|
|
|
|
|
+.affirm-page {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ .affirm-view {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ margin-bottom:90upx;
|
|
|
|
|
+ padding: 20upx;
|
|
|
|
|
+ background-color: #f0f2f6;
|
|
|
|
|
+ .commodity-view {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ .commodity-list {
|
|
|
|
|
+ padding: 20upx;
|
|
|
|
|
+ .commodity-item {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ margin-bottom: 20upx;
|
|
|
|
|
+ .item-icon {
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ width: 140upx;
|
|
|
|
|
+ height: 140upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-info {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ margin-left: 20upx;
|
|
|
|
|
+ .info-line {
|
|
|
|
|
+ margin-bottom: 20upx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: flex-end;
|
|
|
|
|
+ .item-name {
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ font-size: 28upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-price {
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ font-size: 22upx;
|
|
|
|
|
+ .price {
|
|
|
|
|
+ font-size: 32upx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-type {
|
|
|
|
|
+ color: #999;
|
|
|
|
|
+ font-size: 24upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-count {
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ font-size: 24upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .summary-bar {
|
|
|
|
|
+ padding: 0 20upx;
|
|
|
|
|
+ height: 90upx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ border-top: 1upx solid #eeeeee;
|
|
|
|
|
+ .operate-view {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ color: #3385ff;
|
|
|
|
|
+ font-size: 26upx;
|
|
|
|
|
+ .iconfont {
|
|
|
|
|
+ margin-right: 20upx;
|
|
|
|
|
+ font-size: 40upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .describe-view {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ font-size: 24upx;
|
|
|
|
|
+ .price {
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ font-size: 36upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .module-com {
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ margin-bottom: 20upx;
|
|
|
|
|
+ border-radius: 10upx;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ .tab-box{
|
|
|
|
|
+ padding: 10upx 30upx 30upx;
|
|
|
|
|
+ .tab{
|
|
|
|
|
+ width: 49%;
|
|
|
|
|
+ height: 70upx;
|
|
|
|
|
+ color: #a2a2a2;
|
|
|
|
|
+ border: 1upx solid #dcdcdc;
|
|
|
|
|
+ border-radius: 10upx;
|
|
|
|
|
+ font-size: 28upx;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ &.active{
|
|
|
|
|
+ color: #ff4d4d;
|
|
|
|
|
+ border: 1upx solid #ff4d4d;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .member-wrap {
|
|
|
|
|
+ .member-det {
|
|
|
|
|
+ font-size: 24upx;
|
|
|
|
|
+ margin-left: 20upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .remark-wrap {
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+ .remark {
|
|
|
|
|
+ height: 240upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .under-bar {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 0 20upx;
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ bottom:0;
|
|
|
|
|
+ /* 手机mobile屏幕小于1000px */
|
|
|
|
|
+ @media screen and (max-width: 1100px) {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ /* 收银台cashier屏幕大于1000px */
|
|
|
|
|
+ @media screen and (min-width:1100px) {
|
|
|
|
|
+ width: 40%;
|
|
|
|
|
+ }
|
|
|
|
|
+ height: 100upx;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
|
|
|
|
|
+ .price-view {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ font-size: 24upx;
|
|
|
|
|
+ .price-title {
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ }
|
|
|
|
|
+ .price-number {
|
|
|
|
|
+ margin: 0 20upx;
|
|
|
|
|
+ color: #ff2842;
|
|
|
|
|
+ .large {
|
|
|
|
|
+ font-size: 40upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .admin-button-com {
|
|
|
|
|
+ width: 200upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|