shish 4 лет назад
Родитель
Сommit
4648be71c4

+ 11 - 35
ghsApp/src/admin/item/add.vue

@@ -28,14 +28,14 @@
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">价</div>
+          <div class="tui-title">花店价</div>
           <input
             v-model="form.price"
             placeholder-class="phcolor"
             class="tui-input"
             name="price"
             @focus="form.price=''"
-            placeholder="请填写售价"
+            placeholder="请填写"
             maxlength="50"
             type="digit"
           />
@@ -117,46 +117,33 @@
             class="tui-input"
             name="skAddPrice"
             @focus="form.skAddPrice=''"
-            placeholder="请填写散客加价"
+            placeholder="请填写"
             maxlength="50"
             type="digit"
           />
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">店加价</div>
+          <div class="tui-title">店加价</div>
           <input
             v-model="form.addPrice"
             placeholder-class="phcolor"
             class="tui-input"
             name="addPrice"
             @focus="form.addPrice=''"
-            placeholder="请填写普店加价"
+            placeholder="请填写"
             maxlength="50"
             type="digit"
           />
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">银店加价</div>
+          <div class="tui-title">同行加价</div>
           <input
             v-model="form.hjAddPrice"
             placeholder-class="phcolor"
             class="tui-input"
             name="hjAddPrice"
             @focus="form.hjAddPrice=''"
-            placeholder="请填写银店加价"
-            maxlength="50"
-            type="digit"
-          />
-        </tui-list-cell>
-        <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">金店加价</div>
-          <input
-            v-model="form.zsAddPrice"
-            placeholder-class="phcolor"
-            class="tui-input"
-            name="zsAddPrice"
-            @focus="form.zsAddPrice=''"
-            placeholder="请填写金店加价"
+            placeholder="请填写"
             maxlength="50"
             type="digit"
           />
@@ -276,7 +263,6 @@ export default {
         skAddPrice:'',
         addPrice:'',
         hjAddPrice:'',
-        zsAddPrice:'',
         discountPrice:'',
         weight:'',
         cover:[],
@@ -381,7 +367,6 @@ export default {
         this.form.skAddPrice =''
         this.form.addPrice =''
         this.form.hjAddPrice =''
-        this.form.zsAddPrice =''
         this.form.discountPrice = ''
       })
     },
@@ -490,15 +475,11 @@ export default {
 					return;
 				}
 				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.addPrice) == false){
-					uni.showToast({title:"请填写店加价",icon:"none"})
+					uni.showToast({title:"请填写店加价",icon:"none"})
 					return;
 				}
 				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.hjAddPrice) == false){
-					uni.showToast({title:"请填写银店加价",icon:"none"})
-					return;
-				}
-				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.zsAddPrice) == false){
-					uni.showToast({title:"请填写金店加价",icon:"none"})
+					uni.showToast({title:"请填写同行加价",icon:"none"})
 					return;
 				}
       }
