Browse Source

小菊颜色

shish 4 years ago
parent
commit
46a13cd3c8

+ 15 - 36
ghsApp/src/admin/billing/affirm.vue

@@ -299,16 +299,25 @@ export default {
         Fn = updateOrder
         params = {...params,id:this.option.orderId}
       }
+
+      //小菊
+      let xj = uni.getStorageSync("xj"+this.option.customId)
+      params = {...params,xj:JSON.stringify(xj)}
+
       Fn(params).then((res) => {
-        //删除记忆
-        this.removeMemory(that.option.customId)
-        const {data: { id, orderSn },} = res;
-        this.$util.pageTo({ url: '/admin/billing/result',type:2,query: {orderId:id,orderSn:orderSn}})
+        if(res.code == 1){
+          //删除记忆
+          this.removeMemory(that.option.customId)
+          //删除小菊的记忆
+          uni.removeStorageSync("xj"+params.customId)
+          const {data: { id, orderSn },} = res;
+          this.$util.pageTo({ url: '/admin/billing/result',type:2,query: {orderId:id,orderSn:orderSn}})
+        }
       });
     },
     affirmFormSubmit () {
       let self = this;
-      if(this.isBilling){
+      
         let rules = [
           {
             name: "customId",
@@ -338,37 +347,7 @@ export default {
             }
           },
         });
-      }else{
-        let price = 0;
-        let that = this
-        let product = this.selectList.map((ele) => {
-          price += ele.bigCount * Number(ele.bigPrice);
-          price += ele.smallCount * Number(ele.smallPrice);
-          return {
-            productId: ele.id,
-            bigNum: ele.bigCount,
-            smallNum: ele.smallCount,
-            classId: ele.classId,
-            itemId: ele.itemId,
-            price: ele.userPrice>0?ele.userPrice:price,
-          };
-        });
-        uni.showModal({
-          title: "提示",
-          content: "确认报损?",
-          success: function (res) {
-            if (res.confirm) {
-              wastage({product:JSON.stringify(product)}).then((res) => {
-                //删除记忆
-                that.removeMemory(that.option.customId)
-                const {data: { id, orderSn },} = res;
-                let url = `/admin/billing/result?title=报损成功&orderId=${id}&orderSn=${orderSn}`;
-                uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },});
-              });
-            }
-          },
-        });
-      }
+      
     },
     // 表单验证
     async formSubmit () {

+ 66 - 5
ghsApp/src/admin/billing/index.vue

@@ -44,6 +44,7 @@
 									@add="addEvent"
 									@addOneEvent="addCustomNumEvent"
 									@del="delEvent"
+									@goToSpecialVariety="goToSpecialVariety"
 								></Commondity>
 							</view>
 						</template>
@@ -118,7 +119,9 @@ export default {
 				smallCount: 0,
 				userPrice: 0,
 			},
-			showSubmitModel: false
+			showSubmitModel: false,
+			xjData:{},
+			xjDataInfo:{}
 		};
 	},
 	computed: {
@@ -130,12 +133,70 @@ export default {
 			return content;
 		}
 	},
