shish 3 лет назад
Родитель
Сommit
142d50b87d

+ 2 - 1
hdApp/src/admin/billing/affirmGhs.vue

@@ -58,7 +58,7 @@
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
 						<button class="admin-button-com big" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(0)">有车到店</button>
 						<button class="admin-button-com big" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(1)">上门自取</button>
-						<button class="admin-button-com big" :class="[form.sendType == 2 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(2)">发快递</button>
+						<button class="admin-button-com big" :class="[form.sendType == 2 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(2)">跑腿</button>
 					</tui-list-cell>
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
@@ -111,6 +111,7 @@
 					</tui-list-cell>
 
 				</view>
+
 			</form>
 		</view>
 		<view class="under-bar">

+ 4 - 0
mallApp/src/api/order/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const freight = async data => {
+	return https.get("/order/freight", data);
+};
+
 export const buyItem = data => {
 	return https.post('/order/buy-item', data)
 }

+ 97 - 0
mallApp/src/components/wangCg.vue

@@ -0,0 +1,97 @@
+<template>
+  <view class="model" v-if="loginStatus == 0">
+    <view class="freeApply" @click="login">请先登录</view>
+  </view>
+</template>
+<script>
+export default {
+  props: {
+    loginStatus: {
+      type: Number,
+      default: 0,
+    }
+  },
+  data() {
+    return {
+      
+    };
+  },
+  methods: {
+    login() {
+        this.$emit('goToLogin')
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.model {
+  position: fixed;
+  z-index: 9999;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  background: rgba(0, 0, 0, 0.6);
+  color: #fff;
+  overflow: hidden;
+  text-align: center;
+  & > .noData_img {
+    width: 318upx;
+    height: 318upx;
+    margin: 100upx auto 0;
+  }
+  & > .no_data_text {
+    font-size: 32upx;
+    color: #ffffff;
+    text-align: center;
+    margin: 50upx 0;
+  }
+  & > .freeApply {
+    width: 280upx;
+    height: 110upx;
+    line-height:110upx;
+    background: linear-gradient(90deg, #3385ff, #33b0ff);
+    border-radius: 30upx;
+    margin: 380upx auto 0 auto;
+    font-size: 34upx;
+    font-weight:bold;
+    color: #ffffff;
+    text-align: center;
+  }
+  &>.experience{
+    margin-top: 40upx;
+    color: #fff;
+    font-size: 30upx;
+  }
+  &>.experFrame{
+    margin-top: 50upx;
+    height: 50upx;
+    &>view{
+      margin: 0 auto;
+      &>.experInput{
+        height: 70upx;
+        width: 250upx;
+        display: inline-block;
+        vertical-align: middle;
+        border-radius: 8upx;
+        background-color: #fff;
+        border: 1px solid #ccc;
+        color: #666;
+        padding-left: 20upx;
+        box-sizing: border-box;
+        text-align: left;
+      }
+      &>text{
+        display: inline-block;
+        line-height: 70upx;
+        padding: 0 20upx;
+        background-color: #3385FF;
+        vertical-align: middle;
+        font-size: 30upx;
+        margin-left: 20upx;
+      }
+    }
+  }
+}
+</style>

+ 104 - 3
mallApp/src/pages/billing/affirmGhs.vue

@@ -35,6 +35,65 @@
 					</view>
 				</view>
 
+				<view class="module-com input-line-wrap">
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
+						<button class="admin-button-com big" :class="[form.sendType == 2 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(2)">跑腿</button>
+						<button class="admin-button-com big" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(1)">到店自取</button>
+						<button class="admin-button-com big" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(0)">有车上门</button>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
+						<view v-if="form.sendType == 0">
+							<text style="color: #3385FF;width:100%;">本店如有出车经过您那边,请选此项,免配送费</text>
+						</view>				
+						<view v-if="form.sendType == 1">
+							<text style="color: #3385FF;width:100%;">到店取货,没有配送费</text>
+						</view>
+						<view v-if="form.sendType == 2">
+							<text style="color: #3385FF;width:100%;">请跑腿送货,有配送费</text>
+						</view>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 2" @click="modifyAddress">
+						<view class="tui-title">收花地址</view>
+						<view v-if="!$util.isEmpty(shopInfo.lat) && !$util.isEmpty(shopInfo.long)">
+							<view><text>{{shopInfo.fullAddress}}</text></view>
+							<view><text>{{shopInfo.showAddress}}</text></view>
+						</view>
+						<view v-else>
+							<view><text style="color:#CCCCCC;">请完善地址</text></view>
+						</view>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" v-if="form.sendType == 2 && Number(form.sendCost)>0">
+					<view class="tui-title">运费</view>
+					<text style="color: #3385FF">¥{{ form.sendCost }}</text>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" v-if="(form.sendType == 2 || form.sendType == 0)&& Number(form.packCost)>0">
+					<view class="tui-title">打包费</view>
+					<text style="color: #3385FF">¥{{ form.packCost }}</text>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
+						<view class="tui-title">总金额</view>
+						<text style="color: #3385FF">¥{{ modifyPrice }}</text>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="true">
+						<view class="tui-title ">配送时间</view>
+						<picker mode="date" :value="sendTimeWant" @change="bindDateChange" style="width:400upx;">
+						<view class="uni-input">{{sendTimeWant || '今天'}}</view>
+						</picker>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
+						<textarea style="height: 100upx" v-model="remark" placeholder="这里写备注"/>
+					</tui-list-cell>
+
+				</view>
+
 			</form>
 		</view>
 		<view class="under-bar">
@@ -44,12 +103,14 @@
 	</view>
 </template>
 <script>
+import TuiListCell from "@/components/plugin/list-cell";
 import productMins from "@/mixins/cgProduct";
-import { buyItem } from "@/api/order"
+import { buyItem,freight } from "@/api/order"
 import { mapActions, mapGetters } from "vuex";
 export default {
 	name: "BillingAffirm",
 	components: {
+		TuiListCell
 	},
 	mixins: [productMins],
 	data() {
@@ -76,12 +137,19 @@ export default {
 				sendTimeWant: "",
 				sendCost: "",
 				customId: "",
-				product: ""
+				product: "",
+				packCost:0
 			},
 			showCustomer: false,
 			today:'',
 			monthLater:'',
-			modifyPrice:0
+			modifyPrice:0,
+			shopInfo:{
+				lat:'',
+				long:'',
+				fullAddress:'',
+				showAddress:''
+			}
 		};
 	},
 	onShow() {
@@ -114,6 +182,39 @@ export default {
 		...mapActions(["initMerchantInfo"]),
 		init(){
 
+		},
+		changeSendType(num){
+			this.form.sendType = num
+			if(num == 2){
+				//计算运费
+				this.calcFreight()
+			}
+		},
+		calcFreight() {
+			let weight = 0
+			if(!this.$util.isEmpty(this.selectList)){
+				this.selectList.forEach((item,idx,arr) => {
+					if(Number(item.bigCount)>0){
+						let add = Number(item.weight)*Number(item.bigCount)
+						weight = Number(weight) + Number(add)
+					}else{
+						let unitWeight = item.weight/item.ratio
+						let add = Number(unitWeight)*Number(item.smallCount)
+						weight = Number(weight) + Number(add)
+					}
+				})
+			}
+			weight = Number(weight).toFixed(2)
+
+			let params = {
+				ghsId: this.options.id,
+				weight:weight
+			};
+			freight(params).then(res => {
+				if(res.code == 1){
+					this.form.sendCost = res.data.fee?parseFloat(res.data.fee):0
+				}
+			});
 		},
 		calcPrice(){
 			let allPrice = this.allPrice.toFixed(2)

+ 47 - 15
mallApp/src/pages/home/category.vue

@@ -10,7 +10,7 @@
         <view class="page-view" v-if="!$util.isEmpty(list.data)" >
           <view class="goods-list" v-for="(items) in list.data" :key="items.id" @click="pageTo(`/pages/goods/detail?id=${items.id}`)" >
             <view class="img-blo">
-              <app-img :src="items.smallImgList[0]" alt="商品图" mode="aspectFit" :height="200" />
+              <image :src="items.smallImgList[0]" mode="aspectFill" ></image>
             </view>
             <view class="goods-det">
               <view class="goods-det-top">
@@ -18,6 +18,7 @@
                 <view class="goods-sales"></view>
               </view>
               <view class="goods-price">¥{{ items.price?parseFloat(items.price):0 }}</view>
+              <view style="color:red;border:1upx solid red;width:80upx;text-align:center;padding:5upx 0 5upx 0;font-size:25upx;right:30upx;position:absolute;">购买</view>
             </view>
           </view>
         </view>
@@ -26,48 +27,75 @@
         </block>
       </scroll-view>
     </block>
+
+    <wangCg :loginStatus.sync="loginStatus" @goToLogin="loginTo()"></wangCg>
+
   </view>
 </template>
 <script>
+import { mapGetters } from 'vuex'
 import AppImg from '@/components/app-img'
+import wangCg from "@/components/wangCg"
 import AppWrapperEmpty from '@/components/app-wrapper-empty'
 import { getClass, getList } from '@/api/category'
-import { list } from '@/mixins'
-import { share } from "@/mixins";
+import { list,share } from '@/mixins'
 export default {
   name: 'category',
   components: {
     AppWrapperEmpty,
-    AppImg
+    AppImg,
+    wangCg
   },
   mixins: [list, share],
   data () {
     return {
       tabbar: [],
-      height: 0, // scroll-view高度
-      currentTab: 0, // 预设当前项的值
-      scrollTop: 0, // tab标题的滚动条位置
+      height: 0,
+      currentTab: 0,
+      scrollTop: 0,
       form: {
         categoryId: ''
       },
-      currentTabIndex: 1
+      currentTabIndex: 1,
+			//0没有登录 1有登录
+      loginStatus :0
     }
   },
-  onShow () {
-    uni.hideTabBar()
-  },
-  onLoad: function () {
-    uni.hideTabBar()
-  },
+	computed: {
+    	...mapGetters({ loginInfo:"getLoginInfo" })
+	},
   onShareAppMessage(res) {
-		console.log("pages/home/category?account="+this.option.account)
 		return {
 			title: '花束',
 			desc: "",
 			path: "pages/home/category?account="+this.option.account,
 		}
 	},
+	onShow(){
+		//登录状态
+		if(!this.$util.isEmpty(this.loginInfo)){
+			this.loginStyle = 1
+		}else{
+			this.loginStyle = 0
+		}
+  },
+	watch: {
+		loginInfo: {
+			deep: true,
+			handler: function(newVal) {
+				if(!this.$util.isEmpty(newVal)){
+					this.loginStatus = 1
+				}else{
+					this.loginStatus = 0
+				}
+			},
+			immediate:true
+		}
+	},
   methods: {
+		loginTo() {
+			this.$util.pageTo({url:"/pages/login/index?needBack=1"})
+		},
     init(){
       this.sInit()
     },
@@ -195,6 +223,10 @@ page {
         width: 200upx;
         height: 200upx;
         margin-right: 20upx;
+        image{
+          width: 200upx;
+          height: 200upx;
+        }
       }
       .goods-det {
         padding-top: 18upx;

+ 36 - 17
mallApp/src/pages/item/item.vue

@@ -72,13 +72,16 @@
     	<sel-popup :show="popupShow" :info="infoData" @close="hidePopup" />
 		<app-activily-coupon :show.sync="isNewCustom" :info="newCustomGift" :ghsId="ghsId" />
 		
+		<wangCg :loginStatus.sync="loginStatus" @goToLogin="loginTo()"></wangCg>
+
 	</view>
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import AppTabs from "@/components/plugin/tabs";
 import Commondity from "./components/subItem";
-import wangCg from "./components/wangCg";
+import wangCg from "@/components/wangCg";
 import SelPopup from "./components/sel-popup.vue";
 import AppWrapperEmpty from "./components/app-wrapper-empty";
 import GoodsCommondity from "@/components/item/module/app-goods-commodity";
@@ -144,7 +147,9 @@ export default {
 			shareDiscount:1,
 			ghsId:0,
 			newCustomGift:{xrFlAmount:0},
-			isNewCustom:false
+			isNewCustom:false,
+			//0没有登录 1有登录
+      		loginStatus :0
 		};
 	},
 	onPullDownRefresh() {
@@ -153,10 +158,20 @@ export default {
 		});
 	},
 	computed: {
-    
+    	...mapGetters({ loginInfo:"getLoginInfo" })
 	},
 	watch: {
-		
+		loginInfo: {
+			deep: true,
+			handler: function(newVal) {
+				if(!this.$util.isEmpty(newVal)){
+					this.loginStatus = 1
+				}else{
+					this.loginStatus = 0
+				}
+			},
+			immediate:true
+		}
 	},
   	onShareAppMessage(res) {
 		console.log("pages/item/item?account="+this.option.account)
@@ -167,6 +182,14 @@ export default {
 		}
 	},
 	onShow(){
+
+		//登录状态
+		if(!this.$util.isEmpty(this.loginInfo)){
+			this.loginStyle = 1
+		}else{
+			this.loginStyle = 0
+		}
+
 		if(this.xjData.hasUpdate == 1){
 			const list = this.selectList;
 
@@ -191,11 +214,11 @@ export default {
 				if(has == false){
 					let params = {
 						...this.xjDataInfo,
-						bigCount: null, //扎数
-						smallCount: null, //支数
-						autoPrice: null, //调价价格
-						realityWeight: null, //调价价格
-						userPrice: null, //调价价格
+						bigCount: null,
+						smallCount: null,
+						autoPrice: null,
+						realityWeight: null,
+						userPrice: null,
 					};
 					list.push(params);
 					this.setSelectInfoByType({ type: this.pageType, info: list });
@@ -218,8 +241,8 @@ export default {
 	onUnload() {
 	},
 	methods: {
-		recharge(item){
-			this.$util.pageTo({url:'/pagesStore/me/recharge',query:{ghsId:item.id}})
+		loginTo() {
+			this.$util.pageTo({url:"/pages/login/index?needBack=1"})
 		},
 		//去特殊品种页,如小菊等
 		goToSpecialVariety(info){
@@ -230,8 +253,8 @@ export default {
 				this.$util.pageTo({url: "/pagesPurchase/xj",query: {stock:info.stock,price: info.price,ghsId:this.option.id}})
 			}
 		},
-	  showPopup() {
-				this.popupShow = true;
+		showPopup() {
+			this.popupShow = true;
 		},
 		hidePopup() {
 			this.popupShow = false;
@@ -340,7 +363,6 @@ export default {
 			if (val.index === 0) {
 				this.cancelEvent();
 			} else {
-				console.log(444, this.selectList);
 				uni.navigateTo({
 					url: "/admin/billing/affirm"
 				});
@@ -357,14 +379,12 @@ export default {
 			}
 		},
 		confirmSelectEvent() {
-			console.log(777)
 			if (this.selectList.length > 0) {
 				//因历史遗留原因,打开花材页马上点花材出现数量0或null的情况,需要过滤 shish 20210716
 				let selectList = this.selectList;
 				let list = [];
 				for (let i=0;i<selectList.length;i++){
 					if(/(^[1-9]\d*$)/.test(selectList[i].bigCount) == false && /(^[1-9]\d*$)/.test(selectList[i].smallCount) == false){
-						console.log(i)
 						continue
 					}
 					list.push(selectList[i])
@@ -375,7 +395,6 @@ export default {
 				}
 				this.setSelectInfoByType({ type: this.pageType, info: list });
 
-				console.log(771)
 				this.pageTo({url: '/pages/billing/affirmGhs',query:{id:this.options.id},type:2})
 			} else {
 				this.$msg("请选择花材");

+ 16 - 5
mallApp/src/pages/login/index.vue

@@ -39,15 +39,18 @@ export default {
       form: {
         mobile: "",
         name: ""
-      }
+      },
+      needBack:0
     };
   },
   methods: {
+    init(){
+      if(this.option.needBack){
+        this.needBack = this.option.needBack
+      }
+    },
     accountLogin(){
       this.$util.pageTo({url: "/pages/login/account",type:2})
-    },
-    init(){
-
     },
     confirmFn() {
       let currentMiniOpenId = uni.getStorageSync('miniOpenId')
@@ -57,7 +60,15 @@ export default {
           uni.setStorageSync('token', res.data.token)
           if(res.data.user && !that.$util.isEmpty(res.data.user)){
             store.commit('setLoginInfo', res.data.user)
-            that.$util.pageTo({url: "/pages/login/result",type:2})
+            if(this.needBack == 1){
+              that.$msg('登录成功')
+              setTimeout(function(){
+                uni.navigateBack({})
+              },1500)
+            }else{
+              that.$util.pageTo({url: "/pages/login/result",type:2})
+            }
+            
           }
         }
       })

+ 10 - 4
mallApp/src/pages/login/result.vue

@@ -9,14 +9,17 @@
         </view>
 
         <view v-if="!$util.isEmpty(superWx)" style="margin-bottom:50upx;font-size:35upx;">点击查看二维码,添加店长微信</view>
-        
+
         <button v-if="!$util.isEmpty(superWx)" class="button-com red" style="width:220upx;" @click="openSuperWx">查看二维码</button>
 
-        <view style="margin-top:50upx;" v-if="Number(account)>0">
-          <button class="button-com default" style="width:220upx;" @click="lookMall">继续买花</button>
+        <view style="margin-top:30upx;" v-if="Number(account)>0">
+        <button class="button-com default" style="width:220upx;background-color:#FF2842;color:white;border-color:#FF2842;" @click="lookMall">买鲜花</button>
+        </view>
+        <view style="margin-top:30upx;" v-if="Number(account)>0">
+        <button class="button-com default" style="width:220upx;background-color:#FF2842;color:white;border-color:#FF2842;" @click="lookGoodsMall">买花束绿植</button>
         </view>
 
-        <view style="margin-top:50upx;">
+        <view style="margin-top:30upx;">
           <button class="button-com default" style="width:220upx;" @click="goBack()">返回</button>
         </view>
 
@@ -46,6 +49,9 @@ export default {
     lookMall(){
       this.$util.pageTo({ url: "/pages/item/item?account="+this.account, type: 2})
     },
+    lookGoodsMall(){
+      this.$util.pageTo({ url: "/pages/home/category?account="+this.account, type: 2})
+    },
     init() {
         getInfo().then(res=>{
           if(res.code == 1){

+ 61 - 69
mallApp/src/pages/order/buy.vue

@@ -1,38 +1,29 @@
 <template>
   <view class="app-content">
-    <app-tabs :tabs="tabs" :currentTab="tabIndex" :isFixed="true" :borderLeft="true" @change="tabChange" itemWidth="50%" />
-    <form @submit="formSubmit">
-      <block v-if="tabIndex == 0">
-        <app-delivery-module ref="appDelivery" @changeAddress="changeAddress" />
-      </block>
-      <block v-else>
-        <view class="module-com">
-          <tui-list-cell class="line-cell" :hover="false">
-            <view class="tui-title">订花人电话</view>
-            <input v-model="mentionForm.bookMobile" placeholder-class="phcolor" class="tui-input" name="phone" placeholder="请输入手机号" type="number" />
-          </tui-list-cell>
-        </view>
-      </block>
 
+    <form @submit="formSubmit">
       <view class="module-com shop-price-wrap">
         <view class="module-tit">商品信息</view>
         <view class="module-det">
           <app-list-module v-if="!$util.isEmpty(goodsInfo)" :info="goodsInfo" />
-          <view class="shop-prompt" v-if="!$util.isEmpty(orderShop)" @click="showAlert = true">
-            <view>
-              <span>{{ `运费(${showDistance}公里)` }}</span>
-              <i class="iconfont iconchangjianwentixiangguanwenti2" style="font-size:45upx;"></i>
-            </view>
-            <view>¥{{ freightPrice }}</view>
-          </view>
           <view class="shop-prompt">
-            <view>计</view>
-            <view>¥{{ totalPrice }}</view>
+            <view>商品合计</view>
+            <view>¥{{ goodsTotalPrice }}</view>
           </view>
         </view>
       </view>
 
-      <view style="width:100vw;height:200upx"></view>
+      <view class="module-com input-line-wrap">
+        <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
+          <button class="admin-button-com big" :class="[form.sendType == 2 ? 'blue' : 'default']" style="width:180upx;margin-right:20upx;" @click="changeSendType(2)">跑腿送</button>
+          <button class="admin-button-com big" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:180upx;margin-right:20upx;"  @click="changeSendType(1)">到店自取</button>
+          <button class="admin-button-com big" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(0)">有车上门</button>
+        </tui-list-cell>
+      </view>
+
+      <block v-if="form.sendType != 1">
+        <app-delivery-module ref="appDelivery" @changeAddress="changeAddress" />
+      </block>
 
       <view class="page-btn app-footer">
         <view class="flex-center">
@@ -45,17 +36,7 @@
         <button class="button-com red" formType="submit">确认</button>
       </view>
     </form>
-    <alert-module :show="showAlert" @click="hideAlert" @cancel="hideAlert">
-      <view class="alt-content" v-if="!$util.isEmpty(orderShop)">
-        <view>
-          <span class="app-price">{{ `${orderShop.freight.first}公里`}}</span>内免运费
-        </view>
-        <view>
-          <span>超过每增加1公里运费加</span>
-          <span class="app-price">{{ `${orderShop.freight.add}元` }}</span>
-        </view>
-      </view>
-    </alert-module>
+
   </view>
 </template>
 <script>
@@ -70,7 +51,7 @@ import AlertModule from "@/components/plugin/alert";
 const form = require("@/utils/formValidation.js");
 import { getShopUser } from "@/utils/auth";
 import { getOrderShop } from "@/utils/config";
-import { createOrder } from "@/api/order";
+import { createOrder,freight } from "@/api/order";
 import { getUserDistance } from "@/api/express";
 export default {
   name: "order-buy",
@@ -87,20 +68,16 @@ export default {
     return {
       goodsInfo: {},
       tabIndex: 0,
-      tabs: [
-        { name: "帮我送" },
-        { name: "到店自取" }
-      ],
       showAlert: false,
       form: {
-        sendDistance: "", // 配送距离,根据腾讯js进行计算
-        goodsId: "", // 【商城下单特有字段】商品id
-        goodsStyleId: "", // 【商城下单特有字段】商品款式id
-        goodsNum: "", // 【商城下单特有字段】商品数量
-        couponId: "0", // 优惠券id,默认0没有使用优惠券
-        receiveLat: "", // 收花人纬度
-        receiveLong: "", // 收花人经度
-        sendType:0
+        sendDistance:"",
+        goodsId: "",
+        goodsStyleId: "",
+        goodsNum: "",
+        couponId: "0",
+        receiveLat: "",
+        receiveLong: "",
+        sendType:2
       },
       mentionForm: {
         bookMobile: ""
@@ -109,7 +86,7 @@ export default {
       freightPrice: 0,
       goodsNum: 1,
       showDistance: 0,
-      totalPrice: 0,
+      goodsTotalPrice: 0,
       memberDiscount: 1,
       couponDiscountAmount: 0
     };
@@ -123,13 +100,6 @@ export default {
       return parseFloat(price.toFixed(2))
     }
   },
-  watch: {
-    //运费变化则总金额和应付金额变化
-    freightPrice(newVal) {
-      let price = this.goodsInfo.price * this.goodsInfo.buyNum + newVal;
-      this.totalPrice = parseFloat(price.toFixed(2))
-    }
-  },
   methods: {
     init() {
 
@@ -141,21 +111,44 @@ export default {
       goodsInfo.buyNum = this.option.goodsNum;
       this.goodsInfo = goodsInfo;
 
-      this.totalPrice = goodsInfo.price * this.option.goodsNum;
-
-      Object.keys(this.form).forEach((i, index) => {
-        this.form[i] = this.option[i];
-      })
+      this.goodsTotalPrice = goodsInfo.price * this.option.goodsNum;
+      this.goodsTotalPrice = this.goodsTotalPrice.toFixed(2)
+      this.goodsTotalPrice = parseFloat(this.goodsTotalPrice)
 
     },
-    tabChange(e) {
-      this.tabIndex = e.index;
-      if(e.index == 0){
-        this.form.sendType =0
-      }else{
-        this.form.sendType =1
-      }
-    },
+		changeSendType(num){
+			this.form.sendType = num
+			if(num == 2){
+				//计算运费
+				this.calcFreight()
+			}
+		},
+		calcFreight() {
+			let weight = 0
+			if(!this.$util.isEmpty(this.selectList)){
+				this.selectList.forEach((item,idx,arr) => {
+					if(Number(item.bigCount)>0){
+						let add = Number(item.weight)*Number(item.bigCount)
+						weight = Number(weight) + Number(add)
+					}else{
+						let unitWeight = item.weight/item.ratio
+						let add = Number(unitWeight)*Number(item.smallCount)
+						weight = Number(weight) + Number(add)
+					}
+				})
+			}
+			weight = Number(weight).toFixed(2)
+
+			let params = {
+				ghsId: this.options.id,
+				weight:weight
+			};
+			freight(params).then(res => {
+				if(res.code == 1){
+					this.form.sendCost = res.data.fee?parseFloat(res.data.fee):0
+				}
+			});
+		},
     hideAlert() {
       this.showAlert = false;
     },
@@ -221,7 +214,6 @@ export default {
 
 <style lang='scss' scoped>
 .app-content {
-  padding-top: 100upx;
   padding-bottom: 160upx;
   min-height: calc(100vh - 220upx);
   .module-com {

+ 12 - 1
mallApp/src/static/iconfont/iconfont.css

@@ -2,7 +2,7 @@
   font-family: 'iconfont';  /* project id 1525256 */
   src: url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.eot');
   src: url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.eot?#iefix') format('embedded-opentype'),
-  url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.woff2') format('woff2'),
+  url('https://img.theflorist.cn/iconfont/font_1525256_6bxwphhntqh.woff2') format('woff2'),
   url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.woff') format('woff'),
   url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.ttf') format('truetype'),
   url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.svg#iconfont') format('svg');
@@ -20,6 +20,17 @@
   content: "\e61a";
 }
 
+.iconmingxi1:before {
+  content: "\e7e5";
+}
+.iconjian:before {
+  content: "\e7e3";
+}
+
+.iconzeng:before {
+  content: "\e7e4";
+}
+
 .iconshenheweitongguo:before {
   content: "\e774";
 }

+ 12 - 1
开发/mallApp/src/static/iconfont/iconfont.css

@@ -2,7 +2,7 @@
   font-family: 'iconfont';  /* project id 1525256 */
   src: url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.eot');
   src: url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.eot?#iefix') format('embedded-opentype'),
-  url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.woff2') format('woff2'),
+  url('https://img.theflorist.cn/iconfont/font_1525256_6bxwphhntqh.woff2') format('woff2'),
   url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.woff') format('woff'),
   url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.ttf') format('truetype'),
   url('https://img.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.svg#iconfont') format('svg');
@@ -20,6 +20,17 @@
   content: "\e61a";
 }
 
+.iconmingxi1:before {
+  content: "\e7e5";
+}
+.iconjian:before {
+  content: "\e7e3";
+}
+
+.iconzeng:before {
+  content: "\e7e4";
+}
+
 .iconshenheweitongguo:before {
   content: "\e774";
 }

+ 12 - 1
线上/mallApp/src/static/iconfont/iconfont.css

@@ -2,7 +2,7 @@
   font-family: 'iconfont';  /* project id 1525256 */
   src: url('https://img.zhiguanhua.cn/iconfont/font_1525256_6243f1wxe9f.eot');
   src: url('https://img.zhiguanhua.cn/iconfont/font_1525256_6243f1wxe9f.eot?#iefix') format('embedded-opentype'),
-  url('https://img.zhiguanhua.cn/iconfont/font_1525256_6243f1wxe9f.woff2') format('woff2'),
+  url('https://img.zhiguanhua.cn/iconfont/font_1525256_6bxwphhntqh.woff2') format('woff2'),
   url('https://img.zhiguanhua.cn/iconfont/font_1525256_6243f1wxe9f.woff') format('woff'),
   url('https://img.zhiguanhua.cn/iconfont/font_1525256_6243f1wxe9f.ttf') format('truetype'),
   url('https://img.zhiguanhua.cn/iconfont/font_1525256_6243f1wxe9f.svg#iconfont') format('svg');
@@ -20,6 +20,17 @@
   content: "\e61a";
 }
 
+.iconmingxi1:before {
+  content: "\e7e5";
+}
+.iconjian:before {
+  content: "\e7e3";
+}
+
+.iconzeng:before {
+  content: "\e7e4";
+}
+
 .iconshenheweitongguo:before {
   content: "\e774";
 }