shish 3 лет назад
Родитель
Сommit
34807f1136

+ 96 - 43
hdApp/src/admin/billing/affirmGhs.vue

@@ -53,22 +53,44 @@
 
 				<view class="module-com input-line-wrap">
 
-					<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 class="line-cell" :hover="false" :arrow="false" >
+						<button class="admin-button-com big" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:230upx;"  @click="form.sendType = 1">自取</button>
+						<button class="admin-button-com big" :class="[form.sendType == 3 ? 'blue' : 'default']" style="width:230upx;" @click="form.sendType = 3">跑腿</button>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
+						<view v-if="form.sendType == 1">
+							<text style="color: #3385FF;width:100%;">出车有经过或到店拿货的花店,免运费,请选【自取】</text>
+						</view>				
+						<view v-else>
+							<text style="width:100%;color:#CCCCCC;">使用跑腿,需要配送费</text>
+						</view>
+					</tui-list-cell>
 
+					<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 3" @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>
+						<input v-else v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" @focus="form.name=''" placeholder="请完善门店地址" maxlength="50" type="text" />
 					</tui-list-cell>
 
-          			<tui-list-cell v-if="hasHb == 1" class="line-cell" :hover="false" :arrow="true" @click="goSelectCoupon">
-						<view class="tui-title ">红包</view>
-						<view class="coupon_box"><text class="selected" v-if="selectedHb.hbId && selectedHb.hbId>0">-{{selectedHb.couponAmount}}</text><text class="has-hb" v-else>有红包</text></view>
+					<tui-list-cell class="line-cell" :hover="false" v-if="form.sendType == 3 && 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" :arrow="false" >
 						<view class="tui-title">总金额</view>
-						<text style="color: #3385FF">{{ modifyPrice }}</text>
+						<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">
@@ -118,9 +140,10 @@ 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 { freight,createOrder } from "@/api/purchase";
 import { mapActions, mapGetters } from "vuex";
 import { shopHouponHas } from '@/api/coupon'