+	onShow() {
+		if(this.xjData.hasUpdate == 1){
+			console.log('this.xjData',this.xjData)
+			console.log('this.xjDataInfo',this.xjDataInfo)
 
+			const list = this.selectList;
+
+			this.customData = this.xjDataInfo
+
+			if(this.xjData.price == null){
+				this.customData.bigCount = 0
+				this.customData.smallCount = 0
+				console.log('this.customData',this.customData)
+				this.affirm({index:0})
+			}else{
+
+				//判断list有没有数据,没有需要初始化
+				const list = this.selectList;
+				let has = false
+				for (let index = 0; index < list.length; index++) {
+					const element = list[index];
+					if (element.id == this.xjDataInfo.id && element.classId == this.xjDataInfo.classId) {
+						has = true
+					}
+				}
+
+				if(has == false){
+					let params = {
+						...this.xjDataInfo,
+						bigCount: null, //扎数
+						smallCount: null, //支数
+						autoPrice: null, //调价价格
+						realityWeight: null, //调价价格
+						userPrice: null, //调价价格
+					};
+					list.push(params);
+					this.setSelectInfoByType({ type: this.pageType, info: list });
+				}
+
+				this.customData.bigCount = this.xjData.stock
+				this.customData.smallCount = 0
+				this.customData.bigPrice = this.xjData.price
+				this.customData.price = this.xjData.price
+				this.customData.itemPrice = this.xjData.price
+				this.customData.userPrice = (Number(this.xjData.stock) * Number(this.xjData.price)).toFixed(2)
+
+				this.affirm({index:1})
+			}
+		}
+		this.xjData = {}
+	},
 	onUnload() {
 		this.resetSelectInfoByType(this.pageType);
 	},
