shish 3 лет назад
Родитель
Сommit
30649b4798

+ 32 - 2
ghsApp/src/admin/changePrice/components/Item.vue

@@ -9,7 +9,9 @@
 		</view>
 		<view class="cmd-info_bx" @click="pageTo({url: '/admin/item/detail',query: {id: info.id}})">
 			<view class="tit">{{ info.itemName || "" }}</view>
+			<text v-if="info.variety && info.variety ==1" class="show-color"></text>
 			<view class="kc">¥{{ parseFloat(info.price) }}</view>
+			<text v-if="info.presell && info.presell ==1" class="presell-color">预售</text>
 			<view class="num-open_bx">
 				<view>
 					<view class="open-bx" >
@@ -152,7 +154,35 @@ export default {
 			overflow: hidden;
 			white-space: nowrap;
 			text-overflow: ellipsis;
-			width:200upx;
+			width:248upx;
+		}
+		.show-color{
+			position:absolute;
+			top:4upx;
+			right:14upx;
+			display:inline-block;
+			width:25upx;
+			height:25upx;
+			background-color:rgb(9, 199, 9);
+			border-radius:15upx;
+			border:none;
+			margin-left:8upx;
+		}
+		.presell-color{
+			position:absolute;
+			top:-2upx;
+			right:45upx;
+			display:inline-block;
+			width:70upx;
+			height:35upx;
+			line-height:35upx;
+			background-color:#3385FF;
+			border-radius:15upx;
+			border:none;
+			font-size:20upx;
+			color:white;
+			margin-left:8upx;
+			text-align:center;
 		}
 		& .kc {
 			color:red;
@@ -180,7 +210,7 @@ export default {
 				.hd-price-area{
 					width:190upx;
 					position: absolute;
-					top:30upx;
+					top:37upx;
 					right:-10upx;
 					.change-input {
 						width: 150upx;

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

@@ -55,7 +55,7 @@ export default {
                     title:'订单与销售',
                     list:[
                         {name: "预售",img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`,url: "/admin/order/statBook"},
-                        {name: "预售设置",img: `${this.$constant.imgUrl}/ghs/home/shop.png`,url: "/admin/order/bookSet"},
+                        {name: "预订开关",img: `${this.$constant.imgUrl}/ghs/home/shop.png`,url: "/admin/order/bookSet"},
                     ]
                 },
                 {

+ 32 - 14
ghsApp/src/admin/item/components/ItemStock.vue

@@ -8,10 +8,9 @@
 			<image :src="info.cover" style="width:160upx;height:160upx;" lazy-load="true" :lazy-load-margin="0"></image>
 		</view>
 		<view class="cmd-info_bx active" @click="pageTo({url: '/admin/item/detail',query: {id: info.id}})">
-			<view class="tit">{{ info.itemName || "" }}
-				<text v-if="info.variety && info.variety ==1" class="show-color">
-				</text>
-			</view>
+			<view class="tit">{{ info.itemName || "" }}</view>
+			<text v-if="info.variety && info.variety ==1" class="show-color"></text>
+			<text v-if="info.presell && info.presell ==1" class="presell-color">预售</text>
 			<view class="kc">¥{{ parseFloat(info.price) }} 
 				<text style="margin-left:25upx;color:#555555;font-weight:normal;">¥{{ parseFloat(info.skPrice) }}</text>
 				<text style="margin-left:32upx;color:#999;font-size:23upx;font-weight:normal;">成本 ¥{{ info.cost?parseFloat(info.cost):0 }}</text>
@@ -140,16 +139,35 @@ export default {
 			overflow: hidden;
 			white-space: nowrap;
 			text-overflow: ellipsis;
-			width:350upx;
-			.show-color{
-				display:inline-block;
-				width:25upx;
-				height:25upx;
-				background-color:rgb(9, 199, 9);
-				border-radius:15upx;
-				border:none;
-				margin-left:8upx;
-			}
+			width:248upx;
+		}
+		.show-color{
+			position:absolute;
+			top:6upx;
+			right:14upx;
+			display:inline-block;
+			width:25upx;
+			height:25upx;
+			background-color:rgb(9, 199, 9);
+			border-radius:15upx;
+			border:none;
+			margin-left:8upx;
+		}
+		.presell-color{
+			position:absolute;
+			top:0upx;
+			right:45upx;
+			display:inline-block;
+			width:70upx;
+			height:35upx;
+			line-height:35upx;
+			background-color:#3385FF;
+			border-radius:15upx;
+			border:none;
+			font-size:20upx;
+			color:white;
+			margin-left:8upx;
+			text-align:center;
 		}
 		& .kc {
 			color: red;

+ 2 - 8
ghsApp/src/admin/item/list.vue

@@ -199,7 +199,7 @@ export default {
 		},
 		moreToDo(item){
 			let that=this;
-			let doList = ['成本变动记录','价格变动记录','复制花材','颜色管理', '下单记录','下架']
+			let doList = ['成本变动记录','价格变动记录','复制花材','颜色管理', '下单记录','预售管理']
 			uni.showActionSheet({
 				itemList: doList,
 				success: function (respond) {
@@ -219,13 +219,7 @@ export default {
 					} else if (index == 4) {
 						that.pageTo({url: "/admin/order/itemOrder?productId="+item.id})
 					} else if (index == 5) {
-						that.$util.confirmModal({content:'确认下架?'},() => {
-							statusUpdate({id:item.id,status:2}).then(res=>{
-								if(res.code == 1){
-									that.$msg('操作成功')
-								}
-							})
-						})			
+						that.pageTo({url: "/admin/item/presell?id="+item.id})
 					}else{
 
 					}

+ 162 - 0
ghsApp/src/admin/item/presell.vue

@@ -0,0 +1,162 @@
+<template>
+  <view class="app-content">
+      <form @submit="submitPresell">
+        <div class="module-com input-line-wrap">
+          <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">预售状态</div>
+            <view>
+				<switch style="transform:scale(0.7,0.7)" :checked="form.presell == 0 ? false : true" @change="presellChangeFn" />
+				<text v-if="form.presell == 0">关闭</text><text v-else>开启</text>
+			</view>
+          </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title">日期1</div>
+              <input v-model="form.date1" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" @click="showDatePicker(1)" name="name" placeholder="请填写日期" />
+          </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title">日期2</div>
+              <input v-model="form.date2" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" @click="showDatePicker(2)" name="name" placeholder="请填写日期" />
+          </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title">日期3</div>
+              <input v-model="form.date3" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" @click="showDatePicker(3)" name="name" placeholder="请填写日期" />
+          </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title">日期4</div>
+              <input v-model="form.date4" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" @click="showDatePicker(4)" name="name" placeholder="请填写日期" />
+          </tui-list-cell>
+        </div>
+        <div class="confirm-btn">
+          <button class="admin-button-com big blue" formType="submit">添加</button>
+        </div>
+      </form>
+	  <mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="cancelPicker" />
+  </view>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import AppAvatarModule from "@/components/module/app-avatar";
+import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
+import { getProductDetail,changePresell } from "@/api/product";
+export default {
+  name: "presell",
+  components: {
+    TuiListCell,
+    AppAvatarModule,
+	MxDatePicker
+  },
+  data() {
+    return {
+		showPicker:false,
+		form:{
+			date1:'',date2:'',date3:'',date4:'',presell:0
+		},
+		index:1
+    }
+  },
+  onLoad(){
+	let that = this
+	return getProductDetail({ id: this.option.id }).then(res => {
+		if(res.code == 1){
+			that.form.presell = res.data.presell
+			if(res.data.presellDateList && !this.$util.isEmpty(res.data.presellDateList)) {
+				res.data.presellDateList.forEach((item,idx) => {
+					if(idx == 0){
+						that.form.date1 = item
+					}else if(idx == 1){
+						that.form.date2 = item
+					}else if(idx == 2){
+						that.form.date3 = item
+					}else if(idx == 3){
+						that.form.date4 = item
+					}else{
+
+					}
+				})
+			}
+		}
+	})
+  },
+  methods: {
+	showDatePicker(index){
+		this.showPicker = true
+		this.index = index
+	},
+	cancelPicker(){
+		this.showPicker = false;
+	},
+	confirmPicker(e) {
+		this.showPicker = false
+		if(this.index == 1){
+			this.form.date1 = e.value
+		}else if(this.index ==2){
+			this.form.date2 = e.value
+		}else if(this.index == 3){
+			this.form.date3 = e.value
+		}else if(this.index == 4){
+			this.form.date4 = e.value
+		}else{
+			this.$msg('暂无选项')
+		}
+	},
+	submitPresell(){
+		let arr = []
+		if(!this.$util.isEmpty(this.form.date1)){
+			arr.push(this.form.date1)
+		}
+		if(!this.$util.isEmpty(this.form.date2)){
+			arr.push(this.form.date2)
+		}
+		if(!this.$util.isEmpty(this.form.date3)){
+			arr.push(this.form.date3)
+		}
+		if(!this.$util.isEmpty(this.form.date4)){
+			arr.push(this.form.date4)
+		}
+		if(this.$util.isEmpty(arr)){
+			this.$msg('请填写日期')
+			return false
+		}
+		changePresell({date:JSON.stringify(arr),presell:this.form.presell,id:this.option.id}).then(res=>{
+
+		})
+	},
+	presellChangeFn(e){
+      this.form.presell = e.detail.value ? 1 : 0
+	}
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20upx);
+  padding-top: 20upx;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30upx;
+  margin-bottom: 30upx;
+}
+.module-com {
+  margin-bottom: 20upx;
+  .member-wrap {
+    .member-det {
+      font-size: 24upx;
+      margin-left: 20upx;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240upx;
+    }
+  }
+}
+.confirm-btn {
+  width: calc(100% - 60upx);
+  margin: 60upx 30upx 20upx;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

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

@@ -88,7 +88,7 @@
 				</tui-list-cell>
 
 				<tui-list-cell class="line-cell" :hover="false">
-					<view class="tui-title">预售</view>
+					<view class="tui-title">客户预订</view>
 					<view>
 						<switch style="transform:scale(0.7,0.7)" :checked="form.presell == 0 ? false : true" @change="presellChange" /> {{form.presell==0 ? '关闭' : '开启'}}
 					</view>

+ 4 - 0
ghsApp/src/api/product/index.js

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const changePresell = data => {
+	return https.post("/product/change-presell", data);
+};
+
 export const cancelDiscountPrice = data => {
 	return https.get("/product/cancel-discount", data);
 };

+ 2 - 1
ghsApp/src/pages.json

@@ -358,6 +358,7 @@
 				{"path": "copy","style": {"navigationBarTitleText": "复制花材"}},
 				{"path": "xj","style": {"navigationBarTitleText": "请选择颜色"}},
 				{"path": "xjSelect","style": {"navigationBarTitleText": "颜色管理"}},
+				{"path": "presell","style": {"navigationBarTitleText": "预售管理"}},
 				{"path": "rechargeHb","style": {"navigationBarTitleText": "充值活动"}}
 			]
 		},
@@ -383,7 +384,7 @@
 			"root": "admin/order",
 			"pages": [
 				{"path": "itemOrder","style": {"navigationBarTitleText": "订单列表"}},
-				{"path": "bookSet","style": {"navigationBarTitleText": "预售设置"}},
+				{"path": "bookSet","style": {"navigationBarTitleText": "预订开关"}},
 				{"path": "statBook","style": {"navigationBarTitleText": "预售"}},
 				{"path": "statKhBook","style": {"navigationBarTitleText": "详情"}}
 			]

+ 4 - 8
hdApp/src/pagesPurchase/bookProduct.vue

@@ -5,16 +5,12 @@
       <view class="header_inside">
         <image :src="ghsInfo.avatar"></image>
         <view class="shop_info">
-
 			<view class="shop_title" @click="pageTo({url:'/pagesPurchase/level?id='+ghsInfo.id})">
 				{{ghsInfo.name}}
 			</view>
-
 			<view class="shop_intro">
-				<text>欠款 {{parseFloat(ghsInfo.debtAmount) || '0'}}</text>
-				<text @click="pageTo('/pagesPurchase/bookExplain?id='+ghsInfo.id)" style="margin-left:26upx;font-weight:bold;text-decoration:underline;color:red;">预售说明</text>
+				<text @click="pageTo('/pagesPurchase/bookExplain?id='+ghsInfo.id)" style="margin-left:5upx;font-weight:bold;text-decoration:underline;color:red;">预订说明</text>
 			</view>
-
         </view>
 		<i class="iconfont icondianhua1" style="font-size:50upx;color:#6da3f5;position:absolute;top:45upx;" v-if="ghsInfo.mobile !=''" @tap="toPhone(ghsInfo.mobile)"></i>
       </view>
@@ -670,7 +666,7 @@ export default {
         margin-left: 30upx;
         &>.shop_title{
           margin-top: 14upx;
-          font-size: 34upx;
+          font-size: 38upx;
           font-weight: 600;
           color: #060606;
 		  width: 500upx;
@@ -699,8 +695,8 @@ export default {
         }
         &>.shop_intro{
           margin-top:25upx;
-          font-size:26upx;
-          font-weight: 400;
+          font-size:28upx;
+          font-weight:bold;
           color: #666666;
         }
       }

+ 6 - 1
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -22,7 +22,8 @@
 				<app-search-module v-model="py" placeholder="拼音首字母也可以搜索" @input="searchFn" />
 			</view>
 			<view style="padding:0 0upx 0 20upx;" >
-				<button class="admin-button-com middle blue" @click="delMemory()">清空已选</button>
+				<button v-if="ghsInfo.presell && ghsInfo.presell == 1" class="admin-button-com middle blue" style="background-color:green;border:1upx solid green;" @click="aheadCg(ghsInfo)">提前订花</button>
+				<button v-else class="admin-button-com middle blue" @click="delMemory()">清空已选</button>
 			</view>
 		</view>
 
@@ -366,6 +367,10 @@ export default {
 		selectFlowerNumFn(){
 			this.$refs.selectFlowerNumRef.open('top')
 		},
+		aheadCg(item){
+			const { id } = item
+			this.pageTo({url: '/pagesPurchase/bookProduct?id='+id})
+		},
 		delMemory(){
 			this.cartItemShow = false
 			this.removeMemory(this.option.id)