lhl 1 gadu atpakaļ
vecāks
revīzija
c692b0da4a

+ 2 - 1
package.json

@@ -5,7 +5,8 @@
   "scripts": {
     "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --open  --mode=dev ",
     "dev": "vue-cli-service serve --open  --mode=dev",
-    "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode=production"
+    "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode=production",
+	"builds": "vue-cli-service build --mode=production"
   },
   "dependencies": {
     "@babel/polyfill": "^7.12.1",

+ 15 - 1
src/pages/marketing/serveItem/create.vue

@@ -29,6 +29,18 @@
 				<FormItem label="价格" v-if="formData.price">
 					<Input  v-model="formData.price" v-width="320" disabled ></Input>
 				</FormItem>
+				<FormItem label="前端显示:">
+				  <RadioGroup v-model="formData.is_display" >
+				    <Radio :label="1">
+				      <Icon type="social-apple"></Icon>
+				      <span>显示</span>
+				    </Radio>
+				    <Radio :label="0">
+				      <Icon type="social-android"></Icon>
+				      <span>隐藏</span>
+				    </Radio>
+				  </RadioGroup>
+				</FormItem>
 				<!-- <FormItem label="库存" v-if="formData.repertory">
 					<Input  v-model="formData.repertory" v-width="320" disabled></Input>
 				</FormItem>
@@ -100,7 +112,8 @@
 					explain: '',
 					unit_name: '',
 					image: '',
-					images: ''
+					images: '',
+					is_display: 1
 				},
 				isMinPrice: 0,
 				isCouponTime: 1,
@@ -126,6 +139,7 @@
 				this.formData.craft_price = query.craft_price;
 				this.formData.sales_commissions = query.sales_commissions
 				this.formData.superior_commission = query.superior_commission
+				this.formData.is_display = query.is_display*1
 			}
 		},
 		methods: {

+ 35 - 10
src/pages/marketing/serveItem/index.vue

@@ -3,7 +3,7 @@
 		<Card :bordered="false" dis-hover class="mt15 ivu-mt" :padding="0">
 			<div class="new_card_pd">
 				<!-- 查询条件 -->
-				
+
 				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
 					:label-position="labelPosition" @submit.native.prevent>
 					<!-- <FormItem label="是否删除:" label-for="is_show">
@@ -41,10 +41,10 @@
 					<span
 						v-if="row.coupon_type==2">{{parseFloat(row.coupon_price)/10}}折({{row.coupon_price.toString().split(".")[0]}}%)</span>
 				</template>
-				<template slot-scope="{ row, index }" slot="status">
+				<!-- <template slot-scope="{ row, index }" slot="status">
 					<Icon type="md-checkmark" v-if="row.status === 1" color="#0092DC" size="14" />
 					<Icon type="md-close" v-else color="#ed5565" size="14" />
-				</template>
+				</template> -->
 				<template slot-scope="{ row, index }" slot="is_show">
 					<span> {{row.is_show == 1 ?'显示': '隐藏'}}</span>
 				</template>
@@ -54,6 +54,13 @@
 				<template slot-scope="{ row, index }" slot="add_time">
 					<span> {{row.add_time }}</span>
 				</template>
+				<template slot-scope="{ row, index }" slot="status">
+					<i-switch v-model="row.is_display" :value="row.is_display" :true-value="1" :false-value="0"
+						@on-change="changeSwitch(row)" size="large">
+						<span slot="open">显示</span>
+						<span slot="close">隐藏</span>
+					</i-switch>
+				</template>
 				<template slot-scope="{ row, index }" slot="action">
 					<!-- <a @click="bind(row)">绑定项目</a>
 					<Divider type="vertical" /> -->
@@ -82,7 +89,8 @@
 		ServeItemListApi,
 		VipDeleteApi,
 		serveEditApi,
-		serveDelApi
+		serveDelApi,
+		createServeProduct
 	} from '@/api/marketing';
 	import editFrom from '@/components/from/from';
 	import {
@@ -148,11 +156,11 @@
 						key: 'repertory',
 						minWidth: 100
 					},
-					// {
-					// 	title: '添加时间',
-					// 	slot: 'add_time',
-					// 	minWidth: 100
-					// },
+					{
+						title: '前端显示',
+						slot: 'status',
+						minWidth: 100
+					},
 					{
 						title: '操作',
 						slot: 'action',
@@ -188,6 +196,17 @@
 			}
 		},
 		methods: {
+			changeSwitch(row) {
+				//
+				console.log(row)
+				createServeProduct(row.id, row)
+					.then((res) => {
+						this.$Message.success(res.msg);
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
 			//绑定项目
 			bind(row) {
 				this.$router.push({
@@ -212,7 +231,13 @@
 			},
 			// 发布
 			couponSend(row) {
-				this.$router.push({path: this.roterPre + "/marketing/serve_item/create?id=" + row.id + '&craft_price=' + row.craft_price + '&performance_value=' + row.performance_value + '&product_id=' + row.product_id + '&repertory=' + row.repertory + '&sales_commissions=' + row.sales_commissions + '&slider_image=' + row.slider_image + '&store_name=' + row.store_name + '&superior_commission=' + row.superior_commission});
+				this.$router.push({
+					path: this.roterPre + "/marketing/serve_item/create?id=" + row.id + '&craft_price=' + row
+						.craft_price + '&performance_value=' + row.performance_value + '&product_id=' + row
+						.product_id + '&repertory=' + row.repertory + '&sales_commissions=' + row
+						.sales_commissions + '&slider_image=' + row.slider_image + '&store_name=' + row
+						.store_name + '&superior_commission=' + row.superior_commission + '&is_display=' + row.is_display
+				});
 				console.log(row);
 			},
 			// 删除