+import {currentShop} from "@/api/shop"
 import ModalModule from "@/components/plugin/modal";
 export default {
 	name: "BillingAffirm", // 开单确认
@@ -158,11 +181,11 @@ export default {
 				receiveAddress: "",
 				receiveLong: "",
 				receiveLat: "",
-				sendType: 2,
+				sendType: 1,
 				sendSide: "2",
 				sendDate: "",
 				sendTimeWant: "",
-				sendCost: "",
+				sendCost: 0,
 				customId: "",
 				product: "",
         		hbId: '0'
@@ -175,6 +198,13 @@ export default {
 			customData: {
 				bigCount: 0,
 				smallCount: 0
+			},
+			sendData:{},
+			shopInfo:{
+				lat:'',
+				long:'',
+				fullAddress:'',
+				showAddress:''
 			}
 		};
 	},
@@ -188,18 +218,30 @@ export default {
 			this.form.hbId = 0
 			this.hasCoupon()
 		}
+
+		//计算运费
+		this.calcFreight()
+
 	},
 	computed: {
 		...mapGetters(["getMerchantInfo", "getLoginInfo"]),
 		modifyPrice(){
 			let allPrice = this.allPrice.toFixed(2)
 			let price = Number(allPrice)
+
+			if(this.form.sendType == 3){
+				price = price + this.form.sendCost
+			}
+
 			price = parseFloat(price)
 			return price
 		}
 	},
 	methods: {
 		...mapActions(["initMerchantInfo"]),
+		modifyAddress(){
+      		this.$util.pageTo({ url: '/admin/shop/add?id='+this.getLoginInfo.admin.currentShopId})
+		},
 		customUpdate(item) {
 			if(item.variety == 0){
 				if(item.stock<=0){
@@ -285,7 +327,42 @@ export default {
 
 		},
 		init() {
-			this._getDet()
+			this.getDetailData()
+
+			currentShop().then(res=>{
+				let that = this
+				if(res.code == 1){
+					that.shopInfo = res.data
+				}
+			})
+			//计算运费
+			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
+				}
+			});
 		},
 		addEvents(item) {
 			if(item.variety == 0){
@@ -321,12 +398,6 @@ export default {
 				phoneNumber: phone
 			});
 		},
-		goSelectCoupon() {
-			let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
-			let query = {amount:amount,ghsId:this.option.id,...this.selectedHb}
-			this.pageTo({url: '/admin/coupon/selectCouponList',query:query})
-		},
-		// 是否有可用红包
 		hasCoupon() {
 			let amount = this.allPrice
 			shopHouponHas({amount:amount,ghsId:this.option.id}).then(res => {
@@ -341,7 +412,7 @@ export default {
 		countAllPrices(e){
 			this.allPrices = this.allPrices+Number(this.form.sendCost)
 		},
-		_getDet() {
+		getDetailData() {
 			let data = uni.getStorageSync("modifyShopB")
 			if (this.$util.isEmpty(data)){
 				return
@@ -350,25 +421,6 @@ export default {
 				this.form[i] = data[i];
 			});
 		},
-		purchaseFreight(info) {
-			const product = this.selectList.map(ele => {
-				return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
-			});
-			let params = {
-				ghsId: this.options.id,
-				product: JSON.stringify(product),
-				province: info.province,
-				city:info.city,
-				address:info.address,
-				floor:info.floor,
-				long: info.long,
-				lat: info.lat,
-				sendTimeWant: this.sendTimeWant,
-			};
-			freight(params).then(res => {
-				this.form.sendCost = res.data.sedCost;
-			});
-		},
 		confirmFn(options) {
 			createOrder(options).then(res => {
 				this.resetSelectInfoByType(this.pageType);
@@ -386,7 +438,7 @@ export default {
 		},
 		affirmFormSubmit(){
 			const product = this.selectList.map(ele => {
-				return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
+				return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId,weight:ele.weight };
 			})
 
 			let xj = []
@@ -398,9 +450,10 @@ export default {
 			})
 	
 			let params = {
-				getType:this.form.sendType,
+				getType:this.form.sendType == 1 ? 2 : 1,
 				sendTimeWant:this.sendTimeWant,
-				sendCost:this.form.sendType==2?'':this.form.sendCost,
+				sendCost:this.form.sendCost,
+				sendType:this.form.sendType,
 				remark:this.remark,
 				product:JSON.stringify(product),
 				ghsId:this.ghsInfo.id,
@@ -486,7 +539,7 @@ export default {
 			}
 		},
 		gobackEvent() {
-			this.$util.pageTo({url: "/pagesPurchase/ghsProduct",query: {id:this.options.id},type: 2})
+			this.$util.pageTo({url: "/pagesPurchase/ghsProduct?id="+this.options.id,type: 2})
 		}
 	}
 };

+ 45 - 36
hdApp/src/admin/shop/add.vue

@@ -77,7 +77,7 @@
 					<input v-model="form.province" name="province" hidden />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
-					<view class="tui-title">地址</view>
+					<view class="tui-title">所在地址</view>
 					<view class="tui-input" v-if="form.address">{{ form.address }}</view>
 					<view class="tui-placeholder" v-else>请填写详细地址</view>
 					<input v-model="form.address" name="address" hidden />
@@ -126,6 +126,7 @@ import SimpleAddress from '@/components/plugin/simple-address'
 import AppAreaSel from '@/components/app-area-sel'
 const form = require('@/utils/formValidation.js')
 import {mapActions} from "vuex";
+import {getDetail} from "@/api/shop"
 import { updateShop as update, addShop as add } from '@/api/shop'
 //图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
 import htzImageUpload from './components/htz-image-upload/htz-image-upload.vue'
@@ -177,7 +178,7 @@ export default {
 	onLoad() {
 		const token = uni.getStorageSync('token')
 		this.headers.token = token
-		this._getDet()
+		this.getShopInfo()
 	},
 	onShow() {
 		if (this.option.id) {
@@ -207,39 +208,42 @@ export default {
 			this.form.superWx.splice(index,1)
 			this.currentImgData.splice(index,1)
 		},
-		_getDet() {
-			let data = uni.getStorageSync('currentShopInfo')
-			if (this.$util.isEmpty(data)){
-				return
-			} 
-			Object.keys(this.form).forEach((i, index) => {
-				this.form[i] = data[i]
-			})
-			this.region.lat = data.lat
-			this.region.long = data.long
+		getShopInfo() {
+			if(this.option.id && !this.$util.isEmpty(this.option.id)){
+				getDetail({shopId:this.option.id}).then(res=>{
+					let data = res.data.info
+					if (this.$util.isEmpty(data)){
+						return
+					} 
+					Object.keys(this.form).forEach((i, index) => {
+						this.form[i] = data[i]
+					})
+					this.region.lat = data.lat
+					this.region.long = data.long
 
-			// 营业时间初始化
-			this.visible = this.form.open == 1 ? true : false
-			this.openTimeVisible = true
-			this.form.openType = 1
-			this.start_time = this.form.openStartTime
-			this.end_time = this.form.openEndTime
-			if (data.openStartTime == '') {
-				this.openTimeVisible = false
-				this.form.openType = 0
-				this.start_time = '09:00'
-				this.form.openStartTime = this.start_time
-			}
-			if (data.openEndTime == '') {
-				this.end_time = '18:00'
-				this.form.openEndTime = this.end_time
-			}
+					// 营业时间初始化
+					this.visible = this.form.open == 1 ? true : false
+					this.openTimeVisible = true
+					this.form.openType = 1
+					this.start_time = this.form.openStartTime
+					this.end_time = this.form.openEndTime
+					if (data.openStartTime == '') {
+						this.openTimeVisible = false
+						this.form.openType = 0
+						this.start_time = '09:00'
+						this.form.openStartTime = this.start_time
+					}
+					if (data.openEndTime == '') {
+						this.end_time = '18:00'
+						this.form.openEndTime = this.end_time
+					}
 
-			if(!this.$util.isEmpty(data.shortSuperWx)){
-				this.currentImgData.push(data.superWx)
-				this.form.superWx = [data.shortSuperWx]
+					if(!this.$util.isEmpty(data.shortSuperWx)){
+						this.currentImgData.push(data.superWx)
+						this.form.superWx = [data.shortSuperWx]
+					}
+				})
 			}
-
 		},
 		openChange(e) {
 			this.visible = e.target.value ? true : false
@@ -311,9 +315,14 @@ export default {
 				let promptText = this.option.id ? '修改成功!' : '添加成功!'
 				this.$msg(promptText)
 				uni.removeStorageSync('currentShopInfo')
-				setTimeout(() => {
-					this.$util.pageTo(1)
-				}, 1000)
+
+				//返回上一页带参数
+				let pages = getCurrentPages();
+				let prevPage = pages[ pages.length - 2 ];
+				//修改上一页data里面的sendData
+				//prevPage.$vm.sendData = {hasUpdate:1,id:item.id,fullAddress:item.fullAddress,showAddress:item.showAddress}
+				uni.navigateBack({})
+
 			})
 		},
 		// 表单验证
@@ -394,7 +403,7 @@ export default {
 		bottom:0upx;
 		width: calc(100% - 60upx);
 		margin: 60upx 30upx 0upx;
-		z-index:99999;
+		z-index:99;
 		.admin-button-com {
 			width: 100%;
 		}

+ 227 - 0
hdApp/src/admin/shop/addressAdd.vue

@@ -0,0 +1,227 @@
+<template>
+  <view class="app-delivery-module">
+
+    <form @submit="formSubmit">
+
+    <view class="module-com">
+
+        <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectCityFn">
+          <view class="tui-title">所在城市</view>
+          <view class="tui-input" v-if="form.province || form.city" >{{ form.province + '-' + form.city }}</view> <view class="tui-placeholder" v-else>请选择</view>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
+          <view class="tui-title">所在地址</view>
+          <view class="tui-input" v-if="form.address">{{ form.address }}</view>
+          <view class="tui-placeholder" v-else>请填写地址</view>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">门牌号</view>
+          <input v-model="form.floor" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="floor" placeholder="楼号门牌号(选填)" />
+        </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">默认地址</div>
+            <view><switch style="transform:scale(0.7,0.7)" :checked="form.default == 0 ? false : true" @change="defaultChangeFn" /></view>
+          </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">备注</view>
+            <input v-model="form.remark" placeholder-class="phcolor" class="tui-input" placeholder-style="color:#ccc" name="remark" placeholder="选填" />
+        </tui-list-cell>
+
+
+        <div style="text-align:center;margin-top:10upx;">
+        <button class="admin-button-com default big" style="width:230upx;margin-right:60upx;">取消</button>
+            <button class="admin-button-com blue big" style="width:230upx;" formType="submit">确认</button>
+        </div>
+
+    </view>
+
+    </form>
+
+    <!-- 省市联动 -->
+    <simple-address ref="simpleAddress" :region="regionTree" :pickerValueDefault="cityPickerValueDefault" @onConfirm="getCityConfirm" ></simple-address>
+
+    <!-- 选择详细地址 -->
+    <app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
+
+  </view>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import TuiListCell from "@/components/plugin/list-cell";
+import AppDatePicker from "@/components/app-date-picker";
+import SimpleAddress from "@/components/plugin/simple-address";
+import AppAreaSel from "@/components/app-area-sel";
+import AppBindInfo from "@/components/app-bind-info";
+import {getShop} from "@/api/common"
+import {getRegion} from "@/api/shop"
+import {addAddress} from "@/api/address"
+export default {
+  name: "app-delivery-module",
+  components: {
+    AppAreaSel,
+    TuiListCell,
+    AppDatePicker,
+    SimpleAddress,
+    AppBindInfo
+  },
+	props: {
+		info: {
+			type: Object,
+			default: {}
+		},
+  },
+  data() {
+    return {
+      fillMobile:0,
+      region: [],
+      showRegion: false,
+      form: {
+        province: "",
+        city: "",
+        address: "",
+        showAddress:"",
+        floor: "",
+        fullAddress: "",
+        remark: "",
+        lat:'',
+        long:'',
+        default:0
+      },
+      region: {latitude: 0,longitude: 0},
+      regionTree:[],
+      cityPickerValueDefault: [0, 0],
+      timeOptions: [
+			['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],
+			['00', '05', '10','15','20','25','30','35','40','45','50','55']
+		],
+    };
+  },
+  mounted() {
+    let that = this
+    getRegion().then(res=>{
+      if(res.code == 1){
+        that.regionTree = res.data.region
+        getShop().then(res=>{
+          if(res.code == 1){
+            if(res.data.info){
+              that.form.province = res.data.info.province
+              that.form.city = res.data.info.city
+            }
+          }
+        })
+      }
+    })
+  },
+  methods: {
+    defaultChangeFn(e) {
+      this.form.default = e.detail.value ? 1 : 0;
+    },
+    formSubmit () {
+        let that = this
+        if (this.$util.isEmpty(this.form.address)){
+          this.$msg('请填写所在地址')
+          return false
+        }
+        if (this.$util.isEmpty(this.form.lat) || this.$util.isEmpty(this.form.long)){
+          this.$msg('请填写所在地址')
+          return false
+        }
+        addAddress(this.form).then(res=>{
+          if(res.code == 1){
+            that.$msg(res.msg)
+            setTimeout(function(){
+              uni.navigateBack()
+            },1500)
+          }
+        })
+    },
+    selRegionFn() {
+      if (!this.form.city) {
+        this.$msg("请选择城市");
+        return false;
+      }
+      this.showRegion = true;
+    },
+    changeAreaFn(e) {
+      this.form.address = e.title;
+      this.form.showAddress = e.address;
+      this.form.lat = e.location.lat;
+      this.form.long = e.location.lng;
+    },
+    selectCityFn() {
+      this.$refs.simpleAddress.open();
+    },
+    getCityConfirm(e) {
+      this.form.province = e.provinceName;
+      this.form.city = e.cityName;
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-delivery-module {
+  .module-com {
+    margin-bottom: 20upx;
+    background-color: #fff;
+    .module-tit {
+      padding: 20upx 18upx;
+      font-size: 28upx;
+      font-weight: 600;
+      border-bottom: 1px solid $borderColor;
+    }
+    .module-det {
+      padding: 0 30upx;
+    }
+  }
+  // 公共
+  .line-cell {
+    .tui-title {
+      width: 210upx;
+      color: $fontColor2;
+    }
+    .tui-input {
+      width: calc(100% - 210upx);
+      font-size: 28upx;
+    }
+    .tui-placeholder {
+      color: #ccc;
+    }
+    .phcolor {
+      color: #ccc;
+    }
+  }
+  .delivery-time {
+    @include disFlex(center, center);
+    .button-com {
+      padding-top: 14upx;
+      padding-bottom: 10upx;
+      margin-right:10upx;
+    }
+  }
+  .gift-wrap {
+    .gift-content {
+      width: 100%;
+    }
+    .need-gift {
+      margin-left: 14upx;
+      color: $fontColor2;
+    }
+    .gitf-textarea {
+      margin-top: 40upx;
+    }
+  }
+  .none-name-delivery {
+    margin-bottom: 20upx;
+    background-color: #fff;
+    .none-name-text {
+      margin-left: 10upx;
+      color: $fontColor2;
+    }
+  }
+}
+</style>

+ 244 - 0
hdApp/src/admin/shop/addressList.vue

@@ -0,0 +1,244 @@
+<template>
+	<view class="app-main app-content">
+        <view class="list-wrap staff-list">
+            <block v-if="!$util.isEmpty(list.data)">
+                <view class="list" v-for="(item, index) in list.data" :key="index">
+                    <view class="list-det" @click="select(item)">
+                        <view class="list-det-left">
+                            <view>
+                                <span class="staff-name">{{ item.fullAddress }}</span>
+                            </view>
+                            <view></view>
+                            <view>
+                                <view class="status-list">
+                                    <span>{{ item.showAddress }}</span>
+                                </view>
+                            </view>
+                            <view style="margin-top:10upx;color:#3385FF" v-if="item.default == 1">
+                                <view>
+                                    <span>默认地址</span>
+                                </view>
+                            </view>
+                        </view>
+                        <view class="list-det-right">
+                            <view @click.stop="delAddressFn(item)" style="margin-right:70upx;">
+                                <i class="iconfont iconshanchu1"></i>
+                            </view>
+                            <view @click.stop="updateAddress(item)">
+                                <i class="iconfont iconbianji"></i>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </block>
+            <block v-else>
+                <app-wrapper-empty title="暂无地址" :is-empty="$util.isEmpty(list.data)" />
+            </block>
+        </view>
+        <!-- 按钮 -->
+        <view class="app-footer">
+            <view class="admin-button-com big blue" @click="pageTo({url: '/admin/shop/addressAdd'})">添加新地址</view>
+        </view>
+	</view>
+</template>
+<script>
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
+import ModalModule from '@/components/plugin/modal'
+import { list } from '@/mixins'
+import { mapGetters } from "vuex"
+import { getAddressList,delAddress } from '@/api/address'
+export default {
+	name: 'list',
+	components: {
+		AppWrapperEmpty,
+		ModalModule
+	},
+	mixins: [list],
+	data() {
+		return {
+
+		}
+	},
+	onPullDownRefresh() {
+		this.resetList()
+		this.getAddressData().then(res => {
+			uni.stopPullDownRefresh()
+		})
+	},
+	computed: {
+		...mapGetters({ loginInfo: "getLoginInfo" }),
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.getAddressData().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		} else {
+			uni.stopPullDownRefresh()
+		}
+	},
+	onShow(){
+		this.getAddressData()
+	},
+	methods: {
+		select(item){
+
+			//返回上一页带参数
+			let pages = getCurrentPages();
+			let prevPage = pages[ pages.length - 2 ];
+			//修改上一页data里面的xjData
+			prevPage.$vm.sendData = {hasUpdate:1,id:item.id,fullAddress:item.fullAddress,showAddress:item.showAddress}
+			uni.navigateBack({});
+
+		},
+		updateAddress(item){
+			this.$util.pageTo({url: '/admin/shop/addressUpdate?id='+item.id})
+		},
+		async init() {
+			this.getAddressData()
+		},
+		getAddressData() {
+			return getAddressList().then(res => {
+				this.completes(res)
+			})
+		},
+		delAddressFn(item) {
+			let that = this
+			that.$util.confirmModal({content:'确认删除?'},() => {
+				delAddress({id:item.id}).then(res=>{
+					if(res.code == 1){
+						that.$msg('删除成功')
+					}
+				})
+			})
+		}
+	}
+}
+</script>
+<style lang="scss" scoped>
+	.app-content {
+		padding-bottom: 20upx;
+	}
+	.app-tabs {
+		position: fixed;
+		@media screen and (max-width: 1100px) {
+			width: 100%;
+		}   
+		z-index: 9;
+	}
+	.input-wrap_box {
+		background-color: #fff;
+		position: fixed;
+		top: 0;
+		z-index: 10;
+		@media screen and (max-width: 1100px) {
+			width: 100%;
+		} 
+		height: 100upx;
+		display: flex;
+		align-items: center;
+		padding: 0 30upx;
+		& > view:nth-child(1) {
+		flex: 1;
+		}
+	}
+	.list-wrap {
+		background-color: #fff;
+		.list {
+			@include disFlex(center, flex-start);
+			margin: 0 0upx 0 30upx;
+			padding: 30upx 0;
+			border-bottom: 2upx solid $borderColor;
+		}
+	}
+	.staff-list {
+		.list-det {
+			width: calc(100% - 110upx);
+			color: $fontColor3;
+			margin-left: 20upx;
+			@include disFlex(center, space-between);
+			.list-det-left {
+				.staff-name {
+					color: #333;
+					font-size: 30upx;
+					font-weight: 600;
+					margin-right: 10upx;
+					display: inline-block;
+					overflow: hidden;
+					text-overflow:ellipsis;
+					white-space: nowrap;
+					width:410upx;
+				}
+				.flex-center {
+					margin-top: 10upx;
+				}
+				.status-list {
+					.iconfont {
+						font-size: 24upx;
+						margin-right: 10upx;
+					}
+				}
+			}
+			.list-det-right {
+				@include disFlex(center, flex-start);
+				.iconfont {
+					font-size: 36upx;
+					color: $fontColor3;
+				}
+			}
+		}
+	}
+	// 角色管理
+	.role-list {
+		.list {
+			justify-content: space-between;
+		}
+		.role-option {
+			@include disFlex(center, flex-start);
+			& > view {
+				margin-left: 50upx;
+				&:first-child {
+					margin-left: 0;
+				}
+			}
+			.iconfont {
+				font-size: 36upx;
+				color: $fontColor3;
+			}
+		}
+	}
+	// 操作记录
+	.axis-wrap {
+		position: relative;
+		padding: 30upx 30upx 30upx 40upx;
+		background-color: #fff;
+		.axis-list {
+			&:last-child .axis-det {
+				margin-bottom: 0;
+			}
+		}
+		.axis-title {
+			font-size: 30upx;
+			font-weight: 600;
+			margin-bottom: 14upx;
+		}
+		.axis-det {
+			color: $fontColor2;
+			margin-bottom: 40upx;
+			& > view {
+				margin-top: 6upx;
+				&:first-child {
+					margin-top: 0;
+				}
+			}
+		}
+	}
+	// 按钮
+	.app-footer {
+		justify-content: flex-end;
+		.admin-button-com {
+			width: 260upx;
+			margin-right: 30upx;
+		}
+	}
+</style>

+ 245 - 0
hdApp/src/admin/shop/addressUpdate.vue

@@ -0,0 +1,245 @@
+<template>
+  <view class="app-delivery-module">
+
+    <form @submit="formSubmit">
+
+    <view class="module-com">
+
+        <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectCityFn">
+          <view class="tui-title">所在城市</view>
+          <view class="tui-input" v-if="form.province || form.city" >{{ form.province + '-' + form.city }}</view> <view class="tui-placeholder" v-else>请选择</view>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
+          <view class="tui-title">所在地址</view>
+          <view class="tui-input" v-if="form.address">{{ form.address }}</view>
+          <view class="tui-placeholder" v-else>请填写地址</view>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">门牌号</view>
+          <input v-model="form.floor" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="floor" placeholder="楼号门牌号(选填)" />
+        </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">默认地址</div>
+            <view><switch style="transform:scale(0.7,0.7)" :checked="form.default == 0 ? false : true" @change="defaultChangeFn" /></view>
+          </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">备注</view>
+            <input v-model="form.remark" placeholder-class="phcolor" class="tui-input" placeholder-style="color:#ccc" name="remark" placeholder="选填" />
+        </tui-list-cell>
+
+
+        <div style="text-align:center;margin-top:10upx;">
+        <button class="admin-button-com default big" style="width:230upx;margin-right:60upx;">取消</button>
+            <button class="admin-button-com blue big" style="width:230upx;" formType="submit">确认</button>
+        </div>
+
+    </view>
+
+    </form>
+
+    <!-- 省市联动 -->
+    <simple-address ref="simpleAddress" :region="regionTree" :pickerValueDefault="cityPickerValueDefault" @onConfirm="getCityConfirm" ></simple-address>
+
+    <!-- 选择详细地址 -->
+    <app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
+
+  </view>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import TuiListCell from "@/components/plugin/list-cell";
+import AppDatePicker from "@/components/app-date-picker";
+import SimpleAddress from "@/components/plugin/simple-address";
+import AppAreaSel from "@/components/app-area-sel";
+import AppBindInfo from "@/components/app-bind-info";
+import {getShop} from "@/api/common"
+import {getRegion} from "@/api/shop"
+import {updateAddress,getDetail} from "@/api/address"
+export default {
+  name: "app-delivery-module",
+  components: {
+    AppAreaSel,
+    TuiListCell,
+    AppDatePicker,
+    SimpleAddress,
+    AppBindInfo
+  },
+	props: {
+		info: {
+			type: Object,
+			default: {}
+		},
+  },
+  data() {
+    return {
+      fillMobile:0,
+      region: [],
+      showRegion: false,
+      form: {
+        id:0,
+        province: "",
+        city: "",
+        address: "",
+        showAddress:"",
+        floor: "",
+        fullAddress: "",
+        remark: "",
+        lat:'',
+        long:'',
+        default:0
+      },
+      region: {latitude: 0,longitude: 0},
+      regionTree:[],
+      cityPickerValueDefault: [0, 0],
+      timeOptions: [
+			['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],
+			['00', '05', '10','15','20','25','30','35','40','45','50','55']
+		],
+    };
+  },
+  mounted() {
+    let that = this
+    getRegion().then(res=>{
+      if(res.code == 1){
+        that.regionTree = res.data.region
+        getShop().then(res=>{
+          if(res.code == 1){
+            if(res.data.info){
+              that.form.province = res.data.info.province
+              that.form.city = res.data.info.city
+            }
+          }
+        })
+      }
+    })
+  },
+  methods: {
+    init(){
+        getDetail({id:this.option.id}).then(res=>{
+            if(res.code == 1){
+                this.form.id = res.data.info.id
+                this.form.province = res.data.info.province
+                this.form.city = res.data.info.city
+                this.form.address = res.data.info.address
+                this.form.showAddress = res.data.info.showAddress
+                this.form.floor = res.data.info.floor
+                this.form.fullAddress = res.data.info.fullAddress
+                this.form.remark = res.data.info.remark
+                this.form.lat = res.data.info.lat
+                this.form.long = res.data.info.long
+                this.form.default = res.data.info.default
+            }
+        })
+    },
+    defaultChangeFn(e) {
+      this.form.default = e.detail.value ? 1 : 0;
+    },
+    formSubmit () {
+        let that = this
+        if (this.$util.isEmpty(this.form.address)){
+          this.$msg('请填写所在地址')
+          return false
+        }
+        if (this.$util.isEmpty(this.form.lat) || this.$util.isEmpty(this.form.long)){
+          this.$msg('请填写所在地址')
+          return false
+        }
+        updateAddress(this.form).then(res=>{
+          if(res.code == 1){
+            that.$msg(res.msg)
+            setTimeout(function(){
+              uni.navigateBack()
+            },1500)
+          }
+        })
+    },
+    selRegionFn() {
+      if (!this.form.city) {
+        this.$msg("请选择城市");
+        return false;
+      }
+      this.showRegion = true;
+    },
+    changeAreaFn(e) {
+      this.form.address = e.title;
+      this.form.showAddress = e.address;
+      this.form.lat = e.location.lat;
+      this.form.long = e.location.lng;
+    },
+    selectCityFn() {
+      this.$refs.simpleAddress.open();
+    },
+    getCityConfirm(e) {
+      this.form.province = e.provinceName;
+      this.form.city = e.cityName;
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-delivery-module {
+  .module-com {
+    margin-bottom: 20upx;
+    background-color: #fff;
+    .module-tit {
+      padding: 20upx 18upx;
+      font-size: 28upx;
+      font-weight: 600;
+      border-bottom: 1px solid $borderColor;
+    }
+    .module-det {
+      padding: 0 30upx;
+    }
+  }
+  // 公共
+  .line-cell {
+    .tui-title {
+      width: 210upx;
+      color: $fontColor2;
+    }
+    .tui-input {
+      width: calc(100% - 210upx);
+      font-size: 28upx;
+    }
+    .tui-placeholder {
+      color: #ccc;
+    }
+    .phcolor {
+      color: #ccc;
+    }
+  }
+  .delivery-time {
+    @include disFlex(center, center);
+    .button-com {
+      padding-top: 14upx;
+      padding-bottom: 10upx;
+      margin-right:10upx;
+    }
+  }
+  .gift-wrap {
+    .gift-content {
+      width: 100%;
+    }
+    .need-gift {
+      margin-left: 14upx;
+      color: $fontColor2;
+    }
+    .gitf-textarea {
+      margin-top: 40upx;
+    }
+  }
+  .none-name-delivery {
+    margin-bottom: 20upx;
+    background-color: #fff;
+    .none-name-text {
+      margin-left: 10upx;
+      color: $fontColor2;
+    }
+  }
+}
+</style>

+ 1 - 2
hdApp/src/admin/shop/list.vue

@@ -82,8 +82,7 @@ export default {
 			})
 		},
 		toModiyFn(item) {
-			uni.setStorageSync('currentShopInfo', item)
-			this.pageTo({ url: '/admin/shop/add', query: { id: item.id } })
+			this.pageTo({ url: '/admin/shop/add?id='+item.id})
 		},
 		// 收款码
 		downQrCodeFn(item, index) {

+ 21 - 0
hdApp/src/api/address/index.js

@@ -0,0 +1,21 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const getDetail = data => {
+	return https.get('/address/detail', data)
+}
+
+export const delAddress = data => {
+	return https.get('/address/del', data)
+}
+
+export const getAddressList = data => {
+	return https.get('/address/list', data)
+}
+
+export const addAddress = data => {
+	return https.post('/address/add', data)
+}
+
+export const updateAddress = data => {
+	return https.post('/address/update', data)
+}

+ 1 - 1
hdApp/src/api/purchase/index.js

@@ -98,7 +98,7 @@ export const createPurchaseOrderApi = async data => {
 	* 发快递配送费计算  姜枫 2021.04.12
 	*/
 export const freight = async data => {
-	return https.post("/purchase/freight", data);
+	return https.get("/purchase/freight", data);
 };
 /** *
 	* 采购-下单  姜枫 2021.04.12

+ 4 - 0
hdApp/src/api/shop/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const getDetail = data => {
+	return https.get('/shop/detail', data)
+}
+
 export const checkShop = data => {
 	return https.get('/shop/check-shop', data)
 }

+ 4 - 1
hdApp/src/pages.json

@@ -194,7 +194,10 @@
 				{"path": "password","style": {"navigationBarTitleText": "修改密码"}},
 				{"path": "trumpet","style": {"navigationBarTitleText": "前台云音箱"}},
 				{"path": "makeTrumpet","style": {"navigationBarTitleText": "操作台云音箱"}},
-				{"path": "mtTrumpet","style": {"navigationBarTitleText": "美团云音箱"}}
+				{"path": "mtTrumpet","style": {"navigationBarTitleText": "美团云音箱"}},
+				{"path": "addressList","style": {"navigationBarTitleText": "请选择地址"}},
+				{"path": "addressAdd","style": {"navigationBarTitleText": "添加地址"}},
+				{"path": "addressUpdate","style": {"navigationBarTitleText": "修改地址"}}
 			]
 		},
 		{