-
 	methods: {
+		//去特殊品种页,如小菊等
+		goToSpecialVariety(info){
+			this.xjDataInfo = info
+			if(info.stock <= 0){
+				uni.showToast({title:"没有库存",icon:"none"})
+			}else{
+				this.$util.pageTo({url: "/admin/item/xj",query: {stock:info.stock,price: info.price,customId:this.option.customId,userPrice:info.userPrice}})
+			}
+		},
 		countPrice() {
 			let price = 0;
 			price += this.customData.bigCount * Number(this.customData.bigPrice);
@@ -197,10 +258,10 @@ export default {
 					return;
 				}
 				if(this.customData.userPrice <=0){
-						uni.showToast({title:"金额要大于0",icon:"none"})
-						return;
+					uni.showToast({title:"金额要大于0",icon:"none"})
+					return;
 				}
-				 
+
 				const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.customData;
 				const ratioNum = Number(ratio);
 				//超过库存时 设置为库存最大值 1

+ 2 - 1
ghsApp/src/admin/home/apply.vue

@@ -49,7 +49,8 @@ export default {
                     title:'花材',
                     list:[
                         {name: "花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list"},
-                        {name: "花材分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/list"}
+                        {name: "花材分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/list"},
+                        {name: "小菊颜色",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/xjSelect"}
                     ]
                 },
                 {

+ 347 - 0
ghsApp/src/admin/item/xj.vue

@@ -0,0 +1,347 @@
+<template>
+	<view class="billing_box_bg">
+    	<view class="input-wrap">
+			剩余:{{option.stock}}扎
+		</view>
+		<view class="scroll-middle_bx">
+			<block>
+				<view class="item_list_bx"  style="width: 100%">
+					<view v-for="(xjItem,xjIndex) in xjList" :key="xjIndex">
+						<view>
+							<view class="item-cmd_bx">
+								<view class="img_bx" style="background:#eeeeee">
+									<image :src="xjItem.cover"></image>
+								</view>
+								<view class="cmd-info_bx">
+									<view class="tit">{{ xjItem.name || "" }}</view>
+									<view class="kc"></view>
+									<view class="num-open_bx">
+										<view class="open-bx warn">
+											数量:<input class="change-input" @focus="xjNum = ''" 
+											placeholder-style="color:#CCCCCC" v-model="numList[xjItem.id]" type="digit" placeholder="请填写" />
+										</view>
+									</view>
+								</view>
+							</view>
+						</view>
+					</view>
+					<view style="margin-top:30rpx;margin-bottom:20rpx;">
+						<text style="padding-top:50rpx;font-size:30rpx;font-weight:700;display:inline-block;">单价:</text>
+						<input class="change-input" @focus="option.price=''" placeholder-style="color:#CCCCCC" v-model="option.price" type="digit" placeholder="请填写" />
+					</view>
+					<view>
+						<button class="admin-button-com big default" @click="clearXj()">清除全部</button>
+						<button class="admin-button-com big default" @click="goBack()" style="margin-left:65rpx;padding:30rpx 55rpx 30rpx 55rpx;">返回</button>
+						<button class="admin-button-com big blue" @click="confirmXj()" style="margin-left:65rpx;padding:30rpx 65rpx; 30rpx 65rpx;" >确认</button>
+					</view>
+				</view>
+			</block>
+		</view>
+	</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { mapGetters } from "vuex";
+import { getSjXj } from "@/api/product/xj"
+export default {
+	name: "xj",
+	components: {
+		AppWrapperEmpty,
+	},
+	mixins: [],
+	data() {
+		return {
+			xjNum:'',
+			xjList:[],
+			xjData:[],
+			numList:[],
+		};
+	},
+	computed:{
+		...mapGetters(["getMyShopInfo","getLoginInfo"]),
+	},
+	onLoad() {
+
+		let history = uni.getStorageSync("xj"+this.option.customId)
+		if(!this.$util.isEmpty(history)){
+			history.forEach((item,index)=>{
+				this.numList[item.id] = item.num
+			})
+		}
+
+	},
+	onPullDownRefresh() {
+	},
+	onShow(){
+	},
+	methods: {
+		clearXj(){
+			uni.removeStorageSync("xj"+this.option.customId)
+			if(!this.$util.isEmpty(this.numList)){
+				console.log('this.numList',this.numList)
+				this.numList.forEach((item,index,arr)=>{
+					arr[index]=''
+				})
+				this.$forceUpdate();
+				console.log('this.numList',this.numList)
+			}
+
+			//返回上一页带参数
+			let pages = getCurrentPages();
+			let prevPage = pages[ pages.length - 2 ];
+			//修改上一页data里面的xjData
+			prevPage.$vm.xjData = {price:null,stock:0,hasUpdate:1}
+			uni.navigateBack({});
+
+		},
+		goBack(){
+			//返回上一页带参数
+			let pages = getCurrentPages();
+			let prevPage = pages[ pages.length - 2 ];
+			//修改上一页data里面的xjData
+			prevPage.$vm.xjData = {price:this.option.price,stock:0,hasUpdate:0}
+			uni.navigateBack({});
+		},
+		confirmXj(){
+
+			let arr = []
+			this.numList.forEach((num,id)=>{
+				if(!this.$util.isEmpty(num) && Number(num)>0){
+					arr.push({id:id,num:num})
+				}
+			})
+
+			if(this.$util.isMoney(this.option.price) == false){
+				this.$msg("请填写单价")
+				return false
+			}
+
+			let totalNum = 0
+			arr.forEach((item)=>{
+				totalNum = (Number(item.num) + Number(totalNum)).toFixed(0)
+			})
+			if(totalNum <= 0){
+				this.$msg("请填写数量")
+				return false
+			}
+
+			if(totalNum > Number(this.option.stock)){
+				this.$msg("数量不能超过总库存")
+				return false
+			}
+
+			uni.setStorageSync("xj"+this.option.customId, arr)
+
+			//返回上一页带参数
+			let pages = getCurrentPages();
+			let prevPage = pages[ pages.length - 2 ];
+			//修改上一页data里面的xjData
+			prevPage.$vm.xjData = {price:this.option.price,stock:totalNum,hasUpdate:1}
+			uni.navigateBack({});
+
+		},
+		init(){
+			getSjXj().then(res => {
+				this.xjList = res.data.list
+				console.log('list',this.xjList)
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.billing_box_bg {
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.input-wrap {
+		font-size:30rpx;
+		display: flex;
+		padding: 22px 20px 22px 30px;
+		.search-bar {
+			flex: 1;
+		}
+		.city-select {
+			display: flex;
+			flex-shrink: 0;
+			align-items: center;
+			margin-right: 15upx;
+			margin-left: 45px;
+			background-color: #ffff;
+			.iconfont {
+				margin-left: 20upx;
+				font-size: 30upx;
+			}
+		}
+	}
+	.scroll-middle_bx {
+		flex: 1;
+		display: flex;
+		width: 100%;
+		height: 100%;
+	}
+	.tab-view {
+		height: 100%;
+		width: 170upx;
+		flex-shrink: 0;
+		background-color: #f0f2f6;
+		.tab-bar-item {
+			position: relative;
+			width: 170upx;
+			height: 90upx;
+			box-sizing: border-box;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			font-size: 26upx;
+			color: #444;
+			font-weight: 400;
+			.tag {
+				display: flex;
+				padding: 0 20px;
+				align-items: center;
+				position: absolute;
+				right: 0;
+				top: 0;
+				height: 32px;
+				background: #ff2842;
+				border-radius: 16px;
+				color: #fff;
+				font-size: 20px;
+			}
+			&:last-child{
+				margin-bottom: 110upx;
+			}
+		}
+		.active {
+			position: relative;
+			color: $mainColor;
+			font-size: 26px;
+			background: #fff;
+		}
+		.active::before {
+			content: "";
+			position: absolute;
+			border-left: 8upx solid $mainColor;
+			height: 100%;
+			left: 0;
+		}
+	}
+	.right-box {
+		height: 100%;
+		flex: 1;
+		box-sizing: border-box;
+	}
+	.item_list_bx {
+		padding: 10px 40px;
+	}
+	.item_list_title {
+		margin-bottom: 20px;
+		font-size: 24px;
+		font-weight: 600;
+		color: #666666;
+	}
+	.select-cmd_bx {
+		& .kc {
+			color: #999999;
+			font-size: 28px;
+			font-weight: 400;
+			margin-bottom: 60px;
+			text-align: center;
+			margin-top: 10px;
+		}
+		& .num_bx {
+			display: flex;
+			align-items: center;
+			margin-bottom: 80px;
+			& > input {
+				width: 212px;
+				height: 80px;
+				border: 1px solid #dddddd;
+				border-radius: 4px;
+				text-align: center;
+				margin-right: 24px;
+			}
+		}
+	}
+}
+.item-cmd_bx {
+	position: relative;
+	margin-bottom: 20px;
+	.img_bx {
+		height: 160px;
+		width: 160px;
+		position: absolute;
+		left: 0px;
+		top: 0px;
+		image{
+			width: 100%;
+			height: 100%;
+		}
+	}
+	.cmd-info_bx {
+		position: relative;
+		padding-left: 177px;
+		&.active{
+			&:before{
+				content: ' ';
+				height: 22rpx;
+				width: 22rpx;
+				border-width: 2rpx 2rpx 0 0;
+				border-color: #b2b2b2;
+				border-style: solid;
+				-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				position: absolute;
+				top: 50%;
+				margin-top: -12rpx;
+				right: 30rpx;
+			}
+		}
+
+		& .tit {
+			font-size: 30px;
+			font-weight: 700;
+			color: #333333;
+		}
+		& .kc {
+			color: #999999;
+			font-size: 24px;
+			padding: 10px 0 24px;
+		}
+		& .num-open_bx {
+			display: flex;
+			align-items: center;
+			& .price {
+				font-size: 28px;
+				color: #999999;
+				flex: 1;
+			}
+			& .open-bx {
+				color: #333333;
+				text{
+					font-size: 24rpx;
+				}
+				*.warn {
+					color: $redColor;
+				}
+			}
+		}
+	}
+}
+.change-input {
+	width: 285px;
+	height: 60px;
+	line-height: 60px;
+	text-align: center;
+	background: #ffffff;
+	border: 1px solid #b4b4b4;
+	border-radius: 4px;
+	font-size: 25px;
+	color:#5e5d5d;
+	position: relative;
+	left:120rpx;
+	top:-36rpx;
+}
+</style>

+ 276 - 0
ghsApp/src/admin/item/xjSelect.vue

@@ -0,0 +1,276 @@
+<template>
+	<view class="billing_box_bg">
+		<view class="scroll-middle_bx">
+			<block>
+				<view class="item_list_bx"  style="width: 100%">
+					<view v-for="(xjItem,xjIndex) in xjList" :key="xjIndex">
+						<view>
+							<view class="item-cmd_bx">
+								<view class="img_bx" style="background:#eeeeee">
+									<image :src="xjItem.cover"></image>
+								</view>
+								<view class="cmd-info_bx">
+									<view class="tit">{{ xjItem.name || "" }}</view>
+									<view class="kc"></view>
+									<view class="num-open_bx">
+										<view class="open-bx warn">
+											<text v-if="xjItem.has == 0" style="color:#777777;">已停用</text>
+											<text v-else style="color:green;">已启用</text>
+<switch :checked="xjItem.has == 0 ? false : true" @change="changeFn($event,xjItem.id)" style="transform: scale(0.7,0.7)" />
+										</view>
+									</view>
+								</view>
+							</view>
+						</view>
+					</view>
+
+					<view>
+						<button class="admin-button-com big blue" @click="goBack()" style="margin:40rpx 0 20rpx 220rpx;padding:30rpx 80rpx 30rpx 80rpx;">返回</button>
+					</view>
+
+				</view>
+			</block>
+		</view>
+	</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { mapGetters } from "vuex";
+import { getFilterXj,ReplaceXj } from "@/api/product/xj"
+export default {
+	name: "xj",
+	components: {
+		AppWrapperEmpty,
+	},
+	mixins: [],
+	data() {
+		return {
+			xjNum:'',
+			xjList:[],
+			xjData:[],
+			numList:[],
+		};
+	},
+	computed:{
+		...mapGetters(["getMyShopInfo","getLoginInfo"]),
+	},
+	onLoad() {
+
+		let history = uni.getStorageSync("xj"+this.option.customId)
+		if(!this.$util.isEmpty(history)){
+			history.forEach((item,index)=>{
+				this.numList[item.id] = item.num
+			})
+		}
+
+	},
+	onPullDownRefresh() {
+	},
+	onShow(){
+	},
+	methods: {
+		changeFn(e,id){
+			let act = e.target.value == true ? 'add' : 'del'
+			let that = this
+			ReplaceXj({act,id}).then(res=>{
+				that.init()
+			})
+		},
+		goBack(){
+			uni.navigateBack({});
+		},
+		init(){
+			getFilterXj().then(res => {
+				this.xjList = res.data.list
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.billing_box_bg {
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.input-wrap {
+		font-size:30rpx;
+		display: flex;
+		padding: 22px 20px 22px 30px;
+		.search-bar {
+			flex: 1;
+		}
+		.city-select {
+			display: flex;
+			flex-shrink: 0;
+			align-items: center;
+			margin-right: 15upx;
+			margin-left: 45px;
+			background-color: #ffff;
+			.iconfont {
+				margin-left: 20upx;
+				font-size: 30upx;
+			}
+		}
+	}
+	.scroll-middle_bx {
+		flex: 1;
+		display: flex;
+		width: 100%;
+		height: 100%;
+	}
+	.tab-view {
+		height: 100%;
+		width: 170upx;
+		flex-shrink: 0;
+		background-color: #f0f2f6;
+		.tab-bar-item {
+			position: relative;
+			width: 170upx;
+			height: 90upx;
+			box-sizing: border-box;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			font-size: 26upx;
+			color: #444;
+			font-weight: 400;
+			.tag {
+				display: flex;
+				padding: 0 20px;
+				align-items: center;
+				position: absolute;
+				right: 0;
+				top: 0;
+				height: 32px;
+				background: #ff2842;
+				border-radius: 16px;
+				color: #fff;
+				font-size: 20px;
+			}
+			&:last-child{
+				margin-bottom: 110upx;
+			}
+		}
+		.active {
+			position: relative;
+			color: $mainColor;
+			font-size: 26px;
+			background: #fff;
+		}
+		.active::before {
+			content: "";
+			position: absolute;
+			border-left: 8upx solid $mainColor;
+			height: 100%;
+			left: 0;
+		}
+	}
+	.right-box {
+		height: 100%;
+		flex: 1;
+		box-sizing: border-box;
+	}
+	.item_list_bx {
+		padding: 10px 40px;
+	}
+	.item_list_title {
+		margin-bottom: 20px;
+		font-size: 24px;
+		font-weight: 600;
+		color: #666666;
+	}
+	.select-cmd_bx {
+		& .kc {
+			color: #999999;
+			font-size: 28px;
+			font-weight: 400;
+			margin-bottom: 60px;
+			text-align: center;
+			margin-top: 10px;
+		}
+		& .num_bx {
+			display: flex;
+			align-items: center;
+			margin-bottom: 80px;
+			& > input {
+				width: 212px;
+				height: 80px;
+				border: 1px solid #dddddd;
+				border-radius: 4px;
+				text-align: center;
+				margin-right: 24px;
+			}
+		}
+	}
+}
+.item-cmd_bx {
+	position: relative;
+	margin-bottom: 75px;
+	.img_bx {
+		height: 160px;
+		width: 160px;
+		position: absolute;
+		left: 0px;
+		top: 0px;
+		image{
+			width: 100%;
+			height: 100%;
+		}
+	}
+	.cmd-info_bx {
+		position: relative;
+		padding-left: 177px;
+		&.active{
+			&:before{
+				content: ' ';
+				height: 22rpx;
+				width: 22rpx;
+				border-width: 2rpx 2rpx 0 0;
+				border-color: #b2b2b2;
+				border-style: solid;
+				-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				position: absolute;
+				top: 50%;
+				margin-top: -12rpx;
+				right: 30rpx;
+			}
+		}
+
+		& .tit {
+			font-size: 30px;
+			font-weight: 700;
+			color: #333333;
+		}
+		& .kc {
+			color: #999999;
+			font-size: 24px;
+			padding: 10px 0 24px;
+		}
+		& .num-open_bx {
+			display: flex;
+			align-items: center;
+			& .price {
+				font-size: 28px;
+				color: #999999;
+				flex: 1;
+			}
+			& .open-bx {
+				color: #333333;
+				text{
+					font-size: 24rpx;
+				}
+				*.warn {
+					color: $redColor;
+				}
+				switch{
+					position: absolute;
+					right:50rpx;
+					top:105rpx;
+				}
+			}
+		}
+	}
+}
+</style>

+ 19 - 0
ghsApp/src/api/product/xj.js

@@ -0,0 +1,19 @@
+import https from "@/plugins/luch-request_0.0.7/request";
+
+//获取商家小菊
+export const getSjXj = data => {
+	return https.get("/xj/get-sj-xj", data);
+};
+
+//获取所有小菊
+export const getAllXj = data => {
+	return https.get("/xj/get-all-xj", data);
+};
+
+export const getFilterXj = data => {
+	return https.get("/xj/get-filter-xj", data);
+};
+
+export const ReplaceXj = data => {
+	return https.get("/shop-ext/replace-xj", data);
+};

+ 51 - 66
ghsApp/src/components/module/app-commodity.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="item-cmd_bx" @click="customNum">
+	<view class="item-cmd_bx" @click="customNum(info.variety)">
 		<view class="img_bx" style="background:#eeeeee">
 			<image :src="info.cover" v-if="isImg"></image>
 		</view>
@@ -10,13 +10,13 @@
 				<view class="price csss" v-else>¥{{ info.price }}</view>
 				<view style="text-align: right" >
 					<view class="open-bx" >
-						<i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delEvent" v-if="bigCount > 0 || smallCount > 0"></i>
+						<i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delEvent(info.variety)" v-if="bigCount > 0 || smallCount > 0"></i>
 						<text class="num" >
 							<text v-if="bigCount > 0 || smallCount > 0">{{ `${bigCount}` }}</text>
 							<text v-if="smallCount > 0">/</text>
 							<text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
 						</text>
-						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addEvents"></i>
+						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addEvents(info.variety)"></i>
 					</view>
 					<text v-if="Number(info.stock) > Number(info.stockWarning)" style="padding-right: 55rpx">还剩 {{ info.stock }}</text>
 					<text v-else style="padding-right: 55rpx;color:red;font-weight:450;">还剩 {{ info.stock }}</text>
@@ -99,13 +99,10 @@ export default {
 	data() {
 		return {
 			COMMODITY_TYPE,
-			// isAllActive: false,
-			// isAllFocus: false,
 			isImg:false,
 			isAlterMoney:false,
 			isAloneAllActive: false,
 			isAloneAllFocus: false,
-
 			isShowSucceed:false,
 			changeAutoPrice:'',
 			showPrice:0.00,
@@ -134,12 +131,9 @@ export default {
 		moveAllInput(e){
 			this.isAloneAllActive=false;
 			this.isAloneAllFocus=false;
-			// if(e==''){return}
-			console.log(e);
 			this.changeAutoPrice = e?e:0;
 			if(this.isAlterMoney){
 				this.isAlterMoney = false;
-				// let self = this
 				changePriceByIdApi({
 					productId: this.info.id,
 					price: this.changeAutoPrice
@@ -156,34 +150,34 @@ export default {
 				})
 			}
 		},
-		addEvents() {
-			const ratio = Number(this.info.ratio);
-			if(this.offVerifyRepertory){
-				if(this.info.stock<=0){
-					this.$msg("库存不足");
-					return
-				}
-				if (Number(this.bigCount) * ratio + Number(this.smallCount) >Number(this.info.bigNum) * ratio + Number(this.info.smallNum)) {
-					this.$msg("库存不足");
-					return
+		addEvents(variety) {
+			if(variety == 0){
+				const ratio = Number(this.info.ratio);
+				if(this.offVerifyRepertory){
+					if(this.info.stock<=0){
+						this.$msg("库存不足");
+						return
+					}
+					if (Number(this.bigCount) * ratio + Number(this.smallCount) >Number(this.info.bigNum) * ratio + Number(this.info.smallNum)) {
+						this.$msg("库存不足");
+						return
+					}
 				}
+				this.animationFun('add');
+				this.$emit("add", this.info);
+			}else{
+				this.customNum(variety)
 			}
-
-			this.animationFun('add');
-			// let params = {
-			// 	...this.info,
-			// 	bigCount: this.bigCount,
-			// 	smallCount: this.smallCount
-			// };
-			// this.$emit("add", this.info,params);
-			this.$emit("add", this.info);
 		},
-		delEvent() {
-			this.animationFun('del');
-			this.$emit("del", this.info);
+		delEvent(variety) {
+			if(variety == 0){
+				this.animationFun('del');
+				this.$emit("del", this.info);				
+			}else{
+				this.customNum(variety)
+			}
 		},
 		changePriceEvent(event) {
-			// console.log('改价',this.changeAutoPrice)
 			changePriceByIdApi({
 				productId: this.info.id,
 				price: this.showPrice
@@ -198,45 +192,36 @@ export default {
 					this.$msg(res.msg)
 				}
 			})
-			// this.isFocus = false;
-			// this.isAloneAllFocus = false;
 			this.isAlterMoney = true;
-
-			// if(uni.getSystemInfoSync().platform=='android'){return};
-			// this.$nextTick(()=>{
-			// 	this.moveAllInput(this.changeAutoPrice);
-			// })
-
-
 		},
-		customNum() {
-			if(this.offVerifyRepertory){
-				if(this.info.stock<=0){
-					uni.showToast({title:'库存不足',icon:'none'})
-					return;
+		customNum(variety) {
+			if(variety == 0){
+				if(this.offVerifyRepertory){
+					if(this.info.stock<=0){
+						uni.showToast({title:'库存不足',icon:'none'})
+						return;
+					}
+				}
+				if(!this.bigCount && !this.smallCount){
+					let params = {
+						...this.info,
+						bigCount: this.bigCount,
+						smallCount: this.smallCount,
+						userPrice: this.userPrice,
+					};
+					this.$emit("addOneEvent", this.info,params);
+				}else{
+					this.$emit("customNum", {
+						...this.info,
+						bigCount: this.bigCount,
+						smallCount: this.smallCount,
+						userPrice: this.userPrice,
+					});
 				}
-			}
-
-			if(!this.bigCount && !this.smallCount){
-				
-				let params = {
-					...this.info,
-					bigCount: this.bigCount,
-					smallCount: this.smallCount,
-					userPrice: this.userPrice,
-				};
-
-				this.$emit("addOneEvent", this.info,params);
 			}else{
-				this.$emit("customNum", {
-					...this.info,
-					bigCount: this.bigCount,
-					smallCount: this.smallCount,
-					userPrice: this.userPrice,
-				});
+				//去特殊品种页
+				this.$emit("goToSpecialVariety", this.info);
 			}
-			
-
 		}
 	}
 };

+ 5 - 5
ghsApp/src/mixins/product.js

@@ -114,6 +114,7 @@ export default {
 		if (this.autoLoad) {
 			this.initData();
 		}
+		//修改花材
 		if(this.option.modifyProductKey){
 			if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
 				//this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
@@ -174,11 +175,10 @@ export default {
 						});
 				});
 				this.productInfo = data;
-
+				//修改花材
 				if(this.option.modifyProductKey){
 					if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
 						let currentInfo = uni.getStorageSync('selectList'+this.option.modifyProductKey)
-						console.log('ccccc',currentInfo)
 						if(!this.$util.isEmpty(currentInfo)){
 
 							currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
@@ -189,7 +189,7 @@ export default {
 									let bPrice = currentItem.bigCount * Number(directList[currentId].bigPrice)
 									let sPrice = currentItem.smallCount * Number(directList[currentId].smallPrice)
 									let currentUserPrice =  (bPrice+sPrice).toFixed(2)
-									currentArray[currentIndex].userPrice = currentUserPrice
+									//currentArray[currentIndex].userPrice = currentUserPrice
 								}
 							})
 
@@ -209,7 +209,7 @@ export default {
 									let bPrice = currentItem.bigCount * Number(directList[currentId].bigPrice)
 									let sPrice = currentItem.smallCount * Number(directList[currentId].smallPrice)
 									let currentUserPrice =  (bPrice+sPrice).toFixed(2)
-									currentArray[currentIndex].userPrice = currentUserPrice
+									//currentArray[currentIndex].userPrice = currentUserPrice
 								}
 							})
 							this.setSelectInfoByType({ type: this.pageType, info: currentInfo })
@@ -537,7 +537,7 @@ export default {
 					break;
 				}
 			}
-
+			console.log('更新1',list)
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 
 			//记忆已经选择的花材

+ 12 - 0
ghsApp/src/pages.json

@@ -534,6 +534,18 @@
 					"style": {
 						"navigationBarTitleText": "花材详情"
 					}
+				},
+				{
+					"path": "xj",
+					"style": {
+						"navigationBarTitleText": "请选择颜色"
+					}
+				},
+				{
+					"path": "xjSelect",
+					"style": {
+						"navigationBarTitleText": "小菊颜色"
+					}
 				}
 			]
 		},

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

@@ -315,5 +315,6 @@ export default {
 	numberFormat,
 	isString,
 	unique,
-	isMoney
+	isMoney,
+	isNumber
 };