@@ -568,17 +549,12 @@ export default {
         {
           name: "addPrice",
           rule: ["required"],
-          msg: ["请填写店加价"]
+          msg: ["请填写店加价"]
         },
         {
           name: "hjAddPrice",
           rule: ["required"],
-          msg: ["请填写银店加价"]
-        },
-        {
-          name: "zsAddPrice",
-          rule: ["required"],
-          msg: ["请填写金店加价"]
+          msg: ["请填写同行加价"]
         },
         {
           name: "discountPrice",

+ 2 - 2
ghsApp/src/admin/item/copy.vue

@@ -201,8 +201,8 @@ export default {
     smallPrice(){
        let price = 0
         if(this.form.price){
-          let div = this.$util.div(this.form.price,this.form.ratio)
-          price = this.$util.mul(div,this.form.smallRatio)
+          let div = Number(this.form.price)/Number(this.form.ratio)
+          price = div*Number(this.form.smallRatio)
           price = parseFloat(price.toFixed(2))
         }
         return price

+ 44 - 12
ghsApp/src/admin/item/detail.vue

@@ -20,7 +20,7 @@
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">价</view>
+          <view class="tui-title">花店价</view>
           <input v-model="form.price" placeholder-class="phcolor" class="tui-input" name="price" @focus="form.price=''" placeholder="请填写售价" maxlength="50" type="digit" />
         </tui-list-cell>
 
@@ -31,8 +31,8 @@
 
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">单支价格系数</view>
-          <input v-model="form.smallRatio" placeholder-class="phcolor" class="tui-input" name="smallRatio" placeholder="请填写" style="width:230upx;" @focus="form.smallRatio=''"
-          maxlength="50" type="number" /><text style="color:#CCCCCC;">¥<text>{{smallPrice}}</text></text>
+          <input v-model="form.smallRatio" placeholder-class="phcolor" class="tui-input" name="smallRatio" placeholder="请填写" style="width:200upx;" @focus="form.smallRatio=''" maxlength="50" type="number" />
+          <text style="color:#CCCCCC;">拆散单支价 ¥<text>{{smallPrice}}</text></text>
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
@@ -52,17 +52,28 @@
 
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">散客加价</view>
-          <input v-model="form.skAddPrice" placeholder-class="phcolor" class="tui-input" name="skAddPrice" @focus="form.skAddPrice=''" placeholder="请填写" maxlength="50" type="digit" />
+          <input v-model="form.skAddPrice" placeholder-class="phcolor" class="tui-input" style="width:130upx;" name="skAddPrice" @focus="form.skAddPrice=''" placeholder="请填写" maxlength="50" type="digit" />
+          <text style="color:#CCCCCC;">
+            <text style="width:170upx;display:inline-block;">成本 ¥{{parseFloat(cost)}}</text>
+            <text style="width:170upx;display:inline-block;">售价 ¥{{skSellPrice}}</text>
+          </text>
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">花店加价</view>
-          <input v-model="form.addPrice" placeholder-class="phcolor" class="tui-input" name="addPrice" @focus="form.addPrice=''" placeholder="请填写" maxlength="50" type="digit" />
+          <input v-model="form.addPrice" placeholder-class="phcolor" class="tui-input" style="width:130upx;" name="addPrice" @focus="form.addPrice=''" placeholder="请填写" maxlength="50" type="digit" />
+          <text style="color:#CCCCCC;">
+            <text style="width:170upx;display:inline-block;">成本 ¥{{parseFloat(cost)}}</text>
+            <text style="width:170upx;display:inline-block;">售价 ¥{{sellPrice}}</text>
+          </text>
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">同行加价</view>
-          <input v-model="form.hjAddPrice" placeholder-class="phcolor" class="tui-input" name="hjAddPrice" @focus="form.hjAddPrice=''" placeholder="请填写" maxlength="50" type="digit" />
+          <input v-model="form.hjAddPrice" placeholder-class="phcolor" class="tui-input" style="width:130upx;" name="hjAddPrice" @focus="form.hjAddPrice=''" placeholder="请填写" maxlength="50" type="digit" />
+          <text style="color:#CCCCCC;">
+            <text style="width:170upx;display:inline-block;">成本 ¥{{parseFloat(cost)}}</text>
+            <text style="width:170upx;display:inline-block;">售价 ¥{{hjSellPrice}}</text>
+          </text>
         </tui-list-cell>
-
         <tui-list-cell class="line-cell" :arrow="false">
           <view class="tui-title">大单位</view>
           <input v-model="form.bigUnitId" name="bigUnitId" type="text" hidden />
@@ -183,7 +194,8 @@ export default {
       bigUnitSelectedData:{},
       hasRequest:0,
       productData:{id:0},
-      headers:{token:''}
+      headers:{token:''},
+      cost:0
     };
   },
 	computed:{
@@ -191,11 +203,26 @@ export default {
     smallPrice(){
        let price = 0
         if(this.form.price){
-          let div = this.$util.div(this.form.price,this.form.ratio)
-          price = this.$util.mul(div,this.form.smallRatio)
+          let div = Number(this.form.price)/Number(this.form.ratio)
+          price = div*Number(this.form.smallRatio)
           price = parseFloat(price.toFixed(2))
         }
         return price
+    },
+    hjSellPrice(){
+      let price = Number(this.cost) + Number(this.form.hjAddPrice)
+      price = parseFloat(price.toFixed(2))
+      return price
+    },
+    sellPrice(){
+      let price = Number(this.cost) + Number(this.form.addPrice)
+      price = parseFloat(price.toFixed(2))
+      return price
+    },
+    skSellPrice(){
+      let price = Number(this.cost) + Number(this.form.skAddPrice)
+      price = parseFloat(price.toFixed(2))
+      return price
     }
 	},
   onLoad(option) {
@@ -280,6 +307,8 @@ export default {
         this.form.addPrice =''
         this.form.hjAddPrice =''
         this.form.discountPrice = ''
+
+        this.cost = res.data.cost || 0
       })
     },
     getDetail() {
@@ -287,11 +316,13 @@ export default {
         if (this.$util.isEmpty(res.data)) {
           return;
         }
-        Object.keys(this.form).forEach((i, index) => {
-          this.form[i] = res.data[i];
+
+        Object.keys(this.form).forEach((i) => {
+            this.form[i] = res.data[i]
         });
 
         this.currentImgData.push(res.data.cover)
+
         this.form.cover = [res.data.shortCover]
 
         this.form.price = res.data.prePrice
@@ -306,6 +337,7 @@ export default {
           e => this.form.bigUnitId == e.id
         )[0];
         this.productData = res.data
+        this.cost = res.data.cost || 0
       });
     },
     imgUploadSuccess(res) {

+ 53 - 62
ghsApp/src/admin/shop/add.vue

@@ -1,100 +1,97 @@
 <template>
-	<div class="app-content">
-		<!-- 门店信息 -->
+	<view class="app-content">
 		<form @submit="formSubmit">
-			<div class="module-com input-line-wrap">
+			<view class="module-com input-line-wrap">
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title required">门店名称</div>
+					<view class="tui-title required">门店名称</view>
 					<input v-model="form.shopName" placeholder-class="phcolor" class="tui-input" name="shopName" placeholder="请输入名称,如同安店" maxlength="50" type="text" />
 				</tui-list-cell>
-<!--
-			<tui-list-cell class="line-cell" :hover="false">
-			<div class="tui-title required" >门店图片</div>
-			<app-uploader :remark="'建议上传比例750X480'" @chooseImage="_resultData" :num="4" :prefixShow="true" :imgList="form.img"/>
-			</tui-list-cell>
--->
-			</div>
-			<!-- <div class="prompt-text">注: 请先关注公众号,绑定后可以在移动端自动登录</div> -->
-			<!-- 登录信息 -->
-			<div class="module-com input-line-wrap">
-				<!-- <tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title required">营业时间</div>
-					<input v-model="form.openTime" placeholder-class="phcolor" class="tui-input" name="openTime" placeholder="请输入营业时间 例如:8:00 - 22:00" maxlength="50" type="text" />
-				</tui-list-cell> -->
-
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title">是否营业</div>
+					<view class="tui-title">营业状态</view>
 					<view><switch style="transform:scale(0.7,0.7)" :checked="form.open == 0 ? false : true" @change="openChange" /></view>
 				</tui-list-cell>
-				<div v-if="visible">
+				<template v-if="visible">
 					<tui-list-cell class="line-cell" :hover="false">
-						<div class="tui-title">营业时间</div>
-						<radio-group class="tui-input flex-center-between" @change="radioChange">
-							<label class="list" for="customLink">
-								<radio value="0" :checked="form.openType == 0" />
+						<view class="tui-title">营业时间</view>
+						<radio-group class="tui-input" @change="radioChange">
+							<label class="list" for="hourLink">
+								<radio id="hourLink" value="0" :checked="form.openType == 0" />
 								<span class="checkbox-text">24小时</span>
 							</label>
-							<label class="list" for="goodsLink">
-								<radio value="1" :checked="form.openType == 1" />
+							<label class="list" for="setTimeLink">
+								<radio id="setTimeLink" value="1" :checked="form.openType == 1" />
 								<span class="checkbox-text">指定时段</span>
 							</label>
 							<input v-model="form.openType" name="openType" hidden />
 						</radio-group>
 					</tui-list-cell>
-					<div v-if="openTimeVisible">
+					<template v-if="openTimeVisible">
 						<tui-list-cell class="line-cell" :hover="false">
-							<div class="tui-title">开店时间</div>
+							<view class="tui-title">开店时间</view>
 								<picker mode="time" :value="start_time" start="00:00" end="24:00" @change="startTimeChange">
 										<view class="uni-input">{{start_time}}</view>
 								</picker>
 								<input v-model="form.openStartTime" name="openStartTime" hidden />
 						</tui-list-cell>
 						<tui-list-cell class="line-cell" :hover="false">
-							<div class="tui-title">关店时间</div>
+							<view class="tui-title">关店时间</view>
 								<picker mode="time" :value="end_time" start="00:00" end="24:00" @change="endTimeChange">
 										<view class="uni-input">{{end_time}}</view>
 								</picker>
 								<input v-model="form.openEndTime" name="openEndTime" hidden />
 						</tui-list-cell>
-					</div>
-				</div>
+					</template>
+				</template>
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title">门店类型</view>
+					<radio-group class="tui-input" @change="joinChange">
+						<label class="list" for="chainLink">
+							<radio id="chainLink" value="0" :checked="form.join == 0" />
+							<span class="checkbox-text">直营店</span>
+						</label>
+						<label class="list" for="joinLink">
+							<radio id="joinLink" value="1" :checked="form.join == 1" />
+							<span class="checkbox-text">加盟店</span>
+						</label>
+					</radio-group>
+				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title required">手机号</div>
+					<view class="tui-title required">手机号</view>
 					<input v-model="form.mobile" placeholder-class="phcolor" class="tui-input" name="mobile" placeholder="请输入手机号" maxlength="50" type="number" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
-					<div class="tui-title required">所在城市</div>
-					<div class="tui-input" v-if="form.province || form.city">{{ form.province + '-' + form.city }}</div>
-					<div class="tui-placeholder" v-else>请选择</div>
+					<view class="tui-title required">所在城市</view>
+					<view class="tui-input" v-if="form.province || form.city">{{ form.province + '-' + form.city }}</view>
+					<view class="tui-placeholder" v-else>请选择</view>
 					<input v-model="form.province" name="province" hidden />
 				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
-					<div class="tui-title required">地址</div>
-					<div class="tui-input" v-if="form.address">{{ form.address }}</div>
-					<div class="tui-placeholder" v-else>请填写详细地址</div>
+				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
+					<view class="tui-title required">地址</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 />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title ">门牌号</div>
+					<view class="tui-title ">门牌号</view>
 					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(选填)" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell remark-wrap" :hover="false">
-					<div class="tui-title">简介</div>
-					<div class="tui-input">
+					<view class="tui-title">简介</view>
+					<view class="tui-input">
 						<textarea v-model="form.introduction" class="tui-textarea remark" placeholder-class="phcolor" placeholder="请输入简介" />
-					</div>
+					</view>
 				</tui-list-cell>
-			</div>
+			</view>
 			<!-- 提交 -->
-			<div class="confirm-btn">
+			<view class="confirm-btn">
 				<button class="admin-button-com big blue" formType="submit">提交</button>
-			</div>
+			</view>
 		</form>
 		<!-- 省市联动 -->
 		<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
 		<!-- 选择地区 -->
 		<app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
-	</div>
+	</view>
 </template>
 
 <script>
@@ -120,14 +117,14 @@
 				visible: true,
 				openTimeVisible: false,
 				start_time: '00:00',
-      	end_time: '00:00',
+      			end_time: '00:00',
 				form: {
+					join:0,
 					shopName: '',
 					province: '',
 					city: '',
 					address: '',
 					floor: '',
-					// openTime: '8:00 - 22:00',
 					open: 1,
 					openType: 0, // openType: 0. 表示 24小时营业 1. 表示 xx ~ xx
 					openStartTime: '',
@@ -136,14 +133,12 @@
 					mobile: '',
 					img: []
 				},
-				// 详细地址
 				showRegion: false,
 				region: {
 					lat: 0,
 					long: 0
 				},
-        // 省市联动
-        regionData: [],
+				regionData: [],
 				cityPickerValueDefault: [0, 0]
 			}
 		},
@@ -200,12 +195,15 @@
 			},
 			startTimeChange: function(e) {
 				this.start_time = e.detail.value
-        this.form.openStartTime = e.detail.value
+        		this.form.openStartTime = e.detail.value
 			},
 			endTimeChange: function(e) {
 				this.end_time = e.detail.value
 				this.form.openEndTime = e.detail.value
 			},
+			joinChange(e){
+				this.form.join = e.detail.value
+			},
 			radioChange(e) {
 				this.openTimeVisible = e.detail.value == 0 ? false : true;
 				this.form.openType = e.detail.value == 0 ? 0 : 1; // openType: 0. 24小时 1. xx ~ xx
@@ -215,7 +213,7 @@
 				}
 			},
 			// 选择地址
-			selRegionFn() {
+			selectRegion() {
 				if (!this.form.city) {
 					this.$msg('请先选择城市!')
 					return false
@@ -223,7 +221,6 @@
 				this.showRegion = true
 			},
 			changeAreaFn(e) {
-				console.log('changeAreaFn', e)
 				this.form.address = e.title
 				this.region.lat = e.location.lat
 				this.region.long = e.location.lng
@@ -266,11 +263,6 @@
 						rule: ['required'],
 						msg: ['请输入名称']
 					},
-					// {
-					// 	name: 'openTime',
-					// 	rule: ['required'],
-					// 	msg: ['请输入营业时间']
-					// },
 					{
 						name: 'mobile',
 						rule: ['required'],
@@ -311,7 +303,6 @@
 		padding-left: 30upx;
 		margin-bottom: 30upx;
 	}
-	// ---
 	.module-com {
 		margin-bottom: 20upx;
 		.member-wrap {

+ 1 - 1
ghsApp/src/admin/shop/sk.vue

@@ -56,7 +56,7 @@ export default {
       let that = this
       uni.showModal({
         title: '提示',
-        content: '确认绑定?',
+        content: '确认绑定?确认零售店的欠款已全部结清?!!!',
         success: function (res) {
           if (res.confirm) {
             uni.showLoading({mask:true})

+ 1 - 71
ghsApp/src/utils/util.js

@@ -421,72 +421,6 @@ export const isScanEnv = () =>{
 	return isScanEnv
 }
 
-//加
-export const add = (arg1, arg2) => {
-    var r1, r2, m, n;
-    try {
-        r1 = arg1.toString().split(".")[1].length
-    } catch (e) {
-        r1 = 0
-    }
-    try {
-        r2 = arg2.toString().split(".")[1].length
-    } catch (e) { 
-        r2 = 0 
-    } 
-    m = Math.pow(10, Math.max(r1, r2))
-    n = (r1 >= r2) ? r1 : r2;
-    return ((arg1 * m + arg2 * m) / m).toFixed(n);
-}
-
-//减
-export const sub = (arg1, arg2) => {
-    var re1, re2, m, n;
-    try {
-        re1 = arg1.toString().split(".")[1].length;
-    } catch (e) {
-    re1 = 0;
-    }
-    try {
-        re2 = arg2.toString().split(".")[1].length;
-    } catch (e) {
-        re2 = 0;
-    }
-    m = Math.pow(10, Math.max(re1, re2)); 
-    n = (re1 >= re2) ? re1 : re2;
-    return ((arg1 * m - arg2 * m) / m).toFixed(n);
-}
-
-//乘
-export const mul = (arg1, arg2) => {
-    var m = 0;
-    var s1 = arg1.toString();
-    var s2 = arg2.toString();
-    try {
-        m += s1.split(".")[1].length;
-    } catch (e) {}
-    try {
-        m += s2.split(".")[1].length;
-    } catch (e) {}
- 
-    return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
-}
-
-// 除数,被除数, 保留的小数点后的位数
-export const div = (arg1,arg2,digit) =>{
-    var t1=0,t2=0,r1,r2;
-    try{t1=arg1.toString().split(".")[1].length}catch(e){}
-    try{t2=arg2.toString().split(".")[1].length}catch(e){}
-    r1=Number(arg1.toString().replace(".",""))
-    r2=Number(arg2.toString().replace(".",""))
-    //获取小数点后的计算值
-   var result= ((r1/r2)*Math.pow(10,t2-t1)).toString()
-    var result2=result.split(".")[1];
-    result2=result2.substring(0,digit>result2.length?result2.length:digit);
- 
-    return Number(result.split(".")[0]+"."+result2);
-}
-
 export default {
 	isEmpty,
 	copyObject,
@@ -509,9 +443,5 @@ export default {
 	callUp,
 	hitRemind,
 	confirmModal,
-	isScanEnv,
-	add,
-	sub,
-	mul,
-	div
+	isScanEnv
 };

+ 2 - 72
ghsPad/src/utils/util.js

@@ -361,72 +361,6 @@ export const isScanEnv = () =>{
 	return isScanEnv
 }
 
-//加
-export const add = (arg1, arg2) => {
-    var r1, r2, m, n;
-    try {
-        r1 = arg1.toString().split(".")[1].length
-    } catch (e) {
-        r1 = 0
-    }
-    try {
-        r2 = arg2.toString().split(".")[1].length
-    } catch (e) { 
-        r2 = 0 
-    } 
-    m = Math.pow(10, Math.max(r1, r2))
-    n = (r1 >= r2) ? r1 : r2;
-    return ((arg1 * m + arg2 * m) / m).toFixed(n);
-}
-
-//减
-export const sub = (arg1, arg2) => {
-    var re1, re2, m, n;
-    try {
-        re1 = arg1.toString().split(".")[1].length;
-    } catch (e) {
-    re1 = 0;
-    }
-    try {
-        re2 = arg2.toString().split(".")[1].length;
-    } catch (e) {
-        re2 = 0;
-    }
-    m = Math.pow(10, Math.max(re1, re2)); 
-    n = (re1 >= re2) ? re1 : re2;
-    return ((arg1 * m - arg2 * m) / m).toFixed(n);
-}
-
-//乘
-export const mul = (arg1, arg2) => {
-    var m = 0;
-    var s1 = arg1.toString();
-    var s2 = arg2.toString();
-    try {
-        m += s1.split(".")[1].length;
-    } catch (e) {}
-    try {
-        m += s2.split(".")[1].length;
-    } catch (e) {}
- 
-    return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
-}
-
-// 除数,被除数, 保留的小数点后的位数
-export const div = (arg1,arg2,digit) =>{
-    var t1=0,t2=0,r1,r2;
-    try{t1=arg1.toString().split(".")[1].length}catch(e){}
-    try{t2=arg2.toString().split(".")[1].length}catch(e){}
-    r1=Number(arg1.toString().replace(".",""))
-    r2=Number(arg2.toString().replace(".",""))
-    //获取小数点后的计算值
-   var result= ((r1/r2)*Math.pow(10,t2-t1)).toString()
-    var result2=result.split(".")[1];
-    result2=result2.substring(0,digit>result2.length?result2.length:digit);
- 
-    return Number(result.split(".")[0]+"."+result2);
-}
-
 export default {
 	isEmpty,
 	copyObject,
@@ -448,9 +382,5 @@ export default {
 	noStockRemind,
 	callUp,
 	hitRemind,
-	isScanEnv,
-	add,
-	sub,
-	mul,
-	div
-};
+	isScanEnv
+};

+ 1 - 32
hdApp/src/admin/changePrice/components/Item.vue

@@ -9,7 +9,7 @@
 		</view>
 		<view class="cmd-info_bx" @click="pageTo({url: '/admin/item/detail',query: {id: info.id}})">
 			<view class="tit">{{ info.itemName || "" }}</view>
-			<view class="kc">¥{{ parseFloat(info.price) }}</view>
+			<view class="kc">¥{{ parseFloat(info.skPrice) }}</view>
 			<view class="num-open_bx">
 				<view>
 					<view class="open-bx" >
@@ -24,12 +24,6 @@
 			</view>
 		</view>
 	</view>
-	<view class="level-price">
-		散客 ¥<text style="margin-right:35upx;">{{skPrice}}</text>
-		普店 ¥<text style="margin-right:35upx;">{{pdPrice}}</text>
-		银店 ¥<text style="margin-right:35upx;">{{ydPrice}}</text>
-		金店 ¥<text style="margin-right:8upx;">{{jdPrice}}</text>
-	</view>
 </view>
 </template>
 <script>
@@ -53,41 +47,16 @@ export default {
 	data() {
 		return {
 			modifyPrice:'',
-			skPrice:0,
-			pdPrice:0,
-			ydPrice:0,
-			jdPrice:0
 		};
 	},
 	watch: {
-		modifyPrice: {
-			handler(newValue) {
-				this.changeLevelPrice(newValue)			
-			}
-		}
 	},
 	mounted(){
-		this.skPrice = parseFloat(this.info.skPrice)
-		this.pdPrice = parseFloat(this.info.price)
-		this.ydPrice = parseFloat(this.info.hjPrice)
-		this.jdPrice = parseFloat(this.info.zsPrice)
 	},
 	methods: {
 		savePrice() {
 			this.$emit("savePrice",this.modifyPrice,this.info.id);
 		},
-		changeLevelPrice(pdPrice){
-			if(Number(pdPrice) <= 0 ||this.$util.isEmpty(pdPrice)){
-				pdPrice = this.info.price
-			}
-			this.pdPrice = parseFloat(pdPrice)
-			let skSub = (this.info.addPrice - this.info.skAddPrice).toFixed(2)
-			let ydSub = (this.info.addPrice - this.info.hjAddPrice).toFixed(2)
-			let jdSub = (this.info.addPrice - this.info.zsAddPrice).toFixed(2)
-			this.skPrice = parseFloat((pdPrice - skSub).toFixed(2))
-			this.ydPrice = parseFloat((pdPrice - ydSub).toFixed(2))
-			this.jdPrice = parseFloat((pdPrice - jdSub).toFixed(2))
-		}
 	}
 };
 </script>

+ 1 - 1
hdApp/src/admin/changePrice/list.vue

@@ -30,7 +30,7 @@
 						<view v-if="classItem.child && !$util.isEmpty(classItem.child)">
 
 							<template v-for="(productItem, productIndex) in classItem.child">
-								<view style="height:230upx" :id="`class_${classIndex}`" :key="productIndex">
+								<view style="height:200upx" :id="`class_${classIndex}`" :key="productIndex">
 									<ItemComponent v-if="classItem.isActive" :isPrice="false" :info="productItem" @savePrice="savePrice" ></ItemComponent>
 								</view>
 							</template>

+ 4 - 76
hdApp/src/admin/item/add.vue

@@ -110,53 +110,14 @@
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">散客加价</view>
+          <view class="tui-title">加价</view>
           <input
             v-model="form.skAddPrice"
             placeholder-class="phcolor"
             class="tui-input"
             name="skAddPrice"
             @focus="form.skAddPrice=''"
-            placeholder="请填写散客加价"
-            maxlength="50"
-            type="digit"
-          />
-        </tui-list-cell>
-        <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">普店加价</view>
-          <input
-            v-model="form.addPrice"
-            placeholder-class="phcolor"
-            class="tui-input"
-            name="addPrice"
-            @focus="form.addPrice=''"
-            placeholder="请填写普店加价"
-            maxlength="50"
-            type="digit"
-          />
-        </tui-list-cell>
-        <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">银店加价</view>
-          <input
-            v-model="form.hjAddPrice"
-            placeholder-class="phcolor"
-            class="tui-input"
-            name="hjAddPrice"
-            @focus="form.hjAddPrice=''"
-            placeholder="请填写银店加价"
-            maxlength="50"
-            type="digit"
-          />
-        </tui-list-cell>
-        <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">金店加价</view>
-          <input
-            v-model="form.zsAddPrice"
-            placeholder-class="phcolor"
-            class="tui-input"
-            name="zsAddPrice"
-            @focus="form.zsAddPrice=''"
-            placeholder="请填写金店加价"
+            placeholder="请填写加价"
             maxlength="50"
             type="digit"
           />
@@ -274,9 +235,6 @@ export default {
         classId:'',
         price:'',
         skAddPrice:'',
-        addPrice:'',
-        hjAddPrice:'',
-        zsAddPrice:'',
         discountPrice:'',
         weight:'',
         cover:[],
@@ -379,9 +337,6 @@ export default {
         this.form.id = 0
         this.form.price = ''
         this.form.skAddPrice =''
-        this.form.addPrice =''
-        this.form.hjAddPrice =''
-        this.form.zsAddPrice =''
         this.form.discountPrice = ''
       })
     },
@@ -486,19 +441,7 @@ export default {
 					return;
 				}
 				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skAddPrice) == false){
-					uni.showToast({title:"请填写散客加价",icon:"none"})
-					return;
-				}
-				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.addPrice) == false){
-					uni.showToast({title:"请填写普店加价",icon:"none"})
-					return;
-				}
-				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.hjAddPrice) == false){
-					uni.showToast({title:"请填写银店加价",icon:"none"})
-					return;
-				}
-				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.zsAddPrice) == false){
-					uni.showToast({title:"请填写金店加价",icon:"none"})
+					uni.showToast({title:"请填写加价",icon:"none"})
 					return;
 				}
       }
@@ -561,22 +504,7 @@ export default {
         {
           name: "skAddPrice",
           rule: ["required"],
-          msg: ["请填写散客加价"]
-        },
-        {
-          name: "addPrice",
-          rule: ["required"],
-          msg: ["请填写普店加价"]
-        },
-        {
-          name: "hjAddPrice",
-          rule: ["required"],
-          msg: ["请填写银店加价"]
-        },
-        {
-          name: "zsAddPrice",
-          rule: ["required"],
-          msg: ["请填写金店加价"]
+          msg: ["请填写加价"]
         },
         {
           name: "discountPrice",

+ 12 - 9
hdApp/src/admin/item/detail.vue

@@ -25,8 +25,8 @@
 
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">单支价格系数</view> 
-          <input v-model="form.smallRatio" placeholder-class="phcolor" class="tui-input" name="smallRatio" style="width:230upx;" @focus="form.smallRatio=''"
-           placeholder="请填写" maxlength="30" type="number" /><text style="color:#CCCCCC;">¥<text>{{smallPrice}}</text></text>
+          <input v-model="form.smallRatio" placeholder-class="phcolor" class="tui-input" name="smallRatio" style="width:200upx;" @focus="form.smallRatio=''" placeholder="请填写" maxlength="30" type="number" />
+           <text style="color:#CCCCCC;">拆散单支价 ¥<text>{{smallPrice}}</text></text>
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
@@ -165,7 +165,7 @@ export default {
       smallUnitSelectedData:{},
       bigUnitSelectedData:{},
       hasRequest:0,
-      productData:{id:0},
+      productData:{id:0,ptItemInfo:{name:''}},
       headers:{token:''}
     };
   },
@@ -173,9 +173,9 @@ export default {
 		...mapGetters(["getLoginInfo","getDictionariesInfo"]),
     smallPrice(){
        let price = 0
-        if(this.form.skPrice){
-          let div = this.$util.div(this.form.skPrice,this.form.ratio)
-          price = this.$util.mul(div,this.form.smallRatio)
+        if(Number(this.form.skPrice) > 0 && Number(this.form.smallRatio) >0 ){
+          let div = Number(this.form.skPrice)/Number(this.form.ratio)
+          price = div*Number(this.form.smallRatio)
           price = parseFloat(price.toFixed(2))
         }
         return price
@@ -261,6 +261,9 @@ export default {
         this.form.delStatus = 0
         this.form.id = 0
         this.form.skAddPrice =''
+
+        this.productData.ptItemInfo.name = res.data.name
+
       })
     },
     getDetail() {
@@ -268,7 +271,7 @@ export default {
         if (this.$util.isEmpty(res.data)) {
           return;
         }
-        Object.keys(this.form).forEach((i, index) => {
+        Object.keys(this.form).forEach((i) => {
           this.form[i] = res.data[i];
         });
         this.currentImgData.push(res.data.cover)
@@ -351,7 +354,7 @@ export default {
 					return;
 				}
 				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skAddPrice) == false){
-					uni.showToast({title:"请填写散客加价",icon:"none"})
+					uni.showToast({title:"请填写加价",icon:"none"})
 					return;
 				}
       }
@@ -416,7 +419,7 @@ export default {
         {
           name: "skAddPrice",
           rule: ["required"],
-          msg: ["请填写散客加价"]
+          msg: ["请填写加价"]
         },
         {
           name: "weight",

+ 8 - 62
hdApp/src/admin/itemClass/addPrice.vue

@@ -4,10 +4,7 @@
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 				<t-tr header>
                     <t-th>名称</t-th>
-					<t-th>散客</t-th>
-					<t-th>普店</t-th>
-					<t-th>银店</t-th>
-					<t-th>金店</t-th>
+					<t-th>加价</t-th>
 				</t-tr>
 				<view v-for="(item, index) in list.data" :key="index">
 					<t-tr>
@@ -15,15 +12,6 @@
 						<t-td align="center" color="info">
                             <view><input v-model="item.skAddPrice" @focus="item.skAddPrice=''" name="skAddPrice" type="digit" style="border:1upx solid #cccccc;" /></view>
                         </t-td>
-						<t-td align="center" color="info">
-                            <view><input v-model="item.addPrice" @focus="item.addPrice=''" name="price" type="digit" style="border:1upx solid #cccccc;" /></view>
-                            </t-td>
-						<t-td align="center" color="info">
-                            <view><input v-model="item.hjAddPrice" @focus="item.hjAddPrice=''" name="hjAddPrice" type="digit" style="border:1upx solid #cccccc;" /></view>
-                            </t-td>
-						<t-td align="center" color="info">
-                            <view><input v-model="item.zsAddPrice" @focus="item.zsAddPrice=''" name="zsAddPrice" type="digit" style="border:1upx solid #cccccc;" /></view>
-                            </t-td>
 					</t-tr>
 				</view>
 			</t-table>
@@ -34,11 +22,10 @@
         <view class="app-footer">
             <view class="admin-button-com middle blue" @click="showBatchUpdate('add')">整列累加</view>
             <view style="margin-left:20upx;" class="admin-button-com middle blue" @click="showBatchUpdate('update')">整列改为</view>
-            <view style="margin-left:20upx;" class="admin-button-com middle blue" @click="pageTo({url: '/admin/item/list'})">花材</view>
 		    <view style="margin-left:20upx;" class="admin-button-com middle blue" @click="savePrice">全部保存</view>
 		</view>
 
-		<modal-module :show="batchModel" @click="affirmBatch" title="批量操作" color="#333" :size="32" padding="30upx 30upx" >
+		<modal-module :show="batchModel" @click="confirmBatch" title="批量操作" color="#333" :size="32" padding="30upx 30upx" >
 			<template slot="customContent">
 				<view class="select-cmd_bx">
 					<view class="num_bx" style="margin:60upx 0 60upx 0;font-size:35upx;">
@@ -77,19 +64,10 @@ export default {
                 this.$msg('没有花材')
                 return false
             }
-
             this.batchStyle = styleInfo
-			let self = this
-			let levelList = ['请选择列:','散客', '普店', '银店', '金店']
-			uni.showActionSheet({
-				itemList: levelList,
-				success: function (respond) {
-					self.levelIndex = respond.tapIndex
-                    self.batchModel = true
-				}
-			})
+            this.batchModel = true
         },
-		affirmBatch(val) {
+		confirmBatch(val) {
             let that = this
 			if (val.index === 0) {
                 this.batchPrice = ''
@@ -102,29 +80,9 @@ export default {
                 let currentPrice = Number(this.batchPrice)
                 this.list.data.forEach(function(value,index,array){
                     if(that.batchStyle =='add'){
-                        if(that.levelIndex == 1){
-                            array[index].skAddPrice =  parseFloat((Number(array[index].skAddPrice) + currentPrice).toFixed(2))
-                        }else if(that.levelIndex == 2){
-                            array[index].addPrice =  parseFloat((Number(array[index].addPrice) + currentPrice).toFixed(2))
-                        }else if(that.levelIndex == 3){
-                            array[index].hjAddPrice =  parseFloat((Number(array[index].hjAddPrice) + currentPrice).toFixed(2))
-                        }else if(that.levelIndex == 4){
-                            array[index].zsAddPrice =  parseFloat((Number(array[index].zsAddPrice) + currentPrice).toFixed(2))
-                        }else{
-
-                        }
+                        array[index].skAddPrice =  parseFloat((Number(array[index].skAddPrice) + currentPrice).toFixed(2))
                     }else{
-                        if(that.levelIndex == 1){
-                            array[index].skAddPrice =  parseFloat((currentPrice).toFixed(2))
-                        }else if(that.levelIndex == 2){
-                            array[index].addPrice =  parseFloat((currentPrice).toFixed(2))
-                        }else if(that.levelIndex == 3){
-                            array[index].hjAddPrice =  parseFloat((currentPrice).toFixed(2))
-                        }else if(that.levelIndex == 4){
-                            array[index].zsAddPrice =  parseFloat((currentPrice).toFixed(2))
-                        }else{
-
-                        }
+                        array[index].skAddPrice =  parseFloat((currentPrice).toFixed(2))
                     }
 				});
                 this.batchPrice = ''
@@ -138,22 +96,10 @@ export default {
            this.list.data.forEach(function(value,index,array){
 
                if(that.$util.isMoney(value.skAddPrice) == false){
-                   that.$msg('【'+value.name+'】的散客加价填写错误')
-                   return false
-               }
-               if(that.$util.isMoney(value.addPrice) == false){
-                   that.$msg('【'+value.name+'】的普店加价填写错误')
-                   return false
-               }
-               if(that.$util.isMoney(value.hjAddPrice) == false){
-                   that.$msg('【'+value.name+'】的银店加价填写错误')
-                   return false
-               }
-               if(that.$util.isMoney(value.zsAddPrice) == false){
-                   that.$msg('【'+value.name+'】的金店加价填写错误')
+                   that.$msg('【'+value.name+'】的加价填写错误')
                    return false
                }
-                addData.push({id:value.id,skAddPrice:value.skAddPrice,addPrice:value.addPrice,hjAddPrice:value.hjAddPrice,zsAddPrice:value.zsAddPrice})
+                addData.push({id:value.id,skAddPrice:value.skAddPrice})
            })
            let addString = JSON.stringify(addData)
            batchChangeAddPrice({addData:addString}).then(res=>{

+ 54 - 51
hdApp/src/admin/shop/add.vue

@@ -1,93 +1,97 @@
 <template>
-	<div class="app-content">
-		<!-- 门店信息 -->
+	<view class="app-content">
 		<form @submit="formSubmit" @reset="formReset">
-			<div class="module-com input-line-wrap">
+			<view class="module-com input-line-wrap">
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title required">门店名称</div>
+					<view class="tui-title required">门店名称</view>
 					<input v-model="form.shopName" placeholder-class="phcolor" class="tui-input" name="shopName" placeholder="请输入名称,如同安店" maxlength="50" type="text" />
 				</tui-list-cell>
-			<tui-list-cell class="line-cell" :hover="false">
-			<div class="tui-title required" >门店图片</div>
-			<app-uploader :remark="'建议上传比例750X480'" @chooseImage="_resultData" :num="4" :prefixShow="true" :imgList="form.img"/>
-			</tui-list-cell>
-			</div>
-			<!-- <div class="prompt-text">注: 请先关注公众号,绑定后可以在移动端自动登录</div> -->
-			<!-- 登录信息 -->
-			<div class="module-com input-line-wrap">
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title">是否营业</div>
+					<view class="tui-title">营业状态</view>
 					<view><switch style="transform:scale(0.7,0.7)" :checked="form.open == 0 ? false : true" @change="openChange" /></view>
 				</tui-list-cell>
-				<div v-if="visible">
+				<template v-if="visible">
 					<tui-list-cell class="line-cell" :hover="false">
-						<div class="tui-title">营业时间</div>
-						<radio-group class="tui-input flex-center-between" @change="radioChange">
-							<label class="list" for="customLink">
-								<radio value="0" :checked="form.openType == 0" />
+						<view class="tui-title">营业时间</view>
+						<radio-group class="tui-input" @change="radioChange">
+							<label class="list" for="hourLink">
+								<radio id="hourLink" value="0" :checked="form.openType == 0" />
 								<span class="checkbox-text">24小时</span>
 							</label>
-							<label class="list" for="goodsLink">
-								<radio value="1" :checked="form.openType == 1" />
+							<label class="list" for="setTimeLink">
+								<radio id="setTimeLink" value="1" :checked="form.openType == 1" />
 								<span class="checkbox-text">指定时段</span>
 							</label>
 							<input v-model="form.openType" name="openType" hidden />
 						</radio-group>
 					</tui-list-cell>
-					<div v-if="openTimeVisible">
+					<template v-if="openTimeVisible">
 						<tui-list-cell class="line-cell" :hover="false">
-							<div class="tui-title">开店时间</div>
+							<view class="tui-title">开店时间</view>
 								<picker mode="time" :value="start_time" start="00:00" end="24:00" @change="startTimeChange">
 										<view class="uni-input">{{start_time}}</view>
 								</picker>
 								<input v-model="form.openStartTime" name="openStartTime" hidden />
 						</tui-list-cell>
 						<tui-list-cell class="line-cell" :hover="false">
-							<div class="tui-title">关店时间</div>
+							<view class="tui-title">关店时间</view>
 								<picker mode="time" :value="end_time" start="00:00" end="24:00" @change="endTimeChange">
 										<view class="uni-input">{{end_time}}</view>
 								</picker>
 								<input v-model="form.openEndTime" name="openEndTime" hidden />
 						</tui-list-cell>
-					</div>
-				</div>
+					</template>
+				</template>
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title required">手机号</div>
+					<view class="tui-title">门店类型</view>
+					<radio-group class="tui-input" @change="joinChange">
+						<label class="list" for="chainLink">
+							<radio id="chainLink" value="0" :checked="form.join == 0" />
+							<span class="checkbox-text">直营店</span>
+						</label>
+						<label class="list" for="joinLink">
+							<radio id="joinLink" value="1" :checked="form.join == 1" />
+							<span class="checkbox-text">加盟店</span>
+						</label>
+					</radio-group>
+				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title required">手机号</view>
 					<input v-model="form.mobile" placeholder-class="phcolor" class="tui-input" name="mobile" placeholder="请输入手机号" maxlength="50" type="number" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
-					<div class="tui-title required">所在城市</div>
-					<div class="tui-input" v-if="form.province || form.city">{{ form.province + '-' + form.city }}</div>
-					<div class="tui-placeholder" v-else>请选择</div>
+					<view class="tui-title required">所在城市</view>
+					<view class="tui-input" v-if="form.province || form.city">{{ form.province + '-' + form.city }}</view>
+					<view class="tui-placeholder" v-else>请选择</view>
 					<input v-model="form.province" name="province" hidden />
 				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
-					<div class="tui-title required">地址</div>
-					<div class="tui-input" v-if="form.address">{{ form.address }}</div>
-					<div class="tui-placeholder" v-else>请填写详细地址</div>
+				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
+					<view class="tui-title required">地址</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 />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title ">门牌号</div>
+					<view class="tui-title ">门牌号</view>
 					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(选填)" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell remark-wrap" :hover="false">
-					<div class="tui-title">简介</div>
-					<div class="tui-input">
+					<view class="tui-title">简介</view>
+					<view class="tui-input">
 						<textarea v-model="form.introduction" class="tui-textarea remark" placeholder-class="phcolor" placeholder="请输入简介" />
-					</div>
+					</view>
 				</tui-list-cell>
-			</div>
+			</view>
 			<!-- 提交 -->
-			<div class="confirm-btn">
+			<view class="confirm-btn">
 				<button class="admin-button-com big blue" formType="submit">提交</button>
-			</div>
+			</view>
 		</form>
 		<!-- 省市联动 -->
 		<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
 		<!-- 选择地区 -->
 		<app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
-	</div>
+	</view>
 </template>
 
 <script>
@@ -113,14 +117,14 @@
 				visible: true,
 				openTimeVisible: false,
 				start_time: '00:00',
-      	end_time: '00:00',
+      			end_time: '00:00',
 				form: {
+					join:0,
 					shopName: '',
 					province: '',
 					city: '',
 					address: '',
 					floor: '',
-					// openTime: '8:00 - 22:00',
 					open: 1,
 					openType: 0, // openType: 0. 表示 24小时营业 1. 表示 xx ~ xx
 					openStartTime: '',
@@ -129,16 +133,14 @@
 					mobile: '',
 					img: []
 				},
-				// 详细地址
 				showRegion: false,
 				region: {
 					lat: 0,
 					long: 0
 				},
-        // 省市联动
-        regionData: [],
+		        regionData: [],
 				cityPickerValueDefault: [0, 0],
-        img: []
+		        img: []
 			}
 		},
 		onLoad() {
@@ -193,7 +195,10 @@
 			},
 			startTimeChange: function(e) {
 				this.start_time = e.detail.value
-        this.form.openStartTime = e.detail.value
+        		this.form.openStartTime = e.detail.value
+			},
+			joinChange(e){
+				this.form.join = e.detail.value
 			},
 			endTimeChange: function(e) {
 				this.end_time = e.detail.value
@@ -207,8 +212,7 @@
 					this.end_time = '18:00'
 				}
 			},
-			// 选择地址
-			selRegionFn() {
+			selectRegion() {
 				if (!this.form.city) {
 					this.$msg('请先选择城市!')
 					return false
@@ -303,7 +307,6 @@
 		padding-left: 30upx;
 		margin-bottom: 30upx;
 	}
-	// ---
 	.module-com {
 		margin-bottom: 20upx;
 		.member-wrap {

+ 8 - 0
hdApp/src/api/product/index.js

@@ -1,5 +1,13 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const batchChangeAddPrice = data => {
+	return https.post("/product/batch-change-add-price", data);
+};
+
+export const productList = data => {
+	return https.get("/product/list", data);
+};
+
 //获取拼音首字母缩写 shish 20210707
 export const py = data => {
 	return https.get("/product/py", data);

+ 1 - 72
hdApp/src/utils/util.js

@@ -413,73 +413,6 @@ export const noStockRemind = () =>{
 	})
 }
 
-//加
-export const add = (a,b) => {
-    let c, d, e;
-    try {
-        c = a.toString().split(".")[1].length;
-    } catch (f) {
-        c = 0;
-    }
-    try {
-        d = b.toString().split(".")[1].length;
-    } catch (f) {
-        d = 0;
-    }
-    e = Math.pow(10, Math.max(c, d));
-    return  (mul(a, e) + mul(b, e)) / e;
-}
-
-//减
-export const sub = (a, b) => {
-    let c, d, e;
-    try {
-        c = a.toString().split(".")[1].length;
-    } catch (f) {
-        c = 0;
-    }
-    try {
-        d = b.toString().split(".")[1].length;
-    } catch (f) {
-        d = 0;
-    }
-    e = Math.pow(10, Math.max(c, d));
-    return (mul(a, e) - mul(b, e)) / e;
-}
-
-//乘
-export const mul = (a,b) =>{
-    let c = 0,
-          d = a.toString(),
-          e = b.toString();
-    try {
-        c += d.split(".")[1].length;
-    } catch (f) {}
-    try {
-        c += e.split(".")[1].length;
-    } catch (f) {}
-    return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c);  
-}
-
-// 除数,被除数, 保留的小数点后的位数
-export const div = (a, b) => {
-    var c, d, e = 0,
-           f = 0;
-    try {
-        e = a.toString().split(".")[1].length;
-    } catch (g) {
-        e = 0;
-    }
-    try {
-        f = b.toString().split(".")[1].length;
-    } catch (g) {
-        f = 0;
-    }
-    c = Number(a.toString().replace(".", ""));
-    d = Number(b.toString().replace(".", ""));
-    return mul(c / d, Math.pow(10, f - e));
-}
-
 export default {
 	isEmpty,
 	copyObject,
@@ -500,9 +433,5 @@ export default {
 	confirmModal,
 	isScanEnv,
 	hitRemind,
-	noStockRemind,
-	add,
-	sub,
-	mul,
-	div
+	noStockRemind
 };

+ 1 - 71
hdPad/src/utils/util.js

@@ -360,72 +360,6 @@ export const isScanEnv = () =>{
 	return isScanEnv
 }
 
-//加
-export const add = (arg1, arg2) => {
-    var r1, r2, m, n;
-    try {
-        r1 = arg1.toString().split(".")[1].length
-    } catch (e) {
-        r1 = 0
-    }
-    try {
-        r2 = arg2.toString().split(".")[1].length
-    } catch (e) { 
-        r2 = 0 
-    } 
-    m = Math.pow(10, Math.max(r1, r2))
-    n = (r1 >= r2) ? r1 : r2;
-    return ((arg1 * m + arg2 * m) / m).toFixed(n);
-}
-
-//减
-export const sub = (arg1, arg2) => {
-    var re1, re2, m, n;
-    try {
-        re1 = arg1.toString().split(".")[1].length;
-    } catch (e) {
-    re1 = 0;
-    }
-    try {
-        re2 = arg2.toString().split(".")[1].length;
-    } catch (e) {
-        re2 = 0;
-    }
-    m = Math.pow(10, Math.max(re1, re2)); 
-    n = (re1 >= re2) ? re1 : re2;
-    return ((arg1 * m - arg2 * m) / m).toFixed(n);
-}
-
-//乘
-export const mul = (arg1, arg2) => {
-    var m = 0;
-    var s1 = arg1.toString();
-    var s2 = arg2.toString();
-    try {
-        m += s1.split(".")[1].length;
-    } catch (e) {}
-    try {
-        m += s2.split(".")[1].length;
-    } catch (e) {}
- 
-    return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
-}
-
-// 除数,被除数, 保留的小数点后的位数
-export const div = (arg1,arg2,digit) =>{
-    var t1=0,t2=0,r1,r2;
-    try{t1=arg1.toString().split(".")[1].length}catch(e){}
-    try{t2=arg2.toString().split(".")[1].length}catch(e){}
-    r1=Number(arg1.toString().replace(".",""))
-    r2=Number(arg2.toString().replace(".",""))
-    //获取小数点后的计算值
-   var result= ((r1/r2)*Math.pow(10,t2-t1)).toString()
-    var result2=result.split(".")[1];
-    result2=result2.substring(0,digit>result2.length?result2.length:digit);
- 
-    return Number(result.split(".")[0]+"."+result2);
-}
-
 export default {
 	isEmpty,
 	copyObject,
@@ -447,9 +381,5 @@ export default {
 	noStockRemind,
 	callUp,
 	hitRemind,
-	isScanEnv,
-	add,
-	sub,
-	mul,
-	div
+	isScanEnv
 };