|
|
@@ -39,37 +39,94 @@
|
|
|
<view class="operate-view" @click="gobackEvent">
|
|
|
<text class="iconfont icongouwuche"></text>返回列表
|
|
|
</view>
|
|
|
- <view class="describe-view">共{{ allCountFun.bigLength }}扎,合计 ¥<text class="price">{{ allPriceFun }}</text></view>
|
|
|
+ <view class="describe-view">
|
|
|
+ <text class="price">共{{ allCountFun.bigLength }}扎,{{ allCountFun.weight }}公斤,合计 ¥{{ allPriceFun }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</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 == 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 == 3 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(3)">物流</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><text style="color:red;">首次下单,请联系客服确认是否在配送范围</text></view>
|
|
|
- <view v-if="ghsInfo.shopId && ghsInfo.shopId == 520"><text style="color:red;font-weight:bold">免费配送每天晚23:30发车,其它时间请用跑腿或自取</text></view>
|
|
|
- <view v-if="ghsInfo.shopId && ghsInfo.shopId == 520"><text style="color:red;font-weight:bold">免费配送仅送货到楼下,不支持送货上楼</text></view>
|
|
|
- </view>
|
|
|
- <view v-if="form.sendType == 1">
|
|
|
- <text style="color: #3385FF;width:100%;">您自己来店里取,没有配送费</text>
|
|
|
+<block v-if="ghsInfo.pfLevel && ghsInfo.pfLevel == 1">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <button class="admin-button-com middle" :class="[form.transType == 0 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeTransType(0)">德邦空运</button>
|
|
|
+ <button class="admin-button-com middle" :class="[form.transType == 1 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeTransType(1)">顺丰空运</button>
|
|
|
+ <button class="admin-button-com middle" :class="[form.transType == 2 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeTransType(2)">冷链物流</button>
|
|
|
+ <button class="admin-button-com middle" :class="[form.transType == 3 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeTransType(3)">航空物流</button>
|
|
|
+ </tui-list-cell>
|
|
|
+</block>
|
|
|
+<block v-else>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <button v-if="ghsInfo.shopId != 4608" class="admin-button-com middle" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:30upx;" @click="changeSendType(0)">送货上门</button>
|
|
|
+ <button class="admin-button-com middle" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeSendType(1)">自取</button>
|
|
|
+ <button class="admin-button-com middle" :class="[form.sendType == 2 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeSendType(2)">跑腿</button>
|
|
|
+ <button class="admin-button-com middle" :class="[form.sendType == 4 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeSendType(4)">快递</button>
|
|
|
+ <button class="admin-button-com middle" :class="[form.sendType == 3 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeSendType(3)">物流</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><text style="color:red;">首次下单,请联系客服确认是否在配送范围</text></view>
|
|
|
+ <view v-if="ghsInfo.shopId && ghsInfo.shopId == 520"><text style="color:red;font-weight:bold">免费配送每天晚23:30发车,其它时间请用跑腿或自取</text></view>
|
|
|
+ <view v-if="ghsInfo.shopId && ghsInfo.shopId == 520"><text style="color:red;font-weight:bold">免费配送仅送货到楼下,不支持送货上楼</text></view>
|
|
|
+ </view>
|
|
|
+ <view v-if="form.sendType == 1">
|
|
|
+ <text style="color: #3385FF;width:100%;">到店自取,没有运费</text>
|
|
|
+ </view>
|
|
|
+ <view v-if="form.sendType == 3">
|
|
|
+ <text style="color: #3385FF;width:100%;">发物流,运费到付</text>
|
|
|
+ </view>
|
|
|
+ <view v-if="form.sendType == 4">
|
|
|
+ <text style="color: #3385FF;width:100%;">运费到付</text>
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <block v-if="$util.isEmpty(wlList)">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" v-if="form.sendType == 3">
|
|
|
+ <view class="tui-title">配送物流</view>
|
|
|
+ <input type="text" placeholder="请填选物流" v-model="form.wlName" @focus="form.wlName=''" placeholder-class="tui-placeholder"/>
|
|
|
+ </tui-list-cell>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <tui-list-cell class="line-cell" :arrow="true" v-if="form.sendType == 3">
|
|
|
+ <div class="tui-title">配送物流</div>
|
|
|
+ <picker mode="selector" :value="form.wlId" :range="wlList" range-key="name" @change="changeWlFn" class="tui-input" >
|
|
|
+ <div v-if="form.wlId">{{ wlSelData.name }}</div>
|
|
|
+ <div class="tui-placeholder" v-else>请选择</div>
|
|
|
+ </picker>
|
|
|
+ </tui-list-cell>
|
|
|
+ </block>
|
|
|
+
|
|
|
+</block>
|
|
|
+
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="displayAddress == true" @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-if="form.sendType == 3">
|
|
|
- <text style="color: #3385FF;width:100%;">发物流,运费到付</text>
|
|
|
+ <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 == 3">
|
|
|
- <view class="tui-title ">配送物流</view>
|
|
|
- <input type="text" placeholder="请填写物流" v-model="form.wlName" @focus="form.wlName=''" placeholder-class="tui-placeholder"/>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" v-if="displaySendCost == true">
|
|
|
+ <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="needAddPackCost == true">
|
|
|
+ <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">
|
|
|
@@ -80,11 +137,6 @@
|
|
|
</picker>
|
|
|
</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="false">
|
|
|
<textarea style="height: 100upx" v-model="remark" placeholder="这里写备注..."/>
|
|
|
</tui-list-cell>
|
|
|
@@ -115,10 +167,11 @@ import appFormSend from "@/components/app-form-send";
|
|
|
import appSendTime from "@/components/app-send-time";
|
|
|
const formUtil = require("@/utils/formValidation.js");
|
|
|
import AppDatePicker from "@/components/app-date-picker";
|
|
|
-import { getGhsDataApi } from "@/api/ghs/index";
|
|
|
-import { freight,createOrder } from "@/api/purchase/index";
|
|
|
+import { getGhsDataApi,getWlList } from "@/api/ghs";
|
|
|
+import { freight,createOrder } from "@/api/purchase";
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
import { shopHouponHas } from '@/api/coupon'
|
|
|
+import {currentShop} from "@/api/shop"
|
|
|
export default {
|
|
|
name: "affirmGhsBook",
|
|
|
components: {
|
|
|
@@ -167,25 +220,69 @@ export default {
|
|
|
today:'',
|
|
|
monthLater:'',
|
|
|
hasHb:0,
|
|
|
- selectedHb:{couponAmount:0,hbId:0,couponSelInx:0}
|
|
|
+ selectedHb:{couponAmount:0,hbId:0,couponSelInx:0},
|
|
|
+ needAddPackCost:false,
|
|
|
+ lackExpend:0,
|
|
|
+ wlList:[],
|
|
|
+ wlSelData: {id:0,name:''},
|
|
|
+ shopInfo:{
|
|
|
+ lat:'',
|
|
|
+ long:'',
|
|
|
+ fullAddress:'',
|
|
|
+ showAddress:''
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
this.getGhsData(e.id);
|
|
|
+ this.changeTransType(0)
|
|
|
},
|
|
|
onShow() {
|
|
|
-
|
|
|
+ if(this.form.sendType == 2){
|
|
|
+ //计算运费
|
|
|
+ this.calcFreight()
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(["getMerchantInfo", "getLoginInfo"]),
|
|
|
+ ...mapGetters(["getMerchantInfo", "getLoginInfo","getDictionariesInfo"]),
|
|
|
+ displayAddress(){
|
|
|
+ if(this.form.sendType == 2){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if(this.ghsInfo.pfLevel && this.ghsInfo.pfLevel == 1){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
+ displaySendCost(){
|
|
|
+ if(this.form.sendType == 2){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if(this.ghsInfo.pfLevel && this.ghsInfo.pfLevel == 1){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
modifyPrice(){
|
|
|
let allPrice = this.allPrice.toFixed(2)
|
|
|
let price = Number(allPrice)
|
|
|
- if(this.form.sendType == 2){
|
|
|
+ if(this.displaySendCost == true){
|
|
|
price = price + this.form.sendCost
|
|
|
}
|
|
|
- if(this.form.sendType == 2 || this.form.sendType == 0){
|
|
|
+ this.needAddPackCost = false
|
|
|
+ if(this.ghsInfo.pfLevel && this.ghsInfo.pfLevel == 1){
|
|
|
+ //昆明发全国
|
|
|
+ this.needAddPackCost = true
|
|
|
price = price + this.form.packCost
|
|
|
+ }else{
|
|
|
+ //同城配送
|
|
|
+ if(this.form.sendType == 4){
|
|
|
+ //设置了订单金额低200需要付包装费,当前只付一次
|
|
|
+ if(Number(this.lackExpend) > 0 && allPrice < Number(this.lackExpend)){
|
|
|
+ price = price + this.form.packCost
|
|
|
+ this.needAddPackCost = true
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
price = parseFloat(price)
|
|
|
return price
|
|
|
@@ -193,8 +290,80 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
+ modifyAddress(){
|
|
|
+ this.$util.pageTo({ url: '/admin/shop/add?id='+this.getLoginInfo.admin.currentShopId})
|
|
|
+ },
|
|
|
init() {
|
|
|
- this._getDet()
|
|
|
+ let that = this
|
|
|
+
|
|
|
+ this.getDetailData()
|
|
|
+
|
|
|
+ currentShop().then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.shopInfo = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ getWlList({id:this.option.id}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.wlList = res.data.list ? res.data.list : []
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeTransType(num){
|
|
|
+ let that = this
|
|
|
+ this.form.transType = num
|
|
|
+ if(this.getDictionariesInfo.transCost && !this.$util.isEmpty(this.getDictionariesInfo.transCost)){
|
|
|
+ let weight = this.allCountFun.weight ? Number(this.allCountFun.weight) : 0
|
|
|
+ for (const ele of this.getDictionariesInfo.transCost) {
|
|
|
+ if(ele.sign == num){
|
|
|
+ if(num == 2){
|
|
|
+ let llOption = ele.option ? ele.option : ''
|
|
|
+ if(!this.$util.isEmpty(llOption)){
|
|
|
+ for (const llEle of llOption) {
|
|
|
+ if(Number(llEle.num)>=weight){
|
|
|
+ this.form.sendCost = llEle.amount?llEle.amount:0
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ let perKiloCost = ele.perKiloCost?Number(ele.perKiloCost):0
|
|
|
+ let sendCost = weight*perKiloCost
|
|
|
+ sendCost = parseFloat(sendCost.toFixed(2))
|
|
|
+ this.form.sendCost = sendCost
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
changeSendType(num){
|
|
|
this.form.sendType = num
|
|
|
@@ -225,12 +394,13 @@ export default {
|
|
|
getGhsDataApi({id:id}).then(res => {
|
|
|
that.ghsInfo = res.data;
|
|
|
that.form.wlName = res.data.customWlName ? res.data.customWlName : ''
|
|
|
+ that.lackExpend = res.data.lackExpend?parseFloat(res.data.lackExpend):0
|
|
|
});
|
|
|
},
|
|
|
countAllPrices(e){
|
|
|
this.allPrices = this.allPrices+Number(this.form.sendCost)
|
|
|
},
|
|
|
- _getDet() {
|
|
|
+ getDetailData() {
|
|
|
let data = uni.getStorageSync("modifyShopB")
|
|
|
if (this.$util.isEmpty(data)){
|
|
|
return
|
|
|
@@ -482,13 +652,12 @@ export default {
|
|
|
}
|
|
|
.describe-view {
|
|
|
display: flex;
|
|
|
-
|
|
|
align-items: center;
|
|
|
color: #333;
|
|
|
font-size: 24upx;
|
|
|
.price {
|
|
|
font-weight: bold;
|
|
|
- font-size: 36upx;
|
|
|
+ font-size: 30upx;
|
|
|
}
|
|
|
}
|
|
|
}
|